/* ─────────────────────────────────────────────────────────────────────────
   CATGENT — machine terminal.

   The house colour is acid chartreuse on near-black. It is not decoration:
   at 16.7:1 on this surface it is the highest-contrast thing on the page, so
   it is spent only on live values and system state, never on chrome.

   Polarity is chartreuse (gain) against magenta-red (loss). That pair separates
   at ΔE 28.7 under deuteranopia — where the conventional green/red collapses at
   3.6 — so this palette is legible to colourblind readers by construction
   rather than by mitigation. Signs and ▲/▼ glyphs are still carried on every
   signed value, because a number should never depend on hue alone.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ── The colour ── */
  --acid: #d3ff3e;
  --acid-dim: #a8cc31;
  --acid-glow: rgba(211, 255, 62, 0.22);
  --acid-soft: rgba(211, 255, 62, 0.09);

  --bg: #080b07;
  --surface: #0d110b;
  --surface-2: #131810;
  --surface-3: #1a2116;
  --border: #232d1c;
  --grid: #161d13;

  --ink: #e9f4dc; /* 16.7:1 on the card surface */
  --ink-2: #94a486; /* 7.2:1  */
  /* 5.0:1. The obvious darker grey for this role measured 3.4:1, which is under
     the 4.5:1 body-text minimum — and this token carries real content: chart
     captions, the reason on every passed-over candidate, rejected decisions.
     Muted has to mean quieter, not unreadable. */
  --ink-3: #78886a;

  --up: #d3ff3e;
  --down: #ff2d6f;
  --info: #22d3ee;
  --warn: #ffb020;

  --up-soft: rgba(211, 255, 62, 0.12);
  --down-soft: rgba(255, 45, 111, 0.14);
  --info-soft: rgba(34, 211, 238, 0.12);

  --accent: var(--acid);

  --radius: 4px;
  --radius-sm: 3px;
  --gap: 16px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: var(--mono);

  color-scheme: dark;
}

/* Colour-safe variant: swaps the loss pole to amber, which separates from
   chartreuse on lightness as well as hue. Chartreuse is already CVD-clean, so
   this is a preference rather than a repair. */
:root[data-cvd="on"] {
  --down: #ff9500;
  --down-soft: rgba(255, 149, 0, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Faint engineering grid — one shade off the surface, never competing. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 100%);
}

/* CRT scanlines. Deliberately near-invisible: texture, not a vestibular event. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(211, 255, 62, 0.016) 0 1px,
    transparent 1px 3px
  );
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
}
h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

a {
  color: var(--acid-dim);
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: rgba(8, 11, 7, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acid), transparent);
  opacity: 0.5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 15px;
  color: var(--acid);
  text-shadow: 0 0 18px var(--acid-glow);
}
.brand-sub {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pill {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--acid-soft);
  color: var(--acid);
  border: 1px solid var(--acid-dim);
}
.pill.is-live {
  background: var(--down-soft);
  color: var(--down);
  border-color: var(--down);
  animation: pulse 1.6s steps(2, end) infinite;
}
.pill-quiet {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--border);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.conn i {
  width: 6px;
  height: 6px;
  background: var(--ink-3);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.conn.is-live i {
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
  animation: pulse 1.2s steps(2, end) infinite;
}

.btn {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.12s;
}
.btn:hover {
  border-color: var(--acid-dim);
  color: var(--acid);
}
.btn[aria-pressed="true"] {
  border-color: var(--acid);
  color: var(--acid);
  background: var(--acid-soft);
}
.btn-danger[data-halted="true"] {
  border-color: var(--down);
  color: var(--down);
  background: var(--down-soft);
}

/* X link. Icon plus handle, so it is identifiable without relying on the glyph. */
.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-x svg {
  width: 11px;
  height: 11px;
  display: block;
}
.btn-x:hover {
  border-color: var(--acid);
  color: var(--acid);
  background: var(--acid-soft);
}

/* A pending reward is an instruction, not a statistic — it gets a banner. */
.reward-call {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--acid);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--acid-soft);
}
.reward-call b {
  display: block;
  color: var(--acid);
  font-size: 14px;
  margin-bottom: 4px;
}
.reward-call span {
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ── Docs page ───────────────────────────────────────────────────────────── */

.docs {
  max-width: 900px;
}
.docs-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--acid);
}
.docs-lead {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.docs-lead:last-child {
  margin-bottom: 0;
}
.docs-lead strong {
  color: var(--acid);
}

.docs-flow {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.7;
  color: var(--acid-dim);
  overflow-x: auto;
}

.docs-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 14px;
}
.docs-ladder span {
  flex: 1;
  min-width: 58px;
  text-align: center;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.docs-ladder span:last-child {
  border-color: var(--acid);
  color: var(--acid);
  background: var(--acid-soft);
}

.docs-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.75;
}
.docs-list li {
  margin-bottom: 7px;
}
.docs-list li::marker {
  color: var(--acid);
}
.docs-list b {
  color: var(--ink);
}

.docs-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--acid);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.docs-note b {
  color: var(--acid);
}

.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--acid);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.step b {
  display: block;
  color: var(--acid);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.step span {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.step code,
.docs-note code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--acid-dim);
}

/* ── Contract address bar ────────────────────────────────────────────────── */

.ca-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1440px;
  margin: 12px auto 0;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--acid);
  border-radius: var(--radius);
  background: var(--surface);
}
.ca-label {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}
/* Breaks anywhere so a 42-character address cannot force the page sideways. */
.ca-value {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--acid);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.ca-value.is-empty {
  color: var(--ink-3);
  font-style: italic;
}
.ca-copy,
.ca-link {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ca-copy:hover,
.ca-link:hover {
  border-color: var(--acid);
  color: var(--acid);
}
.ca-copy.is-done {
  border-color: var(--acid);
  color: var(--acid);
  background: var(--acid-soft);
}

@media (max-width: 640px) {
  .ca-bar {
    margin-left: 12px;
    margin-right: 12px;
  }
  .btn-x span {
    display: none;
  }
}

.banner {
  position: relative;
  z-index: 1;
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--down);
  border-left-width: 3px;
  background: var(--down-soft);
  color: var(--ink);
  font-size: 12px;
}
.banner.is-warn {
  border-color: var(--warn);
  background: rgba(255, 176, 32, 0.1);
}
.banner div::before {
  content: "! ";
  color: var(--down);
  font-weight: 700;
}
.banner.is-warn div::before {
  color: var(--warn);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

main {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 20px 50px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Cards are instrument panels: square, bracketed at the corners, no shadow. */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--acid-dim);
  opacity: 0.55;
  pointer-events: none;
}
.card::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.card::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--grid);
}
.card-head h2::before {
  content: "▚ ";
  color: var(--acid);
  opacity: 0.75;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 1000px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  font-weight: 500;
}

.chip {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--acid-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.hint {
  margin: 0 0 11px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

.empty {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
  padding: 20px;
  letter-spacing: 0.06em;
}
.empty::before {
  content: "// ";
  color: var(--acid-dim);
}

/* ── The cat ─────────────────────────────────────────────────────────────── */

.catbay {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  min-width: 260px;
}

.cat-frame {
  position: relative;
  width: 86px;
  height: 86px;
  flex: none;
}
.cat-frame svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 12px var(--acid-glow));
}

.cat-status {
  min-width: 0;
}
.cat-state {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acid);
}
.cat-say {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.5;
  min-height: 2.6em;
}
.cat-say::before {
  content: "> ";
  color: var(--acid);
}
.caret {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--acid);
  vertical-align: -1px;
  animation: blink 1.05s steps(2, end) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Eye animations, driven by the cat's state class. */
.cat-pupil {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-cat="scan"] .cat-pupil {
  animation: scan 2.8s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
}
[data-cat="hunt"] .cat-pupil {
  animation: dilate 0.7s ease-in-out infinite alternate;
}
@keyframes dilate {
  from { transform: scale(1); }
  to { transform: scale(1.35); }
}
.cat-antenna-tip {
  animation: blink 1.8s steps(2, end) infinite;
}
[data-cat="halt"] .cat-antenna-tip,
[data-cat="offline"] .cat-antenna-tip {
  animation: none;
  opacity: 0.3;
}
.cat-ear {
  transform-origin: center bottom;
}
[data-cat="hunt"] .cat-ear,
[data-cat="win"] .cat-ear {
  animation: twitch 2.4s ease-in-out infinite;
}
@keyframes twitch {
  0%, 88%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-7deg); }
  96% { transform: rotate(5deg); }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hero-figure {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin-top: 4px;
  color: var(--acid);
  text-shadow: 0 0 26px var(--acid-glow);
  font-variant-numeric: proportional-nums;
}
.hero-delta {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.goal {
  min-width: 250px;
  flex: 1;
  max-width: 400px;
}
.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.goal-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--acid);
  font-variant-numeric: tabular-nums;
}
/* Segmented readout rather than a smooth bar — it should look metered. */
.goal-track {
  height: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.goal-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 5px, var(--surface) 5px 7px);
  pointer-events: none;
}
.goal-fill {
  height: 100%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid-glow);
  width: 0;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 2px;
}
.goal-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Milestone ladder: every rung visible, so progress has a shape rather than
   being one bar that barely moves for months. */
.ladder {
  display: flex;
  gap: 3px;
  margin-top: 9px;
}
.rung {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
}
.rung.is-done {
  background: var(--acid);
  border-color: var(--acid);
  box-shadow: 0 0 8px var(--acid-glow);
}
.rung.is-current {
  border-color: var(--acid);
}
.rung.is-current::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--acid);
  opacity: 0.35;
}

.wallet-split {
  min-width: 226px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: var(--surface-2);
}
.wallet-split .label {
  margin-bottom: 7px;
}
.ws-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 3px 0;
}
.ws-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ws-quiet {
  border-top: 1px solid var(--grid);
  margin-top: 5px;
  padding-top: 6px;
  font-size: 10.5px;
}

.ranges {
  display: flex;
  gap: 3px;
  align-self: flex-start;
}
.range {
  padding: 4px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.range:hover {
  color: var(--ink);
}
.range.is-active {
  background: var(--acid-soft);
  color: var(--acid);
  border-color: var(--acid-dim);
}

/* ── Charts ──────────────────────────────────────────────────────────────── */

.chart-figure {
  margin: 0;
}
.chart {
  position: relative;
  width: 100%;
  height: 262px;
}
.chart-short {
  height: 152px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.caption {
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.caption::before {
  content: "// ";
  color: var(--acid-dim);
}

.tip {
  position: absolute;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--acid-dim);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.1s;
}
.tip.is-on {
  opacity: 1;
}
.tip b {
  display: block;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--acid);
}
.tip b.down {
  color: var(--down);
}
.tip span {
  color: var(--ink-3);
  font-size: 10px;
}

/* ── Tiles ───────────────────────────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--acid);
  opacity: 0.45;
}
.tile .label {
  margin-bottom: 5px;
}
.tile-val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.005em;
  font-variant-numeric: proportional-nums;
}
.tile-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tbl th {
  text-align: left;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
  font-weight: 500;
  padding: 0 9px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 9px;
  border-bottom: 1px solid var(--grid);
  vertical-align: middle;
}
.tbl tbody tr:last-child td {
  border-bottom: none;
}
.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tbl-click tbody tr.row-main {
  cursor: pointer;
}
.tbl-click tbody tr.row-main:hover {
  background: var(--acid-soft);
}
.tbl-click tbody tr.row-main:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--acid);
}

.sym {
  font-weight: 700;
  letter-spacing: 0.04em;
}
.addr {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
}
.addr a {
  color: inherit;
  text-decoration: none;
}
.addr a:hover {
  color: var(--acid);
}

.side {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.side-buy {
  background: var(--up-soft);
  color: var(--up);
  border-color: var(--acid-dim);
}
.side-sell {
  background: var(--down-soft);
  color: var(--down);
  border-color: var(--down);
}

.up {
  color: var(--up);
}
.down {
  color: var(--down);
}
.flat {
  color: var(--ink-2);
}

.why {
  color: var(--ink-2);
  font-size: 11.5px;
  max-width: 340px;
}

/* Expanded rationale */
.row-detail td {
  background: var(--surface-2);
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.detail-inner {
  padding: 15px 17px 17px;
  border-left: 2px solid var(--acid);
}
.detail-head {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 13px;
  line-height: 1.65;
}
.detail-head b {
  color: var(--acid);
}
.factors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.factor {
  display: grid;
  grid-template-columns: 148px 1fr auto;
  gap: 11px;
  align-items: center;
  font-size: 11.5px;
}
.factor-name {
  color: var(--ink-2);
  letter-spacing: 0.03em;
}
.factor-track {
  height: 7px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow: hidden;
}
.factor-fill {
  height: 100%;
  background: var(--acid);
  opacity: 0.85;
}
.factor-note {
  color: var(--ink-3);
  font-size: 10.5px;
  grid-column: 2 / -1;
  margin-top: -3px;
}
.factor-pts {
  font-variant-numeric: tabular-nums;
  color: var(--acid-dim);
  min-width: 54px;
  text-align: right;
}
.veto {
  margin-top: 11px;
  padding: 8px 11px;
  border: 1px solid var(--down);
  border-left-width: 3px;
  background: var(--down-soft);
  color: var(--ink);
  font-size: 11.5px;
}
.veto b {
  color: var(--down);
  letter-spacing: 0.1em;
}

/* ── Shortlist ───────────────────────────────────────────────────────────── */

.shortlist {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
}
.watch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-left-width: 2px;
  background: var(--surface-2);
}
.watch.is-pass {
  border-color: var(--acid);
  background: var(--acid-soft);
}
.watch-score {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  color: var(--ink-3);
}
.watch.is-pass .watch-score {
  color: var(--acid);
  text-shadow: 0 0 14px var(--acid-glow);
}
.watch-sym {
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}
.watch-why {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
}
/* Observation-only: scored every tick, structurally unable to be entered. */
.watch.is-observing {
  border-color: var(--info);
  border-left-width: 2px;
  background: var(--info-soft);
}
.watch.is-observing .watch-score {
  color: var(--info);
}
.obs {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--info);
  border: 1px solid var(--info);
  border-radius: var(--radius-sm);
  vertical-align: 1px;
}

.watch-meta {
  text-align: right;
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Stat grid ───────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
}
.stat-val {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: proportional-nums;
}

/* ── Feed ────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 3px;
}
.tab {
  padding: 4px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tab.is-active {
  background: var(--acid-soft);
  color: var(--acid);
  border-color: var(--acid-dim);
}

.feed {
  max-height: 470px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.feed-row {
  display: grid;
  grid-template-columns: 58px auto 1fr;
  gap: 9px;
  padding: 6px 3px;
  border-bottom: 1px solid var(--grid);
  font-size: 11.5px;
  align-items: baseline;
}
.feed-row:last-child {
  border-bottom: none;
}
.feed-time {
  color: var(--ink-3);
  font-size: 10px;
}
.feed-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 1px 6px;
  border: 1px solid var(--border);
  color: var(--ink-3);
  white-space: nowrap;
}
.feed-tag.t-enter {
  border-color: var(--acid-dim);
  color: var(--acid);
}
.feed-tag.t-exit {
  border-color: var(--down);
  color: var(--down);
}
.feed-tag.t-error {
  border-color: var(--down);
  color: var(--down);
  background: var(--down-soft);
}
.feed-tag.t-warn {
  border-color: var(--warn);
  color: var(--warn);
}
.feed-msg {
  color: var(--ink-2);
  line-height: 1.5;
}
.feed-row.is-rejected .feed-msg {
  color: var(--ink-3);
}

/* ── Boot overlay ────────────────────────────────────────────────────────── */

.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.boot.is-done {
  opacity: 0;
  pointer-events: none;
}
.boot-inner {
  width: min(560px, 88vw);
  font-size: 12px;
  line-height: 1.9;
  color: var(--acid);
}
.boot-line {
  white-space: pre-wrap;
}
.boot-line .ok {
  color: var(--ink-2);
}

/* ── Setup ───────────────────────────────────────────────────────────────── */

.setup {
  max-width: 600px;
  margin: 36px auto;
}
.setup h2 {
  font-size: 15px;
  margin-bottom: 9px;
  color: var(--acid);
}
.setup-row {
  margin-bottom: 12px;
}
.setup-row label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.setup-row label .addr {
  display: inline;
  text-transform: none;
  letter-spacing: 0;
}
.setup-row input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--acid);
  font: inherit;
  font-size: 12.5px;
}
.setup-row input:focus {
  outline: none;
  border-color: var(--acid);
  box-shadow: 0 0 0 2px var(--acid-soft);
}
.setup-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
}
.btn-go {
  background: var(--acid);
  border-color: var(--acid);
  color: #0a0f04;
  font-weight: 700;
  padding: 7px 18px;
}
.btn-go:hover {
  background: var(--acid);
  color: #0a0f04;
  box-shadow: 0 0 18px var(--acid-glow);
}
.setup code {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  color: var(--acid-dim);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 10.5px;
  padding-top: 4px;
  border-top: 1px solid var(--grid);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.foot-warn {
  max-width: 620px;
  text-align: right;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 1px solid var(--border);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--acid-dim);
}

::selection {
  background: var(--acid);
  color: #0a0f04;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  body::after {
    display: none;
  }
}
