:root{
  --bg:#0B0D12; --accent:#F2B544; --on-accent:#141007;
  --surface:color-mix(in srgb,var(--bg) 88%,#fff 12%);
  --surface-2:color-mix(in srgb,var(--bg) 80%,#fff 20%);
  --line:color-mix(in srgb,var(--bg) 84%,#fff 16%);
  --ink:#F2F3F6; --muted:rgba(236,239,246,.62); --faint:rgba(236,239,246,.38);
  --danger:#FF6B6B; --ok:#5ED39A;
  --safe-t:env(safe-area-inset-top,0px); --safe-b:env(safe-area-inset-bottom,0px);
  --tabbar:58px; --radius:12px;
  color-scheme:dark;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink)}
body{font:15px/1.4 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,system-ui,sans-serif;-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
button,input{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
a{color:inherit}
img{max-width:100%}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hidden{display:none!important}
#app{min-height:100%}
.boot{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}
.boot img{border-radius:18px;animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{50%{opacity:.55}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ---------- welcome + login ---------- */
.gate{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;gap:28px;padding:calc(var(--safe-t) + 32px) 24px calc(var(--safe-b) + 32px);max-width:440px;margin:0 auto;background:radial-gradient(120% 55% at 50% 0%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 70%)}
.gate-brand{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px}
.gate-logo{width:148px;height:148px;border-radius:32px;object-fit:contain;background:transparent;box-shadow:0 18px 50px -18px color-mix(in srgb,var(--accent) 55%,transparent)}
.gate h1{margin:0;font-size:28px;font-weight:700;letter-spacing:-.02em}
.gate .tagline{margin:0;color:var(--muted);font-size:16px;max-width:30ch}
.gate-actions{display:flex;flex-direction:column;gap:12px}
.btn{display:flex;align-items:center;justify-content:center;gap:8px;height:50px;border-radius:14px;font-weight:600;font-size:16px;padding:0 18px}
.btn svg{width:20px;height:20px;flex:none}
.btn-primary{background:var(--accent);color:var(--on-accent)}
.btn-primary:disabled{opacity:.6}
.btn-quiet{background:var(--surface);color:var(--ink)}
.btn-text{height:auto;color:var(--muted);font-weight:500;font-size:14px;padding:8px}
.install{background:var(--surface);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:10px}
.install h2{margin:0;font-size:15px}
.install ol{margin:0;padding-left:20px;color:var(--muted);display:flex;flex-direction:column;gap:6px}
.install b{color:var(--ink)}
.share-ico{display:inline-block;width:16px;height:16px;vertical-align:-2px;margin:0 2px}
.form{display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:13px;color:var(--muted)}
.field input{height:50px;border-radius:12px;border:1px solid var(--line);background:var(--surface);padding:0 14px;font-size:16px;outline:none}
.field input:focus{border-color:var(--accent)}
.pw{position:relative}
.pw input{width:100%;padding-right:64px}
.pw button{position:absolute;right:6px;top:7px;height:36px;padding:0 10px;color:var(--muted);font-size:13px}
.error{color:var(--danger);font-size:14px;min-height:20px;margin:0}
.notfound{text-align:center;color:var(--muted)}

/* ---------- shell ---------- */
.shell{min-height:100vh;min-height:100dvh;padding-bottom:calc(var(--tabbar) + var(--safe-b))}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:8px;min-height:52px;padding:calc(var(--safe-t) + 6px) 12px 8px;background:color-mix(in srgb,var(--bg) 86%,transparent);backdrop-filter:saturate(1.4) blur(18px);-webkit-backdrop-filter:saturate(1.4) blur(18px)}
.topbar h1{margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .brandmark{width:48px;height:48px;border-radius:12px;flex:none;box-shadow:0 0 18px -4px color-mix(in srgb,var(--accent2,var(--accent)) 55%,transparent),0 0 10px -4px color-mix(in srgb,var(--accent) 60%,transparent)}
.topbar:has(.brand-title) .brandmark{width:60px;height:60px;border-radius:15px}
.topbar.hero{position:relative;display:block;padding:calc(var(--safe-t) + 8px) 12px 4px;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.topbar.hero h1.hero-banner{margin:0;line-height:0}
.topbar.hero h1.hero-banner img{width:100%;height:auto;max-height:210px;object-fit:cover;border-radius:16px;display:block;box-shadow:0 10px 34px -14px color-mix(in srgb,var(--accent) 55%,transparent),0 6px 26px -16px color-mix(in srgb,var(--accent2,var(--accent)) 60%,transparent)}
.topbar.hero > .icon-btn{position:absolute;right:20px;top:calc(var(--safe-t) + 16px);background:rgba(0,0,0,.45);border-radius:999px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.topbar.hero .svc-switch{margin-top:8px}
.topbar h1.brand-banner{margin:0;line-height:0;align-self:flex-start;max-width:100%}
.topbar h1.brand-banner img{height:58px;max-width:100%;object-fit:contain;object-position:left center;display:block}
.topbar h1.brand-title{align-self:flex-start;max-width:100%;font-size:26px;font-weight:900;letter-spacing:-.01em;padding-right:2px;background:linear-gradient(90deg,var(--accent2,var(--accent)),var(--accent));-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 0 12px color-mix(in srgb,var(--accent) 38%,transparent))}
.icon-btn{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:var(--ink);flex:none}
.icon-btn:active{background:var(--surface)}
.icon-btn svg{width:22px;height:22px}
.content{padding:4px 16px 24px;display:flex;flex-direction:column;gap:22px}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(6,1fr);height:calc(var(--tabbar) + var(--safe-b));padding-bottom:var(--safe-b);background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-top:1px solid var(--line)}
.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:10.5px;color:var(--faint);font-weight:500}
.tab svg{width:24px;height:24px}
.tab[aria-current="page"]{color:var(--accent)}

/* ---------- sections, rails ---------- */
.section{display:flex;flex-direction:column;gap:10px}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.section-head h2{margin:0;font-size:18px;font-weight:700}
.section-head button{color:var(--accent);font-size:14px;font-weight:500}
.rail{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x proximity;margin:0 -16px;padding:0 16px 4px;scrollbar-width:none}
.rail::-webkit-scrollbar{display:none}
.rail > *{scroll-snap-align:start;flex:none}
.hint{color:var(--muted);font-size:14px;margin:0}
.empty{color:var(--muted);text-align:center;padding:40px 16px;display:flex;flex-direction:column;gap:12px;align-items:center}

/* ---------- lists ---------- */
.search{position:relative}
.search input{width:100%;height:42px;border-radius:12px;border:0;background:var(--surface);padding:0 14px 0 38px;font-size:16px;outline:none}
.search svg{position:absolute;left:11px;top:11px;width:20px;height:20px;color:var(--faint)}
.cats{display:flex;flex-direction:column;border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.cat{display:flex;align-items:center;gap:12px;padding:14px;text-align:left;width:100%}
.cat + .cat{border-top:1px solid var(--line)}
.cat span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cat svg{width:16px;height:16px;color:var(--faint);flex:none}
.cat:active{background:var(--surface-2)}
.chips{display:flex;gap:8px;overflow-x:auto;margin:0 -16px;padding:0 16px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;height:34px;padding:0 14px;border-radius:999px;background:var(--surface);font-size:14px;font-weight:500;color:var(--muted);white-space:nowrap}
.chip[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}

.channels{display:flex;flex-direction:column}
.channel{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;padding:8px 0}
.channel + .channel{border-top:1px solid var(--line)}
.ch-main{display:grid;grid-template-columns:56px 1fr;align-items:center;gap:12px;text-align:left;min-width:0;width:100%}
.ch-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.rail .poster.sq{width:92px}
.sq .poster-img{aspect-ratio:1}
.sq .poster-img img{object-fit:contain;padding:10px}
.ch-logo{width:56px;height:40px;border-radius:8px;background:var(--surface);display:grid;place-items:center;overflow:hidden;font-size:12px;font-weight:700;color:var(--faint)}
.ch-logo img{width:100%;height:100%;object-fit:contain;padding:4px}
.ch-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-now{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fav-btn{width:36px;height:36px;display:grid;place-items:center;color:var(--faint)}
.fav-btn svg{width:20px;height:20px}
.fav-btn[aria-pressed="true"]{color:var(--accent)}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px 10px}
@media (min-width:700px){.grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}}
.poster{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:6px;text-align:left;min-width:0}
.rail .poster{width:112px}
.poster-img{position:relative;aspect-ratio:2/3;border-radius:10px;overflow:hidden;background:var(--surface);display:grid;place-items:center}
.poster-img img{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover}
.poster-img .initials{font-size:22px;font-weight:700;color:var(--faint);padding:8px;text-align:center}
.poster-title{font-size:13px;line-height:1.25;color:var(--ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.poster-sub{font-size:12px;color:var(--faint)}
.progress{position:absolute;left:6px;right:6px;bottom:6px;height:3px;border-radius:2px;background:rgba(255,255,255,.25);overflow:hidden}
.progress i{display:block;height:100%;background:var(--accent)}
.wide{width:220px!important}
.wide .poster-img{aspect-ratio:16/9}
.sentinel{height:1px}
.skeleton{background:linear-gradient(90deg,var(--surface) 0%,var(--surface-2) 50%,var(--surface) 100%);background-size:200% 100%;animation:sk 1.2s linear infinite;border-radius:10px}
@keyframes sk{to{background-position:-200% 0}}

/* ---------- detail ---------- */
.detail{display:flex;flex-direction:column;gap:16px}
.backdrop{position:relative;margin:calc(-1 * (var(--safe-t) + 58px)) -16px 0;aspect-ratio:16/10;background:var(--surface) center/cover no-repeat}
.backdrop::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(to bottom,transparent 35%,var(--bg) 100%)}
.detail-head{display:grid;grid-template-columns:104px 1fr;gap:14px;margin-top:-72px;position:relative;z-index:1;align-items:end}
.detail-head .poster-img{box-shadow:0 12px 30px -10px #000}
.detail h2{margin:0;font-size:22px;line-height:1.2;letter-spacing:-.01em}
.meta{display:flex;flex-wrap:wrap;gap:6px 10px;color:var(--muted);font-size:13px}
.plot{color:var(--muted);margin:0;line-height:1.5}
.row-actions{display:grid;grid-template-columns:1fr auto;gap:10px}
.episodes{display:flex;flex-direction:column}
.episode{display:grid;grid-template-columns:128px 1fr;gap:12px;padding:10px 0;text-align:left;width:100%}
.episode + .episode{border-top:1px solid var(--line)}
.episode .poster-img{aspect-ratio:16/9}
.ep-title{font-weight:500;font-size:14px}
.ep-meta{font-size:12px;color:var(--faint)}
.ep-plot{font-size:13px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- player ---------- */
.player{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#000;display:flex;flex-direction:column;overflow-y:auto}
.player-bar{display:flex;align-items:center;gap:6px;padding:calc(var(--safe-t) + 4px) 8px 6px}
.player-bar h2{margin:0;font-size:16px;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.video-wrap{position:relative;width:100%;aspect-ratio:16/9;background:#000;max-height:70vh;max-height:70dvh}
.video-wrap video{width:100%;height:100%;display:block;background:#000}
.player-msg{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;text-align:center;padding:20px;color:#fff;background:rgba(0,0,0,.7);font-size:15px}
.player-msg > div{display:flex;flex-direction:column;gap:12px;align-items:center;max-width:34ch}
.spinner{width:34px;height:34px;border-radius:50%;border:3px solid rgba(255,255,255,.25);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.live-controls{position:absolute;left:0;right:0;bottom:0;z-index:4;display:flex;align-items:center;gap:4px;padding:14px 10px 8px;background:linear-gradient(to top,rgba(0,0,0,.7),rgba(0,0,0,0));transition:opacity .25s}
.live-controls .icon-btn{color:#fff}
.live-controls .icon-btn svg{width:24px;height:24px}
.player:not(.chrome) .live-controls{opacity:0;pointer-events:none}
.live-pill{background:#E5484D;color:#fff;font-size:11px;font-weight:800;letter-spacing:.06em;border-radius:6px;padding:2px 7px;margin-left:4px}
.player .land-only{display:none}
.player .video-wrap{overflow:hidden;flex:none}
/* Phone sideways: picture edge to edge, title bar floats over it and fades out while playing. */
@media (orientation:landscape) and (max-height:600px){
  .player{overflow:hidden}
  .player .video-wrap{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;height:100vh;height:100dvh;max-height:none;aspect-ratio:auto;z-index:1}
  .player .video-wrap video{object-fit:contain;transform-origin:center center;will-change:transform}
  .player .player-bar{position:fixed;left:0;right:0;top:0;z-index:3;padding:calc(var(--safe-t) + 8px) calc(env(safe-area-inset-right,0px) + 12px) 22px calc(env(safe-area-inset-left,0px) + 12px);background:linear-gradient(to bottom,rgba(0,0,0,.7),rgba(0,0,0,0));transition:opacity .25s}
  .player:not(.chrome) .player-bar{opacity:0;pointer-events:none}
  .player .land-only{display:grid}
  .player .player-info{display:none}
  .live-controls{padding:18px calc(env(safe-area-inset-right,0px) + 14px) calc(env(safe-area-inset-bottom,0px) + 10px) calc(env(safe-area-inset-left,0px) + 14px)}
}
.player-info{padding:14px 16px calc(var(--safe-b) + 20px);display:flex;flex-direction:column;gap:12px;background:var(--bg);flex:1}
.epg{display:flex;flex-direction:column;border-radius:var(--radius);background:var(--surface);overflow:hidden}
.epg-item{padding:12px 14px;display:flex;flex-direction:column;gap:3px}
.epg-item + .epg-item{border-top:1px solid var(--line)}
.epg-time{font-size:12px;color:var(--accent);font-variant-numeric:tabular-nums;font-weight:600}
.epg-title{font-weight:500}
.epg-desc{font-size:13px;color:var(--muted)}
.epg-bar{height:3px;border-radius:2px;background:var(--line);overflow:hidden}
.epg-bar i{display:block;height:100%;background:var(--accent)}
.zap{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ---------- account ---------- */
.card{background:var(--surface);border-radius:var(--radius);overflow:hidden}
.kv{display:flex;justify-content:space-between;gap:12px;padding:13px 14px}
.kv + .kv{border-top:1px solid var(--line)}
.kv span:first-child{color:var(--muted)}
.kv span:last-child{font-variant-numeric:tabular-nums;text-align:right}
.status-ok{color:var(--ok)}
.status-bad{color:var(--danger)}
.support{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.small{font-size:12px;color:var(--faint);text-align:center}

.toast{position:fixed;left:50%;bottom:calc(var(--tabbar) + var(--safe-b) + 14px);transform:translateX(-50%);z-index:60;background:var(--surface-2);color:var(--ink);padding:10px 16px;border-radius:12px;font-size:14px;box-shadow:0 10px 30px -10px #000;max-width:calc(100% - 32px)}

/* ---------- multi-service ---------- */
.titlewrap{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.titlewrap h1{flex:none}
.svc-switch{align-self:flex-start;background:var(--surface);color:var(--muted);font-size:12px;font-weight:600;border-radius:999px;padding:2px 10px;letter-spacing:.02em}
.svc-switch:active{background:var(--surface-2)}
.svc-tiles{display:flex;flex-direction:column;gap:10px}
.svc-tile{display:flex;align-items:center;gap:14px;padding:16px;border-radius:14px;background:var(--surface);text-align:left;width:100%}
.svc-tile:active{background:var(--surface-2)}
.svc-tile .svc-badge{width:44px;height:44px;border-radius:11px;flex:none;display:grid;place-items:center;font-weight:800;font-size:18px;background:var(--accent);color:var(--on-accent)}
.svc-tile .svc-name{flex:1;min-width:0;font-weight:600;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.svc-tile svg{width:18px;height:18px;color:var(--faint);flex:none}
.svc-login{background:var(--surface);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:2px}
.svc-login + .svc-login{margin-top:2px}
.svc-login-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.svc-login-head b{font-size:15px;letter-spacing:.02em}
.svc-err{color:var(--danger);font-size:13px;min-height:0;margin:2px 0 0}
.svc-err:empty{display:none}
.pill-on{font-size:12px;font-weight:600;color:var(--ok);background:color-mix(in srgb,var(--ok) 18%,transparent);border-radius:999px;padding:2px 9px}

/* ---------- search results ---------- */
.sresults{display:flex;flex-direction:column;gap:12px}
.sresult{display:grid;grid-template-columns:64px 1fr;gap:12px;align-items:start}
.sposter{width:64px;aspect-ratio:2/3;border-radius:8px;overflow:hidden;background:var(--surface);display:grid;place-items:center}
.sposter img{width:100%;height:100%;object-fit:cover}
.sposter .initials{font-size:18px;font-weight:700;color:var(--faint)}
.sinfo{display:flex;flex-direction:column;gap:4px;min-width:0}
.stitle{font-weight:600;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.smeta{font-size:12.5px;color:var(--faint)}
.schips{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}
.svc-chip{height:30px;padding:0 12px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-size:12.5px;font-weight:700;letter-spacing:.02em}
.svc-chip:active{opacity:.85}
.svc-warn{font-size:12.5px;color:var(--warn,#E6A15C);background:color-mix(in srgb,#E6A15C 14%,transparent);border-radius:8px;padding:8px 10px;margin:0 0 8px}

/* v62: favourites + continue watching editing */
.head-btns{display:flex;gap:14px;align-items:baseline}
.poster-img .rm{display:none}
.editing .poster-img .rm{display:grid;place-items:center;position:absolute;top:5px;right:5px;z-index:2;width:28px;height:28px;border-radius:50%;background:rgba(0,0,0,.78);color:#fff;font-size:20px;line-height:1;font-weight:600;box-shadow:0 0 0 1.5px rgba(255,255,255,.35)}
.editing .poster-img img{opacity:.6}
.cat.cat-mine span{color:var(--accent);font-weight:600}

/* v79 refresh button */
.icon-btn.spinning svg{animation:spin .9s linear infinite}
.btn[data-refresh]{display:flex;align-items:center;justify-content:center;gap:8px}
.btn[data-refresh] svg{width:18px;height:18px}

/* v80 Android TV / Fire TV remote: a clear highlight on whatever is selected */
.tv :focus{outline:3px solid var(--accent);outline-offset:2px;border-radius:12px}
.tv .poster:focus{outline-offset:4px;transform:scale(1.04);transition:transform .12s}
.tv .cat:focus,.tv .channel:focus,.tv .ch-main:focus{background:color-mix(in srgb,var(--accent) 22%,var(--surface))}

/* Android app settings */
.set-row{width:100%;text-align:left;font:inherit;color:inherit;background:none}
.set-opt{display:flex;align-items:center;gap:14px;width:100%;padding:14px;text-align:left;font:inherit;color:var(--ink);background:none}
.set-opt + .set-opt{border-top:1px solid var(--line)}
.set-radio{flex:none;width:20px;height:20px;border-radius:50%;border:2px solid var(--faint)}
.set-opt.on .set-radio{border-color:var(--accent);box-shadow:inset 0 0 0 4px var(--surface),inset 0 0 0 10px var(--accent)}
.set-text{display:flex;flex-direction:column;gap:2px}
.set-desc{font-size:13px;color:var(--muted)}
.tv .set-row:focus,.tv .set-opt:focus{outline:none;background:color-mix(in srgb,var(--accent) 22%,var(--surface));border-radius:0}

/* TV (Android app on a Fire TV / TV box): sign-in screens use the whole screen, not a phone column.
   Brand on the left, the form on the right; several services sit side by side so nothing needs scrolling. */
.tv .gate:not(.welcome){max-width:1040px;min-height:100vh;display:grid;grid-template-columns:5fr 7fr;grid-auto-flow:row dense;align-content:center;align-items:center;column-gap:56px;row-gap:10px;padding:24px 48px;background:radial-gradient(55% 80% at 22% 50%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 70%)}
.tv .gate:not(.welcome) > *{grid-column:2}
.tv .gate > .gate-brand,.tv .gate > .gate-side{grid-column:1}
.tv .gate:not(.welcome) .gate-brand{align-items:flex-start;text-align:left}
.tv .gate.welcome{max-width:none;padding-left:calc(50% - 280px);padding-right:calc(50% - 280px)}
.tv .gate.welcome .gate-actions{align-items:center}
.tv .gate.welcome .gate-actions .btn{width:360px}
.tv .gate-side .hint{text-align:left!important}
.tv .gate .tagline{max-width:34ch}
.tv .gate > .form{grid-row:1 / span 3}
.tv .gate > .gate-side{justify-self:start}
.tv .gate > .gate-actions.gate-side{justify-self:stretch}
.tv .form.multi{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tv .form.multi > :not(.svc-login){grid-column:1 / -1}
.tv .form.multi .svc-login{margin-top:0;padding:10px 12px}
.tv .form.multi .svc-login-head{margin-bottom:2px}
.tv .form.multi .field{gap:3px}
.tv .form.multi .field label{font-size:12px}
.tv .form.multi .field input{height:40px}
.tv .form.multi .pw button{top:2px}
.tv .form .error{min-height:0}

/* Home: Recent channels (short row) with the seller's picture box beside it; stacked on a phone */
.home-duo{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.home-duo > .section{min-width:0}
.home-duo .promo-pic{width:100%;max-width:240px;justify-self:center}
@media (min-width:700px){
  .home-duo.has-pic{grid-template-columns:minmax(0,1fr) 180px;align-items:start}
  .home-duo.has-pic .rail{margin-right:0;padding-right:0}
  .home-duo .promo-pic{max-width:none}
}

/* One tidy line for a service name under a tile, never running into the next tile */
.poster-sub{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ================= v85: TV layout (Fire TV / Android TV box) =================
   A TV is watched from the sofa, not held in the hand: the phone screens were readable but tiny and
   the bottom tab bar is not how a remote works. On TV the app gets a top menu bar, room for overscan,
   and a three-column browse screen (services + folders | channels | guide) in the style of the boxes
   customers already know. Everything here is under .tv, so phones and the web app are unchanged. */
.tv{--tv-pad:40px;--tv-nav:60px}
.tv body,.tv{font-size:17px}
.tv .shell{padding-bottom:0;height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
.tv .tabbar{display:none}
/* The scroller is the <main> only. Home also builds `<div id="home-rails" class="content">`
   to reuse the phone's column stacking; if that div matched this rule too it became a SECOND
   flex:1/min-height:0 scroller nested in an already-overflowing one, collapsed to height 0,
   and took the Movies/Series rails out of <main>'s scrollHeight - the remote could highlight
   them but the page would not scroll down to them. Keep this selector on main. */
.tv main.content{padding:10px var(--tv-pad) 18px;gap:18px;flex:1;min-height:0;overflow-y:auto}

/* ---- top menu bar: Home | Live | Movies | Series, search, and the seller's logo ---- */
.tv .tvnav{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:18px;height:var(--tv-nav);
  padding:0 var(--tv-pad);background:linear-gradient(to bottom,color-mix(in srgb,var(--bg) 96%,#fff 4%),color-mix(in srgb,var(--bg) 88%,transparent));
  border-bottom:1px solid var(--line);flex:none}
.tv .tvnav-tabs{display:flex;align-items:center;gap:2px}
.tv .tvtab{padding:7px 16px;border-radius:10px;font-size:19px;font-weight:600;color:var(--muted);white-space:nowrap}
.tv .tvtab[aria-current="page"]{color:var(--accent)}
.tv .tvtab:focus{outline:none;background:color-mix(in srgb,var(--accent) 26%,var(--surface));color:var(--ink)}
.tv .tvnav-sep{width:1px;height:22px;background:var(--line);flex:none}
.tv .tvnav-search{flex:1;max-width:420px;display:flex;align-items:center;gap:10px;height:40px;padding:0 16px;
  border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--muted);font-size:16px}
.tv .tvnav-search svg{width:20px;height:20px;flex:none}
.tv .tvnav-search:focus{outline:none;border-color:var(--accent);background:color-mix(in srgb,var(--accent) 18%,var(--surface));color:var(--ink)}
.tv .tvnav-right{margin-left:auto;display:flex;align-items:center;gap:12px}
.tv .tvclock{font-size:16px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.tv .tvnav-logo{height:38px;width:auto;max-width:150px;object-fit:contain;border-radius:8px}

/* ---- three-column browse ---- */
.tv .tvb{display:grid;grid-template-columns:minmax(230px,20%) minmax(0,1fr) minmax(290px,26%);
  gap:12px;height:100%;min-height:0}
.tv .tvb-movie,.tv .tvb-series{grid-template-columns:minmax(230px,21%) minmax(0,1fr)}
.tv .tvcol,.tv .tvside{min-height:0;overflow-y:auto;scrollbar-width:none}
.tv .tvcol::-webkit-scrollbar,.tv .tvside::-webkit-scrollbar{display:none}
.tv .tvcats,.tv .tvmid{background:color-mix(in srgb,var(--bg) 92%,#fff 8%);border-radius:14px;padding:6px}
.tv .tvloading{display:grid;place-items:center;padding:40px}

/* services down the left, each one opening to show its folders */
.tv .svcgrp + .svcgrp{margin-top:4px}
.tv .svcgrp-head{position:sticky;z-index:2;display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:10px;
  text-align:left;font-size:16px;font-weight:700;letter-spacing:.02em;color:var(--ink);
  background:color-mix(in srgb,var(--accent) 22%,var(--bg))}
.tv .svcgrp-head:focus{outline:none;background:var(--accent);color:var(--on-accent)}
.tv .svcgrp-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tv .svcgrp-caret{flex:none;opacity:.8}
.tv .svcgrp-body{display:flex;flex-direction:column}
.tv .svcgrp:not(.open) .svcgrp-body{display:none}
.tv .tvcat{display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;border-radius:8px;text-align:left;
  font-size:15px;color:var(--ink);line-height:1.25}
.tv .tvcat-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tv .tvcat-n{flex:none;font-size:14px;font-weight:700;color:var(--faint);font-variant-numeric:tabular-nums}
.tv .tvcat.mine .tvcat-name{color:var(--accent);font-weight:600}
.tv .tvcat[aria-current="true"]{background:color-mix(in srgb,var(--accent) 16%,transparent)}
.tv .tvcat:focus{outline:none;background:var(--accent);color:var(--on-accent)}
.tv .tvcat:focus .tvcat-n,.tv .tvcat:focus .tvcat-name{color:inherit}

/* the channel list in the middle */
.tv .tvchans{display:flex;flex-direction:column}
.tv .tvch{display:grid;grid-template-columns:46px 40px minmax(0,1fr);align-items:center;gap:10px;width:100%;
  padding:5px 10px;border-radius:8px;text-align:left}
.tv .tvch + .tvch{border-top:1px solid var(--line)}
.tv .tvch-num{font-size:14px;font-weight:700;color:var(--faint);font-variant-numeric:tabular-nums}
.tv .tvch-logo{width:40px;height:28px;border-radius:6px;background:var(--surface);display:grid;place-items:center;overflow:hidden}
.tv .tvch-logo img{width:100%;height:100%;object-fit:contain;padding:3px}
.tv .tvch-logo .initials{font-size:11px;font-weight:700;color:var(--faint)}
.tv .tvch-name{font-size:15.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tv .tvch:focus{outline:none;background:var(--accent);color:var(--on-accent)}
.tv .tvch:focus .tvch-num{color:var(--on-accent);opacity:.8}

/* the guide on the right, with the picture window above it */
.tv .tvside{display:flex;flex-direction:column;gap:12px;overflow:hidden}
.tv .tvprev{position:relative;aspect-ratio:16/9;border-radius:14px;overflow:hidden;background:#000;
  border:1px solid var(--line);display:grid;place-items:center;flex:none}
.tv .tvprev-fill{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:14%}
.tv .tvprev-fill img{width:100%;height:100%;object-fit:contain;opacity:.85}
.tv .tvprev-fill .initials{font-size:34px;font-weight:800;color:var(--faint)}
.tv .tvnow h3{margin:0 0 8px;font-size:19px;font-weight:700;line-height:1.25}
.tv .tvepg{display:flex;flex-direction:column;gap:9px}
.tv .tvepg-row{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:15px}
.tv .tvepg-row.on{color:var(--ink)}
.tv .tvepg-time{font-size:13px;font-weight:600;color:var(--faint);font-variant-numeric:tabular-nums}
.tv .tvepg-row.on .tvepg-time{color:var(--accent)}
.tv .tvepg-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tv .tvacts{margin-top:auto;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:6px}
.tv .tvacts .btn{height:44px;font-size:15px}
.tv .tvacts .btn:focus{outline:none;background:var(--accent);color:var(--on-accent)}

/* ---- Home on a TV: the banner is a header, not half the screen, and the tiles are sofa-sized ---- */
.tv .topbar.hero{padding:8px 0 0}
.tv .topbar.hero h1.hero-banner img{max-height:118px;width:auto;max-width:52%;object-fit:contain;border-radius:12px}
.tv .topbar.hero > .icon-btn{display:none}
.tv .section-head h2{font-size:21px}
.tv .section-head button{font-size:16px}
.tv .rail{gap:14px;margin:0;padding:2px 0 6px}
.tv .rail .poster{width:104px}
.tv .rail .poster.sq{width:92px}
.tv .poster-title{font-size:13px}
.tv .poster-sub{font-size:12px}

/* The tile you are on shows its whole name. Titles clamp to two lines - about 26 characters at 93px -
   and 49% of the catalogue is longer than that, but a third line would cost a whole row of posters
   (only 18px of slack below the third row). So the full name appears on the highlighted tile only,
   over the bottom of its own artwork. Anchored to the tile's BOTTOM so it grows upward: it can never
   be clipped by the column edge or run off the screen on the last row. No modern CSS - Chrome 83 has
   attr(), absolute positioning and box-shadow. [data-full] guard so a card without one shows nothing. */
.tv .poster{position:relative}
.tv .poster[data-full]:focus{z-index:5}
.tv .poster[data-full]:focus::after{content:attr(data-full);position:absolute;left:-6px;right:-6px;bottom:-6px;
  padding:6px 8px;border-radius:8px;background:var(--surface);border:1px solid var(--line);color:var(--ink);
  font-size:13px;line-height:1.3;text-align:left;box-shadow:0 10px 24px rgba(0,0,0,.55);pointer-events:none;z-index:6}
.tv .grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px 10px}
.tv .home-duo .promo-pic{max-width:300px}
.tv .empty{font-size:17px}
.tv .tvhero{line-height:0}
.tv .tvhero img{width:100%;max-width:100%;height:auto;max-height:210px;object-fit:cover;object-position:center;border-radius:14px;display:block}

/* Room for the focus ring: without it the first tile of a row is clipped by the column edge. */
.tv .rail{padding:6px 8px 10px;margin:0 -8px}
.tv .tvcats,.tv .tvmid{padding:8px}
.tv .tvmid .grid{grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:10px 10px}
.tv .tvmid .poster:focus{transform:scale(1.03)}
.tv .tvprev-cap{margin:-4px 0 0;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- v92: Home rows don't scroll sideways on a TV ----
   A rail with `overflow-x:auto` is a focusable scroll box to Chrome, so the d-pad would land on the whole
   row as one big highlight instead of a tile (owner 09-16: "selects a big square in the back"). Each row
   now shows only what fits; the rest is behind See more. */
.tv .rail{overflow:hidden;scroll-snap-type:none}
.tv .home-duo{gap:26px}
.tv .home-duo.has-pic{grid-template-columns:minmax(0,1fr) 260px;align-items:start}
.tv .home-duo .promo-pic{max-width:260px}
/* the seller's banner was cut down too far when the hero went */
/* full width across the top, like the phone: sellers' banners run from 1.5 to 2.5 wide, so it
   fills the width and crops the overhang rather than growing taller than the screen */
.tv .tvhero img{max-height:210px}
.tv .tvhero.tall img{width:auto;max-width:42%;object-fit:contain}
.tv main.content{scroll-padding:70px 0 40px}

/* ---- v93: a movie/series page on a TV ----
   The phone page opens with a backdrop the width of the screen (16/10 => 1280x800 on a TV: bigger than the
   whole screen, owner 09-16 "mivies images loads way too big"). On TV the backdrop becomes the page's own
   background and the page reads like a TV app: poster on the left, everything else beside it. */
.tv .detail{display:grid;grid-template-columns:230px minmax(0,1fr);column-gap:30px;row-gap:12px;align-content:start;padding-top:6px;padding-bottom:28px}
.tv .detail > *{grid-column:2;position:relative;z-index:1}
.tv .detail > .backdrop{position:fixed;top:0;right:0;bottom:0;left:0;margin:0;z-index:0;aspect-ratio:auto;opacity:.14;
  background-position:center 22%;background-size:cover}
.tv .detail > .backdrop::after{background:linear-gradient(to right,var(--bg) 20%,transparent 85%),
  linear-gradient(to top,var(--bg) 25%,transparent 85%)}
/* the poster becomes one tall cell on the left and everything else stacks beside it, so there's no
   dead space under the title */
.tv .detail-head{display:contents}
.tv .detail-head > .poster-img{grid-column:1;grid-row:1 / span 8;width:230px;align-self:start;position:relative;z-index:1}
.tv .detail-head > div{grid-column:2;position:relative;z-index:1;gap:2px!important}

.tv .detail h2{font-size:30px;margin-top:2px}
.tv .detail .meta{font-size:15px;gap:6px 14px}
/* Long synopses were pushing the season tabs so far down they landed right on the fold, half cut
   off before anyone scrolled. Clamped so the tabs sit inside the first screenful for most shows. */
.tv .detail .plot{font-size:16px;line-height:1.5;max-width:70ch;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tv .detail .hint{font-size:14px;max-width:80ch}
.tv .detail .chips{margin:6px 0 4px;padding:4px 0}
.tv .row-actions{grid-template-columns:auto auto;justify-content:start;gap:12px}
.tv .row-actions .btn{min-width:210px;height:48px}
.tv .detail .btn:focus,.tv .episode:focus{outline:none;background:var(--accent);color:var(--on-accent)}
.tv .episodes{grid-column:1 / -1}
.tv .episode{grid-template-columns:190px minmax(0,1fr);gap:16px;padding:10px;border-radius:10px}
.tv .ep-title{font-size:16px}
.tv .ep-plot{font-size:14px}

/* the seller's banner, very faint, as the wallpaper behind every TV screen */
.tv .tvbg{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1;background-position:center;background-size:cover;opacity:.18;pointer-events:none}
.tv .tvbg::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:
  radial-gradient(120% 90% at 50% 0%,transparent,var(--bg) 78%),linear-gradient(to bottom,transparent,var(--bg))}
.tv .detail > .btn{max-width:430px}

/* ---- Search on TV: field, tabs, results across every service ---- */
.tv .tvsearch{padding-top:2px}
.tv .tvsfield{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:12px;
  padding:10px 16px;margin-bottom:14px}
.tv .tvsfield svg{width:22px;height:22px;flex:none;color:var(--faint)}
.tv .tvsfield input{flex:1;min-width:0;background:none;border:0;outline:none;color:var(--ink);font-size:20px}
.tv .tvsfield:focus-within{box-shadow:0 0 0 2px var(--accent)}
.tv .tvstabs{display:flex;gap:10px;margin-bottom:10px}
.tv .tvstab{height:40px;padding:0 18px;border-radius:999px;background:var(--surface);color:var(--ink);font-size:16px;font-weight:600}
.tv .tvstab .n{margin-left:8px;font-size:14px;opacity:.65}
.tv .tvstab[aria-current="page"]{background:var(--accent);color:var(--on-accent)}
.tv .tvstab[aria-current="page"] .n{opacity:.85}
.tv .tvstab:focus{outline:2px solid var(--accent);outline-offset:3px}
.tv .tvscover{font-size:14px;color:var(--faint);margin:0 0 12px}
.tv .tvscover:empty{display:none}
.tv .tvsres .sresults{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr));gap:12px 22px}
.tv .tvsres .sresult{align-items:center;grid-template-columns:76px minmax(0,1fr);gap:16px}
.tv .tvsres .sposter{width:76px}
.tv .tvsres .stitle{font-size:17px}
.tv .tvsres .smeta{font-size:14px}
.tv .tvsres .svc-chip{height:34px;font-size:13.5px}
.tv .tvsres .svc-chip:focus{outline:2px solid var(--ink);outline-offset:2px}

/* Chrome <88: no aspect-ratio. Reproduce the box with padding and pin the contents. */
@supports not (aspect-ratio: 2/3){
.poster-img{height:0;padding-top:150%}
.sq .poster-img{height:0;padding-top:100%}
.wide .poster-img{height:0;padding-top:56.25%}
.episode .poster-img{height:0;padding-top:56.25%}
.tv .tvprev{height:0;padding-top:56.25%}
.poster-img > *,.tv .tvprev > *{position:absolute;top:0;right:0;bottom:0;left:0}
.poster-img .initials{display:grid;place-items:center}
}

/* Chrome <111: no color-mix(). app.js fills in the --cm-* values at boot. */
@supports not (color: color-mix(in srgb, red 50%, blue)){
:root{
  --surface:var(--cm-1);
  --surface-2:var(--cm-2);
  --line:var(--cm-3)}
.gate{background:radial-gradient(120% 55% at 50% 0%,var(--cm-4),transparent 70%)}
.gate-logo{box-shadow:0 18px 50px -18px var(--cm-5)}
.topbar{background:var(--cm-6)}
.topbar .brandmark{box-shadow:0 0 18px -4px var(--cm-7),0 0 10px -4px var(--cm-8)}
.topbar.hero h1.hero-banner img{box-shadow:0 10px 34px -14px var(--cm-5),0 6px 26px -16px var(--cm-9)}
.topbar h1.brand-title{filter:drop-shadow(0 0 12px var(--cm-10))}
.tabbar{background:var(--cm-11)}
.pill-on{background:var(--cm-12)}
.svc-warn{background:var(--cm-13)}
.tv .cat:focus,.tv .channel:focus,.tv .ch-main:focus{background:var(--cm-14)}
.tv .set-row:focus,.tv .set-opt:focus{background:var(--cm-14)}
.tv .gate:not(.welcome){background:radial-gradient(55% 80% at 22% 50%,var(--cm-4),transparent 70%)}
.tv .tvnav{background:linear-gradient(to bottom,var(--cm-15),var(--cm-16))}
.tv .tvtab:focus{background:var(--cm-17)}
.tv .tvnav-search:focus{background:var(--cm-18)}
.tv .tvcats,.tv .tvmid{background:var(--cm-19)}
.tv .svcgrp-head{
  background:var(--cm-20)}
.tv .tvcat[aria-current="true"]{background:var(--cm-4)}
}

/* Chrome <86: no :focus-visible, so the highlight would be invisible. */
html.nofv :focus{outline:2px solid var(--accent);outline-offset:2px}

/* Chrome <84: no flexbox gap. app.js sets html.nogap when the probe fails. */
html.nogap .gate > * + *{margin-top:28px}
html.nogap .gate-brand > * + *{margin-top:14px}
html.nogap .gate-actions > * + *{margin-top:12px}
html.nogap .btn > * + *{margin-left:8px}
html.nogap .install > * + *{margin-top:10px}
html.nogap .install ol > * + *{margin-top:6px}
html.nogap .form > * + *{margin-top:12px}
html.nogap .field > * + *{margin-top:6px}
html.nogap .topbar > * + *{margin-left:8px}
html.nogap .content > * + *{margin-top:22px}
html.nogap .tab > * + *{margin-top:3px}
html.nogap .section > * + *{margin-top:10px}
html.nogap .section-head > * + *{margin-left:12px}
html.nogap .rail > * + *{margin-left:10px}
html.nogap .empty > * + *{margin-top:12px}
html.nogap .cat > * + *{margin-left:12px}
html.nogap .chips > * + *{margin-left:8px}
html.nogap .ch-text > * + *{margin-top:2px}
html.nogap .detail > * + *{margin-top:16px}
html.nogap .meta{margin-top:calc(-1 * 6px);margin-left:calc(-1 * 10px)}
html.nogap .meta > *{margin-top:6px;margin-left:10px}
html.nogap .player-bar > * + *{margin-left:6px}
html.nogap .player-msg > div > * + *{margin-top:12px}
html.nogap .live-controls > * + *{margin-left:4px}
html.nogap .player-info > * + *{margin-top:12px}
html.nogap .epg-item > * + *{margin-top:3px}
html.nogap .kv > * + *{margin-left:12px}
html.nogap .titlewrap > * + *{margin-top:1px}
html.nogap .svc-tiles > * + *{margin-top:10px}
html.nogap .svc-tile > * + *{margin-left:14px}
html.nogap .svc-login > * + *{margin-top:2px}
html.nogap .svc-login-head > * + *{margin-left:10px}
html.nogap .sresults > * + *{margin-top:12px}
html.nogap .sinfo > * + *{margin-top:4px}
html.nogap .schips{margin-top:calc(-1 * 6px);margin-left:calc(-1 * 6px)}
html.nogap .schips > *{margin-top:6px;margin-left:6px}
html.nogap .head-btns > * + *{margin-left:14px}
html.nogap .btn[data-refresh] > * + *{margin-left:8px}
html.nogap .set-opt > * + *{margin-left:14px}
html.nogap .set-text > * + *{margin-top:2px}
html.nogap.tv .tvnav > * + *{margin-left:18px}
html.nogap.tv .tvnav-tabs > * + *{margin-left:2px}
html.nogap.tv .tvnav-search > * + *{margin-left:10px}
html.nogap.tv .tvnav-right > * + *{margin-left:12px}
html.nogap.tv .svcgrp-head > * + *{margin-left:10px}
html.nogap.tv .tvcat > * + *{margin-left:10px}
html.nogap.tv .tvside > * + *{margin-top:12px}
html.nogap.tv .tvepg > * + *{margin-top:9px}
html.nogap.tv .tvepg-row > * + *{margin-top:3px}
html.nogap.tv .tvsfield > * + *{margin-left:12px}
html.nogap.tv .tvstabs > * + *{margin-left:10px}
