/* Kino — design tokens + layout (PRD §6.1). No framework, no icon font. */
:root{
  --bg:#070A09;--panel:#121A18;--text:#F2F6F4;--dim:#9FB0AA;--faint:#6B7D77;
  --accent:#5DD39E;--line:rgba(255,255,255,.10);
  --glass:rgba(255,255,255,.07);--glass2:rgba(255,255,255,.14);
  --r-s:10px;--r-m:16px;--r-l:22px;--r-xl:30px;
  --pad:clamp(18px,3.6vw,58px);--gap:clamp(10px,1.1vw,18px);--nav-h:74px;
  --e:cubic-bezier(.22,.68,.24,1);--e-out:cubic-bezier(.16,1,.3,1);
}
*{box-sizing:border-box}
/* the live region must stay in the accessibility tree, so it is offset rather than hidden */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
html,body{margin:0;padding:0;height:100%}
body{background:var(--bg);color:var(--text);overflow:hidden;-webkit-font-smoothing:antialiased;
  font:400 16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}
svg.i{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
svg.i.sm{width:17px;height:17px}
.app{position:fixed;inset:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}

/* top bar */
/* always frosted — never transparent, or the search pill disappears into bright artwork */
.topbar{position:absolute;top:0;left:0;right:0;z-index:60;height:var(--nav-h);display:flex;align-items:center;
  gap:clamp(14px,2.6vw,40px);padding:0 var(--pad);border-bottom:1px solid var(--line);
  /* the hero behind this can be almost white, and a 55% scrim left the controls at roughly
     3:1. Darker base plus a gradient keeps the band readable over any backdrop. */
  background:linear-gradient(180deg,rgba(7,10,9,.88),rgba(7,10,9,.66));
  backdrop-filter:blur(20px) saturate(140%);
  -webkit-backdrop-filter:blur(20px) saturate(140%);
  transition:background .3s var(--e)}
.topbar.solid{background:rgba(7,10,9,.86)}
.brand{font-weight:800;font-size:19px;letter-spacing:.24em;flex:none}
.nav{position:relative;display:none;gap:clamp(14px,2vw,30px)}
.nav button{position:relative;padding:8px 2px;font-size:.92rem;color:var(--dim);transition:color .18s var(--e)}
.nav button:hover{color:var(--text)}
.nav button[aria-current="page"]{color:var(--text);font-weight:600}
/* 1px base scaled on the X axis: slides + resizes on transform alone, no layout pass */
.ink{position:absolute;bottom:0;height:2px;width:1px;border-radius:2px;background:var(--accent);
  pointer-events:none;transform-origin:left center;transition:transform .34s var(--e-out)}
.top-right{margin-left:auto;display:flex;align-items:center;gap:12px}
/* region picker: same pill language as the search control beside it, and a menu that belongs
   to this UI rather than to the operating system */
.region-wrap{position:relative;flex:none}
.region{display:flex;align-items:center;gap:8px;height:42px;padding:0 14px;border-radius:99px;
  border:1px solid var(--line);background:rgba(7,10,9,.45);color:var(--text);font:inherit;
  font-size:.86rem;font-weight:600;white-space:nowrap;
  transition:background .16s var(--e),border-color .16s var(--e)}
.region:hover{background:rgba(7,10,9,.66);border-color:rgba(255,255,255,.34)}
.rchev{transform:rotate(90deg);opacity:.62;transition:transform .2s var(--e)}
.region[aria-expanded="true"] .rchev{transform:rotate(-90deg);opacity:1}
.region-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:70;width:186px;padding:7px;
  background:rgba(20,30,27,.88);backdrop-filter:blur(26px) saturate(150%);
  -webkit-backdrop-filter:blur(26px) saturate(150%);
  border:1px solid rgba(255,255,255,.14);border-radius:var(--r-m);
  box-shadow:0 20px 48px rgba(0,0,0,.55);animation:rise .16s var(--e-out)}
.ropt{display:flex;width:100%;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--r-s);
  text-align:left;font-size:.88rem;color:var(--dim)}
.ropt:hover,.ropt:focus-visible{background:var(--glass);color:var(--text)}
.ropt.on{color:var(--accent);font-weight:600}
.ropt-gap{width:17px;flex:none}
.searchbar{display:flex;align-items:center;gap:10px;height:42px;width:clamp(150px,20vw,270px);padding:0 16px;
  border-radius:99px;border:1px solid var(--line);background:rgba(7,10,9,.45);color:var(--dim);font-size:.88rem;
  transition:background .2s var(--e),color .2s var(--e)}
.searchbar:hover{background:rgba(7,10,9,.66);color:var(--text)}
.searchbar span{flex:1;text-align:left}
.avatar{width:38px;height:38px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:var(--glass2);border:1px solid var(--line)}
.avatar:hover{border-color:var(--accent)}

/* mobile section bar: hidden wherever the header carries the same links */
.tabbar{display:none}
.scroller{flex:1;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;scroll-behavior:smooth}
.scroller::-webkit-scrollbar{display:none}

/* hero */
.hero{position:relative;min-height:clamp(540px,80vh,800px);display:flex;flex-direction:column;
  justify-content:flex-end;align-items:flex-start;padding:var(--nav-h) var(--pad) clamp(26px,4vh,46px)}
.hero-art{position:absolute;inset:0;overflow:hidden;background:var(--panel)}
.hero-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 22%;
  opacity:0;transition:opacity .6s var(--e)}
.hero-art img.on{opacity:1}
.hero-scrim{position:absolute;inset:0;background:
  linear-gradient(90deg,rgba(7,10,9,.94) 0%,rgba(7,10,9,.66) 34%,rgba(7,10,9,.06) 68%,transparent 100%),
  linear-gradient(0deg,var(--bg) 1%,rgba(7,10,9,.32) 30%,transparent 58%)}
.hero-body{position:relative;z-index:2;max-width:min(640px,66%)}
.chips{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:20px}
.chip{padding:6px 15px;border-radius:99px;font-size:.73rem;letter-spacing:.06em;background:var(--glass);
  border:1px solid var(--line);color:var(--dim);transition:background .18s var(--e),color .18s var(--e)}
.chip:hover{background:var(--glass2);color:var(--text)}
.eyebrow{font-size:.78rem;letter-spacing:.2em;text-transform:uppercase;color:var(--dim);margin-bottom:10px}
.hero h1{margin:0 0 6px;font-size:clamp(2.5rem,6.2vw,5.2rem);line-height:.92;font-weight:800;
  letter-spacing:-.03em;text-transform:uppercase}
.hero .tag{display:block;font-size:clamp(1rem,1.8vw,1.6rem);letter-spacing:.04em;color:var(--accent);
  margin-top:12px;font-weight:700}
.facts{display:flex;align-items:center;gap:13px;flex-wrap:wrap;color:var(--dim);font-size:.9rem;margin:20px 0 26px}
.facts b{color:var(--accent);font-weight:700}
.facts i{width:4px;height:4px;border-radius:50%;background:var(--faint);display:block}
.hero p.syn{margin:0 0 24px;color:#CBD9D4;font-size:.95rem;max-width:56ch;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.hero-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.hero-rail{position:relative;z-index:3;display:flex;gap:9px;margin-top:clamp(24px,4vh,40px)}
.hero-rail button{width:34px;height:3px;border-radius:2px;background:rgba(255,255,255,.22)}
.hero-rail button[aria-current="true"]{width:60px;background:var(--accent)}
.cluster{position:absolute;right:var(--pad);bottom:clamp(26px,4vh,46px);z-index:3;display:flex;gap:12px}

/* buttons */
.pill{display:inline-flex;align-items:center;justify-content:center;gap:10px;height:52px;padding:0 28px;
  border-radius:99px;font-weight:600;font-size:.97rem;transition:transform .16s var(--e),background .2s var(--e)}
.pill:active{transform:scale(.97)}
.pill-solid{background:#fff;color:#0A0F0D;box-shadow:0 6px 16px rgba(0,0,0,.42)}
.pill-solid:hover{background:var(--accent);color:#06120D}
.pill-outline{border:1px solid rgba(255,255,255,.4)}
.pill-outline:hover{background:var(--glass2);border-color:var(--text)}
.pill.sm{height:46px;padding:0 22px;font-size:.92rem}
.circ{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;flex:none;border:1px solid var(--line);
  background:var(--glass);backdrop-filter:blur(12px);transition:background .18s var(--e),transform .18s var(--e)}
.circ:hover{background:var(--glass2);transform:translateY(-2px)}
.circ[aria-pressed="true"]{background:var(--accent);color:#06120D;border-color:var(--accent)}
.circ.sm{width:44px;height:44px}

/* rows */
.rows{position:relative;z-index:2;padding:6px 0 70px}
.row{margin-bottom:clamp(26px,3.6vh,46px)}
.row-head{display:flex;align-items:baseline;gap:14px;padding:0 var(--pad);margin-bottom:16px}
.row-head h2{margin:0;font-size:1.16rem;font-weight:700;letter-spacing:-.01em}
.row-head span{color:var(--faint);font-size:.8rem}
.track-wrap{position:relative}
.track{display:flex;gap:var(--gap);padding:6px var(--pad) 10px;overflow-x:auto;
  scroll-snap-type:x proximity;scrollbar-width:none}
.track::-webkit-scrollbar{display:none}
/* poster fallback: sits under the image, so it shows only when there is no image to cover it */
.art-fb{position:absolute;inset:0;z-index:0;display:grid;place-items:center;padding:8%;
  text-align:center;font-size:.8rem;font-weight:600;color:var(--faint);
  background:linear-gradient(160deg,var(--panel),rgba(255,255,255,.03))}
.art img{position:relative;z-index:1}
.card{flex:0 0 clamp(122px,28vw,150px);scroll-snap-align:start;text-align:left;position:relative;
  transition:transform .3s var(--e-out)}
.card:hover,.card:focus-visible{transform:translateY(-8px)}
.card .t{margin-top:11px;font-size:.87rem;font-weight:600;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.card .y{font-size:.76rem;color:var(--faint)}
.track>.card.feature{flex:0 0 clamp(250px,42vw,380px)}
.card.feature .t,.card.feature .y{display:none}
.feat-in{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:18px 20px;border-radius:0 0 var(--r-m) var(--r-m);
  background:linear-gradient(0deg,rgba(5,9,8,.92),rgba(5,9,8,.12) 72%,transparent)}
.feat-in b{display:block;font-size:1rem;font-weight:700;margin-bottom:4px}
.feat-in small{color:var(--dim);font-size:.75rem}
.play-fab{position:absolute;right:16px;bottom:16px;z-index:4;width:46px;height:46px;border-radius:50%;
  display:grid;place-items:center;background:rgba(255,255,255,.92);color:#0A0F0D;
  opacity:0;transform:scale(.85);transition:opacity .24s var(--e-out),transform .24s var(--e-out)}
.card:hover .play-fab,.card:focus-visible .play-fab{opacity:1;transform:none}
.chev{position:absolute;top:0;bottom:34px;width:64px;z-index:5;display:none;place-items:center;opacity:0;
  transition:opacity .2s;color:#fff}
.chev.prev{left:0;background:linear-gradient(90deg,var(--bg),transparent)}
.chev.next{right:0;background:linear-gradient(270deg,var(--bg),transparent)}
.track-wrap:hover .chev,.track-wrap:focus-within .chev{opacity:1}

/* artwork wrappers — aspect reserved before the network responds (CLS 0, PRD §8) */
.art{position:relative;overflow:hidden;background:var(--panel);border-radius:var(--r-m)}
.art img{width:100%;height:100%;object-fit:cover}
.poster{aspect-ratio:2/3}
.wide{aspect-ratio:16/9}
.progress{position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(255,255,255,.18);z-index:5}
.progress i{display:block;height:100%;background:var(--accent)}
.badge{position:absolute;left:10px;top:10px;z-index:5;padding:3px 9px;border-radius:8px;font-size:.68rem;
  font-weight:700;background:rgba(5,9,8,.74);backdrop-filter:blur(6px)}

/* skeletons — no spinners anywhere (PRD §6.2) */
.sk{background:var(--glass);border-radius:var(--r-m);animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}

/* my library + states */
.page-head{padding:calc(var(--nav-h) + 30px) var(--pad) 0}
.page-head h1{margin:0 0 6px;font-size:clamp(1.9rem,3.8vw,2.8rem);letter-spacing:-.025em}
.page-head p{margin:0;color:var(--dim);font-size:.92rem}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(134px,1fr));gap:var(--gap);padding:26px var(--pad) 70px}
.note{display:flex;align-items:center;gap:10px;margin:20px var(--pad) 0;padding:12px 16px;border:1px solid var(--line);
  border-radius:var(--r-m);background:var(--glass);font-size:.85rem;color:var(--dim)}
.note button{margin-left:auto;color:var(--dim)}
.empty{display:grid;place-items:center;gap:10px;text-align:center;padding:clamp(60px,16vh,150px) var(--pad)}
.empty h3{margin:0;font-size:1.35rem}
.empty p{margin:0;color:var(--dim);max-width:44ch}
.empty code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85em;color:var(--accent)}

/* overlays */
.scrim{position:fixed;inset:0;z-index:600;background:rgba(3,6,5,.76);backdrop-filter:blur(7px);animation:fade .2s var(--e)}
@keyframes fade{from{opacity:0}to{opacity:1}}
/* NOTE: `rise` animates transform, so nothing using it may rely on transform for
   centering — the keyframes would override it and the panel would slide in off-centre.
   Everything below centres with auto margins instead. */
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

.search-panel{position:fixed;z-index:700;top:16px;left:0;right:0;margin-inline:auto;width:min(760px,94vw);
  max-height:88vh;overflow:auto;scrollbar-width:none;padding:16px;border-radius:var(--r-l);
  border:1px solid rgba(255,255,255,.14);
  background:rgba(20,30,27,.72);backdrop-filter:blur(30px) saturate(150%);
  -webkit-backdrop-filter:blur(30px) saturate(150%);
  box-shadow:0 34px 90px rgba(0,0,0,.66);animation:rise .22s var(--e-out)}
.search-panel::-webkit-scrollbar{display:none}
.search-field{display:flex;align-items:center;gap:12px;padding:0 6px}
.search-field input{flex:1;height:54px;padding:0 18px;border-radius:99px;border:1px solid var(--line);
  background:rgba(255,255,255,.06);color:var(--text);font:inherit;font-size:1.02rem}
.search-field input::placeholder{color:var(--faint)}
.search-body{margin-top:18px;padding:0 6px 6px}
.label{font-size:.71rem;letter-spacing:.15em;text-transform:uppercase;color:var(--faint);margin:0 0 12px}
.recent{display:grid;gap:2px;margin-bottom:24px}
.recent-row{display:flex;align-items:center;gap:12px;padding:10px;border-radius:var(--r-s)}
.recent-row:hover{background:var(--glass)}
.result{display:flex;align-items:center;gap:14px;width:100%;padding:8px;border-radius:var(--r-s);text-align:left}
.result:hover{background:var(--glass)}
/* arrows are the only traversal now, so the active row needs more than a 1.2:1 tint */
.result.active{background:var(--glass2);box-shadow:inset 2px 0 0 var(--accent)}
.result .art{width:44px;height:66px;flex:none;border-radius:9px}
.result .rt{flex:1;min-width:0}
.result .rt b{display:block;font-weight:600;font-size:.94rem}
.result .rt small{color:var(--faint)}
.result mark{background:transparent;color:var(--accent);font-weight:700}
.tagpill{padding:4px 11px;border-radius:99px;border:1px solid var(--line);font-size:.64rem;letter-spacing:.1em;color:var(--dim)}
.sk-row{display:flex;gap:14px;align-items:center;padding:8px}
.sk-row .sk:first-child{width:44px;height:66px;flex:none;border-radius:9px}
.sk-lines{flex:1;display:grid;gap:9px}
.sk-lines .sk:nth-child(1){height:13px;width:52%;border-radius:6px}
.sk-lines .sk:nth-child(2){height:11px;width:30%;border-radius:6px}

/* detail */
.detail{position:fixed;z-index:700;overflow:auto;scrollbar-width:none;animation:rise .24s var(--e-out);
  background:rgba(18,27,25,.78);backdrop-filter:blur(30px) saturate(150%);
  -webkit-backdrop-filter:blur(30px) saturate(150%)}
.detail::-webkit-scrollbar{display:none}
.d-art{position:relative;aspect-ratio:16/8;background:var(--panel)}
.d-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.d-art .fade{position:absolute;inset:0;background:linear-gradient(0deg,rgba(18,27,25,.96) 2%,rgba(18,27,25,.06) 72%)}
.d-close{position:absolute;top:16px;right:16px;z-index:3;width:42px;height:42px;border-radius:50%;display:grid;
  place-items:center;background:rgba(4,8,7,.62);backdrop-filter:blur(10px);border:1px solid var(--line)}
.d-body{position:relative;padding:0 clamp(20px,3.6vw,42px) 44px;margin-top:-72px}
.d-body h2{margin:0 0 12px;font-size:clamp(1.8rem,3.8vw,2.8rem);line-height:1;letter-spacing:-.025em;text-transform:uppercase}
.d-meta{display:flex;align-items:center;gap:13px;flex-wrap:wrap;color:var(--dim);font-size:.89rem;margin-bottom:24px}
.d-meta b{color:var(--accent)}
.d-meta i{width:4px;height:4px;border-radius:50%;background:var(--faint);display:block}
.d-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.over{margin:26px 0 0;color:#CBD9D4;font-size:.95rem;max-width:72ch}
.over.clamped{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.more-toggle{color:var(--dim);font-size:.85rem;margin-top:8px;text-decoration:underline}
.tabs-row{display:flex;align-items:center;gap:10px;margin:28px 0 4px}
.tab{padding:9px 19px;border-radius:99px;font-size:.89rem;color:var(--dim);background:var(--glass)}
.tab:hover{color:var(--text)}
.tab[aria-selected="true"]{background:var(--accent);color:#06120D;font-weight:600}
.tabs-row select{margin-left:auto;height:40px;padding:0 14px;border-radius:99px;border:1px solid var(--line);
  background:rgba(255,255,255,.06);color:var(--text);font:inherit;font-size:.85rem}
.ep{display:flex;gap:16px;width:100%;text-align:left;padding:16px 0;border-bottom:1px solid var(--line)}
.ep:hover{background:rgba(255,255,255,.028)}
.ep .art{width:clamp(96px,14vw,164px);flex:none;border-radius:var(--r-s)}
.ep-b{flex:1;min-width:0}
.ep-b .h{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}
.ep-b .h b{font-size:.94rem}
.ep-b .h small{color:var(--faint);margin-left:auto;white-space:nowrap}
.ep-b p{margin:7px 0 0;color:var(--dim);font-size:.84rem;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.showmore{display:block;margin:24px auto 0;padding:12px 30px;border-radius:99px;border:1px solid var(--line);font-size:.9rem}
.showmore:hover{background:var(--glass)}
.dl{display:grid;grid-template-columns:clamp(110px,16vw,160px) 1fr;gap:12px 20px;margin:26px 0 0;font-size:.9rem}
.dl dt{color:var(--faint)}
.dl dd{margin:0}

/* player */
.player{position:fixed;inset:0;z-index:800;background:#050807;display:flex;flex-direction:column;animation:fade .2s var(--e)}
/* sticks to the top of the scrolling stage column — never spans the episode rail */
.p-top{position:sticky;top:0;z-index:6;display:flex;align-items:center;gap:16px;
  padding:16px clamp(16px,3vw,32px);width:100%;
  background:linear-gradient(180deg,rgba(3,6,5,.92),rgba(3,6,5,.55) 70%,transparent);
  transition:opacity .3s var(--e)}
/* anchored to the video, so it can't collide with the rail either. The bottom offset clears
   the provider's own control strip: every embed player puts its seek bar, volume and its own
   fullscreen button in the bottom ~80px of the frame, and at bottom:16px this pill sat on top
   of them (measured against VidLink 2026-09-21, whose fullscreen button it covered outright). */
.p-bottom{position:absolute;right:16px;bottom:96px;z-index:6;display:flex;align-items:center;
  transition:opacity .3s var(--e)}
.player.idle .p-top,.player.idle .p-bottom{opacity:0;pointer-events:none;visibility:hidden}
/* a keyboard user's focused control must never be an invisible target */
.player.idle:has(.p-top :focus-visible) .p-top,
.player.idle:has(.p-bottom :focus-visible) .p-bottom{opacity:1;pointer-events:auto;visibility:visible}
.p-title{min-width:0}
.p-title b{display:block;font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* the episode title can be long; it truncates rather than pushing the source row around */
.p-title small{display:block;color:var(--faint);overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;max-width:min(52vw,640px)}
.p-main{flex:1;display:flex;min-height:0;overflow:hidden}
/* no top padding: .p-top is sticky and in flow, so it reserves its own space */
.p-stage{flex:1;min-width:0;position:relative;display:flex;flex-direction:column;align-items:center;
  gap:0;padding:0 16px 90px;overflow-y:auto;scrollbar-width:none}
.p-stage::-webkit-scrollbar{display:none}

/* episode rail — Kino-owned, sits beside the provider iframe */
.p-side{width:clamp(280px,25vw,380px);flex:none;display:flex;flex-direction:column;min-height:0;
  border-left:1px solid var(--line);background:rgba(10,15,13,.72)}
/* the top bar no longer overlaps the rail, so this needs no clearance padding */
.rail-head{display:flex;align-items:center;gap:12px;padding:18px 16px 14px;
  border-bottom:1px solid var(--line)}
.rail-head b{flex:1;min-width:0;font-size:.95rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-head select{height:34px;padding:0 10px;border-radius:99px;border:1px solid var(--line);
  background:rgba(255,255,255,.06);color:var(--text);font:inherit;font-size:.8rem}
.rail-list{flex:1;overflow-y:auto;scrollbar-width:thin;padding:8px}
.rail-list::-webkit-scrollbar{width:6px}
.rail-list::-webkit-scrollbar-thumb{background:var(--glass2);border-radius:3px}
.rail-ep{display:flex;gap:12px;align-items:center;width:100%;text-align:left;padding:8px;border-radius:var(--r-s);
  position:relative;transition:background .16s var(--e)}
.rail-ep:hover{background:var(--glass)}
.rail-ep.current{background:var(--glass2)}
.rail-ep .art{width:112px;flex:none;border-radius:8px}
.rail-tx{flex:1;min-width:0}
.rail-tx b{display:block;font-size:.84rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-tx small{color:var(--faint);font-size:.75rem}
.nowdot{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:7px;height:7px;border-radius:50%;
  background:var(--accent)}

/* watch-page detail block under the player */
.p-meta{width:min(1180px,96%);display:flex;gap:clamp(16px,2.4vw,30px);margin-top:26px;
  padding-bottom:26px;border-bottom:1px solid var(--line)}
.pm-poster{width:clamp(110px,13vw,168px);flex:none}
.pm-poster.sk{aspect-ratio:2/3;border-radius:var(--r-m)}
.pm-body{flex:1;min-width:0}
.pm-body h1{margin:0 0 6px;font-size:clamp(1.4rem,2.8vw,2.1rem);line-height:1.05;letter-spacing:-.02em}
.pm-ep{color:var(--accent);font-size:.92rem;font-weight:600;margin-bottom:10px}
.pm-facts{display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:var(--dim);font-size:.88rem;margin-bottom:16px}
.pm-facts b{color:var(--accent);font-weight:700}
.pm-facts i{width:4px;height:4px;border-radius:50%;background:var(--faint);display:block}
.pm-over{margin:0 0 18px;color:#CBD9D4;font-size:.93rem;max-width:74ch}
.pm-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}
.pm-dl{display:grid;grid-template-columns:clamp(90px,11vw,130px) 1fr;gap:9px 18px;margin:0;font-size:.87rem}
.pm-dl dt{color:var(--faint)}
.pm-dl dd{margin:0;color:var(--text)}

/* suggestions under the video */
.p-sugg{width:min(1180px,96%);margin-top:26px}
.p-sugg .row-head{padding:0;margin-bottom:12px}
.p-sugg .track{padding:4px 0 8px}
/* a slot holds its height only once a tag mounts, and gives it back if the frame fails to
   load within 5 s — see mountAd */
.ad-slot{width:min(1180px,96%);height:90px;flex:none;display:grid;place-items:center;overflow:hidden;margin:4px 0 18px}
/* nothing mounted: the slot claims no space at all, so the video starts under the header */
.ad-slot.empty{display:none}
.ad-int{position:fixed;inset:0;width:100%;height:100%;border:0;z-index:960;background:rgba(0,0,0,.72)}
.ad-banner{position:fixed;left:0;right:0;bottom:0;z-index:880;display:none;align-items:center;
  justify-content:center;padding:6px 44px 6px 10px;background:rgba(7,10,9,.94);backdrop-filter:blur(12px);
  border-top:1px solid var(--line)}
.ad-banner.on{display:flex}
.ad-banner .close{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:30px;height:30px;
  border-radius:50%;display:grid;place-items:center;background:var(--glass2);color:var(--text)}
.ad-banner .close:hover{background:#fff;color:#0A0F0D}
body.has-banner .rows,body.has-banner .grid{padding-bottom:130px}
/* the video rectangle: sizing box + containing block for its own overlays */
.p-video{position:relative;width:min(1180px,96%);aspect-ratio:16/9;border-radius:var(--r-l);
  overflow:hidden;background:#000;flex:none}
.frame{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.p-video .p-gate{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border-radius:0}
/* source row — aligned to the video's own column, sitting directly above it. No panel or
   card behind it: the row is chrome, the video keeps its own edges. */
.p-sources{width:min(1180px,96%);flex:none;display:flex;align-items:center;gap:14px;
  padding:2px 2px 16px;flex-wrap:wrap}
.p-sources-label{display:inline-flex;align-items:center;gap:8px;color:var(--dim);
  font-size:.82rem;letter-spacing:.02em;flex:none}
.p-sources-label svg{width:15px;height:15px}
.p-sources-list{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.src-pill{height:32px;padding:0 15px;border-radius:99px;font-size:.82rem;font-weight:600;
  color:var(--dim);border:1px solid var(--line);background:var(--glass);
  transition:background .16s var(--e),color .16s var(--e),border-color .16s var(--e)}
.src-pill:hover{color:var(--text);border-color:rgba(255,255,255,.34)}
.src-pill.on{background:var(--accent);border-color:var(--accent);color:#06120D}
/* pre-roll gate — nothing from the provider is loaded until this is clicked */
.p-gate{width:min(1180px,96%);aspect-ratio:16/9;position:relative;border-radius:var(--r-l);overflow:hidden;
  background:var(--panel);display:grid;place-items:center}
.p-gate img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.42}
.p-gate-in{position:relative;z-index:2;display:grid;justify-items:center;gap:8px;text-align:center;padding:20px}
.p-gate-in b{font-size:1.15rem}
.p-gate-in small{color:var(--dim)}
.gate-play{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;margin-bottom:10px;
  background:#fff;color:#0A0F0D;box-shadow:0 10px 30px rgba(0,0,0,.5);
  transition:transform .18s var(--e-out),background .18s var(--e)}
.gate-play svg{width:30px;height:30px}
.gate-play:hover{transform:scale(1.07);background:var(--accent)}
.gate-note{color:var(--faint);font-size:.78rem;max-width:44ch;margin-top:6px}

.loading-shell{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:#050807}
.loading-shell img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.28}
.loading-shell .txt{position:relative;z-index:2;text-align:center}
.fail{position:absolute;z-index:4;inset:0;margin:auto;height:fit-content;width:min(430px,90vw);padding:30px;
  border-radius:var(--r-l);text-align:center;background:rgba(20,30,27,.82);
  backdrop-filter:blur(26px) saturate(150%);-webkit-backdrop-filter:blur(26px) saturate(150%);
  border:1px solid rgba(255,255,255,.14);animation:rise .2s var(--e-out)}
.fail h3{margin:0 0 10px;font-size:1.12rem}
.fail p{margin:0 0 22px;color:var(--dim);font-size:.9rem}
.fail .d-actions{justify-content:center}
.next-bar{display:inline-flex;align-items:center;gap:14px;padding:13px 22px;border-radius:99px;
  background:var(--glass2);backdrop-filter:blur(14px);border:1px solid var(--line)}
.next-bar:hover{background:#fff;color:#0A0F0D}
.next-bar small{color:var(--faint);display:block}

/* auth + toast */
.modal{position:fixed;z-index:750;inset:0;margin:auto;height:fit-content;width:min(400px,92vw);padding:32px;
  border-radius:var(--r-l);background:rgba(22,33,30,.82);
  backdrop-filter:blur(30px) saturate(150%);-webkit-backdrop-filter:blur(30px) saturate(150%);
  border:1px solid rgba(255,255,255,.14);animation:rise .2s var(--e-out)}
.modal h3{margin:0 0 8px;font-size:1.25rem}
.modal p{margin:0 0 22px;color:var(--dim);font-size:.88rem}
.modal input{width:100%;height:50px;padding:0 18px;margin-bottom:12px;border-radius:99px;border:1px solid var(--line);
  background:rgba(255,255,255,.06);color:var(--text);font:inherit}
.modal .pill{width:100%;margin-bottom:12px}
/* kept for the Google-provider restore path (PRD §4.2); unused while email is the only
   enabled provider, so do not delete it as dead CSS */
.modal .or{text-align:center;color:var(--faint);font-size:.76rem;margin:14px 0}
#toast{position:fixed;left:0;right:0;bottom:32px;margin-inline:auto;width:fit-content;z-index:950;display:flex;align-items:center;
  gap:16px;padding:14px 22px;border-radius:99px;background:rgba(22,33,30,.95);backdrop-filter:blur(16px);
  border:1px solid var(--line);font-size:.88rem;box-shadow:0 18px 52px rgba(0,0,0,.6);animation:rise .2s var(--e-out)}
#toast button{color:var(--accent);font-weight:700}

/* responsive (PRD §6.9) */
@media (min-width:860px){.nav{display:flex}.chev{display:grid}}
@media (max-width:899px){
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:70;height:56px;
    padding-bottom:env(safe-area-inset-bottom);
    background:rgba(7,10,9,.92);backdrop-filter:blur(18px) saturate(140%);
    -webkit-backdrop-filter:blur(18px) saturate(140%);border-top:1px solid var(--line)}
  .tabbar button{flex:1;font-size:.78rem;font-weight:600;color:var(--dim);letter-spacing:.01em;
    position:relative;transition:color .16s var(--e)}
  .tabbar button[aria-current="page"]{color:var(--accent)}
  /* the active tab carries a short accent rule rather than an icon, to stay inside the budget */
  .tabbar button[aria-current="page"]::after{content:"";position:absolute;top:0;left:50%;
    width:22px;height:2px;margin-left:-11px;border-radius:2px;background:var(--accent)}
  /* content must clear the bar, and the ad banner must sit above it, never over it */
  .scroller{padding-bottom:56px}
  .ad-banner{bottom:56px}
  .detail{inset:0}
  .hero{min-height:calc(100dvh - 40px)}
  .hero-body{max-width:100%}
  .hero-scrim{background:linear-gradient(0deg,var(--bg) 6%,rgba(7,10,9,.45) 46%,rgba(7,10,9,.2) 100%)}
  .cluster{position:static;margin-top:22px}
  .searchbar{width:42px;padding:0;justify-content:center}
  .searchbar span{display:none}
  .region{font-size:.8rem;padding:0 10px;gap:6px}
  .region-menu{width:168px}
  .track>.card.feature{flex:0 0 clamp(220px,72vw,290px)}
  .play-fab{opacity:1;transform:none}

  /* Player: the episode rail is a second column only while there is room for one. Below this
     width it stacks under the video, and the whole player column scrolls as one document
     instead of two independently scrolling panes. Left side-by-side, a 25vw rail squeezed the
     video to roughly 150px at 430px wide. */
  .p-main{flex-direction:column;overflow-y:auto;scrollbar-width:none}
  .p-main::-webkit-scrollbar{display:none}
  .p-stage{overflow:visible;flex:none;padding-bottom:28px}
  .p-side{width:auto;border-left:0;border-top:1px solid var(--line);background:transparent}
  .rail-list{overflow:visible;flex:none}
  /* one scrollable chip row rather than a wrapped block: at 430px the wrapped version cost
     120px of vertical space above the video */
  .p-sources{gap:10px;padding:2px 2px 12px;flex-wrap:nowrap}
  .p-sources-list{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .p-sources-list::-webkit-scrollbar{display:none}
  .src-pill{flex:none}
  /* the Next-episode pill shrinks to icon + episode number and tucks just above the touch
     control strip: at a 215px-tall video the desktop offset landed on the centre play button */
  .p-bottom{right:8px;bottom:52px}
  .next-bar{padding:9px 14px;gap:9px;font-size:.9rem}
  .next-bar small{display:none}
}
@media (min-width:900px){
  .detail{top:24px;left:0;right:0;margin-inline:auto;width:min(950px,92vw);max-height:90vh;
    border-radius:var(--r-xl);border:1px solid var(--line);box-shadow:0 44px 120px rgba(0,0,0,.7)}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
