/* ============================================
   QuantStrike — Styles
   Brand: Navy (#1a3a5c) + Teal (#3b82f6)
   ============================================ */

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

:root {
  --navy: #1a3a5c;
  --navy-dark: #0f2440;
  --navy-deeper: #0b1a30;
  --teal: #3b82f6;
  --teal-light: #93c5fd;
  --teal-dark: #2563eb;
  --cyan: #22d3ee;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(20, 184, 166, 0.2);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.logo-dark { color: #104068; }
.logo-teal { color: #30b0c8; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--teal); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(20, 184, 166, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
}

.btn-ai {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
  margin-left: 6px;
}
.btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
}

.btn-signin {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}
.btn-signin:hover {
  background: var(--teal-dark);
}

/* Auth Modal */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.auth-modal-overlay.hidden { display: none; }
.auth-modal {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: #334155; }
.auth-modal-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy, #1a3a5c);
  margin-bottom: 8px;
}
.auth-modal-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 32px;
}
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.auth-google-btn:hover {
  border-color: #4285F4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}
.auth-google-btn:active {
  transform: scale(0.98);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.auth-email-btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.auth-email-btn:hover {
  background: #4338ca;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}
.auth-email-btn:active {
  transform: scale(0.98);
}
.auth-modal-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.95rem;
  color: var(--text-muted, #94a3b8);
}
.auth-modal-footer a {
  color: #4f46e5;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-modal-footer a:hover {
  color: #4338ca;
}
/* Email auth forms */
.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.auth-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: var(--font-main);
  background: #f8fafc;
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #fff;
}
.auth-input::placeholder {
  color: #94a3b8;
}
.auth-submit-btn {
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.auth-submit-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}
.auth-submit-btn:active {
  transform: scale(0.98);
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-error {
  color: #ef4444;
  font-size: 13px;
  margin: 0;
  text-align: center;
}

/* Market Overview Section */
.market-overview-section {
  margin-top: 24px;
  margin-bottom: 32px;
}

/* User menu (signed in) */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-menu.hidden { display: none; }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-light, #e2e8f0);
}
.user-name {
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-signout {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: #94a3b8;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.btn-signout:hover {
  color: #f43f5e;
  background: #fff1f2;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  color: var(--teal);
  border-color: var(--teal);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 184, 166, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(20, 184, 166, 0.08) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 0 80px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-subtitle {
  max-width: 620px;
  margin: 0 auto 40px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--teal);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 100px 0;
}

.section-dark {
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ============================================
   Features Grid
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(20, 184, 166, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.feature-card-large {
  grid-column: span 3;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.feature-card-large h3 { margin-top: 0; }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 16px;
}

.icon-teal { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); }
.icon-cyan { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.icon-navy { background: linear-gradient(135deg, var(--navy), #234e78); }
.icon-green { background: linear-gradient(135deg, #10b981, #34d399); }
.icon-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.icon-rose { background: linear-gradient(135deg, #ef4444, #f87171); }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================
   Live Demo
   ============================================ */
.demo-search-wrap {
  max-width: 680px;
  margin: 0 auto 48px;
}

.demo-search {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  gap: 12px;
  transition: border-color 0.2s;
}

.demo-search:focus-within {
  border-color: var(--teal);
}

.demo-search svg { color: var(--text-muted); flex-shrink: 0; }

.demo-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  min-width: 0;
}

.demo-search input::placeholder { color: var(--text-muted); }

.popular-tickers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.popular-tickers span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ticker-chip {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--teal);
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.15);
  cursor: pointer;
  transition: all 0.2s;
}

.ticker-chip:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: var(--teal);
}

/* Demo Loading */
.demo-loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* Demo Error */
.demo-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  max-width: 680px;
  margin: 0 auto;
}

/* Demo Dashboard */
.demo-dashboard {
  max-width: 720px;
  margin: 0 auto;
  animation: fadeUp 0.5s ease;
}

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

/* Stock Header */
.demo-stock-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.demo-stock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.demo-ticker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-back {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s;
}
.demo-back:hover { color: var(--text-primary); }

.demo-ticker {
  font-size: 1.5rem;
  font-weight: 800;
}

.demo-star {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s;
}
.demo-star:hover { color: var(--amber); }

.demo-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 2px;
  padding-left: 38px;
}

.demo-price-block {
  text-align: center;
}

.demo-price {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.demo-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 8px;
}

.demo-change.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.demo-change.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

/* QS Score Card */
.qs-score-card {
  padding: 24px;
}

.qs-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.qs-score-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
}

.qs-rating {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
}

.qs-score-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}

.qs-score-body {
  display: flex;
  align-items: center;
  gap: 40px;
}

.qs-score-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qs-price-target {
  text-align: center;
}

.qs-pt-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.qs-pt-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.qs-gauge {
  position: relative;
  width: 120px;
  height: 120px;
}

.qs-gauge svg {
  width: 100%;
  height: 100%;
}

#gaugeCircle {
  transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.qs-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qs-gauge-score {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
}

.qs-gauge-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.qs-score-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qs-factor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qs-factor-name {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.qs-factor-val {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* Demo Cards */
.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.demo-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chart */
.chart-timeframes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tf-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tf-btn:hover { color: var(--text-primary); border-color: var(--border-light); }
.tf-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.chart-change-pct {
  margin-left: auto;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--green);
}

.chart-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.metric-cell {
  background: var(--bg-card);
  padding: 16px;
  text-align: center;
}

.metric-cell-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-cell-value {
  display: block;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* About */
.about-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Top Stocks */
.top-stocks-section {
  margin-top: 64px;
}

.top-stocks-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.top-stocks-title svg { color: var(--teal); }

.top-stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.stock-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.stock-tile:hover {
  border-color: rgba(20, 184, 166, 0.3);
  transform: translateY(-2px);
}

.stock-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.stock-tile-symbol {
  font-weight: 800;
  font-size: 1rem;
}

.stock-tile-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
}

.stock-tile-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-tile-change {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.stock-tile-change.positive { color: var(--green); }
.stock-tile-change.negative { color: var(--red); }

/* Mini chart in tile */
.stock-tile-chart {
  height: 32px;
  margin-top: 8px;
}

.stock-tile-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ============================================
   How It Works / Steps
   ============================================ */
.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step-card {
  text-align: center;
  padding: 40px 32px;
  max-width: 300px;
}

.step-number {
  font-size: 3rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: rgba(20, 184, 166, 0.15);
  line-height: 1;
  margin-bottom: 16px;
}

.step-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--teal);
}

.step-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.step-connector {
  display: flex;
  align-items: center;
  padding-top: 100px;
}

/* ============================================
   Score Pillars
   ============================================ */
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.score-pillar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.score-pillar-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.score-pillar-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--bar-height);
  background: var(--bar-color);
  border-radius: 4px;
  transition: width 1s ease;
}

.score-pillar-pts {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--teal);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.score-pillar h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.score-pillar p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.score-pillar ul {
  list-style: none;
  text-align: left;
}

.score-pillar li {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.score-pillar li:last-child { border: none; }

.rating-legend {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.rating-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.rating-stars { font-size: 1.1rem; }
.rating-undervalued .rating-stars { color: var(--green); }
.rating-undervalued span:last-child { color: var(--green); }
.rating-fair .rating-stars { color: var(--amber); }
.rating-fair span:last-child { color: var(--amber); }
.rating-overvalued .rating-stars { color: var(--red); }
.rating-overvalued span:last-child { color: var(--red); }

/* ============================================
   Learn Grid
   ============================================ */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.learn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
}

.learn-card:hover {
  border-color: rgba(20, 184, 166, 0.3);
  transform: translateY(-2px);
}

.learn-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(20, 184, 166, 0.2);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.learn-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.learn-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================
   Tech Stack
   ============================================ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.tech-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--teal);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tags span {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.12);
  color: var(--text-secondary);
}

/* ============================================
   CTA
   ============================================ */
.cta-section {
  padding: 80px 0;
}

.cta-inner {
  text-align: center;
  padding: 72px 40px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.06) 0%, rgba(26, 58, 92, 0.06) 100%);
  border: 1px solid rgba(20, 184, 166, 0.15);
  border-radius: var(--radius-lg);
}

.cta-inner h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-inner p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.cta-buttons {
  margin-bottom: 32px;
}

.cta-stores {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cta-store-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.store-badges {
  display: flex;
  gap: 12px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 60px 0 32px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  max-width: 280px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-links h5 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  font-style: italic;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-card-large {
    grid-column: span 2;
  }
  .score-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }

  /* Push nav-actions to the right and give Start Trial breathing room */
  .nav-actions {
    margin-left: auto;
    gap: 8px;
  }

  /* Shrink Start Trial so it fits */
  .nav-actions .btn-primary {
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  /* User menu: hide name, show only avatar + sign-out icon */
  .user-name { display: none; }
  .user-avatar { width: 30px; height: 30px; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    animation: fadeDown 0.3s ease;
  }

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

  .mobile-toggle { display: flex; }

  .hero-content { padding: 40px 0 60px; }
  .hero-stats { gap: 24px; }
  .hero-stat-number { font-size: 1.5rem; }

  .features-grid {
    grid-template-columns: 1fr;
  }
  .feature-card-large {
    grid-column: span 1;
    flex-direction: column;
  }

  .steps-grid {
    flex-direction: column;
    align-items: center;
  }
  .step-connector {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .score-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rating-legend {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .qs-score-body {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }

  .qs-score-right {
    width: 100%;
  }

  .demo-price {
    font-size: 2.2rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section { padding: 64px 0; }

  .top-stocks-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-stats { gap: 16px; }

  .score-grid { grid-template-columns: 1fr; }

  .metrics-grid { grid-template-columns: 1fr 1fr; }

  .learn-grid { grid-template-columns: 1fr; }

  .demo-stock-header { padding: 16px; }
  .demo-card { padding: 16px; }

  .store-badges { flex-direction: column; }
}

/* ============================================
   Fixed Market Overview Sidebar
   ============================================ */

/* Push all page content to sit between both sidebars */
body {
  padding-left: 260px;
  padding-right: 260px;
}

/* Nav stays full-width */
.nav {
  left: 0;
  right: 0;
  width: 100%;
}

/* Mobile drawer for sidebars */
.mobile-sidebar-btn {
  display: none;
  position: fixed;
  top: 70px;
  left: 14px;
  z-index: 1100;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 8px;
  color: #334155;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(0,0,0,0.4);
}
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background: #fff;
  z-index: 1200;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.mobile-drawer-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}
.mobile-drawer-tab {
  flex: 1;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: #64748b;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.mobile-drawer-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.mobile-drawer-panel { display: none; }
.mobile-drawer-panel.active { display: block; }

.market-sidebar {
  position: fixed;
  top: 64px; /* below nav */
  left: 0;
  width: 260px;
  height: calc(100vh - 64px);
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.market-sidebar::-webkit-scrollbar { width: 4px; }
.market-sidebar::-webkit-scrollbar-track { background: #f8fafc; }
.market-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.market-sidebar-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 14px 11px;
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.market-sidebar-refresh {
  margin-left: auto;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.market-sidebar-refresh:hover { color: #475569; }

.market-sidebar-spinner {
  display: flex;
  justify-content: center;
  padding: 16px;
}
.market-sidebar-spinner .spinner {
  border-color: #e2e8f0;
  border-top-color: #3b82f6;
}

.sidebar-section {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-section-title {
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.sidebar-sector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5px 0;
}
.sidebar-sector-name {
  font-size: 11.5px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.sidebar-sector-pct {
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  margin-left: 6px;
  flex-shrink: 0;
}

.sidebar-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  margin: 1px 0;
}
.sidebar-stock:hover { background: #f1f5f9; }

.sidebar-stock-sym {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  min-width: 44px;
}
.sidebar-stock-name {
  font-size: 10.5px;
  color: #94a3b8;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-stock-pct {
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

/* ── Comparative Performance Panel ── */
#comp-perf-content {
  border-top: 1px solid #e2e8f0;
}
.comp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.comp-title {
  font-size: 9.5px; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.comp-periods { display: flex; gap: 3px; }
.comp-period-btn {
  padding: 2px 7px; font-size: 9px; font-weight: 700;
  border-radius: 3px; cursor: pointer; transition: all 0.15s;
  background: transparent; color: #94a3b8; border: 1px solid transparent;
  font-family: var(--font-mono);
}
.comp-period-btn:hover { color: #475569; }
.comp-period-btn.active {
  color: #3b82f6; border-color: #3b82f6;
}
.comp-chart {
  padding: 2px 8px 0;
}
.comp-chart svg {
  display: block;
}
.comp-legend {
  display: flex; flex-wrap: wrap; gap: 3px 8px;
  padding: 4px 12px 8px;
}
.comp-legend-item {
  display: flex; align-items: center; gap: 3px;
  font-size: 8px; color: #94a3b8;
}
.comp-legend-dot {
  width: 6px; height: 2px; border-radius: 1px; display: inline-block;
}
.comp-bars-header {
  font-size: 9.5px; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px 4px;
  border-top: 1px solid #e2e8f0;
}
.comp-bars {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px 12px 12px;
}
.comp-bar-row {
  display: flex; align-items: center; gap: 6px;
}
.comp-bar-label {
  font-size: 8.5px; color: #64748b; width: 62px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.comp-bar-track {
  flex: 1; background: #f1f5f9; border-radius: 2px; height: 5px; overflow: hidden;
}
.comp-bar-fill {
  height: 100%; border-radius: 2px; transition: width 0.4s ease;
}
.comp-bar-pct {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  width: 42px; text-align: right; flex-shrink: 0;
}

/* ── Right News Sidebar ── */
.news-sidebar {
  position: fixed;
  top: 64px;
  right: 0;
  width: 260px;
  height: calc(100vh - 64px);
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
}
.news-sidebar::-webkit-scrollbar { width: 4px; }
.news-sidebar::-webkit-scrollbar-track { background: #f8fafc; }
.news-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.news-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  transition: background 0.15s;
}
.news-item:hover { background: #f8fafc; }
.news-item-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  display: block;
}
.news-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.news-item-source {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.news-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
}
.news-item-time {
  font-size: 11px;
  color: #94a3b8;
}

/* Mobile: hide sidebars, show hamburger, undo padding */
@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-right: 0;
  }
  .market-sidebar {
    display: none;
  }
  .news-sidebar {
    display: none;
  }
  .mobile-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   Technical Indicators
   ============================================ */
.tech-indicators {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.tech-indicator-row {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
}

.tech-indicator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tech-indicator-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.tech-indicator-value {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.tech-indicator-detail {
  font-size: 11px;
  color: var(--text-muted);
}

.tech-indicator-highlight {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

/* ═══ Analysis Tabs ═══ */
.analysis-tabs {
  margin-top: 24px;
}

.analysis-tab-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.analysis-tab-bar::-webkit-scrollbar { display: none; }

.analysis-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.analysis-tab:hover {
  color: var(--text-primary);
}
.analysis-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.analysis-tab-content {
  display: none;
}
.analysis-tab-content.active {
  display: block;
}

/* AI tab special styling */
.analysis-tab.ai-tab {
  color: #7c3aed;
  font-weight: 700;
}
.analysis-tab.ai-tab:hover {
  color: #6d28d9;
  background: #f5f3ff;
}
.analysis-tab.ai-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
  background: #faf5ff;
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}
.search-dropdown.hidden { display: none; }
.search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f0fdfa; }
.search-item-symbol {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--teal);
  margin-right: 12px;
}
.search-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item-exchange {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 8px;
}

.analysis-tab-hint {
  text-align: center;
  padding: 32px 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.analysis-tab-hint.hidden {
  display: none;
}

/* Bar Charts */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-label {
  min-width: 52px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}
.bar-track {
  flex: 1;
  height: 24px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.bar-value {
  min-width: 68px;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

/* Vertical Bar Charts */
.vbar-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  padding-left: 48px;
}
.vbar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.vbar-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.vbar-chart-wrap {
  display: flex;
  gap: 0;
  min-height: 360px;
}
.vbar-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 10px;
  padding-bottom: 28px;
  min-width: 48px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.vbar-chart {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  border-left: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 8px;
  min-height: 320px;
  position: relative;
}
.vbar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.vbar-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  width: 100%;
  justify-content: center;
  height: 300px;
}
.vbar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: 40%;
  max-width: 36px;
  min-width: 16px;
}
.vbar-col-single {
  width: 60%;
  max-width: 48px;
}
.vbar-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.5s ease;
}
.vbar-val {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
  margin-bottom: 4px;
  line-height: 1;
}
.vbar-label {
  margin-top: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Stock Price Forecast Chart */
.forecast-card {
  position: relative;
}
.forecast-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.forecast-svg-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}
.forecast-svg-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}
.forecast-targets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}
.forecast-target-col {
  text-align: center;
  padding: 12px 8px;
  background: #f8fafc;
}
.forecast-target-col:first-child {
  border-radius: 8px 0 0 8px;
}
.forecast-target-col:last-child {
  border-radius: 0 8px 8px 0;
}
.forecast-target-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.forecast-target-price {
  font-size: 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}
.forecast-target-change {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  margin-top: 4px;
}

.tab-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}

.badge-positive {
  display: inline-block;
  padding: 2px 8px;
  background: #ecfdf5;
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
}
.badge-negative {
  display: inline-block;
  padding: 2px 8px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
}
.badge-neutral {
  display: inline-block;
  padding: 2px 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
}
.badge-form {
  display: inline-block;
  padding: 2px 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
}

.tab-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* DCF valuation cards */
.dcf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dcf-stat {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.dcf-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dcf-stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
}

/* News cards */
.news-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.news-item:last-child { border-bottom: none; }
.news-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f1f5f9;
}
.news-body { flex: 1; min-width: 0; }
.news-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-title:hover { color: var(--teal); }
.news-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.news-meta span { margin-right: 8px; }

/* Analyst price target boxes */
.pt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.pt-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.pt-box-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pt-box-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--teal-dark);
}

/* Insider stats grid */
.insider-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

/* Statements tab selector */
.stmt-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.stmt-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.stmt-btn.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

.table-scroll {
  overflow-x: auto;
}

/* ============================================
   Legal Pages (Terms, Privacy, Contact)
   ============================================ */
.legal-page {
  padding: 120px 0 80px;
  min-height: 100vh;
}

.legal-container {
  max-width: 800px;
}

.legal-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-content ul {
  margin: 12px 0 20px 24px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.legal-content ul li {
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.legal-content a:hover {
  color: var(--teal-light);
}

/* Contact Page */
.contact-intro {
  margin-bottom: 40px;
}

.contact-intro p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 32px 0 48px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.contact-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--teal);
}

.contact-card-icon {
  margin-bottom: 16px;
}

.contact-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.contact-link {
  display: inline-block;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--teal-light);
}

.contact-notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 32px;
}

.contact-notice h2 {
  margin-top: 0 !important;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .legal-page {
    padding: 100px 0 60px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
