:root {
  --bg: #141414;
  --bg2: #1f1f1f;
  --bg3: #2b2b2b;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --red: #ffa94d; /* brand orange (the "TV" in SwoopTV); the variable keeps its old name */
  --green: #46d369;
  --radius: 10px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { min-height: 100vh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
#login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
#login .logo { color: #fff; font-weight: 800; font-size: 34px; letter-spacing: 1px; margin-bottom: 6px; }
#login p.sub { color: var(--muted); margin: 0 0 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; background: var(--bg3); border: 1px solid #3a3a3a; border-radius: 8px; padding: 13px 14px; font-size: 16px; }
.field input:focus { outline: 2px solid var(--red); border-color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 8px; font-weight: 700; font-size: 16px; }
.btn.primary { background: var(--red); color: #1a1a1a; }
.btn.light { background: #fff; color: #000; }
.btn.grey { background: rgba(109, 109, 110, 0.7); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.6; }
.error { color: #ff6b6b; font-size: 14px; min-height: 20px; margin: 4px 0 12px; }
.note { color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.5; }

/* ---------- Shell ---------- */
#app { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
header.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: calc(10px + var(--safe-t)) 16px 10px; background: linear-gradient(#000c, #0000); backdrop-filter: blur(8px); }
header.top .brand { color: #fff; font-weight: 800; font-size: 22px; letter-spacing: 1px; }
header.top .spacer { flex: 1; }
header.top .nav { display: none; gap: 18px; }
header.top .nav button { color: #d0d0d0; font-size: 15px; padding: 6px 2px; }
header.top .nav button.on { color: #fff; font-weight: 700; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #0d0d0df2; border-top: 1px solid #262626; padding-bottom: var(--safe-b); backdrop-filter: blur(10px); }
nav.tabs button { flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; }
nav.tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs button.on { color: #fff; }

@media (min-width: 900px) {
  nav.tabs { display: none; }
  header.top .nav { display: flex; }
  #app { padding-bottom: 40px; }
}

main { min-height: 60vh; }
.page { padding: 0 0 20px; }
.pad { padding: 0 16px; }
h2.title { font-size: 20px; margin: 18px 16px 10px; }
.empty { color: var(--muted); padding: 40px 24px; text-align: center; line-height: 1.5; }
.spinner { width: 28px; height: 28px; border: 3px solid #333; border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero { position: relative; height: 62vh; min-height: 380px; max-height: 560px; margin-top: -58px; display: flex; align-items: flex-end; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center top; filter: saturate(1.1); }
.hero .bg.blur { filter: blur(22px) brightness(0.6); transform: scale(1.15); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 4%, #14141400 55%), linear-gradient(to bottom, #0009, #0000 30%); }
.hero .info { position: relative; z-index: 2; padding: 0 16px 22px; width: 100%; }
.hero h1 { font-size: 30px; margin: 0 0 6px; text-shadow: 0 2px 12px #000a; }
.hero .meta { color: #d6d6d6; font-size: 14px; margin-bottom: 14px; }
.hero .actions { display: flex; gap: 8px; }
.hero .actions .btn { padding: 7px 14px; font-size: 14px; gap: 6px; border-radius: 6px; }
.hero .poster-fg { position: absolute; z-index: 2; left: 50%; top: 84px; transform: translateX(-50%); width: 140px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; box-shadow: 0 8px 30px #000a; }
@media (min-width: 700px) { .hero .poster-fg { left: auto; right: 16px; top: auto; bottom: 22px; transform: none; width: 170px; } .hero h1 { font-size: 40px; } }

/* ---------- Rows & cards ---------- */
.row { margin: 4px 0 8px; }
.row h3 { margin: 14px 16px 8px; font-size: 17px; font-weight: 700; }
.rail { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 6px; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.card { flex: 0 0 auto; width: 112px; scroll-snap-align: start; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-self: flex-start; padding: 0; }
.card .ph { width: 100%; aspect-ratio: 2/3; border-radius: 6px; background: var(--bg3); object-fit: cover; }
.card .nm { font-size: 12px; margin-top: 5px; color: #d0d0d0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 700px) { .card { width: 150px; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 8px; padding: 0 16px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); } }
.grid .card { width: auto; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; position: sticky; top: calc(54px + var(--safe-t)); z-index: 10; background: linear-gradient(var(--bg) 70%, #1400); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: var(--bg3); color: #ddd; font-size: 14px; white-space: nowrap; }
.chip.on { background: #fff; color: #000; font-weight: 700; }
.chip small { opacity: 0.6; margin-left: 4px; }
.search { margin: 4px 16px 0; }
.search input { width: 100%; background: var(--bg3); border: 0; border-radius: 8px; padding: 11px 14px; font-size: 16px; }

/* ---------- Sports ---------- */
.game { margin: 0 16px 10px; background: var(--bg2); border-radius: var(--radius); padding: 12px; }
.game .teams { display: flex; align-items: center; gap: 12px; }
.game .logos { display: flex; flex-direction: column; gap: 6px; }
.game .logos img { width: 30px; height: 30px; object-fit: contain; }
.game .names { flex: 1; min-width: 0; }
.game .names div { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .names div.away { color: #cfcfcf; font-weight: 500; }
.game .status { text-align: right; font-size: 12px; color: var(--muted); }
.game .status .live { color: #1a1a1a; background: var(--red); border-radius: 4px; padding: 2px 6px; font-weight: 700; font-size: 11px; display: inline-block; margin-bottom: 4px; }
.game .feeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.game .feeds .btn { padding: 5px 11px; font-size: 13px; border-radius: 6px; gap: 5px; }
.game .nofeed { margin-top: 10px; color: var(--muted); font-size: 13px; }
.game.dim { opacity: 0.65; }
.day { margin: 18px 16px 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.badge { font-size: 10px; border: 1px solid #fff8; border-radius: 3px; padding: 0 4px; margin-left: 6px; }

/* ---------- Live TV ---------- */
.seg { display: flex; margin: 12px 16px; background: var(--bg3); border-radius: 8px; padding: 3px; }
.seg button { flex: 1; padding: 8px; border-radius: 6px; font-size: 14px; color: #ccc; }
.seg button.on { background: #555; color: #fff; font-weight: 700; }
.chan { display: flex; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; border-bottom: 1px solid #202020; }
.chan .lg { width: 48px; height: 48px; border-radius: 8px; background: var(--bg3); object-fit: contain; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.chan .tx { flex: 1; min-width: 0; }
.chan .tx b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .tx span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chan .tx span.now { color: #cfcfcf; }
.chan .idtag { font-size: 11px; color: #777; }
.grouphead { margin: 16px 16px 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }

/* ---------- Sheet ---------- */
#sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: #000a; }
#sheet .panel { background: var(--bg2); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: up 0.2s ease-out; position: relative; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { #sheet { align-items: center; } #sheet .panel { border-radius: 14px; max-height: 88vh; } }
#sheet .close { position: absolute; top: 10px; right: 10px; z-index: 5; background: #000a; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }
.sh-head { position: relative; min-height: 190px; display: flex; align-items: flex-end; }
.sh-head .bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.sh-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg2) 2%, #1f1f1f00 70%); }
.sh-head .tt { position: relative; z-index: 2; padding: 0 16px 8px; }
.sh-head h2 { margin: 0; font-size: 24px; }
.sh-body { padding: 0 16px; }
.sh-body .meta { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.sh-body p { line-height: 1.5; color: #d8d8d8; font-size: 14px; }
.sh-body .actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
select.season { background: var(--bg3); border: 0; border-radius: 8px; padding: 10px 12px; font-size: 15px; color: #fff; margin: 8px 0; }
.ep { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #2c2c2c; width: 100%; text-align: left; }
.ep .n { width: 26px; color: var(--muted); text-align: center; flex: 0 0 auto; }
.ep .t { flex: 1; min-width: 0; }
.ep .t b { display: block; font-size: 14px; font-weight: 600; }
.ep .t span { color: var(--muted); font-size: 12px; }
.ep .pl { font-size: 18px; }
.kv { color: var(--muted); font-size: 12px; word-break: break-all; margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translateX(-50%); background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; z-index: 80; font-size: 14px; font-weight: 600; max-width: 90vw; }
@media (min-width: 900px) { #toast { bottom: 30px; } }

/* west-coast feed sits under its east-coast channel */
.chan.west { margin-left: 22px; border-left: 2px solid #3a3a3a; }

.game .sc { margin-left: 8px; font-variant-numeric: tabular-nums; }

.row h3 .seeall { font: inherit; color: inherit; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.row h3 .seeall span { color: #888; font-size: 20px; line-height: 1; }
.railwait { color: #777; font-size: 13px; padding: 40px 0; min-width: 140px; }
.card.more .ph { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: #bbb; }

.hero.wide { height: 46vh; min-height: 300px; max-height: 480px; }
.hero.wide .bg { background-position: center 20%; }

/* Grid guide */
.egrid { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.einner { position: relative; }
.esec { position: sticky; left: 0; width: 100vw; max-width: 100%; box-sizing: border-box; padding: 18px 16px 6px; font-size: 17px; font-weight: 700; }
.erow { display: flex; height: 60px; border-bottom: 1px solid #1c1c1c; }
.erow.eruler { height: 26px; border: 0; }
.ech { position: sticky; left: 0; z-index: 3; flex: 0 0 84px; width: 84px; box-sizing: border-box; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; border-right: 1px solid #262626; cursor: pointer; }
.ech img { width: 46px; height: 32px; object-fit: contain; border-radius: 4px; }
.ech img.dk { background: #e6e6e6; padding: 3px; box-sizing: border-box; border-radius: 6px; }
.ech .ini { width: 40px; height: 30px; display: grid; place-items: center; background: var(--bg3); border-radius: 4px; font-size: 12px; color: #aaa; }
.ech small { font-size: 10px; color: #bbb; line-height: 1.1; max-width: 76px; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.erow.west .ech { border-left: 2px solid #4a4a4a; }
.etl { position: relative; flex: 0 0 auto; }
.eruler .etl span { position: absolute; top: 4px; font-size: 11px; color: #888; padding-left: 6px; border-left: 1px solid #2a2a2a; line-height: 18px; }
.epgb { position: absolute; top: 4px; bottom: 4px; box-sizing: border-box; padding: 5px 8px; background: #232323; border-radius: 6px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.epgb b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epgb small { font-size: 11px; color: #999; }
.epgb.cur { background: #3a2226; }
.epgb.past { opacity: .5; }
.epgb.none { background: transparent; cursor: default; }
.epgb:active { background: #333; }
.enow { position: absolute; top: 0; bottom: 0; width: 2px; display: block; background: var(--red); opacity: .7; pointer-events: none; z-index: 2; }

.hero .titlelogo { display: block; max-width: 72%; max-height: 96px; object-fit: contain; object-position: left bottom; margin: 0 0 10px; filter: drop-shadow(0 2px 10px #000b); }
@media (min-width: 700px) { .hero .titlelogo { max-width: 420px; max-height: 130px; } }

.epgb.fast b, .epgb.fast small { position: sticky; left: 96px; max-width: calc(100vw - 112px); }
.epgb.fast { cursor: pointer; }
.epgb.fast { overflow: visible; }
.epgb.fast b, .epgb.fast small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.esent { width: 100%; }

.fav { background: none; border: 0; color: #777; font-size: 20px; line-height: 1; padding: 8px 10px; cursor: pointer; flex: 0 0 auto; }
.fav.on { color: #f5c518; }
.ech .fav { position: absolute; top: -2px; right: -2px; font-size: 14px; padding: 4px 5px; }
.chan .fav { margin-right: -6px; }

/* version lists: compact rows, language headings */
.srclist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.srchead { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #999); margin: 8px 0 0; }
.srchead:first-child { margin-top: 0; }
.btn.src { justify-content: flex-start; padding: 9px 14px; font-size: 15px; border-radius: 6px; width: 100%; text-align: left; }

/* cast row and actor page */
.people { display: flex; gap: 12px; overflow-x: auto; margin: 4px -16px 14px; padding: 0 16px; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.person { flex: 0 0 auto; width: 72px; text-align: center; padding: 0; }
.person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg3); display: block; margin: 0 auto; }
.person span { display: block; font-size: 11px; line-height: 1.25; margin-top: 5px; color: #d0d0d0; }
.actorpage { padding-top: 24px; }
.actorpage .ahead { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding-right: 48px; }
.actorpage .ahead img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex: 0 0 auto; }
.actorpage h2 { margin: 0; }
.actorpage h3 { margin: 18px 0 8px; }
.actorpage .grid { padding: 0; }

/* country toggles in Settings */
.ctoggles { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.ctog { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 14px; border-radius: 8px; background: var(--bg3); font-size: 15px; font-weight: 600; text-align: left; }
.ctog i { width: 38px; height: 22px; border-radius: 11px; background: #555; position: relative; flex: 0 0 auto; transition: background 0.15s; }
.ctog i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.ctog.on i { background: var(--red); }
.ctog.on i::after { transform: translateX(16px); }

/* a league's 24/7 channels: square tiles (logo over name) that are easy to tap and to step across with a remote */
.chstrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chstrip::-webkit-scrollbar { display: none; }
.chch { flex: 0 0 auto; width: 92px; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 10px; background: var(--bg3); color: #eee; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; scroll-snap-align: start; }
.chch img { width: 44px; height: 44px; object-fit: contain; }
.chch span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.chch:focus-visible, .chch:hover { outline: 2px solid #fff; outline-offset: 2px; }

/* wordmark: Swoop in white, TV in light orange */
#login .logo span, header.top .brand span { color: #ffa94d; }

/* ---- Continue watching + resume marks ---- */
.card.cw { position: relative; width: 132px; }
.card.cw .cwb { display: block; width: 100%; text-align: left; padding: 0; background: none; border: 0; color: inherit; font: inherit; }
.card.cw .phw { position: relative; }
.card.cw .phw .ph { width: 100%; aspect-ratio: 2/3; border-radius: 6px; object-fit: cover; display: block; }
.card.cw .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); }
.card.cw .bar b { display: block; height: 100%; border-radius: 2px; background: var(--red); }
.card.cw .sub { font-size: 11px; color: #9a9a9a; margin-top: 2px; }
.card.cw .cwx { position: absolute; top: 4px; right: 4px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #ddd; font-size: 12px; line-height: 24px; padding: 0; }
@media (min-width: 700px) { .card.cw { width: 170px; } }
[data-pkey] .pg { margin-left: 8px; font-size: 12px; font-weight: 600; opacity: .75; }
[data-pkey] .pg.done { color: #5ecb7b; opacity: 1; }
.btn[data-pkey].hasprog, .ep[data-pkey].hasprog { background-image: linear-gradient(to right, rgba(255,169,77,.28) var(--pg), transparent var(--pg)); }
.ep[data-pkey] .pg { margin-left: auto; align-self: center; }
.btn.startover { display: block; width: fit-content; min-width: 0; margin: -2px 0 10px 4px; padding: 6px 14px; font-size: 13px; background: transparent; color: #aaa; border: 1px solid #444; border-radius: 16px; }

/* ---------- TV (Android TV app): focus ring and Live TV in the TiviMate style ---------- */
.tv :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tv header.top .nav button:focus-visible { outline-color: var(--red); }
.tvlive { position: relative; display: flex; height: calc(100vh - 64px); overflow: hidden; padding: 0 28px 16px; gap: 0; }
.tvmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tvtop { display: flex; gap: 24px; height: 250px; flex: none; }
.tvprev { width: 444px; height: 250px; flex: none; background: #000; border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 16px; }
.tvinfo { flex: 1; min-width: 0; padding-top: 6px; }
.tvinfo .lg { height: 190px; max-width: 360px; object-fit: contain; object-position: right top; float: right; margin-left: 16px; }
.tvinfo h2 { margin: 0 0 8px; font-size: 26px; }
.tvinfo .nowp { font-size: 20px; color: #fff; margin-bottom: 10px; }
.tvinfo .bar { height: 5px; background: #fff3; border-radius: 3px; overflow: hidden; margin-bottom: 10px; max-width: 520px; }
.tvinfo .bar i { display: block; height: 100%; background: var(--red); }
.tvinfo .nextp { font-size: 17px; color: var(--muted); }
.tvhead { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px 8px; font-size: 16px; }
.tvhead b { font-size: 20px; }
.tvhead span { color: var(--muted); font-size: 14px; }
.tvlist { flex: 1; overflow-y: auto; scrollbar-width: none; }
.tvlist::-webkit-scrollbar { display: none; }
.tvrow { position: relative; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 16px; border-radius: 8px; background: var(--bg2); margin-bottom: 4px; cursor: pointer; }
.tvrow.sel { background: #3a3a3a; box-shadow: inset 0 0 0 3px #fff; }
.tvrow .num { width: 44px; text-align: right; color: var(--muted); font-size: 18px; }
.tvrow .lg { width: 90px; height: 48px; object-fit: contain; flex: none; }
.tvrow .lg.ini { display: grid; place-items: center; background: var(--bg3); border-radius: 6px; font-weight: 700; }
.tvrow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tvrow .tx b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvrow .now { font-size: 16px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvrow .next { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvrow .star { display: none; position: absolute; left: 10px; top: 4px; color: #ffc233; font-size: 15px; }
.tvrow.isfav .star { display: block; }
.tvcats { position: fixed; z-index: 15; left: 0; top: 56px; bottom: 0; width: 320px; overflow-y: auto; scrollbar-width: none; background: #101010; padding: 12px; transform: translateX(-105%); transition: transform .18s; box-shadow: 8px 0 24px #000a; }
.tvcats.open { transform: none; }
.tvcat { display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: 8px; font-size: 19px; color: #ddd; margin-bottom: 2px; }
.tvcat.on { color: #fff; font-weight: 700; }
.tvcat.hi { background: #3a3a3a; box-shadow: inset 0 0 0 3px #fff; color: #fff; }
.tvrow .tx { flex: none; width: 230px; }
.tvtl { position: relative; flex: 1; min-width: 0; height: 50px; overflow: hidden; }
.tvb { position: absolute; top: 0; height: 100%; padding: 6px 10px; border-radius: 6px; background: #303030; overflow: hidden; white-space: nowrap; display: flex; flex-direction: column; justify-content: center; }
.tvb b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.tvb small { font-size: 12px; color: var(--muted); }
.tvb.cur { background: #3f4254; }
.tvb.past { opacity: .55; }
.tvb.none { background: transparent; }
.tvnow { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; }
.tvruler { display: flex; padding: 0 16px; height: 26px; flex: none; font-size: 14px; color: var(--muted); }
.tvruler .day { width: 412px; flex: none; padding-left: 60px; line-height: 26px; }
.tvruler .tvtl { height: 26px; }
.tvruler .tvtl span { position: absolute; top: 4px; transform: translateX(-2px); }
.tv #lgchips { display: none; }
.tv .page > .tvhead { padding: 6px 28px 10px; }
.tvdiv { padding: 12px 6px 6px; color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.tvrow.sp .tx { flex: 1; width: auto; }
.tvrow .tx small { font-size: 14px; color: var(--muted); }
.tvrow .gl { width: 90px; flex: none; display: flex; gap: 6px; justify-content: center; }
.tvrow .gl img { width: 40px; height: 40px; object-fit: contain; }
.tv .tvlive .tvlist .empty { padding: 40px 0; }
.tvgrid { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 4px 10px; }
.tvrow.tile { height: auto; margin: 0; padding: 12px; background: var(--bg2); }
.tile.sq { width: 160px; height: 136px; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; }
.tile.sq .lg { width: 100%; height: 66px; }
.tile.sq b { font-size: 15px; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
.tile.sq .star { top: 6px; left: 8px; }
.tile.wide { width: 404px; height: 112px; gap: 12px; }
.tile.wide .tms { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tile.wide .tm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile.wide .tm img, .tile.wide .tm .ph { width: 34px; height: 34px; object-fit: contain; flex: none; }
.tile.wide .nm { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.wide .sc { font-size: 22px; min-width: 28px; text-align: right; }
.tile.wide .st { flex: none; width: 96px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.tile.wide .st b { font-size: 17px; }
.tile.wide .st small { font-size: 13px; color: var(--muted); }
.tile.wide .st .pl { color: #fff; }
.tile.wide .lv { background: var(--red); color: #1a1a1a; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 4px; }
.tile.wide.live { background: #2a2224; }
#dbg { position: fixed; right: 16px; bottom: 16px; z-index: 80; max-width: 380px; padding: 10px 14px; background: #000d; border: 1px solid #fff4; border-radius: 8px; font: 14px/1.45 ui-monospace, Menlo, monospace; pointer-events: none; }
#dbg b { display: block; font-size: 15px; margin-bottom: 4px; }
#dbg .e { color: #ffc233; margin-top: 4px; }
.tvcat.tvs { padding: 6px; }
.tvcat.tvs input { width: 100%; border: 0; border-radius: 6px; background: #262626; color: #fff; font-size: 19px; padding: 10px 12px; outline: none; }
.tvcat.tvs input::placeholder { color: #aaa; }
.tv .rail { padding-top: 8px; margin-top: -8px; padding-bottom: 10px; } /* room for the focus outline, which the scrolling rail would otherwise clip */
.tv .search { margin-top: 12px; } .tv .search input:focus-visible { outline: 3px solid #fff; outline-offset: -3px; } /* drawn inside the box so the header / screen edge cannot clip it */
.tv .person { padding: 6px 4px; border-radius: 10px; } .tv .person:focus-visible { outline: 3px solid #fff; outline-offset: -3px; } /* inside the button, so the scrolling cast row cannot clip it */
.tvinfo .descp { margin-top: 8px; font-size: 16px; line-height: 1.35; color: #bbb; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
