/* Ulysses: the drafting office.
   Warm paper, black ink, one contract blue for the commitment. Square sheets,
   crop marks, title blocks, and hatching for anything that is not real traffic.
   Tokens are read by the three.js instrument at boot, so page and scene never drift. */

@font-face { font-family: "Plex Cond"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Cond"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif"; font-weight: 200 900; font-style: normal; font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2-variations"); }

:root {
  --paper: #F4F2EC; --sheet: #FBFAF7; --enamel: #E7E2D4; --enamel-in: #D9D3C3;
  --ink: #121518; --graphite: #4B525A; --rule: #8C8574; --hairline: #CFCAB9;
  --contract: #1F4E8C; --flagsmith: #6837FC; --win: #1E6B3A; --loss: #A3361F; --amber: #9A4F00;
  --on-fill: #FFFFFF;
  --hatch: repeating-linear-gradient(45deg, rgb(18 21 24 / .14) 0 1px, transparent 1px 6px);
  --hatch-amber: repeating-linear-gradient(45deg, rgb(154 79 0 / .38) 0 1px, transparent 1px 6px);

  --f-ui: "Plex Cond", "Arial Narrow", sans-serif;
  --f-mono: "Plex Mono", ui-monospace, Consolas, monospace;
  --f-doc: "Source Serif", Georgia, serif;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --gutter: 32px;
  --m-fade: 120ms; --m-state: 160ms; --m-snap: 500ms;
  --e-snap: cubic-bezier(0.65, 0, 0.35, 1); --e-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #101315; --sheet: #171B1E; --enamel: #262B2F; --enamel-in: #1E2226;
  --ink: #ECE8DE; --graphite: #A7ADB3; --rule: #6B7279; --hairline: #2E3439;
  --contract: #7FA7E0; --flagsmith: #A88BFF; --win: #6CC08A; --loss: #EE8A73; --amber: #E7A656;
  --on-fill: #101315;
  --hatch: repeating-linear-gradient(45deg, rgb(236 232 222 / .16) 0 1px, transparent 1px 6px);
  --hatch-amber: repeating-linear-gradient(45deg, rgb(231 166 86 / .40) 0 1px, transparent 1px 6px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 16px/24px var(--f-ui); min-height: 100vh;
  font-feature-settings: "kern"; text-rendering: optimizeLegibility; }
a { color: var(--contract); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, .mono { font-family: var(--f-mono); font-weight: 400; font-variant-numeric: tabular-nums; }
code { font-size: 0.875em; overflow-wrap: anywhere; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--graphite); }
.label { font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1 { font: 600 28px/34px var(--f-ui); margin: 0; letter-spacing: -.005em; }
h2 { font: 600 20px/28px var(--f-ui); margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--contract); outline-offset: 2px; box-shadow: 0 0 0 4px var(--paper); }

/* ---- top bar ---------------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top-in { max-width: 1264px; margin: 0 auto; padding: 0 var(--gutter); min-height: 56px; display: flex; align-items: center; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 18px/1 var(--f-ui); letter-spacing: .12em; }
.brand svg { width: 22px; height: 22px; }
.brand-sub { color: var(--graphite); font-size: 14px; line-height: 20px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-5); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--contract); }
.nav a:hover { border-bottom-color: var(--rule); }
.chip-src { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/16px var(--f-mono); border: 1px solid currentColor;
  border-radius: 2px; padding: 5px 8px; color: var(--ink); white-space: nowrap; }
.chip-src[data-sim="true"] { color: var(--amber); }
.chip-src .sw { width: 10px; height: 10px; border: 1px solid currentColor; background: var(--hatch-amber); }
.chip-src .dot { width: 6px; height: 6px; background: currentColor; }

main { max-width: 1264px; margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-8); }
.page-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); max-width: 820px; }
.lede { font: 400 18px/28px var(--f-doc); color: var(--graphite); max-width: 68ch; }
.hash-line { font: 400 13px/20px var(--f-mono); color: var(--graphite); word-spacing: .4em; }

/* ---- grid ---------------------------------------------------------------------------- */
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; } .col-12 { grid-column: 1 / -1; }
section + section, .stack > * + * { margin-top: var(--s-7); }

/* ---- sheets, plates and crop marks ----------------------------------------------------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule); }
.plate { position: relative; margin: 0; background: var(--sheet); border: 1px solid var(--rule); }
.cm { position: absolute; width: 12px; height: 12px; pointer-events: none; }
.cm::before, .cm::after { content: ""; position: absolute; background: var(--rule); }
.cm::before { width: 12px; height: 1px; } .cm::after { width: 1px; height: 12px; }
.cm.tl { left: -19px; top: -19px; } .cm.tl::before { bottom: 0; right: 0; } .cm.tl::after { right: 0; bottom: 0; }
.cm.tr { right: -19px; top: -19px; } .cm.tr::before { bottom: 0; left: 0; } .cm.tr::after { left: 0; bottom: 0; }
.cm.bl { left: -19px; bottom: -19px; } .cm.bl::before { top: 0; right: 0; } .cm.bl::after { right: 0; top: 0; }
.cm.br { right: -19px; bottom: -19px; } .cm.br::before { top: 0; left: 0; } .cm.br::after { left: 0; top: 0; }
.plate-band { position: relative; min-height: 32px; padding: 6px 12px; background: var(--hatch); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; }
.plate-band[data-tone="amber"] { background: var(--hatch-amber); }
.plate-band .tag { background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; padding: 2px 8px;
  font: 400 12px/18px var(--f-mono); color: var(--ink); }
.plate-stage { position: relative; height: 520px; overflow: hidden; background: var(--sheet); touch-action: pan-y; }
.plate-stage > svg.elevation, .plate-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plate-stage > canvas { background: var(--sheet); }
.plate-stage[data-ready="gl"] > svg.elevation { visibility: hidden; }
.plate-stage[data-dim="true"] { opacity: .5; }
.plate[data-drag="true"] .plate-stage { cursor: grab; }
.plate[data-drag="true"] .plate-stage:active { cursor: grabbing; }
.plate-controls { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 8px; }
.plate-band + .plate-stage-wrap .plate-controls { top: 12px; }
.plate-stage-wrap { position: relative; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--graphite);
  font: 600 12px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.turn-btn { display: none; }
.plate[data-flat="true"] .plate-controls { display: none !important; }
.plate-axis { position: absolute; left: 12px; z-index: 2; font: 600 11px/14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase;
  color: var(--graphite); background: var(--sheet); padding: 2px 4px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.plate-axis.up { top: 12px; } .plate-axis.down { bottom: 12px; }
.plate-axis svg { width: 10px; height: 12px; }
.plate-note { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 2px; padding: 4px 10px; font: 400 12px/16px var(--f-mono); color: var(--graphite);
  max-width: calc(100% - 24px); text-align: center; }
.plate-foot { border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; align-items: stretch; }
.plate-foot .legend { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13px; line-height: 18px; color: var(--graphite); }
.legend .key { display: inline-flex; align-items: center; gap: 8px; }
.legend svg { width: 28px; height: 10px; flex: none; }
.title-block { display: grid; grid-template-columns: auto auto; border-left: 1px solid var(--rule); font: 400 12px/16px var(--f-mono); }
.title-block > div { padding: 6px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.title-block > div:nth-child(odd) { border-right: 1px solid var(--rule); }
.title-block > div:nth-last-child(-n+2) { border-bottom: 0; }
.title-block b { font-weight: 500; color: var(--graphite); letter-spacing: .04em; }
.copy-btn { font: 600 11px/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--rule); border-radius: 2px;
  background: transparent; color: var(--contract); padding: 3px 6px; cursor: pointer; min-height: 0; }
figcaption.cap { padding: 8px 14px; border-top: 1px solid var(--rule); font: 500 12px/16px var(--f-ui); color: var(--graphite); }

/* chips laid over the plate (positioned by the instrument) */
.chips { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.chip { position: absolute; left: 0; top: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; padding: 3px 7px;
  font: 400 12px/16px var(--f-mono); color: var(--ink); white-space: nowrap; opacity: 0; transition: opacity var(--m-fade) linear;
  will-change: transform; }
.chip.on { opacity: 1; }
.chip.flag { border-color: var(--flagsmith); color: var(--ink); }
.chip.flag::before { content: ""; display: inline-block; width: 14px; height: 0; border-top: 1.5px dashed var(--flagsmith); vertical-align: middle; margin-right: 6px; }
.chip.money { border: 1px solid var(--ink); font: 500 12px/16px var(--f-ui); letter-spacing: .02em; padding: 5px 9px; max-width: 260px; white-space: normal; }
.chip.money b { color: var(--flagsmith); font-weight: 600; }
.chip.amber { border-color: var(--amber); color: var(--amber); }
.chip.leader { border-color: var(--ink); }
.chip.quiet { color: var(--graphite); }

/* SVG elevation */
svg.elevation { overflow: visible; }
svg.elevation .mast { stroke: var(--ink); stroke-width: 1.5px; }
svg.elevation .tick { stroke: var(--ink); stroke-width: 1px; }
svg.elevation .banner { stroke: var(--flagsmith); stroke-width: 1.5px; stroke-dasharray: 6 4; fill: none; }
svg.elevation .banner-fill { fill: var(--flagsmith); fill-opacity: .07; }
svg.elevation .env { fill: var(--enamel); }
svg.elevation .edge { stroke: var(--contract); stroke-width: 2px; fill: none; }
svg.elevation .ring { stroke: var(--contract); fill: none; }
svg.elevation .ring.s0 { stroke: var(--contract); opacity: .55; }
svg.elevation .ring.s2 { stroke: var(--contract); }
svg.elevation .ring.s3 { stroke: var(--win); }
svg.elevation .ring.s4 { stroke: var(--loss); }
svg.elevation .ring.s5 { stroke: var(--graphite); }
svg.elevation .ring.s6 { stroke: var(--contract); opacity: .55; }
svg.elevation .ring.s7 { stroke: var(--rule); opacity: .8; }
svg.elevation .ring.dim { opacity: .3; }
svg.elevation .thread { stroke: var(--ink); stroke-width: 2.5px; fill: none; stroke-linejoin: round; }
svg.elevation .bead { fill: var(--ink); }
svg.elevation .hollow { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.25px; }
svg.elevation .halo { fill: none; stroke: var(--ink); stroke-width: 1.25px; }
svg.elevation .sup { stroke: var(--amber); fill: none; }
svg.elevation .needle { stroke: var(--ink); stroke-width: 1.25px; }
svg.elevation .fan polyline { fill: none; stroke-width: 1px; }
svg.elevation .fan-quiet { stroke: var(--ink); stroke-opacity: .16; }
svg.elevation .fan-banner { stroke: var(--flagsmith); stroke-opacity: .55; }
svg.elevation .fan-contract { stroke: var(--contract); stroke-opacity: .9; stroke-width: 1.5px !important; }
svg.elevation .dot-banner { fill: var(--flagsmith); stroke: var(--sheet); stroke-width: .012; }
svg.elevation .dot-contract { fill: var(--contract); stroke: var(--sheet); stroke-width: .012; }
svg.glyph { width: 120px; height: 28px; display: block; }
svg.glyph .ring { stroke-width: 1.4px; }

/* ---- verdict band ----------------------------------------------------------------------- */
.verdict { position: relative; background: var(--sheet); border: 1px solid var(--rule); padding: var(--s-5) var(--s-6) var(--s-5) calc(var(--s-6) + 8px);
  margin-bottom: var(--s-6); }
.verdict::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 8px; background: var(--edge, var(--contract)); }
.verdict[data-outcome="win"] { --edge: var(--win); }
.verdict[data-outcome="loss"] { --edge: var(--loss); }
.verdict[data-outcome="horizon"], .verdict[data-outcome="not_ready"], .verdict[data-outcome="error"] { --edge: var(--graphite); }
.verdict[data-outcome="guardrail_breach"], .verdict[data-outcome="amendment"] { --edge: var(--amber); }
.verdict-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); }
.verdict-word { font: 600 72px/72px var(--f-ui); letter-spacing: .02em; margin: 0; color: var(--ink); }
.verdict-word .w-sub { color: var(--edge, var(--contract)); }
.verdict-sentence { font: 400 20px/28px var(--f-doc); margin-top: var(--s-3); max-width: 62ch; }
.verdict-meta { white-space: nowrap; display: grid; gap: 6px; justify-items: end; text-align: right; font: 400 12px/16px var(--f-mono); color: var(--graphite); padding-top: 6px; }
.verdict details { margin-top: var(--s-3); }
/* "tied to the mast" header scene (web/src/mast.js); hidden until it has drawn a frame */
.mast-hero { margin: var(--s-3) 0 0; }
.mast-hero:not([data-ready="gl"]) .mast-stage { visibility: hidden; }
.mast-stage { position: relative; height: 170px; }
.mast-stage > canvas { display: block; width: 100%; height: 100%; }
.mast-cap { font: 400 11px/16px var(--f-mono); color: var(--graphite); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1100px) {
  .verdict:has(.mast-hero:not([hidden])) { min-height: 290px; }
  .verdict:has(.mast-hero:not([hidden])) .verdict-sentence { max-width: min(62ch, calc(100% - 470px)); }
  .mast-hero { position: absolute; right: var(--s-6); bottom: var(--s-3); width: 460px; margin: 0; }
}
.state-chip { display: inline-block; font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor;
  border-radius: 2px; padding: 2px 6px; color: var(--graphite); white-space: nowrap; }
.state-chip[data-s="executed"], .state-chip[data-s="signed"], .state-chip[data-s="active"] { color: var(--ink); }
.state-chip[data-s="decided"], .state-chip[data-s="pending"] { color: var(--contract); }
.state-chip[data-s="deviated"], .state-chip[data-s="void"], .state-chip[data-s="expired"], .state-chip[data-s="failed"] { color: var(--loss); }
.state-chip[data-s="draft"] { color: var(--amber); }
.state-chip[data-s="superseded"] { color: var(--graphite); }

details > summary { cursor: pointer; color: var(--graphite); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--m-fade) linear; }
details[open] > summary::before { transform: rotate(90deg); }
details .why { font: 400 16px/26px var(--f-doc); margin-top: 6px; max-width: 75ch; color: var(--ink); }

/* ---- readout ----------------------------------------------------------------------------- */
.readout { background: var(--sheet); border: 1px solid var(--rule); }
.readout > div { padding: var(--s-4) var(--s-5); }
.readout > div + div { border-top: 1px solid var(--rule); }
.readout-pair { padding: 0 !important; }
.readout-pair > div { padding: var(--s-4) var(--s-5); }
.readout-pair > div + div { border-top: 1px solid var(--rule); }
.after-grid { margin-top: var(--s-7); }
.visually-hidden:focus { position: fixed !important; left: 16px; top: 8px; width: auto; height: auto; clip: auto; z-index: 50; background: var(--sheet); padding: 8px 12px; border: 1px solid var(--rule); }
.big { font: 500 44px/48px var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin-top: 6px; white-space: nowrap; }
.big.flag { color: var(--ink); }
.big small { font-size: 16px; color: var(--graphite); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.big.long { font-size: 26px; line-height: 48px; }
.read-line { font-size: 14px; line-height: 20px; color: var(--graphite); margin-top: 6px; }
.read-line .mono { color: var(--ink); }
.read-key { display: flex; align-items: center; gap: 8px; }
.read-key svg { width: 22px; height: 10px; }
.readout .verdict-mini { font: 600 72px/72px var(--f-ui); letter-spacing: .02em; }

/* ---- tables -------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--sheet); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
thead th { font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--sheet); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { font-family: var(--f-ui); }
tbody tr[tabindex] { cursor: default; }
tbody tr[tabindex]:focus-visible { outline-offset: -2px; box-shadow: none; }
tbody tr.hi, tbody tr[tabindex]:hover { background: color-mix(in srgb, var(--contract) 7%, var(--sheet)); }
tbody tr.current td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
tbody tr.later td { color: var(--graphite); }
.cell-z { color: var(--graphite); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-3); flex-wrap: wrap; }
.plate + .footnote, .plate ~ .footnote { margin-top: var(--s-5); }
.footnote { font-size: 13px; line-height: 20px; color: var(--graphite); margin-top: var(--s-3); max-width: 90ch; }
.footnote .mono { color: var(--ink); }

/* ---- look slider --------------------------------------------------------------------------- */
.slider { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--rule); }
.slider .lab { font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.slider output { font: 500 13px/16px var(--f-mono); min-width: 13ch; text-align: right; }
.step { width: 32px; height: 32px; min-height: 32px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet); color: var(--ink); cursor: pointer; }
.step svg { width: 10px; height: 10px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--rule); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 22px; margin-top: -10px; background: var(--ink); border: 3px solid var(--sheet); outline: 1px solid var(--ink); border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 18px; background: var(--ink); border: 3px solid var(--sheet); border-radius: 0; }

/* ---- buttons and forms --------------------------------------------------------------------- */
button, .button { font: 600 16px/1 var(--f-ui); letter-spacing: .02em; border: 1px solid transparent; border-radius: 2px; padding: 0 20px; min-height: 44px; cursor: pointer;
  background: var(--contract); color: var(--on-fill); display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
button.big-btn { min-height: 56px; width: 100%; font-size: 18px; }
button.quiet { background: transparent; color: var(--contract); border-color: var(--rule); }
button:disabled { background: transparent; color: var(--graphite); border: 1px dashed var(--rule); cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
select { font: 500 16px/24px var(--f-ui); min-height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet); color: var(--ink); width: 100%; }
label.field { display: block; font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); margin: 0 0 6px; }
pre { margin: 0; background: var(--paper); border: 1px solid var(--hairline); padding: 12px 14px; overflow: auto; font: 400 12.5px/19px var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg { margin-top: var(--s-3); padding: 10px 12px; border: 1px solid var(--rule); border-left-width: 4px; background: var(--sheet); font-size: 15px; }
.msg[data-kind="ok"] { border-left-color: var(--win); }
.msg[data-kind="err"] { border-left-color: var(--loss); color: var(--loss); }
.cmd { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet); padding: 6px 6px 6px 10px; max-width: 100%; }
.cmd code { font-size: 13px; }

/* ---- action panel ---------------------------------------------------------------------------- */
.action { background: var(--sheet); border: 1px solid var(--ink); padding: var(--s-5); display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
.action-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.action-text { font: 400 20px/30px var(--f-doc); }
.action-text code { font-size: 17px; background: var(--paper); border: 1px solid var(--hairline); padding: 0 5px; }
.action .result { font: 400 20px/30px var(--f-doc); display: flex; gap: 12px; align-items: baseline; }
.action .result::before { content: ""; width: 10px; height: 10px; flex: none; transform: translateY(-2px); background: var(--win); }
.action-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4) var(--s-5); align-items: start; }
.key-note { font-size: 14px; line-height: 20px; color: var(--graphite); }

/* ---- contract document ------------------------------------------------------------------------- */
.doc { background: var(--sheet); border: 1px solid var(--rule); padding: var(--s-6) var(--s-6) var(--s-5); }
.clause { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--hairline); }
.clause:first-child { padding-top: 0; }
.clause:last-child { border-bottom: 0; }
.clause .no { font: 600 15px/30px var(--f-ui); color: var(--graphite); }
.clause .h { font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); margin: 7px 0 4px; }
.clause .t { font: 400 18px/30px var(--f-doc); max-width: 68ch; }
.clause .t code { font-size: 15px; }
.clause ul { margin: 0; padding-left: 1.1em; }
.clause .changed-label { display: inline-block; font: 600 11px/14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px solid var(--amber); border-radius: 2px; padding: 1px 5px; margin-right: 6px; vertical-align: 2px; }
.clause.changed .t { border-left: 3px solid var(--amber); padding-left: 12px; }
.clause del { color: var(--loss); text-decoration-thickness: 1px; display: block; }
.pull { font: 400 20px/30px var(--f-doc); border-left: 3px solid var(--amber); padding: 4px 0 4px 16px; margin: var(--s-2) 0 0; max-width: 64ch; }
.sticky-col { position: sticky; top: 80px; }
.sig-slots { display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.sig { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 20px; }
.sig .ring-ic { width: 16px; height: 16px; flex: none; }
.sig[data-state="signed"] .ring-ic circle { stroke: var(--ink); stroke-dasharray: none; }
.sig[data-state="bad"] { color: var(--loss); }
.sign-panel { background: var(--sheet); border: 1px solid var(--ink); padding: var(--s-5); display: grid; gap: var(--s-4); margin-top: var(--s-6); }
.status-strip { display: flex; align-items: center; gap: 12px; font-size: 15px; padding: 10px 12px; border: 1px solid var(--amber); color: var(--ink); }
.status-strip b { color: var(--amber); }

/* ---- home ------------------------------------------------------------------------------------- */
.home-hero .readout .verdict-mini { margin-top: 4px; }
.cards-list { display: none; }
.empty { display: grid; gap: var(--s-3); padding: var(--s-5); background: var(--sheet); border: 1px solid var(--rule); }
.err-panel { border: 1px solid var(--loss); border-left-width: 4px; padding: var(--s-4) var(--s-5); background: var(--sheet); }

/* ---- calibration -------------------------------------------------------------------------------- */
.tabs { display: flex; border-bottom: 1px solid var(--rule); gap: 0; margin-bottom: 0; flex-wrap: wrap; }
.tabs [role="tab"] { background: transparent; color: var(--graphite); border: 1px solid transparent; border-bottom: 0; border-radius: 0; min-height: 44px;
  font: 600 15px/1 var(--f-ui); padding: 0 16px; margin-bottom: -1px; text-decoration: none; display: inline-flex; align-items: center; }
.tabs [role="tab"][aria-selected="true"] { background: var(--sheet); color: var(--ink); border-color: var(--rule); }
.tabs [role="tab"][aria-disabled="true"] { color: var(--graphite); opacity: .75; cursor: not-allowed; text-decoration: line-through; text-decoration-thickness: 1px; }
.tabpanel { background: var(--sheet); border: 1px solid var(--rule); border-top: 0; }
.facts { padding: 10px 14px; font: 400 12px/18px var(--f-mono); color: var(--graphite); border-bottom: 1px solid var(--rule); }
.rate { font: 500 28px/32px var(--f-mono); font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 10px; border: 1px solid var(--sheet); outline: 1px solid var(--rule); }
.swatch.banner { background: var(--flagsmith); } .swatch.final { background: var(--graphite); } .swatch.contract { background: var(--contract); }
.cal-table td { vertical-align: middle; }
.cal-table .rule-cell { font-size: 15px; line-height: 22px; }
.cal-table .sub { display: block; font: 400 12px/16px var(--f-mono); color: var(--graphite); margin-top: 2px; }
.filter { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; border: 0; padding: 0; margin: 0; font-size: 14px; }
.filter legend { float: left; margin-right: 8px; font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.filter label { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; cursor: pointer; }
.filter input { accent-color: var(--contract); width: 16px; height: 16px; }
.counter { font: 400 13px/18px var(--f-mono); color: var(--graphite); }
.counter b { color: var(--ink); font-weight: 500; }

/* ---- footer -------------------------------------------------------------------------------------- */
.foot { max-width: 1264px; margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-7); border-top: 1px solid var(--rule); font-size: 13px; line-height: 20px; color: var(--graphite);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---- responsive ------------------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .col-8, .col-7, .col-5, .col-4 { grid-column: 1 / -1; }
  .sticky-col { position: static; }
  .verdict-word, .readout .verdict-mini { font-size: 56px; line-height: 58px; }
}
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .action-grid { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  :root { --gutter: 16px; }
  main { padding-top: var(--s-5); }
  .top-in { flex-wrap: wrap; gap: 6px 16px; padding-top: 8px; padding-bottom: 8px; }
  .nav { gap: 16px; margin-left: auto; }
  .chip-src { order: 3; flex-basis: 100%; justify-content: flex-start; white-space: normal; }
  h1 { font-size: 24px; line-height: 30px; }
  .verdict { padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 8px); }
  .verdict-top { flex-direction: column; gap: 8px; }
  .verdict-meta { justify-items: start; text-align: left; padding: 0; }
  .verdict-word, .readout .verdict-mini { font-size: 40px; line-height: 44px; }
  .verdict-sentence { font-size: 18px; line-height: 27px; }
  .big { font-size: 28px; line-height: 32px; white-space: normal; overflow-wrap: anywhere; }
  .big small { display: block; margin: 2px 0 0; font-size: 14px; line-height: 18px; }
  .readout-pair > div { padding: var(--s-3) var(--s-4); min-width: 0; }
  .card-grid > .readout { order: -1; }
  .card-grid > * { min-width: 0; }
  .big.long { font-size: 20px; line-height: 32px; }
  .readout-pair { display: grid; grid-template-columns: 1fr 1fr; }
  .readout-pair > div + div { border-top: 0; border-left: 1px solid var(--rule); }
  .plate-stage { height: auto !important; aspect-ratio: 100 / 84; }
  .chip { font-size: 11px; line-height: 14px; padding: 2px 6px; }
  .chip.money { max-width: 200px; padding: 4px 7px; }
  .plate-stage.tall { aspect-ratio: 100 / 70; }
  .cm { display: none; }
  .plate-foot { grid-template-columns: 1fr; }
  .title-block { border-left: 0; border-top: 1px solid var(--rule); grid-template-columns: 1fr; }
  .title-block > div { white-space: normal; overflow-wrap: anywhere; border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; }
  .title-block > div:last-child { border-bottom: 0 !important; }
  .title-block b { white-space: nowrap; }
  .turn-btn { display: inline-flex; }
  .seg.rv { display: none; }
  .plate-axis { display: none; }
  .slider { grid-template-columns: auto 1fr auto; }
  .slider .lab { display: none; }
  .slider output { grid-column: 1 / -1; text-align: left; order: -1; }
  .doc { padding: var(--s-4); }
  .clause { grid-template-columns: 36px minmax(0, 1fr); }
  .clause .t { font-size: 17px; line-height: 28px; }
  th, td { padding: 9px 10px; }
  .sticky-first th:first-child, .sticky-first td:first-child { position: sticky; left: 0; background: var(--sheet); z-index: 1; box-shadow: 1px 0 0 var(--hairline); }
  .home-table { display: none; }
  .cards-list { display: grid; gap: 8px; }
  .action { padding: var(--s-4); }
  .action-text, .action .result { font-size: 18px; line-height: 27px; }
  .mobile-bar { position: sticky; bottom: 0; z-index: 10; background: var(--paper); padding: 8px 0; margin: 0 calc(-1 * var(--s-4)); padding-inline: var(--s-4); border-top: 1px solid var(--rule); }
  .order-phone-first { order: -1; }
  .rate { font-size: 22px; }
  .foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---- signer identity, deviations ---------------------------------------------------------------- */
.who { border: 1px solid var(--rule); background: var(--paper); padding: 12px 14px; }
.who-grid { margin: 6px 0 0; display: grid; gap: 0; }
.who-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 12px; }
.who-row[hidden] { display: none; }
.who-row dt { font: 600 12px/22px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.who-row dd { margin: 0; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.who-row dd.mono { font-size: 13px; }
[data-browser-key][data-state="ok"] { color: var(--win); }
[data-browser-key][data-state="bad"] { color: var(--loss); font-weight: 500; }
[data-browser-key][data-state="none"] { color: var(--amber); }
.dev-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--loss); border-left-width: 4px; background: var(--sheet); }
.dev-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; align-items: baseline; }
.dev-list li + li { border-top: 1px solid var(--hairline); }
.dev-what { font: 400 17px/26px var(--f-doc); }
.dev-meta { grid-column: 2; font-size: 14px; line-height: 20px; color: var(--graphite); }
.dev-flag { color: var(--loss); font-size: 13px; }
@media (max-width: 639px) { .who-row { grid-template-columns: 1fr; } .dev-list li { grid-template-columns: 1fr; } .dev-meta { grid-column: 1; } }

.cal-cap { caption-side: top; text-align: left; padding: 14px 14px 8px; font: 600 15px/22px var(--f-ui); color: var(--ink); border-bottom: 1px solid var(--hairline); }
.cal-table + .cal-table, .tabpanel .table-wrap + .table-wrap { border-top: 1px solid var(--rule) !important; }

.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.two-card { position: relative; display: grid; gap: 10px; padding: 18px 20px 16px 28px; background: var(--sheet); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.two-card::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px; background: var(--contract); }
.two-card[data-outcome="win"]::before { background: var(--win); }
.two-card[data-outcome="loss"]::before { background: var(--loss); }
.two-card[data-outcome="horizon"]::before, .two-card[data-outcome="not_ready"]::before { background: var(--graphite); }
.two-card[data-outcome="guardrail_breach"]::before { background: var(--amber); }
.two-card:hover { border-color: var(--ink); }
.two-word { font: 600 28px/32px var(--f-ui); letter-spacing: .02em; }
.two-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-nums > span { display: grid; gap: 2px; }
.two-nums b { font-size: 22px; line-height: 28px; font-weight: 500; }
.two-nums small { color: var(--graphite); font-size: 12px; }
.two-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* the pencil drawing: an unsigned contract is graphite until the signature casts it */
svg.elevation.pencil .ring, svg.elevation.pencil .ring.s0, svg.elevation.pencil .ring.s6 { stroke: var(--graphite); opacity: 1; }
svg.elevation.pencil .edge { stroke: var(--graphite); }

.chip { max-width: calc(100% - 12px); }
@media (max-width: 639px) { .chip { white-space: normal; } }

/* leader lines from a docked label to the point it names */
.chips svg.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity var(--m-fade) linear; }
.chips svg.leaders.on { opacity: 1; }
.chips svg.leaders line { stroke: var(--graphite); stroke-width: 1; }
.chips svg.leaders circle { fill: var(--sheet); stroke: var(--graphite); stroke-width: 1; }
.chip.docked { white-space: normal; max-width: min(58%, 420px); }
.state-chip[data-s="executing"] { color: var(--contract); border-style: dashed; }

/* Power and expected-sample-size curves on the signing page (templates/_curves.html). */
.oc { margin-top: var(--s-5); padding: var(--s-5); }
.oc h2 { font: 600 20px/28px var(--f-ui); margin: 4px 0 8px; }
.oc-lede { font: 400 16px/26px var(--f-doc); max-width: 68ch; margin: 0 0 var(--s-3); }
.oc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 14px/20px var(--f-ui); color: var(--ink); margin-bottom: var(--s-3); }
.oc-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.oc-charts { position: relative; }
.oc-panel + .oc-panel { margin-top: var(--s-4); }
.oc-title { font: 600 12px/16px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); margin: 0 0 6px 56px; }
.oc-frame { position: relative; padding-left: 56px; }
.oc-plot { position: relative; height: 168px; border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); touch-action: pan-y; }
.oc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.oc-grid { stroke: var(--hairline); stroke-width: 1; vector-effect: non-scaling-stroke; }
.oc-zero { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.oc-ref { stroke: var(--graphite); stroke-width: 1; vector-effect: non-scaling-stroke; }
.oc-design { stroke: var(--contract); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.oc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.oc-line[data-tone="contract"], .oc-key[data-tone="contract"] { stroke: var(--contract); }
.oc-line[data-tone="ink"], .oc-key[data-tone="ink"] { stroke: var(--ink); }
.oc-line[data-tone="amber"], .oc-key[data-tone="amber"] { stroke: var(--amber); }
.oc-line[data-dash="true"], .oc-key[data-dash="true"] { stroke-dasharray: 6 4; }
.oc-key { stroke-width: 2; }
.oc-y { position: absolute; left: 0; top: 0; width: 56px; height: 168px; }
.oc-y span { position: absolute; left: 0; width: 50px; text-align: right; transform: translateY(-50%);
  font: 400 12px/16px var(--f-mono); font-variant-numeric: tabular-nums; color: var(--graphite); }
.oc-x { position: relative; height: 20px; }
.oc-x span { position: absolute; top: 4px; transform: translateX(-50%); font: 400 12px/16px var(--f-mono); color: var(--graphite); white-space: nowrap; }
.oc-x-title { margin: 6px 0 0 56px; font: 500 14px/20px var(--f-ui); color: var(--graphite); }
.oc-ref-label { position: absolute; right: 6px; transform: translateY(calc(-100% - 2px)); font: 500 12px/16px var(--f-ui); color: var(--graphite);
  background: var(--sheet); padding: 0 4px; white-space: nowrap; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; }
.oc-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--contract); box-shadow: 0 0 0 2px var(--sheet);
  transform: translate(-50%, -50%); }
.oc-mark-label { position: absolute; transform: translate(8px, 4px); font: 500 12px/16px var(--f-mono); color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; white-space: nowrap; }
.oc-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--ink); pointer-events: none; }
.oc-tip { position: absolute; top: 0; transform: translateX(-50%); z-index: 4; min-width: 170px; padding: 8px 10px; pointer-events: none;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; font: 500 13px/18px var(--f-ui); color: var(--ink);
  display: grid; gap: 2px; }
.oc-tip[hidden] { display: none; }
.oc-tip i { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--contract); }
.oc-tip i[data-tone="ink"] { background: var(--ink); }
.oc-tip i[data-tone="amber"] { background: var(--amber); }
@media (max-width: 639px) {
  .oc { padding: var(--s-4); }
  .oc-frame { padding-left: 44px; }
  .oc-y span { width: 40px; }
  .oc-title, .oc-x-title { margin-left: 44px; }
  .oc-plot, .oc-y { height: 148px; }
  .oc-y { width: 44px; }
}
.oc-ref-label[data-side="below"] { transform: translateY(3px); }

/* ---- Two Ships: calibration hero (templates/_two_ships.html) ------------------------------ */
.ts { margin: 0 0 var(--s-7); }
.ts-head { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.ts-head h1 { font-size: 32px; line-height: 38px; }
.ts-lede { font: 400 19px/28px var(--f-doc); color: var(--ink); max-width: 70ch; }
.ts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.ts-panel { margin: 0; background: var(--sheet); border: 1px solid var(--rule); padding: var(--s-3) var(--s-4) var(--s-3); display: grid; gap: 4px; min-width: 0; }
.ts-panel[data-side="right"] { border-top: 3px solid var(--contract); }
.ts-panel[data-side="left"] { border-top: 3px solid var(--loss); }
.ts-cap h2 { font-size: 19px; line-height: 26px; }
.ts-cap p { font-size: 14px; line-height: 20px; color: var(--graphite); }
.ts-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ts-axis text { font: 400 11px var(--f-mono); fill: var(--graphite); }
.ts-axis .ts-xt { font-family: var(--f-ui); font-size: 12px; }
.ts-grid-line { stroke: var(--hairline); stroke-width: 1; }
.ts-key { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; }
.ts-line95 { stroke: var(--loss); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ts-bound { fill: none; stroke: var(--contract); stroke-width: 2.5; }
.ts-tag { font: 600 12px var(--f-ui); paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
.ts-tag95 { fill: var(--loss); }
.ts-tagb { fill: var(--contract); }
.ts-run { stroke: var(--graphite); stroke-width: 1.1; stroke-opacity: .38; stroke-linejoin: round; stroke-linecap: round; }
.ts-run.kept { stroke-opacity: .5; }
.ts-run.ship { stroke: var(--loss); stroke-width: 2.2; stroke-opacity: 1; }
.ts-wreck path { fill: var(--loss); stroke: var(--sheet); stroke-width: 1.2; }
.ts-wreck .ts-sail { fill: var(--sheet); stroke: var(--loss); }
.ts-kept { fill: var(--sheet); stroke: var(--graphite); stroke-width: 1.5; }
.ts-count { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.ts-num { font: 500 44px/48px var(--f-mono); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.ts-panel[data-side="left"] .ts-num { color: var(--loss); }
.ts-panel[data-side="right"] .ts-num { color: var(--contract); }
.ts-of { font: 600 17px/24px var(--f-ui); }
.ts-rate { font: 500 15px/22px var(--f-ui); color: var(--ink); }
.ts-rate b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-also { font-size: 13px; line-height: 18px; color: var(--graphite); }
.ts-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-2); }
.ts-replay { font: 600 14px/1 var(--f-ui); color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; min-height: 32px; padding: 0 14px; cursor: pointer; }
.ts-replay[hidden] { display: none; }
.ts-details .why p + p { margin-top: 8px; }
.ph-h { font-size: 22px; line-height: 30px; }
/* replay: only when the script armed it (never without JS, never under reduced motion) */
.ts-armed .ts-run { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.ts-armed .ts-run.ship { stroke: var(--graphite); stroke-width: 1.1; stroke-opacity: .38; }
.ts-armed .ts-wreck, .ts-armed .ts-kept { opacity: 0; }
.ts-wreck { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(16deg); }
.ts-armed.ts-play .ts-run { animation: ts-draw calc(var(--e) * var(--ts-dur)) linear forwards; }
.ts-armed.ts-play .ts-run.ship { animation: ts-draw calc(var(--e) * var(--ts-dur)) linear forwards,
  ts-red 240ms linear calc(var(--e) * var(--ts-dur)) forwards; }
.ts-armed.ts-play .ts-wreck { animation: ts-sink 420ms var(--e-out) calc(var(--e) * var(--ts-dur)) forwards; }
.ts-armed.ts-play .ts-kept { animation: ts-fade 200ms linear calc(var(--e) * var(--ts-dur)) forwards; }
@keyframes ts-draw { to { stroke-dashoffset: 0; } }
@keyframes ts-red { to { stroke: var(--loss); stroke-width: 2.2; stroke-opacity: 1; } }
@keyframes ts-sink { 0% { opacity: 0; transform: scale(1.8) rotate(0deg); } 100% { opacity: 1; transform: scale(1) rotate(16deg); } }
@keyframes ts-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ts-armed .ts-run, .ts-armed .ts-wreck, .ts-armed .ts-kept { animation: none !important; opacity: 1; stroke-dashoffset: 0; }
}
@media (max-width: 759px) {
  .ts-grid { grid-template-columns: 1fr; }
  .ts-head h1 { font-size: 26px; line-height: 32px; }
  .ts-lede { font-size: 17px; line-height: 26px; }
  .ts-num { font-size: 36px; line-height: 40px; }
  .ts-foot { flex-direction: column; }
  .ts-axis text { font-size: 19px; }
  .ts-axis .ts-xt { font-size: 19px; }
  .ts-tag { font-size: 19px; stroke-width: 6px; }
  .ts-run { stroke-width: 1.6; }
  .ts-run.ship { stroke-width: 3; }
}

/* ---- the voyage (the Siren Log) --------------------------------------------------------------- */
.siren-ic { width: 14px; height: 14px; flex: none; vertical-align: -2px; display: inline-block; }
.legend svg.legend-siren { width: 14px; height: 14px; }
.siren-line { display: flex; align-items: center; gap: 6px; color: var(--ink) !important; }
.verdict-short { font: 600 28px/32px var(--f-ui); letter-spacing: .02em; margin-top: 6px; color: var(--ink); }
.verdict-short[data-outcome="win"] { color: var(--win); }
.verdict-short[data-outcome="loss"] { color: var(--loss); }
.verdict-short[data-outcome="guardrail_breach"] { color: var(--amber); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--graphite); margin: 0 0 var(--s-3); cursor: pointer; min-height: 32px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.refresh-row { display: none !important; }
section:has(input[data-toggle-refresh]:checked) li.refresh-row { display: grid !important; }
section:has(input[data-toggle-refresh]:checked) tr.refresh-row { display: table-row !important; }
.voyage-sum { background: var(--sheet); border: 1px solid var(--rule); padding: 12px 16px; margin-bottom: var(--s-3); font-size: 15px; line-height: 22px; display: grid; gap: 8px; }
.cf { color: var(--ink); }
.cf-tag { display: inline-block; font: 600 11px/14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite);
  border: 1px dashed var(--graphite); border-radius: 2px; padding: 1px 5px; margin-right: 4px; vertical-align: 1px; }
.voyage-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--rule); position: relative; }
.voyage-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 14px; padding: 10px 16px; border-bottom: 1px solid var(--hairline); position: relative; }
.voyage-list li:last-child { border-bottom: 0; }
.voyage-list li::before { content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 1px; background: var(--hairline); }
.voyage-list li:first-child::before { top: 20px; } .voyage-list li:last-child::before { bottom: calc(100% - 20px); }
.v-mark { position: relative; z-index: 1; padding-top: 2px; }
.v-mark svg { width: 16px; height: 16px; display: block; background: var(--sheet); }
.v-title { font: 600 15px/22px var(--f-ui); color: var(--ink); }
.v-title a { color: var(--ink); }
.v-word[data-outcome="win"] { color: var(--win); } .v-word[data-outcome="loss"] { color: var(--loss); }
.v-word[data-outcome="guardrail_breach"] { color: var(--amber); }
.v-detail, .v-note { font-size: 14px; line-height: 20px; color: var(--graphite); }
.v-autonomy { font-size: 14px; line-height: 20px; margin-top: 6px; }
.v-autonomy[data-level="off"] b.mono { color: var(--loss); }
.v-autonomy[data-level="ask"] b.mono { color: var(--amber); }
.v-autonomy[data-kind], li.v-autonomy .v-title { color: var(--ink); }
.v-when { font: 400 12px/22px var(--f-mono); color: var(--graphite); white-space: nowrap; text-align: right; }
.v-tag { display: inline-block; font: 600 11px/14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor;
  border-radius: 2px; padding: 1px 5px; margin-right: 8px; vertical-align: 2px; }
.v-tag.refused { color: var(--loss); }
.v-tag.here { color: var(--graphite); margin: 0 0 0 8px; }
.v-siren { background: color-mix(in srgb, var(--flagsmith) 6%, var(--sheet)); }
.v-siren .v-mark svg { width: 18px; height: 18px; margin-left: -1px; }
.v-siren-line { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ink); }
.v-siren-line b { color: var(--flagsmith); }
.v-refusal .v-title { color: var(--ink); }
.v-here { box-shadow: inset 3px 0 0 var(--ink); }
.v-fires .v-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.v-cf { font-size: 14px; line-height: 20px; color: var(--ink); }
.v-watch .v-title { color: var(--graphite); font-weight: 500; }
@media (max-width: 639px) {
  .voyage-list li { grid-template-columns: 22px 1fr; padding: 10px 12px; }
  .voyage-list li::before { left: 22px; }
  .v-when { grid-column: 2; text-align: left; line-height: 16px; }
}
/* overview strip */
.voyage-strip { background: var(--sheet); border: 1px solid var(--rule); }
.strip { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; border-bottom: 1px solid var(--rule); }
.strip li { flex: 1 0 104px; border-right: 1px solid var(--hairline); }
.strip li:last-child { border-right: 0; }
.strip a { display: grid; gap: 2px; padding: 10px 12px; color: var(--ink); text-decoration: none; height: 100%; }
.strip a:hover { background: color-mix(in srgb, var(--contract) 7%, var(--sheet)); }
.s-k { font: 600 11px/14px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.s-mark svg { width: 16px; height: 16px; display: block; }
.s-word { font: 600 14px/18px var(--f-ui); }
.s-ctw { font-size: 13px; color: var(--graphite); }
.s-ref { font: 600 11px/14px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--loss); }
.s-siren { background: color-mix(in srgb, var(--flagsmith) 6%, var(--sheet)); }
.s-win .s-word { color: var(--win); } .s-loss .s-word { color: var(--loss); }
.s-unbound { box-shadow: inset 0 -3px 0 var(--graphite); }
.strip-sum { padding: 10px 14px; font-size: 14px; line-height: 21px; color: var(--ink); }
.two-voy { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--graphite); }
/* behind the reading */
.behind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--sheet); border: 1px solid var(--rule); }
.behind-grid > div { padding: var(--s-4) var(--s-5); }
.behind-grid > div + div { border-left: 1px solid var(--rule); }
.z-details { margin-top: var(--s-3); }
.z-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; font-size: 14px; line-height: 20px; }
.z-list dt { color: var(--graphite); }
.z-list dd { margin: 0; color: var(--ink); }
.z-list .why { margin: 0; font-size: 15px; line-height: 22px; }
@media (max-width: 639px) {
  .behind-grid { grid-template-columns: 1fr; } .behind-grid > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .z-list { grid-template-columns: 1fr; } .z-list dd { margin-bottom: 6px; }
}
/* the walkthrough line under the bell */
.tour-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--rule);
  background: var(--sheet); min-height: 52px; }
.tour-text { font: 400 16px/22px var(--f-doc); color: var(--ink); max-width: 72ch; }
.tour-text b { font-weight: 600; }
.tour-text .siren-ic { margin-right: 4px; }
.tour-btn { flex: none; font: 600 12px/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--rule); border-radius: 2px;
  background: transparent; color: var(--contract); padding: 8px 10px; cursor: pointer; min-height: 32px; }
.tour-steps { display: flex; gap: 4px; flex: none; }
.tour-steps i { width: 6px; height: 6px; background: var(--hairline); display: block; }
.tour-steps i.on { background: var(--ink); }
.plate[data-touring="true"] .chips { visibility: hidden; }
svg.elevation .siren { fill: none; stroke: var(--flagsmith); stroke-width: 1.75px; }
svg.elevation .siren-dot { fill: var(--flagsmith); }
.chip.siren { border-color: var(--flagsmith); font: 500 12px/16px var(--f-ui); }
.chip.siren svg, .chip.money svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
.verdict-meta .copy-btn { margin-left: 6px; }
.tour-text svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; display: inline-block; }
@media (max-width: 639px) { .tour-steps { display: none; } .tour-text { font-size: 15px; line-height: 21px; } }
/* ---- explainer page (/explain): plain words for someone new ------------------------------------------ */
.new-here { font: 500 15px/22px var(--f-ui); color: var(--graphite); }
.new-here a { font-weight: 600; }
.nav a.nav-new { color: var(--contract); }
.xp { max-width: 960px; }
.xp .page-head h1 { font-size: 36px; line-height: 42px; }
.xp-toc { list-style: none; counter-reset: xp; margin: 0 0 var(--s-6); padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.xp-toc li { counter-increment: xp; }
.xp-toc a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--sheet); color: var(--ink); text-decoration: none; font-size: 14px; line-height: 18px; }
.xp-toc a::before { content: counter(xp); font: 500 12px/1 var(--f-mono); color: var(--contract); }
.xp-toc a:hover { border-color: var(--contract); }
.xp-sec { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 var(--s-4); margin: 0; padding: var(--s-6) 0; border-top: 1px solid var(--rule); }
section.xp-sec + section.xp-sec { margin-top: 0; }
.xp-no { font: 600 40px/1 var(--f-ui); color: var(--contract); padding-top: 2px; }
.xp-body { display: grid; gap: var(--s-3); max-width: 70ch; }
.xp-body > p, .xp-list li { font: 400 18px/28px var(--f-doc); color: var(--ink); }
.xp-body b { font-weight: 650; }
.xp-body .muted { color: var(--graphite); font-size: 16px; line-height: 24px; }
.xp-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.xp-buttons { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-2); }
.xp-variant { display: grid; gap: 8px; justify-items: start; padding: var(--s-4); background: var(--sheet); border: 1px solid var(--rule); min-width: 180px; }
.xp-btn { display: inline-block; padding: 10px 22px; border: 1px solid var(--ink); border-radius: 2px; font: 500 16px/20px var(--f-ui); color: var(--ink); background: var(--paper); }
.xp-btn.bold { font-weight: 600; background: var(--ink); color: var(--paper); letter-spacing: .02em; }
.xp-stat { display: grid; gap: 8px; padding: var(--s-4) var(--s-5); background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--loss); }
.xp-stat p { font: 400 17px/26px var(--f-doc); }
.xp-stat .xp-big { font: 600 56px/1 var(--f-ui); color: var(--loss); letter-spacing: -.01em; }
.xp-ships { padding-bottom: var(--s-5); }
.xp-ships .ts { margin: 0; }
.xp-ships .ts-head h2 { font-size: 26px; line-height: 32px; }
.xp-flow { margin: 0 0 var(--s-6); background: var(--sheet); border: 1px solid var(--rule); }
.xp-flow svg { display: block; width: 100%; height: auto; padding: var(--s-3); }
.xp-flow .xp-tall { display: none; max-width: 420px; margin: 0 auto; }
.xp-box rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1.25; }
.xp-box[data-tone="contract"] rect { stroke: var(--contract); stroke-width: 2; }
.xp-box[data-tone="flagsmith"] rect { stroke: var(--flagsmith); stroke-width: 2; }
.xp-box[data-tone="rule"] rect { fill: color-mix(in srgb, var(--contract) 8%, var(--paper)); stroke: var(--contract); stroke-width: 2; }
.xp-lab { font-family: var(--f-mono); font-weight: 500; letter-spacing: .04em; fill: var(--graphite); }
.xp-txt { font-family: var(--f-ui); font-weight: 600; fill: var(--ink); }
.xp-loss { fill: var(--loss); color: var(--loss); }
.xp-note { font: 600 12px var(--f-mono); letter-spacing: .06em; fill: var(--contract); }
.xp-halo { stroke: var(--sheet); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.xp-arrow, .xp-loop { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.xp-loop { stroke: var(--contract); stroke-dasharray: 5 4; }
.xp-refuse { stroke: var(--loss); stroke-width: 1.5; stroke-dasharray: 4 3; }
.xp-head { fill: var(--ink); } .xp-head-loss { fill: var(--loss); }
.xp-pill rect { fill: color-mix(in srgb, var(--loss) 7%, var(--paper)); stroke: var(--loss); stroke-width: 1.25; }
.xp-table { background: var(--sheet); }
.xp-table tr.xp-siren td { background: color-mix(in srgb, var(--flagsmith) 7%, var(--sheet)); }
.xp-tag { display: inline-block; font: 600 11px/14px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--flagsmith);
  border: 1px solid currentColor; border-radius: 2px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.xp-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); max-width: none; }
.xp-body:has(.xp-checks) { max-width: none; }
.xp-checks .sheet { padding: var(--s-4); display: grid; gap: 8px; align-content: start; font-size: 15px; line-height: 22px; }
.xp-checks .cmd code { font-size: 12px; }
.xp-gloss { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.xp-gloss dt { font: 600 16px/26px var(--f-ui); color: var(--ink); }
.xp-gloss dd { margin: 0; font: 400 17px/26px var(--f-doc); color: var(--ink); }
.xp-next { border-top: 1px solid var(--rule); padding-top: var(--s-5); font-weight: 600; }
@media (max-width: 760px) {
  .xp-flow .xp-wide { display: none; }
  .xp-flow .xp-tall { display: block; }
  .xp-checks { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .xp .page-head h1 { font-size: 28px; line-height: 34px; }
  .xp-sec { grid-template-columns: 1fr; padding: var(--s-5) 0; }
  .xp-no { font-size: 28px; }
  .xp-body > p, .xp-list li { font-size: 17px; line-height: 27px; }
  .xp-stat { padding: var(--s-4); }
  .xp-stat .xp-big { font-size: 44px; }
  .xp-gloss { grid-template-columns: 1fr; gap: 2px; }
  .xp-gloss dd { margin-bottom: 10px; }
  .xp-ships .ts-head h2 { font-size: 22px; line-height: 28px; }
}
