:root {
  /* light theme = the story page's tokens (app/story.html): warm paper, one ink family, purple dashed = simulated */
  --bg: #efebe4;
  --card: #fbfaf7;
  --panel-2: #f5f2ec;
  --ink: #1d1b18;
  --muted: #5b554d;
  --line: #e4ddd2;
  --line-2: #d6cec1;
  --accent: #0b6b74;
  --accent-soft: #dcf1f2;
  --alert: #b45309;
  --alert-soft: #fdf1e3;
  --bad: #b42318;
  --bad-soft: #fbe4e1;
  --ok: #157a42;
  --ok-soft: #e0f3e7;
  --neutral-soft: #f5f2ec;
  --sim: #7b3fe4;
  --sim-soft: #f1e9fe;
  --red: #c0352b;
  --red-soft: #fbe4e1;
  --green: #157a42;
  --green-soft: #e0f3e7;
  --methane: #e2590f;
  --chain: #2457d6;
  --chain-soft: #e4ecfd;
  --r: 10px;
  --shadow: 0 1px 2px rgba(30, 25, 20, .06), 0 4px 14px rgba(30, 25, 20, .06);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* dark palette: opt-in (<html data-theme="dark">); the default is light, like the story page */
@media all {
  :root[data-theme="dark"] {
    --bg: #121516; --card: #1b1f21; --panel-2: #202527; --ink: #e6eaeb; --muted: #9aa6ab; --line: #2c3336; --line-2: #3a4245;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --accent: #5fb3c2; --accent-soft: #1d3136; --alert: #f0a35b; --alert-soft: #3a2a17;
    --bad: #f2786c; --bad-soft: #3b1f1c; --ok: #5cc28c; --ok-soft: #183026; --neutral-soft: #24292b;
    --sim: #b794ff; --sim-soft: #2a2140; --red: #f2786c; --red-soft: #3b1f1c; --green: #5cc28c; --green-soft: #183026;
    --methane: #f59e4b; --chain: #7ea2ff; --chain-soft: #1c2640;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
code { font: 12.5px/1.4 var(--mono); overflow-wrap: anywhere; }
a { color: var(--accent); }
h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; }
.pill { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.sim { font-weight: 600; color: var(--sim); }
.lede { margin: 18px 0 6px; color: var(--muted); max-width: 900px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 20px 0; padding: 20px; box-shadow: var(--shadow); }
.card-head { margin-bottom: 12px; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.grid-map { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
#map { height: 420px; border-radius: 8px; border: 1px solid var(--line); }
.side { max-height: 420px; overflow: auto; }
.src { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
.src:last-child { border-bottom: 0; }
.src h3 { margin: 0 0 4px; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--neutral-soft); color: var(--muted); }
.badge.absent { background: var(--neutral-soft); color: var(--ink); border: 1px dashed var(--muted); }
.badge.detect { background: var(--alert-soft); color: var(--alert); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
table.dets { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.dets td, table.dets th { padding: 3px 6px 3px 0; text-align: left; border-bottom: 1px solid var(--line); }
table.dets th { color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cov { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.stat { background: var(--neutral-soft); border-radius: 8px; padding: 10px 12px; }
.stat .lbl { display: block; font-size: 12px; color: var(--muted); }
.stat .val { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .val.small { font-size: 13px; font-weight: 500; }
.status-list { grid-column: 1 / -1; display: grid; gap: 6px; }
.status { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--neutral-soft); flex-wrap: wrap; }
.status.hit { background: var(--alert-soft); }
.chips { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); }
table.ep { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.ep td, table.ep th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.ep th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
tr.child td:first-child { padding-left: 26px; }
tr.child td { color: var(--muted); }
.state { font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 4px; background: var(--neutral-soft); }
.state.CONFIRMED { background: var(--accent-soft); color: var(--accent); }
.state.PROPOSED { background: var(--alert-soft); color: var(--alert); }
.state.REVERTED { background: var(--bad-soft); color: var(--bad); }
.state.LINKED { background: var(--neutral-soft); color: var(--muted); }
.tamper-grid, .export-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
table.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.kv td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td:first-child { color: var(--muted); white-space: nowrap; width: 1%; }
table.kv td:last-child { font-family: var(--mono); overflow-wrap: anywhere; }
table.kv tr.edited td { background: var(--bad-soft); color: var(--bad); }
table.kv.annex td:last-child { font-family: var(--sans); }
.tamper-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tamper-actions input { width: 110px; padding: 6px 8px; font: 14px var(--mono); border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.btn { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2); font-weight: 500; background: var(--card); color: var(--ink); font: 13.5px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hashes { display: grid; gap: 8px; margin-bottom: 10px; }
.hashes .lbl { display: block; font-size: 12px; color: var(--muted); }
.hashes code { display: block; padding: 6px 8px; border-radius: 6px; background: var(--neutral-soft); }
.hashes code.bad { background: var(--bad-soft); color: var(--bad); }
ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.checks li { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; background: var(--neutral-soft); }
ul.checks li.pass { background: var(--ok-soft); }
ul.checks li.pass::before { content: "✓ "; color: var(--ok); font-weight: 700; }
ul.checks li.fail { background: var(--bad-soft); color: var(--bad); }
ul.checks li.fail::before { content: "✕ "; font-weight: 700; }
ul.checks li.info::before { content: "• "; color: var(--muted); }
.verdict { font-weight: 600; margin: 10px 0 0; min-height: 1.5em; }
.verdict.bad { color: var(--bad); }
.export-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.limits { margin: 24px 0 40px; color: var(--muted); font-size: 13.5px; }
.limits h2 { color: var(--ink); font-size: 14.5px; }
.attrib { font-size: 12px; }
.leaflet-container { font: 12px var(--sans); }
@media (max-width: 820px) {
  .grid-map, .tamper-grid, .export-grid { grid-template-columns: 1fr; }
  table.kv tr { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding: 4px 0; }
  table.kv td { border-bottom: 0; padding: 1px 6px; }
  table.kv td:first-child { white-space: normal; width: auto; font-size: 11.5px; }
  table.ep, table.ep tbody, table.ep tr, table.ep td { display: block; }
  table.ep tr:first-child { display: none; }
  table.ep tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.ep td { border: 0; padding: 2px 4px; }
  tr.child td:first-child { padding-left: 14px; }
  #map { height: 300px; }
  .legend { font-size: 10.5px; line-height: 1.4; padding: 4px 6px; }
  .side { max-height: none; }
}
.legend { background: var(--card); color: var(--ink); padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 11.5px; line-height: 1.6; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .dot.cm { background: #f0a35b; border: 1px solid #b45309; }
.legend .dot.old { background: #c3c9cc; border: 1px solid #7b868c; }
.legend .dot.mars { background: #fff; border: 2px solid #1d2327; }
.legend .ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px dashed #5d6870; margin-right: 6px; vertical-align: -1px; }

/* ================================================================ v2 */
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 2000; background: var(--card); padding: 6px 10px; border-radius: 6px; }
.persona-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 12px; }
.persona-lbl { font-size: 12.5px; color: var(--muted); }
.persona-note { font-size: 12.5px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 13.5px var(--sans); padding: 6px 12px; border: 0; border-right: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--card); font-weight: 600; }
.seg button[aria-checked="true"] .sim { color: var(--card); }
.seg button:focus-visible, select:focus-visible, input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notprove { margin: 16px 0 10px; padding: 12px 16px; border-radius: 10px; border: 2px solid var(--ink); background: var(--card); }
.notprove h2 { font-size: 15px; margin-bottom: 6px; }
.notprove ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--muted); }
.notprove li::before { content: "✕ "; color: var(--ink); font-weight: 700; }
.notprove strong { color: var(--ink); }

.modestrip { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.modestrip .strip { margin: 0 0 6px; color: var(--ink); line-height: 2; }
.modes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.mode { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 0 6px; border-radius: 4px; line-height: 17px; vertical-align: 1px; white-space: nowrap; }
.m-real { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.m-comp { background: var(--accent-soft); color: var(--accent); border: 1px dotted var(--accent); }
.m-sim { background: var(--alert-soft); color: var(--alert); border: 1px dashed var(--alert); }
.m-proj { background: var(--neutral-soft); color: var(--muted); border: 1px double var(--muted); font-style: italic; }
.mockb { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; line-height: 17px; vertical-align: 1px; white-space: nowrap;
  color: var(--bad); background: repeating-linear-gradient(-45deg, var(--bad-soft), var(--bad-soft) 4px, var(--card) 4px, var(--card) 8px); border: 1px solid var(--bad); text-transform: uppercase; }

.persona-card h2 { font-size: 16px; }
.persona-card .cov { margin-top: 10px; }

.ledger { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.ledger:last-child { margin-bottom: 0; }
.ledger-head h3 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panels { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1.35fr) 22px minmax(0, 1fr); gap: 8px; margin-top: 10px; align-items: start; }
.panels .arrow { display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.panel { border-radius: 8px; padding: 10px; background: var(--neutral-soft); border-top: 4px solid var(--muted); min-width: 0; }
.panel h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel .step { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--card); font-size: 12px; align-items: center; justify-content: center; }
.panel.leak, .panel.relapse { border-top-color: var(--alert); }
.panel.clean { border-top-color: var(--ok); border-top-style: dashed; }
.panel.none { border-top-color: var(--muted); border-top-style: dotted; }
.panel .big { font-size: 16px; font-weight: 600; margin: 4px 0 10px; }
.panel .unit, .ledger-foot .unit { font-size: 13px; padding: 8px; border-left: 3px solid var(--ok); background: var(--card); margin: 8px 0; }
.fact { display: grid; gap: 1px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fact:last-child { border-bottom: 0; }
.fact .lbl { font-size: 11.5px; color: var(--muted); }
.scene-map { height: 190px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); }
.tile-note { margin: 4px 0 6px; font-size: 11.5px; color: var(--muted); }
td.ok-t { color: var(--ok); font-weight: 600; }
td.bad-t { color: var(--bad); font-weight: 600; }
/* two-panel TKM card: leak + "no qualified clean pass" */
.panels:not(:has(.panel:nth-of-type(3))) { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); }

.obs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ostep { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ostep-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ostep-n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--neutral-soft); align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.ostep.done .ostep-n { background: var(--ok); color: var(--card); }
.ostep.failed .ostep-n { background: var(--bad); color: var(--card); }
.ostep-s { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.ostep.done .ostep-s { color: var(--ok); }
.ostep.failed .ostep-s { color: var(--bad); }
.ostep.waiting { opacity: 0.6; }

.tamper-h { margin: 18px 0 2px; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tamper-h:first-of-type { margin-top: 4px; }
.tamper-grid { margin-top: 8px; }
.tamper-actions select { padding: 6px 8px; font: 14px var(--mono); border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.tamper-actions input[type=number] { width: 90px; }
.scroll-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.scroll-table table.dets td, .scroll-table table.dets th { padding: 3px 8px; }
tr.removed td { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
tr.removed td:first-child { text-decoration: none; }

.limits ul { padding-left: 18px; }
.limits li { margin-bottom: 4px; }
.limits strong { color: var(--ink); }

@media (max-width: 980px) {
  .panels, .panels:not(:has(.panel:nth-of-type(3))) { grid-template-columns: 1fr; }
  .panels .arrow { transform: rotate(90deg); height: 18px; }
}
@media (max-width: 820px) {
  .persona-bar { padding-bottom: 10px; }
  .seg button { padding: 6px 9px; font-size: 13px; }
}
.ostep, ul.checks li, .fact, .panel { min-width: 0; overflow-wrap: anywhere; }
td.ok-t, td.bad-t { overflow-wrap: normal; white-space: nowrap; }
ul.inst { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
ul.inst li { font-size: 12.5px; }
.inst-mark { font-weight: 700; }
ul.inst li.reached .inst-mark { color: var(--ok); }
ul.inst li.forfeit .inst-mark { color: var(--bad); }
details.scenes { margin-top: 6px; font-size: 12.5px; }
details.scenes summary { cursor: pointer; color: var(--accent); padding: 4px 0; }
details.scenes .scroll-table { max-height: 260px; background: var(--card); }
tr.after td { color: var(--muted); font-style: italic; }
details.scenes table.dets td, details.scenes table.dets th { white-space: nowrap; overflow-wrap: normal; }
#annex-eu table.dets td, #annex-eu table.dets th { white-space: normal; overflow-wrap: anywhere; }
.date { white-space: nowrap; }
details.more .more-body { padding-top: 4px; }
ol.windows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ol.windows li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
ol.windows li.skipped { border-style: dashed; border-color: var(--alert); }
ol.windows .btn { margin-top: 6px; }
.win-res { margin: 6px 0 0; }
.countdown { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 8px 0; }
ol.vsteps { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
ol.vsteps li.now { font-weight: 600; }
ol.vsteps li.now::marker { color: var(--alert); }
ol.vsteps li.done { color: var(--muted); }
ol.vsteps li.done::after { content: " ✓"; color: var(--ok); font-weight: 700; }
ol.vsteps .vt { color: var(--muted); font-variant-numeric: tabular-nums; }
.stopwatch { font: 600 16px var(--mono); font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 6px; background: var(--neutral-soft); }
.capr { margin-top: 8px; }
.ledger-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 12px; margin-top: 10px; align-items: start; }
.ledger-foot .capr { margin-top: 0; }
.ledger-foot .capr .sub:first-child { margin-top: 8px; }
.capr-line { font-size: 13px; padding: 8px; border-left: 3px solid var(--alert); background: var(--card); margin: 6px 0; }
details.scenes table.dets { min-width: 420px; }
details.scenes .scroll-table { overflow-x: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
#annexc-table td:first-child, #cn-table td:first-child { white-space: normal; width: 40%; }

/* judge's path, deep-link note, explorer table */
.judgepath { border: 2px solid var(--accent); }
ol.jpath { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ol.jpath > li { padding-left: 4px; min-width: 0; overflow-wrap: anywhere; }
ol.jpath > li::marker { font-weight: 700; color: var(--accent); }
.jtitle { display: flex; gap: 6px 10px; align-items: baseline; flex-wrap: wrap; }
a.deep { font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); text-decoration: none; white-space: nowrap; }
a.deep:hover, a.deep:focus-visible { text-decoration: underline; }
.jsee { margin: 2px 0 0; font-size: 13.5px; }
.jv { font-size: 13px; color: var(--muted); }
.jsee .lbl, .jv .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
ul.jverify { margin: 0; padding-left: 18px; }
.deeplink { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; font-weight: 600; }
.deeplink[data-state="reset"] { background: var(--ok-soft); color: var(--ok); }
.scroll-x { overflow-x: auto; }
table.xtab { font-size: 13px; }
table.xtab td:last-child a { font-family: var(--mono); font-size: 12.5px; }
span.ok-t { color: var(--ok); font-weight: 600; white-space: nowrap; }
span.bad-t { color: var(--bad); font-weight: 600; white-space: nowrap; }
#explorer-addr td:last-child { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  table.xtab tr { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
  table.xtab tr:first-child { display: none; }
  table.xtab td { padding: 1px 0; overflow-wrap: anywhere; min-width: 0; }
  table.xtab td:first-child { flex-basis: 100%; }
  #explorer-tx td.xlive::before { content: "receipt now: "; color: var(--muted); font-weight: 400; }
  #explorer-tx td.num::before { content: "gas "; color: var(--muted); }
}

/* ================================================================ the page in three layers */
body { overflow-x: hidden; }
main { display: block; }
html { overflow-anchor: none; }  /* a chapter change never nudges the page */
section, h3[id], ol.moment { scroll-margin-top: 64px; }
.wrap-card { max-width: 1148px; margin: 18px auto; }
@media (max-width: 1180px) { .wrap-card { margin-left: 16px; margin-right: 16px; } }
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 8px 14px;
  flex-wrap: wrap; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.brand strong { font-weight: 700; letter-spacing: -0.01em; }
.brand .case { font-weight: 400; color: var(--muted); font-size: 14px; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keyl { display: flex; gap: 6px; align-items: center; }
.lchip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lchip.real { background: var(--card); border: 1px solid var(--line-2); color: var(--ink); }
.lchip.simc { background: var(--sim-soft); border: 1.5px dashed var(--sim); color: var(--sim); }
.top .pill { text-decoration: none; white-space: nowrap; font-size: 12px; font-weight: 500; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; }
.top .pill.live { background: none; color: var(--chain); border-color: var(--chain-soft); }
.pill { text-decoration: none; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
/* simulated: purple, dashed (one legend; the repository's [SIM] labels render as these) */
.simk { display: inline-block; width: 11px; height: 11px; border: 1.5px dashed var(--sim); background: var(--sim-soft); border-radius: 3px;
  vertical-align: -1px; margin: 0 2px; }
.simq { display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 17px; padding: 0 7px; border-radius: 999px;
  color: var(--sim); background: var(--sim-soft); border: 1.5px dashed var(--sim); white-space: normal; vertical-align: 1px; }
.simw { color: var(--sim); font-weight: 600; text-decoration: underline dashed 1.5px; text-underline-offset: 3px; }

/* ---- layer 0 */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 28px; align-items: center; padding-top: 26px; padding-bottom: 18px; }
.lead { margin: 0 0 10px; font-size: clamp(17px, 1.6vw, 20px); font-weight: 700; color: var(--ink); }
.kicker { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.22; letter-spacing: -0.015em; margin: 0 0 14px; }
.hero h1 .l { display: block; }
.hero h1 .red { color: var(--red); }
.hero h1 .green { color: var(--green); }
.hero h1 .sub-l { font-size: 0.62em; font-weight: 500; line-height: 1.38; letter-spacing: 0; margin-top: 8px; }
.jteaser { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); max-width: 62ch; }
.jteaser strong { color: var(--ink); }
#bundle-table tr.extra { display: none; }
#bundle-table.show-all tr.extra { display: table-row; }
.btn.linkish { background: none; border: none; color: var(--accent); padding: 6px 0; text-decoration: underline; cursor: pointer; }
details.tamper-more { margin-top: 14px; border-top: 1px solid var(--line, rgba(127,127,127,.3)); padding-top: 6px; }
details.tamper-more > summary { cursor: pointer; list-style: revert; }
details.tamper-more > summary .tamper-h { display: inline-flex; margin: 6px 0 2px; }
details.tamper-more > summary .sub { display: block; margin: 0 0 4px; }
.analogy { margin: 0 0 16px; font-size: 15.5px; max-width: 60ch; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn.big { font-size: 15px; padding: 10px 16px; border-radius: 8px; }
.btn.danger.big { background: var(--bad); color: #fff; border-color: var(--bad); font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.fine { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.money { margin: 0; }
.money svg { width: 100%; height: auto; max-height: 520px; display: block; }
.money figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.money .orbit, #stage-sky .orbit { fill: none; stroke: var(--sim); stroke-width: 1.5; stroke-dasharray: 5 5; }
.money .beam { fill: var(--methane); opacity: 0.13; }
.money .sat rect, #stage-sky .sat rect { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; }
.money .sat rect.panel, #stage-sky .sat rect.panel { fill: var(--chain-soft); stroke: var(--chain); }
.money .ground { stroke: var(--line); stroke-width: 2; }
.money .plume { fill: var(--methane); opacity: 0.55; }
.money .facility { fill: var(--ink); }
.money .flow { stroke: var(--muted); stroke-width: 1.4; }
.money .clause { fill: var(--chain-soft); stroke: var(--chain); stroke-width: 1.6; }
.money .decide { stroke: var(--chain); stroke-width: 1.4; stroke-dasharray: 3 4; }
.money .party { fill: var(--sim-soft); stroke: var(--sim); stroke-width: 1.6; stroke-dasharray: 5 4; }
.money text { fill: var(--ink); font-family: var(--sans); }
.money .t-strong { font-size: 15px; font-weight: 700; }
.money .t-small { font-size: 12px; fill: var(--muted); }
.money .party-t, .money .party-t.t-small { fill: var(--sim); }
.money .witness-t { fill: var(--ink); font-weight: 600; }
.money .arrow-red { fill: none; stroke: var(--red); stroke-width: 4; }
.money .arrow-green { fill: none; stroke: var(--green); stroke-width: 4; }
.money .f-red { fill: var(--red); }
.money .f-green { fill: var(--green); }
.money .f-ink { fill: var(--muted); }
.money .t-red { fill: var(--red); font-size: 13px; font-weight: 700; }
.money .t-green { fill: var(--green); font-size: 13px; font-weight: 700; }

/* ---- layer 1 */
.story { padding-top: 10px; padding-bottom: 6px; }
.sec-head h2 { font-size: 22px; letter-spacing: -0.01em; }
.actors { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.actor { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.actor.sim { border: 1.5px dashed var(--sim); font-weight: 400; color: var(--ink); }
.actor-h { display: flex; align-items: center; gap: 8px; }
.actor-h h3 { margin: 0; font-size: 15px; color: var(--sim); }
.actor .ico { display: inline-flex; width: 28px; height: 28px; padding: 4px; border-radius: 8px; color: var(--sim); background: var(--sim-soft); }
.actor p { margin: 6px 0 4px; font-size: 13.5px; }
.actor-more summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 2px 0; }
.actor:has(.actor-more[open]) { grid-column: 1 / -1; }
.actor-more .view h3 { font-size: 14.5px; margin: 8px 0 2px; color: var(--ink); }
.actor-more .cov { margin-top: 8px; }
.paths { list-style: none; margin: 4px 0 16px; padding: 0; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.paths li { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; flex-wrap: wrap; }
.p-red { background: var(--red-soft); color: var(--red); }
.p-green { background: var(--green-soft); color: var(--green); }
.p-stop { background: var(--neutral-soft); color: var(--ink); border: 1px solid var(--line); }
.arcs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.arc-btn { font: 600 13.5px var(--sans); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.arc-btn[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.arc-btn:focus-visible, .dot-btn:focus-visible, .trust-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stage { position: relative; min-height: 460px; background: #2b2a27; }
#stage-map { position: absolute; inset: 0; color: #fff; }
#stage-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 500; }
#stage-sky .beam { fill: #fbbf24; opacity: 0.22; }
#stage-sky .sat-t { fill: #fff; font: 600 12px var(--sans); paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 3px; }
.cm-tiles { mix-blend-mode: screen; filter: brightness(.7) contrast(4) sepia(1) saturate(7) hue-rotate(-18deg) brightness(.82); }
.leaflet-container { isolation: isolate; }
.stage-card { position: absolute; left: 10px; bottom: 28px; z-index: 600; background: var(--card); border-radius: 10px; padding: 8px 10px;
  min-width: 220px; max-width: calc(100% - 20px); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); font-size: 12.5px; }
.stage-attrib { position: absolute; right: 6px; bottom: 4px; left: 6px; margin: 0; z-index: 600; font-size: 10.5px; color: #fff; text-shadow: 0 0 3px #000; text-align: right; }
.mc strong { display: block; margin-bottom: 4px; font-size: 12.5px; }
.mc-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.mc-row b { font-variant-numeric: tabular-nums; }
.mc-row.held b { color: var(--alert); }
.mc-row.paid b { color: var(--red); }
.mc-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); margin: 2px 0 6px; }
.mc-bar span { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--neutral-soft); color: var(--muted); border-right: 1px solid var(--line); }
.mc-bar span:last-child { border-right: 0; }
.mc-bar span.ok { background: var(--green); color: #fff; }
.mc-bar span.lost { background: repeating-linear-gradient(-45deg, var(--bad-soft), var(--bad-soft) 4px, var(--card) 4px, var(--card) 8px); color: var(--bad); }
.demo-story { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ds-kick { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.demo-story h3 { margin: 4px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.demo-story h3:focus { outline: none; }
#ds-body { margin: 2px 0 4px; font-size: 15px; }
.ds-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.ds-facts li { padding: 6px 9px; border-radius: 6px; background: var(--neutral-soft); overflow-wrap: anywhere; }
.ds-facts .lbl { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ds-nav { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 10px; }
.ds-dots { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: center; }
.dot-btn { padding: 0; cursor: pointer; }

/* the failure moment */
ol.moment { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
ol.moment li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--neutral-soft); font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
ol.moment li.hit { background: var(--alert-soft); color: var(--alert); }
ol.moment li.bad { background: var(--bad-soft); color: var(--bad); }
.mn { display: inline-flex; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--card); align-items: center; justify-content: center; font-size: 12px; }
li.bad .mn { background: var(--bad); }
li.hit .mn { background: var(--alert); }

/* become a witness */
.witness { border: 1px solid var(--line-2); border-top: 4px solid var(--accent); }
.witness-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
ol.wsteps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; font-size: 14px; }
ol.wsteps li.now { font-weight: 700; }
ol.wsteps li.done { color: var(--muted); }
ol.wsteps li.done::after { content: " ✓"; color: var(--ok); font-weight: 700; }

/* layer 2: the drawer */
.trust { margin-top: 24px; margin-bottom: 30px; }
.trust-toggle { width: 100%; text-align: left; display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  background: var(--card); color: var(--ink); cursor: pointer; font: inherit; }
.trust-toggle > span:first-child { font-size: 18px; font-weight: 700; }
.trust-toggle > span:first-child::after { content: "  ▸"; }
.trust-toggle[aria-expanded="true"] > span:first-child::after { content: "  ▾"; }
ul.rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.strip { color: var(--ink); }
.foot { padding-bottom: 30px; }

@media all {
  :root[data-theme="dark"] .btn.danger.big, :root[data-theme="dark"] .btn.primary { color: #111; }  /* AA contrast on the light dark-mode fills */
}
.verdict.note { color: var(--ink); font-weight: 500; background: var(--neutral-soft); padding: 8px 10px; border-radius: 8px; }
.plain[title] { text-decoration: underline dotted 1px; text-underline-offset: 3px; cursor: help; }
.money .t-sim { fill: var(--sim); font-size: 11px; font-style: italic; }
#stage-sky .sky-t { fill: #e9d5ff; font: italic 11px var(--sans); paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 3px; }
label.tap { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; cursor: pointer; }
label.tap input { width: 18px; height: 18px; }
.dot-btn { width: 30px; height: 44px; border: 0; background: none; position: relative; border-radius: 8px; }
.dot-btn::before { content: ""; position: absolute; left: 8px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); box-sizing: border-box; }
.dot-btn.now { background: none; }
.dot-btn.now::before { background: var(--ink); border-color: var(--ink); }
#ds-prev, #ds-next { min-width: 44px; min-height: 44px; }
#player:focus { outline: none; }
#player:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jump { margin: -6px 0 10px; font-size: 13.5px; }
@media (min-width: 981px) { .jump { display: none; } }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 14px; }
  .money svg { max-height: 460px; }
  .actors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { grid-template-columns: 1fr; }
  .stage { min-height: 340px; }
  ol.moment, .witness-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .actors { grid-template-columns: 1fr; }
  .top { padding: 8px 12px; position: static; }
  .kicker { display: none; }
  .top-right .pill { font-size: 11.5px; }
  .demo-story h3 { font-size: 20px; }
  .stage-card { min-width: 0; left: 8px; bottom: 40px; max-width: calc(100% - 16px); }
}

/* ---- story first: the hero's primary action is the map story (story.html); the cheat button is the 60-second proof */
.btn.ghost { background: none; border-color: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; font-size: 14px; }
.btn.ghost:hover { border-color: transparent; color: var(--ink); }
.cta { align-items: center; gap: 10px 12px; }
.story-card { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: box-shadow .15s, border-color .15s, transform .15s; }
.story-card:hover { border-color: var(--accent); box-shadow: 0 2px 4px rgba(30, 25, 20, .08), 0 10px 26px rgba(30, 25, 20, .12); transform: translateY(-1px); }
.story-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.story-card strong { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.sc-sub { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.sc-go { font-size: 22px; font-weight: 700; color: #fff; background: var(--accent); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.story-mini { width: 100%; height: auto; display: block; border-radius: 10px; }
.story-mini .sm-land { fill: #d9d2c6; }
.story-mini .sm-road { fill: none; stroke: #f5f2ec; stroke-width: 5; opacity: .8; }
.story-mini .sm-orbit { fill: none; stroke: var(--sim); stroke-width: 1.6; stroke-dasharray: 5 5; }
.story-mini .sm-sat rect { fill: #fff; stroke: #1d1b18; stroke-width: 1.2; }
.story-mini .sm-sat .sm-panel { fill: #e4ecfd; stroke: #2457d6; }
.story-mini .sm-beam { fill: #e2590f; opacity: .16; }
.story-mini .sm-plume { fill: #e2590f; opacity: .6; }
.story-mini .sm-site { fill: #1d1b18; }
#cheat-btn { box-shadow: var(--shadow); }
.hero h1 { font-weight: 700; }
.lead { font-weight: 600; color: var(--muted); }
.sec-head h2, .card-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
@media (max-width: 560px) {
  .story-card { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; padding: 6px 10px 6px 6px; }
  .story-card strong { font-size: 16px; }
  .sc-sub { display: none; }
  .sc-go { width: 32px; height: 32px; font-size: 18px; }
  .story-mini .sm-road, .story-mini .sm-beam { display: none; }
}
@media all {
  :root[data-theme="dark"] .sc-go { color: #111; }
}

/* ---- one product with the story page: logo, panel eyebrows, segmented case tabs, ink primary buttons */
.brand { align-items: center; }
.brand .logo { flex: none; align-self: center; }
.eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sec-head { margin-bottom: 4px; }
.sec-head .sub, .card-head .sub { max-width: 78ch; }
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); width: max-content; max-width: 100%; }
details.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
details.more > .sub { max-width: 78ch; }
.arcs { display: inline-flex; gap: 2px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; max-width: 100%; flex-wrap: wrap; }
.arc-btn { border: 0; background: transparent; color: var(--muted); font-weight: 500; border-radius: 7px; padding: 6px 12px; }
.arc-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #3a3631; border-color: #3a3631; }
.sc-go { background: var(--ink); }
.btn:focus-visible, .story-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 560px) {
  .top-right { gap: 6px; }
  .top .pill { font-size: 11.5px; padding: 2px 8px; }
  /* phone, two rows: brand + legend, then checks + the story-map link; the live block reading stays in the page's own sections */
  .brand .case, #net-pill { display: none; }
  .top { flex-wrap: wrap; gap: 6px 8px; }
  .top-right { display: contents; }
}
:root[data-theme="dark"] .arc-btn[aria-pressed="true"] { background: var(--card); }
.cta-links { display: inline-flex; flex-wrap: wrap; gap: 0 14px; }
@media (max-width: 560px) { .cta-links .btn.ghost { font-size: 13.5px; padding: 6px 2px; } }
.cta-links .btn.ghost:first-child { padding-left: 0; }
@media (min-width: 561px) and (max-width: 1180px) {
  .story-card { grid-template-columns: minmax(0, 170px) minmax(0, 1fr) auto; gap: 14px; }
  .story-card strong { font-size: 19px; }
}
/* phone: the seven step dots stay on one row between the arrows; the two case tabs share one row */
.dot-btn::before { left: calc(50% - 7px); }
@media (max-width: 560px) {
  .ds-nav { gap: 4px; }
  .ds-dots { flex-wrap: nowrap; gap: 0; }
  .dot-btn { width: 28px; flex: 0 1 28px; }
  .arcs { display: flex; flex-wrap: nowrap; }
  .arc-btn { flex: 1 1 0; font-size: 12.5px; padding: 6px 8px; white-space: normal; line-height: 1.25; }
}
/* mid widths: the Story map link keeps the top bar on one row; the case name stays in the story's own heading */
@media (min-width: 561px) and (max-width: 1100px) { .brand .case { display: none; } }
