/* Onchain Markets Lab — Real World Activated
   Same credit-desk language as ProofGate: deep green-black canvas,
   hairline rules, serif display headings, monospace figures.
   Live chain reads are marked LIVE; every simulation is marked SAMPLE. */

:root {
  --ink: #f2f7f1;
  --muted: #93a396;
  --muted-strong: #c3cfc4;
  --canvas: #060d09;
  --canvas-soft: #0a130d;
  --panel: #0d1912;
  --panel-raised: #122217;
  --line: rgba(196, 224, 200, 0.13);
  --line-strong: rgba(196, 224, 200, 0.27);
  --green: #00c805;
  --green-bright: #72ff78;
  --green-pale: #d7ffda;
  --green-dim: rgba(0, 200, 5, 0.12);
  --amber: #f2c94c;
  --amber-dim: rgba(242, 201, 76, 0.12);
  --danger: #ff6b72;
  --danger-dim: rgba(255, 107, 114, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  --pointer-x: 80%;
  --pointer-y: 8%;
  color-scheme: dark;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 42% at var(--pointer-x) var(--pointer-y), rgba(0, 200, 5, 0.05), transparent 70%),
    radial-gradient(ellipse 90% 40% at 85% -5%, rgba(0, 200, 5, 0.07), transparent),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--mono); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed; z-index: 1000; top: 12px; left: 12px;
  padding: 10px 14px;
  color: #061009;
  background: var(--green-bright);
  border-radius: var(--radius-sm);
  transform: translateY(-180%);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:is(a, button, input, select, textarea, summary, pre):focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Reveal (driven by ../app.js) ────────────────────────── */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── Top bar ─────────────────────────────────────────────── */
.top-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  align-items: center; justify-content: space-between;
  width: min(1360px, calc(100% - 48px));
  min-height: 78px;
  margin: 0 auto;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.3s ease;
}
.top-bar.is-scrolled {
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(10px);
}
.wordmark { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; letter-spacing: -0.02em; }
.wordmark svg { width: 32px; color: var(--green-bright); }
.wordmark span { font-size: 16px; font-weight: 520; white-space: nowrap; }
.wordmark b { font-weight: 800; }
.product-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.product-nav a {
  padding: 8px 12px;
  color: var(--muted-strong);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.product-nav a:hover { color: var(--ink); }
.product-nav a.is-active { color: var(--green-pale); background: var(--green-dim); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.network-chip {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 12px;
  color: var(--muted-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.network-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.network-chip[data-tone="ok"] i { background: var(--green); box-shadow: 0 0 10px var(--green); }
.network-chip[data-tone="bad"] i { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* ── Shared furniture ────────────────────────────────────── */
.lab-main { width: min(1360px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--green-bright);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.section-head {
  display: flex; flex-wrap: wrap; gap: 16px 40px;
  align-items: end; justify-content: space-between;
  margin-bottom: 28px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.section-note { max-width: 440px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.section-note b { color: var(--muted-strong); }
.section-note code { font-size: 12px; color: var(--muted-strong); }

.lab-section { padding: 72px 0 12px; }

/* ── Tags: live vs sample vs config ──────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  vertical-align: 2px;
}
.tag-live { color: var(--green-pale); background: var(--green-dim); border: 1px solid rgba(114, 255, 120, 0.35); }
.tag-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: live-pulse 2.4s ease-in-out infinite;
}
.tag-sample { color: var(--amber); background: var(--amber-dim); border: 1px solid rgba(242, 201, 76, 0.35); }
.tag-config { color: var(--muted-strong); background: rgba(196, 224, 200, 0.07); border: 1px solid var(--line-strong); }
@keyframes live-pulse { 50% { opacity: 0.35; } }

/* ── Masthead ────────────────────────────────────────────── */
.masthead { padding: clamp(56px, 9vh, 110px) 0 24px; max-width: 900px; }
.masthead h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(36px, 5.4vw, 64px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.masthead-lede { max-width: 700px; margin: 0 0 28px; color: var(--muted-strong); font-size: 15.5px; line-height: 1.7; }

.disclosure {
  display: grid; gap: 6px;
  max-width: 760px;
  margin: 0 0 26px;
  padding: 16px 18px;
  border: 1px solid rgba(242, 201, 76, 0.3);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-md);
  background: var(--amber-dim);
  font-size: 13px; line-height: 1.6;
}
.disclosure strong { color: var(--amber); letter-spacing: 0.01em; }
.disclosure span { color: var(--muted-strong); }

.legend { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 0; }
.legend > div { display: flex; gap: 10px; align-items: baseline; max-width: 340px; }
.legend dt { margin: 0; }
.legend dd { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* ── Panels ──────────────────────────────────────────────── */
.panel {
  display: flex; flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-raised), var(--panel) 55%);
}
.panel-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; display: flex; gap: 10px; align-items: center; }
.panel-sub { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.panel-fine { margin: 14px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.panel-fine code { font-size: 11px; color: var(--muted-strong); }

/* ── Network desk ────────────────────────────────────────── */
.desk-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.desk-controls { display: flex; gap: 10px; align-items: center; }
.status-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.status-pill[data-tone="wait"] { color: var(--muted-strong); background: rgba(196, 224, 200, 0.08); }
.status-pill[data-tone="ok"] { color: var(--green-pale); background: var(--green-dim); }
.status-pill[data-tone="bad"] { color: var(--danger); background: var(--danger-dim); }

.stat-rows { margin: 0; display: grid; gap: 0; }
.stat-row {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  align-items: baseline; justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.stat-row dt { color: var(--muted); font-size: 12.5px; }
.stat-row dd { margin: 0; font-size: 13.5px; text-align: right; }
.stat-row code { color: var(--green-pale); font-size: 13px; }
.stat-big { font-size: 22px !important; font-weight: 600; letter-spacing: 0.01em; }
.stat-wrap { word-break: break-all; font-size: 11.5px !important; }
.stat-flag { font-size: 11px; font-weight: 700; }
.stat-flag[data-tone="ok"] { color: var(--green-bright); }
.stat-flag[data-tone="bad"] { color: var(--danger); }
.stat-row a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.stat-row a:hover code { color: var(--green-bright); }

.boundary-note {
  display: flex; gap: 12px; align-items: center;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.boundary-note::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }

/* ── Composer ────────────────────────────────────────────── */
.composer-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 18px; align-items: start; }

.noscript-note {
  margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid rgba(255, 107, 114, 0.4);
  border-radius: var(--radius-md);
  background: var(--danger-dim);
  color: var(--ink); font-size: 13px;
}

.exposure-list { display: grid; gap: 14px; }
.exposure {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas-soft);
}
.exposure.is-eligible { border-color: rgba(114, 255, 120, 0.3); }
.exposure.is-blocked { border-color: rgba(242, 201, 76, 0.3); }
.exposure-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.exposure-code {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--green-bright); letter-spacing: 0.1em;
}
.exposure-kind { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.exposure-label { margin: 4px 0 2px; font-size: 14px; font-weight: 650; }
.exposure-detail { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.exposure-controls { display: flex; gap: 12px; align-items: center; }
.exposure-controls input[type="range"] { flex: 1; accent-color: var(--green); min-width: 80px; }
.exposure-pct {
  width: 74px; padding: 6px 8px;
  color: var(--green-pale);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 13px; text-align: right;
}
.exposure-usd { min-width: 84px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--muted-strong); }
.exposure-state { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; }
.exposure-state[data-tone="ok"] { color: var(--green-bright); }
.exposure-state[data-tone="hold"] { color: var(--amber); }
.exposure-state[data-tone="idle"] { color: var(--muted); }

.alloc-footer { margin-top: 16px; }
.alloc-meter {
  height: 10px; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas-soft);
}
.alloc-meter-track { display: flex; height: 100%; transition: width 0.25s ease; }
.alloc-meter-track span { height: 100%; transition: width 0.25s ease; }
.alloc-meter.is-over .alloc-meter-track { outline: 1px solid var(--danger); }
.alloc-total { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.alloc-total code { color: var(--green-pale); }
.alloc-total [data-alloc-remainder] { color: var(--muted); }
.alloc-total .is-over { color: var(--danger); font-weight: 700; }

.policy-fieldset, .prereq-fieldset, .event-fieldset { margin: 0; padding: 0; border: 0; }
.policy-list, .prereq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-tile {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.check-tile:hover { border-color: var(--line-strong); }
.check-tile:has(input:checked) { border-color: rgba(114, 255, 120, 0.4); background: rgba(0, 200, 5, 0.06); }
.check-tile:has(input:focus-visible) { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.check-tile input {
  margin: 2px 0 0;
  width: 16px; height: 16px; flex: none;
  accent-color: var(--green);
}
.check-tile .tile-label { font-size: 13px; font-weight: 600; line-height: 1.4; }
.check-tile .tile-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 400; line-height: 1.5; }
.check-tile .tile-used { display: block; margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }

.outcome-panel { position: sticky; top: 96px; }
.outcome-figures { display: grid; gap: 10px; margin-bottom: 16px; }
.outcome-big, .outcome-small { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.outcome-big code { font-size: clamp(28px, 3vw, 38px); font-weight: 650; color: var(--green-bright); letter-spacing: -0.01em; }
.outcome-small code { font-size: 18px; color: var(--amber); }
.outcome-big span, .outcome-small span { color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }

.blocker-block h4 { margin: 0 0 8px; color: var(--muted-strong); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.blocker-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.blocker-list li {
  padding: 9px 12px;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--amber-dim);
  color: var(--muted-strong);
  font-size: 12px; line-height: 1.5;
}
.blocker-list li.is-over { border-left-color: var(--danger); background: var(--danger-dim); }
.blocker-list li.is-clear { border-left-color: var(--green); background: var(--green-dim); color: var(--green-pale); }
.blocker-list b { color: var(--ink); }
.blocker-list code { font-size: 11.5px; }

/* ── Buttons ─────────────────────────────────────────────── */
.primary-button {
  display: inline-flex; gap: 14px; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  color: #061009;
  background: var(--green-bright);
  border: 0; border-radius: 999px;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.primary-button:hover:not(:disabled) { background: #99ff9e; }
.primary-button:active:not(:disabled) { transform: scale(0.98); }
.primary-button:disabled { opacity: 0.4; cursor: not-allowed; }
.ghost-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 14px;
  color: var(--muted-strong);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ghost-button:hover { color: var(--ink); border-color: var(--green-bright); }

.export-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px; }
.digest-line { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; }
.digest-line code { display: inline-block; max-width: 100%; word-break: break-all; color: var(--green-pale); font-size: 11px; }

.json-details { border-top: 1px solid var(--line); padding-top: 10px; }
.json-details summary { color: var(--muted-strong); font-size: 12px; font-weight: 600; cursor: pointer; }
.json-details summary:hover { color: var(--ink); }
.json-view {
  max-height: 320px; overflow: auto;
  margin: 10px 0 0; padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--muted-strong);
  font-family: var(--mono); font-size: 11px; line-height: 1.55;
  white-space: pre; tab-size: 2;
}

/* ── Corporate action gate ───────────────────────────────── */
.gate-grid { display: grid; grid-template-columns: 1fr 1.1fr 1.15fr; gap: 18px; align-items: start; }

.event-list { display: grid; gap: 8px; }
.event-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.event-option:hover { border-color: var(--line-strong); }
.event-option:has(input:checked) { border-color: rgba(114, 255, 120, 0.45); background: rgba(0, 200, 5, 0.07); }
.event-option:has(input:focus-visible) { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.event-option input { margin: 3px 0 0; width: 15px; height: 15px; flex: none; accent-color: var(--green); }
.event-option .event-code { font-family: var(--mono); font-size: 10px; color: var(--green-bright); letter-spacing: 0.1em; }
.event-option .event-name { display: block; font-size: 13.5px; font-weight: 650; margin-top: 2px; }
.event-option .event-applies { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }

.event-terms {
  margin-top: 14px; padding: 12px 14px;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--canvas-soft);
  color: var(--muted-strong);
  font-size: 12px; line-height: 1.6;
}
.event-terms b { color: var(--ink); }

/* pipeline */
.pipeline { list-style: none; display: flex; gap: 0; margin: 0 0 18px; padding: 0; }
.pipeline li { flex: 1; position: relative; padding: 0 6px 0 0; }
.pipeline li:not(:last-child)::after {
  content: "";
  position: absolute; top: 7px; right: -2px; left: calc(50% + 14px);
  border-top: 1px solid var(--line-strong);
}
.pipeline .node {
  display: block; width: 15px; height: 15px;
  margin: 0 auto 8px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--canvas-soft);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pipeline .stage-name { display: block; text-align: center; color: var(--muted); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.pipeline .stage-count { display: block; text-align: center; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.pipeline li[data-state="done"] .node { border-color: var(--green); background: var(--green); box-shadow: 0 0 10px rgba(0, 200, 5, 0.5); }
.pipeline li[data-state="done"] .stage-name { color: var(--green-pale); }
.pipeline li[data-state="partial"] .node { border-color: var(--amber); background: var(--amber-dim); }
.pipeline li[data-state="partial"] .stage-name { color: var(--amber); }
.pipeline li[data-state="blocked"] .node { border-color: var(--danger); background: var(--danger-dim); }
.pipeline li[data-state="blocked"] .stage-name { color: var(--danger); }

.decision {
  margin-bottom: 14px; padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.decision[data-tone="blocked"] { border-color: rgba(242, 201, 76, 0.4); background: var(--amber-dim); }
.decision[data-tone="ready"] { border-color: rgba(114, 255, 120, 0.4); background: var(--green-dim); }
.decision-state {
  margin: 0 0 4px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.decision[data-tone="blocked"] .decision-state { color: var(--amber); }
.decision[data-tone="ready"] .decision-state { color: var(--green-bright); }
.decision-why { margin: 0; color: var(--muted-strong); font-size: 12px; line-height: 1.55; }

.receipt { border-top: 1px solid var(--line); padding-top: 14px; }

/* ── Boundaries & footer ─────────────────────────────────── */
.boundaries { max-width: 860px; padding: 72px 0 40px; }
.boundaries h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500; letter-spacing: -0.02em;
}
.boundaries ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.boundaries li {
  padding: 12px 0 12px 18px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: 13px; line-height: 1.65;
}
.boundaries b { color: var(--muted-strong); }

.lab-footer {
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px; line-height: 1.65;
}
.lab-footer p { margin: 0 0 8px; max-width: 820px; }
.lab-footer b { color: var(--muted-strong); }
.footer-meta a { color: var(--muted-strong); text-underline-offset: 3px; }
.footer-meta a:hover { color: var(--ink); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 100; bottom: 24px; left: 50%;
  max-width: min(480px, calc(100vw - 40px));
  padding: 0;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible {
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-raised);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font-size: 13px;
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ── Quick start ─────────────────────────────────────────── */
.quickstart-steps {
  list-style: none;
  counter-reset: qstep;
  margin: 0 0 22px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 18px;
}
.quickstart-steps li {
  counter-increment: qstep;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted-strong);
  font-size: 13px; font-weight: 600;
}
.quickstart-steps li::before {
  content: counter(qstep);
  flex: none;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--green-bright);
  font-family: var(--mono); font-size: 11px; font-weight: 400;
}
.quickstart-steps li:not(:last-child)::after {
  content: "→";
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preset-button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 44px; padding: 20px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.preset-button:hover { border-color: var(--line-strong); background: var(--panel-raised); }
.preset-button:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.preset-button.is-active { border-color: rgba(114, 255, 120, 0.5); background: rgba(0, 200, 5, 0.08); }
.preset-button.is-active .preset-name::after { content: " ✓"; color: var(--green-bright); }
.preset-name { font-family: var(--serif); font-size: 20px; letter-spacing: -0.01em; }
.preset-desc { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.preset-summary {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(114, 255, 120, 0.35);
  border-radius: var(--radius-md);
  background: var(--green-dim);
  color: var(--green-pale);
  font-size: 13px; line-height: 1.6;
}
.preset-summary:focus { outline: 2px solid var(--green-bright); outline-offset: 2px; }

/* ── Advanced controls heading ───────────────────────────── */
.advanced-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  margin: 0 0 16px;
}
.advanced-head h3 {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.advanced-head p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .composer-grid { grid-template-columns: 1fr 1fr; }
  .composer-grid .outcome-panel { grid-column: 1 / -1; position: static; }
  .gate-grid { grid-template-columns: 1fr 1fr; }
  .gate-grid .outcome-panel { grid-column: 1 / -1; position: static; }
}
@media (max-width: 860px) {
  .preset-row { grid-template-columns: 1fr; }
  .desk-grid { grid-template-columns: 1fr; }
  .composer-grid, .gate-grid { grid-template-columns: 1fr; }
  .lab-section { padding-top: 56px; }
  .top-bar { position: static; }
}
@media (max-width: 560px) {
  .lab-main, .top-bar, .lab-footer { width: calc(100% - 32px); }
  .exposure-controls { flex-wrap: wrap; }
  .exposure-controls input[type="range"] { flex-basis: 100%; order: 3; }
  .exposure-usd { flex: 1; }
  .pipeline .stage-name { font-size: 9px; }
  .outcome-big code { font-size: 26px; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .tag-live::before { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
