/* vault.css -- the vault's copy of Axiom's design language.

   The vault runs on CT211 and cannot load the engine's web/static files, so
   the tokens and component rules it needs are copied here. Each block names
   the file and section it came from; change the source and this copy in step
   so the vault never grows a second visual language. Sources:
     .superdesign/design-system.md        the rules (tokens, type, density)
     web/static/execution-matrix.css      tokens, base, label/panel/chip, header,
                                          authority strip, generic table
     web/static/overview.html             capital stack-bar, trade-track mini
                                          axis, correlation matrix cell,
                                          btc-tf buttons
     web/static/ui-foundation.css         operator-brief <details> summary
   Only page-specific layout (the cockpit grid) is new, and it is built from
   those pieces. No external fonts or files: the page must render offline. */

/* == Tokens ==========================================================
   Source: web/static/execution-matrix.css :root ("Axiom Execution Matrix",
   design-system.md "Exact base tokens"). Same values. The *-rgb triplets are
   the same hues as numbers, for the washes execution-matrix.css writes
   inline as rgba(142,169,154,.44) and friends. */
:root {
  color-scheme: dark;
  --bg: #060c11; --bg-elevated: #0a1117; --panel: #0f151c; --panel-strong: #121a22;
  --border: rgba(146,163,173,.16); --border-strong: rgba(171,188,198,.28);
  --text: #e6edf2; --muted: #9aa8b1; --dim: #84919b; --accent: #a8c1cd; --accent-strong: #7e9faf;
  --success: #8ea99a; --warning: #c7a975; --danger: #c68a84; --shadow: #7788a4;
  --accent-rgb: 168,193,205; --success-rgb: 142,169,154; --warning-rgb: 199,169,117; --danger-rgb: 198,138,132;
  --row-line: rgba(255,255,255,.04); --hover: rgba(255,255,255,.02);
  --font-body: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-heading: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* == Light tokens ====================================================
   Axiom is dark-first and has no light set yet (overview.html reserves "a
   future light token set"). The vault is a public page that follows the
   reader's system setting, so this is the same cool-steel palette on a
   light surface: identical hues, taken darker so text and state colours
   keep WCAG AA contrast on the light panels. Only tokens change; every
   component below reads them. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef2f5; --bg-elevated: #e3e9ed; --panel: #fbfcfd; --panel-strong: #f1f4f6;
    --border: rgba(38,58,72,.16); --border-strong: rgba(38,58,72,.30);
    --text: #10202b; --muted: #3f4f5a; --dim: #56656f; --accent: #3a6273; --accent-strong: #2c5263;
    --success: #34694e; --warning: #7d5810; --danger: #9c3f36; --shadow: #4c5b79;
    --accent-rgb: 58,98,115; --success-rgb: 52,105,78; --warning-rgb: 125,88,16; --danger-rgb: 156,63,54;
    --row-line: rgba(16,32,43,.07); --hover: rgba(16,32,43,.03);
  }
}

/* == Base ============================================================
   Source: web/static/execution-matrix.css (base typography, .mono, .wrap,
   scrollbars). The phone gutter is 16 px (vault house rule). */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 12px/1.45 var(--font-body); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1880px; margin: 0 auto; padding: 0 14px 60px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 4px; height: 4px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* == Label, section title, panel =====================================
   Source: web/static/execution-matrix.css (.label, .section-title, .panel,
   .panel > header, .panel .body). */
.label { color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-title { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; min-width: 0; }
.panel > header, .panel > summary { min-height: 34px; padding: 0 12px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); gap: 8px; flex-wrap: wrap; }
.panel .body { padding: 10px 12px; }

/* == Chips ===========================================================
   Source: web/static/execution-matrix.css (.chip and its variants). */
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 17px; padding: 2px 6px;
  border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 9px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; background: transparent; font-family: inherit; }
.chip-observed { color: var(--accent); border-color: rgba(var(--accent-rgb),.35); }
.chip-live { color: var(--success); border-color: rgba(var(--success-rgb),.44); }
.chip-warn { color: var(--warning); border-color: rgba(var(--warning-rgb),.5); }
.chip-bad { color: var(--danger); border-color: rgba(var(--danger-rgb),.55); }

/* == Header / brand ==================================================
   Source: web/static/execution-matrix.css (header.top, .conn, .dot); the
   AXIOM VAULT brand from the previous vault front page. */
header.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 10px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-heading); }
.brand .ax { font-size: 18px; font-weight: 800; letter-spacing: .18em; color: var(--text); }
.brand .va { font-size: 18px; font-weight: 300; letter-spacing: .18em; color: var(--accent); }
.brand .tag { font-size: 10px; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; margin-left: 6px; }
.conn { margin-left: auto; font: 10px/1 var(--mono); color: var(--dim); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.conn a.owner { color: var(--dim); font-family: var(--font-body); letter-spacing: .06em; text-transform: uppercase; font-size: 9px; font-weight: 700; }
.conn a.owner:hover { color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--success); box-shadow: 0 0 7px rgba(var(--success-rgb),.45); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--danger); box-shadow: 0 0 7px rgba(var(--danger-rgb),.45); }

/* == Annunciators: the authority strip ===============================
   Source: web/static/execution-matrix.css (.authority: one row of cells, a
   3 px top border carrying the state colour) and overview.html pill(). The
   state also reads as a word in the cell, never as colour alone; warn and
   bad cells get the design system's restrained 12-14 % wash. */
.authority { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden;
  margin-bottom: 12px; background: var(--panel);
  grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr); }
.authority > div { padding: 8px 12px 10px; border-left: 1px solid var(--border); border-top: 3px solid transparent; min-width: 0; }
.authority > div:first-child { border-left: 0; }
.authority p { margin: 0; }
.authority .head { display: flex; align-items: center; gap: 6px; }
.authority p.v { margin-top: 4px; font: 700 22px/1.15 var(--font-heading); letter-spacing: .02em; overflow-wrap: anywhere; }
.authority p.v small { font: 600 12px/1 var(--font-body); color: var(--dim); letter-spacing: 0; margin-left: 4px; }
.authority .sub { color: var(--dim); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.authority > div.tone-ok { border-top-color: var(--success); }
.authority > div.tone-warn { border-top-color: var(--warning); background: rgba(var(--warning-rgb),.08); }
.authority > div.tone-bad { border-top-color: var(--danger); background: rgba(var(--danger-rgb),.10); }
.authority > div.tone-hot { border-top-color: var(--accent-strong); }
.tone-ok .v { color: var(--success); } .tone-warn .v { color: var(--warning); } .tone-bad .v { color: var(--danger); }
.verdict p.v { text-transform: uppercase; font-size: 20px; }

/* == Bar meter (distance to the promotion bar) =======================
   Source: web/static/overview.html capital stack (.stack-bar: segments in
   one 13 px rail) -- three checks of the bar, in the order it tests them. */
.stack-bar { display: flex; gap: 2px; height: 10px; margin-top: 6px; }
.stack-bar > span { flex: 1 1 0; border-radius: 2px; background: var(--bg-elevated); border: 1px solid var(--border); }
.stack-bar > span.pass { background: rgba(var(--success-rgb),.55); border-color: rgba(var(--success-rgb),.7); }
.stack-bar > span.block { background: rgba(var(--warning-rgb),.35); border-color: rgba(var(--warning-rgb),.7); }
.stack-bar > span.fail { background: rgba(var(--danger-rgb),.30); border-color: rgba(var(--danger-rgb),.6); }
.bar-steps { display: flex; gap: 2px; margin-top: 3px; }
.bar-steps > span { flex: 1 1 0; color: var(--dim); font: 8px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* == Cockpit grid ====================================================
   Pattern: web/static/overview.html main .row3 (narrow | wide | narrow).
   Named areas let phones stack the instruments in priority order. */
.deck { display: grid; gap: 12px; margin-bottom: 12px;
  grid-template-columns: minmax(250px,310px) minmax(0,1fr) minmax(280px,360px);
  grid-template-areas: "cov close side"; }
#coverage { grid-area: cov; } #closest { grid-area: close; } #side { grid-area: side; }

/* == Counters =======================================================
   Source: web/static/overview.html .btc-regime-stat (k/v pairs) at the
   design system's headline size for exceptional values. */
.counters { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.counter { background: var(--panel-strong); padding: 7px 10px 8px; min-width: 0; }
.counter .k { color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.counter .v { display: block; margin-top: 2px; font: 700 22px/1.15 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.counter .s { display: block; color: var(--dim); font-size: 9px; margin-top: 1px; overflow-wrap: anywhere; }
.counter.hero .v { font-size: 30px; }
.pool-line { margin: 10px 0 0; color: var(--dim); font-size: 10px; line-height: 1.5; }
.pool-line b { color: var(--muted); font-family: var(--mono); font-weight: 700; }

/* == Generic table ===================================================
   Source: web/static/execution-matrix.css (table, th, td, .pos, .neg,
   .empty): numbers right-aligned in mono, signs coloured. */
.scroll-x { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font: 11px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
th { text-align: right; color: var(--dim); font-weight: 700; font-size: 9px; text-transform: uppercase;
  letter-spacing: .07em; padding: 5px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; font-family: var(--font-body); }
td { padding: 5px 8px; border-bottom: 1px solid var(--row-line); vertical-align: middle; text-align: right; white-space: nowrap; }
th.t, td.t { text-align: left; }
tbody tr:hover { background: var(--hover); }
.pos { color: var(--success); } .neg { color: var(--danger); }
.empty { color: var(--dim); padding: 16px 12px; text-align: center; font-size: 11px; }
td .sub2 { display: block; color: var(--dim); font-size: 9px; font-family: var(--font-body); }
tr.drill { cursor: pointer; }
tr.drill:hover td { background: rgba(var(--accent-rgb),.05); }
/* The key of a closest row: a real button (the keyboard's way in), drawn as
   the bold key text it replaces. */
.key-btn { all: unset; cursor: pointer; font-weight: 700; color: var(--text); }
.key-btn:hover { color: var(--accent); }
.key-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* == Period pips and the lower-bound axis ============================
   Source: web/static/overview.html trade track .mini-axis (a thin rail, a
   zero mark, a bar to the value). Pips: one per test period, filled when
   it counted, washed when it ran and did not count, hollow when the test
   stopped before it. */
.pips { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 6px; }
.pips > i { width: 7px; height: 9px; border-radius: 1px; border: 1px solid var(--border-strong); }
.pips > i.on { background: var(--success); border-color: var(--success); }
.pips > i.ran { background: rgba(var(--danger-rgb),.28); border-color: rgba(var(--danger-rgb),.55); }
.mini-axis { position: relative; height: 12px; width: 96px; display: inline-block; vertical-align: middle; }
.mini-axis .mt { position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: rgba(var(--accent-rgb),.16); }
.mini-axis .z { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); }
.mini-axis .mz { position: absolute; top: 3px; height: 6px; border-radius: 2px; }
.mini-axis .mz.neg { background: rgba(var(--danger-rgb),.75); }
.mini-axis .mz.pos { background: rgba(var(--success-rgb),.85); }
.lb { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.lb .val { min-width: 48px; text-align: right; }

/* == Segmented bars: why not promoted, age of the latest test ========
   Source: web/static/overview.html capital stack (.stack-bar). One accent
   hue in steps (an ordered category, so a sequential ramp; status colours
   stay for state), with a 2 px surface gap between segments. Each segment
   gets its own step: the page sets --a (the accent's alpha) per segment, so
   two reasons never share a swatch. */
.split { display: flex; gap: 2px; height: 14px; border-radius: 3px; overflow: hidden; }
.split > span { height: 100%; min-width: 2px; background: rgba(var(--accent-rgb), var(--a, .3)); }
.split-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; }
.split-legend li { display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; gap: 8px; align-items: center; font-size: 11px; min-height: 18px; }
.split-legend .sw { width: 10px; height: 10px; border-radius: 2px; background: rgba(var(--accent-rgb), var(--a, .3)); }
.split-legend .n { font-family: var(--mono); color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.split-legend .p { font-family: var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.trend { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.trend-head .now { font: 700 13px/1.2 var(--mono); font-variant-numeric: tabular-nums; }

/* == Heat view =======================================================
   Source: web/static/overview.html correlation matrix (.corr-cell: success
   and danger washes by magnitude around a transparent zero, 9 px mono
   heads). Five steps each side, so the scale can be read off the legend. */
.heat-scroll { overflow-x: auto; max-width: 100%; }
.heat { display: grid; gap: 2px; min-width: max-content; }
.heat .hd { color: var(--dim); font: 9px/1.1 var(--mono); text-align: center; align-self: end; padding-bottom: 2px; white-space: nowrap; }
.heat .rh { color: var(--muted); font: 700 10px/1 var(--font-body); text-align: right; padding-right: 6px; align-self: center; white-space: nowrap; }
/* .hc resets the button first; the .h-* steps come after it at the same
   specificity, so they win without !important. */
.hc { height: 20px; min-width: 24px; border-radius: 2px; border: 1px solid var(--row-line); cursor: pointer; padding: 0;
  font: 700 9px/1 var(--mono); color: var(--text); background-color: transparent; }
.h-n5 { background-color: rgba(var(--danger-rgb),.85); } .h-n4 { background-color: rgba(var(--danger-rgb),.62); }
.h-n3 { background-color: rgba(var(--danger-rgb),.42); } .h-n2 { background-color: rgba(var(--danger-rgb),.26); }
.h-n1 { background-color: rgba(var(--danger-rgb),.13); } .h-z { background-color: transparent; }
.h-p1 { background-color: rgba(var(--success-rgb),.16); } .h-p2 { background-color: rgba(var(--success-rgb),.30); }
.h-p3 { background-color: rgba(var(--success-rgb),.48); } .h-p4 { background-color: rgba(var(--success-rgb),.68); }
.h-p5 { background-color: rgba(var(--success-rgb),.90); }
.hc.void { cursor: default; background-color: var(--bg-elevated); border-style: dashed; border-color: var(--border); }
/* Not enough trades to colour (fewer than research.heat.min_trades): a dot
   pattern, read as "sparse". No trades at all: one stroke through the cell.
   Neither is a colour, so neither can be mistaken for a result. */
.hc.h-thin { background-color: transparent; background-image: radial-gradient(circle, rgba(var(--accent-rgb),.5) .9px, transparent 1.3px);
  background-size: 5px 5px; background-position: center; }
.hc.h-none { background-color: transparent;
  background-image: linear-gradient(to top right, transparent calc(50% - .7px), var(--border-strong) calc(50% - .7px), var(--border-strong) calc(50% + .7px), transparent calc(50% + .7px)); }
.hc.near { box-shadow: inset 0 0 0 2px var(--accent); }
.hc.won { box-shadow: inset 0 0 0 2px var(--success); }
.heat.tall .hd { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; padding: 0 0 4px; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; color: var(--dim); font-size: 9px; }
.heat-legend .scale { display: inline-flex; gap: 2px; align-items: center; }
.heat-legend .scale i { width: 16px; height: 10px; border-radius: 2px; border: 1px solid var(--row-line); }
.heat-legend .edges { font-family: var(--mono); }
.heat-legend .mark { display: inline-flex; align-items: center; gap: 4px; }
.heat-legend .mark i.hc { width: 16px; height: 10px; min-width: 0; display: inline-block; cursor: default; }

/* == Expanders =======================================================
   Source: web/static/ui-foundation.css .axiom-operator-brief > summary
   (a 44 px target with a ▸/▾ marker), sized to the panel header. */
details.panel > summary { cursor: pointer; list-style: none; min-height: 40px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .section-title::before { content: '▸ '; color: var(--accent); }
details.panel[open] > summary .section-title::before { content: '▾ '; }
details.panel:not([open]) > summary { border-bottom: 0; }
details.panel { margin-bottom: 12px; }
/* A drill scrolls the ledger to the top: clear of the sticky header. */
#ledger { scroll-margin-top: 56px; }

/* == Filters, sort and pager buttons =================================
   Source: the previous vault front page (.filters) and overview.html
   .btc-tf-btn (9 px uppercase buttons). */
.filters { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; margin-bottom: 8px; }
.filters label { display: flex; flex-direction: column; gap: 2px; }
.filters select { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 5px; padding: 4px 6px; font: 11px var(--mono); min-width: 120px; max-width: 100%; }
.btn { font: 800 9px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  background: transparent; border: 1px solid var(--border); border-radius: 3px; padding: 4px 8px; min-height: 22px; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--text); border-color: var(--border-strong); }
.btn:disabled { opacity: .4; cursor: default; }
th.sort button { all: unset; cursor: pointer; }
th.sort[aria-sort] { color: var(--accent); }
th.sort button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 8px; color: var(--dim); font: 10px var(--mono); }
.active-filters { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 20px; margin-bottom: 6px; }
.chip.filter { cursor: pointer; color: var(--accent); border-color: rgba(var(--accent-rgb),.4); }

/* == Notes and footer ================================================ */
.meaning { margin: 0; padding: 0 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 120ch; }
.meaning li { margin: 3px 0; }
footer.note { color: var(--dim); font-size: 10px; margin-top: 16px; display: flex; gap: 14px; flex-wrap: wrap; }

/* == Narrower screens ================================================
   Breakpoints from ui-foundation.css (1180, 760). Phones stack the
   instruments in priority order: lights, closest to passing, why not
   promoted with the trends, coverage, heat, ledger. */
@media (max-width: 1180px) {
  .authority { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .authority > div.verdict, .authority > div.best { grid-column: 1 / -1; }
  .authority > div { border-left: 0; border-bottom: 1px solid var(--border); }
  .authority > div.fresh + div { border-left: 1px solid var(--border); }
  .deck { grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: "close close" "side cov"; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px 48px; }
  .deck { grid-template-columns: minmax(0,1fr); grid-template-areas: "close" "side" "cov"; }
  .authority p.v { font-size: 19px; }
  .verdict p.v { font-size: 17px; }
  .hide-sm { display: none; }
  .brand .tag { display: none; }
  /* A shorter axis and tighter cells: the closest-to-passing table fits a
     343 px column (a 375 px phone) without scrolling; narrower phones scroll
     it inside its own container, never the page. */
  .mini-axis { width: 46px; }
  .lb { gap: 4px; } .lb .val { min-width: 38px; }
  td, th { padding: 5px 4px; }
  #ledger { scroll-margin-top: 80px; }      /* the header wraps to two lines */
}
@media (prefers-reduced-motion: no-preference) {
  .dot, .authority > div { transition: background-color .18s ease, border-color .18s ease; }
}
