:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1b2330; --muted: #677284; --line: #e1e5eb;
  --brand: #1f6feb; --brand-ink: #ffffff; --ok: #1a7f37; --warn: #9a6700; --bad: #c62828;
  --pill-trial: #fff4d6; --pill-active: #dcf5e3; --pill-frozen: #fde2e2;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --panel: #1a2029; --ink: #e6e9ee; --muted: #9aa4b2; --line: #2b3340;
          --brand: #4c8dff; --pill-trial: #4a3b12; --pill-active: #163b23; --pill-frozen: #4a1c1c; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 24px; height: 70px; }
.logo { display: flex; align-items: center; }
.logo img { display: block; height: 54px; width: auto; }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 18px; flex: 1; }
.langs a { margin-inline-start: 8px; color: var(--muted); font-weight: 600; }
.langs a.on { color: var(--brand); }
main { padding-block: 24px 48px; }
h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { margin: 24px 0 8px; }
details.grp { border-bottom: 1px solid var(--line); }
details.grp > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.grp[open] > summary::before { transform: rotate(90deg); }
[dir="rtl"] details.grp > summary::before { content: '◂'; }
[dir="rtl"] details.grp[open] > summary::before { transform: rotate(-90deg); }
details.grp > summary h3 { margin: 14px 0; }
details.grp > table.list { margin-bottom: 14px; }
.grp-all { font-size: 14px; }
h4 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
small, .note { color: var(--muted); }
.hero { padding: 24px 0 8px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; color: var(--ink); }
.card:hover { border-color: var(--brand); text-decoration: none; }
.card span { color: var(--muted); font-size: 13px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; min-width: 0; }
.narrow { max-width: 380px; margin: 40px auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .bar { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 10px 18px; } }
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: start; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.list tr.off td { opacity: .5; }
.num { font-variant-numeric: tabular-nums; color: var(--muted); width: 1%; white-space: nowrap; }
label { display: block; margin-bottom: 10px; font-size: 14px; }
label.inline { display: flex; gap: 8px; align-items: center; max-width: 420px; }
label.chk { display: flex; gap: 8px; align-items: center; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; }
input[type=checkbox] { width: auto; }
label > input, label > select, label > textarea { margin-top: 4px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-width: 760px; }
.form .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
button, .btn { display: inline-block; font: inherit; font-weight: 600; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
button.big, .btn.big { padding: 11px 20px; font-size: 16px; }
.tiny { padding: 3px 8px; font-size: 12px; }
.danger { background: var(--bad); }
.err { color: var(--bad); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.pill.trial { background: var(--pill-trial); } .pill.active { background: var(--pill-active); } .pill.frozen { background: var(--pill-frozen); }
.epgs td.links input { font-size: 12px; direction: ltr; }
.act { min-width: 300px; }
.act .actrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.act form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.act input { width: auto; margin: 0; padding: 3px 6px; font-size: 12px; height: 26px; }
.act input[type=number] { width: 64px; }
.act .btn.tiny, .act button.tiny { height: 26px; line-height: 20px; white-space: nowrap; }
button.ghost, .btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
details.tree { border-top: 1px solid var(--line); padding: 8px 0; }
details.tree > summary { cursor: pointer; list-style-position: inside; }
details.tree .note { font-size: 13px; margin-inline-start: 8px; }
details.tree.sub { margin-inline-start: 18px; padding: 6px 0; }
details.tree.sub table { margin-top: 6px; }
.row { display: flex; gap: 8px; margin-bottom: 8px; }
.picker { max-height: 520px; overflow: auto; border-top: 1px solid var(--line); }
.picker label.ch { margin: 0; padding: 3px 4px; display: flex; gap: 6px; align-items: baseline; }
.picker label.ch:hover { background: var(--bg); }
.selwrap { max-height: 600px; overflow: auto; }
.sel select { width: 90px; } .sel input { width: 120px; }
.nowrap { white-space: nowrap; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 20px; align-items: end; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.picker label.ch .num { width: auto; min-width: 3.4em; display: inline-block; }
.sel td { vertical-align: middle; }
.sel td.num { width: 1%; min-width: 3.4em; white-space: nowrap; }
.sel td small { display: block; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 99px; background: var(--pill-trial); color: var(--ink); margin-inline-start: 4px; }
.tag.off { background: var(--pill-frozen); }
small.warn { color: var(--warn); }
h4.grp { cursor: pointer; user-select: none; margin: 6px 0; padding: 6px 4px; border-radius: 6px; }
h4.grp:hover { background: var(--bg); }
h4.grp .arrow { display: inline-block; width: 1em; color: var(--muted); }
h4.grp .note { font-weight: 400; }

/* home: guide channels by region (fold open / closed) */
.region { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.region-h { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.region-h::-webkit-details-marker { display: none; }
.region-t { font-weight: 700; font-size: 16px; display: flex; align-items: baseline; gap: 10px; }
.region-t::after { content: "▾"; margin-inline-start: auto; color: var(--muted); transition: transform .15s; }
.region[open] .region-t::after { transform: rotate(180deg); }
.region-t small { font-weight: 400; font-size: 13px; }
.region-c { color: var(--muted); font-size: 13px; }
.region[open] .region-c { display: none; }
.region .grid { padding: 0 16px 16px; }
.region .card { background: var(--bg); }
.region-h:hover .region-t { color: var(--brand); }

/* footer */
.foot { background: var(--panel); border-top: 1px solid var(--line); margin-top: 24px; color: var(--muted); font-size: 14px; }
.foot-cols { display: grid; grid-template-columns: 1.6fr 1.6fr 1fr 1fr; gap: 24px; padding-block: 28px 18px; }
.foot h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 4px 0; }
.foot ul.cols2 { columns: 2; column-gap: 24px; }
.foot-regions { width: fit-content; }
.foot-regions h4 { justify-content: center; }
.foot ul.cols2 li { break-inside: avoid; margin: 0 0 8px; }
.foot a { color: var(--muted); }
.foot a:hover, .foot a.on { color: var(--brand); }
.foot-brand .logo img { height: 40px; }
.foot-brand p { margin: 8px 0 0; max-width: 300px; }
.foot-bottom { border-top: 1px solid var(--line); padding-block: 12px; font-size: 13px; }
@media (max-width: 760px) { .foot-cols { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

@media (max-width: 520px) { .region .grid { grid-template-columns: 1fr 1fr; gap: 8px; } .region .card { padding: 12px; } }
/* footer always at the bottom of the window, also on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }

/* error pages: a TV with white noise and the error code */
.errpage { max-width: 520px; margin: 32px auto 48px; text-align: center; }
.errpage h1 { margin: 22px 0 6px; font-size: 26px; }
.errpage p { color: var(--muted); margin: 0 0 22px; }
.tv { width: min(340px, 100%); margin: 0 auto; }
.tv-ant { display: block; width: 34%; margin: 0 auto -2px; }
.tv-ant line { stroke: #4a5361; stroke-width: 3; stroke-linecap: round; }
.tv-ant circle, .tv-ant rect { fill: #4a5361; }
.tv-body { display: flex; gap: 12px; padding: 14px; background: linear-gradient(#3a414c, #2a3038); border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08); }
.tv-screen { position: relative; flex: 1; aspect-ratio: 4 / 3; border-radius: 14px / 18px; overflow: hidden; background: #777;
  box-shadow: inset 0 0 0 3px #1b1f25, inset 0 0 24px rgba(0,0,0,.6); }
.tv-screen canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; filter: contrast(1.1); }
.tv-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.18) 2px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45));
  box-shadow: inset 0 0 0 3px #1b1f25; }
.tv-code { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;
  font: 800 clamp(48px, 16vw, 84px)/1 system-ui, sans-serif; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 2px #000, 3px 0 0 rgba(255,0,60,.55), -3px 0 0 rgba(0,200,255,.55), 0 0 18px rgba(0,0,0,.8); }
.tv-side { width: 46px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.tv-side i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a93a0, #4a5361); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tv-side b { width: 30px; height: 3px; border-radius: 2px; background: #1b1f25; }
.tv-side i + b { margin-top: 10px; }
.tv-legs { display: flex; justify-content: space-between; width: 62%; margin: 0 auto; }
.tv-legs i { width: 12px; height: 16px; background: #2a3038; border-radius: 0 0 4px 4px; }
.tv-legs i:first-child { transform: skewX(18deg); }
.tv-legs i:last-child { transform: skewX(-18deg); }
/* today's TV guide grid (/c/<code>/tv) */
.tvhead { color: var(--muted); font-size: 14px; }
.tvhead a.on { font-weight: 700; text-decoration: underline; }
.tvscroll { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.tvgrid { --px: 4px; position: relative; width: calc(190px + var(--min) * var(--px)); }
.tvrow { display: flex; height: 44px; border-bottom: 1px solid var(--line); }
.tvruler { height: 28px; position: sticky; top: 0; z-index: 3; background: var(--bg); }
.tvruler .tvch { background: var(--bg); }
.tvch { position: sticky; inset-inline-start: 0; z-index: 2; width: 190px; flex: none; background: var(--panel); border-inline-end: 1px solid var(--line);
        padding: 4px 8px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 36px; }
.tvch b { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.tvline { position: relative; flex: none; width: calc(var(--min) * var(--px)); }
.tvtick { position: absolute; inset-inline-start: calc(var(--l) * var(--px)); top: 0; bottom: 0; border-inline-start: 1px solid var(--line); padding-inline-start: 4px;
          font-size: 12px; font-weight: 600; color: var(--muted); line-height: 28px; font-variant-numeric: tabular-nums; }
.tvtick.half { color: transparent; }
.tvs { position: absolute; top: 3px; bottom: 3px; inset-inline-start: calc(var(--l) * var(--px)); width: calc(var(--w) * var(--px) - 2px);
       background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12.5px; line-height: 17px;
       overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.tvs:hover, .tvs:focus { border-color: var(--brand); outline: none; }
.tvs.on { background: color-mix(in srgb, var(--brand) 14%, var(--panel)); border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
         box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .tvs.on { box-shadow: inset -3px 0 0 var(--brand); }
.tvs.on .tt { color: var(--brand); font-weight: 600; }
.tvs .tt { color: var(--muted); font-variant-numeric: tabular-nums; }
.tvs .ti { display: block; overflow: hidden; text-overflow: ellipsis; }
.tvnowl { position: absolute; top: 0; bottom: 0; inset-inline-start: calc(190px + var(--l) * var(--px)); width: 2px; background: var(--brand); z-index: 1; pointer-events: none; }
#tvpop { position: fixed; z-index: 10; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
         max-height: 60vh; overflow: auto; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#tvpop .tvx { float: right; color: var(--muted); }
[dir="rtl"] #tvpop .tvx { float: left; }
#tvpop .tdt { color: var(--ink); font-size: 16px; }
#tvpop .tdtime { color: var(--brand); font-weight: 600; }
#tvpop .tdtime, #tvpop .tvcat { color: var(--muted); font-size: 13px; }
[dir="rtl"] #tvpop .tdtime { text-align: right; }
#tvpop p { margin: 8px 0 0; white-space: pre-line; }
#tvpop [dir="rtl"], [dir="rtl"] #tvpop { text-align: right; }
@media (max-width: 640px) { .tvgrid { --px: 3px; width: calc(120px + var(--min) * var(--px)); } .tvch { width: 120px; }
  .tvnowl { inset-inline-start: calc(120px + var(--l) * var(--px)); } }

/* picons + channel page */
.picon { width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--line); object-fit: contain; flex: none; }
.picon.none { display: inline-block; background: var(--bg); }
.picon.sm { width: 28px; height: 28px; border-radius: 6px; }
.picon.lg { width: 96px; height: 96px; border-radius: 16px; }
.chcell { display: flex; align-items: center; gap: 10px; }
.list td .chcell a { color: var(--ink); }
.list td .chcell a:hover { color: var(--brand); }
.tvch { display: flex; align-items: center; gap: 8px; }
.tvch > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.chhead { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.chhead h1 { margin: 0; }
.chhead .note { margin: 2px 0 0; }
.chmeta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chmeta .pill, .tags .pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chmeta .pill.warn { color: var(--warn); border-color: var(--warn); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.chdesc { font-size: 17px; max-width: 70ch; margin: 0 0 18px; }
.chgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.chgrid h3 { margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.bio { margin: 0; line-height: 1.65; }
.srcs { margin: 4px 0 24px; }
.srcs summary { cursor: pointer; color: var(--muted); }
.srcs ul { margin: 8px 0; padding-inline-start: 20px; }
@media (max-width: 760px) { .chgrid { grid-template-columns: 1fr; } .chhead { gap: 12px; } .picon.lg { width: 72px; height: 72px; } }
.list tr.chrow td { vertical-align: middle; padding-top: 5px; padding-bottom: 5px; }
.chhist { max-width: 860px; } .chhist h3 { margin-top: 0; } .chhist .bio { margin-bottom: 16px; }
.nchg-h { margin: 16px 0 6px; } .nchg { margin: 0; padding: 0; list-style: none; } .nchg li { padding: 4px 0; border-top: 1px solid var(--line); } .nchg-d { display: inline-block; min-width: 90px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* TV Guide page (/tv): filters + one scrolling box */
.tvfilters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 4px 0 6px; }
.tvfilters h1 { flex: 1 0 100%; margin: 0 0 4px; }
.tvfilters label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; min-width: 140px; }
.tvfilters label.tvq { flex: 1 1 200px; }
.tvfilters .tvbtns { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel); color: var(--muted); border-radius: 0; padding: 7px 12px; font-weight: 600; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }
.btn.small, button.small { padding: 7px 12px; }
.tvbox-wrap { height: calc(100vh - 250px); min-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin-bottom: 18px; overscroll-behavior: contain; }
.tvbox-wrap .tvgrid .tvch { display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.tvbox-wrap .tvch > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvbox-wrap .tvch a { color: var(--ink); }
#tvmore { padding: 12px 16px; position: sticky; inset-inline-start: 0; }
.tvempty { padding: 16px; }
.tvs.past { opacity: .62; }
/* boxes view */
.tvboxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 12px; }
.tvbox { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-width: 0; }
.tvbox header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tvbox header span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvbox header b { color: var(--brand); font-variant-numeric: tabular-nums; }
.tvbox header a { color: var(--ink); }
.tvlist { list-style: none; margin: 0; padding: 4px 0; position: relative; }
.tvlist .tvs.out { display: none; }
.tvlist .tvs { position: static; display: flex; gap: 10px; width: auto; border: 0; border-radius: 0; padding: 5px 12px; white-space: normal; background: none; font-size: 13.5px; line-height: 1.35; }
.tvlist .tvs .tt { flex: none; width: 42px; }
.tvlist .tvs .ti { display: block; white-space: normal; }
.tvlist .tvs:hover, .tvlist .tvs:focus { background: var(--bg); }
.tvlist .tvs.on { background: color-mix(in srgb, var(--brand) 12%, var(--panel)); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .tvlist .tvs.on { box-shadow: inset -3px 0 0 var(--brand); }
@media (max-width: 640px) { .tvfilters label { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); } .tvbox-wrap { height: calc(100vh - 330px); } .tvboxes { grid-template-columns: 1fr; padding: 8px; } }

/* TV Guide: placeholders, hidden scroll bars + drag, a channel's whole day */
.tvs.ph { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, transparent 6px 12px); color: var(--muted); cursor: default; border-style: dashed; }
.tvs.ph:hover { border-color: var(--line); }
.tvs.ph.on { box-shadow: none; background: repeating-linear-gradient(135deg, var(--bg) 0 6px, transparent 6px 12px); border-color: var(--line); }
.tvs.ph .tt, .tvs.ph.on .tt { color: var(--muted); font-weight: 400; }
.tvlist .tvs.ph { background: none; font-style: italic; }
.tvbox-wrap, .tvlist { scrollbar-width: none; }
.tvbox-wrap::-webkit-scrollbar, .tvlist::-webkit-scrollbar { display: none; }
.tvbox-wrap { cursor: grab; }
.tvbox-wrap.dragging { cursor: grabbing; user-select: none; }
.tvbox-wrap.dragging .tvs { pointer-events: none; }
.tvchan { cursor: pointer; }
#tvday { position: fixed; z-index: 11; width: 320px; max-width: calc(100vw - 16px); padding: 0; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#tvday .tvdh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#tvday .tvdh a { font-size: 13px; white-space: nowrap; }
#tvday ol { list-style: none; margin: 0; padding: 4px 0; max-height: min(420px, 60vh); overflow: auto; }
#tvday li { display: flex; gap: 10px; padding: 4px 12px; font-size: 13.5px; }
#tvday li .tt { flex: none; width: 42px; color: var(--muted); font-variant-numeric: tabular-nums; }
#tvday li.past { opacity: .55; }
#tvday li.on { background: color-mix(in srgb, var(--brand) 12%, var(--panel)); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] #tvday li.on { box-shadow: inset -3px 0 0 var(--brand); }
#tvday li.on .tt { color: var(--brand); font-weight: 600; }
#tvday li.ph { color: var(--muted); font-style: italic; }
#tvpop .tdimg { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; margin: 0 0 10px; background: var(--bg); }

/* admin statistics */
.stgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat.warn b { color: var(--warn); }
.stbars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.stbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.stbar i { display: block; width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.stbar small { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.st3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.list td.ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- M3U playlist editor ---- */
.m3ufield { display: block; margin-bottom: 12px; font-weight: 600; }
.m3ufield input, .m3ufield select { margin-top: 6px; font-weight: 400; max-width: 100%; }
.m3uerr { color: var(--bad); font-weight: 600; }
.m3ubar { display: flex; flex-direction: column; gap: 10px; }
.m3ucounts { display: flex; flex-wrap: wrap; gap: 6px; }
.m3ucounts .chip { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.m3ucounts .chip.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.m3utools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m3utools input[type=search] { flex: 1 1 200px; min-width: 0; }
.m3ugrp { padding: 0; overflow: hidden; }
.m3ugh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.m3ugh.over, .m3urow.over { box-shadow: inset 0 3px 0 var(--brand); }
.m3ugname { font-weight: 700; font-size: 15px; flex: 0 1 280px; min-width: 120px; }
.m3uask { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.m3urow { display: grid; grid-template-columns: 18px 18px 40px minmax(120px, 1fr) minmax(160px, 1.3fr) auto; gap: 8px; align-items: center;
          padding: 6px 12px; border-bottom: 1px solid var(--line); cursor: grab; }
.m3urow.sel { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.m3urow .grip { color: var(--muted); font-size: 12px; letter-spacing: -2px; }
.m3ulogo { width: 40px; height: 24px; display: flex; align-items: center; justify-content: center; }
.m3ulogo img { max-width: 40px; max-height: 24px; }
.m3uname { overflow-wrap: anywhere; }
.m3umatch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; min-width: 0; }
.m3umatch .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.m3umatch .how { color: var(--muted); }
.m3umatch .mname { overflow-wrap: anywhere; }
.how-exact .dot, .how-alias .dot, .how-manual .dot { background: var(--ok); }
.how-check .dot, .how-shift .dot, .how-shiftmiss .dot { background: var(--warn); }
.how-none .dot { background: var(--bad); }
.m3ucounts .chip.how-exact, .m3ucounts .chip.how-alias, .m3ucounts .chip.how-manual { border-color: var(--ok); }
.m3ucounts .chip.how-check, .m3ucounts .chip.how-shift, .m3ucounts .chip.how-shiftmiss { border-color: var(--warn); }
.m3ucounts .chip.how-none { border-color: var(--bad); }
.m3upick { padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.m3upicktop { display: flex; gap: 8px; flex-wrap: wrap; }
.m3upicktop input { flex: 1 1 220px; min-width: 0; }
.m3ures { display: flex; flex-direction: column; max-height: 300px; overflow: auto; margin-top: 8px; }
.m3uopt { display: flex; gap: 8px; align-items: center; text-align: start; background: var(--panel); color: var(--ink); border: 0;
          border-bottom: 1px solid var(--line); padding: 6px 8px; cursor: pointer; border-radius: 0; }
.m3uopt:hover { background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
.m3uopt img { max-width: 36px; max-height: 22px; }
.m3uopt small { color: var(--muted); margin-inline-start: auto; }
.aliasform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.aliasform input { flex: 1 1 200px; min-width: 0; }
@media (max-width: 700px) {
  .m3urow { grid-template-columns: 18px 18px 40px 1fr; }
  .m3umatch { grid-column: 3 / -1; }
  .m3urow > .btn { grid-column: 3 / -1; justify-self: start; }
}
.m3utools select, .m3ugh select, .m3uask select, .m3ugname { width: auto; }
.m3ugh .note { margin: 0; }
.m3ucols { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.m3ucols > div > h2 { margin: 4px 0 10px; }
.m3upicker { position: sticky; top: 12px; }
.m3upicker .picker { max-height: calc(100vh - 200px); min-height: 240px; }
.m3upicker .row select { width: auto; flex: 0 1 50%; }
.m3upicker .row input { flex: 1 1 50%; min-width: 0; }
.m3upicker h4.grp { margin: 0; padding: 6px 4px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 14px; }
.m3uactive { min-height: 1.5em; margin: 0 0 8px; overflow-wrap: anywhere; }
.m3uopt { width: 100%; }
.m3uopt:disabled { cursor: default; opacity: .75; }
.m3uopt.on { box-shadow: inset 3px 0 0 var(--ok); font-weight: 700; }
.m3uopt .noimg { width: 36px; flex: none; }
.m3urow { cursor: pointer; }
.m3urow.active { background: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.m3ucounts .chip.how-unset { border-style: dashed; }
@media (max-width: 860px) {
  .m3ucols { grid-template-columns: 1fr; }
  .m3upicker { position: static; }
  .m3upicker .picker { max-height: 320px; }
}
.m3udlg { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
.m3udlg::backdrop { background: rgba(0, 0, 0, .45); }
.m3udlg h2 { margin: 0 0 12px; }
.m3udlgbody label { display: block; margin: 8px 0; }
.m3udlgbody select { width: auto; }
.m3udlglangs label { font-weight: 600; }
.m3udlgbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.m3udlglink { width: 100%; font-family: monospace; font-size: 13px; }

/* privacy & cookies page */
.legal { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; line-height: 1.6; }
.legal h2 { margin-top: 28px; font-size: 1.15rem; }
.legal ul { padding-inline-start: 20px; }
.legal li { margin: 6px 0; }
.legal .muted { opacity: .7; font-size: .9rem; }

/* news */
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.news-item time, .news-post time { color: var(--muted); font-size: 14px; }
.news-item h2 { margin: 4px 0 8px; font-size: 1.25rem; }
.news-item h2 a { color: inherit; }
.news-body { line-height: 1.6; overflow-wrap: anywhere; }
.news-body p { margin: 0 0 12px; }
.news-post { max-width: 760px; }
.news-post h1 { margin: 6px 0 16px; }
.news-post .pill { background: var(--pill-frozen); margin-inline-start: 8px; }
.newsform label { display: block; margin-bottom: 10px; }
.newsform input[name^="title_"], .newsform textarea { width: 100%; box-sizing: border-box; }
.newsform .row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.newsform fieldset { padding: 10px 14px; }

/* rights-holder form */
.legal .form { max-width: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* main page: news + sidebar */
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.home-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.home-side .box { margin: 0; }
.home-side h3 { margin: 0 0 10px; font-size: 1.05rem; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin: 0 0 10px; display: flex; flex-direction: column; }
.side-k { font-size: 13px; color: var(--muted); }
.side-list a { overflow-wrap: anywhere; }
.btn.paypal { display: block; text-align: center; background: #ffc439; color: #111; border-color: #ffc439; font-weight: 600; }
@media (max-width: 820px) { .home-cols { grid-template-columns: 1fr; } .home-side { position: static; } }
.home-main > .news-item:first-child { margin-top: 0; }

/* free weekly files */
.free-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.free-reg h2 { margin: 0 0 6px; font-size: 1.2rem; }
.free-reg p { margin: 4px 0; }
.free-url code { font-size: 12px; overflow-wrap: anywhere; }
