/* ═══════════════════════════════════════════════════════════════════════════
   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;
  /* Native App Feel */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Re-enable text selection in inputs */
input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
}

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;
  /* Safe area padding for notches */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* Prevent pull-to-refresh */
  overscroll-behavior-y: none;
  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; }

/* ─── 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;
}

.mobile-dl-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 icon color */
.sb-item.active .sb-icon,
.sb-item.q-active .sb-icon {
  color: var(--cta) !important;
}
/* 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: var(--cta-light) !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;
}



/* ─── Main Content ────────────────────────────────────────────────────────── */
.main-content, .panel-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) ~ .workspace-layout .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);
}

/* 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;
}
.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;
}
@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: 4px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all var(--ease-med);
}
.market-status-dot { width: 6px; height: 6px; border-radius: 50%; transition: background var(--ease-med); }
.market-status-badge.live     { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); color: #10B981; }
.market-status-badge.live .market-status-dot { animation: pulse-dot 1.5s ease-in-out infinite; }
.market-status-badge.closed   { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: #F59E0B; }
.market-status-badge.error    { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: #EF4444; }

/* 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;
}

/* ─── 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;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.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-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; }

/* ── Tab Filter Button & Dropdown ────────────────────────────────────────── */
.tab-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 8px;
}
.tab-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--divider);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: var(--font-body);
}
.tab-filter-btn:hover {
  border-color: var(--accent-q);
  color: var(--accent-q);
  background: rgba(var(--accent-q-rgb), 0.08);
}
.tab-filter-btn.active {
  background: rgba(var(--accent-q-rgb), 0.15);
  border-color: var(--accent-q);
  color: var(--accent-q);
  box-shadow: 0 0 8px rgba(var(--accent-q-rgb), 0.2);
}
.tab-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent-q);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}
.tab-filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: var(--r-md, 10px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.18);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tab-filter-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.tfd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--divider);
}
.tfd-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tfd-clear {
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.tfd-clear:hover { color: var(--accent-q); background: rgba(var(--accent-q-rgb), 0.08); }
.tfd-items { padding: 6px 0; }
.tfd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.tfd-item:hover { background: rgba(var(--accent-q-rgb), 0.07); }
.tfd-item.checked { background: rgba(var(--accent-q-rgb), 0.1); }
.tfd-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--divider);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.tfd-item.checked .tfd-checkbox {
  background: var(--accent-q);
  border-color: var(--accent-q);
  box-shadow: 0 0 6px rgba(var(--accent-q-rgb), 0.4);
}
.tfd-checkbox-check { display: none; }
.tfd-item.checked .tfd-checkbox-check { display: block; }
.tfd-item-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.tfd-item.checked .tfd-item-label { color: var(--accent-q); }
[data-theme="light"] .tab-filter-btn { background: #f4f4f8; border-color: #e2e2ea; color: #555; }
[data-theme="light"] .tab-filter-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,0.15); background: #fff; }
[data-theme="light"] .tfd-item:hover { background: rgba(var(--accent-q-rgb), 0.05); }

/* ─── 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: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-deep);
  position: relative;
}

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

/* Signal table — terminal grade */
.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: 7px 12px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}
.signal-table thead th:last-child { text-align: center !important; border-right: none; }

/* 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 — 6-column terminal layout */
.col-asset    { padding: 10px 14px 10px 20px; width: 22%; text-align: left; }
.col-strategy { padding: 10px 12px; width: 22%; text-align: center; border-left: 1px solid rgba(255,255,255,0.04); }
.col-entry    { padding: 10px 12px; width: 12%; text-align: center; border-left: 1px solid rgba(255,255,255,0.04); }
.col-hl       { padding: 10px 12px; width: 14%; text-align: center; border-left: 1px solid rgba(255,255,255,0.04); }
.col-move     { padding: 10px 12px; width: 14%; text-align: center; border-left: 1px solid rgba(255,255,255,0.04); }
.col-action   { padding: 10px 12px; width: 16%; text-align: center; border-left: 1px solid rgba(255,255,255,0.04); }

.signal-table tbody td:not(.col-asset) { text-align: center !important; }
.signal-table tbody td.col-asset { text-align: left !important; }
.asset-inner  { display: flex; align-items: center; justify-content: flex-start; gap: 8px; text-align: left; }
.strategy-meta { justify-content: center; }
.hl-cell > div { align-items: center !important; justify-content: center; }

.severity-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-q);
  flex-shrink: 0;
  margin-top: 0;
  box-shadow: 0 0 5px rgba(var(--accent-q-rgb), 0.8);
}
.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 5px rgba(var(--accent-q-rgb), 0.8); }
  50% { transform: scale(1.6); box-shadow: 0 0 12px rgba(var(--accent-q-rgb), 1); }
}

.asset-ticker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.asset-exchange {
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255,255,255,0.08);
}
.asset-sector {
  display: inline-flex;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.strategy-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-q);
  background: rgba(var(--accent-q-rgb), 0.08);
  border: 1px solid rgba(var(--accent-q-rgb), 0.2);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  margin-bottom: 5px;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}
.strategy-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.strategy-time-ago {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Volume badge */
.volume-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ─── Entry Price Column ─── */
.entry-price-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.entry-price-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0.6;
  font-family: var(--font-mono);
}

.entry-price-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ─── High / Low Column — NEUTRAL, no P&L color ─── */
.hl-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hl-cell-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0.6;
}

.hl-cell-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ─── Move % Column ─── */
.move-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease;
}

.move-chip-pos {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.move-chip-neg {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.move-chip-neutral {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Signal row — tighter, terminal feel */
.signal-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  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: 2px;
  background: var(--accent-q);
  opacity: 0;
  transition: opacity var(--ease-fast);
  box-shadow: 0 0 6px rgba(var(--accent-q-rgb), 0.5);
}
.signal-row:hover { background: rgba(255,255,255,0.025); }
.signal-row:hover td:first-child::before { opacity: 0.7; }

.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; }


.analyze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--cta);
  border: 1px solid var(--cta);
  border-radius: var(--r-sm);
  color: #000000;
  box-shadow: 0 0 8px rgba(var(--cta-rgb), 0.4);
  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);
  box-shadow: none;
}

/* 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; }

/* ─── 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;
  padding-bottom: 64px;
}

.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; }

/* 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; }

/* ─── 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;
}

/* ─── 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; }
.ppc-upgrade-btn .cut-price {
  color: rgba(5,46,34,0.65);
  margin-left: 4px;
}

/* ─── Send Meeting Modal ─────────────────────────────────────────────────── */
.send-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.send-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
.send-shell {
  width: min(760px, 100%);
  min-height: 430px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 18, 33, 0.98);
  box-shadow: 0 40px 120px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: auth-pop 0.42s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.send-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(155deg, rgba(16,185,129,0.18), rgba(8,16,31,0.98) 58%, rgba(59,130,246,0.12));
}
.send-hero-mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(160deg, #000, transparent 82%);
  opacity: 0.6;
}
.send-kicker,
.send-recipient {
  position: relative;
  z-index: 1;
}
.send-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(16,185,129,0.28);
  background: rgba(16,185,129,0.08);
  color: #9FF4C9;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}
.send-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 12px rgba(16,185,129,0.8);
}
.send-recipient {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 72px;
}
.send-recipient-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #10B981, #2563EB);
  box-shadow: 0 14px 34px rgba(16,185,129,0.25);
  flex-shrink: 0;
}
.send-recipient-label {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.send-recipient-name {
  max-width: 170px;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.send-recipient-phone {
  margin-top: 6px;
  color: rgba(255,255,255,0.68);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.send-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px;
  background: rgba(12, 18, 33, 0.98);
}
.send-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.send-close-btn:hover {
  color: var(--text-primary);
  border-color: rgba(16,185,129,0.35);
}
.send-form-head {
  padding-right: 34px;
}
.send-form-head h2 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 850;
  font-family: var(--font-display);
}
.send-form-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}
.send-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.send-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}
.send-control-wrap {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1.5px solid var(--divider);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.send-control-wrap:focus-within {
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.send-control {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.86rem;
}
.send-control::placeholder {
  color: var(--text-muted);
}
.send-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 12px;
}
.send-time-input {
  font-family: var(--font-mono);
}
.send-modal-status {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
}
.send-modal-status.error { color: var(--danger); }
.send-modal-status.success { color: var(--cta); }
.send-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}
.send-secondary-btn,
.send-submit-btn {
  min-height: 44px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}
.send-secondary-btn {
  flex: 0 0 120px;
  border: 1px solid var(--divider);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.send-submit-btn {
  flex: 1;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 10px 30px rgba(16,185,129,0.28);
}
.send-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(16,185,129,0.38);
}
.send-submit-btn:disabled,
.send-secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

[data-theme="light"] .send-shell,
[data-theme="light"] .send-form {
  background: #fff;
}
[data-theme="light"] .send-control-wrap,
[data-theme="light"] .send-close-btn,
[data-theme="light"] .send-secondary-btn {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

@media (max-width: 720px) {
  .send-shell {
    max-width: 420px;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .send-hero {
    min-height: 170px;
    padding: 22px;
  }
  .send-recipient {
    padding-top: 38px;
  }
  .send-form {
    padding: 24px;
  }
  .send-field-grid {
    grid-template-columns: 1fr;
  }
  .send-actions {
    flex-direction: column;
  }
  .send-secondary-btn {
    flex-basis: auto;
  }
}

/* ─── 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;
  display: flex;
  align-items: center;
}
.footer-live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--cta);
  border-radius: 50%;
  margin: 0 5px;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ─── 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); }
}

/* ─── Mobile Sidebar Overlay & Button ────────────────────────────────────────── */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 299;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-sidebar-open .mobile-sidebar-overlay {
  display: block;
  opacity: 1;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn:hover { color: var(--text-primary); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */





    /* Drag handle indicator */
    padding-top: 18px;
    position: relative;
  }
  .drawer-topbar::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--divider);
  }
}



@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; }

/* ─── 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"] .modal-card         { background: #FFFFFF; }
/* ═══════════════════════════════════════════════════════════════════════════
   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; }

/* ─── 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); }

/* ═══ 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"] .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);
  }
}


/* ═══════════════════════════════════════════════════════════════
   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);
}


/* ═══════════════════════════════════════════════════════════════
   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);
}


/* ═══════════════════════════════════════════════════════════════
   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;
}




/* ═══════════════════════════════════════════════════════════════
   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;
}

/* ─── Sector Heatmap Styles ─── */
.hm-summary-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-elevated); border-bottom: 1px solid var(--divider);
  padding: 8px 16px; overflow-x: auto; min-height: 52px; flex-shrink: 0;
}
.hm-summary-block { display: flex; flex-direction: column; gap: 3px; min-width: 125px; padding: 0 16px; flex-shrink: 0; justify-content: center; }
.hm-summary-block:first-child { padding-left: 0; }
.hm-summary-divider { width: 1px; height: 28px; background: var(--divider); flex-shrink: 0; }
.hm-summary-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.hm-adv-count { font-size: 0.75rem; font-weight: 700; color: var(--cta); white-space: nowrap; }
.hm-dec-count { font-size: 0.75rem; font-weight: 700; color: #F87171; white-space: nowrap; }

.hm-top-chip { font-size: 0.7rem; font-weight: 700; font-family: var(--font-mono); padding: 3px 8px; border-radius: var(--r-xs); display: inline-block; }
.hm-top-chip.up { color: var(--cta-light); background: var(--cta-dim); }
.hm-top-chip.down { color: #F87171; background: var(--red-dim); }
.hm-top-chip.neu { color: var(--text-muted); background: var(--bg-surface); }
.hm-live-count { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
.hm-avg-change { font-size: 0.8rem; font-weight: 800; font-family: var(--font-mono); }
.hm-avg-change.up { color: var(--cta); }
.hm-avg-change.down { color: #F87171; }
.hm-spread-val { font-size: 0.8rem; font-weight: 800; font-family: var(--font-mono); color: #f59e0b; }
.hm-spread-sub { font-size: 0.55rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
/* Grid */
.heatmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; padding: 16px 0; }

/* Cards */
@keyframes hm-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.heatmap-card {
  background: var(--bg-elevated); border: 1px solid var(--divider);
  border-left: 3px solid var(--divider); border-radius: var(--r-md);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: hm-card-in 0.4s ease both;
  position: relative; overflow: hidden;
}
.heatmap-card.hm-card-ready { animation: none; }
.heatmap-card:hover { transform: translateY(-2px); border-color: var(--cta); box-shadow: 0 4px 20px rgba(16,185,129,0.15) !important; }

/* Top gainer glow */
@keyframes top-gainer-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); } 50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); } }
.heatmap-card.top-gainer { border-left-color: var(--cta) !important; animation: top-gainer-pulse 2s ease-in-out infinite; }

/* Card Header */
.hm-card-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.hm-card-name { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: flex; align-items: center; gap: 5px; min-width: 0; }
.hm-card-name i { flex-shrink: 0; color: var(--cta); }

/* Price */
.hm-card-price { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); transition: color 0.3s ease; line-height: 1.2; }
.hm-card-price.flash-up { animation: val-flash-up 0.5s ease; }
.hm-card-price.flash-down { animation: val-flash-down 0.5s ease; }

/* Chip */
.hm-card-change { font-size: 0.62rem; font-weight: 700; padding: 2px 5px; border-radius: var(--r-xs); font-family: var(--font-mono); white-space: nowrap; }
.hm-card-change.up { color: var(--cta-light); background: var(--cta-dim); }
.hm-card-change.down { color: #F87171; background: var(--red-dim); }
.hm-card-change.neu { color: var(--text-muted); background: var(--bg-surface); }

/* Sentiment */
.hm-card-sentiment { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sentiment-strong-buy  { color: #10b981; }
.sentiment-buy         { color: #34d399; }
.sentiment-neutral     { color: var(--text-muted); }
.sentiment-sell        { color: #f87171; }
.sentiment-strong-sell { color: #ef4444; }

/* Sparkline */
.hm-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 2px; }
.hm-spark-bar { flex: 1; border-radius: 1px; min-height: 3px; transition: height 0.4s ease, background 0.3s ease; background: var(--divider); }
.hm-spark-bar.up { background: rgba(16,185,129,0.35); }
.hm-spark-bar.down { background: rgba(239,68,68,0.35); }
.hm-spark-bar.active.up { background: var(--cta); }
.hm-spark-bar.active.down { background: #ef4444; }

/* Progress bar */
.hm-card-bar { height: 3px; border-radius: 2px; background: var(--divider); overflow: hidden; }
.hm-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease, background 0.4s ease; }

/* ─── 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;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERT CENTER v2
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper */
.ac2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
}

/* User Profile Banner at top of Alert Center */
.ac2-user-banner {
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  height: var(--header-h);
  min-height: var(--header-h);
  flex-shrink: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.ac2-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ac2-user-greeting {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}
.ac2-user-name {
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ac2-stage-pill {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  font-family: var(--font-mono) !important;
  padding: 2px 7px !important;
  border-radius: var(--r-xs) !important;
  display: inline-flex !important;
  align-items: center !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  margin-left: 2px;
}
.ac2-stage-pill.stage-fresh {
  color: var(--text-muted) !important;
  background: var(--divider) !important;
}
.ac2-stage-pill.stage-trial {
  color: var(--cta-light) !important;
  background: var(--cta-dim) !important;
}
.ac2-stage-pill.stage-paid {
  color: #ffffff !important;
  background: var(--emerald) !important;
  font-weight: 800 !important;
  box-shadow: 0 0 8px var(--emerald-glow);
}
.ac2-stage-pill.stage-expired {
  color: var(--red) !important;
  background: var(--red-dim) !important;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
.ac2-header {
  height: var(--tab-h);
  min-height: var(--tab-h);
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--divider);
}
.ac2-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
}
.ac2-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

/* Settings Button */
.ac2-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.ac2-settings-btn:hover {
  color: var(--text-primary);
  background: var(--bg-highlight);
}
.ac2-settings-btn.active {
  color: var(--cta-light);
  background: var(--cta-dim);
}

/* Status pill */
.ac2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: all 0.3s ease;
}
.ac2-status-pill.live {
  background: var(--cta-dim);
  border-color: rgba(16,185,129,0.25);
  color: var(--cta);
}
.ac2-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s ease;
}
.ac2-status-pill.live .ac2-status-dot {
  background: var(--cta);
  animation: dot-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 5px rgba(16,185,129,0.6);
}

/* ─── Connection Card ─────────────────────────────────────────────────────── */
.ac2-card {
  margin: 12px 12px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  display: block; /* Visible by default */
}
.ac2-card:not(.is-connected) {
  border-color: rgba(41,182,246,0.2);
  box-shadow: 0 0 20px rgba(41,182,246,0.06);
  animation: ac2-card-pulse 4s ease-in-out infinite;
}
@keyframes ac2-card-pulse {
  0%,100% { box-shadow: 0 0 16px rgba(41,182,246,0.04); }
  50%      { box-shadow: 0 0 32px rgba(41,182,246,0.12); }
}
.ac2-card.is-connected {
  border-color: rgba(16,185,129,0.3);
  box-shadow: 0 0 24px rgba(16,185,129,0.08);
}

/* Disconnected layout */
.ac2-disconnected {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ac2-card.is-connected .ac2-disconnected { display: none; }
.ac2-card.is-connected .ac2-connected    { display: flex; }

/* Brand row */
.ac2-tg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ac2-tg-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(41,182,246,0.12);
  color: #29B6F6;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(41,182,246,0.2);
}
.ac2-card-headline {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.ac2-card-sub {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Steps */
.ac2-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
}
.ac2-step:not(.ac2-step--last)::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: -10px;
  width: 1px;
  background: var(--divider);
}
.ac2-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-mono);
  z-index: 1;
  position: relative;
}
.ac2-step-num--done {
  background: var(--cta-dim);
  border-color: rgba(16,185,129,0.25);
  color: var(--cta);
}
.ac2-step-body {
  flex: 1;
  padding-top: 2px;
}
.ac2-step-label {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ac2-step-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Code row */
.ac2-code-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-deep);
  border: 1px solid var(--divider);
  border-radius: 8px;
  overflow: hidden;
}
.ac2-code {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
}
.ac2-copy-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border-left: 1px solid var(--divider);
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.ac2-copy-btn:hover { background: var(--bg-highlight); color: var(--text-primary); }
.ac2-copy-btn.copied { color: var(--cta); }

/* Connect button */
.ac2-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px 10px;
  background: #29B6F6;
  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 #1084b6;
  border-radius: 8px;
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(41,182,246,0.3);
  width: 100%;
  justify-content: center;
}
.ac2-connect-btn:hover {
  background: #1EA8E0;
  box-shadow: 0 6px 20px rgba(41,182,246,0.45);
  transform: translateY(-1px);
  border-bottom-width: 4px;
}
.ac2-connect-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

/* Connected state — one-liner */
.ac2-connected {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
}
/* Connected state — clean modern one-liner */
.ac2-connected {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(41, 182, 246, 0.05);
  border: 1px solid rgba(41, 182, 246, 0.18);
  border-radius: 8px;
  overflow: visible;
}
.ac2-conn-check-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transform-origin: center;
  animation: ac2CheckPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.ac2-check-stroke {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: ac2CheckDraw 0.45s cubic-bezier(0.65, 0, 0.45, 1) 0.15s forwards;
}
@keyframes ac2CheckPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  65% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes ac2CheckDraw {
  0% {
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
.ac2-conn-text {
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ac2-bot-pill {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(41, 182, 246, 0.12);
  color: #29B6F6;
  border: 1px solid rgba(41, 182, 246, 0.25);
  line-height: 1.1;
  text-transform: uppercase;
}
.ac2-conn-tg-ico {
  color: #29B6F6;
  flex-shrink: 0;
  animation: ac2TgFloat 3s ease-in-out infinite;
}
@keyframes ac2TgFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-1.5px) rotate(-4deg); }
}

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.ac2-divider {
  height: 1px;
  background: var(--divider);
  margin: 14px 0 0;
  display: none;
}
.ac2-divider.settings-open {
  display: block !important;
}

/* ─── Telegram icon + broadcast wave wrapper ──────────────────────────────── */
.ac2-conn-tg-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  overflow: visible;
}

/* Wave SVG — standard wifi arcs rotated 45deg to point top-right */
.ac2-conn-wave {
  position: absolute;
  /* Telegram icon is a 15x15px circle. Its center is at (7.5, 7.5).
     Our wifi SVG is 40x40px, and its arc origin is at its exact center (20, 20).
     To make the arcs perfectly concentric with the Telegram circle,
     we align their centers:
     left = 7.5 - 20 = -12.5px
     top = 7.5 - 20 = -12.5px */
  width: 40px;
  height: 40px;
  left: -12.5px;
  top: -12.5px;
  pointer-events: none;
  /* Rotate 45deg around the arc origin (20, 20) */
  transform-origin: 20px 20px;
  transform: rotate(45deg);
  overflow: visible;
}

.ac2-conn-wave path {
  animation: ac2WifiBroadcast 1.5s ease-out infinite;
  opacity: 0;
}

.ac2-conn-wave .ac2-wave1 { animation-delay: 0s; }
.ac2-conn-wave .ac2-wave2 { animation-delay: 0.25s; }
.ac2-conn-wave .ac2-wave3 { animation-delay: 0.5s; }
.ac2-conn-wave .ac2-wave4 { animation-delay: 0.75s; }

@keyframes ac2WifiBroadcast {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ─── Signal Channels ─────────────────────────────────────────────────────── */
.ac2-channels {
  padding: 12px 14px;
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 10px;
}
.ac2-channels.settings-open {
  display: flex !important;
}
.ac2-channels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ac2-channels-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ac2-rt-pill {
  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;
}
.ac2-rt-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cta);
  animation: dot-pulse 2s ease-in-out infinite;
}

/* Channel rows */
.ac2-channel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ac2-channel-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}
.ac2-channel-row:hover { background: var(--bg-highlight); }

.ac2-ch-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ac2-ch-icon--green  { background: var(--cta-dim);   color: var(--cta); }
.ac2-ch-icon--cta    { background: var(--cta-dim);       color: var(--cta-light); }

.ac2-ch-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ac2-ch-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}
.ac2-ch-meta {
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* Custom toggle */
.ac2-ch-toggle {
  flex-shrink: 0;
  position: relative;
}
.ac2-ch-toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.ac2-toggle-track {
  display: flex;
  align-items: center;
  width: 34px; height: 18px;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.ac2-ch-toggle input:checked + .ac2-toggle-track {
  background: var(--cta);
  border-color: var(--cta);
}
.ac2-toggle-thumb {
  position: absolute;
  left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ac2-ch-toggle input:checked + .ac2-toggle-track .ac2-toggle-thumb {
  transform: translateX(16px);
  background: #fff;
}

/* Save button */
.ac2-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 10px;
  width: 100%;
  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.15);
  border-bottom: 3px solid var(--divider);
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ac2-save-btn:hover {
  background: var(--bg-highlight);
  border-color: var(--cta);
  color: var(--cta-light);
  border-bottom-width: 4px;
  transform: translateY(-1px);
}
.ac2-save-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}
.ac2-save-btn.saved {
  background: var(--cta-dim);
  border-color: rgba(16,185,129,0.3);
  color: var(--cta);
}

/* ─── Light Theme Overrides ───────────────────────────────────────────────── */
[data-theme="light"] .ac2-card        { background: #fff; }
[data-theme="light"] .ac2-code-row    { background: #F5F7FF; }
[data-theme="light"] .ac2-tg-icon     { background: rgba(41,182,246,0.08); }
[data-theme="light"] .ac2-toggle-track { background: #E2E8F0; border-color: #CBD5E1; }
[data-theme="light"] .ac2-channel-row:hover { background: #F1F5FB; }
[data-theme="light"] .ac2-save-btn    { background: #F5F7FF; }
[data-theme="light"] .ac2-status-pill { background: #F1F5FB; border-color: #D1DCF0; }
[data-theme="light"] .ac2-step-num    { background: #EEF2FB; border-color: #D0DCF0; }


/* ─── CRM Leads Table Overhaul ────────────────────────────────────────────── */
.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  table-layout: fixed;
  padding: 0 20px;
}
.crm-table thead th {
  padding: 10px 15px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--divider);
}
.crm-table thead th:last-child {
  text-align: center;
}

.crm-row td {
  padding: 14px 15px;
  background: var(--bg-surface);
  border-top: 1px solid var(--divider-soft);
  border-bottom: 1px solid var(--divider-soft);
  transition: all 0.3s ease;
}
.crm-row td:first-child {
  border-left: 1px solid var(--divider-soft);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}
.crm-row td:last-child {
  border-right: 1px solid var(--divider-soft);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  text-align: center;
}

.crm-row:hover td {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  border-color: var(--divider);
}

/* We have to apply box-shadow carefully on rows with separate borders. */
.crm-row:hover td {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Columns */
.crm-col-stage { width: 15%; }
.crm-col-agent { width: 15%; }
.crm-col-action { width: 5%; }
/* Fresh Tab Layout Overrides */
.crm-table-fresh {
  table-layout: auto;
}
.crm-table-fresh th {
  white-space: nowrap;
}
.crm-table-fresh .crm-col-id { width: 1%; white-space: nowrap; }
.crm-table-fresh .crm-col-phone { white-space: nowrap; }
.crm-table-fresh .crm-col-added { white-space: nowrap; }
.crm-table-fresh .crm-col-action { width: 1%; white-space: nowrap; }

.crm-table-fresh .crm-row td {
  padding: 10px 8px; /* Slightly tighter padding for 8 columns */
  vertical-align: middle;
}
.crm-table-fresh .crm-lead-cell {
  gap: 8px; /* Tighter gap */
}

/* Lead Cell */
.crm-lead-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

[data-theme="light"] .crm-row td {
  background: #fff;
  border-color: #E2E8F0;
}
[data-theme="light"] .crm-row:hover td {
  background: #F8FAFC;
  border-color: var(--accent-q);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* CRM Form Controls */
.crm-input {
  width: 100%;
  min-width: 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.crm-input.mono {
  font-family: var(--font-mono);
}
.crm-input:hover, .crm-input:focus {
  border-color: var(--accent-q);
  box-shadow: 0 0 0 2px rgba(var(--accent-q-rgb), 0.15);
}
.crm-select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 120px;
}
.crm-select:hover, .crm-select:focus {
  border-color: var(--accent-q);
  box-shadow: 0 0 0 2px rgba(var(--accent-q-rgb), 0.15);
}

.crm-send-btn {
  background: rgba(var(--accent-q-rgb), 0.1);
  color: var(--accent-q);
  border: 1px solid var(--accent-q);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
}
.crm-send-btn:hover {
  background: var(--accent-q);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--accent-q-rgb), 0.3);
}

[data-theme="light"] .crm-input,
[data-theme="light"] .crm-select {
  background: #fff;
  border-color: #CBD5E1;
}

/* Registry Contacts */
.tab-search-wrap {
  height: 30px;
  width: 160px;
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 7px;
  padding: 0 10px;
  margin-right: 8px;
  border: 1px solid var(--divider);
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex-shrink: 0;
}
.tab-search-wrap:focus-within {
  border-color: var(--accent-q);
  box-shadow: 0 0 0 2px rgba(var(--accent-q-rgb), 0.15);
}
.tab-search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-family: var(--font-body);
}
.tab-search-wrap input::placeholder {
  color: var(--text-muted);
}
.registry-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-right: 10px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.registry-status.success { color: var(--cta); }
.registry-status.error { color: var(--danger); }
.registry-table .crm-col-id { width: 1%; white-space: nowrap; }
.registry-table .crm-col-name { min-width: 190px; }
.registry-table .crm-col-phone { min-width: 130px; }
.registry-table .crm-col-added { min-width: 110px; }
.registry-table .crm-col-stage { min-width: 130px; }
.registry-table .crm-col-action { width: 1%; white-space: nowrap; }
.registry-name-cell {
  gap: 0;
}
.registry-phone-text {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.registry-row.is-saving td {
  opacity: 0.72;
}

[data-theme="light"] .tab-search-wrap {
  background: #fff;
  border-color: #CBD5E1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH MODAL — Premium Split-Panel Login / Register
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-backdrop {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4, 5, 10, 0.75); /* Lowered from 0.94 so dashboard is visible */
  pointer-events: all;
}
.auth-backdrop.hidden { opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }

/* ── Shell: two-column card ─────────────────────────────────────────────── */
.auth-shell {
  display: flex;
  width: 100%; max-width: 860px;
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06);
  animation: auth-pop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes auth-pop {
  from { opacity:0; transform: scale(0.9) translateY(24px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

/* ── LEFT: Hero Panel ────────────────────────────────────────────────────── */
.auth-hero {
  position: relative;
  flex: 1.1;
  background: linear-gradient(145deg, #050812 0%, #0a1628 40%, #091420 100%);
  overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 36px;
}

/* Animated orbs */
.auth-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: auth-orb-drift 8s ease-in-out infinite;
}
.auth-orb-1 { width: 280px; height: 280px; background: radial-gradient(circle, #10B981 0%, transparent 70%); top: -60px; left: -60px; animation-duration: 9s; }
.auth-orb-2 { width: 200px; height: 200px; background: radial-gradient(circle, #3B82F6 0%, transparent 70%); top: 30%; right: -40px; animation-duration: 11s; animation-delay: -3s; }
.auth-orb-3 { width: 160px; height: 160px; background: radial-gradient(circle, #8B5CF6 0%, transparent 70%); bottom: 20%; left: 30%; animation-duration: 13s; animation-delay: -6s; }
@keyframes auth-orb-drift {
  0%,100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(20px, -30px) scale(1.08); }
  66%  { transform: translate(-15px, 20px) scale(0.95); }
}

/* Grid mesh overlay */
.auth-hero-mesh {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,185,129,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
}

/* Floating stat cards */
.auth-float-card {
  position: absolute;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 10px 14px;
  animation: auth-float 6s ease-in-out infinite;
}
.auth-fc-1 { top: 24px; left: 24px; animation-delay: 0s; }
.auth-fc-2 { top: 24px; right: 24px; animation-delay: -2s; }
.auth-fc-3 { top: 100px; right: 20px; animation-delay: -4s; }
@keyframes auth-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
.auth-fc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; animation: auth-pulse-dot 2s ease-in-out infinite; }
@keyframes auth-pulse-dot { 0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,0.4)} 50%{box-shadow:0 0 0 5px rgba(255,255,255,0)} }
.auth-fc-val { font-size: 0.88rem; font-weight: 800; color: #fff; font-family: var(--font-display); line-height: 1.2; }
.auth-fc-label { font-size: 0.63rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* Hero content */
.auth-hero-content { position: relative; z-index: 2; }
.auth-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  color: #10B981;
  margin-bottom: 16px;
}
.auth-hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10B981;
  animation: auth-pulse-dot 1.5s ease-in-out infinite;
}
.auth-hero-title {
  font-family: var(--font-display);
  font-size: 2.1rem; font-weight: 900; line-height: 1.1;
  color: #fff; margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.auth-hero-accent {
  background: linear-gradient(90deg, #10B981, #3B82F6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-hero-desc {
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
  line-height: 1.6; margin-bottom: 20px; max-width: 280px;
}
.auth-hero-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.auth-hf-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: rgba(255,255,255,0.7);
}
.auth-hf-item svg { color: #10B981; flex-shrink: 0; }

/* Avatar stack */
.auth-hero-users { display: flex; align-items: center; gap: 10px; }
.auth-avatar-stack { display: flex; }
.auth-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff;
  border: 2px solid rgba(10,20,40,0.8);
  margin-left: -6px;
}
.auth-av:first-child { margin-left: 0; }
.auth-hero-user-text { font-size: 0.73rem; color: rgba(255,255,255,0.55); }
.auth-hero-user-text strong { color: #fff; }

/* ── RIGHT: Form Panel ────────────────────────────────────────────────────── */
.auth-form-panel {
  flex: 1;
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 36px;
  border-left: 1px solid rgba(255,255,255,0.06);
}
.auth-form-inner { width: 100%; max-width: 320px; }

/* Logo row */
.auth-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-form-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.auth-form-brand { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--text-primary); }

.auth-form-title {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-form-sub {
  font-size: 0.75rem; color: var(--text-muted);
  line-height: 1.5; margin-bottom: 24px;
}

/* Field label */
.auth-field-label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px; letter-spacing: 0.02em;
}

/* Input */
.auth-input-wrap {
  display: flex; align-items: center;
  background: var(--bg-elevated);
  border: 1.5px solid var(--divider);
  border-radius: 10px; overflow: hidden;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input-wrap:focus-within {
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.auth-input-prefix {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px 0 14px;
  font-size: 0.83rem; font-weight: 600; color: var(--text-secondary);
  border-right: 1px solid var(--divider); height: 46px;
  white-space: nowrap; flex-shrink: 0;
}
.auth-input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 0 14px; height: 46px;
  font-size: 0.88rem; font-family: var(--font-body);
  color: var(--text-primary); letter-spacing: 0.01em;
}
.auth-input::placeholder { color: var(--text-muted); }

/* Trust row */
.auth-trust-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.65rem; color: var(--text-muted);
  margin-top: 10px;
}

/* CTA button */
.auth-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none; border-radius: 10px;
  color: #fff; font-size: 0.875rem; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
  letter-spacing: 0.01em; margin-top: 4px;
  position: relative; overflow: hidden;
}
.auth-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(16,185,129,0.5); }
.auth-btn:hover::before { opacity: 1; }
.auth-btn:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(16,185,129,0.25); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* WhatsApp button */
.auth-btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
}
.auth-btn-whatsapp:hover { box-shadow: 0 8px 28px rgba(37,211,102,0.5); }

/* WhatsApp card */
.auth-wa-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(37,211,102,0.07), rgba(18,140,126,0.04));
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: 12px; padding: 16px;
  margin-bottom: 16px;
}
.auth-wa-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(37,211,102,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-wa-title { font-size: 0.83rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.auth-wa-sub { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
.auth-wa-sub strong { color: var(--cta); }

/* OTP heading */
.auth-otp-heading {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.auth-otp-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--cta); flex-shrink: 0;
}
.auth-otp-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.auth-otp-hint { font-size: 0.72rem; color: var(--text-muted); margin: 0; }

/* OTP grid */
.auth-otp-grid {
  display: flex; gap: 10px; justify-content: center;
  margin-bottom: 16px;
}
.auth-otp-box {
  width: 62px; height: 68px;
  background: var(--bg-elevated);
  border: 2px solid var(--divider);
  border-radius: 14px;
  text-align: center;
  font-size: 1.7rem; font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
  caret-color: var(--cta);
}
.auth-otp-box:focus {
  border-color: var(--cta);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
  transform: scale(1.05);
  background: rgba(16,185,129,0.04);
}
.auth-otp-box.filled { border-color: var(--cta); background: rgba(16,185,129,0.06); }
.auth-otp-box.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
  animation: auth-shake 0.4s ease;
}
@keyframes auth-shake {
  0%,100%{transform:translateX(0)}
  20%,60%{transform:translateX(-5px)}
  40%,80%{transform:translateX(5px)}
}

/* Error message */
.auth-error-msg {
  font-size: 0.72rem; color: #EF4444;
  text-align: center; margin-bottom: 12px;
  padding: 7px 12px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 8px;
}

/* Change Number — green pill */
.auth-back-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,0.12);
  border: 1.5px solid rgba(16,185,129,0.3);
  color: var(--cta);
  font-size: 0.71rem; font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
  letter-spacing: 0.01em;
}
.auth-back-pill:hover {
  background: rgba(16,185,129,0.2);
  border-color: var(--cta);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16,185,129,0.18);
}
.auth-back-pill:active { transform: translateY(0); }

/* OTP actions row (resend / send passcode) */
.auth-otp-actions {
  margin-top: 12px;
  text-align: center;
  min-height: 28px;
}
.auth-link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-size: 0.73rem; font-weight: 600;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-link-btn:hover { color: var(--cta); background: rgba(16,185,129,0.07); }
.auth-link-btn:disabled { opacity: 0.45; cursor: not-allowed; text-decoration: none; }
.auth-link-btn--wa { color: #25D366; }
.auth-link-btn--wa:hover { color: #1aaf55; background: rgba(37,211,102,0.08); }

/* Cooldown timer text */
#auth-resend-timer, #auth-existing-timer {
  display: inline-block;
  font-size: 0.72rem; color: var(--cta);
  font-weight: 600;
}

/* Profile step header */
.auth-profile-header { text-align: center; margin-bottom: 20px; }
.auth-profile-emoji { font-size: 2rem; margin-bottom: 8px; }
.auth-profile-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.auth-profile-sub { font-size: 0.73rem; color: var(--text-muted); line-height: 1.5; }

/* Steps */
.auth-step { display: none; }
.auth-step.active { display: block; animation: auth-step-in 0.3s ease; }
@keyframes auth-step-in {
  from { opacity:0; transform: translateX(16px); }
  to   { opacity:1; transform: translateX(0); }
}

/* Success step */
.auth-success-step { text-align: center; padding: 10px 0 20px; }
.auth-success-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(16,185,129,0.08);
  border: 2px solid rgba(16,185,129,0.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  animation: auth-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.auth-success-ring::before {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(16,185,129,0.15);
  animation: auth-ring-expand 1.5s ease-out infinite;
}
@keyframes auth-ring-expand {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(1.4); opacity: 0; }
}
.auth-success-check { color: var(--cta); }
@keyframes auth-success-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.auth-success-name { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.auth-success-sub { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 20px; }
.auth-success-bars {
  display: flex; gap: 4px; align-items: flex-end;
  justify-content: center; height: 24px;
}
.auth-bar {
  width: 6px; border-radius: 3px;
  background: var(--cta);
  animation: auth-bar-dance 1s ease-in-out infinite;
}
.auth-bar:nth-child(1){height:40%;animation-delay:0s}
.auth-bar:nth-child(2){height:70%;animation-delay:.1s}
.auth-bar:nth-child(3){height:100%;animation-delay:.2s}
.auth-bar:nth-child(4){height:60%;animation-delay:.3s}
.auth-bar:nth-child(5){height:30%;animation-delay:.4s}
@keyframes auth-bar-dance {
  0%,100%{transform:scaleY(1);opacity:1}
  50%{transform:scaleY(0.4);opacity:0.5}
}

/* Spinner */
.auth-spinner { animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* Form footer */
.auth-form-footer {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 24px;
  font-size: 0.64rem; color: var(--text-muted);
}

/* Light theme */
[data-theme="light"] .auth-form-panel { background: #fff; border-left-color: rgba(0,0,0,0.08); }
[data-theme="light"] .auth-hero { background: linear-gradient(145deg, #0a1628 0%, #0f2040 40%, #0d1e36 100%); }
[data-theme="light"] .auth-input-wrap, [data-theme="light"] .auth-otp-box { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .auth-backdrop { background: rgba(15,30,60,0.85); }

/* In-form social proof: hidden on desktop, shown below Continue on mobile */
.auth-form-social-proof {
  display: none;
}

/* ── Mobile Auth: Full-screen premium centered experience ─────────────────── */
@media (max-width: 768px) {
  /* Full screen takeover — the backdrop becomes the hero background */
  .auth-backdrop {
    padding: 16px;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(ellipse 500px 400px at 20% 20%, rgba(16,185,129,0.18) 0%, transparent 60%),
      radial-gradient(ellipse 400px 350px at 80% 80%, rgba(59,130,246,0.12) 0%, transparent 60%),
      radial-gradient(ellipse 300px 300px at 50% 50%, rgba(139,92,246,0.08) 0%, transparent 60%),
      rgba(4, 5, 10, 0.75); /* Lowered from 0.97 so dashboard is visible */
  }

  /* The shell becomes a centered card — no more side-by-side */
  .auth-shell {
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    min-height: auto;
    max-height: 92vh;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
      0 0 0 1px rgba(16,185,129,0.1),
      0 40px 80px rgba(0,0,0,0.9),
      inset 0 1px 0 rgba(255,255,255,0.07);
    overflow: hidden;
    animation: auth-mobile-pop 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
  }
  @keyframes auth-mobile-pop {
    from { opacity: 0; transform: scale(0.88) translateY(24px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* Hero panel: proper height so float cards have room above the title */
  .auth-hero {
    display: flex;
    flex: none;
    padding: 24px 24px 20px;
    align-items: flex-end; /* Title at bottom, cards float above */
    min-height: 180px;     /* Enough room for cards at top: 24px and top: 100px */
    background: linear-gradient(160deg, rgba(16,185,129,0.15) 0%, rgba(10,22,40,0.95) 60%);
  }
  /* Scale down float cards to fit the narrower mobile card width */
  .auth-float-card {
    padding: 7px 10px;
    gap: 7px;
    border-radius: 10px;
  }
  .auth-fc-1 { top: 16px; left: 16px; }
  .auth-fc-2 { top: 16px; right: 16px; }
  .auth-fc-3 { top: 76px; right: 16px; }
  .auth-fc-val { font-size: 0.75rem; }
  .auth-fc-label { font-size: 0.55rem; }

  /* Hide heavy decorative elements on mobile for speed */
  .auth-hero-orb { display: none; }
  .auth-hero-mesh { opacity: 0.3; }

  /* Hero content sits at bottom, no overlap with cards */
  .auth-hero-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    position: relative;
    z-index: 2;
  }
  .auth-hero-badge { margin-bottom: 0; font-size: 0.55rem; padding: 3px 10px; align-self: flex-start; }
  .auth-hero-title { font-size: 1.35rem; margin-bottom: 0; }
  .auth-hero-desc { display: none; }

  /* Hide the avatar social proof row and feature pills to keep it tight */
  .auth-hero-users { display: none; }
  .auth-hero-features { display: none; }

  /* Form panel: clean glass card below the hero strip */
  .auth-form-panel {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(12, 18, 33, 0.98);
    padding: 24px 24px 28px;
    width: 100%;
    overflow-y: auto;
    flex: none;
  }
  .auth-form-inner { max-width: 100%; }

  /* Logo row centered */
  .auth-logo-row { justify-content: flex-start; margin-bottom: 16px; }
  .auth-form-logo { width: 36px; height: 36px; border-radius: 9px; }
  .auth-form-brand { font-size: 1.05rem; }
  .auth-form-title { font-size: 1.2rem; }
  .auth-form-sub { font-size: 0.72rem; margin-bottom: 18px; }

  /* Bigger tap targets */
  .auth-btn { padding: 14px 20px; font-size: 0.95rem; border-radius: 12px; }
  .auth-input { height: 50px; font-size: 0.92rem; }
  .auth-input-prefix { height: 50px; }
  .auth-trust-row { justify-content: center; }
  .auth-form-footer { text-align: center; }

  /* OTP boxes — big and thumb-friendly */
  .auth-otp-box { width: 54px !important; height: 60px !important; font-size: 1.5rem !important; border-radius: 14px !important; }

  /* WA card */
  .auth-wa-card { padding: 14px; border-radius: 12px; }
  .auth-wa-title { font-size: 0.85rem; }
  .auth-wa-sub { font-size: 0.73rem; }

  /* Social proof below Continue button */
  .auth-form-social-proof {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
}


/* Responsive: stack on small screens */

.mobile-drawer-logo { display: none; }


@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .header-mobile-avatar { display: flex !important; }

  /* --- Mobile Pinned Icons State --- */
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sidebar {
    position: fixed !important;
    transform: translateX(0) !important;
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    height: calc(100vh - var(--ticker-h) - var(--header-h)) !important;
    top: calc(var(--ticker-h) + var(--header-h)) !important;
    z-index: 10 !important;
    box-shadow: none !important;
    border-right: 1px solid var(--divider);
  }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .workspace-views {
    padding-left: var(--sidebar-w) !important; /* Push main content, keep header full width */
  }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .mobile-sidebar-overlay { display: none !important; }
  body:not(.mobile-sidebar-open) .mobile-drawer-logo { display: none !important; } /* Hide drawer logo when closed/pinned */

  /* Force icon-only view when pinned (overriding any .expanded classes) */
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-item > *:not(.sb-icon) { display: none !important; }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-item { padding: 0 0 !important; justify-content: center !important; gap: 0 !important; overflow: visible !important; }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-icon { width: 38px !important; height: 38px !important; display: flex !important; align-items: center !important; justify-content: center !important; border-radius: 10px !important; }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-divider { margin: 4px 8px !important; }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-section-label { display: none !important; }
  body.mobile-pinned-icons:not(.mobile-sidebar-open) .sb-collapse-row { display: none !important; }

  .sidebar {
    position: fixed !important;
    left: 0 !important;
    transform: translateX(-100%);
    z-index: 999 !important;
    width: var(--sidebar-full) !important;
    min-width: var(--sidebar-full) !important;
    height: 100vh !important;
    top: 0 !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .ticker-strip {
    z-index: 0 !important; /* Ensure sidebar slides over ticker */
  }
  .sidebar.expanded {
    width: var(--sidebar-full) !important;
    min-width: var(--sidebar-full) !important;
  }
  .mobile-drawer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
  }

  .mobile-dl-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
  }
  .sb-logo {
    display: flex !important;
    position: fixed !important;
    top: var(--ticker-h) !important;
    left: 56px !important; /* Starts after 12px padding + 36px btn + 8px margin */
    width: 44px !important; /* Just enough for the icon */
    height: var(--header-h) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 8px !important;
  }
  .sb-logo-text { display: none !important; }
  .sb-nav {
    margin-top: 12px !important;
  }

  @keyframes slideInNative {
    0% { transform: translateX(-100%); width: var(--sidebar-full); min-width: var(--sidebar-full); height: 100vh; top: 0; }
    100% { transform: translateX(0); width: var(--sidebar-full); min-width: var(--sidebar-full); height: 100vh; top: 0; }
  }
  .mobile-sidebar-open .sidebar {
    transform: translateX(0);
    animation: slideInNative 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .mobile-menu-btn {
    display: flex !important; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--divider);
    color: var(--text-primary); flex-shrink: 0;
  }
  .mobile-menu-btn:active { transform: scale(0.95); }
  .header-clock { display: none; }
  .scan-badge { display: none; }
  #header-upgrade-btn {
    padding: 4px 8px 6px;
    font-size: 0;
  }
  #header-upgrade-btn i {
    margin: 0;
  }
  .terminal-header { padding: 0 12px !important; gap: 8px; }
  .header-brand { margin-left: 36px !important; } /* Pushes text right to make room for the 44px logo at left:56px */
  .header-right { gap: 6px; }
  .heatmap-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px; }
  .quadrant-info-bar { padding: 0 12px; gap: 8px; }
  .qi-desc { display: none; }

  /* Footer reset for mobile */
  .terminal-footer {
    position: static;
    padding: 20px 16px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .footer-disclaimer { display: none !important; }
  .footer-version { font-size: 0.65rem; opacity: 0.8; }
  .main-content { padding-bottom: 20px; }
  .right-panel { display: none; }



  /* ── Mobile Native Signal Cards ── */
  .signal-table, .signal-table tbody, .signal-table tr, .signal-table td, .signal-table tfoot {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }
  .signal-table thead { display: none; }
  .signal-table tfoot td { padding: 0 !important; border: none !important; }

  .signal-table tr.signal-row {
    width: auto !important;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas:
      "asset asset asset strat strat strat"
      "entry entry hl hl move move"
      "action action action action action action";
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-surface));
    border: 1px solid var(--divider-glass);
    border-radius: 12px;
    margin: 0 12px 12px 12px;
    padding: 12px;
    gap: 12px 8px; /* 12px vertical gap between rows, 8px horizontal gap */
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 16px rgba(0,0,0,0.2);
  }
  [data-theme="light"] .signal-table tr.signal-row {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid var(--divider);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 12px rgba(0,0,0,0.06);
  }
  .signal-table tr.skeleton-row {
    width: auto !important;
    display: block;
    margin: 0 12px 12px 12px;
    padding: 12px;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--divider-glass);
  }
  .signal-table tr.skeleton-row td { display: block; margin-bottom: 8px; }

  .signal-table td { border: none !important; padding: 0 !important; text-align: left !important; }

  /* Top Row: Asset (Left) and Strategy (Right) */
  .signal-table td.col-asset    { grid-area: asset; display: flex; justify-content: flex-start; align-items: flex-start; margin-top: 2px; }
  .signal-table td.col-strategy { grid-area: strat; display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; gap: 4px; }
  .signal-table td.col-strategy .strategy-label { margin-bottom: 0 !important; }
  [data-theme="light"] .signal-table td.col-strategy { border-bottom: none; }

  /* Premium data pills for the 3 values */
  .signal-table td.col-entry, .signal-table td.col-hl, .signal-table td.col-move {
    background: rgba(0,0,0,0.15);
    padding: 6px 8px !important;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.02);
  }
  [data-theme="light"] .signal-table td.col-entry, [data-theme="light"] .signal-table td.col-hl, [data-theme="light"] .signal-table td.col-move {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
  }

  .signal-table td.col-entry    { grid-area: entry; display: flex; flex-direction: column; justify-content: center; }
  .signal-table td.col-hl       { grid-area: hl; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
  .signal-table td.col-hl .hl-cell { height: 100%; justify-content: center; }
  .signal-table td.col-move     { grid-area: move; display: flex; justify-content: flex-end; align-items: center; }

  .signal-table td.col-action   { grid-area: action; margin-top: 2px; }
  .signal-table td.col-action .analyze-btn { width: 100%; justify-content: center; padding: 8px; border-radius: 6px; }

  .entry-price-label { font-size: 0.6rem; color: var(--text-muted); margin-bottom: 2px; }
  .entry-price-value { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
  .hl-cell-label { font-size: 0.6rem; }
  .hl-cell-value { font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UPGRADE PLANS MODAL — Auth-matched two-panel design
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Backdrop ───────────────────────────────────────────────────────────── */
.upm-backdrop {
  position: fixed; inset: 0;
  z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4, 5, 10, 0.82);
  pointer-events: all;
}
.upm-backdrop-click {
  position: absolute; inset: 0;
  z-index: 0; cursor: pointer;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */
.upm-shell {
  position: relative; z-index: 1;
  display: flex;
  width: 100%; max-width: 880px;
  min-height: 540px;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.06);
  animation: upm-pop 0.42s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes upm-pop {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ── LEFT: Plans panel (increased width) ─────────────────────────────────── */
.upm-plans-panel {
  position: relative; flex: 1.25;
  background: linear-gradient(145deg, #0d2125 0%, var(--bg-surface) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 44px 48px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.upm-plans-inner { width: 100%; max-width: 380px; }

/* Global Close button (always top-right of the shell) */
.upm-close {
  position: absolute; top: 20px; right: 20px; z-index: 10;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; color: rgba(255,255,255,0.6); cursor: pointer;
  transition: all 160ms ease;
}
.upm-close:hover { background: rgba(255,255,255,0.16); color: #ffffff; }
.upm-plans-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.upm-plans-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.upm-plans-brand { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.upm-plans-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; margin-bottom: 6px; }
.upm-plans-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 22px; }

/* Plan rows */
.upm-plan-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.upm-plan-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--divider); background: var(--bg-elevated);
  cursor: pointer;
  transition: transform 320ms cubic-bezier(0.25,0.46,0.45,0.94),
              box-shadow 320ms ease,
              border-color 320ms ease;
}
/* Gradient overlay — sweeps in from left on hover */
.upm-plan-row::before {
  content: ''; position: absolute; inset: 0; z-index: 2;
  border-radius: inherit; 
  clip-path: inset(0 100% 0 0);
  transition: clip-path 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
/* The hidden CTA layer that sweeps in */
.upm-plan-cta-layer {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.85rem; font-weight: 700; color: #fff; letter-spacing: 0.005em;
  clip-path: inset(0 100% 0 0);
  transform: translateX(-10px);
  transition: clip-path 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
.upm-plan-row:hover::before { clip-path: inset(0 0 0 0); }
.upm-plan-row:hover .upm-plan-cta-layer { clip-path: inset(0 0 0 0); transform: translateX(0); }
.upm-plan-row:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: transparent;
}
/* All children sit below the sweep layer */
.upm-plan-left,
.upm-plan-right { 
  position: relative; z-index: 1; 
}

/* Trial */
.upm-plan-trial   { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.04); }
.upm-plan-trial::before { background: linear-gradient(135deg, #F59E0B, #D97706); }
.upm-plan-trial:hover { box-shadow: 0 8px 24px rgba(245,158,11,0.35); }
/* Monthly */
.upm-plan-monthly { border-color: rgba(16,185,129,0.25);  background: rgba(16,185,129,0.04); }
.upm-plan-monthly::before { background: linear-gradient(135deg, #10B981, #059669); }
.upm-plan-monthly:hover { box-shadow: 0 8px 24px rgba(16,185,129,0.35); }
/* Annual */
.upm-plan-annual  { border-color: rgba(56,189,248,0.2);   background: rgba(56,189,248,0.04); }
.upm-plan-annual::before { background: linear-gradient(135deg, #0EA5E9, #0284C7); }
.upm-plan-annual:hover { box-shadow: 0 8px 24px rgba(14,165,233,0.35); }

.upm-plan-left { display: flex; align-items: center; gap: 12px; }
.upm-plan-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 9px; flex-shrink: 0; transition: all 320ms ease; }
.upm-plan-row:hover .upm-plan-icon { transform: scale(1.1); background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); color: #fff; }
.upm-plan-icon-amber { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.28); color: #FCD34D; }
.upm-plan-icon-green { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: #34D399; }
.upm-plan-icon-blue  { background: rgba(56,189,248,0.1);  border: 1px solid rgba(56,189,248,0.22); color: #7DD3FC; }
.upm-plan-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); transition: color 320ms ease; }
.upm-plan-desc { font-size: 0.67rem; color: var(--text-muted); margin-top: 1px; transition: color 320ms ease; }
.upm-plan-badge {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px;
  background: rgba(16,185,129,0.14); color: #34D399; border: 1px solid rgba(16,185,129,0.28);
  white-space: nowrap; flex-shrink: 0;
}
.upm-plan-badge-amber { background: rgba(245,158,11,0.14); color: #FCD34D; border-color: rgba(245,158,11,0.3); }
.upm-plan-badge-gold  { background: rgba(245,158,11,0.12); color: #FCD34D; border-color: rgba(245,158,11,0.25); }
.upm-plan-price { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.upm-plan-cur    { font-size: 0.78rem; font-weight: 600; vertical-align: super; }
.upm-plan-period { font-size: 0.67rem; font-weight: 500; color: var(--text-muted); }

/* Includes grid */
.upm-includes { margin-bottom: 20px; }
.upm-includes-label { font-size: 0.67rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.upm-includes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.upm-includes-grid span { display: flex; align-items: center; gap: 5px; font-size: 0.71rem; color: var(--text-secondary); }

/* CTA shimmer animation */
@keyframes upm-cta-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* CTA Buttons */
.upm-cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; text-decoration: none; cursor: pointer; border: none;
  transition: all 180ms ease; margin-bottom: 10px; letter-spacing: 0.005em;
}
.upm-cta::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  background-size: 200% 100%;
  animation: upm-cta-shimmer 3s ease-in-out infinite;
  pointer-events: none;
}
.upm-cta-trial {
  background: linear-gradient(135deg,#F59E0B,#D97706);
  color: #fff; box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.upm-cta-trial:hover {
  background: linear-gradient(135deg,#FCD34D,#F59E0B);
  box-shadow: 0 6px 22px rgba(245,158,11,0.4); transform: translateY(-1px); color: #fff;
}
.upm-cta-monthly {
  background: linear-gradient(135deg,#10B981,#059669);
  color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}
.upm-cta-monthly:hover {
  background: linear-gradient(135deg,#34D399,#10B981);
  box-shadow: 0 6px 22px rgba(16,185,129,0.45); transform: translateY(-1px); color: #fff;
}
.upm-cta-annual {
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  color: #fff; box-shadow: 0 4px 16px rgba(14,165,233,0.35);
  border: none;
}
.upm-cta-annual:hover {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  box-shadow: 0 6px 22px rgba(14,165,233,0.45);
  transform: translateY(-1px); color: #fff;
}

/* Trust row */
.upm-trust-row {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--divider-soft);
}
.upm-trust-row span { font-size: 0.65rem; color: var(--text-muted); }

/* ── RIGHT: Hero (decreased width) ───────────────────────────────────────── */
.upm-hero {
  position: relative; flex: 0.85;
  background: linear-gradient(145deg, #050812 0%, #0a1628 40%, #091420 100%);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; padding: 44px 40px;
}
.upm-orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.55;
  animation: upm-orb-drift 8s ease-in-out infinite;
}
.upm-orb-1 { width:280px;height:280px; background:radial-gradient(circle,#10B981 0%,transparent 70%); top:-60px;left:-60px; animation-duration:9s; }
.upm-orb-2 { width:200px;height:200px; background:radial-gradient(circle,#3B82F6 0%,transparent 70%); top:30%;right:-40px; animation-duration:11s;animation-delay:-3s; }
.upm-orb-3 { width:160px;height:160px; background:radial-gradient(circle,#8B5CF6 0%,transparent 70%); bottom:20%;left:30%; animation-duration:13s;animation-delay:-6s; }
@keyframes upm-orb-drift {
  0%,100% { transform:translate(0,0) scale(1); }
  33%     { transform:translate(20px,-30px) scale(1.08); }
  66%     { transform:translate(-15px,20px) scale(0.95); }
}
.upm-mesh {
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(16,185,129,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.05) 1px, transparent 1px);
  background-size:40px 40px;
  mask-image:radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
}
.upm-float-card {
  position:absolute; display:flex; align-items:center; gap:10px;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  backdrop-filter:blur(12px); border-radius:12px; padding:9px 12px;
  animation:upm-float 6s ease-in-out infinite;
}
.upm-fc-1 { top: 32px; left: 32px; animation-delay: 0s; }
.upm-fc-2 { top: 92px; right: 32px; animation-delay: -2s; }
@keyframes upm-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.upm-fc-dot { width:8px;height:8px;border-radius:50%;flex-shrink:0; animation:upm-dot-pulse 2s ease-in-out infinite; }
@keyframes upm-dot-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,0.4)} 50%{box-shadow:0 0 0 5px rgba(255,255,255,0)} }
.upm-fc-val   { font-size:.82rem;font-weight:800;color:#fff;font-family:var(--font-display);line-height:1.2; }
.upm-fc-label { font-size:.60rem;color:rgba(255,255,255,0.5);margin-top:2px; }

.upm-hero-content { position:relative;z-index:2; margin-top: auto; padding-top: 140px; }
.upm-hero-badge {
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(16,185,129,0.12);border:1px solid rgba(16,185,129,0.3);
  border-radius:20px;padding:4px 12px;
  font-size:.6rem;font-weight:700;letter-spacing:.1em;color:#10B981;margin-bottom:16px;
}
.upm-hero-badge-dot { width:6px;height:6px;border-radius:50%;background:#10B981;animation:upm-dot-pulse 1.5s ease-in-out infinite; }
.upm-hero-title { font-family:var(--font-display);font-size:1.85rem;font-weight:900;line-height:1.15;color:#fff;margin-bottom:12px;letter-spacing:-.02em; }
.upm-hero-accent { background:linear-gradient(90deg,#10B981,#3B82F6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text; }
.upm-hero-desc { font-size:.80rem;color:rgba(255,255,255,0.55);line-height:1.55;margin-bottom:18px;max-width:260px; }
.upm-hero-features { display:flex;flex-direction:column;gap:8px;margin-bottom:20px; }
.upm-hf-item { display:flex;align-items:center;gap:8px;font-size:.73rem;color:rgba(255,255,255,0.7); }
.upm-hf-item svg { color:#10B981;flex-shrink:0; }
.upm-hero-guarantee {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 12px;
  padding: 8px 14px;
}
.upm-guar-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(16,185,129,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.upm-guar-text {
  display: flex; flex-direction: column; gap: 2px;
}
.upm-guar-text strong {
  font-size: 0.76rem; font-weight: 700; color: #fff;
}
.upm-guar-text span {
  font-size: 0.65rem; color: rgba(255,255,255,0.6);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .upm-backdrop { padding:0;align-items:flex-end; }
  .upm-shell {
    flex-direction:column-reverse;max-width:100%;width:100%;
    min-height:unset;border-radius:20px 20px 0 0;
    max-height:92dvh;overflow-y:auto;
    animation:upm-slide-up 0.35s cubic-bezier(0.34,1.4,0.64,1);
  }
  @keyframes upm-slide-up {
    from { opacity:0;transform:translateY(100%); }
    to   { opacity:1;transform:translateY(0); }
  }
  .upm-hero { flex:unset;min-height:unset;padding:20px 20px 16px;align-items:flex-start; }
  .upm-hero-content { margin-top:0; padding-top:0; }
  .upm-orb,.upm-float-card,.upm-hero-features,.upm-hero-guarantee,.upm-hero-desc { display:none; }
  .upm-hero-title { font-size:1.35rem;margin-bottom:0; }
  .upm-hero-badge { margin-bottom:8px; }
  .upm-plans-panel { flex:unset;padding:24px 20px 28px;border-right:none;border-top:none; }
  .upm-plans-inner { max-width:100%; }
  .upm-plans-logo-row { display:none; }
  .upm-plans-title { font-size:1.2rem; }
}

/* ─── WhatsApp Sticky Bar ────────────────────────────────────────────────────── */
.wa-sticky-bar {
  position: fixed;
  bottom: 12px;
  right: 8px;
  width: calc(var(--right-w) - 16px);
  max-width: calc(100vw - 16px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 8px;
  background: rgba(6, 12, 22, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-display);
  box-sizing: border-box;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  animation: 
    wa-bar-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both, 
    wa-cycle-bar 30s ease-in-out infinite;
}
@keyframes wa-bar-in {
  from { transform: translateY(100%) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}
@keyframes wa-cycle-bar {
  0%, 42% { max-width: 400px; padding: 4px 4px 4px 8px; background: rgba(6, 12, 22, 0.96); border-color: rgba(16, 185, 129, 0.35); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(16, 185, 129, 0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  48%, 94% { max-width: 32px; padding: 4px; background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  100% { max-width: 400px; padding: 4px 4px 4px 8px; background: rgba(6, 12, 22, 0.96); border-color: rgba(16, 185, 129, 0.35); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(16, 185, 129, 0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
}
@keyframes wa-cycle-content {
  0%, 42% { opacity: 1; transform: scale(1); visibility: visible; }
  46%, 96% { opacity: 0; transform: scale(0.9); visibility: hidden; }
  100% { opacity: 1; transform: scale(1); visibility: visible; }
}

/* WhatsApp breathing circular badge */
.wa-sticky-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 50%;
  color: var(--cta-light);
  flex-shrink: 0;
  animation: wa-cycle-live 30s ease-in-out infinite;
}
@keyframes wa-cycle-live {
  0%, 42% { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); }
  48%, 94% { background: transparent; border-color: transparent; }
  100% { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); }
}
.wa-sticky-icon {
  width: 12px;
  height: 12px;
  color: var(--cta);
  animation: wa-breathe 2.4s ease-in-out infinite, wa-cycle-icon 30s ease-in-out infinite;
}
@keyframes wa-cycle-icon {
  0%, 42% { color: var(--cta); width: 13px; height: 13px; }
  48%, 94% { color: #25D366; width: 32px; height: 32px; }
  100% { color: var(--cta); width: 13px; height: 13px; }
}
@keyframes wa-breathe {
  0%, 100% {
    transform: scale(0.9);
    filter: drop-shadow(0 0 0px rgba(16, 185, 129, 0));
    opacity: 0.85;
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.7));
    opacity: 1;
  }
}

/* Text block */
.wa-sticky-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  animation: wa-cycle-content 30s ease-in-out infinite;
}
.wa-sticky-text strong {
  font-size: 0.7rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.wa-sticky-mid-dot {
  color: var(--text-muted);
  font-size: 0.65rem;
}
.wa-sticky-muted {
  font-size: 0.64rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* CTA button */
.wa-sticky-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-display);
  padding: 6px 11px;
  border-radius: 999px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  animation: wa-cycle-content 30s ease-in-out infinite;
}
.wa-sticky-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
  filter: brightness(1.08);
}
.wa-sticky-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

/* ─── Static UPM Shell Embed Customizations ─── */
.static-upm-shell {
  width: calc(100% - 24px) !important;
  max-width: 840px !important;
  min-height: auto !important;
  margin: 12px auto !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
}

.static-upm-shell .upm-plans-panel {
  padding: 20px 24px !important;
}

.static-upm-shell .upm-hero {
  padding: 20px 24px !important;
}

/* Make it responsive inside the table body grid context */
@media (max-width: 840px) {
  .static-upm-shell {
    flex-direction: column-reverse !important;
    max-width: 480px !important;
    margin: 8px auto !important;
  }
  .static-upm-shell .upm-plans-panel {
    border-right: none !important;
    padding: 16px 14px !important;
  }
  .static-upm-shell .upm-plan-row {
    padding: 12px 10px !important;
  }
  .static-upm-shell .upm-plan-left {
    gap: 8px !important;
  }
  
  /* We stack the hero below the plans on small screens */
  .static-upm-shell .upm-hero {
    padding: 24px 20px !important;
  }
  
  .static-upm-shell .upm-plans-logo-row {
    display: none !important;
  }
  .static-upm-shell .upm-hero-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  .static-upm-shell .upm-hero-title {
    font-size: 1.35rem !important;
    margin-bottom: 8px !important;
  }
  .static-upm-shell .upm-hero-badge {
    margin-bottom: 8px !important;
  }
}

