/*
 * CTO-market design system. One file, shared by every page. Page engineers: do NOT edit this
 * file; put page-only rules in web/css/<page>.css and load it AFTER this one.
 *
 * Sections
 *   01 Fonts            06 Buttons             11 Tables            16 Banner / toast
 *   02 Tokens           07 Fields / forms      12 Lanes + fuse      17 Header
 *   03 Surfaces         08 Chips               13 Facts list        18 Footer
 *   04 Base + layout    09 Segmented control   14 Token logo        19 Motion
 *   05 Type scale       10 Stat board          15 Empty / notice    20 Utilities
 *
 * Three surfaces re-scope the same custom properties, so every component works on all of them:
 *   page ("deck", signal yellow, ink text)  ->  :root
 *   .board (ink, chalk text, accent = deck) ->  stats, tables, charts
 *   .paper (chalk, ink text)                ->  forms, reading content
 * Contrast rule: never chalk text on the deck. Ink on yellow only.
 */

/* ---------------------------------------------------------------- 01 Fonts */
/* Files are copied by scripts/vendor-fonts.mjs (npm run vendor:fonts). */
@font-face { font-family: "Sofia Sans XC"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/sofia-sans-extra-condensed-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Sofia Sans XC"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("../fonts/sofia-sans-extra-condensed-latin-900-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/onest-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/onest-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/onest-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/onest-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---------------------------------------------------------------- 02 Tokens */
:root {
  /* palette (raw; components use the semantic variables below) */
  --deck: #ffc629;
  --deck-2: #f2b705;      /* pressed / striped deck */
  --ink: #16140f;
  --ink-2: #4a4435;       /* secondary text on deck / paper (7.6:1 on chalk, 5.6:1 on deck) */
  --chalk: #fff7e6;
  --chalk-2: #c9bfa6;     /* secondary text on board (9:1 on ink) */
  --board-2: #26231b;
  --board-3: #3a3629;
  --flare: #e5341d;       /* the single alert tone: "helm is free" */
  --flare-on-board: #ff6a4f;

  --font-display: "Sofia Sans XC", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --maxw: 1400px;
  --pad: 20px;
  --r-board: 6px;
  --r-ctl: 4px;
  --header-h: 64px;
  --demo-h: 0px;          /* set by shell.js when the demo banner is visible */

  /* semantic, page surface */
  --surface: var(--deck);
  --surface-2: var(--deck-2);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --rule: var(--ink);
  --rule-soft: rgba(22, 20, 15, 0.22);
  --accent: var(--ink);
  --on-accent: var(--deck);
  --hover-bg: var(--chalk);
  --hover-fg: var(--ink);
  --up: #0c7038;
  --down: #b92d17;
  --alert: var(--flare);
  --alert-fg: #b3200c;   /* alert-coloured TEXT on this surface */
  --on-alert: #fff7e6;
  --focus: var(--ink);
}
@media (min-width: 900px) { :root { --pad: 40px; --header-h: 72px; } }

/* ---------------------------------------------------------------- 03 Surfaces */
.board {
  --surface: var(--ink);
  --surface-2: var(--board-2);
  --fg: var(--chalk);
  --fg-2: var(--chalk-2);
  --rule: var(--chalk);
  --rule-soft: rgba(255, 247, 230, 0.16);
  --accent: var(--deck);
  --on-accent: var(--ink);
  --hover-bg: var(--chalk);
  --hover-fg: var(--ink);
  --up: #86e0a3;
  --down: #ff9384;
  --alert: var(--flare);
  --alert-fg: var(--flare-on-board);
  --on-alert: #fff7e6;
  --focus: var(--deck);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--r-board);
}
.paper {
  --surface: var(--chalk);
  --surface-2: #f3e9d2;
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --rule: var(--ink);
  --rule-soft: rgba(22, 20, 15, 0.18);
  --accent: var(--ink);
  --on-accent: var(--chalk);
  --hover-bg: var(--deck);
  --hover-fg: var(--ink);
  --up: #0c7038;
  --down: #b92d17;
  --alert: var(--flare);
  --alert-fg: #c62a14;
  --on-alert: #fff7e6;
  --focus: var(--ink);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--r-board);
}
.board-pad, .paper-pad { padding: 20px; }
@media (min-width: 900px) { .board-pad, .paper-pad { padding: 32px; } }

/* ---------------------------------------------------------------- 04 Base + layout */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--demo-h);
}
main { flex: 1 0 auto; display: block; }
/* A page whose copy is filled by its module sets <main data-pending="true"> in the HTML and removes
   it after the first render: content keeps its space but is not shown half-filled, so nothing
   visible jumps. The page module must always clear it (try / finally). */
main[data-pending="true"] > * { visibility: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--deck); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: 40px; }
.section-tight { padding-block: 24px; }
@media (min-width: 900px) { .section { padding-block: 72px; } .section-tight { padding-block: 40px; } }
.rule-top { border-top: 2px solid var(--rule); }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.row-between { justify-content: space-between; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; } }
.sticky-col { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
@media (max-width: 899px) { .sticky-col { position: static; } }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--chalk); padding: 10px 14px; border-radius: var(--r-ctl); font-weight: 600; }
.skip-link:focus { top: 8px; }
.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; }

/* ---------------------------------------------------------------- 05 Type scale */
.shout, .head, .sub, .fig, .lane-no, .wordmark-text {
  font-family: var(--font-display);
  text-transform: uppercase;
}
.shout { font-weight: 900; font-size: clamp(54px, 9.6vw, 164px); line-height: 0.84; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.head { font-weight: 800; font-size: clamp(38px, 4.8vw, 68px); line-height: 0.9; letter-spacing: -0.008em; }
.sub { font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: 0; }
.fig { font-weight: 800; font-size: clamp(34px, 3.6vw, 56px); line-height: 0.95; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
.fig-sm { font-size: 28px; }
.fig-xl { font-size: clamp(48px, 6vw, 96px); }
.lead { font-size: 18px; line-height: 1.45; font-weight: 500; max-width: 58ch; }
@media (min-width: 900px) { .lead { font-size: 20px; } }
.body-lg { font-size: 18px; }
.cap { font-size: 13px; line-height: 1.35; font-weight: 500; color: var(--fg-2); }
.cap-up { font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.up { color: var(--up); }
.down { color: var(--down); }
.alert-text { color: var(--alert-fg); }
.muted { color: var(--fg-2); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.prose > * + * { margin-top: 14px; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li + li { margin-top: 8px; }
.prose ul > li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 4px; background: var(--fg); }

/* ---------------------------------------------------------------- 06 Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-body); font-size: 16px; font-weight: 700; line-height: 1; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--hover-bg); color: var(--hover-fg); box-shadow: inset 0 0 0 2px var(--fg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-line { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 2px var(--fg); }
.btn-line:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--fg); color: var(--surface); box-shadow: inset 0 0 0 2px var(--fg); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-alert { background: var(--alert); color: var(--on-alert); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; }
.btn-ghost { background: transparent; color: var(--fg); padding-inline: 10px; }
.btn-ghost:hover:not(:disabled) { background: transparent; color: var(--fg); box-shadow: inset 0 -2px 0 0 var(--fg); }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }

/* ---------------------------------------------------------------- 07 Fields / forms */
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset + .fieldset { margin-top: 36px; padding-top: 28px; border-top: 2px solid var(--rule); }
.legend { float: left; width: 100%; padding: 0; margin-bottom: 18px; } /* float keeps the legend inside the fieldset box, below the top rule */
.legend + * { clear: both; }
.form-row { display: block; }
.form-row + .form-row { margin-top: 20px; }
.form-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.form-grid > .form-row + .form-row { margin-top: 0; }
.form-grid + .form-row, .form-row + .form-grid, .form-grid + .form-grid { margin-top: 20px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); margin-bottom: 4px; }
.label .cap { text-transform: none; letter-spacing: 0; }
.field {
  display: block; width: 100%; min-height: 48px; padding: 10px 0;
  background: transparent; color: var(--fg);
  border: 0; border-bottom: 2px solid var(--rule-soft); border-radius: 0;
  font-size: 18px; font-weight: 500; line-height: 1.3;
  transition: border-color 0.12s;
  appearance: none; -webkit-appearance: none;
}
.field::placeholder { color: var(--fg-2); opacity: 0.75; }
.field:hover { border-bottom-color: var(--fg-2); }
.field:focus, .field:focus-visible { border-bottom-color: var(--fg); outline: none; box-shadow: 0 2px 0 0 var(--fg); }
.field[aria-invalid="true"] { border-bottom-color: var(--down); }
.field-lg { font-family: var(--font-display); font-weight: 800; font-size: 40px; min-height: 64px; font-variant-numeric: tabular-nums; }
textarea.field { resize: vertical; min-height: 96px; }
.field-wrap { position: relative; display: flex; align-items: baseline; gap: 10px; }
.field-wrap > .field { flex: 1 1 auto; min-width: 0; }
.field-unit { font-weight: 700; color: var(--fg-2); }
.hint { margin-top: 6px; font-size: 13px; color: var(--fg-2); }
.error { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--down); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.check input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--fg); background: transparent; display: grid; place-content: center; cursor: pointer; }
.check input:checked { background: var(--fg); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 3px solid var(--surface); border-bottom: 3px solid var(--surface); transform: translateY(-1px) rotate(-45deg); }

/* ---------------------------------------------------------------- 08 Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap;
  color: var(--fg); background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg);
  border: 0; text-decoration: none; vertical-align: middle;
}
.chip-fill { background: var(--fg); color: var(--surface); box-shadow: none; }
.chip-hot { background: var(--alert); color: var(--on-alert); box-shadow: none; }
.chip-bad { color: var(--down); box-shadow: inset 0 0 0 1.5px var(--down); }
.chip-ok { color: var(--up); box-shadow: inset 0 0 0 1.5px var(--up); }
.chip-quiet { color: var(--fg-2); box-shadow: inset 0 0 0 1.5px var(--rule-soft); }
button.chip { cursor: pointer; height: 32px; padding: 0 12px; font-size: 12px; }
button.chip:hover:not(:disabled) { background: var(--fg); color: var(--surface); }
.chip-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------- 09 Segmented control */
.seg { display: inline-flex; max-width: 100%; border-radius: var(--r-ctl); box-shadow: inset 0 0 0 2px var(--fg); padding: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > button {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 2px;
  background: transparent; color: var(--fg);
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.seg > button:hover { background: var(--rule-soft); }
.seg > button[data-active="true"], .seg > button[aria-pressed="true"] { background: var(--fg); color: var(--surface); }
.seg-block { display: flex; }
.seg-block > button { flex: 1 1 0; }

/* ---------------------------------------------------------------- 10 Stat board */
.stat-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.stat-cell { padding: 18px 16px 20px; min-width: 0; border-top: 1px solid var(--rule-soft); border-left: 1px solid var(--rule-soft); }
.stat-cell:nth-child(-n + 2) { border-top: 0; }
.stat-cell:nth-child(odd) { border-left: 0; }
.stat-cell > .cap-up { display: block; margin-bottom: 10px; }
.stat-cell > .fig { display: block; overflow-wrap: anywhere; }
.stat-cell > .cap { display: block; margin-top: 6px; }
.stat-cell[data-alert="true"] > .fig { color: var(--alert-fg); }
@media (min-width: 900px) {
  .stat-board { grid-template-columns: repeat(var(--cells, 4), minmax(0, 1fr)); }
  .stat-cell { padding: 26px 28px 28px; border-top: 0 !important; border-left: 1px solid var(--rule-soft) !important; }
  .stat-cell:first-child { border-left: 0 !important; }
}
.stat-board[data-cells="5"] { --cells: 5; }
.stat-board[data-cells="3"] { --cells: 3; }
@media (max-width: 899px) { .stat-board[data-cells="5"] > .stat-cell:last-child, .stat-board[data-cells="3"] > .stat-cell:last-child { grid-column: 1 / -1; border-left: 0; } }

/* ---------------------------------------------------------------- 11 Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.table-scroll:focus-visible { outline-offset: -3px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; padding: 14px 16px; white-space: nowrap;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2);
  border-bottom: 2px solid var(--rule);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .t-right, .table th.t-right { text-align: right; }
.table .t-rank { width: 1%; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--fg-2); }
.table .t-strong { font-weight: 700; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.token-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.token-cell .t-name { display: block; font-weight: 700; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.token-cell .t-sym { display: block; font-size: 13px; color: var(--fg-2); }

/* ---------------------------------------------------------------- 12 Lanes + fuse */
.lanes { border-bottom: 3px solid var(--rule); }
.lane {
  display: grid; align-items: center; gap: 12px 20px;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "no token" "no fuse";
  min-height: 76px; padding: 12px 0;
  border-top: 3px solid var(--rule);
  color: inherit; text-decoration: none;
}
a.lane:hover .lane-no, a.lane:focus-visible .lane-no { opacity: 1; }
.lane-no { grid-area: no; font-weight: 900; font-size: 64px; line-height: 0.8; opacity: 0.32; font-variant-numeric: tabular-nums; align-self: center; }
.lane-token { grid-area: token; display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.lane-sym { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; text-transform: uppercase; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-prize { margin-left: auto; text-align: right; }
.lane-prize .fig { font-size: 28px; display: block; }
/* Fixed time column on EVERY width (also in empty lanes), so all fuse tracks have the same length
   and the bars can be compared lane to lane. */
.lane-fuse { grid-area: fuse; display: grid; grid-template-columns: minmax(0, 1fr) var(--lane-time-w, 12ch); align-items: center; gap: 14px; min-width: 0; }
.lane-fuse .fuse { min-width: 0; }
.lane-fuse .lane-time { grid-column: 2; min-width: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 479px) { .lane-fuse { gap: 10px; font-size: 14px; } }
.lane[data-free="true"] .lane-no { opacity: 1; color: var(--alert-fg); }
.lane[data-empty="true"] { color: var(--fg-2); }
.lane[data-empty="true"] .lane-no { opacity: 0.16; }
@media (min-width: 900px) {
  .lane { grid-template-columns: 88px minmax(260px, 0.9fr) minmax(0, 1.4fr); grid-template-areas: "no token fuse"; padding: 8px 0; gap: 0 32px; }
  .lane-no { font-size: 84px; }
}

/* fuse: the remaining share of the 14-day watch. Set the share with <progress value max> OR with
   style-free attribute data-level="0..100" (CSP forbids inline style; use fuse.style.setProperty
   from JS, which CSP allows). */
.fuse { position: relative; height: 14px; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.fuse > i { position: absolute; inset: 0 auto 0 0; width: var(--level, 0%); background: var(--fg); border-radius: 2px; transition: width 0.9s linear; }
.fuse[data-tone="warn"] > i { background: repeating-linear-gradient(135deg, var(--fg) 0 8px, transparent 8px 12px); }
.fuse[data-tone="free"] { background: repeating-linear-gradient(135deg, var(--alert) 0 8px, transparent 8px 16px); }
.fuse[data-tone="free"] > i { width: 0; }
.fuse-lg { height: 22px; }

/* generic progress (graduation etc.) */
.meter { position: relative; height: 10px; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: var(--level, 0%); background: var(--accent); }

/* ---------------------------------------------------------------- 13 Facts list */
.facts { display: grid; grid-template-columns: minmax(0, 1fr); }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule-soft); min-width: 0; }
.facts > div:first-child { border-top: 0; }
.facts dt { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.facts dd { min-width: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.facts dd a { text-decoration-thickness: 1.5px; }
.quote-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; border-top: 1px solid var(--rule-soft); }
.quote-rows > div:first-child { border-top: 0; }
.quote-rows > div > :last-child { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------- 14 Token logo */
.logo { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--fg); color: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 22px; line-height: 1; text-transform: uppercase; }
.logo > img { width: 100%; height: 100%; object-fit: cover; }
.logo-sm { width: 32px; height: 32px; font-size: 18px; }
.logo-lg { width: 72px; height: 72px; font-size: 40px; border-radius: 6px; }
.logo-xl { width: 112px; height: 112px; font-size: 64px; border-radius: 6px; }

/* ---------------------------------------------------------------- 15 Empty / notice */
.empty { padding: 40px 20px; text-align: center; }
.empty > .sub { margin-bottom: 10px; }
.empty > p { max-width: 52ch; margin-inline: auto; color: var(--fg-2); }
.empty > .btn, .empty > .row { margin-top: 20px; justify-content: center; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-ctl); box-shadow: inset 0 0 0 2px var(--fg); font-size: 15px; }
.notice-alert { box-shadow: none; background: var(--alert); color: var(--on-alert); }
.notice-fill { box-shadow: none; background: var(--fg); color: var(--surface); }
.card { padding: 20px; border-radius: var(--r-board); box-shadow: inset 0 0 0 2px var(--fg); }
.skeleton { display: inline-block; min-width: 4ch; border-radius: 3px; background: var(--rule-soft); color: transparent !important; user-select: none; }

/* ---------------------------------------------------------------- 16 Banner / toast */
.demo-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  min-height: 44px; padding: 8px var(--pad);
  background: var(--ink); color: var(--chalk);
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center;
  border-top: 3px solid var(--deck);
}
.demo-banner a { color: var(--deck); }
@media (max-width: 479px) { .demo-banner { font-size: 11px; gap: 4px 12px; min-height: 40px; padding-block: 6px; } }
.toasts { position: fixed; right: 16px; bottom: calc(var(--demo-h) + 16px); z-index: 70; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--ink); color: var(--chalk); font-size: 14px; font-weight: 500; box-shadow: 0 0 0 2px var(--chalk), 0 10px 30px rgba(22, 20, 15, 0.35); overflow-wrap: anywhere; }
.toast[data-kind="error"] { background: var(--flare); color: #fff7e6; }
.toast[data-kind="ok"] { box-shadow: 0 0 0 2px #86e0a3, 0 10px 30px rgba(22, 20, 15, 0.35); }
.toast a { color: inherit; font-weight: 700; }
.toast > button { margin-left: auto; background: none; border: 0; color: inherit; font-weight: 700; padding: 0 4px; }

/* ---------------------------------------------------------------- 17 Header */
/* The host <header class="site-header"> is in the HTML and shell.js fills it, so the height is
   reserved before the first paint: no layout shift when the header content arrives. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--deck); border-bottom: 2px solid var(--ink); min-height: calc(var(--header-h) + 2px); }
.site-header > .wrap { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.wordmark svg { width: 34px; height: 34px; } /* 17-cell mark at 2px per cell */
.wordmark-text { font-weight: 900; font-size: 30px; line-height: 0.9; letter-spacing: -0.005em; white-space: nowrap; }
.wordmark-text > span { opacity: 0.55; }
.site-nav { display: none; align-items: center; gap: 4px; margin-left: 20px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-ctl); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.site-nav a:hover { background: rgba(22, 20, 15, 0.1); }
.site-nav a[aria-current] { background: var(--ink); color: var(--deck); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.wallet-btn { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.wallet-btn[data-state="wrong"] { background: var(--flare); color: #fff7e6; }
.nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-ctl); background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.nav-toggle > i { display: block; width: 18px; height: 2px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
.site-header[data-open="true"] .site-nav { display: flex; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 8px var(--pad) 16px; flex-direction: column; align-items: stretch; background: var(--deck); border-bottom: 2px solid var(--ink); }
.site-header[data-open="true"] .site-nav a { min-height: 48px; font-size: 16px; }
@media (max-width: 479px) { .wordmark-text { font-size: 24px; } .wordmark { gap: 8px; } .wallet-btn { padding-inline: 12px; } }
@media (min-width: 900px) { .site-nav { display: flex; } .nav-toggle { display: none; } }

/* ---------------------------------------------------------------- 18 Footer */
.site-footer { margin-top: 56px; border-top: 2px solid var(--ink); padding-block: 40px 48px; }
.site-footer > .wrap { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.site-footer .wordmark-text { font-size: 44px; }
.site-footer .wordmark svg { width: 51px; height: 51px; } /* 3px per cell */
.footer-links { display: flex; flex-wrap: wrap; align-content: flex-start; align-self: start; gap: 10px 20px; font-weight: 600; }
.footer-risk { font-size: 13px; color: var(--fg-2); max-width: 90ch; }
.footer-vault { font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .site-footer > .wrap { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .footer-risk, .footer-vault { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- 19 Motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rise-2 { animation-delay: 0.08s; }
.rise-3 { animation-delay: 0.16s; }
.rise-4 { animation-delay: 0.24s; }
@keyframes pulse { 50% { opacity: 0.55; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- 20 Utilities */
.hero { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: center; padding-block: 36px 28px; }
.hero-mark { display: none; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); padding-block: 64px 48px; gap: 40px; }
  .hero-mark { display: block; justify-self: end; width: min(100%, 460px); aspect-ratio: 1 / 1; } /* square reserved before the SVG is mounted */
  .hero-mark svg { width: 100%; height: auto; }
}
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.t-right { text-align: right; }
.w-full { width: 100%; }
@media (max-width: 899px) { .hide-sm { display: none !important; } }
@media (min-width: 900px) { .hide-lg { display: none !important; } }
