/* TOE Consequences Atlas — static site. No framework. */
:root {
  --bg: #0c0d0a;
  --bg-elev: #161710;
  --bg-soft: #1c1e16;
  --ink: #f3efe4;
  --muted: #a8a494;
  --faint: #737065;
  --line: #2b2d24;
  --accent: #e0b15a;
  --accent-dim: #b48a3a;
  --focus: #f0d59a;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --conjecture: #e0b15a;
  --reproduced: #6fbfa3;
  --differs: #7eb4e0;
  --robust: #8fd18b;
  --known-mechanism: #b39ee0;
  --novel-candidate: #f0c36a;
  --failed: #e07a72;
  --dead-end: #c4937a;
  --inert-by-construction: #8b9084;
  --derived: #8fd18b;
  --derived-under-assumption: #c4c878;
  --imported: #7eb4e0;
  --assumed: #e0b15a;
  --contested: #e08ab8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(224, 177, 90, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(111, 191, 163, 0.05), transparent 50%),
    var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: #1a1408;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  z-index: 20;
}
.skip:focus { top: 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--focus); }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--bg-soft); padding: 0.1em 0.35em; border-radius: 4px; }
pre {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.45;
}
pre code { background: none; padding: 0; }
.quiet, .meta, .sub { color: var(--muted); }
.meta, .eyebrow, .pill-label, .sub { font-size: 0.9rem; }
.caveat {
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 13, 10, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand img { display: block; }
nav { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover { color: var(--ink); }

.hero { padding: 4.2rem 0 3.2rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.5vw, 3.15rem); margin: 0 0 1rem; max-width: 22ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 0.7rem; }
h3 { font-size: 1.2rem; margin: 1.4rem 0 0.5rem; }
.lede { font-size: 1.15rem; max-width: 62ch; color: #d8d4c8; }
.hero-stats {
  list-style: none;
  padding: 0;
  margin: 2rem 0 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.hero-stats li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.hero-stats strong { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.hero-stats .sub { display: block; margin-top: 0.25rem; }
.pills { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pill-label { margin: 0.4rem 0 0.35rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem 0.2rem;
  font-size: 0.78rem;
  font-family: var(--mono);
  letter-spacing: 0.01em;
  background: var(--bg-soft);
  color: var(--ink);
}
.pill-n { font-weight: 600; }
.pill-conjecture, .pill-assumed { color: var(--conjecture); border-color: rgba(224,177,90,.4); }
.pill-reproduced { color: var(--reproduced); border-color: rgba(111,191,163,.4); }
.pill-differs, .pill-imported { color: var(--differs); border-color: rgba(126,180,224,.4); }
.pill-robust, .pill-derived { color: var(--robust); border-color: rgba(143,209,139,.4); }
.pill-known-mechanism { color: var(--known-mechanism); border-color: rgba(179,158,224,.4); }
.pill-novel-candidate { color: var(--novel-candidate); border-color: rgba(240,195,106,.4); }
.pill-failed { color: var(--failed); border-color: rgba(224,122,114,.45); }
.pill-dead-end { color: var(--dead-end); border-color: rgba(196,147,122,.45); }
.pill-inert-by-construction { color: var(--inert-by-construction); border-color: rgba(139,144,132,.45); }
.pill-derived-under-assumption { color: var(--derived-under-assumption); border-color: rgba(196,200,120,.45); }
.pill-contested { color: var(--contested); border-color: rgba(224,138,184,.45); }

.labels, .browse, .contribute { padding: 1.2rem 0 3rem; }
.label-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.2rem; }
.meanings { margin: 0; }
.meanings dt { margin-top: 0.85rem; }
.meanings dd { margin: 0.3rem 0 0; color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.7rem;
  margin: 1.2rem 0 0.4rem;
}
.filters .search { grid-column: 1 / -1; }
.label-colors { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.8rem; }
.label-colors button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.label-colors button[aria-pressed="true"] { outline: 2px solid var(--focus); outline-offset: 2px; }
.filters label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.filters input, .filters select {
  width: 100%;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.95rem;
}
.filters input:focus, .filters select:focus, a:focus-visible, .row:focus-visible, .button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.list-status { min-height: 1.4em; color: var(--muted); margin: 0 0 0.6rem; }
.browse-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  max-height: min(70vh, 920px);
  overflow: auto;
}
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem 0.8rem;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font: inherit;
}
.row:last-child { border-bottom: 0; }
.row:hover, .row[aria-current="true"] { background: var(--bg-soft); }
.row .id { font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
.row .topic { color: var(--muted); font-size: 0.85rem; }
.row .kind { color: var(--faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

.detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1.1rem 1.15rem 1.3rem;
  min-height: 12rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 4.4rem;
  max-height: min(74vh, 960px);
  overflow: auto;
}
.detail h3 { margin-top: 0; font-family: var(--mono); font-size: 1.02rem; word-break: break-word; }
.detail .lead { margin: 0.3rem 0 0.8rem; color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.kv th, .kv td { text-align: left; vertical-align: top; padding: 0.35rem 0.5rem 0.35rem 0; border-bottom: 1px solid var(--line); }
.kv th { color: var(--faint); font-weight: 500; width: 9.5rem; }
.kv td { word-break: break-word; }
.notes, .assumptions { white-space: pre-wrap; color: #d8d4c8; }
.prototype-check {
  margin: 0.6rem 0;
  padding: 0.55rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: #1a1408;
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  margin-top: 0.4rem;
}
.button:hover { color: #1a1408; background: var(--focus); }
.badge-legacy {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.contribute { padding-bottom: 4rem; }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .hero-stats, .label-grid, .browse-layout, .filters { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .hero { padding-top: 2.4rem; }
  h1 { max-width: none; }
  .detail { position: static; max-height: none; }
  .results { max-height: 55vh; }
  nav { gap: 0.7rem; }
}

/* Playground */
.pg-hero { padding: 2rem 0 1rem; }
.pg-hero h1 { max-width: 22ch; }
.pg-details { margin-top: 0.6rem; }
.pg-details summary { cursor: pointer; color: var(--muted); }
.pg-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  padding-bottom: 3rem;
}
.pg-side {
  position: sticky;
  top: 4.3rem;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  padding-right: 0.2rem;
}
.pg-models { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.pg-model {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
  background: var(--bg-elev);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.pg-model[aria-pressed="true"] {
  border-color: rgba(224, 177, 90, 0.75);
  background: var(--bg-soft);
}
.pg-model-title { font-family: var(--serif); font-size: 1.05rem; }
.pg-model-family {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.pg-model-summary { color: var(--muted); font-size: 0.85rem; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.pg-board {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
.pg-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.pg-board-head h2 { margin: 0; font-size: 1.25rem; }
.pg-board-actions { display: flex; align-items: center; gap: 0.7rem; }
#pg-free {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
#pg-free[aria-pressed="true"] {
  background: rgba(224, 177, 90, 0.16);
  border-color: rgba(224, 177, 90, 0.85);
  color: var(--accent);
}
.pg-runbar { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.15rem 0 0.2rem; }
.pg-runbar button {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.pg-run-list { list-style: none; padding: 0; margin: 0.35rem 0 0; }
.pg-run {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: none;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  padding: 0.4rem 0;
  cursor: pointer;
}
#pg-save-note { min-height: 1.2em; margin-top: 0; }
.pg-text-button {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.2rem 0;
}
.pg-text-button:hover { color: var(--focus); }
.pg-dial { margin: 0.85rem 0 0.35rem; }
.pg-dial-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.92rem;
}
.pg-symbol { font-family: var(--serif); color: var(--accent); }
.pg-dial-top label { min-width: 0; }
.pg-dial output {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink);
  flex: 0 0 auto;
  white-space: nowrap;
}
.pg-offlock { color: var(--accent) !important; }
.pg-dial input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 1.7rem;
  margin: 0.15rem 0;
}
.pg-dial-slider {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.pg-dial .pg-dial-slider input[type="range"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.pg-exact {
  flex: 0 0 8.2rem;
  width: 8.2rem;
  box-sizing: border-box;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.4rem;
}
.pg-dial select {
  width: 100%;
  margin-top: 0.25rem;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}
.pg-dial input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  margin-top: 0.35rem;
}
.pg-help { margin: 0.2rem 0 0; font-size: 0.8rem; }
.pg-main h2 { margin-top: 0; }
.pg-banner {
  border: 1px dashed rgba(224, 177, 90, 0.65);
  background: rgba(224, 177, 90, 0.08);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  margin: 0.4rem 0 0.8rem;
}
.pg-banner-explore { border-style: solid; }
.pg-verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.pg-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
}
.pg-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.pg-verdict-value {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0.2rem 0;
}
.pg-ours { list-style: none; padding: 0; margin: 0.3rem 0; }
.pg-ours li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.45;
}
.pg-ours li span:last-child { font-family: var(--mono); font-size: 0.82rem; white-space: nowrap; }
.pg-lock-note { margin-bottom: 0; }
.pg-view { margin: 0 0 1.4rem; }
.pg-view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.pg-view h3 { margin: 0.2rem 0; }
.pg-blurb { margin-top: 0; }
.pg-stamp {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1408;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
}
.pg-frame {
  background: #10110d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.pg-frame.pg-scroll { display: block; }
.pg-scroll { overflow: auto; max-height: 560px; }
.pg-frame canvas, .pg-graph { display: block; }
.pg-graph { width: 100%; height: auto; }
.pg-region-list, .pg-legend {
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  font-size: 0.85rem;
}
.pg-legend { color: var(--muted); }
.pg-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.pg-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.pg-stage {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.65rem 0.75rem;
  background: var(--bg-elev);
  min-height: 8.2rem;
}
.pg-stage h4 { margin: 0.2rem 0 0.45rem; font-size: 1rem; }
.pg-stage-kicker {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pg-stage[data-state="example-on"] {
  border-style: solid;
  border-color: rgba(224, 177, 90, 0.7);
  background: rgba(224, 177, 90, 0.07);
}
.pg-stage[data-state="example-off"] { opacity: 0.55; }
.pg-stage[data-state="on"] {
  border-style: solid;
  border-color: rgba(143, 209, 139, 0.7);
}
.pg-stage[data-state="off"] { opacity: 0.45; }
.pg-transport {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
}
.pg-transport input[type="range"] { flex: 1; accent-color: var(--accent); }
.pg-play {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.pg-note {
  border-left: 3px solid var(--line);
  padding: 0.2rem 0 0.2rem 0.8rem;
  color: var(--muted);
}
.pg-model:focus-visible, .pg-play:focus-visible, .pg-text-button:focus-visible, .pg-dial input:focus-visible, .pg-dial select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .header-inner { align-items: flex-start; flex-wrap: wrap; }
  nav { flex: 1 1 100%; }
}
@media (max-width: 900px) {
  .pg-shell, .pg-verdict, .pg-timeline { grid-template-columns: minmax(0, 1fr); }
  .pg-side { position: static; max-height: none; }
  .pg-timeline { display: flex; overflow-x: auto; padding-bottom: 0.3rem; }
  .pg-timeline .pg-stage { min-width: 11rem; }
  .pg-stage-list { grid-template-columns: 1fr; }
  .pg-hero { padding-top: 1.4rem; }
  .pg-hero h1 { max-width: none; }
  .pg-scroll { max-height: 420px; }
}
.pg-map-svg, .pg-strip-block svg { width: 100%; height: auto; display: block; }
.pg-axes { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0.2rem 0 0.6rem; }
.pg-axis { color: var(--muted); font-size: 0.9rem; }
.pg-axis select { margin-left: 0.35rem; background: var(--bg-elev); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.5rem; font: inherit; }
.pg-map-read { min-height: 2.6em; }
.pg-strip-block { margin-top: 0.35rem; }
.pg-strip-name { margin: 0.2rem 0 0; font-family: var(--serif); }
.pg-stage-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.45rem; }
.pg-dim-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.pg-dim-list li { margin: 0.35rem 0; }
.pg-stage[data-state="ok"] { border-style: solid; border-color: rgba(61, 207, 142, 0.7); }
.pg-stage[data-state="weak"] { border-style: solid; border-color: rgba(201, 180, 74, 0.7); }
.pg-stage[data-state="open"] { border-style: solid; border-color: rgba(126, 180, 224, 0.7); }
.pg-stage[data-state="contested"] { border-style: solid; border-color: rgba(224, 161, 74, 0.75); }
.pg-stage[data-state="fail"] { border-style: solid; border-color: rgba(226, 92, 106, 0.75); }
.pg-stage[data-state="blocked"] { opacity: 0.55; }

/* Atlas shell */
body:has(.atlas-foot) { padding-bottom: 9.2rem; }
.atlas-screen {
  display: grid;
  grid-template-columns: minmax(13.5rem, 17.5rem) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.7rem 1rem;
  width: min(1240px, calc(100% - 1.4rem));
  margin: 0.45rem auto 0;
  height: auto;
  min-height: 0;
}
.atlas-screen.is-compare {
  grid-template-columns: minmax(11rem, 14.5rem) minmax(0, 1fr) minmax(11rem, 14.5rem);
}
.spine { grid-column: 1; grid-row: 1; min-height: 0; max-height: min(62vh, 640px); overflow: auto; }
.spine-ours { grid-column: 3; grid-row: 1; outline: 1px solid rgba(224, 177, 90, 0.6); border-radius: 12px; padding: 0.35rem; }
.map-panel { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dial-dock {
  grid-column: 1 / -1;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem 0.8rem;
}
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.9rem; margin-bottom: 0.35rem; }
.map-panel h1 {
  font-size: clamp(2.15rem, 4.2vw, 3.5rem);
  font-weight: 560;
  margin: 0;
  max-width: none;
  letter-spacing: -0.02em;
}
.map-axes { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.map-stage { flex: 1; min-height: 0; }
.map-frame {
  background: #08090c;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  height: min(62vh, 640px);
  width: min(100%, calc(min(62vh, 640px) * 640 / 560));
}
.map-svg { width: 100%; height: 100%; display: block; }
.map-read {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 2.2em;
  margin: 0.3rem 0 0;
}
.spine-heading {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.spine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.28rem; }
.spine-node {
  width: 100%;
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.15rem 0.4rem;
  align-items: baseline;
  text-align: left;
  background: var(--bg-elev);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.42rem 0.32rem;
  font: inherit;
  cursor: pointer;
}
.spine-node[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.spine-status { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.03em; }
.spine-name { font-family: var(--serif); font-weight: 560; font-size: 0.95rem; line-height: 1.15; }
.spine-node[data-status="PASS"] { border-color: #3dcf8e; }
.spine-node[data-status="WEAK"] { border-color: #c9b44a; }
.spine-node[data-status="OPEN"] { border-color: #7eb4e0; }
.spine-node[data-status="CONTESTED"] { border-color: #e0a14a; }
.spine-node[data-status="FAIL"] { border-color: #e25c6a; }
.spine-node[data-status="BLOCKED"] { border-color: #8b9084; color: var(--muted); }
.dial-dock-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; margin-bottom: 0.35rem; }
.dial-dock-head h2 { margin: 0; font-size: 1.35rem; }
#pg-models { display: flex; flex-direction: row; gap: 0.35rem; margin: 0; }
#pg-models .pg-model { padding: 0.28rem 0.6rem; font-size: 0.88rem; }
.engine-line { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin: 0 0 0.35rem; }
.dial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.2rem 0.9rem; }
.dial-grid .pg-dial { margin: 0; min-width: 0; }
.dial-grid select, .dial-grid .pg-exact { max-width: 100%; }
.dial-name {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.ours-tag { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); white-space: nowrap; }
.slider-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ours-tick {
  position: absolute;
  top: 0.35rem;
  width: 2px;
  height: 0.85rem;
  background: var(--accent);
  transform: translateX(-1px);
  pointer-events: none;
}
.sens-host { margin-top: 0.1rem; }
.sens-bar {
  position: relative;
  display: flex;
  width: 100%;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  background: #08090c;
}
.sens-seg { flex: 1 1 0; min-width: 0; display: block; }
.sens-ours {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f3efe4;
  transform: translateX(-1px);
  pointer-events: none;
}
.first-legend[hidden] { display: none !important; }
.first-legend {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: min(1240px, calc(100% - 1.4rem));
  margin: 0.45rem auto 0;
  padding: 0.45rem 0.7rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
}
.first-legend p { margin: 0; font-size: 0.92rem; }
.first-legend button {
  flex: 0 0 auto;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(224, 177, 90, 0.5);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.linked-row { margin-top: 0.8rem; }
.linked-heading { font-size: 1.35rem; margin: 0 0 0.2rem; }
.linked-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.linked-chip {
  background: var(--bg-elev);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font: inherit;
  cursor: pointer;
}
.more-views { margin-top: 0.6rem; }
.more-views summary { cursor: pointer; color: var(--muted); }
.lattice-section {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.8fr);
  gap: 0.8rem;
  margin-top: 1rem;
  align-items: stretch;
}
.lattice-live, .lattice-play {
  background: #08090c;
  border: 1px dashed rgba(224, 177, 90, 0.65);
  border-radius: 12px;
  min-height: 24rem;
  padding: 0.75rem 0.85rem 1rem;
}
.lattice-quiet { max-width: 42rem; padding: 2.2rem 0.4rem; }
.lattice-quiet p { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; margin: 0 0 0.8rem; }
#run-lattice, .lattice-quiet button {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(224, 177, 90, 0.65);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.honesty-strip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.live-kicker, .lock-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}
.live-kicker { color: var(--accent); }
.lock-kicker { color: var(--ink); }
.live-verdict { font-size: 1.55rem; margin: 0 0 0.35rem; }
.lattice-frame canvas { width: 100%; height: auto; display: block; }
.atlas-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  background: rgba(12, 13, 10, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 0.35rem 0 0.4rem;
}
.atlas-foot p { margin: 0.15rem 0; font-size: 0.78rem; line-height: 1.35; }
.foot-swatches { display: flex; flex-wrap: wrap; gap: 0.28rem 0.35rem; align-items: center; }
.st {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.02rem 0.38rem;
}
.st-pass { border-color: #3dcf8e; }
.st-weak { border-color: #c9b44a; }
.st-open { border-color: #7eb4e0; }
.st-contested { border-color: #e0a14a; }
.st-fail { border-color: #e25c6a; }
.st-blocked { border-color: #8b9084; }
.drawer {
  width: min(38rem, calc(100% - 1.5rem));
  max-height: min(82vh, 42rem);
  overflow: auto;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem 1.2rem;
}
.drawer::backdrop { background: rgba(0, 0, 0, 0.55); }
.drawer-bar { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; }
.drawer-bar h2 { margin: 0; font-size: 1.45rem; }
.drawer-bar button {
  background: transparent;
  color: var(--accent);
  border: 0;
  font: inherit;
  cursor: pointer;
}
.drawer-h { font-size: 1.05rem; margin: 0.9rem 0 0.3rem; }
.link-fold { margin: 0.35rem 0; }
.link-fold summary { cursor: pointer; }
.assume { margin: 0.3rem 0; padding-left: 1.1rem; color: var(--muted); }
.mono, .engine-line, .map-read, .spine-status, output { font-family: var(--mono); }

@media (max-width: 800px) {
  body:has(.atlas-foot) { padding-bottom: 12rem; }
  .atlas-screen, .atlas-screen.is-compare {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    width: calc(100% - 0.8rem);
  }
  .map-panel { order: 1; min-height: 0; }
  .map-frame { height: 34vh; width: 100%; }
  .map-svg { height: 100%; width: 100%; }
  .first-legend p { font-size: 0.78rem; line-height: 1.3; }
  .spine, .spine-ours { order: 2; overflow: visible; max-height: none; }
  .spine-list { flex-direction: row; overflow-x: auto; padding-bottom: 0.25rem; }
  .spine-list > li { min-width: 11.5rem; }
  .dial-dock { order: 4; }
  .dial-grid { grid-template-columns: 1fr; }
  .lattice-section { grid-template-columns: 1fr; }
  .map-panel h1 { font-size: 2rem; }
  .pg-dial-slider { flex-wrap: wrap; }
  .pg-exact { flex-basis: 100%; width: 100%; }
}
