/* ═══════════════════════════════════════════════════════════════════════════
   JAYNE CAPITAL TRADING DASHBOARD
   styles.css — Production stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CUSTOM PROPERTIES: DARK THEME ─── */
[data-theme="dark"] {
  --bg: #08090c;
  --bg2: #0e1015;
  --bg3: #14161d;
  --bg4: #1a1d26;
  --bg5: #1f2230;
  --surface: #0e1015;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.10);
  --border3: rgba(255,255,255,0.16);
  --text: #e4e8ef;
  --text2: #c8cdd6;
  --muted: #6b7485;
  --dim: #3d4455;
  --dim2: #2a2d38;
  --white: #ffffff;
  --nav-hover: rgba(255,255,255,0.04);
  --nav-active: rgba(207,86,161,0.08);
  --card-bg: rgba(14,16,21,0.85);
  --overlay: rgba(14,16,21,0.92);
}

/* ─── CUSTOM PROPERTIES: LIGHT THEME ─── */
[data-theme="light"] {
  --bg: #f5f5f7;
  --bg2: #ffffff;
  --bg3: #f0f0f2;
  --bg4: #e8e8ec;
  --bg5: #dddde1;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.10);
  --border3: rgba(0,0,0,0.16);
  --text: #1a1a2e;
  --text2: #3a3a4e;
  --muted: #7a7a8e;
  --dim: #a0a0ae;
  --dim2: #d0d0d8;
  --white: #000000;
  --nav-hover: rgba(0,0,0,0.03);
  --nav-active: rgba(207,86,161,0.08);
  --card-bg: rgba(255,255,255,0.92);
  --overlay: rgba(255,255,255,0.95);
}

/* ─── CUSTOM PROPERTIES: SHARED / ROOT ─── */
:root {
  --pink: #CF56A1;
  --pink-dim: rgba(207,86,161,0.15);
  --lime: #A3EB48;
  --lime-dim: rgba(163,235,72,0.1);
  --lavender: #A156B4;
  --lav-dim: rgba(161,86,180,0.12);
  --bull: #22c55e;
  --bull-dim: rgba(34,197,94,0.1);
  --bear: #ef4444;
  --bear-dim: rgba(239,68,68,0.1);
  --warn: #f59e0b;
  --warn-dim: rgba(245,158,11,0.1);
  --rail-w: 56px;
  --rail-expanded: 200px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  transition: background 0.3s, color 0.3s;
}


/* ═══════════════════════════════════════════════════════════════════════════
   NAV RAIL
   56px collapsed, 200px on hover with cubic-bezier transition
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-rail {
  width: var(--rail-expanded);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 0;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.nav-rail.collapsed { width: var(--rail-w); }
.nav-rail.collapsed .nav-label,
.nav-rail.collapsed .logo-text,
.nav-rail.collapsed .nav-section-label,
.nav-rail.collapsed .avatar-info {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

/* Collapsed: keep icons/tickers visible and centered */
.nav-rail.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}

.nav-rail.collapsed .nav-item svg,
.nav-rail.collapsed .watchlist-ticker {
  flex-shrink: 0;
}

.nav-rail.collapsed .nav-items {
  padding: 0 4px;
}

.nav-rail.collapsed .nav-bottom {
  padding: 0 4px;
}

.nav-rail.collapsed .nav-btn {
  justify-content: center;
  padding: 10px 0;
}

.nav-rail.collapsed .nav-avatar {
  justify-content: center;
  padding: 10px 0;
}

.nav-rail.collapsed .connection-status {
  justify-content: center;
  padding: 8px 0;
}

.nav-rail.collapsed .nav-pin {
  right: 50%;
  transform: translateX(50%) rotate(180deg);
}

/* Logo */
.nav-logo {
  width: 100%;
  padding: 4px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-shrink: 0;
  position: relative;
}

.nav-pin {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, transform 0.2s;
}
.nav-pin:hover { background: var(--nav-hover); color: var(--text2); }
.nav-rail.collapsed .nav-pin { transform: rotate(180deg); }

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Nav items */
.nav-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: var(--text2);
}

.nav-item.active {
  background: var(--nav-active);
  color: var(--pink);
}

/* Nav icons */
.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Nav labels */
.nav-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Section labels (uppercase, 9px) */
.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 12px 6px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Bottom section */
.nav-bottom {
  width: 100%;
  padding: 0 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: var(--nav-hover); color: var(--text2); }

/* Avatar */
.nav-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-avatar:hover {
  background: var(--nav-hover);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--pink);
  flex-shrink: 0;
}

.avatar-info {
  opacity: 1;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.avatar-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.avatar-account {
  font-size: 10px;
  color: var(--muted);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s;
}

.theme-toggle:hover {
  background: var(--nav-hover);
  color: var(--text2);
}

.toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--dim2);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(14px);
}

/* Theme toggle pill (inline in top bar) */
.theme-toggle-pill {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.theme-toggle-pill:hover {
  border-color: var(--border3);
}

/* Connection status dot */
.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-dot.connected {
  background: var(--bull);
}

.connection-dot.demo {
  background: var(--warn);
}

.connection-dot.degraded {
  background: #f97316;
}

.connection-dot.error {
  background: var(--bear);
}

.connection-status { display: none; /* Moved to bar 1 — .bar-status */ }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-connected .conn-dot, .conn-dot.status-connected { background: var(--bull); }
.status-demo .conn-dot, .conn-dot.status-demo { background: var(--warn); }
.status-error .conn-dot, .conn-dot.status-error { background: var(--bear); }
.status-disconnected .conn-dot, .conn-dot.status-disconnected { background: var(--dim); }


/* ═══════════════════════════════════════════════════════════════════════════
   MAIN AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   AI GRADE BAR — 60px height
   ═══════════════════════════════════════════════════════════════════════════ */
/* Bar 1: Actions (persists) */
/* Bar status: Connected + Session */
.bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.status-dot.connected { background: var(--bull); box-shadow: 0 0 6px rgba(163,235,72,0.5); }
.status-dot.degraded { background: var(--warn); box-shadow: 0 0 6px rgba(245,158,11,0.5); animation: pulse-warn 1.5s infinite; }
@keyframes pulse-warn { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-dot.disconnected { background: var(--bear); }
.status-text { color: var(--muted); font-weight: 500; font-size: 11px; }
.status-divider { color: var(--border2); font-size: 11px; }
.status-session { color: var(--text); font-weight: 600; font-size: 12px; }
.status-timer { color: var(--muted); font-size: 11px; opacity: 0.7; }

.action-bar {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg2);
}
.action-bar-spacer { flex: 1; }

/* Bar 2: Instrument context */
.instrument-bar {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg);
  overflow: visible;
  position: relative;
  z-index: 100;
}
.instrument-bar-spacer { flex: 1; min-width: 8px; }

/* Price in bar 2 */
.bar-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}
.bar-price .price-value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bar-price .price-change,
.bar-price .price-change-pct {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

/* ── Instrument Dropdown ─────────────────────────────────── */
.instrument-dropdown-wrap {
  position: relative;
}
.instrument-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  transition: all 0.15s;
}
.instrument-trigger:hover {
  background: var(--bg4);
}
.instrument-trigger-symbol {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}
.instrument-trigger-arrow {
  opacity: 0.5;
  transition: transform 0.2s;
}
.instrument-dropdown-wrap.open .instrument-trigger-arrow {
  transform: rotate(180deg);
}
.instrument-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 9000;
  padding: 4px;
  backdrop-filter: blur(12px);
}
.instrument-dropdown-wrap.open .instrument-dropdown {
  display: block;
  animation: dropdown-in 0.15s ease-out;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.instrument-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.instrument-option:hover {
  background: var(--bg4);
}
.instrument-option.active {
  background: var(--pink-dim);
}
.instrument-option-symbol {
  font-size: 12px;
  font-weight: 800;
  width: 26px;
  color: var(--text);
}
.instrument-option-name {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}
.instrument-option .micro-toggle {
  display: flex;
  gap: 2px;
}

/* Grade ring (40px, border animation) */
.grade-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  position: relative;
  flex-shrink: 0;
}

.grade-ring-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--bg4);
}

.grade-ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--bull);
  border-right-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-10deg);
}

.grade-letter {
  z-index: 1;
  color: var(--bull);
}

.grade-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--bg4);
  border: 2px solid currentColor;
}

/* AI summary */
.ai-summary {
  flex: 1;
  min-width: 0;
}

.ai-headline {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Confirmation chips (colored backgrounds) */
.ai-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.chip-bull {
  background: var(--bull-dim);
  color: var(--bull);
}

.chip-warn {
  background: var(--warn-dim);
  color: var(--warn);
}

.chip-lav {
  background: var(--lav-dim);
  color: var(--lavender);
}

.chip-neutral {
  background: var(--bg4);
  color: var(--muted);
}

.chip-bear {
  background: var(--bear-dim);
  color: var(--bear);
}

.chip-pink {
  background: var(--pink-dim);
  color: var(--pink);
}

/* Metric cards (OFI, Regime, R:R) */
.ai-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.ai-metric {
  text-align: center;
}

.ai-m-val {
  font-size: 15px;
  font-weight: 700;
}

.ai-m-label {
  font-size: 8px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-divider {
  width: 1px;
  height: 24px;
  background: var(--border2);
}

/* Session pill (lime green, pulsing dot) */
.session-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--lime-dim);
  border: 1px solid rgba(163,235,72,0.2);
  padding: 6px 14px;
  border-radius: 20px;
  flex-shrink: 0;
}

.s-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

.s-text {
  font-size: 11px;
  color: var(--lime);
  font-weight: 600;
  white-space: nowrap;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--lime-dim);
  border: 1px solid rgba(163,235,72,0.2);
  padding: 4px 12px;
  border-radius: 12px;
  flex-shrink: 0;
}
.session-label { font-size: 11px; color: var(--lime); font-weight: 600; white-space: nowrap; }
.session-timer { font-size: 11px; color: var(--lime); opacity: 0.7; font-weight: 500; }


/* ═══════════════════════════════════════════════════════════════════════════
   PHASE TABS — 36px height
   ═══════════════════════════════════════════════════════════════════════════ */
.phase-bar {
  height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  background: var(--bg2);
  flex-shrink: 0;
  gap: 0;
}

.phase-tab {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 6px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.phase-tab:hover {
  color: var(--muted);
}

.phase-tab.active {
  color: var(--text);
  border-bottom-color: var(--pink);
}

/* Phase dot (5px, lime pulse on active) */
.phase-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
}

.phase-tab.active .phase-dot {
  background: var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

.phase-spacer {
  flex: 1;
}
.phase-bar .session-info,
.phase-bar .news-btn,
.phase-bar .ask-jayne-btn,
.phase-bar .topbar-icon-btn,
.phase-bar .theme-toggle-pill {
  margin-left: 8px;
}

/* Chart controls (timeframe group, instrument group) */
.chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tf-group {
  display: flex;
  gap: 2px;
  background: transparent;
  border-radius: 8px;
  padding: 0;
  border: none;
}

.tf-btn {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  border: none;
  background: transparent;
  font-family: inherit;
}
.tf-btn:hover { color: var(--text); background: var(--bg4); }
.tf-btn.active { background: var(--pink-dim); color: var(--pink); font-weight: 600; }

.inst-group {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 2px;
  margin-left: 8px;
  border: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════════════════════════
   WORKSPACE
   ═══════════════════════════════════════════════════════════════════════════ */
.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CHART PANE
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-pane {
  flex: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 13px;
  position: relative;
  min-width: 0;
}

/* Hide Lightweight Charts library attribution watermark */
#lw-chart a[href*="tradingview"],
#lw-chart div[style*="tradingview"],
#lw-chart img[src*="tradingview"] { display: none !important; }
/* TV watermark is rendered on canvas — hide the link overlay */
.tv-lightweight-charts a,
[class*="chart"] a[target="_blank"] { display: none !important; }

/* Chart watermark (instrument name at 15% opacity) */
.chart-watermark {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.chart-inst {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  opacity: 0.15;
}

/* Price float (top right, 22px bold) */
.chart-price-float {
  position: absolute;
  top: 16px;
  right: 16px;
  text-align: right;
  z-index: 2;
}

.chart-price-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--bull);
}

.chart-price-chg {
  font-size: 11px;
  color: var(--bull);
  opacity: 0.7;
}

.candle-countdown {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(107,116,133,0.15);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SETUP PANEL — 270px right sidebar
   ═══════════════════════════════════════════════════════════════════════════ */
.setup-panel {
  width: 270px;
  border-left: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.panel-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Setup cards */
.setup-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.setup-card:hover {
  border-color: var(--border2);
}

.setup-card.featured {
  border-color: rgba(34,197,94,0.25);
}

.setup-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.setup-name {
  font-size: 12px;
  font-weight: 600;
}

/* Grade badges (A=bull, B=warn, C=neutral) */
.setup-grade {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.g-a {
  background: var(--bull-dim);
  color: var(--bull);
}

.g-b {
  background: var(--warn-dim);
  color: var(--warn);
}

.g-c {
  background: rgba(107,116,133,0.15);
  color: var(--muted);
}

/* Setup meta (entry/SL/TP, R:R) */
.setup-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Confirmation chips (yes=bull, neutral=warn, no=bear, 9px) */
.confirmations {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.conf-chip {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid;
}

.conf-yes {
  background: var(--bull-dim);
  border-color: rgba(34,197,94,0.2);
  color: var(--bull);
}

.conf-neutral {
  background: var(--warn-dim);
  border-color: rgba(245,158,11,0.2);
  color: var(--warn);
}

.conf-no {
  background: var(--bear-dim);
  border-color: rgba(239,68,68,0.2);
  color: var(--bear);
}

/* Panel sections */
.panel-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.panel-section-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* Session stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
}

.stat-label {
  color: var(--muted);
}

.stat-val {
  font-weight: 600;
}

/* News section */
.news-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.news-time {
  font-weight: 600;
  font-size: 10px;
}

/* Watchlist items */
.watchlist-item { color: var(--muted); }
.watchlist-item.active { color: var(--bull); }
.watchlist-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
.watchlist-item.active .watchlist-dot { opacity: 1; animation: pulse 2s ease-in-out infinite; }

.watchlist-ticker {
  font-size: 11px;
  font-weight: 700;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.watchlist-name {
  font-size: 11px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}
.micro-toggle {
  display: flex;
  gap: 2px;
}
.micro-btn {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.micro-btn:hover { color: var(--muted); border-color: var(--border2); }
.micro-btn.active { background: var(--pink-dim); color: var(--pink); border-color: rgba(207,86,161,0.3); }


/* ═══════════════════════════════════════════════════════════════════════════
   SETUP EXPLAINER PANEL — slides in from right on card click
   ═══════════════════════════════════════════════════════════════════════════ */
.active-view { position: relative; overflow: hidden; }

/* Detail panel: flex sibling between chart and setup list */
.setup-explainer {
  width: 0;
  min-width: 0;
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.setup-explainer.visible {
  width: 340px;
  overflow-y: auto;
}

/* Resize handle on left edge of detail panel */
.panel-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  transition: background 0.15s;
}
.panel-resize-handle:hover,
.panel-resize-handle.dragging {
  background: var(--pink);
}

/* Resize handle on left edge of setup panel */
.setup-panel { position: relative; }
.setup-panel .panel-resize-handle {
  left: 0;
}

.explainer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.explainer-grade {
  font-size: 18px;
  font-weight: 800;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.explainer-headline {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.explainer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

.explainer-close:hover { color: var(--text); }

.explainer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.explainer-summary {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}

.explainer-signals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signal-row {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg3);
  border-left: 3px solid var(--muted);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
}

.signal-row .signal-name {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}

.signal-confirmed { border-left-color: var(--bull); }
.signal-confirmed .signal-name { color: var(--bull); }
.signal-neutral { border-left-color: var(--warn); }
.signal-neutral .signal-name { color: var(--warn); }
.signal-against { border-left-color: var(--bear); }
.signal-against .signal-name { color: var(--bear); }

.explainer-levels {
  background: var(--bg3);
  border-radius: 6px;
  padding: 12px;
}

.explainer-levels .level-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.explainer-levels .level-label { color: var(--muted); }
.explainer-levels .level-val { font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums; }
.explainer-levels .level-entry { color: var(--text); }
.explainer-levels .level-sl { color: var(--bear); }
.explainer-levels .level-tp { color: var(--bull); }

.explainer-risk {
  background: var(--bg3);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
}

.explainer-disqualifier {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--bear);
}

.setup-card.selected {
  border-color: var(--pink, #ec4899);
  background: var(--bg4, rgba(236,72,153,0.05));
}


/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM DRAWER — 40px collapsed, 200px expanded
   ═══════════════════════════════════════════════════════════════════════════ */
.bottom-drawer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  overflow: hidden;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-drawer.collapsed {
  height: 40px;
}

.bottom-drawer.expanded {
  height: 200px;
}

/* Drawer handle with key stats */
.drawer-handle {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  cursor: pointer;
}

.drawer-stats {
  display: flex;
  gap: 24px;
}

.d-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.d-stat-label {
  font-size: 9px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.d-stat-val {
  font-size: 12px;
  font-weight: 600;
}

/* Chevron rotation on expand */
.drawer-chevron {
  font-size: 12px;
  color: var(--dim);
  transition: transform 0.3s;
}

.expanded .drawer-chevron {
  transform: rotate(180deg);
}

/* 4-column grid of drawer cards */
.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 20px 12px;
}

.drawer-card {
  background: var(--bg3);
  border-radius: 6px;
  padding: 12px;
}

.drawer-card-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Data rows (label + value) */
.dc-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
}

.dc-label {
  color: var(--muted);
}

.dc-val {
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════════
   NEWS TICKER — 28px
   ═══════════════════════════════════════════════════════════════════════════ */
.ticker {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}

.ticker-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Concept label (for wireframe reference, kept for consistency) */
.concept-label {
  position: fixed;
  bottom: 36px;
  right: 20px;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 200;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS PANEL — Overlay modal
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Settings Drawer (slides from right) ─── */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 499;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.settings-backdrop.visible { opacity: 1; pointer-events: all; }

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100dvh;
  background: var(--bg2);
  border-left: 1px solid var(--border2);
  z-index: 500;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.3);
}
.settings-drawer.visible { transform: translateX(0); }

.settings-drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-drawer-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.settings-drawer-close {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.settings-drawer-close:hover { background: var(--bg4); color: var(--text); }

.settings-drawer-body { overflow: visible; padding: 16px 20px calc(40px + env(safe-area-inset-bottom)); }

.settings-section { margin-bottom: 20px; }
.settings-section-title {
  font-size: 9px; font-weight: 700; color: var(--pink);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.settings-field {
  margin-bottom: 16px;
}

.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

.settings-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.settings-input:focus {
  border-color: var(--pink);
}

.settings-input::placeholder {
  color: var(--dim);
}

.settings-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.settings-select:focus {
  border-color: var(--pink);
}

.settings-textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s;
}

.settings-textarea:focus {
  border-color: var(--pink);
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text2);
}

.settings-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  cursor: pointer;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-secondary {
  background: var(--bg4);
  color: var(--text2);
  border-color: var(--border2);
}

.btn-secondary:hover {
  background: var(--bg5);
  color: var(--text);
}

.btn-primary {
  background: var(--pink);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-danger {
  background: var(--bear-dim);
  color: var(--bear);
  border-color: rgba(239,68,68,0.2);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   INVALIDATION BANNER
   ═══════════════════════════════════════════════════════════════════════════ */
.invalidation-banner {
  display: none;
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  animation: banner-pulse 2s infinite;
  font-family: 'Plus Jakarta Sans', sans-serif;
  max-width: 90vw;
}
.inv-icon {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.inv-dismiss {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.inv-dismiss:hover { background: rgba(255,255,255,0.35); }
@keyframes banner-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.7); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 48px;
  right: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  pointer-events: all;
  animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  min-width: 260px;
  max-width: 380px;
}

.toast.toast-out {
  animation: toast-out 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-info .toast-icon {
  background: var(--lav-dim);
  color: var(--lavender);
}

.toast-success .toast-icon {
  background: var(--bull-dim);
  color: var(--bull);
}

.toast-warning .toast-icon {
  background: var(--warn-dim);
  color: var(--warn);
}

.toast-error .toast-icon {
  background: var(--bear-dim);
  color: var(--bear);
}

.toast-info {
  border-color: rgba(161,86,180,0.2);
}

.toast-success {
  border-color: rgba(34,197,94,0.2);
}

.toast-warning {
  border-color: rgba(245,158,11,0.2);
}

.toast-error {
  border-color: rgba(239,68,68,0.2);
}

.toast-message {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.toast-dismiss {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.toast-dismiss:hover {
  color: var(--text);
  background: var(--bg4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   BRIEFING VIEW
   ═══════════════════════════════════════════════════════════════════════════ */
.briefing-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

.briefing-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.briefing-card-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* Session bias card */
.session-bias-card .bias-direction {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.session-bias-card .bias-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* Key levels card */
.key-levels-card .level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.key-levels-card .level-row:last-child {
  border-bottom: none;
}

.key-levels-card .level-name {
  color: var(--muted);
}

.key-levels-card .level-price {
  font-weight: 600;
}

/* Events timeline card */
.events-card .event-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.events-card .event-item:last-child {
  border-bottom: none;
}

.events-card .event-time {
  font-weight: 600;
  color: var(--text2);
  flex-shrink: 0;
  width: 56px;
}

.events-card .event-label {
  color: var(--muted);
  flex: 1;
}

.events-card .event-impact {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.event-impact.high {
  background: var(--bear-dim);
  color: var(--bear);
}

.event-impact.medium {
  background: var(--warn-dim);
  color: var(--warn);
}

.event-impact.low {
  background: var(--bg4);
  color: var(--muted);
}


/* ═══════════════════════════════════════════════════════════════════════════
   REVIEW VIEW
   ═══════════════════════════════════════════════════════════════════════════ */
.review-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

/* Summary card */
.review-summary-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.review-summary-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.review-headline {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.review-body {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* Stats grid */
.review-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.review-stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.review-stat-val {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 2px;
}

.review-stat-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Text colors */
.text-bull { color: var(--bull); }
.text-bear { color: var(--bear); }
.text-warn { color: var(--warn); }
.text-pink { color: var(--pink); }
.text-lav  { color: var(--lavender); }
.text-lime { color: var(--lime); }
.text-muted { color: var(--muted); }
.text-dim  { color: var(--dim); }

/* Background tints */
.bg-bull-dim { background: var(--bull-dim); }
.bg-bear-dim { background: var(--bear-dim); }
.bg-warn-dim { background: var(--warn-dim); }
.bg-pink-dim { background: var(--pink-dim); }
.bg-lav-dim  { background: var(--lav-dim); }
.bg-lime-dim { background: var(--lime-dim); }

/* Display */
.hidden { display: none; }
.visible { display: block; }
.flex { display: flex; }
.grid { display: grid; }

/* Overflow */
.overflow-y-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Spacing helpers */
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Scrollbar styling (dark theme aware) */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--dim2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

/* Selection styling */
::selection {
  background: var(--pink-dim);
  color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE UI ELEMENTS (hidden on desktop by default)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hamburger menu button */
.mobile-hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 350;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: background 0.15s;
}
.mobile-hamburger:hover { background: var(--bg3); }

/* Nav overlay backdrop */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-nav-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* Setup panel toggle button (inside chart pane) */
.setup-toggle-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.setup-toggle-btn:hover { color: var(--text); background: var(--bg3); }

/* Setup panel close button (hidden on desktop) */
.setup-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
  margin-left: auto;
}
.setup-close-btn:hover { color: var(--text); }


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Desktop (1024 – 1440px) ─── */
@media (max-width: 1440px) {
  .setup-panel {
    width: 240px;
  }
  .setup-explainer {
    width: 300px;
  }
  .drawer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bottom-drawer.expanded {
    height: 280px;
  }
  .ai-headline {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ─── Tablet (768 – 1024px) ─── */
@media (max-width: 1024px) {
  /* Nav rail: collapsed by default */
  .nav-rail {
    width: var(--rail-w);
  }
  .nav-rail .nav-label,
  .nav-rail .logo-text,
  .nav-rail .nav-section-label,
  .nav-rail .avatar-info {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
  }
  .nav-rail .nav-item {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
  }
  .nav-rail .nav-items { padding: 0 4px; }
  .nav-rail .nav-bottom { padding: 0 4px; }
  .nav-rail .nav-btn { justify-content: center; padding: 10px 0; }
  .nav-rail .nav-avatar { justify-content: center; padding: 10px 0; }
  .nav-rail .connection-status { justify-content: center; padding: 8px 0; }
  .nav-rail .nav-pin { display: none; }

  /* Setup panel */
  .setup-panel {
    width: 220px;
  }

  /* Explainer + chat: full width overlay */
  .setup-explainer {
    right: 0;
    width: 100%;
  }
  .ai-chat-drawer.visible {
    width: 300px;
  }

  /* AI bar: hide metrics, truncate headline */
  .ai-metrics {
    display: none;
  }
  .ai-headline {
    max-width: 220px;
  }

  /* Drawer stats: tighter, hide overflow */
  .drawer-stats {
    gap: 12px;
    overflow: hidden;
  }
  .d-stat:nth-child(n+5) {
    display: none;
  }

  /* Phase bar: smaller instrument buttons */
  .tf-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Bottom drawer */
  .drawer-grid {
    grid-template-columns: 1fr;
  }
  .bottom-drawer.expanded {
    height: 240px;
    overflow-y: auto;
  }

  /* Briefing / review grids: 2 columns */
  .briefing-view > div,
  #briefing-view > div {
    grid-template-columns: 1fr 1fr !important;
  }
  .review-view > div,
  #review-view > div {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ─── Small tablet / large phone (600 – 768px) ─── */
@media (max-width: 768px) {
  /* Hide nav rail, show hamburger */
  .nav-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail-expanded);
    transform: translateX(-100%);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav-rail.mobile-open {
    transform: translateX(0);
  }
  /* Restore nav labels when open as mobile overlay */
  .nav-rail.mobile-open .nav-label,
  .nav-rail.mobile-open .logo-text,
  .nav-rail.mobile-open .nav-section-label,
  .nav-rail.mobile-open .avatar-info {
    opacity: 1;
    pointer-events: auto;
    width: auto;
    overflow: visible;
  }
  .nav-rail.mobile-open .nav-item {
    justify-content: flex-start;
    padding: 10px 12px;
    gap: 12px;
  }
  .nav-rail.mobile-open .nav-items { padding: 0 8px; }
  .nav-rail.mobile-open .nav-bottom { padding: 0 8px; }
  .nav-rail.mobile-open .nav-btn { justify-content: flex-start; padding: 10px 12px; }
  .nav-rail.mobile-open .nav-avatar { justify-content: flex-start; padding: 10px 12px; }
  .nav-rail.mobile-open .connection-status { justify-content: flex-start; padding: 8px 12px; }

  .mobile-hamburger {
    display: flex;
  }
  .mobile-nav-backdrop {
    display: block;
  }

  /* Main area takes full width */
  body {
    overflow: hidden;
  }

  /* Setup panel: slide-in overlay from right */
  .setup-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    transform: translateX(100%);
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  }
  .setup-panel.mobile-visible {
    transform: translateX(0);
  }
  .setup-close-btn {
    display: block;
  }

  /* Show setup toggle button */
  .setup-toggle-btn {
    display: flex;
  }

  /* Chart pane: full width */
  .chart-pane {
    flex: 1;
    min-width: 0;
  }

  /* AI bar: allow wrapping, shrink text */
  .ai-bar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 8px 12px 8px 56px;
    gap: 8px;
  }
  .grade-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .ai-headline {
    font-size: 12px;
    max-width: none;
  }
  .session-info {
    padding: 4px 10px;
    font-size: 10px;
  }
  .ask-jayne-btn {
    font-size: 10px;
    padding: 4px 10px;
  }

  /* Phase bar: tighter */
  .phase-bar {
    height: auto;
    min-height: 36px;
    padding: 0 12px;
    flex-wrap: wrap;
    gap: 0;
  }
  .phase-tab {
    padding: 0 10px;
    font-size: 10px;
  }
  .chart-controls {
    gap: 4px;
  }
  .tf-btn {
    padding: 3px 6px;
    font-size: 9px;
  }
  .inst-group {
    margin-left: 4px;
  }

  /* Bottom drawer: collapsed by default */
  .bottom-drawer.expanded {
    height: 160px;
  }
  .drawer-stats {
    gap: 8px;
  }
  .d-stat:nth-child(n+4) {
    display: none;
  }
  .d-stat-label {
    font-size: 8px;
  }
  .d-stat-val {
    font-size: 11px;
  }
  .drawer-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 8px;
    gap: 6px;
  }

  /* Ticker */
  .ticker {
    padding: 0 12px;
    font-size: 10px;
  }

  /* Toasts: full width */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 40px;
  }
  .toast {
    min-width: auto;
    max-width: none;
  }

  /* Briefing / review grids: single column */
  .briefing-view > div,
  #briefing-view > div {
    grid-template-columns: 1fr !important;
  }
  .review-view > div,
  #review-view > div {
    grid-template-columns: 1fr !important;
  }
  /* Review cards that span full row: reset */
  #review-view .drawer-card[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  /* Settings modal: near full-screen */
  .settings-drawer { width: 340px; }

  /* Touch-friendly targets */
  .nav-item {
    min-height: 44px;
  }
  .filter-pill {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .quick-prompt {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* ─── Phone (<600px) ─── */
@media (max-width: 600px) {
  /* AI bar: compact single row */
  .ai-bar {
    padding: 6px 8px 6px 52px;
    gap: 6px;
  }
  .ai-summary {
    min-width: 0;
    flex: 1;
  }
  .ai-headline {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ai-confirmations {
    display: none;
  }
  .session-info {
    display: none;
  }

  /* Phase bar: wrap to two rows */
  .phase-bar {
    padding: 4px 8px;
    gap: 2px;
  }
  .phase-tab {
    padding: 4px 8px;
    font-size: 9px;
    min-height: 32px;
  }
  .phase-spacer {
    flex-basis: 100%;
    height: 0;
  }
  .chart-controls {
    width: 100%;
    justify-content: center;
    padding: 2px 0;
  }

  /* Bottom drawer: hidden by default */
  .bottom-drawer {
    display: none;
  }
  .bottom-drawer.expanded {
    display: block;
    height: auto;
    max-height: 50vh;
    overflow-y: auto;
  }

  /* Ticker: smaller */
  .ticker {
    height: 24px;
    font-size: 9px;
    padding: 0 8px;
  }
  .ticker-tag {
    font-size: 8px;
  }

  /* Chat drawer: narrower on phone */
  .ai-chat-drawer.visible {
    width: 280px;
  }
  .chat-bubble {
    max-width: 92%;
    font-size: 12px;
  }

  /* Setup panel: wider on phone */
  .setup-panel {
    width: 100vw;
    max-width: 100vw;
  }

  /* Settings */
  .settings-drawer {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  /* Briefing / review within phone */
  #briefing-view > div,
  #review-view > div {
    gap: 8px !important;
    padding: 0 !important;
  }
  .drawer-card {
    padding: 10px;
  }
  .dc-row {
    font-size: 10px;
  }

  /* Touch targets */
  .tf-btn {
    min-height: 36px;
    min-width: 32px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .drawer-handle {
    min-height: 44px;
    padding: 0 12px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   ASK JAYNE AI CHAT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Ask Jayne Button ── */
.ask-jayne-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #ec4899);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.ask-jayne-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── AI Chat Drawer (right-side flex panel, pushes layout) ── */
.ai-chat-drawer {
  width: 0;
  overflow: hidden;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-drawer.visible {
  width: 360px;
}

.ai-chat-drawer.minimized {
  width: 0;
}

/* When chat is open, auto-collapse the nav rail to make room */
body:has(.ai-chat-drawer.visible) .nav-rail {
  width: var(--rail-collapsed, 56px);
}
body:has(.ai-chat-drawer.visible) .nav-rail .nav-label,
body:has(.ai-chat-drawer.visible) .nav-rail .logo-text,
body:has(.ai-chat-drawer.visible) .nav-rail .watchlist-name,
body:has(.ai-chat-drawer.visible) .nav-rail .watchlist-full,
body:has(.ai-chat-drawer.visible) .nav-rail .micro-toggle {
  width: 0;
  overflow: hidden;
  opacity: 0;
}

.chat-minimize-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 36px;
  height: 80px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  transition: opacity 0.2s;
  opacity: 0;
  pointer-events: none;
  z-index: 400;
}

.ai-chat-drawer.minimized ~ .chat-minimize-tab,
.chat-minimize-tab.show {
  opacity: 1;
  pointer-events: all;
}

.ai-chat-drawer.visible .chat-minimize-tab {
  opacity: 0;
  pointer-events: none;
}

.chat-header-minimize {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}
.chat-header-minimize:hover { color: var(--text); border-color: var(--border2); }

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.chat-header-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
  font-family: inherit;
}

.chat-header-clear:hover { color: var(--text); border-color: var(--border2); }

.chat-header-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

.chat-header-close:hover { color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-welcome {
  text-align: center;
  padding: 40px 20px;
}

.chat-welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.chat-welcome-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.chat-welcome-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-user {
  background: rgba(236,72,153,0.1);
  border: 1px solid rgba(236,72,153,0.15);
  color: var(--text);
  align-self: flex-end;
  border-radius: 12px 12px 2px 12px;
}

.chat-assistant {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  align-self: flex-start;
  border-radius: 12px 12px 12px 2px;
}

.chat-loading {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
}

.chat-loading .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-dot-pulse 1.4s ease-in-out infinite;
}

.chat-loading .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.chat-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
}

.quick-prompt {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.quick-prompt:hover {
  border-color: rgba(236,72,153,0.3);
  color: #ec4899;
  background: rgba(236,72,153,0.05);
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus { border-color: #ec4899; }

.chat-input::placeholder { color: var(--dim); }

.chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.chat-send:hover { opacity: 0.85; }

/* chat drawer width handled in responsive section above */


/* ═══════════════════════════════════════════════════════════════════════════
   NEWS BUTTON & DRAWER
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── News Button (top bar) ── */
.news-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.08);
  color: #3b82f6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.news-btn:hover {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.5);
}

/* ── News Drawer (right-side flex panel, pushes layout) ── */
.news-drawer {
  width: 0;
  overflow: hidden;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.news-drawer.visible {
  width: 320px;
}

/* When news drawer is open, auto-collapse the nav rail */
body:has(.news-drawer.visible) .nav-rail {
  width: var(--rail-collapsed, 56px);
}
body:has(.news-drawer.visible) .nav-rail .nav-label,
body:has(.news-drawer.visible) .nav-rail .logo-text,
body:has(.news-drawer.visible) .nav-rail .watchlist-name,
body:has(.news-drawer.visible) .nav-rail .watchlist-full,
body:has(.news-drawer.visible) .nav-rail .micro-toggle {
  width: 0;
  overflow: hidden;
  opacity: 0;
}

.news-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.news-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.news-drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.news-drawer-close:hover { color: var(--text); }

.news-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-drawer-item {
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
}

.news-drawer-item .news-time {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.news-drawer-item .news-impact-high {
  color: var(--warn);
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SETUP FILTER PILLS
   ═══════════════════════════════════════════════════════════════════════════ */
.setup-filters {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-pill {
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-pill:hover { border-color: var(--border2); color: var(--text); }
.filter-pill.active { background: var(--pink, #ec4899); border-color: transparent; color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   COUNTDOWN ON PRICE AXIS
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-countdown-axis {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(207,86,161,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums;
  padding: 2px 4px;
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
  letter-spacing: 0.5px;
  transition: top 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETUP CONTROLS (sort + type filters)
   ═══════════════════════════════════════════════════════════════════════════ */
.setup-controls {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setup-controls .setup-filters {
  border-bottom: none;
  padding: 0;
}
.setup-type-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.type-pill {
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.type-pill:hover { border-color: var(--border2); color: var(--text); }
.type-pill.active { background: var(--lavender); border-color: transparent; color: #fff; }

.setup-sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sort-select {
  flex: 1;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--pink); }

/* Signal filter pills */
.signal-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.signal-pill {
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.signal-pill:hover { border-color: var(--border2); color: var(--text); }
.signal-pill.active { background: var(--bull); border-color: transparent; color: #fff; }

/* Distance badge on setup cards */
.setup-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dist-badge {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg4);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums;
}
.htf-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.htf-confirmed { color: var(--bull); background: rgba(163,235,72,0.12); }
.htf-neutral   { color: var(--muted); background: var(--bg4); }
.htf-against   { color: var(--bear); background: rgba(255,77,106,0.12); }

/* Entry confirmation on setup cards */
.setup-confirmation {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.setup-confirmation.waiting {
  color: var(--warn, #f59e0b);
  background: rgba(245,158,11,0.1);
}
.setup-confirmation.confirmed {
  color: var(--bull);
  background: rgba(163,235,72,0.1);
}
.take-trade-btn.waiting {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface, #1a1d24);
  color: var(--muted);
}

/* ── Review Detail Slide-Out Panel ──────────────────────── */
.review-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  animation: slide-in-right 0.2s ease-out;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.review-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.review-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.review-detail-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.review-detail-close:hover { background: var(--bg4); color: var(--text); }
.review-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.review-detail-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.review-detail-actions .btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}
.btn-took-trade {
  background: var(--bull);
  color: #000;
}
.btn-took-trade:hover { filter: brightness(1.1); }
.btn-pass {
  background: var(--bg4);
  color: var(--muted);
}
.btn-pass:hover { background: var(--bg3); color: var(--text); }
.review-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--bg3);
}
.review-detail-row .label { color: var(--muted); }
.review-detail-row .value { color: var(--text); font-weight: 600; }
.review-detail-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.review-detail-note {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px;
  font-size: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  resize: vertical;
  min-height: 60px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS GEAR IN TOP BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.topbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.topbar-icon-btn:hover {
  background: var(--nav-hover);
  border-color: var(--border2);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERLAY TOGGLE ROWS IN SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Overlay rows in settings drawer ─── */
.overlay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.overlay-row:last-child { border-bottom: none; }
.overlay-row-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.overlay-row-label { font-size: 12px; font-weight: 500; color: var(--text); }
.overlay-row-desc { font-size: 9px; color: var(--muted); }

/* Color swatch picker */
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border2);
  padding: 0;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
  -webkit-appearance: none;
}
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 4px; }

/* Color row (candle colors) */
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.color-row-label { font-size: 12px; font-weight: 500; color: var(--text2); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-track-sm {
  display: block;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg4);
  transition: background 0.2s;
  position: relative;
}
.toggle-thumb-sm {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track-sm {
  background: var(--pink);
}
.toggle-switch input:checked + .toggle-track-sm .toggle-thumb-sm {
  transform: translateX(16px);
  background: #fff;
}

/* Settings grid (2-col for prop firm) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Profile chips */
.profile-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
}
.profile-chip.active { border-color: var(--pink); color: var(--pink); }
.profile-load-btn {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.profile-load-btn:hover { border-color: var(--pink); color: var(--pink); }

.overlay-checkbox { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   TAKE TRADE BUTTON + ACTIVE TRADE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.explainer-actions {
  padding: 12px 0 0;
}
.take-trade-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.take-trade-btn:hover { opacity: 0.85; }
.take-trade-btn.taken {
  background: var(--bg4);
  color: var(--muted);
  cursor: default;
}
.take-trade-btn.taken:hover { opacity: 1; }

/* Active trade cards */
.setup-card.active-trade {
  border: 2px solid var(--pink);
  background: rgba(207,86,161,0.04);
}
.active-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
  background: var(--pink-dim);
  padding: 2px 6px;
  border-radius: 4px;
}
.active-pnl {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums;
  padding: 6px 0 4px;
}
.close-trade-btn {
  width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.close-trade-btn:hover {
  border-color: var(--bear);
  color: var(--bear);
}
.active-trades-header {
  font-size: 9px;
  font-weight: 600;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px 6px;
}
.active-trades-separator {
  height: 1px;
  background: var(--border2);
  margin: 8px 12px;
}
.g-a { background: var(--bull-dim); color: var(--bull); }
.g-b { background: var(--warn-dim); color: var(--warn); }
.g-c { background: rgba(107,116,133,0.15); color: var(--muted); }

/* ─── Loading overlay ─── */
.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  z-index: 20;
  transition: opacity 0.4s ease;
  text-align: center;
}
.chart-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.chart-loading .overlay-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.chart-loading .overlay-detail {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}
.chart-loading .overlay-loading-icon,
.chart-loading .overlay-error-icon {
  display: none;
}
.chart-loading .overlay-retry {
  display: none;
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chart-loading .overlay-retry:hover {
  background: var(--bg);
  border-color: var(--pink);
}

/* Loading state: spinner + heading + detail */
.chart-loading[data-state="loading"] .overlay-loading-icon { display: flex; }

/* Error state: red icon + retry button */
.chart-loading[data-state="error"] .overlay-error-icon {
  display: flex;
  color: var(--bear, #ef4444);
}
.chart-loading[data-state="error"] .overlay-heading { color: var(--bear, #ef4444); }
.chart-loading[data-state="error"] .overlay-retry { display: inline-block; }

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Confetti ─── */
.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}
.loading-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACKTEST DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */
.bt-controls {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.bt-controls-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.bt-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin-right: 8px;
}
.bt-field { display: flex; align-items: center; gap: 6px; }
.bt-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.bt-select, .bt-input {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text); font-size: 12px; font-family: inherit; outline: none;
}
.bt-select:focus, .bt-input:focus { border-color: var(--pink); }
.bt-run-btn {
  padding: 8px 24px; border-radius: 8px; border: none;
  background: var(--pink); color: #fff; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: opacity 0.15s;
}
.bt-run-btn:hover { opacity: 0.85; }
.bt-export-btn {
  padding: 6px 16px; border-radius: 6px; border: 1px solid var(--border2);
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.bt-export-btn:hover { border-color: var(--pink); color: var(--pink); }

.bt-progress-track {
  height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; margin-top: 12px;
}
.bt-progress-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--lavender));
  border-radius: 3px; transition: width 0.3s;
}
.bt-progress-text { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Results layout */
.bt-results { padding: 20px 24px; }
.bt-section { margin-bottom: 24px; }
.bt-section-label {
  font-size: 10px; font-weight: 700; color: var(--pink); text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.bt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bt-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.bt-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 16px;
}
.bt-card-title {
  font-size: 10px; font-weight: 600; color: var(--dim); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 10px;
}

/* Radial gauges */
.bt-gauges {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.bt-gauge {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 16px 8px;
}
.bt-gauge-ring {
  width: 72px; height: 72px; position: relative;
}
.bt-gauge-ring svg { transform: rotate(-90deg); }
.bt-gauge-ring circle {
  fill: none; stroke-width: 6; stroke-linecap: round;
}
.bt-gauge-ring .bg { stroke: var(--bg4); }
.bt-gauge-ring .fg { transition: stroke-dashoffset 0.8s ease; }
.bt-gauge-value {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.bt-gauge-label {
  font-size: 9px; font-weight: 600; color: var(--dim); text-transform: uppercase;
  letter-spacing: 0.08em; text-align: center;
}

/* Heatmap */
.bt-heatmap { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.bt-heatmap-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
}
.bt-heatmap-grid .bt-heat-cell {
  border-radius: 6px; padding: 6px 4px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; min-height: 48px;
}
.bt-heatmap-grid .bt-heat-hour { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85); }
.bt-heatmap-grid .bt-heat-wr { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.95); }
.bt-heatmap-grid .bt-heat-ct { font-size: 8px; font-weight: 500; color: rgba(255,255,255,0.4); }
.bt-heat-cell {
  aspect-ratio: 1; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 600; color: rgba(255,255,255,0.7); position: relative;
}
.bt-heat-label {
  font-size: 8px; color: var(--dim); text-align: center; margin-top: 2px;
}
.bt-heatmap-labels {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 4px;
}

/* Session bars */
.bt-session-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.bt-session-name { font-size: 11px; color: var(--text2); width: 70px; flex-shrink: 0; }
.bt-bar-track {
  flex: 1; height: 20px; background: var(--bg4); border-radius: 4px; overflow: hidden; position: relative;
}
.bt-bar-fill {
  height: 100%; border-radius: 4px; transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
}
.bt-bar-value {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 700; color: var(--text);
}
.bt-bar-count { font-size: 10px; color: var(--dim); width: 50px; text-align: right; flex-shrink: 0; }

/* Signal lift bars */
.bt-lift-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.bt-lift-name { font-size: 11px; color: var(--text2); width: 80px; flex-shrink: 0; }
.bt-lift-track { flex: 1; height: 14px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.bt-lift-fill { height: 100%; border-radius: 3px; background: var(--bull); transition: width 0.6s; }
.bt-lift-value { font-size: 10px; font-weight: 600; width: 50px; text-align: right; flex-shrink: 0; }

/* Grade bars */
.bt-grade-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.bt-grade-label { font-size: 13px; font-weight: 700; width: 24px; flex-shrink: 0; }
.bt-grade-track { flex: 1; height: 22px; background: var(--bg4); border-radius: 4px; overflow: hidden; position: relative; }
.bt-grade-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.bt-grade-pct {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; color: var(--text);
}
.bt-grade-count { font-size: 10px; color: var(--dim); width: 40px; text-align: right; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* RADAR SCANNER                                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.radar-view { background: var(--bg); }

.radar-header { margin-bottom: 20px; }
.radar-title-row { display: flex; align-items: center; gap: 12px; }
.radar-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.radar-status {
  font-size: 10px; font-weight: 600; color: var(--muted);
  padding: 2px 8px; border-radius: 10px;
  background: var(--bg4); text-transform: uppercase; letter-spacing: 0.05em;
}
.radar-status.radar-live {
  color: var(--bull); background: rgba(163,235,72,0.1);
}
.radar-subtitle { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* Radar controls */
.radar-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.radar-filters { display: flex; gap: 4px; }
.radar-sort-row { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Radar mini chart */
.radar-chart-row {
  margin-bottom: 16px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; overflow: hidden;
}
.radar-chart-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.radar-chart-symbol { font-size: 14px; font-weight: 700; color: var(--text); }
.radar-chart-close {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.radar-chart-close:hover { background: var(--bg4); color: var(--text); }

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.radar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.radar-card:hover {
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(207,86,161,0.15);
}
.radar-card-selected {
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(207,86,161,0.25);
  background: var(--bg3);
}

.radar-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.radar-symbol { font-size: 16px; font-weight: 700; color: var(--text); }
.radar-grade {
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 2px 8px; border-radius: 6px;
}

.radar-card-setup {
  font-size: 13px; font-weight: 600; margin-bottom: 10px;
}

.radar-card-levels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}
.radar-level {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; padding: 2px 0;
}
.radar-label { color: var(--muted); }
.radar-level span:last-child { color: var(--text); font-weight: 500; }

.radar-card-meta {
  display: flex; gap: 8px; margin-top: 8px;
  font-size: 9px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Empty state */
.radar-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
}
.radar-empty-icon { margin-bottom: 16px; opacity: 0.4; }
.radar-empty-text { font-size: 14px; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.radar-empty-sub { font-size: 12px; color: var(--muted); }

@media (max-width: 768px) {
  .radar-grid { grid-template-columns: 1fr; }
}
