/* ==========================================================================
   shelf - shared components for both looks
   One DOM, two visual languages. Everything reads tokens from
   shelf-tokens.css. Rules scoped with [data-look="..."] are the ONLY places
   where the two looks lay things out differently; each one is listed in
   README.md under "Where the layouts differ".
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.ic { stroke-width: var(--icon-stroke); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display {
  font-family: var(--font-display); font-weight: var(--display-weight);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking); line-height: var(--display-leading);
}
[data-look="marquee"] .only-soft, [data-look="soft"] .only-marquee { display: none !important; }

/* ---------- app shell ------------------------------------------------ */
.app {
  position: relative; max-width: 430px; margin: 0 auto; min-height: 100dvh;
  background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--fs-body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
.app.no-tabbar { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* ---------- app bar --------------------------------------------------- */
.appbar { height: var(--appbar-h); padding: 6px 8px 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; }
.mark { display: inline-flex; flex-direction: column; gap: 2.5px; }
.mark i { display: block; height: 4px; background: var(--text); }
.mark i:nth-child(2) { background: var(--accent); }
/* Marquee mark: square-ended staircase. Soft mark: stacked stadium bars. */
[data-look="marquee"] .mark i { border-radius: 1px; }
[data-look="marquee"] .mark i:nth-child(1) { width: 20px; }
[data-look="marquee"] .mark i:nth-child(2) { width: 16px; margin-left: 4px; }
[data-look="marquee"] .mark i:nth-child(3) { width: 12px; margin-left: 8px; }
[data-look="soft"] .mark { align-items: center; }
[data-look="soft"] .mark i { height: 5px; border-radius: 999px; }
[data-look="soft"] .mark i:nth-child(1) { width: 22px; }
[data-look="soft"] .mark i:nth-child(2) { width: 17px; }
[data-look="soft"] .mark i:nth-child(3) { width: 12px; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-wordmark); letter-spacing: var(--display-tracking); line-height: 1; }
[data-look="soft"] .wordmark { letter-spacing: -.03em; }
.appbar-actions { display: flex; align-items: center; }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-control); transition: transform var(--dur-press) var(--ease-standard); }
.icon-btn:active { transform: scale(var(--press-scale)); }
.icon-btn[aria-current] { background: var(--tone); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--tone); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text); }

/* page bar for pushed screens (Settings) */
.pagebar { height: var(--appbar-h); padding: 6px var(--gutter) 0 4px; display: flex; align-items: center; gap: 4px; }
.pagebar h1 { margin: 0; font-size: var(--fs-section); }

/* ---------- sub-tabs ----------------------------------------------------
   Marquee: two-tone text, thin accent underline.  Soft: pill chips.        */
.subtabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.subtabs a { white-space: nowrap; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.subtabs a[aria-current] { color: var(--text); font-weight: 700; }
[data-look="marquee"] .subtabs { height: var(--subtab-h); gap: 22px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
[data-look="marquee"] .subtabs a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
[data-look="soft"] .subtabs { gap: 8px; padding: 6px var(--gutter) 14px; }
[data-look="soft"] .subtabs a { height: var(--subtab-h); padding: 0 16px; border-radius: var(--radius-chip); background: var(--surface-2); color: var(--text); }
[data-look="soft"] .subtabs a[aria-current] { background: var(--text); color: var(--bg); }

/* ---------- section header ------------------------------------------- */
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px var(--gutter) 10px; }
.section-h h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-section); font-weight: var(--section-weight); text-transform: var(--section-transform); letter-spacing: var(--display-tracking); }
.section-h .count { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-section); color: var(--muted); }
[data-look="soft"] .section-h { justify-content: flex-start; }
[data-look="soft"] .section-h .count { font-family: var(--font-body); font-size: 12px; height: 24px; min-width: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- progress (segment per episode / continuous bar) ---------- */
.progress { display: flex; gap: var(--seg-gap); height: var(--progress-h); border-radius: var(--progress-radius); overflow: hidden; }
/* Filled segments each show their slice of the accent (--k of --n filled, set by the app), so a
   gradient or metallic accent spans the filled part exactly like the library's continuous bars.
   A lone highlighted segment (.next, no --k) shows the whole accent. */
.progress i { flex: 1; background: var(--surface-2);
  --seg-size: calc(var(--n, 1) * 100%) 100%; --seg-pos: calc(var(--k, 0) / max(var(--n, 1) - 1, 1) * 100%) 0; }
.progress i.on { background: var(--text); }
.progress i.next { background: var(--accent-fill) var(--seg-pos) / var(--seg-size) no-repeat; }
[data-look="soft"] .progress { background: var(--tone); }
[data-look="soft"] .progress i { background: transparent; }
[data-look="soft"] .progress i.on { background: var(--accent-fill) var(--seg-pos) / var(--seg-size) no-repeat; }

/* ---------- check button (mark watched) ------------------------------
   .check-btn > .plate > svg. The plate is the "ink plate": on textured
   accents icons always sit on it, never on the pattern.                   */
.check-btn { width: var(--tap); height: var(--tap); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform var(--dur-press) var(--ease-standard); }
.check-btn:active { transform: scale(.9); }
.check-btn .plate { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.check-btn.is-done .plate { animation: check-pop var(--dur-check) var(--ease-pill); }
@keyframes check-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Up next ----------------------------------------------------
   Same DOM: .upnext > .next-card > (.next-media > img + .next-code) + .next-body + .check-btn
   Marquee: first card is a full-bleed hero, the rest are rows.
   Soft:    two-column poster grid, check floats on the poster.            */
.next-card { position: relative; }
.next-media { position: relative; overflow: hidden; background: var(--surface-2); }
.next-art { width: 100%; height: 100%; object-fit: cover; }
.next-code { display: none; }
.next-title { margin: 0; font-size: var(--fs-row-title); font-weight: 700; }
.next-ep { margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.next-meta { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.next-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.next-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Marquee rows */
[data-look="marquee"] .next-card { display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter); }
[data-look="marquee"] .next-media { width: 52px; height: 78px; flex: none; border-radius: var(--radius-art); }
[data-look="marquee"] .next-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
[data-look="marquee"] .next-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
[data-look="marquee"] .next-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
[data-look="marquee"] .next-foot .progress { flex: 1; height: 3px; gap: 0; }
[data-look="marquee"] .next-foot .progress i.next { background: var(--surface-2); }
[data-look="marquee"] .check-btn { border: 1.5px solid var(--line); }
[data-look="marquee"] .check-btn .plate { color: var(--text); }
/* Marquee hero = first card */
[data-look="marquee"] .upnext:not(.compact) .next-card.hero { display: block; margin: 0 var(--gutter) 6px; padding: 0; height: 300px; border-radius: var(--radius-art); overflow: hidden; background: #111; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-media { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-media::after { content: ''; position: absolute; inset: 0; background: var(--hero-scrim); }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-art { object-position: 50% 22%; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-body { position: absolute; left: 16px; right: 88px; bottom: 30px; color: #fff; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-title); line-height: .9; text-transform: uppercase; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-ep { color: #fff; font-size: 15px; font-weight: 600; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-meta { color: rgba(255,255,255,.72); }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-foot { position: absolute; left: -0px; right: -72px; bottom: -18px; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-foot .progress { height: 4px; gap: 2px; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-foot .progress i { background: rgba(255,255,255,.22); }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-foot .progress i.on { background: #fff; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-foot .progress i.next { background: var(--accent-fill) var(--seg-pos) / var(--seg-size) no-repeat; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-left { display: none; }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .check-btn { position: absolute; right: 16px; bottom: 34px; width: 60px; height: 60px; border: 0; background: var(--accent-fill); }
[data-look="marquee"] .upnext:not(.compact) .next-card.hero .check-btn .plate { width: 44px; height: 44px; background: var(--accent-plate); color: var(--on-plate); }

/* Soft grid */
[data-look="soft"] .upnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 0 var(--gutter); }
[data-look="soft"] .next-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
[data-look="soft"] .next-media { height: 224px; border-radius: var(--radius-tile); }
[data-look="soft"] .next-art { object-position: 50% 12%; }
[data-look="soft"] .next-media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: var(--hero-scrim); }
[data-look="soft"] .next-code { display: block; position: absolute; left: 12px; bottom: 14px; z-index: 1; color: #fff; font-size: 14px; font-weight: 700; }
[data-look="soft"] .next-ep .code, [data-look="soft"] .next-ep .sep, [data-look="soft"] .next-meta, [data-look="soft"] .next-left { display: none; }
[data-look="soft"] .next-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
[data-look="soft"] .next-foot { order: -1; margin-bottom: 7px; }
[data-look="soft"] .next-title-row .next-badge { position: absolute; top: 10px; left: 10px; z-index: 1; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface); text-transform: none; letter-spacing: 0; font-size: 12px; }
[data-look="soft"] .check-btn { position: absolute; right: 8px; top: 168px; width: 48px; height: 48px; background: var(--accent-fill); box-shadow: 0 6px 14px -6px rgba(0,0,0,.5); z-index: 2; }
[data-look="soft"] .check-btn .plate { width: 48px; height: 48px; color: var(--on-accent); }
[data-look="soft"][data-accent-kind="textured"] .check-btn .plate,
[data-look="soft"] [data-accent-kind="textured"] .check-btn .plate { width: 34px; height: 34px; background: var(--accent-plate); color: var(--on-plate); }

/* compact cards for Not started (same DOM, .next-card.compact) */
[data-look="soft"] .upnext.compact { grid-template-columns: 1fr; gap: 8px; }
[data-look="soft"] .upnext.compact .next-card { flex-direction: row; align-items: center; gap: 12px; height: 64px; padding: 0 8px; border-radius: var(--radius-row); background: var(--surface); }
[data-look="soft"] .upnext.compact .next-media { width: 48px; height: 48px; border-radius: 50%; flex: none; }
[data-look="soft"] .upnext.compact .next-media::after, [data-look="soft"] .upnext.compact .next-code, [data-look="soft"] .upnext.compact .next-foot { display: none; }
[data-look="soft"] .upnext.compact .next-meta { display: block; }
[data-look="soft"] .upnext.compact .next-ep { display: none; }
[data-look="soft"] .upnext.compact .next-body { flex: 1; }
[data-look="soft"] .upnext.compact .check-btn { position: static; background: var(--tone); box-shadow: none; }
[data-look="soft"] .upnext.compact .check-btn .plate { color: var(--text); background: none; }

/* Soft Up next for shows: list rows (poster, title + badge, episode, progress + "N left", check) */
[data-look="soft"] .upnext.list { grid-template-columns: minmax(0, 1fr); gap: 8px; overflow-x: clip; }
[data-look="soft"] .upnext.list > * { min-width: 0; }
[data-look="soft"] .upnext.list .next-card { position: relative; flex-direction: row; align-items: center; gap: 12px; height: auto; min-height: 76px; padding: 8px 10px 8px 8px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); }
[data-look="soft"] .upnext.list .next-media { width: 46px; height: 60px; border-radius: 10px; flex: none; }
[data-look="soft"] .upnext.list .next-art { object-position: 50% 50%; }
[data-look="soft"] .upnext.list .next-media::after, [data-look="soft"] .upnext.list .next-code, [data-look="soft"] .upnext.list .next-meta { display: none; }
[data-look="soft"] .upnext.list .next-body { flex: 1; min-width: 0; gap: 2px; }
[data-look="soft"] .upnext.list .next-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
[data-look="soft"] .upnext.list .next-title { font-family: var(--font-body); font-size: var(--fs-row-title); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
[data-look="soft"] .upnext.list .next-title-row .next-badge { position: static; flex: none; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--tone); color: var(--text); text-transform: none; letter-spacing: 0; font-size: 11px; }
[data-look="soft"] .upnext.list .next-ep { display: block; margin: 0; font-size: var(--fs-micro); color: var(--muted); }
[data-look="soft"] .upnext.list .next-ep .code { display: inline; color: var(--text); font-weight: 700; }
[data-look="soft"] .upnext.list .next-ep .sep { display: inline; }
[data-look="soft"] .upnext.list .next-foot { display: flex; order: 0; align-items: center; gap: 10px; margin: 6px 0 0; }
[data-look="soft"] .upnext.list .next-foot .progress { flex: 1; height: 5px; }
[data-look="soft"] .upnext.list .next-left { display: block; flex: none; margin: 0; font-size: 11px; color: var(--muted); }
[data-look="soft"] .upnext.list .check-btn { position: static; flex: none; width: 40px; height: 40px; background: var(--tone); box-shadow: none; }
[data-look="soft"] .upnext.list .check-btn .plate,
[data-look="soft"][data-accent-kind="textured"] .upnext.list .check-btn .plate { width: 40px; height: 40px; color: var(--text); background: none; }

/* ---------- bottom navigation ------------------------------------------
   Same DOM: .tabbar > .tab-sections(.tab-pill + 3 .tab) + extras.
   Marquee: full-width thumb bar - sections | Discover, You.
   Soft:    floating dock - sections + round search button.              */
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; bottom: 0; display: flex; align-items: center; }
.tab-sections { position: relative; display: flex; align-items: center; gap: 4px; }
.tab { position: relative; z-index: 1; width: 64px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: color var(--dur-pill) var(--ease-standard); }
.tab[aria-current] { color: var(--nav-pill-text); }
.tab-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 64px; height: 40px; border-radius: var(--radius-control); background: var(--nav-pill); transform: translateX(calc(var(--active, 0) * (64px + 4px))); transition: transform var(--dur-pill) var(--ease-pill); }
[data-look="marquee"] .tabbar { height: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px)); padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px)); justify-content: center; background: var(--chrome); border-top: 1px solid var(--line); }
/* (no active dot on tabs: the pill already marks where you are) */
/* The divider carries the space between sections and Discover/You: up to 48px, shrinking
   when the bar is full. So with every section it spans the bar as designed, and with fewer
   sections (Personalize) the row stays centred instead of leaving a hole. */
[data-look="marquee"] .tab-divider { flex: 0 1 48px; min-width: 9px; height: 24px; background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; }
[data-look="marquee"] .tab-extras { display: flex; gap: 4px; }
[data-look="marquee"] .tab-extras .tab { width: 56px; }
[data-look="soft"] .tabbar { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); justify-content: center; gap: 10px; pointer-events: none; }
[data-look="soft"] .tab-sections { pointer-events: auto; height: 64px; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px var(--line); }
[data-look="soft"] .tab { width: 64px; height: 52px; }
[data-look="soft"] .tab-pill { top: 6px; left: 6px; width: 64px; height: 52px; }
.tabbar.single-section .tab-sections, .tabbar.single-section .tab-divider { display: none; }   /* one section: no lone section button (Soft: just Search; Marquee: Discover and You) */
[data-look="soft"] .tab-search { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-float); }

/* ---------- buttons ---------------------------------------------------- */
.btn { height: 52px; padding: 0 22px; border-radius: var(--radius-control); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 15px; transition: transform var(--dur-press) var(--ease-standard); }
.btn:active { transform: scale(var(--press-scale)); }
.btn-block { display: flex; width: 100%; }
[data-look="marquee"] .btn-primary { background: var(--text); color: var(--bg); }
[data-look="soft"] .btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-quiet { background: var(--surface-2); color: var(--text); }

/* primary "next episode" button on detail */
.btn-next { width: 100%; min-height: 56px; border-radius: var(--radius-control); display: flex; align-items: center; gap: 12px; padding: 0 6px 0 20px; text-align: left; }
.btn-next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.btn-next-text small { font-size: 12px; opacity: .75; font-weight: 600; }
.btn-next-text strong { font-size: 16px; }
.btn-next .check-btn { pointer-events: none; }
[data-look="marquee"] .btn-next { background: var(--text); color: var(--bg); }
[data-look="marquee"] .btn-next .check-btn { width: 44px; height: 44px; background: var(--accent-fill); border: 0; }
[data-look="marquee"] .btn-next .check-btn .plate { width: 32px; height: 32px; background: var(--accent-plate); color: var(--on-plate); }
[data-look="soft"] .btn-next { min-height: 64px; padding: 0 8px 0 22px; background: var(--accent-fill); color: var(--on-accent); }
[data-look="soft"] .btn-next .check-btn { position: static; width: 48px; height: 48px; background: rgba(255,255,255,.22); box-shadow: none; }
[data-look="soft"] .btn-next .check-btn .plate { color: inherit; }

/* secondary actions: same DOM, Marquee hides labels visually */
.action-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.action-ic { display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
[data-look="marquee"] .action-ic { width: 100%; height: 48px; border-radius: var(--radius-control); border: 1.5px solid var(--line); }
[data-look="marquee"] .action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-look="soft"] .action-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); }

/* ---------- chips ------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: var(--radius-chip); }
[data-look="marquee"] .chip { padding: 5px 10px; border: 1px solid var(--line); }
[data-look="soft"] .chip { height: 32px; padding: 0 12px; background: var(--surface-2); font-size: 13px; }

/* ---------- detail ------------------------------------------------------
   Same DOM. Marquee: title overlays the faded art.  Soft: a rounded
   sheet slides over the art and the title sits on it.                     */
.detail-hero { position: relative; background: var(--surface-2); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-topbar { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; display: flex; justify-content: space-between; }
.round-btn { width: var(--tap); height: var(--tap); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.detail-head { position: relative; padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 10px; }
.detail-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-hero); line-height: var(--display-leading); letter-spacing: var(--display-tracking); text-transform: var(--display-transform); text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.detail-body { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 14px; }
.summary { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.summary a { color: var(--text); font-weight: 700; }

[data-look="marquee"] .detail-hero { height: 520px; background: #111; }
[data-look="marquee"] .detail-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 48%, var(--bg) 100%); }
[data-look="marquee"] .detail-hero img { object-position: 50% 18%; }
[data-look="marquee"] .detail-topbar { z-index: 1; }
[data-look="marquee"] .round-btn { background: rgba(10,10,12,.5); color: #fff; }
[data-look="marquee"] .detail-head { margin-top: -132px; }
[data-look="marquee"] .meta .ic { display: none; }
[data-look="marquee"] .meta li + li::before { content: '·'; color: var(--muted); margin-right: 6px; }
[data-look="marquee"] .detail-body { padding-top: 12px; gap: 16px; }
[data-look="soft"] .detail-hero { height: 500px; }
[data-look="soft"] .detail-hero img { object-position: 50% 14%; }
[data-look="soft"] .round-btn { background: rgba(255,255,255,.88); color: #17141F; }
[data-look="soft"] .detail-head { margin-top: -40px; padding-top: 22px; background: var(--bg); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; gap: 14px; }
[data-look="soft"] .detail-title { font-size: var(--fs-hero); }
[data-look="soft"] .meta li { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
[data-look="soft"] .detail-head .chips .chip { background: none; padding: 0; height: auto; color: var(--muted); }
[data-look="soft"] .detail-head .chips .chip + .chip::before { content: '·'; margin-right: 6px; }
[data-look="soft"] .detail-body { padding-top: 14px; }

/* stat band: rating + progress */
.stat-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-number); line-height: 1; letter-spacing: var(--display-tracking); }
.stat-num em { font-style: normal; color: var(--muted); }
.stat-sub { font-size: 13px; color: var(--muted); }
.stat-col { display: flex; flex-direction: column; justify-content: center; }
.star { color: var(--accent); }
.ring { --p: 0; width: 62px; height: 62px; border-radius: 50%; flex: none; display: none; align-items: center; justify-content: center; background: conic-gradient(transparent calc(var(--p) * 1%), var(--tone) 0), var(--accent-fill); -webkit-mask: radial-gradient(circle, transparent 23px, #000 24px); mask: radial-gradient(circle, transparent 23px, #000 24px); }
[data-look="marquee"] .stat-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-look="marquee"] .stat { padding: 14px 0; }
[data-look="marquee"] .stat + .stat { border-left: 1px solid var(--line); padding-left: 16px; }
[data-look="marquee"] .star svg { fill: var(--accent); stroke: var(--text); }
[data-look="soft"] .stat-band { gap: 10px; }
[data-look="soft"] .stat { border-radius: var(--radius-card); background: var(--surface); padding: 14px; }
[data-look="soft"] .ring { display: flex; }
[data-look="soft"] .stat-band + .progress { display: none; }
[data-look="soft"] .star { width: 62px; height: 62px; border-radius: 50%; background: var(--tone); display: inline-flex; align-items: center; justify-content: center; }
[data-look="soft"] .star svg { fill: var(--accent); }
[data-look="soft"] .stat-num { font-size: 22px; }
[data-look="soft"] .stat.rating .stat-num { font-size: var(--fs-number); }
[data-look="marquee"] .stat-band + .progress { height: 6px; }

/* season tabs */
.season-tabs { display: flex; }
.season-tabs a, .season-tabs span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.season-tabs [aria-current] { color: var(--text); font-weight: 700; }
.season-tabs small { font-size: 12px; color: var(--muted); }
.season-tabs .unaired { opacity: .55; }
[data-look="marquee"] .season-tabs { height: 44px; gap: 24px; margin: 8px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
[data-look="marquee"] .season-tabs [aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
[data-look="soft"] .season-tabs { gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; }
[data-look="soft"] .season-tabs > * { flex: 1; height: 40px; border-radius: 999px; font-size: 14px; }
[data-look="soft"] .season-tabs [aria-current] { background: var(--surface); box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }

/* episode rows: [data-state] = watched | next | open | unaired */
.episodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ep-row { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.ep-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--muted); width: 26px; text-align: right; flex: none; }
.ep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-name { font-size: 15px; font-weight: 600; }
.ep-meta { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.ep-uptohere { display: none; height: 32px; padding: 0 10px; border-radius: var(--radius-control); align-items: center; gap: 4px; font-size: 12px; font-weight: 700; flex: none; }
.ep-row[data-state="next"] .ep-uptohere { display: inline-flex; }
.ep-check { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.ep-check .clock { display: none; }
.ep-row[data-state="unaired"] .ep-check .tick { display: none; }
.ep-row[data-state="unaired"] .ep-check .clock { display: block; }
.ep-row[data-state="unaired"] .ep-check { pointer-events: none; }

[data-look="marquee"] .episodes { margin: 0 calc(-1 * var(--gutter)); }
[data-look="marquee"] .ep-row { padding: 8px var(--gutter); }
[data-look="marquee"] .ep-uptohere { border: 1px solid var(--line); }
[data-look="marquee"] .ep-check { border: 1.5px solid var(--line); }
[data-look="marquee"] .ep-row[data-state="watched"] .ep-body { opacity: .55; }
[data-look="marquee"] .ep-row[data-state="watched"] .ep-check { border: 0; background: var(--text); color: var(--bg); }
[data-look="marquee"] .ep-row[data-state="next"] { background: var(--surface); }
[data-look="marquee"] .ep-row[data-state="next"] .ep-check { border: 2px solid var(--accent); }
[data-look="marquee"] .ep-row[data-state="unaired"] { opacity: .5; }
[data-look="marquee"] .ep-row[data-state="unaired"] .ep-check { border-style: dashed; }

[data-look="soft"] .episodes { gap: 6px; }
[data-look="soft"] .ep-row { height: 58px; padding: 0 6px; border-radius: var(--radius-row); background: var(--surface); }
[data-look="soft"] .ep-num { display: none; }
[data-look="soft"] .ep-check { order: -1; width: 46px; height: 46px; background: var(--surface-2); color: var(--text); }
[data-look="soft"] .ep-name { font-weight: 700; }
[data-look="soft"] .ep-row:not([data-state="watched"]):not([data-state="unaired"]) .ep-check .tick { display: none; }
[data-look="soft"] .ep-row:not([data-state="watched"]):not([data-state="unaired"]) .ep-check::after { content: attr(data-n); font-family: var(--font-display); font-weight: 700; font-size: 17px; }
[data-look="soft"] .ep-row[data-state="watched"] { background: var(--tone); }
[data-look="soft"] .ep-row[data-state="watched"] .ep-check { background: var(--accent-fill); color: var(--on-accent); }
[data-look="soft"] .ep-row[data-state="next"] { box-shadow: inset 0 0 0 2px var(--accent); }
[data-look="soft"] .ep-uptohere { height: 40px; padding: 0 12px; background: var(--tone); }
[data-look="soft"] .ep-row[data-state="unaired"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); border: 0; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
[data-look="soft"] .ep-row[data-state="unaired"] .ep-body { opacity: .6; }

/* poster strip (Similar) + missing art */
.strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.tile { width: 110px; flex: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.tile-art { position: relative; height: 165px; border-radius: var(--radius-art); overflow: hidden; background: var(--surface-2); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.tile-noart { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile-noart b { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: .95; letter-spacing: var(--display-tracking); text-transform: var(--display-transform); }
.tile-noart small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.in-lib { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
[data-look="marquee"] .tile-noart { background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); }
[data-look="marquee"] .in-lib { background: #0E0E10; color: #fff; }
[data-look="soft"] .tile-art { border-radius: var(--radius-art); background: var(--tone); }
[data-look="soft"] .tile-noart { justify-content: space-between; }
[data-look="soft"] .tile-noart::before { content: ''; width: 26px; height: 22px; background: linear-gradient(var(--accent) 0 0) 0 0 / 26px 6px no-repeat, linear-gradient(var(--accent) 0 0) 0 8px / 20px 6px no-repeat, linear-gradient(var(--accent) 0 0) 0 16px / 14px 6px no-repeat; opacity: .45; border-radius: 3px; }
[data-look="soft"] .in-lib { background: var(--accent-fill); color: var(--on-accent); top: 8px; right: 8px; width: 24px; height: 24px; }

/* ---------- settings ------------------------------------------------------ */
.settings { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 26px; }
.set-group { display: flex; flex-direction: column; gap: 12px; }
.set-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
[data-look="soft"] .set-label { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); font-family: var(--font-display); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-control); background: var(--surface-2); }
.segmented button { height: 40px; border-radius: var(--radius-control); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { color: var(--text); font-weight: 700; background: var(--surface); box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }
[data-look="marquee"] .segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
/* sliding selection (segThumb(seg, "aria-pressed")) */
.segmented { position: relative; }
.segmented .seg-thumb { position: absolute; left: 0; top: 0; border-radius: var(--radius-control); background: var(--surface); box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); opacity: 0; pointer-events: none;
  transition: transform var(--dur-pill) var(--ease-pill), width var(--dur-pill) var(--ease-pill); }
[data-look="marquee"] .segmented .seg-thumb { background: var(--text); box-shadow: none; }
.segmented.has-thumb button { position: relative; z-index: 1; transition: color var(--dur-pill) ease; }
[data-look] .segmented.has-thumb button[aria-pressed="true"] { background: transparent; box-shadow: none; }
/* theme / look / accent change: a slower, even cross-fade of the whole app */
html.vt-repaint::view-transition-old(root), html.vt-repaint::view-transition-new(root) { animation-duration: .38s; animation-timing-function: ease; }
.swatch-group { display: flex; flex-direction: column; gap: 8px; }
.swatch-group h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); position: relative; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 3px; }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 600; }
.set-row .ic { color: var(--muted); }
.set-row .set-value { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- choose your look ------------------------------------------- */
.look-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.look-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 14px; border-radius: 22px; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 0 0 1.5px var(--line); transition: box-shadow var(--dur-pill) var(--ease-standard), transform var(--dur-press); }
.look-card:has(input:checked) { box-shadow: 0 0 0 2.5px var(--text); }
.look-card input { position: absolute; opacity: 0; pointer-events: none; }
.look-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.look-preview { position: relative; height: 340px; border-radius: 15px; overflow: hidden; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
/* Previews are static images (previews/upnext-<look>-<theme>.jpg). Do not nest a
   live data-look inside another: the [data-look] layout rules would collide. */
.look-preview-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.look-meta { display: flex; flex-direction: column; gap: 3px; padding: 0 6px; }
.look-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: var(--display-tracking); text-transform: var(--display-transform); }
.look-tagline { font-size: 13px; line-height: 1.35; color: var(--muted); }
.look-radio { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.look-card:has(input:checked) .look-radio { background: var(--text); color: var(--bg); box-shadow: none; }
.look-cards.compact .look-preview { height: 150px; }
.look-cards.compact .look-name { font-size: 18px; }
.look-cards.compact .look-tagline { display: none; }

.choose { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(28px + env(safe-area-inset-top, 0px)) var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); gap: 22px; }
.choose-head { display: flex; flex-direction: column; gap: 10px; }
.choose-head h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: .95; letter-spacing: var(--display-tracking); text-transform: var(--display-transform); }
.choose-head p { margin: 0; color: var(--muted); font-size: 15px; }
.choose-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.choose-foot p { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- toast -------------------------------------------------------- */
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); width: calc(min(430px, 100vw) - 32px); min-height: 52px; padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); border-radius: var(--radius-control); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity var(--dur-sheet) var(--ease-sheet), transform var(--dur-sheet) var(--ease-sheet); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast span { flex: 1; }
.toast button { height: 40px; padding: 0 14px; border-radius: var(--radius-control); background: color-mix(in oklab, var(--bg) 18%, transparent); font-weight: 700; }

[data-look="marquee"] .upnext:not(.compact) .next-card.hero .next-title { white-space: normal; overflow: visible; }
[data-look="marquee"] .upnext:not(.compact) .next-card:not(.hero) .next-meta:not(.next-left) { display: none; }
[data-look="marquee"] .upnext.compact .next-left { display: none; }
