/* IN THE LOOP: a 2040 master panel, drawn like the character portraits.
   Recessed brushed-steel housings, enamel panel, light-pipe routes. Light comes from below:
   warm amber from the panel lamps on the left, a cool blue-grey rim on the right. */
:root {
  --night: #0a1019;
  --wall: #0e1622;
  --enamel: #152131;
  --enamel-2: #1b293c;
  --enamel-3: #223349;
  --recess: #05080d;
  --edge: #223044;
  --slate: #2a374b;
  --steel-1: #4a5566;
  --steel-2: #2b3442;
  --steel-3: #171e29;
  --ink: #e8edf4;
  --ink-2: #aab5c4;
  --muted: #6d7a8c;
  --amber: #f4b23e;
  --amber-2: #d98f2b;
  --amber-rim: rgba(244, 178, 62, 0.8);
  --cool-rim: rgba(127, 151, 176, 0.55);
  --lampw: #f6ecd2;
  --go: #2fd08f;
  --caution: #f4b23e;
  --stop: #ff5b4f;
  --copper: #e07a5f;
  --sys: #8fa8be;
  --paper: #ebe3d1;
  --paper-2: #dfd5bf;
  --paper-ink: #1d1f24;
  --pencil: #33363d;
  --display: 'Big Shoulders', 'Arial Narrow', sans-serif;
  /* zan (2026-10-16): Afacad for all the small type, the radio's dialogue too (--dlg, v61). */
  --mono: 'Afacad', 'Segoe UI', sans-serif;
  --dlg: 'Afacad', 'Segoe UI', sans-serif;
  --ui: 'Afacad', 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --brushed: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  /* A housing: dark brushed steel, bevelled, amber on the left edge and blue-grey on the right. */
  --housing: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 3px 0 0 var(--amber-rim), inset -2px 0 0 var(--cool-rim), inset 0 -3px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px #05080d, 0 4px 0 #05080d;
  --recessed: inset 0 3px 6px rgba(0, 0, 0, 0.75), inset 0 -1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px #2c3747;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink);
  background: var(--night);
  font: 400 16px/1.5 var(--mono);
  overflow-x: hidden; -webkit-text-size-adjust: 100%;
}
/* Paper and metal grain over everything, as in the portraits. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background-image: var(--grain); opacity: 0.08; mix-blend-mode: overlay;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; margin: 0; text-wrap: balance; }
/* The amber focus ring shows only while someone moves through the page with Tab (html.kbd, set in app.js), never
   after the game moves focus itself or after a click. */
:focus-visible { outline: none; }
.kbd :focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.screen[hidden] { display: none; }

/* Buttons: flat blocks, no gradients or glow (amber only for the one thing to do now). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px;
  border-radius: 4px; border: 0; cursor: pointer; white-space: nowrap;
  font: 800 17px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
}
.btn-primary { border-radius: 0; background: var(--amber); color: #1a1206; box-shadow: inset 0 -4px 0 #c4831f; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { box-shadow: none; }
.btn-quiet { border-radius: 0; background: #243142; color: var(--ink); box-shadow: inset 0 -4px 0 #1b2433; }
.btn-quiet:hover { filter: brightness(1.15); }
.ctl {
  height: 38px; padding: 0 14px; border-radius: 0; border: 0;
  background: #1b2433;
  box-shadow: inset 0 -3px 0 #121a26;
  color: var(--ink); font: 700 15px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
}
.ctl:hover { filter: brightness(1.15); }
.ctl:active { box-shadow: none; }
.ctl[aria-pressed="true"] { background: #eef2f6; color: #0a1019; box-shadow: inset 0 -3px 0 #a9b4c1; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; justify-self: start; }
.link:hover { color: var(--amber); }

/* Signal lamp: the game's one device (logo, status, marks) */
.lamp { width: 10px; height: 24px; flex: none; }
.lamp-body { fill: var(--recess); stroke: #2c3747; stroke-width: 1; }
.lamp-dot { fill: #1d2633; }
.lamp-dot.on-go { fill: var(--go); filter: drop-shadow(0 0 2px var(--go)); }
.lamp-dot.on-caution { fill: var(--caution); filter: drop-shadow(0 0 2px var(--caution)); }
.lamp-dot.on-stop { fill: var(--stop); filter: drop-shadow(0 0 2px var(--stop)); }
.marks { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.marks .lamp { width: 8px; height: 19px; }

/* ---------- Week (title) ---------- */
.week { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; padding: 48px 56px 72px; overflow: hidden; }
/* Key art sits smaller on the right at its own shape (the whole picture shows), dimmed, and melts into the night on every side. */
.week-art { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: min(74vw, calc(100vh * 1.79 * 0.86)); aspect-ratio: 1920 / 1072; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(0deg, transparent 0%, #000 24%, #000 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(0deg, transparent 0%, #000 24%, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.week-art img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 100% 40%; display: block; filter: brightness(0.72) saturate(0.88); animation: drift 40s ease-in-out infinite alternate; transform-origin: 75% 45%; }
.week-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 16, 25, 0.35) 0%, rgba(10, 16, 25, 0) 30%); }
@keyframes drift { to { transform: scale(1.045) translateX(-0.6%); } }
.week-copy { position: relative; max-width: none; display: grid; justify-items: start; gap: 20px; }
/* The wordmark is drawn from Big Shoulders outlines by tools/wordmark.py: two lines of equal width, the I of IN and
   the L of LOOP sharing one stem. Plain white, no offsets behind it; its left edge lines up with the buttons'.
   1em = 2000 font units, the same scale as before. */
.week h1 { font-size: clamp(120px, min(16vw, 32vh), 412px); line-height: 1; margin: 4px 0 0; }
.wordmark { display: block; width: 2.18em; height: auto; overflow: visible; }
.wm-ink { fill: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.week-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.week-acts .ctl { height: 48px; }
.credit { position: absolute; left: 56px; bottom: 22px; margin: 0; font-size: 12px; color: var(--muted); }
.week-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.week-links:not(:has(> :not([hidden]):not(:empty))) { display: none; }
/* Test picker (temporary). */
.test-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; background: rgba(5, 8, 13, 0.7); border: 1px dashed #4c5868; border-radius: 4px; }
.test-tag { font: 700 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #8d9aab; }
.test-pick select { height: 36px; padding: 0 8px; font: 600 15px/1 var(--mono); color: var(--ink); background: #0f1621; border: 1px solid #2e3b58; border-radius: 3px; }
.week-done { margin: 0; font-size: 14px; color: var(--ink-2); }
.week-done:empty { display: none; }
.week-reset { display: grid; gap: 12px; justify-items: start; max-width: 460px; padding: 16px 18px; border-left: 3px solid var(--stop); background: rgba(10, 16, 25, 0.82); }
.week-reset[hidden] { display: none; }
.week-reset p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.week-reset-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.week-reset .ctl { height: 44px; }
.ctl-warn { color: #ffb0a8; }

/* ---------- Shared bar ---------- */
.bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: #0a1019; box-shadow: inset 0 -1px 0 #1b2433; }

/* ---------- Scenes: a visual novel. The picture fills the screen, the speaker stands in it,
   and the line is written out in a box along the bottom. ---------- */
.scene { --gut: max(16px, 4vw); --who-c: var(--ink-2); --sprite-h: min(42vh, 392px); position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: radial-gradient(90% 70% at 50% 40%, #142030, var(--night) 70%); }
.scene[data-who="L"] { --who-c: var(--amber); }
.scene[data-who="P"] { --who-c: var(--copper); }
.scene[data-who="S"] { --who-c: var(--sys); }
.scene[data-who="A"] { --who-c: var(--ink); }
/* The place's own picture (the panel room for now), behind any story moment. */
.scene-bg, .scene-art { position: absolute; inset: 0; margin: 0; overflow: hidden; pointer-events: none; }
.scene-bg[hidden], .scene-art[hidden] { display: none; }
.scene-bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--at, 50% 50%); filter: brightness(0.62) saturate(0.9); }
.scene-bg.is-new img { animation: fadeIn .8s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.art-stack { position: absolute; inset: 0; transform-origin: 50% 55%; }
.art-stack img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--at, 50% 50%); }
.art-stack img.is-place { filter: brightness(0.62) saturate(0.9); }
.art-stack .art-from { position: absolute; inset: 0; }
.art-stack .art-from[hidden] { display: none; }
.scene-art.is-new .art-stack { animation: artIn .7s ease-out; }
/* A line said in the dark (black: true): everything above the text box fades out. */
.scene .scene-bg, .scene .scene-art, .scene .scene-portrait, .scene .scene-prop { transition: opacity .9s ease-out; }
.scene.is-black .scene-bg, .scene.is-black .scene-art, .scene.is-black .scene-portrait, .scene.is-black .scene-prop { opacity: 0; }
/* A flashback (zan: no flashing, so dim you barely see the silhouettes): the picture very dark and drained. */
.scene-art.is-flash .art-stack img { filter: brightness(0.17) saturate(0.35); }
/* A film's pictures, stacked; each one fades in over the last. */
.art-seq, .art-seq img { position: absolute; inset: 0; }
/* The line's own picture waits underneath; the film's pictures are not all the same shape, so it stays out of sight. */
.art-stack.is-film > img { visibility: hidden; }
@keyframes artIn { from { opacity: 0; } to { opacity: 1; } }
/* The picture lives in the space above the text box, so the box never covers any of it (--stage-b: the box, its
   name plate and a little air). On a screen held sideways the picture is shown whole at its own shape, as big as that
   space allows, centred, its edges fading into the night (app.js gives each picture its shape as --ar). A phone held
   upright fills that space with the picture, framed by --at, since a whole picture there would be a thin strip. */
.scene { --stage-b: max(236px, calc(var(--np) * 0.7 + var(--fs-est) * 3.3 + var(--bh) + 62px)); }
.scene-bg, .scene-art { bottom: var(--stage-b); }
.scene .scene-bg img, .scene .art-stack img, .scene .art-seq img { -webkit-mask-image: linear-gradient(#000 90%, transparent); mask-image: linear-gradient(#000 90%, transparent); }
@media (orientation: landscape) {
  .scene .scene-bg img, .scene .art-stack img, .scene .art-seq img { position: absolute; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(100%, calc((100vh - var(--stage-b)) * var(--ar, 1.792))); width: min(100%, calc((100dvh - var(--stage-b)) * var(--ar, 1.792))); height: min(100%, calc(100vw / var(--ar, 1.792)));
    object-fit: cover; object-position: 50% 50%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent);
    mask-composite: intersect; }
}
@media (orientation: portrait) {
  .scene .scene-bg.is-whole img { object-fit: contain; object-position: 50% 55%; -webkit-mask-image: none; mask-image: none; }
  .scene .scene-art.is-whole .art-stack img { object-fit: contain; object-position: 50% 55%; -webkit-mask-image: none; mask-image: none; }
}
/* Shade: a little night at the top for the place name; the rest of the picture stays clear. */
.scene::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 16, 25, 0.72) 0%, rgba(10, 16, 25, 0) 20%); }
.scene-where { position: absolute; z-index: 2; left: var(--gut); top: 26px; right: var(--gut); display: grid; gap: 6px; justify-items: start; pointer-events: none; }
.scene h2 { font-size: clamp(30px, calc(8px + 2.6vw), 75px); line-height: 0.92; font-weight: 900; max-width: 16em; }
.scene h2.is-new { animation: placeIn .5s ease-out; }
@keyframes placeIn { from { opacity: 0; transform: translateX(-14px); } }
/* The scene's object, held up to the camera between the place name and the box (app.js fits it: --py, --ps).
   Look closer opens it full size. */
.scene-prop { position: absolute; z-index: 2; left: 50%; top: var(--py, 45%); transform: translate(-50%, -50%) scale(var(--ps, 1)); width: min(540px, 40vw); border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px #05080d, 0 0 0 7px #232c39, 0 0 0 8px #05080d, 0 24px 60px rgba(0, 0, 0, 0.6); animation: fadeIn .45s ease-out; }
.scene-prop[hidden] { display: none; }
.scene-prop .mcard { margin: 0; max-width: none; transform: none; }
.scene-prop:has(.mcard) { overflow: visible; box-shadow: none; width: min(460px, 40vw); transform: translate(-50%, -50%) scale(var(--ps, 1)) rotate(-1deg); }
.scene-ruler { position: absolute; width: 0; height: var(--sprite-h); visibility: hidden; pointer-events: none; }
.prop-svg { display: block; width: 100%; height: auto; }
/* The speaker: a cut-out standing behind the box, always in the same spot on the left. Laura and Paul are turned
   to face in; the System's dome hangs in the same spot at head height. */
.scene-portrait { position: absolute; z-index: 2; margin: 0; left: calc(50% - var(--boxw) / 2); bottom: calc(var(--stage-b) - 8px); height: var(--sprite-h); aspect-ratio: 640 / 794; animation: standIn .3s ease-out;
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 22%); mask-image: linear-gradient(0deg, transparent 0%, #000 22%); }
.scene-portrait[hidden] { display: none; }
.scene-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; display: block; }
.scene-portrait img[hidden] { display: none; }
.scene-portrait.is-loading img { visibility: hidden; }
.scene-portrait.is-quiet img { filter: brightness(0.62) saturate(0.85); transition: filter .25s; }
.scene-portrait[data-who="L"] img, .scene-portrait[data-who="P"] img { transform: scaleX(-1); }
.scene-portrait[data-who="S"] { --s: 0.8; --sh: calc(var(--sprite-h) * var(--s)); height: var(--sh);
  /* The dome's left edge on the box's left edge (5% of the picture is clear on each side), and its lower edge
     10 px above the name plate (25.4% of the picture is clear below the dome). */
  bottom: calc(var(--stage-b) + var(--np) * 0.85 + 10px - var(--sh) * 0.254); margin-left: calc(var(--sh) * 0.806 * -0.05);
  -webkit-mask-image: none; mask-image: none; animation-name: fadeIn; }
.scene-portrait .talk { opacity: 0; transition: opacity .35s ease-out; }
.scene-portrait .talk:not([src]) { display: none; }
.scene-portrait.is-talking .talk { opacity: 1; transition-duration: .15s; }
@keyframes standIn { from { opacity: 0; transform: translateX(-16px); } }
/* The box. Click it (or Next, Enter, Space, the right arrow) to finish the line, then to go on. It fills the space
   under the picture: its top edge is the picture's lower edge and it is as wide as a wide (1.792) picture there
   (zan: one flat colour, no texture). Sizes follow zan's layout at 2560 wide: name 35, line 37, Log and Audio 20,
   Back and Next 24, buttons 46 high, lines in Afacad 37; the line's size follows the box's own width, so no line in the
   story wraps past two lines (checked with every scene line). */
.scene { --box-c: #172131; --np: clamp(20px, calc(2px + 1.29vw), 35px); --bh: clamp(36px, calc(24.5px + 0.84vw), 46px);
  --fs-est: clamp(15px, 1.45vw, 37px);
  --boxw: min(calc(100% - 2 * var(--gut)), calc((100vh - var(--stage-b)) * 1.792));
  --boxw: min(calc(100% - 2 * var(--gut)), calc((100dvh - var(--stage-b)) * 1.792)); }
.scene-box { position: absolute; z-index: 3; left: 0; right: 0; top: calc(100% - var(--stage-b)); bottom: 22px; margin: 0 auto; width: var(--boxw);
  display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: calc(var(--np) * 0.7 + 10px) 30px 16px; border-radius: 6px; cursor: pointer;
  background: var(--box-c); container-type: inline-size; }
.scene-name { position: absolute; left: 20px; top: 0; transform: translateY(-55%); margin: 0; padding: 0.29em 0.4em 0.26em; border-radius: 4px;
  font: 800 var(--np)/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; text-align: left; color: var(--who-c);
  background: var(--box-c); }
.scene-name[hidden] { display: none; }
.scene-line { margin: 0; font-family: var(--ui); font-size: clamp(16px, 2.3cqi, 37px); line-height: 1.5; color: var(--ink); min-height: 3em; }
.scene-box.is-stage .scene-line { color: #c2ccd8; }
.scene-line .rest { color: transparent; }
.scene-ctls { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; cursor: default; }
.scene-ctls [hidden] { display: none; }
.scene-ctls .ctl { height: var(--bh); padding: 0 0.85em; font: 700 clamp(12px, calc(2px + 0.7vw), 20px)/1 var(--ui); letter-spacing: 0.06em; background: #0f1621; box-shadow: none; }
.scene-ctls .btn { height: var(--bh); padding: 0 0.8em 0 0.9em; font: 700 clamp(16px, calc(7px + 0.67vw), 24px)/1 var(--ui); letter-spacing: 0.06em; margin-left: 6px; gap: 0.45em; }
.scene-ctls .btn::after { content: ''; width: 0.36em; height: 0.48em; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
/* Back: amber like Next, its arrow pointing the other way, left of Log. */
.scene-ctls .btn-back { margin: 0 6px 0 0; padding: 0 0.9em 0 0.8em; }
.scene-ctls .btn-back::after { display: none; }
.scene-ctls .btn-back::before { content: ''; width: 0.36em; height: 0.48em; background: currentColor; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.scene-box.is-ready .btn::after { animation: nudge 1.1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(3px); } }
/* The log: every line of the scene so far, over the picture. */
.scene-logview { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px var(--gut); background: var(--night); cursor: default; }
.scene-logview[hidden] { display: none; }
.scene-logbox { width: min(760px, 100%); max-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; justify-items: end; }
.scene-logtitle { justify-self: start; font-size: 28px; color: var(--ink-2); }
.scene-log { list-style: none; margin: 0; padding: 0 8px 0 0; width: 100%; display: grid; gap: 14px; overflow: auto; align-content: start; }
.beat-who { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 2px; color: var(--ink-2); }
.beat-l .beat-who { color: var(--amber); }
.beat-p .beat-who { color: var(--copper); }
.beat-s .beat-who { color: var(--sys); }
.beat-text { margin: 0; font-size: 17px; line-height: 1.45; color: var(--ink); }
.beat-stage .beat-text { color: var(--ink-2); font-size: 15px; }
.beat-a .beat-text { color: #d9e1ea; }

/* ---------- Briefing: Martin's card, pencil on card ---------- */
.brief { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.brief-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 56px; padding: 36px 56px 48px; align-items: center; max-width: 1440px; width: 100%; margin: 0 auto; }
.brief-copy { display: grid; gap: 14px; }
.brief h2 { font-size: clamp(52px, 6vw, 92px); line-height: 0.86; font-weight: 900; white-space: nowrap; }
.brief-day { margin: 0; color: #8d9aab; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.brief-intro { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 36em; }
.mcard {
  position: relative; margin: 0; background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--pencil);
  padding: 14px 20px 10px 24px; max-width: 32em; border-radius: 2px; transform: rotate(-0.8deg);
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.45);
  animation: noteIn .35s ease-out;
}
.mcard p { margin: 0 0 4px; font: 400 27px/1.08 var(--hand); }
.mcard .mcard-sign { text-align: right; margin: 0; }
.mcard.is-broken p:last-of-type { transform: rotate(-1.4deg); transform-origin: left; }
.mcard-none { margin: 0; font: 400 26px/1 var(--hand); color: var(--muted); }
.scene-log .mcard { margin: 4px 0 6px; }
@keyframes noteIn { from { opacity: 0; } }
.radio-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brief-goal { margin: 6px 0 0; font-weight: 700; font-size: 15px; color: var(--ink); }
.brief-goal b { color: #fff; }
.acts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.brief-board { margin: 0; display: grid; gap: 12px; }
#briefSvg { width: 100%; height: auto; aspect-ratio: 16 / 10; display: block; background: #2a394f; }
/* The platform chips sit on the middle of the words beside them (zan). */
.brief-board figcaption { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.35em; row-gap: 6px; font-size: 13px; color: var(--ink-2); }
.code { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 3px; background: var(--c); color: #fff; font: 800 12px/1 var(--display); margin-left: 0.25em; }

/* Things on the desk, opened over the page */
.prop-view { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px; background: rgba(5, 8, 13, 0.86); overflow: auto; }
.prop-view[hidden] { display: none; }
.prop-box { width: min(720px, 100%); }
.prop-box.is-pic { width: min(100%, 1800px, calc((100vh - 120px) * var(--pa))); width: min(100%, 1800px, calc((100dvh - 120px) * var(--pa))); }

/* ---------- Shift: one quiet line on the navy, the Night Line board, the Comic Panels band ---------- */
.play { --band: clamp(176px, 25vh, 236px); height: 100vh; height: 100dvh; display: grid; grid-template-rows: 52px minmax(0, 1fr) var(--band); background: var(--night); overflow: hidden; }
/* Placed by row, so the result card (rows 2 to the end) lies over the board and the band instead of pushing them down. */
.play-bar { grid-row: 1; grid-column: 1; }
.board { grid-row: 2; grid-column: 1; }
.band { grid-row: 3; grid-column: 1; }
.play-bar { display: flex; align-items: center; min-width: 0; padding: 0 22px 0 34px; background: var(--night); position: relative; z-index: 2; }
.pb-name { margin: 0; display: flex; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; }
.pb-shift { flex: none; font: 700 16px/1 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: #93a0af; margin-right: 14px; }
.pb-day, .pb-dot { flex: none; font: 700 26px/52px var(--display); letter-spacing: 0.5px; text-transform: uppercase; color: #a9b4c1; }
.pb-dot { margin: 0 10px; }
.pb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 800 26px/52px var(--display); letter-spacing: 0.5px; text-transform: uppercase; color: #eef2f6; }
/* Keys: words with a bar under them; a lamp before the ones that are on or off. */
.key { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  font: 700 14px/1 var(--mono); letter-spacing: 2.2px; text-transform: uppercase; color: #a9b4c1; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.key::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 12px; height: 2px; background: #4c5a6b; }
.key:hover { color: #fff; }
.key:hover::after { background: #8d9aab; }
.key-lamp::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3a4757; }
.key-lamp.is-on, .key-lamp[aria-pressed="true"] { color: #fff; }
.key-lamp.is-on::before, .key-lamp[aria-pressed="true"]::before { background: #fff; }
.key-lamp.is-on::after, .key-lamp[aria-pressed="true"]::after { background: #c9d0d8; }
.key-week { margin-left: 22px; }
.key-restart { height: 36px; margin-left: clamp(20px, 5vw, 96px); padding: 4px 26px 0; background: #0c121b; box-shadow: inset 0 4px 0 #2c3644; color: #c9d0d8; }
.key-restart::after { display: none; }
.key-restart:hover { background: #151e2b; }
.kbd .key:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.meters { display: flex; align-items: baseline; gap: 30px; margin: 0 26px 0 auto; }
.meters > div { display: flex; align-items: baseline; gap: 10px; }
.meters > div[hidden] { display: none; }
.meters dt { font: 700 15px/1 var(--ui); letter-spacing: 1.8px; text-transform: uppercase; color: #93a0af; white-space: nowrap; }
.meters dd { margin: 0; font: 800 28px/52px var(--display); letter-spacing: 0.5px; color: #eef2f6; font-variant-numeric: tabular-nums; white-space: nowrap; }
#mPatternBox dd { color: var(--sys); }
.ctls { display: flex; flex: none; }

/* The board: the city fills it edge to edge, no frame. The hint line and the ticker run along its foot. */
.board { position: relative; overflow: hidden; min-height: 0; min-width: 0; background: #2a394f; touch-action: manipulation; }
#boardSvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.board-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; min-height: 40px; }
.hint { align-self: flex-start; max-width: calc(100% - 52px); margin: 0 0 9px 26px; padding: 5px 10px 4px; background: var(--night); font: 700 15px/1.2 var(--mono); color: #eef2f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint:empty { visibility: hidden; }
.hint[data-kind="warn"] { color: var(--amber); }
.hint[data-kind="bad"] { color: #ff8a80; }
.hint[data-kind="late"], .hint[data-kind="info"] { color: #c9d0d8; }
.ticker { margin: 0; height: 24px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; background: var(--night); font: 700 13px/1 var(--mono); letter-spacing: 0.1em; color: #7d8a9b; }
.ticker[hidden] { display: none; }
.ticker span { display: inline-block; padding-left: 100%; animation: tick 38s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }

/* The band under the board: comic panels with slanted gutters. Radio on the left, departures on the right. */
.band { display: flex; min-width: 0; min-height: 0; padding: 12px 16px 10px; background: var(--night); }
.band > * { min-width: 0; }
.radio-now { display: none; }
.martin { flex: none; width: clamp(170px, 12vw, 230px); margin-right: 0; display: grid; align-content: center; gap: 8px; padding: 14px 30px 14px 22px; border: 0; cursor: pointer; text-align: left;
  background: #6a5a3c; color: #ece0c4; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); -webkit-tap-highlight-color: transparent; }
.martin[hidden] { display: none; }
.mt-top { font: 700 13px/1.25 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; }
.mt-big { font: 800 clamp(28px, calc(var(--band) * 0.19), 40px)/0.92 var(--display); text-transform: uppercase; }
.martin:hover { background: #77664a; }
.martin.is-needed { background: var(--amber); color: #120e07; }
.martin.is-reverse { background: #243142; color: #dfe6ee; cursor: default; }
.martin.is-locked { background: #1b2433; color: #6d7a8c; cursor: default; }
.kbd .martin:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.radio { position: relative; flex: 0 0 47%; display: flex; min-width: 0; background: #0f1624; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
/* The radio's speaker grille, flat bars at the panel's right. */
.radio::after { content: ''; position: absolute; right: 30px; top: 26px; bottom: 26px; width: 26px; background: repeating-linear-gradient(#1c2638 0 4px, transparent 4px 9px); }
.band:has(.dp-other) .radio { flex-basis: 40%; }
.martin:not([hidden]) + .radio { flex-basis: 40%; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.radio .air-big { flex: none; height: 100%; }
.radio-talk { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 8px 64px 10px 22px; }
.radio-log { flex: 0 1 auto; min-height: 0; overflow: hidden; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; }
.rl { flex: none; padding: 3px 10px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font: 400 15px/1.4 var(--dlg); color: #a2abb7; background: #131b2b; }
.rl-who { margin-right: 10px; font: 800 14.5px/1 var(--display); letter-spacing: 1px; text-transform: uppercase; }
.rl-3 { color: #7f8ba0; background: #0f1624; opacity: 0.5; }
.rl-2 { opacity: 0.75; }
.rl-1 { color: #c8ced7; background: #18213a; }
/* Before the first call the log is empty: the caption sits in the middle, larger. */
.radio-talk:has(.radio-log:empty) { justify-content: center; }
.radio-talk:has(.radio-log:empty) .cap-line { font-size: 24px; }
.radio-cap { position: relative; flex: none; display: flex; flex-direction: column; gap: 5px; }
/* The caption's tail, pointing back at the face on the radio. */
.radio-cap::before { content: ''; position: absolute; left: -12px; bottom: 12px; width: 13px; height: 16px; background: #2e3b58; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.radio-cap[data-state="idle"]::before { background: #1f2a40; }
.radio-cap:has(.cap-line:empty)::before { display: none; }
.cap-who { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; min-height: 26px; }
.cap-name { padding: 3px 11px 2px; background: #05080d; font: 800 21px/1 var(--display); letter-spacing: 1.5px; text-transform: uppercase; color: #dfe4ea; }
.cap-name:empty { display: none; }
/* Names in each speaker's colour, as in the story scenes (zan, v61). */
.radio-cap[data-who="L"] .cap-name, .rl[data-c="L"] .rl-who { color: var(--amber); }
.radio-cap[data-who="P"] .cap-name, .rl[data-c="P"] .rl-who { color: var(--copper); }
.radio-cap[data-who="S"] .cap-name, .rl[data-c="S"] .rl-who { color: var(--sys); }
/* ON AIR: a grey lamp that burns light red while someone is talking (zan, 2026-10-16). */
.tx { display: inline-flex; align-items: center; gap: 8px; font: 700 13px/1 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: #4c5868; }
.tx::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #3a4554; box-sizing: border-box; }
.tx.is-on { color: #c9d0d8; }
/* The words trimmed to their capitals, so the lamp sits on their middle whatever the font's line metrics. */
.tx-t { display: block; text-box: trim-both cap alphabetic; }
.tx.is-on::before { background: #ff7b6e; box-shadow: 0 0 0 3px rgba(255, 123, 110, 0.18), 0 0 10px rgba(255, 92, 76, 0.55); }
.radio-cap:not([data-who]) .tx { visibility: hidden; }
.cap-line { flex: none; max-height: calc(var(--band) - 92px); margin: 0; overflow: hidden; padding: 7px 18px 8px 14px; background: #2e3b58;
  font: 700 21px/1.25 var(--dlg); color: #fff; clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.cap-line:empty { visibility: hidden; }
.radio-cap[data-state="idle"] .cap-line { background: #1f2a40; color: #c8ced7; }
/* Nobody on the air yet: one quiet line. */
.radio-cap.is-quiet::before { display: none; }
.radio-cap.is-quiet .cap-line, .radio-talk:has(.radio-log:empty) .radio-cap.is-quiet .cap-line { padding-left: 0; background: none; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #6d7a8c; }

/* Departures: the next three trains, in their station's colour, soonest first and biggest. */
.departures { position: relative; flex: 1; min-width: 0; display: flex; overflow: hidden; }
.deps { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; }
.dp { --c: #121a26; --cs: #121a26; --c2: #0c121b; flex: 1 1 0; min-width: 0; display: flex; position: relative; color: #fff; background: var(--cs);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.dp.is-lead { flex-grow: 1.15; background: var(--c); }
/* A train that has just left: lifted out of the row and sliding off to the left (app.js orderDeps). */
.dp.dp-leaving { position: absolute; z-index: 0; pointer-events: none; }
.deps > .dp { z-index: 1; }
.dp.is-end { clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); }
.dp-main { flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; justify-items: start; align-items: center; padding: 10px 8px 8px 24px; }
.dp-id { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 700 15px/1.2 var(--mono); white-space: nowrap; }
/* The white water train: dark words on its white panel and tile. */
.dp.is-water .dp-tile b, .dp.is-water .dp-name, .dp.is-water .dp-id { color: #0a1019; }
.dp-tag { display: inline-block; margin-left: 8px; vertical-align: 1px; padding: 2px 6px 1px; background: #9fd8ff; color: #0a1019; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.dp-tile { --ts: calc(var(--band) * 0.36); position: relative; width: var(--ts); height: var(--ts); margin: 2px 6px 6px 0; }
.dp.is-lead .dp-tile { --ts: calc(var(--band) * 0.46); }
/* On the first panel (filled with the station colour) the tile face is a lighter tone, so it reads as a tile. */
.dp.is-lead .dp-tile b { background: color-mix(in srgb, var(--c), #fff 20%); }
.dp-tile::before { content: ''; position: absolute; inset: 6px -6px -6px 6px; background: var(--c2); }
.dp-tile b { position: absolute; inset: 0; display: grid; place-items: center; padding-right: 6%; background: var(--c); clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%);
  font: 800 calc(var(--ts) * 0.76)/1 var(--display); color: #fff; }
.dp-tile b::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.22); clip-path: polygon(100% 42%, 100% 78%, 78% 100%, 42% 100%); }
.dp-tile b::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255, 255, 255, 0.22); }
.dp-name { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 calc(var(--band) * 0.115)/1 var(--display); letter-spacing: 0.6px; text-transform: uppercase; }
.dp.is-lead .dp-name { font-size: calc(var(--band) * 0.14); }
.dp-when { flex: none; min-width: 36%; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 10px 24px 4px 20px; background: var(--c2);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); }
.dp-lbl { margin: 0; font: 700 13px/1.2 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: #f1ecf4; text-align: right; white-space: nowrap; }
.dp-secs { margin: 0; font: 800 calc(var(--band) * 0.5)/0.8 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dp.is-lead .dp-secs { font-size: calc(var(--band) * 0.62); }
.dp-secs small { font-size: 0.34em; margin-left: 2px; }
/* Every digit but 1 is the same width; the box keeps that width so the panel's split never jumps as the seconds count down. */
.dp-secs { min-width: calc(0.65em + 2px); text-align: right; }
.dp.is-2d .dp-secs { min-width: calc(1.14em + 2px); }
.dp.is-2d .dp-secs { font-size: calc(var(--band) * 0.4); }
.dp.is-2d.is-lead .dp-secs { font-size: calc(var(--band) * 0.48); }
.dp.is-held .dp-lbl { white-space: normal; max-width: 7em; }
.dp-none { display: none; }
.dp.is-empty { background: #121a26; }
.dp.is-empty .dp-main, .dp.is-empty .dp-when { display: none; }
.dp.is-empty .dp-none { display: block; margin: auto 0 18px 28px; font: 700 13px/1.2 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: #6d7a8c; }
.dp-note { display: none; }
/* Lever keys (the phone's levers; hidden on wider screens, where the plates on the board are the levers): brass
   plates with the lever's number and its two ways as rows of station letters, the way it is set lit. */
.keys { display: none; }
.levkeys { display: flex; gap: 5px; min-width: 0; }
.lk { position: relative; flex: 1 1 auto; min-width: 44px; height: 60px; display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto 1fr;
  justify-content: center; align-items: center; column-gap: 7px; padding: 0 9px 0 8px; border: 0; cursor: pointer; text-align: left;
  background: #6a5a3c; color: #ece0c4; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lk::before { content: ''; position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; background: #fff; }
.lk::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #8a7752; }
.lk-num { grid-area: 1 / 1 / 4 / 2; min-width: 0.55em; font: 800 38px/1 var(--display); text-align: center; }
.lk-rows { grid-area: 2 / 2; display: grid; gap: 4px; }
.lk-row { display: flex; align-items: center; gap: 2px; height: 18px; }
.lk-row { position: relative; }
/* The way it is set: a filled dot and a bar under the row. The other way: an empty ring and faded tiles. */
.lk-dot { flex: none; width: 8px; height: 8px; margin: 0 5px 0 1px; border-radius: 50%; background: transparent; box-shadow: 0 0 0 2.5px #1a1610; }
.lk-row.is-on .lk-dot { background: #fff4dc; }
.lk-row.is-on::after { content: ''; position: absolute; left: 15px; right: 0; bottom: -3px; height: 2px; background: #1a1610; }
.lk-t { flex: none; width: 18px; height: 18px; display: grid; place-items: center; padding-right: 2px; background: var(--c); color: #fff;
  font: 800 14.5px/1 var(--display); clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%); }
.lk-row:not(.is-on) .lk-t { background: var(--off); color: #b9b1a1; }
.lk-loop { font: 700 12px/1 var(--mono); letter-spacing: 0.6px; text-transform: uppercase; }
.lk-row:not(.is-on) .lk-loop { opacity: 0.55; }
.lk-tag { grid-area: 3 / 2; align-self: start; justify-self: start; margin-top: 4px; padding: 2px 5px 1px; background: #243142; color: #dfe6ee;
  font: 700 12px/1 var(--mono); letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; }
.lk-tag:empty { display: none; }
.lk.has-tag .lk-rows { align-self: end; }
/* One lever: one key, not a slab across the screen. One or two levers: the keys are wide, so their letters are bigger. */
.levkeys[data-n="1"] { justify-content: center; }
.levkeys[data-n="1"] .lk { flex: 0 1 60%; }
.levkeys[data-n="1"] .lk-num, .levkeys[data-n="2"] .lk-num { font-size: 44px; }
.levkeys[data-n="1"] .lk-row, .levkeys[data-n="2"] .lk-row { height: 22px; }
.levkeys[data-n="1"] .lk-t, .levkeys[data-n="2"] .lk-t { width: 22px; height: 22px; font-size: 18px; }
.levkeys[data-n="1"] .lk-dot, .levkeys[data-n="2"] .lk-dot { width: 10px; height: 10px; margin-right: 7px; }
.lk:hover { background: #77664a; }
.lk.is-needed { background: var(--amber); color: #120e07; }
.lk.is-needed::after { background: #ffd98a; }
.lk.is-needed .lk-dot { box-shadow: 0 0 0 2.5px #120e07; }
.lk.is-needed .lk-row.is-on .lk-dot { background: #120e07; }
.lk.is-locked { background: #4a4030; color: #9a8e74; }
.lk.is-locked::after { background: #5c5040; }
.lk.is-locked .lk-row.is-on .lk-t { opacity: 0.75; }
.lk.is-jammed { background: #4a3f2b repeating-linear-gradient(-45deg, rgba(10, 16, 25, 0.55) 0 6px, transparent 6px 13px); }
.lk.is-jammed .lk-tag, .keys.is-sealed .lk-tag { background: #dfe6ee; color: #0a1019; }
.keys.is-sealed .lk { background: #4a4030; color: #9a8e74; }
.keys.is-sealed .lk::after { background: #5c5040; }
.keys.is-copied .lk { background: #3a4656; color: #c9d4e0; }
.keys.is-copied .lk::after { background: #56657a; }
.keys.is-copied .lk-tag { background: var(--sys); color: #0a1019; }
.lk.refused { animation: shake .3s; }
.lk.refused::before { background: var(--stop); animation: flashOut .6s ease-out; }
.lk.refused.thrown::before { background: #fff; }
.lk.thrown::before { animation: flashOut 1.2s ease-out; }
.kbd .lk:focus-visible, .kbd .mkey:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
/* Martin's key, over the lever keys on the last night. */
.mkey { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border: 0; cursor: pointer; text-align: left;
  background: #6a5a3c; color: #ece0c4; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mkey[hidden] { display: none; }
.mk-top { font: 700 12px/1 var(--mono); letter-spacing: 1.3px; text-transform: uppercase; }
.mk-big { font: 800 24px/1 var(--display); letter-spacing: 0.3px; text-transform: uppercase; }
.mkey.is-needed { background: var(--amber); color: #120e07; }
.mkey.is-reverse { background: #243142; color: #dfe6ee; cursor: default; }
.mkey.is-locked { background: #1b2433; color: #6d7a8c; cursor: default; }
/* Laptop widths: the meters stack their labels over their numbers, and everything in the bar and band tightens. */
@media (min-width: 1081px) and (max-width: 1600px) {
  .play-bar { padding: 0 14px 0 22px; }
  .pb-shift { font-size: 13px; letter-spacing: 1.5px; margin-right: 10px; }
  .pb-day, .pb-dot, .pb-title { font-size: 24px; }
  .pb-dot { margin: 0 8px; }
  .key { padding: 0 9px; font-size: 13px; letter-spacing: 1.6px; }
  .key::after { left: 9px; right: 9px; }
  .key-week { margin-left: 14px; }
  .key-restart { margin-left: 18px; padding: 4px 16px 0; }
  .meters { align-items: center; gap: 22px; margin: 0 14px 0 auto; padding-left: 16px; }
  .meters > div { flex-direction: column; align-items: flex-start; gap: 3px; }
  .meters dt { font-size: 13px; letter-spacing: 1.2px; }
  .meters dd { font-size: 25px; line-height: 1; }
  .radio { flex-basis: 44%; }
  .martin:not([hidden]) + .radio { flex-basis: 36%; }
  .band:has(.dp-other) .radio { flex-basis: 34%; }
  .dp-other { flex-grow: 0.8; }
  .dp-other .dp-when { padding: 10px 14px 4px 14px; }
  /* No speaker grille at these widths: the caption gets the room. */
  .radio-talk { padding-right: 18px; }
  .radio::after { display: none; }
  .cap-line { font-size: 18px; }
  /* Two whole log lines read better than three cut ones here. */
  .rl-3 { display: none; }
  .dp-main { padding-left: 16px; }
  .dp-id { font-size: 13px; }
  .dp-when { padding: 10px 20px 4px 16px; }
  /* A station's whole name fits beside two-digit seconds (HARBOUR at 1440 x 900). */
  .dp-name { font-size: calc(var(--band) * 0.098); letter-spacing: 0.3px; }
}
@media (min-width: 1081px) and (max-width: 1365px) {
  .dp-from { display: none; }
}
/* With Martin's key in the band the departures are narrower: the depot alone, no "from". */
@media (min-width: 1081px) and (max-width: 1600px) {
  .band:has(.martin:not([hidden])) .dp-from { display: none; }
}
/* Narrow laptops: the date gives its room to the shift's name. */
@media (min-width: 1081px) and (max-width: 1240px) {
  .pb-day, .pb-dot { display: none; }
}
/* Shift 7: the Arrays service, one way. Slate, not a station colour: it is not a train to route. */
.dp-other { flex: 0.85 1 0; background: #1d2633; }
.dp-other .dp-main { padding-right: 10px; }
.dp-other .dp-when { min-width: 0; padding-left: 18px; background: #161d28; }
.dp-other .dp-id { color: #c9d0d8; font-size: 13px; white-space: normal; }
.dp-ontime { display: block; color: #8d9aab; }
.dp-other .dp-tile { --ts: calc(var(--band) * 0.3); }
.dp-other .dp-name { font-size: calc(var(--band) * 0.1); color: #c9d0d8; }
.dp-other .dp-lbl { color: #c9d0d8; }
.dp-other .dp-note { display: block; margin: 0; max-width: 7em; font: 700 13px/1.3 var(--mono); letter-spacing: 0.5px; text-transform: uppercase; color: #8d9aab; text-align: right; }

/* The radio face: a small screen. Laura and Paul come in over the radio, with static as they key up, scan lines and a
   meter that follows their voice; the System's ring lights up as it speaks. Between calls the face dims. The picture
   is always shown whole. */
.air { position: relative; display: block; overflow: hidden; aspect-ratio: 640 / 794; background: #05080d; --who-c: #fff; }
.air[data-who="P"] { --who-c: #c9d0d8; }
.air[data-who="S"] { --who-c: var(--sys); }
.air img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.air img[hidden], .air:not([data-who]) img { visibility: hidden; }
.air-face { transition: opacity .9s ease, filter .9s ease; }
.air[data-state="idle"] .air-face, .air[data-state="idle"] .air-lit { opacity: 0.4; filter: grayscale(0.55) brightness(0.8); }
.air-lit { opacity: calc(var(--lvl, 0) * 1.3); }
.air::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(5, 8, 13, 0.16) 0 1px, rgba(5, 8, 13, 0) 1px 4px); }
.air-grain { position: absolute; inset: 0; z-index: 2; background: var(--static) 0 0 / 96px; opacity: 0.09; animation: grain .48s steps(1) infinite paused; pointer-events: none; }
.air:not([data-who]) .air-grain { opacity: 0.22; }
.air[data-state="live"] .air-grain { animation-play-state: running; }
.air.is-key .air-grain { animation: grain .48s steps(1) infinite, keyUp .55s ease-out; }
.air.is-key .air-face { animation: faceIn .55s ease-out; }
.air-big::after { background: repeating-linear-gradient(180deg, rgba(5, 8, 13, 0.14) 0 1px, rgba(5, 8, 13, 0) 1px 4px); }
.air[data-who="S"]::after, .air[data-who="S"] .air-grain { display: none; }
.air-meter { position: absolute; z-index: 3; left: 8%; right: 8%; bottom: 5%; height: 5px; display: flex; gap: 2px; }
.air-meter i { flex: 1; background: rgba(255, 255, 255, 0.1); }
.air-meter i.on { background: var(--who-c); }
@keyframes grain { 0% { background-position: 0 0; } 25% { background-position: -31px 17px; } 50% { background-position: 23px -41px; } 75% { background-position: -47px -9px; } }
@keyframes keyUp { from { opacity: 0.85; } }
@keyframes faceIn { from { opacity: 0.15; } }
.msg { padding: 7px 10px 8px 12px; background: rgba(255, 255, 255, 0.02); animation: msgIn .3s ease-out; }
.msg-who { display: block; font-size: 11px; font-weight: 700; color: var(--amber); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 3px; }
.msg-p .msg-who { color: var(--copper); }
.msg-s .msg-who { color: var(--sys); }
.msg-text { margin: 0; font-size: 14px; line-height: 1.42; color: #f1ead8; }
#briefLines .msg { background: #1b2433; max-width: 36em; }
#briefLines .msg-who { font-size: 12px; }
#briefLines .msg-s .msg-who { color: var(--sys); }
@keyframes msgIn { from { opacity: 0; } }

/* ---------- Panel (shared): the city, the track, points, stations, depots, trains ---------- */
.trk-case polyline, .trk-dim polyline, .trk-set polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.trk-case polyline { stroke: #0b111b; stroke-width: var(--cu); }
.trk-case polyline.is-set { stroke-width: var(--cs); }
.trk-dim polyline { stroke: #7c705a; stroke-width: var(--ku); }
.trk-dim polyline.is-set { display: none; }
/* The set way of a lever no train can reach just now: between set and unset track in width and colour. */
.trk-dim polyline.is-armed { stroke: #c9b48a; stroke-width: var(--ka); }
.trk-case polyline.is-armed { stroke-width: var(--ca); }
.trk-set polyline { stroke: #ecd6a8; stroke-width: var(--ks); display: none; }
.trk-set polyline.is-set { display: inline; }
.is-copied .trk-set polyline { stroke: #cfdceb; }
/* Merge signals: a head with red over green, one lamp always lit; the stop bar shows only while it holds a train. */

.st-code { fill: #fff; font-family: var(--display); font-weight: 800; text-anchor: middle; pointer-events: none; }
.st-name { fill: #dde3ea; font-family: var(--mono); font-weight: 700; letter-spacing: 1.5px; }
.st-flash { fill: #fff; opacity: 0; pointer-events: none; }
.b-station.hit-ok .st-flash { animation: flashOut .9s ease-out; }
/* A wrong arrival: a flat red bar beside the tile, so the tile keeps its own colour. */
.st-bad { fill: var(--stop); opacity: 0; pointer-events: none; }
.b-station.hit-bad .st-bad { animation: flatOut 1.6s linear; }
@keyframes flashOut { from { opacity: 0.8; } to { opacity: 0; } }
@keyframes flatOut { from { opacity: 1; } to { opacity: 0; } }
.dt-body { fill: var(--amber); }
.dt-top { fill: #ffd98a; }
.dt-foot { fill: #c4831f; }
.dt-code { fill: #120e07; font-family: var(--display); font-weight: 800; text-anchor: middle; }

/* Points: a ring on the track and the lever's plate beside it. The plate turns amber when it needs throwing now. */
.b-switch { outline: none; -webkit-tap-highlight-color: transparent; }
.b-switch[role="button"] { cursor: pointer; }
.sw-hit { fill: transparent; }
.sw-case { fill: none; stroke: #0a1019; }
.sw-ring { fill: none; stroke: #dfe6ee; }
.b-switch:not(.is-live) .sw-ring { stroke: #a9b4c1; }
.sw-focus, .pl-focus { fill: none; stroke: none; }
.kbd .b-switch:focus-visible { outline: none; }
.kbd .b-switch:focus-visible .sw-focus, .kbd .b-switch:focus-visible .pl-focus { stroke: #fff; stroke-width: 2px; }
.b-switch.is-locked .sw-ring, .is-sealed .sw-ring { stroke: #8d9aab; }
/* A refused throw flashes the ring red, once; the colour is in the animation, never left behind. */
.b-switch.refused .sw-ring { animation: ringRefuse .6s ease-out; }
@keyframes ringRefuse { from, 35% { stroke: var(--stop); } }
/* zan (2026-10-16): the lever plates and depot tags are yellow, the amber of the buttons. */
.pl-lead { stroke: var(--amber); stroke-linecap: round; }
.pl-body { fill: var(--amber); }
.pl-shade { fill: #d9952a; }
.pl-hi { fill: #ffd98a; }
.pl-rivet { fill: #a8731f; }
.pl-num { fill: #120e07; font-family: var(--display); font-weight: 800; text-anchor: middle; pointer-events: none; }
.pl-lbl { fill: #120e07; font-family: var(--mono); font-weight: 700; letter-spacing: 0.5px; pointer-events: none; }
.pl-code { fill: #fff; font-family: var(--display); font-weight: 800; text-anchor: middle; pointer-events: none; }
.pl-well { fill: #c4831f; }
/* The way the lever is set: a filled dot in its ring and a bar under the row. The other way: an empty ring and tiles
   faded into the plate, so "which way" reads on brass, amber, locked and copied plates alike. */
.pl-ring { fill: none; stroke: #1a1610; }
.pl-dot { fill: none; }
.pl-row.is-on .pl-dot { fill: #120e07; }
.pl-bar { fill: #120e07; display: none; }
.pl-row.is-on .pl-bar { display: inline; }
.pl-row:not(.is-on) .pl-t { fill: var(--off); }
.pl-row:not(.is-on) .pl-code { fill: #b9b1a1; }
.pl-row:not(.is-on) .pl-lbl { opacity: 0.55; }
.pl-stripes { display: none; pointer-events: none; }
.pl-flash { fill: #fff; opacity: 0; pointer-events: none; }
.pl-tag { fill: #243142; }
.pl-tagtxt { fill: #dfe6ee; font-family: var(--mono); font-weight: 700; letter-spacing: 1px; pointer-events: none; }
.pl-tagtxt.is-mid { text-anchor: middle; letter-spacing: 0.5px; }
.b-switch[role="button"]:hover .pl-in { filter: brightness(1.08); }
/* "Throw it now": with every plate yellow, the plate that needs its lever turns white (its ring stays amber). */
.b-switch.is-needed .pl-body { fill: #fff6e2; }
.b-switch.is-needed .pl-lead { stroke: #fff6e2; }
.b-switch.is-needed .pl-shade { fill: #e6dcc6; }
.b-switch.is-needed .pl-hi { fill: #ffffff; }
.b-switch.is-needed .pl-rivet { fill: #b9ab8c; }
.b-switch.is-needed .pl-well { fill: #e2d5b8; }
/* Locked (a train on the points) and sealed: a solid darker plate with its tag, never see-through. */
.b-switch.is-locked .pl-body, .is-sealed .b-switch .pl-body { fill: #4a4030; }
.b-switch.is-locked .pl-shade, .is-sealed .b-switch .pl-shade { fill: #3d3426; }
.b-switch.is-locked .pl-hi, .is-sealed .b-switch .pl-hi { fill: #5c5040; }
.b-switch.is-locked .pl-well, .is-sealed .b-switch .pl-well { fill: #342c20; }
.b-switch.is-locked .pl-rivet, .is-sealed .b-switch .pl-rivet { fill: #2e271c; }
.b-switch.is-locked .pl-num, .b-switch.is-locked .pl-lbl, .is-sealed .b-switch .pl-num, .is-sealed .b-switch .pl-lbl { fill: #9a8e74; }
.b-switch.is-locked .pl-row.is-on .pl-t, .is-sealed .b-switch .pl-row.is-on .pl-t { opacity: 0.7; }
.b-switch.is-locked .pl-bar, .is-sealed .b-switch .pl-bar { fill: #cfc4aa; }
.b-switch.is-locked .pl-lead, .is-sealed .b-switch .pl-lead { stroke: #4a4030; }
.b-switch.is-jammed .pl-stripes { display: inline; opacity: 0.55; }
.b-switch.is-jammed .pl-tag { fill: #dfe6ee; }
.b-switch.is-jammed .pl-tagtxt { fill: #0a1019; }
.is-sealed .pl-tag { fill: #dfe6ee; }
.is-sealed .pl-tagtxt { fill: #0a1019; }
.is-copied .pl-body { fill: #3a4656; }
.is-copied .pl-shade, .is-copied .pl-well { fill: #2c3644; }
.is-copied .pl-hi { fill: #56657a; }
.is-copied .pl-num, .is-copied .pl-lbl { fill: #c9d4e0; }
.is-copied .pl-lead { stroke: #3a4656; }
.is-copied .pl-tag { fill: var(--sys); }
.is-copied .pl-tagtxt { fill: #0a1019; }
.is-copied .pl-bar { fill: #c9d4e0; }
.b-switch.refused .pl-in { animation: refuse .45s; }
.b-switch.refused .pl-flash { fill: var(--stop); animation: flashOut .6s ease-out; }
.b-switch.thrown .pl-flash { fill: #fff; animation: flashOut 1.2s ease-out; }
/* Amber, "throw it now", is the last word on a ring. */
.b-switch.is-needed .sw-ring { stroke: var(--amber); stroke-width: max(3px, calc(var(--k, 1) * 6.5px)); }
@keyframes refuse { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Trains: a flat car in the destination's colour with its letter, and a disc counting the passengers' patience. */
.b-train { pointer-events: none; }
.tr-code { fill: #fff; font-family: var(--display); font-weight: 800; text-anchor: middle; }
.tr-disc { fill: #0a1019; stroke: #0a1019; }
.tr-track { fill: none; stroke: #243142; }
.tr-arc { fill: none; stroke: #f6eedc; }
.tr-secs { fill: #f6eedc; font-family: var(--display); font-weight: 800; text-anchor: middle; }
.b-train.is-late .tr-arc, .b-train.is-wrong .tr-arc { stroke: var(--stop); }
.b-train.is-late .tr-secs { fill: #ff8a80; }
.tr-lbg { fill: #0a1019; }
.tr-label { fill: #d0d8e1; font-family: var(--mono); font-weight: 700; text-anchor: middle; }
.tr-lead { stroke: #7d8a9e; stroke-linecap: round; }
.tr-wbox { fill: #9fd8ff; }
.tr-wtxt { fill: #0a1019; font-family: var(--mono); font-weight: 700; text-anchor: middle; letter-spacing: 1px; }
.b-train.gone, .tr-water.gone, .tr-lead.gone { opacity: 0; transition: opacity .4s; }

/* Cards over the board and the band (pause, the System's report): flat panels on the dimmed screen. A tall card
   scrolls from its top. */
.overlay { grid-row: 2 / -1; grid-column: 1; position: relative; z-index: 5; display: flex; padding: 16px; background: rgba(10, 16, 25, 0.84); overflow: auto; }
.overlay[hidden] { display: none; }
.card { position: relative; margin: auto; width: min(460px, 100%); padding: 24px 26px 22px; display: grid; gap: 10px; background: #1b2433; color: var(--ink); font-family: var(--ui); }
.card h3 { font-size: 40px; line-height: 0.9; font-weight: 900; color: #fff; }
.card-text { margin: 0; font-size: 17px; color: #a9b4c1; }
/* Pause: Resume across the card, the three others in an even row under it. */
.card-acts.pause-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.pause-acts .btn { width: 100%; padding: 0 10px; }
.pause-acts .btn:first-child { grid-column: 1 / -1; }
.card .marks { flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid #2c3a4e; }
.card .mark { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #6d7a8c; }
.card .mark span { white-space: nowrap; }
.card .mark.is-on { color: #eef2f6; font-weight: 700; }
.card .lamp { width: 10px; height: 24px; }
.card .lamp-dot.on-go, .card .lamp-dot.on-caution, .card .lamp-dot.on-stop { filter: none; }
.card-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.card .btn { height: 44px; border-radius: 0; }
.card .btn-primary { background: #eef2f6; color: #0a1019; box-shadow: none; }
.card .btn-primary:hover { background: #fff; filter: none; }
.card .btn-primary:active, .card .btn-quiet:active { transform: none; box-shadow: none; }
.card .btn-quiet { background: #2c3a4e; color: #eef2f6; box-shadow: none; }
.card .btn-quiet:hover { background: #36465c; filter: none; }
.kbd .card .btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* zan (2026-10-16): no countdown disc or "T5 · 110 aboard" label on the trains; the departure panels carry the times. */
.b-discs .b-train, .b-leads .tr-lead { display: none !important; }
/* The System's report. */
/* zan (2026-10-16): the shift in words, three numbers in even tiles, Afacad for the words (numbers and buttons stay
   Big Shoulders), and the buttons as one wide primary over two equal ones. */
.report { gap: 12px; }
.rep-head { margin: 0; padding-bottom: 12px; border-bottom: 1px solid #2c3a4e; font: 600 21px/1 var(--ui); color: #93a0af; letter-spacing: 0.06em; text-transform: uppercase; }
.rep-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 2px 0 4px; }
.rep-nums div { padding: 10px 12px 11px; background: #243142; }
.rep-nums dt { font: 600 13px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: #93a0af; }
.rep-nums dd { margin: 6px 0 0; font: 900 30px/1 var(--display); color: #fff; }
.rep-line { margin: 0; font-size: 16px; line-height: 1.35; color: #c9d0d8; }
.report .marks { font-family: var(--ui); }
.report .mark { font-size: 15px; }
.rep-small { margin: 0; font-size: 13px; color: #6d7a8c; letter-spacing: 0.02em; }
.rep-voice { margin: 2px 0 0; padding: 10px 14px; background: #2e3b58; color: #fff; font-size: 16px; }
.rep-voice span { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #c9d0d8; }
.rep-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.rep-acts .btn { width: 100%; padding: 0 12px; }
.rep-acts .btn:first-child:nth-last-child(3) { grid-column: 1 / -1; }

/* ---------- Props: paper, card, plate, board, postcard ---------- */
.prop-hand { font: 400 22px/1.05 var(--hand); color: var(--pencil); }
.prop-ticket { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px; background: var(--night); }
.tk { aspect-ratio: 1.6; border-radius: 10px; padding: 16px 18px; display: grid; align-content: start; gap: 4px; font-size: 13px; }
.tk-front { background: linear-gradient(135deg, #2a374b, #1b293c); color: var(--ink); box-shadow: inset 4px 0 0 var(--amber-rim), 0 6px 0 #05080d; position: relative; }
.tk-front b { font: 900 30px/1 var(--display); text-transform: uppercase; margin-bottom: 6px; }
.tk-co { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.tk-chip { position: absolute; right: 18px; bottom: 16px; width: 34px; height: 26px; border-radius: 4px; background: linear-gradient(135deg, #f2c568, #b8741d); }
.tk-back { background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--paper-ink); font-size: 12px; line-height: 1.45; box-shadow: 0 6px 0 #05080d; }
.tk-back p { margin: 0 0 6px; }
.tk-small { font-size: 9px; color: #8d877a; letter-spacing: 0.04em; margin: 0; }
.prop-plate { position: relative; margin: 30px auto; width: min(460px, 90%); padding: 26px 34px; text-align: center; border-radius: 6px;
  background: linear-gradient(160deg, #e3b968, #b8862e 55%, #8a6220); color: #3a2706; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 0 0 2px #05080d, 8px 10px 0 rgba(0, 0, 0, 0.5); }
.prop-plate p { margin: 0; font: 900 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.06em; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.prop-plate .pl-small { font: 700 13px/1.4 var(--mono); letter-spacing: 0.12em; margin-top: 8px; }
.pl-bolt { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3d0, #8a6220 70%); }
.pl-bolt:nth-child(1) { left: 10px; top: 10px; } .pl-bolt:nth-child(2) { right: 10px; top: 10px; }
.pl-bolt:nth-last-child(2) { left: 10px; bottom: 10px; } .pl-bolt:nth-last-child(1) { right: 10px; bottom: 10px; }
.prop-board { position: relative; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 20px; padding: 30px; min-height: 300px; background: #6b4e2e radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.18) 1px, transparent 2px) 0 0 / 9px 9px; align-items: start; }
.pb-rota, .pb-memo { background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--paper-ink); padding: 14px 16px; display: grid; gap: 4px; font-size: 12px; box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.35); position: relative; }
.pb-rota { transform: rotate(-2deg); }
.pb-memo { transform: rotate(1deg); font-size: 13px; }
.pb-memo b, .pb-rota b { font: 900 18px/1 var(--display); text-transform: uppercase; }
.pb-memo p { margin: 0; }
.pb-rota::before, .pb-memo::before { content: ''; position: absolute; top: 6px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #c0392b; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.pb-glove { position: absolute; left: 40px; bottom: 26px; width: 56px; height: 70px; background: #2a374b; border-radius: 12px 12px 18px 18px; transform: rotate(-14deg); box-shadow: inset 4px 0 0 rgba(244, 178, 62, 0.35); }
.prop-postcard { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px; background: var(--night); }
.pc { aspect-ratio: 1.55; background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--paper-ink); box-shadow: 0 6px 0 #05080d; overflow: hidden; position: relative; }
.pc-front svg { display: block; width: 100%; height: auto; }
.pc-caption { position: absolute; left: 10px; bottom: 6px; font-size: 11px; color: #f2e6c8; letter-spacing: 0.06em; }
.pc-back { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; padding: 14px; }
.pc-hand { margin: 0; font: 400 22px/1.02 var(--hand); color: #24324a; border-right: 1px solid #c9bea6; padding-right: 10px; }
.pc-addr { display: grid; align-content: start; gap: 6px; font: 400 22px/1 var(--hand); color: #24324a; }
.pc-stamp { justify-self: end; width: 40px; height: 48px; display: grid; place-items: center; background: #8a63e6; color: #fff; font: 900 22px/1 var(--display); outline: 2px dashed #ebe3d1; outline-offset: -5px; margin-bottom: 14px; }
.paper { background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--paper-ink); padding: 22px 26px 18px; box-shadow: inset 4px 0 0 rgba(244, 178, 62, 0.5), 8px 10px 0 rgba(0, 0, 0, 0.5); font-size: 14px; line-height: 1.45; }
.paper-mast { display: grid; gap: 4px; border-bottom: 3px double var(--paper-ink); padding-bottom: 10px; margin-bottom: 14px; text-align: center; }
.paper-name { font: 900 46px/0.9 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.paper-meta { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #5d5a52; }
.paper h3 { font-size: 30px; line-height: 0.95; margin-bottom: 6px; }
.paper h4 { font: 900 15px/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 4px; }
.paper p { margin: 0 0 8px; }
.paper-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; border-top: 1px solid #b3aa95; padding-top: 12px; margin-top: 8px; }
.paper-box { border: 1px solid var(--paper-ink); padding: 8px 10px; }
.paper-foot { border-top: 1px solid #b3aa95; margin-top: 10px; padding-top: 6px; font-size: 10px; color: #8d877a; }
.paper.is-blank { min-height: 420px; display: grid; grid-template-rows: auto 1fr auto; }
.paper-blank { align-self: center; text-align: center; font-size: 15px; color: #5d5a52; }

/* ---------- Ending ---------- */
.ending { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 56px 24px; }
.end-wrap { width: min(680px, 100%); display: grid; gap: 24px; justify-items: stretch; }
.ending h2 { font-size: clamp(50px, 6.5vw, 92px); line-height: 0.86; font-weight: 900; }
.end-lines p { margin: 0 0 10px; font-size: 16px; color: var(--ink-2); max-width: 36em; }
.end-platform { border-top: 1px solid #222c3a; padding-top: 18px; }
.end-platform p { margin: 0 0 8px; color: var(--ink); font-size: 16px; }
.end-platform .end-place { color: var(--amber); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.end-last { margin: 0; font-size: 18px; }
.end-last span:first-child { color: var(--ink-2); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; display: block; }
.register { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper) var(--grain); background-blend-mode: multiply; color: var(--paper-ink); font-size: 14px; box-shadow: inset 4px 0 0 rgba(244, 178, 62, 0.6), 8px 10px 0 rgba(0, 0, 0, 0.5); }
.register caption { caption-side: top; text-align: left; font: 800 18px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); padding-bottom: 12px; }
.register th, .register td { padding: 9px 12px; text-align: left; border-bottom: 1px dashed #b3aa95; }
.register th { font-size: 11px; color: #5d5a52; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.register .num { text-align: right; }
.register tfoot td { font-weight: 700; border-bottom: 0; }
.register .lamp-body { fill: var(--paper-ink); }
#endBack { justify-self: start; }

/* Sound settings: a small mixing desk, flat like the cards. Four channel strips, each a fader in a slot under its
   readout. The well, the input and the knob are all 40 px wide, so the knob sits centred on its slot and its ticks. */
.mixer-view { position: fixed; inset: 0; z-index: 31; display: flex; padding: 24px 16px; background: rgba(5, 8, 13, 0.86); overflow: auto; }
.mixer-view[hidden] { display: none; }
.mixer { margin: auto; width: min(460px, 100%); display: grid; gap: 16px; padding: 22px 24px; background: #1b2433; font-family: var(--ui); }
.mixer h2 { font-size: 30px; line-height: 1; color: #fff; }
.mixer-strips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 1.15fr; gap: 10px; padding: 14px 12px 12px; background: #121a26; }
.strip { display: grid; justify-items: center; gap: 10px; min-width: 0; }
.strip-master { padding-left: 12px; border-left: 1px solid #2c3a4e; }
.strip-read { min-width: 48px; text-align: center; padding: 5px 6px; background: #0a1019; font: 800 20px/1 var(--display); color: #eef2f6; font-variant-numeric: tabular-nums; }
.strip-name { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: #a9b4c1; }
.strip-master .strip-name { color: #fff; font-weight: 700; }
.strip-well { position: relative; height: 180px; width: 40px; display: grid; place-items: center;
  background: repeating-linear-gradient(0deg, transparent 0 17px, #2c3a4e 17px 18px) center / 22px 100% no-repeat; }
.strip-well input { writing-mode: vertical-lr; direction: rtl; width: 40px; height: 180px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.strip-well input::-webkit-slider-runnable-track { width: 100%; background: linear-gradient(90deg, transparent 16px, #0a1019 16px 24px, transparent 24px); }
.strip-well input::-moz-range-track { width: 100%; background: linear-gradient(90deg, transparent 16px, #0a1019 16px 24px, transparent 24px); }
.strip-well input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 40px; height: 22px; border-radius: 0; border: 0; background: #8d9aab; box-shadow: inset 0 -4px 0 #6d7a8c; }
.strip-well input::-moz-range-thumb { width: 40px; height: 22px; border-radius: 0; border: 0; background: #8d9aab; box-shadow: inset 0 -4px 0 #6d7a8c; }
.strip-master input::-webkit-slider-thumb { background: #eef2f6; box-shadow: inset 0 -4px 0 #a9b4c1; }
.strip-master input::-moz-range-thumb { background: #eef2f6; box-shadow: inset 0 -4px 0 #a9b4c1; }
.kbd .strip-well input:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.mixer-note { margin: 0; font-size: 14px; color: #8d9aab; }
.mixer-close { justify-self: start; }
.mixer .btn-primary { height: 44px; border-radius: 0; background: #eef2f6; color: #0a1019; box-shadow: none; }
.mixer .btn-primary:hover { background: #fff; filter: none; }
.mixer .btn-primary:active { transform: none; box-shadow: none; }

/* Short screens: the report tightens so its buttons stay in view. */
@media (max-height: 700px) {
  .card { padding: 16px 20px 14px; gap: 7px; }
  .card h3 { font-size: 30px; }
  .rep-head { padding-bottom: 6px; }
  .rep-nums dd { font-size: 22px; }
  .card .marks { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding-top: 6px; }
  .card .lamp { width: 8px; height: 19px; }
  .rep-line, .rep-voice { font-size: 14px; }
  .rep-voice { padding: 7px 10px; }
  .card-acts { margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .msg, .radio .msg, .mcard, .beat, .scene-portrait, .scene-prop, .scene-bg.is-new img { animation: none; }
  .scene-box.is-ready .btn::after { animation: none; }
  .b-station.hit-ok .st-flash, .b-switch.thrown .pl-flash, .b-switch.refused .pl-flash, .b-switch.refused .pl-in { animation: none; }
  .lk.refused, .lk.refused::before, .lk.thrown::before { animation: none; }
  .b-train.gone, .tr-water.gone, .tr-lead.gone { transition: none; }
  .ticker span { animation: none; padding-left: 0; }
  .air .air-grain, .air.is-key .air-grain, .air.is-key .air-face { animation: none; }
  .week-art img { animation: none; }
  .scene-art.is-new .art-stack, .scene h2.is-new { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .brief-grid { grid-template-columns: minmax(0, 1fr); padding: 28px 24px 40px; gap: 32px; }
  .scene { --sprite-h: min(32vh, 360px); }
  .scene:not(:has(.scene-prop:not([hidden]))) { --sprite-h: min(42vh, 460px); }
  .scene-prop { width: min(560px, 70vw); }
  .scene-prop:has(.mcard) { width: min(460px, 70vw); }
  .week { padding: 40px 32px 72px; align-items: start; }
  .week { padding-top: 0; }
  .week-art { position: relative; inset: auto; grid-row: 1; height: 56vw; max-height: 540px; margin: 0 -32px -18vw; -webkit-mask-image: none; mask-image: none; top: auto; transform: none; width: auto; aspect-ratio: auto; }
  .week-art img { object-position: 70% 40%; }
  .week-art::after { background: linear-gradient(0deg, var(--night) 0%, rgba(10, 16, 25, 0.75) 26%, rgba(10, 16, 25, 0) 55%); }
  .week-copy { grid-row: 2; }
  .week h1 { font-size: min(26vw, 214px); }
  .credit { left: 32px; }
  /* The shift on a tablet held sideways: the top bar takes two lines (the name and RESTART, then the readouts and keys),
     the band keeps its panels, tighter. */
  .play { grid-template-rows: auto minmax(0, 1fr) var(--band); }
  .play-bar { flex-wrap: wrap; padding: 0 16px; }
  .play-bar::after { content: ''; order: 4; flex: 0 0 100%; height: 0; }
  .pb-name { order: 1; flex: 1 1 0; }
  .key-restart { order: 3; margin-left: 16px; }
  .key-week { order: 5; margin-left: -12px; }
  .meters { order: 6; margin: 0 0 0 12px; gap: 18px; }
  .ctls { order: 7; margin-left: auto; }
  .radio, .band:has(.dp-other) .radio { flex-basis: 40%; }
  .martin:not([hidden]) + .radio { flex-basis: 37%; }
  .martin { width: 140px; padding: 12px 22px 12px 16px; }
  .radio-talk { padding-right: 18px; }
  .radio::after { display: none; }
  .dp-main { padding-left: 18px; }
  .dp-id { font-size: 13px; }
  .dp-from { display: none; }
  .dp-when { min-width: 0; padding: 10px 14px 4px 12px; }
  .dp-secs, .dp.is-lead .dp-secs { font-size: calc(var(--band) * 0.44); }
  .dp.is-2d .dp-secs, .dp.is-2d.is-lead .dp-secs { font-size: calc(var(--band) * 0.34); }
  .dp-tile, .dp.is-lead .dp-tile { --ts: calc(var(--band) * 0.34); }
  .dp-name, .dp.is-lead .dp-name { font-size: calc(var(--band) * 0.1); }
}

/* A tablet held sideways with a short screen (1024 x 600): one row on top and a shorter band, so the board keeps its room. */
@media (min-width: 641px) and (max-width: 1080px) and (min-height: 561px) and (max-height: 700px) and (orientation: landscape) {
  .play { --band: 150px; grid-template-rows: 52px minmax(0, 1fr) var(--band); }
  .play-bar { flex-wrap: nowrap; padding: 0 10px 0 18px; }
  .play-bar::after { display: none; }
  .pb-name { order: 0; flex: 1 1 auto; }
  .pb-day, .pb-dot { display: none; }
  .pb-shift { font-size: 13px; margin-right: 10px; }
  .pb-title { font-size: 22px; }
  .key { padding: 0 8px; font-size: 13px; letter-spacing: 1.2px; }
  .key::after { left: 8px; right: 8px; }
  .key-week { order: 1; margin-left: 8px; }
  .meters { order: 2; margin: 0 10px 0 auto; padding-left: 10px; gap: 16px; align-items: center; }
  .meters > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .meters dd { font-size: 22px; line-height: 1; }
  .meters .lg { display: none; }
  .ctls { order: 3; margin-left: 0; }
  .key-restart { order: 4; margin-left: 10px; padding: 4px 14px 0; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  .week { padding: 0 16px 28px; }
  .week-art { height: 96vw; margin: 0 -16px -26vw; }
  .week-art img { object-position: 74% 30%; }
  .week-art::after { background: linear-gradient(0deg, var(--night) 0%, rgba(10, 16, 25, 0.9) 24%, rgba(10, 16, 25, 0) 52%); }
  .week-copy { gap: 14px; }
  .week h1 { font-size: min(39vw, 170px); }
  .credit { position: static; grid-row: 3; margin-top: 18px; }
  .bar { padding: 10px 16px; gap: 10px; }
  .brief-grid { padding: 22px 16px 32px; }
  .brief h2 { font-size: 54px; }
  .scene { --gut: 10px; --sprite-h: min(25vh, 210px); --stage-b: 230px; }
  .scene:not(:has(.scene-prop:not([hidden]))) { --sprite-h: min(36vh, 320px); }
  .scene h2 { font-size: 30px; }
  .scene-where { top: 18px; left: 16px; }
  .scene { --np: 18px; --bh: 36px; }
  .scene-box { bottom: 10px; padding: 24px 16px 12px; gap: 10px; }
  .scene-name { left: 12px; }
  .scene-line { font-size: 17px; line-height: 1.45; min-height: 4.35em; }
  .scene-ctls { gap: 6px; }
  .scene-ctls .ctl { padding: 0 10px; font-size: 13px; }
  .scene-ctls .btn { padding: 0 14px 0 16px; margin-left: auto; }
  .scene-ctls .btn-back { margin: 0; padding: 0 16px 0 14px; }
  .scene-ctls .long { display: none; }
  .scene-portrait { left: var(--gut); bottom: calc(var(--stage-b) - 8px); }
  .scene-prop { width: calc(100% - 40px); }
  .scene-prop:has(.mcard) { width: calc(100% - 48px); }
  .mcard p { font-size: 24px; }
  .strip-well, .strip-well input { height: 150px; }
  .mixer-strips { gap: 6px; padding: 12px 8px; }
  .strip-master { padding-left: 8px; }
  .prop-ticket, .prop-postcard { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .prop-board { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .paper-cols { grid-template-columns: minmax(0, 1fr); }
  .paper-name { font-size: 36px; }
}
/* The shift in the phone layout: phones, and tablets or narrow windows held upright (app.js uses the same query). */
@media (max-width: 640px) and (min-height: 561px), (max-width: 1080px) and (orientation: portrait) {
  /* Two short rows on top, the speaker strip, the upright board, three departures, and the lever keys under the
     thumbs. The band's parts become rows of the screen. */
  .play { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  .band { display: contents; }
  .band > .radio, .band > .martin { display: none; }
  .play-bar { grid-row: 1; flex-wrap: wrap; align-items: center; padding: 0 4px 0 12px; }
  .play-bar::after { content: ''; order: 4; flex: 0 0 100%; height: 0; }
  .pb-name { order: 1; flex: 1 1 0; min-width: 0; height: 44px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; align-items: baseline; row-gap: 3px; }
  .pb-shift { grid-area: 1 / 1; margin-right: 0; font-size: 12px; letter-spacing: 1px; }
  .pb-day { grid-area: 1 / 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 12px/1 var(--mono); letter-spacing: 1px; color: #93a0af; }
  .pb-day::before { content: ' · '; white-space: pre; }
  .pb-dot { display: none; }
  .pb-title { grid-area: 2 / 1 / 3 / 3; font-size: 21px; line-height: 1; }
  /* Every key in the bar is at least 44 x 44. */
  .key { height: 44px; min-width: 44px; justify-content: center; padding: 0 6px; gap: 5px; font-size: 12px; letter-spacing: 0.6px; }
  .key::after { left: 6px; right: 6px; bottom: 10px; }
  .key-lamp::before { width: 7px; height: 7px; }
  .key-week { order: 2; margin-left: 4px; }
  .key-restart { order: 3; height: 44px; margin-left: 6px; padding: 3px 12px 0; }
  .ctls { order: 5; margin-left: -6px; }
  .meters { order: 6; margin: 0 4px 0 auto; gap: 12px; align-items: center; }
  .meters > div { flex-direction: column; align-items: flex-start; gap: 3px; }
  .meters dt { font-size: 12px; letter-spacing: 0.4px; }
  .meters dd { font-size: 21px; line-height: 1; }
  .meters .lg { display: none; }

  /* The board, edge to edge; the hint is one small line at its foot. */
  .board { grid-row: 3; }
  .hint { max-width: calc(100% - 16px); margin: 0 0 6px 8px; padding: 4px 8px 3px; font-size: 12.5px; }
  .ticker { height: 20px; font-size: 12px; }

  /* Departures: three panels in a row, the station's tile, the train and depot, and the seconds. */
  .departures { grid-row: 4; margin: 6px 8px 0; }
  .deps { flex-wrap: wrap; row-gap: 4px; }
  .dp { height: 72px; }
  .dp, .dp.is-lead { flex: 1 1 30%; clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
  .dp.is-lead { clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
  .dp.is-end { clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%); }
  .dp-main { grid-template-rows: minmax(0, 1fr) auto; row-gap: 2px; align-items: start; padding: 7px 0 5px 12px; }
  .dp.is-lead .dp-main { padding-left: 8px; }
  .dp-tile, .dp.is-lead .dp-tile { --ts: 36px; grid-row: 1; margin: 0; }
  .dp-tile::before { inset: 4px -4px -4px 4px; }
  .dp-id { grid-row: 2; font-size: 12px; letter-spacing: 0; word-spacing: -2px; }
  .dp-from, .dp-tag, .dp-name, .dp.is-lead .dp-name, .dp-lbl .lg { display: none; }
  .dp-when, .dp.is-lead .dp-when { min-width: 0; width: 46%; padding: 6px 6px 3px 6px; clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%); }
  .dp.is-end .dp-when { padding-right: 6px; }
  .dp-lbl { font-size: 12px; letter-spacing: 0; line-height: 1.05; white-space: normal; }
  .dp-secs, .dp.is-lead .dp-secs { font-size: 46px; }
  .dp.is-2d .dp-secs, .dp.is-2d.is-lead .dp-secs { font-size: 34px; }
  .dp.is-held .dp-lbl { max-width: none; }
  /* The water train names no station (zan, 2026-10-17): where the tile would be, a WATER tag. */
  .dp.is-water .dp-tile { visibility: hidden; }
  .dp.is-water .dp-main::after { content: 'Water'; position: absolute; left: 12px; top: 16px; padding: 3px 5px 2px; background: #9fd8ff; color: #0a1019; font: 700 12px/1 var(--mono); letter-spacing: 0.5px; text-transform: uppercase; }
  .dp.is-empty .dp-none { margin: auto 0 9px 14px; font-size: 12px; }
  /* Shift 7's Arrays service: a slate line under the three panels. */
  .dp.dp-other { flex: 1 1 100%; height: 26px; clip-path: none; }
  .dp-other .dp-main { display: flex; align-items: center; gap: 8px; padding: 0 0 0 8px; }
  .dp-other .dp-tile { --ts: 16px; grid-row: auto; order: 2; }
  .dp-other .dp-tile::before { display: none; }
  .dp-other .dp-tile b { padding-right: 0; }
  .dp-other .dp-id { order: 1; font-size: 12px; white-space: nowrap; }
  .dp-other .dp-ontime { display: none; }
  .dp-other .dp-name { display: block; order: 3; font: 800 15px/1 var(--display); }
  .dp-other .dp-when { width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 0 8px 0 14px; clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%); }
  .dp-other .dp-lbl { max-width: none; font-size: 12px; white-space: nowrap; }
  .dp-other .dp-note { font-size: 12px; max-width: none; white-space: nowrap; }

  /* Lever keys: one per lever, its number and its two ways, the way it is set lit; amber when it must go now. */
  .keys { grid-row: 5; display: grid; gap: 6px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .levkeys { min-height: 60px; }
  /* A tag (BUSY, JAMMED...) sits tight under the rows on narrow keys, and beside them on wide ones, so the rows keep
     clear of the key's top edge. */
  .lk-tag { margin-top: 2px; padding: 1px 4px 0; }
  .lk.has-tag .lk-rows { gap: 2px; }
  .levkeys[data-n="1"] .lk, .levkeys[data-n="2"] .lk { grid-template-columns: auto auto auto; }
  .levkeys[data-n="1"] .lk-tag, .levkeys[data-n="2"] .lk-tag { grid-area: 2 / 3; align-self: center; margin: 0 0 0 4px; }
  .levkeys[data-n="1"] .lk.has-tag .lk-rows, .levkeys[data-n="2"] .lk.has-tag .lk-rows { align-self: center; gap: 4px; }
  /* With three keys or fewer the tiles get bigger, so "which way" reads under the thumb. */
  :where(.levkeys[data-n="3"]) { min-height: 68px; }
  :where(.levkeys[data-n="3"]) .lk { height: 68px; }
  :where(.levkeys[data-n="3"]) .lk-row { height: 22px; }
  :where(.levkeys[data-n="3"]) .lk-t { width: 22px; height: 22px; font-size: 18px; }
  .overlay { position: fixed; inset: 0; z-index: 20; padding: 12px; }
  .card { padding: 18px 18px 16px; gap: 8px; }
  .card h3 { font-size: 32px; }
  .rep-nums dd { font-size: 22px; }
  .card .marks { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding-top: 8px; }
  .card .mark { font-size: 12px; gap: 6px; }
  .card .lamp { width: 8px; height: 19px; }
  .rep-line, .rep-voice { font-size: 14px; }
  .card .btn { height: 44px; padding: 0 16px; font-size: 15px; }
}
/* The speaker strip (phones, and short screens held sideways): the face whole, a caption with the name, ON AIR and the line. */
@media (max-width: 640px) and (min-height: 561px), (max-width: 1080px) and (orientation: portrait), (orientation: landscape) and (max-height: 560px) {
  .radio-now { grid-row: 2; display: flex; height: 58px; margin: 2px 8px 6px; }
  .air-mini { flex: none; height: 100%; }
  .air-mini .air-meter { height: 3px; gap: 1px; bottom: 4%; }
  .now-talk { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; margin-left: 11px; padding: 3px 10px 4px 10px; background: #2e3b58; }
  .now-talk::before { content: ''; position: absolute; left: -9px; bottom: 9px; width: 10px; height: 12px; background: inherit; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
  .radio-now[data-state="idle"] .now-talk { background: #1f2a40; }
  .radio-now:not([data-who]) .now-talk { background: #121a26; }
  .radio-now:not([data-who]) .now-talk::before, .radio-now:not([data-who]) .now-who { visibility: hidden; }
  .radio-now.is-quiet .now-text { color: #6d7a8c; letter-spacing: 1.5px; text-transform: uppercase; }
  .now-who { display: flex; align-items: center; gap: 8px; margin: 0; }
  .now-name { padding: 2px 6px 1px; background: #05080d; font: 800 14px/1 var(--display); letter-spacing: 1.2px; text-transform: uppercase; color: #dfe4ea; }
  .radio-now[data-who="L"] .now-name { color: var(--amber); }
  .radio-now[data-who="P"] .now-name { color: var(--copper); }
  .radio-now[data-who="S"] .now-name { color: var(--sys); }
  .radio-now .tx { gap: 6px; font-size: 12px; letter-spacing: 1px; }
  .radio-now .tx::before { width: 11px; height: 11px; }
  .now-text { margin: 0; max-height: 2.5em; overflow: hidden; font: 700 13px/1.25 var(--dlg); color: #fff; }
  .radio-now[data-state="idle"] .now-text { color: #c8ced7; }
}
/* Tablets held upright: the phone layout, set larger. */
@media (min-width: 641px) and (max-width: 1080px) and (orientation: portrait) {
  .play-bar { padding: 0 10px 0 18px; }
  .pb-name { height: 54px; }
  .pb-shift, .pb-day { font-size: 13px; }
  .pb-title { font-size: 28px; }
  .key { height: 50px; padding: 0 10px; font-size: 13px; letter-spacing: 1.6px; }
  .key::after { left: 10px; right: 10px; }
  .key-restart { height: 50px; padding: 4px 22px 0; }
  .meters { gap: 24px; }
  .meters dt { font-size: 13px; letter-spacing: 1.2px; }
  .meters dd { font-size: 28px; }
  .meters .lg { display: inline; }
  .radio-now { height: 84px; margin: 4px 16px 10px; }
  .now-talk { padding: 6px 16px 8px 14px; gap: 6px; }
  .now-name { font-size: 19px; }
  .radio-now .tx { font-size: 13px; }
  .radio-now .tx::before { width: 14px; height: 14px; }
  .now-text { font-size: 18px; }
  .hint { font-size: 15px; margin: 0 0 10px 16px; }
  .departures { margin: 10px 16px 0; }
  .dp { height: 104px; }
  .dp-main { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; padding: 10px 0 8px 18px; }
  .dp.is-lead .dp-main { padding-left: 14px; }
  .dp-tile, .dp.is-lead .dp-tile { --ts: 54px; grid-area: 1 / 1; }
  .dp-name, .dp.is-lead .dp-name { display: block; grid-area: 1 / 2; align-self: end; font-size: 19px; }
  .dp-id { grid-area: 2 / 1 / 3 / 3; font-size: 13px; }
  .dp-from { display: inline; }
  .dp-when, .dp.is-lead .dp-when { width: 36%; padding: 10px 16px 4px 12px; }
  .dp-lbl { font-size: 13px; letter-spacing: 1px; }
  .dp-secs, .dp.is-lead .dp-secs { font-size: 70px; }
  .dp.is-2d .dp-secs, .dp.is-2d.is-lead .dp-secs { font-size: 52px; }
  .dp.dp-other { height: 32px; }
  .dp-other .dp-main { display: flex; padding-left: 14px; }
  .dp-other .dp-name { font-size: 17px; }
  .dp-other .dp-lbl, .dp-other .dp-note, .dp-other .dp-id { font-size: 13px; }
  .keys { gap: 8px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .levkeys { gap: 8px; min-height: 80px; }
  .lk { height: 80px; column-gap: 10px; }
  .lk-num, .levkeys[data-n] .lk-num { font-size: 52px; }
  .lk-rows { gap: 6px; }
  .lk-row, .levkeys[data-n] .lk-row { height: 26px; }
  .lk-t, .levkeys[data-n] .lk-t { width: 26px; height: 26px; font-size: 21px; }
  .lk-dot, .levkeys[data-n] .lk-dot { width: 11px; height: 11px; margin-right: 8px; }
  .lk-row.is-on::after { left: 21px; }
  .lk-loop { font-size: 14px; }
  .lk-tag { font-size: 13px; padding: 3px 7px 2px; }
  .lk, .levkeys[data-n] .lk { grid-template-columns: auto auto auto; }
  .lk-tag, .levkeys[data-n] .lk-tag { grid-area: 2 / 3; align-self: center; margin: 0 0 0 6px; }
  .lk.has-tag .lk-rows, .levkeys[data-n] .lk.has-tag .lk-rows { align-self: center; gap: 6px; }
  .mkey { height: 56px; padding: 0 20px; }
  .mk-top { font-size: 13px; }
  .mk-big { font-size: 30px; }
}
/* Short phones (375 x 667 and the like): every row a little tighter, so the board keeps its room; keys stay 44 px. */
@media (max-width: 640px) and (min-height: 561px) and (max-height: 760px) {
  .pb-title { font-size: 20px; }
  .meters dd { font-size: 19px; }
  .radio-now { height: 48px; margin-bottom: 4px; }
  .now-who { display: contents; }
  .now-talk { display: block; padding: 5px 9px 4px; font-size: 12.5px; line-height: 1.3; }
  .now-name { display: inline; margin-right: 6px; font-size: 13px; padding: 1px 5px 0; }
  .now-talk { overflow: hidden; }
  .radio-now .tx { display: inline-flex; vertical-align: -1px; margin-right: 7px; font-size: 0; letter-spacing: 0; gap: 0; }
  .now-text { display: inline; font-size: 12.5px; line-height: 1.3; }
  .departures { margin-top: 4px; }
  .dp { height: 62px; }
  .dp-tile, .dp.is-lead .dp-tile { --ts: 30px; }
  .dp-main { padding-top: 6px; }
  .dp-secs, .dp.is-lead .dp-secs { font-size: 40px; }
  .dp.is-2d .dp-secs, .dp.is-2d.is-lead .dp-secs { font-size: 30px; }
  .dp.is-water .dp-main::after { left: 10px; top: 13px; }
  .keys { gap: 5px; padding-top: 5px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .levkeys { min-height: 54px; }
  .lk { height: 54px; }
  .lk-num { font-size: 34px; }
  .lk-rows { gap: 3px; }
  .lk-row, .lk-t { height: 17px; }
  .lk-t { width: 17px; font-size: 14px; }
  .lk-tag { margin-top: 3px; }
  .mkey { height: 44px; }
  .mk-big { font-size: 21px; }
}
/* A phone (or any short screen) held sideways: one row on top, the speaker strip over the wide board, the departures
   as a narrow column beside it, and the lever keys down the right edge. */
@media (orientation: landscape) and (max-height: 560px) {
  /* A phone held sideways: a shorter box, so the picture keeps more of the screen. */
  .scene { --stage-b: 184px; --sprite-h: min(34vh, 150px); --boxw: calc(100% - 2 * var(--gut)); }
  .scene-box { min-height: 0; padding-top: 22px; }
  .play { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 44px auto minmax(0, 1fr); }
  .band { display: contents; }
  .band > .radio, .band > .martin { display: none; }
  .play-bar { grid-row: 1; grid-column: 1 / -1; flex-wrap: nowrap; padding: 0 6px 0 14px; }
  .play-bar::after { display: none; }
  .pb-name { order: 0; flex: 1 1 auto; height: 44px; display: flex; align-items: center; }
  .pb-shift { font-size: 12px; letter-spacing: 1px; margin-right: 10px; }
  .pb-day, .pb-dot { display: none; }
  .pb-title { font-size: 20px; line-height: 44px; }
  .key { height: 44px; min-width: 44px; justify-content: center; padding: 0 6px; gap: 5px; font-size: 12px; letter-spacing: 0.6px; }
  .key::after { left: 6px; right: 6px; bottom: 10px; }
  .key-lamp::before { width: 7px; height: 7px; }
  .key-week { order: 1; margin-left: 4px; }
  .meters { order: 2; margin: 0 6px 0 auto; padding-left: 8px; gap: 12px; align-items: center; }
  .meters > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .meters dt { font-size: 12px; letter-spacing: 0.4px; }
  .meters dd { font-size: 19px; line-height: 1; }
  .meters .lg { display: none; }
  .ctls { order: 3; margin-left: 0; }
  .key-restart { order: 4; height: 44px; margin-left: 6px; padding: 3px 12px 0; }
  .radio-now { grid-row: 2; grid-column: 1; height: 40px; margin: 0 8px 6px; }
  .now-who { display: contents; }
  .now-talk { display: block; padding: 4px 9px 3px; line-height: 1.3; overflow: hidden; }
  .now-name { display: inline; margin-right: 6px; font-size: 13px; padding: 1px 5px 0; }
  .radio-now .tx { display: inline-flex; vertical-align: -1px; margin-right: 7px; font-size: 0; letter-spacing: 0; gap: 0; }
  .now-text { display: inline; font-size: 12.5px; line-height: 1.3; }
  .board { grid-row: 3; grid-column: 1; }
  .hint { max-width: calc(100% - 16px); margin: 0 0 6px 8px; padding: 4px 8px 3px; font-size: 12.5px; }
  .ticker { height: 20px; font-size: 12px; }
  .departures { grid-row: 2 / 4; grid-column: 2; width: clamp(108px, 16vw, 128px); margin: 0 6px 8px 0; }
  .deps { flex-direction: column; gap: 4px; }
  .dp, .dp.is-lead { flex: 1 1 0; min-height: 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%); }
  .dp.is-end { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%); }
  .dp-main { grid-template-rows: minmax(0, 1fr) auto; row-gap: 2px; align-items: start; padding: 6px 0 5px 8px; }
  .dp-tile, .dp.is-lead .dp-tile { --ts: 30px; grid-row: 1; margin: 0; }
  .dp-tile::before { inset: 4px -4px -4px 4px; }
  .dp-id { grid-row: 2; font-size: 12px; letter-spacing: 0; word-spacing: -2px; white-space: nowrap; }
  .dp-from, .dp-tag, .dp-name, .dp.is-lead .dp-name, .dp-lbl .lg { display: none; }
  .dp-when, .dp.is-lead .dp-when { min-width: 0; width: 48%; padding: 5px 6px 3px 4px; clip-path: none; }
  .dp-lbl { font-size: 12px; letter-spacing: 0; line-height: 1.05; white-space: normal; }
  .dp-secs, .dp.is-lead .dp-secs { font-size: 36px; }
  .dp.is-2d .dp-secs, .dp.is-2d.is-lead .dp-secs { font-size: 28px; }
  .dp.is-held .dp-lbl { max-width: none; }
  .dp.is-water .dp-main::after { content: 'Water'; position: absolute; left: 6px; top: 40px; padding: 2px 4px 1px; background: #9fd8ff; color: #0a1019; font: 700 12px/1 var(--mono); text-transform: uppercase; }
  .dp.is-empty .dp-none { margin: auto 0 8px 10px; font-size: 12px; }
  .dp.dp-other { flex: 0 0 auto; height: auto; padding: 4px 0; }
  .dp-other .dp-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 0 0 0 8px; }
  .dp-other .dp-tile { --ts: 16px; order: 2; }
  .dp-other .dp-tile::before { display: none; }
  .dp-other .dp-tile b { padding-right: 0; }
  .dp-other .dp-id { order: 1; font-size: 12px; }
  .dp-other .dp-ontime, .dp-other .dp-when { display: none; }
  .dp-other .dp-name { display: block; order: 3; font: 800 14px/1 var(--display); }
  .keys { grid-row: 2 / 4; grid-column: 3; display: flex; flex-direction: column; gap: 5px; width: clamp(96px, 15vw, 128px); padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px)) 0; }
  .levkeys { flex: 1 1 0; min-height: 0; flex-direction: column; gap: 5px; }
  .levkeys .lk, .levkeys[data-n="1"] .lk { flex: 1 1 0; height: auto; min-height: 44px; max-height: 92px; }
  .lk-num { font-size: 34px; }
  .mkey { flex: none; height: 52px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 0 10px; }
  .mk-big { font-size: 18px; }
  .overlay { grid-column: 1 / -1; padding: 10px; }
  /* The report, wide and low, so it fits between the top row and the foot of a sideways phone. */
  .card { width: min(640px, 100%); padding: 12px 16px; gap: 6px; }
  .rep-nums div { padding: 4px 8px; }
  .rep-nums dd { font-size: 20px; }
  .rep-voice { margin-top: 0; padding: 6px 10px; }
  .card-acts { margin-top: 0; }
}
/* A small phone held sideways: the shift's number gives its room to the shift's name. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 760px) {
  .pb-shift { display: none; }
}
/* The narrowest phones (320 px): the departures' ids keep their depot. */
@media (max-width: 340px) and (min-height: 561px) {
  .dp-main { padding-left: 9px; }
  .dp-id { word-spacing: -3px; }
}

/* zan (2026-10-16): the cards (after the shift, paused) and the audio window drawn bigger on big screens (zoom scales the whole
   card, its type and buttons together). */
@media (min-width: 1300px) and (min-height: 860px) { .card, .mixer { zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1050px) { .card, .mixer { zoom: 1.4; } }
@media (min-width: 2400px) and (min-height: 1150px) { .card { zoom: 1.5; } .mixer { zoom: 1.6; } }

/* zan (2026-10-16): four departures on wide screens, the next train big and the other three a bit smaller. */
@media (min-width: 1241px) and (min-height: 561px) {
  .dp.is-lead { flex-grow: 1.55; }
  .dp:not(.is-lead) .dp-main { padding-left: 18px; padding-right: 4px; }
  .dp:not(.is-lead) .dp-when { min-width: 0; padding: 10px 14px 4px 18px; }
  .dp.is-end:not(.is-lead) .dp-when { padding-right: 18px; }
  .dp:not(.is-lead) .dp-id { font-size: 13px; }
  .dp:not(.is-lead) .dp-from { display: none; }
  .dp:not(.is-lead):not(.dp-other) .dp-tile { --ts: calc(var(--band) * 0.3); }
  .dp:not(.is-lead):not(.dp-other) .dp-name { font-size: calc(var(--band) * 0.092); letter-spacing: 0.2px; }
  .dp:not(.is-lead) .dp-secs { font-size: calc(var(--band) * 0.42); }
  .dp.is-2d:not(.is-lead) .dp-secs { font-size: calc(var(--band) * 0.32); }
  .dp:not(.is-lead) .dp-lbl { font-size: 11px; letter-spacing: 0.6px; }
}
/* Laptops: the radio gives the four panels more room, and the small panels' names get smaller. */
@media (min-width: 1241px) and (max-width: 1600px) and (min-height: 561px) {
  .radio { flex-basis: 40%; }
  .martin:not([hidden]) + .radio { flex-basis: 36%; }
  .dp-other { flex-grow: 1.15; }
  .dp-other .dp-main { padding-left: 14px; }
  .dp-other .dp-when { padding: 10px 12px 4px 10px; }
  .dp-other .dp-id, .dp-other .dp-note { font-size: 12px; letter-spacing: 0; }
  .dp:not(.is-lead) .dp-main { padding-left: 16px; }
  .dp:not(.is-lead) .dp-when { padding: 10px 10px 4px 14px; }
  .dp:not(.is-lead):not(.dp-other) .dp-tile { --ts: calc(var(--band) * 0.27); }
  .dp:not(.is-lead):not(.dp-other) .dp-name { font-size: calc(var(--band) * 0.078); letter-spacing: 0; }
  .dp:not(.is-lead) .dp-secs { font-size: calc(var(--band) * 0.38); }
  .dp:not(.is-lead) .dp-lbl .lg { display: none; }
}

/* zan (2026-10-16, laid out at 2560 wide in the editable copy): on big screens the title screen's buttons and the
   shift brief are drawn bigger. Title 1.79x (font-size above), Start 1.61x, Audio 1.39x, Start over 2.11x; the brief
   1.5x, its intro and the platforms line a further 1.25x, the target, Take the levers and Week 1.5x. */
@media (min-width: 1300px) and (min-height: 760px) {
  .brief-intro { font-size: 19px; }
  .brief-goal { font-size: 22px; }
  .brief-copy .acts { zoom: 1.5; }
  .brief-board figcaption { font-size: 16px; }
  .brief .bar .ctl { zoom: 1.15; }
}
@media (min-width: 1300px) and (min-height: 800px) {
  #weekGo { zoom: 1.2; }
  .week-acts .ctl { zoom: 1.12; }
  .week-links .link { font-size: 18px; }
  .week-reset, .week-done { zoom: 1.2; }
}
@media (min-width: 1800px) and (min-height: 1000px) {
  #weekGo { zoom: 1.4; }
  .week-acts .ctl { zoom: 1.25; }
  .week-links .link { font-size: 23px; }
  .week-reset, .week-done { zoom: 1.4; }
  .brief-grid { zoom: 1.25; }
  .brief .bar .ctl { zoom: 1.3; }
}
@media (min-width: 2400px) and (min-height: 1150px) {
  #weekGo { zoom: 1.61; }
  .week-acts .ctl { zoom: 1.39; }
  .week-links .link { font-size: 29.5px; }
  .week-reset, .week-done { zoom: 1.6; }
  .brief-grid { zoom: 1.5; }
  .brief .bar .ctl { zoom: 1.5; }
}

/* zan (2026-10-16): the departure shows only its depot, twice the size, and "Leaves in" 1.5x. */
@media (min-width: 1081px) and (min-height: 561px) {
  .dp:not(.dp-other) .dp-id { font-size: 30px; letter-spacing: 0.02em; line-height: 1; }
  .dp:not(.is-lead):not(.dp-other) .dp-id { font-size: 24px; }
  .dp:not(.dp-other) .dp-lbl { font-size: 19.5px; letter-spacing: 0.06em; }
  .dp:not(.is-lead):not(.dp-other) .dp-lbl { font-size: 16px; letter-spacing: 0.04em; }
}
@media (min-width: 1081px) and (max-width: 1600px) and (min-height: 561px) {
  .dp:not(.dp-other) .dp-id { font-size: 24px; }
  .dp:not(.is-lead):not(.dp-other) .dp-id { font-size: 20px; }
  .dp:not(.dp-other) .dp-lbl { font-size: 16px; }
  .dp:not(.is-lead):not(.dp-other) .dp-lbl { font-size: 13px; letter-spacing: 0.02em; }
}

/* Paul's note before the eighth briefing (zan, 2026-10-17): big uneven capitals in marker, not Martin's hand. */
.note-card { display: grid; gap: 14px; width: min(520px, 100%); margin: 0 auto; }
.note-intro { margin: 0; color: var(--ink-2); font-size: 16px; }
.pnote {
  margin: 4px 0 8px; padding: 16px 20px 12px; background: var(--paper) var(--grain); background-blend-mode: multiply; color: #1d2633;
  transform: rotate(1.2deg); box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.45); animation: noteIn .35s ease-out;
}
.pnote p { margin: 0 0 8px; font: 400 24px/1.2 'Permanent Marker', var(--hand); letter-spacing: 0.02em; }
.pnote p:nth-child(2) { transform: rotate(-1.6deg); transform-origin: left; font-size: 20px; }
/* Martin's lever alone (it takes two hands): pressed, it shakes and flashes red, and doesn't move. */
.martin.refused { animation: shake .3s; box-shadow: inset 0 0 0 3px var(--stop); }
@media (prefers-reduced-motion: reduce) { .martin.refused { animation: none; } }

/* zan (2026-10-23): no "Shift N/12" in the bar; the Menu key stands where it was, first on the left, in every layout. */
.play-bar .key-week { order: -1; margin-left: 0; margin-right: clamp(8px, 1.4vw, 22px); }
/* With nothing before it now, the date on a phone needs no leading dot. */
.pb-name .pb-day::before { content: none; }
