/* ==========================================================================
   Supreme Player design system
   Tokens -> base -> layout -> components -> views -> player
   ========================================================================== */

:root {
  --bg: #0b0d12;
  --surface: #131722;
  --surface-2: #1a2030;
  --surface-3: #232b3f;
  --border: #252c3e;
  --text: #e9edf6;
  --muted: #8d97ad;
  --accent: #6f8dff;
  --accent-strong: #4f6fef;
  --accent-ink: #fff;
  --danger: #ff6272;
  --ok: #3ddc97;
  --warn: #ffb648;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 236px;
  --topbar-h: 56px;
  --tabbar-h: calc(60px + env(safe-area-inset-bottom));
  --gutter: clamp(14px, 3vw, 28px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --surface-3: #e2e7f2;
  --border: #dbe1ee;
  --text: #141a29;
  --muted: #5d6882;
  --accent: #4463f0;
  --accent-strong: #2f4bd8;
  --shadow: 0 10px 40px rgba(30, 45, 90, .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: inherit;
  transition: background .15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.icon-btn.on { color: var(--warn); }
.icon-btn.on svg.i { fill: currentColor; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); outline: none; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238d97ad' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.search-input { position: relative; flex: 1; min-width: 0; }
.cats > .search-input, .live-cats > .search-input { flex: none; }
.search-input > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input .input { padding-left: 42px; min-height: 42px; border-radius: 999px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px var(--gutter); margin: 0 calc(var(--gutter) * -1); scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); letter-spacing: .02em; }
.badge-live { background: var(--danger); color: #fff; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); padding: 20px 14px; display: none; flex-direction: column; gap: 4px;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; padding: 4px 10px 18px; white-space: nowrap; }
.brand { text-decoration: none; }
.brand-logo { display: block; height: 64px; width: auto; }
.sidebar .brand { justify-content: center; padding: 0 10px 12px; }
.login-card .brand { justify-content: center; }
.login-card .brand-logo { height: 96px; }
.topbar-logo { display: inline-flex; align-items: center; flex: none; }
.topbar-logo img { height: 34px; width: auto; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.sidebar .spacer { flex: 1; }
.account-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.account-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.account-chip small { display: block; color: var(--muted); font-size: 12px; }
.account-chip div { min-width: 0; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0; }
.topbar .brand { padding: 0; flex: 1; }
.view { padding: 18px var(--gutter) calc(var(--tabbar-h) + 24px); animation: fade .25s ease; }
.view.flush { padding: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; inset: auto 0 0 0; height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); z-index: 40; display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); min-width: 0; }
.tab.active { color: var(--accent); }
.tab svg.i { width: 24px; height: 24px; }

@media (max-width: 959.98px) { .only-desktop { display: none !important; } }
@media (min-width: 960px) {
  .sidebar { display: flex; }
  .main { margin-left: var(--sidebar-w); }
  .tabbar { display: none; }
  .only-mobile { display: none !important; }
  .view { padding-bottom: 40px; }
  :root { --tabbar-h: 0px; }
  .topbar .brand { display: none; }
}

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), radial-gradient(900px 500px at 100% 110%, color-mix(in srgb, #8a4dff 18%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 18px; }
.login-card .brand { padding: 0; font-size: 24px; }
.login-card p.lead { color: var(--muted); margin-top: -8px; }
.login form { display: grid; gap: 14px; }
.pw { position: relative; }
.pw .icon-btn { position: absolute; right: 2px; top: 1px; width: 44px; height: 44px; color: var(--muted); }
.pw .input { padding-right: 48px; }
.error-box { padding: 11px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); font-size: 14px; }
.saved { display: grid; gap: 8px; }
.saved-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; width: 100%; }
.saved-item:hover { border-color: var(--accent); }
.saved-item .grow { flex: 1; min-width: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- section headers, rows, cards ---------- */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.section-head a, .section-head button { color: var(--accent); font-size: 13px; font-weight: 600; }
.row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); padding: 2px var(--gutter) 10px; margin: 0 calc(var(--gutter) * -1); scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.row > * { scroll-snap-align: start; flex: none; }
.row .card { width: clamp(118px, 30vw, 158px); }
.row .card.wide { width: clamp(200px, 60vw, 280px); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(112px, 29vw, 172px), 1fr)); gap: 18px 14px; }
.card { display: block; position: relative; min-width: 0; border-radius: var(--radius-sm); }
.card-img {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  display: grid; place-items: center; transition: transform .2s, box-shadow .2s;
}
.card.wide .card-img { aspect-ratio: 16 / 9; }
.card-img::before { content: attr(data-initial); position: absolute; font-size: 34px; font-weight: 800; color: var(--muted); opacity: .5; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.card-img img.loaded { opacity: 1; }
.card-img img.broken { display: none; }
@media (hover: hover) { .card:hover .card-img { transform: translateY(-3px); box-shadow: var(--shadow); } }
.card-title { margin-top: 8px; font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card .rating { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 700; display: flex; gap: 4px; align-items: center; }
.card .rating svg { width: 11px; height: 11px; fill: var(--warn); stroke: none; }
.card .fav-btn { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card:hover .fav-btn, .card .fav-btn.on, .card .fav-btn:focus-visible { opacity: 1; }
@media (hover: none) { .card .fav-btn { opacity: 1; } }
.card .fav-btn.on { color: var(--warn); }
.card .fav-btn.on svg.i { fill: currentColor; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.progress > i { display: block; height: 100%; background: var(--accent); }

.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; text-align: center; }
.tile .logo { width: 84px; height: 84px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; padding: 10px; position: relative; overflow: hidden; }
.tile .logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile .logo img.broken { display: none; }
.tile .logo::before { content: attr(data-initial); position: absolute; font-weight: 800; color: var(--muted); font-size: 24px; opacity: .6; }
.tile .logo img { position: relative; }
.tile span { font-size: 12px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }

.skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card .skeleton:first-child { aspect-ratio: 2/3; }
.skel-card .skeleton:last-child { height: 14px; margin-top: 10px; width: 70%; }

.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 56px 20px; color: var(--muted); }
.empty svg.i { width: 44px; height: 44px; opacity: .6; }
.empty h3 { color: var(--text); font-size: 17px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--text) 18%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; gap: 14px; padding: 60px 0; color: var(--muted); }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: 14px; }
.banner.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ---------- category lists / two-pane browse ---------- */
.pane { display: block; }
.cats { display: none; }
.cat-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.cat-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-align: left; width: 100%; }
.cat-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item small { font-size: 12px; opacity: .75; flex: none; }
.cat-item:hover { background: var(--surface-2); color: var(--text); }
.cat-item.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.cat-item .i { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .btn { min-height: 42px; }
.toolbar select.input { width: auto; min-height: 42px; border-radius: 999px; padding-left: 16px; }
.count { color: var(--muted); font-size: 13px; }
@media (max-width: 959.98px) { .toolbar.stack .search-input { flex: 1 1 100%; order: -1; } .toolbar.stack select.input { flex: 1; } }

@media (min-width: 960px) {
  .pane { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
  .cats { display: flex; flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100dvh - var(--topbar-h) - 32px); gap: 10px; }
  .cat-btn { display: none !important; }
}

/* ---------- sheet / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 12, .62); display: flex; align-items: flex-end; justify-content: center; animation: fadein .18s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes fadein { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: min(82dvh, 720px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); animation: rise .24s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 20px; }
.sheet-head h3 { flex: 1; font-size: 17px; }
.sheet-body { padding: 4px 12px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 28px)); pointer-events: none; }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; animation: rise .22s ease; pointer-events: auto; }
.toast.error { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }

/* ---------- LIVE view ---------- */
.live { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - var(--tabbar-h)); }
.live-stage { display: none; background: var(--bg); }
.live.has-channel .live-stage { display: block; }
.live-list { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px var(--gutter) 0; gap: 10px; }
.live-stage .xp { max-height: 46dvh; }
.live-cats { display: none; }
.vl { position: relative; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.vl-spacer { position: relative; width: 100%; }
.vl-window { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.ch { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 8px 0 6px; border-radius: 12px; width: 100%; text-align: left; }
.ch:hover { background: var(--surface-2); }
.ch.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ch .logo { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; padding: 4px; position: relative; overflow: hidden; }
.ch .logo img { max-width: 100%; max-height: 100%; object-fit: contain; position: relative; }
.ch .logo img.broken { display: none; }
.ch .logo::before { content: attr(data-initial); position: absolute; font-weight: 800; color: var(--muted); opacity: .6; }
.ch .meta { flex: 1; min-width: 0; }
.ch .name { font-weight: 600; display: block; }
.ch .num { color: var(--muted); font-size: 12px; }
.ch .fav { width: 40px; height: 40px; color: var(--muted); border-radius: 50%; display: grid; place-items: center; flex: none; }
.ch .fav:hover { color: var(--text); }
.ch .fav.on { color: var(--warn); }
.ch .fav.on svg.i { fill: currentColor; }
.ch .playing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.stage-info { padding: 12px var(--gutter) 10px; display: grid; gap: 10px; }
.stage-title { display: flex; align-items: center; gap: 10px; }
.stage-title h2 { font-size: 17px; flex: 1; min-width: 0; }
.epg-now .t { font-weight: 600; }
.epg-now .s { color: var(--muted); font-size: 13px; }
.epg-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 6px 0; }
.epg-bar > i { display: block; height: 100%; background: var(--accent); }
.epg-list { display: none; }
.epg-item { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.epg-item time { color: var(--muted); font-variant-numeric: tabular-nums; }
.epg-item p { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* mobile: sticky player above channel list */
@media (max-width: 959.98px) {
  .live.has-channel .live-stage { position: relative; }
  .live .xp { border-radius: 0; }
  .live-stage .stage-actions .only-desktop { display: none; }
  .live-stage .epg-list { display: none !important; }
}
@media (min-width: 960px) {
  .live { display: grid; grid-template-rows: 1fr; grid-template-columns: 232px minmax(280px, 360px) minmax(0, 1fr); gap: 0; height: calc(100dvh - var(--topbar-h)); }
  .live-cats { display: flex; flex-direction: column; min-height: 0; padding: 14px 8px 0 var(--gutter); gap: 8px; border-right: 1px solid var(--border); }
  .live-cats .cat-list { flex: 1; padding-bottom: 20px; }
  .live-list { padding: 14px 10px 0; border-right: 1px solid var(--border); }
  .live-stage { display: block; overflow-y: auto; order: 3; padding: 16px var(--gutter); }
  .live-stage .xp { border-radius: var(--radius); max-height: none; }
  .stage-info { padding: 16px 2px; }
  .epg-list { display: block; }
  .stage-empty { display: grid; }
}
.stage-empty { display: none; place-items: center; text-align: center; color: var(--muted); gap: 10px; height: 100%; min-height: 320px; }
.stage-empty svg.i { width: 56px; height: 56px; opacity: .45; }
.live.has-channel .stage-empty { display: none; }
.live:not(.has-channel) .stage-body { display: none; }
@media (min-width: 960px) { .live .live-stage { display: block; } }

/* ---------- detail pages ---------- */
.detail-hero { position: relative; margin: -18px calc(var(--gutter) * -1) 0; padding: 18px var(--gutter) 24px; overflow: hidden; isolation: isolate; }
.detail-hero .backdrop { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center 20%; opacity: .22; filter: blur(2px) saturate(1.2); transform: scale(1.05); }
.detail-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, transparent 30%, var(--bg)); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; margin-bottom: 14px; min-height: 40px; }
.back-link:hover { color: var(--text); }
.detail { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.detail-poster { width: min(46vw, 210px); aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); position: relative; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-poster img.broken { display: none; }
.detail-main { display: grid; gap: 14px; align-content: start; min-width: 0; width: 100%; }
.detail-main h1 { font-size: clamp(24px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 14px; }
.meta-line .rate { color: var(--warn); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.meta-line .rate svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.plot { max-width: 70ch; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; max-width: 70ch; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 720px) { .detail { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; } .detail-poster { width: 100%; } }
@media (max-width: 719.98px) { .detail-poster { justify-self: start; } }

.episodes { display: grid; gap: 10px; margin-top: 8px; }
.episode { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.episode:hover { border-color: var(--accent); background: var(--surface-2); }
.ep-thumb { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-thumb img.broken { display: none; }
.ep-body { min-width: 0; }
.ep-body strong { display: block; font-size: 14px; }
.ep-body p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.ep-check { color: var(--ok); }
@media (max-width: 520px) { .episode { grid-template-columns: 96px minmax(0, 1fr); } .episode > .ep-check { display: none; } }

/* ---------- settings ---------- */
.settings { display: grid; gap: 22px; max-width: 760px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 18px; }
.panel > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 0 4px; }
.panel .line { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.panel h3 + .line { border-top: 0; }
.panel .line small { display: block; color: var(--muted); }
.panel .line select.input { width: auto; min-width: 150px; }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 10px 0 14px; font-size: 14px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); font: 600 12px/1.6 ui-monospace, monospace; text-align: center; }

/* ==========================================================================
   Player
   ========================================================================== */
.xp { position: relative; background: #000; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; aspect-ratio: 16 / 9; width: 100%; --xp-accent: var(--accent); }
.xp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.xp-full { position: fixed; inset: 0; z-index: 90; aspect-ratio: auto; height: 100dvh; }
.xp:fullscreen, .xp:-webkit-full-screen { max-height: none !important; aspect-ratio: auto; width: 100vw; height: 100dvh; border-radius: 0 !important; }
.xp.is-fs { position: fixed; inset: 0; width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0 !important; z-index: 9999; }
.xp-surface { position: absolute; inset: 0; z-index: 1; }
.xp-top, .xp-controls { position: absolute; left: 0; right: 0; z-index: 3; transition: opacity .22s; }
.xp-top { top: 0; padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 28px calc(8px + env(safe-area-inset-left)); display: flex; align-items: center; gap: 6px; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.xp-top .titles { min-width: 0; flex: 1; }
.xp-top strong { display: block; font-size: 16px; }
.xp-top small { opacity: .75; }
.xp-embed .xp-top { display: none; }
.xp-controls { bottom: 0; padding: 34px calc(10px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); background: linear-gradient(transparent, rgba(0,0,0,.82)); }
.xp.idle .xp-top, .xp.idle .xp-controls { opacity: 0; pointer-events: none; }
.xp.idle { cursor: none; }
.xp .icon-btn { width: 42px; height: 42px; color: #fff; }
.xp .icon-btn:hover { background: rgba(255,255,255,.16); }
.xp-row { display: flex; align-items: center; gap: 2px; }
.xp-row .grow { flex: 1; }
.xp-time { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; opacity: .95; }
.xp .badge-live { margin: 0 8px; }
.xp-seek { display: block; width: 100%; height: 22px; margin: 0 0 2px; appearance: none; background: transparent; cursor: pointer; --p: 0%; --b: 0%; touch-action: none; }
.xp-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--xp-accent) var(--p), rgba(255,255,255,.55) var(--p), rgba(255,255,255,.55) var(--b), rgba(255,255,255,.22) var(--b)); }
.xp-seek::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--xp-accent) var(--p), rgba(255,255,255,.55) var(--p), rgba(255,255,255,.55) var(--b), rgba(255,255,255,.22) var(--b)); }
.xp-seek::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 0 0 4px rgba(255,255,255,.2); transform: scale(0); transition: transform .12s; }
.xp-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .12s; }
.xp-seek:hover::-webkit-slider-thumb, .xp-seek:focus-visible::-webkit-slider-thumb, .xp.seeking .xp-seek::-webkit-slider-thumb { transform: scale(1); }
.xp-seek:hover::-moz-range-thumb, .xp-seek:focus-visible::-moz-range-thumb, .xp.seeking .xp-seek::-moz-range-thumb { transform: scale(1); }
.xp.is-live .xp-seek, .xp.is-live .xp-vod-only { display: none; }
.xp-vol { width: 84px; height: 22px; appearance: none; background: transparent; cursor: pointer; --p: 100%; margin: 0 6px; }
.xp-vol::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.xp-vol::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.xp-vol::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4.5px; }
.xp-vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
@media (pointer: coarse), (max-width: 620px) { .xp-vol { display: none; } .xp-row .vol-btn-wrap .icon-btn { display: none; } }
.xp-center { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.xp-bigplay { width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; transition: transform .2s, opacity .2s; pointer-events: auto; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.xp-bigplay svg { width: 30px; height: 30px; }
.xp:not(.paused) .xp-bigplay, .xp.buffering .xp-bigplay, .xp.errored .xp-bigplay { opacity: 0; transform: scale(.8); pointer-events: none; }
.xp .spinner { display: none; width: 44px; height: 44px; border-width: 4px; border-color: rgba(255,255,255,.25); border-top-color: #fff; position: absolute; }
.xp.buffering:not(.errored) .spinner { display: block; }
.xp-toast { position: absolute; z-index: 4; left: 50%; top: 18%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(0,0,0,.7); font-size: 14px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.xp-toast.show { opacity: 1; }
.xp-error { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; align-content: center; gap: 12px; text-align: center; padding: 24px; background: rgba(0,0,0,.82); }
.xp.errored .xp-error { display: grid; }
.xp.errored video { visibility: hidden; }
.xp-error p { max-width: 42ch; opacity: .9; }
.xp-error .actions { justify-content: center; }
.xp-error .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.xp-error .btn-primary { background: var(--accent); }
.xp-menu { position: absolute; z-index: 6; right: 10px; bottom: 74px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 100px); overflow-y: auto; background: rgba(16, 19, 28, .96); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.xp-menu h4 { margin: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; opacity: .6; }
.xp-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 10px; text-align: left; font-size: 14px; }
.xp-menu button:hover { background: rgba(255,255,255,.1); }
.xp-menu button.sel { color: var(--accent); font-weight: 700; }
.xp-menu button.sel::after { content: "\2713"; }
.xp-embed .xp-menu { bottom: 62px; }
.xp-flash { position: absolute; top: 0; bottom: 0; width: 34%; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; background: radial-gradient(closest-side, rgba(255,255,255,.22), transparent); font-weight: 700; }
.xp-flash.left { left: 0; } .xp-flash.right { right: 0; }
.xp-flash.show { animation: flash .5s ease; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- reconnect status, connections badge, update bar ---------- */
.xp-status { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); max-width: 90%; padding: 7px 14px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font-size: 13px; font-weight: 600; text-align: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.xp-status[hidden] { display: none; }
.conn-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.conn-badge[hidden] { display: none; }
.conn-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn-badge.full .dot { background: var(--warn); }
.conn-badge.over .dot { background: var(--danger); }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 12px); z-index: 300; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 999px; background: var(--surface-3); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--shadow); font-size: 14px; max-width: calc(100vw - 24px); animation: drop .22s ease; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: .4; } }
.update-bar[hidden] { display: none; }
.update-bar .btn { padding: 6px 14px; }

/* ---------- Supreme / cinematic edition ---------- */
:root {
  --bg: #0c0e0d; --surface: #121513; --surface-2: #1b1f1c; --surface-3: #282f29;
  --border: #2b322d; --text: #f1f3ed; --muted: #99a299;
  --accent: #c5f467; --accent-strong: #d5ff88; --accent-ink: #17200b;
  --sidebar-w: 230px; --topbar-h: 78px; --gutter: clamp(20px, 3.4vw, 52px);
  --radius: 18px; --radius-sm: 12px;
}
:root[data-theme="light"] {
  --bg: #f4f5ef; --surface: #fff; --surface-2: #eaeee4; --surface-3: #dce4d5;
  --border: #d3dccd; --text: #1d281d; --muted: #616d5b;
  --accent: #456c13; --accent-strong: #34540d; --accent-ink: #fff;
}
::selection { background: var(--accent); color: var(--accent-ink); }
.btn { border-radius: 10px; min-height: 46px; font-size: 13px; padding: 0 21px; transition: background .2s, transform .2s, box-shadow .2s; }
.btn-primary:hover { box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 18%, transparent); transform: translateY(-2px); }
.input { border-radius: 10px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 27px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.wordmark small { display: block; font-size: 8px; font-weight: 500; letter-spacing: 5px; margin: 8px 0 0 2px; }
.wordmark-dot { color: var(--accent); }
.brand-symbol { display: grid; place-items: center; width: 39px; height: 43px; color: var(--accent-ink); background: var(--accent); border-radius: 12px 12px 12px 3px; transform: rotate(-5deg); flex: none; }
.brand-symbol svg { transform: rotate(5deg); }
.sidebar { padding: 35px 18px 20px; background: var(--bg); }
.sidebar .wordmark { margin: 0 10px 42px; }
.nav-label { margin: 0 15px 14px; font-size: 9px; color: var(--muted); letter-spacing: 2.2px; }
.nav-item { min-height: 48px; border-radius: 9px; font-size: 13px; font-weight: 500; padding: 0 15px; margin-bottom: 4px; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 3px 24px color-mix(in srgb, var(--accent) 8%, transparent); }
.sidebar-note { border: 1px solid var(--border); border-radius: 13px; padding: 18px 15px; margin: 28px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.8; background: radial-gradient(ellipse at 0 100%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 80%); }
.sidebar-note strong { font-weight: 500; color: var(--text); }
.sidebar-note > span { display: block; font-size: 8px; letter-spacing: 1.4px; margin-top: 13px; }
.account-chip { border-top: 1px solid var(--border); border-radius: 0; background: none; padding: 17px 6px 0; margin-top: 12px; font-size: 12px; }
.account-chip .avatar { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); }
.account-chip small { max-width: 125px; font-size: 10px; margin-top: 3px; }
.topbar { gap: 20px; border-bottom-color: var(--border); }
.topbar h1 { font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.topbar-search { display: flex; gap: 11px; align-items: center; color: var(--muted); font-size: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; }
.topbar-search kbd { font: 11px var(--font); margin-left: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.conn-badge { font-size: 10px; background: none; border: 0; font-weight: 500; }
.conn-badge .dot { width: 5px; height: 5px; background: var(--accent); }
.view { padding-top: 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 9px; line-height: 1.6; font-weight: 600; letter-spacing: 2.3px; color: var(--accent); }
.eyebrow i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.home-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.home-heading h2 { font-size: clamp(27px, 3vw, 39px); font-weight: 600; letter-spacing: -1.6px; margin-top: 7px; }
.home-heading-note { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.discovery-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 410px; border: 1px solid #384534; border-radius: 20px; background: #111b15; color: #f1f3ed; display: flex; align-items: center; }
.feature-content { position: relative; z-index: 2; padding: 42px 42px 70px; max-width: 70%; animation: feature-enter .5s ease both; }
.feature-content .eyebrow { color: #c5f467; }
.feature-content h2 { font-size: clamp(34px, 4.2vw, 64px); font-weight: 600; letter-spacing: -2.5px; line-height: 1.04; margin: 22px 0 20px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature-content h2 em { font-family: Georgia, serif; font-weight: 400; color: #c5f467; }
.feature-content p { color: #c1cabd; font-size: 13px; line-height: 1.8; margin: 17px 0 23px; }
.discovery-hero .btn-primary { background: #c5f467; color: #17200b; }
.feature-save { background: #ffffff0d; border-color: #ffffff38; color: #f1f3ed; backdrop-filter: blur(10px); }
.feature-save.on { color: #c5f467; }
.feature-art { position: absolute; right: 0; top: 0; height: 100%; width: 54%; object-fit: cover; object-position: center 25%; opacity: .85; }
.feature-art.broken { display: none; }
.feature-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #111b15 16%, #111b15ee 37%, #111b1570 68%, #111b1520), linear-gradient(0deg, #111b15 0%, transparent 45%); }
.hero-orbit { position: absolute; width: 510px; height: 510px; right: -30px; top: -90px; border-radius: 50%; border: 1px solid #c5f44655; box-shadow: inset 0 0 70px #c5f46720, 0 0 100px #93e56412; background: radial-gradient(circle at 30% 70%, #53622c 0, #203c2a 30%, #101c15 70%); }
.hero-orbit::after { content: ''; position: absolute; inset: 55px; border-radius: 50%; border: 1px solid #c5f46730; }
.hero-edition { position: absolute; bottom: 26px; right: 30px; font-size: 8px; letter-spacing: 2px; color: #b3bdad; }
.feature-meta { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; color: #c1cabd; font-size: 11px; }
.feature-rating { display: inline-flex; align-items: center; gap: 5px; color: #c5f467; }
.feature-rating svg { fill: currentColor; width: 12px; height: 12px; }
.feature-tag { border: 1px solid #b3bdad55; border-radius: 4px; padding: 3px 6px; font-size: 8px; letter-spacing: 1px; }
.feature-bottom { position: absolute; z-index: 3; bottom: 22px; left: 42px; right: 32px; display: flex; align-items: center; gap: 20px; color: #a5b09e; font-size: 8px; letter-spacing: 1.7px; }
.feature-dots { display: flex; gap: 4px; margin-left: auto; }
.feature-dots button { width: 25px; height: 24px; display: grid; place-items: center; }
.feature-dots button::before { content: ''; width: 6px; height: 6px; background: #cad4c466; border-radius: 5px; transition: width .2s, background .2s; }
.feature-dots button.active::before { width: 22px; background: #c5f467; }
.discovery-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 20px 0 35px; }
.discovery-links a { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); transition: border-color .2s, transform .2s; }
.discovery-links a:hover { border-color: var(--accent); transform: translateY(-3px); }
.discovery-icon { width: 39px; height: 39px; display: grid; place-items: center; background: var(--surface-2); border-radius: 10px; color: var(--accent); flex: none; }
.discovery-links strong { font-size: 12px; font-weight: 600; display: block; }
.discovery-links small { color: var(--muted); display: block; font-size: 10px; margin-top: 4px; }
.discovery-links a > .i { margin-left: auto; color: var(--muted); }
.section { margin-bottom: 36px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 21px; letter-spacing: -.6px; font-weight: 600; }
.section-head a { font-size: 11px; color: var(--muted); }
.section-head a::after { content: ' ↗'; color: var(--accent); margin-left: 5px; }
.row { gap: 19px; padding-bottom: 16px; }
.row .card { width: clamp(145px, 14vw, 205px); }
.card-img { border: 1px solid var(--border); background: radial-gradient(ellipse at 15% 0, #45613955, transparent 70%), linear-gradient(135deg, var(--surface-3), var(--surface)); }
.card:nth-child(3n + 2) .card-img { background: radial-gradient(ellipse at 90% 0, #7c5c4555, transparent 70%), linear-gradient(135deg, var(--surface-3), var(--surface)); }
.card:nth-child(3n) .card-img { background: radial-gradient(ellipse at 15% 0, #42627c55, transparent 70%), linear-gradient(135deg, var(--surface-3), var(--surface)); }
.card-img::before { font-family: Georgia, serif; font-style: italic; font-size: 48px; font-weight: 400; }
.card-title { margin-top: 12px; font-size: 12px; font-weight: 500; }
.card-sub { margin-top: 6px; font-size: 10px; }
.card:focus-within .card-img { border-color: var(--accent); }
.card:focus-within .fav-btn { opacity: 1; }
@media (hover: hover) { .card:hover .card-img { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); box-shadow: 0 14px 35px #0005; } }
.grid { gap: 27px 18px; }
.cats { background: var(--surface); border: 1px solid var(--border); padding: 14px; border-radius: 15px; }
.cat-item { font-size: 12px; min-height: 43px; }
.cat-item.active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.toolbar { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.toolbar .input { border-radius: 9px !important; }
.detail-hero { border-bottom: 1px solid var(--border); }
.detail-main h1 { letter-spacing: -1.8px; }
.detail-poster { box-shadow: 0 25px 70px #0006; }
.empty { border: 1px dashed var(--border); border-radius: 18px; margin: 20px 0; padding: 70px 24px; background: var(--surface); }
.empty > svg.i { color: var(--accent); }
.banner { font-size: 12px; }
.tabbar { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.tab.active svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 35%, transparent)); }
@keyframes feature-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* The entrance: a CSS-built celestial composition, with no external assets. */
.login { padding: 0; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); align-items: stretch; }
.login-story { position: relative; isolation: isolate; overflow: hidden; min-height: 100dvh; background: #111b15; color: #f1f3ed; padding: 44px 50px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid #36442d; }
.login-story .wordmark { position: relative; z-index: 2; align-self: start; }
.login-story .brand-symbol { background: #c5f467; color: #17200b; }
.login-story .wordmark-dot { color: #c5f467; }
.cinema-orbit { position: absolute; z-index: -1; width: 760px; height: 760px; top: 46%; left: 53%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, #6b863425, transparent 65%); }
.orbit-core { position: absolute; width: 370px; height: 370px; top: 170px; left: 195px; border-radius: 50%; background: radial-gradient(circle at 70% 25%, #d0e991, #819853 14%, #304b2a 40%, #14281c 64%, #101c15 75%); box-shadow: inset 6px 6px 20px #d2f99e30, 0 0 65px #a9dc6f12; animation: planet-float 12s ease-in-out infinite; }
.orbit-ring { position: absolute; width: 620px; height: 620px; top: 65px; left: 70px; border: 1px solid #bce68244; border-radius: 50%; transform: rotate(-32deg) scaleY(.57); box-shadow: 0 0 18px #bce6820a, inset 0 0 18px #bce6820a; }
.orbit-ring::before, .orbit-ring::after { content: ''; position: absolute; border: 1px solid #bce68220; border-radius: 50%; inset: -30px; }
.orbit-ring::after { inset: -70px; border-color: #bce68212; }
.orbit-caption { position: absolute; top: 80px; right: 120px; writing-mode: vertical-rl; font-size: 8px; letter-spacing: 3px; color: #9db68b; }
.login-story::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, #101b15 10%, #101b15d9 26%, transparent 63%), radial-gradient(ellipse at 0 100%, #bbec6322, transparent 70%); }
.login-editorial { margin-top: 330px; position: relative; z-index: 1; }
.login-editorial .eyebrow { color: #c5f467; font-size: 9px; }
.login-editorial h1 { font-size: clamp(37px, 4.1vw, 64px); line-height: 1.08; letter-spacing: -2.8px; font-weight: 500; margin: 24px 0 20px; }
.login-editorial h1 em { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; color: #c5f467; }
.login-editorial p { color: #a5b09e; font-size: 13px; line-height: 1.8; }
.login-genres { display: flex; gap: 28px; margin-top: 31px; }
.login-genres span { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #c1cbbb; }
.login-genres svg { color: #c5f467; width: 15px; height: 15px; }
.login-story-footer { margin-top: 46px; font-size: 8px; letter-spacing: 2.4px; color: #81947a; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 70px 40px; }
.login-card { width: min(360px, 100%); padding: 0; border: 0; background: none; border-radius: 0; box-shadow: none; gap: 20px; }
.login-card > .eyebrow { color: var(--muted); font-size: 8px; letter-spacing: 1.8px; }
.login-card h2 { font-size: 38px; font-weight: 500; letter-spacing: -1.7px; line-height: 1.15; }
.login-card p.lead { font-size: 12px; line-height: 1.8; margin-top: -9px; }
.login form { gap: 21px; margin-top: 15px; }
.login .field { gap: 9px; }
.login .field > span { font-size: 11px; font-weight: 500; color: var(--text); }
.login .input { height: 52px; background: var(--surface); font-size: 12px; padding-left: 15px; }
.login .pw .icon-btn { top: 4px; }
.login .input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.login .btn-primary { min-height: 52px; margin-top: 5px; justify-content: space-between; }
.login-note { display: flex; gap: 12px; padding-top: 25px; margin-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; line-height: 1.9; }
.login-note svg { margin-top: 3px; }
.login-note span { font-size: 9px; }
.login-panel-footer { position: absolute; bottom: 32px; left: 40px; right: 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; letter-spacing: 1.3px; }
@keyframes planet-float { 50% { transform: translate(0, -14px) rotate(6deg); } }
@media (min-width: 960px) { .pane { grid-template-columns: 215px minmax(0, 1fr); gap: 25px; } }
@media (max-width: 1150px) {
  .discovery-links a { padding: 13px; gap: 9px; }
  .discovery-links strong { font-size: 11px; }
  .discovery-links a > .i { display: none; }
  .login-story { padding: 35px; }
  .login-editorial h1 { letter-spacing: -2px; }
}
@media (max-width: 959.98px) {
  :root { --topbar-h: 65px; }
  .topbar { gap: 12px; }
  .topbar .brand-symbol { width: 30px; height: 32px; border-radius: 9px 9px 9px 2px; }
  .login { grid-template-columns: 1fr 1fr; }
  .login-story { padding: 30px; }
  .login-editorial h1 { font-size: 38px; }
  .login-panel { padding: 70px 26px; }
  .login-card h2 { font-size: 32px; }
  .login-genres { gap: 16px; }
  .cinema-orbit { left: 45%; transform: translate(-50%, -50%) scale(.8); }
  .home-heading-note { display: none; }
}
@media (max-width: 640px) {
  .login { display: block; }
  .login-story { min-height: 380px; padding: 26px 27px 24px; border-right: 0; border-bottom: 1px solid #36442d; }
  .login-story .wordmark { font-size: 24px; }
  .login-story .wordmark small { font-size: 7px; margin-top: 6px; }
  .login-editorial { margin-top: 66px; }
  .login-editorial h1 { font-size: 38px; margin: 15px 0; letter-spacing: -1.8px; }
  .login-editorial p { font-size: 11px; }
  .login-genres { margin-top: 22px; gap: 26px; }
  .login-story-footer { display: none; }
  .cinema-orbit { left: 78%; top: 12%; transform: translate(-50%, -50%) scale(.62); }
  .login-story::after { background: linear-gradient(0deg, #101b15 0%, #101b15ba 50%, transparent); }
  .login-panel { padding: 40px 27px 88px; }
  .login-card { width: 100%; max-width: 400px; gap: 17px; }
  .login-card h2 { font-size: 33px; }
  .login-panel-footer { left: 27px; right: 27px; bottom: 25px; }
  .view { padding-top: 23px; }
  .home-heading { margin-bottom: 21px; }
  .home-heading h2 { font-size: 30px; letter-spacing: -1px; }
  .discovery-hero { min-height: 410px; border-radius: 15px; align-items: end; }
  .feature-content { padding: 34px 23px 69px; max-width: 100%; }
  .feature-content h2 { font-size: 36px; letter-spacing: -1.5px; max-width: 90%; margin: 17px 0; }
  .feature-art { width: 100%; opacity: .55; }
  .feature-shade { background: linear-gradient(0deg, #111b15 0%, #111b15dd 45%, #111b1520), linear-gradient(90deg, #111b1577, transparent); }
  .feature-content p { font-size: 12px; margin: 14px 0 20px; }
  .feature-content .btn { padding: 0 14px; font-size: 12px; }
  .feature-bottom { left: 23px; right: 23px; gap: 6px; }
  .feature-bottom > span:first-child { font-size: 7px; letter-spacing: .9px; }
  .hero-edition { right: 23px; font-size: 7px; }
  .discovery-links { gap: 8px; margin: 13px 0 30px; }
  .discovery-links a { padding: 13px 9px; flex-direction: column; align-items: start; gap: 10px; }
  .discovery-links strong { font-size: 10px; line-height: 1.5; }
  .discovery-links small { font-size: 9px; }
  .discovery-icon { width: 31px; height: 31px; border-radius: 8px; }
  .discovery-icon svg { width: 17px; height: 17px; }
  .section-head h2 { font-size: 19px; }
  .row { gap: 13px; }
  .row .card { width: 143px; }
  .grid { gap: 22px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Keep grid children and long provider labels inside narrow viewports. */
.login { justify-items: stretch; }
.login-story, .login-panel, .settings, .panel { min-width: 0; }
.panel .line > div { min-width: 0; }
.panel .line small { overflow-wrap: anywhere; }
.feature-bottom > span:last-child { white-space: nowrap; }
:root[data-theme="light"] { --ok: #28733f; --danger: #b52843; }
@media (max-width: 640px) {
  .panel .line { flex-wrap: wrap; }
  .panel .line select.input { width: 100%; min-width: 0; max-width: 100%; }
  .panel .switch.line { flex-wrap: nowrap; }
  .panel .line > .btn { flex-shrink: 0; }
  .settings .home-heading { margin-bottom: 0; }
}
.feature-content [data-feature-plot] { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 48ch; }
.feature-backdrop { width: 100%; object-position: center; }

/* ---------- TV guide: pinned channel rail and proportional programme grid ---------- */
.live-guide-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-guide-link .btn { min-height: 32px; color: var(--accent); }
.tv-guide { --guide-channel-width: 205px; --guide-time-width: 900px; }
.guide-toolbar { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.guide-toolbar .search-input { max-width: 390px; }
.guide-toolbar > select { width: min(270px, 35%); }
.guide-toolbar > button { margin-left: auto; padding: 0 14px; }
.guide-toolbar .input { border-radius: 9px; min-height: 46px; }
.guide-timebar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 20px; }
.guide-timebar strong { display: block; font-size: 14px; font-weight: 500; }
.guide-timebar small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.guide-time-actions { display: flex; gap: 6px; align-items: center; }
.guide-time-actions .input { width: 145px; min-height: 38px; font-size: 12px; margin-right: 8px; }
.guide-time-actions .icon-btn { width: 36px; height: 38px; border-radius: 8px; border: 1px solid var(--border); }
.guide-time-actions .btn { min-height: 38px; }
.guide-scroll { position: relative; overflow: auto; max-height: min(65dvh, 760px); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); scrollbar-width: thin; scrollbar-color: var(--surface-3) var(--surface); overscroll-behavior: contain; }
.guide-canvas { min-width: calc(var(--guide-channel-width) + var(--guide-time-width)); }
.guide-header { display: flex; height: 55px; position: sticky; top: 0; z-index: 6; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.guide-channel-heading { position: sticky; left: 0; z-index: 7; width: var(--guide-channel-width); flex: none; background: var(--surface-2); display: flex; flex-direction: column; justify-content: center; padding: 0 18px; font-size: 10px; letter-spacing: 1.8px; border-right: 1px solid var(--border); }
.guide-channel-heading span { font-size: 7px; letter-spacing: 1.5px; color: var(--muted); margin-top: 4px; }
.guide-times { display: flex; flex: 1; }
.guide-times > span { width: calc(100% / 6); padding: 19px 14px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); border-left: 1px solid var(--border); }
.guide-tracks { position: relative; }
.guide-row { display: flex; min-height: 86px; border-bottom: 1px solid var(--border); }
.guide-row:last-child { border-bottom: 0; }
.guide-channel { position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: 10px; width: var(--guide-channel-width); flex: none; padding: 13px; background: var(--surface); border-right: 1px solid var(--border); transition: background .15s; }
.guide-channel:hover, .guide-channel:focus-visible { background: var(--surface-3); }
.guide-channel-logo { position: relative; display: grid; place-items: center; flex: none; width: 35px; height: 35px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.guide-channel-logo::before { content: attr(data-initial); font: italic 19px Georgia, serif; color: var(--muted); }
.guide-channel-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); padding: 4px; }
.guide-channel-logo img.broken { display: none; }
.guide-channel > span:nth-child(2) { min-width: 0; }
.guide-channel small { color: var(--muted); font-size: 9px; display: block; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.guide-channel strong { font-size: 11px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guide-channel > svg { margin-left: auto; color: var(--accent); width: 13px; }
.guide-schedule { position: relative; flex: 1; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 6 - 1px), var(--border) calc(100% / 6 - 1px), var(--border) calc(100% / 6)); }
.guide-programme, .guide-gap { position: absolute; top: 5px; bottom: 5px; border: 1px solid var(--border); border-radius: 9px; text-align: left; padding: 12px 14px; overflow: hidden; min-width: 0; }
.guide-programme { background: var(--surface-2); border-right: 4px solid var(--surface); transition: background .15s, border-color .15s; }
.guide-programme:hover { background: var(--surface-3); border-color: var(--accent); }
.guide-programme:focus-visible { outline-offset: -3px; z-index: 3; }
.guide-programme-time { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 7px; }
.guide-programme-time i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.guide-programme strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.guide-programme.is-now { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-left: 2px solid var(--accent); }
.guide-programme.is-now strong { color: var(--accent); }
.guide-programme.is-past { opacity: .65; }
.guide-gap { display: flex; align-items: center; border: 0; font-size: 11px; color: var(--muted); }
.guide-gap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-placeholder { position: absolute; inset: 5px; display: flex; align-items: center; gap: 16px; padding: 15px; color: var(--muted); font-size: 11px; }
.guide-error { color: var(--warn); }
.guide-now-track { position: absolute; top: 0; bottom: 0; left: var(--guide-channel-width); right: 0; pointer-events: none; z-index: 2; }
.guide-now-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 20%, transparent); }
.guide-now-line > span { position: absolute; top: 0; left: -13px; padding: 3px 5px; border-radius: 0 0 5px 5px; font-size: 7px; letter-spacing: .6px; color: var(--accent-ink); background: var(--accent); }
.guide-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.guide-footer > span { font-size: 11px; color: var(--muted); }
.guide-footer > div { display: flex; gap: 8px; }
.guide-provider-note { font-size: 11px; color: var(--muted); margin-top: 20px; line-height: 1.7; }
.guide-details { display: grid; gap: 16px; padding: 10px 10px 8px; }
.guide-details > p { line-height: 1.8; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.guide-details .guide-live-note { font-size: 11px; color: var(--muted); }
.guide-details .btn { justify-self: start; }
@media (max-width: 640px) {
  .tv-guide { --guide-channel-width: 125px; --guide-time-width: 780px; }
  .tv-guide .home-heading { align-items: start; }
  .tv-guide .home-heading h2 { font-size: 27px; }
  .tv-guide .home-heading > .btn { padding: 0 11px; font-size: 11px; }
  .guide-toolbar { flex-wrap: wrap; gap: 9px; margin-top: 15px; }
  .guide-toolbar .search-input { flex: 1 1 100%; max-width: none; }
  .guide-toolbar > select { flex: 1; width: auto; min-width: 0; }
  .guide-timebar strong { font-size: 12px; }
  .guide-time-actions { width: 100%; gap: 5px; }
  .guide-time-actions .input { margin-right: auto; width: 130px; }
  .guide-channel { gap: 7px; padding: 9px; }
  .guide-channel-logo { width: 25px; height: 29px; border-radius: 6px; }
  .guide-channel strong { font-size: 10px; }
  .guide-channel > svg { display: none; }
  .guide-channel-heading { padding: 0 12px; font-size: 9px; }
  .guide-channel-heading span { font-size: 6px; }
  .guide-footer .btn { padding: 0 12px; font-size: 11px; }
  .tab { font-size: 9px; }
  .tab svg.i { width: 21px; height: 21px; }
}
.guide-scroll { scroll-padding-left: calc(var(--guide-channel-width) + 8px); scroll-padding-top: 60px; }
.guide-programme { padding: 12px 0; }
.guide-programme > span, .guide-programme > strong { padding-inline: 12px; }
.guide-programme-time i { display: none; }
.guide-programme.is-now .guide-programme-time i { display: block; }

/* Multi-screen: the viewing wall owns the viewport; channel browsing is temporary. */
.view.multi-view { animation: none; padding: 0; }
.multi-board { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.multi-toolbar { display: flex; align-items: center; gap: 12px; padding: 6px 10px; min-height: 54px; flex: none; border-bottom: 1px solid var(--border); }
.multi-toolbar strong { white-space: nowrap; }
.multi-toolbar [data-count], .multi-hint { color: var(--muted); font-size: 12px; }
.multi-grid { position: relative; flex: 1; min-height: 0; margin: 4px; }
.multi-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 24px; }
.multi-empty p { color: var(--muted); margin: 12px 0 24px; }
.multi-tile { position: absolute; overflow: hidden; border: 2px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; background: #000; }
.multi-tile.selected { border-color: var(--accent); }
.multi-tile-head { height: 28px; flex: none; display: flex; align-items: center; background: var(--surface); color: var(--text); }
.multi-tile.selected .multi-tile-head { background: var(--accent); color: var(--accent-ink); }
.multi-select { flex: 1; min-width: 0; text-align: left; padding: 3px 7px; font-size: 12px; height: 28px; }
.multi-tile-head .icon-btn { width: 28px; height: 28px; color: inherit; flex: none; }
.multi-tile .xp { flex: 1; min-height: 0; aspect-ratio: auto; }
.multi-tile .xp-controls { padding: 4px; }
.multi-tile .xp-row { gap: 0; }
.multi-tile .xp .icon-btn { width: 30px; height: 30px; }
.multi-tile .xp-vol, .multi-tile .badge-live, .multi-tile [data-a=menu], .multi-tile [data-a=pip] { display: none; }
.multi-tile .xp-error { padding: 6px; gap: 4px; font-size: 11px; overflow: auto; }
.multi-tile .xp-error > .badge, .multi-tile .xp-error [data-a=copylink] { display: none; }
.multi-tile .xp-error .btn { min-height: 26px; padding: 3px 8px; }
.multi-picker { margin: auto; width: min(520px, calc(100vw - 24px)); height: min(700px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 18px; box-shadow: var(--shadow); }
.multi-picker[open] { display: flex; flex-direction: column; gap: 12px; }
.multi-picker::backdrop { background: #0009; }
.multi-picker-head { display: flex; align-items: center; justify-content: space-between; }
.multi-picker-head h2 { font-size: 20px; }
.multi-picker > * { flex-shrink: 0; }
.multi-picker [data-limit] { font-size: 12px; }
.multi-picker [data-channels] { flex: 1; min-height: 0; overflow: auto; }
.multi-channel { width: 100%; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.multi-channel:hover, .multi-channel:focus-visible { background: var(--surface-2); color: var(--accent); }
@media (max-width: 600px) { .multi-hint { display: none; } .multi-toolbar { gap: 6px; padding: 4px; } .multi-toolbar strong { font-size: 13px; } .multi-toolbar .btn { padding: 6px 8px; } .multi-toolbar .icon-btn { width: 32px; } .tab { min-width: 0; } .tab span { font-size: 9px; } }
.multi-toolbar .grow { flex: 1; }

/* Multi-screen tools share the active theme and leave the wall free of side panels. */
.multi-toolbar { flex-wrap: wrap; gap: 7px; }
.multi-toolbar .btn[aria-pressed="true"], .multi-quick [aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.multi-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 24px; padding: 3px 12px; font-size: 11px; color: var(--muted); }
.multi-status button { text-decoration: underline; text-underline-offset: 3px; flex: none; }
.multi-status .full { color: var(--warn); }
.multi-status > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-empty .btn { margin: 4px; }
.multi-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.multi-programmes { position: absolute; inset: 0 0 auto; z-index: 3; display: grid; gap: 4px; padding: 7px; background: linear-gradient(#000e, #0009); color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .15s; max-height: 65%; overflow: hidden; }
.multi-programmes span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-programmes b { font-size: 10px; margin-right: 5px; color: #fff; opacity: .8; }
.multi-tile.show-programme .multi-programmes, .multi-tile:has(:focus-visible) .multi-programmes { opacity: 1; }
@media (hover: hover) { .multi-tile:hover .multi-programmes { opacity: 1; } }
.multi-tile .xp.errored .multi-programmes { display: none; }
.multi-tile-head .multi-move { display: none; }
.reordering .multi-select { cursor: grab; touch-action: none; }
.reordering .multi-tile-head .multi-move { display: inline-flex; }
.reordering .multi-tile-head [data-change], .reordering .multi-tile-head [data-remove] { display: none; }
.multi-tile.drop-target { outline: 3px dashed var(--accent); outline-offset: -5px; }
.lineup-save { display: grid; gap: 6px; }
.lineup-save > div { display: flex; gap: 8px; }
.lineup-save input { min-width: 0; flex: 1; }
.lineup-list { overflow: auto; flex: 1; min-height: 0; }
.lineup-entry { padding: 14px 0; border-bottom: 1px solid var(--border); }
.lineup-entry h3 { font-size: 16px; overflow-wrap: anywhere; }
.lineup-entry p { font-size: 12px; color: var(--muted); margin: 5px 0 10px; overflow-wrap: anywhere; }
.lineup-entry > div { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.lineup-entry .lineup-warning { color: var(--warn); }
.multi-connection-dialog { height: auto; }
.multi-connection-dialog p { line-height: 1.7; }
.multi-picker [data-lineup-message]:empty { display: none; }
.guide-details-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-reminder-mark { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--accent); margin-top: 4px; }
.guide-reminder-mark svg { height: 11px; width: 11px; }
.guide-reminders article { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--border); }
.guide-reminders p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.guide-reminders > p { padding: 20px 0; }
.reminder-alerts { position: fixed; z-index: 250; bottom: max(16px, env(safe-area-inset-bottom)); right: 16px; width: min(460px, calc(100vw - 32px)); display: grid; gap: 10px; max-height: 50dvh; overflow: auto; }
.reminder-alerts:empty { display: none; }
.reminder-alert { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.reminder-alert > div { flex: 1; min-width: 0; }
.reminder-alert strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.reminder-alert small { color: var(--muted); font-size: 10px; }
.reminder-alert .icon-btn { flex: none; }
@media (max-width: 600px) {
  .multi-toolbar { gap: 5px; }
  .multi-toolbar strong { margin-right: auto; }
  .multi-toolbar .grow { display: none; }
  .multi-toolbar .btn { font-size: 11px; min-height: 32px; }
  .multi-toolbar [data-lineups] { margin-left: auto; }
  .multi-status { padding-inline: 7px; font-size: 10px; }
  .multi-programmes { font-size: 10px; gap: 2px; padding: 4px; }
  .multi-picker { padding: 12px; gap: 8px; }
  .reminder-alerts { bottom: calc(var(--tabbar-h) + 10px); }
  .multi-board .reminder-alerts { bottom: 12px; }
  .conn-badge { max-width: 45vw; font-size: 10px; }
}
.conn-badge { overflow: hidden; text-overflow: ellipsis; }

/* Features field guide: editorial introduction, a local CSS illustration and searchable cards. */
.features-page { max-width: 1500px; margin: 0 auto; }
.features-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(22px, 4vw, 64px); align-items: center; padding: clamp(24px, 4vw, 58px); border: 1px solid var(--border); border-radius: var(--radius); background: radial-gradient(ellipse at 95% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%), var(--surface); overflow: hidden; }
.features-intro h2 { font-family: var(--theme-heading-font); font-size: clamp(42px, 5.2vw, 80px); line-height: 1.02; letter-spacing: -2.8px; margin: 20px 0; font-weight: 700; }
.features-intro h2 em { color: var(--accent); font-style: normal; }
.features-intro > p { color: var(--muted); font-size: 15px; line-height: 1.9; }
.features-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.features-hero-actions .btn { font-size: 12px; }
.features-stats { display: flex; flex-wrap: wrap; gap: 24px; border-top: 1px solid var(--border); padding-top: 24px; margin-top: 34px; }
.features-stats span { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.features-stats strong { color: var(--text); font-family: var(--theme-heading-font); font-size: 25px; letter-spacing: -.8px; }
.features-art { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 82%, transparent); transform: rotate(-3deg); box-shadow: 0 22px 65px #0002; }
.features-art-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 8px; letter-spacing: 1.5px; color: var(--muted); padding: 0 0 17px; }
.features-art-label > span:first-child { display: flex; align-items: center; gap: 7px; }
.features-art-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.features-demo-wall { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.features-demo-screen { aspect-ratio: 1.5; position: relative; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); border-radius: max(2px, calc(var(--radius-sm) / 2)); isolation: isolate; }
.features-demo-screen > span { position: absolute; top: 8px; left: 9px; z-index: 1; font-size: 9px; color: var(--muted); }
.features-demo-screen small { position: absolute; left: 9px; bottom: 8px; z-index: 1; font-size: 7px; letter-spacing: 1px; color: var(--text); }
.features-demo-scene { position: absolute; inset: 0; opacity: .55; }
.screen-0 { grid-row: span 2; aspect-ratio: auto; border: 2px solid var(--accent); }
.screen-0 .features-demo-scene { inset: 32px 15px 46px; border: 1px solid var(--accent); background: repeating-linear-gradient(90deg, transparent 0 22%, color-mix(in srgb, var(--accent) 12%, transparent) 22% 44%); }
.screen-0 .features-demo-scene::after { content: ''; position: absolute; width: 58%; aspect-ratio: 1; border: 1px solid var(--accent); border-radius: 50%; left: 21%; top: 28%; }
.screen-0 .features-demo-scene::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--accent); }
.screen-0 small { bottom: 30px; }
.features-demo-screen b { position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; font-size: 6px; letter-spacing: .5px; display: flex; align-items: center; gap: 4px; background: var(--accent); color: var(--accent-ink); }
.features-demo-screen b svg { width: 10px; height: 10px; }
.screen-1 .features-demo-scene { background: linear-gradient(90deg, transparent 10%, var(--accent) 10% 25%, transparent 25% 31%, var(--accent) 31% 44%, transparent 44% 50%, var(--accent) 50% 68%, transparent 68% 75%, var(--accent) 75% 91%, transparent 91%); clip-path: polygon(0 90%, 0 55%, 25% 55%, 25% 35%, 45% 35%, 45% 48%, 60% 48%, 60% 15%, 77% 15%, 77% 45%, 100% 45%, 100% 90%); }
.screen-2 .features-demo-scene { background: repeating-radial-gradient(ellipse at 60% 70%, transparent 0 10px, var(--accent) 11px 12px, transparent 13px 23px); opacity: .22; }
.screen-3 .features-demo-scene { background: radial-gradient(circle at 70% 30%, var(--accent) 0 15%, transparent 16%), linear-gradient(140deg, transparent 40%, var(--accent) 41% 53%, transparent 54%); opacity: .28; }
.screen-4 .features-demo-scene { background: repeating-linear-gradient(125deg, transparent 0 22px, var(--accent) 23px 24px, transparent 25px 42px); opacity: .22; }
.screen-5 { grid-column: span 2; aspect-ratio: 5; }
.screen-5 .features-demo-scene { background: radial-gradient(ellipse at 85% 50%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 65%); }
.features-art-caption { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.features-art-caption strong { color: var(--text); font-size: 17px; font-family: var(--theme-heading-font); }
.features-art-caption > svg { color: var(--accent); width: 28px; height: 28px; }
.features-directory { margin-top: 52px; }
.features-directory-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 23px; }
.features-directory-heading h2 { font-family: var(--theme-heading-font); font-size: clamp(25px, 3vw, 36px); line-height: 1.2; letter-spacing: -1px; margin-top: 8px; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.features-directory-heading > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.features-search { max-width: 560px; }
.features-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 26px; }
.features-filters .btn { border-radius: 999px; }
.features-filters [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.features-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.features-card { display: flex; flex-direction: column; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.features-card-top { display: flex; gap: 12px; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.features-card-top small { margin-left: auto; font-size: 11px; color: var(--muted); }
.features-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); flex: none; }
.features-card h3 { font-family: var(--theme-heading-font); font-size: clamp(23px, 2.2vw, 30px); margin-top: 23px; letter-spacing: -.8px; line-height: 1.2; }
.features-card-intro { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 10px 0 21px; }
.features-card ul { list-style: none; padding: 0; margin: 0 0 24px; }
.features-card li { display: flex; gap: 11px; padding: 15px 0; border-top: 1px solid var(--border); }
.features-check { color: var(--accent); flex: none; padding-top: 2px; }
.features-check svg { width: 14px; height: 14px; }
.features-card h4 { font-size: 13px; font-weight: 700; line-height: 1.6; }
.features-card li p { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 4px; }
.features-card-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 17px; border-top: 1px solid var(--border); color: var(--accent); font-size: 12px; font-weight: 700; min-height: 44px; }
.features-card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.features-no-results { text-align: center; padding: 56px 20px; border: 1px dashed var(--border); border-radius: var(--radius); }
.features-no-results > svg { color: var(--accent); margin-bottom: 15px; }
.features-no-results p { color: var(--muted); margin: 10px 0 20px; }
.features-fineprint { display: flex; gap: 18px; align-items: center; margin: 28px 0 15px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.features-fineprint-icon { color: var(--accent); flex: none; }
.features-fineprint h3 { font-size: 14px; margin-bottom: 7px; }
.features-fineprint p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.features-fineprint .btn { flex: none; }
.features-home-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.features-home-link:hover { color: var(--accent); }
@media (max-width: 1100px) { .features-hero { gap: 26px; padding: 28px; } .features-art { padding: 12px; } .features-stats { gap: 18px; } }
@media (max-width: 700px) {
  .features-hero { grid-template-columns: 1fr; padding: 24px; gap: 35px; }
  .features-intro h2 { font-size: 56px; }
  .features-art { transform: rotate(-2deg); max-width: 420px; width: 100%; margin: 0 auto 6px; }
  .features-stats { gap: 22px; }
  .features-directory { margin-top: 35px; }
  .features-directory-heading { align-items: start; flex-direction: column; gap: 10px; }
  .features-cards { grid-template-columns: 1fr; }
  .features-fineprint { flex-wrap: wrap; padding: 20px; }
  .features-fineprint > div { flex: 1; min-width: 180px; }
  .features-fineprint .btn { margin-left: 42px; }
  .features-filters .btn { font-size: 11px; padding-inline: 12px; }
  .features-home-link { font-size: 11px; }
  .settings > .home-heading { gap: 14px; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .features-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .features-stats span { font-size: 9px; }
  .features-stats strong { font-size: 24px; }
}
