/* ==========================================================================
   Optionflow — 2026 UI/UX Design System
   Spatial Glassmorphism · Ambient Telemetry · High-Density Trading Ergonomics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ===================== DESIGN TOKENS ===================== */
:root, html[data-theme="dark"], html[data-theme="obsidian"] {
  /* Canvas & Elevation */
  --bg: #07090e;
  --bg-2: #0d121c;
  --bg-3: #121927;
  --surface: #101623;
  --surface-2: #161e2e;
  --surface-3: #1c263b;
  --surface-glass: rgba(16, 22, 35, 0.75);
  --surface-glass-card: rgba(20, 28, 44, 0.65);
  
  /* Micro-Borders & Outlines */
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: rgba(99, 102, 241, 0.55);
  
  /* Typography Colors */
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --muted: #64748b;
  --muted-light: #94a3b8;
  
  /* Vibrant Accents */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-2: #f97316;
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  
  /* Financial Directional Colors */
  --green: #10b981;
  --green-hover: #34d399;
  --green-dim: rgba(16, 185, 129, 0.15);
  --green-glow: rgba(16, 185, 129, 0.35);
  
  --red: #f43f5e;
  --red-hover: #fb7185;
  --red-dim: rgba(244, 63, 94, 0.15);
  --red-glow: rgba(244, 63, 94, 0.35);
  
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --amber-glow: rgba(245, 158, 11, 0.3);
  
  /* Radii & Geometry */
  --radius-xl: 20px;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 9999px;
  
  /* Lighting, Shadows & Depth */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.65), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px -16px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --inner-glow: inset 0 0 20px rgba(99, 102, 241, 0.04);
  
  /* Gradients */
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #f97316 100%);
  --grad-accent: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --grad-bullish: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-bearish: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-card: linear-gradient(180deg, rgba(24, 33, 50, 0.7) 0%, rgba(16, 22, 35, 0.7) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(99, 102, 241, 0.12), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(6, 182, 212, 0.08), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(249, 115, 22, 0.05), transparent 60%);
  
  /* Structural Surfaces */
  --sidebar-bg: rgba(10, 15, 24, 0.82);
  --topbar-bg: rgba(10, 15, 24, 0.80);
  --nav-bg: rgba(10, 15, 24, 0.88);
  
  color-scheme: dark;
}

/* Tokyo Cyberpunk Theme */
html[data-theme="tokyo"] {
  --bg: #0b0e1b;
  --bg-2: #101426;
  --bg-3: #161b33;
  --surface: #14182e;
  --surface-2: #1a203d;
  --surface-3: #22294e;
  --surface-glass: rgba(20, 24, 46, 0.78);
  --surface-glass-card: rgba(26, 32, 61, 0.70);
  
  --border: rgba(122, 162, 247, 0.12);
  --border-2: rgba(122, 162, 247, 0.24);
  --border-subtle: rgba(122, 162, 247, 0.06);
  --border-focus: rgba(122, 162, 247, 0.65);
  
  --text: #f0f3fe;
  --text-2: #c0caf5;
  --muted: #7982a9;
  --muted-light: #9aa5ce;
  
  --accent: #7aa2f7;
  --accent-light: #9bb7f9;
  --accent-2: #bb9af7;
  --cyan: #7dcfff;
  --cyan-dim: rgba(125, 207, 255, 0.15);
  
  --green: #9ece6a;
  --green-hover: #b9f27c;
  --green-dim: rgba(158, 206, 106, 0.15);
  --green-glow: rgba(158, 206, 106, 0.35);
  
  --red: #f7768e;
  --red-hover: #ff9eaf;
  --red-dim: rgba(247, 118, 142, 0.15);
  --red-glow: rgba(247, 118, 142, 0.35);
  
  --amber: #e0af68;
  --amber-dim: rgba(224, 175, 104, 0.15);
  --amber-glow: rgba(224, 175, 104, 0.3);
  
  --shadow-sm: 0 2px 8px -2px rgba(5, 7, 15, 0.6);
  --shadow: 0 12px 32px -12px rgba(5, 7, 15, 0.75), 0 2px 6px -2px rgba(5, 7, 15, 0.5);
  --shadow-lg: 0 20px 48px -16px rgba(5, 7, 15, 0.9), 0 0 0 1px rgba(122, 162, 247, 0.08);
  --inner-highlight: inset 0 1px 0 rgba(122, 162, 247, 0.12);
  --inner-glow: inset 0 0 20px rgba(122, 162, 247, 0.06);
  
  --grad-brand: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 50%, #f7768e 100%);
  --grad-accent: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
  --grad-bullish: linear-gradient(135deg, #9ece6a 0%, #73daca 100%);
  --grad-bearish: linear-gradient(135deg, #f7768e 0%, #db4b4b 100%);
  --grad-card: linear-gradient(180deg, rgba(26, 32, 61, 0.75) 0%, rgba(20, 24, 46, 0.75) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(122, 162, 247, 0.14), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(187, 154, 247, 0.10), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(125, 207, 255, 0.06), transparent 60%);
  
  --sidebar-bg: rgba(12, 15, 29, 0.85);
  --topbar-bg: rgba(12, 15, 29, 0.82);
  --nav-bg: rgba(12, 15, 29, 0.90);
  
  color-scheme: dark;
}

/* Matrix Emerald Theme */
html[data-theme="emerald"] {
  --bg: #050d09;
  --bg-2: #09150f;
  --bg-3: #0e1e16;
  --surface: #0c1813;
  --surface-2: #11231a;
  --surface-3: #183024;
  --surface-glass: rgba(12, 24, 19, 0.78);
  --surface-glass-card: rgba(17, 35, 26, 0.70);
  
  --border: rgba(16, 185, 129, 0.12);
  --border-2: rgba(16, 185, 129, 0.24);
  --border-subtle: rgba(16, 185, 129, 0.06);
  --border-focus: rgba(16, 185, 129, 0.65);
  
  --text: #ecfdf5;
  --text-2: #a7f3d0;
  --muted: #4e7a64;
  --muted-light: #6ee7b7;
  
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-2: #22c55e;
  --cyan: #14b8a6;
  --cyan-dim: rgba(20, 184, 166, 0.15);
  
  --green: #10b981;
  --green-hover: #34d399;
  --green-dim: rgba(16, 185, 129, 0.16);
  --green-glow: rgba(16, 185, 129, 0.40);
  
  --red: #ef4444;
  --red-hover: #f87171;
  --red-dim: rgba(239, 68, 68, 0.15);
  --red-glow: rgba(239, 68, 68, 0.35);
  
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --amber-glow: rgba(245, 158, 11, 0.3);
  
  --shadow-sm: 0 2px 8px -2px rgba(2, 8, 5, 0.6);
  --shadow: 0 12px 32px -12px rgba(2, 8, 5, 0.75), 0 2px 6px -2px rgba(2, 8, 5, 0.5);
  --shadow-lg: 0 20px 48px -16px rgba(2, 8, 5, 0.9), 0 0 0 1px rgba(16, 185, 129, 0.08);
  --inner-highlight: inset 0 1px 0 rgba(16, 185, 129, 0.12);
  --inner-glow: inset 0 0 20px rgba(16, 185, 129, 0.06);
  
  --grad-brand: linear-gradient(135deg, #10b981 0%, #059669 50%, #22c55e 100%);
  --grad-accent: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-bullish: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --grad-bearish: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-card: linear-gradient(180deg, rgba(17, 35, 26, 0.75) 0%, rgba(12, 24, 19, 0.75) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(16, 185, 129, 0.14), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(20, 184, 166, 0.10), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(34, 197, 94, 0.06), transparent 60%);
  
  --sidebar-bg: rgba(7, 15, 10, 0.86);
  --topbar-bg: rgba(7, 15, 10, 0.83);
  --nav-bg: rgba(7, 15, 10, 0.90);
  
  color-scheme: dark;
}

/* Bloomberg Amber Theme */
html[data-theme="amber"] {
  --bg: #0b0d10;
  --bg-2: #12151a;
  --bg-3: #1a1e24;
  --surface: #14181d;
  --surface-2: #1c2229;
  --surface-3: #252d37;
  --surface-glass: rgba(20, 24, 29, 0.80);
  --surface-glass-card: rgba(28, 34, 41, 0.72);
  
  --border: rgba(245, 158, 11, 0.14);
  --border-2: rgba(245, 158, 11, 0.26);
  --border-subtle: rgba(245, 158, 11, 0.06);
  --border-focus: rgba(245, 158, 11, 0.65);
  
  --text: #fef3c7;
  --text-2: #fde68a;
  --muted: #78716c;
  --muted-light: #a8a29e;
  
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-2: #d97706;
  --cyan: #38bdf8;
  --cyan-dim: rgba(56, 189, 248, 0.15);
  
  --green: #10b981;
  --green-hover: #34d399;
  --green-dim: rgba(16, 185, 129, 0.15);
  --green-glow: rgba(16, 185, 129, 0.35);
  
  --red: #f43f5e;
  --red-hover: #fb7185;
  --red-dim: rgba(244, 63, 94, 0.15);
  --red-glow: rgba(244, 63, 94, 0.35);
  
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.18);
  --amber-glow: rgba(245, 158, 11, 0.4);
  
  --shadow-sm: 0 2px 8px -2px rgba(6, 7, 9, 0.6);
  --shadow: 0 12px 32px -12px rgba(6, 7, 9, 0.75), 0 2px 6px -2px rgba(6, 7, 9, 0.5);
  --shadow-lg: 0 20px 48px -16px rgba(6, 7, 9, 0.9), 0 0 0 1px rgba(245, 158, 11, 0.08);
  --inner-highlight: inset 0 1px 0 rgba(245, 158, 11, 0.12);
  --inner-glow: inset 0 0 20px rgba(245, 158, 11, 0.06);
  
  --grad-brand: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  --grad-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-bullish: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-bearish: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-card: linear-gradient(180deg, rgba(28, 34, 41, 0.75) 0%, rgba(20, 24, 29, 0.75) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(245, 158, 11, 0.14), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(217, 119, 6, 0.10), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(251, 191, 36, 0.06), transparent 60%);
  
  --sidebar-bg: rgba(13, 16, 20, 0.86);
  --topbar-bg: rgba(13, 16, 20, 0.83);
  --nav-bg: rgba(13, 16, 20, 0.90);
  
  color-scheme: dark;
}

/* Nordic Polar Theme */
html[data-theme="nordic"] {
  --bg: #090e17;
  --bg-2: #0e1622;
  --bg-3: #141e2e;
  --surface: #111b27;
  --surface-2: #182535;
  --surface-3: #203146;
  --surface-glass: rgba(17, 27, 39, 0.78);
  --surface-glass-card: rgba(24, 37, 53, 0.70);
  
  --border: rgba(56, 189, 248, 0.12);
  --border-2: rgba(56, 189, 248, 0.22);
  --border-subtle: rgba(56, 189, 248, 0.05);
  --border-focus: rgba(56, 189, 248, 0.65);
  
  --text: #f0f9ff;
  --text-2: #bae6fd;
  --muted: #566b82;
  --muted-light: #7dd3fc;
  
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-2: #818cf8;
  --cyan: #0284c7;
  --cyan-dim: rgba(2, 132, 199, 0.15);
  
  --green: #34d399;
  --green-hover: #6ee7b7;
  --green-dim: rgba(52, 211, 153, 0.15);
  --green-glow: rgba(52, 211, 153, 0.35);
  
  --red: #f43f5e;
  --red-hover: #fb7185;
  --red-dim: rgba(244, 63, 94, 0.15);
  --red-glow: rgba(244, 63, 94, 0.35);
  
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.15);
  --amber-glow: rgba(251, 191, 36, 0.3);
  
  --shadow-sm: 0 2px 8px -2px rgba(4, 7, 12, 0.6);
  --shadow: 0 12px 32px -12px rgba(4, 7, 12, 0.75), 0 2px 6px -2px rgba(4, 7, 12, 0.5);
  --shadow-lg: 0 20px 48px -16px rgba(4, 7, 12, 0.9), 0 0 0 1px rgba(56, 189, 248, 0.08);
  --inner-highlight: inset 0 1px 0 rgba(56, 189, 248, 0.12);
  --inner-glow: inset 0 0 20px rgba(56, 189, 248, 0.06);
  
  --grad-brand: linear-gradient(135deg, #38bdf8 0%, #0284c7 50%, #818cf8 100%);
  --grad-accent: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --grad-bullish: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --grad-bearish: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-card: linear-gradient(180deg, rgba(24, 37, 53, 0.75) 0%, rgba(17, 27, 39, 0.75) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(129, 140, 248, 0.10), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(125, 211, 252, 0.06), transparent 60%);
  
  --sidebar-bg: rgba(10, 16, 25, 0.86);
  --topbar-bg: rgba(10, 16, 25, 0.83);
  --nav-bg: rgba(10, 16, 25, 0.90);
  
  color-scheme: dark;
}

/* Monolith Crimson Theme */
html[data-theme="crimson"] {
  --bg: #0c080a;
  --bg-2: #140d10;
  --bg-3: #1d1318;
  --surface: #161013;
  --surface-2: #20171c;
  --surface-3: #2b1f25;
  --surface-glass: rgba(22, 16, 19, 0.80);
  --surface-glass-card: rgba(32, 23, 28, 0.72);
  
  --border: rgba(244, 63, 94, 0.14);
  --border-2: rgba(244, 63, 94, 0.26);
  --border-subtle: rgba(244, 63, 94, 0.06);
  --border-focus: rgba(244, 63, 94, 0.65);
  
  --text: #fff1f2;
  --text-2: #fecdd3;
  --muted: #7f686e;
  --muted-light: #fda4af;
  
  --accent: #f43f5e;
  --accent-light: #fb7185;
  --accent-2: #fb923c;
  --cyan: #c084fc;
  --cyan-dim: rgba(192, 132, 252, 0.15);
  
  --green: #10b981;
  --green-hover: #34d399;
  --green-dim: rgba(16, 185, 129, 0.15);
  --green-glow: rgba(16, 185, 129, 0.35);
  
  --red: #f43f5e;
  --red-hover: #fb7185;
  --red-dim: rgba(244, 63, 94, 0.18);
  --red-glow: rgba(244, 63, 94, 0.40);
  
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.15);
  --amber-glow: rgba(251, 191, 36, 0.3);
  
  --shadow-sm: 0 2px 8px -2px rgba(6, 4, 5, 0.6);
  --shadow: 0 12px 32px -12px rgba(6, 4, 5, 0.75), 0 2px 6px -2px rgba(6, 4, 5, 0.5);
  --shadow-lg: 0 20px 48px -16px rgba(6, 4, 5, 0.9), 0 0 0 1px rgba(244, 63, 94, 0.08);
  --inner-highlight: inset 0 1px 0 rgba(244, 63, 94, 0.12);
  --inner-glow: inset 0 0 20px rgba(244, 63, 94, 0.06);
  
  --grad-brand: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #fb923c 100%);
  --grad-accent: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-bullish: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-bearish: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  --grad-card: linear-gradient(180deg, rgba(32, 23, 28, 0.75) 0%, rgba(22, 16, 19, 0.75) 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(244, 63, 94, 0.14), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(251, 146, 60, 0.10), transparent 50%),
                  radial-gradient(700px 500px at 50% 100%, rgba(192, 132, 252, 0.06), transparent 60%);
  
  --sidebar-bg: rgba(14, 9, 11, 0.86);
  --topbar-bg: rgba(14, 9, 11, 0.83);
  --nav-bg: rgba(14, 9, 11, 0.90);
  
  color-scheme: dark;
}

/* Alabaster Daylight Light Theme */
html[data-theme="light"] {
  /* Canvas & Elevation */
  --bg: #f5f7fb;
  --bg-2: #edf1f7;
  --bg-3: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #edf2f7;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-glass-card: rgba(255, 255, 255, 0.88);
  
  /* Micro-Borders & Outlines */
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --border-subtle: #f1f5f9;
  --border-focus: rgba(99, 102, 241, 0.55);
  
  /* Typography Colors */
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-light: #475569;
  
  /* Vibrant Accents */
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-2: #ea580c;
  --cyan: #0891b2;
  --cyan-dim: #cffafe;
  
  /* Financial Directional Colors */
  --green: #059669;
  --green-hover: #10b981;
  --green-dim: #d1fae5;
  --green-glow: rgba(16, 185, 129, 0.25);
  
  --red: #e11d48;
  --red-hover: #f43f5e;
  --red-dim: #ffe4e6;
  --red-glow: rgba(225, 29, 72, 0.25);
  
  --amber: #d97706;
  --amber-dim: #fef3c7;
  --amber-glow: rgba(217, 119, 6, 0.2);
  
  /* Lighting, Shadows & Depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 1);
  --inner-glow: inset 0 0 12px rgba(99, 102, 241, 0.03);
  
  /* Gradients */
  --grad-brand: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #ea580c 100%);
  --grad-accent: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --grad-bullish: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-bearish: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  --grad-card: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --grad-ambient: radial-gradient(1000px 500px at 90% -10%, rgba(99, 102, 241, 0.06), transparent 60%),
                  radial-gradient(800px 400px at 10% 20%, rgba(6, 182, 212, 0.04), transparent 50%);
  
  /* Structural Surfaces */
  --sidebar-bg: rgba(255, 255, 255, 0.88);
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --nav-bg: rgba(255, 255, 255, 0.92);
  
  color-scheme: light;
}

/* ===================== GLOBAL BASE ===================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image: var(--grad-ambient);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  overflow-x: clip;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-feature-settings: "tnum";
}

.hidden {
  display: none !important;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

.settings-stale-warn {
  color: var(--amber);
  background: var(--amber-dim);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 1rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===================== AUTHENTICATION VIEW ===================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  background: 
    radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1), transparent 40%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-glass-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-brand);
}

.auth-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.logo-badge {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #ffffff;
  background: var(--grad-brand);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.5);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-badge:hover {
  transform: rotate(4deg) scale(1.05);
}

.logo-badge.sm {
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
  border-radius: 10px;
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.4);
}

.auth-fields label {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-2);
}

.auth-foot {
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted);
  margin: 1.8rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.2rem;
}

/* ===================== APP SHELL LAYOUT ===================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.15rem 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  align-self: flex-start;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  overflow: hidden;
  box-shadow: 4px 0 24px -12px rgba(0, 0, 0, 0.4);
}

.sidebar-ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: radial-gradient(circle at 50% -30%, rgba(99, 102, 241, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.2rem 0.4rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.brand-logo-wrap {
  position: relative;
  flex-shrink: 0;
}

.brand-pulse-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
  box-shadow: 0 0 8px var(--green);
}

.brand-text {
  min-width: 0;
  flex: 1;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-title-row h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
}

.sm-badge {
  font-size: 0.58rem !important;
  font-weight: 800;
  padding: 0.12rem 0.4rem !important;
  border-radius: 4px;
}

.brand-text span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-top: 0.15rem;
}

.sidebar-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0.2rem -0.3rem 0;
  padding: 0 0.3rem 0.5rem;
  position: relative;
  z-index: 1;
}

.sidebar-scrollable::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--radius-pill);
}

.nav-section-label {
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.85rem 0.25rem;
  display: block;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
  position: relative;
  gap: 0.85rem;
}

.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  transform: translateX(3px);
}

.nav-btn .ico {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.nav-btn .lbl {
  flex: 1;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn:hover .ico {
  color: var(--accent-light);
  transform: scale(1.1);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0.03) 100%);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: inset 3px 0 0 var(--accent), 0 2px 12px rgba(99, 102, 241, 0.12);
}

.nav-btn.active .lbl {
  font-weight: 700;
  color: #ffffff;
}

.nav-btn.active .ico {
  color: var(--accent-light);
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
}

.nav-trail-pill {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.nav-live-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.8s infinite;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--accent-light);
  flex-shrink: 0;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  z-index: 1;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-row:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: none;
}

.theme-row-ico {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: var(--amber);
  flex-shrink: 0;
}

.theme-row-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
}

.theme-row-txt strong {
  font-size: 0.8rem;
  font-weight: 700;
}

.theme-row-txt em {
  font-size: 0.68rem;
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.theme-switch-pill {
  width: 32px;
  height: 18px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-2);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: all 0.2s ease;
}

html[data-theme="light"] .theme-switch-thumb {
  right: auto;
  left: 2px;
  background: var(--amber);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.user-chip:hover {
  border-color: var(--border-2);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
  background: var(--grad-brand);
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  gap: 0.12rem;
}

.user-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.signout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  box-shadow: none;
  font-weight: 600;
  display: inline;
  width: auto;
  transition: color 0.15s ease;
}

.signout-btn:hover {
  color: var(--red);
  background: none;
  transform: none;
}

/* ===================== MAIN CONTENT & TOPBAR ===================== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease;
}

.topbar-left-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-title .crumb {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
  display: block;
  margin-top: 0.1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===================== TOPBAR LIVE CLOCK ===================== */
.topbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  user-select: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.topbar-clock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14) 0%, rgba(6, 182, 212, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.topbar-clock:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 18px -2px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.topbar-clock:hover::before {
  opacity: 1;
}

/* Pulsing Lively Live Beacon Dot */
.clock-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981, 0 0 14px rgba(16, 185, 129, 0.6);
  display: inline-block;
  flex-shrink: 0;
  animation: clockPulse 2s ease-in-out infinite;
}

@keyframes clockPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 6px #10b981, 0 0 12px rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: scale(1.35);
    opacity: 0.75;
    box-shadow: 0 0 12px #10b981, 0 0 20px rgba(16, 185, 129, 0.85);
  }
}

.clock-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.clock-divider {
  width: 1px;
  height: 14px;
  background: var(--border-2);
  display: inline-block;
  opacity: 0.8;
}

.clock-time-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.clock-time {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.clock-ampm {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-light);
  text-transform: uppercase;
}

.clock-tz {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  letter-spacing: 0.04em;
}

/* Theme Toggle Button */
.theme-toggle {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: rotate(15deg);
}

/* Ticker Strip Ribbon */
.ticker-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  max-width: min(50vw, 680px);
  padding: 0.1rem 0;
}

.ticker-strip::-webkit-scrollbar {
  display: none;
}

.ticker-strip .ticker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-size: 0.78rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ticker-strip .ticker:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.ticker-strip .ticker .t-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ticker-strip .ticker .t-val {
  font-weight: 700;
  color: var(--text);
}

.ticker-strip .ticker.closed {
  opacity: 0.6;
}

.ticker-strip .ticker.commodity.open {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.ticker-strip .ticker.equity.open {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.06);
}

/* Status Pills (Market & Scanner) */
.market-pill, .scanner-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: all 0.25s ease;
}

.market-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.market-pill.open {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--green-dim);
}

.market-pill.open .dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; box-shadow: 0 0 16px var(--green); }
}

.scanner-pill.on {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--green-dim);
  animation: pulse-scanner-pill 2.5s ease-in-out infinite;
}

@keyframes pulse-scanner-pill {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12); }
}

.scanner-pill.off {
  color: var(--muted);
}

/* ===================== PANELS & VIEWS ===================== */
.content {
  padding: 1.8rem 2rem 3rem;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  display: none;
  animation: panelFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== CARDS & SPATIAL CONTAINERS ===================== */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow);
  position: relative;
  box-shadow: var(--inner-highlight), var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: var(--border-2);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card h4 {
  margin: 0 0 0.6rem;
  font-size: 0.84rem;
  color: var(--text-2);
  font-weight: 700;
}

.mt {
  margin-top: 1.2rem;
}

.sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
}

/* ===================== KPI METRIC TILES ===================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.3rem;
}

.kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--inner-highlight), var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), var(--shadow-lg);
}

.kpi .k-ico {
  position: absolute;
  right: -8px;
  top: -10px;
  font-size: 3.8rem;
  opacity: 0.04;
  pointer-events: none;
  font-family: inherit;
}

.kpi .k-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.kpi .k-val {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.35rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

.kpi .k-sub {
  font-size: 0.76rem;
  color: var(--text-2);
  margin-top: 0.3rem;
  font-weight: 500;
}

.win {
  color: var(--green) !important;
}

.loss {
  color: var(--red) !important;
}

/* Stat Tiles (Grid sub-items) */
.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-tile:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}

.stat-tile .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-tile .value {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ===================== SYSTEM STATUS & REGIME ===================== */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.status-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.status-item:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.status-dot.fail {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.status-item .name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.status-item .detail {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.rec-item .fit {
  color: var(--accent-light);
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

/* ===================== BADGES & PILLS ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge.strong {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.trade {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge.watch {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.skip {
  background: rgba(100, 116, 139, 0.15);
  color: var(--muted);
}

/* ===================== DATA TABLES ===================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.data-table th {
  padding: 0.8rem 0.9rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 2;
}

.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.sortable-th:hover {
  color: var(--text);
}

.sortable-th.sorted {
  color: var(--accent-light);
}

.sort-arrow {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-left: 0.25rem;
}

.sortable-th.sorted .sort-arrow {
  opacity: 1;
}

/* ===================== FORM CONTROLS & BUTTONS ===================== */
label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-2);
  margin: 0.75rem 0 0.35rem;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.2rem;
}

.mini-select {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

button {
  cursor: pointer;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--grad-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.65);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  box-shadow: none;
}

button.ghost:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-3);
}

.chip-btn,
.filter-chip,
.filter-chips button,
.analytics-filter-chips button,
.bt-chip-btn,
.bt-pill-btn,
.bt-tf-chip,
.n-idx-btn,
#neural-index-buttons button,
.period-btn,
.signals-period-btn,
.analytics-period-btn {
  padding: 0.36rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-pill);
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.chip-btn:hover,
.filter-chip:hover,
.filter-chips button:hover,
.analytics-filter-chips button:hover,
.bt-chip-btn:hover,
.bt-pill-btn:hover,
.bt-tf-chip:hover,
.n-idx-btn:hover,
#neural-index-buttons button:hover,
.period-btn:hover,
.signals-period-btn:hover,
.analytics-period-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  filter: none;
}

.chip-btn:active,
.filter-chip:active,
.filter-chips button:active,
.analytics-filter-chips button:active,
.bt-chip-btn:active,
.bt-pill-btn:active,
.bt-tf-chip:active,
.n-idx-btn:active,
#neural-index-buttons button:active {
  transform: translateY(0);
}

.chip-btn.active,
.filter-chip.active,
.filter-chips button.active,
.analytics-filter-chips button.active,
.bt-chip-btn.active,
.bt-pill-btn.active,
.bt-tf-chip.active,
.n-idx-btn.active,
#neural-index-buttons button.active,
.period-btn.active,
.signals-period-btn.active,
.analytics-period-btn.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.22), inset 0 0 8px rgba(99, 102, 241, 0.1);
  filter: none;
}

.chip-btn.danger {
  color: var(--red);
  border-color: rgba(244, 63, 94, 0.35);
  background: var(--red-dim);
}

.chip-btn.danger:hover {
  background: rgba(244, 63, 94, 0.25);
  color: var(--red-hover);
}


.row-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.row-btns button {
  flex: 1;
  min-width: 140px;
}

/* Custom Toggle Switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-2);
  margin: 0.65rem 0;
  font-weight: 600;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  display: inline-block;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch input:checked + .slider {
  background: var(--grad-accent);
  border-color: transparent;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.log {
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.2rem;
  margin-top: 0.85rem;
  white-space: pre-wrap;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.4;
}

/* ===================== PERIOD TABS (ANALYTICS) ===================== */
.tab-bar {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 1.2rem;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: none;
}

.tab-btn:hover {
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ===================== STRATEGY MANAGER ===================== */
.strat-list {
  margin-top: 0.8rem;
}

.strategy-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.strat-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.strategy-row .strat-info {
  min-width: 0;
  flex: 1;
}

.strategy-row .strat-info .name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: block;
}

.strategy-row .strat-info .desc {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 0.25rem;
  line-height: 1.45;
}

.strategy-row .strat-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.76rem;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
}

.stat-chip.live {
  color: var(--accent-light);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.1);
}

.stat-chip.win {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--green-dim);
}

.stat-chip.loss {
  color: var(--red);
  border-color: rgba(244, 63, 94, 0.35);
  background: var(--red-dim);
}

@media (min-width: 769px) {
  .strategy-row {
    flex-direction: row;
    align-items: center;
  }
  .strategy-row .strat-stats {
    margin-left: auto;
    flex-shrink: 0;
  }
}

/* ===================== LIVE SIGNAL CARDS & DYNAMIC PRICE RAIL ===================== */
.signal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.1rem;
}

.signal-card-grid.scroll-panel {
  padding: 0.25rem 0.2rem;
  overflow-y: auto;
  max-height: min(72vh, 800px);
}

.sig-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sig-card:hover {
  border-color: var(--accent, #38bdf8);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.14), var(--shadow);
}

.sig-card:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: var(--shadow-sm);
}

.sig-card:focus-visible {
  outline: 2px solid var(--accent, #38bdf8);
  outline-offset: 2px;
}

.sig-tv-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent, #38bdf8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

/* Show Spread Button on Signal Cards */
.sig-spread-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 4px);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.38);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

.sig-card:hover .sig-spread-btn,
.sig-spread-btn:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(129, 140, 248, 0.75);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.sig-spread-btn:active {
  transform: scale(0.96);
}

.sig-spread-btn .spread-ico {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.sig-card:hover .sig-spread-btn .spread-ico,
.sig-spread-btn:hover .spread-ico {
  transform: scale(1.1);
}

/* Spread Anatomy Modal Styles */
.spread-modal-card {
  max-width: 740px !important;
  border-radius: var(--radius-lg, 16px) !important;
  background: var(--surface-glass-card, #0f172a) !important;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(99, 102, 241, 0.15) !important;
}

.spread-corridor-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.spread-corridor-track {
  position: relative;
  height: 28px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  margin: 1.5rem 0 0.75rem 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spread-corridor-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.15));
  border-left: 2px solid #10b981;
  border-right: 2px solid #10b981;
  border-radius: 4px;
}

.spread-spot-pin {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.spread-spot-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px #38bdf8;
}

.spread-spot-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.9);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #38bdf8;
  margin-top: 4px;
  white-space: nowrap;
}

.spread-be-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: #10b981;
}

.spread-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.spread-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 0.75rem;
}

.spread-tile-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #94a3b8);
  margin-bottom: 0.25rem;
}

.spread-tile-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: var(--text, #f8fafc);
}

.spread-tile-sub {
  font-size: 0.70rem;
  color: var(--muted, #94a3b8);
  margin-top: 0.15rem;
}

.spread-legs-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}

.spread-danger-callout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.spread-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-2, rgba(255, 255, 255, 0.08));
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sig-card:hover .sig-tv-pill,
.sig-tv-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.sig-tv-pill .tv-ico {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.sig-card:hover .sig-tv-pill .tv-ico,
.sig-tv-pill:hover .tv-ico {
  transform: translate(1px, -1px);
}

.sig-card.live {
  border-left: 4px solid var(--green);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--surface-glass-card) 65%);
}

.sig-card.settled {
  border-left: 4px solid var(--border-2);
  opacity: 0.94;
}

.sig-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sig-id {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.sig-idx {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.sig-idx-link {
  transition: color 0.15s ease, text-decoration 0.15s ease;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.sig-idx-link:hover {
  color: var(--accent, #38bdf8);
  text-decoration: underline;
}

.sig-contract {
  font-size: 0.74rem;
  color: var(--muted-light);
  font-weight: 600;
  background: var(--surface-2);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.sig-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sig-side {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.sig-side.action-short {
  background: rgba(147, 51, 234, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(147, 51, 234, 0.55);
}

.sig-side.action-long {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.sig-side.call {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sig-side.put {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

.badge-short {
  background: rgba(147, 51, 234, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(147, 51, 234, 0.45);
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

.badge-long {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

.sig-oc {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-xs);
}

.sig-oc.live {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: sig-live-pulse 2s ease-in-out infinite;
}

.sig-oc.win {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sig-oc.trail {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.45);
}

.sig-oc.be {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.45);
}

.sig-oc.mom {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.sig-oc.loss {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.sig-oc.eod {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

@keyframes sig-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sig-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.sig-ltp {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.sig-ltp-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sig-ltp-val {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.sig-ltp.up .sig-ltp-val { color: var(--green); }
.sig-ltp.dn .sig-ltp-val { color: var(--red); }

.sig-ltp-chg {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-pill);
}

.sig-ltp.up .sig-ltp-chg { color: var(--green); background: var(--green-dim); }
.sig-ltp.dn .sig-ltp-chg { color: var(--red); background: var(--red-dim); }

.sig-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sig-strat-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.sig-hist-wr {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
}

/* Fixed 3-Column Trade Boundaries (Guaranteed Zero Overlap) */
.sig-bounds-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0.25rem 0.1rem;
}

.sig-bound {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sig-bound.sl {
  align-items: flex-start;
  text-align: left;
}

.sig-bound.en {
  align-items: center;
  text-align: center;
}

.sig-bound.tg {
  align-items: flex-end;
  text-align: right;
}

.sig-bound .b-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.sig-bound .b-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-2);
}

.sig-bound.sl .b-val { color: var(--red); }
.sig-bound.en .b-val { color: var(--text); }
.sig-bound.tg .b-val { color: var(--green); }

/* Dynamic Price Rail Visual Track */
.sig-rail-wrap {
  margin: 0.35rem 0 0.15rem;
  padding: 0.25rem 0.15rem;
  position: relative;
}

.sig-rail-bar {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  margin: 0;
  overflow: visible;
  border: 1px solid var(--border);
}

.sig-rail-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  min-width: 3px;
}

.sig-rail-fill.up {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}

.sig-rail-fill.dn {
  background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.sig-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.sig-tick > i {
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: var(--muted);
}

.sig-tick.sl > i {
  background: var(--red);
  height: 12px;
}

.sig-tick.en > i {
  background: var(--text-2);
  height: 14px;
}

.sig-tick.tg > i {
  background: var(--green);
  height: 12px;
}

.sig-tick.peak > i {
  width: 6px;
  height: 6px;
  background: var(--amber);
  transform: rotate(45deg);
  border-radius: 1px;
}

.sig-tick.dip > i {
  width: 6px;
  height: 6px;
  background: var(--red);
  transform: rotate(45deg);
  border-radius: 1px;
}

.sig-tick.cur {
  z-index: 6;
}

.sig-tick.cur > i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.sig-tick.cur.up > i {
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.sig-tick.cur.dn > i {
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.sig-tick.cur.pulse > i {
  animation: sig-cur-pulse 1.8s ease-in-out infinite;
}

@keyframes sig-cur-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 0 6px rgba(16, 185, 129, 0); }
}

.sig-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.45rem;
  margin-top: 0.1rem;
}

.sig-time {
  font-weight: 500;
}

.sig-foot-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sig-exc-hi {
  color: var(--amber);
  font-weight: 700;
  font-size: 0.7rem;
}

.sig-exc-lo {
  color: var(--red);
  font-weight: 700;
  font-size: 0.7rem;
}

.sig-conf {
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
}

.sig-hist-wr {
  color: var(--accent-light);
  font-weight: 700;
}

.empty-signals {
  color: var(--muted);
  padding: 1.5rem 0.5rem;
  font-size: 0.88rem;
  text-align: center;
}

/* ===================== SCANNER PIPELINE ENGINE ===================== */
.engine-hero {
  position: relative;
  overflow: hidden;
}

.engine-hero .hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 250px at 10% 0%, rgba(6, 182, 212, 0.15), transparent 60%),
              radial-gradient(500px 220px at 90% 20%, rgba(99, 102, 241, 0.12), transparent 50%);
  pointer-events: none;
}

.global-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem 1.1rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.g-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.g-step-lbl {
  font-weight: 700;
  color: var(--text);
}

.g-step-det {
  color: var(--muted);
  font-size: 0.74rem;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.funnel-stage {
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.funnel-stage:hover {
  border-color: var(--border-2);
}

.funnel-stage .f-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.funnel-stage .f-bar-wrap {
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  margin: 0.55rem 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.funnel-stage .f-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.4s ease;
}

.funnel-stage .f-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

.engine-indices {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.idx-pipeline {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
}

.idx-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.idx-regime {
  font-size: 0.76rem;
  color: var(--accent-light);
  font-weight: 700;
}

.idx-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.strat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.strat-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

.strat-chip.hit {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
}

/* Timeline Stages */
.tl-wrap {
  display: flex;
  flex-direction: column;
  margin: 0.65rem 0;
  padding-left: 0.3rem;
}

.tl-step {
  display: flex;
  gap: 0.8rem;
  padding: 0.5rem 0;
  position: relative;
}

.tl-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 24px;
  bottom: -6px;
  width: 2px;
  background: var(--border);
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: var(--muted);
  border: 2px solid var(--surface);
}

.tl-dot.ok {
  background: var(--green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.tl-dot.warn {
  background: var(--amber);
}

.tl-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.tl-detail {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.15rem;
  font-family: "JetBrains Mono", monospace;
}

/* ===================== HOURLY HEATMAP & CALENDAR ===================== */
.tod-heatmap {
  padding: 0.4rem 0 0.6rem;
}

.tod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.65rem;
}

.tod-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  text-align: center;
  background: var(--surface-2);
  transition: all 0.2s ease;
}

.tod-cell:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.tod-cell.good {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.tod-cell.mid {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.tod-cell.low {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
}

.tod-hr {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-2);
}

.tod-wr {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  margin: 0.2rem 0;
}

.tod-n {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Calendar Styling */
.cal-months-host {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cal-months {
  display: flex;
  gap: 1.2rem;
  padding: 0.4rem 0;
}

.cal-month {
  flex: 0 0 min(100%, 320px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}

.cal-month-title {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.cal-weekdays span {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  cursor: default;
  position: relative;
  gap: 2px;
  transition: all 0.15s ease;
}

.cal-day.cal-click {
  cursor: pointer;
}

.cal-day.cal-click:hover {
  transform: scale(1.08);
  border-color: var(--accent);
  z-index: 2;
}

.cal-day.cal-sel {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.cal-day.cal-win { background: var(--green-dim); border-color: rgba(16, 185, 129, 0.3); }
.cal-day.cal-loss { background: var(--red-dim); border-color: rgba(244, 63, 94, 0.3); }
.cal-day.cal-sig { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.25); }

.cal-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
}

.cal-badge {
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

/* ===================== SCROLL PANELS & UTILITIES ===================== */
.scroll-panel {
  max-height: min(65vh, 600px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.scroll-panel-table {
  max-height: min(50vh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.scroll-panel::-webkit-scrollbar,
.scroll-panel-table::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scroll-panel::-webkit-scrollbar-thumb,
.scroll-panel-table::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--radius-pill);
}

.analytics-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.3rem;
}

/* History Accordion */
.engine-history-wrap { padding: 0 1.2rem 1.2rem; }
.engine-history-card.collapsed .engine-history-wrap { display: none; }
.card-head-toggle { cursor: pointer; user-select: none; }
.card-head-toggle:hover h3 { color: var(--accent-light); }
.engine-history { display: flex; flex-direction: column; gap: 0.6rem; }
.scroll-panel-compact { max-height: min(34vh, 300px); }

.hist-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hist-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.hist-summary:hover {
  background: var(--surface-3);
}

/* ===================== MOBILE NAVIGATION & RESPONSIVE ERGONOMICS ===================== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  height: 40px;
  padding: 10px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  box-shadow: none;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  box-shadow: none;
}

.mobile-close-btn:hover {
  color: var(--text);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1200px) {
  .kpi-row, .dash-kpi-grid, .signals-kpi-grid, .scanner-kpi-grid, .analytics-kpi-grid, .bt-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
  }
  .grid2 { grid-template-columns: 1fr; }
  .analytics-split { grid-template-columns: 1fr; }
  .bt-analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Shell & Fixed/Drawer Sidebar */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
  }
  
  #app, .app-shell, .main, .content, .panel {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: clip !important;
  }

  .app-shell {
    flex-direction: column;
    min-height: 100vh;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    max-width: 84vw;
    height: 100dvh;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
    padding: 1.2rem 1rem max(1rem, env(safe-area-inset-bottom));
    background: var(--surface);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .mobile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
  }
  
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  
  /* Topbar Mobile Header */
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: max(0.6rem, env(safe-area-inset-top, 0px)) 0.85rem 0.55rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--topbar-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  
  .topbar-left-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }
  
  .topbar-title {
    flex: 1;
    min-width: 0;
    margin-left: 0.25rem;
  }

  .topbar-title h2 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  .topbar-clock {
    padding: 0.22rem 0.55rem;
    gap: 0.35rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
  }

  .clock-time {
    font-size: 0.78rem;
    font-weight: 700;
  }

  .clock-date, .clock-divider, .clock-tz {
    display: none;
  }

  .theme-toggle {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--radius-sm);
  }

  .topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 0.45rem;
    margin-top: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .topbar-right::-webkit-scrollbar {
    display: none;
  }

  .ticker-strip {
    max-width: 100%;
    width: 100%;
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .market-pill, .scanner-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    flex-shrink: 0;
  }
  
  /* Main Content Spacing */
  .content {
    padding: 0.85rem 0.75rem calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: clip !important;
  }
  
  /* Grids & Cards */
  .grid2, .grid3, .analytics-split, .bt-analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }
  
  .card {
    padding: 1rem 0.95rem !important;
    border-radius: var(--radius-md) !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* High-Density 2-Column Mobile KPI Matrix */
  .kpi-row, .dash-kpi-grid, .signals-kpi-grid, .scanner-kpi-grid, .analytics-kpi-grid, .bt-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem 0.65rem !important;
    margin-bottom: 1rem;
    width: 100% !important;
  }
  
  .kpi, .bt-kpi-card {
    padding: 0.85rem 0.95rem !important;
    border-radius: var(--radius-md) !important;
  }
  
  .kpi .k-lbl, .bt-kpi-label {
    font-size: 0.66rem !important;
    letter-spacing: 0.04em !important;
  }
  
  .kpi .k-val, .bt-kpi-val {
    font-size: 1.3rem !important;
    margin-top: 0.25rem !important;
    line-height: 1.15 !important;
  }
  
  .kpi .k-sub, .bt-kpi-sub {
    font-size: 0.68rem !important;
    margin-top: 0.2rem !important;
  }
  
  .kpi .k-ico {
    font-size: 2.8rem !important;
    top: -6px !important;
    right: -6px !important;
  }
  
  .funnel-row, .scanner-funnel-track, .dash-regime-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
    width: 100% !important;
  }
  .status-grid, .scanner-pipe-grid, .pro-signal-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }
  
  /* Touch Ergonomics & Form Controls */
  input:not(.mini-select):not(.mini-input), select:not(.mini-select), textarea {
    font-size: 16px !important;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
  }

  .mini-select, .mini-input {
    font-size: 0.82rem !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 0.25rem 0.6rem !important;
  }
  
  /* Hero & Card Headers */
  .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100% !important;
  }
  
  .card-head > div:first-child {
    width: 100%;
  }

  .card-head .row-btns, .engine-hero .row-btns, .dash-hero .row-btns {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }
  
  .card-head .row-btns button, .chip-btn {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    width: auto;
    flex: initial;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Form Submission Buttons */
  .auth-fields .row-btns, .form-grid .row-btns, .settings-actions .row-btns {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  
  .auth-fields .row-btns button, .form-grid .row-btns button {
    width: 100%;
    min-height: 48px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Riya Card on Mobile */
  .ai-query-wrap {
    margin-top: 0.75rem;
  }
  
  .ai-input-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .ai-input-row input {
    font-size: 16px !important;
    min-height: 46px;
  }
  
  .ai-input-row button {
    width: 100%;
    min-height: 42px;
  }
  
  .ai-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    width: 100%;
  }
  .ai-chips::-webkit-scrollbar {
    display: none;
  }
  
  .ai-chip {
    flex-shrink: 0;
    min-height: 32px;
    padding: 0.3rem 0.65rem;
    font-size: 0.74rem;
  }
  
  /* Filter Ribbon Horizontal Scroll */
  .filter-chips, .analytics-filter-chips, .bt-pill-selector, .tab-chips, #bt-trade-filter-chips, .signals-filter-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 0.35rem !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .filter-chips::-webkit-scrollbar,
  .analytics-filter-chips::-webkit-scrollbar,
  .bt-pill-selector::-webkit-scrollbar,
  .tab-chips::-webkit-scrollbar,
  #bt-trade-filter-chips::-webkit-scrollbar,
  .signals-filter-chips::-webkit-scrollbar {
    display: none !important;
  }
  
  .filter-chip, .tab-btn, .bt-pill-btn, .sig-filter-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* Data Tables Mobile Optimization */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .data-table, .bt-interactive-table, .analytics-log-table, .scanner-radar-table {
    font-size: 0.78rem;
    min-width: 580px !important;
  }
  
  .data-table th, .data-table td {
    padding: 0.65rem 0.75rem;
    white-space: nowrap;
  }

  /* ===================== PRO QUANT ANALYTICS MOBILE ===================== */
  .analytics-hero .tab-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .analytics-hero-right {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .analytics-date-picker-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
  }

  .analytics-date-picker-wrap input {
    max-width: 145px !important;
    padding: 0.25rem 0.5rem !important;
  }

  .analytics-active-pill {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.72rem !important;
  }

  .analytics-period-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 0.35rem !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .analytics-period-bar::-webkit-scrollbar { display: none !important; }

  .analytics-chart-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .ana-chart-legend {
    flex-wrap: wrap !important;
    gap: 0.4rem 0.75rem !important;
    font-size: 0.7rem !important;
    width: 100% !important;
  }

  .analytics-chart-host {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 180px !important;
    overflow: hidden !important;
    padding: 0.5rem 0.35rem !important;
    box-sizing: border-box !important;
  }

  .analytics-chart-host svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
    display: block !important;
  }

  .analytics-tod-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ana-tod-cell {
    padding: 0.65rem 0.75rem !important;
  }

  .analytics-regime-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ana-regime-cell {
    padding: 0.65rem 0.75rem !important;
  }

  .analytics-search-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
    width: 100% !important;
  }

  .analytics-search-box {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ===================== PRO QUANT BACKTEST STUDIO MOBILE ===================== */
  .bt-studio-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .bt-control-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  .bt-spotlight-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .bt-champion-card {
    padding: 0.95rem 1rem !important;
  }

  .bt-chart-card, .bt-chart-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #bt-equity-svg {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: block !important;
  }

  .bt-chart-legend {
    flex-wrap: wrap !important;
    gap: 0.4rem 0.75rem !important;
    font-size: 0.7rem !important;
  }

  .bt-hourly-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .bt-hourly-row {
    gap: 0.45rem !important;
    font-size: 0.72rem !important;
  }

  .bt-hourly-label {
    width: 40px !important;
    font-size: 0.68rem !important;
  }

  .bt-hourly-meta {
    width: 72px !important;
    font-size: 0.68rem !important;
  }

  .bt-outcome-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .bt-outcome-card {
    padding: 0.65rem 0.75rem !important;
  }

  .bt-trades-header-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  .bt-trades-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .bt-search-wrap, .bt-search-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .bt-computing-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .bt-computing-title-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.3rem !important;
  }
  
  /* Modals Mobile Bottom Sheet */
  .bt-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  
  .bt-modal, .bt-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6) !important;
  }
  
  /* Mobile Bottom Navigation Dock */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--nav-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid var(--border);
    z-index: 900;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  }
  
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0;
    height: 52px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius-sm);
    box-shadow: none;
    min-width: 0;
  }
  
  .mobile-nav-item:active {
    transform: scale(0.92);
  }
  
  .mobile-nav-item .m-ico {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .mobile-nav-item .m-lbl {
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
  }
  
  .mobile-nav-item:hover {
    color: var(--text-2);
  }
  
  .mobile-nav-item.active {
    color: var(--accent-light);
    position: relative;
  }
  
  .mobile-nav-item.active .m-ico {
    transform: translateY(-2px);
    color: var(--accent-light);
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
  }
  
  .mobile-nav-item.active::after {
    content: "";
    position: absolute;
    top: 2px;
    width: 20px;
    height: 2.5px;
    background: var(--accent);
    border-radius: var(--radius-pill);
    box-shadow: 0 0 8px var(--accent);
  }
}

@media (max-width: 480px) {
  .card { padding: 0.9rem 0.85rem !important; border-radius: var(--radius-md) !important; }
  .auth-card { padding: 1.6rem 1.25rem; border-radius: var(--radius); }
}

/* ===================== TABLE FILTERS & CONTROLS ===================== */
.hist-filters, .open-filters {
  margin-bottom: 1.1rem;
}

.hist-filters-row {
  display: flex;
  align-items: center;
  gap: 0.65rem 0.85rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}

.hf-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.hf-field span {
  white-space: nowrap;
}

.mini-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-height: 34px;
  height: 34px;
  line-height: 1.2;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mini-select:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}

.mini-select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.hf-meta {
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

/* ===================== Riya — AI Companion Design System ===================== */
.ai-desk-card {
  position: relative;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(18, 16, 30, 0.85) 50%, rgba(236, 72, 153, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ai-desk-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #ec4899, #6366f1);
}

.ai-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ai-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.ai-pulse-box {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  background: rgba(10, 15, 24, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.ai-pulse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.mini-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
}

.mini-close:hover {
  color: var(--text);
}

.ai-pulse-content {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

.ai-query-wrap {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-input-row {
  display: flex;
  gap: 0.5rem;
  position: relative;
}

.ai-input-row input {
  flex: 1;
  min-width: 0;
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  transition: all 0.2s ease;
}

.ai-input-row input:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  background: rgba(18, 22, 34, 0.98);
}

.ai-input-row input::placeholder {
  color: var(--muted);
  font-size: 0.84rem;
}

.ai-send-btn {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
  color: #fff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}

.ai-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45);
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: none;
}

.ai-chip:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.ai-response-card {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  background: rgba(13, 18, 28, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.25s ease;
}

.ai-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-response-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-light);
}

.ai-response-time {
  font-size: 0.7rem;
  color: var(--muted);
}

.ai-response-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

.ai-response-body strong {
  color: #fff;
  font-weight: 700;
}

.ai-loading-spinner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.spin {
  display: inline-block;
  animation: spin 1.2s linear infinite;
  color: var(--accent-light);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===================== TOD HEATMAP & HOUR FILTER ===================== */
.tod-heatmap {
  margin-top: 0.65rem;
}

.tod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.65rem;
}

.tod-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tod-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.tod-cell.good {
  background: rgba(16, 185, 129, calc(0.08 + var(--int, 50) * 0.0018));
  border-color: rgba(16, 185, 129, 0.35);
}

.tod-cell.mid {
  background: rgba(245, 158, 11, calc(0.08 + var(--int, 50) * 0.0015));
  border-color: rgba(245, 158, 11, 0.35);
}

.tod-cell.low {
  background: rgba(244, 63, 94, calc(0.06 + var(--int, 50) * 0.0012));
  border-color: rgba(244, 63, 94, 0.28);
}

.tod-cell.selected {
  border-color: var(--accent-light) !important;
  box-shadow: 0 0 0 2px var(--accent-light), 0 6px 18px rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.22) !important;
  transform: translateY(-2px);
}

.tod-hr {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}

.tod-cell.selected .tod-hr {
  color: #fff;
}

.tod-wr {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
}

.tod-cell.good .tod-wr {
  color: var(--green);
}

.tod-cell.mid .tod-wr {
  color: var(--amber);
}

.tod-cell.low .tod-wr {
  color: var(--red);
}

.tod-n {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.tod-sel-tick {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.65rem;
  color: var(--accent-light);
  font-weight: 800;
}

.tod-active-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-pill);
  color: var(--accent-light);
}

.tod-detail-wrap {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease;
}

.tod-detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.tod-dh-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tod-dh-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
}

.tod-dh-stats {
  font-size: 0.8rem;
  color: var(--text-2);
}

.tod-dh-right {
  display: flex;
  gap: 0.4rem;
}

.tod-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ===================== STICKY TABLE COLUMNS & MOBILE UX (F-04) ===================== */
.table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (max-width: 768px) {
  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 6;
    background: var(--surface-2);
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.2);
  }
  .data-table td:first-child {
    background: var(--surface);
    font-weight: 700;
    color: var(--text);
  }
}

/* ===================== BACKTEST STUDIO SUITE ===================== */
.bt-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--grad-card);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.bt-hero .hero-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(6, 182, 212, 0.1) 50%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.bt-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.bt-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bt-group-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bt-pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.bt-pill-btn {
  flex: 1;
  min-width: 65px;
  text-align: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-light);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.bt-pill-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.bt-pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
  font-weight: 700;
}

.bt-chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bt-chip-btn {
  padding: 0.36rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
}

.bt-chip-btn:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.bt-chip-btn.active {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.22), inset 0 0 8px rgba(99, 102, 241, 0.1);
  font-weight: 700;
}


.bt-action-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.bt-run-btn {
  background: var(--grad-brand);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  flex: 1;
}

.bt-run-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.55);
}

.bt-run-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Champions Spotlight Cards */
.bt-spotlight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.bt-spotlight-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bt-spotlight-card.gold {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(20, 28, 44, 0.65) 100%);
}

.bt-spotlight-card.cyan {
  border-color: rgba(6, 182, 212, 0.4);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(20, 28, 44, 0.65) 100%);
}

.bt-spotlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.bt-spotlight-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
}

.bt-spotlight-badge.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.bt-spotlight-badge.cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.bt-spotlight-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.bt-spotlight-metric {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
}

/* Backtest Leaderboard Bar Visuals */
.bt-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.bt-bar-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.bt-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.bt-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.bt-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Heatmap Grid */
.bt-heatmap-cell {
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.bt-heatmap-cell:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Trade Log Filters */
.bt-trade-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.bt-tf-chip {
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bt-tf-chip:hover {
  color: var(--text);
}

.bt-tf-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* Background Execution & Polling Widgets */
.bt-computing-card {
  margin-top: 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(20, 28, 44, 0.75) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.18);
  animation: btPulseGlow 3s infinite ease-in-out;
}

@keyframes btPulseGlow {
  0%, 100% { border-color: rgba(99, 102, 241, 0.35); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15); }
  50% { border-color: rgba(99, 102, 241, 0.65); box-shadow: 0 8px 35px rgba(99, 102, 241, 0.35); }
}

.bt-computing-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.bt-spinner-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-light, #818cf8);
  border-right-color: var(--cyan, #38bdf8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.bt-orbit-ico {
  font-size: 1.25rem;
  animation: btIconPulse 1.5s ease-in-out infinite;
}

@keyframes btIconPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

.bt-computing-meta {
  flex: 1;
}

.bt-computing-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.bt-computing-title-row h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Topbar Background Job Pill */
.bt-topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-light, #818cf8);
  transition: all 0.2s ease;
  user-select: none;
}

.bt-topbar-badge:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.bt-topbar-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.bt-badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #6366f1);
  box-shadow: 0 0 8px var(--accent);
  animation: clockPulse 1.4s ease-in-out infinite;
}

.bt-topbar-badge.ready .bt-badge-pulse {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Sidebar Nav Badge */
.nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  animation: clockPulse 1.5s infinite;
}

/* Notification Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(10px);
  opacity: 0;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.toast.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-msg {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

/* ==========================================================================
   PRO QUANT INTRADAY BACKTEST STUDIO STYLES
   ========================================================================== */

.bt-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  width: 100%;
}

.bt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.bt-kpi-card {
  background: var(--surface-glass-card, rgba(15, 23, 42, 0.65));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 14px);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.bt-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
}

.bt-kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--accent));
  opacity: 0.8;
}

.bt-kpi-card.green::after { background: #10b981; }
.bt-kpi-card.red::after { background: #f43f5e; }
.bt-kpi-card.blue::after { background: #6366f1; }
.bt-kpi-card.amber::after { background: #f59e0b; }
.bt-kpi-card.purple::after { background: #a855f7; }

.bt-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.bt-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.bt-kpi-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.bt-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-family: var(--font-mono, monospace);
}

.bt-kpi-val.green { color: #10b981; }
.bt-kpi-val.red { color: #f43f5e; }

.bt-kpi-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* Analytics Grid (Dual Charts & Heatmap) */
.bt-analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .bt-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.bt-chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.bt-leg-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.bt-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.bt-leg-dot.green { background: #10b981; box-shadow: 0 0 6px #10b981; }
.bt-leg-dot.red { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }

.bt-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm, 8px);
  padding: 0.5rem 0.75rem;
  font-size: 0.74rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 50;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  white-space: nowrap;
}

/* Hourly Performance Heatmap */
.bt-hourly-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bt-hourly-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.bt-hourly-label {
  width: 48px;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
}

.bt-hourly-bar-bg {
  flex: 1;
  height: 22px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 6px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.bt-hourly-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm, 6px);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
}

.bt-hourly-bar-fill.pos {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.75) 100%);
}

.bt-hourly-bar-fill.neg {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.3) 0%, rgba(244, 63, 94, 0.75) 100%);
}

.bt-hourly-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  font-family: var(--font-mono, monospace);
}

.bt-hourly-meta {
  width: 90px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

/* Outcome Distribution Grid */
.bt-outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.bt-outcome-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: center;
  transition: all 0.2s ease;
}

.bt-outcome-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.bt-outcome-ico {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.bt-outcome-num {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: var(--text);
}

.bt-outcome-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Trade Table Controls & Search */
.bt-trades-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.bt-trades-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.bt-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bt-search-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0.6;
}

.bt-search-input {
  padding: 0.35rem 0.75rem 0.35rem 1.9rem;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  color: var(--text);
  width: 180px;
  transition: all 0.2s ease;
}

.bt-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  width: 220px;
}

.bt-tf-chip {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bt-tf-chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.bt-tf-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Interactive Table & Inspect Button */
.bt-interactive-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.bt-interactive-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}

.bt-inspect-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bt-inspect-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Confluence Glow Pill */
.confluence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(239, 68, 68, 0.3) 100%);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
  animation: glowPulse 2s infinite;
}

/* Trade Diagnostics Modal */
.bt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.bt-modal-backdrop.hidden {
  display: none;
  opacity: 0;
}

.bt-modal-card {
  background: var(--surface-glass-card, #0f172a);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 18px);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.bt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.02);
}

.bt-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bt-modal-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
}

.bt-modal-title-group h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.bt-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.bt-modal-close:hover {
  color: var(--red);
}

.bt-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bt-diag-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.bt-diag-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.bt-diag-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.bt-diag-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.bt-diag-row:last-child {
  margin-bottom: 0;
}

.bt-diag-lbl {
  color: var(--muted);
}

.bt-diag-val {
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text);
}

/* ===================== PRO QUANT EXECUTIVE DASHBOARD ===================== */
.dash-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.3rem;
}

.dash-status-bar {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.9rem;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.3rem;
}

.dash-kpi-grid .kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--inner-highlight), var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-kpi-grid .kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}

.dash-kpi-grid .kpi.kpi-green::before { background: var(--green); }
.dash-kpi-grid .kpi.kpi-blue::before { background: var(--accent); }
.dash-kpi-grid .kpi.kpi-purple::before { background: #a855f7; }
.dash-kpi-grid .kpi.kpi-amber::before { background: var(--amber); }
.dash-kpi-grid .kpi.kpi-red::before { background: var(--red); }

.dash-kpi-grid .kpi:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), var(--shadow-lg);
}

/* Riya AI Desk Card & Controls */
.ai-desk-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 50%, var(--surface-glass-card) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-bottom: 1.3rem;
}

.ai-pulse-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.15);
  animation: panelFadeIn 0.25s ease-out;
}

.ai-pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.ai-pulse-content {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
}

.ai-query-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-input-row {
  display: flex;
  gap: 0.6rem;
}

.ai-input-row input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.ai-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: var(--surface);
}

.ai-send-btn {
  width: 44px;
  height: 42px;
  min-width: 44px;
  max-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.ai-send-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.5);
}

.ai-send-btn:active {
  transform: translateY(1px) scale(0.97);
}

.ai-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-send-btn svg {
  display: block;
  transform: translate(1px, -1px);
  transition: transform 0.15s ease;
}

.ai-send-btn:hover svg {
  transform: translate(2px, -2px);
}

.ai-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: none;
  transition: all 0.15s ease;
}

.ai-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text);
  transform: translateY(-1px);
}

/* Riya 2.0 Cockpit Components */
.riya-hud-head {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.85rem;
}

.riya-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.riya-avatar-halo {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, rgba(99, 102, 241, 0.1) 70%, transparent 100%);
  animation: riyaHaloPulse 2.8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.riya-avatar-halo.halo-protective {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.7) 0%, rgba(239, 68, 68, 0.2) 70%, transparent 100%);
}

.riya-avatar-halo.halo-focused {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.7) 0%, rgba(6, 182, 212, 0.2) 70%, transparent 100%);
}

.riya-avatar-halo.halo-spicy {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.8) 0%, rgba(217, 70, 239, 0.2) 70%, transparent 100%);
}

@keyframes riyaHaloPulse {
  0% { transform: scale(0.92); opacity: 0.55; }
  100% { transform: scale(1.18); opacity: 0.95; }
}

.riya-avatar-img {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

.riya-meter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.riya-meter-bar {
  width: 55px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.riya-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Audio Player Strip */
.riya-audio-player-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.85rem;
  animation: panelFadeIn 0.2s ease-out;
}

.riya-audio-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--accent-light);
}

.riya-soundwave-icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
}

.riya-soundwave-icon .wave-bar {
  width: 3px;
  background: #a855f7;
  border-radius: 1.5px;
  animation: soundWaveAnim 1.2s ease-in-out infinite alternate;
}

.riya-soundwave-icon .wave-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.riya-soundwave-icon .wave-bar:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.riya-soundwave-icon .wave-bar:nth-child(3) { height: 10px; animation-delay: 0.15s; }
.riya-soundwave-icon .wave-bar:nth-child(4) { height: 16px; animation-delay: 0.4s; }

@keyframes soundWaveAnim {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.0); }
}

/* Multi-Turn Chat Stream */
.riya-chat-stream {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0.2rem 0.85rem;
  margin-bottom: 0.85rem;
  scroll-behavior: smooth;
}

.riya-chat-stream:empty {
  display: none;
}

.riya-msg-row {
  display: flex;
  flex-direction: column;
  animation: panelFadeIn 0.22s ease-out;
}

.riya-msg-row.user-row {
  align-items: flex-end;
}

.riya-msg-row.assistant-row {
  align-items: flex-start;
}

.riya-bubble {
  max-width: 82%;
  padding: 0.7rem 0.95rem;
  font-size: 0.87rem;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.riya-msg-row.user-row .riya-bubble {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.25) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 14px 14px 3px 14px;
  color: var(--text);
}

.riya-msg-row.assistant-row .riya-bubble {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 14px 14px 14px 3px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.riya-bubble-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.71rem;
  color: var(--muted);
}

.riya-listen-btn {
  background: transparent;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.45rem;
  font-size: 0.71rem;
  color: var(--accent-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.riya-listen-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #fff;
}

.riya-typing-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  color: var(--accent-light);
}

.muted-btn {
  opacity: 0.6;
}
.muted-btn:hover {
  opacity: 1;
}

/* Multi-Index Live Market Rails Grid */
.dash-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.dash-market-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dash-market-tile:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dash-market-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.dash-market-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.dash-market-spot {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

.dash-market-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.74rem;
}

/* Quick Navigation Ribbon */
.dash-quick-links .row-btns .ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: none;
  transition: all 0.2s ease;
}

.dash-quick-links .row-btns .ghost:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ===================== PRO QUANT LIVE SCANNER COCKPIT ===================== */
.scanner-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.3rem;
}

.scanner-status-bar {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.9rem;
}

.scanner-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: var(--green-dim);
  color: var(--green);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.scanner-live-pill .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.scanner-live-pill.idle {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--amber-dim);
  color: var(--amber);
}

.scanner-live-pill.idle .pulse-dot {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

/* 6-Grid Scanner KPI Row */
.scanner-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.3rem;
}

.scanner-kpi-grid .kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--inner-highlight), var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-kpi-grid .kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}

.scanner-kpi-grid .kpi.kpi-green::before { background: var(--green); }
.scanner-kpi-grid .kpi.kpi-blue::before { background: var(--accent); }
.scanner-kpi-grid .kpi.kpi-purple::before { background: #a855f7; }
.scanner-kpi-grid .kpi.kpi-amber::before { background: var(--amber); }
.scanner-kpi-grid .kpi.kpi-red::before { background: var(--red); }

.scanner-kpi-grid .kpi:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), var(--shadow-lg);
}

/* Multi-Stage Quant Filter Funnel Track */
.scanner-funnel-card {
  margin-bottom: 1.3rem;
}

.funnel-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.scanner-funnel-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.scanner-funnel-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-funnel-step:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-2px);
}

.scanner-funnel-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.scanner-funnel-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.scanner-funnel-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-bottom: 0.25rem;
}

.scanner-funnel-val {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  line-height: 1.15;
}

.scanner-funnel-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Market Breadth Rails */
.scanner-breadth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.scanner-breadth-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  transition: all 0.2s ease;
}

.scanner-breadth-card:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}

.scanner-breadth-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Active Instrument Pipeline Grid */
.scanner-indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.2rem;
  margin-top: 0.8rem;
}

.scanner-idx-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.scanner-idx-card:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  box-shadow: var(--shadow);
}

.scanner-idx-card.closed {
  opacity: 0.65;
}

.scanner-idx-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.scanner-idx-name-wrap h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.scanner-idx-spot {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  text-align: right;
}

.scanner-idx-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.scanner-idx-meta-col {
  display: flex;
  flex-direction: column;
}

.scanner-idx-meta-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scanner-idx-meta-val {
  font-size: 0.84rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  margin-top: 0.15rem;
}

/* Strategy Scan Matrix Inside Card */
.scanner-strat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.scanner-strat-chip {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  white-space: nowrap;
}

.scanner-strat-chip.fired {
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--green-dim);
  color: var(--green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.scanner-strat-chip.regime-block {
  border-color: rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.06);
  color: var(--red);
  opacity: 0.8;
}

.scanner-strat-chip.oi-block {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
  color: var(--amber);
  opacity: 0.8;
}

.scanner-strat-chip.waiting {
  color: var(--muted);
  opacity: 0.7;
}

/* Radar & Telemetry Table */
.scanner-radar-table th {
  padding: 0.8rem 0.9rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scanner-radar-table td {
  padding: 0.8rem 0.9rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-subtle);
}

.scanner-radar-table tr:hover td {
  background: var(--surface-2);
}

/* Pipeline History Grid */
.scanner-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 1rem 0 0.5rem;
}

.scanner-hist-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.scanner-hist-card:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-1px);
}

/* ===================== PRO QUANT SIGNAL ANALYTICS COCKPIT ===================== */
.analytics-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.3rem;
}

.analytics-hero .tab-bar {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.9rem;
}

.analytics-hero-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.analytics-date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.analytics-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: var(--green-dim);
  color: var(--green);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.analytics-active-pill .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* 6-Grid KPI Row */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.3rem;
}

.analytics-kpi-grid .kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--inner-highlight), var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.analytics-kpi-grid .kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}

.analytics-kpi-grid .kpi.kpi-green::before { background: var(--green); }
.analytics-kpi-grid .kpi.kpi-blue::before { background: var(--accent); }
.analytics-kpi-grid .kpi.kpi-purple::before { background: #a855f7; }
.analytics-kpi-grid .kpi.kpi-amber::before { background: var(--amber); }
.analytics-kpi-grid .kpi.kpi-red::before { background: var(--red); }

.analytics-kpi-grid .kpi:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), var(--shadow-lg);
}

.analytics-chart-card {
  margin-bottom: 1.3rem;
}

.ana-chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.legend-dot.purple { background: #8b5cf6; box-shadow: 0 0 6px #8b5cf6; }
.legend-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }

.analytics-chart-host {
  width: 100%;
  min-height: 220px;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
}

/* Hourly Killzone Grid */
.analytics-tod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.ana-tod-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ana-tod-cell:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  transform: translateY(-2px);
}

.ana-tod-cell.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.06) 100%);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px rgba(99, 102, 241, 0.25);
}

.ana-tod-hour {
  font-size: 0.88rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ana-tod-session {
  font-size: 0.68rem;
  color: var(--accent-light);
  font-weight: 700;
  margin: 0.25rem 0 0.45rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ana-tod-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.ana-tod-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.ana-tod-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

/* Regime Sensitivity Grid */
.analytics-regime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.ana-regime-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.ana-regime-cell:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.ana-regime-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* Log Card, Search & Filters */
.analytics-log-head {
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
}

.analytics-log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.analytics-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  min-width: 240px;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease;
}

.analytics-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.analytics-search-box input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
  width: 100%;
  padding: 0;
  box-shadow: none;
}

.analytics-filter-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.analytics-log-table th {
  padding: 0.8rem 0.9rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.analytics-log-table td {
  padding: 0.8rem 0.9rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-subtle);
}

.analytics-log-table tr:hover td {
  background: var(--surface-2);
}

/* ===================== PRO QUANT LIVE SIGNALS TERMINAL ===================== */
.signals-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.signals-period-bar {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.signals-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.signals-filter-card {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.35rem;
}

.signals-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pro-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.15rem;
}

@media (max-width: 768px) {
  .pro-signal-grid {
    grid-template-columns: 1fr;
  }
}

.sig-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sig-card:hover {
  border-color: var(--accent, #38bdf8);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.14), var(--shadow-md);
}

.sig-card:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: var(--shadow-sm);
}

.sig-card.live {
  border-left: 4px solid var(--green);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, var(--surface-glass-card) 70%);
}

.sig-card.settled {
  border-left: 4px solid var(--border-2);
}

.sig-card.target {
  border-left: 4px solid var(--green);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--surface-glass-card) 70%);
}

.sig-card.trail {
  border-left: 4px solid var(--purple, #a855f7);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, var(--surface-glass-card) 70%);
}

.sig-card.breakeven {
  border-left: 4px solid var(--blue, #3b82f6);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, var(--surface-glass-card) 70%);
}

.sig-card.momentum {
  border-left: 4px solid var(--amber, #f59e0b);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, var(--surface-glass-card) 70%);
}

.sig-card.stop {
  border-left: 4px solid var(--red);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.05) 0%, var(--surface-glass-card) 70%);
}

.signals-quick-links {
  margin-top: 1.25rem;
}

/* ===================== PRO QUANT BACKTEST STUDIO ===================== */
.backtest-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.bt-pill-selector {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.bt-pill-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bt-pill-btn:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.bt-pill-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.bt-computing-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--surface-glass-card) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.bt-computing-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.bt-spinner-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: bt-spin 1s linear infinite;
}

@keyframes bt-spin {
  to { transform: rotate(360deg); }
}

.bt-orbit-ico {
  font-size: 1.2rem;
  color: var(--accent-light);
}

.bt-computing-meta {
  flex: 1;
}

.bt-computing-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.bt-computing-title-row h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.bt-topbar-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-light);
  cursor: pointer;
  animation: pulse-border 2s infinite;
}

.bt-badge-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent-light);
}

.bt-spotlight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.bt-champion-card {
  background: var(--surface-glass-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.bt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.bt-chart-card {
  position: relative;
}

.bt-chart-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.bt-leg-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bt-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bt-leg-dot.green { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.bt-leg-dot.red { background: var(--red); box-shadow: 0 0 6px rgba(244, 63, 94, 0.6); }

.bt-chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.74rem;
  pointer-events: none;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.bt-hourly-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bt-outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.bt-interactive-table th {
  padding: 0.75rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.bt-interactive-table td {
  padding: 0.75rem 0.85rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-subtle);
}

.bt-interactive-table tr:hover td {
  background: var(--surface-2);
}

.bt-quick-links {
  margin-top: 1.25rem;
}

/* ==========================================================================
   2026 POLISH LAYER — Spacing · Typography · Liveliness · Ambient Sound
   Additive only — no existing rules overridden.
   ========================================================================== */

/* ===================== SPACING SCALE TOKENS ===================== */
:root {
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --font-display: 2.1rem;
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --orb-1-color: rgba(99, 102, 241, 0.12);
  --orb-2-color: rgba(6, 182, 212, 0.08);
  --orb-3-color: rgba(168, 85, 247, 0.07);
}

html[data-theme="tokyo"] {
  --orb-1-color: rgba(122, 162, 247, 0.14);
  --orb-2-color: rgba(187, 154, 247, 0.11);
  --orb-3-color: rgba(125, 207, 255, 0.08);
}

html[data-theme="emerald"] {
  --orb-1-color: rgba(16, 185, 129, 0.14);
  --orb-2-color: rgba(20, 184, 166, 0.10);
  --orb-3-color: rgba(34, 197, 94, 0.08);
}

html[data-theme="amber"] {
  --orb-1-color: rgba(245, 158, 11, 0.14);
  --orb-2-color: rgba(217, 119, 6, 0.10);
  --orb-3-color: rgba(251, 191, 36, 0.08);
}

html[data-theme="nordic"] {
  --orb-1-color: rgba(56, 189, 248, 0.14);
  --orb-2-color: rgba(129, 140, 248, 0.10);
  --orb-3-color: rgba(125, 211, 252, 0.08);
}

html[data-theme="crimson"] {
  --orb-1-color: rgba(244, 63, 94, 0.14);
  --orb-2-color: rgba(251, 146, 60, 0.10);
  --orb-3-color: rgba(192, 132, 252, 0.08);
}

html[data-theme="light"] {
  --orb-1-color: rgba(99, 102, 241, 0.06);
  --orb-2-color: rgba(6, 182, 212, 0.05);
  --orb-3-color: rgba(168, 85, 247, 0.04);
}

/* ===================== FLOATING AMBIENT ORBS ===================== */
.ambient-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 1;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, var(--orb-1-color), transparent 70%);
  animation: orbDrift1 22s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  bottom: 5%;
  left: -80px;
  background: radial-gradient(circle, var(--orb-2-color), transparent 70%);
  animation: orbDrift2 28s ease-in-out infinite alternate;
}

.orb-3 {
  width: 400px;
  height: 400px;
  top: 40%;
  left: 35%;
  background: radial-gradient(circle, var(--orb-3-color), transparent 70%);
  animation: orbDrift3 35s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-60px, 80px) scale(1.08); }
  66%  { transform: translate(40px, -40px) scale(0.95); }
  100% { transform: translate(-30px, 60px) scale(1.05); }
}

@keyframes orbDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  40%  { transform: translate(70px, -50px) scale(1.1); }
  80%  { transform: translate(-40px, 30px) scale(0.92); }
  100% { transform: translate(50px, -70px) scale(1.06); }
}

@keyframes orbDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-80px, 60px) scale(1.15); }
  100% { transform: translate(60px, -40px) scale(0.9); }
}

/* ===================== ENHANCED TYPOGRAPHY ===================== */
/* Bigger, more impactful KPI numbers */
.kpi .k-val {
  font-size: 2rem !important;
  letter-spacing: -0.045em !important;
  line-height: 1.1 !important;
  font-feature-settings: "tnum" 1, "ss01" 1 !important;
}

.kpi .k-lbl {
  font-size: 0.695rem !important;
  letter-spacing: 0.09em !important;
  line-height: 1.4 !important;
}

.kpi .k-sub {
  font-size: 0.78rem !important;
  margin-top: 0.4rem !important;
  line-height: 1.35 !important;
}

/* Stat tile values */
.stat-tile .value {
  font-size: 1.45rem !important;
  font-feature-settings: "tnum" 1 !important;
  letter-spacing: -0.025em !important;
}

/* Gradient hero text on card h3 inside engine-hero */
.engine-hero .card-head h3,
.engine-hero .card-head > div > div h3 {
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav section labels — subtle glow underline */
.nav-section-label {
  position: relative;
}

.nav-section-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.85rem;
  width: 20px;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
  border-radius: var(--radius-pill);
}

/* ===================== DESKTOP SPACING REFINEMENTS ===================== */
/* More generous card padding */
.card {
  padding: 1.5rem 1.65rem !important;
  margin-bottom: 1.4rem !important;
}

.card-head {
  margin-bottom: 1.3rem !important;
  gap: 1.1rem !important;
}

/* Taller topbar for more breathing room */
.topbar {
  padding: 1rem 2.2rem !important;
}

/* Content area — slightly more generous */
.content {
  padding: 2rem 2.25rem 3.5rem !important;
}

/* KPI tiles — more internal padding */
.kpi {
  padding: 1.4rem 1.55rem !important;
}

/* Better gap between KPI grids */
.dash-kpi-grid,
.scanner-kpi-grid,
.signals-kpi-grid {
  gap: 1.25rem !important;
}

/* ===================== ENHANCED CARD HOVER ===================== */
.card:hover {
  border-color: var(--border-2) !important;
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.06) !important;
}

/* KPI tile hover — spring lift */
.kpi:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--inner-highlight), var(--shadow-lg), 0 0 24px rgba(99, 102, 241, 0.1) !important;
}

/* ===================== KPI TOP BORDER SWEEP ANIMATION ===================== */
.dash-kpi-grid .kpi::before,
.scanner-kpi-grid .kpi::before {
  height: 3px !important;
  background: var(--accent) !important;
  animation: kpiBorderPulse 3s ease-in-out infinite !important;
}

.dash-kpi-grid .kpi.kpi-green::before,
.scanner-kpi-grid .kpi.kpi-green::before { background: var(--green) !important; animation-delay: 0.3s !important; }
.dash-kpi-grid .kpi.kpi-purple::before,
.scanner-kpi-grid .kpi.kpi-purple::before { background: #a855f7 !important; animation-delay: 0.6s !important; }
.dash-kpi-grid .kpi.kpi-amber::before,
.scanner-kpi-grid .kpi.kpi-amber::before { background: var(--amber) !important; animation-delay: 0.9s !important; }
.dash-kpi-grid .kpi.kpi-red::before,
.scanner-kpi-grid .kpi.kpi-red::before { background: var(--red) !important; animation-delay: 1.2s !important; }

@keyframes kpiBorderPulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; box-shadow: 0 0 8px currentColor; }
}

/* ===================== ENHANCED PULSE RINGS ===================== */
/* Multi-ring ripple for brand pulse dot */
.brand-pulse-dot {
  animation: multiRingPulse 2.2s ease-out infinite !important;
}

@keyframes multiRingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.9), 0 0 0 0 rgba(16, 185, 129, 0.5); }
  40%  { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.15), 0 0 0 10px rgba(16, 185, 129, 0.05); }
  100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0), 0 0 0 14px rgba(16, 185, 129, 0); }
}

/* Nav live dot — expanding rings */
.nav-live-dot {
  animation: navLivePulse 2s ease-out infinite !important;
}

@keyframes navLivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8), 0 0 8px var(--green); }
  60%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08), 0 0 12px var(--green); }
  100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0), 0 0 8px var(--green); }
}

/* Clock live dot — ring ripple */
.clock-live-dot {
  animation: clockRingPulse 2s ease-out infinite !important;
}

@keyframes clockRingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8), 0 0 6px #10b981; transform: scale(1); }
  50%  { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.1), 0 0 14px rgba(16, 185, 129, 0.6); transform: scale(1.2); }
  100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0), 0 0 8px rgba(16, 185, 129, 0.4); transform: scale(1); }
}

/* ===================== ENHANCED PANEL TRANSITION ===================== */
@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) translateX(-6px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
    filter: blur(0px);
  }
}

/* ===================== NAV BUTTON HOVER TRAIL ===================== */
.nav-btn {
  overflow: hidden;
}

.nav-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.85rem;
  right: 0.85rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  opacity: 0;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.nav-btn:hover::after {
  opacity: 0.5;
  transform: scaleX(1);
}

.nav-btn.active::after {
  opacity: 0;
}

/* ===================== SHIMMER LOADING SKELETON ===================== */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmerSlide 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmerSlide {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================== SIGNAL CARD HOVER ENHANCEMENT ===================== */
.sig-card:hover {
  border-color: rgba(99, 102, 241, 0.45) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px -8px rgba(99, 102, 241, 0.18), var(--shadow) !important;
}

.sig-card.live:hover {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 12px 32px -8px rgba(16, 185, 129, 0.2), var(--shadow) !important;
}

/* ===================== SCANNER IDX CARD HOVER ===================== */
.scanner-idx-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ===================== AMBIENT SOUND & SFX TOGGLES ===================== */
.ambient-btn,
.sfx-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  box-shadow: none;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.ambient-btn svg,
.sfx-btn svg,
.theme-toggle svg,
.ambient-row-ico svg,
.sfx-row-ico svg,
.theme-row-ico svg,
.nav-btn .ico svg,
.mobile-nav-item .m-ico svg {
  display: block;
  stroke: currentColor;
  fill: none;
  transition: stroke 0.2s ease;
}

.ambient-btn:hover,
.sfx-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ambient-btn.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.5);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.sfx-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--green);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

/* Ambient & SFX sidebar rows */
.ambient-row,
.sfx-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ambient-row:hover,
.sfx-row:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: none;
  box-shadow: none;
  filter: none;
}

.ambient-row.active {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--cyan);
}

.sfx-row.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--green);
}

.ambient-row-ico,
.sfx-row-ico {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
}

.ambient-row.active .ambient-row-ico {
  color: var(--cyan);
}

.sfx-row.active .sfx-row-ico {
  color: var(--green);
}

.ambient-row-txt,
.sfx-row-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
}

.ambient-row-txt strong,
.sfx-row-txt strong {
  font-size: 0.8rem;
  font-weight: 700;
}

.ambient-row-txt em,
.sfx-row-txt em {
  font-size: 0.68rem;
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.ambient-row.active .ambient-row-txt em {
  color: var(--cyan);
  opacity: 0.9;
}

.sfx-row.active .sfx-row-txt em {
  color: var(--green);
  opacity: 0.9;
}

/* Switch pill styling for Ambient & SFX rows */
#ambient-switch-pill .theme-switch-thumb,
#sfx-switch-pill .theme-switch-thumb {
  right: auto;
  left: 2px;
  background: var(--muted);
  box-shadow: none;
}

#ambient-switch-pill.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.45);
}

#ambient-switch-pill.active .theme-switch-thumb {
  left: auto;
  right: 2px;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.6);
}

#sfx-switch-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
}

#sfx-switch-pill.active .theme-switch-thumb {
  left: auto;
  right: 2px;
  background: var(--green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}


/* Sound wave animation bars for active state */
.ambient-waves {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}

.ambient-wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0;
  transform-origin: bottom;
  transition: opacity 0.3s ease;
}

.ambient-row.active .ambient-wave-bar {
  opacity: 1;
}

.ambient-wave-bar:nth-child(1) { animation: waveBar 1.2s ease-in-out infinite 0s; }
.ambient-wave-bar:nth-child(2) { animation: waveBar 1.2s ease-in-out infinite 0.15s; }
.ambient-wave-bar:nth-child(3) { animation: waveBar 1.2s ease-in-out infinite 0.3s; }
.ambient-wave-bar:nth-child(4) { animation: waveBar 1.2s ease-in-out infinite 0.45s; }

@keyframes waveBar {
  0%, 100% { height: 4px; }
  50%       { height: 12px; }
}

/* ===================== MOBILE RESPONSIVE POLISH ===================== */
@media (max-width: 1024px) {
  .content {
    padding: 1.6rem 1.8rem 3rem !important;
  }

  .topbar {
    padding: 0.9rem 1.5rem !important;
  }

  .kpi {
    padding: 1.2rem 1.35rem !important;
  }

  .card {
    padding: 1.3rem 1.4rem !important;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 1.2rem 1rem 5.5rem !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .topbar {
    padding: 0.7rem 1rem !important;
    gap: 0.75rem !important;
  }

  .topbar-left-wrap {
    gap: 0.6rem !important;
  }

  .topbar-title h2 {
    font-size: 1.05rem !important;
  }

  .card {
    padding: 1.1rem 1.15rem !important;
    margin-bottom: 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  .card-head {
    margin-bottom: 1rem !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
  }

  .card h3 {
    font-size: 0.95rem !important;
  }

  .kpi {
    padding: 1rem 1.1rem !important;
  }

  .kpi .k-val {
    font-size: 1.65rem !important;
  }

  .kpi .k-lbl {
    font-size: 0.66rem !important;
  }

  .dash-kpi-grid,
  .scanner-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .signals-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  /* Hide ticker strip on small mobile */
  .ticker-strip {
    display: none !important;
  }

  /* Ambient button visible on mobile topbar */
  .ambient-btn {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 0.95rem !important;
  }

  .bt-diag-grid {
    grid-template-columns: 1fr !important;
  }

  .grid2 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .grid3 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .status-grid {
    grid-template-columns: 1fr !important;
  }

  .scanner-indices-grid {
    grid-template-columns: 1fr !important;
  }

  .bt-spotlight-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  html, body, #app, .app-shell, .main, .content {
    max-width: 100vw !important;
    overflow-x: clip !important;
  }

  .content {
    padding: 1rem 0.85rem 5.5rem !important;
  }

  .topbar {
    padding: 0.65rem 0.85rem !important;
  }

  .kpi .k-val {
    font-size: 1.45rem !important;
    letter-spacing: -0.03em !important;
  }

  .card {
    padding: 0.95rem 1rem !important;
    border-radius: 14px !important;
  }

  .card h3 {
    font-size: 0.9rem !important;
  }

  .dash-kpi-grid,
  .scanner-kpi-grid,
  .signals-kpi-grid,
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.7rem !important;
  }

  .chip-btn {
    font-size: 0.72rem !important;
    padding: 0.35rem 0.7rem !important;
  }

  .row-btns {
    gap: 0.5rem !important;
  }

  .tab-btn {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.76rem !important;
  }
}

/* ===================== ENHANCED SCROLLBAR (DESKTOP) ===================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--radius-pill);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ===================== GLASS CARD — INNER SHINE ON HOVER ===================== */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 1;
}

/* ===================== LIVELY CHIP BUTTONS ===================== */
.chip-btn.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
  font-weight: 700;
}

.chip-btn.primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* ===================== AUTH PAGE — LIVELY BACKGROUND ===================== */
.auth-wrap {
  background:
    radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.18), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.12), transparent 45%),
    radial-gradient(circle at 15% 60%, rgba(168, 85, 247, 0.1), transparent 40%),
    var(--bg) !important;
  animation: authBgShift 12s ease-in-out infinite alternate;
}

@keyframes authBgShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.auth-card {
  animation: authCardFloat 6s ease-in-out infinite alternate;
}

@keyframes authCardFloat {
  0%   { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}

/* ===================== LOGO BADGE — HOVER SPARKLE ===================== */
.logo-badge {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}

.logo-badge:hover {
  transform: rotate(8deg) scale(1.1) !important;
  box-shadow: 0 10px 30px -6px rgba(99, 102, 241, 0.7) !important;
}

/* ===================== TOPBAR CLOCK — ENHANCED GLOW ===================== */
.topbar-clock:hover {
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

/* ===================== TOAST — POLISHED STYLING ===================== */
.toast {
  background: var(--surface-glass-card) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-2) !important;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.5), var(--inner-highlight) !important;
}

/* ===================== ENGINE HERO CARDS — SUBTLE PATTERN ===================== */
.engine-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 30px,
      rgba(255,255,255,0.01) 30px,
      rgba(255,255,255,0.01) 31px
    );
  pointer-events: none;
  z-index: 0;
}

/* ===================== BADGE HOVER MICRO-BOUNCE ===================== */
.badge {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
}

/* ===================== TABLE ROWS — ENHANCED HIGHLIGHT ===================== */
.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%) !important;
}

.bt-interactive-table tr:hover td {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%) !important;
}

.analytics-log-table tr:hover td {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%) !important;
}

/* ===================== MOBILE BOTTOM NAV — ENHANCED ===================== */
.mobile-bottom-nav {
  background: var(--nav-bg) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 -8px 24px -8px rgba(0, 0, 0, 0.35) !important;
}

.mobile-nav-item.active .m-ico {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8));
}

/* ===================== HERO GLOW ENHANCEMENT ===================== */
.hero-glow {
  animation: heroGlowPulse 4s ease-in-out infinite !important;
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.05); }
}

/* ===================== FUNNEL STEP — ANIMATED PROGRESS BAR ===================== */
.scanner-funnel-step::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-funnel-step:hover::after {
  width: 100%;
}

/* ===================== FOCUS VISIBLE IMPROVEMENTS ===================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2) !important;
}

/* =====================================================================
   BUG-FIX PATCH — KPI CARD CLASS ALIASES & BREADTH GRID WIDTH  v20260830b
   Fixes two regressions visible in screenshots:
   1. JS renders .kpi-head/.kpi-label/.kpi-value/.kpi-sub/.kpi-bg-icon
      but CSS only defines .k-lbl/.k-val/.k-sub/.k-ico
   2. .scanner-breadth-grid minmax(130px) → text collision on Regime row
   ===================================================================== */

/* ── KPI inner elements — alias both JS-rendered and legacy class names ── */
.kpi .kpi-bg-icon, .kpi .k-ico {
  position: absolute; right: -8px; top: -10px;
  font-size: 3.8rem; opacity: 0.04;
  pointer-events: none; user-select: none;
}

.kpi .kpi-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 0.4rem;
  margin-bottom: 0.4rem; flex-wrap: wrap;
}

.kpi .kpi-label, .kpi .k-lbl {
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; line-height: 1.3;
}

.kpi .kpi-value, .kpi .k-val {
  font-size: 1.65rem; font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.15;
  color: var(--text); font-family: "JetBrains Mono", monospace;
  margin-bottom: 0.25rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.kpi .kpi-sub, .kpi .k-sub {
  font-size: 0.73rem; color: var(--text-2);
  font-weight: 500; line-height: 1.35;
  white-space: normal; word-break: break-word;
}

/* colour helpers */
.kpi .kpi-text-green { color: var(--green, #10b981) !important; }
.kpi .kpi-text-red   { color: var(--red,   #f43f5e) !important; }

/* top-border accent by variant class */
.kpi.kpi-green { border-top: 3px solid var(--green,  #10b981); }
.kpi.kpi-red   { border-top: 3px solid var(--red,    #f43f5e); }
.kpi.kpi-blue  { border-top: 3px solid var(--blue,   #6366f1); }
.kpi.kpi-amber { border-top: 3px solid var(--amber,  #f59e0b); }
.kpi.kpi-purple{ border-top: 3px solid var(--purple, #a855f7); }

/* kpi-row auto-fill grid (backtest + dashboard) */
#bt-kpi-row.kpi-row, .kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.3rem;
}

/* ── Breadth grid: was 130px min — bumped to 200px so Regime text fits ── */
.scanner-breadth-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

/* Regime / ADX rows: allow wrap if still tight */
.scanner-breadth-card > div {
  flex-wrap: wrap; gap: 0.15rem 0.4rem;
}

/* ── Mobile overrides ── */
@media (max-width: 768px) {
  .kpi .kpi-value, .kpi .k-val { font-size: 1.4rem; white-space: normal; }
  .kpi .kpi-label, .kpi .k-lbl { font-size: 0.68rem; }
}
@media (max-width: 480px) {
  #bt-kpi-row.kpi-row, .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .kpi .kpi-value, .kpi .k-val { font-size: 1.25rem; }
  .scanner-breadth-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
/* ── END BUG-FIX PATCH ── */

/* ==========================================================================
   NEURAL QUANT COCKPIT & CAS RADAR (INSTITUTIONAL MICROSTRUCTURE)
   ========================================================================== */

#panel-neural {
  display: none;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#panel-neural.active {
  display: flex;
  animation: panelFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 1. Hero Header & Real-Time Telemetry Ribbon */
.neural-hero {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.5rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.neural-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.neural-brand-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.neural-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.1));
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--accent-light, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.neural-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.neural-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: #38bdf8;
}

.neural-main-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

.neural-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.neural-pill.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.neural-sub-meta {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.neural-top-kpi-deck {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.neural-top-kpi-deck .n-kpi-chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  min-width: 85px;
}

.neural-top-kpi-deck .n-kpi-lbl {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.neural-top-kpi-deck .n-sub-tag {
  color: var(--accent-light, #38bdf8);
}

.neural-top-kpi-deck .n-kpi-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.neural-clock-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
}

.neural-time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-light, #38bdf8);
}

.neural-tz {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.neural-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.control-group-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-right: 0.35rem;
}

/* 2. Cockpit Grid Layouts */
.neural-cockpit-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
}

.neural-cockpit-card {
  background: var(--surface-glass-card, rgba(17, 24, 39, 0.75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.neural-cockpit-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.6);
}

.ncard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.ncard-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
}

.ncard-icon {
  font-size: 0.95rem;
  color: var(--accent-light, #38bdf8);
}

.ncard-badge-live {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

/* ==========================================================================
   COMPONENT 1: CAS ORDERBOOK IMBALANCE GAUGE
   ========================================================================== */
.cas-gauge-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cas-imbalance-meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cas-imbalance-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
}

.cas-bar-container {
  height: 18px;
  background: rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cas-bar-buy {
  background: linear-gradient(90deg, #10b981, #059669);
  height: 100%;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.cas-bar-center-pin {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
  z-index: 2;
}

.cas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.cas-kpi-box {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cas-kpi-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.cas-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
}

.cas-settlement-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(0, 242, 254, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cas-settle-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cas-settle-lbl {
  font-size: 0.68rem;
  color: var(--muted);
}

.cas-settle-val {
  font-size: 0.95rem;
  font-weight: 700;
}

.cas-bias-banner {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cas-bias-banner.bullish {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.cas-bias-banner.bearish {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.cas-bias-banner.neutral {
  background: rgba(0, 242, 254, 0.10);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #38bdf8;
}

/* ==========================================================================
   COMPONENT 2: STRUCTURAL LEVELS TABLE & ZONE BADGES
   ========================================================================== */
.zone-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  display: inline-block;
  white-space: nowrap;
}

.zone-value {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.zone-breakout {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #f59e0b;
}

.zone-fvg {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.45);
  color: #38bdf8;
}

.zone-target {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10b981;
}

.zone-expansion {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
}

/* ==========================================================================
   COMPONENT 3: 11-STRATEGY CONVICTION RADAR
   ========================================================================== */
.strategy-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.strat-radar-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.strat-radar-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.strat-radar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.strat-radar-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.strat-status-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
}

.strat-status-chip.s-fired {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.strat-status-chip.s-priming {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f59e0b;
}

.strat-status-chip.s-idle,
.strat-status-chip.s-standby {
  background: var(--surface-3, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-subtle);
  color: var(--muted);
}

.strat-conviction-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.strat-conv-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.strat-conv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.strat-bias-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-xs);
}

.strat-bias-tag.ce {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.strat-bias-tag.pe {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.strat-bias-tag.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

/* ==========================================================================
   COMPONENT 4: OPTION GREEKS & INSTITUTIONAL DEPTH
   ========================================================================== */
.greeks-depth-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.greeks-chips-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.greek-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.greek-lbl {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.greek-val {
  font-size: 0.88rem;
  font-weight: 700;
}

.pcr-depth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.pcr-box {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pcr-val-big {
  font-size: 1.15rem;
  font-weight: 800;
}

.buildup-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.l2-micro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.l2-micro-table th {
  color: var(--muted);
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.l2-micro-table td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   COMPONENT 5: SMART MOMENTUM GUARD POSITION COCKPIT
   ========================================================================== */
.position-cockpit-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 270px;
  overflow-y: auto;
}

.mg-pos-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mg-pos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mg-pos-title {
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mg-shields-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lock-badge-be {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10b981;
}

.lock-badge-p10 {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.45);
  color: #38bdf8;
}

.mg-rail-track {
  height: 8px;
}

.l2-ask-row { color: #f43f5e; }
.l2-bid-row { color: #10b981; }

.l2-vol-bar-bg {
  position: relative;
  width: 50px;
  height: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.l2-vol-bar-fill.ask {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(244, 63, 94, 0.35);
}

.l2-vol-bar-fill.bid {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.35);
}

/* Card 3: Gantt Lifecycle */
.gantt-lanes-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.3rem 0;
  min-height: 180px;
}

.gantt-lane-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spine-nodes-track {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  position: relative;
  padding: 0.5rem 0;
}

.spine-nodes-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #00f2fe, #f59e0b, #10b981);
  transform: translateX(-50%);
  opacity: 0.6;
}

.spine-node-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.spine-node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00f2fe;
  border: 2px solid #030712;
  box-shadow: 0 0 10px #00f2fe;
  z-index: 3;
}

.spine-node-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(3, 7, 18, 0.85);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

/* Connecting Bezier Canvas */
.neural-bezier-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Core Sphere Column */
.neural-core-column {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Market-Closed Overlay */
.neural-market-closed-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.82);
  border-radius: 16px;
  z-index: 10;
  text-align: center;
  gap: 0.5rem;
  backdrop-filter: blur(4px);
}
.mco-icon {
  font-size: 2.8rem;
  opacity: 0.5;
  color: var(--muted);
  line-height: 1;
}
.mco-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}
.mco-next {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.8;
}

/* Market status pill in controls bar */
#neural-market-pill {
  cursor: default;
  pointer-events: none;
}
#neural-market-pill.open {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}
#neural-market-pill.closed {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
}


.core-charge-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(3, 7, 18, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  text-align: right;
  z-index: 3;
}

.core-charge-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.core-prob-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #10b981;
}

.core-units-sub {
  font-size: 0.68rem;
}

.neural-core-canvas {
  width: 100%;
  max-width: 480px;
  height: 420px;
  display: block;
}

/* In-Flight Decision Rails */
.neural-decision-rails {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rails-lanes-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.decision-rail-lane {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.rail-lane-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  width: 65px;
  flex-shrink: 0;
}

.rail-track-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.rail-tick-pulse {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 2px;
}

.rails-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
}

/* 4. Bottom Diagnostics */
.edge-matrix-body {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 1rem;
  min-height: 240px;
}

.edge-scatter-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.edge-scatter-canvas-wrap canvas {
  width: 100%;
  height: 200px;
  background: rgba(3, 7, 18, 0.6);
  border-radius: 6px;
  display: block;
}

.edge-residual-bars {
  display: flex;
  gap: 2px;
  height: 20px;
  align-items: flex-end;
}

.edge-residual-bar {
  flex: 1;
  background: #10b981;
  border-radius: 1px;
}

.edge-residual-bar.red { background: #f43f5e; }

.edge-scatter-foot {
  font-size: 0.62rem;
  color: var(--muted);
}

.edge-signals-sidebar {
  background: rgba(3, 7, 18, 0.5);
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.edge-signals-header {
  font-size: 0.65rem;
  line-height: 1.3;
}

.edge-signals-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
}

.edge-signal-row {
  display: flex;
  justify-content: space-between;
  padding: 0.1rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.buy-edge-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.25rem;
  border-radius: 4px;
}

/* Sankey Flow */
.sankey-flow-body {
  width: 100%;
  height: 240px;
  background: rgba(3, 7, 18, 0.6);
  border-radius: 6px;
  overflow: hidden;
}

.sankey-flow-body canvas {
  width: 100%;
  height: 240px;
  display: block;
}

.sankey-footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.4rem;
}

/* 5. Bottom Telemetry Bar */
.neural-footer-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 15, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 12px);
  font-size: 0.72rem;
  color: var(--muted);
}

.nfoot-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Responsive Overrides */
@media (max-width: 1200px) {
  .neural-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .neural-shell-workspace {
    grid-template-columns: 200px 160px 1fr;
  }
}

@media (max-width: 900px) {
  .neural-shell-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .neural-core-column {
    min-height: 360px;
  }
  .neural-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .neural-grid-4 {
    grid-template-columns: 1fr;
  }
  .resolution-grid-tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .resolution-grid-tiles {
    grid-template-columns: repeat(3, 1fr);
  }
  .wallet-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   THEME STUDIO & QUANT COLOR PICKER STYLES
   ========================================================================== */
.theme-studio-card {
  margin-bottom: 1.5rem;
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.theme-studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.theme-studio-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-studio-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.theme-tile {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
  text-align: left;
  user-select: none;
}

.theme-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.theme-tile.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -6px rgba(99, 102, 241, 0.25);
}

.theme-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-tile-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-tile-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-3);
}

.theme-tile-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.theme-tile-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--muted-light);
  border: 1px solid var(--border);
}

.theme-tile.active .theme-tile-badge {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.theme-tile-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

/* Visual Miniature Swatch Strip */
.theme-preview-box {
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-preview-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.theme-preview-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 12px;
}

.theme-preview-pill {
  height: 100%;
  border-radius: 4px;
  flex: 1;
}

/* Sidebar-only theme picker */
.sidebar-theme-popover {
  position: fixed !important;
  z-index: 10050 !important;
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  width: 360px;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.sidebar-theme-popover.open {
  display: flex !important;
}

.sidebar-theme-popover .theme-modal-grid {
  grid-template-columns: 1fr;
}

.theme-modal-item {
  width: 100%;
  text-align: left;
}

.theme-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-modal-head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-modal-close-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  transition: all 0.15s ease;
}

.theme-modal-close-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-2);
}

.theme-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.theme-modal-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.theme-modal-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  background: var(--surface-3);
}

.theme-modal-item.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-modal-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-modal-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-modal-item-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--muted-light);
}

.theme-modal-item.active .theme-modal-item-tag {
  background: var(--accent);
  color: #ffffff;
}

@media (max-width: 640px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }
  .theme-modal-grid {
    grid-template-columns: 1fr;
  }
  .theme-modal-dialog {
    padding: 1.25rem;
  }
}

/* ==========================================================================
   RADICAL THEME UI/UX ARCHETYPES & COMPONENT REDESIGNS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKYO CYBERPUNK — Neo-Tokyo Holographic HUD
   -------------------------------------------------------------------------- */
html[data-theme="tokyo"] {
  background-image: 
    linear-gradient(rgba(122, 162, 247, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 247, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

html[data-theme="tokyo"] .card,
html[data-theme="tokyo"] .theme-studio-card,
html[data-theme="tokyo"] .theme-modal-dialog {
  border-radius: 4px 20px 4px 20px !important;
  border: 1.5px solid rgba(122, 162, 247, 0.35) !important;
  box-shadow: 0 0 20px -5px rgba(122, 162, 247, 0.3), inset 0 0 15px -4px rgba(122, 162, 247, 0.08) !important;
  background: rgba(20, 24, 46, 0.82) !important;
  backdrop-filter: blur(18px) !important;
}

html[data-theme="tokyo"] .kpi-card {
  border-radius: 3px 14px 3px 14px !important;
  border: 1px solid rgba(122, 162, 247, 0.3) !important;
  box-shadow: 0 0 14px -4px rgba(122, 162, 247, 0.25) !important;
  background: rgba(26, 32, 61, 0.75) !important;
}

html[data-theme="tokyo"] .card-head h3,
html[data-theme="tokyo"] #page-title,
html[data-theme="tokyo"] .k-lbl,
html[data-theme="tokyo"] .nav-section-label {
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  text-shadow: 0 0 10px rgba(122, 162, 247, 0.45) !important;
}

html[data-theme="tokyo"] .content button:not(.theme-modal-close-btn),
html[data-theme="tokyo"] .filter-chip,
html[data-theme="tokyo"] .filter-chips button,
html[data-theme="tokyo"] .bt-chip-btn,
html[data-theme="tokyo"] .bt-pill-btn,
html[data-theme="tokyo"] .n-idx-btn,
html[data-theme="tokyo"] .nav-btn {
  border-radius: 3px 10px 3px 10px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}

html[data-theme="tokyo"] .nav-btn.active,
html[data-theme="tokyo"] .filter-chip.active,
html[data-theme="tokyo"] .filter-chips button.active,
html[data-theme="tokyo"] .bt-chip-btn.active {
  background: rgba(122, 162, 247, 0.22) !important;
  border-color: #7aa2f7 !important;
  box-shadow: 0 0 16px rgba(122, 162, 247, 0.4) !important;
  color: #ffffff !important;
}

html[data-theme="tokyo"] .topbar,
html[data-theme="tokyo"] .sidebar {
  border-color: rgba(122, 162, 247, 0.25) !important;
  box-shadow: 0 0 25px -8px rgba(122, 162, 247, 0.2) !important;
}

html[data-theme="tokyo"] table th {
  border-bottom: 2px solid #7aa2f7 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}

/* --------------------------------------------------------------------------
   2. BLOOMBERG AMBER — Wall Street Institutional High-Density Terminal
   -------------------------------------------------------------------------- */
html[data-theme="amber"] {
  font-family: 'JetBrains Mono', monospace !important;
}

html[data-theme="amber"] * {
  border-radius: 0px !important;
}

html[data-theme="amber"] .card,
html[data-theme="amber"] .kpi-card,
html[data-theme="amber"] .theme-studio-card,
html[data-theme="amber"] .theme-modal-dialog {
  border-radius: 0px !important;
  border: 1.5px solid rgba(245, 158, 11, 0.35) !important;
  background: #0d1014 !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  margin-bottom: 1rem;
}

html[data-theme="amber"] .card-head {
  border-bottom: 2px solid #f59e0b !important;
  padding-bottom: 0.45rem !important;
  margin-bottom: 0.85rem !important;
}

html[data-theme="amber"] .card-head h3,
html[data-theme="amber"] #page-title,
html[data-theme="amber"] h1,
html[data-theme="amber"] h2,
html[data-theme="amber"] h3,
html[data-theme="amber"] h4 {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  color: #fef3c7 !important;
  letter-spacing: -0.01em !important;
}

html[data-theme="amber"] .card-head h3::before {
  content: '> ';
  color: #f59e0b;
  font-weight: 800;
}

html[data-theme="amber"] .content button,
html[data-theme="amber"] .filter-chip,
html[data-theme="amber"] .filter-chips button,
html[data-theme="amber"] .bt-chip-btn,
html[data-theme="amber"] .bt-pill-btn,
html[data-theme="amber"] .n-idx-btn,
html[data-theme="amber"] input,
html[data-theme="amber"] select {
  border-radius: 0px !important;
  border: 1px solid #f59e0b !important;
  background: #14181f !important;
  color: #fef3c7 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82rem !important;
}

html[data-theme="amber"] .content button:hover,
html[data-theme="amber"] .filter-chip:hover {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #ffffff !important;
}

html[data-theme="amber"] .filter-chip.active,
html[data-theme="amber"] .filter-chips button.active,
html[data-theme="amber"] .bt-chip-btn.active,
html[data-theme="amber"] .nav-btn.active {
  background: #f59e0b !important;
  color: #0b0d10 !important;
  font-weight: 800 !important;
  border-color: #f59e0b !important;
}

html[data-theme="amber"] .data-table,
html[data-theme="amber"] .bt-interactive-table,
html[data-theme="amber"] .analytics-log-table {
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-collapse: collapse !important;
}

html[data-theme="amber"] table th {
  background: #181d26 !important;
  color: #f59e0b !important;
  border-bottom: 2px solid #f59e0b !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.76rem !important;
}

html[data-theme="amber"] table td {
  border-bottom: 1px solid rgba(245, 158, 11, 0.15) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

html[data-theme="amber"] .ambient-orbs {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. MATRIX EMERALD — Algorithmic Quant Terminal & Code Mainframe
   -------------------------------------------------------------------------- */
html[data-theme="emerald"] {
  background-image: repeating-linear-gradient(
    0deg,
    rgba(16, 185, 129, 0.02) 0px,
    rgba(16, 185, 129, 0.02) 1px,
    transparent 1px,
    transparent 2px
  );
  font-family: 'JetBrains Mono', monospace !important;
}

html[data-theme="emerald"] .card,
html[data-theme="emerald"] .theme-studio-card,
html[data-theme="emerald"] .theme-modal-dialog {
  border-radius: 3px !important;
  border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
  background: rgba(8, 18, 13, 0.88) !important;
  box-shadow: 0 0 16px -2px rgba(16, 185, 129, 0.2), inset 0 0 10px -2px rgba(16, 185, 129, 0.08) !important;
}

html[data-theme="emerald"] .kpi-card {
  border-radius: 3px !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 0 12px -2px rgba(16, 185, 129, 0.18) !important;
  background: rgba(11, 25, 18, 0.85) !important;
}

html[data-theme="emerald"] .card-head h3::before {
  content: '[$] ';
  color: #10b981;
  font-weight: 800;
}

html[data-theme="emerald"] .content button,
html[data-theme="emerald"] .filter-chip,
html[data-theme="emerald"] .filter-chips button,
html[data-theme="emerald"] .bt-chip-btn,
html[data-theme="emerald"] .bt-pill-btn,
html[data-theme="emerald"] .n-idx-btn,
html[data-theme="emerald"] .nav-btn {
  border-radius: 2px !important;
  border: 1px solid #10b981 !important;
  background: #09150f !important;
  color: #10b981 !important;
  font-family: 'JetBrains Mono', monospace !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}

html[data-theme="emerald"] .content button:hover,
html[data-theme="emerald"] .filter-chip:hover {
  background: rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="emerald"] .filter-chip.active,
html[data-theme="emerald"] .filter-chips button.active,
html[data-theme="emerald"] .bt-chip-btn.active,
html[data-theme="emerald"] .nav-btn.active {
  background: #10b981 !important;
  color: #050d09 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.5) !important;
}

html[data-theme="emerald"] .topbar,
html[data-theme="emerald"] .sidebar {
  border-color: rgba(16, 185, 129, 0.25) !important;
  box-shadow: 0 0 20px -8px rgba(16, 185, 129, 0.25) !important;
}

/* --------------------------------------------------------------------------
   4. NORDIC POLAR — Scandinavian Minimalist Swiss Flat
   -------------------------------------------------------------------------- */
html[data-theme="nordic"] .card,
html[data-theme="nordic"] .theme-studio-card,
html[data-theme="nordic"] .theme-modal-dialog {
  border-radius: 6px !important;
  border: 1px solid rgba(56, 189, 248, 0.18) !important;
  background: #111b27 !important;
  backdrop-filter: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="nordic"] .kpi-card {
  border-radius: 6px !important;
  border: 1px solid rgba(56, 189, 248, 0.15) !important;
  background: #162232 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="nordic"] .content button,
html[data-theme="nordic"] .filter-chip,
html[data-theme="nordic"] .filter-chips button,
html[data-theme="nordic"] .bt-chip-btn,
html[data-theme="nordic"] .bt-pill-btn,
html[data-theme="nordic"] .n-idx-btn,
html[data-theme="nordic"] .nav-btn {
  border-radius: 6px !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  background: #162334 !important;
  color: #bae6fd !important;
  font-weight: 600 !important;
}

html[data-theme="nordic"] .content button:hover,
html[data-theme="nordic"] .filter-chip:hover {
  background: #1e3046 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

html[data-theme="nordic"] .filter-chip.active,
html[data-theme="nordic"] .filter-chips button.active,
html[data-theme="nordic"] .bt-chip-btn.active,
html[data-theme="nordic"] .nav-btn.active {
  background: #38bdf8 !important;
  color: #090e17 !important;
  font-weight: 700 !important;
  border-color: #38bdf8 !important;
}

html[data-theme="nordic"] .card-head h3,
html[data-theme="nordic"] #page-title {
  color: #f0f9ff !important;
  letter-spacing: -0.01em !important;
}

/* --------------------------------------------------------------------------
   5. MONOLITH CRIMSON — Stealth Tactical Defense HUD
   -------------------------------------------------------------------------- */
html[data-theme="crimson"] .card,
html[data-theme="crimson"] .theme-studio-card,
html[data-theme="crimson"] .theme-modal-dialog {
  border-radius: 2px 14px 2px 14px !important;
  border-top: 3.5px solid #f43f5e !important;
  border-left: 1px solid rgba(244, 63, 94, 0.25) !important;
  border-right: 1px solid rgba(244, 63, 94, 0.25) !important;
  border-bottom: 1px solid rgba(244, 63, 94, 0.25) !important;
  background: #161013 !important;
  box-shadow: 0 6px 24px -6px rgba(0, 0, 0, 0.9), 0 0 16px -6px rgba(244, 63, 94, 0.25) !important;
}

html[data-theme="crimson"] .kpi-card {
  border-radius: 2px 10px 2px 10px !important;
  border-top: 2.5px solid #f43f5e !important;
  border-left: 1px solid rgba(244, 63, 94, 0.2) !important;
  border-right: 1px solid rgba(244, 63, 94, 0.2) !important;
  border-bottom: 1px solid rgba(244, 63, 94, 0.2) !important;
  background: #1f1418 !important;
}

html[data-theme="crimson"] .card-head h3,
html[data-theme="crimson"] #page-title {
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  font-weight: 800 !important;
  color: #fff1f2 !important;
}

html[data-theme="crimson"] .content button,
html[data-theme="crimson"] .filter-chip,
html[data-theme="crimson"] .filter-chips button,
html[data-theme="crimson"] .bt-chip-btn,
html[data-theme="crimson"] .bt-pill-btn,
html[data-theme="crimson"] .n-idx-btn,
html[data-theme="crimson"] .nav-btn {
  border-radius: 2px 8px 2px 8px !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  background: #201519 !important;
  color: #fff1f2 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

html[data-theme="crimson"] .content button:hover,
html[data-theme="crimson"] .filter-chip:hover {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: #f43f5e !important;
}

html[data-theme="crimson"] .filter-chip.active,
html[data-theme="crimson"] .filter-chips button.active,
html[data-theme="crimson"] .bt-chip-btn.active,
html[data-theme="crimson"] .nav-btn.active {
  background: #f43f5e !important;
  color: #0c080a !important;
  font-weight: 800 !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.45) !important;
}

/* --------------------------------------------------------------------------
   6. ALABASTER DAYLIGHT — Executive Modern Fintech SaaS Light Mode
   -------------------------------------------------------------------------- */
html[data-theme="light"] {
  background: #f5f7fb !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .theme-studio-card,
html[data-theme="light"] .theme-modal-dialog {
  border-radius: 14px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] .kpi-card {
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .card-head h3,
html[data-theme="light"] #page-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .content button,
html[data-theme="light"] .filter-chip,
html[data-theme="light"] .filter-chips button,
html[data-theme="light"] .bt-chip-btn,
html[data-theme="light"] .bt-pill-btn,
html[data-theme="light"] .n-idx-btn,
html[data-theme="light"] .nav-btn {
  border-radius: 8px !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .content button:hover,
html[data-theme="light"] .filter-chip:hover {
  background: #e2e8f0 !important;
}

html[data-theme="light"] .filter-chip.active,
html[data-theme="light"] .filter-chips button.active,
html[data-theme="light"] .bt-chip-btn.active,
html[data-theme="light"] .nav-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] table th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] table td {
  border-bottom: 1px solid #f1f5f9 !important;
}

/* ==========================================================================
   Universe Selector Component (Settings / Preferences)
   ========================================================================== */
.universe-settings-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.65rem 0 1rem 0;
  padding: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.universe-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.universe-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.universe-market-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.universe-market-badge.equity {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.universe-market-badge.mcx {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.universe-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.universe-quick-actions {
  display: flex;
  gap: 0.35rem;
}

.univ-quick-btn {
  background: var(--surface-3, rgba(255, 255, 255, 0.05)) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  padding: 0.15rem 0.45rem !important;
  border-radius: 4px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.univ-quick-btn:hover {
  background: var(--surface-glass, rgba(99, 102, 241, 0.2)) !important;
  color: var(--text) !important;
  border-color: var(--accent, #6366f1) !important;
}

.universe-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.universe-card-option {
  position: relative;
  display: block;
  cursor: pointer;
  user-select: none;
}

.universe-card-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.univ-card-inner {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.7rem;
  background: var(--surface-3, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.univ-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.univ-card-sub {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.universe-card-option:hover .univ-card-inner {
  background: var(--surface-2);
  border-color: var(--border-2, rgba(255, 255, 255, 0.18));
  transform: translateY(-1px);
}

.universe-card-option input[type="checkbox"]:checked + .univ-card-inner {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2), inset 0 0 8px rgba(99, 102, 241, 0.08);
}

.universe-card-option input[type="checkbox"]:checked + .univ-card-inner .univ-card-name {
  color: var(--accent-light, #a5b4fc);
  font-weight: 800;
}

.universe-card-option input[type="checkbox"]:checked + .univ-card-inner .univ-card-sub {
  color: var(--text-2);
}

#univ-mcx-grid .universe-card-option input[type="checkbox"]:checked + .univ-card-inner {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.18), inset 0 0 8px rgba(245, 158, 11, 0.06);
}

#univ-mcx-grid .universe-card-option input[type="checkbox"]:checked + .univ-card-inner .univ-card-name {
  color: #fde68a;
}

/* Signal Card Timing & Metadata Badges */
.sig-time-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sig-time-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.70rem;
  color: var(--text-2);
  background: var(--surface-3, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  padding: 0.15rem 0.42rem;
  border-radius: 4px;
}

.sig-time-tag {
  font-size: 0.60rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sig-time-item.exit.win {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.sig-time-item.exit.win .sig-time-tag {
  color: #34d399;
}

.sig-time-item.exit.loss {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.sig-time-item.exit.loss .sig-time-tag {
  color: #fb7185;
}

.sig-time-item.held {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.sig-time-item.held.live {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ==========================================================================
   Market Split KPI Deck (Live Signals Terminal)
   ========================================================================== */
.signals-kpi-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
  margin-bottom: 1.15rem !important;
}

.combined-kpi-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  position: relative;
  overflow: hidden;
}

.combined-kpi-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #f59e0b, #10b981);
}

.comb-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.comb-lbl {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comb-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.comb-sub {
  font-size: 0.72rem;
  color: var(--text-2);
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  width: fit-content;
  letter-spacing: 0.01em;
}

.leader-badge.equity {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.leader-badge.mcx {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.leader-badge.neutral {
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.market-duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .combined-kpi-banner {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .market-duo-grid {
    grid-template-columns: 1fr;
  }
}

.market-segment-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.market-segment-card.equity {
  border-left: 3.5px solid #6366f1;
}

.market-segment-card.mcx {
  border-left: 3.5px solid #f59e0b;
}

.market-segment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  border-color: var(--border-2, rgba(255, 255, 255, 0.15));
}

.mkt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
}

.mkt-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mkt-title-wrap h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.mkt-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.mkt-badge.equity {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.mkt-badge.mcx {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.mkt-count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.mkt-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.mkt-kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mkt-kpi-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mkt-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.mkt-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-2);
}

.mkt-outcomes-pill-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
}

.mkt-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.48rem;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.mkt-chip.win {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.mkt-chip.trail {
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.08);
}

.mkt-chip.mom {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

.mkt-chip.loss {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
}

/* ==========================================================================
   Virtual Trade (Paper Trading) Desk
   ========================================================================== */
.virtual-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.v-sizing-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.v-toggle-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.v-toggle-btn.active {
  background: var(--accent, #6366f1);
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}

.virtual-kpi-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.virtual-portfolio-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1.2fr;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  position: relative;
  overflow: hidden;
}

.virtual-portfolio-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1, #f59e0b);
}

@media (max-width: 1000px) {
  .virtual-portfolio-hero {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.virtual-market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .virtual-market-grid {
    grid-template-columns: 1fr;
  }
}

.virtual-open-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.85rem;
}

.v-open-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.v-open-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  border-color: var(--border-2, rgba(255, 255, 255, 0.18));
}

.v-open-card.equity {
  border-left: 3.5px solid #6366f1;
}

.v-open-card.mcx {
  border-left: 3.5px solid #f59e0b;
}

.v-open-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v-open-pnl-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--surface-3);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.v-open-card-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
}

.v-square-off-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}

.v-square-off-btn:hover {
  background: rgba(244, 63, 94, 0.22);
  color: #fff;
  border-color: rgba(244, 63, 94, 0.6);
}

/* ==========================================================================
   Virtual Capital & Sizing Modal - High-Density Institutional Theme
   ========================================================================== */
.v-cfg-modal-card {
  max-width: 480px;
  width: 92%;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border-2, rgba(99, 102, 241, 0.25));
  border-radius: var(--radius-xl, 14px);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.v-modal-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.v-modal-section-title span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.v-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.v-preset-pill {
  padding: 0.45rem 0.2rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.80rem;
  font-weight: 700;
  text-align: center;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.v-preset-pill:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.v-preset-pill.active {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25) inset;
}

.v-input-currency-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.v-input-currency-wrap:focus-within {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.v-currency-prefix {
  padding: 0.55rem 0.65rem 0.55rem 0.9rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent, #6366f1);
  user-select: none;
}

.v-currency-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0.55rem 0.25rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.v-currency-suffix {
  padding: 0 0.85rem;
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  user-select: none;
}

.v-modal-sizing-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.v-sizing-opt-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.v-sizing-opt-card:hover {
  background: var(--surface-3);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.v-sizing-opt-card.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.85);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15) inset, 0 4px 12px rgba(0, 0, 0, 0.2);
}

.v-opt-indicator {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  border-radius: 50%;
  border: 2px solid var(--border-2, rgba(255, 255, 255, 0.2));
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.v-sizing-opt-card.active .v-opt-indicator {
  border-color: var(--accent, #6366f1);
  background: var(--accent, #6366f1);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.v-opt-indicator::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}

.v-sizing-opt-card.active .v-opt-indicator::after {
  opacity: 1;
  transform: scale(1);
}

.v-opt-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.v-opt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.v-opt-header strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.v-opt-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.v-opt-badge.fixed {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border);
}

.v-opt-desc {
  font-size: 0.74rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* ================= EOD Session Wrap-Up Deck ================= */
.eod-deck-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--purple, #8b5cf6);
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

.eod-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.eod-waterfall-wrap {
  padding: 0.85rem 1rem;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
}

.eod-waterfall-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.6rem;
}

.eod-wf-seg {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.eod-wf-seg.target { background: #10b981; }
.eod-wf-seg.trail { background: #06b6d4; }
.eod-wf-seg.momentum { background: #6366f1; }
.eod-wf-seg.breakeven { background: #94a3b8; }
.eod-wf-seg.autoflip { background: #a855f7; }
.eod-wf-seg.stagnation { background: #f59e0b; }
.eod-wf-seg.stop { background: #ef4444; }
.eod-wf-seg.eod { background: #64748b; }

.eod-waterfall-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.73rem;
  color: var(--muted);
}

.eod-wf-leg-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.eod-wf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.eod-insights-box {
  padding: 0.85rem 1rem;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm, 6px);
}

.eod-tape-table th, .eod-tape-table td {
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
}


/* ═══════════ Day Replay ═══════════ */
#replay-card .mini-input { padding: 0.35rem 0.6rem; }
#replay-stage { animation: panelFadeIn 0.25s ease; }
#replay-chart-wrap { background: var(--bg-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); }
#replay-progress { accent-color: var(--accent); height: 4px; cursor: pointer; }
.replay-log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 900px) { .replay-log-grid { grid-template-columns: 1fr; } }
.replay-log-box { background: var(--bg-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm, 8px); overflow: hidden; max-height: 240px; display: flex; flex-direction: column; }
.replay-log-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-light); padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border-subtle); background: rgba(255,255,255,0.02); }
.replay-log-box > div { overflow-y: auto; flex: 1; padding: 0.25rem 0; }
.s-replay-log-row { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 0.5rem; align-items: center; padding: 0.22rem 0.6rem; font-size: 0.72rem; animation: panelFadeIn 0.3s ease; }
.s-replay-log-row:hover { background: rgba(255,255,255,0.03); }
.sig-replay-btn { font-size: 0.66rem; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(99, 102, 241, 0.45); background: rgba(99, 102, 241, 0.12); color: var(--accent-light, #818cf8); font-weight: 700; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; margin-left: auto; }
.sig-replay-btn:hover { background: rgba(99, 102, 241, 0.28); transform: translateY(-1px); }
.sig-sub-row { display: flex; align-items: center; gap: 0.5rem; }
.sig-sub-row .sig-replay-btn { margin-left: auto; }

