/* ============================================================================
   Regal Picker — Apple TV-style design system
   Black canvas, artwork-led. Colour comes from the posters; the interface is white,
   greys and glass. One warm accent (gold) marks the blend score. Source colours
   (RT red, IMDb yellow, Letterboxd blue) appear only as small dots.
   Type: SF/system sans with Apple's dark label hierarchy; tabular numerals for numbers.
   ========================================================================== */
:root {
  --bg: #000; --bg-2: #1c1c1e; --bg-3: #2c2c2e; --bg-4: #3a3a3c; --bg-5: #48484a;
  --line: rgba(255,255,255,.1); --line-2: rgba(255,255,255,.18);
  --fg: #fff; --fg-2: rgba(235,235,245,.64); --fg-3: rgba(235,235,245,.42);
  --glass: rgba(255,255,255,.1); --glass-2: rgba(255,255,255,.16);
  --accent: #f3c76d; --accent-fg: #1a1300;
  --rt: #ff4a2b; --rt-rotten: #4ac24a; --imdb: #f5c518; --lb: #40bcf4; --you: #a78bfa;
  --warn: #ffb340; --danger: #ff453a; --up: #30d158; --down: #ff453a;
  --r-xl: 22px; --r-lg: 12px; --r-md: 10px; --r-sm: 8px;
  --gutter: 16px; --max: 1240px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --shadow: 0 10px 30px rgba(0,0,0,.55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; }
button, select, a, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--fg); }
.hidden { display: none !important; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.ic.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.num, .scores, .sc .v, .tag-gross, .score-btn, .tile .v, .seen-nums, .time { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; }

/* ---------- header (thin material over black) ---------- */
/* No backdrop-filter or blur on anything that scrolls: phones recompute it on every frame, which is what stutters. */
.top { position: sticky; top: 0; z-index: 5; background: rgba(0,0,0,.94); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: var(--max); margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; }
.brand { min-width: 0; }
.brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theatre-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; }
.theatre-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theatre-btn .chev { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: var(--fg-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand .meta { margin: 1px 0 0; font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .meta.warn { color: var(--warn); }
.brand .meta a { color: var(--fg); font-weight: 600; text-decoration: none; }
.actions { display: flex; gap: 8px; flex-shrink: 0; }
.type-row { display: flex; gap: 8px; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 10px; }
.type-row.hidden { display: none; }
.type-row .fchip { white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--bg-3); color: var(--fg); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s var(--ease), background .15s, color .15s; }
.pill:active { transform: scale(.96); }
.pill.on { background: var(--fg); color: #000; }
.pill .ic { font-size: 14px; }
.pill .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fg); color: #000; font-size: 11px; font-weight: 800; }
.pill.on .badge { background: #000; color: #fff; }
.pill .chev { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.pill.small { height: 30px; padding: 0 11px; font-size: 12px; }
.pill .count { font-weight: 700; color: var(--fg-3); }
.pill.on .count { color: inherit; }

.banner { max-width: var(--max); margin: 12px auto 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-2); color: var(--fg-2); font-size: 13px; }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, var(--bg-2)); color: var(--warn); }
.banner.error { background: color-mix(in srgb, var(--danger) 16%, var(--bg-2)); color: var(--danger); }

/* filter chips: one scrolling row under the title. Every chip is a filter that lights up (white) when active. */

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
#seen { padding-top: 16px; scroll-margin-top: 170px; }

/* ---------- shelves ---------- */
.shelf { margin: 20px 0 0; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.shelf-head > div { min-width: 0; }
.shelf-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.shelf-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--fg-3); }
.section-head { margin-top: 30px; }
.rail-wrap { --card-w: 184px; position: relative; }
.shelf-row { position: relative; isolation: isolate; height: calc(var(--card-w) * 1.5 + 126px); margin: 0 calc(-1 * var(--gutter)); overflow: hidden; touch-action: pan-y pinch-zoom; overscroll-behavior-x: contain; -webkit-user-select: none; user-select: none; cursor: grab; }
.shelf-row.dragging { cursor: grabbing; }
.rail-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .rail-arrow { position: absolute; top: calc(var(--card-w) * .75 + 16px); z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(44,44,46,.96); color: var(--fg); box-shadow: 0 4px 16px rgba(0,0,0,.5); cursor: pointer; transform: translateY(-50%); transition: background .12s; }
  .rail-arrow:hover { background: var(--bg-5); }
  .rail-arrow:active { transform: translateY(-50%) scale(.94); }
  .rail-arrow.prev { left: 0; }
  .rail-arrow.next { right: 0; }
  .rail-arrow.prev svg { transform: scaleX(-1); }
  .rail-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .rail-arrow[hidden] { display: none; }
}
.card.rail { position: absolute; top: 24px; left: calc(50% - var(--card-w) / 2); width: var(--card-w); transition: none; will-change: transform; backface-visibility: hidden; }
.card.rail:active { transform: none; }
.card.rail img { -webkit-user-drag: none; pointer-events: none; }
.card.rail .poster { box-shadow: 0 10px 26px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06) inset; transition: none; }
.card-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.card-halo { position: absolute; inset: 0 0 auto; aspect-ratio: 2 / 3; border-radius: 10px; box-shadow: 0 28px 60px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.14); opacity: 0; pointer-events: none; }
.card.rail .cap { position: relative; text-align: center; } /* positioned so the halo's shadow stays behind it */
.card.rail .scores { justify-content: center; }
@media (hover: hover) and (pointer: fine) {
  .card.rail:hover .poster { transform: none; box-shadow: 0 10px 26px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06) inset; }
}
.card.rail .tag-flag { max-width: calc(100% - 16px); }
.card.rail .scores { font-size: 11px; gap: 4px; }
.card.rail .scores .src { gap: 3px; }
.card.rail .scores .blend { font-size: 14px; }
.card.rail .title { font-size: 15px; font-weight: 700; -webkit-line-clamp: 2; }
.card.rail .meta { -webkit-line-clamp: 1; }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 12px; padding-top: 2px; }
.card { position: relative; display: block; border: 0; padding: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--r-lg); transition: transform .18s var(--ease); }
.card:active { transform: scale(.97); }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .poster, .card:focus-visible .poster { transform: scale(1.045); box-shadow: 0 18px 40px rgba(0,0,0,.65), 0 0 0 2.5px rgba(255,255,255,.95); }
  .card:focus-visible { outline: none; }
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .placeholder { display: grid; place-items: center; width: 100%; height: 100%; box-sizing: border-box; padding: 34px 14px 14px; text-align: center; color: var(--fg-2); font-weight: 600; font-size: 13px; background: linear-gradient(160deg, #2c2c2e, #151517); }
.tag { position: absolute; top: 8px; max-width: calc(100% - 16px); height: 20px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; line-height: 1; color: #fff; background: rgba(28,28,30,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-flag { left: 8px; max-width: 60%; }
.tag-leaving { background: var(--warn); color: #1d1300; }
.tag-seen { background: var(--you); color: #130b2b; }
.card.watched .poster img { opacity: .5; filter: saturate(.3); }
.tag-gross { right: 8px; }
.tag-flag + .tag-gross { max-width: 38%; }
.cap { padding: 8px 2px 0; }
.card .title { font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scores { display: flex; align-items: baseline; gap: 7px; margin: 3px 0 0; font-size: 12px; font-weight: 600; color: var(--fg-2); white-space: nowrap; overflow: hidden; }
.scores .blend { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); line-height: 1; }
.scores .blend.none { color: var(--fg-3); }
.src { display: inline-flex; align-items: center; gap: 4px; }
.src i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--fg-3); }
.src.rt i { background: var(--rt); }
.src.rt.rotten i { background: var(--rt-rotten); }
.src.imdb i { background: var(--imdb); }
.src.lb i { background: var(--lb); }
.src.none { color: var(--fg-3); }
.src.none i { background: rgba(255,255,255,.2); }
.card .meta { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--fg-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta strong { color: var(--fg-2); font-weight: 600; }
.card.pending .poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.empty { max-width: 560px; margin: 40px auto; }
.empty h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.empty-inline { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 2px; }

/* ---------- sheets (dialogs) ---------- */
.sheet { border: 0; padding: 0; width: min(760px, 100vw); max-width: 100vw; max-height: 92dvh; background: var(--bg-2); color: var(--fg); border-radius: var(--r-xl) var(--r-xl) 0 0; margin: auto auto 0; box-shadow: 0 -12px 48px rgba(0,0,0,.6); touch-action: pan-y; overflow: hidden; overscroll-behavior: contain; }
@media (min-width: 760px) { .sheet { border-radius: var(--r-xl); margin: auto; max-height: 86dvh; } }
.sheet::backdrop { background: rgba(0,0,0,.72); }
.sheet[open] { animation: rise .28s var(--ease); }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { position: relative; padding: 14px var(--gutter) calc(24px + env(safe-area-inset-bottom)); overflow: auto; max-height: inherit; overscroll-behavior: contain; }
.sheet-inner > * { position: relative; }
.sheet.compact { width: min(440px, 100vw); }
.handle { width: 36px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 0 auto 14px; touch-action: none; cursor: grab; }
.sheet .close { position: absolute; top: 14px; right: 12px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(72,72,74,.92); color: var(--fg); font-size: 17px; line-height: 1; cursor: pointer; }
.sheet-title { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sheet h3 { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.sheet-inner > .sheet-head { position: sticky; top: -14px; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: -4px calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter); background: var(--bg-2); }
.sheet-head .sheet-title { margin: 0; }
.sheet-head .btn:first-child { justify-self: start; }
.sheet-head .btn:last-child { justify-self: end; }
.sheet-head .btn:disabled { opacity: .4; cursor: default; }

/* film sheet: blurred artwork fades into the sheet */
.film-bg { position: absolute !important; left: -40px; right: -40px; top: -40px; height: 320px; z-index: 0; background-size: cover; background-position: center 25%; filter: saturate(1.3) brightness(.55); transform: scale(1.15); pointer-events: none; }
.film-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(28,28,30,0) 0%, rgba(28,28,30,.55) 55%, var(--bg-2) 100%); }
.film-head { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: end; padding-top: 8px; }
.film-head .poster { box-shadow: 0 14px 34px rgba(0,0,0,.6); }
.film-head h2 { margin: 0 0 4px; padding-right: 30px; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
.film-head h2 span { color: var(--fg-2); font-weight: 400; }
.film-head .facts { margin: 0 0 8px; font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.facts .bo { color: var(--accent); font-weight: 600; }
.flagchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.flagchip { height: 22px; padding: 0 9px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; background: rgba(72,72,74,.92); color: var(--fg); }
.flagchip.leaving { background: var(--warn); color: #1d1300; }

.scores-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 14px; }
.sc { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 11px; border-radius: 12px; background: var(--glass); color: var(--fg); text-decoration: none; transition: background .12s; }
a.sc:hover { background: var(--glass-2); }
.sc .v { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.sc .l { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc .l::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.sc.rt .l::before { background: var(--rt); }
.sc.rt.rotten .l::before { background: var(--rt-rotten); }
.sc.imdb .l::before { background: var(--imdb); }
.sc.lb .l::before { background: var(--lb); }
.sc.hero { background: color-mix(in srgb, var(--accent) 18%, var(--glass)); }
.sc.hero .v { color: var(--accent); }
.sc.hero .l::before { display: none; }
/* Post-credit scenes and box office, under the scores. Up and down are the stock-market green and red. */
.film-facts { display: flex; flex-direction: column; margin: -4px 0 14px; padding: 4px 12px; border-radius: 12px; background: var(--glass); }
.fact-row { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: baseline; padding: 9px 0; font-size: 13px; }
.fact-row + .fact-row { border-top: 1px solid var(--line); }
.fact-k { color: var(--fg-3); font-size: 12px; }
.fact-v { min-width: 0; color: var(--fg); line-height: 1.4; }
.fact-v.muted { color: var(--fg-3); }
.fact-v b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.fact-chg { display: inline-block; margin-left: 2px; font-weight: 700; white-space: nowrap; }
.fact-chg.up { color: var(--up); }
.fact-chg.down { color: var(--down); }
.fact-sub { display: block; margin-top: 2px; color: var(--fg-3); font-size: 12px; }
@media (max-width: 420px) { .fact-row { grid-template-columns: 1fr; gap: 4px; } }
.sc .s { font-size: 11px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc.none .v { color: var(--fg-3); }
@media (max-width: 420px) { .scores-row { grid-template-columns: repeat(2, 1fr); } }

.synopsis { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.synopsis.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.linkbtn { border: 0; background: none; padding: 0; margin: -2px 0 10px; color: var(--fg); font-size: 13px; font-weight: 600; cursor: pointer; }
.credits { margin: 0 0 16px; font-size: 13px; color: var(--fg-3); }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; min-width: 60px; padding: 7px 10px; border-radius: 10px; border: 0; background: var(--bg-3); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; transition: background .12s, color .12s; }
.day .d { display: block; font-size: 11px; font-weight: 500; color: var(--fg-3); }
.day.on { background: #fff; color: #000; }
.day.on .d { color: rgba(0,0,0,.6); }
.times { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.time { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 7px 13px; border-radius: 10px; border: 0; background: var(--bg-3); font-weight: 600; font-size: 15px; }
a.time { color: var(--fg); text-decoration: none; }
.time .tags { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--fg-3); text-transform: uppercase; }
.time.past { opacity: .35; text-decoration: line-through; }
.time.soon { box-shadow: inset 0 0 0 1.5px #fff; }
.note { margin-top: 12px; font-size: 12px; line-height: 1.45; color: var(--fg-3); }
.note a { color: var(--fg-2); }
/* The film sheet has no bottom padding: scroller padding would hold this sticky bar above the screen edge and over the last line. */
.sheet-inner.film { padding-bottom: 0; overflow-x: hidden; touch-action: pan-y pinch-zoom; } /* the blurred backdrop is wider than the sheet */
.sheet-actions { position: sticky; bottom: 0; display: flex; gap: 8px; margin: 18px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: rgba(28,28,30,.98); border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--bg-3); color: var(--fg); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s var(--ease), background .12s, opacity .12s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: #fff; color: #000; }
.btn.ghost { background: var(--glass); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.sheet-actions .btn:first-child { flex: 1; }

/* ---------- rating ---------- */
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 14px; border-radius: 14px; background: var(--bg-3); }
.rate-label { flex-basis: 100%; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--bg-4); font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .12s var(--ease), background .12s; }
.rchip:active { transform: scale(.95); }
.rchip:hover { background: var(--bg-5); }
.rchip.on { background: var(--you); color: #130b2b; }
.scale-hint { flex-basis: 100%; margin: 2px 0 0; min-height: 1.4em; font-size: 13px; color: var(--fg-2); }
.calib { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--fg-3); }
.rate-actions { flex-basis: 100%; display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.you-ink { color: var(--you); }
.worth-wrap { white-space: nowrap; }
.worth-tag { display: inline-flex; align-items: center; gap: 4px; }
.worth-tag.up { color: #a9f0c9; } .worth-tag.down { color: #f7a7a7; }

/* ---------- lists, segmented controls, chips, inputs ---------- */
.list { display: flex; flex-direction: column; margin-top: 8px; border-radius: 14px; overflow: hidden; background: var(--bg-3); }
.list-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; min-height: 48px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 15px; font-weight: 600; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--bg-4); }
.list-row small { display: block; grid-column: 1; font-size: 12px; font-weight: 500; color: var(--fg-3); }
.list-row .ic { grid-column: 2; grid-row: 1 / span 2; font-size: 18px; }
.search { margin: 6px 0 10px; }
.theatre-list { max-height: 50dvh; overflow: auto; }
.fsec { margin-top: 18px; }
.fsec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.fsec .list { margin-top: 0; }
.fsec .note { margin: 8px 0 0; }
.list-row small.inline { display: inline; margin-left: 6px; font-weight: 600; color: var(--fg-3); }
.list-row[aria-checked="false"] { color: var(--fg-3); }
.tick { grid-column: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--bg-5); color: transparent; }
.list-row .tick .ic { grid-column: 1; grid-row: 1; font-size: 14px; stroke-width: 3; }
.list-row.on .tick { background: var(--fg); color: #000; box-shadow: none; }
/* Collapsed dropdown: the current choice with a chevron; the list appears under it when expanded. */
.dd { display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--bg-3); color: var(--fg); text-align: left; font-size: 15px; font-weight: 600; cursor: pointer; }
.dd small { display: block; font-size: 12px; font-weight: 500; color: var(--fg-3); }
.dd .chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .18s var(--ease); }
.dd.opens .chev { transform: rotate(-90deg); }
.dd:disabled { opacity: .5; cursor: default; }
/* A sheet that drops down from under the header instead of rising from the bottom. */
.sheet.from-top { margin: 0 auto auto; width: min(560px, 100vw); max-height: 80dvh; border-radius: 0 0 var(--r-xl) var(--r-xl); box-shadow: 0 12px 48px rgba(0,0,0,.6); }
.sheet.from-top[open] { animation: drop .24s var(--ease); }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet.from-top .sheet-inner { padding: 10px var(--gutter) 16px; }
.sheet.from-top .list { margin-top: 0; }
.seg .ic { font-size: 13px; vertical-align: -2px; margin-right: 4px; }
.seg { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--bg-3); }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.seg button.on { background: var(--bg-5); color: var(--fg); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.fchip { min-height: 36px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--bg-3); color: var(--fg); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, color .12s; }
.fchip:disabled { opacity: .4; cursor: default; }
select.chip { -webkit-appearance: none; appearance: none; height: 32px; padding: 0 28px 0 12px; border-radius: 999px; border: 0; background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b6b6c2' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center; color: var(--fg); font-size: 13px; font-weight: 600; cursor: pointer; }
.text { width: 100%; max-width: 420px; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 0; background: var(--bg-3); color: var(--fg); font: 15px/1.3 inherit; }
.text::placeholder { color: var(--fg-3); }
.account details { margin-top: 14px; color: var(--fg-2); }
.account summary { cursor: pointer; }

/* ---------- Seen (inset grouped) ---------- */
.seen { max-width: 760px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--bg-2); }
.tile .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tile .l { font-size: 11px; color: var(--fg-3); }
.hist-wrap { margin: 0 0 18px; padding: 14px; border-radius: 14px; background: var(--bg-2); }
.hist-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; font-size: 12px; color: var(--fg-3); }
.hist-head strong { font-size: 13px; color: var(--fg); }
.hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 84px; align-items: end; }
.hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.hist-n { min-height: 11px; font-size: 11px; line-height: 1; color: var(--fg-2); }
.hist-bar { width: 100%; max-width: 28px; min-height: 2px; border-radius: 4px 4px 2px 2px; background: var(--you); }
.hist-x { font-size: 11px; line-height: 1; color: var(--fg-3); }
.seen-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--fg-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }
.legend i.rt { background: var(--rt); } .legend i.imdb { background: var(--imdb); } .legend i.lb { background: var(--lb); }
.legend i.you { width: 4px; height: 14px; border-radius: 2px; background: var(--you); vertical-align: -3px; }
.seen-list { display: flex; flex-direction: column; gap: 8px; }
.seen-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg-2); }
.poster-sm { width: 52px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-3); align-self: start; }
.poster-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seen-main { min-width: 0; }
.seen-row h3 { font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
.yr { color: var(--fg-3); font-weight: 400; }
.seen-meta { margin: 2px 0 8px; font-size: 12px; color: var(--fg-3); }
.track { position: relative; height: 24px; margin: 0 6px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; border-radius: 1px; background: var(--line-2); }
.track::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px 25%); opacity: .6; }
.track .dot, .track .you { position: absolute; z-index: 1; }
.track .dot { top: 7px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-2); }
.track .dot.rt { background: var(--rt); } .track .dot.imdb { background: var(--imdb); } .track .dot.lb { background: var(--lb); }
.track .you { top: 2px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--you); box-shadow: 0 0 0 2px var(--bg-2); z-index: 2; }
.seen-nums { margin: 6px 0 0; font-size: 12px; color: var(--fg-3); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.seen-nums .k { white-space: nowrap; }
.seen-nums i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }
.seen-nums i.rt { background: var(--rt); } .seen-nums i.imdb { background: var(--imdb); } .seen-nums i.lb { background: var(--lb); }
.seen-nums b { color: var(--fg); font-weight: 700; }
.seen-nums .gapv { color: var(--fg-2); }
.score-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 56px; height: 56px; padding: 0 8px; border-radius: 14px; border: 0; background: var(--bg-3); color: var(--you); font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; }
.score-btn small { font-size: 10px; font-weight: 600; color: var(--fg-3); }
.score-btn.empty { color: var(--fg-2); font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); background: transparent; }
.seen-edit { grid-column: 1 / -1; }
.seen-edit.rate { margin: 4px 0 0; background: var(--bg-3); }
.account { margin: 22px 0 0; padding: 14px; border-radius: 14px; background: var(--bg-2); }
.account h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--fg); }
.account .btn.primary { margin-top: 2px; }
.install-row { display: flex; gap: 12px; align-items: flex-start; }
.install-icon { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--line); }
.install .code-row { margin-top: 12px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 12px 0 12px 44px; font-size: 15px; line-height: 1.45; color: var(--fg-2); border-top: 1px solid var(--line); counter-increment: step; }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 11px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-3); color: var(--fg); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps b { color: var(--fg); }
.steps .ic { font-size: 16px; vertical-align: -3px; color: var(--fg); }

/* ---------- sign-in sheet: one column, one primary action, generous air ---------- */
.field { display: block; margin: 0 0 12px; }
.field span { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.field .text { max-width: none; margin: 0; height: 50px; padding: 0 14px; font-size: 16px; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.field .text:focus { outline: none; box-shadow: inset 0 0 0 1.5px #fff; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.code-row code { padding: 8px 10px; border-radius: 8px; background: var(--bg-3); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.code-row .text { flex: 1; min-width: 180px; margin: 0; }

/* ---------- larger screens ---------- */
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 26px 16px; }
  .rail-wrap { --card-w: 230px; }
  .shelf-row { -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
  .shelf-head h2 { font-size: 22px; }
  .brand h1 { font-size: 28px; }
  .film-head { grid-template-columns: 128px 1fr; }
  .film-head h2 { font-size: 28px; }
}
/* ---------- phones ---------- */
@media (max-width: 480px) {
  .brand h1 { font-size: 21px; }
  .pill { height: 32px; padding: 0 11px; font-size: 12px; }
  .chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
  .type-row { gap: 6px; overflow-x: auto; scrollbar-width: none; } /* the smallest phones scroll this row, not the page */
  .type-row::-webkit-scrollbar { display: none; }
  .type-row .fchip { flex: 1 0 auto; padding: 0 5px; font-size: 12px; }
  .rchip { width: auto; height: 42px; }
  select.chip { font-size: 16px; } /* 16px stops iOS zooming the page on focus */
  .film-head { grid-template-columns: 92px 1fr; }
  .film-head h2 { font-size: 21px; }
}
@media (max-width: 360px) {
  .type-row { gap: 4px; }
  .type-row .fchip { padding: 0 4px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Phones: the Filters pill keeps its icon and badge only, so the theatre name has room. */
@media (max-width: 520px) {
  #filterBtn .lbl { display: none; }
  #filterBtn { padding: 0 11px; }
  #filterBtn .ic { font-size: 16px; }
}
