/* Lightbox & Annunciator — operating surfaces are dark instrument panel, reading surfaces are paper. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--lampblack); color: var(--bone);
  font: 400 var(--t-15)/1.45 var(--font-ui); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }
small { font-size: var(--t-12); color: var(--ash); }
:focus-visible { outline: 2px solid var(--film); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { min-height: 44px; display: grid; place-items: center; position: absolute; left: var(--s-3); top: -60px; z-index: 50; padding: var(--s-2) var(--s-3); background: var(--bone); color: var(--ink); }
.skip:focus { top: var(--s-2); }

/* status = colour + icon + word */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--t-13); white-space: nowrap; }
.st .glyph { flex: none; }
.st[data-tier="normal"] { color: var(--calm); }
.st[data-tier="attention"] { color: var(--amber); }
.st[data-tier="critical"] { color: var(--alarm); }
.st[data-tier="none"] { color: var(--ash); }
.stamp { font-style: normal; font-size: var(--t-12); color: var(--ash); border: 1px dashed currentColor; padding: 0 5px; border-radius: var(--radius); white-space: nowrap; }
.ic { flex: none; vertical-align: -1px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4); border-radius: var(--radius);
  font-weight: 600; font-size: var(--t-15); white-space: nowrap;
  transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out), border-color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--bone); color: var(--ink); }
.btn-line { border: 1px solid var(--ash); }
.btn-quiet { color: var(--ash); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; padding: 0 var(--s-2); }
.btn-ack { min-height: 40px; margin-top: var(--s-2); border: 1px solid var(--alarm); color: var(--alarm); }
.btn-log { min-height: 36px; padding: 0 var(--s-3); font-size: var(--t-13); border: 1px solid var(--rule); }
@media (hover: hover) {
  .btn-solid:hover { background: #fff; }
  .btn-line:hover, .btn-log:hover { border-color: var(--bone); }
  .btn-quiet:hover { color: var(--bone); }
  .btn-ack:hover { background: var(--alarm); color: var(--ink); }
}
.linklike { text-decoration: underline; text-underline-offset: 3px; color: var(--bone); }

/* ---------- top bar: one row ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--s-4); min-height: 60px; padding: var(--s-2) var(--s-5);
  border-bottom: 1px solid var(--rule); background: var(--anodized);
}
.topbar small { display: block; line-height: 1.2; }
.topbar b { font-weight: 600; }
.tb-file { display: flex; align-items: center; gap: var(--s-2); }
.tb-mark { width: 28px; height: 28px; color: var(--film); flex: none; }
.tb-file h1 { font: 500 var(--t-18)/1.2 var(--font-read); letter-spacing: -.005em; }
.tb-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.tb-icons { display: flex; align-items: center; }
.tb-langs { display: flex; align-items: center; margin-right: var(--s-1); }
.tb-lang { min-width: 36px; height: 44px; font-size: var(--t-12); font-weight: 600; letter-spacing: .04em; color: var(--ash); }
.tb-lang + .tb-lang { position: relative; }
.tb-lang + .tb-lang::before { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; border-left: 1px solid var(--rule); }
.tb-lang[aria-pressed="true"] { color: var(--bone); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.tb-lang:hover { color: var(--bone); }
html.i18n-wait body { visibility: hidden; }
.tb-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--ash); border-radius: var(--radius); transition: color var(--d-hover) var(--ease-out); }
@media (hover: hover) { .tb-ic:hover { color: var(--bone); } }
.tb-sound[aria-pressed="true"] { color: var(--bone); }
.tb-sound .snd-on, .tb-sound[aria-pressed="true"] .snd-off { display: none; }
.tb-sound[aria-pressed="true"] .snd-on { display: inline; }
.tb-guide { min-height: 44px; padding: 0 var(--s-3); text-decoration: none; }
.tb-crew small, .tb-day small { white-space: nowrap; }
.tb-crew { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); border-radius: var(--radius); text-align: left; line-height: 1.25; }
.tb-crew b { display: block; max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-crew svg { flex: none; color: var(--ash); }
@media (hover: hover) { .tb-crew:hover { background: var(--anodized-2); } }
.tb-day b { font-size: var(--t-18); font-stretch: 112%; }
.env { display: flex; border: 1px solid var(--rule); border-radius: var(--radius); }
.env-opt { position: relative; }
.env-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.env-opt span { display: grid; place-items: center; min-height: 40px; padding: 0 var(--s-3); font-size: var(--t-13); font-weight: 600; color: var(--ash); transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out); }
.env-opt + .env-opt span { border-left: 1px solid var(--rule); }
.env-opt input:checked + span { background: var(--bone); color: var(--ink); }
.env-opt input:focus-visible + span { outline: 2px solid var(--film); outline-offset: 2px; }
.tb-link { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); border-radius: var(--radius); min-width: 164px; }
.tb-link-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--calm); flex: none; }
.tb-link[data-state="blackout"] .tb-link-dot { background: none; border: 1.5px solid var(--amber); }
.tb-link[data-state="blackout"] b { color: var(--amber); }
@media (hover: hover) { .tb-link:hover { background: var(--anodized-2); } }

/* ---------- deck ---------- */
.deck {
  position: relative; display: grid; grid-template-columns: 320px minmax(0, 1fr) 384px;
  min-height: 0; overflow: hidden;
}
.deck > section { min-height: 0; }
.deck h2 { font: 600 var(--t-13)/1.2 var(--font-ui); color: var(--ash); }
/* seven stars, one for each zone lamp: they light with the lamps at power-up */
#h-zones { display: flex; align-items: flex-end; justify-content: space-between; }
#h-zones .stars7 { flex: none; color: var(--film); }
#h-zones use { opacity: .16; transition: opacity .4s var(--ease-out); }
#h-zones use.lit { opacity: .9; }
.annun, .today { overflow-y: auto; padding: var(--s-4) var(--s-5) var(--s-5); scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.annun { border-right: 1px solid var(--rule); }
.today { border-left: 1px solid var(--rule); }
.alerts-head, .today-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule); }
.today-head:first-child { margin-top: 0; }
.count { font-size: var(--t-12); color: var(--ash); }

.more { position: sticky; z-index: 2; bottom: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity var(--d-hover) var(--ease-out); }
.more.on { opacity: 1; }
.more span { position: absolute; left: 0; right: 0; bottom: calc(-1 * var(--s-5)); display: flex; align-items: flex-end; justify-content: center; height: 76px; padding-bottom: 10px; font-size: var(--t-12); font-weight: 600; color: var(--bone); background: linear-gradient(rgba(12, 13, 11, 0), var(--lampblack) 64%); }
.cue-body .more span { bottom: calc(-1 * var(--s-7)); color: var(--ink); background: linear-gradient(rgba(234, 230, 216, 0), var(--bone) 64%); }
.booting .more { display: none; }

/* annunciator lamps: dark cockpit — a lamp is lit only when it needs you */
.lamps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: var(--s-3); }
.lamp, .master {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 70px;
  padding: 9px 11px 8px; border-radius: var(--radius);
  background: var(--anodized); color: var(--ash);
  box-shadow: inset 0 0 0 1px var(--rule), inset 0 0 0 4px var(--lampblack), inset 0 0 0 5px var(--rule-soft);
  transition: background-color 120ms linear, color 120ms linear, transform var(--d-press) var(--ease-out);
}
.lamp:active, .master:active { transform: scale(.975); }
.lamp-legend, .master-legend { font-weight: 700; font-stretch: 68%; font-size: 1.125rem; line-height: 1; text-transform: uppercase; letter-spacing: .055em; opacity: .5; }
.lamp-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-12); font-weight: 600; opacity: 0; }
.lamp.lit .lamp-legend { opacity: 1; }
.lamp.lit .lamp-state { opacity: 1; }
.lamp.lit[data-tier="normal"] { color: var(--bone); }
.lamp.lit[data-tier="normal"] .lamp-state, .lamp.lit[data-tier="none"] .lamp-state { color: var(--calm); }
.lamp.lit[data-tier="attention"], .lamp.lit[data-tier="critical"], .lamps.test .lamp, .lamps.test .master {
  color: var(--lampblack);
  background-image: repeating-linear-gradient(90deg, rgba(12, 13, 11, .09) 0 1px, transparent 1px 4px);
  box-shadow: inset 0 0 0 1px rgba(12, 13, 11, .5), inset 0 0 0 4px rgba(12, 13, 11, .14);
}
.lamp.lit[data-tier="attention"] { background-color: var(--amber); }
.lamp.lit[data-tier="critical"] { background-color: var(--alarm); }
.lamps.test .lamp, .lamps.test .master { background-color: var(--bone); }
.lamps.test .lamp-legend, .lamps.test .master-legend { opacity: 1; }
.lamp::after, .master::after { content: ""; position: absolute; inset: -1px; border-radius: var(--radius); pointer-events: none; opacity: 0; }
.lamp.lit[data-tier="attention"]::after { opacity: 1; box-shadow: 0 0 20px -2px rgba(242, 162, 58, .42); }
.lamp.lit[data-tier="critical"]::after { opacity: 1; box-shadow: 0 0 24px 0 rgba(240, 80, 60, .5); }
.lamp.lit[data-unacked], .master.lit[data-state="armed"] { animation: lamp-flash 1.1s var(--ease-in-out) infinite alternate; }
.lamp.lit[data-unacked]::after, .master.lit[data-state="armed"]::after { animation: lamp-glow 1.1s var(--ease-in-out) infinite alternate; }
@keyframes lamp-flash { from { background-color: #FF6A52; } to { background-color: var(--alarm); } }
@keyframes lamp-glow { from { opacity: 1; } to { opacity: 0; } }
.lamp.hl, .lamp[aria-current] { outline: 1px solid var(--film); outline-offset: 2px; }
.lamp:focus-visible { outline-width: 2px; }
.lamp[aria-current]::before { content: ""; position: absolute; right: -9px; top: 50%; width: 6px; height: 1px; background: var(--film); }

.lamp[data-zone="metabolism"] .lamp-legend { font-size: 1rem; letter-spacing: .03em; }
.master { color: var(--ash); }
.master-legend { font-size: 1rem; white-space: nowrap; }
.master-sub { font-size: var(--t-12); font-weight: 600; line-height: 1.15; opacity: 0; }
.master.lit .master-legend, .master.lit .master-sub { opacity: 1; }
.master.lit[data-state="idle"] .master-legend { opacity: .8; }
.master.lit[data-state="armed"] {
  color: var(--lampblack); background-color: var(--alarm);
  background-image: repeating-linear-gradient(135deg, rgba(12, 13, 11, .08) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px rgba(12, 13, 11, .5), inset 0 0 0 4px rgba(12, 13, 11, .14);
}
.master.lit[data-state="armed"]::after { box-shadow: 0 0 24px 0 rgba(240, 80, 60, .5); }
.master.lit[data-state="acked"] { color: var(--alarm); box-shadow: inset 0 0 0 1px var(--alarm), inset 0 0 0 4px var(--lampblack), inset 0 0 0 5px var(--rule-soft); }
.master[aria-disabled="true"] { cursor: default; }
/* master caution is a control bar under the seven zone lamps, not an eighth zone */
.lamps > li:nth-child(7) { grid-column: 1 / -1; }
.lamps > li:last-child { grid-column: 1 / -1; margin-top: var(--s-2); }
.master { flex-direction: row; align-items: center; gap: var(--s-3); height: 48px; padding: 0 14px; }
.master-sub { text-align: right; }

/* alerts: a log, not cards */
.alert { position: relative; padding: var(--s-3) 0 var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule-soft); }
.alert::before { content: ""; position: absolute; left: 0; top: var(--s-3); bottom: var(--s-3); width: 3px; background: var(--rule); }
.alert[data-tier="attention"]::before { background: var(--amber); }
.alert[data-tier="critical"]::before { background: var(--alarm); }
.alert-top { display: flex; justify-content: space-between; align-items: baseline; }
.alert-zone { font-size: var(--t-12); color: var(--ash); }
.alert-title { display: block; margin: 0; padding: 3px 0; font-weight: 600; font-size: var(--t-15); line-height: 1.3; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color var(--d-hover) var(--ease-out); }
.alert-title:hover, .alert-title:focus-visible { text-decoration-color: var(--ash); }
.why { margin-top: 2px; font-size: var(--t-13); color: var(--ash); }
.why summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.why summary::-webkit-details-marker { display: none; }
.why summary::before { content: "+"; display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--rule); font-size: 11px; line-height: 1; text-decoration: none; }
.why[open] summary::before { content: "–"; }
.why ul { margin: var(--s-1) 0 var(--s-2); }
.why li { position: relative; padding: 2px 0 2px var(--s-3); color: var(--bone); }
.why li::before { content: ""; position: absolute; left: 0; top: .72em; width: 5px; height: 1px; background: var(--ash); }
.why p { color: var(--bone); font-family: var(--font-read); font-size: var(--t-13); line-height: 1.5; }
.why p b { font-family: var(--font-ui); }
.acked { display: flex; align-items: center; gap: 6px; margin-top: var(--s-1); font-size: var(--t-12); color: var(--ash); }
.alert-none { padding: var(--s-4) 0; color: var(--ash); font-size: var(--t-13); }

/* ---------- stage: the lightbox ---------- */
.stage { position: relative; overflow: hidden; background: var(--lampblack); min-height: 420px; }
.body3d, .body3d canvas, .leaders, .callouts, .film { position: absolute; inset: 0; width: 100%; height: 100%; }
.body3d canvas { display: block; touch-action: pan-y; cursor: grab; }
.body3d canvas:active { cursor: grabbing; }
.film { z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse 44% 58% at 50% 47%, rgba(207, 227, 230, .085), rgba(207, 227, 230, .02) 62%, transparent 78%); }
.film-id { position: absolute; left: var(--s-5); top: 21px; font-size: var(--t-12); font-stretch: 80%; letter-spacing: .04em; color: rgba(207, 227, 230, .5); white-space: pre; }
.leaders { z-index: 2; pointer-events: none; overflow: visible; }
.leaders path { fill: none; stroke: var(--ash); stroke-opacity: .42; stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke-opacity var(--d-hover) var(--ease-out); }
.leaders path[data-tier="attention"] { stroke: var(--amber); stroke-opacity: .7; }
.leaders path[data-tier="critical"] { stroke: var(--alarm); stroke-opacity: .8; }
.leaders path.hl { stroke-opacity: 1; stroke: var(--film); }
.callouts { z-index: 3; pointer-events: none; }
.callout { position: absolute; left: 0; top: 0; translate: 0 -50%; pointer-events: auto; width: 152px; padding: 4px 0; text-align: left; line-height: 1.25; will-change: transform; }
.callout[data-side="l"] { translate: -100% -50%; text-align: right; }
.callout[data-side="l"] .c-line { justify-content: flex-end; }
.c-name { display: block; font-size: var(--t-13); font-weight: 600; color: var(--bone); }
.c-line { display: flex; align-items: center; gap: var(--s-2); margin-top: 1px; }
.c-val { font-size: var(--t-12); color: var(--ash); white-space: nowrap; }
.callout[data-tier="normal"] .c-name, .callout[data-tier="none"] .c-name { color: var(--ash); font-weight: 500; }
.callout[data-tier="normal"] .st, .callout[data-tier="none"] .st { font-weight: 500; font-size: var(--t-12); }
.callout.hl .c-name { color: #fff; }
.stage.focused .callouts, .stage.focused .leaders { opacity: 0; pointer-events: none; }
.stage.focused .callout { pointer-events: none; }
.stage.focused .stage-hint { opacity: 0; }
.callouts, .leaders { transition: opacity 200ms var(--ease-out); }
.stage-hint { position: absolute; z-index: 3; right: var(--s-5); top: 21px; font-size: var(--t-12); color: var(--ash); }

/* 2D figure fallback */
.figure { position: absolute; inset: 0; width: 100%; height: 100%; }
.figure .fig-body { fill: rgba(207, 227, 230, .06); stroke: var(--film); stroke-opacity: .55; stroke-width: 1; }
.figure .fig-bone { fill: none; stroke: var(--film); stroke-opacity: .32; stroke-width: 1; }
.figure .fig-hit { fill: transparent; cursor: pointer; }
.figure .fig-anchor circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.figure .fig-anchor .core { fill: currentColor; stroke: none; }
.figure .fig-anchor[data-tier="normal"], .figure .fig-anchor[data-tier="none"] { color: var(--calm); }
.figure .fig-anchor[data-tier="attention"] { color: var(--amber); }
.figure .fig-anchor[data-tier="critical"] { color: var(--alarm); }
.figure .fig-anchor.hl .ring { stroke-width: 2.5; }
.figure .fig-dose { fill: none; stroke: var(--rule); stroke-width: 3; }
.figure .fig-dose-val { fill: none; stroke: var(--calm); stroke-width: 3; }

/* ---------- today ---------- */
.metric { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto 14px; grid-template-rows: auto auto; align-items: center; column-gap: var(--s-3); width: 100%; min-height: 46px; padding: 4px 0; border-bottom: 1px solid var(--rule-soft); transition: background-color var(--d-hover) var(--ease-out); }
.m-label { font-size: var(--t-13); font-weight: 500; line-height: 1.2; align-self: end; }
.m-label small { display: inline; margin-left: 6px; }
.m-state { grid-column: 1; grid-row: 2; align-self: start; line-height: 1; }
.m-state .st { font-size: var(--t-12); font-weight: 500; }
.m-spark, .m-val, .m-arrow { grid-row: 1 / 3; }
.m-spark { grid-column: 2; } .m-val { grid-column: 3; min-width: 96px; } .m-arrow { grid-column: 4; }
.m-val { text-align: right; white-space: nowrap; }
html[lang="ru"] .metric { grid-template-columns: minmax(0, 1fr) 72px auto 14px; }   /* Russian labels and units are longer */
html[lang="ru"] .m-spark .spark { width: 72px; height: auto; }
.m-val b { font-size: 1.375rem; font-weight: 500; font-stretch: 112%; line-height: 1; letter-spacing: -.01em; }
.m-val small { margin-left: 3px; }
.metric[data-tier="attention"] .m-val b { color: var(--amber); }
.metric[data-tier="critical"] .m-val b { color: var(--alarm); }
.m-arrow { color: var(--ash); display: grid; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--ash); stroke-width: 1.25; stroke-linejoin: round; }
.spark-base { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.spark-dot { fill: var(--calm); }
.spark[data-tier="attention"] .spark-dot { fill: var(--amber); }
.spark[data-tier="critical"] .spark-dot { fill: var(--alarm); }
.spark[data-tier="none"] .spark-dot { fill: var(--ash); }
@media (hover: hover) { .metric:hover { background: var(--anodized); } }

.rt { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 40px; border-bottom: 1px solid var(--rule-soft); font-size: var(--t-13); }
.rt-time { color: var(--ash); font-stretch: 112%; font-size: var(--t-12); }
.rt-label small { display: block; }
.rt[data-done="true"] .rt-label { color: var(--ash); }
.rt-done { display: inline-flex; align-items: center; gap: 6px; color: var(--calm); font-weight: 600; font-size: var(--t-12); }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); }
.badge { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-12); line-height: 1.2; color: var(--bone); }
.badge svg { flex: none; color: var(--calm); }
.badge small { display: block; }
.badge[data-got="false"] { color: var(--ash); }
.badge[data-got="false"] svg { color: var(--ash); }
.today-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); }

/* ---------- disclaimer ---------- */
.disc-full { display: none; margin: var(--s-5) var(--s-4) var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--rule); color: var(--ash); font-size: var(--t-12); line-height: 1.5; }
.disc-full strong { color: var(--bone); }
.disclaimer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--s-5); padding: var(--s-2) var(--s-5); border-top: 1px solid var(--rule); background: var(--anodized); font-size: var(--t-13); }
.disclaimer strong { font-weight: 700; }
.disclaimer-more { color: var(--ash); font-size: var(--t-12); }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: 64px; translate: -50% 0; width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: var(--s-3) var(--s-4); background: var(--bone); color: var(--ink); font-size: var(--t-13); font-weight: 500; border-radius: var(--radius); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.toast.on { opacity: 1; transform: none; }
/* what an environment switch changed: one short flash on the link and the dose readouts */
.changed { animation: changed 1.2s var(--ease-out); }
@keyframes changed { from { background-color: rgba(234, 230, 216, .22); } to { background-color: rgba(234, 230, 216, 0); } }

/* ---------- power-up: hide what the timeline will reveal ---------- */
.booting .metric, .booting .alert, .booting .routine, .booting .badges, .booting .today-actions, .booting .callouts, .booting .leaders { opacity: 0; }

/* ---------- widths ---------- */
@media (max-width: 1280px) {
  .deck { grid-template-columns: 300px minmax(0, 1fr) 360px; }
}
@media (max-width: 1240px) {
  .topbar { gap: var(--s-2); padding-inline: var(--s-4); }
  .tb-link { min-width: 0; }
}
@media (max-width: 1080px) {
  .topbar { flex-wrap: wrap; }
}
@media (min-width: 1081px) {
  body { height: 100dvh; }
}
@media (max-width: 1080px) {
  .deck { grid-template-columns: 1fr 1fr; overflow: visible; overflow-x: clip; }
  .stage { grid-column: 1 / -1; grid-row: 1; height: min(64vh, 620px); border-bottom: 1px solid var(--rule); }
  .annun, .today { overflow: visible; }
  .deck > section > .more { display: none; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: var(--s-2) var(--s-3); padding: var(--s-2) var(--s-4); }
  .tb-actions { display: contents; }
  .tb-file { order: 1; margin-right: auto; }
  .tb-icons { order: 2; }
  .tb-crew { order: 3; padding-left: 0; }
  .tb-day { order: 4; min-width: 0; }
  .tb-link { order: 5; min-width: 0; padding: 0; margin-right: auto; }
  .env { order: 6; flex: 1 1 auto; }
  .env-opt { flex: 1; }
  .tb-guide { order: 7; }
  #open-checkin { order: 8; flex: 1 1 100%; }
  .deck { grid-template-columns: 1fr; }
  .stage { height: 56vh; min-height: 380px; }
  .annun, .today { border: 0; padding: var(--s-4); }
  .today { border-top: 1px solid var(--rule); }
  .callouts, .leaders { display: none; }
  .annun { display: contents; }
  .annun > * { margin-inline: var(--s-4); }
  #h-zones { order: -2; margin-top: var(--s-4); }
  #zones { order: -1; margin-bottom: var(--s-4); }
  .stage { grid-row: auto; border-top: 1px solid var(--rule); }
  .alerts-head, .alerts { order: 1; }
  .alerts-head { margin-top: var(--s-4); }
  .alerts { margin-bottom: var(--s-4); }
  .today { order: 2; }
  .film-id { display: none; }
  .rt { min-height: 48px; }
  .btn-log { min-height: 44px; }
  .env-opt span { min-height: 44px; }
  .alert-title { display: flex; align-items: center; min-height: 44px; }
  .why summary { min-height: 44px; }
  .btn-ack { min-height: 44px; }
  .disclaimer .linklike { display: inline-flex; align-items: center; min-height: 44px; }
  .disclaimer { align-items: center; padding-top: 0 !important; padding-bottom: env(safe-area-inset-bottom) !important; }
  .stage-hint { right: auto; left: var(--s-4); top: 21px; }
  .disclaimer-more span { display: none; }
  .disclaimer { flex-wrap: nowrap; }
  .disclaimer p { white-space: nowrap; }
  html[lang="ru"] .disclaimer p:first-child { white-space: normal; line-height: 1.2; }   /* Russian is longer: the first line may break */
  .disc-rest { display: none; }
  .disc-full { display: block; }
  .disclaimer { padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom)); position: sticky; bottom: 0; z-index: 5; }
  .disclaimer-more { font-size: 0.6875rem; }
  html { scroll-padding-bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .lamp.lit[data-unacked], .master.lit[data-state="armed"] { outline: 2px solid var(--bone); outline-offset: 1px; }
}

/* ---------- zone card: paper, the reading surface ---------- */
.cue { position: absolute; z-index: 10; top: 0; right: 0; bottom: 0; width: min(var(--cue-w), 100%); color: var(--ink); color-scheme: light; outline: none;
  transform: translateX(104%); visibility: hidden; filter: drop-shadow(-10px 0 0 rgba(12, 13, 11, .5));
  transition: transform var(--d-card-out) var(--ease-in-out), visibility 0s linear var(--d-card-out); }
.cue.open { transform: none; visibility: visible; transition: transform var(--d-card-in) var(--ease-drawer), visibility 0s; }
.cue-paper, .sheet.paper { background-color: var(--bone);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .09 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.cue-paper { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); clip-path: polygon(28px 0, 100% 0, 100% 100%, 0 100%, 0 28px); }
.cue-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s-4); padding: 38px var(--s-6) var(--s-4); border-bottom: 1px solid var(--ink); }
.cue-head h2 { color: var(--ink); font: 500 1.875rem/1.1 var(--font-read); letter-spacing: -.012em; text-wrap: balance; }
.cue-stamp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 3px; border: 1.5px solid currentColor; border-radius: var(--radius); font-weight: 700; font-stretch: 68%; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; rotate: -3deg; }
.cue-stamp[data-tier="normal"], .cue-stamp[data-tier="none"] { color: var(--calm-ink); }
.cue-stamp[data-tier="attention"] { color: var(--amber-ink); }
.cue-stamp[data-tier="critical"] { color: var(--alarm-ink); }
.cue-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ink); border-radius: var(--radius); transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out); }
.cue-close:active { transform: scale(.95); }
@media (hover: hover) { .cue-close:hover { background: var(--ink); color: var(--bone); } }
.cue-body { overflow-y: auto; padding: var(--s-5) var(--s-6) var(--s-7); scrollbar-width: thin; scrollbar-color: var(--paper-rule) transparent; overscroll-behavior: contain; }
.cue :focus-visible, .paper :focus-visible { outline-color: var(--ink); }
.cue small, .paper small { color: var(--ink-soft); }
.cue .st[data-tier="normal"], .paper .st[data-tier="normal"] { color: var(--calm-ink); }
.cue .st[data-tier="attention"], .paper .st[data-tier="attention"] { color: var(--amber-ink); }
.cue .st[data-tier="critical"], .paper .st[data-tier="critical"] { color: var(--alarm-ink); }
.cue .st[data-tier="none"], .paper .st[data-tier="none"], .cue .stamp, .paper .stamp { color: var(--ink-soft); }
.cue h3, .paper h3 { font: 600 var(--t-13)/1.2 var(--font-ui); color: var(--ink-soft); margin: var(--s-6) 0 var(--s-2); }
.cue-about { font: 400 1.0625rem/1.5 var(--font-read); text-wrap: pretty; }
.cue-why h3 { margin-top: var(--s-5); }
.cue-why ul { border-top: 1px solid var(--paper-rule); }
.cue-why li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-15); line-height: 1.4; }
.cue-why li .glyph { margin-top: 4px; }
.cue-why li[data-tier="attention"] .glyph { color: var(--amber-ink); }
.cue-why li[data-tier="critical"] .glyph { color: var(--alarm-ink); }
.cue-why > p, .cue-env p, .cue-sym { font: 400 var(--t-15)/1.5 var(--font-read); }
.cue-sym { margin-top: var(--s-3); }
.cue-sym b { font-family: var(--font-ui); font-weight: 600; }

.tabs { display: flex; gap: 3px; margin: var(--s-6) calc(var(--s-6) * -1) 0; padding: 0 var(--s-6); border-bottom: 1px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 var(--s-3); margin-bottom: -1px; font-size: var(--t-13); font-weight: 600; color: var(--ink-soft); background: var(--paper-shade); border: 1px solid var(--paper-rule); border-bottom-color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out); }
.tabs button { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 48px; }
.tabs button small { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--bone); color: var(--ink); border-color: var(--ink); border-bottom-color: var(--bone); }
.tabs button[data-tier="attention"] .glyph { color: var(--amber-ink); }
.tabs button[data-tier="critical"] .glyph { color: var(--alarm-ink); }
.tabs button[data-tier="normal"] .glyph { color: var(--calm-ink); }
.tabs + .ind .ind-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ind-title { margin-top: var(--s-6); }
.ind-head { display: flex; align-items: flex-end; gap: var(--s-5); margin-top: var(--s-4); }
.ind-num { white-space: nowrap; line-height: 1; }
.ind-num b { font-size: var(--t-56); font-weight: 400; font-stretch: 112%; letter-spacing: -.02em; }
.ind-num small { margin-left: 6px; font-size: var(--t-15); }
.ind-meta { display: grid; gap: 3px; padding-bottom: 5px; font-size: var(--t-13); color: var(--ink-soft); }
.ind-meta li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ind-band { color: var(--ink); }
.ind-extra { margin-top: var(--s-3); font-size: var(--t-13); line-height: 1.5; }
.seg { display: inline-flex; margin-top: var(--s-4); border: 1px solid var(--ink); border-radius: var(--radius); }
.seg button { min-height: 32px; padding: 0 var(--s-3); font-size: var(--t-12); font-weight: 600; transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out); }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bone); }
.chart { height: 216px; margin-top: var(--s-2); }
.chart-cap, .src-note { font-size: var(--t-12); line-height: 1.45; color: var(--ink-soft); }
.vis-log { margin: var(--s-4) 0; border-top: 1px solid var(--paper-rule); }
.vis-log li { display: flex; justify-content: space-between; padding: var(--s-2) 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-13); }
.guide { margin-top: var(--s-5); border-top: 1px solid var(--ink); }
.guide > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--paper-rule); }
.guide h4, .steps-h { font: 600 var(--t-13)/1.35 var(--font-ui); }
.guide p { font: 400 var(--t-15)/1.5 var(--font-read); text-wrap: pretty; }
.steps-h { margin-top: var(--s-5); color: var(--ink-soft); }
.steps { margin-top: var(--s-2); }
.steps li { position: relative; padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-left: 1px solid var(--paper-rule); }
.steps li b { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--t-13); font-weight: 600; }
.steps li p { margin-top: 2px; font: 400 var(--t-15)/1.5 var(--font-read); color: var(--ink-soft); text-wrap: pretty; }
.steps li[data-now] { background: var(--paper-shade); border-left: 4px solid var(--calm-ink); padding-left: 13px; }
.steps li[data-now] p { color: var(--ink); }
.steps li[data-now][data-tier="attention"] { border-left-color: var(--amber-ink); }
.steps li[data-now][data-tier="critical"] { border-left-color: var(--alarm-ink); }
.steps li i { font-style: normal; font-size: var(--t-12); font-weight: 600; padding: 0 6px; border: 1px solid currentColor; border-radius: var(--radius); }
.src { margin-top: var(--s-5); font-size: var(--t-13); }
.src summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; list-style: none; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.src summary::-webkit-details-marker { display: none; }
.src-list li { padding: var(--s-2) 0 var(--s-3); border-bottom: 1px solid var(--paper-rule); }
.src blockquote { margin: 0 0 var(--s-1); padding-left: var(--s-3); border-left: 2px solid var(--ink); font: italic 400 var(--t-15)/1.45 var(--font-read); }
.src cite { font-style: normal; color: var(--ink-soft); }
.src a, .cue-risk a { overflow-wrap: anywhere; text-underline-offset: 2px; }
.src-h { margin-top: var(--s-3); font-weight: 600; }
.src-tiers li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s-2); padding: var(--s-1) 0; }
.src-note { margin-top: var(--s-2); }
.cue-risk ul { border-top: 1px solid var(--paper-rule); }
.cue-risk li { padding: 6px 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-13); }
.cue-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.btn-ink { background: var(--ink); color: var(--bone); }
.btn-inkline { border: 1px solid var(--ink); color: var(--ink); }
@media (hover: hover) { .btn-ink:hover { background: #000; } .btn-inkline:hover { background: var(--paper-shade); } }

@media (max-width: 700px) {
  .cue { position: fixed; z-index: 20; top: 0; padding-top: 12px; background: var(--lampblack); width: 100%; transform: translateY(103%); filter: none; }
  .cue.open { transform: none; }
  .cue-head { padding: 34px var(--s-4) var(--s-3); gap: var(--s-3); }
  .cue-head h2 { font-size: var(--t-24); }
  .cue-body { padding: var(--s-4) var(--s-4) var(--s-7); }
  .tabs { margin: var(--s-5) calc(var(--s-4) * -1) 0; padding: 0 var(--s-4); }
  .ind-head { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .guide > div { grid-template-columns: 1fr; gap: 2px; }
  body.cue-open { overflow: hidden; }
}

/* ---------- sheets: check-in is an operating panel; report and about are paper ---------- */
dialog.sheet { padding: 0; max-width: none; max-height: none; width: min(860px, calc(100vw - 32px)); height: min(840px, calc(100dvh - 48px)); overflow: hidden; background: var(--anodized); color: var(--bone); border: 1px solid var(--rule); border-radius: var(--radius); }
dialog.sheet::backdrop { background: rgba(12, 13, 11, .82); }
dialog.sheet[open] { animation: sheet-in var(--d-card-in) var(--ease-drawer); }
dialog.sheet[open]::backdrop { animation: sheet-dim 200ms var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes sheet-dim { from { opacity: 0; } }
.sheet-in { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.sheet-in[hidden] { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-4); border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font: 500 var(--t-24)/1.15 var(--font-read); letter-spacing: -.01em; }
.sheet-head p { margin-top: 4px; font-size: var(--t-13); color: var(--ash); }
.sheet-close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ash); border-radius: var(--radius); transition: background-color var(--d-hover) var(--ease-out), color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out); }
.sheet-close:active { transform: scale(.95); }
@media (hover: hover) { .sheet-close:hover { background: var(--bone); color: var(--ink); } .paper .sheet-close:hover { background: var(--ink); color: var(--bone); } }
.sheet-body { overflow-y: auto; padding: 0 var(--s-6) var(--s-6); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-3); padding: var(--s-3) var(--s-6); border-top: 1px solid var(--rule); }

#checkin h3, #crew h3 { margin: var(--s-5) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--rule); font-size: var(--t-13); font-weight: 600; color: var(--ash); }
#checkin section:first-child h3, #crew section:first-child h3 { border-top: 0; padding-top: 0; }
.ci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--s-4) var(--s-5); }
.fld label { display: block; margin-bottom: 6px; font-size: var(--t-13); font-weight: 500; }
.fld label small { color: var(--ash); font-weight: 400; }
.fld-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; background: var(--lampblack); border: 1px solid var(--rule); border-radius: var(--radius); transition: border-color var(--d-hover) var(--ease-out); }
.fld-row:focus-within { border-color: var(--bone); }
.fld input { width: 100%; height: 48px; padding: 0 6px 0 var(--s-2); background: none; border: 0; color: var(--bone); font: inherit; font-size: 1.375rem; font-stretch: 112%; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.fld input::placeholder { font-size: var(--t-13); font-stretch: 100%; color: var(--ash); opacity: 1; }
.fld-unit { min-width: 46px; padding-right: var(--s-2); font-size: var(--t-12); color: var(--ash); }
.step { display: grid; place-items: center; width: 44px; height: 48px; transition: background-color var(--d-press) var(--ease-out); }
.step:first-child { border-right: 1px solid var(--rule); }
.step:last-child { border-left: 1px solid var(--rule); }
.step:active { background: var(--rule); }
@media (hover: hover) { .step:hover { background: var(--anodized-2); } }
.fld[data-bad] .fld-row { border-color: var(--alarm); }
.fld-err { margin-top: 5px; font-size: var(--t-12); line-height: 1.35; color: var(--alarm); }
.fld-err:empty { display: none; }
.scale { min-width: 0; margin: var(--s-4) 0 0; padding: 0; border: 0; }
.scale legend { padding: 0; margin-bottom: 6px; font-size: var(--t-13); font-weight: 500; }
.scale-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 560px; background: var(--lampblack); border: 1px solid var(--rule); border-radius: var(--radius); }
.scale label, .sym label { position: relative; }
.scale label + label { border-left: 1px solid var(--rule); }
.scale input, .sym input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale span { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 68px; padding: 8px 2px; color: var(--ash); transition: background-color var(--d-press) var(--ease-out), color var(--d-press) var(--ease-out); }
.scale b { font-size: var(--t-12); font-weight: 500; text-align: center; line-height: 1.15; }
.scale input:checked + span, .sym input:checked + span { background: var(--bone); color: var(--ink); }
.scale input:focus-visible + span, .sym input:focus-visible + span { outline: 2px solid var(--bone); outline-offset: 2px; }
.sym { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sym span { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); font-size: var(--t-13); font-weight: 500; transition: background-color var(--d-press) var(--ease-out), color var(--d-press) var(--ease-out); }
.sym span .ic { opacity: .22; }
.sym input:checked + span { border-color: var(--bone); }
.sym input:checked + span .ic { opacity: 1; }
.ci-vision { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); font-size: var(--t-13); color: var(--ash); }
.ci-note { margin-top: var(--s-2); font-size: var(--t-12); line-height: 1.45; color: var(--ash); }
.ci-sum { margin-right: auto; font-size: var(--t-13); color: var(--alarm); }
.vis { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--s-6); align-items: start; padding-top: var(--s-5); }
.amsler { display: block; width: 100%; aspect-ratio: 1; background: #000; color: var(--bone); }
.vis-steps { display: grid; gap: var(--s-2); counter-reset: vis; font-size: var(--t-15); line-height: 1.45; }
.vis-steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); counter-increment: vis; }
.vis-steps li::before { content: counter(vis); color: var(--ash); font-variant-numeric: tabular-nums; }
.vis-letters { display: grid; gap: 8px; margin-top: var(--s-5); padding: var(--s-3) var(--s-4); background: #000; font-weight: 600; letter-spacing: .34em; white-space: nowrap; overflow: hidden; }
.vis-letters span:nth-child(1) { font-size: 1.25rem; }
.vis-letters span:nth-child(2) { font-size: .875rem; }
.vis-letters span:nth-child(3) { font-size: .625rem; }
.vis-answer { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

dialog.sheet.paper { width: min(820px, calc(100vw - 32px)); color: var(--ink); color-scheme: light; border: 0; clip-path: polygon(28px 0, 100% 0, 100% 100%, 0 100%, 0 28px); }
.paper .sheet-head { position: relative; padding-top: 36px; border-bottom-color: var(--ink); }
.paper .sheet-head h2 { font: 500 1.75rem/1.1 var(--font-read); letter-spacing: -.012em; }
.paper .sheet-head p { color: var(--ink-soft); }
.paper .sheet-close { border-color: var(--ink); }
.paper .sheet-foot { border-top-color: var(--ink); flex-wrap: wrap; }
.paper .sheet-body { font-size: var(--t-15); line-height: 1.5; scrollbar-color: var(--paper-rule) transparent; }
.paper .sheet-body > p { font-family: var(--font-read); text-wrap: pretty; }
.paper .sheet-body > h3 { color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--ink); margin-bottom: var(--s-3); }
.rep-orn { height: 14px; background: var(--ink-soft); opacity: .75; }
.rep-orn + .rep-top { margin-top: var(--s-4); }
.rep-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); }
.rep-top .seg { margin-top: 0; }
.rep-top .seg button { min-height: 40px; font-size: var(--t-13); }
.rep-period, .rep-note, .rep-sim { font-family: var(--font-ui) !important; font-size: var(--t-12); line-height: 1.45; color: var(--ink-soft); }
.rep-period { font-size: var(--t-13); }
.rep-disc { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--ink); font-family: var(--font-ui) !important; font-size: var(--t-13); }
.rep-disc span { color: var(--ink-soft); }
.rep-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); column-gap: var(--s-5); }
.rep-zones li { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-13); }
.rep-flags li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-2); padding: var(--s-3) 0; border-bottom: 1px solid var(--paper-rule); }
.rep-flags .st { align-self: start; margin-top: 2px; }
.rep-flags b { display: block; font-weight: 600; }
.rep-flags small { display: block; font-size: var(--t-12); }
.rep-flags p { margin-top: 4px; font: 400 var(--t-15)/1.45 var(--font-read); }
.rep-actions li { padding: var(--s-3) 0; border-bottom: 1px solid var(--paper-rule); }
.rep-actions b { margin-right: var(--s-2); font-size: var(--t-13); font-weight: 600; }
.rep-actions i { padding: 0 6px; border: 1px solid currentColor; border-radius: var(--radius); font-style: normal; font-size: var(--t-12); font-weight: 600; }
.rep-actions p { margin-top: 3px; font: 400 var(--t-15)/1.45 var(--font-read); }
.rep-note { margin-top: var(--s-2); }
.rep-sim { flex: 1 1 100%; }
.rep-scroll { overflow-x: auto; }
.rep-table { width: 100%; border-collapse: collapse; font-size: var(--t-13); font-variant-numeric: tabular-nums; }
.rep-table th, .rep-table td { padding: 7px var(--s-3) 7px 0; text-align: left; vertical-align: baseline; white-space: nowrap; border-bottom: 1px solid var(--paper-rule); }
.rep-table thead th { font-size: var(--t-12); font-weight: 600; color: var(--ink-soft); }
.rep-table tbody th { min-width: 190px; font-weight: 500; white-space: normal; }
.rep-table th small { margin-left: 6px; }
.rep-log li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-13); }
.rep-log b { font-weight: 600; }
.rep-log b[data-status="queued"] { color: var(--amber-ink); }
.about-lead { margin-top: var(--s-5); font-size: 1.0625rem; }
.about-list { display: grid; gap: 6px; }
.about-list li { position: relative; padding-left: 18px; font: 400 var(--t-15)/1.5 var(--font-read); text-wrap: pretty; }
.about-list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 7px; height: 1px; background: var(--ink); }
.about-src { margin-top: var(--s-3); }
.about-src > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--paper-rule); font-size: var(--t-13); line-height: 1.45; }
.about-src dt { font-weight: 600; }
.about-src dd { margin: 0; }
.about-src li + li, .about-src dd ul { margin-top: 4px; }
.about-src a { overflow-wrap: anywhere; text-underline-offset: 2px; }

@media (max-width: 700px) {
  dialog.sheet, dialog.sheet.paper { width: 100vw; height: 100dvh; border: 0; }
  .sheet-head { padding: var(--s-4) var(--s-4) var(--s-3); }
  .paper .sheet-head { padding-top: 34px; }
  .sheet-body { padding: 0 var(--s-4) var(--s-5); }
  .sheet-foot { padding: var(--s-3) var(--s-4); flex-wrap: wrap; }
  .ci-sum, .rep-sim { flex-basis: 100%; }
  .vis { grid-template-columns: 1fr; gap: var(--s-4); }
  .about-src > div, .rep-flags li { grid-template-columns: 1fr; gap: 2px; }
  .paper .sheet-foot .btn { flex: 1 1 auto; }
}

/* ---------- crew files and data ---------- */
.crew-list { margin-bottom: var(--s-4); border-top: 1px solid var(--rule); }
.crew-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px var(--s-4); min-height: 64px; padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); }
.crew-who b { display: block; font-size: var(--t-15); font-weight: 600; overflow-wrap: anywhere; }
.crew-who small, .crew-meta { font-size: var(--t-12); line-height: 1.35; color: var(--ash); }
.crew-now { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 96px; min-height: 44px; font-size: var(--t-13); font-weight: 600; color: var(--calm); }
.crew-row .btn { min-width: 96px; }
.data-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }
.data-note { margin-top: var(--s-3); padding: var(--s-2) var(--s-3); border-left: 2px solid var(--calm); font-size: var(--t-13); line-height: 1.45; }
.data-note:empty { display: none; }
.data-note[data-bad] { border-left-color: var(--alarm); color: var(--alarm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.confirm { margin-top: var(--s-4); padding: var(--s-4); border: 1px solid var(--alarm); border-radius: var(--radius); }
.confirm p { font-size: var(--t-15); line-height: 1.45; }
.btn-danger { background: var(--alarm); color: var(--lampblack); }
.fld-text .fld-row { grid-template-columns: minmax(0, 1fr); }
.fld-text input { padding: 0 var(--s-3); font-size: var(--t-15); font-stretch: 100%; }
.fld-hint { margin-top: 5px; font-size: var(--t-12); line-height: 1.35; color: var(--ash); }
.nf-env { display: inline-flex; max-width: 100%; }
.nf-env .env-opt { flex: 1 1 0; }
.nf-env .env-opt span { min-height: 60px; padding: var(--s-2) var(--s-4); align-content: center; text-align: center; }
.nf-env small { display: block; margin-top: 2px; font-weight: 400; font-size: var(--t-12); }

/* first-visit note: a paper slip in the corner, never in the way of the demo */
.welcome { position: fixed; z-index: 30; right: var(--s-5); bottom: 60px; width: min(404px, calc(100vw - 24px)); padding: var(--s-5) var(--s-5) var(--s-4); background: var(--bone); color: var(--ink); color-scheme: light; border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); animation: welcome-in 320ms var(--ease-out) both; }
.welcome[hidden] { display: none; }
.wl-hi { font: italic 400 var(--t-13)/1.2 var(--font-read); color: var(--ink-soft); }
.welcome h2 { margin-top: 2px; font: 500 var(--t-24)/1.15 var(--font-read); letter-spacing: -.01em; }
.welcome h2 + p { margin-top: var(--s-2); font-size: var(--t-13); line-height: 1.5; }
.wl-act { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.wl-act .btn { flex: 1 1 auto; padding: 0 var(--s-3); border: 1px solid var(--ink); font-size: var(--t-13); }
.wl-act .btn:first-child { background: var(--ink); color: var(--bone); }
.wl-close { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink-soft); }
.welcome :focus-visible { outline-color: var(--ink); }
@keyframes welcome-in { from { opacity: 0; transform: translateY(12px); } }
@media (hover: hover) { .wl-act .btn:hover { background: var(--ink); color: var(--bone); } .wl-close:hover { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .welcome { animation: none; } }
@media (max-width: 700px) {
  .welcome { left: 12px; right: 12px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom)); }
  .crew-row { grid-template-columns: minmax(0, 1fr) auto; }
  .crew-meta { grid-column: 1; grid-row: 2; }
  .crew-row > .btn, .crew-now { grid-column: 2; grid-row: 1 / span 2; }
  .data-row .btn { flex: 1 1 auto; }
}

/* ---------- light theme: what the token swap alone does not cover ---------- */
:root[data-theme="light"] .stage { margin: var(--s-4); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--rule), 0 0 0 1px var(--ink); }
:root[data-theme="light"] .more span { background: linear-gradient(rgba(233, 229, 215, 0), var(--lampblack) 64%); }
:root[data-theme="light"] .cue-body .more span { background: linear-gradient(rgba(250, 248, 240, 0), var(--bone) 64%); }
:root[data-theme="light"] :is(.lamp, .master)::after { display: none; }
:root[data-theme="light"] .lamp, :root[data-theme="light"] .master { box-shadow: inset 0 0 0 1px var(--rule); }
:root[data-theme="light"] .master.lit[data-state="acked"] { box-shadow: inset 0 0 0 1px var(--alarm); }
:root[data-theme="light"] .changed { animation-name: changed-light; }
@keyframes changed-light { from { background-color: rgba(26, 27, 23, .16); } to { background-color: rgba(26, 27, 23, 0); } }
:root[data-theme="light"] .cue { filter: drop-shadow(-10px 0 0 rgba(26, 27, 23, .22)); }
:root[data-theme="light"] .cue-paper, :root[data-theme="light"] .welcome { outline: 1px solid var(--ink); }
:root[data-theme="light"] .welcome { box-shadow: 0 18px 40px rgba(26, 27, 23, .28); }
:root[data-theme="light"] dialog.sheet::backdrop { background: rgba(26, 27, 23, .6); }
:root[data-theme="light"] dialog.sheet { outline: 1px solid var(--bone); }
:root[data-theme="light"] dialog.sheet.paper { outline-color: var(--ink); }
@media (hover: hover) { :root[data-theme="light"] .btn-solid:hover { background: #000; } }
@media (max-width: 700px) { :root[data-theme="light"] .stage { margin: var(--s-3); } }

/* ---------- round 4: show less, reveal on demand ---------- */
/* body labels: only for the zone under the pointer or with keyboard focus */
.callout { opacity: 0; pointer-events: none; transition: opacity var(--d-hover) var(--ease-out); }
.callout.hl, .callout:focus-visible { opacity: 1; pointer-events: auto; }
.leaders path:not(.hl) { stroke-opacity: 0; }
.alerts-all { display: inline-flex; align-items: center; font-size: var(--t-12); font-weight: 600; }
@media (max-width: 700px) { .alerts-all { min-height: 44px; } .alerts-head { align-items: center; } }
.alerts-all[hidden] { display: none; }
/* right column: Today / Routine */
.pane-tabs { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--rule); }
.pane-tabs [role="tab"] { min-height: 44px; margin-bottom: -1px; font-size: var(--t-15); font-weight: 600; color: var(--ash); border-bottom: 2px solid transparent; transition: color var(--d-hover) var(--ease-out), border-color var(--d-hover) var(--ease-out); }
.pane-tabs [role="tab"][aria-selected="true"] { color: var(--bone); border-bottom-color: var(--bone); }
@media (hover: hover) { .pane-tabs [role="tab"]:hover { color: var(--bone); } }
.pane-sub { margin-top: var(--s-3); }
.score-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-4); font-size: var(--t-13); color: var(--ash); }
.score-row b { font-size: var(--t-24); line-height: 1; font-stretch: 112%; font-weight: 500; color: var(--bone); }
.score-row b small { display: inline; margin-left: 2px; }
.wl-sub { font-weight: 600; }
