/* Countersign design system. One stylesheet for every page.
   Flat panels, hairline borders, no shadows. Depth is tone only. */

/* ================= tokens ================= */
:root {
  /* palette */
  --bg: #04112a;
  --surface: #0d2846;
  --raised: #12385d;
  --border: #235079;
  --text: #e6eef2;
  --muted: #9db6c3;
  --brand: #3297a2;
  --brand-hover: #44a8b3;
  --brand-press: #2b8690;
  --brand-ink: #04112a;
  --accent: #8cc2d0;
  --ok: #4cc38a;
  --warn: #e3b04b;
  --err: #ef6b62;
  --series-1: #42aec2;
  --series-2: #7f9eae;
  --diagram: #7f9eae;
  --grid: rgba(35, 80, 121, 0.4);
  --overlay: rgba(4, 17, 42, 0.82);

  /* type */
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-hero: 40px; --lh-hero: 44px;
  --fs-h2: 28px; --lh-h2: 34px;
  --fs-h3: 20px; --lh-h3: 26px;
  --fs-body: 15px; --lh-body: 22px;
  --fs-label: 12px; --lh-label: 16px;
  --fs-mono: 13px; --lh-mono: 20px;
  --track-tight: -0.01em;
  --track-label: 0.04em;

  /* spacing scale: 4 8 12 16 24 32 48 96 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 96px;

  /* layout */
  --container: 1200px;
  --gutter: 24px;
  --rail: 232px;
  --row-table: 36px;
  --row-list: 44px;
  --control: 40px;

  /* radii */
  --r-panel: 4px;
  --r-chip: 2px;
  --r-dot: 999px;

  /* shadows: none by design, depth comes from tone */
  --shadow: none;

  /* motion */
  --t-state: 160ms;
  --ease-state: ease-out;
  --t-rule: 120ms;
  --t-tick: 240ms;
  --ease-tick: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-counter: 400ms;
  --slide: 8px;
}

/* ================= reset and base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(140, 194, 208, 0.4); transition: color var(--t-state) var(--ease-state), text-decoration-color var(--t-state) var(--ease-state); }
a:hover { color: var(--text); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--brand); color: var(--brand-ink); }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--sp-4); top: -48px; z-index: 100; background: var(--accent); color: var(--brand-ink); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-panel); text-decoration: none; transition: top var(--t-state) var(--ease-state); }
.skip-link:focus { top: var(--sp-2); }

/* ================= type ================= */
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: var(--track-tight); color: var(--text); }
h1, .h1 { font-size: var(--fs-hero); line-height: var(--lh-hero); }
h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
h4 { font: 500 var(--fs-body)/var(--lh-body) var(--font-sans); }
.label, .eyebrow, th {
  font: 500 var(--fs-label)/var(--lh-label) var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted);
}
.eyebrow { display: block; margin-bottom: var(--sp-3); }
.lead { font-size: 17px; line-height: 26px; color: var(--text); max-width: 640px; }
.muted { color: var(--muted); }
.mono, .num { font-family: var(--font-mono); font-size: var(--fs-mono); line-height: var(--lh-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose { max-width: 640px; }
.prose > * + * { margin-top: var(--sp-5); }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-err { color: var(--err); } .text-accent { color: var(--accent); }

/* ================= layout ================= */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.grid > * { grid-column: span var(--c, 12); min-width: 0; }
.col-1 { --c: 1; } .col-2 { --c: 2; } .col-3 { --c: 3; } .col-4 { --c: 4; } .col-5 { --c: 5; } .col-6 { --c: 6; }
.col-7 { --c: 7; } .col-8 { --c: 8; } .col-9 { --c: 9; } .col-10 { --c: 10; } .col-11 { --c: 11; } .col-12 { --c: 12; }
.grid--tight { gap: var(--sp-4); }
.stack > * + * { margin-top: var(--gap, var(--sp-4)); }
.stack--2 { --gap: var(--sp-2); } .stack--3 { --gap: var(--sp-3); } .stack--5 { --gap: var(--sp-5); } .stack--6 { --gap: var(--sp-6); } .stack--7 { --gap: var(--sp-7); }
.row { display: flex; align-items: center; gap: var(--gap, var(--sp-3)); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--nowrap { flex-wrap: nowrap; }
.row--top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }

.section { padding-block: var(--sp-8); border-top: 1px solid var(--border); }
.section:first-of-type, .section--flush { border-top: 0; }
.section__head { max-width: 640px; margin-bottom: var(--sp-6); }
.section__head h2 + p { margin-top: var(--sp-3); color: var(--muted); }
.section--tight { padding-block: var(--sp-7); }

/* ================= marketing shell ================= */
.sample-strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.sample-strip .container { display: flex; align-items: center; min-height: 32px; padding-block: 4px; }
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: var(--sp-5); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--text); text-decoration: none; font-family: var(--font-serif); font-weight: 600; font-size: 20px; letter-spacing: var(--track-tight); }
.brand:hover { color: var(--text); }
.brand__mark { width: 40px; height: 40px; object-fit: cover; object-position: 50% 50%; border-radius: var(--r-panel); background: var(--bg); flex: none; }
.site-nav { display: flex; align-items: center; gap: var(--sp-5); margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: var(--sp-1); }
.nav-list a, .rail-nav a {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-panel);
  color: var(--muted); text-decoration: none; font-weight: 500; border: 1px solid transparent;
  transition: color var(--t-state) var(--ease-state), background-color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state);
}
.nav-list a:hover, .rail-nav a:hover { color: var(--text); background: var(--surface); }
.nav-list a[aria-current="page"], .rail-nav a[aria-current="page"] { color: var(--brand-ink); background: var(--brand); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: var(--control); height: var(--control); margin-left: auto; background: transparent; border: 1px solid var(--border); border-radius: var(--r-panel); cursor: pointer; transition: background-color var(--t-state) var(--ease-state); }
.nav-toggle:hover { background: var(--surface); }
.nav-toggle .icon { width: 20px; height: 20px; }

.site-footer { border-top: 1px solid var(--border); padding-block: var(--sp-7); background: var(--bg); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--sp-5) var(--sp-7); justify-content: space-between; align-items: flex-start; }
.site-footer p { color: var(--muted); max-width: 420px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-note { width: 100%; border-top: 1px solid var(--border); padding-top: var(--sp-4); font-size: 13px; line-height: 20px; }

/* ================= app shell ================= */
.shell-app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.app-rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-4); background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.app-rail .brand { padding: var(--sp-2) var(--sp-2) 0; }
.rail-nav { flex: 1 1 auto; }
.rail-nav ul { display: flex; flex-direction: column; gap: var(--sp-1); }
.rail-nav a { width: 100%; }
.rail-nav .icon { flex: none; }
.rail__foot { display: flex; flex-direction: column; gap: var(--sp-3); }
.app-body { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-main { flex: 1 1 auto; padding: var(--sp-6); width: 100%; max-width: 1280px; }
.app-footer { border-top: 1px solid var(--border); padding: var(--sp-4) var(--sp-6); color: var(--muted); font-size: 13px; line-height: 20px; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); justify-content: space-between; }
.app-footer a { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.page-head h1 { font-size: 28px; line-height: 34px; }
.page-head p { color: var(--muted); margin-top: var(--sp-1); max-width: 640px; }
.master-detail { display: grid; grid-template-columns: minmax(300px, 4fr) minmax(0, 8fr); gap: var(--sp-5); align-items: start; }
.master-detail__master { position: sticky; top: var(--sp-5); }
.panel-stack > * + * { margin-top: var(--sp-5); }

/* one entrance on page load, nothing on scroll */
@keyframes cs-enter { from { opacity: 0; transform: translateY(var(--slide)); } to { opacity: 1; transform: none; } }
.page-enter { animation: cs-enter var(--t-state) var(--ease-state) both; }
@keyframes cs-slide { from { opacity: 0; transform: translateY(var(--slide)); } to { opacity: 1; transform: none; } }
.slide-in { animation: cs-slide var(--t-state) var(--ease-state) both; }

/* ================= sample-data marker ================= */
.sample-marker { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--accent); border-radius: var(--r-panel); color: var(--text); font-size: 12px; line-height: 16px; }
.sample-marker .icon { flex: none; width: 16px; height: 16px; color: var(--accent); margin-top: 0; }
.sample-strip .sample-marker { border: 0; padding: 0; align-items: center; }
.storage-note { font-size: 12px; line-height: 16px; color: var(--warn); }

/* ================= icons ================= */
.icon { display: inline-block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: round; vertical-align: -3px; }
.icon--24 { width: 24px; height: 24px; }
.icon--20 { width: 20px; height: 20px; }

/* ================= buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--control); padding: 0 var(--sp-4);
  border: 1px solid transparent; border-radius: var(--r-panel); background: transparent; color: var(--text);
  font: 500 15px/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state), color var(--t-state) var(--ease-state), opacity var(--t-state) var(--ease-state), transform var(--t-state) var(--ease-state);
}
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn--primary:active:not(:disabled) { background: var(--brand-press); }
.btn--secondary { border-color: var(--border); color: var(--text); background: transparent; }
.btn--secondary:hover { background: var(--raised); border-color: var(--accent); color: var(--text); }
.btn--danger { border-color: var(--err); color: var(--err); }
.btn--danger:hover { background: rgba(239, 107, 98, 0.12); color: var(--err); }
.btn--quiet { color: var(--muted); padding: 0 var(--sp-3); }
.btn--quiet:hover { color: var(--text); background: var(--surface); }
.btn--sm { height: 32px; padding: 0 var(--sp-3); font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn.is-pending { opacity: 0.7; cursor: progress; font-family: var(--font-mono); font-weight: 400; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.link-btn:hover { color: var(--text); }

/* ================= forms ================= */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field__label { font: 500 var(--fs-label)/var(--lh-label) var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); }
.field__hint { font-size: 13px; line-height: 18px; color: var(--muted); }
.field__error { font-size: 13px; line-height: 18px; color: var(--err); display: flex; gap: var(--sp-2); align-items: flex-start; }
.field__error:empty { display: none; }
.input, .select, .textarea {
  width: 100%; height: var(--control); padding: 0 var(--sp-3); background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-panel); font: 400 15px/1 var(--font-sans);
  transition: border-color var(--t-state) var(--ease-state), background-color var(--t-state) var(--ease-state);
}
.input--mono, .select--mono { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.input--num { text-align: right; font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.textarea { height: auto; min-height: 96px; padding: var(--sp-3); line-height: 22px; resize: vertical; }
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input:disabled, .select:disabled { opacity: 0.5; cursor: not-allowed; }
.input[aria-invalid="true"], .is-invalid .input, .is-invalid .select { border-color: var(--err); }
.select { appearance: none; padding-right: var(--sp-6); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%239db6c3' stroke-width='1.5'><path d='M1 1l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 64px; }
.input-group__unit { position: absolute; right: var(--sp-3); font: 400 12px/16px var(--font-mono); color: var(--muted); pointer-events: none; }
.input-group__prefix { position: absolute; left: var(--sp-3); color: var(--muted); font-family: var(--font-mono); pointer-events: none; }
.input-group--prefix .input { padding-left: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-top: var(--sp-5); }
.form-status { font: 400 13px/20px var(--font-mono); color: var(--muted); min-height: 20px; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; --fill: 0%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--brand) var(--fill), var(--border) var(--fill)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--brand); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 2px; background: var(--text); border: 2px solid var(--bg); }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 2px; background: var(--text); border: 2px solid var(--bg); }
.range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.chip-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2); height: 32px; padding: 0 var(--sp-3); background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--r-chip); font: 500 13px/1 var(--font-sans); cursor: pointer;
  transition: background-color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state), color var(--t-state) var(--ease-state);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip .chip__tick { width: 0; opacity: 0; margin-left: -4px; transition: width var(--t-state) var(--ease-state), opacity var(--t-state) var(--ease-state); }
.chip[aria-pressed="true"] { background: var(--raised); border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] .chip__tick { width: 16px; opacity: 1; margin-left: 0; color: var(--accent); }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 44px; height: 24px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg); transition: background-color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 2px; background: var(--muted); transition: transform var(--t-state) var(--ease-state), background-color var(--t-state) var(--ease-state); }
.switch input:checked + .switch__track { background: var(--raised); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.45; }
.switch__label { font-weight: 500; }

/* tabs and segmented filters */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); }
.tab { height: 40px; padding: 0 var(--sp-4); background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: 500 15px/1 var(--font-sans); cursor: pointer; transition: color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.tab-panel { padding-top: var(--sp-4); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-panel); padding: 2px; gap: 2px; background: var(--bg); }
.segmented__btn { height: 28px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-chip); background: transparent; color: var(--muted); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: background-color var(--t-state) var(--ease-state), color var(--t-state) var(--ease-state); }
.segmented__btn:hover { color: var(--text); }
.segmented__btn[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.segmented__count { margin-left: var(--sp-1); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ================= panels ================= */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); min-width: 0; }
.panel--raised { background: var(--raised); }
.panel--flat { background: transparent; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--row-list); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel__title { font: 500 var(--fs-label)/var(--lh-label) var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); display: inline-flex; align-items: center; gap: var(--sp-2); }
.panel__actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.panel__body { padding: var(--sp-4); }
.panel__body--flush { padding: 0; }
.panel__foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 20px; }
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); font-size: 14px; line-height: 20px; }
.notice--ok { border-color: var(--ok); } .notice--warn { border-color: var(--warn); } .notice--error { border-color: var(--err); } .notice--info { border-color: var(--accent); }
.notice--ok .icon { color: var(--ok); } .notice--warn .icon { color: var(--warn); } .notice--error .icon { color: var(--err); } .notice--info .icon { color: var(--accent); }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.kv dt, .kv dd { display: flex; align-items: center; min-height: 32px; padding: 4px 0; border-bottom: 1px solid var(--grid); }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { justify-content: flex-end; text-align: right; font-family: var(--font-mono); font-size: var(--fs-mono); font-variant-numeric: tabular-nums; gap: var(--sp-2); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-4); }
.metric { min-width: 0; }
.metric__label { display: block; font: 500 var(--fs-label)/var(--lh-label) var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); }
.metric__value { display: block; margin-top: var(--sp-1); font: 500 22px/28px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.metric__sub { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }

/* ================= badges and status ================= */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-chip); font: 500 12px/16px var(--font-sans); letter-spacing: 0.02em; color: var(--muted); white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; }
.badge--ok { color: var(--ok); border-color: rgba(76, 195, 138, 0.5); }
.badge--warn { color: var(--warn); border-color: rgba(227, 176, 75, 0.5); }
.badge--error { color: var(--err); border-color: rgba(239, 107, 98, 0.5); }
.badge--info { color: var(--accent); border-color: rgba(140, 194, 208, 0.5); }
.badge--solid { background: var(--raised); color: var(--text); }
.status { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.status--ok { color: var(--ok); } .status--warn { color: var(--warn); } .status--error { color: var(--err); } .status--muted { color: var(--muted); } .status--info { color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-dot); background: var(--muted); flex: none; }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); } .dot--error { background: var(--err); } .dot--live { background: var(--accent); }

/* ================= tables ================= */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); max-width: 100%; }
.table-wrap--scroll { max-height: 420px; }
.panel .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { height: var(--row-table); padding: 0 var(--sp-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--border); height: 36px; }
.table td { font-size: 14px; }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); font-size: var(--fs-mono); font-variant-numeric: tabular-nums; }
.table th.num { font-family: var(--font-sans); font-size: var(--fs-label); }
.table tbody tr { transition: background-color var(--t-state) var(--ease-state); }
.table tbody tr:hover { background: var(--raised); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .wrap { white-space: normal; }
.th-sort { display: inline-flex; align-items: center; gap: var(--sp-1); background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort:hover { color: var(--text); }
.th-sort .icon { width: 12px; height: 12px; opacity: 0.6; }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--text); }
th[aria-sort="ascending"] .th-sort .icon, th[aria-sort="descending"] .th-sort .icon { opacity: 1; color: var(--accent); }
.row-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: none; border: 1px solid transparent; border-radius: var(--r-chip); color: var(--muted); cursor: pointer; transition: color var(--t-state) var(--ease-state), border-color var(--t-state) var(--ease-state); }
.row-toggle:hover { color: var(--text); border-color: var(--border); }
.row-toggle .icon { transition: transform var(--t-state) var(--ease-state); }
.row-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.table tr.is-open { background: var(--raised); }
.table tr.row-detail td, .table tr.row-detail:hover td { height: auto; padding: var(--sp-4); background: var(--bg); white-space: normal; border-bottom: 1px solid var(--border); }
.table tr.row-detail:hover { background: transparent; }
.table tr.is-highlight { background: var(--raised); outline: 1px solid var(--accent); outline-offset: -1px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager { display: inline-flex; gap: var(--sp-1); align-items: center; }

/* ================= lists ================= */
.list { display: flex; flex-direction: column; }
.list__row { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--row-list); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--grid); transition: background-color var(--t-state) var(--ease-state); }
.list__row:last-child { border-bottom: 0; }
.list__row:hover { background: var(--raised); }
.list__row--rich { min-height: 72px; align-items: stretch; flex-direction: column; justify-content: center; gap: var(--sp-2); }
.list__row--action { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--grid); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.list__row.is-selected { background: var(--raised); outline: 1px solid var(--accent); outline-offset: -1px; }
.list__line { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.list__title { font-weight: 500; color: var(--text); min-width: 0; }
.list__meta { font-size: 13px; line-height: 18px; color: var(--muted); min-width: 0; }
.feed-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; min-height: var(--row-table); padding: 4px var(--sp-4); border-bottom: 1px solid var(--grid); }

/* ================= co-sign rule line (the signature) ================= */
.cosign { display: inline-flex; align-items: center; width: 100%; max-width: 168px; min-width: 96px; height: 20px; gap: 0; vertical-align: middle; color: var(--muted); }
.cosign__x { position: relative; width: 10px; height: 10px; flex: none; }
.cosign__x::before, .cosign__x::after { content: ""; position: absolute; left: 4px; top: -1px; width: 1px; height: 12px; background: currentColor; transform: rotate(45deg); }
.cosign__x::after { transform: rotate(-45deg); }
.cosign__line { flex: 1 1 auto; height: 1px; background: var(--muted); margin: 0 var(--sp-2) 0 var(--sp-1); min-width: 16px; }
.cosign__tick { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; flex: none; margin-left: var(--sp-1); border: 1px solid var(--muted); border-radius: var(--r-chip); background: transparent; transition: background-color var(--t-tick) var(--ease-tick), border-color var(--t-tick) var(--ease-tick); }
.cosign__tick.is-filled { background: var(--accent); border-color: var(--accent); }
.cosign__tick.is-filled::after { content: ""; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid var(--brand-ink); border-width: 0 1.5px 1.5px 0; transform: rotate(40deg); }
.cosign__tick.is-broken { border-color: var(--err); }
.cosign__tick.is-broken::after { content: ""; position: absolute; left: 4px; top: -3px; width: 1.5px; height: 16px; background: var(--err); transform: rotate(35deg); }
.cosign__tick.is-broken::before { content: ""; position: absolute; left: 2px; top: 2px; width: 6px; height: 6px; background: var(--surface); transform: rotate(35deg); z-index: 0; }
.cosign__lab { position: absolute; top: 15px; font: 500 9px/10px var(--font-mono); color: var(--muted); }
.cosign--wide { max-width: none; }
.cosign--rule { max-width: none; width: 100%; height: 24px; }
.cosign--rule .cosign__line { margin: 0 var(--sp-3) 0 var(--sp-2); }
.cosign--rule .cosign__tick { margin-left: var(--sp-2); }
.section-divider { padding-block: 0; }

/* rule check lines */
.rules { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg); }
.rule { display: grid; grid-template-columns: 20px minmax(0, 190px) minmax(0, 1fr); gap: var(--sp-3); align-items: center; min-height: var(--row-table); padding: 6px var(--sp-3); border-bottom: 1px solid var(--grid); color: var(--muted); transition: color var(--t-state) var(--ease-state), background-color var(--t-state) var(--ease-state); }
.rule:last-child { border-bottom: 0; }
.rule__label { font-weight: 500; }
.rule__detail { color: var(--muted); font-size: 12px; line-height: 18px; }
.rule.is-checking { color: var(--accent); background: var(--surface); }
.rule.is-checking .rule__detail { color: var(--accent); }
.rule.is-pass { color: var(--text); }
.rule.is-pass .rule__icon { color: var(--ok); }
.rule.is-fail { color: var(--text); background: rgba(239, 107, 98, 0.1); }
.rule.is-fail .rule__icon, .rule.is-fail .rule__detail { color: var(--err); }
.rule.is-skip { opacity: 0.6; }

/* signer trio */
.signers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.signer { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg); min-width: 0; }
.signer__name { font-family: var(--font-mono); font-size: var(--fs-mono); }
.signer__nodes { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.node-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-chip); color: var(--text); font: 500 12px/1 var(--font-sans); text-decoration: none; transition: background-color var(--t-tick) var(--ease-tick), border-color var(--t-tick) var(--ease-tick); }
.node-chip:hover { background: var(--raised); color: var(--text); }
.node-chip__mark { display: inline-flex; color: var(--muted); }
.node-chip.is-signed { border-color: var(--accent); background: var(--raised); }
.node-chip.is-signed .node-chip__mark { color: var(--accent); }
.node-chip.is-refused { border-color: var(--err); }
.node-chip.is-refused .node-chip__mark { color: var(--err); }

/* spend bar with limit tick */
.spend { position: relative; display: block; width: 100%; height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-chip); }
.spend__bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--spent); background: var(--series-1); border-radius: 1px; transition: width var(--t-counter) var(--ease-tick); }
.spend__tick { position: absolute; left: var(--limit); top: -4px; bottom: -4px; width: 2px; background: var(--warn); }
.spend--high .spend__bar { background: var(--warn); }
.spend--breach .spend__bar { background: var(--err); }

/* ================= charts ================= */
.chart { position: relative; width: 100%; min-height: 24px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-text, .chart .trace-label, .chart .trace-value { font: 400 11px var(--font-mono); fill: var(--muted); }
.chart .trace-label { font: 500 12px var(--font-sans); fill: var(--text); }
.chart .trace-value { fill: var(--text); }
.gridline { stroke: var(--grid); stroke-width: 1; }
.series { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.series--1 { stroke: var(--series-1); } .series--2 { stroke: var(--series-2); }
.series.is-dashed { stroke-dasharray: 4 3; }
.area { stroke: none; } .area--1 { fill: var(--series-1); fill-opacity: 0.12; } .area--2 { fill: var(--series-2); fill-opacity: 0.12; }
.direct-label { font: 500 11px var(--font-sans); } .direct-label--1 { fill: var(--series-1); } .direct-label--2 { fill: var(--series-2); }
.limit-line { stroke: var(--warn); stroke-width: 1.25; stroke-dasharray: 5 4; }
.chart .limit-label { fill: var(--warn); }
.breach-mark { fill: var(--err); stroke: var(--surface); stroke-width: 1.5; }
.cursor-line { stroke: var(--accent); stroke-width: 1; }
.bar { transition: opacity var(--t-state) var(--ease-state); }
.bar--1 { fill: var(--series-1); } .bar--2 { fill: var(--series-2); } .bar--breach { fill: var(--err); }
.bar:hover { opacity: 0.8; }
.trace-track { fill: var(--bg); }
.trace-bar--pass { fill: var(--series-1); } .trace-bar--fail { fill: var(--err); } .trace-bar--skip { fill: var(--series-2); }
.trace-glyph { fill: none; stroke-width: 1.5; stroke-linecap: square; }
.trace-glyph--pass { stroke: var(--ok); } .trace-glyph--fail { stroke: var(--err); } .trace-glyph--skip { stroke: var(--muted); }
.tooltip { position: absolute; z-index: 5; min-width: 140px; padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-panel); pointer-events: none; font-size: 12px; line-height: 18px; }
.tooltip__title { color: var(--muted); margin-bottom: 2px; }
.tooltip__row { display: flex; justify-content: space-between; gap: var(--sp-4); }
.sparkline { display: inline-block; width: 96px; height: 24px; vertical-align: middle; }
.sparkline .series { stroke-width: 1.5; }
.popover { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-panel); padding: var(--sp-3); }

/* line diagrams (key fan-out) */
.diagram { width: 100%; height: auto; }
.diagram .d-line { fill: none; stroke: var(--diagram); stroke-width: 1.5; }
.diagram .d-node { fill: var(--surface); stroke: var(--diagram); stroke-width: 1.5; }
.diagram .d-key { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: square; }
.diagram .d-breach { fill: none; stroke: var(--err); stroke-width: 1.5; }
.diagram .d-breach-fill { fill: rgba(239, 107, 98, 0.12); stroke: var(--err); stroke-width: 1.5; }
.diagram .d-text { font: 400 12px var(--font-sans); fill: var(--text); }
.diagram .d-mono { font: 400 11px var(--font-mono); fill: var(--muted); }
.diagram .d-text--breach { fill: var(--err); }

/* ================= code blocks ================= */
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.code { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-panel); min-width: 0; }
.code__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.code__title { font: 500 var(--fs-label)/var(--lh-label) var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); }
.code__body { margin: 0; padding: var(--sp-4); overflow-x: auto; font: 400 var(--fs-mono)/var(--lh-mono) var(--font-mono); tab-size: 2; color: var(--text); }
.code--after { border-color: var(--accent); }

/* ================= timeline ================= */
.timeline { display: flex; flex-direction: column; }
.timeline__step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--sp-3); padding-bottom: var(--sp-4); color: var(--muted); }
.timeline__step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--border); }
.timeline__step:last-child { padding-bottom: 0; }
.timeline__step:last-child::before { display: none; }
.timeline__mark { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: var(--r-chip); background: var(--bg); transition: background-color var(--t-tick) var(--ease-tick), border-color var(--t-tick) var(--ease-tick), color var(--t-tick) var(--ease-tick); }
.timeline__title { font-weight: 500; color: inherit; }
.timeline__text { font: 400 var(--fs-mono)/var(--lh-mono) var(--font-mono); }
.timeline__step.is-done { color: var(--text); }
.timeline__step.is-done .timeline__mark { border-color: var(--ok); color: var(--ok); }
.timeline__step.is-removed .timeline__mark { border-color: var(--err); color: var(--err); }
.timeline__step.is-kept .timeline__mark { border-color: var(--accent); color: var(--accent); background: var(--raised); }
.timeline__step.is-pending { opacity: 0.55; }

/* proof block */
.proof { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg); }
.proof__row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--grid); align-items: baseline; }
.proof__row:last-child { border-bottom: 0; }
.proof__value { font: 400 var(--fs-mono)/var(--lh-mono) var(--font-mono); word-break: break-all; }
.proof__row.is-breach .proof__value { color: var(--err); }

/* ================= states: empty, loading, error ================= */
.state { padding: var(--sp-6) var(--sp-5); text-align: center; border: 1px dashed var(--border); border-radius: var(--r-panel); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.state__title { font-weight: 500; }
.state__text { color: var(--muted); max-width: 420px; }
.state--loading { align-items: flex-start; text-align: left; border-style: solid; border-color: var(--grid); }
.state--loading .loading-lines { font: 400 var(--fs-mono)/var(--lh-mono) var(--font-mono); color: var(--muted); }
.loading-lines p::before { content: "> "; color: var(--accent); }
.loading-lines p:last-child::after { content: "_"; animation: cs-blink 1s steps(1) infinite; }
@keyframes cs-blink { 50% { opacity: 0; } }
.state--error { border-style: solid; border-color: var(--err); text-align: left; align-items: flex-start; }
.state--error .state__title { color: var(--err); }

/* ================= toasts and dialogs ================= */
.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 90; display: flex; flex-direction: column; gap: var(--sp-2); width: min(380px, calc(100vw - 2 * var(--sp-4))); }
.toast { display: grid; grid-template-columns: 20px minmax(0, 1fr) 24px; gap: var(--sp-3); align-items: start; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-panel); font-size: 14px; line-height: 20px; animation: cs-slide var(--t-state) var(--ease-state) both; }
.toast--ok { border-color: var(--ok); } .toast--ok .toast__icon { color: var(--ok); }
.toast--error { border-color: var(--err); } .toast--error .toast__icon { color: var(--err); }
.toast--warn { border-color: var(--warn); } .toast--warn .toast__icon { color: var(--warn); }
.toast--info .toast__icon { color: var(--accent); }
.toast__close { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--r-chip); color: var(--muted); cursor: pointer; }
.toast__close:hover { color: var(--text); background: var(--raised); }
.dialog { width: min(440px, calc(100vw - 2 * var(--sp-4))); padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--accent); border-radius: var(--r-panel); }
.dialog::backdrop { background: var(--overlay); }
.dialog__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.dialog__foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }

/* ================= landing blocks ================= */
.hero { padding-block: var(--sp-8) var(--sp-7); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--sp-7); align-items: center; }
.hero__copy > * + * { margin-top: var(--sp-5); }
.hero__panel { min-width: 0; }
.livestrip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); }
.livestrip__row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: var(--sp-3); align-items: center; min-height: var(--row-list); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--grid); }
.livestrip__row:last-child { border-bottom: 0; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.step { counter-increment: step; border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.step::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: var(--sp-3); font: 500 13px/20px var(--font-mono); color: var(--accent); }
.step h3 { margin-bottom: var(--sp-2); }
.step p { color: var(--muted); }
.policy-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: var(--sp-4); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-7); align-items: start; }
.compare .table td, .compare .table th { white-space: normal; height: auto; padding-block: var(--sp-3); vertical-align: top; }
.compare .table th:first-child, .compare .table td:first-child { width: 28%; }
.cta-band { padding-block: var(--sp-8); border-top: 1px solid var(--border); }
.cta-band__inner { max-width: 640px; display: flex; flex-direction: column; gap: var(--sp-5); align-items: flex-start; }

/* ================= responsive ================= */
@media (max-width: 1024px) {
  .grid > * { grid-column: span var(--c-md, 12); }
  .col-md-1 { --c-md: 1; } .col-md-2 { --c-md: 2; } .col-md-3 { --c-md: 3; } .col-md-4 { --c-md: 4; } .col-md-5 { --c-md: 5; } .col-md-6 { --c-md: 6; }
  .col-md-7 { --c-md: 7; } .col-md-8 { --c-md: 8; } .col-md-9 { --c-md: 9; } .col-md-10 { --c-md: 10; } .col-md-11 { --c-md: 11; } .col-md-12 { --c-md: 12; }
  .shell-app { display: block; }
  .app-rail { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) var(--sp-4); border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .app-rail .brand { padding: 0; }
  .rail-nav { flex: 1 1 auto; }
  .rail-nav ul { flex-direction: row; justify-content: flex-end; }
  .rail-nav a { width: auto; }
  .rail__foot { order: 3; flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .rail__foot .sample-marker { flex: 1 1 auto; }
  .app-main { padding: var(--sp-5) var(--sp-4); }
  .app-footer { padding-inline: var(--sp-4); }
  .master-detail { grid-template-columns: minmax(0, 1fr); }
  .master-detail__master { position: static; }
  .hero__grid, .split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: var(--sp-7); }
  .section { padding-block: var(--sp-7); }
}
@media (max-width: 640px) {
  :root { --fs-hero: 32px; --lh-hero: 38px; --fs-h2: 24px; --lh-h2: 30px; --gutter: 16px; }
  .grid > * { grid-column: span var(--c-sm, 12); }
  .col-sm-1 { --c-sm: 1; } .col-sm-2 { --c-sm: 2; } .col-sm-3 { --c-sm: 3; } .col-sm-4 { --c-sm: 4; } .col-sm-5 { --c-sm: 5; } .col-sm-6 { --c-sm: 6; }
  .col-sm-12 { --c-sm: 12; }
  .nav-toggle { display: inline-flex; }
  .site-nav, .rail-nav { display: none; }
  .site-nav.is-open, .rail-nav.is-open { display: flex; }
  .site-header__inner { flex-wrap: wrap; padding-block: var(--sp-2); }
  .site-nav { flex: 1 1 100%; flex-direction: column; align-items: stretch; margin: 0; gap: var(--sp-3); padding-bottom: var(--sp-3); }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list a { min-height: 44px; }
  .site-nav .btn { width: 100%; }
  .rail-nav { order: 4; flex: 1 1 100%; }
  .rail-nav ul { flex-direction: column; }
  .rail-nav a { min-height: 44px; }
  .app-rail .nav-toggle { order: 2; }
  .rail__foot { flex-direction: column; align-items: stretch; }
  .sample-strip .container { min-height: 40px; }
  .page-head h1 { font-size: 24px; line-height: 30px; }
  .form-grid, .code-grid, .signers { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .rule { grid-template-columns: 20px minmax(0, 1fr); }
  .rule__detail { grid-column: 2; }
  .proof__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .section, .hero, .cta-band { padding-block: var(--sp-7); }
  .livestrip__row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-1); }
  .toasts { right: var(--sp-2); left: var(--sp-2); bottom: var(--sp-2); width: auto; }
  /* stacked tables: add .table--stack and data-label on each td */
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
  .table--stack td { display: flex; justify-content: space-between; gap: var(--sp-3); height: auto; min-height: 28px; padding: 2px 0; border: 0; white-space: normal; text-align: right; }
  .table--stack td::before { content: attr(data-label); flex: none; font: 500 var(--fs-label)/20px var(--font-sans); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); text-align: left; }
  .table--stack tr.row-detail td { display: block; }
  .table--stack tr.row-detail td::before { content: none; }
}

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .loading-lines p:last-child::after { animation: none; }
}
