/* Cyber Covid — design system.
   One full-screen scene: the Earth, with the instrument panel set around it in type and hairlines.
   No cards. The only hues are the three states and the thermal scale they sit on.

   Type: IBM Plex Sans (text), Plex Sans Condensed (labels), Plex Mono (figures).
   Scale: 11 label · 12 meta · 13 small · 14 body · 16 lead · display for the one reading.
   Space: 4px base; rails are 28px from the edges; rules are 1px. */

:root {
  --bg: #05070b;
  --raised: #0c1017;
  --ink: #eef1f5;
  --ink-2: #aeb6c2;
  --ink-3: #78818f;
  --rule: rgba(255, 255, 255, .09);
  --rule-2: rgba(255, 255, 255, .2);
  --red: #ff4438;
  --amber: #ffc23d;
  --green: #2fd39b;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: 28px;
  --left: 300px;
  --right: 384px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; font-weight: inherit; font-size: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; padding: 0; border-radius: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#scene.grab { cursor: grabbing; }
#scene.hot { cursor: pointer; }

/* labels: condensed capitals, used for every section and field name */
.label, .sec-h, .vit dt, .d-facts dt, th, .k, .tag, .case-meta b, .scale, .dock-sub, .states dt, .prose h3 {
  font-family: var(--cond); font-weight: 500; font-size: 11.5px; line-height: 16px; letter-spacing: .09em; text-transform: uppercase;
}
.label, .sec-h, .vit dt, .d-facts dt, th, .k, .dock-sub, .prose h3 { color: var(--ink-3); }

/* state marks: one mark per state, the same everywhere */
.m { display: inline-block; flex: none; width: 7px; height: 7px; margin-right: 8px; }
.m-inf { background: var(--red); }
.m-con { border: 1.5px solid var(--amber); }
.m-clean { background: var(--green); transform: scale(.6); }
.m-orbit { background: var(--ink-2); transform: rotate(45deg) scale(.8); }

/* ── header ── */
.top { position: fixed; inset: 0 0 auto 0; z-index: 10; height: 56px; padding: 0 var(--pad); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; border-bottom: 1px solid var(--rule); background: linear-gradient(rgba(5, 7, 11, .92), rgba(5, 7, 11, .6)); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
h1 { font: 600 15px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.top-nav { display: flex; align-self: stretch; gap: 26px; }
.top-nav button { position: relative; font: 500 12.5px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; transition: color 140ms; }
.top-nav button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease); }
.top-nav button:hover { color: var(--ink); }
.top-nav button:hover::after { transform: none; }
.top-nav b { margin-left: 6px; font: 400 11.5px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.status { display: inline-flex; align-items: center; font: 500 12.5px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; margin-right: 9px; background: var(--red); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }
.status-sep { width: 1px; height: 12px; margin: 0 14px; background: var(--rule-2); }
.clock { font: 400 12px var(--mono); letter-spacing: 0; text-transform: none; color: var(--ink-3); }

/* ── rails ── */
.hud { position: fixed; z-index: 8; top: 80px; bottom: 148px; display: flex; flex-direction: column; min-height: 0; }
.hud-left { left: var(--pad); width: var(--left); gap: 22px; overflow-y: auto; scrollbar-width: none; }
.hud-left::-webkit-scrollbar { display: none; }
.hud-right { right: var(--pad); width: var(--right); overflow: hidden; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2); }
.sec-h span { font: 400 11.5px var(--mono); letter-spacing: 0; text-transform: none; }
.sec-h button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); border-bottom: 1px solid var(--rule-2); }
.sec-h button:hover { border-color: var(--ink); }

.hero { flex: none; }
.temp { display: flex; align-items: flex-start; margin: 4px 0 0 -4px; font: 300 clamp(64px, 10.4vh, 92px)/.96 var(--font); letter-spacing: -.045em; transition: color 600ms; }
.temp small { margin: .2em 0 0 .16em; font: 400 .2em var(--mono); letter-spacing: 0; color: var(--ink-3); }
.lead-line { margin-top: 10px; font-size: 16px; font-weight: 500; letter-spacing: -.005em; }
.lead-line b { font-weight: 600; }
.diag { margin-top: 2px; max-width: 34ch; color: var(--ink-2); font-size: 13.5px; }
.diag b { margin-right: 6px; font-weight: 600; color: var(--red); }
.diag b.ok { color: var(--green); }

.vit { flex: none; border-top: 1px solid var(--rule-2); }
.vit div { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 31px; border-bottom: 1px solid var(--rule); }
.vit dt { display: flex; align-items: center; white-space: nowrap; }
.vit dd { font: 500 14px var(--mono); white-space: nowrap; }
.vit dd small { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }

.sectors { flex: none; }
#sectors button { display: grid; grid-template-columns: minmax(0, 1fr) 62px 18px 22px 24px; align-items: center; column-gap: 8px; width: 100%; height: 23px; text-align: left; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--rule); transition: color 140ms, opacity 200ms, background 140ms; }
#sectors button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sectors .bar { display: flex; gap: 1px; height: 3px; background: rgba(255, 255, 255, .06); }
#sectors .bar i { min-width: 0; }
.b-inf { background: var(--red); } .b-con { background: var(--amber); } .b-clean { background: rgba(47, 211, 155, .45); }
#sectors .n { text-align: right; font: 400 11.5px var(--mono); }
#sectors .n-inf { color: var(--red); } #sectors .n-con { color: var(--amber); } #sectors .n-clean { color: var(--ink-3); }
#sectors .zero { color: #4a515c; }
#sectors button:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
#sectors button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, .08); }
#sectors.filtered button[aria-pressed="false"] { opacity: .4; }

/* ── incident stream ── */
.pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#feed { flex: 1; min-height: 0; overflow: hidden; }
.case { position: relative; display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-content: center; padding: 10px 0 11px; border-bottom: 1px solid var(--rule); transition: background 140ms; }
.case:hover { background: linear-gradient(90deg, rgba(255, 255, 255, .05), transparent); }
.case.is-sel { background: linear-gradient(90deg, rgba(255, 255, 255, .1), transparent 85%); }
.sevbar { grid-column: 1; grid-row: 1 / 4; align-self: stretch; display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.sevbar i { flex: 1; background: rgba(255, 255, 255, .1); }
.case.inf .sevbar i.on { background: var(--red); }
.case.con .sevbar i.on { background: var(--amber); }
.case-org { grid-column: 2; grid-row: 1; font-weight: 600; font-size: 14px; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-org::after { content: ""; position: absolute; inset: 0; }
.case-age { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; font: 400 11.5px var(--mono); color: var(--ink-3); }
.case-meta { grid-column: 2; grid-row: 2; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-meta b { display: inline-block; max-width: 168px; margin-right: 8px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--ink-2); }
.src { grid-column: 3; grid-row: 2; justify-self: end; position: relative; z-index: 1; font: 400 11.5px var(--mono); color: var(--ink-3); white-space: nowrap; transition: color 140ms; }
.src::after { content: "↗"; display: inline-block; margin-left: 4px; transition: transform 140ms; }
.src:hover { color: var(--ink); }
.src:hover::after { transform: translate(1px, -1px); }
.case-imp { grid-column: 2 / -1; grid-row: 3; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case.is-new { animation: rise 520ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── case file ── */
.dossier { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2a303a transparent; padding-right: 6px; animation: fade 300ms var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.d-bar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2); }
.d-back { font: 500 11.5px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); transition: color 140ms; }
.d-back:hover { color: var(--ink); }
.tag { display: inline-flex; align-items: center; }
.tag.inf { color: var(--red); } .tag.con { color: var(--amber); }
.d-title { margin-top: 18px; font-size: 26px; line-height: 1.12; font-weight: 500; letter-spacing: -.025em; overflow-wrap: anywhere; }
.d-where { margin-top: 5px; color: var(--ink-3); font-size: 13px; }
.d-impact { margin-top: 16px; font-size: 16px; line-height: 1.4; font-weight: 500; }
.d-summary { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.d-actions { display: flex; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border: 1px solid var(--rule-2); font: 500 12.5px var(--cond); letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; transition: background 140ms, border-color 140ms, color 140ms, transform 140ms; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--ink); color: #05070b; border-color: var(--ink); font-weight: 600; }
.btn-main:hover { background: #fff; border-color: #fff; }
.d-facts { margin-top: 20px; border-top: 1px solid var(--rule-2); }
.d-facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.d-facts small { color: var(--ink-3); margin-left: 6px; font-size: 12.5px; }
.sev { display: inline-flex; gap: 2px; margin-right: 8px; }
.sev i { width: 14px; height: 6px; background: rgba(255, 255, 255, .1); }
.sev i.on { background: currentColor; }
.k { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 7px; border-bottom: 1px solid var(--rule-2); }
.k span { font: 400 11.5px var(--mono); letter-spacing: 0; text-transform: none; }
.d-h { margin-top: 22px; }
.d-list li { border-bottom: 1px solid var(--rule); }
.d-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto 12px; gap: 10px; align-items: center; min-height: 42px; padding: 5px 0; }
.d-list b { display: flex; align-items: center; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-list small { display: block; color: var(--ink-3); font-size: 12px; }
.d-list time { color: var(--ink-3); font: 400 11.5px var(--mono); white-space: nowrap; }
.d-list .arr { color: var(--ink-3); font-size: 12px; transition: transform 140ms, color 140ms; }
.d-list a:hover .arr { color: var(--ink); transform: translate(1px, -1px); }
.d-list a:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }

/* ── timeline ── */
.dock { position: fixed; z-index: 8; left: var(--pad); right: var(--pad); bottom: 20px; height: 108px; display: grid; grid-template-columns: auto 148px minmax(0, 1fr); align-items: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.play { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--rule-2); color: var(--ink); transition: background 140ms, color 140ms, border-color 140ms, transform 140ms; }
.play:hover { background: var(--ink); color: #05070b; border-color: var(--ink); }
.play:active { transform: scale(.95); }
.dock-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.date { font: 500 17px/1.2 var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.dock-sub { display: flex; gap: 10px; white-space: nowrap; }
.now { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); border-bottom: 1px solid var(--rule-2); }
.now:hover { border-color: var(--ink); }
.tl { position: relative; height: 84px; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.tl svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tl-tick { fill: var(--ink-3); font: 400 11px var(--mono); }
.tl-base { stroke: var(--rule-2); }
.tl-block { fill: rgba(255, 255, 255, .09); transition: fill 200ms; }
.tl-block.inf { fill: var(--red); } .tl-block.con { fill: var(--amber); }
.tl-block.is-sel { stroke: #fff; stroke-width: 1.5; }
.tl-block:hover { filter: brightness(1.3); }
.tl-head { stroke: #fff; stroke-width: 1; }
.tl-knob { fill: #fff; }

/* ── thermal scale: the legend for the whole map ── */
.scale { position: fixed; z-index: 7; pointer-events: none; right: calc(var(--right) + var(--pad) + 36px); top: 112px; bottom: 196px; width: 40px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--ink-3); font: 400 11px var(--mono); letter-spacing: 0; text-transform: none; transition: opacity 800ms var(--ease) 200ms; }
.scale-bar { position: relative; flex: 1; width: 4px; background: linear-gradient(to top, #10a880 0%, #8fcf52 18%, #fcd629 35%, #fc6b1a 56%, #f01c33 76%, #fff7ea 100%); }
#scale-mark { position: absolute; left: -6px; right: -6px; height: 1px; background: #fff; transition: bottom 500ms var(--ease); }
#scale-val { position: absolute; right: 18px; top: -9px; padding: 1px 6px; background: #fff; color: #05070b; font: 500 11.5px/16px var(--mono); }
.booting .scale { opacity: 0; }

.hint { position: fixed; z-index: 7; left: 50%; bottom: 156px; translate: -50% 0; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; pointer-events: none; transition: opacity 500ms; }
.hint.gone { opacity: 0; }

.labels { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.lab { position: absolute; left: 0; top: 0; display: flex; align-items: center; height: 22px; padding: 0 8px 0 9px; background: rgba(5, 7, 11, .86); border-left: 2px solid var(--red); font-size: 12.5px; font-weight: 500; white-space: nowrap; will-change: transform; }
.lab.con { border-left-color: var(--amber); }
.lab.is-sel { background: var(--ink); color: #05070b; }
.reticle { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border: 1px solid #fff; border-radius: 50%; will-change: transform; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: #fff; opacity: .7; }
.reticle::before { left: 50%; top: -9px; width: 1px; height: 46px; margin-left: -.5px; }
.reticle::after { top: 50%; left: -9px; height: 1px; width: 46px; margin-top: -.5px; }

.tip { position: fixed; left: 0; top: 0; z-index: 40; max-width: 300px; padding: 9px 12px 10px; background: var(--raised); border: 1px solid var(--rule-2); box-shadow: 0 18px 44px rgba(0, 0, 0, .55); color: var(--ink-2); font-size: 13px; line-height: 1.45; pointer-events: none; }
.tip b { display: flex; align-items: center; color: var(--ink); font-size: 14px; font-weight: 600; }
.tip em { font-style: normal; color: var(--ink-3); }

/* ── sheets ── */
.sheet { width: min(1240px, calc(100vw - 56px)); height: min(86vh, 900px); max-width: none; max-height: none; padding: 0; background: var(--raised); color: var(--ink); border: 1px solid var(--rule-2); box-shadow: 0 32px 80px rgba(0, 0, 0, .6); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in 260ms var(--ease); }
.sheet-narrow { width: min(640px, calc(100vw - 32px)); height: auto; max-height: 88vh; }
.sheet::backdrop { background: rgba(3, 4, 7, .72); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 20px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--rule-2); flex: none; }
.sheet-head h2 { font: 600 14px var(--cond); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.sheet-head input { flex: 1; min-width: 0; max-width: 420px; height: 34px; padding: 0 12px; border: 1px solid var(--rule-2); outline: 0; font-size: 13.5px; transition: border-color 140ms; }
.sheet-head input:focus { border-color: var(--ink); }
.sheet-head input::placeholder { color: var(--ink-3); }
.x { display: grid; place-items: center; margin-left: auto; width: 32px; height: 32px; color: var(--ink-2); transition: background 140ms, color 140ms; }
.x:hover { color: #05070b; background: var(--ink); }
.sheet-body { overflow: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #2a303a transparent; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 10px; background: var(--raised); text-align: left; border-bottom: 1px solid var(--rule-2); }
td { height: 40px; padding: 0 10px; border-bottom: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th:first-child, td:first-child { padding-left: 20px; width: 20%; } th:last-child, td:last-child { padding-right: 20px; }
th:nth-child(2) { width: 13%; } th:nth-child(3) { width: 15%; } th:nth-child(4) { width: 13%; } th:nth-child(5) { width: 104px; } th:nth-child(6) { width: 60px; } th:nth-child(8) { width: 176px; }
.r { text-align: right; }
td.r { font: 400 12px var(--mono); color: var(--ink); }
td:first-child { color: var(--ink); font-weight: 600; }
tbody tr { cursor: pointer; transition: background 140ms; }
tbody tr:hover { background: rgba(255, 255, 255, .045); }
td.open { color: var(--red); }
.prose { padding: 20px 20px 24px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.prose .lead { color: var(--ink); font-size: 17px; line-height: 1.45; letter-spacing: -.01em; }
.prose h3 { margin-top: 24px; padding-bottom: 7px; border-bottom: 1px solid var(--rule-2); }
.prose > p { margin-top: 14px; }
.states { margin-top: 18px; border-top: 1px solid var(--rule-2); }
.states div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.states dt { display: flex; align-items: center; height: 22px; color: var(--ink); }
.sources { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.sources a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); color: var(--ink); font-size: 13.5px; }
.sources a span { color: var(--ink-3); font: 400 11.5px var(--mono); white-space: nowrap; }
.sources a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fine { color: var(--ink-3); font-size: 12.5px; }

/* ── intro ── */
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--bg); transition: opacity 900ms var(--ease), visibility 0s 900ms; pointer-events: none; }
.boot-say { font-size: clamp(32px, 5.6vw, 84px); line-height: 1; font-weight: 300; letter-spacing: -.04em; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--ease), transform 900ms var(--ease); }
.boot.say .boot-say { opacity: 1; transform: none; }
.boot-bar { position: absolute; left: 50%; bottom: 14vh; width: 120px; height: 1px; translate: -50% 0; background: rgba(255, 255, 255, .14); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: #fff; transform-origin: left; animation: load 1700ms cubic-bezier(.5, 0, .2, 1) both; }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
body:not(.booting) .boot { opacity: 0; visibility: hidden; }
.top, .hud, .dock, .hint { transition: opacity 900ms var(--ease), transform 1100ms var(--ease); }
.booting .top, .booting .hud, .booting .dock, .booting .hint { opacity: 0; }
.booting .hud-left { transform: translateX(-16px); } .booting .hud-right { transform: translateX(16px); } .booting .dock { transform: translateY(16px); }
.hud-right { transition-delay: 90ms; } .dock { transition-delay: 180ms; }

/* desktop: the rows of the stream share the rail's height, so it never ends on a gap */
@media (min-width: 1101px) {
  #feed { display: flex; flex-direction: column; }
  .case { flex: 1 1 0; max-height: 104px; }
}
@media (max-height: 800px) and (min-width: 1101px) {
  .hud { top: 72px; } .hud-left { gap: 16px; }
  .vit div { height: 27px; } #sectors button { height: 21px; }
}
@media (max-width: 1280px) and (min-width: 1101px) {
  :root { --left: 264px; --right: 320px; }
  .status-sep, .clock { display: none; }
  #sectors button { grid-template-columns: minmax(0, 1fr) 18px 22px 24px; } #sectors .bar { display: none; }
}

/* ── phone and tablet: the Earth on top, the panel scrolls under it ── */
@media (max-width: 1100px) {
  :root { --pad: 16px; }
  body { height: auto; overflow: visible; overflow-x: hidden; padding: calc(52px + 52svh) 0 28px; display: flex; flex-direction: column; gap: 24px; }
  #scene { top: 52px; height: 52svh; touch-action: pan-y; }
  .top { height: 52px; gap: 16px; background: var(--bg); }
  .status { display: none; }
  .top-nav { justify-content: flex-end; gap: 18px; }
  .hud, .dock { position: relative; inset: auto; width: auto; margin: 0 var(--pad); z-index: 8; background: var(--bg); }
  .dock { order: 1; height: auto; grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; padding-top: 14px; }
  .dock .tl { grid-column: 1 / -1; height: 80px; }
  .hud-left { order: 2; overflow: visible; }
  .hud-right { order: 3; overflow: visible; }
  .hud-right:has(.dossier:not([hidden])) { z-index: 50; }
  .temp { font-size: 84px; }
  .diag { max-width: none; }
  .vit div { height: 40px; } .vit dd { font-size: 15px; }
  #sectors button { height: 38px; font-size: 14px; }
  #feed { overflow: visible; }
  .case { padding: 13px 0 14px; }
  .scale { display: none; }
  .hint { position: absolute; top: calc(52px + 52svh - 30px); bottom: auto; }
  .labels { top: 52px; height: 52svh; }
  .dossier { position: fixed; inset: 0; z-index: 50; background: var(--bg); padding: 16px var(--pad) 32px; }
  .d-actions .btn { flex: 1; height: 46px; }
  .tip { display: none; }
  .booting .hud-left, .booting .hud-right, .booting .dock { transform: none; }
  .sheet { width: 100vw; height: 100dvh; border: 0; }
  .sheet-head { flex-wrap: wrap; gap: 10px; padding: 12px 12px 12px 16px; }
  .sheet-head input { order: 3; flex-basis: 100%; max-width: none; height: 42px; }
  thead { display: none; }
  table, tbody { display: block; }
  tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
  td { display: none; height: auto; padding: 0 !important; border: 0; width: auto !important; }
  td:first-child, td:nth-child(4), td:nth-child(5), td:nth-child(8) { display: block; }
  td:nth-child(5), td:nth-child(8) { text-align: right; }
  td:nth-child(4) { color: var(--ink-3); font-size: 12.5px; }
  .sources { grid-template-columns: 1fr; }
  .states div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; }
}

/* ═══ HUD v2: the panel of a thermal imaging station ═══════════════════════════════════════════
   Every block is an instrument: a framed panel with one cut corner and a filled name tab,
   and inside it a gauge, a trace, a ring or a matrix drawn from the data — not a list of text. */

.panel { position: relative; padding: 12px 14px 13px; background: rgba(6, 9, 15, .78); border: 1px solid var(--rule); clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%); }
.panel::after { content: ""; position: absolute; top: 13px; right: -1px; width: 19px; height: 1px; background: var(--rule-2); transform-origin: 100% 0; transform: rotate(45deg); pointer-events: none; }
.ph { display: flex; align-items: stretch; justify-content: space-between; height: 22px; margin: -12px -14px 12px; border-bottom: 1px solid var(--rule); font: 600 11px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
.ph > span { display: flex; align-items: center; padding: 0 9px; background: var(--ink); color: #05070b; }
.ph > em { display: flex; align-items: center; gap: 10px; padding-right: 24px; font: 400 11px var(--mono); font-style: normal; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.ph i { font-style: normal; }
.ph button { font: 500 11px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--rule-2); }
.ph button:hover { border-color: var(--ink); }

.hud-left { gap: 10px; }

/* vitals: the reading, its place on the scale, and the pulse */
.hero .temp { margin: 0 0 0 -4px; font-size: clamp(60px, 9.4vh, 84px); }
.gauge { position: relative; margin-top: 10px; padding-bottom: 17px; }
.gauge-bar { position: relative; height: 6px; background: linear-gradient(to right, #10a880 0%, #8fcf52 18%, #fcd629 35%, #fc6b1a 56%, #f01c33 76%, #fff7ea 100%); }
.gauge-bar::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: repeating-linear-gradient(to right, var(--rule-2) 0 1px, transparent 1px calc(100% / 27)); }
#scale-mark { position: absolute; top: -4px; left: 0; right: auto; bottom: auto; width: 2px; height: 14px; margin: 0 0 0 -1px; background: #fff; transition: left 500ms var(--ease); }
#scale-mark::before { content: ""; position: absolute; left: -3px; top: -4px; border: 4px solid transparent; border-top-color: #fff; }
.gauge-ticks span { position: absolute; top: 12px; translate: -50% 0; font: 400 10.5px var(--mono); color: var(--ink-3); }
.gauge-ticks span:first-child { translate: 0 0; } .gauge-ticks span:last-child { translate: -100% 0; }
.hero .lead-line { margin-top: 9px; font-size: 15px; }
.hero .diag { max-width: none; font-size: 13px; }
.pulse { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.pulse-h { display: flex; justify-content: space-between; align-items: baseline; font: 500 11px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.pulse-h em { font: 400 10.5px var(--mono); font-style: normal; letter-spacing: 0; text-transform: none; }
#pulse { height: 38px; margin-top: 4px; }
#pulse svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pulse-base { stroke: var(--rule-2); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.pulse-line { stroke: var(--red); stroke-width: 1.5; fill: none; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* four small instruments */
.vit { display: grid; grid-template-columns: 1fr 1fr; padding: 0; border: 1px solid var(--rule); }
.vit div { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; justify-content: start; height: auto; padding: 9px 12px 10px; border-bottom: 0; }
.vit div:nth-child(odd) { border-right: 1px solid var(--rule); }
.vit div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
.ring { grid-row: 1 / 3; width: 34px; height: 34px; }
.ring circle { fill: none; stroke-width: 3; stroke: rgba(255, 255, 255, .1); }
.ring circle + circle { transition: stroke-dasharray 500ms var(--ease); }
#ring-con { stroke: var(--amber); } #ring-clean { stroke: var(--green); }
.vit dt { grid-column: 2; align-self: end; font-size: 10.5px; }
.vit div:nth-child(n+3) dt, .vit div:nth-child(n+3) dd { grid-column: 1 / -1; }
.vit dd { grid-column: 2; align-self: start; font: 500 16px/1.2 var(--mono); letter-spacing: -.02em; }
.vit dd small { font-size: 10.5px; }

/* sector intelligence: sector by month, on the thermal scale */
.sectors { padding-bottom: 8px; }
#sectors button { grid-template-columns: minmax(0, 1fr) 143px 14px 22px; column-gap: 8px; height: 17px; font-size: 12px; border-bottom: 0; }
#sectors .mx { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; height: 11px; }
#sectors .mx i { background: rgba(255, 255, 255, .06); transition: transform 120ms; }
#sectors .mx i:hover { transform: scale(1.5); outline: 1px solid #fff; position: relative; z-index: 1; }
#sectors .n { font-size: 11px; color: var(--ink-3); }
#sectors .n.n-inf { color: var(--red); }

/* incident stream: a time spine, a thermal severity mark, then the facts */
.hud-right.panel { padding-bottom: 0; }
.case { grid-template-columns: 30px 24px minmax(0, 1fr) auto; column-gap: 10px; padding: 10px 0 11px; }
.case::before { content: ""; position: absolute; left: 41px; top: 0; bottom: 0; width: 1px; background: var(--rule-2); }
.case:first-child::before { top: 14px; }
.case-age { grid-column: 1; grid-row: 1; justify-self: start; align-self: center; }
.chip { position: relative; grid-column: 2; grid-row: 1 / 3; align-self: start; display: grid; place-items: center; width: 24px; height: 24px; margin-top: -1px; font: 500 12px var(--mono); color: #05070b; background: var(--amber); }
.case.con .chip { background: var(--bg); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.case-org { grid-column: 3; }
.case-meta { grid-column: 3; }
.case-meta b { padding: 0 5px; margin-right: 8px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 10.5px; line-height: 15px; }
.src { grid-column: 4; grid-row: 1; align-self: center; }
.case-imp { grid-column: 3 / -1; }
.case.empty::before { display: none; }
.case.empty .case-imp { grid-column: 1 / -1; }
.sevbar { display: none; }

/* the limb around the planet */
.bezel { position: fixed; left: 0; top: 0; z-index: 5; width: 660px; height: 660px; margin: -330px 0 0 -330px; pointer-events: none; overflow: visible; transition: opacity 900ms var(--ease) 200ms; }
.bezel circle { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bezel line { stroke: rgba(255, 255, 255, .28); stroke-width: 1; vector-effect: non-scaling-stroke; transform-box: view-box; transform-origin: 0 0; }
.bezel line.maj { stroke: rgba(255, 255, 255, .6); }
.bezel .idx { fill: #fff; }
.view { position: fixed; left: 0; top: 0; z-index: 6; translate: -50% 0; font: 400 11px var(--mono); color: var(--ink-2); white-space: pre; pointer-events: none; transition: opacity 900ms var(--ease) 200ms; }
.booting .bezel, .booting .view { opacity: 0; }

@media (max-height: 800px) and (min-width: 1101px) {
  .hero .temp { font-size: 56px; } #pulse { height: 28px; } #sectors button { height: 15px; } .vit div { padding: 6px 12px 7px; height: auto; }
}
@media (max-width: 1280px) and (min-width: 1101px) {
  #sectors button { grid-template-columns: minmax(0, 1fr) 108px 14px 22px; } #sectors .mx { display: grid; }
}
@media (max-width: 1100px) {
  .hud-left { gap: 12px; }
  .hero .temp { font-size: 84px; }
  #sectors button { height: 30px; font-size: 13.5px; grid-template-columns: minmax(0, 1fr) minmax(120px, 40%) 16px 26px; }
  #sectors .mx { height: 16px; }
  .vit div { padding: 12px 14px; }
  .view { display: none; }
  .hud-right.panel { padding-bottom: 6px; }
}

/* fixes after the first look */
.hud-right.panel { position: fixed; }
.bezel #limb-ticks { transform-box: view-box; transform-origin: 0 0; }
.bezel line { transform-box: fill-box; transform-origin: initial; }
.bezel circle { stroke: rgba(255, 255, 255, .16); }
.hero .temp { font-size: clamp(56px, 8.6vh, 76px); }
.gauge { margin-top: 8px; }
.hero .diag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse { margin-top: 8px; padding-top: 7px; }
#pulse { height: 34px; }
.vit div { padding: 7px 12px 8px; }
#sectors button { grid-template-columns: minmax(0, 1fr) 132px 14px 22px; height: 16px; }
.sectors { padding-bottom: 9px; }
@media (max-width: 1100px) {
  .hud-right.panel { position: relative; }
  .hero .temp { font-size: 84px; }
  .hero .diag { white-space: normal; }
  #sectors button { height: 30px; grid-template-columns: minmax(0, 1fr) minmax(120px, 40%) 16px 26px; }
  .vit div { padding: 12px 14px; }
}

.bezel line { transform-box: view-box; transform-origin: 0 0; }
.case-meta { grid-column: 3 / -1; }

/* the stream shows the day and the time of the first report */
.case { grid-template-columns: 44px 24px minmax(0, 1fr) auto; }
.case::before { left: 66px; }
.case-age { grid-row: 1 / 3; align-self: start; display: flex; flex-direction: column; padding-top: 3px; line-height: 14px; white-space: nowrap; }
.case-age b { font-weight: 400; color: var(--ink-2); }
.case-age i { font-style: normal; color: var(--ink-3); }

/* brand avatar */
.brand img { display: block; width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule-2); transition: transform 600ms var(--ease); }
.brand:hover img { transform: rotate(40deg); }
.boot { align-content: center; justify-items: center; row-gap: 26px; }
.boot-mark { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule-2); opacity: 0; transform: scale(.92); transition: opacity 600ms var(--ease), transform 900ms var(--ease); }
.boot.say .boot-mark { opacity: 1; transform: none; }
@media (max-width: 1100px) { .brand img { width: 28px; height: 28px; } }

/* ── token: the contract address, in the header ── */
.top { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 28px; }
.token { justify-self: center; display: flex; align-items: stretch; min-width: 0; max-width: 100%; height: 30px; border: 1px solid var(--rule-2); font: 400 12px var(--mono); white-space: nowrap; }
.token > * { display: flex; align-items: center; }
.tk-tab { padding: 0 10px; background: var(--ink); color: #05070b; font: 600 12px var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.tk-l { padding: 0 2px 0 10px; color: var(--ink-3); font: 500 11px var(--cond); letter-spacing: .1em; }
#tk-ca { display: block; min-width: 0; padding: 0 10px 0 6px; line-height: 28px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font: inherit; cursor: copy; user-select: all; }
#tk-copy, .token a { padding: 0 11px; border-left: 1px solid var(--rule-2); font: 500 11.5px var(--cond); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); transition: background 140ms, color 140ms; }
#tk-copy { color: var(--ink); }
#tk-copy:hover, .token a:hover { background: var(--ink); color: #05070b; }
#tk-copy.ok { background: var(--green); color: #05070b; }
.token.is-new { animation: tk-in 900ms var(--ease); }
@keyframes tk-in { from { opacity: 0; transform: translateY(-6px); } 60% { border-color: #fff; } to { opacity: 1; transform: none; } }
.status { grid-column: 4; }
@media (max-width: 1500px) and (min-width: 1101px) { .token a { display: none; } .top { gap: 20px; } }
@media (max-width: 1100px) {
  .top { grid-template-columns: auto 1fr; }
  .token { position: fixed; z-index: 9; top: 52px; left: 0; right: 0; height: 40px; justify-self: stretch; border-width: 0 0 1px; background: var(--bg); }
  .token a:not(:last-child) { display: none; }
  #tk-ca { flex: 1; line-height: 39px; }
  body.has-token { padding-top: calc(92px + 52svh); }
  body.has-token #scene, body.has-token .labels { top: 92px; }
  body.has-token .hint { top: calc(92px + 52svh - 30px); }
}

#tk-ca { line-height: 29px; }
@media (max-width: 1100px) { #tk-ca { line-height: 39px; } }
