/* =====================================================================
   nova-themes.css — Madar design tokens + shared components
   Each layout file only changes structure; colours, radii and fonts
   come from the tokens below, switched by <html data-layout="…">.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root,
[data-layout="apple"] {
  /* graphite gradient, visionOS-style glass */
  color-scheme: dark;
  --bg: #2b2d32;
  --bg-fx: radial-gradient(1100px 650px at 85% -15%, rgba(150,156,170,.45) 0, transparent 60%),
           radial-gradient(900px 600px at 0% 110%, rgba(110,116,130,.28) 0, transparent 60%),
           linear-gradient(160deg, #50535b 0%, #393b41 38%, #26272b 100%);
  --s1: rgba(255,255,255,.075);
  --s2: rgba(255,255,255,.11);
  --s3: rgba(255,255,255,.18);
  --line: rgba(255,255,255,.12);
  --ink: #f5f5f7;
  --mute: #b9bcc4;
  --acc: #0a84ff;
  --acc-soft: rgba(10,132,255,.22);
  --live: #ff453a;
  --pri-bg: #f5f5f7;  --pri-ink: #1c1c1e;
  --sec-bg: rgba(255,255,255,.16);
  --r: 24px;
  --rc: 18px;
  --rp: 16px;
  --side: 220px;
  --font: "Readex Pro", system-ui, sans-serif;
  --font-h: "Readex Pro", system-ui, sans-serif;
  --h-w: 500;
  --hero-h: 380px;
  --glass: blur(28px) saturate(1.5);
}
[data-layout="netflix"] {
  --bg: #141414; --bg-fx: none;
  --s1: #1c1c1c; --s2: #262626; --s3: #333;
  --line: rgba(255,255,255,.08);
  --ink: #fff; --mute: #a3a3a3;
  --acc: #e5383b; --acc-soft: rgba(229,56,59,.18);
  --live: #e5383b;
  --pri-bg: #fff; --pri-ink: #000;
  --sec-bg: rgba(109,109,110,.7);
  --r: 6px; --rc: 4px; --rp: 4px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-h: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --h-w: 700; --hero-h: 78vh;
}
[data-layout="prime"] {
  --bg: #0f171e; --bg-fx: linear-gradient(180deg, #13212c 0, transparent 420px);
  --s1: #1a242f; --s2: #232f3e; --s3: #2d3b4c;
  --line: rgba(255,255,255,.07);
  --ink: #f2f4f8; --mute: #8197a4;
  --acc: #1a98ff; --acc-soft: rgba(26,152,255,.16);
  --live: #ff5a5f;
  --pri-bg: #1a98ff; --pri-ink: #fff;
  --sec-bg: rgba(255,255,255,.12);
  --r: 12px; --rc: 8px; --rp: 8px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-h: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --h-w: 700; --hero-h: 420px;
}
[data-layout="disney"] {
  --bg: #0b0f2e;
  --bg-fx: radial-gradient(120% 70% at 50% -10%, #1b2a6b 0, #0e1440 45%, #0b0f2e 75%);
  --s1: rgba(255,255,255,.06); --s2: rgba(255,255,255,.1); --s3: rgba(255,255,255,.16);
  --line: rgba(255,255,255,.1);
  --ink: #f9f9f9; --mute: #a9b0d0;
  --acc: #4f8bff; --acc-soft: rgba(79,139,255,.18);
  --live: #ff4d6d;
  --pri-bg: #f9f9f9; --pri-ink: #0b0f2e;
  --sec-bg: rgba(0,0,0,.35);
  --r: 14px; --rc: 10px; --rp: 10px;
  --font: "Readex Pro", system-ui, sans-serif;
  --font-h: "Readex Pro", system-ui, sans-serif;
  --h-w: 600; --hero-h: 440px;
}
[data-layout="hbo"] {
  --bg: #0b0612;
  --bg-fx: radial-gradient(900px 520px at 90% -5%, #3a1660 0, transparent 60%),
           radial-gradient(700px 500px at 0% 110%, #1d0b3a 0, transparent 60%);
  --s1: #170e24; --s2: #22163a; --s3: #2e1f4b;
  --line: rgba(255,255,255,.07);
  --ink: #f4f0fa; --mute: #a596bd;
  --acc: #a970ff; --acc-soft: rgba(169,112,255,.18);
  --live: #ff4d7d;
  --pri-bg: #f4f0fa; --pri-ink: #160b26;
  --sec-bg: rgba(255,255,255,.1);
  --r: 4px; --rc: 4px; --rp: 4px;
  --side: 84px;
  --font: "Readex Pro", system-ui, sans-serif;
  --font-h: "Noto Naskh Arabic", "Readex Pro", serif;
  --h-w: 700; --hero-h: 72vh;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; min-width: 0; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  background: var(--bg-fx), var(--bg); background-attachment: fixed;
  color: var(--ink); font: 15px/1.6 var(--font);
  transition: background-color .4s;
}
button, select, input, textarea { font: inherit; color: inherit; }
button, a, label.btn { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-h); font-weight: var(--h-w); margin: 0; }
h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; text-wrap: balance; }
h2 { font-size: 17px; }
.lead { color: var(--mute); margin: 8px 0 0; max-width: 56ch; }

/* ---------- 3. Shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
aside {
  position: sticky; top: 0; height: 100vh; z-index: 6;
  padding: 26px 14px; display: flex; flex-direction: column; gap: 2px;
  border-inline-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; padding: 0 12px 26px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.sec { font-size: 11px; color: var(--mute); padding: 18px 12px 6px; }
nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 42px;
  border-radius: 12px; color: var(--mute); font-size: 14px; transition: background .2s, color .2s;
}
nav a svg { width: 18px; height: 18px; flex: none; }
nav a:hover { color: var(--ink); }
nav a.on { color: var(--ink); background: var(--s2); }
.side-foot { margin-top: auto; padding: 14px; border-radius: var(--rc); background: var(--s1); font-size: 12px; color: var(--mute); }
.side-foot b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.meter { height: 4px; border-radius: 4px; background: var(--s2); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--acc), var(--live)); }

main { padding: 26px clamp(16px, 3vw, 40px) 48px; width: 100%; max-width: 1400px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--s1); border-radius: 12px; padding: 0 14px; min-height: 42px; width: min(360px, 100%); color: var(--mute); }
.search svg { flex: none; }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 14px; color: var(--ink); }
/* status: weather + time */
.status { display: flex; align-items: center; gap: 8px; }
.status > span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 999px; background: rgba(0,0,0,.35); backdrop-filter: blur(12px); white-space: nowrap; }
.status svg { width: 22px; height: 22px; }
.status b { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.status small { color: var(--mute); font-size: 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); backdrop-filter: blur(12px); }
.icon-btn svg { width: 20px; height: 20px; }
.lay-wrap { position: relative; }
.lay-pop { position: absolute; top: 50px; inset-inline-end: 0; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--s2); box-shadow: 0 20px 50px rgba(0,0,0,.6); z-index: 30; display: flex; flex-direction: column; }
.lay-pop[hidden] { display: none; }
.lay-pop button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-size: 14px; text-align: start; }
.lay-pop button:hover { background: var(--s3); }
.lay-pop button.on { background: var(--acc-soft); }
.lay-pop i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.meta { display: flex; align-items: center; gap: 16px; color: var(--mute); font-size: 13px; white-space: nowrap; }
.meta b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.theme-pick { width: auto; min-height: 38px; padding: 4px 34px 4px 12px; font-size: 13px; border-radius: 999px; }

.view { display: none; }
.view.on { display: block; animation: in .35s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.foot { font-size: 12px; color: var(--mute); margin-top: 26px; max-width: 80ch; }

/* ---------- 4. Components ---------- */
.card { background: var(--s1); border-radius: var(--r); padding: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--s2); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .2s, transform .2s, opacity .2s;
}
.btn:hover { background: var(--s3); }
.btn svg { width: 18px; height: 18px; }
.btn.pri { background: var(--pri-bg); color: var(--pri-ink); }
.btn.pri:hover { opacity: .88; }
.btn.ghost { background: var(--sec-bg); color: #fff; backdrop-filter: blur(8px); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
select, input[type=text], input[type=password], textarea {
  width: 100%; background: var(--s2); border: 0; border-radius: 12px; min-height: 44px; padding: 8px 12px; font-size: 16px;
}
select option { background: #1d1d24; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--s2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 9px; min-height: 38px; font-size: 13px; color: var(--mute); }
.seg button.on { background: var(--s3); color: var(--ink); }
.bar { height: 4px; border-radius: 4px; background: var(--s2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .3s; }
.msg { font-size: 12px; color: var(--mute); margin-top: 8px; }
.hr { height: 1px; background: var(--line); margin: 22px 0; }
.toast { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; background: var(--pri-bg); color: var(--pri-ink); padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; max-width: 90vw; }
.toast.on { opacity: 1; }

/* ---------- 5. Home: billboard ---------- */
.home-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.billboard { grid-column: span 8; position: relative; overflow: hidden; border-radius: var(--r); min-height: var(--hero-h); display: flex; background: #000; }
.billboard canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.billboard .shade { position: absolute; inset: 0; background: linear-gradient(270deg, rgba(0,0,0,.88) 0, rgba(0,0,0,.55) 42%, rgba(0,0,0,0) 100%); }
.billboard .txt { position: relative; padding: 32px; display: flex; flex-direction: column; justify-content: flex-end; max-width: 520px; }
.bb-status { font-size: 12px; color: #7ee2a8; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bb-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bb-title { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.05; }
.bb-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 13px; color: #d0d0d8; }
.bb-meta span + span::before { content: "·"; margin-inline-end: 8px; opacity: .6; }
.bb-meta .tag { border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 0 6px; }
.bb-meta .tag::before { content: none; }
.bb-desc { color: #c8c6d2; margin: 12px 0 0; max-width: 46ch; }
.bb-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.bb-badge { display: none; }

.today { grid-column: span 4; display: flex; flex-direction: column; }
.big { font-size: 52px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.date { color: var(--mute); font-size: 13px; margin-top: 8px; }
.wx { display: flex; align-items: center; gap: 14px; }
.wx svg { width: 46px; height: 46px; flex: none; }
.wx b { font-size: 28px; font-weight: 400; }
.wx span { color: var(--mute); font-size: 13px; display: block; }
.cities { display: flex; justify-content: space-between; margin-top: auto; padding-top: 20px; font-size: 13px; color: var(--mute); }
.cities b { display: block; color: var(--ink); font-weight: 500; font-size: 15px; }

/* feature tiles */
.tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tile { border-radius: var(--r); padding: 20px; min-height: 190px; display: flex; flex-direction: column; color: #fff; position: relative; overflow: hidden; transition: transform .25s; }
.tile:hover { transform: translateY(-3px); }
.tile .lab { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.tile .lab svg { width: 18px; height: 18px; opacity: .85; }
.tile .k { font-size: 44px; font-weight: 400; line-height: 1; margin-top: 20px; font-variant-numeric: tabular-nums; }
.tile .k small { font-size: 13px; margin-inline-start: 6px; opacity: .85; }
.tile p { margin: 8px 0 0; font-size: 13px; opacity: .75; }
.tile .go { margin-top: auto; align-self: flex-start; background: rgba(0,0,0,.22); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.t1 { background: radial-gradient(120% 90% at 80% 10%, #e0304d 0, #a3122a 55%, #5a0a18 100%); }
.t2 { background: radial-gradient(120% 90% at 80% 10%, #8fa21f 0, #56640f 55%, #262c06 100%); }
.t3 { background: radial-gradient(120% 90% at 80% 10%, #4152f0 0, #2229b0 55%, #10145e 100%); }
.t4 { background: radial-gradient(120% 90% at 80% 10%, #1aa0d4 0, #0d6b90 55%, #06374b 100%); }

/* ---------- 6. Home: content rows ---------- */
.rows { margin-top: 30px; display: flex; flex-direction: column; gap: 30px; }
.rowh { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 12px; }
.rowh a { font-size: 13px; color: var(--mute); }
.rowh a:hover { color: var(--ink); }
.rail-x {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 10px; scrollbar-width: none;
}
.rail-x::-webkit-scrollbar { display: none; }
.rail-x > * { scroll-snap-align: start; flex: none; }

.wcard { width: 260px; border: 0; padding: 0; background: none; text-align: start; }
.wcard .th { position: relative; aspect-ratio: 16/9; border-radius: var(--rc); overflow: hidden; background: var(--s1); transition: transform .25s, box-shadow .25s; }
.wcard .th svg { display: block; width: 100%; height: 100%; }
.wcard .pg { position: absolute; inset-inline: 10px; bottom: 8px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.wcard .pg i { display: block; height: 100%; background: var(--acc); }
.wcard .nm { display: block; font-size: 14px; margin-top: 8px; }
.wcard .sb { display: block; font-size: 12px; color: var(--mute); }
.wcard:hover .th { transform: translateY(-3px); }

.pcard { width: 150px; border: 0; padding: 0; background: none; text-align: start; position: relative; }
.pcard svg { display: block; width: 100%; aspect-ratio: 2/3; border-radius: var(--rp); transition: transform .25s, box-shadow .25s; }
.pcard:hover svg { transform: scale(1.04); }
.pcard .rank { display: none; }

.cat { width: 190px; aspect-ratio: 16/9; border-radius: var(--rc); display: grid; place-items: center; font-weight: 600; font-size: 16px; color: #fff; position: relative; overflow: hidden; border: 0; transition: transform .25s, box-shadow .25s; }
.cat svg { position: absolute; top: 12px; inset-inline-start: 12px; width: 22px; height: 22px; opacity: .55; }
.cat:hover { transform: translateY(-3px); }

.mini-match { width: 280px; padding: 14px; border-radius: var(--rc); background: var(--s1); display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; font-size: 13px; }
.mini-match .sc { font-variant-numeric: tabular-nums; font-size: 18px; color: var(--live); text-align: center; white-space: nowrap; }
.mini-match .sc small { display: block; font-size: 11px; }
.mini-match span:last-child { text-align: end; }

/* ---------- 7. Live player ---------- */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.screen { position: relative; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.screen canvas, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.screen video { display: none; }
.cap { position: absolute; inset-inline: 8%; bottom: 7%; text-align: center; pointer-events: none; }
.capbar span { background: rgba(0,0,0,.7); padding: 3px 12px; border-radius: 8px; font-size: clamp(15px, 2vw, 22px); line-height: 1.75; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.cap small { display: block; color: #c9cdf5; font-size: clamp(12px, 1.3vw, 14px); margin-top: 4px; }
.pill { position: absolute; top: 14px; inset-inline-start: 14px; background: var(--live); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.under { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 4px 22px; flex-wrap: wrap; }
.under b { font-size: 18px; font-weight: 500; }
.under span { color: var(--mute); font-size: 13px; display: block; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chips button { flex: none; border: 0; background: var(--s1); color: var(--mute); border-radius: 999px; padding: 0 14px; min-height: 36px; font-size: 13px; }
.chips button.on { background: var(--pri-bg); color: var(--pri-ink); }
.rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--rc); border: 0; background: var(--s1); text-align: start; min-height: 56px; transition: background .2s; }
.ch:hover { background: var(--s2); }
.ch.on { background: var(--s2); box-shadow: inset 0 0 0 1px var(--acc); }
.ch span { font-size: 13px; line-height: 1.35; }
.ch small { display: block; color: var(--mute); font-size: 11px; }
.logo { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff; }
.ai { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.ai h2 { display: flex; align-items: center; gap: 8px; }
.ai h2 svg { width: 18px; height: 18px; color: var(--acc); }
.fld label { display: block; font-size: 12px; color: var(--mute); margin-bottom: 6px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.tg { width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--s2); position: relative; flex: none; transition: background .2s; }
.tg::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 20px; height: 20px; border-radius: 50%; background: #77757f; transition: all .2s; }
.tg[aria-pressed=true] { background: var(--acc); }
.tg[aria-pressed=true]::after { inset-inline-start: 22px; background: #fff; }
details summary { cursor: pointer; font-size: 13px; color: var(--mute); list-style: none; }
details summary::-webkit-details-marker { display: none; }
.cues { margin-top: 10px; max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.cues div { font-size: 13px; padding: 8px 10px; border-radius: 10px; }
.cues div.on { background: var(--s2); }
.cues em { display: block; font-style: normal; color: var(--mute); direction: ltr; text-align: left; font-size: 11px; }

/* ---------- 8. Library ring ---------- */
.ringwrap { position: relative; height: clamp(320px, 40vw, 430px); perspective: 1500px; overflow: hidden; border-radius: var(--r); background: radial-gradient(50% 60% at 50% 105%, var(--acc-soft), transparent 70%), var(--s1); }
.ring { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.ring button { position: absolute; left: 0; top: 0; width: clamp(120px, 14vw, 170px); aspect-ratio: 2/3; translate: -50% -50%; border: 0; padding: 0; border-radius: var(--rp); overflow: hidden; background: none; box-shadow: 0 24px 50px rgba(0,0,0,.55); backface-visibility: hidden; }
.ring svg { display: block; width: 100%; height: 100%; }
.rnav { position: absolute; bottom: 16px; inset-inline: 0; display: flex; justify-content: center; gap: 10px; }
.picked { display: flex; gap: 22px; align-items: center; margin-top: 18px; }
.picked .pp { width: 96px; flex: none; border-radius: var(--rp); overflow: hidden; }
.picked .pp svg { display: block; width: 100%; }
.picked h2 { font-size: 22px; }
.picked .m { color: var(--mute); font-size: 13px; margin: 4px 0 14px; }

/* ---------- 9. Sports ---------- */
.lgrp { margin-bottom: 22px; }
.lgrp h2 { font-size: 13px; color: var(--mute); font-weight: 400; font-family: var(--font); margin: 0 4px 10px; }
.match { display: grid; grid-template-columns: minmax(0,1fr) 110px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--rc); background: var(--s1); }
.tm { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.crest { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; }
.score { text-align: center; font-variant-numeric: tabular-nums; font-size: 20px; white-space: nowrap; }
.score small { display: block; font-size: 11px; color: var(--mute); }
.score.lv, .score.lv small { color: var(--live); }

/* ---------- 10. Multiview ---------- */
.multi { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi.l13 { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.multi.l13 .slot:first-child { grid-row: 1 / 4; aspect-ratio: auto; }
.slot { position: relative; border-radius: var(--rc); overflow: hidden; background: #000; aspect-ratio: 16/9; outline: 2px solid transparent; outline-offset: -2px; cursor: pointer; transition: outline-color .2s; }
.slot.focus { outline-color: var(--acc); }
.slot canvas, .slot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot video { display: none; }
.slot .sbar { position: absolute; inset-inline: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.slot:hover .sbar, .slot.focus .sbar, .slot:focus-within .sbar { opacity: 1; }
.slot select { min-height: 34px; font-size: 13px; padding: 2px 10px; background: rgba(0,0,0,.72); }
.slot .snd { position: absolute; top: 10px; inset-inline-end: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.slot .snd svg { width: 15px; height: 15px; }

/* ---------- 11. Playlist ---------- */
.two { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 18px; align-items: start; }
textarea { min-height: 200px; direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: 12px; margin-top: 14px; }
.stat { display: flex; gap: 28px; margin-top: 18px; }
.stat b { display: block; font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--mute); }
.stack { display: grid; gap: 10px; margin-top: 14px; }

/* ---------- 12. Top-nav mode (shared by netflix / prime / disney) ---------- */
[data-nav="top"] .app { grid-template-columns: minmax(0, 1fr); }
[data-nav="top"] aside {
  position: fixed; inset: 0 0 auto 0; height: 68px; flex-direction: row; align-items: center;
  padding: 0 clamp(16px, 3vw, 40px); gap: 18px; border: 0; overflow-x: auto;
  background: linear-gradient(180deg, rgba(0,0,0,.75), transparent);
  transition: background .3s;
}
[data-nav="top"] aside.solid { background: var(--bg); }
[data-nav="top"] .brand { padding: 0; }
[data-nav="top"] nav { display: flex; gap: 4px; }
[data-nav="top"] nav a { flex: none; white-space: nowrap; background: none; padding: 8px 10px; }
[data-nav="top"] nav a svg,
[data-nav="top"] .sec,
[data-nav="top"] .side-foot { display: none; }
main { --pis: clamp(16px, 3vw, 40px); --pie: clamp(16px, 3vw, 40px); --bleed-s: calc(50% - 50vw); --bleed-e: calc(50% - 50vw); }
[data-nav="top"] main { padding-top: 84px; margin-inline: auto; }
.top { position: fixed; top: 12px; inset-inline-end: clamp(16px, 3vw, 40px); z-index: 7; margin: 0; }
[data-nav="top"] .search { width: 42px; padding: 0 13px; background: rgba(0,0,0,.4); transition: width .25s; overflow: hidden; }
[data-nav="top"] .search:focus-within { width: 220px; }
[data-nav="top"] nav a.tool { padding: 8px; }
[data-nav="top"] nav a.tool svg { display: block; width: 20px; height: 20px; }
[data-nav="top"] nav a.tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-nav="top"] nav .tool:first-of-type { margin-inline-start: 10px; }

@media (prefers-reduced-motion: reduce) {
  .view.on { animation: none; }
  * { transition: none !important; }
}

/* ---------- 13. Hero strip (featured switcher) ---------- */
.bb-strip { position: absolute; bottom: 22px; inset-inline-end: 24px; display: none; gap: 10px; z-index: 2; }
.bb-strip button { width: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; opacity: .65; transition: all .25s; }
.bb-strip button svg { display: block; width: 100%; }
.bb-strip button.on, .bb-strip button:hover { opacity: 1; border-color: #fff; transform: translateY(-4px); }

/* ---------- 14. Kids ---------- */
.kids-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: clamp(22px, 4vw, 44px); border-radius: 28px;
  background: radial-gradient(80% 120% at 0% 0%, #ffb347 0, transparent 55%), linear-gradient(135deg, #6a5cff, #ff5fa2); color: #fff; overflow: hidden; }
.kids-hero h1 { font-family: "Tajawal", var(--font); font-weight: 800; font-size: clamp(32px, 4.5vw, 52px); }
.kids-hero p { margin: 10px 0 0; font-size: 16px; opacity: .92; max-width: 40ch; }
.kids-art { width: 100%; max-height: 240px; }
.kbadge { display: inline-block; background: rgba(255,255,255,.22); border-radius: 999px; padding: 4px 12px; font-size: 13px; margin-bottom: 12px; }
.kids-hero .btn.pri { background: #fff; color: #5b2bd6; border-radius: 999px; }
.kids-hero .btn.ghost { border-radius: 999px; }
.pcard.kid svg { border-radius: 24px; }
.pcard.kid:hover svg { transform: scale(1.06) rotate(-1.5deg); }
#v-kids .wcard .th { border-radius: 22px; }

/* ---------- 15. Settings ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.set-grid .card { display: flex; flex-direction: column; gap: 14px; }
.set-wide { grid-column: 1 / -1; }
.lay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.lay-card { border: 2px solid transparent; background: var(--s2); border-radius: 14px; padding: 10px; text-align: start; display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, transform .2s; }
.lay-card:hover { transform: translateY(-2px); }
.lay-card.on { border-color: var(--acc); }
.lay-card svg { width: 100%; display: block; border-radius: 8px; margin-bottom: 6px; }
.lay-card b { font-size: 14px; font-weight: 600; }
.lay-card span { font-size: 12px; color: var(--mute); line-height: 1.5; }
.acct { display: flex; align-items: center; gap: 14px; }
.acct b { display: block; font-weight: 500; }
.av { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 22px; color: #fff; flex: none; }

/* ---------- 16. Profile chooser (logout) ---------- */
.who { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 0%, #1b1a2b, #08080b); padding: 24px; animation: in .3s ease; }
.who[hidden] { display: none; }
.who-in { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.who-msg { margin: 0; font-size: 13px; color: #7ee2a8; }
.who h1 { font-size: clamp(28px, 4vw, 44px); color: #fff; margin-bottom: 18px; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 34px); }
.profiles button { border: 0; background: none; color: #b8b6c4; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 15px; transition: color .2s; }
.profiles .av { width: clamp(84px, 11vw, 130px); height: clamp(84px, 11vw, 130px); border-radius: 22px; font-size: clamp(30px, 4vw, 46px); outline: 3px solid transparent; outline-offset: 4px; transition: outline-color .2s, transform .2s; }
.profiles button:hover, .profiles button:focus-visible { color: #fff; outline: 0; }
.profiles button:hover .av, .profiles button:focus-visible .av { outline-color: #fff; transform: scale(1.05); }

/* ---------- 17. Side mode: transparent glass sidebar floating over content ---------- */
[data-nav="side"] .app { grid-template-columns: minmax(0, 1fr); }
[data-nav="side"] aside {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); height: 100vh;
  background: linear-gradient(270deg, rgba(8,8,12,.55), rgba(8,8,12,.28));
  backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6);
  border-inline-end: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 60px rgba(0,0,0,.25);
}
[data-nav="side"] main {
  --pis: calc(var(--side) + clamp(16px, 3vw, 40px));
  --bleed-s: calc(-1 * var(--pis)); --bleed-e: calc(-1 * var(--pie));
  max-width: none; padding-top: 84px; padding-inline: var(--pis) var(--pie);
}
[data-nav="side"] nav a { color: rgba(255,255,255,.72); }
[data-nav="side"] nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
[data-nav="side"] nav a.on svg { color: var(--acc); }
[data-nav="side"] nav a:hover:not(.on) { background: rgba(255,255,255,.06); }
[data-nav="side"] .side-foot { background: rgba(255,255,255,.06); }
.bname { font-weight: 600; letter-spacing: .2px; }
.bname b { color: var(--acc); font-weight: 800; }

/* ---------- 18. Modals: pre-play sheet + search ---------- */
.modal { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); animation: in .25s ease; }
.modal[hidden] { display: none; }
.sheet { position: relative; width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--s1); border-radius: var(--r); padding: 24px; box-shadow: 0 40px 80px rgba(0,0,0,.6); border: 1px solid var(--line); }
[data-layout="disney"] .sheet { background: #141a45; }
.close { position: absolute; top: 14px; inset-inline-end: 14px; background: var(--s2); }
.prep-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; padding-inline-end: 40px; }
.prep-head .pp { width: 74px; flex: none; border-radius: var(--rp); overflow: hidden; }
.prep-head .pp svg { display: block; width: 100%; }
.prep-head h2 { font-size: 22px; }
.ph { font-size: 13px; color: var(--mute); font-weight: 500; font-family: var(--font); margin: 20px 0 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--s2); cursor: pointer; border: 1px solid transparent; text-align: start; width: 100%; transition: border-color .2s; }
.opt:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.opt input { accent-color: var(--acc); width: 18px; height: 18px; flex: none; }
.opt b { display: block; font-weight: 500; font-size: 14px; }
.opt small { display: block; color: var(--mute); font-size: 12px; }
.opt.res em { margin-inline-start: auto; font-style: normal; font-size: 12px; color: var(--acc); white-space: nowrap; }
.nosub { padding: 14px; border-radius: 12px; background: var(--s2); }
.nosub p { margin: 0 0 10px; font-size: 14px; }
.nosub #fetchRes { margin-top: 12px; }
.nosub .opt { background: var(--s1); }
.prep-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.prep-acts .btn:disabled { opacity: .45; cursor: default; }
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--mute); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--s2); font-size: 12px; flex: none; }
.steps li.on { color: var(--ink); }
.steps li.on::before { background: var(--acc); color: #fff; animation: pulse 1s ease-in-out infinite; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "✓"; background: var(--acc-soft); color: var(--acc); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--acc-soft); } }
.bar.big { height: 6px; }

.sx { place-items: start center; padding-top: 10vh; background: rgba(0,0,0,.72); }
.sx-in { width: min(760px, 100%); }
.sx-bar { display: flex; align-items: center; gap: 10px; background: var(--s1); border-radius: 18px; padding: 8px 8px 8px 8px; padding-inline-start: 18px; border: 1px solid var(--line); }
.sx-bar > svg { width: 22px; height: 22px; color: var(--mute); flex: none; }
.sx-bar input { flex: 1; background: none; border: 0; outline: 0; font-size: 20px; min-height: 48px; padding: 0; }
.sx-hint { color: var(--mute); font-size: 13px; margin: 12px 6px 18px; }
.sx-res { max-height: 64vh; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.sx-res h4 { margin: 0 6px 8px; font-size: 13px; color: var(--mute); font-weight: 500; }
.sxg { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.sxi { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--s1); border: 0; text-align: start; transition: background .2s; }
.sxi:hover, .sxi:focus-visible { background: var(--s2); }
.sxi span:last-child { font-size: 14px; }
.sxi small { display: block; color: var(--mute); font-size: 12px; }
.sxp { width: 38px; flex: none; border-radius: 6px; overflow: hidden; }
.sxp svg { display: block; width: 100%; }
.mic { background: var(--s2); }
.mic.listening { background: var(--live); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.top .mic { background: rgba(0,0,0,.35); backdrop-filter: blur(12px); }
.top { gap: 8px; }

/* ---------- 19. EPG guide ---------- */
.epg { padding: 0; overflow: hidden; --ech: 190px; }
.escroll { position: relative; overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.erow, .ehead { display: flex; border-bottom: 1px solid var(--line); min-width: max-content; }
.ehead { position: sticky; top: 0; z-index: 3; background: var(--s1); height: 40px; }
.ech { position: sticky; inset-inline-start: 0; z-index: 2; width: var(--ech); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--s1); font-size: 13px; border-inline-end: 1px solid var(--line); }
.etrack { position: relative; height: 72px; flex: none; }
.ehead .etrack { height: 40px; }
.ehead span { position: absolute; top: 10px; font-size: 12px; color: var(--mute); padding-inline-start: 8px; border-inline-start: 1px solid var(--line); height: 30px; font-variant-numeric: tabular-nums; }
.prog { position: absolute; top: 6px; bottom: 6px; border: 0; border-radius: 10px; background: var(--s2); text-align: start; padding: 8px 10px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; transition: background .2s; }
.prog:hover { background: var(--s3); }
.prog b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog small { font-size: 11px; color: var(--mute); white-space: nowrap; }
.prog.past { opacity: .45; cursor: default; }
.prog.onair { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); }
.prog.onair small { color: var(--acc); }
.prog.rem::after { content: "تذكير"; position: absolute; top: 6px; inset-inline-end: 8px; font-size: 10px; background: var(--acc); color: #fff; padding: 0 6px; border-radius: 4px; }
.enow { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 1; }
.enow.full { z-index: 2; pointer-events: none; }
.enow:not(.full) { display: none; }

/* ---------- 20. World events ---------- */
.world { display: grid; gap: 12px; }
.world[hidden] { display: none; }
.wev { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: center; padding: 12px; border-radius: var(--rc); background: var(--s1); }
.wth { border-radius: calc(var(--rc) - 2px); overflow: hidden; }
.wth svg { display: block; width: 100%; }
.wev h3 { font-size: 18px; margin: 6px 0 4px; font-family: var(--font); font-weight: 600; }
.wev .btn { margin-top: 10px; }
.wcat { font-size: 12px; color: var(--acc); background: var(--acc-soft); padding: 2px 10px; border-radius: 999px; }
.set-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.who-brand { margin: 0; font-size: 22px; font-weight: 600; color: #fff; }
.who-brand b { color: #8ab4ff; }
#sportsList[hidden] { display: none; }

[data-nav="side"]:is([data-layout="apple"], [data-layout="netflix"], [data-layout="shahid"]) .billboard .txt { padding-inline-start: calc(var(--pis) + 8px); }
[data-nav="side"]:is([data-layout="apple"], [data-layout="shahid"]) .bb-strip { inset-inline-end: calc(var(--pie) + 8px); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.status small { margin-inline-start: 6px; }

/* ---------- 21. Admin panel ---------- */
.adm-login { max-width: 420px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 6px; }
.adm-login h1 { font-size: 30px; margin-bottom: 8px; }
.row-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--s1); border-radius: var(--rc); padding: 16px 18px; }
.kpi small { display: block; color: var(--mute); font-size: 12px; }
.kpi b { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi.kl small::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #30d158; margin-inline-end: 6px; animation: pulse 1.6s infinite; }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.srv { background: var(--s1); border-radius: var(--rc); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.srv-h { display: flex; gap: 10px; align-items: flex-start; }
.srv-h b { display: block; font-weight: 600; }
.srv-h small { color: var(--mute); font-size: 12px; }
.srv .dot { width: 10px; height: 10px; border-radius: 50%; background: #30d158; margin-top: 6px; flex: none; box-shadow: 0 0 0 4px rgba(48,209,88,.15); }
.srv.down .dot { background: #8d8b99; box-shadow: none; }
.srv.down { opacity: .7; }
.srv-n { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.srv-n small { display: block; font-size: 11px; color: var(--mute); min-height: 2.6em; line-height: 1.3; }
.srv-n b { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.capbar { height: 6px; border-radius: 6px; background: var(--s2); overflow: hidden; }
.capbar span { display: block; height: 100%; background: #30d158; transition: width .8s; }
.capbar span.warm { background: #ffb020; } .capbar span.hot { background: var(--live); }
.srv-a { display: flex; gap: 8px; }
.add-srv { margin-top: 14px; padding: 16px 20px; }
.add-srv summary { font-size: 14px; color: var(--ink); }
.srv-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 14px; }
.acc-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-bar .search { width: min(320px, 100%); }
.tbl-card { padding: 6px 16px; overflow-x: auto; }
.acc-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.acc-tbl th { text-align: start; font-weight: 500; color: var(--mute); font-size: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.acc-tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.acc-tbl tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, monospace; font-size: 13px; white-space: nowrap; }
.pill-s { font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill-s.active { background: rgba(48,209,88,.15); color: #30d158; }
.pill-s.exp { background: rgba(255,176,32,.15); color: #ffb020; }
.pill-s.off { background: rgba(255,69,58,.15); color: #ff6b62; }
.btn.danger { color: #ff6b62; }
.add-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.scan-card, .add-form { display: flex; flex-direction: column; gap: 14px; }
.scan-btn { align-self: flex-start; }
.two-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pending .opt { background: var(--s2); }

/* ---------- 22. Device activation screen ---------- */
.act { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(22px, 4vw, 48px); max-width: 980px; margin: 4vh auto 0; }
.act-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qrbox { background: #fff; padding: 16px; border-radius: 18px; width: 272px; height: 272px; display: grid; place-items: center; }
.qrbox img, .qrbox canvas { display: block; width: 240px !important; height: 240px !important; }
.act-info h1 { margin-bottom: 12px; }
.act-steps { margin: 0 0 18px; padding-inline-start: 20px; color: var(--mute); line-height: 2; }
.act-ids { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.act-ids div { background: var(--s2); border-radius: 12px; padding: 12px 14px; }
.act-ids small { display: block; color: var(--mute); font-size: 12px; }
.act-ids b { font-family: ui-monospace, monospace; font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; letter-spacing: 1px; }
.act-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--s2); font-size: 14px; }
.act-status i { width: 10px; height: 10px; border-radius: 50%; background: #ffb020; animation: pulse 1.4s infinite; flex: none; }
.act-status.ok { background: rgba(48,209,88,.12); color: #30d158; }
.act-status.ok i { background: #30d158; animation: none; }
.act-status.bad { background: rgba(255,69,58,.12); color: #ff6b62; }
.act-status.bad i { background: #ff453a; animation: none; }
[hidden] { display: none !important; }

.who-chip { font-size: 12px; color: var(--mute); background: var(--s1); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.deny { color: #ff6b62; }
.adm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.adm-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--s2); }
.adm-row > div { flex: 1; }
.adm-row b { display: block; font-weight: 500; font-size: 14px; }
.adm-row small { color: var(--mute); font-size: 12px; }
.adm-row.owner { box-shadow: inset 0 0 0 1px var(--acc); }
.av.sm { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; }

/* ---------- 23. TV mode: 10-foot UI for Google TV / Android TV / Tizen / webOS ---------- */
.remote-legend { display: none; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: 14px; color: var(--mute); }
.remote-legend span { display: inline-flex; align-items: center; gap: 8px; }
.rk { width: 22px; height: 14px; border-radius: 4px; display: inline-block; }
.rk.red { background: #e53935; } .rk.green { background: #43a047; } .rk.yellow { background: #fdd835; } .rk.blue { background: #1e88e5; }
[data-tv="1"] .remote-legend { display: flex; }
[data-tv="1"] body { font-size: 18px; }
[data-tv="1"] main { padding-inline-end: max(5vw, var(--pie)); padding-bottom: 6vh; }
[data-tv="1"] .top { top: 3.5vh; inset-inline-end: 5vw; }
[data-tv="1"] .search, [data-tv="1"] .top .mic { display: none; }
/* remote focus: large, bright, lifted - the only "cursor" on a TV */
[data-tv="1"] :focus { outline: none; }
[data-tv="1"] :focus-visible, [data-tv="1"] :focus { outline: 4px solid #fff !important; outline-offset: 4px; box-shadow: 0 0 0 10px rgba(255,255,255,.12), 0 18px 40px rgba(0,0,0,.6); }
[data-tv="1"] .wcard:focus, [data-tv="1"] .pcard:focus, [data-tv="1"] .cat:focus, [data-tv="1"] .ch:focus, [data-tv="1"] .tile:focus, [data-tv="1"] .sxi:focus, [data-tv="1"] .prog:focus { transform: scale(1.07); z-index: 3; transition: transform .15s; }
[data-tv="1"] .wcard:focus, [data-tv="1"] .pcard:focus { outline: none !important; box-shadow: none; }
[data-tv="1"] .wcard:focus .th, [data-tv="1"] .pcard:focus svg { outline: 4px solid #fff; outline-offset: 3px; }
[data-tv="1"] .btn { min-height: 54px; padding: 0 26px; font-size: 17px; }
[data-tv="1"] .wcard { width: 340px; } [data-tv="1"] .pcard { width: 190px; }
[data-tv="1"] .rowh h2 { font-size: 24px; }
[data-tv="1"] .rail-x { padding: 18px 8px 22px; scroll-padding-inline: 8px; }
[data-tv="1"] .slot .sbar { opacity: 1; }
/* Google TV-style rail: icons only, opens with labels when the remote enters it */
[data-tv="1"][data-nav="side"] aside { --side: 104px; width: 104px; padding: 4vh 16px; align-items: stretch; transition: width .25s, background .25s; overflow: hidden; }
[data-tv="1"][data-nav="side"] main { --pis: calc(104px + 4vw); }
[data-tv="1"][data-nav="side"] aside .bname, [data-tv="1"][data-nav="side"] aside nav span, [data-tv="1"][data-nav="side"] aside .sec, [data-tv="1"][data-nav="side"] .side-foot { opacity: 0; transition: opacity .2s; white-space: nowrap; }
[data-tv="1"][data-nav="side"] aside:focus-within { width: 300px; background: linear-gradient(270deg, rgba(8,8,12,.92), rgba(8,8,12,.7)); }
[data-tv="1"][data-nav="side"] aside:focus-within .bname, [data-tv="1"][data-nav="side"] aside:focus-within nav span, [data-tv="1"][data-nav="side"] aside:focus-within .sec { opacity: 1; }
[data-tv="1"] nav a { min-height: 56px; font-size: 18px; gap: 18px; padding: 12px 18px; }
[data-tv="1"] nav a svg { width: 26px; height: 26px; }
[data-tv="1"] nav a:focus { outline-offset: 0; box-shadow: none; background: #fff; color: #111; }
[data-tv="1"] nav a:focus svg { color: #111; }
