/* Decades. A den at dusk: aubergine wall, walnut cabinet, amber dial light. */
:root {
  --wall: #2b1f2e;
  --walnut: #6b4226;
  --walnut-hi: #946038;
  --bezel: #1c1917;
  --amber: #ffb436;
  --amber-dim: #8a5a12;
  --cream: #efe6d2;
  --teal: #23b5a6;
  --rose: #e0457b;
  --ink: #17121a;
  --ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --crt: "VT323", "Menlo", monospace;
  --scan: .5;
  --soft: .4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: clip; }
body {
  margin: 0;
  font: 500 15px/1.4 var(--ui); color: var(--cream);
  background:
    radial-gradient(120% 80% at 38% 30%, #4a3550 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 46px),
    var(--wall);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--rose); outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 20px; padding: 10px 20px; min-width: 0; }
.top-actions, .brand { flex: none; }
.brand {
  font: italic 900 26px/1 var(--ui); font-stretch: 122%; letter-spacing: -.02em; white-space: nowrap;
  color: var(--amber); text-shadow: 0 0 18px rgba(255,180,54,.55);
}
.brand small { font: 600 12px/1 var(--ui); font-stretch: 100%; letter-spacing: 0; color: #b9a6bf; text-shadow: none; margin-left: 4px; }
.top-now { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; white-space: nowrap; overflow: hidden; color: #d9cbe0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.top-now b { font-weight: 800; }
.tn-chip { font: 400 20px/1 var(--crt); color: #fff; border-radius: 4px; padding: 2px 7px 0; }
.tn-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tn-year { font: 400 19px/1 var(--crt); color: var(--amber); }
.tn-badge { font-weight: 800; font-size: 12px; border-radius: 3px; padding: 1px 6px; background: var(--amber); color: var(--ink); }
.tn-idle { color: #cfc2d6; }
.top-now a { color: #f0b7cd; font-size: 13px; }
.top-actions { display: flex; gap: 8px; }
.btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: 6px;
  padding: 7px 13px; font-weight: 650; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn.is-on { background: var(--amber); color: var(--ink); border-color: var(--amber); }

/* ---------- room ---------- */
.room { padding: 4px 20px 12px; min-height: 0; display: grid; }
.stage { position: relative; container-type: size; display: grid; place-items: center; min-width: 0; min-height: 0; }
.tv {
  width: min(100cqw, calc((100cqh - 96px) * 4 / 3 + 44px));
  padding: 22px 22px 0; border-radius: 18px 18px 12px 12px;
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.14) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.05) 0 2px, transparent 2px 19px),
    linear-gradient(180deg, var(--walnut-hi), var(--walnut) 40%, #4f2f1a);
  box-shadow: 0 30px 60px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.4);
}
body[data-cabinet="black"] .tv { background: linear-gradient(180deg, #34302d, #1d1a18); }
body[data-cabinet="cream"] .tv { background: linear-gradient(180deg, #e2d9c3, #b9ad92); }
body[data-cabinet="cream"]:not(.mode-3d) .knob { color: #2c2520; border-color: rgba(0,0,0,.3); }

/* the 3D room: a DOM layer for the picture under a WebGL layer for everything else */
.scene { position: absolute; inset: 0; border-radius: 16px; overflow: clip; background: #241a27; }
.scene-dom { position: absolute !important; left: 0; top: 0; z-index: 1; overflow: clip !important; }
.scene-gl { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
/* the old room, frozen while the next decade's is built under it, then dissolved away */
.scene-snap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.scene::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 70px 26px var(--wall); }
body.mode-3d .tv {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: auto; padding: 0; z-index: 5;
  background: rgba(26,18,28,.8); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); backdrop-filter: blur(8px);
}
/* 3D: the room is the whole page. The top bar and the year band float over it with nothing behind
   them but a soft shade, so the text stays readable. */
body.mode-3d .room { position: fixed; inset: 0; padding: 0; z-index: 0; display: grid; }
/* at every width: the small-screen layout stacks the page, and the stage would shrink to nothing under the room */
body.mode-3d .stage { display: grid; container-type: size; }
body.mode-3d .scene { border-radius: 0; }
body.mode-3d:not(.is-full) .scene::after { box-shadow: none; background: linear-gradient(180deg, rgba(9,6,11,.92) 0, rgba(9,6,11,.78) calc(var(--top-h, 56px) * .68), rgba(9,6,11,0) calc(var(--top-h, 56px) * 1.6), rgba(9,6,11,0) calc(100% - var(--band-h, 120px) * 1.5), rgba(9,6,11,.74) calc(100% - var(--band-h, 120px) * .88), rgba(9,6,11,.94) 100%); }
/* words over the room: a pale wall or an orange bean bag must not swallow them */
body.mode-3d .tn-idle, body.mode-3d .band-count, body.mode-3d .credit { color: #e9dfcd; }
body.mode-3d .top, body.mode-3d .band-read, body.mode-3d .credit { text-shadow: 0 1px 2px rgba(0,0,0,.85); }
body.mode-3d .band-presets > * { background-color: rgba(18,13,20,.78); }
/* what is playing has its own dark ground, so posters and covers behind it never run into the words */
body.mode-3d .top-now:not(:empty) { flex: 0 1 auto; margin-right: auto; padding: 4px 9px; border-radius: 8px; background: rgba(14,10,16,.84); -webkit-mask-image: none; mask-image: none; }
body.mode-3d .tn-idle { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.mode-3d .band-presets > .is-on { background-color: var(--amber); text-shadow: none; }
body.mode-3d .top { grid-row: 1; position: relative; z-index: 6; pointer-events: none; }
body.mode-3d .band { grid-row: 3; position: relative; z-index: 6; background: none; border-top: 0; pointer-events: none; }
body.mode-3d .top > *, body.mode-3d .band > * { pointer-events: auto; }
/* the bar under the 3D set: one slim, solid row (readable over any room) that steps aside when the pointer rests */
body.mode-3d .tv { bottom: calc(var(--band-h, 120px) + 8px); opacity: .96; transition: opacity .2s; }
body.mode-3d:not(.is-full) .tv { background: rgba(18,13,20,.9); }
body.mode-3d .tv:hover, body.mode-3d .tv:focus-within { opacity: 1; }
body.mode-3d.intro .tv { opacity: 0 !important; pointer-events: none; transition: none !important; }     /* the opening shot is the set's alone */
@media (hover: none) { body.mode-3d .tv { opacity: 1; } body.mode-3d:not(.is-full) .tv { background: #120d14; } }      /* solid: the set's own buttons must not show through */
@media (hover: hover) { body.mode-3d.ui-rest .tv:not(:hover):not(:focus-within) { opacity: 0; transition: opacity .7s; } }
body.mode-3d .tv-chin { height: auto; padding: 5px 8px; gap: 8px; }
body.mode-3d .chin-btns { flex-wrap: nowrap; gap: 5px; }
body.mode-3d .knob { padding: 5px 8px; }
body.mode-3d .grille { display: none; }
body.mode-3d .led { font-size: 22px; min-width: 44px; }

.screen {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #050505;
  border-radius: 5% / 6.5%; container-type: size; container-name: screen;
  box-shadow: 0 0 0 10px var(--bezel), 0 0 0 12px rgba(255,255,255,.07), inset 0 0 60px rgba(0,0,0,.9);
  isolation: isolate;
}
.screen.is-flat { border-radius: 4px; }
.screen.in-3d { aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.screen.in-3d .fx-glass { display: none; }
.screen video, .screen .static, .screen .bumper, .screen .bars { transform-origin: 0 0; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.screen video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000;
  filter: sepia(calc(var(--warm, 0) * var(--soft) * 2)) saturate(calc(1 + var(--soft) * .35 - var(--fade, 0) * var(--soft))) contrast(calc(1 + var(--soft) * .12)) blur(calc(var(--soft) * .9px));
  opacity: 0; pointer-events: none;
}
/* each decade's set draws color its own way (scaled by the Picture softness setting): early color sets ran warm
   and a little washed out, 1970s ones warm and rich; later sets are neutral */
body[data-era="1960s"] { --warm: .09; --fade: .32; }
body[data-era="1970s"] { --warm: .06; --fade: .04; }
.screen[data-fit="contain"] video { object-fit: contain; }
/* degauss: the picture's colors swim and settle, the frame wobbles once */
.screen.degauss video.is-live { animation: degauss 1.6s cubic-bezier(.2,.7,.3,1) both; }
@keyframes degauss {
  0% { filter: hue-rotate(0deg) saturate(1.6); transform: skewX(0deg) scale(1); }
  12% { filter: hue-rotate(70deg) saturate(2.2); transform: skewX(1.6deg) scale(1.012); }
  30% { filter: hue-rotate(-50deg) saturate(1.8); transform: skewX(-1.1deg) scale(1.006); }
  55% { filter: hue-rotate(25deg) saturate(1.3); transform: skewX(.5deg); }
  80% { filter: hue-rotate(-8deg) saturate(1.05); transform: skewX(-.15deg); }
  100% { filter: none; transform: none; }
}
.screen video.is-live { opacity: 1; }
/* picture-in-picture: a second channel in the top-left corner, framed as the big sets of the late 1980s and 90s
   framed it; out of the way while the guide has the screen */
.pip-win { position: absolute; left: 5cqw; top: 7cqh; width: 31cqw; aspect-ratio: 4 / 3; z-index: 5; background: #000; outline: .45cqw solid rgba(238,238,238,.9);
  box-shadow: 0 0 0 .8cqw rgba(0,0,0,.6), 0 1cqw 3cqw rgba(0,0,0,.5); overflow: hidden; pointer-events: none; }
.screen .pip-win video { opacity: 1; transform: none; transition: none; }
.pip-win .pip-ch { position: absolute; left: 1.4cqw; top: 1cqh; z-index: 2; font: 400 4.6cqw/1 var(--crt); color: #49ff6b; text-shadow: .3cqw .3cqw 0 #000; }
.pip-win .pip-note { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: .7cqh 1.2cqw; font: 400 3.3cqw/1.1 var(--crt); color: #fff; background: rgba(0,0,0,.62); text-align: center; }
.pip-win .pip-note:empty { display: none; }
.screen.is-pip .pip-win, .screen.is-off .pip-win { display: none; }
/* guide open: the picture, static and bumpers shrink into the corner */
.screen.is-pip video, .screen.is-pip .static, .screen.is-pip .bumper, .screen.is-pip .bars {
  transform: translate(3cqw, 4cqh) scale(.4); z-index: 7; outline: 1.1cqw solid #fff;
}
.screen.is-pip video:not(.is-live) { z-index: 0; }
.screen.is-pip .osd-banner, .screen.is-pip .osd-num, .screen.is-pip .bug { display: none; }
/* while the set is on, a vertical swipe on the picture changes channel instead of scrolling the page */
.screen:not(.is-off) { touch-action: pinch-zoom; }
/* the guide's preview: the highlighted tape's archive.org thumbnail over the corner picture */
.g-thumb { position: absolute; left: 3cqw; top: 4cqh; width: 40cqw; height: 40cqh; z-index: 8; background: #000; outline: 1.1cqw solid #fff;
  opacity: 0; transition: opacity .25s ease; pointer-events: none; overflow: hidden; }
.g-thumb.is-in { opacity: 1; }
.screen:not(.is-pip) .g-thumb { opacity: 0; transition: none; }
.g-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; filter: saturate(.92) contrast(1.04); }
.gt-tag { position: absolute; left: 1.2cqw; bottom: 1.4cqh; padding: .6cqh 1.2cqw .2cqh; background: rgba(0,0,0,.74); color: #fff;
  font: 400 3cqw/1 var(--crt); text-transform: uppercase; letter-spacing: .04em; }
/* the station's logo in the corner during shows, as channels did from the mid-1990s */
.bug { position: absolute; right: 5.5cqw; bottom: 7cqh; z-index: 24; pointer-events: none; display: flex; align-items: baseline; gap: .8cqw;
  color: rgba(255,255,255,.66); text-shadow: 0 0 .5cqw rgba(0,0,0,.75); font: 800 4.4cqw/1 var(--ui); font-stretch: 112%; letter-spacing: -.01em; }
.bug small { font: 700 3.3cqw/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.fx-scan { background: repeating-linear-gradient(0deg, rgba(0,0,0,calc(var(--scan) * .55)) 0 1px, transparent 1px 3px); }      /* black at some opacity comes out the same with no blend mode, which costs a TV stick a whole screen's pass per frame */
.fx-vig { background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
/* the faint hum bar that rolled up the picture on sets of the 1950s to the 70s (it follows the scanline setting) */
body:is([data-era="1950s"], [data-era="1960s"], [data-era="1970s"]) .screen:not(.is-off) .fx-scan::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 24%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,calc(var(--scan) * .16)) 50%, transparent);
  animation: humbar 13s linear infinite;
}
@keyframes humbar { from { transform: translateY(0); } to { transform: translateY(-520%); } }
@media (prefers-reduced-motion: reduce) { .fx-scan::after { display: none; } }
.fx-glass { background: linear-gradient(125deg, rgba(255,255,255,.09) 0%, transparent 22%, transparent 100%); }
.screen.no-vig .fx-vig, .screen.no-vig .fx-glass { display: none; }
.screen.is-off .fx { opacity: .4; }
.static { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20; image-rendering: pixelated; }

/* power */
.power-on {
  position: absolute; inset: 0; z-index: 40; border: 0; background: radial-gradient(circle at 50% 45%, #161616, #030303 70%);
  display: grid; place-content: center; justify-items: center; gap: 2.4cqh; color: var(--cream);
}
.power-ring { width: 14cqw; height: 14cqw; border-radius: 50%; border: 1cqw solid var(--amber); box-shadow: 0 0 6cqw rgba(255,180,54,.45), inset 0 0 3cqw rgba(255,180,54,.35); position: relative; }
.power-ring::after { content: ""; position: absolute; left: 50%; top: -2.2cqw; width: 1cqw; height: 6cqw; margin-left: -.5cqw; background: var(--amber); border-radius: 1cqw; box-shadow: 0 0 0 1cqw #0b0b0b; }
.power-label { font: 800 4.2cqw/1 var(--ui); font-stretch: 112%; }
.power-sub { font: 400 3.4cqw/1 var(--crt); color: #b9a98c; max-width: 80cqw; text-align: center; }
.power-tip { min-height: 3cqw; font: 600 3.2cqw/1.25 var(--ui); color: #f0e2c4; opacity: 0; transition: opacity .5s; max-width: 80cqw; text-align: center; }
.power-tip.is-in { opacity: .95; }
.power-credit { position: absolute; left: 0; right: 0; bottom: 5cqh; font: 400 3cqw/1.2 var(--crt); color: #b9a98c; text-align: center; padding: 0 4cqw; }
.power-on:disabled { cursor: progress; }
.power-on:disabled .power-ring { opacity: .35; }
.screen.powering .power-on { animation: powerup .65s ease-out forwards; }
/* turning off: the picture squeezes to a bright line, the line to a dot, the dot fades */
.crt-off { position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
.crt-off i { position: absolute; left: 0; right: 0; }
.crt-off .co-top, .crt-off .co-bot { height: 50%; background: #000; animation: .26s cubic-bezier(.55,0,.85,.35) forwards; }
.crt-off .co-top { top: 0; transform: translateY(-100%); animation-name: co-top; }
.crt-off .co-bot { bottom: 0; transform: translateY(100%); animation-name: co-bot; }
@keyframes co-top { to { transform: translateY(-.6%); } }
@keyframes co-bot { to { transform: translateY(.6%); } }
.crt-off .co-line { top: 50%; height: .9cqh; margin-top: -.45cqh; background: #f4f8ff; box-shadow: 0 0 2.4cqh .9cqh rgba(205,225,255,.85); opacity: 0; animation: co-line .62s ease-in forwards; }
@keyframes co-line { 0% { opacity: 0; transform: scale(1, 1); } 38% { opacity: 1; transform: scale(1, 1); } 72% { opacity: 1; transform: scale(.025, 1.5); } 100% { opacity: 0; transform: scale(.004, 1.5); } }
/* turning on: a line lights across the middle, then the picture opens out from it */
.crt-off .co-top.on { animation: co-top-on .4s .16s cubic-bezier(.2,.65,.3,1) both; }
.crt-off .co-bot.on { animation: co-bot-on .4s .16s cubic-bezier(.2,.65,.3,1) both; }
@keyframes co-top-on { from { transform: translateY(-.6%); } to { transform: translateY(-100%); } }
@keyframes co-bot-on { from { transform: translateY(.6%); } to { transform: translateY(100%); } }
.crt-off .co-line.on { animation: co-line-on .5s ease-out forwards; }
@keyframes co-line-on { 0% { opacity: 0; transform: scale(.004, 1.5); } 25% { opacity: 1; transform: scale(1, 1.5); } 45% { opacity: 1; transform: scale(1, 1); } 100% { opacity: 0; transform: scale(1, 40); } }
@media (prefers-reduced-motion: reduce) { .crt-off { display: none; } }
/* a 1950s set shows its picture in black and white */
body.bw-50s[data-era="1950s"] .screen video { filter: grayscale(1) contrast(calc(1.08 + var(--soft) * .12)) brightness(1.04) blur(calc(var(--soft) * .9px)); }
@keyframes powerup {
  0% { clip-path: inset(0); background: #fff; }
  40% { clip-path: inset(49.5% 0); background: #fff; }
  100% { clip-path: inset(49.5% 50%); background: #fff; }
}

/* on-screen display */
.osd-num { position: absolute; right: 5cqw; top: 4cqh; z-index: 25; font: 400 13cqw/0.8 var(--crt); color: #49ff6b; text-shadow: .4cqw .4cqw 0 #000, 0 0 2cqw rgba(73,255,107,.6); }
/* the VCR's own words, top left in its blocky white letters, and the band of a tape finding its tracking */
.vcr-osd { position: absolute; inset: 0; z-index: 24; pointer-events: none; overflow: hidden; }
.vcr-osd .v-word { position: absolute; left: 7cqw; top: 7cqh; font: 400 6.4cqw/1 var(--crt); color: #fff; letter-spacing: .06em;
  text-shadow: .35cqw .35cqw 0 #000, -.2cqw -.2cqw 0 #000, .2cqw -.2cqw 0 #000, -.2cqw .2cqw 0 #000; }
.vcr-osd .v-track { position: absolute; left: 0; right: 0; height: 13cqh; top: 100%; opacity: .85; mix-blend-mode: screen;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.65) 0 1px, rgba(255,255,255,0) 1px 3px, rgba(200,200,255,.35) 3px 4px, rgba(0,0,0,0) 4px 6px);
  filter: blur(.4px); animation: vtrack 1.5s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes vtrack { 0% { top: 100%; opacity: .9; } 70% { opacity: .7; } 100% { top: -15cqh; opacity: 0; } }
.screen.is-off .vcr-osd, .screen.is-pip .vcr-osd { display: none; }
/* closed captions: white on black boxes, as a decoder drew them (lifted above the channel banner while it shows: captions.js) */
.cc { position: absolute; left: 7cqw; right: 7cqw; bottom: 7cqh; z-index: 7; display: grid; justify-items: center; gap: .25cqh;
  pointer-events: none; font: 400 4.6cqw/1.08 var(--crt); color: #fff; text-align: center; letter-spacing: .02em; }
.cc span { background: #000; padding: .06em .42em .1em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.screen.is-off .cc, .screen.is-pip .cc { display: none; }
.osd-banner {
  position: absolute; left: 4cqw; right: 4cqw; bottom: 5cqh; z-index: 25; padding: 2.2cqh 3cqw;
  background: linear-gradient(180deg, rgba(20,30,120,.92), rgba(10,14,70,.94)); border: .45cqw solid #fff;
  font: 400 4.4cqw/1.05 var(--crt); color: #fff; display: grid; gap: .6cqh;
}
.osd-banner .ob-top { display: flex; justify-content: space-between; gap: 3cqw; color: #ffe14a; }
.osd-banner .ob-title { font-size: 6cqw; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.osd-banner .ob-next { color: #b8c4ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-banner .ob-desc { display: none; }
/* the 1990s and 2000s sets' info bars carry a line or two about the show */
body:is([data-era="1990s"], [data-era="2000s"]) .osd-banner .ob-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 3.5cqw; line-height: 1.15; color: #d9e0f7; }
.osd-banner .ob-bar { height: 1.2cqh; background: rgba(255,255,255,.2); }
.osd-banner .ob-bar i { display: block; height: 100%; background: #ffe14a; }
.osd-vol { position: absolute; left: 6cqw; top: 6cqh; z-index: 26; font: 400 5cqw/1 var(--crt); color: #49ff6b; text-shadow: .3cqw .3cqw 0 #000; letter-spacing: .05em; white-space: pre; }
/* a reminder coming due: a card across the top of the picture; OK or a click tunes to it */
.osd-remind { position: absolute; left: 50%; top: 5cqh; z-index: 29; width: 72cqw; transform: translate(-50%, -14%); opacity: 0; transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.2,1);
  background: rgba(8,10,34,.94); border: .45cqw solid #ffe14a; box-shadow: 0 1cqh 4cqh rgba(0,0,0,.6); padding: 1.8cqh 3cqw 1.6cqh; font: 400 4.2cqw/1.1 var(--crt); color: #fff; display: grid; gap: .7cqh; cursor: pointer; }
.osd-remind.is-in { opacity: 1; transform: translate(-50%, 0); }
.osd-remind .or-top { display: flex; gap: 1.4cqw; align-items: baseline; color: #ffe14a; }
.osd-remind .or-title { font-size: 6.2cqw; line-height: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.osd-remind .or-sub { color: #b8c4ff; font-size: 3.6cqw; }
/* the "next" strip of the 1990s and 2000s */
.snipe { position: absolute; left: 4.5cqw; bottom: 8cqh; z-index: 4; display: flex; align-items: stretch; max-width: 64cqw; pointer-events: none;
  font: 800 3.1cqw/1 var(--ui); color: #fff; opacity: 0; transform: translateX(-12%); transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .35s; filter: drop-shadow(0 .5cqh 1cqh rgba(0,0,0,.55)); }
.snipe.is-in { opacity: 1; transform: none; }
.snipe > span { padding: 1.3cqh 1.6cqw 1.1cqh; white-space: nowrap; }
.snipe .sn-badge { background: var(--c, #e0457b); text-transform: uppercase; letter-spacing: .1em; font-weight: 900; }
.snipe .sn-title { background: rgba(8,8,12,.86); overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 700; }
.snipe .sn-when { background: #f2f2f2; color: #111; }
.snipe[data-style="00s"] { font-weight: 700; }
.snipe[data-style="00s"] .sn-badge { border-radius: 1.2cqw 0 0 1.2cqw; background: linear-gradient(180deg, color-mix(in srgb, var(--c, #e0457b) 70%, #fff), var(--c, #e0457b)); }
.snipe[data-style="00s"] .sn-title { background: linear-gradient(180deg, rgba(60,80,120,.82), rgba(12,20,40,.9)); border-top: .2cqh solid rgba(255,255,255,.35); }
.snipe[data-style="00s"] .sn-when { border-radius: 0 1.2cqw 1.2cqw 0; background: linear-gradient(180deg, #fff, #cfd6e0); }
.screen.is-pip .snipe { display: none; }
.osd-toast { position: absolute; left: 50%; top: 14cqh; transform: translateX(-50%); z-index: 27; max-width: 84cqw; background: #000; color: #fff; border: .4cqw solid #fff; padding: 1.5cqh 3cqw; font: 400 4.4cqw/1.1 var(--crt); text-align: center; }

/* the menu on the TV, and the years panel */
.quick {
  position: absolute; left: 5cqw; right: 5cqw; bottom: 11cqh; z-index: 28; display: flex; gap: .8cqw; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, rgba(20,30,120,.95), rgba(10,14,70,.96)); border: .45cqw solid #fff; padding: 1.4cqh 1.4cqw;
}
.q-item { font: 400 4.6cqw/1 var(--crt); color: #fff; background: none; border: 0; padding: 1.1cqh 1.7cqw .7cqh; white-space: nowrap; flex: none; }
.q-item.is-sel { background: #ffe14a; color: #0a0e46; }
/* more of the menu past an end: that end fades, where a word cut square looked broken */
.quick { --fade-l: #000; --fade-r: #000; }
.quick.more-l, .quick.more-r { -webkit-mask-image: linear-gradient(90deg, var(--fade-l), #000 9cqw, #000 calc(100% - 9cqw), var(--fade-r)); mask-image: linear-gradient(90deg, var(--fade-l), #000 9cqw, #000 calc(100% - 9cqw), var(--fade-r)); }
.quick.more-l { --fade-l: transparent; }
.quick.more-r { --fade-r: transparent; }
.q-credit { position: absolute; left: 5cqw; right: 5cqw; bottom: 1.3cqh; z-index: 28; text-align: center; font: 400 2.9cqw/1.12 var(--crt); color: #fff; text-shadow: 0 0 .6cqw #000, 0 .2cqw .4cqw #000; pointer-events: none; }
.quick[hidden] + .q-credit { display: none; }
/* the station's logo and the Next strip step aside for the menu and the legal lines under it */
.screen.has-menu .bug, .screen.has-menu .snipe { visibility: hidden; }
/* televisions crop their edges: the legal lines stay inside the safe area */
body.mode-tv .q-credit { bottom: 5cqh; }
body.mode-tv .quick { bottom: 15cqh; }
/* Find a show: a search over the next hours of every channel, on the TV screen */
.find-osd { position: absolute; left: 6cqw; right: 6cqw; top: 7cqh; z-index: 29; padding: 2.4cqh 3cqw 2cqh; background: linear-gradient(180deg, rgba(20,30,120,.97), rgba(10,14,70,.98));
  border: .45cqw solid #fff; font: 400 4cqw/1.1 var(--crt); color: #fff; }
.find-osd .f-head { color: #ffe14a; font-size: 5cqw; margin-bottom: 1.2cqh; }
.find-osd .f-input { width: 100%; box-sizing: border-box; font: 400 4.6cqw/1.2 var(--crt); color: #fff; background: rgba(0,0,0,.35); border: .3cqw solid #b8c4ff; padding: .8cqh 1.6cqw; outline: none; border-radius: 0; }
.find-osd .f-input:focus { border-color: #ffe14a; }
.find-osd .f-list { margin-top: 1.4cqh; display: grid; gap: .5cqh; }
.find-osd .f-item { display: grid; grid-template-columns: 12cqw 24cqw minmax(0, 1fr); gap: 1.6cqw; align-items: baseline; text-align: left; background: rgba(255,255,255,.06); border: 0;
  color: inherit; font: inherit; font-size: 3.6cqw; padding: .6cqh 1.2cqw; cursor: pointer; }
.find-osd .f-item.is-sel { background: #ffe14a; color: #0a0e46; }
.find-osd .f-item.is-now .f-when { color: #49ff6b; }
.find-osd .f-item.is-sel .f-when { color: inherit; }
.find-osd .f-ch, .find-osd .f-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-osd .f-note { margin-top: 1.4cqh; color: #b8c4ff; font-size: 3.2cqw; }
/* the tape's page as a QR code, for a phone to open (on a TV) */
.qr-osd { z-index: 31; }                       /* above the tube's scanlines and glass, so the code is crisp */
.qr-osd .qr-row { display: flex; gap: 3cqw; align-items: center; }
.qr-osd .qr-code { width: 46cqh; height: 46cqh; image-rendering: pixelated; flex: none; border-radius: .6cqw; }
.qr-osd .qr-text { display: grid; gap: 1.2cqh; min-width: 0; }
.qr-osd .qr-text b { font-weight: 400; color: #fff; font-size: 4.4cqw; line-height: 1.1; overflow-wrap: anywhere; }
.qr-osd .qr-url { color: #ffe14a; font-size: 3.4cqw; overflow-wrap: anywhere; }
.years-osd {
  position: absolute; left: 8cqw; right: 8cqw; top: 20cqh; z-index: 28; padding: 3cqh 3.4cqw; text-align: center;
  background: linear-gradient(180deg, rgba(20,30,120,.96), rgba(10,14,70,.97)); border: .45cqw solid #fff; font: 400 4.2cqw/1.1 var(--crt); color: #fff;
}
.y-big { font-size: 14cqw; line-height: .85; color: #ffe14a; }
.y-bar { display: flex; gap: .4cqw; height: 4.4cqh; margin: 2.4cqh 0 1cqh; }
.y-bar i { flex: 1; background: rgba(255,255,255,.18); }
.y-bar i.in { background: #ffe14a; }
.y-ends { display: flex; justify-content: space-between; gap: 2cqw; color: #b8c4ff; }
.y-hint { margin-top: 2.2cqh; color: #b8c4ff; font-size: 3.6cqw; }

/* off-air bars */
.bars { position: absolute; inset: 0; z-index: 4; background: #111; container-type: size; }
.bars-strip { position: absolute; inset: 0 0 26% 0; background: linear-gradient(90deg, #c0c0c0 0 14.28%, #c0c000 0 28.57%, #00c0c0 0 42.85%, #00c000 0 57.14%, #c000c0 0 71.42%, #c00000 0 85.71%, #0000c0 0); }
.bars::after { content: ""; position: absolute; inset: 74% 0 0 0; background: linear-gradient(90deg, #00214c 0 18%, #fff 0 36%, #32006a 0 54%, #131313 0 100%); }
/* the 1950s and 60s: a black and white resolution chart (circles, wedges, a gray scale) */
.bars[data-style="chart"] { background:
  linear-gradient(90deg, transparent calc(50% - .25cqw), #111 calc(50% - .25cqw) calc(50% + .25cqw), transparent 0),
  linear-gradient(0deg, transparent calc(50% - .35cqh), #111 calc(50% - .35cqh) calc(50% + .35cqh), transparent 0),
  repeating-radial-gradient(circle at 50% 50%, transparent 0 7cqh, rgba(0,0,0,.75) 7cqh 7.6cqh),
  repeating-conic-gradient(from 0deg at 50% 50%, #e8e8e8 0 4deg, #6a6a6a 4deg 8deg),
  #9a9a9a; }
.bars[data-style="chart"] .bars-strip { inset: auto 22cqw 6cqh 22cqw; height: 7cqh; background: linear-gradient(90deg, #000 0 16.6%, #333 0 33.3%, #666 0 50%, #999 0 66.6%, #ccc 0 83.3%, #fff 0); border: .4cqw solid #111; }
.bars[data-style="chart"]::after { inset: 6cqh 34cqw auto 34cqw; height: 9cqh; background: repeating-linear-gradient(90deg, #111 0 .5cqw, #eee .5cqw 1cqw); border: .4cqw solid #111; }
.bars[data-style="chart"] .bars-note { background: #e8e8e8; color: #111; border-color: #111; font-family: Georgia, 'Times New Roman', serif; }
/* the 2000s: a digital set's blue screen */
.bars[data-style="blue"] { background: linear-gradient(180deg, #0a2fd0, #0b23a8); }
.bars[data-style="blue"] .bars-strip, .bars[data-style="blue"]::after { display: none; }
.bars[data-style="blue"] .bars-note { background: none; border: 0; color: #fff; font: 700 5cqw/1.2 var(--ui); letter-spacing: .02em; text-shadow: 0 .2cqw .6cqw rgba(0,0,0,.4); }
.bars-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 78cqw; background: #000; color: #fff; border: .5cqw solid #fff; padding: 3cqh 4cqw; text-align: center; font: 400 4.6cqw/1.1 var(--crt); }
.bars-note b { display: block; font-weight: 400; font-size: 7.6cqw; color: #ffe14a; margin-bottom: 1cqh; }

/* bumpers: station idents drawn in CSS */
.bumper { position: absolute; inset: 0; z-index: 12; --c: var(--teal); overflow: hidden; container-type: size; background: var(--c); color: #fff; display: grid; place-content: center; justify-items: center; text-align: center; gap: 2cqh; }
.bumper::before, .bumper::after { content: ""; position: absolute; border-radius: 50%; animation: drift 6s linear infinite; }
.bumper::before { width: 70cqw; height: 70cqw; left: -18cqw; top: -22cqw; background: rgba(0,0,0,.28); mix-blend-mode: multiply; }
.bumper::after { width: 46cqw; height: 46cqw; right: -10cqw; bottom: -14cqw; background: rgba(255,255,255,.55); mix-blend-mode: soft-light; animation-direction: reverse; }
@keyframes drift { from { transform: rotate(0) translateX(3cqw) rotate(0); } to { transform: rotate(360deg) translateX(3cqw) rotate(-360deg); } }
.bumper .bp-zig { position: absolute; left: -5%; right: -5%; bottom: 14cqh; height: 5cqh; opacity: .9; background: repeating-linear-gradient(135deg, #fff 0 2cqw, transparent 2cqw 4cqw); transform: rotate(-4deg); }
.bumper .bp-badge { position: relative; z-index: 2; font: italic 900 9cqw/0.9 var(--ui); font-stretch: 120%; background: #fff; color: var(--c); padding: 1.2cqh 3.5cqw; transform: rotate(-3deg); box-shadow: 1.2cqw 1.2cqw 0 rgba(0,0,0,.35); }
.bumper .bp-line { position: relative; z-index: 2; font: 800 6.4cqw/1.05 var(--ui); font-stretch: 108%; max-width: 82cqw; text-shadow: .4cqw .4cqw 0 rgba(0,0,0,.35); }
.bumper .bp-sub { position: relative; z-index: 2; font: 400 5cqw/1 var(--crt); max-width: 82cqw; opacity: .95; }
/* the 1950s and 60s: a card slide in a rounded frame, serif type, no color to speak of */
.bumper[data-style="60s"] { background: radial-gradient(circle at 50% 45%, #5d5d5d, #1c1c1c 75%); }
.bumper[data-style="60s"]::before { inset: 6cqh 6cqw; width: auto; height: auto; left: 6cqw; top: 6cqh; border-radius: 4cqw; background: none; border: .8cqw solid rgba(255,255,255,.75); mix-blend-mode: normal; animation: none; }
.bumper[data-style="60s"]::after, .bumper[data-style="60s"] .bp-zig { display: none; }
.bumper[data-style="60s"] .bp-badge { font: 700 6.2cqw/1 Georgia, 'Times New Roman', serif; font-stretch: normal; letter-spacing: .12em; text-transform: uppercase; background: none; color: #fff; box-shadow: none; transform: none; border-bottom: .4cqw solid #fff; padding: 0 0 1cqh; }
.bumper[data-style="60s"] .bp-line { font: italic 400 6cqw/1.1 Georgia, 'Times New Roman', serif; text-shadow: none; }
.bumper[data-style="60s"] .bp-sub { font: 400 4.2cqw/1.1 Georgia, serif; letter-spacing: .04em; }
/* the 70s: warm stripes and a fat rounded logo */
.bumper[data-style="70s"] { background: #2b1a10; }
.bumper[data-style="70s"]::before { inset: auto -10cqw 18cqh -10cqw; left: -10cqw; top: auto; width: auto; height: 26cqh; border-radius: 0; mix-blend-mode: normal; animation: none; transform: rotate(-6deg);
  background: linear-gradient(180deg, #f7c548 0 20%, #f39237 20% 40%, #e2582f 40% 60%, #b53d2b 60% 80%, #6b2a1c 80%); }
.bumper[data-style="70s"]::after, .bumper[data-style="70s"] .bp-zig { display: none; }
.bumper[data-style="70s"] .bp-badge { font: 900 10cqw/0.95 var(--ui); font-stretch: 125%; border-radius: 99cqw; padding: 1.4cqh 5cqw; background: #f7c548; color: #2b1a10; transform: none; box-shadow: 0 .8cqw 0 #b53d2b; }
.bumper[data-style="70s"] .bp-line { color: #f9e1b0; text-shadow: none; }
/* the 80s: a neon grid running to the horizon, chrome type */
.bumper[data-style="80s"] { background: linear-gradient(180deg, #0b0628 0 52%, #1d0b3a 52%); }
.bumper[data-style="80s"]::before { left: -20cqw; right: -20cqw; top: 52cqh; bottom: -10cqh; width: auto; height: auto; border-radius: 0; mix-blend-mode: normal; animation: grid-run 1.2s linear infinite;
  background: repeating-linear-gradient(90deg, rgba(255,60,200,.85) 0 .35cqw, transparent .35cqw 8cqw), repeating-linear-gradient(0deg, rgba(255,60,200,.85) 0 .35cqw, transparent .35cqw 5cqh);
  transform: perspective(40cqh) rotateX(62deg); transform-origin: 50% 0; }
@keyframes grid-run { to { background-position: 0 0, 0 5cqh; } }
.bumper[data-style="80s"]::after { width: 34cqw; height: 34cqw; left: 33cqw; right: auto; top: 14cqh; bottom: auto; background: linear-gradient(180deg, #ffd34e, #ff3fa4 70%); mix-blend-mode: normal; animation: none; opacity: .85; }
.bumper[data-style="80s"] .bp-zig { display: none; }
.bumper[data-style="80s"] .bp-badge { background: linear-gradient(180deg, #fff 0 45%, #8fb6ff 50%, #e9f2ff 80%); -webkit-background-clip: text; background-clip: text; color: transparent; box-shadow: none; transform: skewX(-8deg); filter: drop-shadow(0 0 1.2cqw rgba(80,200,255,.9)); }
.bumper[data-style="80s"] .bp-line { color: #7df9ff; text-shadow: 0 0 1.5cqw #29e3ff; }
.bumper[data-style="80s"] .bp-sub { color: #ff8bd8; }
/* the 2000s: dark glass with a sheen */
.bumper[data-style="00s"] { background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c) 70%, #fff 10%), #0a0f1c 70%); }
.bumper[data-style="00s"]::before { inset: 22cqh 12cqw; left: 12cqw; top: 22cqh; width: auto; height: auto; border-radius: 3cqw; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 50%, rgba(255,255,255,.08)); border: .3cqw solid rgba(255,255,255,.35); mix-blend-mode: normal; animation: none; }
.bumper[data-style="00s"]::after { width: 140cqw; height: 18cqh; left: -20cqw; right: auto; top: 18cqh; bottom: auto; border-radius: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: rotate(-12deg); mix-blend-mode: normal; animation: sheen 3s ease-in-out infinite; }
@keyframes sheen { from { translate: -60cqw 0; } to { translate: 60cqw 0; } }
.bumper[data-style="00s"] .bp-zig { display: none; }
.bumper[data-style="00s"] .bp-badge { border-radius: 99cqw; transform: none; font-style: normal; font-weight: 800; font-stretch: 100%; background: linear-gradient(180deg, #fff, #dfe8f5); box-shadow: 0 .6cqw 2cqw rgba(0,0,0,.4); }
.bumper[data-style="00s"] .bp-line { font-weight: 700; letter-spacing: -.01em; }

/* ---------- cabinet chin / remote bar ---------- */
.tv-chin { display: flex; align-items: center; gap: 16px; height: 74px; padding: 0 4px; }
.grille { flex: 1; height: 30px; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.5) 0 3px, transparent 3px 7px); opacity: .7; }
.led { font: 400 34px/1 var(--crt); color: #ff5a3c; background: #1a0705; padding: 2px 10px 0; min-width: 62px; text-align: center; border-radius: 4px; box-shadow: inset 0 0 8px #000; text-shadow: 0 0 10px rgba(255,90,60,.8); }
.chin-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.knob { background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.25)); border: 1px solid rgba(0,0,0,.55); border-radius: 5px; padding: 6px 10px; font: 750 12.5px/1 var(--ui); color: #f3e7d0; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); white-space: nowrap; }
.knob:active { transform: translateY(1px); }

/* ---------- year band ---------- */
.band { display: grid; grid-template-columns: 264px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 12px 22px 14px; background: linear-gradient(180deg, #1c141e, #120d14); border-top: 1px solid rgba(255,255,255,.08); }
.band-years { font: 400 46px/0.9 var(--crt); color: var(--amber); text-shadow: 0 0 16px rgba(255,180,54,.6); white-space: nowrap; }
.band-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.band-count { font-size: 12.5px; color: #c4b6ca; white-space: nowrap; }
#regionSel { font: 650 12.5px/1 var(--ui); color: var(--cream); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 8px; min-width: 0; max-width: 240px; }
#regionSel option { color: #17121a; }
.dial { position: relative; height: 64px; border-radius: 8px; touch-action: none; user-select: none; background: linear-gradient(180deg, #2a1d0c, #1a1206); box-shadow: inset 0 0 0 1px rgba(255,180,54,.25), inset 0 8px 20px rgba(0,0,0,.6); }
.dial-bars { position: absolute; inset: 6px 14px 22px; display: flex; align-items: flex-end; gap: 2px; opacity: .5; }
.dial-bars i { flex: 1; background: var(--amber-dim); border-radius: 1px 1px 0 0; min-height: 2px; }
.dial-bars i.in { background: var(--amber); }
.dial-ticks { position: absolute; inset: auto 14px 3px; height: 18px; display: flex; }
.dial-ticks span { flex: 1 1 0; min-width: 0; position: relative; display: flex; justify-content: center; white-space: nowrap; font: 400 15px/1 var(--crt); color: #c79a4b; }
.dial-ticks span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: #c79a4b; opacity: .6; }
.dial-ticks span.maj::before { height: 8px; top: -9px; opacity: 1; }
.dial-ticks span:not(.maj) { font-size: 0; }
.dial-window { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; cursor: grab; background: rgba(255,180,54,.16); box-shadow: inset 0 0 0 1px rgba(255,180,54,.75), 0 0 22px rgba(255,180,54,.3); }
.dial-window:active { cursor: grabbing; }
.dial-knob::after { content: ''; position: absolute; inset: 0 -14px -20px; }      /* a grip a finger can find (down over the years too) */
.dial-knob { position: absolute; top: -5px; bottom: 21px;      /* stops above the year labels, so the years it marks stay readable */ width: 14px; margin-left: -7px; border-radius: 4px; border: 0; padding: 0; cursor: ew-resize; background: linear-gradient(90deg, #c9c2b3, #f7f1e3 45%, #9d9686); box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.band-presets { display: grid; grid-template-columns: repeat(3, auto); gap: 6px; }
.chip { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.chip:hover { background: rgba(255,255,255,.14); }
.chip.is-on { background: var(--amber); border-color: var(--amber); color: var(--ink); }

/* ---------- the guide (drawn inside the screen) ---------- */
.guide-tv {
  --g-bg: #16247e; --g-row: #2135ad; --g-alt: #1b2c97; --g-head: #0b1250; --g-text: #fff; --g-accent: #ffe14a; --g-now: #3650cf; --g-line: #0b1250; --g-chw: 22cqw; --g-rowh: 9.6cqh;
  position: absolute; inset: 0; z-index: 5; background: var(--g-bg); color: var(--g-text);
  font: 400 3.6cqw/1.05 var(--crt); display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  opacity: 0; transform: translateY(2.5%); transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1);
}
.guide-tv.is-in { opacity: 1; transform: none; }
.guide-tv[data-theme="teal"] { --g-bg: #0a4a4e; --g-row: #0f6c70; --g-alt: #0c5c60; --g-head: #062c2f; --g-accent: #ffd166; --g-now: #17a39a; --g-line: #062c2f; }
.guide-tv[data-theme="slate"] { --g-bg: #171c29; --g-row: #2a3348; --g-alt: #222a3c; --g-head: #0d111b; --g-accent: #6fd3ff; --g-now: #3f5488; --g-line: #0d111b; }
.guide-tv[data-theme="amber"] { --g-bg: #120a01; --g-row: #251703; --g-alt: #1c1102; --g-head: #000; --g-text: #ffb436; --g-accent: #ffe1a3; --g-now: #5a3a06; --g-line: #000; }
.guide-tv[data-theme="grape"] { --g-bg: #3a1450; --g-row: #5a2278; --g-alt: #4b1b66; --g-head: #220a31; --g-accent: #7dffcf; --g-now: #8a3cb4; --g-line: #220a31; }
.guide-tv[data-density="compact"] { --g-rowh: 6.3cqh; }
.guide-tv[data-density="roomy"] { --g-rowh: 11.8cqh; }
.g-top { display: grid; grid-template-columns: 46cqw minmax(0, 1fr); height: 46.2cqh; }
.guide-tv.no-pip .g-top { grid-template-columns: minmax(0, 1fr); height: auto; max-height: 34cqh; }
.guide-tv.no-pip .g-pip { display: none; }
.guide-tv.no-pip .g-info { padding-left: 3cqw; }
.g-info { padding: 3.6cqh 3cqw 1.5cqh 1.5cqw; display: flex; flex-direction: column; gap: 1cqh; overflow: hidden; }
.g-info > * { flex: none; }
.gi-top { display: flex; align-items: center; gap: 1.4cqw; white-space: nowrap; }
.gi-chip { padding: .3cqh 1.2cqw 0; border-radius: .7cqw; color: #fff; }
.gi-ch { overflow: hidden; text-overflow: ellipsis; color: var(--g-accent); }
.gi-when { margin-left: auto; padding: .3cqh 1.2cqw 0; border: .3cqw solid currentColor; opacity: .85; }
.gi-when.is-on { background: #c9302c; border-color: #c9302c; color: #fff; opacity: 1; }
.gi-title { font-size: 4.9cqw; line-height: 1.16; padding-top: .3cqh; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gi-meta { display: flex; flex-wrap: wrap; column-gap: 2cqw; color: var(--g-accent); font-size: 3.4cqw; }
.gi-cc { align-self: center; padding: 0 .3em; border: .13em solid currentColor; border-radius: .3em; font-weight: 700; font-size: .82em; line-height: 1.15; letter-spacing: .04em; }   /* the listings' CC mark */
.gi-bar { height: 1cqh; background: rgba(255,255,255,.2); }
.gi-bar i { display: block; height: 100%; background: var(--g-accent); }
.gi-left { color: var(--g-text); opacity: .85; }
.g-info [hidden] { display: none; }
.gi-run { font-size: 3.2cqw; color: var(--g-accent, #ffe14a); }
.gc-ep { color: var(--g-accent, #ffe14a); }
.gi-desc { font-size: 3.4cqw; line-height: 1.16; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gi-desc.is-short, .gi-title.is-short { -webkit-line-clamp: 1; }
.gi-hint { font-size: 3.1cqw; line-height: 1.16; opacity: .88; }
/* on a TV, what to do with a show still to come */
.g-choice { position: absolute; left: 55%; top: 69%; transform: translate(-50%, -50%); z-index: 6;   /* over the grid, clear of the preview */ min-width: 58cqw; max-width: 74cqw; padding: 2cqh 2.4cqw;
  background: var(--g-head); border: .45cqw solid var(--g-accent); box-shadow: 0 1.2cqh 4cqh rgba(0,0,0,.55); display: grid; gap: .8cqh; }
.g-choice .gc-head { color: var(--g-accent); font-size: 4cqw; line-height: 1.1; margin-bottom: .6cqh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-choice .gc-item { font: inherit; font-size: 4cqw; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: rgba(255,255,255,.07); border: 0; padding: .8cqh 1.4cqw; cursor: pointer; }
.g-choice .gc-item.is-sel { background: var(--g-accent); color: var(--g-head); }
.gi-hint a { color: var(--g-accent); }
.gi-big { justify-self: start; font-size: 3cqw; color: var(--g-head); background: var(--g-accent); padding: .3cqh 1cqw 0; border-radius: .6cqw; }
.gi-remind { font: inherit; color: var(--g-accent); background: none; border: .3cqw solid var(--g-accent); border-radius: .7cqw; padding: .2cqh 1cqw 0; cursor: pointer; }
.gi-remind.is-on { background: var(--g-accent); color: var(--g-head); }
.g-cell.has-remind .gc-t::before { content: '⏰ '; font-size: .85em; }
.g-cell.has-tape .gc-t::after { content: ' ⏺'; font-size: .8em; color: #ff5a4a; }
.gi-tape { font: inherit; color: var(--g-accent); background: none; border: .3cqw solid var(--g-accent); border-radius: .7cqw; padding: .2cqh 1cqw 0; cursor: pointer; }
.gi-tape.is-on { background: #c9302c; border-color: #c9302c; color: #fff; }
.g-head { display: grid; grid-template-columns: var(--g-chw) minmax(0, 1fr) auto; background: var(--g-head); border-block: .35cqw solid var(--g-line); align-items: center; }
.gh-clock { padding: .9cqh 1.5cqw .5cqh; color: var(--g-accent); white-space: nowrap; }
.gh-times { position: relative; height: 5.6cqh; overflow: hidden; }
.gh-times span { position: absolute; top: 1cqh; padding-left: 1cqw; border-left: .3cqw solid var(--g-accent); white-space: nowrap; }
.gh-nav { display: flex; gap: .6cqw; padding: 0 1cqw; }
.gh-btn { font: 400 3.4cqw/1 var(--crt); color: var(--g-head); background: var(--g-accent); border: 0; padding: .8cqh 1.4cqw .5cqh; }
.gh-btn:hover { filter: brightness(1.12); }
.g-body { position: relative; overflow: hidden auto; scrollbar-width: none; padding-bottom: 7cqh; }
.g-body::-webkit-scrollbar { display: none; }
.g-rows { position: relative; }
.g-row { display: grid; grid-template-columns: var(--g-chw) minmax(0, 1fr); height: var(--g-fit, var(--g-rowh)); border-bottom: .3cqw solid var(--g-line); }
.g-ch { display: flex; align-items: center; gap: 1.2cqw; padding: 0 1.2cqw; background: var(--g-head); overflow: hidden; white-space: nowrap; border: 0; color: inherit; font: inherit; text-align: left; }
.g-ch:hover { filter: brightness(1.5); }
.g-ch b { font-weight: 400; color: #fff; min-width: 5.4cqw; text-align: center; padding: .3cqh .6cqw 0; border-radius: .6cqw; }
/* long station names wrap onto a second, smaller line instead of being cut to "Action N…" */
.g-ch span { overflow: hidden; text-overflow: ellipsis; white-space: normal; line-height: 1.06; font-size: .84em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; word-break: normal; }   /* lines break between words; a long word shrinks to fit (fitNames) */
.guide-tv[data-density="compact"] .g-ch span { -webkit-line-clamp: 1; white-space: nowrap; display: block; }
.g-ch span.is-cut { display: block; white-space: nowrap; text-overflow: ellipsis; }
.g-row.is-tuned .g-ch { box-shadow: inset .9cqw 0 0 var(--g-accent); color: var(--g-accent); }
.g-track { position: relative; background: var(--g-alt); }
.g-cell { position: absolute; top: 0; bottom: 0; background: var(--g-row); border: 0; border-left: .35cqw solid var(--g-line); color: inherit; font: inherit; text-align: left; padding: 0 1cqw; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
.g-cell .gc-t { display: flex; min-width: 0; line-height: 1.14; white-space: nowrap; overflow: hidden; }
.g-cell .gc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-cell .gc-y, .g-cell .gc-ep { flex: none; margin-left: .38em; }      /* the year is whole or not there */
.g-cell > span { position: relative; z-index: 4; }                     /* the line of the hour runs behind the words */
.g-cell .gc-d { font-size: .76em; line-height: 1.1; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-tv[data-density="compact"] .gc-d { display: none; }
.g-cell.is-now { background: var(--g-now); }
.g-cell.sliver.earlier::after { content: '◀'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.g-cell.sliver > span { visibility: hidden; }
.g-cell.past { pointer-events: none; }                 /* a crumb of a show at the window's edge: over already, or on the next page */      /* too narrow to read: its name is in the details when it is picked */
.g-cell.is-off { background: transparent; opacity: .55; }
.g-cell.tint { box-shadow: inset .9cqw 0 0 var(--cc); padding-left: 1.8cqw; }
.g-cell.is-sel { background: var(--g-accent); color: var(--g-head); opacity: 1; }
.g-cell.is-sel .gc-y, .g-cell.is-sel .gc-ep { color: inherit; }      /* on the picked cell's accent background */
.g-cell .gc-y { color: var(--g-accent); }
.g-cell .gc-brk { position: absolute; bottom: 0; height: .4cqh; background: var(--g-accent); opacity: .42; min-width: .3cqw; }
.g-cell.is-sel .gc-brk { background: var(--g-head); }
.g-nowline { position: absolute; top: 0; bottom: 0; width: .4cqw; background: #ff4d4d; z-index: 3; pointer-events: none; }
.g-empty { padding: 4cqh 3cqw; }
.g-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--g-head); padding: .9cqh 4cqw 1.6cqh; font-size: 3cqw; display: flex; gap: 2.4cqw; white-space: nowrap; overflow: hidden; }
.g-foot kbd { font: inherit; background: var(--g-accent); color: var(--g-head); padding: 0 1cqw; border-radius: .5cqw; }
.guide-tv.is-idle .g-foot > * { opacity: .5; }      /* the bar itself stays solid over the row behind it */
.g-count { margin-left: auto; opacity: .88; flex: none; font-size: .85em; align-self: center; }
/* a picture as small as a phone's: bigger type, one line a program, no keyboard hints */
@container screen (max-width: 440px) {
  .power-tip { font-size: 4cqw; max-width: 88cqw; }
  .power-credit { font-size: 3.55cqw; bottom: 4cqh; }
  .q-credit { font-size: 3.5cqw; }
  .quick { bottom: 13.5cqh; }
  .g-top { height: 46cqh; grid-template-columns: 45cqw minmax(0, 1fr); }
  .g-info { padding-top: 3cqh; gap: .6cqh; }
  .gi-top, .gi-meta, .gi-desc, .gi-hint { font-size: 4.2cqw; }
  .gi-title { font-size: 5.4cqw; }
  .gi-ads, .gi-what { display: none; }
  .g-head { font-size: 3.7cqw; }
  .gh-btn { font-size: 5cqw; min-width: 10.5cqw; min-height: 10cqw; }
  .g-row { font-size: 4.5cqw; height: var(--g-fit, 12.4cqh); grid-template-columns: var(--g-chw) minmax(0, 1fr); }
  .g-row .g-ch span { font-size: .8em; }
  .g-row .gc-d, .g-foot { display: none; }
  .g-body { padding-bottom: 0; }
  .q-item { padding-block: 3.8cqh 3.4cqh; }
  .bug small { font-size: 3.6cqw; }
}

/* ---------- setup drawer and the about panel ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; background: rgba(10,6,12,.55); display: flex; justify-content: flex-end; }
.drawer-panel { width: min(720px, 100%); height: 100%; background: #efe6d2; color: var(--ink); display: grid; grid-template-rows: auto minmax(0, 1fr); box-shadow: -20px 0 50px rgba(0,0,0,.5); animation: slidein .22s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 2px solid var(--ink); }
.drawer-head h2 { font: italic 900 22px/1 var(--ui); font-stretch: 118%; }
.drawer-head .btn { background: var(--ink); color: var(--cream); border-color: var(--ink); margin-left: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 8px; font-weight: 750; color: #5d5060; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--rose); }
.drawer-body { overflow: auto; padding: 16px 18px 40px; }
.rem-list { display: grid; gap: 6px; }
.rem-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rem-when { font-weight: 750; white-space: nowrap; }
.rem-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-what small { opacity: .7; }
.rem-none { opacity: .7; }
.opt { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(23,18,26,.14); }
.opt > .opt-l { font-weight: 750; }
.opt small { grid-column: 2; color: #5d5060; font-size: 12.5px; }
.art-pick { display: grid; gap: 4px; min-width: 0; }
.ap-row { display: grid; grid-template-columns: 70px 38px minmax(0, 1fr) 38px; gap: 6px; align-items: center; font-size: 13.5px; }
.ap-place { color: #5d5060; }
.ap-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.ap-row button { min-height: 32px; background: #fff; border: 1px solid rgba(23,18,26,.3); border-radius: 5px; color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg button { background: #fff; border: 1px solid rgba(23,18,26,.3); border-radius: 5px; padding: 5px 10px; font-weight: 650; font-size: 13.5px; color: var(--ink); }
.seg button.is-on { background: var(--ink); color: var(--amber); border-color: var(--ink); }
.drawer input[type="text"], .drawer input[type="number"], .drawer select, .about input[type="search"] { font: inherit; color: var(--ink); background: #fff; border: 1px solid rgba(23,18,26,.35); border-radius: 5px; padding: 5px 8px; min-width: 0; }
.drawer input[type="range"] { width: 100%; accent-color: var(--rose); }
.drawer .btn, .about .btn { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.drawer .btn.alt { background: none; color: var(--ink); }
.chrow { border: 1px solid rgba(23,18,26,.25); border-radius: 8px; margin-bottom: 8px; background: #f8f2e2; }
.chrow.is-offair summary { opacity: .6; }
.chrow summary { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; border-radius: 8px; }
.chrow summary::-webkit-details-marker { display: none; }
.chrow .cr-num { font: 400 26px/1 var(--crt); color: #fff; text-align: center; border-radius: 4px; padding: 3px 0 1px; }
.chrow .cr-name { font-weight: 800; }
.chrow .cr-name small { display: block; font-weight: 500; color: #5d5060; }
.chrow .cr-count { font-size: 12.5px; color: #5d5060; white-space: nowrap; }
.chrow .cr-body { padding: 10px 12px 12px; display: grid; gap: 10px; border-top: 1px dashed rgba(23,18,26,.25); }
.chrow .cr-grid { display: grid; grid-template-columns: 76px minmax(0, 1fr) 160px 176px; gap: 8px; }
.chrow .cr-grid label, .cr-field label { display: grid; gap: 3px; font-size: 12.5px; font-weight: 700; }
.cr-field { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.cat-group { display: grid; gap: 4px; }
.cat-label { font-size: 12.5px; font-weight: 700; }
.cats { display: flex; flex-wrap: wrap; gap: 4px; }
.cats button { background: #fff; border: 1px solid rgba(23,18,26,.3); border-radius: 999px; padding: 3px 9px; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.cats button.is-on { background: var(--teal); border-color: #12786e; color: #062b27; }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #b9ad92; position: relative; cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .12s; }
.switch:checked { background: var(--rose); }
.switch:checked::after { transform: translateX(16px); }
.found { font-size: 12.5px; color: #5d5060; }
.drawer-note { font-size: 13px; color: #5d5060; margin: 0 0 12px; max-width: 64ch; }
.lang-set { border: 1px solid rgba(0,0,0,.16); border-radius: 8px; margin: 0 0 8px; background: rgba(255,255,255,.35); }
.lang-set > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 12px; cursor: pointer; list-style: none; font-weight: 750; }
.lang-set > summary::-webkit-details-marker { display: none; }
.lang-set > summary small { font-weight: 500; color: #5d5060; }
.lang-set[open] > summary { border-bottom: 1px solid rgba(0,0,0,.12); }
.lang-set .lang-rows { padding: 8px 8px 2px; }
.drawer-sub { font: 800 15px/1.2 var(--ui); margin: 18px 0 4px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
kbd { font: 400 17px/1 var(--crt); background: var(--ink); color: var(--amber); padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.keys { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 14px; align-items: center; margin-bottom: 14px; }
.keys-h { font: 800 15px/1 var(--ui); font-stretch: 112%; margin: 14px 0 8px; }

.about { position: fixed; inset: 0; z-index: 110; background: rgba(10,6,12,.6); display: grid; place-items: center; padding: 20px; }
.about-panel { width: min(780px, 100%); max-height: min(88vh, 940px); background: #efe6d2; color: var(--ink); border-radius: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.about-body { overflow: auto; padding: 16px 20px 28px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.about-body p, .about-body li { max-width: 72ch; }
.about-body h3 { font: 800 16px/1.2 var(--ui); font-stretch: 110%; margin-top: 10px; }
.about-body a { color: #7a2a52; font-weight: 650; }
.ab-lead { font-size: 16px; font-weight: 650; }
.ab-credit { margin: 0; padding: 9px 12px; border-radius: 8px; background: #2b1f2e; color: #f3e8d2; font-weight: 700; font-size: 14.5px; }
.ab-credit a { color: #ffb436; }
/* the 18+ notice, always part of the legal wording beside it */
.age-note { color: #ffd27a; font-weight: 700; }
.power-credit .age-note, .q-credit .age-note { display: block; font-weight: 400; }
.ab-credit .age-note { display: block; margin-top: 6px; }
.credit { grid-column: 1 / -1; margin: -4px 0 0; text-align: center; font: 500 12px/1.3 var(--ui); letter-spacing: .02em; color: #a8997f; }
.credit a { color: var(--amber); text-decoration: none; }
.credit a:hover, .credit a:focus-visible { text-decoration: underline; }
.ab-small { font-size: 12.5px; color: #5d5060; }
.ab-art { margin: 2px 0; }
.ab-art > summary { cursor: pointer; font-weight: 700; padding: 3px 0; }
.ab-art p { margin: 4px 0 6px 14px; }
.ab-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ab-table { border-collapse: collapse; font-size: 13px; }
.ab-table th { text-align: left; font-weight: 750; padding: 3px 14px 3px 0; white-space: nowrap; vertical-align: top; }
.ab-table td { padding: 3px 14px 3px 0; color: #3d3340; }
.ab-table td:last-child, .ab-table th:last-child { text-align: right; padding-right: 0; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.shelf li { padding: 3px 0; border-bottom: 1px solid rgba(23,18,26,.1); }
.shelf span { color: #5d5060; }

/* ---------- fullscreen, and TV devices ---------- */
body.is-full.is-idle, body.is-full.is-idle * { cursor: none !important; }
body.is-full { grid-template-rows: minmax(0, 1fr); background: #000; }
body.is-full .top, body.is-full .band, body.is-full .tv-chin { display: none; }
body.is-full .room { padding: 0; }
body.is-full .tv { width: min(100cqw, calc(100cqh * 4 / 3)); padding: 0; background: none; box-shadow: none; border-radius: 0; }
body.is-full .screen:not(.in-3d) { box-shadow: none; border-radius: 0; }
body.is-full.mode-3d .tv { display: none; }
body.is-full .scene { border-radius: 0; }
body.is-full .scene::after { display: none; }
body.mode-tv .drawer-panel { width: min(900px, 100%); font-size: 18px; }
body.mode-tv .about-panel { font-size: 18px; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  html { height: auto; overflow: visible; }
  body { height: auto; display: flex; flex-direction: column; overflow: visible; min-height: 100vh; min-height: 100dvh; }
  body > .band { margin-top: auto; }                  /* a short page still ends with the band at the bottom */
  body:not(.is-full) > .room { margin-block: auto; }  /* and the set sits in the middle of the room left above it */
  #regionSel { max-width: min(62vw, 260px); }
  .top { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .top-now { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; flex-wrap: wrap; gap: 6px; max-width: 100%; }
  .top-actions .btn { padding: 6px 10px; font-size: 13.5px; }
  .room { display: block; padding: 4px 16px 12px; }
  .stage { container-type: normal; display: block; }
  .tv { width: 100%; padding: 12px 12px 0; }
  .tv-chin { height: auto; padding: 18px 0 10px; flex-wrap: wrap; }   /* clear of the bezel's shadow when the buttons wrap */
  .grille { display: none; }
  .chin-btns { flex: 1; justify-content: space-between; }
  .band { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 16px 16px; position: sticky; bottom: 0; z-index: 50; }
  .band-read { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .band-years { font-size: 36px; }
  .band-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chip { padding: 4px 4px; }
  .opt { grid-template-columns: minmax(0, 1fr); }
  .opt small { grid-column: 1; }
  .chrow .cr-grid, .cr-field { grid-template-columns: minmax(0, 1fr); }
  .chrow summary { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .chrow .cr-count { display: none; }
  .drawer-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .drawer-head .tabs { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .drawer-head .tab { padding: 8px 6px; font-size: 14px; white-space: nowrap; }
  .top-now { padding-right: 40px; }
  body.is-full { display: grid; height: 100vh; overflow: clip; }
  body.is-full .stage { container-type: size; display: grid; height: 100%; }
  /* the year band is taller here and sits over the shelf of tapes: a deeper shade keeps it readable */
  body.mode-3d:not(.is-full) .scene::after { background: linear-gradient(180deg, rgba(9,6,11,.78) 0, rgba(9,6,11,.3) calc(var(--top-h, 56px) * .9), rgba(9,6,11,0) calc(var(--top-h, 56px) * 1.5), rgba(9,6,11,0) calc(100% - var(--band-h, 120px) * 1.4), rgba(9,6,11,.74) calc(100% - var(--band-h, 120px) * .95), rgba(9,6,11,.9) 100%); }
}
/* fingers need about 40px, a little less where the screen is too short to give it */
@media (max-width: 980px), (pointer: coarse) {
  .knob, body[data-era] .knob, body.mode-3d .knob { min-height: 40px; min-width: 44px; font-size: 13px; }
  .chip, #regionSel { min-height: 36px; }
  .top-actions .btn, .tab, .seg button { min-height: 38px; }
  .opt select { min-height: 40px; }
  .ap-row { grid-template-columns: 60px 42px minmax(0, 1fr) 42px; }
  .ap-row button { min-height: 40px; }
  body.mode-3d .tv-chin { flex-wrap: nowrap; }
  input.switch { width: 54px; height: 32px; border-radius: 16px; }
  input.switch::after { left: 4px; top: 4px; width: 24px; height: 24px; }
  input.switch:checked::after { transform: translateX(22px); }
  .q-item { padding-block: 3.9cqh 3.5cqh; }
  .gh-btn { min-width: 40px; min-height: 38px; }
  body.mode-3d .gh-btn { min-width: 48px; min-height: 46px; }      /* the room draws the screen at about three quarters */
  .seg button { min-width: 40px; }
  input[type=range] { min-height: 32px; }
}
@media (max-height: 520px) {
  .knob, body[data-era] .knob, body.mode-3d .knob { min-height: 32px; }
  .chip, #regionSel { min-height: 28px; }
}
@media (max-width: 560px) {
  body:not(.mode-3d) .chin-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  body:not(.mode-3d) .chin-btns .knob { min-width: 0; padding-inline: 2px; }
  .dial-ticks span.maj:not(.dec) { font-size: 0; }
  .chin-btns #btnMenu { grid-column: span 2; }
  .drawer-head .tabs { flex-wrap: wrap; gap: 2px; }
  .drawer-head .tab { padding: 8px 4px; font-size: 13px; }
}
/* An upright phone: a 4:3 picture leaves three rows of 31px. While the guide is up the tube grows taller, so
   its rows fit a finger, and the live picture keeps its shape in the corner. */
@media (max-width: 560px) and (orientation: portrait) and (min-height: 640px) {
  body:not(.mode-3d):not(.is-full) .screen:has(> .guide-tv:not([hidden])) { aspect-ratio: 4 / 5; border-radius: 5% / 4%; }
  body:not(.mode-3d):not(.is-full) .screen:has(> .guide-tv:not([hidden])) .guide-tv:not(.no-pip) .g-top { height: 37cqw; }
  body:not(.mode-3d):not(.is-full) .screen:has(> .guide-tv:not([hidden])) .g-info { padding-top: 2.4cqw; gap: .3cqw; }
  body:not(.mode-3d):not(.is-full) .screen:has(> .guide-tv:not([hidden])) .g-row { height: var(--g-fit, 11cqh); }
  body:not(.mode-3d):not(.is-full) .screen.is-pip:has(> .guide-tv:not([hidden])) :is(video, .static, .bumper, .bars) { height: 75cqw; transform: translate(3cqw, 3cqw) scale(.4); }
  body:not(.mode-3d):not(.is-full) .screen:has(> .guide-tv:not([hidden])) .g-thumb { top: 3cqw; height: 30cqw; }
  body:not(.mode-3d):not(.is-full):has(.guide-tv:not([hidden])) > .band { position: relative; bottom: auto; }      /* nor may the year band lie over it */
}
/* on a short screen the band stops following the scroll, so it can't lie over the picture */
@media (max-width: 980px) and (max-height: 820px) {
  body:not(.mode-3d) > .band { position: relative; bottom: auto; }
}
@media (max-width: 389px) {
  .top-actions { flex-wrap: nowrap; gap: 4px; }
  .top-actions .btn { padding: 6px 4px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .bumper::before, .bumper::after, .drawer-panel, .screen.powering .power-on { animation: none; }
  .guide-tv, .screen video, .screen .static, .screen .bumper, .screen .bars { transition: none; }
}

/* the big moments on the year dial (moments.js): a small diamond each, coloured by kind; a card opens on a click */
.dial-marks { position: absolute; inset: 0 14px auto; height: 22px; z-index: 3; pointer-events: none; }
.dial-mark { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; padding: 0; border: 0; border-radius: 1.5px; transform: rotate(45deg);
  background: var(--mk, #ffd166); box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 6px var(--mk, #ffd166); cursor: pointer; pointer-events: auto; opacity: .92; }
.dial-mark::before { content: ""; position: absolute; inset: -7px; }                       /* a finger-sized target */
.dial-mark:hover, .dial-mark:focus-visible { opacity: 1; transform: rotate(45deg) scale(1.35); outline: none; }
.k-space { --mk: #6fb7ff; } .k-politics { --mk: #ffd166; } .k-crime { --mk: #ff6b6b; } .k-disaster { --mk: #ff9f43; } .k-culture { --mk: #c792ea; }
.moment-card { position: fixed; z-index: 60; width: min(340px, calc(100vw - 20px)); box-sizing: border-box; padding: 14px 16px 12px; border-radius: 10px;
  background: linear-gradient(180deg, #241a28, #18111b); color: #efe6f2; box-shadow: 0 12px 40px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.08); border-top: 3px solid var(--mk, #ffd166); }
.moment-card .mc-kind { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mk, #ffd166); }
.moment-card .mc-title { font-size: 18px; font-weight: 700; margin: 4px 0 6px; line-height: 1.25; }
.moment-card .mc-blurb { font-size: 14px; line-height: 1.4; color: #d9cfe0; }
.moment-card .mc-notice { margin-top: 8px; font-size: 13px; line-height: 1.35; color: #ffcf9e; }
.moment-card .mc-amount { margin-top: 8px; font-size: 12.5px; color: #a99bb0; }
.moment-card .mc-buttons { display: flex; gap: 8px; margin-top: 12px; }
.moments-osd .f-item .f-ch { color: var(--mk, #ffd166); }
.moments-osd .f-item.is-sel .f-ch { color: inherit; }
/* below 900 pixels or on a touch screen the diamonds are too small and too close for a finger: the menu's Big moments has them */
@media (max-width: 899px), (pointer: coarse) { .dial-marks { display: none; } }
/* a big moment on its anniversary pulses on the dial; Special Report's info bar names its moment */
@keyframes markPulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 6px var(--mk, #ffd166); } 50% { box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 14px 5px var(--mk, #ffd166); } }
.dial-mark.is-today { animation: markPulse 1.6s ease-in-out infinite; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dial-mark.is-today { animation: none; outline: 2px solid var(--mk, #ffd166); outline-offset: 2px; } }
.osd-banner .ob-event { color: #ff8a6b; font-size: .78em; letter-spacing: .03em; text-transform: uppercase; margin: .3em 0 -.1em; }
.gi-like { font-size: .72em; opacity: .75; font-weight: 400; }      /* the guide's details: Beacon 2 like CBS */
