/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand · brand: NEAR (spec 2026-11-04) · surface: absolute · idea: "the economy as a living fossil record, read as a Muller plot of dynasties" · vibe: "museum specimen drawer, live and steerable"
 * paper: #000000 near.org black, raised steps #191919 and #333333 · accent: #00ec97 NEAR green, black text on it · display: Mona Sans at wdth 75 · body and figures: Mona Sans, proportional numerals (its tabular zero is slashed) · outlier: ui-monospace for agent ids only
 * nav: top bar, wordmark, run status in words, transport, three side sheets · signature: the full-width Muller plot of founding dynasties, banded in the five NEAR hues at two light steps, small dynasties pooled in one grey band · states: loading, empty, disconnected, finished, full
 * axes: dark/display-condensed/chromatic-green · posture: full-palette data on black chrome · contrast: pass (black on #00ec97 15.2:1; #acaba6 on #000 9.5:1) · data: live from the sim server · redesign: restyle · v2.0.0 */
/* Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5 · weakest: H, three lower regions compete; the plot takes the full width and the largest type, the regions sit a step down */
/* Hallmark · waive 7b · pure #000 ground and #fff ink come from the NEAR brand spec · near.org sets its bg-black sections with white ink, and the Muller plot's pigments read best on that black */
@import url("./tokens.css");
/* Hallmark · dismissed F25 · the field notes feed scrolls inside its own region on a phone, a layout kept as found by this restyle, not text the rethemed page hides */

/* Base (from the Hallmark scaffold) */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.5; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 30%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-synthesis: none; overflow-wrap: break-word; min-width: 0; text-wrap: balance; font-weight: 700; font-stretch: var(--stretch-display); letter-spacing: var(--tracking-display); }
p { margin: 0; text-wrap: pretty; }
canvas { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
/* Mona Sans draws its tabular zero slashed, which reads as a theta at small sizes ("2θ"), so figures stay proportional. */
.num { font-variant-numeric: proportional-nums; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 36px; padding: 0 var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-input); background: transparent; color: var(--color-ink); font: 500 var(--text-sm)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; position: relative; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn::after { content: ""; position: absolute; inset: -4px; }
.btn:hover { background: var(--color-paper-2); border-color: var(--color-muted); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; }
.btn--primary:hover { background: var(--color-focus); border-color: var(--color-focus); }
.btn--small { min-height: 32px; padding: 0 var(--space-sm); }
.btn[aria-expanded="true"] { border-color: var(--color-accent); background: var(--color-paper-2); }

.seg { display: inline-flex; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-sm); border: 1px solid var(--color-rule); margin-left: -1px; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.seg label:first-of-type { margin-left: 0; border-radius: var(--radius-input) 0 0 var(--radius-input); }
.seg label:last-of-type { border-radius: 0 var(--radius-input) var(--radius-input) 0; }
.seg label:hover { background: var(--color-paper-2); color: var(--color-ink); }
.seg input:checked + label { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); position: relative; transition: none; }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; position: relative; z-index: 1; }
.seg input:disabled + label { opacity: 0.5; cursor: not-allowed; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: var(--color-paper); border-bottom: 1px solid var(--color-rule-soft); }
.bar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); min-height: 64px; padding-block: var(--space-md) var(--space-sm); }
.brand { display: grid; gap: var(--space-xs); flex: 1 1 26rem; min-width: 0; }
.tagline { max-width: 68ch; }
.purpose { max-width: 68ch; color: var(--color-ink); font-size: var(--text-md); line-height: 1.35; font-weight: 600; }
.tagline { color: var(--color-ink); font-size: var(--text-md); line-height: 1.35; }
/* The wind tunnel's headline finding, a link down to the tunnel */
.finding { display: grid; gap: 1px; max-width: 17rem; padding: var(--space-3xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-card); color: var(--color-ink); font-size: var(--text-sm); line-height: 1.3; text-decoration: none; }
.finding:hover { border-color: var(--color-ink-2); }
.finding:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.finding__k { color: var(--color-muted); font-size: var(--text-xs); }
.wordmark { font-size: var(--text-wordmark); font-weight: 800; line-height: 1; letter-spacing: 0; }
.brand__row { display: flex; align-items: center; gap: var(--space-md); }
.whatis { position: relative; padding: var(--space-3xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); background: none; color: var(--color-ink); font: 500 var(--text-sm)/1.2 var(--font-body); cursor: pointer; }
.whatis::after { content: ""; position: absolute; inset: -8px -4px; }
.whatis:hover { border-color: var(--color-ink-2); }
.whatis:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
/* NEAR: the contract and one real tx, one chip */
.chain { order: 2; flex: none; display: grid; grid-template-columns: auto auto; align-items: center; gap: var(--space-3xs) var(--space-xs); padding: var(--space-3xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-card); font-size: var(--text-md); line-height: 1.35; }
.chain__dot { flex: none; width: 8px; height: 8px; border-radius: 1px; background: var(--color-accent); }
.chain a { color: var(--color-ink); text-decoration: none; }
.chain a:hover { text-decoration: underline; }
.chain a { grid-column: 2; }
.chain__dot { grid-row: 1; }
.chain__k { color: var(--color-muted); margin-right: var(--space-3xs); }
.chain a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.status { min-width: 0; color: var(--color-ink-2); font-size: var(--text-xs); margin-top: var(--space-3xs); }
.status b { color: var(--color-ink); font-weight: 500; }
.status .shock { color: var(--color-ink); }
.actions, .transport { order: 3; }
.transport, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
#toggle { min-width: 6.5rem; }
.speed-select { display: none; min-height: 36px; padding: 0 var(--space-sm); background: var(--color-paper-3); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-input); font-size: var(--text-sm); cursor: pointer; }
.speed-select:hover { border-color: var(--color-muted); }
.speed-select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.speed-select:disabled { opacity: 0.5; cursor: not-allowed; }

.notice { background: var(--color-paper-2); border-bottom: 1px solid var(--color-rule); }
.notice__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); padding-block: var(--space-sm); }
.notice p { flex: 1 1 20rem; }
.notice code { font-family: var(--font-mono); font-size: 0.95em; padding: 0 0.3em; background: var(--color-paper-3); border-radius: 3px; }

/* Why it matters: the first thing a newcomer reads below the bar */

/* Narration: what just happened, with a ring that matches the pin on the chart */
.narr { display: flex; align-items: baseline; gap: var(--space-xs); margin: calc(-1 * var(--space-xs)) 0 var(--space-sm); font-size: var(--text-md); line-height: 1.4; color: var(--color-ink); min-height: 1.4em; }
.narr.is-new #narr-text { animation: narr-in var(--dur-long) var(--ease-out); }
@keyframes narr-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.narr__ring, .pin { flex: none; width: 12px; height: 12px; border: 2px solid var(--color-ink); border-radius: var(--radius-pill); }
.narr__ring { align-self: center; }
.narr__label { flex: none; color: var(--color-muted); font-size: var(--text-sm); }
.plot { position: relative; }
/* The chart and its takeaway side by side; the takeaway drops below on narrow screens. */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: var(--space-lg); align-items: start; }
.stage__plot { min-width: 0; }
.take { display: grid; gap: var(--space-sm); padding-left: var(--space-md); border-left: 1px solid var(--color-rule-soft); font-size: var(--text-sm); line-height: 1.45; }
.take .narr { margin: 0 0 var(--space-xs); padding: var(--space-xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-3); font-size: var(--text-md); font-weight: 500; }
.take .narr__label { color: var(--color-accent); font-weight: 600; }
.take__h { font-size: var(--text-lg); line-height: 1.15; }
.take__body { display: grid; gap: var(--space-xs); color: var(--color-ink-2); }
.take__body b { color: var(--color-ink); font-weight: 600; }
.take__body > p:first-child { color: var(--color-ink); font-size: var(--text-md); line-height: 1.4; }
.take__why summary, .proof__all summary { cursor: pointer; color: var(--color-ink); font-weight: 600; width: fit-content; }
.take__why summary:hover, .proof__all summary:hover { text-decoration: underline; text-underline-offset: 0.16em; }
.take__why p { margin-top: var(--space-2xs); }
.proof { display: grid; gap: var(--space-xs); margin-bottom: var(--space-xs); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-rule); }
.proof__all { font-size: var(--text-sm); }
.proof__all[open] summary { margin-bottom: var(--space-2xs); }
.proof__h { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-md); }
.proof__h::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--color-accent); }
.proof__sub { color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.4; overflow-wrap: anywhere; }
.proof__sub a { color: var(--color-ink); }
.proof__live { display: grid; gap: var(--space-2xs); padding: var(--space-xs) var(--space-sm); border: 1px solid var(--color-accent); border-radius: var(--radius-card); background: var(--color-paper-3); }
.proof__live[data-off="true"] { border-color: var(--color-rule); background: none; }
.proof__live-h { color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; }
.proof__live[data-off="true"] .proof__live-h { color: var(--color-ink); }
.proof__live-ago { color: var(--color-muted); font-weight: 400; }
.proof__live-wait { color: var(--color-ink-2); font-size: var(--text-sm); }
.proof__live-tx { display: grid; gap: var(--space-3xs); color: var(--color-ink); text-decoration: none; font-size: var(--text-md); font-weight: 500; line-height: 1.35; }
.proof__live-tx.is-fresh { animation: tx-in 1.6s var(--ease-out); }
@keyframes tx-in { from { background: color-mix(in oklab, var(--color-accent) 28%, transparent); } to { background: transparent; } }
.proof__live-tx:hover .proof__live-what { text-decoration: underline; }
.proof__live-tx:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.proof__live-tx.is-old { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 400; }
.proof__live-meta { font-size: var(--text-xs); font-weight: 400; color: var(--color-muted); }
.proof__sub--rec { margin-top: var(--space-2xs); }
.proof__list { list-style: none; margin: 0; padding: 0; display: grid; }
.proof__list a { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-3xs); padding: var(--space-2xs) 0; border-top: 1px solid var(--color-rule-soft); color: var(--color-ink); text-decoration: none; font-size: var(--text-xs); line-height: 1.35; }
.proof__list a:hover .proof__what { text-decoration: underline; }
.proof__list a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.proof__ev { grid-column: 1; font-family: var(--font-mono); color: var(--color-accent); font-size: var(--text-xs); }
.proof__ev.is-refused { color: var(--color-error); }
.proof__what { grid-column: 1; color: var(--color-ink-2); }
.proof__meta { color: var(--color-muted); font-size: var(--text-xs); }
.proof__hash { font-family: var(--font-mono); color: var(--color-ink-2); letter-spacing: 0.02em; }
.proof__view { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.proof__list a:hover .proof__view, .proof__live-tx:hover .proof__view { text-decoration-thickness: 2px; }
.pin { position: absolute; left: -6px; top: -6px; z-index: var(--z-raised); box-shadow: 0 0 0 2px var(--color-paper); pointer-events: none; transition: transform var(--dur-long) var(--ease-out); }
.pin::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--color-ink); border-radius: var(--radius-pill); animation: pin-pulse 2.4s var(--ease-out) infinite; }
@keyframes pin-pulse { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }

/* The record */
.record { padding-block: var(--space-lg) var(--space-lg); }
.record__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: var(--space-lg); margin-bottom: var(--space-md); }
.record__tools { justify-self: end; }
.record__tools { display: grid; justify-items: end; gap: var(--space-xs); }
.counter { display: flex; align-items: baseline; gap: var(--space-xs); line-height: 0.85; }
.counter__n { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 700; font-size: var(--text-counter); font-variant-numeric: proportional-nums; letter-spacing: -0.01em; }
.counter__of { display: grid; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.2; }
.counter__of small { font-size: var(--text-xs); }
.record__title h2 { font-size: var(--text-section); line-height: 1.1; }
.seg--small label { min-height: 32px; }
.seg .short { display: none; }
/* the band-thickness switch selects with ink, so the selected speed stays the only green fill */
.seg--small input:checked + label { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.headline { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 700; font-size: var(--text-2xl); line-height: 1.15; letter-spacing: var(--tracking-display); color: var(--color-ink); margin: calc(-1 * var(--space-2xs)) 0 var(--space-md); min-height: 1.15em; text-wrap: balance; }
.headline:empty { visibility: hidden; }
/* The live status line: the same numbers as the headline, read from the same round. */
.statusline { margin: calc(-1 * var(--space-sm)) 0 var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); font-variant-numeric: proportional-nums; min-height: 1.3em; }
.plot__caption { position: absolute; left: var(--space-md); top: var(--space-md); z-index: var(--z-raised); max-width: min(30rem, calc(100% - 2 * var(--space-md))); padding: var(--space-sm) var(--space-md); background: var(--color-paper); color: var(--color-ink); border-radius: var(--radius-card); font-size: var(--text-lg); line-height: 1.3; pointer-events: none; transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out); }
.plot__caption:empty { display: none; }
@starting-style { .plot__caption { opacity: 0; transform: translateY(-4px); } }

.plot { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
.lane canvas { width: 100%; height: 20px; }
.lane--notes canvas { height: 24px; }
.lane--ai canvas { height: 18px; }
.plot__well { position: relative; height: clamp(260px, 32vh, 520px); background: var(--color-paper-3); border-radius: 2px; }
.plot__well canvas { width: 100%; height: 100%; cursor: crosshair; border-radius: 2px; }
.plot__well canvas:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.axis { position: relative; height: 34px; margin-top: var(--space-3xs); font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-ink-2); font-variant-numeric: proportional-nums; }
.axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.axis .axis__first { transform: none; }
.axis .axis__brk { transform: none; padding-left: var(--space-2xs); color: var(--color-ink-2); }
.axis .axis__early { transform: none; padding-top: var(--space-3xs); border-top: 1px solid var(--color-muted); overflow: hidden; white-space: normal; text-align: center; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.15; }
.axis__note { margin-top: calc(-1 * var(--space-3xs)); font-size: var(--text-sm); color: var(--color-ink-2); }
.axis .axis__now { transform: translateX(-100%); color: var(--color-ink); font-weight: 600; }

.skeleton { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center; gap: var(--space-2xs); padding: 0; overflow: hidden; }
.skeleton i { display: block; background: var(--color-paper-2); border-radius: 2px; animation: breathe 1.6s var(--ease-in-out) infinite alternate; }
.skeleton i:nth-child(1) { height: 18%; margin-right: 30%; }
.skeleton i:nth-child(2) { height: 26%; margin-left: 4%; }
.skeleton i:nth-child(3) { height: 14%; margin-right: 12%; animation-delay: 0.2s; }
.skeleton i:nth-child(4) { height: 22%; margin-left: 20%; animation-delay: 0.4s; }
.skeleton i:nth-child(5) { height: 12%; margin-right: 50%; animation-delay: 0.6s; }
@keyframes breathe { from { opacity: 0.45; } to { opacity: 1; } }
.plot[data-state="loading"] .skeleton { display: flex; }
.plot[data-state="loading"] canvas#muller { visibility: hidden; }
.plot__empty { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-lg); text-align: center; color: var(--color-ink-2); }

.tip { position: absolute; left: 0; top: 0; z-index: var(--z-tooltip); width: max-content; max-width: 19rem; padding: var(--space-xs) var(--space-sm); background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: var(--radius-card); font-size: var(--text-sm); line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-tip); }
.tip b { display: block; font-family: var(--font-mono); font-weight: 500; }
.tip span { color: var(--color-ink-2); }
.tip em { display: block; margin: var(--space-3xs) 0 var(--space-2xs); font-style: normal; font-weight: 600; color: var(--color-ink); }

.key { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.key span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.key i { flex: none; width: 14px; height: 8px; border-radius: 1px; }
.key .k-hues { width: 4px; margin-right: var(--space-sm); background: var(--pigment-2); box-shadow: 4px 0 0 var(--pigment-3), 8px 0 0 var(--pigment-4), 12px 0 0 var(--pigment-deep-1); }
.key .k-shock { background: var(--color-ink-2); }
.key .k-guard { width: 3px; height: 14px; background: var(--color-accent); }
.key .k-other { height: 8px; background-color: var(--pigment-other); background-image: repeating-linear-gradient(-45deg, var(--pigment-other-hatch) 0 1px, transparent 1px 5px); }
.key .k-ai { width: 3px; height: 14px; background: var(--color-ai); }
.key .k-open { width: 1px; height: 12px; border-left: 1px dashed var(--color-ink); }
/* Claude's latest decision: the AI in the swarm, above the fold */
.ai { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--space-2xs) var(--space-md); margin: 0 0 var(--space-sm); padding: var(--space-xs) var(--space-md); border: 1px solid color-mix(in oklab, var(--color-ai) 55%, var(--color-paper)); border-radius: var(--radius-card); background: var(--color-paper-3); max-width: 72rem; }
.ai[data-mode="off"] { border-color: var(--color-rule-soft); }
.ai__tag { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-xs); border-radius: var(--radius-pill); background: var(--color-ai); color: var(--color-ai-ink); font: 700 var(--text-sm)/1.2 var(--font-body); white-space: nowrap; }
.ai[data-mode="off"] .ai__tag { background: var(--color-paper-2); color: var(--color-ink-2); }
.ai__mark { width: 8px; height: 8px; background: currentColor; transform: rotate(45deg); }
.ai__body { display: grid; gap: var(--space-3xs); min-width: 0; }
.ai__line { font-size: var(--text-md); line-height: 1.4; }
.ai__what { color: var(--color-ink-2); }
.ai__what .id, .tip .id { font-family: var(--font-mono); font-size: 0.95em; color: var(--color-ink); }
.ai__why { color: var(--color-ink); font-weight: 500; }
.ai__meta { font-size: var(--text-xs); color: var(--color-muted); }
.ai__meta a { color: var(--color-ink-2); }
.ai.is-new .ai__why { animation: narr-in var(--dur-long) var(--ease-out); }
/* How to read the chart, right above it */
.read { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-lg); margin: var(--space-sm) 0 var(--space-xs); }
.read__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-xs); font-size: var(--text-lg); line-height: 1.3; }
.read__h { display: inline; font-size: var(--text-lg); line-height: 1.3; }
.read__text p { color: var(--color-ink); }
.tip__ai { color: var(--color-ai) !important; }
.key .k-scar { width: 1px; height: 12px; background: var(--color-ink); }
.key .k-mono { height: 3px; background: var(--color-ink); }
.key .k-gens { width: 28px; background: var(--pigment-deep-1); }
.key .k-fork { width: 14px; height: 12px; background: repeating-linear-gradient(90deg, var(--pigment-deep-1) 0 3px, var(--color-paper) 3px 4px); }

/* The first action: two shocks, one tap away */
.try { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-xs) var(--space-sm); }
.try__lede { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.2; }
/* Shocks are outlined, never the green fill: green is kept for the page's main action. */
.try .btn { min-height: 36px; gap: var(--space-sm); }
/* Shocks are open on the shared run: a full-strength outline, so only the cooldown (disabled) reads as unavailable. */
.btn--shock { border-color: var(--color-ink); color: var(--color-ink); font-weight: 600; }
.btn--shock:hover:not(:disabled) { border-color: var(--color-accent); background: var(--color-paper-2); }
.btn--shock:disabled { border-style: dashed; border-color: var(--color-rule); background: var(--color-paper-3); color: var(--color-muted); cursor: not-allowed; opacity: 1; }
.shock-wait { flex: 1 1 100%; text-align: right; font-size: var(--text-sm); color: var(--color-ink-2); font-variant-numeric: proportional-nums; }
.sheet .shock-wait { text-align: left; margin-top: var(--space-sm); }
.try__sub { font-weight: 400; font-size: var(--text-xs); color: var(--color-ink-2); }
/* contain: inline-size keeps a long message from widening the tools column and squeezing the title. */
.try__msg { flex: 1 1 100%; contain: inline-size; text-align: right; min-height: 0; font-size: var(--text-sm); color: var(--color-ink-2); text-wrap: pretty; }
.try__msg.is-error { color: var(--color-error); }
.exports a[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* The three regions */
.more { border-top: 1px solid var(--color-rule-soft); }
.more__sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3xs) var(--space-sm); padding-block: var(--space-md); cursor: pointer; list-style: none; }
.more__sum::-webkit-details-marker { display: none; }
.more__sum::before { content: "+"; align-self: center; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 1px solid var(--color-rule); border-radius: var(--radius-pill); font-weight: 600; }
.more[open] .more__sum::before { content: "−"; }
.more__h { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 700; font-size: var(--text-lg); }
.more__sub { color: var(--color-muted); font-size: var(--text-sm); }
.more__sum:hover .more__h { text-decoration: underline; text-underline-offset: 0.16em; }
.more__sum:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.regions { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 0.95fr); gap: var(--gap-columns); padding-block: var(--space-lg) var(--space-2xl); border-top: 1px solid var(--color-rule-soft); }
.region__head { margin-bottom: var(--space-md); }
.region h2 { font-size: var(--text-lg); line-height: 1.1; color: var(--color-ink-2); }
.region__sub { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-3xs); }
.placeholder { color: var(--color-muted); font-size: var(--text-sm); }

/* Specimen */
.spec__name { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.spec__swatch { flex: none; width: 14px; height: 32px; border-radius: 2px; }
.spec__name h3 { font-size: var(--text-2xl); line-height: 1; }
.spec__strategy { margin: calc(-1 * var(--space-2xs)) 0 var(--space-md); font-size: var(--text-md); color: var(--color-ink); }
.spec__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs) var(--space-lg); margin: 0 0 var(--space-lg); }
.spec__facts div { min-width: 0; }
.spec__facts dt { font-size: var(--text-xs); color: var(--color-muted); }
.spec__facts dd { margin: 0; font-family: var(--font-body); font-variant-numeric: proportional-nums; font-size: var(--text-sm); overflow-wrap: anywhere; }
.genes { display: grid; gap: var(--space-sm); margin: 0; }
.gene { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 3.6rem; align-items: center; gap: var(--space-sm); }
.gene dt { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.2; }
.gene dt small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.gene dd { margin: 0; }
.gene .track { position: relative; height: 10px; background: var(--color-paper-3); border-radius: 1px; overflow: hidden; }
.gene .fill { position: absolute; inset: 0 auto 0 0; width: 100%; transform-origin: left center; border-radius: 0 2px 2px 0; transition: transform var(--dur-long) var(--ease-out); }
.gene .val { font-family: var(--font-body); font-variant-numeric: proportional-nums; font-size: var(--text-sm); text-align: right; line-height: 1.2; }
.gene .val small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.gene .avg { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--color-ink); }
.gene .track { overflow: visible; }
.spec__edge { margin: calc(-1 * var(--space-xs)) 0 var(--space-md); font-size: var(--text-sm); color: var(--color-ink-2); max-width: 60ch; }
.gene .none { font-size: var(--text-xs); color: var(--color-muted); }
.spec__kinds { margin-top: var(--space-md); }
.spec__kinds h4 { margin: 0 0 var(--space-xs); font: 500 var(--text-sm)/1.2 var(--font-body); color: var(--color-ink-2); }
.kinds { display: flex; height: 24px; border-radius: 2px; overflow: hidden; gap: var(--space-3xs); }
.kinds span { min-width: 0; transition: flex-grow var(--dur-long) var(--ease-out); }
.kinds-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); margin-top: var(--space-2xs); font-size: var(--text-xs); color: var(--color-muted); }
.kind--arith { background: var(--kind-arith); }
.kind--extract { background: var(--kind-extract); }
.kind--classify { background: var(--kind-classify); }
.kind--reason { background: var(--kind-reason); }
.kinds-legend i { display: inline-block; width: 8px; height: 8px; margin-right: var(--space-2xs); border-radius: 1px; vertical-align: 0.05em; }
.kinds-legend b { display: block; color: var(--color-ink); font-family: var(--font-body); font-weight: 400; font-size: var(--text-sm); font-variant-numeric: proportional-nums; }
.spec__note { margin-top: var(--space-md); font-size: var(--text-xs); color: var(--color-muted); }

/* Field notes */
.feed { list-style: none; margin: 0; padding: 0 var(--space-xs) 0 0; max-height: 34rem; overflow-y: auto; overscroll-behavior: contain; }
.feed:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.feed > li { padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule-soft); font-size: var(--text-sm); line-height: 1.45; }
.feed > li:first-child { padding-top: 0; }
.feed .quiet { color: var(--color-ink-2); }
.feed .t { font-family: var(--font-body); font-variant-numeric: proportional-nums; color: var(--color-muted); }
.feed p + p { margin-top: var(--space-2xs); }
.feed .mark { position: relative; padding-left: var(--space-md); color: var(--color-ink); font-weight: 500; }
.feed .mark::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 1px; }
.feed .mark--guard::before { background: var(--color-accent); }
.feed .mark--shock::before { background: var(--color-ink-2); }
.feed .mark--extinct::before { background: var(--color-error); }
.feed .mark--llm::before { background: var(--color-ai); transform: rotate(45deg) scale(0.9); }
.spec__llm { position: relative; padding-left: var(--space-md); color: var(--color-ink); }
.spec__llm::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; background: var(--color-ai); transform: rotate(45deg) scale(0.9); border-radius: 1px; }
.feed li:not(.quiet) p:not(.mark) { color: var(--color-ink-2); }
.feed .id { font-family: var(--font-mono); font-size: 0.95em; }

/* Wind tunnel: rule sets compared against the baseline, one row each */
.tunnel { padding-block: var(--space-xl) var(--space-2xl); border-top: 1px solid var(--color-rule-soft); scroll-margin-top: var(--space-xl); }
.tunnel__head { display: grid; gap: var(--space-xs); max-width: 62rem; margin-bottom: var(--space-lg); }
.tunnel__head h2 { font-size: var(--text-xl); line-height: 1.1; }
.tunnel__result { font-size: var(--text-lg); line-height: 1.35; color: var(--color-ink); max-width: 60rem; }
.tunnel__caveat { font-size: var(--text-sm); color: var(--color-ink-2); }
.tunnel__lede { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-xs); }
.tunnel__lede b { color: var(--color-ink); }
.tunnel code, .tunnel__advice code { font-family: var(--font-mono); font-size: 0.92em; }
.tunnel__table { width: 100%; border-collapse: collapse; font-variant-numeric: proportional-nums; }
.tunnel__table thead th { text-align: right; vertical-align: bottom; padding: 0 var(--space-sm) var(--space-xs); border-bottom: 1px solid var(--color-rule); font-weight: 600; font-size: var(--text-sm); line-height: 1.2; }
.tunnel__table thead th:first-child { text-align: left; padding-left: 0; }
.tunnel__table thead small { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--color-muted); }
.tunnel__table tbody tr { border-bottom: 1px solid var(--color-rule-soft); }
.tunnel__table tbody th { text-align: left; font-weight: 400; padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; vertical-align: top; width: 24%; }
.tunnel__table .tn { display: block; font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 700; font-size: var(--text-lg); line-height: 1.15; }
.tunnel__table .tr { display: block; color: var(--color-muted); font-size: var(--text-xs); margin: var(--space-3xs) 0 var(--space-xs); }
.tunnel__table td { text-align: right; vertical-align: top; padding: var(--space-sm); }
.tunnel__table .tv { display: block; font-weight: 600; font-size: var(--text-lg); line-height: 1.2; color: var(--color-muted); }
.tunnel__table .td { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.tunnel__table .is-base .tv { color: var(--color-ink); }
.tunnel__table .is-sig .tv { color: var(--color-ink); }
.tunnel__table .is-sig .td { color: var(--color-ink); font-weight: 600; }
/* A centred bar: right of centre is up, left is down; length is the change relative to the largest in its column. */
.tbar { position: relative; display: block; width: 6rem; height: 4px; margin: var(--space-2xs) 0 0 auto; background: var(--color-rule-soft); }
.tbar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--color-muted); }
.tbar i { position: absolute; top: 0; bottom: 0; left: 50%; background: var(--color-rule); }
.tbar--neg i { left: auto; right: 50%; }
.is-sig .tbar i { background: var(--color-ink); }
.tunnel__readonly { margin-top: var(--space-sm); }
.tunnel__advice { margin-top: var(--space-lg); padding: var(--space-md) var(--space-lg); border: 1px solid var(--color-rule); border-radius: var(--radius-card); max-width: 62rem; }
.tunnel__advice h3 { font-size: var(--text-xl); margin-bottom: var(--space-xs); }
.tunnel__advice ol { margin: 0 0 var(--space-sm); padding-left: 1.4em; display: grid; gap: var(--space-xs); }
.tunnel__advice li { font-size: var(--text-sm); color: var(--color-ink-2); }
.tunnel__advice li b { color: var(--color-ink); }
.tunnel__advice a { color: var(--color-ink); }
@media (max-width: 60rem) {
  /* Phones and narrow tablets: one card per rule set, metrics in a two-column grid. */
  .tunnel__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tunnel__table, .tunnel__table tbody, .tunnel__table tr { display: block; }
  .tunnel__table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md); padding: var(--space-md) 0; }
  .tunnel__table tbody th { grid-column: 1 / -1; width: auto; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3xs) var(--space-sm); }
  .tunnel__table .tr { margin: 0; flex: 1 1 12rem; }
  .tunnel__try { margin-left: auto; }
  .tunnel__table td { display: block; padding: 0; text-align: left; }
  .tunnel__table td::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--color-muted); }
  .tbar { margin-left: 0; }
}
@media (max-width: 40rem) {
  .tunnel__table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tunnel__advice { padding: var(--space-md); }
  .tunnel__head h2 { font-size: var(--text-xl); }
}

/* Wind tunnel explorer: pick a rule set and a seed, compare with the baseline */
.wt { display: grid; gap: var(--space-sm); margin-bottom: var(--space-xl); padding: var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
.wt__controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-sm) var(--space-lg); }
.wt__sets { border: 0; margin: 0; padding: 0; min-width: 0; }
.wt__sets legend, .wt__seed { color: var(--color-muted); font-size: var(--text-xs); margin-bottom: var(--space-2xs); }
.wt__chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.wt__chip { min-height: 36px; padding: 0 var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); background: none; color: var(--color-ink-2); font: 500 var(--text-sm)/1 var(--font-body); cursor: pointer; }
.wt__chip:hover { border-color: var(--color-ink-2); color: var(--color-ink); }
.wt__chip[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.wt__chip:focus-visible, .wt__seed select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wt__seed { display: grid; gap: var(--space-3xs); }
.wt__seed select { min-height: 36px; padding: 0 var(--space-sm); background: var(--color-paper-3); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-input); font: 500 var(--text-sm) var(--font-body); }
.wt__q { color: var(--color-ink); font-size: var(--text-md); }
.wt__rules { color: var(--color-muted); font-size: var(--text-sm); }
.wt__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md) var(--space-lg); margin: 0; }
.wt__cell { display: grid; gap: var(--space-3xs); align-content: start; }
.wt__cell dt { font-size: var(--text-sm); color: var(--color-ink-2); }
.wt__cell dt small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.wt__cell dd { margin: 0; }
.wt__nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-xs); font-variant-numeric: proportional-nums; }
.wt__b { color: var(--color-muted); font-size: var(--text-md); }
.wt__arrow { color: var(--color-muted); }
.wt__m { color: var(--color-ink); font-size: var(--text-xl); font-weight: 600; }
.wt__d { flex: 1 1 100%; color: var(--color-muted); font-size: var(--text-xs); }
.wt__cell.is-sig .wt__d { color: var(--color-ink); }
.wt__dots svg { display: block; width: 100%; height: 34px; }
.wt__axis { stroke: var(--color-rule-soft); stroke-width: 1; }
.wt__dot--base { fill: none; stroke: var(--color-muted); stroke-width: 1.2; }
.wt__dot--set { fill: var(--color-accent); opacity: 0.85; }
.wt__dot--base.is-on, .wt__dot--set.is-on { stroke: var(--color-ink); stroke-width: 2; opacity: 1; }
.wt__legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-xs); color: var(--color-muted); font-size: var(--text-xs); }
.wt__k { width: 8px; height: 8px; border-radius: 50%; }
.wt__k--base { border: 1.2px solid var(--color-muted); }
.wt__k--set { margin-left: var(--space-sm); background: var(--color-accent); }
.tunnel__th { font-size: var(--text-md); margin-bottom: var(--space-xs); color: var(--color-ink-2); }
@media (max-width: 60rem) { .wt__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .wt { padding: var(--space-sm); } .wt__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); } }

/* Selection pressures */
.figs { display: grid; gap: 0; margin: 0; }
.fig { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 7.5rem; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule-soft); }
.fig dt { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.25; }
.fig dt small { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.fig dd { margin: 0; }
.fig .v { font-family: var(--font-body); font-variant-numeric: proportional-nums; font-weight: 600; font-size: var(--text-lg); text-align: right; }
.fig canvas { width: 100%; height: 28px; }
.guard { margin-top: var(--space-lg); padding: var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
.guard h3 { display: flex; align-items: center; gap: var(--space-xs); }
.guard h3::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--color-accent); border-radius: 1px; }
.guard h3 { font-size: var(--text-lg); margin-bottom: var(--space-2xs); }
.guard p { font-size: var(--text-sm); color: var(--color-ink-2); }
.guard .guard__what { margin-bottom: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); }
.guard .big { display: block; font-family: var(--font-body); font-variant-numeric: proportional-nums; font-size: var(--text-xl); color: var(--color-ink); margin-bottom: var(--space-2xs); }

/* Side sheets (non-modal) */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-modal); width: min(28rem, 100%); overflow-y: auto; padding: var(--space-lg); background: var(--color-paper-2); box-shadow: var(--shadow-sheet); animation: sheet-in var(--dur-short) var(--ease-out); }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-xs); }
.sheet__head h2 { font-size: var(--text-2xl); }
.sheet__head h2:focus { outline: none; }
.sheet__lede { color: var(--color-ink-2); font-size: var(--text-sm); margin-bottom: var(--space-lg); }
.sheet h3 { font-size: var(--text-lg); margin-bottom: var(--space-2xs); }
.hint { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.4; }
.rule { padding: var(--space-sm) 0; border-top: 1px solid var(--color-rule); }
.rule__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.rule label, .rule legend { font-size: var(--text-sm); font-weight: 500; }
.rule output { font-family: var(--font-body); font-variant-numeric: proportional-nums; font-size: var(--text-sm); }
.rule input[type="range"] { width: 100%; margin: var(--space-xs) 0 var(--space-2xs); accent-color: var(--color-ink); min-height: 28px; cursor: pointer; }
.rule input[type="range"]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.rule .seg { margin: var(--space-xs) 0 var(--space-2xs); }
.rule.is-changed label, .rule.is-changed legend { color: var(--color-accent); }
.rule .err, .form-msg.is-error { color: var(--color-error); font-size: var(--text-sm); }
.form-msg { min-height: 1.4em; margin: var(--space-sm) 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.restart { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.restart .hint { margin-bottom: var(--space-sm); }
.restart__row { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.restart__row label { font-size: var(--text-sm); }
input[type="number"] { width: 8rem; min-height: 36px; padding: 0 var(--space-sm); background: var(--color-paper-3); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-input); font-family: var(--font-body); font-variant-numeric: proportional-nums; transition: border-color var(--dur-short) var(--ease-out); }
input[type="number"]:hover { border-color: var(--color-muted); }
input[type="number"]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--color-error); }
.shocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.shocks li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid var(--color-rule); }
.shocks .btn { width: 100%; }
.shocks p { font-size: var(--text-sm); color: var(--color-ink-2); }
.exports { display: grid; gap: var(--space-sm); margin-bottom: var(--space-md); }

/* The field guide: a small tooltip that points at one thing at a time; nothing is dimmed or covered. */
/* On wide screens the guide is pinned to the chart's corner, leaving the side panels clear; on a phone it sits under the chart. */
.tour { position: relative; width: auto; margin: 0 0 var(--space-sm); padding: var(--space-sm) var(--space-md) var(--space-md); background: var(--color-paper-3); color: var(--color-ink); border: 1px solid var(--color-accent); border-radius: var(--radius-card); box-shadow: var(--shadow-tip); animation: fade-in var(--dur-long) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.tour__top { display: flex; align-items: center; justify-content: space-between; }
.tour__of { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: proportional-nums; }
.tour__x { min-width: 32px; min-height: 32px; margin-right: calc(-1 * var(--space-xs)); background: none; border: 0; color: var(--color-ink-2); font-size: var(--text-lg); line-height: 1; cursor: pointer; }
.tour__x:hover { color: var(--color-ink); }
.tour__x:focus-visible { outline: 2px solid var(--color-focus); }
.tour__h { font-size: var(--text-lg); line-height: 1.15; margin-bottom: var(--space-2xs); }
.tour__h:focus { outline: none; }
.tour__body { color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.45; }
.tour__body b { color: var(--color-ink); font-weight: 600; }
.tour__nav { display: flex; justify-content: flex-end; gap: var(--space-xs); margin-top: var(--space-sm); }
.tour[data-side="chart"] { position: absolute; top: var(--space-xs); left: var(--space-xs); z-index: calc(var(--z-raised) + 1); width: min(20rem, 45%); margin: 0; }
.tour-target { outline: 1px solid var(--color-accent); outline-offset: 4px; border-radius: 2px; }

/* 404 */
.lost { display: grid; gap: var(--space-md); align-content: center; justify-items: start; min-height: 80vh; }
.lost h1 { font-size: var(--text-3xl); line-height: 1.05; }
.lost p:not(.counter) { color: var(--color-ink-2); }

/* Below the chart: one step larger and brighter than the chrome above it, so it reads at a glance. */
.regions, .tunnel { --text-xs: 0.875rem; --text-sm: 1rem; --text-md: 1.0625rem; --color-muted: var(--color-muted-strong); }
.regions .region h2 { color: var(--color-ink); }
.tunnel__table tbody th, .tunnel__table td { padding-block: var(--space-md); }
.tunnel__table .td { margin-top: var(--space-3xs); }

/* Narrow windows */
@media (max-width: 80rem) {
  .regions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pressures { grid-column: 1 / -1; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap-columns); }
}
@media (max-width: 60rem) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .take { padding-left: 0; border-left: 0; padding-top: var(--space-sm); border-top: 1px solid var(--color-rule-soft); }
  .record__head { grid-template-columns: auto minmax(0, 1fr); }
  .record__tools { grid-column: 1 / -1; justify-items: start; justify-self: stretch; }
  .try, .try__msg, .shock-wait { justify-content: flex-start; text-align: left; }
  .regions { grid-template-columns: minmax(0, 1fr); }
  .figs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  /* Phones: the chart should start within the first screen. Wordmark and transport share a row, the three
     sheets sit in one row of small buttons beside the run state, and the counter shares a row with the summary. */
  /* The intro collapses to one line behind "More"; wordmark and the sheet buttons share the first row. */
  .bar { position: static; }
  .bar__inner { gap: var(--space-2xs) var(--space-sm); padding-block: var(--space-sm) var(--space-xs); min-height: 0; }
  .brand { display: contents; }
  .brand__row { order: 1; flex: 1 1 auto; }
  .wordmark { font-size: var(--text-xl); }
  .narr { font-size: var(--text-sm); }
  .narr__label { display: none; }
  .tagline { order: 2; flex: 1 1 100%; font-size: var(--text-sm); line-height: 1.3; }
  .purpose { order: 2; flex: 1 1 100%; font-size: var(--text-sm); line-height: 1.3; }
  .chain { order: 4; flex: 1 1 100%; border-radius: var(--radius-card); font-size: var(--text-sm); }
  /* The record: counter and headline, then the chart, then the AI's decision, the shocks and the takeaway. */
  .record { display: flex; flex-direction: column; }
  .record__head, .stage { display: contents; }
  .record__head > .counter { order: 1; margin-bottom: var(--space-2xs); }
  /* Counter and headline, then the chart with its axis and key, then the shock controls; the panels below. */
  .headline { order: 2; }
  .record__tools { order: 5; margin-block: 0 var(--space-xs); }
  .read { order: 6; }
  .stage__plot { order: 7; }
  .stage__plot .tour { margin-top: var(--space-sm); }
  .statusline { order: 3; margin: calc(-1 * var(--space-xs)) 0 var(--space-xs); font-size: var(--text-xs); }
  .ai { order: 4; margin-top: 0; }
  .take { order: 8; margin-top: var(--space-md); }
  .finding { display: none; }
  .notice__inner { padding-block: var(--space-xs); font-size: var(--text-sm); line-height: 1.35; }
  .chain { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3xs) var(--space-sm); padding-block: var(--space-3xs); }
  .counter .status:not([data-kind="conn"]):not(:has(.shock)) { display: none; }
  .plot__well { height: clamp(260px, 70vw, 340px); }
  .key { gap: var(--space-3xs) var(--space-md); font-size: var(--text-xs); margin-top: var(--space-3xs); }
  .axis { height: 28px; font-size: var(--text-sm); }
  .axis__note { font-size: var(--text-xs); }
  .transport { flex-wrap: nowrap; }
  .transport .btn, .actions .btn, .speed-select { min-height: 32px; padding: 0 var(--space-sm); }
  .actions { order: 1; gap: var(--space-2xs); }
  .transport { order: 1; }
  #speed { display: none; }
  .speed-select { display: inline-block; }
  .record { padding-block: var(--space-xs) var(--space-md); }
  .record__title { display: contents; }
  .counter__of small { display: none; }
  .seg .long { display: none; }
  .seg .short { display: inline; }
  .record__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
  #mode { flex: none; }
  .try { flex: 1 1 0; min-width: 0; width: auto; gap: var(--space-xs); }
  .try__sub { display: none; }
  .try__lede { display: none; }
  .ai { display: block; padding: var(--space-xs) var(--space-sm); margin-bottom: var(--space-xs); }
  .ai__tag { display: flex; width: fit-content; margin-bottom: var(--space-2xs); padding: 0 var(--space-xs); font-size: var(--text-xs); }
  .ai__mark { width: 6px; height: 6px; }
  .ai__line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .ai__meta { display: none; }
  .read__h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .read { flex-wrap: nowrap; align-items: center; gap: var(--space-sm); }
  .read__text p { font-size: var(--text-sm); line-height: 1.3; }
  .ai__line { font-size: var(--text-sm); }
  .read { margin-top: var(--space-sm); }
  .read__text, .read__h { font-size: var(--text-md); }
  .record__head { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
  .record__tools { grid-column: auto; }
  .counter__of { max-width: 13rem; }
  .counter { flex-direction: row; align-items: baseline; gap: var(--space-sm); line-height: 1; }
  .counter__n { font-size: var(--text-counter); line-height: 0.9; }
  .counter__of { font-size: var(--text-xs); }
  .record__title h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .headline { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
  .plot__caption { font-size: var(--text-md); left: var(--space-xs); top: var(--space-xs); }
  .shocks li { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
  .try .btn { flex: 1 1 0; min-width: 0; padding: 0 var(--space-xs); }
  .gene { grid-template-columns: 7rem minmax(0, 1fr) 3.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .skeleton i { animation: none; opacity: 0.8; }
  .pin::after { animation: none; opacity: 0; }
}

/* ---------- footer: code and sister-project links ---------- */
.foot { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); padding-block: var(--space-lg) var(--space-xl); border-top: 1px solid var(--color-rule); font-size: var(--text-sm); color: var(--color-muted); }
.foot__shared { flex: 1 1 100%; color: var(--color-ink-2); }
.foot a { color: var(--color-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.foot a:hover { text-decoration-thickness: 2px; }
.foot a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* A code name in a model's quote, shown in plain words; the raw word is in the title. */
.term { text-decoration: underline dotted; text-underline-offset: 0.18em; text-decoration-thickness: 1px; cursor: help; }
.tour__body p + p { margin-top: var(--space-xs); }

/* Test your own rules: a sheet that compares a visitor's rules with the defaults, from results/test-rules.json or a live job */
.sheet--test { width: min(32rem, 100%); }
.tr-presets { margin-bottom: var(--space-md); }
.tr-presets__k { color: var(--color-muted); font-size: var(--text-xs); margin-bottom: var(--space-2xs); }
.tr-run { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.tr-progress { height: 4px; margin-top: var(--space-sm); background: var(--color-paper-3); border-radius: 2px; overflow: hidden; }
.tr-progress i { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width var(--dur-long) var(--ease-out); }
.tr-progress.is-wait i { width: 30%; animation: tr-wait 1.4s var(--ease-in-out) infinite alternate; }
@keyframes tr-wait { from { transform: translateX(-100%); } to { transform: translateX(330%); } }
@media (prefers-reduced-motion: reduce) { .tr-progress.is-wait i { animation: none; width: 100%; opacity: 0.4; } }
.tr-result { margin-top: var(--space-sm); padding: var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-3); }
.tr-result__h { font-size: var(--text-lg); line-height: 1.35; font-weight: 600; color: var(--color-ink); margin-bottom: var(--space-xs); }
.tr-result__h:focus { outline: none; }
.tr-rows { margin: var(--space-md) 0; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3xs) var(--space-sm); padding: var(--space-xs) 0; border-top: 1px solid var(--color-rule-soft); }
.tr-row dt { font-size: var(--text-sm); color: var(--color-ink-2); }
.tr-row dd { margin: 0; font-size: var(--text-sm); font-variant-numeric: proportional-nums; text-align: right; white-space: nowrap; }
.tr-row .tr-d { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); text-align: left; }
.tr-row.is-clear dd.tr-v { color: var(--color-ink); font-weight: 600; }
.tr-tag { padding: 0 var(--space-2xs); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); }
.tr-row.is-clear .tr-tag { border-color: var(--color-accent); color: var(--color-accent); }
.tunnel__own { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin: var(--space-sm) 0; color: var(--color-ink-2); font-size: var(--text-sm); }
.btn--primary[aria-expanded="true"] { background: var(--color-accent); border-color: var(--color-ink); color: var(--color-accent-ink); }
.sheet--test .rule.is-changed .seg label { color: var(--color-ink-2); }
.sheet--test .rule.is-changed .seg input:checked + label { color: var(--color-paper); }
