:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #e6f0ef;
  background: #0b151c;
  --surface: #13232c;
  --rim: #36515b;
  --muted: #a5bac2;
  --mint: #9aefcc;
  --amber: #ffcc83;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(#2d4b5726 1px, transparent 1px), linear-gradient(90deg, #2d4b5726 1px, transparent 1px);
  background-size: 32px 32px;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { line-height: 1.12; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); letter-spacing: -.045em; }
h1:focus { outline: none; }
h2 { font-size: 1.35rem; }
p { line-height: 1.5; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon, .brand svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.masthead, .console-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding-inline: max(1.25rem, calc((100% - 1190px) / 2));
  background: #0c171f;
}
.masthead { min-height: 60px; border-bottom: 1px solid var(--rim); }
.brand, .header-status, .system-status { display: flex; align-items: center; gap: .55rem; }
.brand { font: 700 .95rem var(--mono); letter-spacing: .09em; }
.brand strong, .brand svg { color: var(--mint); }
.brand svg { width: 28px; height: 28px; }
.header-status { color: var(--muted); font: .8rem var(--mono); }
.light { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.header-status .light { color: var(--mint); }
.shell { width: min(1190px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.3rem 0; flex: 1; }
.console-footer {
  border-top: 1px solid var(--rim);
  min-height: 35px;
  color: var(--muted);
  font: .7rem var(--mono);
  letter-spacing: .11em;
}
.frame {
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 7px;
  box-shadow: inset 0 2px #ffffff0a, 0 4px 0 #060d12;
}
.eyebrow { color: var(--mint); font: 700 .74rem/1.45 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.screen-heading { margin-bottom: 1rem; }
.screen-heading .eyebrow { margin-bottom: .35rem; }
.description { max-width: 62ch; color: var(--muted); margin-top: .7rem; }
.welcome, .setup { padding: clamp(1.25rem, 4vw, 3.25rem); }
.welcome { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; min-height: clamp(425px, 75vh, 680px); }
.welcome-scene { position: absolute; z-index: -2; inset: -4%; background: #0e1d24 url("../assets/intro-facility.jpg") 62% center / cover no-repeat; animation: intro-drift 32s ease-in-out infinite alternate; }
.welcome::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #070f14f2, #070f14d9 25%, #070f1438 65%, #070f1410), linear-gradient(0deg, #070f1490, transparent 22%); }
.welcome-content { width: min(100%, 26rem); }
.welcome h1 { font-size: clamp(3rem, 8vw, 6.3rem); line-height: .91; }
.welcome .description { max-width: 34ch; color: #e4eeee; }
.welcome .eyebrow { color: var(--amber); }
.quick-start-note { margin-top: .6rem; color: #e4eeee; font-size: .85rem; }
.welcome-links { display: flex; gap: .4rem 1rem; flex-wrap: wrap; margin-top: .85rem; }
.welcome-links a { color: var(--mint); text-underline-offset: .2em; }
body:has(#screen[data-view="menu"]) > :is(.masthead, .console-footer) { display: none; }
#screen[data-view="menu"] { width: 100%; padding: 0; }
.welcome { min-height: 100svh; padding-inline: clamp(1.4rem, 8vw, 9rem); }
.welcome-content { width: min(100%, 36rem); }
.welcome h1 { max-width: 9ch; text-transform: uppercase; font-size: clamp(2.55rem, 8vw, 7rem); font-weight: 900; letter-spacing: -.062em; }
.welcome-links { display: grid; justify-items: start; gap: .1rem; margin-top: clamp(1rem, 4vh, 2.4rem); }
.welcome-links .menu-item { display: block; min-width: 13rem; padding: .5rem .75rem; border: 0; border-left: 3px solid transparent; border-radius: 0; box-shadow: none; background: transparent; color: #dbe5e5; text-decoration: none; text-align: left; font: 700 1rem var(--mono); }
.welcome-links .menu-start { border-left-color: var(--amber); color: var(--amber); background: #ffcb7417; }
.welcome-links .menu-item:hover, .welcome-links .menu-item:focus-visible { border-left-color: var(--amber); color: #fff; background: #ffe6bb24; }
.instruction-steps > li { margin-bottom: .75rem; }
.instruction-steps h2 { font-size: 1.1rem; margin-bottom: .2rem; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.intro-motion { position: absolute; right: .7rem; bottom: .7rem; }
.welcome[data-background-paused="true"] .welcome-scene { animation-play-state: paused; }
[data-motion="reduced"] .intro-motion { display: none; }
@media (prefers-reduced-motion: reduce) { .intro-motion { display: none; } }
@keyframes intro-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-2%, 1%, 0) scale(1.055); } }
.setup { max-width: 850px; margin-inline: auto; }

.actions, .preferences, .timing { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.actions { margin-top: 1rem; }
.button {
  min-height: 42px;
  padding: .55rem .85rem;
  border: 1px solid #567079;
  border-radius: 4px;
  color: #edf7f6;
  background: #1d303a;
  font-weight: 650;
}
.button:hover:not(:disabled) { background: #2b454f; border-color: #8caaa9; }
.button.primary { color: #10241e; background: var(--mint); border-color: var(--mint); }
.button.primary:hover:not(:disabled) { background: #c1f9e3; }
.button:disabled { color: var(--muted); background: #17252d; border-color: var(--rim); }
.button.quiet { font: .79rem var(--mono); }
.button.quiet strong { color: var(--mint); margin-left: .2rem; }
.preferences { justify-content: flex-end; margin-top: .9rem; }

.timing { margin: 1.4rem 0; }
input[type="number"] { width: 5rem; padding: .55rem; background: #0d1922; color: inherit; border: 1px solid #63818d; border-radius: 3px; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--mint); flex: none; margin: 0; }
.check { display: flex; gap: .55rem; align-items: center; min-height: 38px; }
fieldset { border: 1px solid var(--rim); border-radius: 4px; padding: .65rem 1rem 1rem; }
legend { color: var(--mint); padding-inline: .45rem; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem 1rem; }
.error { color: var(--amber); margin-top: .85rem; }
.brief-details, .result-grid { display: grid; gap: .8rem; margin: 1.5rem 0; }
.brief-details > div, .result-grid > div { padding: .8rem; background: #0e1d24; border: 1px solid var(--rim); border-radius: 4px; }
dt { color: var(--muted); font: .81rem var(--mono); margin-bottom: .35rem; }
dd { font-weight: 650; }
.note { color: var(--muted); }
.result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.telemetry {
  display: grid;
  grid-template-columns: minmax(130px, .9fr) minmax(135px, 1.5fr) repeat(2, minmax(58px, .45fr)) auto;
  align-items: stretch;
  gap: .65rem;
  padding: .65rem;
  margin-bottom: 1rem;
}
.timer, .restoration, .readout { background: #0e1d24; border: 1px solid #2c424d; border-radius: 4px; padding: .55rem .7rem; }
.timer, .readout { display: grid; align-content: center; }
#clock { color: var(--amber); font: 700 clamp(1.15rem, 3vw, 2rem) var(--mono); font-variant-numeric: tabular-nums; }
.readout strong { font: 700 1.45rem var(--mono); }
.restoration { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem; }
.restoration strong { font: .8rem var(--mono); }
progress { grid-column: 1 / -1; appearance: none; height: .62rem; width: 100%; }
progress::-webkit-progress-bar { background: #263b47; border-radius: 2px; }
progress::-webkit-progress-value { background: var(--mint); border-radius: 2px; }
.timer-actions { margin: 0; justify-content: center; }
.control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 225px); gap: .85rem; }
.system-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.system {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 138px;
  width: 100%;
  padding: .75rem;
  text-align: left;
  color: inherit;
  transition: background-color 150ms, border-color 150ms;
}
.system:hover:not(:disabled) { border-color: var(--mint); background: #1a323b; }
.system-top, .system-bottom { display: flex; align-items: center; justify-content: space-between; gap: .3rem; color: var(--muted); font: .72rem var(--mono); }
.system-top .icon { width: 30px; height: 30px; color: var(--mint); }
.system-name { align-self: center; font-size: 1rem; font-weight: 700; }
.system[data-status="Fault detected"] .system-status { color: var(--amber); }
.system[data-status="Restored"] .system-status { color: var(--mint); }
.system:disabled { color: var(--muted); background: #111e26; }
.override { display: grid; align-content: center; justify-items: center; gap: .65rem; text-align: center; padding: 1rem; }
.override p:not(.eyebrow), .module p:not(.eyebrow) { color: var(--muted); }
.override-symbol, .module-symbol { display: grid; place-items: center; background: #0e1d24; border: 1px solid var(--rim); color: var(--mint); border-radius: 5px; }
.override-symbol { width: 56px; height: 56px; color: var(--amber); }
.override-symbol .icon { width: 30px; height: 30px; }
.module { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.2rem; padding: clamp(1rem, 3vw, 2rem); }
.module-symbol { width: clamp(55px, 9vw, 108px); aspect-ratio: 1; }
.module-symbol .icon { width: 60%; height: 60%; }
.module h2 { margin: .3rem 0 .55rem; }
#module-feedback { margin-top: .5rem; min-height: 1.5em; }
.power-setup select, #power-value { padding: .55rem; color: inherit; background: #0d1922; border: 1px solid #63818d; border-radius: 3px; }
.power-setup a { color: var(--mint); }
.teacher-setup { max-width: 960px; }
.teacher-setup fieldset { margin: .7rem 0; min-width: 0; }
.teacher-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: .45rem .8rem; margin-bottom: .5rem; }
.teacher-fields select { width: max-content; max-width: 100%; }
.teacher-system { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; align-items: center; padding: .35rem; border-bottom: 1px solid var(--rim); }
.teacher-setup select, .teacher-setup textarea { padding: .35rem; border: 1px solid #63818d; border-radius: 4px; color: inherit; background: #0d1922; }
.teacher-setup a { color: var(--mint); }
.teacher-system a { grid-column: 1 / -1; font-size: .82rem; }
.teacher-transfer, .teacher-preview { padding: .6rem; margin-top: .85rem; background: #0d1922; border: 1px solid var(--rim); border-radius: 4px; }
.teacher-play-options { margin-top: .6rem; }
.teacher-play-options summary { cursor: pointer; font-weight: 650; }
.teacher-transfer summary, .teacher-preview summary { cursor: pointer; font-weight: 650; }
.teacher-transfer textarea { display: block; width: 100%; font-family: var(--mono); }
.teacher-preview h2 { margin-top: .7rem; }
.teacher-preview li { margin-bottom: .5rem; }
#mission-advisory .override-warning { justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 530px) {
  .teacher-setup .options, .teacher-fields { grid-template-columns: minmax(0, 1fr); }
}
#mission-seed { width: 9rem; }
.power-panel { padding: 1rem; }
.power-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .45rem; }
.power-stages { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; padding: 0; margin: .7rem 0; }
.power-stages li { display: grid; align-content: start; gap: .2rem; padding: .55rem .65rem; border: 1px solid var(--rim); border-radius: 4px; background: #0e1b23; }
.power-stages li[aria-current="step"] { border-color: var(--amber); }
.power-stages li[data-online="true"] { border-color: var(--mint); }
.power-stages svg { width: 60px; height: 32px; stroke: currentColor; fill: none; color: var(--muted); }
.power-stages li[data-online="true"] svg { color: var(--mint); filter: drop-shadow(0 0 5px #76e9b5); animation: energize 450ms ease-out; }
.power-stages span { font-size: .8rem; color: var(--muted); }
@keyframes energize { from { opacity: .45; transform: scale(.93); } to { opacity: 1; transform: scale(1); } }
.power-config { color: var(--amber); font-family: var(--mono); margin: .35rem 0 .6rem; }
.power-inputs { min-width: 0; }
.power-readings, .switch-bank { display: grid; grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); gap: .55rem; }
.power-readings > div { background: #0d1922; border: 1px solid var(--rim); padding: .5rem; }
.power-readings dd, .switch-value { font: 700 1.35rem var(--mono); }
#power-value { width: 8rem; max-width: 100%; margin: .55rem .25rem 0; }
.power-inputs .actions { margin-top: .55rem; }
.power-switch { position: relative; cursor: pointer; }
.power-switch input { position: absolute; top: .55rem; left: .5rem; accent-color: var(--mint); }
.switch-face { display: grid; gap: .3rem; padding: .5rem .5rem .5rem 1.9rem; border: 1px solid var(--rim); border-radius: 4px; background: #0d1922; }
.power-switch input:focus-visible + .switch-face { outline: 2px solid var(--mint); }
.power-switch input:checked + .switch-face { border-color: var(--mint); color: var(--mint); }
.switch-on, .power-switch input:checked + .switch-face .switch-off { display: none; }
.power-switch input:checked + .switch-face .switch-on { display: inline; }
#module-feedback.power-feedback { margin: 0 0 .4rem; }
.power-feedback:empty { min-height: 0 !important; }
.power-feedback[data-outcome="incorrect"], .power-feedback[data-outcome="invalid"] { color: var(--amber); }
.power-feedback[data-outcome="correct"] { color: var(--mint); }
.power-hints { margin: .65rem 0 0; padding-left: 1.5rem; line-height: 1.5; }
.sequence-display, .shape-references, .lock-grid { list-style: none; padding: 0; margin: .45rem 0; }
.sequence-display, .shape-references, .symbol-selectors { display: flex; flex-wrap: wrap; gap: .45rem; }
.sequence-display li, .shape-references li, .symbol-selectors label { display: grid; gap: .2rem; padding: .4rem .55rem; border: 1px solid var(--rim); border-radius: 4px; background: #0d1922; }
.sequence-display input, .symbol-selectors select { max-width: 100%; padding: .35rem; background: #13232c; border: 1px solid #63818d; border-radius: 3px; }
.sequence-display input { width: 5rem; }
.security-glyph { width: 24px; height: 24px; fill: none; stroke: var(--mint); stroke-width: 1.5; }
.symbol-preview { min-height: 24px; }
.symbol-preview > span { display: none; }
.symbol-selectors label:has(option[value="Circle"]:checked) [data-shape="Circle"],
.symbol-selectors label:has(option[value="Triangle"]:checked) [data-shape="Triangle"],
.symbol-selectors label:has(option[value="Square"]:checked) [data-shape="Square"],
.symbol-selectors label:has(option[value="Diamond"]:checked) [data-shape="Diamond"] { display: inline-flex; }
.lock-grids { display: flex; flex-wrap: wrap; gap: 1rem; }
.lock-grids h3 { margin: .35rem 0; }
.lock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
.lock-grid li, .lock-grid label { display: grid; min-width: 74px; min-height: 42px; place-content: center; text-align: center; background: #0d1922; border: 1px solid var(--rim); border-radius: 3px; }
.lock-grid label { display: block; padding: .2rem; cursor: pointer; }
.lock-grid span { display: block; font-size: .72rem; }
.lock-grid [data-marked="true"], .lock-grid label:has(input:checked) { color: var(--mint); border-color: var(--mint); }
.lock-grid [data-marked="true"], .lock-grid label:has(input:checked) { background: #183637; }
.lock-grid .tile-marked, .lock-grid input:checked ~ .tile-empty { display: none; }
.lock-grid input:checked ~ .tile-marked { display: block; }
.radio-links { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: 0; margin: .7rem 0; }
.radio-links li { display: grid; grid-template-columns: auto 1fr; gap: .15rem .55rem; align-items: center; padding: .45rem .55rem; border: 1px solid var(--rim); border-radius: 4px; background: #0d1922; }
.radio-links svg { grid-row: span 2; width: 28px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.radio-links li span { color: var(--muted); font: .72rem var(--mono); }
.radio-links li[aria-current="step"] { border-color: var(--amber); }
.radio-links li[data-online="true"] { color: var(--mint); border-color: var(--mint); }
.radio-links li[data-activated="true"] svg { animation: radio-lock 600ms ease-out; }
@keyframes radio-lock {
  from { opacity: .35; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}
.radio-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.radio-display { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem .5rem; padding: .5rem .65rem; margin-bottom: .4rem; border: 1px inset var(--rim); border-radius: 4px; color: var(--amber); background: #090f15; font: .8rem var(--mono); text-transform: uppercase; }
#radio-digits { font-size: 1.65rem; letter-spacing: .12em; }
.radio-dial, .radio-machine { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .4rem 0; }
.radio-dial input { width: 6rem; }
.radio-machine > span { padding: .45rem; background: #0d1922; border-radius: 4px; }
.temperature-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.temperature-control, .thermometers { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.thermometer { display: flex; align-items: center; gap: .55rem; min-height: 115px; margin: .4rem 0 0; padding: .55rem; border: 1px solid var(--rim); border-radius: 4px; background: #0d1922; }
.thermometer figcaption { display: grid; gap: .25rem; font-size: .8rem; }
.thermometer figcaption strong { color: var(--mint); font: 700 1.05rem var(--mono); }
.thermometer-scale { position: relative; width: 35px; height: 92px; }
.thermometer-track { position: absolute; inset: 0 auto 0 0; width: 14px; overflow: hidden; border: 1px solid var(--rim); border-radius: 12px; background: #223844; }
.thermometer-fluid { position: absolute; inset: auto 0 0; height: var(--level); background: var(--mint); transition: height 220ms ease-out; }
.thermometer-zero { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--muted); font: .68rem var(--mono); border-left: 4px solid currentColor; padding-left: 2px; }
.temperature-workbench dd span { font-size: .75rem; }
.mix-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.mix-total { padding: .4rem .6rem; background: #0d1922; border: 1px solid var(--rim); border-radius: 4px; }
.mix-tanks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .55rem; }
.mix-tank { display: grid; align-content: start; gap: .3rem; min-width: 0; margin: 0; padding: .5rem; }
.mix-tank label, .mix-tank p { font-size: .86rem; }
.mix-tank input { width: 100%; max-width: 100%; accent-color: var(--mint); }
.mix-tank input[aria-invalid="true"] { border-color: var(--amber); }
.mix-vessel { position: relative; min-height: 64px; overflow: hidden; margin: .12rem 0; border: 1px solid var(--rim); border-radius: 4px 4px 10px 10px; background: repeating-linear-gradient(0deg, #203746 0 1px, #0d1922 1px 15px); }
.mix-vessel span { position: absolute; inset: auto 0 0; height: var(--fill); background: linear-gradient(180deg, #a1edd4, #328b8d); border-top: 1px solid #c3f6e4; transition: height 220ms ease-out; }
.navigation-workbench { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: start; gap: 1rem; }
#navigation-grid-focus { border: 1px solid var(--rim); border-radius: 5px; background: #0d1922; }
#navigation-grid-focus:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.navigation-grid { display: block; width: 100%; height: auto; }
.navigation-grid path { fill: none; stroke: #43616a; }
.navigation-grid text { fill: #d9edf0; font: 12px var(--mono); }
.navigation-grid .navigation-axis { stroke: #a2bec5; stroke-width: 1.8; }
.navigation-grid .navigation-beacon { fill: #70572d; stroke: var(--amber); stroke-width: 2; }
#navigation-robot { fill: #0b2421; stroke: var(--mint); stroke-width: 2; transition: transform 145ms ease-out; }
#navigation-robot path { fill: inherit; stroke: inherit; }
#navigation-position { margin-top: .4rem; }
.navigation-drive { margin-top: .55rem; }
.navigation-pad { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.navigation-workbench #module-feedback { margin-top: .45rem; }
.cooling-workbench { display: grid; grid-template-columns: minmax(0, 455px) minmax(0, 1fr); align-items: start; gap: 1rem; }
.cooling-drawing { margin: 0; background: #0d1922; border: 1px solid var(--rim); border-radius: 5px; }
.cooling-drawing figcaption { padding: .4rem .65rem; color: var(--muted); font: .79rem var(--mono); }
.cooling-diagram { display: block; width: 100%; height: auto; }
.cooling-diagram text { fill: #e6f0ef; text-anchor: middle; font: 12px var(--mono); }
.cooling-diagram .cooling-face { fill: #21404c; stroke: var(--mint); stroke-width: 1.7; stroke-linejoin: round; }
.cooling-diagram .cooling-guide { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-dasharray: 5 4; }
.cooling-diagram .cooling-dimension { fill: none; stroke: #b0c6cd; }
.cooling-workbench form { margin-top: .6rem; }
.cooling-workbench dd { font-size: 1.15rem; }
.cooling-fan { width: 32px; height: 32px; color: var(--muted); fill: currentColor; }
.cooling-stages [data-online="true"] .cooling-fan { color: var(--mint); filter: none; animation: none; }
.cooling-stages [data-online="true"] .cooling-blades { transform-origin: 20px 20px; animation: cooling-spin 1.2s linear infinite; }
@keyframes cooling-spin { to { transform: rotate(360deg); } }
.token-receipt, .override-warning, .restoration-scene { margin-top: .65rem; padding: .55rem .75rem; border: 1px solid var(--rim); border-radius: 4px; }
.token-receipt { color: var(--mint); background: #0e201f; }
.override-warning { display: flex; align-items: center; gap: .55rem; margin: 0 0 .8rem; color: var(--amber); border-color: var(--amber); background: #291f18; }
.override-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.override-tokens { list-style: none; padding: 0; display: grid; gap: .35rem; }
.override-tokens li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .4rem .55rem; background: #0d1922; border: 1px solid var(--rim); border-radius: 4px; }
.override-tokens strong, .override-relay strong { color: var(--mint); font: 700 1.2rem var(--mono); }
.override-relay { margin-bottom: .5rem; }
#master-code { display: block; max-width: 100%; width: 9rem; margin: .4rem 0; padding: .45rem; color: var(--amber); background: #0d1922; border: 1px solid #63818d; border-radius: 4px; font: 700 1.4rem var(--mono); letter-spacing: .25em; }
.restoration-scene { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; color: var(--mint); background: #0e201f; }
.restoration-scene svg { width: min(100%, 186px); }
.restoration-scene circle { fill: currentColor; }
.restoration-wire { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 260; animation: restore-network 1.1s ease-out both; }
@keyframes restore-network { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@media (max-width: 700px) { .override-workbench { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 830px) { .cooling-workbench { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .navigation-workbench { grid-template-columns: minmax(0, 1fr); }
  #navigation-grid-focus { max-width: 360px; }
}
@media (max-width: 800px) { .temperature-workbench { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) {
  .radio-workbench { grid-template-columns: minmax(0, 1fr); }
  .radio-links li { grid-template-columns: 1fr; }
  .radio-links svg { grid-row: auto; }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 1020px) {
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .control-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome { align-items: end; padding-bottom: 4rem; }
  .welcome-scene { background-position: 73% center; }
  .welcome::before { background: linear-gradient(0deg, #070f14 7%, #070f14d9 39%, #070f1420 86%); }
  .telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timer-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .shell { width: calc(100% - 1.4rem); }
  .masthead, .console-footer { padding-inline: .7rem; }
  .options, .module { grid-template-columns: minmax(0, 1fr); }
  .system { padding: .5rem; min-height: 124px; }
  .system-top, .system-bottom { font-size: .65rem; }
  .system-status { gap: .3rem; }
  .power-stages { grid-template-columns: 1fr; }
}
/* Raised console surfaces and short, local motion. */
.frame { background-image: linear-gradient(165deg, #ffffff06, transparent 55%); }
.button {
  background-image: linear-gradient(#ffffff0b, transparent 70%);
  box-shadow: inset 0 1px #ffffff18, 0 3px #080f14;
  transition: background-color 120ms, border-color 120ms, transform 95ms, box-shadow 95ms;
}
.button:active:not(:disabled), .system:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 2px 5px #0006;
}
.button.primary { box-shadow: inset 0 1px #ffffff70, 0 3px #21493e; }
.preferences { row-gap: .55rem; }
.volume-control {
  display: flex; align-items: center; gap: .4rem; padding: .4rem .55rem;
  border: 1px solid var(--rim); border-radius: 4px; background: #0d1922; font: .79rem var(--mono);
}
.volume-control input { width: 6rem; accent-color: var(--mint); }
.volume-control output { min-width: 4ch; color: var(--mint); }
.system[data-system="power"] { --system-accent: #ffd279; }
.system[data-system="temperature"] { --system-accent: #ffae96; }
.system[data-system="security"] { --system-accent: #d5baff; }
.system[data-system="comms"] { --system-accent: #8ee8ef; }
.system[data-system="chemical"] { --system-accent: #bce785; }
.system[data-system="navigation"] { --system-accent: #a8c8ff; }
.system[data-system="cooling"] { --system-accent: #89e7d4; }
.system[data-system="data"] { --system-accent: #f8badd; }
.system[data-system] .icon { color: var(--system-accent, var(--mint)); }
.system:not(:disabled):hover { border-color: var(--system-accent, var(--mint)); }
.system[data-status="Restored"] { border-left: 3px solid var(--mint); }
.switch-face { box-shadow: inset 0 1px #ffffff24, 0 2px #080f14; }
.power-switch input:checked + .switch-face { background: #193a35; box-shadow: inset 0 2px 4px #0006; }
.power-switch:active .switch-face { transform: translateY(1px); }
#screen[data-entering="true"] > :first-child { animation: console-enter 155ms ease-out both; }
@keyframes console-enter { from { opacity: .72; } to { opacity: 1; } }
.clock-status { font: .68rem var(--mono); line-height: 1.3; }
.clock-status:empty { display: none; }
#progress::-webkit-progress-value { background: repeating-linear-gradient(115deg, #9aefcc 0 12px, #7bd9b4 12px 15px); }
.restoration[data-advanced="true"], .token-receipt, .power-feedback[data-outcome="correct"] {
  animation: equipment-online 420ms ease-out;
}
@keyframes equipment-online { from { box-shadow: inset 0 0 0 2px #9aefcc99; } to { box-shadow: inset 0 0 0 0 #9aefcc00; } }
.thermometer-fluid, .mix-vessel span { transition-timing-function: cubic-bezier(.2,.65,.35,1); }
.radio-display, #clock { font-variant-numeric: tabular-nums; }
