/* ══════════════════════════════════════════════════════════════════════════
   Batch — base + component layer.

   Ported from the handoff's design system rather than copied: the structural
   rules are the system's (square corners, transparent cards, hairline frames,
   one accent), the values all come from tokens.css. No literal colour, font
   or radius appears below.
   ══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

p { margin: 0 0 var(--space-3); }

a { color: var(--color-accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }

/* Focus is always ours, never the browser's. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── mono voice ───────────────────────────────────────────────────────────
   Every uppercase label, numeral, timestamp and address. The single most
   characteristic detail of the theme. */
.mono { font-family: var(--font-mono); font-weight: 400; }
.fig  { font-family: var(--font-mono); font-weight: 400; font-variant-numeric: tabular-nums; }

.kicker {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-kicker);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.kicker-accent { color: var(--color-accent-700); }
.kicker-sm { font-size: 10px; letter-spacing: 0.08em; }

.pos { color: var(--color-positive); }
.neg { color: var(--color-negative); }
.muted { color: var(--color-muted); }
.text-muted { color: var(--color-muted); }

/* ── the registration-mark frame ──────────────────────────────────────────
   Four 11×11px crosshairs inset 6px outside each corner. Produced by one
   wrapper (see js/ui/panel.js); never hand-placed per instance. */
.panel {
  position: relative;
  border: var(--border);
  border-radius: var(--radius);
  background: transparent;
}
.panel > .mark {
  position: absolute;
  width: var(--mark-size);
  height: var(--mark-size);
  color: var(--mark-color);
  pointer-events: none;
}
.panel > .mark::before,
.panel > .mark::after { content: ""; position: absolute; background: currentColor; }
.panel > .mark::before { left: 5px; top: 0; width: 1px; height: 100%; }
.panel > .mark::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.panel > .mark-tl { top: var(--mark-inset); left: var(--mark-inset); }
.panel > .mark-tr { top: var(--mark-inset); right: var(--mark-inset); }
.panel > .mark-bl { bottom: var(--mark-inset); left: var(--mark-inset); }
.panel > .mark-br { bottom: var(--mark-inset); right: var(--mark-inset); }

/* ── buttons ─────────────────────────────────────────────────────────────
   The solid accent primary is the only filled object in the system. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  padding: var(--space-2) calc(var(--space-3) * 1.2);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
.btn-primary:hover:not(:disabled) { background: var(--color-accent-600); border-color: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active:not(:disabled) { background: var(--color-accent-700); border-color: var(--color-accent-700); }
.btn-secondary:hover:not(:disabled) { background: var(--color-hover-wash); color: var(--color-text); }
.btn-secondary:active:not(:disabled) { background: var(--color-active-wash); }
.btn-block { width: 100%; }

/* ── inputs ─────────────────────────────────────────────────────────────── */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px;
  font-family: var(--font-body); font-size: 14px;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
}
.input::placeholder { color: var(--color-muted); }
.input:hover { border-color: var(--color-input-hover); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }

/* ── segmented control ────────────────────────────────────────────────────
   One bordered strip, options divided by 1px rules. */
.seg {
  display: inline-flex;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
  font-family: var(--font-body); color: var(--color-text);
  background: transparent; border: 0;
  border-radius: var(--radius);
}
.seg-opt + .seg-opt { border-left: var(--border); }
.seg-opt[aria-checked="true"] { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not([aria-checked="true"]):hover { background: var(--color-hover-wash); }
.seg-opt:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* ── tags ────────────────────────────────────────────────────────────────
   Tags carry meaning (PASS, AGED, REBALANCE) — content, not decoration. */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-weight: 400;
  font-size: 11px; line-height: 1.3; letter-spacing: 0.07em;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
}
.tag-accent  { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border-color: var(--color-accent); color: var(--color-accent); }

/* ── cards ───────────────────────────────────────────────────────────────
   Transparent line drawings. No fill, no shadow, no radius. */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3);
  background: transparent;
  border: var(--border);
  border-radius: var(--radius);
  color: inherit;
}
a.card:hover { border-color: var(--color-input-hover); color: inherit; }
.card-featured { outline: 1px solid var(--color-accent); }
.card-kicker {
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-accent-700);
}
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--fs-card-title); line-height: 1.2;
  letter-spacing: -0.015em;
}
.card-body { margin: 0; font-size: 13px; line-height: 1.5; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; font-family: var(--font-mono); font-size: 11px;
  color: var(--color-muted);
}

/* ── tables ─────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
.table th {
  text-align: left;
  font-family: var(--font-mono); font-weight: 400;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-muted);
  padding: var(--space-2);
  border-bottom: var(--border);
  white-space: nowrap;
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-rule);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--color-row-hover); }
.table tbody tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 17px; }
.table-scroll { overflow-x: auto; }

/* ── stat plate ──────────────────────────────────────────────────────────
   A single bordered row of equal cells divided by 1px rules. */
.stat-plate { display: flex; border: var(--border); }
.stat-plate > .stat { flex: 1; padding: 16px 18px; border-right: var(--border); }
.stat-plate > .stat:last-child { border-right: 0; }
.stat-plate.is-tight > .stat { padding: 12px 14px; }
.stat-value {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--fs-stat); line-height: 1; letter-spacing: -0.015em;
}
.stat-label {
  font-family: var(--font-mono); font-size: 10px; line-height: 1.4;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-muted); margin-top: 4px;
}

/* ── rule grid ───────────────────────────────────────────────────────────
   Cells separated by 1px gaps over a rule-coloured ground, so the gaps read
   as hairlines. Used by "how it works", the roadmap and the holder stats. */
.rule-grid {
  display: grid; gap: 1px;
  background: var(--color-divider);
  border: var(--border);
}
.rule-grid > * { background: var(--color-bg); }

/* ── weight bar ──────────────────────────────────────────────────────────
   Stacked segments, darkest step = largest holding. Ties each row of the
   composition table to its slice by colour. */
.weight-bar { display: flex; width: 100%; overflow: hidden; }
.weight-bar > span { display: block; height: 100%; }
.swatch { display: block; width: 12px; height: 12px; }

/* ── the live indicator ──────────────────────────────────────────────────
   Pulses .35 → 1 → .35 over 2.2s; held at full opacity when the viewer has
   asked for reduced motion. */
.live-dot {
  display: inline-block; width: 7px; height: 7px; flex: none;
  background: var(--color-accent);
  animation: batch-pulse 2.2s infinite;
}
.live-dot-sm { width: 6px; height: 6px; }
@keyframes batch-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; opacity: 1; }
}

/* ── charts ─────────────────────────────────────────────────────────────── */
.chart-svg { display: block; width: 100%; }
.chart-axis {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--color-muted);
  margin-top: 8px;
}
/* Range changes cross-fade the path rather than redrawing hard. */
.chart-path { transition: opacity 180ms ease; }
@media (prefers-reduced-motion: reduce) { .chart-path { transition: none; } }
