/* Archivo (variable: weight 100–900, width 62–125%), SIL Open Font License, see fonts/OFL.txt */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2-variations'), url(../fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin.woff2) format('woff2-variations'), url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Torus — visual system
   Colour encodes temperature: hot (plasma, heat) = H-alpha rose, cold (magnets, field) = cryo blue,
   fusion output (helium, energy) = alpha gold. Everything else is quiet tungsten grey. */
:root {
  --vacuum: #05070a;
  --ink: #eaeef4;
  --ink-2: #a3acb9;
  --ink-3: #6a7380;
  --glass: rgba(11, 14, 19, 0.66);
  --glass-2: rgba(20, 25, 32, 0.72);
  --line: rgba(190, 205, 225, 0.11);
  --line-2: rgba(190, 205, 225, 0.2);
  --hot: #ff3d6e;
  --hot-soft: rgba(255, 61, 110, 0.16);
  --cold: #8fd3ff;
  --cold-soft: rgba(143, 211, 255, 0.14);
  --gold: #ffc35a;
  --gold-soft: rgba(255, 195, 90, 0.16);
  --danger: #ff5a4f;
  --r-panel: 18px;
  --r-ctl: 10px;
  --gut: 20px;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--vacuum); color: var(--ink); }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; font-variation-settings: 'wdth' 100; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }

/* ---------- shared controls ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; letter-spacing: 0.01em; transition: color .2s, background .2s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: rgba(234, 238, 244, 0.1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--ink); padding: 9px 16px; border-radius: var(--r-ctl); cursor: pointer; font-size: 13.5px; font-weight: 500; transition: background .2s, border-color .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: rgba(234, 238, 244, 0.38); background: rgba(40, 48, 60, 0.8); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.primary { background: var(--ink); color: #0a0d12; border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #fff; }
.btn.ghost { background: transparent; }
.btn.gold { border-color: rgba(255, 195, 90, 0.45); color: var(--gold); background: rgba(255, 195, 90, 0.07); }
.btn.gold:hover { background: rgba(255, 195, 90, 0.14); border-color: var(--gold); }
.btn.danger { border-color: rgba(255, 90, 79, 0.45); color: #ff8d84; background: rgba(255, 90, 79, 0.06); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 90, 79, 0.14); border-color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn[aria-pressed="true"] { border-color: var(--cold); color: var(--cold); }
.icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--ink-2); cursor: pointer; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: color .2s, border-color .2s; }
.icon:hover { color: var(--ink); border-color: var(--line-2); }
#btnSound .mute { display: inline; } #btnSound .wave { display: none; }
#btnSound[aria-pressed="true"] .mute { display: none; } #btnSound[aria-pressed="true"] .wave { display: inline; }
#btnSound[aria-pressed="true"] { color: var(--ink); }

/* ---------- top bar ---------- */
.bar { position: fixed; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px var(--gut) 0; z-index: 20; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.mark { font-size: 24px; font-weight: 250; font-variation-settings: 'wdth' 125; letter-spacing: 0.02em; line-height: 1; }
.tag { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.modes { justify-self: center; }

/* ---------- thermometer (signature) ---------- */
.thermo { position: fixed; right: var(--gut); top: 96px; bottom: 120px; width: 164px; z-index: 5; pointer-events: none; transition: opacity .6s, transform .6s; }
.thermo-rail { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.thermo-grad { position: absolute; inset: 0; background: linear-gradient(to top, var(--cold) 0%, rgba(143, 211, 255, 0.25) 18%, rgba(160, 170, 185, 0.2) 40%, rgba(255, 61, 110, 0.35) 75%, var(--hot) 100%); opacity: 0.55; }
.thermo-ticks { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.thermo-ticks li { position: absolute; right: 12px; transform: translateY(-50%); text-align: right; font-size: 11.5px; line-height: 1.25; color: var(--ink-3); white-space: nowrap; }
.thermo-ticks li b { display: block; font-weight: 500; color: var(--ink-2); }
.thermo-ticks li.end b, .thermo-ticks li.end span { visibility: hidden; }
.thermo-ticks li::after { content: ''; position: absolute; right: -12px; top: 50%; width: 7px; height: 1px; background: var(--line-2); }
.thermo-mark { position: absolute; right: -5px; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; flex-direction: row-reverse; transition: top .25s linear, opacity .4s; }
.thermo-mark i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; background: var(--vacuum); box-shadow: 0 0 14px currentColor; }
.thermo-mark span { font-size: 12px; font-weight: 600; font-variation-settings: 'wdth' 112; font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); white-space: nowrap; }
.thermo-mark.hot { color: var(--hot); }
.thermo-mark.cold { color: var(--cold); }

/* ---------- tour ---------- */
.tour, .explore, .operate, .micro { position: fixed; z-index: 10; opacity: 0; pointer-events: none; transition: opacity .5s; }
body.mode-tour .tour, body.mode-explore .explore, body.mode-operate .operate, body.micro-on .micro { opacity: 1; pointer-events: auto; }
.tour { left: var(--gut); right: var(--gut); bottom: 18px; top: auto; }
.card { width: min(470px, 100%); padding: 24px 26px 22px; border-radius: var(--r-panel); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); margin-bottom: 14px; transition: opacity .45s, transform .45s; }
.card.swap { opacity: 0; transform: translateY(6px); }
.card-step { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card-title { margin: 0 0 10px; font-size: 34px; line-height: 1.05; font-weight: 250; font-variation-settings: 'wdth' 125; letter-spacing: -0.005em; }
.card-body { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.58; max-width: 60ch; transition: opacity .35s; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.facts:empty { display: none; }
.facts div { min-width: 0; }
.facts dt { font-size: 17px; font-weight: 500; font-variation-settings: 'wdth' 112; line-height: 1.15; color: var(--ink); }
.facts dd { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.legend { display: none; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.legend.on { display: flex; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); margin-right: 7px; vertical-align: 0; }
.legend i.sm { width: 6px; height: 6px; }
.cta { display: none; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.cta.on { display: flex; }
.timeline { display: flex; align-items: center; gap: 6px; }
.track { flex: 1; display: flex; gap: 4px; list-style: none; margin: 0 0 0 10px; padding: 0; height: 38px; align-items: center; }
.track li { flex: 1; height: 100%; display: flex; align-items: center; cursor: pointer; position: relative; }
.track li span { display: block; width: 100%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; transition: height .2s; }
.track li:hover span { height: 5px; }
.track li span i { position: absolute; inset: 0; width: 0; background: var(--ink); border-radius: 3px; }
.track li.done span i { width: 100%; background: var(--ink-2); }
.track li em { position: absolute; bottom: 30px; left: 0; font-style: normal; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; background: var(--glass-2); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); }
.track li:hover em { opacity: 1; }
.play .pl { display: none; } .play.paused .pl { display: inline; } .play.paused .pa { display: none; }

/* ---------- micro ---------- */
.micro { right: calc(var(--gut) + 184px); top: 84px; width: min(380px, calc(100vw - 2 * var(--gut))); padding: 20px 22px; border-radius: var(--r-panel); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.micro-head h2 { margin: 0; font-size: 19px; font-weight: 400; font-variation-settings: 'wdth' 118; }
.micro-head p { margin: 4px 0 12px; font-size: 12.5px; color: var(--ink-3); }
#barrier { width: 100%; height: 170px; display: block; border-radius: 10px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.micro-controls { margin-top: 14px; }
body.mode-tour .micro-controls { display: none; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.slider output { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); font-variation-settings: 'wdth' 110; }
.slider input { grid-column: 1 / -1; width: 100%; }
.chance { margin: 8px 0 12px; font-size: 13px; color: var(--ink-3); }
.chance b { color: var(--ink); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.micro-result { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.micro-result b { color: var(--ink); font-weight: 600; }
.mass { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.mass dt { font-size: 11.5px; color: var(--ink-3); }
.mass dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.mlabels { display: none; } body.micro-on .mlabels { display: block; }
.mlabel { position: absolute; left: 0; top: 0; font-size: 12.5px; font-weight: 500; white-space: nowrap; opacity: 0; transition: opacity .4s; padding: 4px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); pointer-events: none; }
.mlabel span { margin-left: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mlabel.m-d { color: #ff7a9a; } .mlabel.m-t { color: #c3a2ff; } .mlabel.m-he { color: var(--gold); } .mlabel.m-n { color: #fff1d0; }

/* range input */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--fill, var(--ink)) 0 var(--p, 50%), rgba(255, 255, 255, 0.12) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--fill, var(--ink)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%; background: var(--vacuum); border: 2px solid var(--fill, var(--ink)); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--vacuum); border: 2px solid var(--fill, var(--ink)); }

/* ---------- labels ---------- */
.labels { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.hs { position: absolute; left: 0; top: 0; pointer-events: auto; transition: opacity .35s; }
.hs-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); background: rgba(5, 7, 10, 0.5); }
.hs-line { position: absolute; left: 0; bottom: 0; width: 1px; height: 34px; background: linear-gradient(to top, var(--ink-2), rgba(255,255,255,0.15)); transform-origin: bottom; }
.hs-txt { position: absolute; left: -2px; bottom: 40px; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--ink); transition: border-color .2s; }
.hs-txt small { color: var(--ink-3); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hs:hover .hs-txt, .hs.on .hs-txt { border-color: var(--cold); }
.hs.on .hs-dot { background: var(--cold); border-color: var(--cold); }

/* ---------- explore ---------- */
.explore { left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 var(--gut); }
.dock { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.detail { position: fixed; z-index: 15; left: var(--gut); top: 84px; width: min(340px, calc(100vw - 2 * var(--gut))); padding: 20px 22px; border-radius: var(--r-panel); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.detail[hidden] { display: none; }
.detail .close { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; }
.d-count { margin: 0 0 4px; font-size: 12.5px; color: var(--cold); font-variant-numeric: tabular-nums; min-height: 1em; }
.detail h2 { margin: 0 34px 8px 0; font-size: 22px; font-weight: 300; font-variation-settings: 'wdth' 122; line-height: 1.15; }
.detail p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.detail dl { margin: 14px 0 0; display: grid; gap: 0; }
.detail dl div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.detail dt { color: var(--ink-3); }
.detail dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- operate ---------- */
.operate { inset: 0; pointer-events: none !important; }
body.mode-operate .operate > * { pointer-events: auto; }
.panel { position: fixed; top: 76px; padding: 18px 18px 16px; border-radius: var(--r-panel); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: auto; scrollbar-width: thin; }
.panel h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.seq { left: var(--gut); width: 290px; max-height: calc(100vh - 76px - 130px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 10px 8px 10px 4px; border-radius: 12px; transition: background .3s, opacity .3s; }
.steps li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.steps li b { display: block; font-weight: 500; font-size: 13.5px; }
.steps li small { display: block; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.steps li.locked { opacity: 0.4; }
.steps li.locked .btn { pointer-events: none; }
.steps li.active { background: rgba(143, 211, 255, 0.07); }
.steps li.active .n { border-color: var(--cold); color: var(--cold); }
.steps li.done .n { background: var(--ink); color: #0a0d12; border-color: var(--ink); }
.steps li.done .btn, .steps li.active .btn { visibility: hidden; }
.seq-actions { display: grid; gap: 8px; margin-top: 14px; }
.note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.readout { right: calc(var(--gut) + 184px); width: 330px; max-height: calc(100vh - 76px - 130px); }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.phase { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.chips { display: flex; gap: 6px; flex: none; }
.chip { flex: none; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--cold); border-color: rgba(143, 211, 255, 0.5); background: var(--cold-soft); }
.phase::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.phase.live::before { background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.phase.alarm { color: #ff8d84; }
.phase.alarm::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.bigs { display: grid; grid-template-columns: 1.25fr 1fr 0.8fr; gap: 10px; }
.big { display: flex; flex-direction: column; min-width: 0; }
.big .lbl { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.big .val { font-size: 22px; font-weight: 400; font-variation-settings: 'wdth' 112; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.big .sub { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.big.hot .val { color: #ff7d9b; }
.big.gold .val { color: var(--gold); }
#trace { width: 100%; height: 96px; display: block; margin-top: 12px; }
.trace-key { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.trace-key .k::before { content: ''; display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.trace-key .k.hot { color: #ff7d9b; } .trace-key .k.gold { color: var(--gold); }
.lawson { margin-top: 14px; }
.l-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.l-head b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.l-bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); margin: 6px 0 4px; overflow: visible; }
.l-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: linear-gradient(to right, var(--hot), var(--gold)); transition: width .3s; }
.l-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.l-foot { font-size: 11px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.stats dt { font-size: 11.5px; color: var(--ink-3); }
.stats dd { margin: 1px 0 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.limits { display: grid; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lim { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.lim span { color: var(--ink-2); }
.lim b { font-weight: 600; font-variant-numeric: tabular-nums; }
.lim .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); position: relative; overflow: hidden; }
.lim .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink-2); border-radius: 4px; transition: width .3s, background .3s; }
.lim.warn b { color: var(--gold); } .lim.warn .bar i { background: var(--gold); }
.lim.crit b { color: #ff8d84; } .lim.crit .bar i { background: var(--danger); }
.lim small { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); }
.console { position: fixed; left: var(--gut); right: calc(var(--gut) + 184px); bottom: 18px; display: flex; gap: 18px; align-items: center; padding: 14px 18px; border-radius: var(--r-panel); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sliders { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 18px; }
.sl { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.sl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl output { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 14px; font-variation-settings: 'wdth' 108; white-space: nowrap; }
.sl input { width: 100%; margin-top: 2px; }
.sl.cold { --fill: var(--cold); } .sl.hot { --fill: var(--hot); } .sl.neutral { --fill: var(--ink-2); }
.sl.off { opacity: 0.35; pointer-events: none; }
.console-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.console-actions .btn { padding: 8px 14px; font-size: 13px; }
.m-only { display: none; }
#opSPI.ready { border-color: var(--cold); color: var(--cold); animation: pulse 0.8s infinite alternate; }
@keyframes pulse { to { background: rgba(143, 211, 255, 0.18); } }

/* ---------- alert & report ---------- */
.alert { position: fixed; z-index: 30; left: 50%; top: 74px; transform: translate(-50%, -8px); padding: 10px 18px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 500; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.alert.show { opacity: 1; transform: translate(-50%, 0); }
.alert.danger { border-color: var(--danger); color: #ffb0a9; background: rgba(60, 10, 12, 0.8); }
.alert.good { border-color: var(--gold); color: var(--gold); }
.alert.cold { border-color: var(--cold); color: var(--cold); }
.report { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); padding: 24px 26px; border-radius: var(--r-panel); background: rgba(12, 15, 20, 0.9); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.report[hidden] { display: none; }
.report h2 { margin: 0 0 8px; font-size: 24px; font-weight: 300; font-variation-settings: 'wdth' 122; }
.report p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.report dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 16px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.report dt { font-size: 11.5px; color: var(--ink-3); }
.report dd { margin: 1px 0 0; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- dive overlay ---------- */
.dive { position: fixed; inset: 0; z-index: 25; display: grid; place-content: center; text-align: center; pointer-events: none; opacity: 0; transition: opacity .35s; }
.dive.on { opacity: 1; }
.dive-val { font-size: clamp(48px, 9vw, 120px); font-weight: 200; font-variation-settings: 'wdth' 125; font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 40px rgba(255, 61, 110, 0.6); }
.dive-lbl { margin-top: 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; padding: 0 var(--gut) 12vh; background: radial-gradient(ellipse at 50% 40%, rgba(5, 7, 10, 0.2), rgba(5, 7, 10, 0.85) 70%); transition: opacity .9s; }
.intro.gone { opacity: 0; pointer-events: none; }
.intro-inner { max-width: 1100px; width: 100%; margin: 0 auto; }
.intro-mark { margin: 0; font-size: clamp(64px, 14vw, 200px); line-height: 0.9; font-weight: 150; font-variation-settings: 'wdth' 125; letter-spacing: -0.01em; }
.intro-lede { margin: 18px 0 26px; max-width: 46ch; font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); line-height: 1.5; }
.intro-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.intro-load { margin: 18px 0 0; font-size: 12.5px; color: var(--ink-3); min-height: 1.5em; }

.credit { position: fixed; z-index: 21; right: var(--gut); bottom: 6px; font-size: 11px; color: var(--ink-3); text-decoration: none; letter-spacing: 0.01em; opacity: 0.8; }
.credit:hover { color: var(--ink-2); }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; }

/* mode visibility */
body.mode-intro .bar, body.mode-intro .thermo { opacity: 0; }
.bar, .thermo { transition: opacity .8s; }
body.micro-on .thermo { opacity: 0.25; }
body.micro-on .explore { opacity: 0; pointer-events: none; }
body.micro-on #labels { opacity: 0; }
body.micro-on.mode-tour .tour .card { width: min(430px, 100%); }
body.mode-tour .detail { display: none; }
body:not(.mode-explore) .detail { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .sliders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thermo { width: 120px; }
  .thermo-ticks li { font-size: 10.5px; }
  .thermo-ticks li span { display: none; }
  .readout, .micro { right: calc(var(--gut) + 136px); }
  .console { right: calc(var(--gut) + 136px); }
}
@media (max-width: 960px) {
  :root { --gut: 14px; }
  .bar { grid-template-columns: 1fr auto; row-gap: 10px; padding-top: 12px; }
  .modes { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .tag { display: none; }
  .thermo { top: auto; bottom: auto; right: auto; left: var(--gut); top: 104px; width: auto; height: 0; }
  .thermo-rail, .thermo-ticks { display: none; }
  .thermo-mark { position: fixed; right: auto; transform: none; flex-direction: row; transition: none; }
  .thermo-mark.hot { left: auto; right: var(--gut); top: 66px !important; }
  .thermo-mark.cold { left: auto; right: calc(var(--gut) + 170px); top: 66px !important; }
  .thermo-mark i { width: 10px; height: 10px; }
  .micro { right: var(--gut); left: var(--gut); top: auto; bottom: 18px; width: auto; max-height: 52vh; overflow: auto; }
  body.micro-on.mode-tour .tour .card { display: none; }
  .readout { right: var(--gut); left: auto; width: min(330px, calc(100vw - 2 * var(--gut))); top: 136px; max-height: 38vh; }
  .seq { top: 136px; width: min(290px, calc(100vw - 2 * var(--gut))); max-height: 38vh; }
  .console { right: var(--gut); flex-direction: column; align-items: stretch; max-height: 34vh; overflow: auto; }
  .console-actions { flex-direction: row; }
  .card { padding: 18px 18px 16px; }
  .card-title { font-size: 26px; }
  .facts dt { font-size: 15px; }
  .detail { top: auto; bottom: 150px; }
  .dock { gap: 6px; }
  .seg button { padding: 6px 10px; font-size: 12.5px; }
}
@media (max-width: 720px) {
  body.mode-operate.op-live .seq { display: none; }
  body.mode-operate:not(.op-live) .readout { display: none; }
  body.op-live .m-only { display: inline-flex; }
  #opCtl.m-only { display: inline-flex; }
  .console:not(.open) .sliders { display: none; }
  .alert { top: 116px; }
  .console { max-height: 46vh; }
  .thermo-mark.cold { display: none; }
  .console-actions { flex-wrap: wrap; }
  .console-actions .btn { flex: 1 1 auto; }
  .readout { top: 136px; left: var(--gut); right: var(--gut); width: auto; max-height: 30vh; }
  .bigs { grid-template-columns: 1fr 1fr 1fr; }
  .big .val { font-size: 17px; }
  #trace, .trace-key, .stats { display: none; }
  .sliders { grid-template-columns: 1fr 1fr; }
  .sl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reactor button { padding: 6px 9px; }
  .bar-right .icon { width: 34px; height: 34px; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .card-body { font-size: 14px; }
  .explore .hint { display: none; }
  .credit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation: none !important; }
}
