/* ==========================================================================
   EntropyCast — COMPONENT LIBRARY
   --------------------------------------------------------------------------
   Component-specific styles ONLY. Every block below names the design-system
   tokens (from `design-system.css`) it depends on, so a component can be
   lifted into a C# Razor partial without dragging unknown globals with it.

   Markup convention for the future HTMX port:
     - Everything reads as valid static HTML before JS.
     - Where a block is destined to become a partial swap, the HTML carries
       a comment: <!-- hx: swap target = ... -->  (no JS shipped here).

   Contents
     01  Buttons
     02  Form controls
     03  Badges · layer badges · principal identity · status dots
     04  Cards
     05  Command Bar  (compact / expanded)
     06  Breadcrumbs
     07  Claim / Market data table
     08  Metric card + sparkline
     09  Argument-graph preview widget
     10  Reputation / calibration badge
     11  Main chart container
     12  App shell: sidebar · topbar · main
     13  Mobile bottom nav
     14  Wallet / dual-balance
     15  Tabs · segmented control · pagination
     16  Toasts · inline alerts
     17  Modal / dialog
     18  Skeletons · loading · live-update flash
     19  Stepper (dispute trail)
     20  Empty states
     21  Info tooltip affordance
     22  Public site: header · footer · hero · three-layer model
     23  Pricing grid
     24  Sitemap · error pages
     25  Trust surfaces: methodology panel · transparency note · cookie bar
     26  Onboarding fork
     27  LMSR price-impact preview
     28  Admin control-loop panel
     29  Misc: avatar · data list · page head · key/value chips
   ========================================================================== */


/* ==========================================================================
   01  BUTTONS
   tokens: --accent-*, --surface-*, --text-*, --border-*, --radius-md,
           --space-*, --dur-fast, --ease-standard, --glow-focus, --glow-stake,
           --predictive-*, --danger-*, --font-ui
   ========================================================================== */
.btn {
  --_bg: var(--surface-2);
  --_fg: var(--text-primary);
  --_bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.5rem 0.9rem;
  min-height: 34px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  color: var(--_fg);
  background: var(--_bg);
  border: 1px solid var(--_bd);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--glow-focus); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn .btn__icon { width: 15px; height: 15px; flex: none; }

/* Primary — the single accent action per view. */
.btn--primary {
  --_bg: var(--accent-500);
  --_fg: var(--text-on-accent);
  --_bd: transparent;
  font-weight: var(--weight-semibold);
}
.btn--primary:hover { background: var(--accent-400); }

/* Secondary — default outlined action (this is `.btn` base already, alias kept
   for readable markup). */
.btn--secondary { /* inherits base */ }

/* Ghost — low-emphasis, toolbar / inline. */
.btn--ghost {
  --_bg: transparent;
  --_bd: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text-primary); }

/* Danger — destructive confirm. */
.btn--danger {
  --_bg: var(--danger-bg);
  --_fg: var(--danger-fg);
  --_bd: var(--danger-border);
}
.btn--danger:hover { background: var(--danger-fg); --_fg: #fff; }

/* STAKE / COMMIT — used for taking a market position or submitting a
   consequential contribution. Deliberately heavier than a normal submit:
   more padding, the market (violet) color, a persistent inner ridge, and a
   distinct focus glow so the user registers "this has consequence".  */
.btn--stake {
  --_bg: var(--predictive-bg);
  --_fg: var(--predictive-fg);
  --_bd: var(--predictive-border);
  padding: 0.7rem 1.3rem;
  min-height: 44px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(154, 140, 242, 0.14);
}
.btn--stake:hover {
  background: var(--predictive-fg);
  --_fg: #0c0a1e;
  --_bd: transparent;
}
.btn--stake:focus-visible { box-shadow: var(--glow-stake); }
.btn--stake .btn__icon { width: 17px; height: 17px; }

/* Sizes. */
.btn--sm { min-height: 28px; padding: 0.35rem 0.65rem; font-size: var(--text-xs); }
.btn--lg { min-height: 44px; padding: 0.75rem 1.4rem; font-size: var(--text-md); }
.btn--block { display: flex; width: 100%; }

/* Icon-only button. */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--glow-focus); }
.icon-btn svg { width: 17px; height: 17px; }


/* ==========================================================================
   02  FORM CONTROLS
   tokens: --surface-inset, --border-hairline/-strong, --text-*, --radius-md,
           --space-*, --danger-*, --accent-400, --glow-focus, --font-mono
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}
.field__label .req { color: var(--danger-fg); margin-left: 2px; }
.field__hint { font-size: var(--text-xs); color: var(--text-tertiary); }
.field__error { font-size: var(--text-xs); color: var(--danger-fg); }

.input, .textarea, .select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent-400);
  box-shadow: var(--glow-focus);
}
.input:disabled, .textarea:disabled, .select:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.textarea { min-height: 96px; resize: vertical; line-height: var(--leading-normal); }

/* numeric inputs render mono — the value is data */
.input--numeric { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* invalid state */
.field[data-invalid] .input,
.field[data-invalid] .textarea,
.field[data-invalid] .select,
.input[aria-invalid="true"] {
  border-color: var(--danger-border);
}
.field[data-invalid] .input:focus { box-shadow: 0 0 0 3px var(--danger-bg); }

/* select chevron */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239db0bd' stroke-width='1.6'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

/* input with leading affordance (search icon, currency unit) */
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 2.1rem; }
.input-group__lead {
  position: absolute;
  left: 0.65rem;
  display: grid; place-items: center;
  color: var(--text-tertiary);
  pointer-events: none;
}
.input-group__lead svg { width: 15px; height: 15px; }
.input-group__unit {
  position: absolute; right: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* checkbox + radio */
.check {
  display: flex; gap: var(--space-2); align-items: flex-start;
  font-size: var(--text-sm); cursor: pointer;
}
.check input { margin-top: 2px; accent-color: var(--accent-500); width: 15px; height: 15px; }

/* switch — presentational; real control is the visually-hidden checkbox */
.switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-sm); }
.switch input { position: absolute; opacity: 0; }
.switch__track {
  width: 36px; height: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background var(--dur-base) var(--ease-standard);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-standard);
}
.switch input:checked + .switch__track { background: var(--accent-soft-bg); border-color: var(--accent-soft-border); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--accent-400); }
.switch input:focus-visible + .switch__track { box-shadow: var(--glow-focus); }


/* ==========================================================================
   03  BADGES · LAYER BADGES · PRINCIPAL IDENTITY · STATUS DOTS
   tokens: --verified-*, --live-*, --predictive-*, --info-*, --warn-*,
           --human-*, --agent-*, --radius-sm/-pill, --text-xs, --font-mono,
           --pulse-dur, keyframes ec-pulse-live
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.15em 0.55em;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.badge--neutral  { color: var(--text-secondary); background: var(--surface-3); border-color: var(--border-hairline); }
.badge--verified { color: var(--verified-fg); background: var(--verified-bg); border-color: var(--verified-border); }
.badge--live     { color: var(--live-fg);     background: var(--live-bg);     border-color: var(--live-border); }
.badge--predictive{color: var(--predictive-fg);background: var(--predictive-bg);border-color: var(--predictive-border); }
.badge--info     { color: var(--info-fg);     background: var(--info-bg);     border-color: var(--info-border); }
.badge--warn     { color: var(--warn-fg);     background: var(--warn-bg);     border-color: var(--warn-border); }
.badge--danger   { color: var(--danger-fg);   background: var(--danger-bg);   border-color: var(--danger-border); }

/* LAYER BADGE — one of the three temporal layers. Same shape as `.badge`
   but always carries a leading marker glyph so it is recognisable at a glance
   in a dense table. */
.layer-badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.15em 0.55em 0.15em 0.45em;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.layer-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px; flex: none;
}
.layer-badge--historical { color: var(--verified-fg);   background: var(--verified-bg);   border-color: var(--verified-border); }
.layer-badge--historical::before { background: var(--verified-fg); border-radius: 50%; }
.layer-badge--present { color: var(--live-fg); background: var(--live-bg); border-color: var(--live-border); }
.layer-badge--present::before { background: var(--live-fg); border-radius: 50%; animation: ec-pulse-live var(--pulse-dur) var(--pulse-ease) infinite; }
.layer-badge--future { color: var(--predictive-fg); background: var(--predictive-bg); border-color: var(--predictive-border); }
.layer-badge--future::before { background: var(--predictive-fg); transform: rotate(45deg); }

/* PRINCIPAL BADGE — quiet, consistent, everywhere authorship appears.
   Agents are first-class and DISCLOSED, never hidden. */
.principal {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}
.principal__mark {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.principal__mark svg { width: 11px; height: 11px; }
.principal--human .principal__mark { color: var(--human-fg); background: var(--human-bg); border-color: var(--border-hairline); }
.principal--agent .principal__mark { color: var(--agent-fg); background: var(--agent-bg); border-color: var(--agent-border); }
.principal--agent .principal__name { color: var(--agent-fg); }
/* agent responsible-party, shown inline on hover/detail */
.principal__responsible { color: var(--text-tertiary); }
.principal__responsible::before { content: "· acct. "; }

/* STATUS DOT — bare indicator, reused in tables, nav, cards. */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot--verified { background: var(--verified-fg); }
.dot--live { background: var(--live-fg); animation: ec-pulse-live var(--pulse-dur) var(--pulse-ease) infinite; }
.dot--predictive { background: var(--predictive-fg); }
.dot--muted { background: var(--text-tertiary); }


/* ==========================================================================
   04  CARDS
   tokens: --surface-1/-2/-3, --border-hairline, --radius-lg, --shadow-1/-2,
           --space-*
   ========================================================================== */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
}
.card--raised { background: var(--surface-2); box-shadow: var(--shadow-1); }
.card--pop { background: var(--surface-3); box-shadow: var(--shadow-2); }
.card--pad { padding: var(--space-5); }
.card__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-hairline);
}
.card__title { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.card__body { padding: var(--space-5); }
.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-hairline);
  display: flex; align-items: center; gap: var(--space-3);
}
.card__body > * + *, .card__section + .card__section { margin-top: var(--space-4); }


/* ==========================================================================
   05  COMMAND BAR   (§4 + §5.1 — ONE component, two contexts)
   Homepage hero uses `--expanded`; persistent topbar uses `--compact`.
   tokens: --surface-2/-inset, --accent-*, --glow-command, --radius-lg/-pill,
           --predictive-*, --text-*, --font-mono, --space-*
   ========================================================================== */
.command-bar { width: 100%; min-width: 0; }
.command-bar__shell {
  display: flex; align-items: center; gap: var(--space-2);
  min-width: 0;
  background: var(--surface-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-standard);
}
.command-bar__icon { color: var(--text-tertiary); display: grid; place-items: center; flex: none; }
.command-bar__icon svg { width: 18px; height: 18px; }
.command-bar__input {
  flex: 1;
  min-width: 0; /* inputs don't shrink below their default ~20ch content size otherwise */
  border: 0; background: transparent; outline: none;
  color: var(--text-primary);
  font-size: var(--text-base);
}
.command-bar__input::placeholder { color: var(--text-tertiary); }
.command-bar__kbd {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  color: var(--text-tertiary);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.4em;
}
/* focus glow — Perplexity-style */
.command-bar__shell:focus-within {
  border-color: var(--accent-400);
  box-shadow: var(--glow-command);
}

/* EXPANDED — hero context. Larger, more breathing room, prompt copy above. */
.command-bar--expanded .command-bar__shell { padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); }
.command-bar--expanded .command-bar__input { font-size: var(--text-md); }
.command-bar--expanded .command-bar__icon svg { width: 20px; height: 20px; }
.command-bar__prompt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* COMPACT — topbar context. */
.command-bar--compact { max-width: 420px; }
.command-bar--compact .command-bar__shell { padding: 0.6rem 0.7rem; border-radius: var(--radius-md); background: var(--surface-2); border-color: var(--border-hairline); }
.command-bar--compact .command-bar__input { font-size: var(--text-sm); }

/* "Structured query recognized" — a chip appears once the input parses a
   category / date-range / layer filter. Reinforces analytical framing. */
.command-bar__parsed {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3);
}
/* the `display: flex` above shares specificity with the UA [hidden] rule and
   wins on source order alone, so the attribute is silently ignored without
   this override — the empty node then still renders its own margin-top as
   dead space, throwing off the command bar's height next to its siblings. */
.command-bar__parsed[hidden] { display: none; }
.query-chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.2em 0.55em;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--predictive-fg);
  background: var(--predictive-bg);
  border: 1px solid var(--predictive-border);
  border-radius: var(--radius-pill);
}
.query-chip__key { color: var(--text-tertiary); }
.query-chip__remove { color: var(--text-tertiary); background: none; border: 0; cursor: pointer; line-height: 1; padding: 0 0 0 0.2em; }
.query-chip__remove:hover { color: var(--text-primary); }

/* results panel — becomes an HTMX partial swap; empty in static HTML.
   <!-- hx: swap target = #command-results --> */
.command-bar__results {
  margin-top: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.command-bar__results:empty { display: none; }


/* ==========================================================================
   06  BREADCRUMBS   (§5.1)
   A thin monospaced trail: layer → category → claim → argument → evidence.
   tokens: --font-mono, --text-2xs, --text-tertiary/-secondary, --space-*
   ========================================================================== */
.breadcrumbs { font-family: var(--font-mono); font-size: var(--text-2xs); }
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em;
  color: var(--text-tertiary);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.4em; }
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--border-strong);
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--text-primary); }
.breadcrumbs [aria-current="page"] { color: var(--text-primary); }


/* ==========================================================================
   07  CLAIM / MARKET DATA TABLE   (§4)
   GitHub-density table modelled on real fields: claim text, layer badge,
   probability / verification status, trend arrow, contributor principal
   badge, reputation-weighted confidence.
   tokens: --surface-1/-2, --border-hairline, --font-mono, --move-up/-down,
           --text-sm/-xs, --space-*, --radius-lg
   ========================================================================== */
.data-table-wrap {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-1);
}
.data-table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-hairline);
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}
.data-table thead th {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
.data-table tbody tr { transition: background var(--dur-fast) var(--ease-standard); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-claim { max-width: 40ch; }
.data-table .cell-claim a { color: var(--text-primary); font-weight: var(--weight-medium); }
.data-table .cell-claim a:hover { color: var(--text-link); }
.data-table .cell-claim small { display: block; color: var(--text-tertiary); font-size: var(--text-2xs); margin-top: 2px; }

/* numeric columns are mono + right-aligned */
.data-table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* trend arrow — pure green/red is allowed here (probability movement) */
.trend { display: inline-flex; align-items: center; gap: 0.25em; font-family: var(--font-mono); font-size: var(--text-xs); }
.trend--up   { color: var(--move-up); }
.trend--down { color: var(--move-down); }
.trend--flat { color: var(--text-tertiary); }
.trend svg { width: 12px; height: 12px; }

/* reputation-weighted confidence — a small meter, not a raw number */
.confidence { display: inline-flex; align-items: center; gap: var(--space-2); }
.confidence__bar {
  width: 46px; height: 4px; border-radius: var(--radius-pill);
  background: var(--surface-3); overflow: hidden;
}
.confidence__fill { display: block; height: 100%; background: var(--accent-400); border-radius: inherit; }
.confidence__val { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary); }

/* pagination row — HTMX target.  <!-- hx: swap target = tbody, push-url --> */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-hairline);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.pager__pages { display: flex; gap: var(--space-1); }


/* ==========================================================================
   08  METRIC CARD + SPARKLINE   (§4)
   Single claim/market: current probability, delta, mini history sparkline
   (chart-lib plug point), and an "N supporting / N attacking" hint of the
   argument graph beneath it.
   tokens: --surface-1, --border-hairline, --radius-lg, --font-mono,
           --move-up/-down, --predictive-fg, --verified-fg, --space-*
   ========================================================================== */
.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label   label"
    "value   spark"
    "hint    hint";
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
}
.metric__label {
  grid-area: label;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex; align-items: center; gap: var(--space-2);
}
.metric__value {
  grid-area: value;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -0.02em;
}
.metric__delta {
  font-family: var(--font-mono); font-size: var(--text-xs);
  display: inline-flex; align-items: center; gap: 0.3em;
  margin-left: var(--space-2);
}
.metric__delta--up   { color: var(--move-up); }
.metric__delta--down { color: var(--move-down); }
.metric__spark { grid-area: spark; align-self: end; }
.metric__hint {
  grid-area: hint;
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-2xs); color: var(--text-tertiary);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-soft);
}
.metric__hint .support { color: var(--verified-fg); }
.metric__hint .attack  { color: var(--move-down); }

/* Sparkline — inline SVG placeholder. Swap the <svg> for the chart lib's
   canvas/target; keep the box size so layout doesn't shift.
   <!-- chart-hook: sparkline, series=price_history --> */
.sparkline { width: 96px; height: 34px; display: block; color: var(--accent-400); }
.sparkline path { fill: none; stroke: currentColor; stroke-width: 1.5; }
.sparkline .spark-area { fill: currentColor; opacity: 0.12; stroke: none; }


/* ==========================================================================
   09  ARGUMENT-GRAPH PREVIEW WIDGET   (§4)
   Compact, non-interactive node/edge preview. Support edges in one accent,
   attack edges in another. Sits inside a claim card. Full interactive graph
   is a JS hook onto `.arg-preview__canvas`.
   tokens: --surface-inset, --border-hairline, --verified-fg, --move-down,
           --predictive-fg, --radius-md, --text-2xs, --space-*
   ========================================================================== */
.arg-preview {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  overflow: hidden;
}
.arg-preview__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-hairline);
  font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}
/* JS graph renders here (canvas/SVG). Static markup ships the SVG sample. */
.arg-preview__canvas { display: block; width: 100%; height: 168px; }
.arg-preview__canvas .edge-support { stroke: var(--verified-fg); stroke-width: 1.5; }
.arg-preview__canvas .edge-attack  { stroke: var(--move-down); stroke-width: 1.5; stroke-dasharray: 3 3; }
.arg-preview__canvas .node {
  fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1;
}
.arg-preview__canvas .node--root { stroke: var(--predictive-fg); stroke-width: 1.5; }
.arg-preview__canvas .node-label { fill: var(--text-secondary); font-size: 9px; font-family: var(--font-mono); }
.arg-preview__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-hairline);
}
.arg-legend { display: flex; gap: var(--space-3); font-size: var(--text-2xs); color: var(--text-tertiary); }
.arg-legend span { display: inline-flex; align-items: center; gap: 0.4em; }
.arg-legend .swatch { width: 14px; height: 0; border-top: 2px solid currentColor; }
.arg-legend .swatch--support { color: var(--verified-fg); }
.arg-legend .swatch--attack  { color: var(--move-down); border-top-style: dashed; }


/* ==========================================================================
   10  REPUTATION / CALIBRATION BADGE   (§4)
   Role-specific (this instance models FORECASTING). Shows a calibration
   indicator, not just a raw score.
   tokens: --surface-1/-2, --border-hairline, --radius-md, --font-mono,
           --verified-fg, --move-down, --accent-400, --text-*, --space-*
   ========================================================================== */
.rep-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  max-width: 320px;
}
.rep-badge__role {
  grid-column: 1 / -1;
  font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}
.rep-badge__score {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.rep-badge__meta { font-size: var(--text-2xs); color: var(--text-secondary); }
.rep-badge__meta b { font-family: var(--font-mono); color: var(--text-primary); font-weight: var(--weight-medium); }

/* calibration strip: a diagonal reference + the user's plotted deviation.
   Green where over/under-confidence is low; red where it's high. */
.calib {
  grid-column: 1 / -1;
  margin-top: var(--space-2);
}
.calib__track {
  height: 6px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--move-down) 0%, var(--verified-fg) 50%, var(--move-down) 100%);
  position: relative;
}
.calib__marker {
  position: absolute; top: 50%; width: 10px; height: 10px;
  border-radius: 50%; background: var(--text-primary);
  border: 2px solid var(--surface-1);
  transform: translate(-50%, -50%);
}
.calib__labels {
  display: flex; justify-content: space-between;
  font-size: var(--text-2xs); font-family: var(--font-mono); color: var(--text-tertiary);
  margin-top: 2px;
}

/* compact inline variant — used in tables / feed rows */
.rep-inline {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-secondary);
}
.rep-inline__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-400); }


/* ==========================================================================
   11  MAIN CHART CONTAINER   (§4 + §5.2)
   Structured container ready for a probability-over-time line chart. Has
   axis label slots and an annotation marker style for "premise fell / price
   moved because X" tied to the argument graph.
   tokens: --surface-1, --border-hairline, --radius-lg, --font-mono,
           --predictive-fg, --live-fg, --text-*, --space-*
   ========================================================================== */
.chart {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.chart__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.chart__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.chart__legend { display: flex; gap: var(--space-3); font-size: var(--text-2xs); color: var(--text-tertiary); }
.chart__legend span { display: inline-flex; align-items: center; gap: 0.4em; }
.chart__legend .swatch { width: 10px; height: 2px; background: currentColor; }
.chart__range { display: flex; gap: var(--space-1); }
.chart__range button {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  padding: 0.15rem 0.4rem;
  color: var(--text-tertiary);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-xs);
  cursor: pointer;
}
.chart__range button[aria-pressed="true"] { color: var(--text-primary); background: var(--surface-3); border-color: var(--border-hairline); }

/* plot area — chart lib draws into `.chart__plot` (canvas/SVG target).
   <!-- chart-hook: line, series=implied_probability, x=time --> */
.chart__plot {
  position: relative;
  width: 100%;
  height: 280px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 1fr 22px;
  grid-template-areas: "y-axis plot" ".  x-axis";
}
.chart__y-axis { grid-area: y-axis; }
.chart__x-axis { grid-area: x-axis; }
.chart__canvas { grid-area: plot; position: relative; border-left: 1px solid var(--border-hairline); border-bottom: 1px solid var(--border-hairline); }
.chart__axis-label {
  font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary);
  display: flex;
}
.chart__y-axis { flex-direction: column; justify-content: space-between; align-items: flex-end; padding-right: var(--space-2); }
.chart__x-axis { justify-content: space-between; padding-left: 0; }
.chart__unit-y {
  position: absolute; left: -6px; top: 50%;
  transform: rotate(-90deg) translateX(50%);
  transform-origin: left center;
  font-size: var(--text-2xs); color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
}

/* annotation marker — a dashed vertical rule + a numbered flag, placed by JS
   at the x-position of the linked argument event. */
.chart__annotation {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px dashed var(--predictive-border);
}
.chart__annotation-flag {
  position: absolute; top: 4px; left: 0; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: var(--weight-bold);
  color: var(--predictive-fg);
  background: var(--predictive-bg);
  border: 1px solid var(--predictive-border);
  cursor: pointer;
}
.chart__annotations-list { margin-top: var(--space-3); border-top: 1px solid var(--border-soft); padding-top: var(--space-3); }
.chart__annotations-list li {
  display: flex; gap: var(--space-2); align-items: baseline;
  font-size: var(--text-xs); color: var(--text-secondary);
  padding-block: 2px;
}
.chart__annotations-list .marker-num {
  font-family: var(--font-mono); font-size: 9px; font-weight: var(--weight-bold);
  color: var(--predictive-fg);
  border: 1px solid var(--predictive-border); border-radius: 50%;
  width: 15px; height: 15px; display: inline-grid; place-items: center; flex: none;
}


/* ==========================================================================
   12  APP SHELL: SIDEBAR · TOPBAR · MAIN   (§3)
   Sidebar nav is grouped by the four layers + Reputation + Wallet.
   Each shell fragment is destined to become a Razor layout partial.
   tokens: --surface-1/-2, --border-hairline, --sidebar-w, --topbar-h,
           --z-topbar/-drawer, --space-*, --accent-*, --text-*
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
@media (max-width: 899px) {
  /* minmax(0, 1fr), not a bare 1fr: a bare 1fr track can never shrink
     below the min-content width of whatever's inside it (the command bar,
     the data table, …), which blows the whole page out sideways on phones
     — the classic CSS Grid "blowout" bug. minmax(0, …) caps the track at
     the actual available width and lets children handle their own overflow. */
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
}

/* ---- Sidebar ---- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface-1);
  border-right: 1px solid var(--border-hairline);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
@media (max-width: 899px) {
  /* On mobile the sidebar becomes an off-canvas drawer; the bottom nav (§13)
     is the primary wayfinding. Drawer is opened by the topbar menu button. */
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(84vw, var(--sidebar-w));
    z-index: var(--z-drawer);
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
  }
  .sidebar[data-open="true"] { transform: translateX(0); }
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4);
  font-weight: var(--weight-semibold);
  border-bottom: 1px solid var(--border-hairline);
}
.sidebar__brand svg { width: 20px; height: 20px; color: var(--accent-400); }
.sidebar__nav { padding: var(--space-3); flex: 1; }
.sidebar__group { margin-bottom: var(--space-4); }
.sidebar__group-label {
  font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: var(--tracking-caps);
  color: var(--text-tertiary);
  padding: 0 var(--space-2) var(--space-2);
}
.sidebar__link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0.5rem var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.sidebar__link:hover { background: var(--surface-2); color: var(--text-primary); text-decoration: none; }
.sidebar__link svg { width: 16px; height: 16px; flex: none; color: var(--text-tertiary); }
.sidebar__link[aria-current="page"] {
  background: var(--accent-soft-bg);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--accent-400);
}
.sidebar__link[aria-current="page"] svg { color: var(--accent-400); }
.sidebar__link .count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: var(--text-2xs);
  color: var(--text-tertiary);
}
.sidebar__foot { padding: var(--space-3); border-top: 1px solid var(--border-hairline); }

/* ---- Topbar ---- */
.topbar {
  grid-area: topbar;
  position: sticky; top: 0; z-index: var(--z-topbar);
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4);
  background: color-mix(in srgb, var(--surface-1) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}
@media (max-width: 400px) {
  /* small-phone floor: tighten the chrome around the search box so it
     doesn't get squeezed to nothing next to the wallet + avatar. */
  .topbar { gap: var(--space-2); padding-inline: var(--space-3); }
  .topbar__search { min-width: 64px; }
  .wallet--compact .wallet__part { padding: 0.3rem 0.5rem; }
}
.topbar__menu { display: none; }
@media (max-width: 899px) { .topbar__menu { display: inline-grid; } }
/* min-width: 0 lets it shrink to fit; the 88px floor keeps the search box
   from disappearing entirely once the wallet/avatar claim the rest. */
.topbar__search { flex: 1; min-width: 88px; display: flex; justify-content: center; }
@media (max-width: 420px) {
  /* the "/" kbd hint is the first thing to go — reclaim its space for the input */
  .topbar .command-bar__kbd { display: none; }
}
.topbar__right { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

/* ---- Main ---- */
.app-main {
  grid-area: main;
  /* clearance = pill height + its floating gap off the screen edge + breathing room */
  padding: var(--space-6) var(--space-5) calc(var(--bottomnav-h) + var(--space-4) + var(--space-8));
}
@media (min-width: 900px) { .app-main { padding-bottom: var(--space-8); } }
.app-main__inner { max-width: var(--content-max); margin-inline: auto; }

/* drawer scrim (mobile) */
.scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-standard), visibility var(--dur-base);
}
.scrim[data-open="true"] { opacity: 1; visibility: visible; }


/* ==========================================================================
   13  MOBILE BOTTOM NAV   (§5.1)
   Five constant destinations. A tab bar, NOT a hidden hamburger drawer.
   tokens: --surface-2, --border-hairline, --bottomnav-h, --z-sticky,
           --accent-400, --text-tertiary, --font-*
   ========================================================================== */
.bottom-nav {
  /* floating island: inset from the screen edges on every side, fully
     rounded, opaque — same elevation language as a "liquid glass" tab bar,
     minus the actual glass (no blur, no translucency). */
  position: fixed;
  left: var(--space-4); right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-sticky);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--bottomnav-h);
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pop);
}
@media (min-width: 900px) { .bottom-nav { display: none; } }
.bottom-nav__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  margin: 12px 6px;
  border-radius: var(--radius-lg);
  font-size: 10px;
  color: var(--text-tertiary);
  transition: color var(--dur-base) var(--ease-standard);
}
/* active glow — a soft circular gradient behind the icon, feathered to
   transparent at the edge (like a blurred spotlight), not a hard-edged chip */
.bottom-nav__item::before {
  content: "";
  position: absolute;
  top: 1px; left: 50%;
  width: 40px; height: 40px;
  transform: translateX(-50%) scale(0.7);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft-bg) 0%, color-mix(in srgb, var(--accent-soft-bg) 50%, transparent) 55%, transparent 78%);
  filter: blur(5px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
  pointer-events: none;
}
.bottom-nav__item svg { position: relative; width: 19px; height: 19px; }
.bottom-nav__item[aria-current="page"] { color: var(--accent-400); }
.bottom-nav__item[aria-current="page"]::before { opacity: 1; transform: translateX(-50%) scale(1); }
.bottom-nav__item:hover { text-decoration: none; color: var(--text-secondary); }


/* ==========================================================================
   14  WALLET / DUAL-BALANCE   (§3)
   Two-part display: usage credits vs. redeemable value — NEVER merged.
   Visually distinct treatments (icon, color accent, label).
   tokens: --surface-1/-2, --border-hairline, --radius-lg, --font-mono,
           --accent-400, --verified-fg, --text-*, --space-*
   ========================================================================== */
.wallet { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.wallet__part {
  flex: 1 1 200px;
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  position: relative;
}
.wallet__part--usage   { border-top: 2px solid var(--accent-400); }
.wallet__part--value   { border-top: 2px solid var(--verified-fg); }
.wallet__kind {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}
.wallet__amount {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-2);
}
.wallet__unit { font-size: var(--text-xs); color: var(--text-tertiary); margin-left: 0.3em; }
.wallet__sub { font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: 2px; }

/* compact topbar variant — two stacked figures, still separated by a rule */
.wallet--compact { flex-wrap: nowrap; gap: 0; border: 1px solid var(--border-hairline); border-radius: var(--radius-md); overflow: hidden; }
.wallet--compact .wallet__part {
  flex-basis: auto;
  border: 0; border-radius: 0; padding: 0.3rem 0.7rem; background: var(--surface-2);
}
.wallet--compact .wallet__part + .wallet__part { border-left: 1px solid var(--border-hairline); }
.wallet--compact .wallet__amount { font-size: var(--text-sm); margin-top: 0; }
.wallet--compact .wallet__kind { font-size: 9px; }

/* "why two balances?" affordance lives inline; see §21 info-tip */


/* ==========================================================================
   15  TABS · SEGMENTED CONTROL · PAGINATION
   tokens: --surface-2/-3, --border-hairline, --accent-400, --radius-md/-pill,
           --font-mono, --text-*, --space-*
   ========================================================================== */
.tabs {
  display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-hairline);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab {
  flex: none;
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-secondary);
  border: 0; background: transparent; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs__tab:hover { color: var(--text-primary); }
.tabs__tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--accent-400); }

/* Segmented control — used for the leaderboard human/agent toggle (§5.2).
   The plan flags this as a [DECIDE]; the UI makes the segmentation VISIBLE
   and switchable rather than silently picking one. */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-3);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}
.segmented button {
  padding: 0.3rem 0.7rem;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow-1); }


/* ==========================================================================
   16  TOASTS · INLINE ALERTS   (§5.4)
   "Informational" is a first-class style here (below-threshold, low
   liquidity) — frequent expected system messages, not exceptional errors.
   tokens: --surface-2/-3, --info-*, --warn-*, --danger-*, --verified-*,
           --radius-md, --shadow-pop, keyframes ec-toast-in, --z-toast
   ========================================================================== */
.toast-region {
  position: fixed; right: var(--space-4); bottom: var(--space-4);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(360px, calc(100vw - 2 * var(--space-4)));
}
.toast {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  animation: ec-toast-in var(--dur-base) var(--ease-out);
}
.toast__icon { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.toast__body { flex: 1; font-size: var(--text-sm); }
.toast__title { font-weight: var(--weight-semibold); }
.toast__msg { color: var(--text-secondary); margin-top: 2px; }
.toast__close { flex: none; }
.toast--success { border-left-color: var(--verified-fg); }
.toast--success .toast__icon { color: var(--verified-fg); }
.toast--error   { border-left-color: var(--danger-fg); }
.toast--error .toast__icon { color: var(--danger-fg); }
.toast--warn    { border-left-color: var(--warn-fg); }
.toast--warn .toast__icon { color: var(--warn-fg); }
.toast--info    { border-left-color: var(--info-fg); }
.toast--info .toast__icon { color: var(--info-fg); }

/* Inline alert — same palette, lives in the content flow. */
.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.alert__icon { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.alert--info    { color: var(--info-fg);     background: var(--info-bg);     border-color: var(--info-border); }
.alert--warn    { color: var(--warn-fg);     background: var(--warn-bg);     border-color: var(--warn-border); }
.alert--danger  { color: var(--danger-fg);   background: var(--danger-bg);   border-color: var(--danger-border); }
.alert--success { color: var(--verified-fg); background: var(--verified-bg); border-color: var(--verified-border); }
.alert strong { color: var(--text-primary); }
.alert p { color: inherit; opacity: 0.92; }


/* ==========================================================================
   17  MODAL / DIALOG   (§5.4)
   Confirmation pattern for the stake/position flow and disputes.
   Sized/styled with the card surface + elevation tokens.
   tokens: --surface-3, --border-strong, --radius-xl, --shadow-pop,
           --z-modal, --space-*
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--space-4); }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 10, 0.62); backdrop-filter: blur(2px); }
.modal__panel {
  position: relative;
  width: min(480px, 100%);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop);
  animation: ec-toast-in var(--dur-base) var(--ease-out);
}
.modal__panel--wide { width: min(640px, 100%); }
.modal__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.modal__title { font-size: var(--text-lg); }
.modal__body { padding: var(--space-3) var(--space-5); }
.modal__body > * + * { margin-top: var(--space-3); }
.modal__footer {
  display: flex; justify-content: flex-end; gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
}
/* consequence framing: stake confirm modal gets a violet hairline top */
.modal__panel--stake { border-top: 3px solid var(--predictive-fg); }


/* ==========================================================================
   18  SKELETONS · LOADING · LIVE-UPDATE FLASH   (§5.4)
   Content is FREQUENTLY mid-load / mid-update in this product.
   tokens: --surface-2/-3, --radius-*, keyframes ec-skeleton /
           ec-value-flash / ec-indeterminate, --flash-dur, --accent-soft-bg
   ========================================================================== */
.skeleton {
  --_from: var(--surface-2);
  --_via: color-mix(in srgb, var(--surface-3) 70%, var(--text-tertiary) 8%);
  background: linear-gradient(90deg, var(--_from) 25%, var(--_via) 37%, var(--_from) 63%);
  background-size: 200% 100%;
  animation: ec-skeleton 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton--text { height: 0.7em; margin-block: 0.25em; }
.skeleton--title { height: 1.1em; width: 42%; }
.skeleton--line-80 { width: 80%; } .skeleton--line-60 { width: 60%; } .skeleton--line-40 { width: 40%; }
.skeleton--block { height: 100%; width: 100%; border-radius: var(--radius-md); }
.skeleton--chip { height: 18px; width: 64px; border-radius: var(--radius-pill); }
.skeleton--chart { height: 280px; border-radius: var(--radius-lg); }
.skeleton--avatar { width: 28px; height: 28px; border-radius: 50%; }

/* skeleton table row helper */
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-4); padding: 0.7rem 0.9rem; }

/* indeterminate top progress bar (for HTMX request in-flight) */
.progress-indeterminate { height: 2px; overflow: hidden; background: var(--surface-3); }
.progress-indeterminate::after {
  content: ""; display: block; height: 100%; width: 100%;
  background: var(--accent-400);
  animation: ec-indeterminate 1.1s var(--ease-in-out) infinite;
}

/* spinner */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-400);
  animation: ec-spin 0.7s linear infinite;
  display: inline-block;
}

/* LIVE-UPDATE FLASH — add this class (JS/HTMX after swap) to a changed
   value/cell for a brief highlight. No re-render jump. Ties to the pulse
   token family. */
.is-live-flash { animation: ec-value-flash var(--flash-dur) var(--ease-out); }

/* live indicator chip — "updating" state on present-layer / market data */
.live-indicator {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: var(--text-2xs); color: var(--live-fg);
  font-family: var(--font-mono);
}
.live-indicator::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--live-fg);
  animation: ec-pulse-live var(--pulse-dur) var(--pulse-ease) infinite;
}


/* ==========================================================================
   19  STEPPER (dispute trail)   (§5.3)
   submitted → under review → resolved
   tokens: --verified-fg, --live-fg, --text-tertiary, --border-strong,
           --font-mono, --space-*
   ========================================================================== */
.stepper { display: flex; align-items: flex-start; gap: 0; }
.stepper__step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.stepper__step:not(:last-child)::after {
  content: ""; position: absolute; top: 11px; left: 50%; right: -50%;
  height: 2px; background: var(--border-strong);
}
.stepper__dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  color: var(--text-tertiary);
  z-index: 1;
}
.stepper__dot svg { width: 11px; height: 11px; }
.stepper__label { font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: var(--space-2); }
.stepper__meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.stepper__step[data-state="done"] .stepper__dot { border-color: var(--verified-fg); color: var(--verified-fg); }
.stepper__step[data-state="done"]::after { background: var(--verified-fg); }
.stepper__step[data-state="active"] .stepper__dot { border-color: var(--live-fg); color: var(--live-fg); animation: ec-pulse-live var(--pulse-dur) var(--pulse-ease) infinite; }
.stepper__step[data-state="active"] .stepper__label { color: var(--text-primary); }

/* dispute window countdown */
.countdown {
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-family: var(--font-mono);
  color: var(--live-fg);
}
.countdown__num { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.countdown__unit { font-size: var(--text-2xs); color: var(--text-tertiary); }


/* ==========================================================================
   20  EMPTY STATES   (§5.4)
   Distinct copy + a next-action for: empty feed, no search results, new
   user with no history.
   tokens: --surface-1, --border-hairline (dashed), --radius-lg, --text-*,
           --space-*
   ========================================================================== */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.empty__icon {
  width: 40px; height: 40px; color: var(--text-tertiary);
  display: grid; place-items: center;
  border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
}
.empty__title { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.empty__msg { font-size: var(--text-sm); color: var(--text-secondary); max-width: 42ch; }
.empty__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-top: var(--space-2); }


/* ==========================================================================
   21  INFO TOOLTIP AFFORDANCE   (§3 wallet, §5.5 contextual help)
   CSS-only reveal; the trigger is a real <button> for keyboard + SR users.
   tokens: --surface-3, --border-strong, --radius-md, --shadow-pop, --text-xs
   ========================================================================== */
.info-tip { position: relative; display: inline-flex; }
.info-tip__trigger {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: var(--weight-bold);
  color: var(--text-tertiary);
  background: var(--surface-3);
  border: 1px solid var(--border-hairline);
  cursor: help;
}
.info-tip__trigger:hover { color: var(--text-primary); }
.info-tip__panel {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 260px;
  padding: var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
  z-index: var(--z-popover);
}
.info-tip__trigger:hover + .info-tip__panel,
.info-tip__trigger:focus-visible + .info-tip__panel,
.info-tip__panel:hover {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   22  PUBLIC SITE: HEADER · FOOTER · HERO · THREE-LAYER MODEL   (§2)
   tokens: --surface-1, --border-hairline, --content-max, --reading-max,
           --accent-*, --verified/-live/-predictive, --space-*, --text-*
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-topbar);
  background: color-mix(in srgb, var(--bg-900) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}
.site-header__inner {
  max-width: var(--content-max); margin-inline: auto;
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-3) var(--space-4);
}
.site-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-semibold); color: var(--text-primary); }
.site-brand svg { width: 22px; height: 22px; color: var(--accent-400); }
.site-nav { display: none; gap: var(--space-4); margin-left: var(--space-4); }
@media (min-width: 860px) { .site-nav { display: flex; } }
.site-nav a { color: var(--text-secondary); font-size: var(--text-sm); }
.site-nav a:hover { color: var(--text-primary); text-decoration: none; }
.site-header__cta { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

/* hero */
.hero { text-align: center; padding-block: var(--space-9) var(--space-8); }
.hero__inner { max-width: 760px; margin-inline: auto; }
.hero h1 {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  letter-spacing: -0.02em;
}
.hero__sub { font-size: var(--text-md); color: var(--text-secondary); margin-top: var(--space-4); line-height: var(--leading-relaxed); }
.hero__command { margin-top: var(--space-6); }
.hero__examples { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-tertiary); }
.hero__examples button {
  font: inherit; color: var(--text-link); background: none; border: 0; cursor: pointer; padding: 0 0.3em;
}

/* THREE-LAYER MODEL — the core value prop, deserves real layout.
   historical → present → future, argument graph as the connective thread. */
.layer-model {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  position: relative;
}
@media (min-width: 820px) {
  .layer-model { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
}
.layer-col {
  padding: var(--space-5);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  position: relative;
}
.layer-col__tag { display: inline-flex; margin-bottom: var(--space-3); }
.layer-col--historical { border-top: 2px solid var(--verified-fg); }
.layer-col--present    { border-top: 2px solid var(--live-fg); }
.layer-col--future     { border-top: 2px solid var(--predictive-fg); }
.layer-col h3 { font-size: var(--text-base); }
.layer-col p { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-2); }
.layer-col__price { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: var(--space-3); display: block; }
/* connective thread: the argument graph runs beneath all three */
.layer-thread {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--predictive-border);
  border-radius: var(--radius-lg);
  background: var(--predictive-bg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex; align-items: center; gap: var(--space-3);
}
.layer-thread strong { color: var(--predictive-fg); }
.layer-model__arrow { display: none; }
@media (min-width: 820px) {
  .layer-model__arrow {
    display: grid; place-items: center;
    position: absolute; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary); z-index: 2;
  }
}

/* generic feature/media row */
.value-row {
  display: grid; gap: var(--space-6);
  align-items: center;
}
@media (min-width: 820px) { .value-row { grid-template-columns: 1fr 1fr; } .value-row--flip > :first-child { order: 2; } }

/* footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: var(--surface-1);
  margin-top: var(--space-10);
}
.site-footer__inner {
  max-width: var(--content-max); margin-inline: auto;
  padding: var(--space-8) var(--space-4) var(--space-6);
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .site-footer__inner { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-col h4 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-tertiary); margin-bottom: var(--space-3); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.footer-col a { color: var(--text-secondary); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--text-primary); text-decoration: none; }
.site-footer__legal {
  max-width: var(--content-max); margin-inline: auto;
  padding: var(--space-4);
  border-top: 1px solid var(--border-hairline);
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between;
  font-size: var(--text-xs); color: var(--text-tertiary);
}


/* ==========================================================================
   23  PRICING GRID   (§2)
   Structured around the credit system's real shape: free/onboarding tier,
   pay-for-credits tier, and a note that value can be EARNED by contributing.
   tokens: --surface-1/-2, --border-hairline/-strong, --accent-*, --radius-xl,
           --font-mono, --space-*, --text-*
   ========================================================================== */
.price-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 820px) { .price-grid { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.price-card {
  padding: var(--space-5);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.price-card--featured {
  border-color: var(--accent-soft-border);
  background: var(--surface-2);
  box-shadow: var(--glow-command);
}
.price-card__name { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-secondary); }
.price-card__price { font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
.price-card__price small { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-regular); }
.price-card__list { list-style: none; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.price-card__list li { display: flex; gap: var(--space-2); }
.price-card__list svg { width: 15px; height: 15px; color: var(--verified-fg); flex: none; margin-top: 2px; }
/* the "earn, don't only pay" callout */
.price-earn {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--verified-border);
  background: var(--verified-bg);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.price-earn strong { color: var(--verified-fg); }


/* ==========================================================================
   24  SITEMAP · ERROR PAGES   (§2)
   Sitemap: structured link lists per section (historical / present / future /
   about) for traditional SEO + AI-crawler consumption. Not one flat list.
   tokens: --surface-1, --border-hairline, --radius-lg, --space-*, --text-*
   ========================================================================== */
.sitemap-groups { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 720px) { .sitemap-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .sitemap-groups { grid-template-columns: repeat(4, 1fr); } }
.sitemap-group h2 { font-size: var(--text-base); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-hairline); }
.sitemap-group ul { list-style: none; padding: 0; margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.sitemap-group a { font-size: var(--text-sm); color: var(--text-secondary); }
.sitemap-group ul ul { margin-top: var(--space-2); margin-left: var(--space-3); padding-left: var(--space-3); border-left: 1px solid var(--border-hairline); }

.error-page {
  min-height: 70vh;
  display: grid; place-items: center; text-align: center;
  padding: var(--space-6);
}
.error-page__code {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
}
.error-page h1 { margin-top: var(--space-3); }
.error-page p { color: var(--text-secondary); margin-top: var(--space-3); max-width: 46ch; margin-inline: auto; }
.error-page__actions { margin-top: var(--space-5); display: flex; gap: var(--space-2); justify-content: center; }


/* ==========================================================================
   25  TRUST SURFACES   (§5.5)
   Methodology panel (LMSR, calibration, contribution-weight formula) always
   one click away. Transparency note for the deliberately-unpublished
   controller coefficients (§9.6).
   tokens: --surface-1/-2, --border-hairline, --info-*, --radius-lg,
           --font-mono, --space-*, --text-*
   ========================================================================== */
.method-panel { border: 1px solid var(--border-hairline); border-radius: var(--radius-lg); background: var(--surface-1); overflow: hidden; }
.method-panel__item + .method-panel__item { border-top: 1px solid var(--border-hairline); }
.method-panel summary {
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-weight: var(--weight-medium);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  list-style: none;
}
.method-panel summary::-webkit-details-marker { display: none; }
.method-panel summary::after { content: "+"; font-family: var(--font-mono); color: var(--text-tertiary); }
.method-panel details[open] summary::after { content: "\2212"; }
.method-panel__content { padding: 0 var(--space-5) var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); }
.method-panel__content code { font-size: var(--text-xs); background: var(--surface-inset); padding: 0.1em 0.4em; border-radius: var(--radius-xs); }

/* small, honest transparency note (partial opacity is intentional) */
.transparency-note {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.transparency-note svg { width: 15px; height: 15px; color: var(--info-fg); flex: none; margin-top: 1px; }

/* cookie / consent bar (§5.7) */
.cookie-bar {
  position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4);
  z-index: var(--z-toast);
  max-width: 520px; margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center;
  padding: var(--space-4);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.cookie-bar__actions { display: flex; gap: var(--space-2); margin-left: auto; }


/* ==========================================================================
   26  ONBOARDING FORK   (§5.3)
   A fork, not a funnel: "browse the record" vs "contribute in [niche]".
   tokens: --surface-1/-2, --border-hairline/-strong, --accent-soft-*,
           --radius-xl, --space-*, --text-*
   ========================================================================== */
.fork { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .fork { grid-template-columns: 1fr 1fr; } }
.fork__card {
  padding: var(--space-6);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: border-color var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.fork__card:hover { border-color: var(--accent-soft-border); background: var(--surface-2); transform: translateY(-2px); }
.fork__icon { width: 36px; height: 36px; color: var(--accent-400); }
.fork__card h2 { font-size: var(--text-lg); }
.fork__card p { font-size: var(--text-sm); color: var(--text-secondary); flex: 1; }


/* ==========================================================================
   27  LMSR PRICE-IMPACT PREVIEW   (§5.2 / §5.3)
   Shows the implied-probability shift BEFORE the user commits, plus the
   liquidity-parameter transparency note.
   tokens: --surface-inset, --predictive-*, --move-up/-down, --font-mono,
           --radius-md, --space-*, --text-*
   ========================================================================== */
.impact-preview {
  padding: var(--space-4);
  background: var(--surface-inset);
  border: 1px solid var(--predictive-border);
  border-radius: var(--radius-md);
}
.impact-preview__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.impact-preview__row + .impact-preview__row { margin-top: var(--space-2); }
.impact-preview__label { font-size: var(--text-xs); color: var(--text-secondary); }
.impact-preview__val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.impact-preview__from-to {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: var(--weight-semibold);
}
.impact-preview__from-to .arrow { color: var(--text-tertiary); }
.impact-preview__to { color: var(--predictive-fg); }
.impact-preview__note { margin-top: var(--space-3); font-size: var(--text-2xs); color: var(--text-tertiary); display: flex; gap: var(--space-2); }
.impact-preview__note svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }


/* ==========================================================================
   28  ADMIN CONTROL-LOOP PANEL   (§5.6)
   Read-only visibility layer for §9 of the plan. Access-gated, visually
   distinct from the main dashboard (mono-heavy, denser, "instrument panel").
   tokens: --surface-1/-2, --border-hairline, --verified/-warn/-danger,
           --font-mono, --radius-md, --space-*, --text-*
   ========================================================================== */
.admin-shell { border-top: 2px solid var(--warn-border); }
.admin-banner {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--warn-fg);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
}

/* setpoint / sensor grid */
.kpi-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi {
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-left-width: 3px;
  border-radius: var(--radius-md);
}
.kpi__name { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-tertiary); }
.kpi__value { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: var(--weight-semibold); margin-top: var(--space-2); }
.kpi__setpoint { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: 2px; }
.kpi__spark { margin-top: var(--space-3); }
/* status coloring: within band / near band edge / saturated */
.kpi--in-band   { border-left-color: var(--verified-fg); }
.kpi--edge      { border-left-color: var(--warn-fg); }
.kpi--saturated { border-left-color: var(--danger-fg); }
.kpi--in-band .kpi__value   { color: var(--verified-fg); }
.kpi--edge .kpi__value      { color: var(--warn-fg); }
.kpi--saturated .kpi__value { color: var(--danger-fg); }

/* actuator list — current value + recent-change history, read-only */
.actuator-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: var(--text-xs); }
.actuator-table th, .actuator-table td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border-hairline); }
.actuator-table th { color: var(--text-tertiary); text-transform: uppercase; letter-spacing: var(--tracking-wide); font-size: var(--text-2xs); }
.actuator-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actuator-table .delta-up { color: var(--move-up); }
.actuator-table .delta-down { color: var(--move-down); }

/* loop activity log — append-only style list */
.loop-log { list-style: none; padding: 0; border: 1px solid var(--border-hairline); border-radius: var(--radius-md); overflow: hidden; }
.loop-log li {
  display: grid; grid-template-columns: 132px 68px 1fr; gap: var(--space-3);
  align-items: baseline;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-mono); font-size: var(--text-xs);
  border-bottom: 1px solid var(--border-hairline);
}
.loop-log li:last-child { border-bottom: 0; }
.loop-log time { color: var(--text-tertiary); }
.loop-log .msg { color: var(--text-secondary); font-family: var(--font-ui); }
.loop-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.1em 0.4em; border-radius: var(--radius-xs); border: 1px solid transparent; text-align: center;
}
.loop-tag--fast   { color: var(--live-fg); background: var(--live-bg); border-color: var(--live-border); }
.loop-tag--medium { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-border); }
.loop-tag--slow   { color: var(--predictive-fg); background: var(--predictive-bg); border-color: var(--predictive-border); }
/* slow-loop rows requiring human sign-off get a distinct marker (§9.4) */
.loop-log li[data-signoff="required"] .msg::after {
  content: "needs human sign-off";
  margin-left: var(--space-2);
  font-family: var(--font-mono); font-size: 9px;
  color: var(--warn-fg); border: 1px solid var(--warn-border); border-radius: var(--radius-xs);
  padding: 0.05em 0.35em;
}


/* ==========================================================================
   29  MISC: AVATAR · DATA LIST · PAGE HEAD · KEY/VALUE
   tokens: --surface-2/-3, --border-hairline, --font-mono, --space-*, --text-*
   ========================================================================== */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-hairline);
  display: grid; place-items: center;
  font-size: var(--text-xs); color: var(--text-secondary);
  overflow: hidden; flex: none;
}
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-lg); }

/* key/value data list — mono values (they are data) */
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); }
.data-list dt { color: var(--text-tertiary); }
.data-list dd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* app page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.page-head__title { font-size: var(--text-xl); }
.page-head__sub { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* evidence / contribution list row (claim detail) */
.evidence-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: var(--text-sm);
}
.evidence-row:last-child { border-bottom: 0; }
.evidence-row__meta { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-2xs); color: var(--text-tertiary); }
.evidence-row__weight { font-family: var(--font-mono); color: var(--text-secondary); }

/* generic responsive 2-col content + rail */
.with-rail { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .with-rail { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.rail { display: grid; gap: var(--space-4); }
