/* ══════════════════════════════════════════════════════════
   BIRBULL ENGINE — Design System (Reference-matched)
   ══════════════════════════════════════════════════════════ */

/* Fonts loaded via <link> in HTML — no duplicate @import */

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

  --bg-base:        #060A14;
  --bg-deep:        #080D19;
  --bg-surface:     #0C1221;
  --bg-surface-hover: #0F1830;
  --bg-elevated:    #111928;
  --bg-highlight:   #16203A;
  --bg-glass:       rgba(12, 18, 33, 0.82);
  --bg-card:        #0F1926;
  --bg-card-alt:    rgba(15,25,38,0.7);
  --bg-input:       rgba(11,17,32,0.8);
  --divider:        #1C2A44;
  --divider-soft:   #162036;
  --divider-glass:  rgba(28, 42, 68, 0.55);
  --divider-strong: rgba(40,70,110,0.9);

  --text-primary:   #EAF0FC;
  --text-secondary: #B2C3DF;
  --text-tertiary:  #889CBF;
  --text-muted:     #63789F;

  --cta:          #10B981;
  --cta-light:    #34D399;
  --cta-hover:    #059669;
  --cta-dark:     #059669;
  --cta-dim:      rgba(16, 185, 129, 0.12);
  --cta-glow:     rgba(16, 185, 129, 0.25);
  --cta-subtle:   rgba(16, 185, 129, 0.08);
  --accent-q:     #10B981;
  --accent-q-rgb: 16, 185, 129;

  --red:          #F43F5E;
  --red-dim:      rgba(244, 63, 94, 0.1);
  --red-subtle:   rgba(244, 63, 94, 0.1);
  --amber:        #F59E0B;
  --blue:         #3B82F6;

  --ticker-h:      28px;
  --sidebar-full:  224px;
  --sidebar-collapsed: 56px;
  --sidebar-bg:    #070D1A;
  --sidebar-border: rgba(20,40,70,0.8);
  --right-panel-w: 308px;
  --header-h:      56px;
  --header-bg:     #0C1221;
  --tab-h:         44px;
  --info-h:        38px;

  /* Spacing scale (4px base) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* Typography scale */
  --text-2xs: 0.55rem; --text-xs: 0.62rem; --text-sm: 0.72rem;
  --text-base: 0.82rem; --text-md: 0.95rem; --text-lg: 1.1rem;
  --text-xl: 1.3rem; --text-2xl: 1.6rem;

  /* Z-index scale */
  --z-base: 1; --z-sticky: 10; --z-header: 30; --z-sidebar: 40;
  --z-dropdown: 100; --z-modal: 500; --z-popup: 900; --z-toast: 999;
  --z-ticker: 1000;

  --r-xs:  3px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --border-radius:    6px;
  --border-radius-lg: 10px;
  --border-radius-xl: 14px;

  --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);
  --shadow-cta: 0 4px 20px rgba(16,185,129,0.15);

  --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);
  --transition:  0.18s ease;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg-base:        #F0F4FC;
  --bg-deep:        #E6EDF8;
  --bg-surface:     #FFFFFF;
  --bg-surface-hover: #EDF1FB;
  --bg-elevated:    #F5F7FC;
  --bg-highlight:   #EBF0FA;
  --bg-glass:       rgba(255, 255, 255, 0.92);
  --bg-card:        #FFFFFF;
  --bg-card-alt:    rgba(255,255,255,0.85);
  --bg-input:       #E8EDF6;
  --divider:        #C5D3E8;
  --divider-soft:   #DDE6F4;
  --divider-glass:  rgba(197, 211, 232, 0.5);
  --divider-strong: rgba(160,185,220,0.9);

  --text-primary:   #0C1629;
  --text-secondary: #3A4F72;
  --text-tertiary:  #526B91;
  --text-muted:     #6B7F9E;

  --cta:          #059669;
  --cta-light:    #10B981;
  --cta-hover:    #059669;
  --cta-dark:     #047857;
  --cta-dim:      rgba(16, 185, 129, 0.08);
  --cta-glow:     rgba(16, 185, 129, 0.2);
  --cta-subtle:   rgba(5,150,105,0.07);
  --accent-q:     #059669;

  --red:          #DC2626;
  --red-dim:      rgba(220,38,38,0.08);
  --red-subtle:   rgba(220,38,38,0.1);
  --amber:        #D97706;

  --sidebar-bg:   #EDF2FA;
  --sidebar-border: rgba(180,200,230,0.8);
  --header-bg:    #FFFFFF;

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

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

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

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

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

a { color: var(--cta); text-decoration: none; }
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; color: inherit; }
button:active { transform: scale(0.97); }
input, select, textarea { font-family: var(--font-body); }
[data-tabular], .tabnum { font-variant-numeric: tabular-nums; }

/* Focus visible ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

::-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); }

/* View transition for smooth page switching */
.view {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.view:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none !important; }
}

/* ══ TICKER STRIP ══ */
.ticker-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--ticker-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.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: tickerScroll 55s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-strip:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-right: 1px solid var(--divider-soft);
  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;
  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-up { color: var(--cta) !important; }
.ticker-down { color: var(--red) !important; }
.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; } }
.ws-status { color: var(--text-muted); font-size: 0.65rem; }

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

/* ══ APP SHELL ══ */
.app-shell {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--ticker-h));
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: filter 0.3s ease;
}
.shell-blurred {
  filter: blur(12px) grayscale(50%);
  pointer-events: none;
  user-select: none;
}

/* ══ LEFT SIDEBAR ══ */
.sidebar {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
  background: var(--bg-deep);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: visible;
  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);
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--divider);
  height: var(--header-h);
  min-height: var(--header-h);
  flex-shrink: 0;
  background: var(--bg-surface);
  position: relative;
}
.sb-logo-img {
  width: 30px; height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}
.sb-logo-text {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity var(--ease-med), max-width var(--ease-med);
  flex-shrink: 0;
}
.sidebar.expanded .sb-logo-text { opacity: 1; max-width: 160px; }
[data-theme="light"] .sb-logo-text { color: #000000; }

/* Collapsed sidebar: keep logo image visible and centered */
.sidebar:not(.expanded) .sb-logo {
  padding: 0;
  justify-content: center;
  gap: 0;
}
.sidebar:not(.expanded) .sb-logo-img {
  display: block;
}
.sidebar:not(.expanded) .sb-toggle-btn {
  right: -11px;
}

.sb-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--divider);
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: all var(--ease-fast);
  opacity: 1;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.sb-toggle-btn:hover { background: var(--bg-highlight); color: var(--text-primary); border-color: var(--divider-soft); transform: translateY(-50%) scale(1.05); }

.sb-nav {
  flex: 1;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar { display: none; }

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

.sb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider), transparent);
  margin: 4px 10px;
}

.sb-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  transition: color var(--ease-fast), background var(--ease-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
/* Collapsed mode: icon pill */
.sidebar:not(.expanded) .sb-item {
  padding: 0;
  justify-content: center;
  gap: 0;
  overflow: visible;
}
.sidebar:not(.expanded) .sb-item > *:not(.sb-icon) { display: none !important; }
.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;
}
.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;
}
.sidebar.expanded .sb-item:hover {
  background: var(--bg-elevated);
  color: var(--cta-light) !important;
}

/* Active state */
.sb-item.active {
  color: #ffffff !important;
}
.sidebar.expanded .sb-item.active {
  background: var(--cta-dim);
}
.sb-item.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);
}
.sidebar:not(.expanded) .sb-item.active .sb-icon {
  background: rgba(16,185,129,0.15);
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16,185,129,0.3), inset 0 0 0 1px rgba(16,185,129,0.25);
}
.sidebar:not(.expanded) .sb-item.active::before { display: none !important; }

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

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

/* 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 { color: #000000 !important; }
[data-theme="light"] .sidebar:not(.expanded) .sb-item.active .sb-icon { color: #000000 !important; }

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

/* Auto-collapse row */
.sb-collapse-row {
  display: none;
  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;
}

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

/* Premium lock items */
.sb-item.premium-lock { opacity: 0.45; }
.sb-item.premium-lock:hover { opacity: 0.8; }

/* Sidebar theme/preview buttons */
.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; }

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

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

/* ── Terminal Header ── */
.terminal-header {
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  z-index: 30;
  gap: 12px;
  position: relative;
}
[data-theme="light"] .terminal-header { background: rgba(255,255,255,0.9); }
.header-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-live-badge { position: relative; width: 10px; height: 10px; flex-shrink: 0; }
.brand-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 6px var(--cta-glow);
  position: absolute;
  top: 1px; left: 1px;
  animation: live-dot-pulse 2s ease-in-out infinite;
}
.brand-live-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--cta);
  opacity: 0;
  animation: live-ring-expand 2s ease-in-out infinite;
}
@keyframes live-dot-pulse { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:0.75;transform:scale(0.85);} }
@keyframes live-ring-expand { 0%{transform:scale(0.6);opacity:0.8;}100%{transform:scale(2.2);opacity:0;} }

.brand-name {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.brand-tag {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--divider);
}
[data-theme="light"] .brand-tag { background: #EEF2FB; border-color: #D0DCF0; color: #6078A0; }

/* ── 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;
  white-space: nowrap;
}
.scan-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cta);
  animation: pulse-ring 2s ease-in-out infinite;
}
.scan-num {
  color: #ffffff; font-weight: 700;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}
.scan-num.pulse-change { animation: number-pop 0.35s ease; }
@keyframes number-pop { 0%{transform:scale(1)}50%{transform:scale(1.25);color:var(--cta-light)}100%{transform:scale(1)} }

/* ── Broker Badge ── */
.market-status-badge {
  display: flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 4px 10px;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.25s ease; cursor: pointer;
  white-space: nowrap;
}
.ms-dot { width: 5px; height: 5px; border-radius: 50%; transition: background 0.25s ease; }
.market-status-badge.live { background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.market-status-badge.live .ms-dot { background: #10b981; animation: pulse-ring 2s ease-in-out infinite; }
.market-status-badge.premarket { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.25); color: #fbbf24; }
.market-status-badge.premarket .ms-dot { background: #f59e0b; animation: pulse-ring 1s ease-in-out infinite; }
.market-status-badge.closed { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); }
.market-status-badge.closed .ms-dot { background: var(--text-muted); }

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

/* ── Notif Button ── */
.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;
  color: var(--text-secondary);
  transition: all var(--ease-fast);
  cursor: pointer;
}
.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);
}
.notif-badge.visible { display: flex; }

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



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

/* User pill */
.header-user-pill { display: flex; align-items: center; gap: 8px; }
.header-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--cta-dark), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.header-user-info { display: flex; flex-direction: column; gap: 1px; }
.header-user-name { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); }
.header-user-role { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 1px 5px; border-radius: 3px; }
.role-badge { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; }
.role-admin { background: rgba(252,163,17,0.15); color: var(--amber); border: 1px solid rgba(252,163,17,0.3); }
.role-team { background: rgba(59,130,246,0.12); color: var(--blue); border: 1px solid rgba(59,130,246,0.25); }
.role-user { background: var(--cta-subtle); color: var(--cta); border: 1px solid rgba(16,185,129,0.25); }

/* ══ VIEWS WRAPPER ══ */
.views-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.view:not([hidden]) { display: flex; }
.view[hidden] { display: none !important; }

/* ══ SCANNER TAB BAR (sc-tab-bar) ══ */
.sc-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: visible;
  flex-shrink: 0;
}
[data-theme="light"] .sc-tab-bar { background: var(--bg-surface); }

.sc-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  background: transparent;
  border: none;
  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;
  cursor: pointer;
}
.sc-tab-btn:hover { color: var(--cta-light); background: var(--bg-elevated); }
.sc-tab-btn.active { color: #ffffff !important; border-bottom-color: var(--cta); }
.sc-tab-btn.active i, .sc-tab-btn.active svg { color: var(--cta) !important; }
.sc-tab-btn.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: var(--cta);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}
[data-theme="light"] .sc-tab-btn { color: #000000; }
[data-theme="light"] .sc-tab-btn:hover { color: var(--cta); background: var(--bg-highlight); }
[data-theme="light"] .sc-tab-btn.active { color: #000000 !important; }

.sc-tab-live-dot {
  width: 5px; height: 5px;
  background: var(--cta);
  border-radius: 50%;
  animation: dot-pulse 1.8s ease-in-out infinite;
  display: none;
}
.sc-tab-btn.active .sc-tab-live-dot { display: block; }
.sc-tab-spacer { flex: 1; }



/* ══ TAB FILTER ══ */
.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(--cta); color: var(--cta); background: rgba(16,185,129,0.08); }
.tab-filter-btn.active { background: rgba(16,185,129,0.15); border-color: var(--cta); color: var(--cta); box-shadow: 0 0 8px rgba(16,185,129,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(--cta); 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); 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(--cta); background: rgba(16,185,129,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(16,185,129,0.07); }
.tfd-item.checked { background: rgba(16,185,129,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(--cta); border-color: var(--cta); box-shadow: 0 0 6px rgba(16,185,129,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(--cta); }
[data-theme="light"] .tab-filter-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,0.15); background: #fff; }

/* ══ 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-strategy-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding-right: 6px; }
.qi-label { font-size: 0.76rem; font-weight: 700; color: var(--cta); flex-shrink: 0; text-shadow: 0 0 12px rgba(16,185,129,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); }
[data-theme="light"] .qi-timing { background: #EEF2FB; border-color: #D0DCF0; color: #6078A0; }

/* ══ TAB VIEW PANELS ══ */
.sc-tabview { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.sc-tabview.active { display: flex; }

/* ══ SCANNER TABLE AREA ══ */
.scanner-table-area { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* ══ TABLE CONTAINER ══ */
.table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-deep);
}
.signal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.signal-table thead tr {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 10;
}
[data-theme="light"] .signal-table thead tr { background: #F0F4FC; }
.signal-table thead th {
  padding: 12px 16px;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
}
.signal-table thead th.col-num {
  padding: 12px 8px;
}

/* Signal rows */
.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(--cta);
  opacity: 0;
  transition: opacity var(--ease-fast);
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}
.signal-row:hover { background: var(--bg-elevated); }
[data-theme="light"] .signal-row:hover { background: #EDF1FB; }
.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} }

/* Table column widths & alignments */
.col-num { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.65rem; width: 5%; padding: 12px 8px; text-align: left; }
.col-asset { width: 23.75%; padding: 12px 16px; text-align: left; }
.col-qty { width: 23.75%; padding: 12px 16px; text-align: center; }
.col-price { width: 23.75%; padding: 12px 16px; text-align: center; }
.col-alloc { width: 23.75%; padding: 12px 16px; text-align: right; }

.asset-inner  { display: flex; align-items: flex-start; gap: 10px; }
.asset-ticker-wrap { display: flex; align-items: center; gap: 8px; }
.symbol-trend-icon {
  width: 13px; height: 13px;
  color: var(--cta);
  flex-shrink: 0;
  display: inline-block;
  margin-top: 1px;
}
.signal-new .symbol-trend-icon { animation: trend-pulse 1.5s ease-in-out 2; }
@keyframes trend-pulse { 0%,100%{transform:scale(1);filter:drop-shadow(0 0 2px rgba(16,185,129,0.4))}50%{transform:scale(1.25);filter:drop-shadow(0 0 6px rgba(16,185,129,0.9))} }

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

.strategy-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.74rem; font-weight: 700; color: var(--cta);
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.22);
  padding: 3px 10px; border-radius: 99px; margin-bottom: 5px;
  font-family: var(--font-display);
}
[data-theme="light"] .strategy-label { background: rgba(16,185,129,0.07) !important; border-color: rgba(16,185,129,0.18) !important; }
.strategy-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strategy-token { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.05em; }
.strategy-time-ago {
  font-size: 0.6rem; font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-elevated); padding: 1px 6px;
  border-radius: var(--r-xs); border: 1px solid var(--divider);
}
[data-theme="light"] .strategy-time-ago { background: #EEF2FB; border-color: #D0DCF0; color: #6078A0; }

.action-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.volume-badge {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  color: var(--text-secondary); background: var(--bg-highlight);
  border: 1px solid var(--divider); padding: 2px 7px;
  border-radius: 99px; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] .volume-badge { background: #EEF2FB; border-color: #D0DCF0; color: #3A4F72; }
.analyze-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 12px; background: transparent;
  border: 1px solid var(--divider); border-radius: var(--r-sm);
  color: var(--text-tertiary); font-size: 0.68rem; font-weight: 600;
  transition: all var(--ease-fast); white-space: nowrap;
}
.analyze-btn:hover { background: var(--bg-elevated); border-color: var(--cta); color: var(--cta-light); }
[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); }

/* Empty / skeleton states */
.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; }
.cta-color { color: var(--cta) !important; }
.red-color { color: var(--red) !important; }
.tabnum { font-family: var(--font-mono); }
.scan-loading, .pay-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 48px; color: var(--text-muted); font-size: 0.8rem; }

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

/* Payments table */
.payments-table-container { overflow-x: auto; }
.payments-table { width: 100%; border-collapse: collapse; table-layout: auto; min-width: 700px; }
.payments-table thead tr { background: var(--bg-surface); border-bottom: 1px solid var(--divider); position: sticky; top: 0; z-index: 10; }
.payments-table td { padding: 11px 14px; font-size: 0.78rem; color: var(--text-secondary); border-bottom: 1px solid var(--divider-soft); vertical-align: middle; }
.payments-table tr:hover td { background: var(--bg-elevated); }
.payments-table .customer-name { font-weight: 700; color: var(--text-primary); font-size: 0.82rem; }
.payments-table .customer-city { font-size: 0.65rem; color: var(--text-muted); margin-top: 1px; }
.payments-table .amount-val { font-family: var(--font-mono); font-weight: 800; color: var(--text-primary); font-size: 0.84rem; }
.payments-table .plan-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 1px; }
.payments-table .tx-id { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.02em; }
.payments-table th { padding: 9px 14px; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); text-align: left; white-space: nowrap; }
.signal-row td { font-size: 0.93rem; color: var(--text-secondary); }
.signal-new td { background: rgba(16,185,129,0.04); }

/* ══ RIGHT PANEL ══ */
.right-panel {
  width: var(--right-panel-w);
  min-width: var(--right-panel-w);
  height: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--divider-glass);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 20;
}
.rp-section { padding: 16px; border-bottom: 1px solid var(--divider-soft); }
.rp-section-header { display: flex; align-items: center; gap: 7px; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.rp-live-dot { width: 5px; height: 5px; background: var(--cta); border-radius: 50%; animation: dot-pulse 1.5s ease-in-out infinite; }

/* ── Right Panel: Info Rows (Session / Market Stats) ── */
.rp-info-rows { display: flex; flex-direction: column; gap: 0; }
.rp-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider-soft);
  gap: 8px;
}
.rp-info-row:last-child { border-bottom: none; }
.rp-info-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.rp-info-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rp-role-badge {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(252,163,17,0.15);
  color: var(--amber);
  border: 1px solid rgba(252,163,17,0.3);
}
.rp-role-badge.role-team { background: rgba(59,130,246,0.12); color: var(--blue); border-color: rgba(59,130,246,0.25); }
.rp-role-badge.role-user { background: var(--cta-subtle); color: var(--cta); border-color: rgba(16,185,129,0.25); }

/* ── Right Panel: Control Deck ── */
.rp-context { display: flex; flex-direction: column; }
.rp-deck-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rp-deck-field { display: flex; flex-direction: column; gap: 3px; }
.rp-deck-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.rp-deck-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--divider);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
  font-variant-numeric: tabular-nums;
}
.rp-deck-input:focus { border-color: var(--cta); box-shadow: 0 0 0 2px var(--cta-subtle); }
.rp-deck-select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--divider);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
}
.rp-deck-select:focus { border-color: var(--cta); box-shadow: 0 0 0 2px var(--cta-subtle); }
.rp-deck-select option, .settings-field-select option, .pnl-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.rp-deck-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.rp-deck-metric {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 8px;
}
.rp-deck-metric-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.rp-deck-metric-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.rp-deck-session { margin-bottom: 10px; padding: 6px 0; border-top: 1px solid var(--divider-soft); }
.rp-deck-session-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 3px; }
.rp-deck-session-val { font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); font-family: var(--font-mono); }
.rp-deck-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.rp-deck-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
}
.rp-deck-btn:hover { border-color: var(--cta); color: var(--cta); background: var(--cta-subtle); }
.rp-deck-refresh {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--divider-soft);
  padding-top: 6px;
  margin-top: 4px;
}
.rp-deck-status-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* ── Right Panel: Live Feed ── */
.rp-feed-status { display: flex; align-items: center; gap: 7px; font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }
.rp-feed-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cta);
  flex-shrink: 0;
  animation: dot-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
}
.rp-feed-item {
  display: grid;
  grid-template-columns: 85px 1fr 65px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider-soft);
  gap: 8px;
  font-size: 0.68rem;
}
.rp-feed-item:last-child { border-bottom: none; }
.rp-feed-name { font-weight: 700; color: var(--text-secondary); font-family: var(--font-mono); text-align: left; }
.rp-feed-val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; text-align: left; }
.rp-feed-chg { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.rp-feed-val.up, .rp-feed-chg.up { color: var(--cta-light); }
.rp-feed-val.down, .rp-feed-chg.down { color: #F87171; }

/* ── Right Panel: Payments ── */
.rp-pay-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-pay-metric { background: var(--bg-surface); border: 1px solid var(--divider); border-radius: 6px; padding: 8px; text-align: center; }
.rp-pay-metric-val { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.rp-pay-metric-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* 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(16,185,129,0.3); }
.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 { display: flex; align-items: center; justify-content: space-between; font-size: 0.58rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.shortcut-link-btn { background: none; border: none; color: var(--cta); font-size: 0.62rem; font-weight: 600; cursor: pointer; transition: opacity var(--ease-fast); }
.shortcut-link-btn:hover { opacity: 0.8; }
.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; }

/* ══ SCANNER VIEW (heatmap, qty, etc.) ══ */
.sc-av-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 14px 18px 0; }
.sc-av-title { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.sc-av-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }
.sc-live-badge { display: flex; align-items: center; gap: 6px; font-size: 0.65rem; font-weight: 700; color: var(--cta); background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); border-radius: 20px; padding: 4px 10px; }
.sc-live-dot { width: 6px; height: 6px; background: var(--cta); border-radius: 50%; animation: dot-pulse 1.8s ease-in-out infinite; }

/* ══ HEATMAP ══ */
.heatmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 16px; }
.heatmap-card {
  background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--r-md);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.15s, border-color 0.15s;
}
.heatmap-card:hover { transform: translateY(-2px); border-color: var(--cta); box-shadow: 0 4px 16px rgba(16,185,129,0.12); }
.hm-card-name { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.hm-card-price { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
.hm-card-change { font-size: 0.68rem; font-weight: 600; }
.hm-card-change.up { color: var(--cta); }
.hm-card-change.down { color: var(--red); }
.hm-card-bar { height: 3px; border-radius: 2px; background: var(--divider); margin-top: 4px; overflow: hidden; }
.hm-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

/* ══ CALCULATOR VIEWS ══ */
.calc-grid-only { display: flex; flex-direction: column; gap: 12px; padding: 16px; flex: 1; overflow-y: auto; }
.calc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.calc-config-panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.config-card, .config-metrics-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); padding: 16px; }
.config-card-title { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 14px; }
.config-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.config-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.config-input { width: 100%; padding: 9px 10px; background: var(--bg-input); border: 1px solid var(--divider); border-radius: 7px; color: var(--text-primary); font-size: 0.9rem; font-weight: 800; font-family: var(--font-mono); outline: none; transition: border-color var(--transition); }
.config-input:focus { border-color: var(--cta); }
.config-input-row { display: flex; align-items: center; gap: 6px; }
.config-tag { font-size: 0.62rem; font-weight: 800; color: var(--cta); background: var(--cta-subtle); padding: 4px 7px; border-radius: 5px; border: 1px solid rgba(16,185,129,0.2); white-space: nowrap; }
.config-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.config-metric { background: var(--bg-surface); border: 1px solid var(--divider); border-radius: 8px; padding: 10px; }
.config-metric-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.config-metric-val { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 800; color: var(--cta); }
.config-status-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.config-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-green { background: var(--cta); animation: pulse-ring 2s ease-in-out infinite; }
.status-amber { background: var(--amber); animation: pulse-ring 1.5s ease-in-out infinite; }
.config-status-text { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.config-progress-track { width: 100%; height: 3px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; }
.config-progress-fill { height: 100%; background: linear-gradient(90deg, var(--cta), var(--cta-dark)); border-radius: 3px; transition: width 0.5s ease; width: 0%; }
.calc-grid-area { display: flex; flex-direction: column; gap: 12px; }
.calc-toolbar { display: flex; gap: 10px; align-items: center; }
.calc-search-wrap { position: relative; flex: 1; }
.calc-search { width: 100%; padding: 9px 12px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 8px; color: var(--text-primary); font-size: 0.78rem; font-weight: 600; outline: none; transition: border-color var(--transition); }
.calc-search:focus { border-color: var(--cta); }
.calc-reset-btn { padding: 9px 16px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.calc-reset-btn:hover { border-color: var(--cta); color: var(--cta); }
.qty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.qty-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); padding: 14px; transition: all var(--transition); }
.qty-card:hover { border-color: rgba(16,185,129,0.25); box-shadow: 0 4px 20px rgba(16,185,129,0.08); transform: translateY(-1px); }
.qty-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qty-sym { font-weight: 800; font-size: 0.9rem; color: var(--text-primary); }
.qty-badge { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--divider); }
.qty-price-field { margin-bottom: 10px; }
.qty-field-label { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 4px; display: block; }
.qty-input-wrap { position: relative; display: flex; align-items: center; }
.qty-input { width: 100%; padding: 8px 24px 8px 8px; background: var(--bg-input); border: 1px solid var(--divider); border-radius: 7px; color: var(--text-primary); font-size: 0.82rem; font-weight: 800; font-family: var(--font-mono); outline: none; transition: border-color var(--transition); }
.qty-input:focus { border-color: var(--cta); }
.qty-live-dot { position: absolute; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--divider); }
.qty-live-dot-on { background: var(--cta); animation: pulse-ring 2s ease-in-out infinite; }
.qty-computed { background: var(--bg-surface); border: 1px solid var(--divider); border-radius: 8px; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qty-computed-item { display: flex; flex-direction: column; gap: 2px; }
.qty-computed-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.qty-computed-val { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 800; color: var(--cta); }
.qty-computed-val2 { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.qty-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 0.8rem; }

/* ══ P&L CALCULATOR ══ */
.pnl-layout { display: grid; grid-template-columns: 350px 1fr; gap: 16px; align-items: start; padding: 16px; flex: 1; overflow-y: auto; }
.pnl-inputs { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.pnl-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); padding: 16px; }
.pnl-card-title { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.pnl-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); display: block; margin-bottom: 4px; }
.pnl-select, .pnl-input { width: 100%; padding: 9px 10px; background: var(--bg-input); border: 1px solid var(--divider); border-radius: 8px; color: var(--text-primary); font-size: 0.82rem; font-weight: 700; font-family: var(--font-mono); outline: none; transition: border-color var(--transition); }
.pnl-select { cursor: pointer; }
.pnl-select:focus, .pnl-input:focus { border-color: var(--cta); }
.pnl-field { margin-bottom: 12px; }
.pnl-fields-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pnl-fields-3 { grid-template-columns: 1fr 1fr 1fr; }
.pnl-type-toggle { position: relative; display: flex; padding: 4px; background: var(--bg-input); border-radius: 8px; border: 1px solid var(--divider); }
.pnl-type-bg { position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); bottom: 4px; background: linear-gradient(135deg, var(--cta), var(--cta-dark)); border-radius: 6px; transition: transform 0.25s ease; z-index: 0; }
.pnl-type-btn { flex: 1; padding: 8px 4px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; position: relative; z-index: 1; border-radius: 5px; transition: color var(--transition); color: var(--text-muted); }
.pnl-type-active { color: #fff; }
.pnl-qty-display { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 800; color: var(--cta); padding: 9px 10px; background: var(--bg-input); border: 1px solid var(--divider); border-radius: 8px; }
.pnl-slider-wrap { margin-bottom: 12px; }
.pnl-slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.pnl-slider-val { padding: 3px 8px; border-radius: 5px; font-size: 0.68rem; font-weight: 800; background: var(--cta-subtle); color: var(--cta); border: 1px solid rgba(16,185,129,0.2); }
.slider-val-up { background: var(--cta-subtle); color: var(--cta); border-color: rgba(16,185,129,0.2); }
.slider-val-down { background: var(--red-subtle); color: var(--red); border-color: rgba(244,63,94,0.2); }
.pnl-slider { width: 100%; accent-color: var(--cta); }
.pnl-api-status { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--divider); font-size: 0.65rem; font-weight: 600; color: var(--text-muted); font-family: var(--font-mono); }
.pnl-api-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--cta); animation: pulse-ring 2s ease-in-out infinite; }
.dot-amber { background: var(--amber); animation: pulse-ring 1.5s ease-in-out infinite; }
.pnl-results { display: flex; flex-direction: column; gap: 12px; }
.pnl-net-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); padding: 28px; text-align: center; transition: border-color var(--transition); }
.pnl-net-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); margin-bottom: 10px; }
.pnl-net-val { font-family: var(--font-display); font-size: 2.8rem; font-weight: 900; color: var(--text-tertiary); transition: color var(--transition); }
.pnl-net-pct { font-size: 0.9rem; font-weight: 700; color: var(--text-tertiary); margin-top: 4px; }
.pnl-breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pnl-breakdown-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); padding: 16px; }
.pnl-breakdown-rows { display: flex; flex-direction: column; gap: 0; }
.pnl-breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(30,50,80,0.4); font-size: 0.75rem; font-family: var(--font-mono); }
.pnl-breakdown-row span:first-child { color: var(--text-muted); }
.pnl-breakdown-row span:last-child { font-weight: 700; color: var(--text-secondary); }
.pnl-total-row { border-top: 2px solid var(--divider); font-weight: 800; }
.pnl-bar-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--divider); }
.pnl-bar-labels { display: flex; justify-content: space-between; font-size: 0.58rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.pnl-bar-track { width: 100%; height: 4px; background: var(--bg-surface); border-radius: 4px; overflow: hidden; }
.pnl-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cta), var(--cta-dark)); border-radius: 4px; transition: width 0.4s ease; }

/* ══ PAYMENTS VIEW ══ */
.payments-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; padding: 12px 16px 0; }
.pay-search-wrap { position: relative; flex: 1; min-width: 180px; }
.pay-search { width: 100%; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 8px; color: var(--text-primary); font-size: 0.78rem; font-weight: 600; outline: none; }
.pay-filter-select { padding: 8px 10px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 8px; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; outline: none; cursor: pointer; }
.pay-export-btn, .pay-audio-btn { padding: 8px 14px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 5px; }
.pay-export-btn:hover, .pay-audio-btn:hover { border-color: var(--cta); color: var(--cta); }
.pay-status-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; }
.status-success { background: var(--cta-subtle); color: var(--cta); }
.status-processing { background: rgba(245,158,11,0.12); color: var(--amber); }
.status-failed { background: var(--red-subtle); color: var(--red); }

/* ══ SETTINGS VIEW ══ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 16px; overflow-y: auto; flex: 1; align-content: start; }
.settings-card { background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-lg); overflow: visible; }
.settings-card-header { padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.settings-card-title { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.profile-section { padding: 20px 16px; display: flex; gap: 16px; align-items: flex-start; }
.profile-photo-wrap { position: relative; flex-shrink: 0; }
.profile-photo-circle { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--cta-dark), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 900; color: #fff; overflow: hidden; }
.profile-photo-upload-btn { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
.profile-photo-upload-btn:hover { background: var(--cta-subtle); color: var(--cta); border-color: var(--cta); }
.profile-info-rows { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.profile-info-row { display: flex; justify-content: space-between; align-items: center; }
.profile-info-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.profile-info-val { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-align: right; }
.settings-role-badge { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.settings-section-body { padding: 16px; }
.theme-toggle-section { padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.theme-toggle-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.theme-toggle-desc { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.theme-switch { width: 42px; height: 22px; background: var(--bg-highlight); border: 1px solid var(--divider); border-radius: 11px; position: relative; cursor: pointer; transition: background var(--transition); flex-shrink: 0; }
.theme-switch-on { background: var(--cta-subtle); border-color: var(--cta); }
.theme-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: transform 0.25s ease, background var(--transition); }
.theme-switch-on .theme-switch-thumb { background: var(--cta); transform: translateX(20px); }
.settings-logout-btn { display: flex; align-items: center; gap: 8px; padding: 11px 20px; background: var(--red-subtle); border: 1px solid rgba(244,63,94,0.25); border-radius: 8px; color: var(--red); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; transition: all var(--transition); }
.settings-logout-btn:hover { background: rgba(244,63,94,0.18); }
.settings-card-sub { font-size: 0.62rem; color: var(--text-muted); margin-top: 4px; }
.settings-toggle-list { padding: 0 16px; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.settings-toggle-row:last-child { border-bottom: none; }
.settings-toggle-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.settings-toggle-desc { font-size: 0.65rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.settings-field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.settings-field { display: flex; flex-direction: column; gap: 5px; }
.settings-field-label { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.settings-field-select, .settings-field-input { padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--divider); border-radius: 7px; color: var(--text-primary); font-size: 0.85rem; font-weight: 700; font-family: var(--font-mono); outline: none; transition: border-color var(--transition); width: 100%; box-sizing: border-box; display: block; }
.settings-field-select:focus, .settings-field-input:focus { border-color: var(--cta); box-shadow: 0 0 0 2px var(--cta-subtle); }
textarea.settings-field-input { resize: vertical; min-height: 60px; font-size: 0.78rem; line-height: 1.5; }
.settings-save-msg { font-size: 0.65rem; font-weight: 700; color: var(--cta); }
.settings-action-list { display: flex; flex-direction: column; gap: 0; }
.settings-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--divider); }
.settings-action-row:last-child { border-bottom: none; }
.settings-small-btn { display: flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 6px; color: var(--text-secondary); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all var(--transition); }
.settings-small-btn:hover { border-color: var(--cta); color: var(--cta); }
.settings-danger-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-subtle); }
.settings-info-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 6px; font-size: 0.65rem; color: var(--text-muted); }
.pwa-install-options { display: flex; flex-direction: column; gap: 10px; }
.pwa-install-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; background: var(--cta-subtle); border: 1px solid rgba(16,185,129,0.3); border-radius: 8px; color: var(--cta); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; transition: all var(--transition); }
.pwa-install-btn:hover { background: rgba(16,185,129,0.15); }
.pwa-ios-steps { display: flex; flex-direction: column; gap: 8px; }
.pwa-ios-step { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; color: var(--text-secondary); }
.pwa-step-num { width: 20px; height: 20px; background: var(--cta-subtle); border: 1px solid rgba(16,185,129,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 900; color: var(--cta); flex-shrink: 0; }
.pwa-installed-msg { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; color: var(--cta); }
.pwa-install-hint { display: flex; align-items: center; gap: 6px; font-size: 0.65rem; color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: 6px; padding: 8px 10px; }
.about-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.about-rows { display: flex; flex-direction: column; gap: 0; }
.about-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--divider); font-size: 0.68rem; color: var(--text-muted); }
.about-row:last-child { border-bottom: none; }
.about-row span:first-child { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.6rem; }

/* ══ FOMO POPUP — Full Styling ══ */
.fomo-popup {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 9999;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04), 0 0 40px rgba(16,185,129,0.06);
  max-width: 316px;
  width: 316px;
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  pointer-events: none;
}
.fomo-popup.fomo-show { transform: translateX(0); opacity: 1; pointer-events: all; }

/* Badge (icon + ping) */
.fomo-badge-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fomo-badge-success { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(52,211,153,0.1)); border: 1px solid rgba(16,185,129,0.3); box-shadow: 0 0 16px rgba(16,185,129,0.2); }
.fomo-badge-fail { background: linear-gradient(135deg, rgba(244,63,94,0.18), rgba(248,113,113,0.08)); border: 1px solid rgba(244,63,94,0.3); box-shadow: 0 0 16px rgba(244,63,94,0.15); }
.fomo-badge-inner { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.fomo-verify-svg { width: 28px; height: 28px; }
@keyframes fomoStarPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fomoCheckDraw {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}
.fomo-star-path {
  color: var(--cta);
  transform-origin: center;
  animation: fomoStarPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.fomo-check-path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: fomoCheckDraw 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}
.fomo-ping {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fomo-ping-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: fomo-ring-expand 1.5s ease-in-out infinite;
  border: 2px solid var(--cta);
  opacity: 0;
}
.fomo-ping-ring-fail { border-color: var(--red); }
@keyframes fomo-ring-expand { 0%{transform:scale(0.6);opacity:0.8;}100%{transform:scale(2);opacity:0;} }
.fomo-ping-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-elevated);
  position: relative;
  z-index: 1;
}
.fomo-ping-success { background: var(--cta); }
.fomo-ping-fail { background: var(--red); }

/* Content area */
.fomo-content { flex: 1; min-width: 0; }
.fomo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.fomo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 99px;
}
.fomo-status-success { background: rgba(16,185,129,0.15); color: var(--cta-light); border: 1px solid rgba(16,185,129,0.25); }
.fomo-status-fail { background: rgba(244,63,94,0.12); color: #F87171; border: 1px solid rgba(244,63,94,0.2); }
.fomo-pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.fomo-pulse-success { background: var(--cta); animation: dot-pulse 1.5s ease-in-out infinite; }
.fomo-pulse-fail { background: var(--red); animation: dot-pulse 1.5s ease-in-out infinite; }
.fomo-just-now { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* Purchaser row */
.fomo-purchaser {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-family: var(--font-display);
  flex-wrap: wrap;
}
.fomo-purchaser svg { color: var(--cta); flex-shrink: 0; }
.fomo-city {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* Plan / Price divider */
.fomo-divider {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--divider-soft);
  border-bottom: 1px solid var(--divider-soft);
  margin-bottom: 8px;
}
.fomo-plan-col, .fomo-price-col { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.fomo-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.fomo-plan-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}
.fomo-plan-price {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.fomo-price-success { color: var(--cta-light); }
.fomo-price-fail { color: #F87171; }

/* Footer */
.fomo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fomo-payment-info {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.fomo-verified-success {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--cta);
  background: rgba(16,185,129,0.1);
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(16,185,129,0.2);
}
.fomo-verified-fail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #F87171;
  background: rgba(244,63,94,0.08);
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(244,63,94,0.18);
}
[data-theme="light"] .fomo-popup { background: #fff; border-color: #D0DCF0; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
[data-theme="light"] .fomo-badge-success { background: rgba(16,185,129,0.1); }
[data-theme="light"] .fomo-badge-fail { background: rgba(244,63,94,0.08); }

/* ══ LOGIN SCREEN ══ */
.view-login-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.login-backdrop { position: absolute; inset: 0; background: rgba(6, 10, 20, 0.4); z-index: 0; }
.login-card { position: relative; width: 100%; max-width: 400px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius-xl); padding: 40px 36px; overflow: hidden; box-shadow: var(--shadow-lg); z-index: 1; }
.login-glow-1 { position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; background: radial-gradient(circle, var(--cta-subtle) 0%, transparent 70%); pointer-events: none; }
.login-glow-2 { position: absolute; bottom: -60px; left: -60px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%); pointer-events: none; }
.login-inner { position: relative; z-index: 1; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo { height: 44px; margin: 0 auto 12px; display: block; }
.login-brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.login-brand-tag { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.25em; color: var(--text-muted); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.login-input-wrap { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--divider); border-radius: var(--border-radius); overflow: hidden; transition: border-color var(--transition); }
.login-input-wrap:focus-within { border-color: var(--cta); box-shadow: 0 0 0 3px var(--cta-subtle); }
.login-flag { padding: 14px 12px; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; border-right: 1px solid var(--divider); white-space: nowrap; }
.login-input { flex: 1; padding: 14px 14px; background: transparent; border: none; outline: none; font-size: 1.1rem; font-weight: 800; color: var(--cta); font-family: var(--font-mono); letter-spacing: 0.08em; }
.login-input::placeholder { color: var(--text-tertiary); font-weight: 400; }
.login-btn { padding: 15px; background: linear-gradient(135deg, var(--cta), var(--cta-dark)); color: #fff; border: none; border-radius: var(--border-radius); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-cta); }
.login-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.login-btn:active { transform: scale(0.98); }
.login-msg { font-size: 0.72rem; font-weight: 600; text-align: center; min-height: 18px; transition: all var(--transition); }
.login-pwa { margin-top: 8px; }
.login-divider { display: flex; align-items: center; margin: 12px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--divider); }
.login-divider span { padding: 0 10px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.login-install-btn { width: 100%; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--divider); border-radius: var(--border-radius); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.login-install-btn:hover { border-color: var(--cta); color: var(--cta); }
.logo-light-mode { display: none; }
.logo-dark-mode { display: block; }
[data-theme="light"] .logo-light-mode { display: block; }
[data-theme="light"] .logo-dark-mode { display: none; }


/* ══ TOAST ══ */
.toast { padding: 11px 16px; border-radius: 9px; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-md); transition: opacity 0.3s ease; border: 1px solid var(--divider); }
.toast-success { background: var(--bg-elevated); color: var(--cta); border-color: rgba(16,185,129,0.25); }
.toast-error { background: var(--bg-elevated); color: var(--red); border-color: rgba(244,63,94,0.25); }
.toast-info { background: var(--bg-elevated); color: var(--text-secondary); }

/* ══ FOMO POPUP ══ */
/* Duplicate fomo-popup rule removed — see line 1514 */
.fomo-popup.fomo-show { transform: translateX(0); opacity: 1; pointer-events: all; }

/* ══ NOTIFICATION PANEL ══ */
.notif-panel {
  position: fixed;
  top: calc(var(--ticker-h) + var(--header-h) + 6px);
  right: calc(var(--right-panel-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;
  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-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-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); }

/* ══ AC2 ALERT CENTER ══ */
.ac2 { display: flex; flex-direction: column; gap: 0; background: transparent; }
.ac2-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; 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; }
.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-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); }
.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; }
.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); }
.ac2-disconnected { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.ac2-connected { display: none; padding: 22px 14px; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.ac2-card.is-connected .ac2-disconnected { display: none; }
.ac2-card.is-connected .ac2-connected { display: flex; }
.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; }
.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); }
.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); }
.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-connected-icon { color: var(--cta); margin-bottom: 4px; }
.ac2-connected-label { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.ac2-connected-handle { font-size: 0.7rem; font-weight: 600; color: #29B6F6; font-family: var(--font-mono); }
.ac2-connected-meta { font-size: 0.6rem; color: var(--cta); margin-top: 2px; }
.ac2-divider { height: 1px; background: var(--divider); margin: 14px 0 0; display: none; }
.ac2-divider.settings-open { display: block !important; }
.ac2-channels { padding: 12px 14px; display: none; 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; }
.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--amber { background: var(--cta-dim); color: var(--cta); }
.ac2-ch-icon--blue  { background: var(--cta-dim); color: var(--cta-light); }
.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); }
.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; }
.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); }
[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; }

/* ══ MOBILE ══ */
.mobile-menu-btn { display: none; }
#mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 250; display: none; }
.sidebar.mobile-open ~ #mobile-overlay { display: block; }

/* ══ ANIMATIONS ══ */
@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); }
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@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 spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@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); }
}
@keyframes live-ring { 0%,100%{transform:scale(1);opacity:0.5;} 50%{transform:scale(1.5);opacity:0;} }
@keyframes skeletonShimmer { 0%{background-position:-400px 0}100%{background-position:400px 0} }
@keyframes modal-drop { from{opacity:0;transform:translateY(-20px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes shake { 10%,90%{transform:translateX(-2px)}20%,80%{transform:translateX(4px)}30%,50%,70%{transform:translateX(-5px)}40%,60%{transform:translateX(5px)} }
@keyframes flash-anim { 0%,100%{background:transparent}50%{background:rgba(16,185,129,0.15)} }
.flash-up { background: rgba(16,185,129,0.15) !important; animation: flash-anim 0.6s ease; }
.flash-down { background: rgba(244,63,94,0.1) !important; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1280px) {
  :root { --right-panel-w: 240px; }
}
@media (max-width: 1024px) {
  .right-panel { display: none; }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    transform: translateX(-100%);
    z-index: 300;
    transition: transform 0.25s ease;
    width: var(--sidebar-full) !important;
    min-width: var(--sidebar-full) !important;
    height: calc(100vh - var(--ticker-h));
    top: var(--ticker-h);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.expanded {
    width: var(--sidebar-full) !important;
    min-width: var(--sidebar-full) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  /* Mobile overlay when sidebar open */
  .sidebar.mobile-open::after {
    content: '';
    position: fixed;
    top: 0; left: var(--sidebar-full); right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: -1;
  }
  .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; }
  .brand-tag { display: none; }
  .scan-badge { display: none; }
  #header-upgrade-btn { display: none; }
  .header-user-info { display: none; }
  .terminal-header { padding: 0 12px; gap: 8px; }
  .header-right { gap: 6px; }
  .sc-tab-btn { padding: 0 10px; font-size: 0.7rem; gap: 4px; }
  .pnl-layout, .calc-layout { grid-template-columns: 1fr; }
  .pnl-breakdown-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .heatmap-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px; }
  .payments-toolbar { flex-direction: column; gap: 8px; }
  .pay-search-wrap { min-width: 100%; }
  .fomo-popup { bottom: 12px; left: 12px; max-width: 280px; width: 280px; }
  .quadrant-info-bar { padding: 0 12px; gap: 8px; }
  .qi-desc { display: none; }
}
@media (max-width: 480px) {
  .pnl-fields-grid, .pnl-fields-3 { grid-template-columns: 1fr 1fr; }
  .heatmap-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .qty-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .brand-name { font-size: 0.88rem; }
}

/* Light mode card differentiation */
[data-theme="light"] .settings-card {
  border-color: #C5D3E8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .pnl-card,
[data-theme="light"] .config-card,
[data-theme="light"] .config-metrics-card {
  border-color: #C5D3E8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .heatmap-card {
  border-color: #C5D3E8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="light"] .qty-card {
  border-color: #C5D3E8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="light"] .rp-pay-metric,
[data-theme="light"] .rp-deck-metric {
  border-color: #C5D3E8;
}

/* Styled Step badges for onboarding/walkthrough */
.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-highlight);
  border: 1px solid var(--divider);
  color: var(--cta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}
[data-theme="light"] .step-badge {
  background: #EDF2FA;
  border-color: #C5D3E8;
  color: #000000;
}
