/* ═══════════════════════════════════════════════════════════════════════════
   Algoriser Terminal — Premium Design System
   ₹25,000/month institutional-grade dark terminal aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  /* ── Backgrounds ─────────────────────────────────────────────────────── */
  --bg-base:        #060A14;
  --bg-deep:        #080D19;
  --bg-surface:     #0C1221;
  --bg-elevated:    #111928;
  --bg-highlight:   #16203A;
  --bg-glass:       rgba(12, 18, 33, 0.82);
  --divider:        #1C2A44;
  --divider-soft:   #162036;
  --divider-glass:  rgba(28, 42, 68, 0.55);

  /* ── Text ────────────────────────────────────────────────────────────── */
  --text-primary:   #EAF0FC;
  --text-secondary: #B2C3DF;
  --text-tertiary:  #889CBF;
  --text-muted:     #63789F;

  /* ── Action — single CTA color ───────────────────────────────────────── */
  --cta:          #10B981;
  --cta-light:    #34D399;
  --cta-hover:    #059669;
  --cta-dim:      rgba(16, 185, 129, 0.12);
  --cta-glow:     rgba(16, 185, 129, 0.25);

  /* ── Positive / Live ─────────────────────────────────────────────────── */
  --emerald:        var(--cta);
  --emerald-light:  var(--cta-light);
  --emerald-dim:    var(--cta-dim);
  --emerald-glow:   var(--cta-glow);

  /* ── Bearish / Danger ────────────────────────────────────────────────── */
  --red:            #F43F5E;
  --red-dim:        rgba(244, 63, 94, 0.1);

  /* ── Quadrant accent (overridden by JS per active quadrant) ──────────── */
  --accent-q:      #10B981;
  --accent-q-rgb:  16, 185, 129;

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --ticker-h:     28px;
  --sidebar-w:    56px;
  --sidebar-full: 224px;
  --right-w:      268px;
  --header-h:     56px;
  --tab-h:        44px;
  --info-h:       38px;

  /* ── Typography ──────────────────────────────────────────────────────── */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* ── Radii ───────────────────────────────────────────────────────────── */
  --r-xs:  3px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;

  /* ── Shadows ─────────────────────────────────────────────────────────── */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.6);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.65);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.75);
  --shadow-xl:  0 16px 56px rgba(0,0,0,0.8);

  /* ── Transitions ─────────────────────────────────────────────────────── */
  --ease-fast:   140ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-med:    260ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-drawer: 360ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Light Theme ─────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:        #F0F4FC;
  --bg-deep:        #E6EDF8;
  --bg-surface:     #FFFFFF;
  --bg-elevated:    #F8FAFE;
  --bg-highlight:   #EDF1FB;
  --bg-glass:       rgba(255, 255, 255, 0.88);
  --divider:        #D0DCF0;
  --divider-soft:   #E0EAF8;
  --divider-glass:  rgba(208, 220, 240, 0.5);

  --text-primary:   #0C1629;
  --text-secondary: #3A4F72;
  --text-tertiary:  #6078A0;
  --text-muted:     #A0B4D0;

  --cta:          #059669;
  --cta-light:    #10B981;
  --cta-hover:    #059669;
  --cta-dim:      rgba(16, 185, 129, 0.08);
  --cta-glow:     rgba(16, 185, 129, 0.2);

  --emerald-dim:    var(--cta-dim);
  --red-dim:        rgba(244, 63, 94, 0.08);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.09);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.11);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.13);
}


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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

body.modal-open  { overflow: hidden; }

/* ─── Background Mesh Glow ───────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 700px at 12% 55%, rgba(16,185,129,0.065) 0%, transparent 65%),
    radial-gradient(ellipse 600px 800px at 88% 20%, rgba(16,185,129,0.045) 0%, transparent 65%),
    radial-gradient(ellipse 700px 500px at 55% 90%, rgba(16,185,129,0.035) 0%, transparent 65%),
    radial-gradient(ellipse 400px 400px at 35% 10%, rgba(16,185,129,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 0;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--cta-dim); color: var(--text-primary); }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font-body); background: none; }
[data-tabular], .tabnum { font-variant-numeric: tabular-nums; }

/* ─── Floating Preview Button ────────────────────────────────────────────── */
#float-preview-btn {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px 11px;
  background: var(--bg-elevated);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-left: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(0,0,0,0.1);
  border-bottom: 3px solid var(--divider);
  border-radius: 99px;
  color: var(--cta-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 20px var(--cta-glow), var(--shadow-lg);
  transition: all var(--ease-fast);
  white-space: nowrap;
  animation: float-pulse 3s ease-in-out infinite;
}
#float-preview-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 0 36px var(--cta-glow), var(--shadow-xl);
  background: var(--cta-dim);
  border-bottom-width: 4px;
}
#float-preview-btn:active {
  transform: translateX(-50%) translateY(2px);
  border-bottom-width: 1px;
}
#float-preview-btn.float-premium-active {
  background: var(--cta-dim);
  border-color: var(--cta);
  color: var(--cta-light);
  box-shadow: 0 0 24px var(--cta-glow), var(--shadow-lg);
  animation: none;
}
#float-preview-btn.float-premium-active:hover {
  box-shadow: 0 0 36px var(--cta-glow), var(--shadow-xl);
}
@keyframes float-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--cta-glow), var(--shadow-lg); }
  50%       { box-shadow: 0 0 36px var(--cta-glow), var(--shadow-xl); }
}

/* ─── Ticker Strip ────────────────────────────────────────────────────────── */
.ticker-strip {
  height: var(--ticker-h);
  min-height: var(--ticker-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 60;
}

.ticker-strip::before,
.ticker-strip::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.ticker-strip::before { left: 0; background: linear-gradient(to right, var(--bg-surface), transparent); }
.ticker-strip::after  { right: 0; background: linear-gradient(to left, var(--bg-surface), transparent); }

.ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 55s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  border-right: 1px solid var(--divider-soft);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  height: var(--ticker-h);
}

.ticker-name {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ticker-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}

.ticker-chg {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: var(--r-xs);
}
.ticker-chg.up   { color: var(--cta-light); background: var(--cta-dim); }
.ticker-chg.down { color: #F87171; background: var(--red-dim); }
.ticker-chg.neu  { color: var(--text-tertiary); background: var(--bg-elevated); }

/* Ticker flash on value change */
.ticker-val.flash-up   { animation: val-flash-up 0.5s ease; }
.ticker-val.flash-down { animation: val-flash-down 0.5s ease; }
@keyframes val-flash-up   { 0%,100% { color: inherit; } 50% { color: var(--cta-light); } }
@keyframes val-flash-down { 0%,100% { color: inherit; } 50% { color: #F87171; } }

/* ─── App Shell ─────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--ticker-h));
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ─── Left Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-deep);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: visible; /* Allow logo header to overflow when collapsed */
  transition: width var(--ease-spring), min-width var(--ease-spring);
  z-index: 40;
  flex-shrink: 0;
  position: relative;
}

.sidebar.expanded {
  width: var(--sidebar-full);
  min-width: var(--sidebar-full);
}

/* ── Auto Collapse row with switch ── */
.sb-collapse-row {
  display: none; /* hidden when sidebar is collapsed */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 18px;
  height: 34px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.65rem;
  transition: color var(--ease-fast), background var(--ease-fast);
  user-select: none;
}
.sidebar.expanded .sb-collapse-row {
  display: flex;
}
.sb-collapse-row:hover { color: var(--text-secondary); background: var(--bg-elevated); }
.sb-collapse-label {
  flex: 1;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Pill toggle switch */
.sb-switch {
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.sb-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.25s ease, background 0.25s ease;
}
/* Switch ON — auto-collapse is enabled */
.sidebar.auto-collapse .sb-switch {
  background: var(--cta-dim);
  border-color: rgba(16,185,129,0.3);
}
.sidebar.auto-collapse .sb-switch-thumb {
  transform: translateX(14px);
  background: var(--cta);
}

/* Sidebar logo - stays uncollapsed */
.sb-logo {
  width: var(--sidebar-full);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  flex-shrink: 0;
  padding: 0 14px;
  gap: 10px;
  overflow: hidden;
  background: var(--bg-surface);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  transition: background var(--ease-fast);
}

.sb-logo-img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.sb-logo-text {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff; /* White in dark theme */
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--ease-med), transform var(--ease-med), color var(--ease-fast);
}

[data-theme="light"] .sb-logo-text {
  color: #000000; /* Black in light theme */
}

/* Nav items - cleared for uncollapsed absolute logo header */
.sb-nav {
  width: 100%;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  margin-top: var(--header-h); /* Clear top header space */
}
.sb-nav::-webkit-scrollbar { display: none; }

.sb-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: color var(--ease-fast), background var(--ease-fast);
  position: relative;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: none;
  cursor: pointer;
}

/* Collapsed: icon pill container */
.sidebar:not(.expanded) .sb-item {
  padding: 0 0;
  justify-content: center;
  gap: 0;
  overflow: visible;
}

/* Hide everything except the icon pill in collapsed mode */
.sidebar:not(.expanded) .sb-item > *:not(.sb-icon) {
  display: none !important;
}

/* The icon pill */
.sidebar:not(.expanded) .sb-icon {
  width: 38px;
  height: 38px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background var(--ease-fast), box-shadow var(--ease-fast), color var(--ease-fast);
  background: transparent;
  flex-shrink: 0;
}

/* Force all Lucide SVGs inside pills to 16x16 */
.sb-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 1.8;
  display: block;
}

/* Hover: highlight pill and change text/icon to green */
.sidebar:not(.expanded) .sb-item:hover {
  background: transparent;
}
.sidebar:not(.expanded) .sb-item:hover .sb-icon {
  background: var(--bg-highlight);
  color: var(--cta-light) !important;
}

/* Expanded hover: row bg and change text to green */
.sidebar.expanded .sb-item:hover {
  background: var(--bg-elevated);
  color: var(--cta-light) !important;
}

/* ── Active ── */
.sb-item.active,
.sb-item.q-active {
  color: #ffffff !important;
}
.sidebar.expanded .sb-item.active,
.sidebar.expanded .sb-item.q-active {
  background: var(--cta-dim);
}
.sb-item.active::before,
.sb-item.q-active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--cta);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--cta-glow);
}
/* Active pill glow */
.sidebar:not(.expanded) .sb-item.active .sb-icon,
.sidebar:not(.expanded) .sb-item.q-active .sb-icon {
  background: rgba(16,185,129,0.15);
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16,185,129,0.3), inset 0 0 0 1px rgba(16,185,129,0.25);
}
/* No left bar indicator in collapsed */
.sidebar:not(.expanded) .sb-item.active::before,
.sidebar:not(.expanded) .sb-item.q-active::before {
  display: none !important;
}

/* ── Inactive default states (white in dark, black in light) ── */
.sb-item {
  color: #ffffff;
}

/* ── Light Theme Overrides ── */
[data-theme="light"] .sb-item {
  color: #000000;
}
[data-theme="light"] .sb-item:hover {
  color: var(--cta) !important;
}
[data-theme="light"] .sidebar:not(.expanded) .sb-item:hover .sb-icon {
  color: var(--cta) !important;
}
[data-theme="light"] .sb-item.active,
[data-theme="light"] .sb-item.q-active {
  color: #000000 !important;
}
[data-theme="light"] .sidebar:not(.expanded) .sb-item.active .sb-icon,
[data-theme="light"] .sidebar:not(.expanded) .sb-item.q-active .sb-icon {
  color: #000000 !important;
}

/* ── Expanded icon wrapper ── */
.sidebar.expanded .sb-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar.expanded .sb-icon svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.8;
}

/* ── Label, lock, notif-dot ── */
.sb-label {
  font-size: 0.78rem;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity var(--ease-med), max-width var(--ease-med);
  flex: 1;
}
.sidebar.expanded .sb-label { opacity: 1; max-width: 160px; }

.sb-lock {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-right: 4px;
  opacity: 0;
  transition: opacity var(--ease-med);
  flex-shrink: 0;
}
.sidebar.expanded .sb-lock { opacity: 0.6; }

.sb-item.premium-lock { opacity: 0.45; }
.sb-item.premium-lock:hover { opacity: 0.8; }

/* Sidebar divider */
.sb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider), transparent);
  margin: 4px 10px;
  transition: margin var(--ease-med);
}
.sidebar:not(.expanded) .sb-divider { margin: 4px 8px; }

/* Sidebar bottom */
.sb-bottom {
  width: 100%;
  border-top: 1px solid var(--divider);
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

/* Premium preview button */
.sb-preview-btn {
  color: var(--cta-light) !important;
  opacity: 1 !important;
}
.sb-preview-btn.active-premium {
  background: var(--cta-dim) !important;
  color: var(--cta-light) !important;
}
.sb-preview-btn .sb-icon { color: var(--cta-light); }

/* Toggle button */
.sb-toggle {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  transition: all var(--ease-fast);
  gap: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.sidebar.expanded .sb-toggle { justify-content: flex-start; padding: 0 18px; gap: 8px; }
.sb-toggle:hover { color: var(--text-secondary); background: var(--bg-elevated); }
.sb-toggle-label {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity var(--ease-med), max-width var(--ease-med);
  white-space: nowrap;
  display: none;
}
.sidebar.expanded .sb-toggle-label { opacity: 1; max-width: 100px; display: inline-block; }

.sb-toggle-icon {
  font-size: 0.58rem;
  transition: transform var(--ease-spring);
  flex-shrink: 0;
}
.sidebar.expanded .sb-toggle-icon { transform: rotate(180deg); }

/* ─── Main Content ────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* ─── Terminal Header ─────────────────────────────────────────────────────── */
.terminal-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  transition: padding var(--ease-spring);
}

/* Clear space for logo header when sidebar collapses */
.sidebar:not(.expanded) + .main-content .terminal-header {
  padding-left: 188px; /* 168px logo shift + 20px default padding */
}

.header-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.brand-live-badge {
  position: relative;
  width: 10px; height: 10px;
  flex-shrink: 0;
}
.brand-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  position: absolute;
  top: 1px; left: 1px;
  animation: live-dot-pulse 2s ease-in-out infinite;
}
.brand-live-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--cta);
  opacity: 0;
  animation: live-ring-expand 2s ease-in-out infinite;
}
@keyframes live-dot-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(0.85); }
}
@keyframes live-ring-expand {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.brand-tag {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--divider);
}

/* Scan badge */
.scan-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.broker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}
.broker-badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  transition: background 0.25s ease;
}

/* Broker Badge States */
.broker-badge.demo {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  color: #fbbf24;
}
.broker-badge.demo .broker-badge-dot {
  background: #f59e0b;
}

.broker-badge.live {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.25);
  color: #34d399;
}
.broker-badge.live .broker-badge-dot {
  background: #10b981;
  animation: pulse-ring 2s ease-in-out infinite;
}

.broker-badge.connecting {
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.25);
  color: #a78bfa;
}
.broker-badge.connecting .broker-badge-dot {
  background: #8b5cf6;
  animation: pulse-ring 1s ease-in-out infinite;
}

.broker-badge.disconnected {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
}
.broker-badge.disconnected .broker-badge-dot {
  background: #ef4444;
}
.broker-badge.market-closed {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.28);
  color: #fbbf24;
}
.broker-badge.market-closed .broker-badge-dot {
  background: #f59e0b;
}

.broker-badge.configured {
  background: rgba(100,116,139,0.08);
  border: 1px solid rgba(100,116,139,0.28);
  color: #94a3b8;
}
.broker-badge.configured .broker-badge-dot {
  background: #64748b;
}

.broker-badge.authenticated {
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.28);
  color: #22d3ee;
}
.broker-badge.authenticated .broker-badge-dot {
  background: #06b6d4;
  animation: pulse-ring 2.5s ease-in-out infinite;
}

.scan-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cta);
  animation: pulse-ring 2s ease-in-out infinite;
}
.scan-num {
  color: #ffffff;
  font-weight: 700;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}
.scan-num.pulse-change {
  animation: number-pop 0.35s ease;
}
@keyframes number-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: var(--cta-light); }
  100% { transform: scale(1); }
}
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

/* Clock */
.header-clock {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

/* Market Status Badge */
.market-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: all var(--ease-med);
}
.ms-dot { width: 6px; height: 6px; border-radius: 50%; transition: background var(--ease-med); }
.market-status-badge.live     { background: var(--cta-dim); border-color: rgba(16,185,129,0.25); color: var(--cta-light); }
.market-status-badge.live .ms-dot { animation: pulse-dot 1.5s ease-in-out infinite; }
.market-status-badge.premarket  { background: var(--bg-elevated); border-color: var(--divider); color: var(--text-muted); }
.market-status-badge.postmarket { background: var(--cta-dim);   border-color: rgba(16,185,129,0.2); color: var(--cta); }
.market-status-badge.closed     { background: var(--bg-elevated); border-color: var(--divider); color: var(--text-muted); }

/* Notification */
.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all var(--ease-fast);
}
.notif-btn:hover { background: var(--bg-highlight); border-color: var(--cta); }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  padding: 0 3px;
  background: var(--cta);
  color: #fff;
  font-size: 0.58rem; font-weight: 700;
  border-radius: 99px;
  display: none;
  align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
  animation: badge-pop 0.3s cubic-bezier(0.68,-0.55,0.265,1.55);
}

/* Upgrade Button — clean outline, not gradient */
#header-upgrade-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 7px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(0,0,0,0.2);
  border-bottom: 3px solid #059669;
  border-radius: var(--r-sm);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  animation: cta-grad-shift 3s linear infinite;
  cursor: pointer;
}
#header-upgrade-btn:hover {
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
  border-bottom-width: 4px;
}
#header-upgrade-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

#header-backfill-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 7px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--divider);
  border-bottom: 3px solid var(--divider);
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#header-backfill-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
  border-bottom-width: 4px;
}
#header-backfill-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}
#header-backfill-btn.is-loading i {
  animation: spin 1s linear infinite;
}


/* ─── Tab Bar ────────────────────────────────────────────────────────────── */
.tab-bar {
  height: var(--tab-h);
  min-height: var(--tab-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: stretch;
  padding: 0 16px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition: all var(--ease-med);
  position: relative;
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--cta-light); background: var(--bg-elevated); }
.tab-btn.active { color: #ffffff !important; border-bottom-color: var(--accent-q); }
[data-theme="light"] .tab-btn {
  color: #000000;
}
[data-theme="light"] .tab-btn:hover {
  color: var(--cta);
  background: var(--bg-highlight);
}
[data-theme="light"] .tab-btn.active {
  color: #000000 !important;
}
.tab-btn.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: var(--accent-q);
  box-shadow: 0 0 10px rgba(var(--accent-q-rgb), 0.6);
}
.tab-emoji { font-size: 0.9rem; }
.tab-live-dot {
  width: 5px; height: 5px;
  background: var(--cta);
  border-radius: 50%;
  animation: pulse-dot 1.8s ease-in-out infinite;
  display: none;
}
.tab-btn.active .tab-live-dot { display: block; }
.tab-spacer { flex: 1; }

/* Delay chip — neutral slate, no yellow */
.delay-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.63rem;
  color: var(--text-muted);
  padding: 0 2px;
  flex-shrink: 0;
  font-weight: 600;
}
.delay-upgrade {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--cta);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  color: #fff;
  transition: all var(--ease-fast);
  box-shadow: 0 1px 6px var(--cta-glow);
}
.delay-upgrade:hover { background: var(--cta-hover); }

/* ─── Quadrant Info Bar ───────────────────────────────────────────────────── */
.quadrant-info-bar {
  height: var(--info-h);
  min-height: var(--info-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--divider-soft);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.qi-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-q);
  flex-shrink: 0;
  text-shadow: 0 0 12px rgba(var(--accent-q-rgb), 0.5);
  font-family: var(--font-display);
}
.qi-sep { width: 1px; height: 16px; background: var(--divider); flex-shrink: 0; }
.qi-desc { font-size: 0.68rem; color: var(--text-tertiary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-timing {
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xs);
}

/* ─── Signal Table ────────────────────────────────────────────────────────── */
.table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-deep);
}

.signal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.signal-table thead tr {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 10;
}
.signal-table thead th {
  padding: 9px 20px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}
.signal-table thead th:last-child { text-align: center; }

/* Signal row */
.signal-row {
  border-bottom: 1px solid var(--divider-soft);
  transition: background var(--ease-fast);
  animation: row-slide-in 0.35s ease forwards;
}
.signal-row td:first-child {
  position: relative;
}
.signal-row td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-q);
  opacity: 0;
  transition: opacity var(--ease-fast);
  box-shadow: 0 0 8px rgba(var(--accent-q-rgb), 0.5);
}
.signal-row:hover { background: var(--bg-elevated); }
.signal-row:hover td:first-child::before { opacity: 0.6; }

.signal-row.signal-new {
  animation: row-slide-in 0.35s ease forwards, row-glow 2s ease forwards;
}
.signal-row.signal-new td:first-child::before { opacity: 1; animation: left-bar-pulse 2s ease forwards; }

@keyframes left-bar-pulse {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Columns */
.col-asset    { padding: 12px 20px; width: 34%; }
.col-strategy { padding: 12px 20px; width: 38%; }
.col-action   { padding: 12px 20px; width: 28%; text-align: center; }

.asset-inner  { display: flex; align-items: flex-start; gap: 10px; }

.severity-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-q);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 6px rgba(var(--accent-q-rgb), 0.7);
}
.signal-new .severity-dot { animation: severity-pulse 1.5s ease-in-out 2; }
@keyframes severity-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 6px rgba(var(--accent-q-rgb), 0.7); }
  50% { transform: scale(1.5); box-shadow: 0 0 14px rgba(var(--accent-q-rgb), 1); }
}

.asset-ticker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}
.asset-exchange {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  border: 1px solid var(--divider);
}
.asset-name   { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 3px; }
.asset-sector {
  display: inline-flex;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  letter-spacing: 0.04em;
}

.strategy-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-q);
  background: rgba(var(--accent-q-rgb), 0.1);
  border: 1px solid rgba(var(--accent-q-rgb), 0.22);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 5px;
  font-family: var(--font-display);
}
.strategy-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.strategy-token {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.strategy-time-ago {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--divider);
}

.action-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Volume badge — neutral, not green (not all volume is bullish) */
.volume-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.analyze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  font-size: 0.68rem;
  font-weight: 600;
  transition: all var(--ease-fast);
  white-space: nowrap;
}
.analyze-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--cta);
  color: var(--cta-light);
}

/* Empty state */
.empty-row td { padding: 60px 20px; }
.empty-state  { text-align: center; }
.empty-icon   { font-size: 2rem; margin-bottom: 10px; opacity: 0.3; }
.empty-text   { font-size: 0.88rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.empty-sub    { font-size: 0.7rem; color: var(--text-muted); opacity: 0.6; }

/* Lock row */
.lock-row td { padding: 0; }
.lock-overlay {
  background: linear-gradient(to bottom, rgba(13,14,18,0) 0%, var(--bg-deep) 25%);
  padding: 14px 20px 18px;
}
.lock-content {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.lock-icon  { font-size: 1rem; }
.lock-count { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.lock-desc  { font-size: 0.7rem; color: var(--text-tertiary); flex: 1; }
.upgrade-btn-sm {
  padding: 5px 14px 7px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(0,0,0,0.2);
  border-bottom: 3px solid #059669;
  border-radius: var(--r-sm);
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  white-space: nowrap;
  animation: cta-grad-shift 3s linear infinite;
  cursor: pointer;
}
.upgrade-btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  border-bottom-width: 4px;
}
.upgrade-btn-sm:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}
.lock-preview { display: flex; flex-direction: column; gap: 6px; }
.lock-preview-row {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--divider-soft);
  opacity: 0.3;
}
.blurred { filter: blur(5px); user-select: none; }
.lp-ticker { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary); width: 100px; }
.lp-label  { font-size: 0.74rem; color: var(--text-tertiary); flex: 1; }
.lp-btn    { font-size: 0.68rem; color: var(--text-tertiary); width: 90px; text-align: right; }

/* ─── Right Panel ─────────────────────────────────────────────────────────── */
.right-panel {
  width: var(--right-w);
  min-width: var(--right-w);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--divider-glass);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 20;
}

.rp-section {
  padding: 16px;
  border-bottom: 1px solid var(--divider-soft);
}

.rp-section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rp-live-dot {
  width: 5px; height: 5px;
  background: var(--cta);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Index grid */
.index-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.index-card {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color var(--ease-fast);
}
.index-card:hover { border-color: rgba(var(--accent-q-rgb), 0.3); }
.index-card.up-flash   { animation: card-flash-up 0.6s ease; }
.index-card.down-flash { animation: card-flash-down 0.6s ease; }

@keyframes card-flash-up   { 0%,100%{border-color:var(--divider)} 50%{border-color:rgba(16,185,129,0.5)} }
@keyframes card-flash-down { 0%,100%{border-color:var(--divider)} 50%{border-color:rgba(239,68,68,0.5)} }

.idx-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.idx-value {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s;
}
.idx-change {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.idx-change.up   { color: var(--cta-light); background: var(--cta-dim); }
.idx-change.down { color: #F87171; background: var(--red-dim); }

/* Advance/Decline Widget */
.adv-dec-widget {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 10px;
  margin-bottom: 10px;
}
.adv-dec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.adv-dec-header > span:first-child { font-size: 0.62rem; font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.06em; text-transform: uppercase; }
.adv-dec-total { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); }
.adv-dec-bar-track {
  height: 5px;
  background: rgba(239,68,68,0.25);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.adv-dec-bar-advance {
  height: 100%;
  background: linear-gradient(90deg, var(--cta), var(--cta-light));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.adv-dec-labels { display: flex; justify-content: space-between; }
.adv-label { font-size: 0.62rem; color: var(--cta-light); font-weight: 600; font-variant-numeric: tabular-nums; }
.dec-label { font-size: 0.62rem; color: #F87171; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Scan Scope Card */
.scan-scope-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.scan-scope-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
  animation: scan-breathe 3s ease-in-out infinite;
}
@keyframes scan-breathe {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.3); opacity: 1; }
}
.scan-pulse-ring {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cta);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
  animation: sonar 2s ease-in-out infinite;
}
@keyframes sonar {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.scan-scope-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cta-light);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.scan-scope-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }

/* Top Sectors */
.top-sectors-header { font-size: 0.58rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.sector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.sector-row:last-child { border-bottom: none; margin-bottom: 0; }
.sector-name  { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); flex: 1; }
.sector-bar-track { flex: 1; height: 3px; background: var(--bg-highlight); border-radius: 99px; overflow: hidden; }
.sector-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.sector-chg { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.sector-chg.up   { color: var(--cta-light); }
.sector-chg.down { color: #F87171; }

/* ─── Telegram Panel ────────────────────────────────────────────────────────  */
.rp-tg-icon { font-size: 0.85rem; }

.tg-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
}
.tg-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tg-status-dot.not-connected { background: var(--text-muted); }
.tg-status-dot.connected     { background: var(--cta); animation: pulse-dot 1.5s ease-in-out infinite; }
.tg-status-text { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); }

/* Lock state */
.tg-lock {
  text-align: center;
  padding: 14px 0 4px;
}
.tg-lock-icon { font-size: 1.4rem; margin-bottom: 6px; opacity: 0.5; }
.tg-lock-text { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.tg-lock-sub  { font-size: 0.65rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.tg-upgrade-btn {
  width: 100%;
  padding: 9px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border-radius: var(--r-sm);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: cta-grad-shift 3s linear infinite;
  border: none;
  cursor: pointer;
}
.tg-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* Connect flow */
.tg-connect-flow { display: flex; flex-direction: column; gap: 12px; }

.tg-step { display: flex; gap: 10px; align-items: flex-start; }
.tg-step-num {
  width: 20px; height: 20px;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--cta-light);
  flex-shrink: 0;
  margin-top: 1px;
}
.tg-step-title { font-size: 0.65rem; font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }

.tg-open-bot-btn {
  width: 100%;
  padding: 7px 10px;
  background: rgba(0,136,204,0.12);
  border: 1px solid rgba(0,136,204,0.25);
  border-radius: var(--r-sm);
  color: #10B981;
  font-size: 0.7rem;
  font-weight: 700;
  transition: all var(--ease-fast);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.tg-open-bot-btn:hover { background: rgba(0,136,204,0.2); }

.tg-code-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 6px 10px;
}
.tg-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cta-light);
  letter-spacing: 0.05em;
  flex: 1;
}
.tg-copy-btn {
  font-size: 0.8rem;
  padding: 2px;
  color: var(--text-muted);
  transition: color var(--ease-fast);
  flex-shrink: 0;
}
.tg-copy-btn:hover { color: var(--text-primary); }
.tg-copy-btn.copied { color: var(--cta); }

.tg-checkboxes { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.tg-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.tg-check input[type="checkbox"] { accent-color: var(--cta); width: 13px; height: 13px; }

.tg-freq-label { font-size: 0.58rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 5px; }
.tg-frequency  { display: flex; flex-direction: column; gap: 4px; }
.tg-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.tg-radio input[type="radio"] { accent-color: var(--cta); width: 13px; height: 13px; }

.tg-save-btn {
  width: 100%;
  padding: 9px;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--r-sm);
  color: var(--cta-light);
  font-size: 0.72rem;
  font-weight: 700;
  transition: all var(--ease-fast);
}
.tg-save-btn:hover { background: rgba(16,185,129,0.2); box-shadow: 0 0 12px var(--cta-glow); }
.tg-save-btn.saved { background: var(--cta-dim); color: var(--cta-light); }

.tg-whatsapp-coming {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.coming-soon-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: 99px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ─── Drawer Panel ────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(8,9,16,0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-drawer);
}
.drawer-overlay.visible { opacity: 1; pointer-events: auto; }

.drawer-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 500px; max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--divider);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--ease-drawer);
  box-shadow: -8px 0 48px rgba(0,0,0,0.6);
}
.drawer-panel.open { transform: translateX(0); }

.drawer-topbar {
  height: 54px; min-height: 54px;
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.drawer-topbar-title {
  font-size: 0.68rem; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  flex: 1;
}
.drawer-close-btn {
  width: 30px; height: 30px;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease-fast);
}
.drawer-close-btn:hover { background: var(--bg-highlight); color: var(--text-primary); border-color: var(--red); }

.drawer-stock-header { padding: 18px 20px; border-bottom: 1px solid var(--divider); flex-shrink: 0; }
.dsh-row1 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dsh-ticker { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.dsh-exchange { font-size: 0.58rem; font-weight: 700; color: var(--text-muted); background: var(--bg-elevated); padding: 2px 5px; border-radius: 3px; border: 1px solid var(--divider); }
.dsh-quadrant-badge { font-size: 0.6rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; letter-spacing: 0.06em; margin-left: auto; }
.dsh-name   { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 2px; }
.dsh-sector { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 10px; }
.dsh-label  { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; border: 1px solid; margin-bottom: 8px; }
.dsh-meta   { display: flex; gap: 16px; flex-wrap: wrap; }
.dsh-meta-item  { display: flex; flex-direction: column; gap: 2px; }
.dsh-meta-label { font-size: 0.57rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.dsh-meta-val   { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-tertiary); }

.drawer-content-scrollable {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.drawer-chart-section { display: flex; flex-direction: column; flex-shrink: 0; }
.drawer-chart-label {
  padding: 9px 20px 7px;
  font-size: 0.58rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--divider-soft);
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
}
.chart-live-dot { width: 5px; height: 5px; background: var(--cta); border-radius: 50%; animation: pulse-dot 1.5s ease-in-out infinite; }
#chart-canvas { height: 260px; min-height: 260px; width: 100%; }
.drawer-compliance-note {
  padding: 8px 20px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--divider-soft);
  font-size: 0.6rem; color: var(--text-muted); line-height: 1.5;
  flex-shrink: 0;
}
.drawer-footer { padding: 12px 20px; border-top: 1px solid var(--divider); display: flex; gap: 10px; flex-shrink: 0; background: var(--bg-surface); }
.drawer-research-btn {
  flex: 1; padding: 9px;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--r-sm);
  color: var(--cta-light);
  font-size: 0.74rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--ease-fast);
}
.drawer-research-btn:hover { background: rgba(16,185,129,0.2); box-shadow: 0 0 12px var(--cta-glow); }

/* ─── Modals ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8,9,16,0.88);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease-med);
}
.modal-backdrop.visible { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xl);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-xl), 0 0 80px rgba(16,185,129,0.12);
  animation: modal-drop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-header {
  background: var(--bg-elevated);
  padding: 22px 24px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: flex-start; gap: 14px;
}
.modal-header-icon {
  width: 42px; height: 42px;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.modal-header-title { font-size: 0.95rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; font-family: var(--font-display); }
.modal-header-sub   { font-size: 0.68rem; color: var(--text-tertiary); }

.modal-body { padding: 22px 24px; }
.modal-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.modal-points li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.74rem; color: var(--text-secondary); line-height: 1.5;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
}
.point-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--cta); margin-top: 2px; flex-shrink: 0; }
.checkbox-row input[type="checkbox"].shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97); }
.checkbox-label { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.55; }
.checkbox-label strong { color: var(--text-primary); font-weight: 600; }

.modal-confirm-btn {
  width: 100%; padding: 9px 11px 13px;
  background: var(--cta);
  border-top: 1px solid rgba(255,255,255,0.2);
  border-left: 1px solid rgba(255,255,255,0.1);
  border-right: 1px solid rgba(0,0,0,0.1);
  border-bottom: 4px solid var(--cta-hover);
  border-radius: var(--r-sm);
  color: #fff; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 12px var(--cta-glow);
  cursor: pointer;
}
.modal-confirm-btn:hover { background: var(--cta-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--cta-glow); border-bottom-width: 5px; }
.modal-confirm-btn:active { transform: translateY(2px); border-bottom-width: 1px; }

/* Upgrade modal */
.upgrade-card { max-width: 540px; }
.upgrade-close-btn {
  width: 30px; height: 30px;
  background: var(--bg-surface); border: 1px solid var(--divider);
  border-radius: var(--r-sm); color: var(--text-tertiary);
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease-fast);
}
.upgrade-close-btn:hover { color: var(--text-primary); border-color: var(--red); }
/* Single Plan Card (upgrade modal) */
.single-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 0 30px var(--cta-glow);
}
.spc-left { display: flex; flex-direction: column; gap: 3px; }
.spc-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}
.spc-period { font-size: 0.68rem; color: var(--text-tertiary); }
.spc-badge {
  padding: 5px 14px;
  background: var(--cta);
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px var(--cta-glow);
}

.upgrade-plans   { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.upgrade-plan {
  flex: 1; min-width: 130px;
  padding: 14px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  text-align: center;
  transition: all var(--ease-med);
  position: relative;
  cursor: pointer;
}
.upgrade-plan:hover { border-color: var(--cta); box-shadow: 0 0 18px var(--cta-glow); }
.upgrade-plan.featured { border-color: var(--cta); background: var(--cta-dim); box-shadow: 0 0 22px var(--cta-glow); }
.upgrade-plan.institutional { border-color: var(--cta); background: rgba(16,185,129,0.06); box-shadow: 0 0 22px rgba(16,185,129,0.2); }

.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--cta); color: #fff;
  font-size: 0.55rem; font-weight: 700;
  padding: 2px 9px; border-radius: 99px; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.plan-badge.gold { background: var(--cta); color: #fff; }
.plan-price  { font-size: 1.45rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.03em; font-family: var(--font-display); }
.plan-period { font-size: 0.62rem; color: var(--text-tertiary); margin-bottom: 6px; }
.plan-desc   { font-size: 0.65rem; color: var(--text-secondary); }

.upgrade-features { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.upgrade-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }
.feat-check  { color: var(--cta); font-size: 0.85rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.feat-gold   { color: var(--cta); font-size: 0.85rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; }

.upgrade-cta-btn {
  width: 100%; padding: 10px 12px 14px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(0,0,0,0.2);
  border-bottom: 4px solid #059669;
  border-radius: var(--r-sm);
  color: #000; font-size: 0.84rem; font-weight: 800; letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  margin-bottom: 8px;
  animation: cta-grad-shift 3s linear infinite;
  cursor: pointer;
}
.upgrade-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
  border-bottom-width: 5px;
}
.upgrade-cta-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.upgrade-legal { font-size: 0.6rem; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.terminal-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--divider);
  padding: 7px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.footer-disclaimer { font-size: 0.59rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.footer-disclaimer strong { color: var(--text-tertiary); }
.footer-version {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  padding: 2px 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-xs);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Upgrade Banner (inline) ────────────────────────────────────────────── */
.upgrade-banner {
  background: linear-gradient(90deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
  border-top: 1px solid rgba(16,185,129,0.12);
  padding: 8px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.ub-text  { flex: 1; min-width: 0; }
.ub-title { font-size: 0.74rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.ub-sub   { font-size: 0.64rem; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upgrade-cta {
  padding: 6px 14px 8px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(0,0,0,0.2);
  border-bottom: 3px solid #059669;
  border-radius: var(--r-sm);
  color: #000; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
  animation: cta-grad-shift 3s linear infinite;
  cursor: pointer;
}
.upgrade-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  border-bottom-width: 4px;
}
.upgrade-cta:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.65); }
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  80%{ transform: scale(1.2); }
  100%{ transform: scale(1); }
}

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

@keyframes row-glow {
  0%   { background: rgba(16,185,129,0.14); }
  60%  { background: rgba(16,185,129,0.05); }
  100% { background: transparent; }
}

@keyframes modal-drop {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  10%,90%{ transform: translateX(-2px); }
  20%,80%{ transform: translateX(4px); }
  30%,50%,70%{ transform: translateX(-5px); }
  40%,60%{ transform: translateX(5px); }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --right-w: 240px; }
}

@media (max-width: 1024px) {
  .right-panel { display: none; }
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
}

@media (max-width: 768px) {
  .delay-chip { display: none; }
  .scan-badge { display: none; }
  #header-upgrade-btn { display: none; }
  .tab-btn { padding: 0 10px; font-size: 0.7rem; gap: 4px; }
  .col-asset { width: 40%; padding: 10px 12px; }
  .col-strategy { width: 35%; padding: 10px 12px; }
  .col-action { width: 25%; padding: 10px 10px; }
  .analyze-btn span:last-child { display: none; }
  .asset-sector { display: none; }
  .strategy-token { display: none; }
  .terminal-footer { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERT CENTER — Right Panel
   ═══════════════════════════════════════════════════════════════════════════ */

/* Alert Center section — slightly warmer background to stand out */
.rp-alert-center {
  background: linear-gradient(180deg,
    rgba(16,185,129,0.06) 0%,
    transparent 60%
  );
  border-bottom: 1px solid var(--divider);
}

/* Header with live pill */
.alert-center-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--divider-soft);
}
.ac-bell-icon { font-size: 0.85rem; }
.alert-live-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--divider);
  background: var(--bg-highlight);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.alert-live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.alert-live-dot.active {
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  animation: dot-pulse 2s ease-in-out infinite;
}

/* ─── Channel Cards ──────────────────────────────────────────────────────── */
.acc-card {
  margin: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--ease-fast);
}
.acc-card:hover { border-color: rgba(16,185,129,0.3); }
.acc-card-dim { opacity: 0.55; }
.acc-card-dim:hover { opacity: 0.7; border-color: var(--divider); }

.acc-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

/* Channel icon circle */
.acc-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.acc-tg-color { background: rgba(41,182,246,0.15); color: #10B981; }
.acc-wa-color { background: rgba(37,211,102,0.12); color: #25D366; }

.acc-card-info { flex: 1; min-width: 0; }
.acc-card-name { font-size: 0.72rem; font-weight: 700; color: var(--text-primary); }
.acc-card-sub  { font-size: 0.62rem; color: var(--text-tertiary); margin-top: 1px; }

.acc-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.acc-status-dot.not-connected { background: var(--text-muted); }
.acc-status-dot.connected {
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  animation: dot-pulse 2s ease-in-out infinite;
}

/* ─── Free tier CTA ──────────────────────────────────────────────────────── */
.acc-free-cta {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--divider-soft);
}
.acc-free-desc {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 0 0 10px;
}
.acc-unlock-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border: none;
  border-radius: var(--r-sm);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
  animation: cta-grad-shift 3s linear infinite;
}
.acc-unlock-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}
.acc-unlock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ─── Premium connect flow ───────────────────────────────────────────────── */
.acc-premium-flow {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--divider-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-step-n {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.35);
  color: var(--cta-light);
  font-size: 0.6rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.acc-open-bot-btn {
  flex: 1;
  padding: 7px 10px;
  background: rgba(41,182,246,0.12);
  border: 1px solid rgba(41,182,246,0.3);
  border-radius: var(--r-sm);
  color: #10B981;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease-fast);
  text-align: center;
}
.acc-open-bot-btn:hover { background: rgba(41,182,246,0.2); transform: translateY(-1px); }

.acc-code-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 6px 10px;
}
.acc-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cta-light);
  letter-spacing: 0.08em;
}
.acc-copy-btn {
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--ease-fast);
  background: none;
  border: none;
  padding: 0;
}
.acc-copy-btn:hover { opacity: 1; }
.acc-copy-btn.copied { color: var(--cta); opacity: 1; }

/* ─── Alert Save Button ──────────────────────────────────────────────────── */
.alert-save-btn {
  width: calc(100% - 24px);
  margin: 4px 12px 12px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease-fast);
  letter-spacing: 0.02em;
}
.alert-save-btn:hover {
  background: var(--cta-dim);
  border-color: var(--cta);
  color: var(--cta-light);
}
.alert-save-btn.saved {
  background: var(--cta-dim);
  border-color: var(--cta);
  color: var(--cta-light);
}

/* ─── Signal Channel Toggles ─────────────────────────────────────────────── */
.ac-section {
  padding: 10px 12px 0;
}
.ac-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ac-section-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ac-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--cta);
  background: var(--cta-dim);
  border: 1px solid rgba(16,185,129,0.2);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.ac-live-dot-sm {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cta);
  animation: dot-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.ac-toggles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ac-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: background var(--ease-fast);
}
.ac-toggle-row:hover { background: var(--bg-highlight); }
.ac-name { font-size: 0.68rem; color: var(--text-secondary); flex: 1; }


/* CSS Toggle Switch */
.toggle-sw {
  position: relative;
  width: 32px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
}
.toggle-sw input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.sw-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.sw-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px; height: 11px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.25s;
}
.toggle-sw input:checked + .sw-slider {
  background: var(--cta-dim);
  border-color: var(--cta);
}
.toggle-sw input:checked + .sw-slider::before {
  transform: translateX(15px) translateY(-50%);
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
}

/* ─── Alert Frequency Pills ──────────────────────────────────────────────── */
.af-pills {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
}
.af-pill {
  flex: 1;
  padding: 5px 6px;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  background: var(--bg-highlight);
  color: var(--text-tertiary);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
  text-align: center;
  white-space: nowrap;
}
.af-pill:hover { border-color: var(--cta); color: var(--cta-light); }
.af-pill.af-active {
  background: var(--cta-dim);
  border-color: rgba(16,185,129,0.45);
  color: var(--cta-light);
}

/* ─── Sidebar Notification Dot ───────────────────────────────────────────── */
.sb-notif-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  flex-shrink: 0;
  margin-left: auto;
  animation: dot-pulse 2s ease-in-out infinite;
}
.sidebar:not(.expanded) .sb-notif-dot { margin-left: 0; }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Lucide Icon Sizing ──────────────────────────────────────────────────── */
.sb-item i[data-lucide],
.sb-item svg.lucide {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.sb-dyn-icon { display: flex; align-items: center; justify-content: center; }
.sb-dyn-icon svg { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }

/* Tab bar icon sizing */
.tab-btn i[data-lucide],
.tab-btn svg.lucide {
  width: 13px; height: 13px; stroke-width: 2;
}

/* ─── Sidebar Section Labels ─────────────────────────────────────────────── */
.sb-section-label {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 18px 2px;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--ease-med), max-width var(--ease-med);
  pointer-events: none;
}
.sidebar.expanded .sb-section-label { opacity: 1; max-width: 200px; }

/* ─── Quadrant Sidebar Items ─────────────────────────────────────────────── */
.sb-item.sb-quadrant[data-quadrant="intraday"].q-active { color: inherit; }
.sb-item.sb-quadrant[data-quadrant="intraday"].q-active::before { background: #10B981; box-shadow: 0 0 8px rgba(16,185,129,0.5); }

.sb-item.sb-quadrant[data-quadrant="swing"].q-active { color: inherit; }
.sb-item.sb-quadrant[data-quadrant="swing"].q-active::before { background: var(--cta); box-shadow: 0 0 8px var(--cta-glow); }
.sb-item.sb-quadrant[data-quadrant="longterm"].q-active { color: inherit; }
.sb-item.sb-quadrant[data-quadrant="longterm"].q-active::before { background: var(--cta); box-shadow: 0 0 8px var(--cta-glow); }

/* ─── Theme Toggle Button ────────────────────────────────────────────────── */
.sb-theme-btn { color: var(--text-muted) !important; opacity: 1 !important; }
.sb-theme-btn:hover { background: var(--bg-elevated) !important; }
[data-theme="light"] .sb-theme-btn { color: var(--cta) !important; }

/* ─── Telegram Connect Block (redesigned) ────────────────────────────────── */
.tg-connect-block {
  margin: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tg-connect-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tg-brand-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(41,182,246,0.15);
  color: #10B981;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tg-brand-info { display: flex; flex-direction: column; gap: 2px; }
.tg-brand-name  { font-size: 0.72rem; font-weight: 700; color: var(--text-primary); }
.tg-connect-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.6rem; color: var(--text-tertiary);
}
.tg-code-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tg-open-big-btn {
  width: 100%;
  padding: 9px 12px;
  background: rgba(41,182,246,0.1);
  border: 1px solid rgba(41,182,246,0.28);
  border-radius: var(--r-sm);
  color: #10B981;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease-fast);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.tg-open-big-btn:hover {
  background: rgba(41,182,246,0.18);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(41,182,246,0.15);
}
.tg-hint {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ─── Light theme surface overrides ─────────────────────────────────────── */
[data-theme="light"] .ticker-strip       { background: #FFFFFF; border-bottom-color: var(--divider); }
[data-theme="light"] .signal-table thead tr { background: #F0F4FC; }
[data-theme="light"] .signal-row:hover   { background: #EDF1FB; }
[data-theme="light"] .terminal-header    { background: rgba(255,255,255,0.9); }
[data-theme="light"] .tab-bar            { background: var(--bg-surface); }
[data-theme="light"] .tab-btn.active     { background: var(--bg-highlight); }
[data-theme="light"] #float-preview-btn  { background: #F0F4FC; }
[data-theme="light"] .modal-card         { background: #FFFFFF; }
[data-theme="light"] .mesh-bg            { opacity: 0.04; }

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYTICS VIEWS SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* View panels — show/hide */
.analytics-view {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
}
.analytics-view.active { display: flex; }

/* Signal Feed view uses full height scroll like before */
#view-signals { flex-direction: column; }

/* ─── Strategy filter tag in quadrant info bar ───────────────────────────── */
.qi-strategy-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-right: 6px;
}

/* ─── Analytics View Header ──────────────────────────────────────────────── */
.av-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--divider-soft);
  flex-shrink: 0;
}
.av-header-left { display: flex; flex-direction: column; gap: 2px; }
.av-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.av-sub   { font-size: 0.62rem; color: var(--text-tertiary); }
.av-live-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.62rem; font-weight: 700;
  color: var(--cta);
}
.av-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  animation: dot-pulse 2s ease-in-out infinite;
}

/* ─── Market Breadth Grid ────────────────────────────────────────────────── */
.breadth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.breadth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--ease-fast);
}
.breadth-card:hover { border-color: rgba(16,185,129,0.25); }
.breadth-card--wide {
  grid-column: 1 / -1; /* full width */
}
.bc-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* A/D Progress Bar */
.bc-ad-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--red-dim);
  border: 1px solid var(--divider);
  position: relative;
}
.bc-ad-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cta) 0%, #059669 100%);
  display: flex; align-items: center; padding-left: 10px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 60px;
}
.bc-ad-adv-label {
  font-size: 0.68rem; font-weight: 800;
  color: #fff; font-family: var(--font-mono);
}
.bc-ad-dec-label {
  position: absolute; right: 10px;
  font-size: 0.68rem; font-weight: 800;
  color: var(--red); font-family: var(--font-mono);
}
.bc-ad-legend {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.6rem; color: var(--text-tertiary);
}
.bca-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bca-green { background: var(--cta); }
.bca-red   { background: var(--red); }
.bca-grey  { background: var(--text-muted); }

/* Stat tiles */
.bc-stat { align-items: center; text-align: center; padding: 16px 14px; }
.bc-stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.bc-icon-green { background: var(--cta-dim); color: var(--cta); }
.bc-icon-red   { background: var(--red-dim);     color: var(--red); }
.bc-icon-muted { background: var(--bg-highlight); color: var(--text-muted); }
.bc-icon-blue  { background: var(--cta-dim);   color: var(--cta-light); }
.bc-stat-val {
  font-size: 1.5rem; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}
.bc-stat-label {
  font-size: 0.6rem; color: var(--text-tertiary); font-weight: 600;
}

/* Sector bars in breadth view */
.bc-sectors {
  display: flex; flex-direction: column; gap: 5px;
}
.bc-sector-row {
  display: flex; align-items: center; gap: 8px;
}
.bcs-name {
  font-size: 0.6rem; color: var(--text-secondary); font-weight: 600;
  width: 90px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bcs-bar-track {
  flex: 1; height: 4px; background: var(--bg-highlight); border-radius: 2px; overflow: hidden;
}
.bcs-bar { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.bcs-pct {
  font-size: 0.6rem; font-weight: 700; font-family: var(--font-mono);
  width: 42px; text-align: right; flex-shrink: 0;
}


/* Breadth signal tiles */
.bc-signal-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.bc-sig {
  background: var(--bg-highlight);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.bc-sig-name { font-size: 0.58rem; color: var(--text-muted); font-weight: 600; }
.bc-sig-val  {
  font-size: 0.9rem; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.bc-sig-val.green { color: var(--cta); }
.bc-sig-val.red   { color: var(--red); }

/* ─── Premium Lock Screen (Volume / F&O) ─────────────────────────────────── */
.av-premium-lock {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.avpl-glow {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.avpl-glow--blue {
  background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
}
.avpl-icon { color: var(--text-muted); }
.avpl-title {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.avpl-desc {
  font-size: 0.72rem; color: var(--text-tertiary);
  line-height: 1.6; max-width: 420px;
}
.avpl-metrics {
  display: flex; gap: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 14px 20px;
}
.avpl-metric { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.avplm-val {
  font-size: 1.1rem; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.avplm-val.blurred {
  filter: blur(5px);
  user-select: none;
  transition: filter 0.2s;
}
.avplm-val.green { color: var(--cta); }
.avplm-val.red   { color: var(--red); }
.avplm-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; }
.avpl-unlock-btn {
  padding: 12px 28px;
  background: linear-gradient(90deg, #10B981, #34D399, #10B981);
  background-size: 200% auto;
  border: none;
  border-radius: var(--r-md);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all var(--ease-fast);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  position: relative; overflow: hidden;
  animation: cta-grad-shift 3s linear infinite;
}
.avpl-unlock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.5);
}

/* ═══ TELEGRAM CONNECT — FOCUSED CTA BLOCK ═══════════════════════════════ */
.tg-connect-focus {
  border: 1.5px solid rgba(41,182,246,0.35) !important;
  background: linear-gradient(
    145deg,
    rgba(41,182,246,0.06) 0%,
    var(--bg-elevated) 60%
  ) !important;
  box-shadow: 0 0 24px rgba(41,182,246,0.08);
  animation: tg-focus-glow 3s ease-in-out infinite;
}
@keyframes tg-focus-glow {
  0%,100% { box-shadow: 0 0 16px rgba(41,182,246,0.06); }
  50%      { box-shadow: 0 0 32px rgba(41,182,246,0.14); }
}

.tg-connect-cta-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tg-cta-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: rgba(41,182,246,0.15);
  color: #10B981;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tg-cta-text { display: flex; flex-direction: column; gap: 2px; }
.tg-cta-headline {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.tg-cta-sub {
  font-size: 0.62rem;
  color: var(--text-tertiary);
}

.tg-connect-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.63rem;
  color: var(--text-tertiary);
}
.tg-status-text { font-size: 0.63rem; }

/* Primary open-bot button */
.tg-open-primary {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #000 !important;
  box-shadow: 0 0 20px rgba(41,182,246,0.25) !important;
}
.tg-open-primary:hover {
  background: #22A8E0 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 0 32px rgba(41,182,246,0.4) !important;
}

/* ac-toggle-row icon alignment */
.ac-toggle-row {
  gap: 8px !important;
}
.ac-toggle-row > i[data-lucide],
.ac-toggle-row > svg.lucide {
  flex-shrink: 0;
}

/* ═══ LIGHT THEME — CHIP OVERRIDES ══════════════════════════════════════════ */
[data-theme="light"] .asset-exchange {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #6078A0;
}
[data-theme="light"] .asset-sector {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #6078A0;
}
[data-theme="light"] .strategy-label {
  /* keep the inline style color but fix bg */
  background: rgba(var(--accent-q-rgb), 0.07) !important;
  border-color: rgba(var(--accent-q-rgb), 0.18) !important;
}
[data-theme="light"] .strategy-time-ago {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #6078A0;
}
[data-theme="light"] .volume-badge {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #3A4F72;
}
[data-theme="light"] .analyze-btn {
  color: #6078A0;
  border-color: #D0DCF0;
}
[data-theme="light"] .analyze-btn:hover {
  background: var(--cta-dim);
  border-color: var(--cta);
  color: var(--cta);
}
[data-theme="light"] .brand-tag {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #6078A0;
}
[data-theme="light"] .delay-chip { color: #6078A0; }
[data-theme="light"] .delay-upgrade {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #3A4F72;
}
[data-theme="light"] .tg-connect-focus {
  border-color: rgba(41,182,246,0.3) !important;
  background: linear-gradient(145deg, rgba(41,182,246,0.04) 0%, #fff 60%) !important;
}
[data-theme="light"] .qi-timing {
  background: #EEF2FB;
  border-color: #D0DCF0;
  color: #6078A0;
}

@keyframes cta-grad-shift {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 4px 25px rgba(16, 185, 129, 0.7);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  }
}


/* ─── Broker Settings Modal (Modern Redesign) ──────────────────────────────── */
.broker-modal-card {
  max-width: 460px;
  width: 95%;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(10px);
}

.bm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.bm-header-left {
  display: flex;
  gap: 12px;
}

.bm-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--cta);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.bm-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.bm-origin-warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.72rem;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  line-height: 1.4;
  text-align: center;
}

.bm-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease-fast), background var(--ease-fast);
}

.bm-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Chips Section */
.bm-chips-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bm-chips-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.bm-chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.bm-chips-row::-webkit-scrollbar {
  height: 4px;
}

.bm-chips-row::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 2px;
}

.bm-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--divider);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.bm-chip:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.bm-chip.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--cta);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.bm-chip-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.bm-chip-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bm-chip.active .bm-chip-name {
  color: var(--text-primary);
}

.bm-chip-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.live-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.soon-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.bm-divider {
  height: 1px;
  background: var(--divider);
  margin: 4px 0;
}

/* Dynamic Form Area */
.bm-form-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bm-field-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.bm-field input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.bm-field input::placeholder {
  color: var(--text-muted);
}

.bm-field input:focus {
  border-color: var(--cta);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Status Row */
.bm-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
}

.bm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.bm-status-dot.live {
  background: var(--cta);
  box-shadow: 0 0 8px var(--cta);
}

.bm-status-dot.failed {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.bm-status-text {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bm-portal-link {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cta);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.bm-portal-link:hover {
  opacity: 0.8;
}

/* Connect button */
.broker-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--cta) 0%, #059669 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.broker-connect-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.broker-connect-btn:active {
  transform: translateY(0);
}

.broker-connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Disclaimer */
.broker-disclaimer {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
  margin: 0;
}

.broker-disclaimer code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.62rem;
}

/* One-Click OAuth & Manual Toggles */
.bm-oauth-section {
  width: 100%;
}
.broker-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
  transition: all 0.2s ease;
}
.broker-oauth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
  filter: brightness(1.1);
}
.broker-oauth-btn:active {
  transform: translateY(0);
}
.broker-oauth-btn .btn-icon {
  font-size: 1.05rem;
  animation: pulse-ring 2s infinite;
}

.bm-toggle-manual {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}
.manual-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.manual-toggle-btn:hover {
  color: var(--text-secondary);
}
.manual-toggle-btn .toggle-icon {
  font-size: 0.55rem;
  transition: transform 0.2s;
}
.manual-toggle-btn.expanded .toggle-icon {
  transform: rotate(180deg);
}


/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADER
   ═══════════════════════════════════════════════════════════════ */
@keyframes skeletonShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-row td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider-soft);
}
.skel-line {
  height: 11px;
  border-radius: var(--r-sm);
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-highlight) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 800px 100%;
  animation: skeletonShimmer 1.4s infinite linear;
}


/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed;
  top: calc(var(--ticker-h) + var(--header-h) + 6px);
  right: calc(var(--right-w) + 10px);
  width: 300px;
  max-height: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* hidden by default */
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease-spring);
}
.notif-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider-soft);
  flex-shrink: 0;
}
.notif-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.notif-panel-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: color var(--ease-fast), background var(--ease-fast);
}
.notif-panel-clear:hover {
  color: var(--text-primary);
  background: var(--bg-highlight);
}
.notif-panel-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.notif-panel-list::-webkit-scrollbar { width: 4px; }
.notif-panel-list::-webkit-scrollbar-track { background: transparent; }
.notif-panel-list::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 2px; }
.notif-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--ease-fast);
}
.notif-item:hover { background: var(--bg-highlight); }
.notif-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-ticker {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.notif-item-exch {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}
.notif-item-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-mono);
}


/* ═══════════════════════════════════════════════════════════════
   UPGRADE CTA — Pulse Glow Animation
   ═══════════════════════════════════════════════════════════════ */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.18); }
}
.upgrade-cta-btn {
  animation: ctaPulse 2.8s ease-in-out infinite;
}
.upgrade-cta-btn:hover {
  animation: none;
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════ */
.sb-toggle-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--ease-fast), background var(--ease-fast), border-color var(--ease-fast);
  opacity: 0;  /* Hidden when sidebar is narrow */
}
.sidebar.expanded .sb-toggle-btn { opacity: 1; }
.sb-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-highlight);
  border-color: var(--divider-soft);
}


/* ═══════════════════════════════════════════════════════════════
   AUTO-COLLAPSE SWITCH — ON STATE
   ═══════════════════════════════════════════════════════════════ */
.sb-switch {
  width: 28px;
  height: 16px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--ease-fast), border-color var(--ease-fast);
}
.sb-switch.on {
  background: var(--cta);
  border-color: var(--cta);
}
.sb-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--ease-med), background var(--ease-fast);
}
.sb-switch.on .sb-switch-thumb {
  transform: translateX(12px);
  background: #fff;
}


/* ═══════════════════════════════════════════════════════════════
   MARKET CLOSED EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.market-closed-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 4px;
}
.market-closed-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.mca-btn {
  background: var(--cta-dim);
  border: 1px solid var(--cta-glow);
  color: var(--cta-light);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast);
}
.mca-btn:hover {
  background: var(--cta);
  color: #fff;
  border-color: var(--cta);
}
.mca-btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--divider);
  color: var(--text-secondary);
}
.mca-btn-secondary:hover {
  background: var(--bg-highlight);
  border-color: var(--divider-soft);
  color: var(--text-primary);
}


/* ═══════════════════════════════════════════════════════════════
   ALERT CENTER HIGHLIGHT PULSE (sidebar "Alert Center" click)
   ═══════════════════════════════════════════════════════════════ */
@keyframes highlightPulse {
  0%, 100% { box-shadow: none; }
  30%       { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35); }
  60%       { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15); }
}
.highlight-pulse {
  animation: highlightPulse 1.8s ease-out forwards;
  border-radius: var(--r-md);
}


/* ═══════════════════════════════════════════════════════════════
   LOCKED PANEL VALUE ANIMATION (Volume Radar & F&O Pulse)
   ═══════════════════════════════════════════════════════════════ */
@keyframes avplmPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.7; }
}
.avplm-animate {
  animation: avplmPulse 2.2s ease-in-out infinite;
}
.avplm-animate:nth-child(2) { animation-delay: 0.4s; }
.avplm-animate:nth-child(3) { animation-delay: 0.8s; }


/* ═══════════════════════════════════════════════════════════════
   SIGNAL-NEW ROW FLASH ANIMATION
   ═══════════════════════════════════════════════════════════════ */
@keyframes signalNewFlash {
  0%   { background: rgba(16, 185, 129, 0.12); }
  60%  { background: rgba(16, 185, 129, 0.06); }
  100% { background: transparent; }
}
.signal-row.signal-new {
  animation: signalNewFlash 2s ease-out forwards;
}
.signal-row.signal-new .severity-dot {
  animation: ctaPulse 1.5s ease-in-out 3;
}


/* ═══════════════════════════════════════════════════════════════
   UPGRADE BANNER — Only visible on Signal Feed (not all tabs)
   ═══════════════════════════════════════════════════════════════ */
#view-breadth ~ .upgrade-banner,
#view-volume  ~ .upgrade-banner,
#view-fno     ~ .upgrade-banner {
  /* hide banner on non-signal views via JS class instead */
}
/* JS adds .tab-active-signals class to body when Signal Feed is active */
body:not(.tab-active-signals) .upgrade-banner {
  display: none;
}


/* ═══════════════════════════════════════════════════════════════
   VOLUME BADGE TOOLTIP CURSOR
   ═══════════════════════════════════════════════════════════════ */
.volume-badge[title] {
  cursor: help;
}
.analyze-btn[title] {
  position: relative;
}


/* ═══════════════════════════════════════════════════════════════
   DRAWER — FULL ANALYSIS PANEL STYLES
   ═══════════════════════════════════════════════════════════════ */
.drawer-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.drawer-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Rationale */
.drawer-rationale { }
.drawer-rationale p {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* Momentum score bar */
.drawer-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.drawer-score-label { font-size: 0.73rem; color: var(--text-muted); }
.drawer-score-val   { font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer-score-bar-track {
  height: 6px;
  background: var(--bg-highlight);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.drawer-score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.drawer-score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--text-disabled, var(--text-muted));
  opacity: 0.6;
}

/* Volume metrics grid */
.drawer-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.drm-item {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  text-align: center;
}
.drm-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.drm-label { font-size: 0.62rem; color: var(--text-muted); }
.vol-extreme { color: #EF4444; }
.vol-strong  { color: #F59E0B; }
.vol-elevated{ color: #10B981; }
.vol-moderate{ color: var(--text-secondary); }

/* Sector context */
.drawer-sector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.drawer-sector-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}
.drawer-sector-trend {
  font-size: 0.75rem;
  font-weight: 600;
}
.drawer-sector-note {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* What to watch */
.drawer-watchlist {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
}
.drawer-watchlist li {
  position: relative;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-secondary);
  padding: 4px 0 4px 12px;
  border-bottom: 1px solid var(--divider);
}
.drawer-watchlist li:last-child { border-bottom: none; }
.drawer-watchlist li::before {
  content: '→';
  position: absolute;
  left: -2px;
  color: var(--accent-q, #10B981);
  font-size: 0.7rem;
}

/* Footer buttons */
.drawer-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--divider);
  flex-wrap: wrap;
}
.float-research-btn,
.drawer-screener-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--ease-fast), border-color var(--ease-fast);
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
}
.float-research-btn:hover,
.drawer-screener-btn:hover {
  background: var(--bg-highlight);
  border-color: var(--accent-q, #10B981);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Volume Radar — Full Functional View
   ═══════════════════════════════════════════════════════════════════════════ */

.vr-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.vr-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vr-stat-val {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--cta);
  letter-spacing: -0.5px;
}
.vr-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vr-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--bg-elevated);
}
.vr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vr-table thead tr {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
}
.vr-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.vr-row {
  border-bottom: 1px solid var(--divider-soft);
  transition: background 0.15s;
}
.vr-row:last-child { border-bottom: none; }
.vr-row:hover { background: var(--bg-highlight); }
.vr-row td { padding: 10px 14px; vertical-align: middle; }
.vr-ticker {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vr-exch {
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.vr-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vr-vol-val {
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.vr-vol-avg {
  font-size: 10px;
  color: var(--text-muted);
}
.vr-sector-cell {
  font-size: 12px;
  color: var(--text-secondary);
}
.vr-time {
  font-size: 11px;
  color: var(--text-muted);
}
.vr-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.vr-candle-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.vr-segment-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--divider);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   F&O Pulse — Full Functional View
   ═══════════════════════════════════════════════════════════════════════════ */

.fno-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.fno-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--divider);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--ease-fast), transform var(--ease-fast), box-shadow var(--ease-fast);
}
.fno-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
}
.fno-metric-card:has(.green) {
  border-left-color: var(--cta);
}
.fno-metric-card:has(.red) {
  border-left-color: var(--red);
}
.fno-metric-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.fno-metric-val {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2px;
}
.fno-metric-val.green { color: var(--cta) !important; }
.fno-metric-val.red   { color: var(--red) !important; }
.fno-metric-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.fno-section {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.fno-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.fno-flow-bar-wrap { display: flex; flex-direction: column; gap: 8px; }
.fno-flow-bar {
  height: 10px;
  background: var(--red);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.fno-flow-fii {
  height: 100%;
  background: var(--cta);
  border-radius: 5px;
  transition: width 0.6s ease;
}
.fno-flow-labels {
  display: flex;
  justify-content: space-between;
}
.fno-flow-label {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.fno-flow-label.green { color: var(--cta); }
.fno-flow-label.red   { color: var(--red); }

.fno-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--divider-soft);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

/* green / red helper classes for fno-metric-val */

/* ─── Premium Visual Accent Variables ─── */
:root {
  --accent-slate: #64748b;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
}

/* ─── Onboarding Wizard Styles ─── */
.ob-modal-card {
  max-width: 520px !important;
  width: 95%;
}
.ob-steps-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ob-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--divider);
  transition: all var(--ease-normal);
}
.ob-dot.active {
  background: var(--cta);
  box-shadow: 0 0 8px var(--cta);
  transform: scale(1.15);
}
.ob-dot.completed {
  background: #10B981;
}
.ob-step {
  animation: fadeIn var(--ease-normal) forwards;
}
.ob-step-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}
.ob-chips-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.ob-log-box {
  background: #0d1117;
  border: 1px solid var(--divider-soft);
  border-radius: var(--r-sm);
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #c9d1d9;
  text-align: left;
  height: 110px;
  overflow-y: auto;
  margin: 15px 0;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ob-status-card {
  background: var(--bg-surface);
  border: 1px solid var(--divider-soft);
  border-radius: var(--r-md);
  padding: 14px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-status-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}
.ob-status-lbl {
  color: var(--text-muted);
}
.ob-status-val {
  font-weight: 600;
  color: var(--text-primary);
}
.ob-status-val.highlight {
  color: #10B981;
}
.ob-nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.ob-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--ease-fast);
}
.ob-btn-primary {
  background: var(--cta);
  color: white;
  border: none;
}
.ob-btn-primary:hover {
  background: var(--cta-hover);
}
.ob-btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
}
.ob-btn-secondary:hover {
  background: var(--bg-highlight);
  color: var(--text-primary);
}
.ob-loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--divider);
  border-top-color: var(--cta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto 10px;
}
.ob-loading-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ob-loading-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ob-success-icon {
  color: #10B981;
  margin: 15px auto 10px;
  display: flex;
  justify-content: center;
}

/* ─── Sector Heatmap Styles ─── */
.hm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.hm-tile {
  border-radius: var(--r-md);
  border: 1px solid transparent;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 105px;
  transition: transform var(--ease-normal), box-shadow var(--ease-normal);
  cursor: default;
}
.hm-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.hm-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hm-index {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hm-change {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 8px 0 2px;
  color: var(--text-primary);
}
.hm-mask-note {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.85;
}
.hm-filters {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--divider-soft);
  border-radius: var(--r-sm);
  padding: 2px;
}
.hm-filter-btn {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--r-xs);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all var(--ease-fast);
}
.hm-filter-btn.active {
  background: var(--bg-highlight);
  color: var(--text-primary);
}
.hm-sort-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--divider-soft);
  border-radius: var(--r-sm);
  padding: 2px 6px;
}
.hm-sort-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.hm-sort-btn {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all var(--ease-fast);
}
.hm-sort-btn.active {
  background: var(--bg-highlight);
  color: var(--text-primary);
}

/* ─── Shortcut Link & Layout Density Styles ─── */
.shortcut-link-btn {
  background: transparent;
  border: none;
  color: var(--cta);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0;
  transition: color var(--ease-fast);
}
.shortcut-link-btn:hover {
  color: var(--cta-hover);
}
.top-sectors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Density overrides for right-hand panel items */
.right-panel {
  gap: 16px !important;
}
.scan-scope-card {
  padding: 10px 14px !important;
}

/* ─── Compact Mobile Navigation Overrides ─── */
@media (max-width: 680px) {
  .bottom-nav {
    padding: 0 8px !important;
  }
  .tab-btn {
    padding: 10px 8px !important;
    position: relative;
  }
  .tab-btn .tab-text {
    display: none; /* Hide tab labels on small screen */
  }
  /* Show CSS tooltip on hover */
  .tab-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-tooltip, #1e293b);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--r-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--ease-fast);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--divider-soft);
  }
  .tab-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ── SSO & Manual Credential Buttons ── */
.bm-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent); /* Electric blue/green depending on theme */
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
  width: 100%;
}
.bm-oauth-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.bm-oauth-btn:active {
  transform: translateY(0);
}

.bm-manual-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  padding: 8px;
  transition: color var(--ease-fast);
}
.bm-manual-toggle:hover {
  color: var(--text-base);
}
.bm-manual-toggle .chevron {
  margin-left: 6px;
  transition: transform var(--ease-fast);
}








