/* k5view console - cassette-futurism hardware console (approved style proof 2026-10-27, spec section 8).
   No inline styles anywhere (CSP style-src 'self'): every look is a class here; JS only toggles classes or sets
   CSSOM properties. Motion is 12 fps steps() only; prefers-reduced-motion switches flicker, snow and typing off. */

@font-face { font-family: "VT323"; src: url("fonts/vt323-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Departure Mono"; src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
/* Chinese on the CRT screens: Fusion Pixel 12px (simplified). One font pixel is 1/12 em, VT323's is about 0.08 em, so
   at 96 % the two pixel grids match at any font size. Only CJK ranges come from it: Latin, digits and symbols stay
   VT323 / Departure Mono. The hardware labels (IBM Plex Mono, 10-14 px) keep the system CJK font: a 12 px pixel font
   shrunk below its own size turns to mush. The file is a subset (GB2312 + the repo's own CJK, ../subset_font.py); a
   character outside it falls back, alone, to the system font. */
@font-face { font-family: "Fusion Pixel"; src: url("fonts/fusion-pixel-12px-zh_hans-subset.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; size-adjust: 96%;
  unicode-range: U+2E80-2FDF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF; }

:root {
  color-scheme: dark;
  --bg: #11120f;
  --ink: #e9e4d4;
  --charcoal: #2d2f2a;
  --olive: #4b5237;
  --beige: #cbc1a0;
  --s1: #E3A33B;
  --s2: #D9652B;
  --s3: #8C3A1E;
  --amber: #FFB23E;
  --amber-dim: #C98A2B;
  --red: #FF3B2F;
  --crt-bg: #050806;
  /* phosphor (green default; body.ph-amber swaps) */
  --ph: #74FF9A;
  --ph-dim: #49B86A;
  --ph-line: rgba(116, 255, 154, .35);
  --ph-off: #10261a;
  --acc: #FFB23E;
  --acc-dim: #C98A2B;
  --acc-off: #2e200d;
  --cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --f-plex: "IBM Plex Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", ui-monospace, monospace;
  --f-vt: "VT323", "Departure Mono", "Fusion Pixel", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", ui-monospace,
    monospace;
  --f-dm: "Departure Mono", "IBM Plex Mono", "Fusion Pixel", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    ui-monospace, monospace;
}
body.ph-amber {
  --ph: #FFB23E;
  --ph-dim: #C98A2B;
  --ph-line: rgba(255, 178, 62, .35);
  --ph-off: #2a1d0c;
  --acc: #74FF9A;
  --acc-dim: #49B86A;
  --acc-off: #10261a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--f-plex); font-size: 14px; line-height: 1.35;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
small { font-size: .78em; }

.wrap {
  max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: 20px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
}

/* ------------------------------------------------------------------ hardware */
.casing { background: var(--beige); border: 2px solid #191a16;
  box-shadow: inset 0 2px 0 #e3dabb, inset 0 -4px 0 #a1977a, 0 5px 0 #0a0b09; }
.panel { background: var(--charcoal); border: 2px solid #121310;
  box-shadow: inset 0 1px 0 #464940, inset 0 -3px 0 #1c1d1a, 0 5px 0 #0a0b09; }
.olive { background: var(--olive); border: 2px solid #15170f;
  box-shadow: inset 0 1px 0 #656d4d, inset 0 -3px 0 #343924, 0 5px 0 #0a0b09; }

.screw { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #8f8b7c;
  border: 1px solid #23241f; box-shadow: inset 0 1px 0 #cdc9b6, inset 0 -1px 1px #4a4940; }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; background: #2b2b26; }
.screw.tl { left: 6px; top: 6px; }
.screw.tr { right: 6px; top: 6px; }
.screw.bl { left: 6px; bottom: 6px; }
.screw.br { right: 6px; bottom: 6px; }
.screw.ra { transform: rotate(20deg); }
.screw.rb { transform: rotate(-35deg); }
.screw.rc { transform: rotate(70deg); }
.screw.rd { transform: rotate(5deg); }
.screw.re { transform: rotate(-15deg); }
.screw.rf { transform: rotate(40deg); }
.screw.rg { transform: rotate(85deg); }
.screw.rh { transform: rotate(-60deg); }

.tape { display: inline-block; background: #141412; color: #efebdf;
  font: 600 11px/1.3 var(--f-plex); letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 2px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 #000;
  text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255, 255, 255, .2); }
.tape-xl { font-size: 24px; letter-spacing: .24em; padding: 4px 12px; }
.tape-s { font-size: 9px; padding: 2px 5px; }
.tape-amb { background: #2a1d0c; color: #FFD9A0; }
.tape-grn { background: #1d2618; color: #d4ebc8; }
.tape-rust { background: #3a1a0e; color: #FFD9A0; }
.tape-dim { background: #2a2b26; color: #d8d2bf; }
.tape.is-lit { background: #3a1a0e; color: var(--amber); }
.tape-cn { text-transform: none; letter-spacing: .06em; }

.stripes { display: flex; height: 48px; transform: skewX(-18deg); flex: 0 0 auto; }
.stripes span { display: block; width: 15px; }
.c1 { background: var(--s1); }
.c2 { background: var(--s2); }
.c3 { background: var(--s3); }
.tri { display: flex; height: 6px; }
.tri span { display: block; flex: 1 1 0; }

/* ------------------------------------------------------------------ CRT */
.crt { position: relative; background: var(--crt-bg); border: 3px solid #0b0c0a; border-radius: 14px; overflow: hidden;
  box-shadow: inset 0 0 0 2px #1b1d19, 0 0 0 4px #23251f; color: var(--ph); min-width: 0; }
.crt-r4 { border-radius: 4px; }
.crt-r6 { border-radius: 6px; }
.crt-r8 { border-radius: 8px; }
.vt { font-family: var(--f-vt); }
.dm { font-family: var(--f-dm); }
.glow { text-shadow: 0 0 1px currentColor, 0 0 6px currentColor; }
@supports (color: color-mix(in srgb, red 50%, transparent)) {
  .glow { text-shadow: 0 0 1px currentColor, 0 0 7px color-mix(in srgb, currentColor 55%, transparent); }
}
.scan { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .42) 0 1px, rgba(0, 0, 0, 0) 1px 3px); }
body.noscan .scan { display: none; }
.vig { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 110px 28px rgba(0, 0, 0, .88); }
.vig-s { box-shadow: inset 0 0 40px 10px rgba(0, 0, 0, .85); }
.snow { background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .5) 0 1px, rgba(0, 0, 0, 0) 1px 3px, rgba(0, 0, 0, .65) 3px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 1px, rgba(0, 0, 0, 0) 1px 4px, rgba(0, 0, 0, .5) 4px 5px),
    repeating-linear-gradient(37deg, rgba(0, 0, 0, .7) 0 2px, rgba(255, 255, 255, .3) 2px 3px, rgba(0, 0, 0, 0) 3px 7px),
    repeating-linear-gradient(121deg, rgba(255, 255, 255, .35) 0 1px, rgba(0, 0, 0, 0) 1px 5px, rgba(0, 0, 0, .4) 5px 6px);
  background-size: 7px 11px, 13px 5px, 23px 17px, 19px 29px;
  animation: snow .25s steps(1, end) infinite; }
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .07; }
.static { position: absolute; inset: 0; z-index: 4; background-color: #1b1d1a; pointer-events: none; }
.roll { position: absolute; left: 0; right: 0; height: 22%; background: rgba(0, 0, 0, .5);
  animation: roll .5s steps(6, end) infinite; }
.boot { animation: boot 1s steps(1, end) both; }
.flick { animation: flick 7s steps(1, end) infinite; }
.boot.flick { animation: boot 1s steps(1, end) both, flick 7s steps(1, end) 1s infinite; }
.cursor { display: inline-block; width: .55em; height: .85em; margin-left: 4px; vertical-align: -.02em;
  background: currentColor; animation: blink 1s steps(1, end) infinite; }
.frames { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; vertical-align: top; }
.frames span { display: block; line-height: 1em; white-space: pre; animation: frames 1s steps(12, end) infinite; }

.crt-body { position: relative; padding: 20px 24px 26px; display: flex; flex-direction: column; gap: 18px;
  font-size: 22px; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.crt-s { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 20px; line-height: 1.15;
  border-radius: 8px; overflow-wrap: anywhere; }
.crt-main { min-height: 420px; }

/* ------------------------------------------------------------------ lamps, segments */
.lamp { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0d0e0c;
  background: #2a2c25; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); }
.lamp.ok { background: #5CF08A; box-shadow: 0 0 7px 1px rgba(92, 240, 138, .65); }
.lamp.warn { background: #FFB23E; box-shadow: 0 0 7px 1px rgba(255, 178, 62, .6); }
.lamp.alarm { background: var(--red); box-shadow: 0 0 8px 2px rgba(255, 59, 47, .7); }
.lamp.alarm-off { background: #4a1612; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); }
.lamp-s { width: 10px; height: 10px; border-width: 1px; }

.segs { display: flex; gap: 2px; min-width: 0; }
.seg { display: block; flex: 1 1 0; min-width: 3px; height: 14px; background: var(--ph-off); }
.segs-s .seg { height: 10px; }
.seg.on { background: var(--ph); }
.seg.acc { background: var(--acc); }
.seg.acc-off { background: var(--acc-off); }

/* ------------------------------------------------------------------ controls */
.key { min-width: 72px; min-height: 52px; padding: 4px 12px; background: #d6ccab; color: #141412;
  border: 2px solid #171814; border-bottom-width: 7px; border-radius: 2px;
  font: 700 12px/1.1 var(--f-plex); letter-spacing: .14em; cursor: pointer; text-decoration: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.key:active, .key[aria-pressed="true"] { border-bottom-width: 3px; transform: translateY(4px); background: #c3b994; }
.key .led { display: block; width: 18px; height: 4px; background: #3b2b11; }
.key[aria-pressed="true"] .led, .key.is-on .led { background: var(--amber); box-shadow: 0 0 6px rgba(255, 178, 62, .85); }
.key .sub { font-size: 10px; font-weight: 600; letter-spacing: .04em; font-family: var(--f-plex); }
.key:disabled, .key[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.key-xl { min-width: 220px; min-height: 64px; font-size: 15px; }
.key:focus-visible, .knob:focus-visible, .toggle:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.keys { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.knob { position: relative; width: 76px; height: 76px; padding: 0; border-radius: 50%; border: 3px solid #0b0c0a;
  cursor: pointer; background-color: #24261f;
  background-image: repeating-conic-gradient(#191a16 0 6deg, #3c3f35 6deg 12deg);
  box-shadow: 0 5px 0 #0a0b09; transform: rotate(-40deg); transition: transform .17s steps(2, end); }
.knob.is-live { transform: rotate(40deg); }
.knob::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #34372e;
  box-shadow: inset 0 1px 0 #555a4d, inset 0 -2px 0 #22241e; }
.knob::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 24px; margin-left: -2px;
  background: var(--amber); }
.knobbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.knob-labels { display: flex; justify-content: space-between; width: 128px; }

.toggle { position: relative; width: 46px; height: 64px; padding: 0; background: #bdb395; border: 2px solid #171814;
  border-radius: 3px; cursor: pointer; box-shadow: inset 0 2px 0 #dad1b1, 0 4px 0 #0a0b09; }
.toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -12px 0 0 -12px;
  border-radius: 50%; background: #5c5e57; border: 2px solid #1d1e1a; box-shadow: inset 0 1px 0 #9a9c94; }
.lever { position: absolute; left: 50%; bottom: 50%; width: 6px; height: 25px; margin-left: -3px; background: #cfd0c9;
  border: 1px solid #2a2b27; transform-origin: 50% 100%; transition: transform .17s steps(2, end); }
.lever::after { content: ""; position: absolute; left: 50%; top: -7px; width: 13px; height: 13px; margin-left: -7px;
  border-radius: 50%; background: #ecede6; border: 1px solid #2a2b27; }
.toggle[aria-pressed="true"] .lever { transform: rotate(180deg); }

.vstack { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.vstack-c { display: flex; flex-direction: column; align-items: center; gap: 5px; }

/* ------------------------------------------------------------------ header */
.hdr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 26px; }
.clock { border-radius: 6px; padding: 7px 14px 5px; color: var(--amber); font-size: 26px; line-height: 1;
  white-space: nowrap; display: flex; flex-direction: column; gap: 3px; }
.clock-bj { font-size: 13px; color: var(--amber-dim); letter-spacing: .04em; }
.hdr-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 18px;
  flex: 1 1 300px; min-width: 0; }
.lamps { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 18px; }
.maskctl { display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.maskctl-labels { display: flex; flex-direction: column; justify-content: space-between; height: 64px; padding-top: 18px; }

/* ------------------------------------------------------------------ banner */
.banner { border-radius: 4px; padding: 10px 18px; color: var(--amber); font-size: 22px; line-height: 1.15; }
.bn { position: relative; display: flex; flex-direction: column; gap: 6px; }
.bn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; min-width: 0; }
.bn-read { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; flex: 1 1 340px; min-width: 0; }
.bn-read .segs { flex: 1 1 140px; min-width: 100px; }
.bn-read.is-other { opacity: .62; }
.bn-v { color: var(--ph); }
.bn-note { font-size: 16px; color: var(--amber-dim); }
.bn-err { color: var(--amber); }

/* ------------------------------------------------------------------ control strip */
.ctl { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 18px 26px; }
.fresh { flex: 1 1 380px; border-radius: 4px; padding: 8px 14px; font-size: 19px; line-height: 1.25; }
.fresh-in { position: relative; display: flex; flex-direction: column; gap: 4px; }
.fr-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fi { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fi-w { white-space: normal; }

/* ------------------------------------------------------------------ module grid */
.grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-main { flex: 999 1 660px; }
.col-side { flex: 1 1 420px; }
.mod { position: relative; padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel.mod { padding: 18px 20px 20px; gap: 12px; }
.mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.mod-head .tri { flex: 1 1 120px; min-width: 80px; }
.mod-head .lamp { margin-left: auto; }
.pbody { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mod-keys { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mod-keys .tape { margin-right: 4px; }

/* ------------------------------------------------------------------ CRT content */
.dim { color: var(--ph-dim); }
.eq-note { font-size: 15px; line-height: 1.25; margin-top: 4px; }
.acc { color: var(--acc); }
.st { font-size: 18px; color: var(--ph-dim); border-bottom: 1px solid var(--ph-line); padding-bottom: 3px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.sec { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hl { font-size: 22px; }
.err { color: var(--acc); }
.ro { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rd { border: 1px solid var(--ph-line); padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rd .l { font-size: 18px; color: var(--ph-dim); }
.rd .v { font-size: 44px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd .s { font-size: 18px; color: var(--ph-dim); }
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; }
.bar { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bar-h { display: flex; justify-content: space-between; gap: 8px; font-size: 18px; }
.bar-h .l { color: var(--ph-dim); }
.kvs { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 19px; }
.kv { white-space: nowrap; }
.kv-w { white-space: normal; }
.kv .k { color: var(--ph-dim); }
.two { display: flex; flex-wrap: wrap; gap: 16px 26px; }
.two > * { flex: 1 1 300px; min-width: 0; }
.two-s > * { flex-basis: 150px; }
.tm .bj, .bj { color: var(--ph-dim); font-size: .72em; margin-left: .35em; white-space: nowrap; }
.L { color: var(--ph); }
.S { color: var(--acc); }
.lv-warning { color: var(--acc); }
.lv-critical { color: var(--acc); }
.neg { color: var(--acc); }

.tw { overflow: auto; max-height: 460px; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tw-tall { max-height: 620px; }
table.t { border-collapse: collapse; font-size: 19px; line-height: 1.15; white-space: nowrap; }
table.t th { color: var(--ph-dim); font-weight: normal; text-align: left; padding: 0 1.2ch 3px 0;
  border-bottom: 1px solid var(--ph-line); position: sticky; top: 0; background: var(--crt-bg); z-index: 1; }
table.t td { padding: 1px 1.2ch 1px 0; vertical-align: top; }
table.t .n { text-align: right; }
table.t th.n { text-align: right; }
table.t td.wrap { white-space: normal; min-width: 24ch; max-width: 60ch; }
table.t tr.is-new td { color: var(--acc); }
table.t button.th { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }

.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; flex-direction: column; gap: 1px; padding-bottom: 5px; border-bottom: 1px dotted var(--ph-line); }
.item:last-child { border-bottom: 0; }
.item-h { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.ev { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 19px; line-height: 1.15; }
.ev .k { color: var(--ph-dim); }

.nocarrier { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 0 12px; text-align: center; }
.cbars { display: flex; width: 100%; max-width: 600px; height: 132px; border: 2px solid var(--ph-line); }
.cbars span { flex: 1 1 0; }
.cbars .b1 { background: var(--beige); }
.cbars .b2 { background: var(--s1); }
.cbars .b3 { background: var(--s2); }
.cbars .b4 { background: var(--s3); }
.cbars .b5 { background: var(--olive); }
.cbars .b6 { background: var(--charcoal); }
.cbars .b7 { background: var(--ph); }
.nc-big { font-size: 72px; line-height: 1; color: var(--amber); }
.nc-sub { font-size: 30px; color: var(--amber); }
.nc-txt { font-size: 22px; color: var(--ph-dim); line-height: 1.3; }

/* lamp rows on the panels (outside the CRTs) */
.lrow { display: flex; align-items: center; gap: 10px; min-height: 26px; min-width: 0; }
.lrow .tape { min-width: 92px; text-align: center; flex: 0 0 auto; }
.lrow .v { flex: 1 1 auto; min-width: 0; font-size: 13px; color: #ddd7c3; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.lrow .a { font-size: 13px; color: #b3ad98; white-space: nowrap; flex: 0 0 auto; }
.pnote { font-size: 12px; color: #b3ad98; letter-spacing: .06em; overflow-wrap: anywhere; }

/* charts */
.chart { display: block; width: 100%; height: 220px; }
.chart-bars { height: 150px; }

/* auth screens */
.scr { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.authbox { max-width: 860px; width: 100%; margin: 0 auto; }
.auth-crt .crt-body { min-height: 300px; justify-content: center; }
.big { font-size: 56px; line-height: 1; }
.msg { min-height: 1.3em; font-size: 22px; }
.msg.ok { color: var(--ph); }
.msg.err { color: var(--acc); }
.hint { font-size: 18px; color: var(--ph-dim); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ------------------------------------------------------------------ keyframes (12 fps, steps only) */
@keyframes snow { 0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  33.33% { background-position: 3px 5px, -7px 2px, 11px -4px, -5px 9px; }
  66.67% { background-position: -4px 2px, 5px -6px, -8px 7px, 12px -3px; }
  100% { background-position: 0 0, 0 0, 0 0, 0 0; } }
@keyframes roll { from { top: -22%; } to { top: 100%; } }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes frames { from { transform: translateY(0); } to { transform: translateY(-12em); } }
@keyframes flick { 0% { opacity: 1; } 46% { opacity: .93; } 47% { opacity: 1; } 80% { opacity: .97; } 81% { opacity: 1; }
  100% { opacity: 1; } }
@keyframes boot { 0% { opacity: 0; transform: scaleY(.006); }
  8.33% { opacity: 1; transform: scaleY(.006); filter: brightness(4); }
  16.67% { transform: scaleY(.06); filter: brightness(3); }
  25% { opacity: .9; transform: scaleY(1); filter: brightness(2.4); }
  33.33% { opacity: .2; transform: none; }
  41.67% { opacity: 1; filter: brightness(1.6); }
  50% { opacity: .55; }
  58.33% { opacity: 1; }
  66.67% { filter: brightness(1.3); }
  75% { opacity: .8; }
  83.33% { opacity: 1; }
  91.67% { filter: brightness(1.1); }
  100% { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .snow, .roll, .flick, .boot, .boot.flick, .cursor, .frames span { animation: none; }
  .knob, .lever { transition: none; }
}

/* ------------------------------------------------------------------ phone (390 px class) */
@media (max-width: 760px) {
  .wrap { gap: 12px; padding-top: 12px; }
  .hdr { padding: 16px 18px; gap: 10px 14px; }
  .tape-xl { font-size: 20px; }
  .stripes { height: 36px; }
  .clock { font-size: 22px; }
  .hdr-right { justify-content: flex-start; flex-basis: 100%; }
  .lamps { justify-content: flex-start; gap: 10px 12px; }
  .banner { padding: 8px 12px; font-size: 19px; }
  .bn-row { gap: 4px 14px; }
  .bn-note { font-size: 15px; }
  .ctl { padding: 16px 14px; gap: 12px; }
  .ctl .keys { gap: 8px; }
  .key { min-width: 48px; min-height: 48px; padding: 4px 8px; letter-spacing: .08em; }
  .fresh { font-size: 17px; flex-basis: 100%; }
  .mod { padding: 16px 12px 16px; }
  .panel.mod { padding: 16px 12px 16px; }
  .crt-body { padding: 14px 12px 18px; font-size: 20px; gap: 14px; }
  .crt-s { padding: 8px 10px 10px; font-size: 18px; }
  .crt-main { min-height: 300px; }
  .rd .v { font-size: 34px; }
  .rd .l, .rd .s, .st, .bar-h { font-size: 16px; }
  .kvs, table.t, .ev { font-size: 17px; }
  .tw { max-height: 65vh; }
  /* lamp rows: the time aside goes onto its own line under the text, so the text keeps the row's width */
  .lrow { align-items: flex-start; flex-wrap: wrap; row-gap: 2px; }
  .lrow .v { flex: 1 1 calc(100% - 140px); white-space: normal; overflow-wrap: anywhere; }
  .lrow .tape { min-width: 76px; }
  .lrow .a { flex-basis: 100%; padding-left: 110px; white-space: normal; }
  .lrow .a:empty { display: none; }
  .big { font-size: 40px; }
  .nc-big { font-size: 48px; }
  .nc-sub { font-size: 24px; }
  .cbars { height: 90px; }
  .chart { height: 180px; }
  .chart-bars { height: 130px; }
  .grid .mod:not(.is-sel) { display: none; }
  .col.is-empty-phone { display: none; }
}
@media (min-width: 761px) {
  .grid .mod.is-off { display: none; }
  .col.is-empty { display: none; }
}
