/* ── Typography ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design tokens ── */
:root {
  /* Backgrounds */
  --bg-primary:     #050911;      /* near-black, deep navy */
  --bg-card:        #0a1120;      /* card surface */
  --bg-card-hover:  #0f1a2e;      /* elevated surface */
  --bg-panel:       #0d1628;      /* slight variation for nested panels */
  --bg-glass:       rgba(10, 17, 32, 0.72);  /* glassmorphism surface */

  /* Borders */
  --border:         #162035;
  --border-subtle:  #1e2e4a;
  --border-accent:  #1a3658;
  --border-glow:    rgba(0, 200, 220, 0.18);

  /* Text hierarchy */
  --text-primary:   #e4edf8;
  --text-secondary: #7d97b8;
  --text-muted:     #3d5270;
  --text-dim:       #263448;

  /* Signal colors */
  --emerald:  #00d68f;   /* long / gain / ok */
  --rose:     #ff3355;   /* short / loss / danger */
  --amber:    #f5a623;   /* cost / caution / hold */
  --cyan:     #00c8dc;   /* primary accent / links */
  --sky:      #00c8dc;   /* alias */
  --purple:   #8b5cf6;   /* warmup / misc */
  --violet:   #6366f1;

  /* Glow colors */
  --glow-cyan:    rgba(0, 200, 220, 0.12);
  --glow-emerald: rgba(0, 214, 143, 0.12);
  --glow-rose:    rgba(255, 51, 85, 0.12);
  --glow-amber:   rgba(245, 166, 35, 0.10);

  /* Accents */
  --accent-glow: rgba(0,200,220,0.08);
}

[data-theme="light"] {
  --bg-primary:    #f0f4fb;
  --bg-card:       #ffffff;
  --bg-card-hover: #f4f7fd;
  --bg-panel:      #eef2f9;
  --bg-glass:      rgba(255,255,255,0.85);
  --border:        #dde5f5;
  --border-subtle: #c8d5eb;
  --border-accent: #b0c4e0;
  --border-glow:   rgba(0,144,176,0.2);
  --text-primary:  #0d1626;
  --text-secondary:#3d5275;
  --text-muted:    #7a90ad;
  --text-dim:      #bcc8db;
  --cyan:  #0090b0;
  --sky:   #0090b0;
  --emerald: #00904f;
  --rose:    #d92a44;
  --amber:   #c07e00;
  --glow-cyan:    rgba(0,144,176,0.08);
  --glow-emerald: rgba(0,144,79,0.08);
  --glow-rose:    rgba(217,42,68,0.08);
  --glow-amber:   rgba(192,126,0,0.08);
  --accent-glow: rgba(0,144,176,0.06);
}

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ── Aurora animated background ── */
.aurora-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.aurora-canvas::before,
.aurora-canvas::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.035;
  animation: aurora-drift 28s ease-in-out infinite;
}
.aurora-canvas::before {
  width: 80vw; height: 80vw;
  top: -30vw; left: -20vw;
  background: radial-gradient(ellipse, #00c8dc 0%, #0066aa 50%, transparent 70%);
}
.aurora-canvas::after {
  width: 70vw; height: 70vw;
  bottom: -25vw; right: -20vw;
  background: radial-gradient(ellipse, #00d68f 0%, #004488 50%, transparent 70%);
  animation-delay: -14s;
  animation-duration: 34s;
  opacity: 0.028;
}

@keyframes aurora-drift {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(5vw, 8vw) scale(1.08); }
  50%  { transform: translate(-3vw, 12vw) scale(0.95); }
  75%  { transform: translate(8vw, 4vw) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Aurora particle orbs */
.aurora-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orb-float linear infinite;
  opacity: 0;
}

@keyframes orb-float {
  0%   { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 0.6; }
  100% { transform: translateY(-20vh) translateX(var(--orb-drift, 0px)) scale(1); opacity: 0; }
}

[data-theme="light"] .aurora-canvas::before,
[data-theme="light"] .aurora-canvas::after { opacity: 0.018; }
[data-theme="light"] .aurora-orb { display: none; }

/* Page content sits above aurora */
#page-content { position: relative; z-index: 1; }

/* ── Heading font ── */
.font-display {
  font-family: 'Syne', system-ui, sans-serif;
}

/* ── Mono: prices, codes, badges ── */
.mono {
  font-family: 'DM Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Navigation ── */
.nav-link {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.15s;
  text-decoration: none;
  padding: 0.25rem 0;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--cyan);
  transform: scaleX(0);
  transition: transform 0.2s;
  border-radius: 1px;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--text-primary); font-weight: 600; }
.nav-link.active::after { transform: scaleX(1); }

/* ── Card ── */
.card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.125rem 1.25rem;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,200,220,0.04);
}
.card-accent-cyan   { border-left: 2px solid var(--cyan);    box-shadow: -2px 0 12px rgba(0,200,220,0.08); }
.card-accent-emerald{ border-left: 2px solid var(--emerald); box-shadow: -2px 0 12px rgba(0,214,143,0.08); }
.card-accent-rose   { border-left: 2px solid var(--rose);    box-shadow: -2px 0 12px rgba(255,51,85,0.08); }
.card-accent-amber  { border-left: 2px solid var(--amber);   box-shadow: -2px 0 12px rgba(245,166,35,0.08); }
.card-accent-purple { border-left: 2px solid var(--purple);  box-shadow: -2px 0 12px rgba(139,92,246,0.08); }

/* ── Section label ── */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Hero equity chart panel (full-width, top of page) ── */
.hero-chart-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 1.5rem 1.75rem 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(0,200,220,0.06),
    0 24px 64px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Ambient glow top-right */
.hero-chart-panel::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(0,200,220,0.07) 0%, transparent 65%);
  pointer-events: none;
}
/* Subtle grid lines */
.hero-chart-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,200,220,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,220,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  border-radius: 16px;
}

[data-theme="light"] .hero-chart-panel {
  background: rgba(255,255,255,0.92);
  border-color: #c8d8f0;
  box-shadow: 0 12px 40px rgba(0,80,160,0.08), 0 0 0 1px rgba(0,144,176,0.08);
}

/* ── Hero number (equity value) ── */
.equity-figure {
  font-family: 'Outfit', 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { .equity-figure { font-size: 2.2rem; } }
@media (max-width: 380px) { .equity-figure { font-size: 1.75rem; } }

/* Count-up glow effect while animating */
.equity-figure.counting {
  text-shadow: 0 0 30px rgba(0,200,220,0.3);
  transition: text-shadow 0.3s;
}

/* ── Delta pill (today's PnL) ── */
.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.4s, color 0.4s, box-shadow 0.4s;
}
.delta-pill.up {
  background: rgba(0, 214, 143, 0.14);
  color: var(--emerald);
  border: 1px solid rgba(0, 214, 143, 0.25);
  box-shadow: 0 0 12px rgba(0, 214, 143, 0.15);
}
.delta-pill.down {
  background: rgba(255, 51, 85, 0.14);
  color: var(--rose);
  border: 1px solid rgba(255, 51, 85, 0.25);
  box-shadow: 0 0 12px rgba(255, 51, 85, 0.15);
}

/* ── Range toggle buttons (1D / 1W / 1M / All) ── */
.range-toggle-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.range-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.range-btn:hover { color: var(--text-secondary); }
.range-btn.active {
  background: rgba(0,200,220,0.15);
  color: var(--cyan);
}

/* ── Equity chart canvas wrapper ── */
.hero-chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}

/* ── Hero gradient (old sparkline panel — kept for sub-stats reuse) ── */
.hero-gradient {
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero-gradient::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0,200,220,0.06) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="light"] .hero-gradient {
  background: rgba(255,255,255,0.88);
  border-color: #c8d8f0;
}

/* ── Decision Hero Card ── */
.decision-hero {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.decision-hero:hover {
  border-color: rgba(0,200,220,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,200,220,0.06);
  transform: translateY(-1px);
}
.decision-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 60%);
}

/* ── Decision badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-skip   { background: rgba(74,94,122,0.25);   color: #6b82a0; border: 1px solid rgba(74,94,122,0.3); }
.badge-open   { background: rgba(0,214,143,0.14);   color: #00d68f; border: 1px solid rgba(0,214,143,0.3); }
.badge-close  { background: rgba(0,200,220,0.14);   color: #00c8dc; border: 1px solid rgba(0,200,220,0.3); }
.badge-hold   { background: rgba(245,166,35,0.14);  color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.badge-warmup { background: rgba(139,92,246,0.14);  color: #8b5cf6; border: 1px solid rgba(139,92,246,0.3); }

/* ── Decision type label (large, in hero) ── */
.decision-type-label {
  font-family: 'Outfit', 'Syne', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dt-skip  { color: #6b82a0; }
.dt-open  { color: var(--emerald); text-shadow: 0 0 20px rgba(0,214,143,0.3); }
.dt-close { color: var(--cyan);    text-shadow: 0 0 20px rgba(0,200,220,0.3); }
.dt-hold  { color: var(--amber);   text-shadow: 0 0 20px rgba(245,166,35,0.25); }
.dt-other { color: var(--purple);  }

/* ── Key levels compact accordion ── */
.kl-symbol-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.kl-symbol-row:hover { background: var(--bg-card-hover); }
.kl-distance-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
}
.kl-expand-panel {
  margin: 0 0 0.25rem 0;
  border-left: 1.5px solid var(--border-subtle);
  margin-left: 0.5rem;
  padding-left: 0.75rem;
}

/* ── Status grid cell ── */
.stat-cell {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stat-cell:hover {
  border-color: var(--border-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.stat-cell-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.stat-cell-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Next-tick ring ── */
.tick-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tick-ring-svg {
  transform: rotate(-90deg);
}
.tick-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 3;
}
.tick-ring-progress {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 4px rgba(0,200,220,0.5));
}

/* ── Table ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
thead th {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child { padding-left: 0; }
tbody td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  vertical-align: middle;
}
tbody td:first-child { padding-left: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(0,200,220,0.03); }

/* ── Live pulse dot ── */
@keyframes pulse-ring {
  0%   { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(2.2);  opacity: 0; }
}
.live-dot {
  position: relative;
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}
.live-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse-ring 1.8s ease-out infinite;
}
.live-dot.warning { background: var(--amber); }
.live-dot.warning::before { background: var(--amber); }
.live-dot.danger  { background: var(--rose); }
.live-dot.danger::before  { background: var(--rose); }
.live-dot.muted   { background: var(--text-muted); }
.live-dot.muted::before { display: none; }

/* ── Signal colors ── */
.positive { color: var(--emerald); }
.negative { color: var(--rose); }
.neutral  { color: var(--text-secondary); }

/* ── Chart containers ── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── Sentiment ── */
.sentiment-bar { height: 2px; border-radius: 1px; background: var(--border); overflow: hidden; }
.sentiment-fill { height: 100%; border-radius: 1px; transition: width 0.3s; }

/* ── Truncate ── */
.truncate-2 {
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.truncate-3 {
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Health check ── */
.health-check-ok   { color: var(--emerald); }
.health-check-warn { color: var(--amber); }
.health-check-fail { color: var(--rose); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 2px; }

/* ── Loading shimmer ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

/* ── Staggered entrance animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out both; }

/* Staggered entrance — applied to sections on the dashboard */
.enter-0 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.00s both; }
.enter-1 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both; }
.enter-2 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both; }
.enter-3 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both; }
.enter-4 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both; }
.enter-5 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both; }
.enter-6 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both; }
.enter-7 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both; }
.enter-8 { animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.48s both; }

/* ── Chart line-draw animation (via Chart.js easing) ── */
@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 0.875rem 0; }

/* ── Pill / tag ── */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.04em;
}
.pill-cyan   { background: rgba(0,200,220,0.12);   color: var(--cyan);    border: 1px solid rgba(0,200,220,0.22); }
.pill-emerald{ background: rgba(0,214,143,0.12);   color: var(--emerald); border: 1px solid rgba(0,214,143,0.22); }
.pill-rose   { background: rgba(255,51,85,0.12);   color: var(--rose);    border: 1px solid rgba(255,51,85,0.22); }
.pill-amber  { background: rgba(245,166,35,0.12);  color: var(--amber);   border: 1px solid rgba(245,166,35,0.22); }
.pill-slate  { background: rgba(74,94,122,0.18);   color: var(--text-secondary); border: 1px solid rgba(74,94,122,0.25); }
.pill-purple { background: rgba(139,92,246,0.12);  color: var(--purple);  border: 1px solid rgba(139,92,246,0.22); }

/* ── Markdown (reports) ── */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: 'Syne', sans-serif;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
  margin-top: 1.5em;
}
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 0.4rem 0.7rem; }
.markdown-body th { background: var(--bg-card-hover); }
.markdown-body code {
  background: var(--bg-card-hover); border-radius: 3px;
  padding: 0.1em 0.35em; font-family: 'DM Mono', monospace; font-size: 0.83em;
}
.markdown-body pre {
  background: var(--bg-card-hover); border-radius: 6px;
  padding: 1em; overflow-x: auto;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .card { padding: 0.875rem; border-radius: 10px; }
  .hero-chart-panel { padding: 1rem; border-radius: 12px; }
  nav > div:first-child {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 1rem !important; flex: 1 1 auto; min-width: 0;
  }
  nav > div:first-child::-webkit-scrollbar { display: none; }
  .equity-figure { font-size: 2rem; }
  table { font-size: 0.72rem; }
  .chart-container[style*="120px"] { height: 80px !important; }
  .chart-container[style*="160px"] { height: 120px !important; }
}
@media (max-width: 380px) {
  .equity-figure { font-size: 1.55rem; }
  table { font-size: 0.68rem; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .max-w-5xl { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
}

/* ── Reduced motion: disable everything ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora-canvas { display: none; }
  .card:hover, .stat-cell:hover, .decision-hero:hover {
    transform: none !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   DUAL-PANE ULTRAWIDE LAYOUT
   ════════════════════════════════════════════════════════════════ */

/* Top-level split wrapper — sits directly inside <body> above #page-content */
.dual-pane-root {
  display: flex;
  flex-direction: column;   /* single column by default (mobile / narrow) */
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* At ultrawide breakpoint: two columns, side by side */
@media (min-width: 1700px) {
  .dual-pane-root {
    flex-direction: row;
    align-items: flex-start;
  }

  /* Each pane is exactly 50% of viewport width */
  .pane-shadow,
  .pane-live {
    width: 50%;
    min-width: 0;          /* prevent flex children from overflowing */
    flex: 0 0 50%;
  }

  /* Divider line between panes */
  .pane-shadow {
    border-right: 1px solid var(--border-accent);
  }
}

/* ── Shadow pane (left) ── */
.pane-shadow {
  /* Order: on narrow screens appears AFTER the live pane */
  order: 2;
  padding: 0 1.5rem 5rem;
  overflow-x: hidden;
}

@media (min-width: 1700px) {
  .pane-shadow {
    order: 1;                /* left side on ultrawide */
    padding: 0 1.25rem 5rem 1.5rem;
    /* Sticky header doesn't apply here; pane scrolls independently */
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
  }
}

/* ── Live pane (right) — wraps existing #page-content ── */
.pane-live {
  order: 1;
  min-width: 0;
}

@media (min-width: 1700px) {
  .pane-live {
    order: 2;               /* right side on ultrawide */
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
  }
}

/* On narrow: add a visual separator between live (top) and shadow (bottom) */
@media (max-width: 1699px) {
  .pane-shadow {
    border-top: 1px solid var(--border-accent);
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
}

/* ── Shadow panel header strip ── */
.shadow-pane-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 9, 17, 0.88);
  border-bottom: 1px solid var(--border-accent);
  padding: 0.875rem 0 0.875rem;
  margin-bottom: 1rem;
}

[data-theme="light"] .shadow-pane-header {
  background: rgba(240, 244, 251, 0.92);
}

/* Accent bar on the shadow pane header — violet/amber to distinguish it */
.shadow-pane-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #a78bfa 0%, #f59e0b 100%);
  border-radius: 0 2px 2px 0;
}

/* ── Shadow equity hero panel — visual twin of .hero-chart-panel
      but tinted violet/amber so it's unmistakably the what-if book ── */
.shadow-hero-panel {
  background: var(--bg-glass);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  margin-bottom: 1rem;
}

/* Violet ambient glow */
.shadow-hero-panel::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* Subtle grid (same pattern as main hero) */
.shadow-hero-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.012) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  border-radius: 16px;
}

[data-theme="light"] .shadow-hero-panel {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(167, 139, 250, 0.22);
}

/* ── Shadow equity figure (same scale as .equity-figure) ── */
.shadow-equity-figure {
  font-family: 'Outfit', 'Syne', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) { .shadow-equity-figure { font-size: 1.8rem; } }

/* ── Shadow delta pill — reuses .delta-pill from main styles ── */

/* ── Shadow accent color (violet) used throughout shadow pane ── */
.shadow-accent     { color: #a78bfa; }
.shadow-accent-dim { color: rgba(167, 139, 250, 0.55); }

/* Violet pill variant for shadow pane labels */
.pill-violet {
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.22);
}

/* ── Shadow "unavailable" overlay ── */
.shadow-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-accent);
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.03);
}

/* ── Shadow chart wrap (mirrors .hero-chart-wrap) ── */
.shadow-chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 0.75rem;
}

/* ── Shadow open positions list ── */
.shadow-pos-card {
  background: var(--bg-card-hover);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-left: 2px solid #a78bfa;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

/* ── Shadow stats grid (trades / win-rate / R / open) ── */
.shadow-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .shadow-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.shadow-stat-cell {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
}

/* ── Ensure inner tables/charts in shadow pane scroll, not the body ── */
.pane-shadow .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent body-level horizontal scroll on any viewport */
body { overflow-x: hidden; }

/* ── Collapsed shadow toggle (mobile only) ── */
.shadow-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 8px;
  padding: 0.625rem 1rem;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
}

.shadow-toggle-btn:hover {
  background: rgba(167, 139, 250, 0.10);
  border-color: rgba(167, 139, 250, 0.28);
}

/* Hide toggle on ultrawide — shadow is always visible there */
@media (min-width: 1700px) {
  .shadow-toggle-btn { display: none; }
}
