/* ═══════════════════════════════════════════════════════════════════════════
   VARIABLES & DESIGN SYSTEM
════════════════════════════════════════════════════════════════════════════ */
:root {
  --bg-app: #080a14;
  --bg-sidebar: #0c0f1c;
  --bg-card: rgba(18, 22, 42, 0.7);
  --bg-card-hover: rgba(26, 32, 60, 0.9);
  --glass-border: rgba(255, 255, 255, 0.08);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #cbd5e1;

  --accent: #7c6af5;
  --accent-glow: rgba(124, 106, 245, 0.4);

  --c-green: #22c55e;
  --c-green-bg: rgba(34, 197, 94, 0.15);
  --c-red: #ef4444;
  --c-red-bg: rgba(239, 68, 68, 0.15);
  --c-yellow: #f59e0b;
  --c-yellow-bg: rgba(245, 158, 11, 0.15);

  --s-strong-buy: #10b981;
  --s-buy: #34d399;
  --s-neutral: #94a3b8;
  --s-sell: #fb7185;
  --s-strong-sell: #e11d48;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 80px;

  --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow: hidden; }
body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(124, 106, 245, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
}

h1, h2, h3, h4 { font-weight: 600; }
a { text-decoration: none; color: inherit; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .logo-title, 
.sidebar.collapsed .logo-sub, 
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-disclaimer,
.sidebar.collapsed .market-status-box { display: none; }

.sidebar-logo {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-close-btn {
  display: none; /* hidden on desktop */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mobile-close-btn:hover { background: rgba(255,255,255,0.2); }

.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.logo-title { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.logo-sub { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all 0.2s;
  font-weight: 500;
}
.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(124, 106, 245, 0.15) 0%, transparent 100%);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}
.nav-icon { font-size: 20px; }

.sidebar-footer { padding: 24px; border-top: 1px solid var(--glass-border); font-size: 12px; }
.market-status-box { margin-bottom: 12px; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.mkt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.mkt-dot.green { background: var(--c-green); box-shadow: 0 0 8px var(--c-green); }
.mkt-dot.red { background: var(--c-red); box-shadow: 0 0 8px var(--c-red); }
.sidebar-disclaimer { color: rgba(255,255,255,0.3); line-height: 1.4; }

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

.topbar {
  height: 72px;
  flex-shrink: 0;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(8, 10, 20, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 20px; }

.search-box {
  display: flex;
  align-items: center;
}
.search-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  width: 180px;
  transition: width 0.3s ease, background 0.3s ease;
}
.search-box input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  width: 240px;
}
.live-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); animation: live-pulse 2s infinite; }
.live-dot.live-loading { background: var(--c-yellow); animation-duration: 0.8s; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); } 50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); } }
.sidebar-toggle {
  font-size: 22px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 200;
}
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.page-title { font-size: 24px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.clock-badge {
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-dark);
  font-family: monospace;
}
.last-updated { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
#moonshotScanStatus { display: inline-block; vertical-align: middle; max-width: 140px; white-space: normal; line-height: 1.2; font-size: 11px; margin-left: 8px; }

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}
.refresh-btn:hover { background: #6b5ce0; box-shadow: 0 0 15px var(--accent-glow); }
.refresh-btn span { font-size: 16px; }

/* Sections (Tabs) */
.main-section {
  display: none;
  flex: 1;
  min-height: 0; /* Critical: allows flex child to shrink and enable overflow-y:auto */
  overflow-y: auto;
  padding: 32px;
}
.main-section.active { display: flex; flex-direction: column; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-block { margin-bottom: 48px; }
.section-heading { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-heading h2 { font-size: 22px; color: #fff; }
.section-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SUMMARY BAR
════════════════════════════════════════════════════════════════════════════ */
.summary-bar {
  display: flex;
  gap: 32px;
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; gap: 4px; }
.summary-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.summary-value { font-size: 24px; font-weight: 700; }
.summary-count { font-size: 24px; font-weight: 700; }
.summary-count.strong-buy { color: var(--s-strong-buy); }
.summary-count.buy { color: var(--s-buy); }
.summary-count.neutral { color: var(--s-neutral); }
.summary-count.sell { color: var(--s-sell); }
.summary-count.strong-sell { color: var(--s-strong-sell); }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER TABS
════════════════════════════════════════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
}
.filter-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.filter-tab:hover { color: #fff; }
.filter-tab.active { background: var(--glass-border); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   ASSET CARDS
════════════════════════════════════════════════════════════════════════════ */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.top-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Dense mode for massive lists (e.g. 26 moonshot results) */
.assets-grid.dense-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.assets-grid.dense-grid .asset-card {
  padding: 14px;
}
.assets-grid.dense-grid .price-main {
  font-size: 20px;
}
.assets-grid.dense-grid .sparkline-wrap {
  height: 40px;
  margin: 0 -14px 12px -14px;
}
.assets-grid.dense-grid .ind-chip {
  padding: 6px;
}
.assets-grid.dense-grid .card-indicators {
  margin-bottom: 12px;
}
.assets-grid.dense-grid .card-header {
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.assets-grid.dense-grid .card-title-row {
  width: 100%;
}
.assets-grid.dense-grid .signal-badge {
  align-self: flex-start;
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.asset-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.asset-card:focus-visible { outline: 2px solid var(--accent); }

/* Card signal borders */
.signal-border-strong-buy { border-top: 3px solid var(--s-strong-buy); }
.signal-border-buy { border-top: 3px solid var(--s-buy); }
.signal-border-neutral { border-top: 3px solid var(--s-neutral); }
.signal-border-sell { border-top: 3px solid var(--s-sell); }
.signal-border-strong-sell { border-top: 3px solid var(--s-strong-sell); }

/* Card Header */
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 10px; }
.card-title-row { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.asset-icon { font-size: 24px; min-width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; }
.asset-icon.lg { font-size: 36px; min-width: 64px; height: 64px; }
.asset-meta { min-width: 0; flex: 1; overflow: hidden; }
.asset-name { font-weight: 600; font-size: 16px; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-symbol { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badges { display:flex; align-items:center; gap:6px; margin-top: 6px; flex-wrap: wrap; }
.cat-badge-inline,
.winner-tier-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; color: var(--text-dark); white-space: nowrap; }
.cat-badge-inline { background: rgba(0,0,0,0.4); }
.winner-tier-core { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.winner-tier-probation { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.star-btn { margin-left: 8px !important; line-height: 1; }

/* Signal Badges */
.signal-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.signal-badge.sm { padding: 4px 8px; font-size: 10px; }
.signal-badge.lg { padding: 8px 16px; font-size: 14px; }
.signal-badge span { font-size: 14px; }

.signal-strong-buy { background: rgba(16, 185, 129, 0.15); color: var(--s-strong-buy); border: 1px solid rgba(16, 185, 129, 0.3); }
.signal-buy { background: rgba(52, 211, 153, 0.1); color: var(--s-buy); border: 1px solid rgba(52, 211, 153, 0.2); }
.signal-neutral { background: rgba(148, 163, 184, 0.1); color: var(--s-neutral); border: 1px solid rgba(148, 163, 184, 0.2); }
.signal-sell { background: rgba(251, 113, 133, 0.1); color: var(--s-sell); border: 1px solid rgba(251, 113, 133, 0.2); }
.signal-strong-sell { background: rgba(225, 29, 72, 0.15); color: var(--s-strong-sell); border: 1px solid rgba(225, 29, 72, 0.3); }

.signal-bg-strong-buy { background: var(--s-strong-buy); }
.signal-bg-buy { background: var(--s-buy); }
.signal-bg-neutral { background: var(--s-neutral); }
.signal-bg-sell { background: var(--s-sell); }
.signal-bg-strong-sell { background: var(--s-strong-sell); }

/* Pulse animation for strong signals */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(var(--rgb), 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(var(--rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--rgb), 0); }
}
.signal-badge.pulse.signal-strong-buy { --rgb: 16, 185, 129; animation: pulseGlow 2s infinite; }
.signal-badge.pulse.signal-strong-sell { --rgb: 225, 29, 72; animation: pulseGlow 2s infinite; }

/* Prices */
.card-price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.price-main { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.price-changes { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.price-change { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px; }
.price-change.pos { color: var(--c-green); background: var(--c-green-bg); }
.price-change.neg { color: var(--c-red); background: var(--c-red-bg); }
.price-change.flat { color: var(--text-muted); background: rgba(255,255,255,0.05); }
.value-updated { animation: number-pop 1.8s cubic-bezier(0.22, 1, 0.36, 1); transform-origin: center left; }
.card-indicators.value-updated .ind-chip:nth-child(1) { animation: number-pop 1.4s 0.18s both; }
.card-indicators.value-updated .ind-chip:nth-child(2) { animation: number-pop 1.4s 0.36s both; }
.card-indicators.value-updated .ind-chip:nth-child(3) { animation: number-pop 1.4s 0.54s both; }
@keyframes number-pop { 0% { opacity: 0.55; transform: translateY(4px) scale(0.96); } 55% { opacity: 1; transform: translateY(-1px) scale(1.04); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* Sparklines Container */
.sparklines-container { display: flex; gap: 8px; margin: 0 -12px 16px -12px; }
.sparkline-col { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); padding: 4px; border: 1px solid rgba(255,255,255,0.03); height: 56px; overflow: hidden; position: relative; }
.sparkline-col canvas { position: absolute; left: 4px; right: 4px; bottom: 4px; top: 18px; width: calc(100% - 8px) !important; height: calc(100% - 22px) !important; }
.spark-label { font-size: 9px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; text-align: center; letter-spacing: 1px; font-weight: 600; position: relative; z-index: 1; }
.sparklines-container.value-updated canvas { animation: chart-refresh 2.8s ease-out; }
@keyframes chart-refresh { 0% { filter: brightness(1.45); } 100% { filter: brightness(1); } }

/* Indicators */
.card-indicators { display: flex; gap: 8px; margin-bottom: 16px; }
.ind-chip {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  border: 1px solid var(--glass-border);
}
.ind-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.ind-val { display: block; font-size: 14px; font-weight: 600; color: #fff; }
.ind-val.pos { color: var(--c-green); }
.ind-val.neg { color: var(--c-red); }

/* Confidence Bar */
.confidence-bar-wrap { margin-bottom: 12px; }
.confidence-bar { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 2px; transition: width 1s ease; }

/* Stop-loss / take-profit levels */
.stop-levels { margin-bottom: 8px; }
.stop-levels-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stop-chip {
  flex: 1;
  min-width: 120px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.stop-chip-sl { background: var(--c-red-bg); color: var(--c-red); border: 1px solid rgba(239, 68, 68, 0.35); }
.stop-chip-tp { background: var(--c-green-bg); color: var(--c-green); border: 1px solid rgba(34, 197, 94, 0.35); }
.qt-meta { flex-basis: 100%; color: var(--text-muted); font-size: 10px; text-align: center; }

.card-footer { font-size: 12px; color: var(--accent); text-align: center; opacity: 0; transition: opacity 0.2s; font-weight: 600; margin-top: 8px;}
.asset-card:hover .card-footer { opacity: 1; }
.asset-card.data-updated { animation: data-refresh 2.8s ease-out; }
@keyframes data-refresh { 0% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.8), var(--shadow-glow); } 100% { box-shadow: var(--shadow-glow); } }

/* Motion is tied to fetched data; the tape never invents prices. */
.live-tape { display: flex; align-items: center; gap: 14px; margin: 16px 0 24px; padding: 10px 14px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); background: rgba(8, 10, 20, 0.55); }
.live-tape-label { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.live-tape-window { min-width: 0; overflow: hidden; }
.live-tape-track { display: flex; width: max-content; gap: 28px; }
.live-tape-track.moving { animation: tape-scroll 36s linear infinite; }
.tape-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.tape-item strong { color: var(--text-main); }
.tape-item em { font-style: normal; font-weight: 700; }
.tape-item .pos { color: var(--c-green); }
.tape-item .neg { color: var(--c-red); }
@keyframes tape-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Trade Quality Badges */
.trade-quality-badge {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.quality-golden {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.1));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.quality-core {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(45, 212, 191, 0.12));
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.45);
}
.quality-probation {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.1));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.quality-risky {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.1));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.quality-mild {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.1));
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.quality-avoid {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(156, 163, 175, 0.08));
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.no-data { grid-column: 1 / -1; text-align: center; padding: 60px; color: var(--text-muted); font-size: 18px; background: var(--glass-border); border-radius: var(--radius-lg); }
.card-error { font-size: 12px; color: var(--c-red); margin-top: 8px; text-align: center; }

/* Skeleton */
.skeleton {
  min-height: 280px;
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
body.modal-open { overflow: hidden; }

.modal-box {
  background: var(--bg-app);
  width: 95%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }

.modal-close-btn {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  z-index: 10;
  transition: background 0.2s;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.modal-scroll {
  padding: 40px;
  overflow-y: auto;
}
.modal-scroll::-webkit-scrollbar { width: 8px; }
.modal-scroll::-webkit-scrollbar-track { background: transparent; }
.modal-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Modal Content */
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; flex-wrap: wrap; gap: 24px; }
.modal-title-row { display: flex; align-items: center; gap: 20px; }
.modal-title-row h2 { font-size: 32px; margin-bottom: 4px; display: flex; align-items: center; gap: 12px; }
.modal-symbol { font-size: 16px; font-weight: 500; color: var(--text-muted); background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 6px; }
.modal-meta { font-size: 14px; color: var(--accent); font-weight: 500; }
.modal-prices { text-align: right; }
.modal-price { font-size: 48px; font-weight: 800; line-height: 1; letter-spacing: -1px; margin-bottom: 8px; }

.oco-panel {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}
.oco-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.oco-status { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.oco-ready { color: var(--c-green); }
.oco-warning { color: var(--c-yellow); }
.oco-muted { color: var(--text-muted); font-size: 13px; }
.oco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 11px; color: var(--text-muted); }
.oco-grid strong { display: block; color: var(--text-main); font-size: 13px; margin-top: 2px; }
.oco-panel small { display: block; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }

.modal-recommendation {
  background: rgba(124, 106, 245, 0.08);
  border: 1px solid var(--accent-glow);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.modal-indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.ind-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  padding: 20px;
  border-radius: var(--radius-md);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ind-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; }
.ind-detail-value { font-size: 13px; color: var(--text-dark); margin-bottom: 12px; }
.ind-detail-value strong { color: #fff; font-size: 15px; }
.ind-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Custom RSI Gauge in modal */
.rsi-gauge {
  height: 6px;
  background: linear-gradient(90deg, var(--c-green) 0%, var(--c-green) 30%, var(--text-muted) 30%, var(--text-muted) 70%, var(--c-red) 70%, var(--c-red) 100%);
  border-radius: 3px;
  position: relative;
  margin: 16px 0;
}
.rsi-thumb {
  position: absolute;
  top: 50%;
  left: var(--rsi);
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transition: left 1s ease;
}

/* Modal Charts */
.modal-charts h3 { font-size: 16px; color: var(--text-dark); margin-bottom: 12px; margin-top: 24px; font-weight: 500;}
.chart-wrap { background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 24px; position: relative; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.modal-education { margin-top: 40px; border-top: 1px solid var(--glass-border); padding-top: 32px; }
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px;}
.edu-card { background: rgba(255,255,255,0.03); padding: 20px; border-radius: var(--radius-md); }
.edu-icon { font-size: 24px; margin-bottom: 12px; }
.edu-card h4 { margin-bottom: 8px; color: #fff; }
.edu-card p { font-size: 13px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   EDUCATION SECTION (Full Page)
════════════════════════════════════════════════════════════════════════════ */
.edu-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
}
.edu-full-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 32px;
  border-radius: var(--radius-lg);
}
.edu-full-card.highlight-card {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-card) 100%);
}
.edu-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 20px; }
.edu-full-card p { color: var(--text-dark); margin-bottom: 20px; font-size: 15px;}
.edu-full-card ul { padding-left: 24px; margin-bottom: 24px; }
.edu-full-card li { color: var(--text-muted); margin-bottom: 12px; font-size: 15px; }
.edu-full-card strong.green { color: var(--s-buy); }
.edu-full-card strong.yellow { color: var(--c-yellow); }
.edu-full-card strong.red { color: var(--s-sell); }
.edu-tip {
  background: rgba(255,255,255,0.05);
  padding: 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 14px;
  color: var(--text-main);
}
.edu-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.edu-table th, .edu-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--glass-border); font-size: 15px;}
.edu-table th { color: #fff; font-weight: 600; }
.edu-table td.green { color: var(--c-green); }
.edu-table td.red { color: var(--c-red); }

/* ═══════════════════════════════════════════════════════════════════════════
   RISK CALCULATOR
════════════════════════════════════════════════════════════════════════════ */
.risk-calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.glass {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 32px;
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-dark); font-weight: 500; font-size: 14px;}
.form-group input {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-group small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 6px; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  padding: 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s;
  margin-top: 10px;
}
.btn-primary:hover { background: #6b5ce0; box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-2px); }

.risk-results h3 { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--glass-border); }
.risk-result-grid { display: flex; flex-direction: column; gap: 16px; }
.risk-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
}
.risk-item span { color: var(--text-muted); font-size: 14px;}
.risk-item strong { font-size: 18px; color: #fff; }
.risk-item.highlight { background: rgba(124, 106, 245, 0.15); border: 1px solid var(--accent-glow); }
.risk-item.highlight strong { color: var(--accent); font-size: 24px; }
.risk-item.warn strong { color: var(--c-red); }
.risk-item.good strong { color: var(--c-green); }
.risk-placeholder { color: var(--text-muted); text-align: center; padding: 40px 0; font-style: italic; }
.risk-error { color: var(--c-red); padding: 16px; background: var(--c-red-bg); border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY & TOASTS
════════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-app);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loader-content { text-align: center; }
.loader-spinner {
  width: 60px; height: 60px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.loader-sub { color: var(--text-muted); }

.toast-container { position: fixed; bottom: 32px; right: 32px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--glass-border); padding: 16px 24px;
  border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-weight: 500;
  transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid var(--c-green); }
.toast-warning { border-left: 4px solid var(--c-yellow); }
.toast-error { border-left: 4px solid var(--c-red); }
.toast-info { border-left: 4px solid var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .chart-row { grid-template-columns: 1fr; }
  .risk-calc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { position: absolute; height: 100%; transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 16px; flex-wrap: wrap; gap: 12px; height: auto; padding-top: 16px; padding-bottom: 16px; }
  .topbar-left { width: 100%; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .page-title { font-size: 20px; white-space: normal; }
  .main-section { padding: 16px; }
  .summary-bar { gap: 12px; padding: 16px; justify-content: flex-start; flex-wrap: wrap; }
  .summary-item { flex: 1 1 calc(50% - 12px); min-width: 120px; }
  .clock-badge { display: none; }
  .live-tape { margin: 12px 0 18px; }
  .live-tape-label { font-size: 9px; }
  .modal-scroll { padding: 20px; }
  .modal-title-row { flex-direction: column; align-items: flex-start; gap: 12px;}
  .modal-prices { text-align: left; margin-top: 16px;}
  .filter-tabs { flex-wrap: wrap; gap: 8px; }
  .mobile-close-btn { display: flex; }
  
  /* Fixes for other tabs */
  .portfolio-header { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px; }
  .edu-full-grid { grid-template-columns: 1fr; }
  .edu-full-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .live-tape-track.moving, .asset-card.data-updated { animation: none; }
}
/* --- PORTFOLIO TAB STYLES ---------------------------------------------- */
.portfolio-header {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); padding: 24px;
  border-radius: 12px; margin-bottom: 24px;
}
.balance-card { display: flex; flex-direction: column; gap: 4px; }
.balance-label { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.balance-value { font-size: 32px; font-weight: 700; color: var(--accent); }
.portfolio-risk-summary { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.portfolio-risk-summary strong { color: var(--text-main); }
.portfolio-risk-summary small { color: var(--text-muted); }
.portfolio-risk-summary.risk-warning small { color: var(--c-yellow); }
.portfolio-risk-summary.risk-ok small { color: var(--c-green); }
.risk-levels { color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.portfolio-content { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .portfolio-content { grid-template-columns: 1fr 1fr; } }
.portfolio-col h3 { margin: 0 0 16px 0; font-size: 18px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.portfolio-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.portfolio-table th { padding: 12px 16px; background: rgba(0,0,0,0.2); color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.portfolio-table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.portfolio-table tbody tr:last-child td { border-bottom: none; }
.portfolio-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.portfolio-table td.pos { color: var(--success); font-weight: 600; }
.portfolio-table td.neg { color: var(--danger); font-weight: 600; }
.pnl-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.pnl-badge.pos { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.pnl-badge.neg { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.filterable { cursor: pointer; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s; position: relative; opacity: 0.8; }
.filterable:hover { transform: translateY(-4px); opacity: 1; }
.filterable.active { opacity: 1; transform: scale(1.05); }
.filterable.active::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background: var(--accent); border-radius: 2px; }
/* --- CUSTOM TOOLTIPS ------------------------------------------------- */
.custom-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: min(320px, calc(100vw - 20px));
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(30, 32, 48, 0.98), rgba(20, 22, 36, 0.98));
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(99, 102, 241, 0.15);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: 'Inter', sans-serif;
}
.custom-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.custom-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 20px;
  width: 10px;
  height: 10px;
  background: rgba(30, 32, 48, 0.98);
  border-left: 1px solid rgba(99, 102, 241, 0.3);
  border-top: 1px solid rgba(99, 102, 241, 0.3);
  transform: rotate(45deg);
}
. q u i c k - t a r g e t s   { 
 
     d i s p l a y :   f l e x ; 
 
     g a p :   8 p x ; 
 
     m a r g i n - t o p :   1 2 p x ; 
 
     p a d d i n g :   8 p x ; 
 
     b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   0 . 2 ) ; 
 
     b o r d e r - r a d i u s :   8 p x ; 
 
     f o n t - f a m i l y :   m o n o s p a c e ; 
 
     f o n t - s i z e :   1 3 p x ; 
 
     j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
. q u i c k - t a r g e t s   { 
 
     d i s p l a y :   f l e x ; 
 
     g a p :   8 p x ; 
 
     m a r g i n - t o p :   1 2 p x ; 
 
     p a d d i n g :   8 p x ; 
 
     b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   0 . 2 ) ; 
 
     b o r d e r - r a d i u s :   8 p x ; 
 
     f o n t - f a m i l y :   m o n o s p a c e ; 
 
     f o n t - s i z e :   1 3 p x ; 
 
     j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
 
 } 
 
 . q t - t p   {   c o l o r :   v a r ( - - c - g r e e n ) ;   } 
 
 . q t - s l   {   c o l o r :   v a r ( - - c - r e d ) ;   } 

/* Signal History */
.signal-history-list { display: flex; flex-direction: column; gap: 6px; }
.signal-history-entry { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--glass-border); font-size: 13px; }
.sh-icon { font-size: 18px; flex-shrink: 0; }
.sh-name { font-weight: 600; min-width: 120px; }
.sh-name small { font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.sh-arrow { color: var(--text-muted); font-size: 16px; }
.sh-price { color: var(--text-secondary); margin-left: auto; font-size: 12px; }
.sh-time { color: var(--text-muted); font-size: 11px; min-width: 100px; text-align: right; }
/* ─── Mobile Responsiveness ───────────────────────────────────────────────── */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 22px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.hamburger-btn:hover { background: var(--accent); }

@media (max-width: 900px) {
  /* Hide non-essential topbar items on tablets */
  .clock-badge.eod-timer { display: none; }
  #lastUpdated { display: none; }
}

@media (max-width: 768px) {
  /* Sidebar becomes a slide-in overlay */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    width: 260px;
  }
  .sidebar.open { left: 0; }
  
  /* Main content takes full width — no padding overrides, topbar is inside */
  .main-content { margin-left: 0 !important; }

  /* Topbar: hide non-essential items, collapse to just the essentials */
  .topbar {
    padding: 0 12px;
    height: 56px;
    flex-shrink: 0;
  }
  #moonshotScanStatus { display: none; }
  .clock-badge { display: none; }
  #lastUpdated { display: none; }
  .topbar-right { gap: 10px; }
  .refresh-btn { padding: 7px 12px; font-size: 13px; }
  .refresh-btn span { display: none; } /* Hide arrow icon, keep text */

  /* Section content padding */
  .main-section { padding: 16px 12px; }
  
  /* Asset grid single column */
  .assets-grid,
  #assetGrid,
  #topOpportunities {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Stack sparklines vertically */
  .sparklines-container {
    flex-direction: column !important;
    margin: 0 -8px 12px -8px !important;
  }
  .sparkline-col { height: 48px !important; }
  
  /* Smaller price text */
  .price-main { font-size: 22px !important; }
  
  /* Stack price changes */
  .price-changes { flex-direction: row !important; gap: 6px !important; }
  
  /* Indicators wrap */
  .card-indicators { flex-wrap: wrap !important; }
  .ind-chip { min-width: 60px; }
  
  /* Filter tabs scroll horizontally */
  .filter-tabs,
  .category-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar,
  .category-tabs::-webkit-scrollbar { display: none; }
  
  /* Summary bar wraps */
  .summary-bar { flex-wrap: wrap !important; gap: 8px !important; }
  
  /* Overlay backdrop when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.active { display: block; }

  /* Section headings */
  .section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .section-heading h2 { font-size: 18px; }

  /* Mobile close button in sidebar */
  .mobile-close-btn { display: flex; }
}

@media (max-width: 480px) {
  .price-main { font-size: 20px !important; letter-spacing: -0.5px !important; }
  .asset-name { font-size: 14px !important; }
  .card-header { gap: 8px !important; }
  .ind-chip { padding: 6px !important; }
  .ind-val { font-size: 12px !important; }
  .ind-label { font-size: 8px !important; }
  /* Summary bar items shrink */
  .summary-stat { padding: 8px 10px !important; }
  .summary-stat .stat-value { font-size: 18px !important; }
}

/* ─── BACKTESTER UI ──────────────────────────────────────────────────────── */
.backtest-controls {
  display: flex;
  gap: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 1px solid var(--glass-border);
  align-items: flex-end;
  flex-wrap: wrap;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.control-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.control-group select,
.control-group input {
  padding: 10px 15px;
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
}
.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.backtest-results {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  padding: 20px;
}
.stats-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--bg-dark);
  padding: 15px 20px;
  border-radius: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  align-items: center;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.stat-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}
