/* ─────────────────────────────────────────────────────────────────────────
   Hyperliquid Bot Dashboard — "Stripe Cool Slate"
   Dark, three-level surface hierarchy, blue primary, green/red for PnL.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── Reset + tokens ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surface hierarchy — three clear levels */
  --bg:         #0a0f1a;   /* page */
  --surface:    #121826;   /* cards, panels */
  --surface-2:  #1a2236;   /* elevated / hover */
  --surface-3:  #232d44;   /* tooltips, highest */

  /* Borders */
  --border:     #1f2940;
  --border-2:   #2d3a55;

  /* Text */
  --text:       #e8edf5;
  --text-2:     #c2cbdc;
  --muted:      #8b95ad;
  --muted-2:    #5a6378;

  /* Signals */
  --green:      #10b981;
  --green-2:    #34d399;
  --green-bg:   rgba(16, 185, 129, 0.12);
  --red:        #ef4444;
  --red-2:      #f87171;
  --red-bg:     rgba(239, 68, 68, 0.12);
  --yellow:     #f59e0b;
  --yellow-bg:  rgba(245, 158, 11, 0.12);

  /* Primary accent (blue) */
  --primary:    #3b82f6;
  --primary-2:  #60a5fa;
  --primary-bg: rgba(59, 130, 246, 0.12);

  /* Spacing scale — used consistently */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow:    0 1px 3px rgba(0,0,0,.30), 0 1px 2px rgba(0,0,0,.20);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.40), 0 4px 8px rgba(0,0,0,.30);

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* Transitions */
  --t-fast:    120ms cubic-bezier(.2,.7,.3,1);
  --t-base:    180ms cubic-bezier(.2,.7,.3,1);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11"; /* nicer Inter glyphs */
}

/* Subtle background texture: faint radial highlight up top */
body {
  background-image:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(59,130,246,0.06), transparent 60%),
    radial-gradient(ellipse 800px 400px at 90% 110%, rgba(16,185,129,0.04), transparent 60%);
  background-attachment: fixed;
}

::selection { background: var(--primary-bg); color: var(--text); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ─── Utilities ───────────────────────────────────────────────────────── */
.mono, code {
  font-family: var(--font-mono);
  font-size: 0.93em;
  font-feature-settings: "tnum", "zero";
}
.muted    { color: var(--muted); }
.center   { text-align: center; }
.r        { text-align: right; }
.small    { font-size: 12px; }
.positive { color: var(--green-2); }
.negative { color: var(--red-2); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

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

/* ─── Top nav ─────────────────────────────────────────────────────────── */
header.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: rgba(10, 15, 26, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.25), 0 2px 8px rgba(59,130,246,0.25);
}
.brand-name { font-size: 14px; letter-spacing: -0.01em; color: var(--text); }
.brand-name .dim { color: var(--muted); font-weight: 500; }

header.topnav nav { display: flex; gap: var(--space-1); }
header.topnav nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
}
header.topnav nav a:hover { color: var(--text); background: var(--surface); }
header.topnav nav a.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Right-side controls: language toggle + logout button */
.topnav-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.lang-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-2);
}
.lang-current { color: var(--text); }
.lang-sep { color: var(--muted-2); }
.lang-other { color: var(--muted); }

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.btn-logout:hover {
  color: var(--red);
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3);
}
.logout-icon { font-size: 14px; line-height: 1; }
@media (max-width: 700px) {
  .logout-label { display: none; }
  .btn-logout { padding: 5px 10px; }
}

main {
  padding: var(--space-6) var(--space-6) var(--space-7);
  max-width: 1320px;
  margin: 0 auto;
}

footer {
  padding: var(--space-4) var(--space-6);
  margin-top: var(--space-7);
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Landing ─────────────────────────────────────────────────────────── */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-6);
  gap: var(--space-6);
  flex-wrap: wrap;
}
.landing-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.landing-header p.muted { margin-top: var(--space-1); font-size: 13px; }

.combined-stats { display: flex; gap: var(--space-3); }
.combined-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  transition: border-color var(--t-fast);
}
.combined-stats .stat:hover { border-color: var(--border-2); }

.stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.stat-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--text);
}

.bot-grid {
  display: grid;
  /* Wider, more readable cards. min(480px) means at full-HD width the
     grid usually shows 2 columns instead of 3, giving each card ~50%
     more horizontal room — equity, strategy chips and the 7-d chart
     all breathe. Mobile media query at the bottom still collapses to
     1 column under 768 px. */
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
}

/* v2: breathing room between the combined-equity header and the bot cards. */
.overview-head { margin-bottom: var(--space-5); }
#bot-grid { margin-top: var(--space-6, 32px); }

/* ─── Bot card ────────────────────────────────────────────────────────── */
.bot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-base), background var(--t-base), box-shadow var(--t-base);
}
.bot-card::before {
  /* Status accent bar — left edge */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--muted-2);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.bot-card.live::before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(16,185,129,0.5);
}
.bot-card.idle::before { background: var(--muted-2); }
.bot-card:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
.card-id { display: flex; align-items: center; gap: var(--space-2); }
.bot-name {
  font-family: var(--font-mono);
  font-weight: 600;
  /* Bumped 14 → 16 px to match the wider card scale. */
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.sym-pill {
  padding: 2px var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sym-pill.sym-universe {
  /* Universe-mode bot: stand out from the single-symbol pills. */
  background: linear-gradient(90deg, rgba(59,130,246,0.18), rgba(139,92,246,0.18));
  border-color: rgba(99,102,241,0.5);
  color: var(--text);
}
.auto-countdown {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-left: 2px;
}

.bot-roadmap-empty {
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-style: italic;
}

/* Roadmap "Bot #N" pill — same gradient as universe-pill so a user
   can visually associate the per-bot section heading with the bot
   card. Stays compact (e.g. "Bot #3") next to the bot_id mono text. */
.bot-number-badge {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(90deg, rgba(59,130,246,0.20), rgba(139,92,246,0.20));
  border: 1px solid rgba(99,102,241,0.5);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-right: var(--space-2);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  display: inline-block;
  flex-shrink: 0;
}
.bot-card.live .status-dot, .status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
.bot-card.idle .status-dot, .status-dot.idle { background: var(--muted-2); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
  50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0.05); }
}

/* Big Status+Toggle Button (2026-05-28, replaces the old .bot-status-pill +
   small .btn-pause/.btn-start). Combines run-state indicator and pause/start
   action into one large clickable element at the bottom of every bot card.
   Green and pulsing while the bot is running, red while stopped.

   States driven by Jinja-rendered classes:
     .big-toggle-on  → bot is enabled in yaml
     .big-toggle-off → bot is disabled
   Plus the parent .bot-card.live / .idle / .disabled classes (set by Jinja
   on first render AND re-toggled by refreshStats() every 30 s) decide
   whether the LED pulses.
*/
.big-toggle {
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  transition: background var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.big-toggle:hover { transform: translateY(-1px); }
.big-toggle:active { transform: translateY(0); }

/* LED on the left — circular, big enough to read at a glance. */
.big-toggle-led {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  flex-shrink: 0;
}

/* Two-line text in the middle: big label (status) + small action hint. */
.big-toggle-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.big-toggle-action {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* 3-state label swap (v1.0.7): only the label matching the current
   toggle state is visible. Default = all hidden, then the active state
   class makes its labels visible. */
.big-toggle .bt-label-on,    .big-toggle .bt-action-on,
.big-toggle .bt-label-stalled, .big-toggle .bt-action-stalled,
.big-toggle .bt-label-off,    .big-toggle .bt-action-off { display: none; }

.big-toggle-on .bt-label-on,           .big-toggle-on .bt-action-on            { display: inline; }
.big-toggle-stalled .bt-label-stalled, .big-toggle-stalled .bt-action-stalled  { display: inline; }
.big-toggle-off .bt-label-off,         .big-toggle-off .bt-action-off          { display: inline; }

/* Colour scheme:
     ON      = GREEN  (bot ticking, all good)
     STALLED = ORANGE (enabled but no recent tick — operator should know)
     OFF     = RED    (intentionally paused)
*/
.big-toggle-on {
  background: linear-gradient(135deg,
              rgba(16,185,129,0.18),
              rgba(16,185,129,0.10));
  border-color: rgba(16,185,129,0.55);
  color: var(--green);
}
.big-toggle-on:hover {
  background: linear-gradient(135deg,
              rgba(16,185,129,0.25),
              rgba(16,185,129,0.14));
  box-shadow: 0 0 24px rgba(16,185,129,0.25);
}

.big-toggle-stalled {
  background: linear-gradient(135deg,
              rgba(245,158,11,0.18),
              rgba(245,158,11,0.10));
  border-color: rgba(245,158,11,0.55);
  color: #f59e0b;
}
.big-toggle-stalled:hover {
  background: linear-gradient(135deg,
              rgba(245,158,11,0.26),
              rgba(245,158,11,0.14));
  box-shadow: 0 0 24px rgba(245,158,11,0.25);
}

.big-toggle-off {
  background: linear-gradient(135deg,
              rgba(239,68,68,0.16),
              rgba(239,68,68,0.08));
  border-color: rgba(239,68,68,0.45);
  color: #ef4444;
}
.big-toggle-off:hover {
  background: linear-gradient(135deg,
              rgba(239,68,68,0.24),
              rgba(239,68,68,0.12));
  box-shadow: 0 0 24px rgba(239,68,68,0.22);
}

/* LED pulses ONLY in the ON state (genuinely live + enabled). */
.big-toggle-on .big-toggle-led {
  animation: big-toggle-pulse 2.4s ease-in-out infinite;
}
@keyframes big-toggle-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(16,185,129,0.6); }
  50%      { box-shadow: 0 0 22px rgba(16,185,129,0.95); }
}
/* STALLED LED is a slow orange "heartbeat" — still moving but visibly
   off-rhythm vs the live pulse so the operator notices something is wrong. */
.big-toggle-stalled .big-toggle-led {
  animation: big-toggle-stalled-pulse 3.6s ease-in-out infinite;
}
@keyframes big-toggle-stalled-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,0.45); }
  50%      { box-shadow: 0 0 16px rgba(245,158,11,0.7); }
}
.chevron {
  font-size: 22px;
  color: var(--muted-2);
  line-height: 1;
  transition: transform var(--t-fast), color var(--t-fast);
}
.bot-card:hover .chevron { transform: translateX(4px); color: var(--text); }

.card-equity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.big-eq {
  /* Hero number of the card; tabular-nums keeps wide cards aligned. */
  font-size: 27px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.03em;
  color: var(--text);
}
.pnl {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

.sparkline-wrap { height: 56px; margin: var(--space-2) 0 var(--space-4); }
/* Per-bot 7-day equity chart. Taller (130 → 200 px) so the trend
   shape is readable at a glance and the date axis labels don't crowd
   the data points. */
.card-chart-wrap {
  height: 200px;
  margin: var(--space-2) 0 var(--space-4);
  position: relative;
}
.card-chart { width: 100% !important; height: 100% !important; }
canvas.sparkline { width: 100% !important; height: 56px !important; }

.micro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 6 stats → clean 2×3 */
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.micro-val.positive { color: var(--green); }
.micro-val.negative { color: var(--red); }

/* Plain-language helpers for the layperson overview (2026-06-16). */
.eq-label {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 2px;
}
.verdict-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
}
.verdict-badge.v-good    { background: rgba(16,185,129,0.14); color: var(--green); border: 1px solid rgba(16,185,129,0.30); }
.verdict-badge.v-bad     { background: rgba(239,68,68,0.14);  color: var(--red);   border: 1px solid rgba(239,68,68,0.30); }
.verdict-badge.v-neutral { background: var(--surface-2);      color: var(--muted); border: 1px solid var(--border); }
.micro-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.micro-label {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.micro-val {
  /* Bumped 13 → 15 px to match the new card scale. */
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--text);
}

.card-foot {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--muted);
  /* 2026-05-28: switched from horizontal flex (pnl + small button) to a
     vertical stack so the new full-width big-toggle can breathe. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}
.pnl-since { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.toggle-form { width: 100%; }

/* Bot ordering chip — #1, #2, ... shown alongside the bot_id */
.bot-order {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  margin-right: 2px;
}

/* Side filter pill (long/short) shown beside the symbol */
.side-pill {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.side-pill.side-1  { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.side-pill.side--1 { background: rgba(239,68,68,0.12);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.side-pill.side-0  { background: var(--surface-2);      color: var(--muted); }

/* Strategies row: which strategy mix this bot trades */
.strategies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-4);
}
.strategy-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
}

/* The card body is now a separate <a> so the Start/Pause button doesn't
   navigate. Inherits all .bot-card layout/spacing. Padding bumped to
   space-6 (from space-5) so the wider cards keep proportional inner
   breathing room — the content shouldn't hug the borders. */
.bot-card { padding: 0; }
.card-body {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  padding-bottom: var(--space-4);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.bot-card .card-foot {
  padding: var(--space-4) var(--space-6);
  margin-top: 0;
}
.bot-card.disabled { opacity: 0.55; }
.bot-card.disabled::before { background: var(--muted-2); animation: none; box-shadow: none; }

/* Start/Pause button */
.toggle-form { margin: 0; }
.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--surface); border-color: var(--border-2); transform: translateY(-1px); }
/* Charge 10 audit (2026-05-28): .btn-pause and .btn-start removed — the
   old separate pause/start buttons were merged into .big-toggle in
   v1.0.7 and no template selects these classes any more. */

/* Charge 11 audit (2026-05-28): .hidden utility class — was being toggled
   by the auto-refresh JS to dismiss the per-bot error banner when a
   bot's ERROR scrolled out of the 15-min window, but the class was
   never defined in CSS, so the banner stayed visible until a full
   reload. Important: !important so it beats specific selectors like
   .bot-error-banner. */
.hidden { display: none !important; }

/* ─── Strategy toggle panel (bot detail) ─────────────────────────────── */
.strategy-toggle-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.strategy-grid {
  display: grid;
  /* Increased min-width from 280→340px so the strategy description
     fits without truncation (user feedback 2026-05-27). On narrow
     screens the grid still re-flows because of auto-fill. */
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-2);
}
.strategy-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.strategy-row:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.strategy-row.enabled {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.4);
}
.strategy-row.incompatible {
  opacity: 0.45;
  cursor: not-allowed;
}
.strategy-row.incompatible:hover {
  background: var(--surface);
  border-color: var(--border);
}
.strategy-row input[type="checkbox"] {
  margin: 3px 0 0 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.strategy-row.incompatible input[type="checkbox"] { cursor: not-allowed; }
.strategy-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.strategy-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.strategy-name {
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
.strategy-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}
.strategy-warn {
  font-size: 11px;
  color: var(--amber, #f59e0b);
  margin-top: 2px;
}
.strategy-toggle-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border);
}

/* ─── Global Market Overview Bar ─────────────────────────────────────── */
.market-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.market-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border);
  min-width: 0;
}
.market-cell:last-child { border-right: none; }
.mb-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.mb-value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.mb-sub {
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}
.mb-fg-fear  { color: var(--red); }
.mb-fg-greed { color: var(--green); }
.mb-fg-mid   { color: var(--amber, #f59e0b); }

/* Crypto-RSI cell: oversold <30, overbought >70, neutral in between. Mirror the F&G palette so the eye reads them the same way. */
.mb-rsi-oversold   { color: var(--green); }    /* oversold → bounce setup, often a buy zone */
.mb-rsi-overbought { color: var(--red); }
.mb-rsi-mid        { color: var(--muted-2); }

/* Per-bot error banner on the overview card. Orange = warnings only, red = ERROR-level. Sits between the strategy chips and the equity line so it shows up immediately when the operator scans the grid. */
.bot-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 4px 0 8px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber, #f59e0b);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.bot-error-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.45);
}
.bot-error-icon { font-size: 13px; }
.bot-error-text { flex: 1; }
.bot-error-count {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 11px;
  opacity: 0.85;
}
.mb-event-name {
  font-size: 12px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mb-xa-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 11px;
}
.mb-xa-row > span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.mb-xa-tag {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.mb-funding-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 11px;
}
.mb-funding-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 4px;
  align-items: baseline;
}

/* ─── Drag-and-drop reorder ──────────────────────────────────────────── */
.bot-card { position: relative; }
.drag-handle {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 14px;
  color: var(--muted-2);
  cursor: grab;
  user-select: none;
  letter-spacing: -3px;
  z-index: 5;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color var(--t-fast), background var(--t-fast);
}
.drag-handle:hover { color: var(--text); background: var(--surface-2); }
.drag-handle:active { cursor: grabbing; }
.card-ghost {
  opacity: 0.35;
  background: var(--surface-2);
  border: 2px dashed var(--primary);
}
.card-chosen {
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 2px var(--primary);
  transform: rotate(0.5deg);
}
.drag-hint {
  color: var(--muted-2);
  font-size: 12px;
  margin-left: var(--space-2);
}

/* ─── Runtime row + "active since" ───────────────────────────────────── */
.runtime-row {
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
}
.runtime-row strong {
  color: var(--text-2);
  font-weight: 600;
  margin-right: 4px;
}

/* ─── Per-bot notional input ─────────────────────────────────────────── */
.notional-form {
  padding: var(--space-2) var(--space-5);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.notional-form .micro-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.notional-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.notional-input {
  width: 80px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.notional-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}
.notional-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* ─── Per-bot editable display name ──────────────────────────────────── */
.display-name-form {
  padding: var(--space-2) var(--space-5);
  background: var(--surface-2);
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.display-name-input-wrap {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.display-name-input {
  flex: 1;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 11px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.display-name-input::placeholder { color: var(--muted-2); font-style: italic; }
.display-name-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}
.bot-id-sub {
  font-size: 10px;
  margin-left: var(--space-2);
  opacity: 0.7;
}

/* ─── Per-bot notes textarea ─────────────────────────────────────────── */
.notes-form {
  padding: var(--space-2) var(--space-5);
  background: var(--surface-2);
  border-top: 1px dashed var(--border);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.notes-textarea {
  flex: 1;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 11px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  min-height: 32px;
}
.notes-textarea::placeholder { color: var(--muted-2); font-style: italic; }
.notes-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

.btn-tiny {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  align-self: stretch;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.btn-tiny:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--primary);
}

/* ─── Refresh controls in the landing header ─────────────────────────── */
.refresh-controls {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-left: var(--space-3);
}
.btn-refresh {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.btn-refresh:hover { color: var(--text); background: var(--surface-2); }
.btn-refresh[data-state="off"] { color: var(--muted-2); opacity: 0.7; }

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-2);
}
.empty-state code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ─── Detail page ─────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb .current { color: var(--text-2); font-family: var(--font-mono); font-weight: 600; }
.breadcrumb a:hover { color: var(--text); }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-5);
  gap: var(--space-6);
  flex-wrap: wrap;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.detail-id { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.detail-id h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.detail-stats { display: flex; gap: var(--space-5); }
.detail-stats .stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-end;
}
.detail-stats .stat-value { font-size: 17px; }
.detail-stats .stat small { font-size: 12px; opacity: 0.7; font-weight: 500; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-3);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.kpi:hover { border-color: var(--border-2); background: var(--surface-2); }
.kpi-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.kpi-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
  color: var(--text);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.panel h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
.panel-head h2 { margin-bottom: 0; }

.period-tabs { display: flex; gap: var(--space-1); padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.period-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px var(--space-3);
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.period-tabs button:hover { color: var(--text); }
.period-tabs button.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

.chart-wrap { height: 180px; }

/* ─── Tables ──────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.data-table thead th.r { text-align: right; }
.data-table tbody td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table.compact thead th,
.data-table.compact tbody td { padding: var(--space-2) var(--space-3); font-size: 12px; }

.side-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.side-1  { background: var(--green-bg); color: var(--green-2); }
.side--1 { background: var(--red-bg);   color: var(--red-2); }
.side-0  { background: var(--surface-2); color: var(--muted); }

/* ─── Bandit panels ───────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.two-col .panel { margin-bottom: 0; }
.bandit-block + .bandit-block {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.bandit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
}
.bandit-head .mono { color: var(--text); font-weight: 600; font-size: 12px; }

.shadow-stats { display: flex; flex-direction: column; gap: var(--space-4); }
.shadow-headline {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.shadow-headline .big {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.03em;
  color: var(--primary-2);
}
.shadow-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.shadow-cols h3 {
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
}
.bar-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text-2);
}
.bar-row:last-child { border-bottom: 0; }

/* ─── Roadmap ─────────────────────────────────────────────────────────── */
.roadmap-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-6);
  gap: var(--space-6);
  flex-wrap: wrap;
}
.roadmap-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  min-width: 260px;
}
.progress-count {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-weight: 600;
}
.progress-bar {
  width: 260px;
  height: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--green) 100%);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.2,.7,.3,1);
}
.progress-pct {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--green);
  font-weight: 600;
}

/* Tier grouping inside the shipped / upcoming panels */
.tier-group {
  margin: var(--space-4) 0;
  padding: var(--space-3) 0;
  border-top: 1px dashed var(--border);
}
.tier-group:first-of-type { border-top: 0; padding-top: 0; }
.tier-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: var(--space-2);
}
.tier-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: var(--space-2);
}
.phase-row-group { padding-left: var(--space-2); }
.panel-head .muted.small { font-weight: 400; margin-left: var(--space-2); }

.in-progress-panel {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-bg) 0%, var(--surface) 30%);
}
.phase-card { padding: var(--space-3) 0; }
.phase-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text);
}
.phase-notes { color: var(--muted); margin: var(--space-2) 0; font-size: 13px; }
.subtasks {
  list-style: none;
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.subtasks li {
  padding: var(--space-1) 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.subtasks li.done { color: var(--muted-2); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.subtasks .check { color: var(--green); font-weight: 700; flex-shrink: 0; }

.phase-row {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.phase-row:last-child { border-bottom: 0; }
.phase-row summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  list-style: none;
  padding: var(--space-2) 0;
  transition: color var(--t-fast);
}
.phase-row summary:hover { color: var(--text); }
.phase-row summary::-webkit-details-marker { display: none; }
.phase-row .icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.icon.done    { color: var(--green); }
.icon.warn    { color: var(--yellow); }
.icon.spinning {
  color: var(--primary);
  animation: spin 2.5s linear infinite;
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.phase-title { font-weight: 500; color: var(--text-2); font-size: 14px; }
.phase-row.complete .phase-title { color: var(--muted); }
.phase-row.blocked .blocked-reason {
  font-size: 11px;
  color: var(--yellow);
  margin-left: auto;
  font-family: var(--font-mono);
  background: var(--yellow-bg);
  padding: 2px var(--space-2);
  border-radius: 4px;
}
.phase-notes-detail {
  padding: var(--space-2) var(--space-6) var(--space-1);
  color: var(--muted);
  font-size: 13px;
  border-left: 2px solid var(--border);
  margin-left: var(--space-1);
  margin-top: var(--space-1);
}

.ideas .idea-list { list-style: none; }
.ideas .idea-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
}
.ideas .idea-list li:last-child { border-bottom: 0; }
.ideas .phase-title { color: var(--text-2); }

/* ─── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding: var(--space-4); }
  header.topnav { padding: var(--space-3) var(--space-4); }
  .bot-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; align-items: flex-start; }
  .detail-stats { flex-direction: column; gap: var(--space-2); align-items: flex-start; width: 100%; }
  .detail-stats .stat { flex-direction: row; gap: var(--space-3); align-items: baseline; }
  .micro-stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: var(--space-2); }
  .landing-header h1, .roadmap-header h1 { font-size: 24px; }
  .combined-stats { width: 100%; }
  .combined-stats .stat { flex: 1; min-width: 0; }
  .progress-bar, .progress-wrap { width: 100%; }
}

/* ─── Spec §5: Recent-Trades card list ─────────────────────────────────── */
.recent-trades-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trade-card {
  display: grid;
  grid-template-columns: 200px 1fr 160px 1fr 200px;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2, rgba(255, 255, 255, 0.02));
}
.trade-card.trade-win  { border-left: 4px solid var(--green); }
.trade-card.trade-loss { border-left: 4px solid var(--red); }
.trade-card.trade-flat { border-left: 4px solid var(--muted-2); }
.trade-card.trade-open { border-left: 4px solid var(--primary); opacity: 0.85; }

.trade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.trade-badge-win   { background: rgba(34, 197, 94, 0.18);  color: var(--green); }
.trade-badge-loss  { background: rgba(239, 68, 68, 0.18);  color: var(--red); }
.trade-badge-flat  { background: rgba(120, 120, 130, 0.18); color: var(--muted-2); }
.trade-badge-open  { background: rgba(59, 130, 246, 0.18); color: var(--primary); }

.trade-result { display: flex; align-items: center; gap: 8px; }
.trade-symbol { font-weight: 600; font-family: var(--font-mono); }

.trade-strategy-label {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.trade-pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}
.trade-pnl-pct { font-size: 14px; font-weight: 600; }
.trade-pnl-usd { font-size: 12px; }

.trade-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; }
.trade-px {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  text-align: right;
}

@media (max-width: 900px) {
  .trade-card {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .trade-px, .trade-meta { grid-column: span 2; }
}

/* Spec §3.1: strategy POOL (read-only) replaces the toggleable checkbox UI */
.strategy-pool-readonly .strategy-row {
  cursor: default;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
}
.strategy-pool-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.strategy-pool-dot.on  { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.strategy-pool-dot.off { background: var(--muted-2); opacity: 0.5; }

/* ─── S4: Combo-Performance panel ─────────────────────────────────────── */
.combo-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.18);
  color: var(--primary);
  vertical-align: middle;
}
.combo-pill.solo-pill {
  background: rgba(120, 120, 130, 0.18);
  color: var(--muted-2);
}
.combo-lift-title {
  margin-top: 18px;
  margin-bottom: 4px;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ─── S6: Learning-Page (curves + regime × strategy heatmap + KPIs) ───── */
.kpi-strip {
  display: flex;
  gap: 24px;
  align-items: baseline;
  flex-wrap: wrap;
}
.kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.kpi-value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 28px;
  font-weight: 600;
}
.kpi-label {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.heatmap-wrap { overflow-x: auto; }
.heatmap {
  border-collapse: collapse;
  margin-top: 6px;
}
.heatmap th, .heatmap td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: center;
  min-width: 70px;
}
.heatmap thead th { background: rgba(255, 255, 255, 0.02); }
.heat-strong-pos { background: rgba(34, 197, 94, 0.30); color: var(--green); }
.heat-pos        { background: rgba(34, 197, 94, 0.15); }
.heat-neutral    { background: rgba(120, 120, 130, 0.08); }
.heat-neg        { background: rgba(239, 68, 68, 0.15); }
.heat-strong-neg { background: rgba(239, 68, 68, 0.30); color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════════
   Roadmap — Capabilities-Banner (2026-05-27)
   Hard-abgegrenzte Sektion "Was kann der Bot?" oberhalb der Phasen-Liste.
   Eigene Farbgebung (blau-violett-Gradient) damit User Capabilities (was er
   tut) und Roadmap (was wurde gebaut) klar unterscheidet.
   ═══════════════════════════════════════════════════════════════════════ */
.capabilities-banner {
  margin: var(--space-5) 0 var(--space-7);
  padding: var(--space-6);
  background: linear-gradient(180deg,
              rgba(59,130,246,0.06) 0%,
              rgba(139,92,246,0.04) 100%);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: var(--radius);
  position: relative;
}
.capabilities-banner::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #8b5cf6);
  border-radius: var(--radius) 0 0 var(--radius);
}
.cap-banner-head { margin-bottom: var(--space-5); }
.cap-banner-head h2 { font-size: 22px; margin: 0 0 var(--space-2); }

.cap-block {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--border);
}
.cap-block:first-of-type { border-top: none; padding-top: 0; margin-top: var(--space-4); }
.cap-block h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 var(--space-3);
  color: var(--text);
}

/* numbered decision-flow steps */
.cap-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cap-steps li {
  counter-increment: step;
  position: relative;
  padding: var(--space-3) var(--space-3) var(--space-3) 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.cap-steps li::before {
  content: counter(step);
  position: absolute;
  left: var(--space-3); top: var(--space-3);
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.cap-steps li strong { color: var(--text); }

/* 13 strategy cards (responsive grid) */
.strategy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.strat-card {
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.strat-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}
.strat-card .strat-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.strat-card .strat-family {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 600;
}
.strat-card p {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

/* safety-net list */
.cap-safety {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-2) var(--space-4);
}
.cap-safety li {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
  font-size: 13px;
}
.cap-safety li strong { color: var(--text); }

/* data sources grid */
.data-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.ds-card {
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ds-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
}
.ds-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-card li {
  font-size: 12px;
  color: var(--text-2);
  padding-left: var(--space-3);
  position: relative;
}
.ds-card li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 10px;
}

/* learning bullets — same look as safety but with different accent */
.cap-learning {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cap-learning li {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
  font-size: 13px;
}
.cap-learning li strong { color: var(--text); }

/* the 6-bot fleet grid */
.bot-fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.bf-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.bf-card .bf-num {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.4;
}
.bf-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.bf-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}

/* visual separator between capabilities and roadmap proper */
.roadmap-divider {
  margin: var(--space-7) 0 var(--space-5);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.roadmap-divider h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.roadmap-divider p {
  margin: var(--space-1) 0 0;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Detailed bot-fleet cards (2026-05-27 v2)
   Replace the small bf-card grid with rich per-bot detail cards
   showing strategies + data-needs side-by-side.
   ═══════════════════════════════════════════════════════════════════════ */
.bot-detailed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.bot-detail-card {
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.bot-detail-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.bot-detail-card.active::before  { background: var(--green); box-shadow: 0 0 12px rgba(16,185,129,0.4); }
.bot-detail-card.paused::before  { background: var(--yellow); }
.bot-detail-card:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.bot-detail-card header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--border);
}
.bd-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-right: var(--space-2);
}
.bd-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  flex: 0 1 auto;
}
.bd-pill {
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.bd-sym-universe {
  background: linear-gradient(90deg, rgba(59,130,246,0.18), rgba(139,92,246,0.18));
  border-color: rgba(99,102,241,0.5);
  color: var(--text);
}
.bd-side-long  { background: rgba(16,185,129,0.12); color: var(--green); border-color: rgba(16,185,129,0.3); }
.bd-side-short { background: rgba(239,68,68,0.12); color: var(--red);   border-color: rgba(239,68,68,0.3); }
.bd-status-active { background: rgba(16,185,129,0.10); color: var(--green); border-color: rgba(16,185,129,0.25); }
.bd-status-paused { background: rgba(245,158,11,0.10); color: var(--yellow); border-color: rgba(245,158,11,0.3); }

.bd-summary {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.bd-summary strong { color: var(--text); }
.bd-summary code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}

.bd-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.bd-sec strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-2);
  font-weight: 600;
}
.bd-sec ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bd-sec li {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.bd-sec li strong { color: var(--text); display: inline; }
.bd-sec em { color: var(--muted); font-size: 11px; display: block; margin-top: var(--space-2); }

/* Compact compare-table below the cards */
.bot-compare-table {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
}
.bot-compare-table h4 {
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 600;
}
.bot-compare-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-family: var(--font-mono);
}
.bot-compare-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.bot-compare-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.bot-compare-table tbody tr:hover { background: var(--surface-2); }
.bot-compare-table td.ok       { color: var(--green); }
.bot-compare-table td.paused   { color: var(--yellow); }
.bot-compare-table td.ok-long  { color: var(--green); font-weight: 600; }
.bot-compare-table td.ok-short { color: var(--red); font-weight: 600; }

/* Mobile: stack sections vertically inside the card */
@media (max-width: 700px) {
  .bd-sections { grid-template-columns: 1fr; }
  .bot-compare-table { font-size: 11px; }
  .bot-compare-table th,
  .bot-compare-table td { padding: 6px 4px; }
}

/* Highlight for the brand-new candlestick-patterns strategy card */
.strat-card.strat-new {
  border-color: rgba(99,102,241,0.5);
  background: linear-gradient(180deg, var(--surface), rgba(59,130,246,0.04));
  position: relative;
}
.strat-card.strat-new::after {
  content: "NEU";
  position: absolute;
  top: 8px; right: 8px;
  padding: 2px 8px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 4px;
}

/* 2026-05-27: bot-only-by-number rebrand.
   Landing card: prominent #N badge instead of bot_id text. */
.bot-order-big {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  border-radius: var(--radius-sm);
  letter-spacing: -0.02em;
  margin-right: var(--space-2);
  box-shadow: 0 2px 6px rgba(59,130,246,0.25);
}

/* Roadmap status pill — "experimentell" (orange-ish between active green
   and paused yellow, to convey "running but not battle-tested") */
.bd-status-experimental {
  background: linear-gradient(90deg, rgba(245,158,11,0.10), rgba(139,92,246,0.10));
  color: #f59e0b;
  border-color: rgba(245,158,11,0.35);
}

/* Roadmap card: experimental cards get a subtle dashed border to set
   them apart from the rock-solid production bots, but the left-accent
   stripe stays green (= actively trading). */
.bot-detail-card.experimental {
  border-style: dashed;
  border-color: rgba(245,158,11,0.4);
}

/* Compare table: 'experimentell' cell color */
.bot-compare-table td.experimental {
  color: #f59e0b;
}

/* C4 (2026-05-30): shadow-picker A/B comparison panel. The highlight accent
   draws the eye when the shadow Thompson picker is beating live LinUCB. */
.shadow-cmp.highlight {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-bg), var(--surface) 60%);
}
.shadow-rec { margin: 0 0 12px; line-height: 1.5; }
.shadow-cmp .shadow-rec strong { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════
   Redesign 2026-06-17 — laientaugliche Bot-Detail-/Lernseiten
   (Trefferquoten-Donut, Strategie-Balken, Lern-Balken). Nutzt die
   bestehenden Tokens + Komponenten (panel, kpi, trade-card, progress-bar).
   ═══════════════════════════════════════════════════════════════════════ */

/* Verdict-Badge (Ampel) — von der Landing-Page, hier auch im Detail-Header */
.verdict-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.verdict-badge.v-good    { background: var(--green-bg); color: var(--green-2); }
.verdict-badge.v-bad     { background: var(--red-bg);   color: var(--red-2); }
.verdict-badge.v-neutral { background: var(--surface-2); color: var(--muted); }

.detail-stats .stat-value small { color: var(--muted); font-weight: 500; }

/* ─── Trefferquoten-Donut ─────────────────────────────────────────────── */
.winrate-block { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.donut-big { fill: var(--text); font-size: 19px; font-weight: 700; font-family: var(--font-mono); }
.donut-sub { fill: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: 0.1em; }
.winrate-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: var(--space-2); }
.wl-row { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--text-2); }
.wl-row strong { margin-left: auto; font-family: var(--font-mono); font-feature-settings: "tnum"; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-red   { background: var(--red); }
.dot-muted { background: var(--muted-2); }

/* ─── Strategie-Leistung (Balken) ─────────────────────────────────────── */
.strat-perf { display: flex; flex-direction: column; gap: var(--space-1); }
.strat-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(220px, 2fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
}
.strat-row:last-child { border-bottom: 0; }
.strat-info { display: flex; flex-direction: column; gap: 2px; }
.strat-name { font-weight: 600; color: var(--text); font-size: 14px; }
.strat-desc { line-height: 1.35; }
.strat-meta { text-align: left; }
.strat-bar-zone { display: flex; align-items: center; gap: var(--space-3); }
.strat-bar-track {
  flex: 1;
  height: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.strat-bar-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.2,.7,.3,1); min-width: 2px; }
.strat-bar-fill.pos { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.strat-bar-fill.neg { background: linear-gradient(90deg, var(--red), var(--red-2)); }
.strat-pnl { font-family: var(--font-mono); font-feature-settings: "tnum"; font-weight: 600; font-size: 13px; min-width: 92px; text-align: right; }

/* ─── Lern-Panel + Lern-Balken ────────────────────────────────────────── */
.learn-panel .learn-stage { margin-bottom: var(--space-4); }
.learn-stage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2); gap: var(--space-3); flex-wrap: wrap; }
.learn-stage-label { font-size: 14px; color: var(--text-2); }
.learn-stage-label strong { color: var(--primary-2); }
.learn-text { font-size: 14px; line-height: 1.6; color: var(--text-2); margin-bottom: var(--space-4); max-width: 820px; }
.learn-sub {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
  margin: var(--space-5) 0 var(--space-3);
}
.learn-bars { display: flex; flex-direction: column; gap: var(--space-1); }
.learn-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 2fr 48px 64px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.learn-bar-row:last-child { border-bottom: 0; }
.learn-bar-row.dim { opacity: 0.45; }
.lb-name { font-size: 13px; color: var(--text-2); font-weight: 500; }
.lb-track { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.lb-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; transition: width .6s cubic-bezier(.2,.7,.3,1); }
.lb-pulls { text-align: right; font-family: var(--font-mono); }
.lb-reward { text-align: right; font-family: var(--font-mono); font-feature-settings: "tnum"; font-weight: 600; font-size: 13px; }

/* strategy-chip im Detail-Header (Blockchain-Daten etc.) */
.strategy-chip {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--primary-bg); color: var(--primary-2);
}

@media (max-width: 768px) {
  .strat-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .strat-bar-zone { width: 100%; }
  .learn-bar-row { grid-template-columns: 1fr 40px 56px; }
  .learn-bar-row .lb-track { grid-column: 1 / -1; order: 3; }
  .winrate-block { justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Admin-Login / Setup (2026-06-17)
   ═══════════════════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-5);
}
.auth-brand .logo { font-size: 20px; color: var(--primary-2); }
.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--space-2); }
.auth-sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: var(--space-5); }
.auth-error {
  background: var(--red-bg);
  color: var(--red-2);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  margin-bottom: var(--space-4);
}
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.auth-input {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px var(--space-3);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.auth-hint { font-size: 11px; color: var(--muted-2); margin-top: calc(-1 * var(--space-2)); }
.auth-btn {
  margin-top: var(--space-1);
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px var(--space-4);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.auth-btn:hover { background: var(--primary-2); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-foot { color: var(--muted-2); font-size: 12px; }
