/* Vizion Web TV — 1920×1080 canvas, dark-first, brand accent via CSS variable
   (set at boot from config/default-brand.json — never hardcode the accent here). */
:root {
  --accent: #C11C1F;
  --accent-soft: rgba(193, 28, 31, 0.16);
  --bg: #0A0A0C;
  --surface: #16161A;
  --surface-2: #1F1F26;
  --surface-3: #2A2A33;
  --text: #F4F4F6;
  --text-2: #A8A8B2;
  --text-3: #6E6E78;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 1920px; height: 1080px; overflow: hidden; }
body {
  background: radial-gradient(1200px 700px at 75% -10%, #1A1420 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: 'SamsungOneUI', 'LG Smart UI', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 28px;
}
#app { position: relative; width: 100%; height: 100%; }
#screen-root, #overlay-root { position: absolute; inset: 0; }
#overlay-root:empty, #ticker-root:empty, #toast-root:empty { display: none; }
#overlay-root { z-index: 40; }
#ticker-root  { position: absolute; left: 0; right: 0; bottom: 0; z-index: 60; }
#toast-root   { position: absolute; top: 40px; left: 0; right: 0; z-index: 70; text-align: center; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ── Focus (the D-pad cursor must be unmistakable at 10 feet) ─────────────── */
.focusable { outline: none; }
.focusable.focused {
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 11px var(--accent-soft);
  transform: scale(1.04);
  z-index: 2;
  transition: transform 110ms ease, box-shadow 110ms ease;
}
.card, .channel-tile { will-change: transform; }
.side-item.focused, .scope-pill.focused, .osk-key.focused, .season-chip.focused,
.live-row.focused, .live-cat-btn.focused, .live-guide-btn.focused, .live-player.focused,
.cat-row.focused, .cat-back.focused {
  transform: none; /* list rows / pills / panes stay in place — ring only */
}

/* ── Top menu bar ─────────────────────────────────────────────────────────── */
.menubar {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 20px 0 18px;
  background: linear-gradient(rgba(10, 10, 12, 0.96), rgba(10, 10, 12, 0.82) 80%, transparent);
}
.menubar .brand {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center;
  font-weight: 800; font-size: 32px; color: var(--accent); letter-spacing: 0.5px;
}
.menubar .brand img { display: block; }
.menu-pill {
  padding: 10px 28px; border-radius: 999px; color: var(--text-2); font-size: 25px;
}
.menu-pill.selected { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.menu-pill.kids { background: var(--accent); color: #fff; font-weight: 700; }

/* ── Connections manager ──────────────────────────────────────────── */
.conn-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.conn-grid {
  display: flex; flex-wrap: wrap; gap: 26px; justify-content: center;
  margin-top: 44px; max-width: 1500px; padding: 8px;
}
.conn-card {
  width: 380px; padding: 32px 26px 28px; border-radius: 20px; text-align: center;
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}
.conn-card.active { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.conn-card.add { background: none; border: 2px dashed var(--surface-3); box-shadow: none; }
.conn-avatar {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 44px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.conn-card.add .conn-avatar { background: var(--surface-2); color: var(--text-2); }
.conn-name {
  font-size: 28px; font-weight: 700; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conn-sub {
  font-size: 21px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conn-badges { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }
/* Trial badge (menubar, right corner) — mirrors the brand corner on the left. */
.trial-chip {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%);
  padding: 8px 22px; border-radius: 999px; font-size: 21px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2); letter-spacing: 0.3px;
  white-space: nowrap;
}
.trial-chip.urgent { background: var(--accent-soft); color: var(--accent); }

/* ── PIN pad (adult-content protection) ───────────────────────────────────────── */
.pin-panel { width: 560px; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 28px 0 6px; }
.pin-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--text-3);
}
.pin-dot.on { background: var(--accent); border-color: var(--accent); }
.pin-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  width: 324px; margin: 20px auto 0;
}
.pin-key {
  width: 100px; height: 74px; border-radius: 14px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--text);
}

/* ── Phone pairing (PIN + QR) ─────────────────────────────────────────────── */
.pair-panel { width: 720px; }
.pair-qr {
  width: 300px; height: 300px; margin: 6px auto 4px; display: block;
  background: #fff; padding: 12px; border-radius: 16px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ── Split layout: LEFT category sidebar + RIGHT content ──────────────────── */
.split { flex: 1; display: flex; min-height: 0; padding: 6px 0 0 0; }
.sidebar {
  width: 380px; flex: 0 0 auto; overflow-y: hidden; padding: 12px 20px 24px 40px;
}
.side-title {
  font-size: 21px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1.6px; margin: 18px 0 8px 14px;
}
.side-item {
  padding: 13px 18px; border-radius: 10px; color: var(--text-2); font-size: 24px;
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-item.selected {
  background: var(--accent-soft); color: var(--text); font-weight: 700;
  border-left: 4px solid var(--accent); padding-left: 14px;
}
.main-pane { flex: 1; min-width: 0; overflow: hidden; padding: 12px 48px 24px 28px; display: flex; flex-direction: column; }
.pane-head { font-size: 30px; font-weight: 800; margin: 6px 0 16px 4px; }
.pane-scroll { flex: 1; overflow: hidden; }

/* ── Rails / cards / grids ────────────────────────────────────────────────── */
.content { flex: 1; overflow: hidden; padding: 24px 48px; }
.v-scroll { height: 100%; overflow-y: hidden; }
.rail { margin-bottom: 34px; }
.rail-title { font-size: 29px; font-weight: 700; margin-bottom: 14px; }
.rail-row { display: flex; gap: 18px; overflow-x: hidden; padding: 14px 22px; }
.card { flex: 0 0 auto; width: 210px; border-radius: var(--radius); }
.card .art {
  width: 210px; height: 315px; border-radius: var(--radius);
  background: var(--surface-2) center/cover no-repeat; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.card.wide { width: 300px; }
.card.wide .art { width: 300px; height: 170px; background-size: contain; background-color: var(--surface-2); }
.card .cap {
  font-size: 22px; color: var(--text-2); margin-top: 9px; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid { display: flex; flex-wrap: wrap; gap: 20px; align-content: flex-start; overflow: hidden; padding: 14px 22px; }

/* ── Home hero ────────────────────────────────────────────────────────────── */
.home-hero { position: relative; height: 620px; margin: -24px -48px 8px; overflow: hidden; display: flex; align-items: flex-end; }
.home-hero-bd { position: absolute; inset: 0; background: center/cover no-repeat; }
/* Ambient blurred layer — full-bleed and 'big' from the first frame (no small poster). */
.bd-blur { transform: scale(1.12); filter: blur(30px) brightness(0.55) saturate(1.1); }
/* Sharp landscape backdrop — preloaded, then crossfades in over the blur (Netflix). */
.bd-sharp { opacity: 0; background-position: center 16%; filter: brightness(0.9); transition: opacity 600ms ease; }
.bd-sharp.show { opacity: 1; }
.home-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,8,10,0.95) 0%, rgba(8,8,10,0.55) 36%, rgba(8,8,10,0) 66%),
              linear-gradient(0deg, var(--bg) 1%, rgba(8,8,10,0.5) 24%, rgba(8,8,10,0) 52%);
}
.home-hero-info { position: relative; z-index: 1; padding: 0 64px 50px; max-width: 62%; }
.home-hero-title { font-size: 64px; font-weight: 900; line-height: 1.02; text-shadow: 0 3px 22px rgba(0,0,0,0.65); }
.home-hero-ov { color: #fff; opacity: 0.92; font-size: 25px; margin-top: 14px; max-height: 74px; overflow: hidden; line-height: 1.4; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.home-hero-actions { margin-top: 26px; }
.home-hero-dots { display: flex; gap: 10px; margin-top: 22px; }
.home-hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.32); transition: width 200ms ease, background 200ms ease; }
.home-hero-dot.on { width: 28px; border-radius: 5px; background: var(--accent); }

/* ── Channel tiles (Live) ─────────────────────────────────────────────────── */
.channel-tile {
  width: 272px; height: 156px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; position: relative; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.channel-tile img { max-width: 72%; max-height: 58%; object-fit: contain; }
.channel-tile .name {
  font-size: 21px; color: var(--text-2); max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-tile .fav { position: absolute; top: 10px; right: 12px; color: var(--accent); font-size: 24px; }

/* Hint bar (e.g. RED = favorite) */
.hintbar { padding: 10px 4px 0; color: var(--text-3); font-size: 21px; }
.hintbar .dot { color: #E5484D; font-size: 22px; }

/* ── Live: split view — channel list LEFT, inline player RIGHT (app parity) ─ */
.live-wrap { flex: 1; display: flex; min-height: 0; padding: 6px 48px 20px; }
.live-list { width: 660px; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; margin-right: 28px; }
.live-cat-btn {
  display: flex; align-items: center; background: var(--surface);
  border-radius: 12px; padding: 15px 20px; margin-bottom: 12px;
  font-size: 24px; font-weight: 700;
}
.live-cat-btn .glyph { margin-right: 14px; color: var(--text-2); }
.live-cat-btn .cname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-cat-btn .chev { color: var(--text-3); margin-left: 12px; }
.live-rows { flex: 1; min-height: 0; }
.live-row {
  display: flex; align-items: center; padding: 10px 14px; border-radius: 12px;
  margin-bottom: 8px; border: 2px solid transparent;
}
.live-row .logo {
  width: 76px; height: 50px; flex: 0 0 auto; margin-right: 16px; border-radius: 8px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.live-row .logo img { max-width: 92%; max-height: 92%; object-fit: contain; }
.live-row .meta { flex: 1; min-width: 0; }
.live-row .name { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row .now { font-size: 19px; color: var(--text-3); margin-top: 2px; }
.live-row .fav { color: var(--accent); font-size: 24px; margin-left: 12px; flex: 0 0 auto; }
.live-row.playing { background: var(--accent-soft); border-color: var(--accent); }
.live-row.playing .now { color: var(--accent); font-weight: 700; }

.live-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.live-player {
  position: relative; width: 100%;
  padding-top: 56.25%; /* 16:9 box (aspect-ratio isn't available on older TV Chromium) */
  background: #000; border-radius: var(--radius); overflow: hidden;
}
.live-stage { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.live-placeholder {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--text-2); font-size: 25px;
}
.live-info { display: flex; align-items: center; margin-top: 16px; }
.live-ch-name { flex: 1; min-width: 0; font-size: 28px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-guide-btn { padding: 10px 26px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 23px; margin-left: 16px; }

.live-epg { margin-top: 16px; background: var(--surface); border-radius: var(--radius); padding: 18px 22px; display: none; }
.live-epg.on { display: block; }
.epg-line { display: flex; align-items: center; }
.epg-line.next-line { margin-top: 10px; }
.epg-badge {
  padding: 3px 14px; border-radius: 999px; font-size: 19px; font-weight: 800;
  background: var(--accent); color: #fff; flex: 0 0 auto; margin-right: 14px;
}
.epg-badge.next { background: var(--surface-3); color: var(--text-2); }
.epg-title { flex: 1; min-width: 0; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-line.next-line .epg-title { color: var(--text-2); font-size: 22px; }
.epg-time { color: var(--text-3); font-size: 21px; margin-left: 16px; flex: 0 0 auto; }
.epg-track { height: 7px; border-radius: 4px; background: var(--surface-3); margin-top: 12px; }
.epg-fill { height: 100%; border-radius: 4px; background: var(--accent); width: 0%; }

/* Categories drawer — left sheet over a dim scrim (focus confined to the overlay). */
.cat-scrim { background: rgba(0, 0, 0, 0.55); }
.cat-drawer {
  position: absolute; left: 0; top: 0; bottom: 0; width: 700px;
  background: rgba(14, 14, 18, 0.98); box-shadow: var(--shadow);
  padding: 26px 30px; display: flex; flex-direction: column;
}
.cat-head { display: flex; align-items: center; margin-bottom: 16px; flex: 0 0 auto; }
.cat-back { padding: 10px 20px; border-radius: 999px; color: var(--accent); font-size: 23px; font-weight: 700; }
.cat-title { margin-left: auto; font-size: 25px; font-weight: 800; padding-right: 6px; }
.cat-rows { flex: 1; min-height: 0; }
.cat-row {
  display: flex; align-items: center; padding: 13px 18px; border-radius: 10px;
  margin-bottom: 6px; background: var(--surface); color: var(--text-2); font-size: 24px;
}
.cat-row .glyph { margin-right: 12px; }
.cat-row .cname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row.selected { color: var(--accent); font-weight: 700; }
.cat-row .check { margin-left: 12px; color: var(--accent); }

/* ── Scope pills (Search) ─────────────────────────────────────────────────── */
.scope-row { display: flex; gap: 12px; margin: 6px 0 18px; }
.scope-pill {
  padding: 9px 26px; border-radius: 999px; font-size: 23px; color: var(--text-2);
  background: var(--surface);
}
.scope-pill.selected { background: var(--accent); color: #fff; font-weight: 700; }

/* ── Search (two-column TV layout) ────────────────────────────────────────── */
.search-split { flex: 1; display: flex; gap: 36px; min-height: 0; padding: 14px 48px 24px; }
.search-left { width: 740px; flex: 0 0 auto; overflow: hidden; }
.search-right { flex: 1; min-width: 0; overflow: hidden; }
.search-field { width: 100%; }
.search-left .osk { margin-top: 18px; }
.search-results { height: 100%; align-content: flex-start; }

/* ── Panels / forms / buttons ─────────────────────────────────────────────── */
.panel {
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border-radius: 22px; padding: 44px; width: 760px; margin: auto; box-shadow: var(--shadow);
}
.center-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.h1 { font-size: 44px; font-weight: 800; margin-bottom: 10px; }
.h2 { font-size: 31px; font-weight: 700; }
.muted { color: var(--text-2); font-size: 24px; }
.small { color: var(--text-3); font-size: 20px; }
.btn {
  display: inline-block; padding: 14px 34px; border-radius: 999px; font-size: 25px;
  background: var(--surface-3); color: var(--text); margin: 8px 8px 0 0;
}
.btn.primary { background: var(--accent); color: #fff; font-weight: 700; }
.field {
  background: var(--surface-3); border-radius: 12px; padding: 16px 20px; font-size: 26px;
  color: var(--text); margin-top: 16px; min-height: 62px;
}
.field .ph { color: var(--text-3); }
.field.focused { box-shadow: 0 0 0 4px var(--accent); transform: none; }
.code {
  font-family: monospace; font-size: 72px; letter-spacing: 14px; font-weight: 800;
  color: var(--accent); margin: 18px 0;
}

/* ── First-login (premium) ────────────────────────────────────────────────── */
.connect-panel {
  width: 760px; padding: 52px 60px 46px; text-align: center;
  background: linear-gradient(168deg, rgba(31,31,38,0.96), rgba(16,16,20,0.98));
  border: 1px solid rgba(255,255,255,0.05);
}
.connect-brand { min-height: 96px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.connect-logo { height: 92px; max-width: 460px; object-fit: contain; }
.connect-word { font-size: 44px; font-weight: 900; color: var(--accent); letter-spacing: 0.5px; }
.connect-title { font-size: 42px; font-weight: 800; margin-top: 6px; }
.connect-sub { margin-top: 8px; }
.connect-panel .field { text-align: left; margin-top: 14px; }
.connect-panel .btn { min-width: 240px; margin-top: 18px; }
.connect-panel .osk { margin-top: 20px; }


/* ── Skeletons (never bare "Loading…" text on content panes) ──────────────── */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -300% 0; } }
.empty-state { text-align: center; color: var(--text-3); padding-top: 90px; font-size: 25px; }
.empty-state .glyph { font-size: 64px; margin-bottom: 14px; opacity: 0.7; }

/* ── Settings ─────────────────────────────────────────────────────────────── */
.settings-grid {
  display: flex; flex-wrap: wrap; gap: 24px; padding: 10px 48px; align-content: flex-start;
}
.settings-card {
  width: 560px; border-radius: 20px; padding: 30px 32px;
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}
.settings-card .card-title {
  font-size: 21px; font-weight: 700; color: var(--text-3); letter-spacing: 1.6px;
  margin-bottom: 14px;
}
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 24px; }
.kv .k { color: var(--text-2); }
.kv .v { color: var(--text); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.kv.full { flex-direction: column; align-items: flex-start; gap: 4px; }
.kv.full .v { max-width: none; white-space: normal; text-align: left; word-break: break-all; font-size: 22px; }
.badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 20px; font-weight: 700; }
.badge.ok { background: rgba(48, 164, 108, 0.18); color: #46C285; }
.badge.warn { background: var(--accent-soft); color: var(--accent); }

/* ── On-screen keyboard ───────────────────────────────────────────────────── */
.osk { margin-top: 22px; }
.osk-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.osk-key {
  min-width: 58px; height: 58px; border-radius: 10px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; font-size: 24px; padding: 0 12px;
}
.osk-key.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ── Player ───────────────────────────────────────────────────────────────── */
#player-video, #player-object { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player-hud {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 60px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}
.player-title { font-size: 34px; font-weight: 800; }
.player-sub { font-size: 24px; color: var(--text-2); margin-top: 4px; }
.progress { height: 8px; background: rgba(255, 255, 255, 0.22); border-radius: 4px; margin-top: 18px; }
/* AVPlay subtitle overlay (we render embedded subs; native <video> renders its own). */
.player-subs {
  position: absolute; left: 0; right: 0; bottom: 132px; z-index: 5; display: none;
  text-align: center; padding: 0 90px; pointer-events: none;
  font-size: 36px; font-weight: 600; color: #fff; line-height: 1.3;
  text-shadow: 0 2px 6px #000, 0 0 5px #000, 0 0 2px #000;
}
.progress { position: relative; }
.progress .fill { height: 100%; background: var(--accent); border-radius: 4px; width: 0%; position: relative; }
.progress.focusable.focused { transform: none; box-shadow: none; }
.progress.focused { height: 10px; }
.progress.focused .fill::after {
  content: ''; position: absolute; right: -9px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--accent);
}
.p-times { display: flex; justify-content: space-between; font-size: 22px; color: var(--text-2); margin-top: 8px; }
.p-controls { display: flex; gap: 16px; margin-top: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.p-btn { padding: 12px 30px; border-radius: 999px; background: rgba(255,255,255,0.16); color: #fff; font-size: 24px; }
.p-btn.primary { background: var(--accent); font-weight: 700; }
/* Track picker (subtitles / audio) — right-side sheet over the video */
.track-scrim { background: rgba(0,0,0,0.55); display: flex; align-items: stretch; justify-content: flex-end; }
.track-menu { width: 480px; background: rgba(16,16,20,0.98); padding: 44px 34px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.track-title { font-size: 30px; font-weight: 800; margin-bottom: 22px; flex: 0 0 auto; }
.track-list { flex: 1; min-height: 0; overflow: hidden; }
.track-row { padding: 16px 22px; border-radius: 12px; font-size: 25px; color: var(--text); background: var(--surface); margin-bottom: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row.active { color: var(--accent); font-weight: 700; }

/* ── Ticker / toast (portal messages) ─────────────────────────────────────── */
.ticker {
  background: rgba(20, 20, 24, 0.96); border-top: 3px solid var(--accent);
  padding: 16px 48px; font-size: 26px; white-space: nowrap; overflow: hidden;
}
.ticker span { display: inline-block; padding-left: 100%; animation: tick 18s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }
.toast {
  display: inline-block; background: var(--surface-3); border-radius: 12px;
  padding: 14px 28px; font-size: 24px; box-shadow: var(--shadow);
}

/* ── Detail ───────────────────────────────────────────────────────────────── */
.detail-hero {
  position: relative; padding: 44px 56px 24px; display: flex; gap: 44px; align-items: flex-start;
}
.detail-hero .backdrop {
  position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0.22;
  -webkit-mask-image: linear-gradient(#000 30%, transparent);
  mask-image: linear-gradient(#000 30%, transparent);
}
.detail-art {
  width: 300px; height: 450px; border-radius: var(--radius); flex: 0 0 auto;
  background: var(--surface-2) center/cover no-repeat; box-shadow: var(--shadow);
  position: relative;
}
.detail-info { flex: 1; min-width: 0; position: relative; }
.overview { color: var(--text-2); font-size: 24px; margin-top: 16px; max-height: 190px; overflow: hidden; line-height: 1.45; }

/* Season chips + episode rows (Shows) */
.season-row { display: flex; gap: 12px; overflow-x: hidden; padding: 4px 56px 14px; }
.season-chip {
  flex: 0 0 auto; padding: 10px 26px; border-radius: 999px; font-size: 23px;
  background: var(--surface); color: var(--text-2);
}
.season-chip.selected { background: var(--accent); color: #fff; font-weight: 700; }
.episode-list { flex: 1; overflow: hidden; padding: 4px 56px 30px; }
.episode-row {
  display: flex; align-items: center; gap: 22px; padding: 16px 20px; border-radius: 12px;
  background: var(--surface); margin-bottom: 12px;
}
.episode-row .num {
  width: 58px; height: 58px; border-radius: 12px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--accent); flex: 0 0 auto;
}
.episode-row .ep-name { font-size: 24px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-row .ep-mark { color: var(--text-3); font-size: 21px; }

/* ── TV Guide grid ────────────────────────────────────────────────────────── */
.guide-head { padding: 20px 48px 6px; }
.guide-axis { display: flex; margin-top: 8px; color: var(--text-2); font-size: 22px; font-weight: 600; }
.guide-axis-spacer { width: 312px; flex: 0 0 auto; }
.guide-axis-cell { flex: 0 0 auto; border-left: 1px solid var(--surface-3); padding-left: 8px; }
.guide-rows { position: relative; flex: 1; overflow: hidden; padding: 8px 48px 24px; }
.guide-row { display: flex; gap: 12px; margin-bottom: 8px; height: 72px; }
.guide-channel {
  width: 300px; flex: 0 0 auto; border-radius: 10px; background: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 0 14px; overflow: hidden;
}
.guide-channel img { width: 52px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.guide-channel .name {
  font-size: 23px; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guide-lane { position: relative; flex: 0 0 auto; height: 72px; }
.guide-block {
  position: absolute; top: 4px; bottom: 4px; border-radius: 8px;
  background: var(--surface-2); padding: 10px 14px; font-size: 22px; color: var(--text);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.35;
}
.guide-block.now { background: var(--accent); color: #fff; font-weight: 700; }
.guide-block.empty { color: var(--text-3); }
.guide-block.replay { color: var(--text-2); }
.guide-nowline {
  position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent);
  z-index: 3; pointer-events: none;
}
