/* ==========================================================================
   DALAL STREET PULSE - STYLESHEET
   Aesthetic: Trading Terminal / Institutional Dark Theme
   ========================================================================== */

:root {
  /* Surface colors - Institutional Terminal Dark Theme */
  --bg-core: #080c14;
  --bg-surface-1: #101726;
  --bg-surface-2: #182236;
  --bg-surface-hover: #22304c;
  --bg-glass: rgba(16, 23, 38, 0.94);

  /* Border colors */
  --border-subtle: #293750;
  --border-active: #43597d;
  --border-glow: rgba(0, 230, 118, 0.35);

  /* Typography colors - Crystal Clear & High Contrast */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  /* Trading Accent Colors */
  --gain-color: #00e676;
  --gain-bg: rgba(0, 230, 118, 0.16);
  --gain-border: rgba(0, 230, 118, 0.4);

  --loss-color: #ff5252;
  --loss-bg: rgba(255, 82, 82, 0.16);
  --loss-border: rgba(255, 82, 82, 0.4);

  --earnings-color: #38bdf8;
  --earnings-bg: rgba(56, 189, 248, 0.16);
  --earnings-border: rgba(56, 189, 248, 0.38);

  --policy-color: #fbbf24;
  --policy-bg: rgba(251, 191, 36, 0.16);
  --policy-border: rgba(251, 191, 36, 0.38);

  /* Source Brand Colors */
  --et-color: #ff9800;
  --et-bg: rgba(255, 152, 0, 0.16);
  --bs-color: #3b82f6;
  --bs-bg: rgba(59, 130, 246, 0.16);
  --mint-color: #10b981;
  --mint-bg: rgba(16, 185, 129, 0.16);

  /* Font stacks */
  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions & Shadows */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-active);
}

/* ==========================================================================
   TITANIUM PRO LIGHT THEME (Koyfin / TradingView Pro Minimalist Palette)
   ========================================================================== */
[data-theme="light"] {
  /* Rich Titanium Pearl Surfaces */
  --bg-core: #eef2f6;
  --bg-surface-1: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-surface-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.92);

  /* Precise Architectural Borders */
  --border-subtle: #d3dce6;
  --border-active: #94a3b8;
  --border-glow: rgba(2, 132, 199, 0.3);

  /* High-Contrast Editorial Navy & Slate */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Vibrant Pro Signal Accents */
  --gain-color: #059669;
  --gain-bg: #ecfdf5;
  --gain-border: #6ee7b7;

  --loss-color: #dc2626;
  --loss-bg: #fef2f2;
  --loss-border: #fca5a5;

  --earnings-color: #2563eb;
  --earnings-bg: #eff6ff;
  --earnings-border: #93c5fd;

  --policy-color: #d97706;
  --policy-bg: #fffbeb;
  --policy-border: #fde68a;

  /* Ambient Glass Elevations */
  --shadow-card: 0 2px 4px rgba(15, 23, 42, 0.04), 0 10px 24px -4px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 16px 36px -6px rgba(15, 23, 42, 0.13), 0 0 0 1px #94a3b8;
}

/* Light Theme Component Overrides */
[data-theme="light"] body {
  background-color: #eef2f6;
  background-image: radial-gradient(at 0% 0%, #e2e8f0 0, transparent 40%), radial-gradient(at 100% 100%, #e5e9f0 0, transparent 40%);
  background-attachment: fixed;
  color: #0f172a;
}

[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #d3dce6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .brand-title {
  color: #0f172a;
  letter-spacing: 0.02em;
}

[data-theme="light"] .accent-title {
  background: linear-gradient(90deg, #059669, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .zerolive-logo-svg {
  color: #0f172a;
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.08));
}

[data-theme="light"] .brand-title {
  color: #0f172a;
}

[data-theme="light"] .accent-live {
  color: #059669;
}

[data-theme="light"] .brand-tagline {
  color: #64748b;
}

[data-theme="light"] .live-clock-pill {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.1);
}

[data-theme="light"] .clock-pulse-dot {
  background-color: #d97706;
  box-shadow: 0 0 6px #d97706;
}

[data-theme="light"] .clock-label {
  color: #b45309;
}

[data-theme="light"] .clock-time {
  color: #78350f;
}

[data-theme="light"] .market-status-pill.open {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

[data-theme="light"] .market-status-pill.closed {
  background: #f8fafc;
  border-color: #d3dce6;
  color: #475569;
}

/* Sleek Black Terminal Market Ticker Ribbon (Preserved in Light Theme) */
[data-theme="light"] .market-ticker-wrap {
  background: #090d16;
  border-bottom: 1px solid #1e293b;
}

[data-theme="light"] .ticker-badge {
  color: #38bdf8;
  background: #111827;
  border-right: 1px solid #1e293b;
  font-weight: 800;
}

[data-theme="light"] .ticker-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

[data-theme="light"] .ticker-item:hover {
  background: #1e293b;
  border-color: #38bdf8;
}

[data-theme="light"] .ticker-name {
  color: #cbd5e1;
  font-weight: 800;
}

[data-theme="light"] .ticker-price {
  color: #ffffff;
  font-weight: 800;
}

[data-theme="light"] .ticker-change.gain {
  color: #00e676;
  background: rgba(0, 230, 118, 0.2);
  border: 1px solid rgba(0, 230, 118, 0.45);
}

[data-theme="light"] .ticker-change.loss {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.2);
  border: 1px solid rgba(255, 82, 82, 0.45);
}

/* Light Theme Stats Bar */
[data-theme="light"] .stats-bar {
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .stat-label {
  color: #475569;
  font-weight: 700;
}

[data-theme="light"] .stat-value {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .stat-divider {
  background: #cbd5e1;
}

[data-theme="light"] #statBullishCount {
  color: #047857;
}

[data-theme="light"] #statBearishCount {
  color: #b91c1c;
}

[data-theme="light"] #autoRefreshCountdown {
  color: #0284c7;
}

[data-theme="light"] #lastUpdatedTime {
  color: #0f172a;
}

[data-theme="light"] #statTotalArticles {
  color: #0f172a;
}

/* Light Theme Header Sync Info */
[data-theme="light"] .sync-label {
  color: #64748b;
  font-weight: 700;
}

[data-theme="light"] .sync-time {
  color: #0f172a;
  font-weight: 700;
}

[data-theme="light"] .btn-theme-toggle {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}

[data-theme="light"] .btn-push-toggle {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-push-toggle:hover {
  background: #f1f5f9;
  border-color: #0284c7;
  color: #0f172a;
}

[data-theme="light"] .btn-refresh {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-refresh:hover {
  background: #f1f5f9;
  border-color: #059669;
  color: #059669;
}

[data-theme="light"] .control-panel-wrapper {
  background: #ffffff;
  border: 1px solid #d3dce6;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .source-tab {
  background: #ffffff;
  border: 1px solid #d3dce6;
  color: #334155;
  font-weight: 600;
}

[data-theme="light"] .source-tab:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0f172a;
}

/* Active Source Tab (Vibrant Pro Sapphire) */
[data-theme="light"] .source-tab.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .source-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-weight: 800;
}

/* Crisp Colorful Number Badges on Inactive Tabs */
[data-theme="light"] .tab-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

[data-theme="light"] .source-tab:hover .tab-badge {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] #sourceNSE .tab-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

[data-theme="light"] #sourceBSE .tab-badge {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

[data-theme="light"] #sourceET .tab-badge {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

[data-theme="light"] #sourceBS .tab-badge {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

[data-theme="light"] #sourceLiveMint .tab-badge {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] #sourceMC .tab-badge {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] #sourceReuters .tab-badge {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

[data-theme="light"] #sourceYahoo .tab-badge {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

[data-theme="light"] #sourceCNBC .tab-badge {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

[data-theme="light"] #sourceTrump .tab-badge {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

[data-theme="light"] .sentiment-pill {
  border-color: #d3dce6;
  color: #475569;
  background: #ffffff;
}

[data-theme="light"] .sentiment-pill:hover {
  border-color: #0284c7;
  color: #0f172a;
  background: #f8fafc;
}

/* Active Signal Pill (Vibrant Pro Sapphire) */
[data-theme="light"] .sentiment-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

[data-theme="light"] .search-box input {
  background: #f8fafc;
  border: 1px solid #d3dce6;
  color: #0f172a;
}

[data-theme="light"] .search-box input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

[data-theme="light"] .news-card {
  background: #ffffff;
  border: 1px solid #d3dce6;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .news-card:hover {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

[data-theme="light"] .card-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.01em;
}

[data-theme="light"] .card-title a:hover {
  color: #0284c7;
}

[data-theme="light"] .card-description {
  color: #334155;
  line-height: 1.58;
}

[data-theme="light"] .card-footer {
  border-top: 1px solid #f1f5f9;
}

[data-theme="light"] .card-link-out {
  color: #0284c7;
  font-weight: 700;
}

[data-theme="light"] .card-link-out:hover {
  color: #0369a1;
}

[data-theme="light"] .card-link-out.link-pdf {
  color: #b45309;
}

[data-theme="light"] .card-link-out.link-pdf:hover {
  color: #78350f;
}

[data-theme="light"] .btn-card-action {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .btn-card-action:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Light Source Badges */
[data-theme="light"] .source-nse { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; font-weight: 700; }
[data-theme="light"] .source-bse { background: #f3e8ff; color: #6d28d9; border: 1px solid #d8b4fe; font-weight: 700; }
[data-theme="light"] .source-et { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700; }
[data-theme="light"] .source-bs { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; font-weight: 700; }
[data-theme="light"] .source-livemint { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; font-weight: 700; }
[data-theme="light"] .source-mc { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; font-weight: 700; }
[data-theme="light"] .source-reuters { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700; }
[data-theme="light"] .source-yahoo { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; font-weight: 700; }
[data-theme="light"] .source-cnbc { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; font-weight: 700; }
[data-theme="light"] .source-trump { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; font-weight: 700; }

/* Light Sentiment Badges */
[data-theme="light"] .badge-sentiment.BULLISH { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; font-weight: 700; }
[data-theme="light"] .badge-sentiment.BEARISH { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; font-weight: 700; }
[data-theme="light"] .badge-sentiment.EARNINGS { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; font-weight: 700; }
[data-theme="light"] .badge-sentiment.POLICY { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }

[data-theme="light"] .btn-refresh,
[data-theme="light"] .btn-theme-toggle {
  background: #ffffff;
  border: 1px solid #d3dce6;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .btn-refresh:hover {
  background: #f8fafc;
  border-color: #059669;
  color: #059669;
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #f8fafc;
  border-color: #0284c7;
}

[data-theme="light"] .app-footer {
  background: #ffffff;
  border-top: 1px solid #d3dce6;
}

[data-theme="light"] .footer-brand {
  color: #0f172a;
}

[data-theme="light"] .skeleton-card {
  background: linear-gradient(90deg, #ffffff 25%, #f1f5f9 50%, #ffffff 75%);
  background-size: 200% 100%;
  border: 1px solid #d3dce6;
}

[data-theme="light"] .toast {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .btn-back-top {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .btn-back-top:hover {
  background: #0f172a;
  color: #ffffff;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  background-color: var(--bg-core);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  line-height: 1.55;
  background-color: var(--bg-core);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Utilities */
.hidden { display: none !important; }
.font-mono { font-family: var(--font-mono); }
.text-gain { color: var(--gain-color) !important; font-weight: 700; }
.text-loss { color: var(--loss-color) !important; font-weight: 700; }
.text-cyan { color: #38bdf8 !important; font-weight: 600; }

/* ==========================================================================
   TOP NAVIGATION & HEADER
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zerolive-logo-svg {
  color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.25));
}

.zerolive-logo-svg:hover {
  transform: scale(1.06);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
}

.accent-live {
  color: #00e676;
  font-weight: 700;
}

.brand-tagline {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #cbd5e1;
  margin-top: 2px;
  text-transform: none;
}

/* Market Meta & Sync Controls */
.market-meta-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.48);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.18);
}

[data-theme="light"] .live-clock-pill {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: none;
}

.clock-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: clockBlink 1s infinite alternate;
}

[data-theme="light"] .clock-pulse-dot {
  background-color: #d97706;
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.6);
}

@keyframes clockBlink {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 5px #f59e0b); }
}

.clock-label {
  color: #fde047;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

[data-theme="light"] .clock-label {
  color: #b45309;
}

.clock-time {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.05em;
}

[data-theme="light"] .clock-time {
  color: #78350f;
}

.market-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.85rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.market-status-pill.open {
  border-color: rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.16);
  color: #00e676;
}
.market-status-pill.open .status-dot {
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
}

.market-status-pill.closed {
  border-color: #3b4d66;
  background: #182236;
  color: #cbd5e1;
}
.market-status-pill.closed .status-dot {
  background: #94a3b8;
}

.market-status-pill.preopen {
  border-color: var(--policy-border);
  background: var(--policy-bg);
  color: var(--policy-color);
}
.market-status-pill.preopen .status-dot {
  background: var(--policy-color);
}

.sync-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sync-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.sync-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.sync-time {
  font-size: 0.82rem;
  color: #ffffff;
  font-weight: 700;
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s var(--ease-spring);
}

.btn-theme-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: #38bdf8;
  transform: scale(1.05);
}

.btn-theme-toggle:active {
  transform: scale(0.95);
}

.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.15));
  border: 1px solid #38bdf8;
  color: #38bdf8;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.btn-install-pwa:hover {
  background: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

[data-theme="light"] .btn-install-pwa {
  background: #eff6ff;
  border: 1px solid #0284c7;
  color: #0284c7;
}

[data-theme="light"] .btn-install-pwa:hover {
  background: #0284c7;
  color: #ffffff;
}

body.pwa-installed .btn-install-pwa {
  display: none !important;
}

.btn-nav-about {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-secondary);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.btn-nav-about:hover {
  background: var(--bg-surface-hover);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

[data-theme="light"] .btn-nav-about {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-nav-about:hover {
  background: #f1f5f9;
  border-color: #0284c7;
  color: #0284c7;
}

.btn-push-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-secondary);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.btn-push-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: #f59e0b;
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-push-toggle.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.btn-push-toggle.active .push-icon {
  animation: bellRing 2.5s ease infinite;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-12deg); }
  20%, 40% { transform: rotate(12deg); }
  50% { transform: rotate(0); }
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.btn-refresh:hover {
  background: var(--bg-surface-hover);
  border-color: var(--gain-color);
  color: var(--gain-color);
}

.btn-refresh:active {
  transform: scale(0.96);
}

.btn-refresh.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Market Indices Ribbon */
.market-ticker-wrap {
  display: flex;
  align-items: center;
  background: #0f1626;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  height: 40px;
  position: relative;
  z-index: 90;
}

.ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem;
  height: 100%;
  background: #182236;
  border-right: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .ticker-badge {
  color: #0284c7;
  background: #f1f5f9;
  border-right: 1px solid #d3dce6;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.market-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  padding: 0 1rem;
}

.market-ticker-track:hover {
  animation-play-state: paused;
}

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.ticker-item:hover {
  background: var(--bg-surface-hover);
  border-color: #38bdf8;
}

.ticker-name {
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ticker-price {
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
}

.ticker-change {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.ticker-change.gain {
  color: #00e676;
  background: rgba(0, 230, 118, 0.2);
  border: 1px solid rgba(0, 230, 118, 0.45);
}

.ticker-change.loss {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.2);
  border: 1px solid rgba(255, 82, 82, 0.45);
}

/* Stats Bar */
.stats-bar {
  background: #111827;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.45rem 1.25rem;
  overflow-x: auto;
}

.stats-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.stat-label {
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-value {
  color: #ffffff;
  font-weight: 800;
}

.stat-divider {
  width: 1px;
  height: 14px;
  background: #334155;
}

/* ==========================================================================
   CONTROL PANEL & FILTERS
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.control-panel {
  margin-bottom: 1.25rem;
}

.control-panel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-surface-1);
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: visible;
}

/* Source Tabs */
.source-tabs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  overflow: visible;
  position: relative;
}

.source-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: #182236;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f1f5f9;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.source-tab:hover {
  background: #22304c;
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.source-tab.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.source-tab.tab-important {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.source-tab.tab-important:hover {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.16);
}

.source-tab.tab-important.active {
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
  border-color: #fca5a5;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(220, 38, 38, 0.5);
}

.source-tab.tab-important.active .tab-badge {
  background: #ffffff;
  color: #991b1b;
}

[data-theme="light"] .source-tab.tab-important.active {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .source-tab.tab-important.active .tab-badge {
  background: #ffffff;
  color: #991b1b;
}

[data-theme="light"] .source-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #2563eb;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

.tab-badge {
  background: #0b1120;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  border: 1px solid #293750;
}

.source-tab.active .tab-badge {
  background: #ffffff;
  color: #0284c7;
  border-color: #ffffff;
}

[data-theme="light"] .source-tab.active .tab-badge {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="light"] .source-tab.active .tab-badge {
  background: #2563eb;
  color: #ffffff;
}

/* Source Tab Groups with Dropdowns */
.source-tab-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.source-tab-group:hover {
  border-color: var(--border-active);
}

.source-tab-group.active-parent {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

[data-theme="light"] .source-tab-group.active-parent {
  border-color: #2563eb;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

.source-tab-group .source-tab {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 8px 0 0 8px;
  padding-right: 0.45rem;
}

.source-tab-group .source-tab.active {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="light"] .source-tab-group .source-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.tab-dropdown-trigger {
  background: transparent;
  border: none;
  border-left: 1px solid #334155;
  color: #cbd5e1;
  padding: 0 0.65rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-dropdown-trigger:hover,
.source-tab-group.menu-open .tab-dropdown-trigger {
  background: var(--bg-surface-hover);
  color: #38bdf8;
}

[data-theme="light"] .tab-dropdown-trigger:hover,
[data-theme="light"] .source-tab-group.menu-open .tab-dropdown-trigger {
  color: #2563eb;
}

.tab-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #111827;
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  animation: fadeIn 0.15s ease;
}

[data-theme="light"] .tab-dropdown-menu {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.source-tab-group.menu-open .tab-dropdown-menu {
  display: flex;
}

.menu-mobile-header {
  display: none;
}

/* Desktop: No backdrop needed for dropdown menus */
.dropdown-backdrop {
  display: none !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #1e293b;
  color: #38bdf8;
  transform: translateX(3px);
}

.dropdown-item.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  font-weight: 800;
}

[data-theme="light"] .dropdown-item {
  color: #0f172a;
  font-weight: 700;
}

[data-theme="light"] .dropdown-item:hover {
  background: #f1f5f9;
  color: #0284c7;
}

[data-theme="light"] .dropdown-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

/* Secondary Actions */
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sentiment-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.sentiment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  background: #182236;
  border: 1px solid #334155;
  border-radius: 9999px;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sentiment-pill:hover {
  border-color: #38bdf8;
  background: #22304c;
  color: #ffffff;
}

.sentiment-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.gain-dot { background: var(--gain-color); box-shadow: 0 0 4px var(--gain-color); }
.loss-dot { background: var(--loss-color); box-shadow: 0 0 4px var(--loss-color); }
.earnings-dot { background: var(--earnings-color); }
.policy-dot { background: var(--policy-color); }
.macro-dot { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.7); }

.sentiment-pill.pill-macro.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(59, 130, 246, 0.35) 100%);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

[data-theme="light"] .sentiment-pill.pill-macro.active {
  background: #f3e8ff;
  border-color: #9333ea;
  color: #6b21a8;
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.2);
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
  flex: 1;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: #38bdf8;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 2.4rem;
  background: #182236;
  border: 1px solid #3b4d66;
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  background: #1f2c44;
}

.search-box input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.clear-search-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

/* Connection Alert Banner */
.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: #fca5a5;
  flex-wrap: wrap;
}

.connection-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.connection-banner a {
  color: #38bdf8;
  text-decoration: underline;
  font-weight: 700;
}

.connection-banner code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #f8fafc;
}

.banner-retry-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.banner-retry-btn:hover {
  opacity: 0.9;
}

/* Active Query Summary Bar */
.active-query-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}

.active-query-text {
  color: #38bdf8;
  font-weight: 500;
}

.btn-reset-filters {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.btn-reset-filters:hover {
  color: #f8fafc;
}

/* ==========================================================================
   NEWS FEED & CARDS
   ========================================================================== */
.feed-wrapper {
  position: relative;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1140px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual News Card */
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-spring), border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-hover);
  background: var(--bg-surface-2);
}

/* Top Accent Glow Stripe on Card */
.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.news-card.sentiment-BULLISH::before { background: linear-gradient(90deg, var(--gain-color), transparent); }
.news-card.sentiment-BEARISH::before { background: linear-gradient(90deg, var(--loss-color), transparent); }
.news-card.sentiment-EARNINGS::before { background: linear-gradient(90deg, var(--earnings-color), transparent); }
.news-card.sentiment-POLICY::before { background: linear-gradient(90deg, var(--policy-color), transparent); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-source {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.source-nse { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.source-bse { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.source-et { background: var(--et-bg); color: var(--et-color); border: 1px solid rgba(255, 152, 0, 0.25); }
.source-bs { background: var(--bs-bg); color: var(--bs-color); border: 1px solid rgba(59, 130, 246, 0.25); }
.source-livemint { background: var(--mint-bg); color: var(--mint-color); border: 1px solid rgba(16, 185, 129, 0.25); }
.source-mc { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.source-reuters { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.source-yahoo { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.source-cnbc { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.35); }
.source-trump { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.source-default { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

.badge-sentiment {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.badge-sentiment.BULLISH { background: var(--gain-bg); color: var(--gain-color); border: 1px solid var(--gain-border); }
.badge-sentiment.BEARISH { background: var(--loss-bg); color: var(--loss-color); border: 1px solid var(--loss-border); }
.badge-sentiment.EARNINGS { background: var(--earnings-bg); color: var(--earnings-color); border: 1px solid var(--earnings-border); }
.badge-sentiment.POLICY { background: var(--policy-bg); color: var(--policy-color); border: 1px solid var(--policy-border); }

.card-time {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}

/* Card Body */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.65rem;
  color: #ffffff;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.card-title a:hover {
  color: #38bdf8;
}

.card-description {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-link-out {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

.card-link-out:hover {
  color: #7dd3fc;
  gap: 0.55rem;
}

.card-link-out.link-pdf {
  color: #fbbf24;
}

.card-link-out.link-pdf:hover {
  color: #fde68a;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-card-action {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.32rem 0.48rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-card-action:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.btn-card-audio.playing {
  color: var(--gain-color);
  background: var(--gain-bg);
  border-color: var(--gain-border);
}

.audio-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 12px;
}

.equalizer-bar {
  width: 2px;
  background: currentColor;
  border-radius: 1px;
  animation: equalize 0.8s ease-in-out infinite alternate;
}

.equalizer-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.equalizer-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.equalizer-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes equalize {
  0% { height: 20%; }
  100% { height: 100%; }
}

.btn-card-bookmark.starred {
  color: #f59e0b !important;
}

.btn-card-bookmark.starred svg {
  fill: #f59e0b;
}

/* Clickable Ticker Tags */
.card-tickers {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.ticker-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
  text-decoration: none;
}

.ticker-tag:hover {
  background: #38bdf8;
  color: #0f172a;
  transform: translateY(-1px);
}

[data-theme="light"] .ticker-tag {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

[data-theme="light"] .ticker-tag:hover {
  background: #1d4ed8;
  color: #ffffff;
}

/* Starred Bookmarks Badge in Light Theme */
[data-theme="light"] #sourceBookmarks .tab-badge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   KEY EVENTS & ECONOMIC CALENDAR VIEW
   ========================================================================== */
.events-wrapper {
  margin-top: 0.5rem;
  animation: fadeIn 0.25s ease;
}

/* Calendar Header & Sub-Navigation */
.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-subnav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-1);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

[data-theme="light"] .calendar-subnav {
  background: #ffffff;
  border-color: #d3dce6;
}

.calendar-subtab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.calendar-subtab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.calendar-subtab.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
}

/* Calendar Filter Controls Bar */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

[data-theme="light"] .calendar-controls {
  background: #ffffff;
  border-color: #d3dce6;
}

.calendar-filters-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-filter-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.calendar-select-wrap {
  position: relative;
}

.calendar-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  transition: all 0.15s ease;
}

.calendar-select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.calendar-filters-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-date-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

.calendar-search-wrap input {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  outline: none;
  min-width: 200px;
}

.calendar-search-wrap input:focus {
  border-color: #38bdf8;
}

/* Economic Calendar Table */
.calendar-table-wrap {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .calendar-table-wrap {
  background: #ffffff;
  border-color: #d3dce6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.economic-calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.economic-calendar-table thead th {
  background: var(--bg-surface-2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

[data-theme="light"] .economic-calendar-table thead th {
  background: #f8fafc;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.economic-calendar-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.economic-calendar-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

[data-theme="light"] .economic-calendar-table tbody tr:hover {
  background: #f1f5f9;
}

.economic-calendar-table td {
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.cal-cell-datetime {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.cal-cell-country {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-cell-event {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.cal-impact-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-impact-badge.high {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.cal-impact-badge.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.cal-impact-badge.low {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.cal-cell-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
}

.cal-cell-actual {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: #38bdf8;
  text-align: right;
}

.cal-action-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cal-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

.holiday-badge-open {
  color: #4ade80;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.holiday-badge-closed {
  color: #f87171;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

[data-theme="light"] .cal-cell-datetime {
  color: #0f172a;
}

[data-theme="light"] .cal-cell-country {
  color: #0f172a;
}

[data-theme="light"] .cal-cell-event {
  color: #0f172a;
}

[data-theme="light"] .cal-cell-num {
  color: #334155;
}

[data-theme="light"] .cal-action-btn {
  color: #0284c7;
  border-color: #cbd5e1;
  background: #ffffff;
}

[data-theme="light"] .cal-action-btn:hover {
  background: #eff6ff;
  border-color: #0284c7;
}

.event-chip:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.event-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border-color: #38bdf8;
  color: #f0f9ff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

[data-theme="light"] .event-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
}

/* Events Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.event-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  opacity: 0.8;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .event-card {
  background: #ffffff;
  border-color: #d3dce6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .event-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.event-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.event-tags-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.event-category-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.event-country-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.event-countdown-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.event-countdown-pill.countdown-imminent {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.event-countdown-pill.countdown-soon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.event-countdown-pill.countdown-future {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.event-countdown-pill.countdown-today {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
  animation: pulse 1.5s infinite;
}

.event-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.event-date-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  background: var(--bg-surface-2);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
}

[data-theme="light"] .event-date-row {
  background: #f8fafc;
  color: #0284c7;
  border-left-color: #0284c7;
}

.event-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.event-track-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.event-track-btn:hover {
  background: var(--bg-surface-2);
  border-color: #38bdf8;
  color: #38bdf8;
}

@media (max-width: 768px) {
  .events-grid {
    grid-template-columns: 1fr;
  }
  .events-hero-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 1rem;
  }
  .events-hero-title {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   MODALS (3-Bullet TL;DR & Social Sharing)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-active);
  border-radius: 12px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s var(--ease-spring);
  overflow: hidden;
}

[data-theme="light"] .modal-card {
  background: #ffffff;
  border-color: #d3dce6;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: inline-block;
}

[data-theme="light"] .modal-badge {
  color: #0284c7;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
}

.tldr-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tldr-bullet-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

[data-theme="light"] .tldr-bullet-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.tldr-bullet-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tldr-bullet-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tldr-bullet-text strong {
  color: var(--text-primary);
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btn-listen-modal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-listen-modal:hover {
  border-color: var(--gain-color);
  color: var(--gain-color);
}

.btn-primary-modal {
  padding: 0.5rem 1rem;
  background: #0284c7;
  color: #ffffff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-primary-modal:hover {
  background: #0369a1;
}

/* Share Modal Options */
.share-preview-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--bg-surface-2);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

[data-theme="light"] .share-preview-text {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.share-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.share-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.3);
}

.share-whatsapp:hover {
  background: #25d366;
  color: #ffffff;
}

.share-telegram {
  background: rgba(0, 136, 204, 0.12);
  color: #0088cc;
  border-color: rgba(0, 136, 204, 0.3);
}

.share-telegram:hover {
  background: #0088cc;
  color: #ffffff;
}

.share-copy {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-active);
}

[data-theme="light"] .share-copy {
  background: #f8fafc;
  border-color: #d3dce6;
}

.share-copy:hover {
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */
.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 768px) {
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1140px) {
  .skeleton-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.skeleton-card {
  min-height: 220px;
  background: linear-gradient(90deg, #0d1118 25%, #18202d 50%, #0d1118 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-surface-1);
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  margin: 1rem 0;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: #38bdf8;
  color: #090d16;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #7dd3fc;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  background: var(--bg-surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1.25rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.45rem 0 0.65rem;
  font-size: 0.78rem;
}

.footer-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.15s ease;
}

.footer-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

[data-theme="light"] .footer-link {
  color: #0284c7;
}

[data-theme="light"] .footer-link:hover {
  color: #0369a1;
}

.footer-dot {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.footer-sources {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  line-height: 1.45;
  max-width: 780px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.badge-deploy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gain-color);
  background: var(--gain-bg);
  border: 1px solid var(--gain-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ==========================================================================
   TOAST NOTIFICATIONS & FLOATING CONTROLS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease-spring) forwards;
}

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

.btn-back-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 99;
}

.btn-back-top:hover {
  background: #38bdf8;
  color: #06090e;
  transform: translateY(-2px);
}

.drawer-handle-bar {
  display: none;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ARCHITECTURE (WORLD-CLASS MOBILE APP VIEW)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Ultra-Compact App Header */
  .top-nav {
    padding: 0.45rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-surface-1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
  }

  .brand-section {
    gap: 0.5rem;
    align-items: center;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .zerolive-logo-svg {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 1.18rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
  }

  .brand-tagline {
    display: block; /* Visible in mobile view */
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-secondary);
    margin-top: 1px;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }

  [data-theme="light"] .brand-tagline {
    color: #475569;
  }

  .market-meta-section {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
  }

  .live-clock-pill {
    padding: 0.28rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }

  .live-clock-pill .clock-label {
    display: none; /* Hide label text on mobile, keep pulse dot + live time */
  }

  .market-status-pill {
    display: none; /* Hide status text in header to conserve space on small screens */
  }

  .sync-controls {
    gap: 0.3rem;
  }

  .btn-push-toggle,
  .btn-theme-toggle,
  .btn-refresh,
  .btn-install-pwa {
    width: 33px;
    height: 33px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    flex-shrink: 0;
  }

  .btn-install-pwa .install-label,
  .btn-push-toggle .push-label,
  .btn-refresh .refresh-label {
    display: none; /* Show only icons on mobile */
  }

  .btn-push-toggle .push-icon {
    font-size: 0.92rem;
  }

  /* 2. Compact Market Ticker Bar */
  .market-ticker-wrap {
    padding: 0.32rem 0.5rem;
  }

  .ticker-badge {
    padding: 0.18rem 0.45rem;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .ticker-item {
    padding: 0.18rem 0.65rem;
    font-size: 0.72rem;
    gap: 0.3rem;
  }

  /* 3. High-Density Micro-Stats Bar */
  .stats-bar {
    padding: 0.45rem 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stats-bar::-webkit-scrollbar {
    display: none;
  }

  .stats-content {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem;
    min-width: max-content;
  }

  .stat-item {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-surface-2);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
  }

  .stat-divider {
    display: none;
  }

  /* 4. Swipeable Filter Chip Rails */
  .filter-section {
    padding: 0.75rem 0.75rem 0.45rem;
    gap: 0.65rem;
  }

  .source-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    gap: 0.35rem;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .source-tabs::-webkit-scrollbar {
    display: none;
  }

  .source-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.76rem;
    white-space: nowrap;
    border-radius: 20px;
  }

  .source-tab-group {
    border-radius: 20px;
    flex-shrink: 0;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    display: inline-flex;
    align-items: stretch;
  }

  .source-tab-group.active-parent {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
  }

  [data-theme="light"] .source-tab-group.active-parent {
    border-color: #2563eb;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
  }

  .source-tab-group .source-tab {
    border-radius: 20px 0 0 20px;
    padding: 0.4rem 0.55rem 0.4rem 0.85rem;
    border: none;
    background: transparent;
  }

  .source-tab-group .tab-dropdown-trigger {
    border-radius: 0 20px 20px 0;
    padding: 0 0.6rem;
    font-size: 0.8rem;
    border: none;
    border-left: 1px solid rgba(148, 163, 184, 0.25);
    background: transparent;
  }

  .tab-dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 70px;
    left: 16px;
    right: 16px;
    margin: 0 auto;
    max-width: 440px;
    width: auto;
    min-width: unset;
    border-radius: 18px;
    padding: 1.1rem 1.15rem 1.25rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-active);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    z-index: 1050;
    gap: 0.45rem;
    animation: popUpMobile 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  [data-theme="light"] .tab-dropdown-menu {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  }

  @keyframes popUpMobile {
    from { transform: translateY(25px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
  }

  .menu-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  .menu-mobile-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .menu-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-dim);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
  }

  .dropdown-item {
    padding: 0.72rem 0.95rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
  }

  .dropdown-backdrop {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
  }

  .dropdown-backdrop.hidden {
    display: none !important;
  }

  .sentiment-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    gap: 0.35rem;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sentiment-pills::-webkit-scrollbar {
    display: none;
  }

  .sentiment-pill {
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
    white-space: nowrap;
    border-radius: 20px;
  }

  .search-box {
    width: 100%;
    min-width: 100%;
    margin-top: 0.15rem;
  }

  .search-input {
    height: 40px;
    font-size: 0.84rem;
  }

  /* 5. Mobile News Stream Grid */
  .main-content {
    padding: 0.65rem 0.75rem 3.5rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .news-card {
    padding: 0.95rem 1rem;
    border-radius: 12px;
  }

  .card-title {
    font-size: 1.02rem;
    line-height: 1.38;
    margin-bottom: 0.4rem;
  }

  .card-description {
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-footer {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }

  .card-link-out {
    font-size: 0.76rem;
    padding: 0.4rem 0.75rem;
  }

  .card-actions {
    gap: 0.4rem;
  }

  .btn-card-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  /* 6. Native Mobile Bottom-Sheet Drawers */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.75);
  }

  .modal-card {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: slideUpDrawer 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 1.25rem);
  }

  .drawer-handle-bar {
    display: block;
    width: 38px;
    height: 4px;
    background: var(--border-active);
    border-radius: 2px;
    margin: 0.65rem auto 0.25rem;
    opacity: 0.6;
  }

  .modal-header {
    padding: 0.75rem 1.15rem;
  }

  .modal-title {
    font-size: 0.98rem;
  }

  .modal-body {
    padding: 0.85rem 1.15rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 0.85rem 1.15rem;
    flex-direction: column;
    gap: 0.6rem;
  }

  .modal-footer .btn-listen-modal,
  .modal-footer .btn-primary-modal {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.84rem;
  }

  @keyframes slideUpDrawer {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .share-options-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .btn-back-top {
    bottom: 1.25rem;
    left: 1rem;
    width: 38px;
    height: 38px;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-right {
    align-items: flex-start;
  }
}
