/* NOTCH: the NoChill style language. Rules are written down in brand/notch.md.
   1 Every surface has one cut corner (top right). No rounded corners anywhere.
   2 Scores are always shown as a HEAT GAUGE: ten slanted cells, cool to hot.
   3 Display type is tall, narrow, uppercase. Data is monospace.
   4 One accent per theme. It means "this is hot / this is yours / do this".
   5 Motion is short and mechanical: things slide a few pixels, nothing bounces or fades slowly. */

:root {
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --n: 14px; /* the size of the cut corner */
  --rail: 272px;
  --top: 60px;
  --fast: 120ms;
}

/* ---------- themes: the colour half of the language ---------- */
:root, :root[data-theme="dark"] { /* graphite + volt */
  color-scheme: dark;
  --bg: #0e0f10; --panel: #17191b; --panel-2: #212528; --line: #2d3236; --text: #eceee9; --dim: #8f9691; --faint: #5d6460;
  --accent: #c9ff3d; --acc-text: #c9ff3d; --acc-ink: #0e0f10; --cool: #3b4a52; --glow: rgb(201 255 61 / .14);
}
:root[data-theme="red"] { /* black cherry + ember */
  color-scheme: dark;
  --bg: #0f0809; --panel: #1b0e10; --panel-2: #271417; --line: #402027; --text: #f6ebe8; --dim: #ab8f8c; --faint: #6e5254;
  --accent: #ff4b3a; --acc-text: #ff6a58; --acc-ink: #160707; --cool: #52292e; --glow: rgb(255 75 58 / .16);
}
:root[data-theme="blue"] { /* the OkSure look: deep navy + sky */
  color-scheme: dark;
  --bg: #04070b; --panel: #0b1824; --panel-2: #12263a; --line: #1d3955; --text: #e6e9ee; --dim: #8b98a8; --faint: #55657a;
  --accent: #40a1fb; --acc-text: #5db0fc; --acc-ink: #04121f; --cool: #1f3b57; --glow: rgb(64 161 251 / .16);
}
:root[data-theme="light"] { /* warm paper + signal orange */
  color-scheme: light;
  --bg: #f2eee5; --panel: #fffdf8; --panel-2: #e9e4d7; --line: #d3cbb9; --text: #17181a; --dim: #66665f; --faint: #98968b;
  --accent: #e8431a; --acc-text: #b8320f; --acc-ink: #ffffff; --cool: #bcb5a2; --glow: rgb(232 67 26 / .12);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font: 15px/1.5 var(--body); color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 420px at 80% -120px, var(--glow), transparent 70%);
  background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--acc-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--acc-ink); }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.only-small { display: none !important; }
code { font-family: var(--mono); background: var(--panel-2); padding: 1px 6px; }

/* the signature cut corner */
.notch { clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); }
.label { font: 700 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--acc-text); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.mark { display: flex; align-items: baseline; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: .02em; font-variation-settings: "wdth" 75; }
.mark-no { color: transparent; -webkit-text-stroke: 1.6px var(--text); margin-right: 3px; }
.mark-chill { color: var(--accent); }
.finder { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.finder input { width: 100%; height: 40px; padding: 0 14px 0 42px; background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 0; font: 15px var(--body); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); transition: border-color var(--fast); }
.finder input::placeholder { color: var(--faint); }
.finder input:focus { outline: none; border-color: var(--accent); }
.finder-ico { position: absolute; left: 12px; top: 10px; color: var(--faint); pointer-events: none; }
.finder-ico::before { content: ""; display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") center/contain no-repeat; }
.who { display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 8px; font: 700 13px var(--display); text-transform: uppercase; letter-spacing: .08em; }
.me img { width: 28px; height: 28px; object-fit: cover; clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 0 100%); }

/* ---------- buttons ---------- */
.btn { --n: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; background: var(--panel-2); color: var(--text); font: 700 13px var(--display); letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); transition: transform var(--fast) steps(3), background var(--fast); }
.btn:hover { background: var(--line); transform: translate(2px, -2px); }
.btn:active { transform: translate(0, 0); }
.btn.hot { background: var(--accent); color: var(--acc-ink); }
.btn.hot:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--dim); }
.btn.icon { width: 40px; padding: 0; }
.btn.wide { width: 100%; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; }
.rail { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 20px 40px 24px; border-right: 2px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail-head { display: none; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.blk { margin-bottom: 26px; }
.blk .label { display: block; margin-bottom: 12px; }
.rail-shade { display: none; }
.dim-out { opacity: .35; pointer-events: none; }
main { min-width: 0; padding: 20px 28px 56px; }

.kinds { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.kind { --n: 12px; height: 46px; padding: 0 22px; font: 800 22px var(--display); font-variation-settings: "wdth" 75; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); white-space: nowrap; clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); background: transparent; transition: color var(--fast); display: inline-flex; align-items: center; gap: 8px; }
.kind:hover { color: var(--text); }
.kind.on { background: var(--accent); color: var(--acc-ink); }
.kind em { font-style: normal; font-size: 12px; padding: 2px 6px; background: var(--acc-ink); color: var(--accent); }

.bar { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.bar-l { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.bar h2 { font: 800 clamp(30px, 4.5vw, 52px)/.95 var(--display); font-variation-settings: "wdth" 75; text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.count { color: var(--dim); font-size: 13px; }
.bar-r { display: flex; gap: 10px; align-items: center; }
.seg { display: flex; }
.seg button { --n: 9px; width: 44px; height: 40px; display: grid; place-items: center; background: var(--panel-2); color: var(--dim); }
.seg button + button { margin-left: 2px; }
.seg button.on { background: var(--accent); color: var(--acc-ink); }
.seg button:first-child { clip-path: none; }
.seg button:last-child { clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); }
.check { display: flex; align-items: center; gap: 8px; font: 700 12px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- rail pieces ---------- */
.svc-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; background: var(--panel); border-left: 4px solid var(--accent); font-weight: 600; transition: background var(--fast); }
.svc-btn:hover { background: var(--panel-2); }
.svc-btn small { display: block; color: var(--faint); font-size: 11px; font-weight: 400; }
.svc-stack { display: flex; min-width: 40px; }
.svc-stack img, .svc-stack i { width: 30px; height: 30px; margin-right: -9px; border: 2px solid var(--panel); object-fit: cover; background: var(--panel-2); display: grid; place-items: center; font-style: normal; color: var(--accent); }
.channels { display: grid; gap: 4px; }
.channel { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; text-align: left; font: 800 17px var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--dim); border-left: 4px solid var(--line); transition: all var(--fast); }
.channel span { font-size: 11px; color: var(--faint); }
.channel:hover { color: var(--text); border-color: var(--dim); }
.channel.on { color: var(--text); background: var(--panel); border-color: var(--accent); }
.channel.on span { color: var(--acc-text); }
.field { width: 100%; height: 40px; padding: 0 12px; background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 0; font: 14px var(--body); }
.field:focus { outline: none; border-color: var(--accent); }
select.field option { background: var(--panel); color: var(--text); }
.heat-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.step { height: 36px; background: var(--panel); font: 700 13px var(--mono); color: var(--dim); transform: skewX(-14deg); transition: background var(--fast); }
.step:hover { background: var(--panel-2); color: var(--text); }
.step.on { background: var(--accent); color: var(--acc-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 5px 10px; font: 700 12px var(--display); letter-spacing: .08em; text-transform: uppercase; background: var(--panel); color: var(--dim); transition: all var(--fast); }
button.chip:hover { color: var(--text); background: var(--panel-2); }
.chip.on { background: var(--accent); color: var(--acc-ink); }
.chips.ro .chip { background: var(--panel-2); }
.themes { display: flex; gap: 8px; }
.swatch { width: 52px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; outline-offset: 3px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }
.swatch i { display: block; }
.swatch.on { outline: 2px solid var(--accent); clip-path: none; }
.t-dark i:first-child { background: #0e0f10; } .t-dark i:last-child { background: #c9ff3d; }
.t-red i:first-child { background: #0f0809; } .t-red i:last-child { background: #ff4b3a; }
.t-blue i:first-child { background: #04070b; } .t-blue i:last-child { background: #40a1fb; }
.t-light i:first-child { background: #f2eee5; } .t-light i:last-child { background: #e8431a; }

/* ---------- the heat gauge ---------- */
.gauge { display: inline-flex; gap: 2px; vertical-align: middle; }
.gauge i { width: 7px; height: 14px; background: var(--line); transform: skewX(-18deg); }
.gauge i.on { background: color-mix(in srgb, var(--cool), var(--accent) calc(var(--i) * 11.2%)); }
.heat { display: flex; align-items: center; gap: 10px; }
.heat b { font-size: 13px; }

/* ---------- cover art grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 20px; }
.card { position: relative; cursor: pointer; outline-offset: 6px; }
.card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 2 / 3; background: var(--accent); clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); opacity: 0; }
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.art { position: relative; aspect-ratio: 2 / 3; background: var(--panel-2); overflow: hidden; transition: transform var(--fast) steps(3); }
.card:hover .art, .card:focus-visible .art { transform: translate(-6px, -6px); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.noart { display: grid; place-items: center; height: 100%; padding: 14px; text-align: center; font: 800 20px var(--display); text-transform: uppercase; color: var(--faint); }
.noart.sm { font-size: 11px; padding: 4px; }
.rank { position: absolute; left: 6px; bottom: -8px; font: 800 72px/1 var(--display); font-variation-settings: "wdth" 75; color: transparent; -webkit-text-stroke: 2px var(--accent); text-shadow: 0 6px 24px rgb(0 0 0 / .6); pointer-events: none; letter-spacing: -.02em; }
.art::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / .72)); pointer-events: none; }
.rank { z-index: 2; }
.card h3 { margin-top: 12px; font: 800 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--dim); font-size: 12px; margin: 4px 0 8px; }
.stamp { position: absolute; z-index: 3; top: 8px; left: 8px; width: 34px; height: 34px; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text); backdrop-filter: blur(4px); transition: background var(--fast), color var(--fast); }
.stamp:hover { background: var(--accent); color: var(--acc-ink); }
.stamp.on { background: var(--accent); color: var(--acc-ink); }
.stamp svg { width: 18px; height: 18px; }
.ghost .art { animation: pulse 1s steps(4) infinite alternate; }
.ghost h3, .ghost .meta { background: var(--panel); color: transparent; }
@keyframes pulse { to { background: var(--panel); } }

/* ---------- list rows (tickets) ---------- */
.lines { display: grid; gap: 8px; }
.line { --n: 16px; position: relative; display: grid; grid-template-columns: 56px 64px 1fr auto auto; gap: 16px; align-items: center; padding: 10px 14px 10px 6px; background: var(--panel); border-left: 5px solid var(--line); cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.line:hover, .line:focus-visible { background: var(--panel-2); border-color: var(--accent); }
.rank-n { text-align: right; font-size: 22px; font-weight: 700; color: var(--faint); }
.line:hover .rank-n { color: var(--acc-text); }
.thumb { aspect-ratio: 2 / 3; background: var(--panel-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.line h3 { font: 800 21px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.line .meta { margin: 3px 0 6px; }
.blurb { color: var(--dim); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 70ch; }
.line .stamp { position: static; background: var(--panel-2); }
.heat.col { flex-direction: column; align-items: flex-end; gap: 4px; }

.more-wrap { margin-top: 36px; max-width: 360px; }
.notice, .empty { padding: 20px 24px; background: var(--panel); border-left: 5px solid var(--accent); margin-bottom: 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.empty { display: block; padding: 40px 28px; }
.empty h3 { font: 800 28px var(--display); text-transform: uppercase; margin-bottom: 8px; }
.empty .btn { margin-top: 14px; }

/* ---------- title sheet ---------- */
.sheet-back, .dialog-back { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .62); animation: dim var(--fast) linear; }
@keyframes dim { from { opacity: 0; } }
.sheet { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(980px, 100%); overflow-y: auto; background: var(--bg); border-left: 4px solid var(--accent); animation: slide 180ms steps(6); overscroll-behavior: contain; }
@keyframes slide { from { transform: translateX(60px); opacity: 0; } }
.sheet:focus { outline: none; }
.sheet-hero { position: relative; height: 280px; background: linear-gradient(transparent 30%, var(--bg)), var(--bd, none) center 20% / cover, var(--panel); }
.sheet-x { position: absolute; top: 16px; right: 16px; background: color-mix(in srgb, var(--bg) 80%, transparent); }
.sheet-body { padding: 0 32px 48px; margin-top: -150px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sheet-top { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: end; }
.sheet-poster { --n: 22px; aspect-ratio: 2 / 3; background: var(--panel-2); overflow: hidden; box-shadow: 0 0 0 4px var(--accent); }
.sheet-poster img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head h2 { font: 800 clamp(34px, 5vw, 60px)/.92 var(--display); font-variation-settings: "wdth" 75; text-transform: uppercase; margin: 6px 0 10px; overflow-wrap: anywhere; }
.tag { color: var(--dim); font-style: italic; margin-bottom: 12px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.panel { background: var(--panel); padding: 22px 24px; }
.panel .label { display: block; margin-bottom: 14px; }
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.score { display: grid; gap: 4px; }
.score.none { opacity: .45; }
.s-name { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.s-val { font: 800 44px/1 var(--display); font-variation-settings: "wdth" 75; }
.score small { color: var(--faint); font-size: 11px; }
.small-print { font-size: 12px; color: var(--dim); margin-top: 12px; }
.where-row { display: flex; align-items: center; gap: 18px; padding: 8px 0; }
.where-row .label { width: 64px; margin: 0; color: var(--dim); }
.where-logos { display: flex; gap: 8px; flex-wrap: wrap; }
.plogo img { width: 44px; height: 44px; object-fit: cover; }
.plogo { opacity: .7; }
.plogo.mine { opacity: 1; outline: 3px solid var(--accent); outline-offset: 2px; }
.linkout { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font: 700 13px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.linkout svg { width: 15px; height: 15px; }
.video { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: opacity var(--fast); }
.video:hover img { opacity: 1; }
.video .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video .play svg { width: 72px; height: 72px; padding: 20px; background: var(--accent); color: var(--acc-ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.story { max-width: 70ch; font-size: 16px; line-height: 1.65; }
.cast { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.cast small { color: var(--dim); }
.more .label { display: block; margin: 14px 0 14px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 16px; overflow-x: auto; padding: 6px 6px 18px; scrollbar-width: thin; scrollbar-color: var(--accent) var(--panel); }

/* ---------- dialogs and toasts ---------- */
.dialog-back { display: grid; place-items: center; padding: 20px; z-index: 90; }
.dialog { --n: 22px; width: min(760px, 100%); max-height: min(86vh, 800px); display: flex; flex-direction: column; gap: 16px; padding: 26px; background: var(--panel); border-top: 4px solid var(--accent); }
.dialog.small { width: min(440px, 100%); }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.dialog h2 { font: 800 32px/1 var(--display); text-transform: uppercase; margin-bottom: 6px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; overflow-y: auto; padding: 4px; min-height: 120px; }
.svc { position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 8px 10px; background: var(--panel-2); font-size: 12px; text-align: center; line-height: 1.2; outline: 2px solid transparent; transition: outline-color var(--fast); }
.svc:hover { outline-color: var(--faint); }
.svc img { width: 52px; height: 52px; object-fit: cover; outline: 1px solid var(--line); }
.svc b { position: absolute; top: 0; right: 0; width: 24px; height: 24px; display: none; place-items: center; background: var(--accent); color: var(--acc-ink); }
.svc b svg { width: 15px; height: 15px; }
.svc.on { outline-color: var(--accent); background: var(--panel); }
.svc.on b { display: grid; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#toasts { position: fixed; z-index: 95; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { --n: 10px; padding: 12px 20px; background: var(--text); color: var(--bg); font: 700 13px var(--display); letter-spacing: .08em; text-transform: uppercase; animation: slide 160ms steps(5); }
.toast.bad { background: #ff5b4a; color: #1a0705; }

.foot { padding: 28px 28px 40px calc(var(--rail) + 28px); color: var(--dim); font-size: 12px; border-top: 2px solid var(--line); }
.foot p + p { margin-top: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  :root { --top: 56px; }
  .only-small { display: inline-flex !important; }
  .top { padding: 0 12px; gap: 10px; }
  .mark { font-size: 24px; }
  .me-name { display: none; }
  .shell { display: block; }
  .rail { position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); height: auto; background: var(--bg); transform: translateX(-102%); transition: transform 160ms steps(6); border-right: 4px solid var(--accent); }
  .rail-head { display: flex; }
  .rail-shade { position: fixed; inset: 0; z-index: 65; background: rgb(0 0 0 / .6); display: none; }
  body.rail-open .rail { transform: none; }
  body.rail-open .rail-shade { display: block; }
  main { padding: 14px 14px 40px; }
  .kind { padding: 0 14px; font-size: 18px; height: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 22px 12px; }
  .rank { font-size: 52px; }
  .line { grid-template-columns: 34px 52px 1fr auto; gap: 10px; }
  .line .heat.col { display: none; }
  .blurb { -webkit-line-clamp: 1; }
  .foot { padding: 24px 14px 36px; }
  .sheet-hero { height: 200px; }
  .sheet-body { padding: 0 16px 40px; margin-top: -110px; }
  .sheet-top { grid-template-columns: 120px 1fr; gap: 16px; }
  .scores { grid-template-columns: 1fr; }
  .score { grid-template-columns: 1fr auto; align-items: center; }
  .s-val { font-size: 30px; grid-row: span 2; text-align: right; }
  .dialog { padding: 18px; }
}
@media (max-width: 520px) {
  .finder { max-width: none; }
  .mark { font-size: 21px; flex: none; }
  .top { gap: 8px; }
  .who .btn:not(.icon) span { display: none; }
  .who .btn:not(.icon) { width: 40px; padding: 0; }
  .finder { min-width: 0; }
  .sheet-top { grid-template-columns: 1fr; }
  .sheet-poster { width: 130px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- seen it / For you ---------- */
.marks { position: absolute; z-index: 3; top: 8px; left: 8px; display: flex; gap: 4px; }
.marks .stamp { position: static; }
.stamp.seen.on { box-shadow: inset 0 -3px 0 var(--acc-ink); }
.line .marks { position: static; flex-direction: column; }
.line .marks .stamp { background: var(--panel-2); }
.why { margin: 6px 0 0; font-size: 11px; color: var(--acc-text); line-height: 1.3; }
.line .why { margin: 0 0 6px; }
.seg.words button { width: auto; padding: 0 14px; font: 700 12px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.seg.words button:last-child { clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); }

/* ---------- on air / ended ---------- */
.air { margin: 6px 0 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.air.run { color: var(--acc-text); }
.air.end { color: var(--faint); }
.line .air { margin: 0 0 6px; }
.air-badge { margin-top: 12px; display: inline-flex; gap: 10px; align-items: center; padding: 6px 12px; background: var(--panel-2); border-left: 4px solid var(--faint); font-size: 13px; }
.air-badge b { font: 800 14px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.air-badge.run { border-color: var(--accent); }
.air-badge.run b { color: var(--acc-text); }
.air-badge .mono { color: var(--dim); }
.heat-steps.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- genre mixer ---------- */
.genre-head { display: flex; align-items: center; justify-content: space-between; }
.mini { position: relative; width: 26px; height: 26px; display: inline-grid; place-items: center; background: var(--panel-2); color: var(--text); clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); transition: background var(--fast); }
.mini:hover, .mini.on { background: var(--accent); color: var(--acc-ink); }
.mini svg { width: 15px; height: 15px; }
.mini b { position: absolute; right: -1px; bottom: -1px; font-size: 9px; background: var(--acc-ink); color: var(--accent); padding: 0 3px; line-height: 12px; }
.gsum { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; background: var(--panel); border-left: 4px solid var(--accent); font: 700 13px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.gsum i { color: var(--acc-text); font-style: normal; font-size: 11px; }
.gd-chips { gap: 6px; }
.chip.big { padding: 9px 14px; font-size: 14px; }
.gd-hint { min-height: 44px; padding: 10px 12px; background: var(--panel-2); border-left: 4px solid var(--accent); font-size: 14px; }
.seg.words.wide { width: 100%; }
.seg.words.wide button { flex: 1; }

/* ---------- calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-nav h3 { flex: 1; font: 800 28px var(--display); font-variation-settings: "wdth" 75; text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { display: contents; }
.cal-wd span { padding: 4px 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--acc-text); }
.cal-day { --n: 10px; min-height: 112px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; padding: 6px; text-align: left; background: var(--panel); border-left: 3px solid transparent; clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); transition: background var(--fast); }
.cal-day:hover { background: var(--panel-2); }
.cal-day.other { opacity: .45; }
.cal-day.past .cal-chip { opacity: .65; }
.cal-day.today { border-color: var(--accent); background: var(--panel-2); }
.cal-day.today .cal-n { color: var(--acc-text); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font-size: 13px; color: var(--dim); }
.cal-chip { display: block; padding: 2px 5px; font-size: 11px; line-height: 1.3; background: var(--panel-2); border-left: 3px solid var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.today .cal-chip { background: var(--panel); }
.cal-chip.fol { border-color: var(--accent); }
.cal-chip i { font-style: normal; font-weight: 700; color: var(--acc-text); font-family: var(--mono); }
.cal-more { font-size: 11px; color: var(--acc-text); }
.cal-dot { display: none; margin-top: auto; align-self: center; min-width: 20px; padding: 0 5px; font-size: 11px; text-align: center; background: var(--accent); color: var(--acc-ink); }
.cal-sec { margin-top: 24px; display: grid; gap: 8px; }
.cal-sec > .label { margin-bottom: 4px; }
.cal-hint { margin-top: 16px; }
.cal-date { display: grid; gap: 6px; margin-bottom: 14px; }
.cal-date h4 { display: flex; gap: 12px; align-items: baseline; font: 800 18px var(--display); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.cal-date h4 .mono { font-size: 12px; font-weight: 400; color: var(--dim); text-transform: none; }
.ep { --n: 14px; display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 8px 14px 8px 6px; background: var(--panel); border-left: 5px solid var(--line); cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.ep:hover, .ep:focus-visible { background: var(--panel-2); border-color: var(--accent); }
.ep.past { opacity: .8; }
.ep h3 { font: 800 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.ep .meta { margin: 3px 0 6px; }
.ep-body .chip { font-size: 10px; padding: 3px 8px; }
.ep-when { text-align: right; display: grid; gap: 2px; }
.ep-when b { font: 800 16px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--acc-text); }
.ep-when span { font-size: 12px; color: var(--dim); }
@media (max-width: 760px) {
  .cal-day { min-height: 54px; align-items: center; padding: 4px 2px; }
  .cal-chip, .cal-more { display: none; }
  .cal-dot { display: block; }
  .cal-wd span { text-align: center; padding: 4px 0; font-size: 10px; letter-spacing: .04em; }
  .cal-nav h3 { font-size: 22px; }
  .ep { grid-template-columns: 44px 1fr; }
  .ep-when { grid-column: 2; text-align: left; display: flex; gap: 10px; align-items: baseline; }
}
.gd-chips { overflow-y: auto; min-height: 60px; }

/* ---------- calendar: calendar on the left, the picked day on the right ---------- */
.cal-layout { display: block; }
.cal-side .day-panel { margin-top: 24px; }
@media (min-width: 1000px) {
  .cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
  .cal-side .day-panel { margin-top: 0; }
  .cal-side { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  /* the month view fills the window exactly, so a 1080p screen never needs scrolling */
  body.cal-fit { overflow: hidden; }
  body.cal-fit .foot { display: none; }
  body.cal-fit main { height: calc(100vh - var(--top)); display: flex; flex-direction: column; padding-bottom: 16px; overflow: hidden; }
  body.cal-fit .kinds { margin-bottom: 12px; }
  body.cal-fit .bar { margin-bottom: 12px; padding-bottom: 10px; }
  body.cal-fit #stage { flex: 1; min-height: 0; }
  body.cal-fit .cal-layout { height: 100%; min-height: 420px; align-items: stretch; }
  body.cal-fit .cal-side { position: static; max-height: none; height: 100%; }
  body.cal-fit .cal-main { display: flex; flex-direction: column; min-height: 0; height: 100%; }
  body.cal-fit .cal-nav { margin-bottom: 8px; }
  body.cal-fit .cal-nav h3 { font-size: 24px; }
  body.cal-fit .cal-grid { flex: 1; min-height: 0; grid-template-rows: auto repeat(var(--rows), minmax(0, 1fr)); }
  body.cal-fit .cal-day { min-height: 0; overflow: hidden; }
}

/* ---------- cinema mode: dark, clean, trailer first ---------- */
html.cinema body { background-image: none; }
html.cinema .only-small { display: inline-flex !important; }
html.cinema .foot { display: none; }
html.cinema .shell { display: block; }
html.cinema main { padding: 24px 44px 56px; }
/* the sidebar becomes a drawer, like on a phone; the Filters button opens it */
html.cinema .rail { position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); height: auto; background: var(--bg); transform: translateX(-102%); transition: transform 160ms steps(6); border-right: 4px solid var(--accent); }
html.cinema .rail-head { display: flex; }
html.cinema .rail-shade { position: fixed; inset: 0; z-index: 65; background: rgb(0 0 0 / .6); display: none; }
html.cinema body.rail-open .rail { transform: none; }
html.cinema body.rail-open .rail-shade { display: block; }
html.cinema .kind { height: 56px; font-size: 26px; padding: 0 26px; }
html.cinema .bar h2 { font-size: clamp(38px, 5vw, 68px); }
html.cinema .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 28px; }
html.cinema .card h3 { font-size: 21px; }
html.cinema .card .meta, html.cinema .heat b { font-size: 14px; }
html.cinema .rank { font-size: 92px; }
html.cinema .card:focus-visible, html.cinema .line:focus-visible, html.cinema .ep:focus-visible { outline: 3px solid var(--accent); outline-offset: 8px; }
html.cinema .line h3 { font-size: 26px; }
html.cinema .blurb { font-size: 15px; }
html.cinema .top { height: 52px; }

/* the dimmed title screen */
.cine { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; background: rgb(3 4 6 / .97); animation: dim var(--fast) linear; cursor: pointer; }
.cine:focus { outline: none; }
.cine-in { width: min(1180px, 100%); margin: 0 auto; padding: 28px 28px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.cine .panel, .cine button, .cine a, .cine iframe { cursor: auto; }
.cine button, .cine a { cursor: pointer; }
.cine-video { position: relative; width: min(100%, calc(58vh * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 4px var(--accent), 0 30px 120px rgb(0 0 0 / .8); }
.cine-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cine-video.still { display: grid; place-items: center; background: linear-gradient(rgb(0 0 0 / .55), rgb(0 0 0 / .55)), var(--bd, none) center / cover, var(--panel); }
.cine-top { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: end; width: min(100%, calc(58vh * 16 / 9)); margin: 0 auto; }
.cine-top .sheet-poster { --n: 16px; box-shadow: 0 0 0 3px var(--accent); }
.cine-top .sheet-head h2 { font-size: clamp(30px, 4vw, 52px); }
.cine-cols, .cine .more, .cine-in > .panel { width: min(100%, calc(58vh * 16 / 9)); margin: 0 auto; }
.cine-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cine-cols .scores { grid-template-columns: 1fr; gap: 12px; }
.cine-cols .score { grid-template-columns: 110px auto 1fr; align-items: center; gap: 12px; }
.cine-cols .s-val { font-size: 30px; grid-row: auto; text-align: left; }
.cine-cols .score small { display: none; }
.cine-hint { text-align: center; font-size: 12px; margin-top: 8px; }
.cine-load { padding: 40vh 0; text-align: center; }
@media (max-width: 900px) {
  .cine-in { padding: 14px 14px 44px; }
  .cine-video, .cine-top, .cine-cols, .cine .more, .cine-in > .panel { width: 100%; }
  .cine-top { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .cine-cols { grid-template-columns: 1fr; }
  html.cinema main { padding: 14px 14px 40px; }
  html.cinema .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
