/* ===== Google Fonts ===== */
@import url('/fonts/fonts.css');

/* ===== CSS Variables — Dark (default / StockVault) ===== */
:root {
  --bg:      #080d14;
  --bg2:     #0d1520;
  --bg3:     #111c2a;
  --card:    #0f1e2f;
  --card2:   #142333;
  --border:  #1e3248;
  --border2: #243d58;
  --accent:  #00e5a0;
  --accent2: #00b87a;
  --accent3: #00ffc2;
  --text:    #e8e8e8;
  --text2:   #d0d0d0;
  --text3:   #b8b8b8;
  --text4:   #909090;
  --red:     #ff4d6a;
  --gold:    #f5c842;
  --blue:    #22c55e;
  --glow:    rgba(0,229,160,0.15);
  --glow2:   rgba(0,229,160,0.06);
  --shadow:  0 2px 8px rgba(0,0,0,0.4);
  --shadow2: 0 4px 24px rgba(0,0,0,0.55);
  --radius:  12px;
  --primary: #00e5a0;
  --primary2:#00b87a;
  --green:   #00e5a0;
  --pos:     #22c55e;
}

/* ===== Light Mode ===== */
body.light {
  --bg:      #f4f6fa;
  --bg2:     #eef0f6;
  --bg3:     #e4e8f2;
  --card:    #ffffff;
  --card2:   #f8faff;
  --border:  #e1e4ed;
  --border2: #c8cdd9;
  --accent:  #1a9e6a;
  --accent2: #157a52;
  --accent3: #22c55e;
  --text:    #0f172a;
  --text2:   #334155;
  --text3:   #64748b;
  --text4:   #94a3b8;
  --red:     #f04438;
  --gold:    #f79009;
  --blue:    #1a9e6a;
  --glow:    rgba(26,158,106,0.12);
  --glow2:   rgba(26,158,106,0.05);
  --shadow:  0 1px 4px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow2: 0 4px 16px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
  --primary: #1a9e6a;
  --primary2:#157a52;
  --green:   #12b76a;
  --pos:     #16a34a;
}

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

body {
  font-family: 'Fredoka', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

/* ===== Header / Nav ===== */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: rgba(8,13,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
body.light header {
  background: var(--bg3);
  box-shadow: 0 2px 12px rgba(15,23,42,0.08);
}

.header-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}
.header-contact-btn {
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  color: #080d14;
  background: var(--accent);
  text-decoration: none;
  padding: 0 28px;
  height: 46px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.header-contact-btn:hover { background: var(--accent3); text-decoration: none; color: #080d14; }

.logo {
  font-size: 23px;
  font-weight: 700;
  font-family: 'Fredoka', 'Manrope', sans-serif;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #080d14;
  font-weight: 900;
}
.logo span { color: var(--accent); }

.search-form {
  display: flex;
  width: 100%;
  max-width: 520px;
  flex: 1;
}
.search-form input {
  flex: 1;
  padding: 0 16px;
  height: 46px;
  border: 1.5px solid var(--accent);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 15px;
  font-family: 'Fredoka', sans-serif;
  outline: none;
  background: var(--bg2);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.search-form input::placeholder { color: var(--text3); }
.search-form input:focus {
  border-color: var(--accent);
  background: var(--card);
}
.search-form button {
  padding: 0 28px;
  height: 46px;
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #080d14;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: 'Fredoka', sans-serif;
}
.search-form button:hover { background: var(--accent3); }
body.light .search-form button { color:#f4f4f4; }
body.light .search-form button:hover { background: var(--accent2); }

.nav-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-nav {
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Fredoka', sans-serif;
}
.btn-nav-ghost {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text2);
}
.btn-nav-ghost:hover { border-color: var(--accent); color: var(--accent); }
.lang-btn { text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }

/* ── Language bar (below search row) ─────────────── */
.lang-bar {
  display: flex; justify-content: center;
  width: 100%;
  padding: 6px 20px 8px;
  border-top: 1px solid var(--bg3);
  flex-shrink: 0;
}
.lang-static {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
}
.lang-flag-btn {
  display: flex; align-items: center; gap: 7px;
  border-radius: 8px; padding: 5px 10px;
  opacity: 0.45; transition: opacity 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none; white-space: nowrap;
}
.lang-flag-btn img { display: block; border-radius: 3px; flex-shrink: 0; }
.lang-flag-btn span { font-size: 13px; font-weight: 600; color: var(--text); }
.lang-flag-btn:hover { opacity: 0.85; background: var(--bg3); }
.lang-flag-btn.active {
  opacity: 1;
  background: var(--bg3);
  box-shadow: 0 0 0 2px var(--accent);
}
.btn-nav-primary {
  background: var(--accent);
  border: none;
  color: #080d14;
}
.btn-nav-primary:hover { background: var(--accent3); transform: translateY(-1px); }
body.light .btn-nav-primary { color:#f4f4f4; }

/* ===== Hero Section ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
}
body.light .hero { background: #0f172a; }

/* Two-column layout inside hero */
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 64px 32px;
  align-items: stretch;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
/* Full-width hero when no YouTube embed */
.hero-content--full {
  grid-template-columns: 1fr;
  text-align: center;
}
.hero-content--full .hero-left {
  align-items: center;
}
.hero-content--full .hero-title {
  font-size: clamp(42px, 6vw, 80px);
  max-width: 100%;
  line-height: 1.3;
}
.hero-content--full .hero-subtitle {
  font-size: clamp(16px, 1.4vw, 20px);
  max-width: 100%;
  margin-top: 16px;
}
.hero-content--full .hero-underline {
  margin: 24px auto;
}
.hero-content--full .hero-search-form {
  width: 50%;
  max-width: 50%;
  margin-bottom: 48px;
}

/* Left */
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Right: video */
.hero-right {
  display: flex;
  align-items: stretch;
}
.hero-video {
  width: 100%;
  height: 100%;
  min-height: 340px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.hero-video iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* Animated gradient background */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(61,158,255,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(167,139,250,0.07) 0%, transparent 45%),
    linear-gradient(135deg, #040a13 0%, #080d14 40%, #0a1520 70%, #060e1a 100%);
  animation: heroBgShiftDark 12s ease-in-out infinite alternate;
}
/* Hero is always dark — light mode keeps the same dark gradient */
body.light .hero-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(61,158,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(167,139,250,0.06) 0%, transparent 45%),
    linear-gradient(135deg, #040a13 0%, #080d14 40%, #0a1520 70%, #060e1a 100%);
  animation: heroBgShiftDark 12s ease-in-out infinite alternate;
}

@keyframes heroBgShiftDark {
  0%   {
    background:
      radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.12) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 20%, rgba(61,158,255,0.10) 0%, transparent 50%),
      linear-gradient(135deg, #040a13 0%, #080d14 40%, #0a1520 70%, #060e1a 100%);
  }
  100% {
    background:
      radial-gradient(ellipse at 70% 60%, rgba(0,229,160,0.10) 0%, transparent 55%),
      radial-gradient(ellipse at 30% 40%, rgba(61,158,255,0.14) 0%, transparent 50%),
      linear-gradient(135deg, #040a13 0%, #080d14 40%, #0a1520 70%, #060e1a 100%);
  }
}
@keyframes heroBgShiftLight {
  0%   {
    background:
      radial-gradient(ellipse at 20% 50%, rgba(26,158,106,0.10) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 20%, rgba(0,200,150,0.08) 0%, transparent 50%),
      linear-gradient(135deg, #dde8f8 0%, #e8f0fe 40%, #edf4fb 70%, #e0ecf8 100%);
  }
  100% {
    background:
      radial-gradient(ellipse at 70% 60%, rgba(26,158,106,0.12) 0%, transparent 55%),
      radial-gradient(ellipse at 30% 40%, rgba(0,200,150,0.10) 0%, transparent 50%),
      linear-gradient(135deg, #e0ecf8 0%, #dde8f8 40%, #e8f0fe 70%, #edf4fb 100%);
  }
}

/* Grid overlay for depth */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,160,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}
body.light .hero-grid {
  background-image:
    linear-gradient(rgba(26,158,106,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,158,106,0.06) 1px, transparent 1px);
}

/* Slides — stacked inside hero-left */
.hero-slide {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 36px; /* leave room for dots */
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  pointer-events: none;
}
.hero-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: 'Fredoka', sans-serif;
}
body.light .hero-eyebrow { color: var(--accent); }
/* Hero is always dark — override light-mode text colors inside it */
body.light .hero-title { color: #f1f5f9; }
body.light .hero-title span { color: var(--accent); }
body.light .hero-subtitle { color: #94a3b8; }
body.light .hero-btn-ghost { border-color: rgba(255,255,255,0.2); color: #94a3b8; }
body.light .hero-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
body.light .slide-dot { background: #94a3b8; }
body.light .slide-dot.active { background: var(--accent); }

.hero-title {
  font-size: clamp(32px, 4.5vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  color:#f4f4f4;
  letter-spacing: 0.2px;
  max-width: 580px;
  margin: 0;
}
.hero-title span { color: var(--accent); }

.hero-underline {
  width: 160px;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed 0%, #db2777 50%, #f97316 100%);
  border-radius: 2px;
  margin: 18px 0 16px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text2);
  max-width: 500px;
  line-height: 1.65;
  margin: 0 0 28px;
}

/* Search form */
.hero-search-form {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.35);
  border: 2px solid #f59e0b;
  border-radius: 50px;
  overflow: hidden;
  max-width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(245,158,11,0);
}
.hero-search-form:hover,
.hero-search-form:focus-within {
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(245,158,11,0.35);
}
.hero-search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 15px;
  color: #f4f4f4;
  font-family: 'Fredoka', sans-serif;
  cursor: text;
}
.hero-search-form input::placeholder { color: rgba(255,255,255,0.85); }
.hero-search-form button {
  background: #f59e0b;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  margin: 5px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.hero-search-form button:hover { background: #fbbf24; transform: scale(1.05); }
.hero-search-form button svg { display: block; }

.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.hero-btn {
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s;
  border: none;
}
.hero-btn-primary {
  background: var(--accent);
  color: #080d14;
}
.hero-btn-primary:hover { background: var(--accent3); transform: translateY(-2px); box-shadow: 0 8px 24px var(--glow); }
body.light .hero-btn-primary { color:#f4f4f4; }
.hero-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
}
.hero-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Slide indicators — sit at bottom of hero-left */
.slide-dots {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 8px;
  z-index: 2;
  height: 28px;
  align-items: center;
}
.slide-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--text3);
  transition: width 0.4s, background 0.4s;
  cursor: pointer;
}
.slide-dot.active {
  width: 22px;
  background: var(--accent);
}

/* ===== Hero Screen Mockup ===== */
.hero-screen {
  width: 100%;
  max-width: 420px;
  background: rgba(13,21,32,0.85);
  border: 1px solid rgba(0,229,160,0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,229,160,0.08),
    0 24px 64px rgba(0,0,0,0.6),
    0 0 40px rgba(0,229,160,0.06);
  backdrop-filter: blur(12px);
  animation: screenFloat 6s ease-in-out infinite;
}
body.light .hero-screen {
  background: rgba(255,255,255,0.92);
  border-color: rgba(26,158,106,0.2);
  box-shadow: 0 24px 64px rgba(15,23,42,0.15), 0 0 0 1px rgba(26,158,106,0.08);
}
@keyframes screenFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Browser chrome bar */
.hs-bar {
  background: rgba(8,13,20,0.9);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,229,160,0.1);
}
body.light .hs-bar { background: #f0f2f7; border-bottom-color: #e1e4ed; }
.hs-dots { display: flex; gap: 5px; }
.hs-dots span {
  width: 9px; height: 9px; border-radius: 50%;
}
.hs-dots span:nth-child(1) { background: #ff5f57; }
.hs-dots span:nth-child(2) { background: #febc2e; }
.hs-dots span:nth-child(3) { background: #28c840; }
.hs-url {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 10px;
  font-family: 'Fredoka', sans-serif;
  color: rgba(255,255,255,0.6);
  text-align: center;
}
body.light .hs-url { background: #fff; color: #64748b; }

/* Screen body */
.hs-body { padding: 14px; }

/* Mini stat cards */
.hs-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.hs-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0,229,160,0.1);
  border-radius: 8px;
  padding: 8px;
}
body.light .hs-stat { background: #f8faff; border-color: #e1e4ed; }
.hs-sl { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; font-family: 'Fredoka', sans-serif; }
.hs-sv { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'Fredoka', sans-serif; margin: 2px 0; }
.hs-sc { font-size: 9px; font-family: 'Fredoka', sans-serif; font-weight: 600; }

/* Mini chart */
.hs-chart {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(0,229,160,0.08);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  height: 72px;
  overflow: hidden;
}
body.light .hs-chart { background: #f8faff; border-color: #e1e4ed; }
.hs-chart svg { width: 100%; height: 100%; display: block; }

/* Mini stock rows */
.hs-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
body.light .hs-row { border-bottom-color: #f0f2f7; }
.hs-row:last-child { border-bottom: none; }
.hs-logo {
  width: 18px; height: 18px; border-radius: 4px; object-fit: contain;
  background: rgba(255,255,255,0.08); flex-shrink: 0;
}
.hs-sym { font-size: 11px; font-weight: 700; color: var(--accent); font-family: 'Fredoka', sans-serif; min-width: 42px; }
.hs-name { font-size: 10px; color: var(--text3); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-price { font-size: 11px; font-family: 'Fredoka', sans-serif; color: var(--text); min-width: 52px; text-align: right; }
.hs-chg { font-size: 10px; font-family: 'Fredoka', sans-serif; font-weight: 600; min-width: 44px; text-align: right; }

/* Responsive: stack hero on small screens */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; padding: 40px 24px; gap: 24px; }
  .hero-right { display: flex; }
  .hero-video { min-height: 260px; }
  .hero-search-form { max-width: 100%; }
  .hero-content--full { padding-bottom: 48px; }
  .hero-content--full .hero-search-form { width: 100%; max-width: 100%; }
}
@media (max-width: 600px) {
  .hero { padding-left: 12px; padding-right: 12px; }
  .hero-content--full .hero-search-form { width: 100% !important; max-width: 100% !important; }
  .hero-title { font-size: clamp(26px, 7vw, 36px); }
  .hero-title { font-size: clamp(24px, 6vw, 32px); }
  .hero-title br { display: none; }
  .hero-subtitle { font-size: 15px; }
  .hero-search-form input { padding: 12px 16px; font-size: 15px !important; height: 50px !important; }
  .hero-search-form button { font-size: 15px !important; padding: 0 20px !important; height: 50px !important; white-space: nowrap; }
  .hero-search-form { width: 100% !important; max-width: 100% !important; }
  .hero-video { max-width: 100%; }
  .hero-content--full .hero-search-form { width: 100%; max-width: 100%; }
}

/* ===== Ticker Bar ===== */
.ticker-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 2;
  backdrop-filter: blur(10px);
}
body.light .ticker-bar {
  background: rgba(255,255,255,0.82);
  border-top-color: #c8d4e8;
}
body.light .ticker-item .ti-sym { color: #0f172a; }
body.light .ticker-item .ti-val { color: #334155; }
body.light .ticker-label { color: var(--accent); border-right-color: #c8d4e8; }

.ticker-label {
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  font-family: 'Fredoka', sans-serif;
  flex-shrink: 0;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-scroll {
  display: flex;
  gap: 0;
  animation: tickerMove 80s linear infinite;
  white-space: nowrap;
}

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 30px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.ticker-item .ti-sym {
  font-weight: 600;
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
}
.ticker-item .ti-val {
  color: var(--text2);
  font-family: 'Fredoka', sans-serif;
}
.ticker-item .ti-chg { font-size: 14px; font-weight: 600; font-family: 'Fredoka', sans-serif; }
.ticker-item .up { color: var(--pos); }
.ticker-item .down { color: var(--red); }

/* Global positive/negative color helpers */
.up   { color: var(--pos) !important; }
.down { color: var(--red) !important; }

/* ===== Container ===== */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 40px;
}

/* ===== Page Grid (main + sidebar) ===== */
.page-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  min-width: 0;
  align-items: start;
}

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.total-count {
  font-size: 13px;
  color: var(--text3);
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
}
.filter-form select {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a6a88' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
body.light .filter-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}
.filter-form select:focus { border-color: var(--accent); }

/* ===== Stock Table ===== */
.stock-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow2);
}
.stock-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 680px;
}
.stock-table thead {
  background: var(--bg3);
}
.stock-table th {
  padding: 13px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.stock-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  color: var(--text);
  transition: background 0.12s;
}
.stock-table tbody tr:hover td { background: var(--bg2); }
.stock-table tbody tr:last-child td { border-bottom: none; }

.ticker-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  font-size: 16px;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  text-decoration: none;
}
.ticker-link:hover { text-decoration: none; }
.logo-sm {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.logo-sm-fb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1px;
  vertical-align: middle;
}
.num {
  text-align: right;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 400;
}
.green { color: var(--pos) !important; }
.red   { color: var(--red) !important; }
.gold  { color: #f59e0b !important; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  padding-bottom: 8px;
}
.pagination a {
  padding: 9px 22px;
  background: var(--card);
  color: var(--text2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
}
.pagination a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #080d14;
  text-decoration: none;
}
body.light .pagination a:hover { color:#f4f4f4; }
.pagination span {
  color: var(--text3);
  font-size: 14px;
  font-family: 'Fredoka', sans-serif;
}

/* ===== Sidebar ===== */
.page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar-card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-card-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0px;
}
.sidebar-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(0,229,160,0.1);
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  text-transform: uppercase;
}
body.light .sidebar-badge { background: rgba(26,158,106,0.12); }

/* News items */
.news-list { padding: 0 20px; }
.news-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding-left 0.2s;
  text-decoration: none;
  display: block;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { padding-left: 5px; }
.news-ticker {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.news-headline {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-time {
  font-size: 13px;
  color: var(--text3);
  margin-top: 6px;
  font-family: 'Fredoka', sans-serif;
}

/* Market Movers */
.movers-list { padding: 0 20px; }
.mover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  gap: 8px;
}
.mover-item:last-child { border-bottom: none; }
.mover-item:hover .mover-sym { color: var(--accent); }
.mover-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.mover-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.mover-icon-fallback {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  flex-shrink: 0;
}
.mover-sym {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
  transition: color 0.15s;
}
.mover-name {
  font-size: 13px;
  color: var(--text3);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mover-chg {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
}

/* Tab switcher in sidebar */
.movers-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.movers-tab-btn {
  flex: 1;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  font-family: 'Fredoka', sans-serif;
}
.movers-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.movers-panel { display: none; }
.movers-panel.active { display: block; }

/* ===== Company Header (stock.php) ===== */
.company-header {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow2);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.company-title { flex: 1; min-width: 0; }
.company-header-radar {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
}
.company-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 14px;
  border: none;
  background: none;
  padding: 0;
}
.company-logo-fb {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 400;
  color: var(--text2);
  flex-shrink: 0;
}
.company-title { flex: 1; }
.company-title h1 {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text);
}
.ticker-badge {
  background: var(--bg3);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 800;
  font-family: inherit;
  border: 1px solid var(--border2);
  vertical-align: middle;
  line-height: 1;
}
.company-meta { color: var(--text3); margin-top: 8px; font-size: 13px; }
.price-box { text-align: right; min-width: 200px; }
.price { font-family: 'Fredoka', sans-serif; font-size: 32px; font-weight: 700; color: var(--text); }
.change { font-family: 'Fredoka', sans-serif; font-size: 17px; font-weight: 600; margin-top: 6px; }
.ch-live-quote { min-height: 90px; }
.ch-live-quote .tradingview-widget-container__widget { min-height: 90px; }

/* ===== Sections ===== */
.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  letter-spacing: 0px;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.stat span {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}
.stat strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
}
.stat a { color: var(--accent); font-size: 12px; }

/* ===== Consensus ===== */
.consensus-box {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.consensus-rating {
  font-size: 18px;
  font-weight: 800;
  padding: 18px 28px;
  border-radius: var(--radius);
  background: var(--bg2);
  min-width: 140px;
  text-align: center;
  align-self: flex-start;
  border: 1.5px solid var(--border);
}
.consensus-rating.strong-buy  { background: rgba(0,229,160,0.12); color: var(--accent); border-color: rgba(0,229,160,0.3); }
.consensus-rating.buy         { background: rgba(61,158,255,0.1); color: var(--blue); border-color: rgba(61,158,255,0.3); }
.consensus-rating.hold        { background: rgba(245,200,66,0.1); color: var(--gold); border-color: rgba(245,200,66,0.3); }
.consensus-rating.sell        { background: rgba(255,77,106,0.12); color: var(--red); border-color: rgba(255,77,106,0.3); }
.consensus-rating.strong-sell { background: rgba(255,77,106,0.15); color: var(--red); border-color: rgba(255,77,106,0.35); }
body.light .consensus-rating.strong-buy  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
body.light .consensus-rating.buy         { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
body.light .consensus-rating.hold        { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
body.light .consensus-rating.sell        { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
body.light .consensus-rating.strong-sell { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }

.consensus-bars { flex: 1; min-width: 220px; }
.grade-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.grade-label { width: 90px; font-size: 12px; color: var(--text3); font-weight: 500; }
.grade-bar-wrap { flex: 1; background: var(--bg2); border-radius: 4px; height: 8px; }
.grade-bar { height: 8px; border-radius: 4px; transition: width 0.6s ease; }
.grade-bar.strong-buy  { background: #00e5a0; }
.grade-bar.buy         { background: #22c55e; }
.grade-bar.hold        { background: #f5c842; }
.grade-bar.sell        { background: #ff7a8a; }
.grade-bar.strong-sell { background: #ff4d6a; }
.grade-count { width: 32px; text-align: right; font-size: 13px; font-family: 'Fredoka', sans-serif; color: var(--text3); }
.price-target { display: flex; gap: 24px; flex-wrap: wrap; align-self: flex-start; }

/* ===== Data Table ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: right;
  padding: 10px 16px;
  background: var(--bg2);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text3);
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table th:first-child { text-align: left; }
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  color: var(--text);
}
.data-table td:first-child { text-align: left; font-weight: 600; font-family: 'Fredoka', sans-serif; }
.data-table tbody tr:hover td { background: var(--bg2); }

/* Financial statement tables (income/balance/cashflow) */
/* Financial statement table — TipRanks style */
.fin-stmt-tbl { font-family: 'Fredoka', sans-serif; }
.fin-stmt-tbl thead th {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    padding: 10px 16px;
    background: var(--bg2);
    border-bottom: 2px solid var(--border);
}
.fin-stmt-tbl td { padding: 9px 16px; font-size: 15px; border-bottom: 1px solid var(--border); }
.fin-stmt-tbl td.num {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--text1);
    text-align: right;
}
/* Bold rows (Revenue, Gross Profit, Net Income, etc.) */
.fin-stmt-tbl .fin-bold-row td { background: rgba(128,128,128,0.03); }
.fin-stmt-tbl .fin-bold-row td:first-child { font-weight: 600; font-size: 16px; color: var(--text1); }
.fin-stmt-tbl .fin-bold-row td.num { font-weight: 600; font-size: 16px; }
.fin-stmt-tbl tbody tr:hover td { background: rgba(59,130,246,0.04); }

/* ===== Description ===== */
.description { color: var(--text2); line-height: 1.8; font-size: 15px; }

/* ===== Back Link ===== */
.back-link { margin: 8px 0 16px; }
.back-link a { color: var(--text3); font-size: 14px; }
.back-link a:hover { color: var(--accent); text-decoration: none; }

/* ===== Homepage Sections ===== */
.page-left { min-width: 0; width: 100%; }
.home-twin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  min-width: 0;
}
.home-section {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--bg3);
}
.home-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.2px;
}
.home-section-link {
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
}
.home-section-link:hover { color: var(--accent); }
.home-stock-list { padding: 4px 0; }
/* Largest companies card list */
.largest-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.largest-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  text-decoration: none; color: inherit; gap: 10px;
}
.largest-row:nth-child(3n) { border-right: none; }
@media (max-width: 768px) {
  .largest-list { grid-template-columns: 1fr; }
  .largest-row { border-right: none; }
}
.largest-row:hover { background: var(--bg2); }
.largest-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.largest-info { display: flex; flex-direction: column; min-width: 0; }
.largest-sym { font-size: 15px; font-weight: 700; color: var(--accent); font-family: 'Fredoka', sans-serif; }
.largest-name { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.largest-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.largest-price { font-size: 15px; font-weight: 600; color: var(--text); font-family: 'Fredoka', sans-serif; }
.largest-chg { font-size: 13px; font-family: 'Fredoka', sans-serif; font-weight: 600; }
/* logo | info(grows) | stats(fixed right) */
.hsi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  text-decoration: none;
  transition: background 0.15s;
}
.hsi:hover { background: var(--bg3); }
.hsi-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}
.hsi-logo-empty {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.hsi-logo-fb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: 0.1px;
}
.hsi-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.hsi-sym {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsi-name {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsi-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hsi-price {
  font-size: 16px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  color: var(--text);
  min-width: 62px;
  text-align: right;
}
.hsi-chg {
  font-size: 16px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  min-width: 58px;
  text-align: right;
}
.hsi-vol {
  font-size: 12px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  color: var(--text3);
  min-width: 42px;
  text-align: right;
}
@media (max-width: 1000px) {
  .home-twin-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .home-twin-grid { grid-template-columns: 1fr; }
  .hsi { padding: 9px 12px; gap: 8px; }
  .hsi-price { min-width: 54px; }
  .hsi-chg  { min-width: 48px; }
  .hsi-vol  { min-width: 36px; }
}
@media (max-width: 400px) {
  .hsi-vol { display: none; }
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text3);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  background: var(--bg2);
}
footer a { color: var(--text3); }
footer a:hover { color: var(--accent); text-decoration: none; }

/* ===== Search Dropdown (TipRanks-style) ===== */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 560px;
  max-width: 700px;
  background: var(--bg3);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  z-index: 600;
  overflow: hidden;
  border: 1px solid var(--border2);
}
/* Hero search dropdown: full width of the form */
.hero-search-form .search-dropdown {
  min-width: 100%;
  max-width: 100%;
  left: 0;
  right: 0;
}
body.light .search-dropdown {
  box-shadow: 0 12px 36px rgba(15,23,42,0.15);
}
.search-dropdown.open { display: block; }

/* Two-panel pre-type layout */
.sd-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 280px;
}
.sd-panel {
  padding: 0 0 8px;
}
.sd-panel:first-child {
  border-right: 1px solid var(--border);
}
.sd-panel-header {
  padding: 12px 16px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  font-family: 'Fredoka', sans-serif;
  border-bottom: 1px solid var(--border);
}

/* Trending tabs inside right panel */
.sd-trending-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.sd-tab {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text3);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  font-family: 'Fredoka', sans-serif;
}
.sd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sd-tab-panel { display: none; }
.sd-tab-panel.active { display: block; }

/* Dropdown items in two-panel */
.sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.sd-item:hover, .sd-item.focused { background: var(--card2); }
.sd-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
  border: none;
  background: none;
  flex-shrink: 0;
}
.sd-icon-fallback {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  flex-shrink: 0;
}
.sd-info { flex: 1; min-width: 0; }
.sd-symbol {
  font-weight: 700;
  color:#f4f4f4;
  font-size: 13px;
  font-family: 'Fredoka', sans-serif;
}
.sd-company {
  font-size: 11px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.sd-right { text-align: right; flex-shrink: 0; }
.sd-price {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.sd-chg {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

/* Single-panel live search results */
.sd-results-list {
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
}
.sd-results-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.sd-results-list li:last-child { border-bottom: none; }
.sd-results-list li:hover, .sd-results-list li.active { background: var(--card2); }
.sd-icon-placeholder { width: 28px; height: 28px; flex-shrink: 0; }
.sd-sym { font-weight: 700; color:#f4f4f4; min-width: 60px; font-size: 14px; font-family: 'Fredoka', sans-serif; }
.sd-name { flex: 1; color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-meta { font-size: 12px; color: var(--text2); white-space: nowrap; }

/* Loading state */
.sd-loading {
  padding: 24px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  font-family: 'Fredoka', sans-serif;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 10px; height: auto; padding: 10px 16px; }
  .logo { flex: 1; }
  .search-form { order: 2; flex: 0 0 100%; max-width: 100%; width: 100%; margin-top: 4px; }
  .header-contact-btn { display: none; }
  .lang-bar { padding: 6px 8px; justify-content: center; }
  .lang-static { flex-wrap: nowrap; justify-content: space-between; width: 100%; }
  .lang-flag-btn { padding: 4px 2px; gap: 0; flex: 1; justify-content: center; }
  .lang-flag-btn span { display: none; }
  .lang-flag-btn img { width: 32px; height: 24px; }

  .hero-cta { margin-top: 16px; }

  .back-link { display: none; }
  .container { padding: 16px 14px 32px; }
  .filters-bar { flex-wrap: wrap; gap: 10px; }

  .stock-table { min-width: 560px; }
  .stock-table .col-num,
  .stock-table th:nth-child(6), .stock-table td:nth-child(6),
  .stock-table th:nth-child(7), .stock-table td:nth-child(7),
  .stock-table th:nth-child(8), .stock-table td:nth-child(8) { display: none; }
  .stock-table .num { font-size:14px; }
  .stock-table th { padding:10px 6px; font-size:11px; }
  .stock-table td { padding:10px 6px; font-size:13px; }
  .stock-table td:nth-child(3) { max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }

}
@media (max-width: 1300px) {
  .ch-targets { flex-wrap: wrap; }
  .ch-tv-widget { margin-left: 0 !important; }
}
@media (max-width: 900px) {
  .company-header { flex-wrap: wrap; gap: 14px; padding: 18px 20px; }
  .company-logo { width: 52px; height: 52px; }
  .company-title { flex: 1; min-width: 200px; }
  .company-title h1 { font-size: 20px; }
  .company-title h1 .ticker-badge { font-size: 20px !important; }
  .price-box { width: 100%; text-align: left; }
  .price { font-size: 28px; }
  .company-header-radar { display: none; }
  .ch-tv-widget { display: none !important; }
  .ch-targets { grid-template-columns: 1fr !important; }
  .ch-targets .ch-tv-mobile { display: flex !important; grid-column: 1 / -1; }

  .tvp-live-quote { display: block; }

  /* Price forecast chart: bleed to section edges on mobile */
  .forecast-chart-wrap {
    margin-left: -10px !important;
    margin-right: -10px !important;
    width: calc(100% + 20px) !important;
    border-radius: 0 !important;
  }

  /* Tables: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }


  .section { padding: 14px 10px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .consensus-box { flex-direction: column; gap: 18px; }
  .pagination a { padding: 9px 16px; font-size: 14px; }

  .search-dropdown { min-width: calc(100vw - 28px); max-width: calc(100vw - 28px); max-height: 60vh; overflow-y: auto; }
  .sd-panels { grid-template-columns: 1fr; }
  .sd-panel:first-child { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stock-table th:nth-child(6), .stock-table td:nth-child(6) { display: none; }
  .price { font-size: 26px; }
}

/* ===== Chart + Side Panel ===== */
.section-chart { padding-bottom: 16px; }
.chart-with-panel {
  display: grid;
  grid-template-columns: 1fr 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  height: 680px;
}
.chart-main {
  min-width: 0;
  border-right: 1px solid var(--border);
}
.chart-main .tradingview-widget-container,
.chart-main .tradingview-widget-container__widget,
.chart-main iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.chart-side-panel {
  background: var(--card);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px;
  font-family: 'Fredoka', sans-serif;
}
@media (max-width: 768px) {
  .chart-with-panel { display: flex !important; flex-direction: column; height: auto; }
  .chart-main { width: 100%; height: 360px; border-right: none; border-bottom: 1px solid var(--border); }
  .chart-main .tradingview-widget-container,
  .chart-main .tradingview-widget-container__widget,
  .chart-main iframe { width: 100% !important; height: 360px !important; }
  .chart-side-panel { width: 100%; height: auto; max-height: none; overflow: visible; padding: 16px; box-sizing: border-box; }
}
/* TradingView-style panel */
.tvp-symbol { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tvp-name   { font-size: 13px; color: var(--text2); margin-bottom: 2px; }
.tvp-link   { color: var(--accent); font-size: 11px; }
.tvp-exch   { color: var(--text3); }
.tvp-sector { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.tvp-live-quote { margin: 0 -4px; min-height: 80px; }
.tvp-live-quote iframe { border: none !important; }
.tvp-price  {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
  line-height: 1.1;
  margin-top: 12px;
}
.tvp-currency { font-size: 13px; font-weight: 400; color: var(--text3); vertical-align: super; margin-left: 3px; }
.tvp-change { font-size: 14px; font-weight: 600; font-family: 'Fredoka', sans-serif; margin: 4px 0 8px; }
.tvp-status { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.tvp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tvp-dot.open   { background: #22c55e; }
.tvp-dot.closed { background: var(--text3); }
.tvp-divider { height: 1px; background: var(--border); margin: 14px 0; }
.tvp-range-block { margin-bottom: 4px; }
.tvp-range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 6px;
}
.tvp-range-val   { color: var(--text); font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 12px; }
.tvp-range-label { color: var(--text3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.tvp-range-bar {
  position: relative;
  height: 4px;
  background: var(--border2);
  border-radius: 4px;
  margin-bottom: 10px;
}
.tvp-range-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  background: linear-gradient(to right, var(--red), #f59e0b, var(--pos));
  border-radius: 4px;
}
.tvp-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--text3);
}
.tvp-stats-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.tvp-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.tvp-stat-row:last-child { border-bottom: none; }
.tvp-stat-row span  { color: var(--text3); flex: 1; }
.tvp-stat-row strong { color: var(--text); font-weight: 400; font-family: 'Fredoka', sans-serif; text-align: right; white-space: nowrap;
}
.tradingview-widget-copyright { padding: 6px 12px; font-size: 12px; color: var(--text3); }
.tradingview-widget-copyright a { color: var(--accent); }
.blue-text { color: var(--accent); }

/* ===== Fundamentals Section (TipRanks-style) ===== */
.fund-section h2 { margin-bottom: 16px; }
.fund-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fund-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}
.fund-col {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
}
.fund-col:last-child { border-right: none; }
.fund-group-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  margin-bottom: 10px;
  margin-top: 4px;
}
.fund-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.fund-row:last-child { border-bottom: none; }
.fund-row span   { color: var(--text3); }
.fund-row .fund-value { color: var(--text); font-weight: 500; }
.fund-row strong { color: var(--text); font-weight: 400; font-family: 'Fredoka', sans-serif; text-align: right; white-space: nowrap; }
/* Analyst bar */
.analyst-bar-wrap { padding: 10px 0 4px; }
.analyst-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 6px;
}
.ab-buy  { background: var(--pos); border-radius: 4px 0 0 4px; }
.ab-hold { background: var(--gold); }
.ab-sell { background: var(--red); border-radius: 0 4px 4px 0; }
.analyst-bar-labels { display: flex; justify-content: space-between; font-size: 11px; font-family: 'Fredoka', sans-serif; }

/* ===== Stock Page Left Nav Layout ===== */
.stock-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.stock-leftnav {
  position: sticky;
  top: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.sln-company {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.sln-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  border: none;
  background: none;
  flex-shrink: 0;
}
.sln-info { min-width: 0; }
.sln-sym  { font-size: 18px; font-weight: 700; color: var(--text); font-family: 'Fredoka', sans-serif; }
.sln-name { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sln-price { font-size: 16px; font-family: 'Fredoka', sans-serif; margin-top: 4px; font-weight: 600; }
.sln-price span { font-size: 13px; margin-left: 5px; }
.sln-nav { padding: 8px 0; }
.sln-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sln-link:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.sln-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--glow2); font-weight: 600; }
.sln-link svg { flex-shrink: 0; opacity: 0.7; width: 18px; height: 18px; }
.sln-link.active svg { opacity: 1; }
.sln-divider { height: 1px; background: var(--border); margin: 6px 0; }
.sln-link-gold { color: #f59e0b !important; }
.sln-link-gold svg { color: #f59e0b; opacity: 1 !important; }
.sln-link-gold:hover { color: #fbbf24 !important; }
.sln-link-gold.active { color: #f59e0b !important; border-left-color: #f59e0b !important; background: rgba(245,158,11,0.08) !important; }
.sln-link-iv { color: var(--accent) !important; }
.sln-link-iv svg { color: var(--accent); opacity: 1 !important; }
.sln-link-iv:hover { color: var(--accent2, #00ffb3) !important; }
.sln-link-iv.active { color: var(--accent) !important; border-left-color: var(--accent) !important; background: var(--glow2) !important; font-weight: 600; }
.sln-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text4);
  padding: 8px 18px 4px;
}
.stock-main { min-width: 0; }

@media (max-width: 900px) {
  .stock-layout { grid-template-columns: 1fr; }
  .stock-leftnav { position: static; display: flex; flex-wrap: wrap; border-radius: 8px; max-width: 100%; }
  .sln-company { display: none; }
  .sln-nav { display: flex; flex-wrap: wrap; padding: 4px; max-width: 100%; }
  .sln-link { padding: 6px 10px; border-left: none; border-bottom: 2px solid transparent; font-size: 12px; white-space: nowrap; }
  .sln-divider { display: none; }
  .sln-sym { font-size: 13px; }
  .sln-name { font-size: 11px; }
  .sln-price { font-size: 13px; }
  .sln-price span { font-size: 11px; }
  .sln-logo { width: 42px; height: 42px; }
  .sln-link.active { border-left: none; border-bottom-color: var(--accent); }
  .sln-divider { display: none; }
  .sln-section-label { display: none; }
}

@media (max-width: 600px) {
  .fund-grid { grid-template-columns: 1fr; }
  .fund-col { border-right: none; border-bottom: 1px solid var(--border); }
  .fund-col:last-child { border-bottom: none; }
  .fund-row { flex-wrap: wrap; gap: 2px; }
  .fund-row span { flex: 1 1 60%; }
  .fund-row strong { flex: 0 0 auto; text-align: right; }
}

/* ===== News List Page ===== */
.news-page-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  padding: 28px 0 20px;
}
.news-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.news-page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.news-lang-switch {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 3px;
}
.news-lang-switch a {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  text-decoration: none;
  transition: all 0.15s;
}
.news-lang-switch a.active {
  background: var(--accent);
  color:#f4f4f4;
}
.news-page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-card-featured {
  grid-column: span 3;
  display: flex !important;
  flex-direction: row !important;
  gap: 24px;
}
.news-card-featured .nci-img {
  width: 420px;
  flex-shrink: 0;
  height: 240px;
}
.news-card-featured .nci-title { font-size: 22px; }
.news-card-featured .nci-excerpt { display: block; }
.news-card-item {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.news-card-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.nci-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg3);
}
.nci-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nci-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.nci-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nci-sym {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(124,58,237,0.12);
  padding: 2px 7px;
  border-radius: 4px;
}
.nci-site {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nci-time { font-size: 11px; color: var(--text4); margin-left: auto; }
.nci-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}
.nci-excerpt {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
  display: none;
  margin: 0;
}
@media (max-width: 900px) {
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-card-featured { grid-column: span 2; flex-direction: column !important; }
  .news-card-featured .nci-img { width: 100%; height: 200px; }
}
@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-card-featured { grid-column: span 1; }
}

/* ===== News Detail Page ===== */
.nd-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.nd-back {
  display: inline-block;
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
  margin-bottom: 20px;
}
.nd-back:hover { color: var(--accent); }
.nd-hero-img {
  width: 100%;
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--bg3);
}
.nd-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.nd-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nd-sym {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(124,58,237,0.12);
  padding: 3px 9px;
  border-radius: 5px;
  text-decoration: none;
}
.nd-publisher { font-size: 13px; color: var(--text3); font-weight: 600; }
.nd-time { font-size: 13px; color: var(--text4); margin-left: auto; }
.nd-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 20px;
}
.nd-lang-switch {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 3px;
  width: fit-content;
  margin-bottom: 28px;
}
.nd-lang-switch a {
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text3);
  text-decoration: none;
  transition: all 0.15s;
}
.nd-lang-switch a.active {
  background: var(--accent);
  color:#f4f4f4;
}
.nd-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text2);
}
.nd-body p {
  margin: 0 0 18px;
}
.nd-ai-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text3);
}
.nd-ai-badge a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.nd-ai-badge a:hover { text-decoration: none; }
.nd-stock-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.nd-stock-label {
  font-size: 11px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.nd-stock-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}
.nd-stock-link:hover { opacity: 0.8; }
.nd-related { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; overflow: hidden; }
.nd-related-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--bg3);
}
.nd-related-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg3);
  text-decoration: none;
  transition: background 0.15s;
}
.nd-related-item:last-child { border-bottom: none; }
.nd-related-item:hover { background: var(--bg3); }
.nd-related-item img { width: 60px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.nd-rel-title { font-size: 12px; color: var(--text); line-height: 1.4; }
.nd-rel-time { font-size: 11px; color: var(--text4); margin-top: 4px; }
@media (max-width: 860px) {
  .nd-wrap { grid-template-columns: 1fr; }
  .nd-sidebar { order: -1; }
  .nd-hero-img { height: 220px; }
  .nd-title { font-size: 22px; }
}

/* ===== IV Preview Section ===== */
.iv-preview-section {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

/* ===== Market Charts Section ===== */
.market-charts-section {
  background: var(--bg);
  padding: 32px 0;
}
.market-charts-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}
.market-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
.market-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 10px;
  overflow: hidden;
  min-width: 0;
}
.market-chart-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  font-family: 'Fredoka', sans-serif;
}
.market-chart-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 28px;
}
.mch-price {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
}
.mch-chg {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
}
.market-chart-canvas {
  width: 100%;
  height: 200px;
}
@media (max-width: 900px) {
  .market-charts-grid { grid-template-columns: 1fr; }
  .market-charts-inner { padding: 0 16px; }
}

/* ===== Gold Insight Section ===== */
.gold-insight-section {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 52px 0;
}
.gold-insight-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}
.gold-insight-body {
  max-width: 100%;
}
.gold-insight-eyebrow {
  font-size: 28px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: #f59e0b; margin-bottom: 14px; font-family: 'Fredoka', sans-serif;
}
.gold-insight-title {
  font-size: 28px; font-weight: 800; color: #f59e0b; line-height: 1.25;
  margin-bottom: 20px; font-family: 'Fredoka', sans-serif;
}
.gold-insight-text {
  font-size: 17px; color: var(--text2); line-height: 1.75; margin-bottom: 24px;
  font-family: 'Fredoka', sans-serif;
}
.gold-insight-formula {
  background: var(--bg3); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  overflow-x: auto;
  border-radius: 0 10px 10px 0;
  padding: 20px 24px; margin: 28px 0;
}
.gold-insight-formula .katex-display { margin: 0 0 12px; }
.gold-insight-formula-note {
  font-size: 14px; color: var(--text3); line-height: 1.6;
  font-family: 'Fredoka', sans-serif; margin-top: 10px;
}
.gold-insight-cta {
  display: inline-block; margin-top: 8px;
  padding: 13px 28px; border-radius: 10px;
  background: var(--accent); color: #080d14;
  font-size: 16px; font-weight: 700; font-family: 'Fredoka', sans-serif;
  text-decoration: none; transition: background .18s;
}
.gold-insight-cta:hover { background: var(--accent2); }

/* ===== Gold Page ===== */
.gold-page-wrap {
  max-width: 1440px; margin: 0 auto; padding: 28px 32px 60px;
}
.gold-page-header {
  margin-bottom: 28px;
}
.gold-page-title {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 28px; font-weight: 800; color: var(--text);
  font-family: 'Fredoka', sans-serif; margin: 12px 0 20px;
}
.gold-sym-form {
  display: flex; gap: 10px; align-items: center; max-width: 380px;
}
.gold-sym-form .search-dropdown {
  min-width: 340px; max-width: 480px;
}
.gold-sym-input {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: 16px; font-family: 'Fredoka', sans-serif;
  outline: none;
}
.gold-sym-input:focus { border-color: var(--accent); }
.gold-sym-btn {
  padding: 10px 20px; border-radius: 8px; border: none;
  background: var(--accent); color: #080d14;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: 'Fredoka', sans-serif; transition: background .18s;
}
.gold-sym-btn:hover { background: var(--accent2); }
.gold-sym-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 0 20px;
}
.gold-quick-tickers {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.gold-quick-btn {
  padding: 7px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text2); font-size: 13px; font-weight: 600;
  font-family: 'Fredoka', sans-serif; text-decoration: none;
  transition: all .15s;
}
.gold-quick-btn:hover { border-color: var(--accent); color: var(--accent); }
.gold-quick-btn.active { background: var(--accent); color: #080d14; border-color: var(--accent); }
.gold-charts-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 40px;
}
.gold-explain { background: var(--bg2); border-radius: 16px; padding: 36px 0; }
.gold-explain-inner { max-width: 100%; margin: 0 auto; padding: 0 32px; }
.gold-explain-title {
  font-size: 22px; font-weight: 800; color: var(--text);
  margin-bottom: 16px; font-family: 'Fredoka', sans-serif;
}
.gold-explain-text {
  font-size: 16px; color: var(--text2); line-height: 1.75;
  margin-bottom: 20px; font-family: 'Fredoka', sans-serif;
}
/* Gold Beatability hero stat */
.gb-hero {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  background: rgba(245,158,11,0.06); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 28px;
  border: 1px solid rgba(245,158,11,0.3);
}
.gb-hero-sym {
  font-family: 'Fredoka', sans-serif; font-size: 15px; font-weight: 700;
  color: #f59e0b; letter-spacing: 1px; text-transform: uppercase;
}
.gb-hero-value {
  font-family: 'Fredoka', sans-serif; font-size: 36px; font-weight: 800;
  line-height: 1; color: #f59e0b;
}
.gb-hero-label {
  font-size: 20px; color: #f59e0b; font-family: 'Fredoka', sans-serif;
  margin-left: auto; opacity: 0.75;
}

/* Gold Beatability table */
.gb-loading { color: var(--text3); font-size: 14px; padding: 16px 0; }
.gb-row {
  display: grid; grid-template-columns: 64px 1fr 90px 160px;
  align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.gb-row:last-child { border-bottom: none; }
.gb-row-active { background: rgba(0,229,160,.04); border-radius: 8px; padding: 10px 8px; }
.gb-sym {
  font-family: 'Fredoka', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--accent); text-decoration: none;
}
.gb-sym:hover { text-decoration: none; }
.gb-bar-wrap {
  height: 6px; background: var(--bg3); border-radius: 4px; overflow: hidden;
}
.gb-bar { height: 100%; border-radius: 4px; }
.gb-bar-pos { background: var(--accent); }
.gb-bar-neg { background: #ef4444; }
.gb-pct { font-size: 14px; font-weight: 700; font-family: 'Fredoka', sans-serif; text-align: right; }
.gb-label { font-size: 11px; font-weight: 400; color: var(--text3); }
.gb-detail { font-size: 12px; color: var(--text3); font-family: 'Fredoka', sans-serif; }
@media (max-width: 700px) {
  .gb-row { grid-template-columns: 54px 1fr 80px; }
  .gb-detail { display: none; }
}

@media (max-width: 900px) {
  .gold-charts-grid { grid-template-columns: 1fr; }
  .gold-page-wrap { padding: 20px 16px 40px; }
}

.iv-preview-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}
.iv-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.iv-preview-eyebrow {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  font-family: 'Fredoka', sans-serif;
  margin-bottom: 6px;
}
.iv-preview-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  font-family: 'Fredoka', sans-serif;
}
/* 6-card grid */
.iv-prev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.iv-prev-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.iv-prev-card, .iv-prev-card:hover, .iv-prev-card:focus,
.iv-prev-card *, .iv-prev-card *:hover { text-decoration: none !important; }
.iv-prev-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

/* Left column */
.iv-prev-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.iv-prev-co {
  display: flex;
  align-items: center;
  gap: 14px;
}
.iv-prev-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg3);
  padding: 4px;
}
.iv-prev-logo-fb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--text2);
  flex-shrink: 0;
}
.iv-prev-sym {
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-name {
  font-size: 14px;
  color: var(--text2);
  margin-top: 2px;
}
.iv-prev-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.iv-prev-price {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
}
.iv-prev-chg {
  font-size: 16px;
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-label-sm {
  font-size: 12px;
  color: var(--text3);
  margin-left: 4px;
}
.iv-prev-methods {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.iv-prev-method-card {
  flex: 1;
  min-width: 60px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.iv-prev-method-card.rec {
  border-color: #f59e0b;
}
.iv-prev-method-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text3);
  text-transform: uppercase;
  font-family: 'Fredoka', sans-serif;
  margin-bottom: 6px;
}
.iv-prev-method-iv {
  font-size: 22px;
  font-weight: 400;
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
}
.iv-prev-method-pct {
  font-size: 14px;
  font-family: 'Fredoka', sans-serif;
  margin-top: 4px;
}
.iv-prev-params {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text3);
}
.iv-prev-params strong {
  color: var(--text2);
  font-weight: 400;
}

/* Right column */
.iv-prev-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.iv-prev-gauge-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.iv-prev-gauge { display: block; }
.iv-prev-gauge-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 16px;
  color: var(--text3);
  margin-top: -6px;
  padding: 0 8px;
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-iv-display {
  text-align: center;
  margin-top: 12px;
}
.iv-prev-iv-label {
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 4px;
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-iv-sym {
  color: var(--accent);
  font-weight: 700;
}
.iv-prev-iv-val {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-market-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.iv-prev-market-label {
  font-size: 15px;
  color: var(--text3);
  font-family: 'Fredoka', sans-serif;
}
.iv-prev-market-price {
  font-size: 18px;
  font-family: 'Fredoka', sans-serif;
  color: var(--text2);
}
.iv-prev-verdict {
  font-size: 15px;
  margin-top: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
}
.iv-prev-under { background: rgba(34,197,94,0.12);  color: #22c55e; }
.iv-prev-over  { background: rgba(239,68,68,0.12);  color: #ef4444; }
.iv-prev-fair  { background: rgba(245,158,11,0.12); color: #f59e0b; }
.iv-prev-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  background: var(--accent);
  color: #080d14;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.iv-prev-cta:hover { background: var(--accent3); transform: translateY(-1px); }

@media (max-width: 1100px) {
  .iv-prev-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .iv-prev-grid { grid-template-columns: 1fr; }
  .iv-prev-card { grid-template-columns: 1fr; }
}

/* ===== Subscribe Banner ===== */
.subscribe-banner {
  background: linear-gradient(135deg, #0a1f35 0%, #071628 50%, #0d2a1e 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 72px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
body.light .subscribe-banner {
  background: linear-gradient(135deg, #1a9e6a 0%, #157a52 50%, #0a4fa0 100%);
  border-color: transparent;
}
.subscribe-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(61,158,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.subscribe-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.subscribe-eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  margin-bottom: 12px;
}
body.light .subscribe-banner .subscribe-eyebrow { color: rgba(255,255,255,0.8); }
.subscribe-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  color:#f4f4f4;
  letter-spacing: 0.1px;
  margin-bottom: 12px;
}
.subscribe-sub {
  font-size: clamp(15px, 1.2vw, 18px);
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  line-height: 1.5;
}
.subscribe-form {
  display: flex;
  gap: 0;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.subscribe-form input {
  flex: 1;
  padding: 18px 24px;
  border: none;
  background: rgba(255,255,255,0.1);
  color:#f4f4f4;
  font-size: 18px;
  font-family: 'Fredoka', sans-serif;
  outline: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-right: none;
  border-radius: 12px 0 0 12px;
}
.subscribe-form input::placeholder { color: rgba(255,255,255,0.85); }
.subscribe-form button {
  padding: 18px 36px;
  background: var(--accent);
  border: none;
  color: #080d14;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  transition: background 0.2s;
  white-space: nowrap;
  border-radius: 0 12px 12px 0;
}
.subscribe-form button:hover { background: var(--accent3); }
.subscribe-form button.nl-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.subscribe-form button.nl-busy::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  top: 50%; left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #080d14;
  border-radius: 50%;
  animation: nl-spin 0.65s linear infinite;
}
@keyframes nl-spin { to { transform: rotate(360deg); } }
body.light .subscribe-banner .subscribe-form button { background: #fff; color: #1a9e6a; }
body.light .subscribe-banner .subscribe-form button:hover { background: #e0f0ff; }
.subscribe-note {
  margin-top: 12px;
  font-size: 18px;
  color: rgba(255,255,255,0.7);
}

/* ===== Site Footer ===== */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.footer-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 56px 32px 40px;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand {}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
  letter-spacing: 0.1px;
  text-decoration: none;
  margin-bottom: 14px;
}
.footer-logo:hover { text-decoration: none; }
.footer-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #080d14;
  font-weight: 900;
}
.footer-logo span { color: var(--accent); }
.footer-tagline {
  font-size: 14px;
  color: var(--text3);
  line-height: 1.6;
  max-width: 260px;
  margin-bottom: 20px;
}
.footer-socials {
  display: flex;
  gap: 10px;
}
.footer-social {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text3);
  text-decoration: none;
  transition: all 0.2s;
}
.footer-social:hover { border-color: var(--accent); color: var(--accent); background: var(--glow); text-decoration: none; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 16px;
  font-family: 'Fredoka', sans-serif;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul li a {
  font-size: 14px;
  color: var(--text3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: 13px;
  color: var(--text4);
}
.footer-bottom-links {
  display: flex;
  gap: 20px;
}
.footer-bottom-links a {
  font-size: 13px;
  color: var(--text4);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-bottom-links a:hover { color: var(--accent); }

@media (max-width: 1100px) {
  .footer-main { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-main { grid-template-columns: 1fr; text-align: center; padding: 36px 16px 28px; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .footer-tagline { width: 100%; max-width: 100%; }
  .footer-logo { justify-content: center; }
  .footer-col { width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .subscribe-form { flex-direction: column; border-radius: 12px; }
  .subscribe-form input { border-right: 1px solid rgba(255,255,255,0.15); border-bottom: none; border-radius: 12px 12px 0 0; }
  .subscribe-form button { border-radius: 0 0 12px 12px; }
}

/* =====================================================
   STOCK PAGE — EXTENDED COMPONENTS (appended)
   ===================================================== */

/* ── Stock page container ── */
.stock-page-container {
  max-width: 1440px;
  padding-top: 24px;
  padding-bottom: 48px;
  overflow-x: clip;
}

/* ── Exchange badge ── */
.exchange-badge {
  background: var(--bg3);
  color: var(--text3);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  border: 1px solid var(--border);
}

/* ── Company website link ── */
.company-website-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.company-website-link:hover { text-decoration: none; }

/* ── Price extras ── */
.price-range52 {
  font-size: 11px;
  color: var(--text3);
  font-family: 'Fredoka', sans-serif;
  margin-top: 5px;
}
.price-volume {
  font-size: 11px;
  color: var(--text4);
  font-family: 'Fredoka', sans-serif;
  margin-top: 2px;
}

/* ── Wide stats grid override ── */
.stats-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ── Consensus total ── */
.consensus-total {
  font-size: 11px;
  color: var(--text4);
  margin-top: 6px;
  font-family: 'Fredoka', sans-serif;
}

/* ── Price Target Panel ── */
.price-target-panel {
  min-width: 200px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px 20px;
  align-self: flex-start;
}
.pt-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 12px;
  font-family: 'Fredoka', sans-serif;
}
.pt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pt-row:last-child { border-bottom: none; }
.pt-row span { color: var(--text3); }
.pt-row strong { font-family: 'Fredoka', sans-serif; color: var(--text); font-weight: 600; }
.pt-divider {
  height: 1px;
  background: var(--border2);
  margin: 8px 0;
}
.no-data { font-size: 13px; color: var(--text4); font-style: italic; }

/* ── Financial Ratings ── */
.ratings-grid {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.rating-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.rating-badge {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Fredoka', sans-serif;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: var(--bg3);
  border: 2px solid var(--border2);
  color: var(--accent);
  text-align: center;
}
.rating-badge.rating-aplus,
.rating-badge.rating-a  { background: rgba(0,229,160,0.12); color: var(--accent); border-color: rgba(0,229,160,0.3); }
.rating-badge.rating-bplus,
.rating-badge.rating-b  { background: rgba(61,158,255,0.10); color: var(--blue);   border-color: rgba(61,158,255,0.3); }
.rating-badge.rating-cplus,
.rating-badge.rating-c  { background: rgba(245,200,66,0.12); color: var(--gold);   border-color: rgba(245,200,66,0.3); }
.rating-badge.rating-d,
.rating-badge.rating-f  { background: rgba(255,77,106,0.12); color: var(--red);    border-color: rgba(255,77,106,0.3); }
body.light .rating-badge.rating-aplus,
body.light .rating-badge.rating-a  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
body.light .rating-badge.rating-bplus,
body.light .rating-badge.rating-b  { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
body.light .rating-badge.rating-cplus,
body.light .rating-badge.rating-c  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
body.light .rating-badge.rating-d,
body.light .rating-badge.rating-f  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.rating-label { font-size: 12px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.rating-date  { font-size: 11px; color: var(--text4); font-family: 'Fredoka', sans-serif; }
.rating-scores { flex: 1; min-width: 260px; }
.rscore-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.rscore-label {
  width: 110px;
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}
.rscore-bar-wrap {
  flex: 1;
  background: var(--bg2);
  border-radius: 4px;
  height: 8px;
  border: 1px solid var(--border);
}
.rscore-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.5s ease;
}
.rscore-val {
  width: 36px;
  text-align: right;
  font-size: 12px;
  font-family: 'Fredoka', sans-serif;
  color: var(--text3);
}

/* ── Section tabs header (Annual / Quarterly) ── */
.section-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-tabs-header h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.section-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}
.stab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'Fredoka', sans-serif;
}
.stab.active {
  background: var(--accent);
  color: #080d14;
}
body.light .stab.active { color:#f4f4f4; }
.stab:not(.active):hover { color: var(--text); }
.fin-tab-panel { display: none; }
.fin-tab-panel.active { display: block; }

/* ── Num helpers ── */
.num { font-family: 'Fredoka', sans-serif; font-weight: 400; }
.green-soft { color: var(--green); opacity: 0.85; }
.red-soft   { color: var(--red);   opacity: 0.85; }

/* ── Action badges (Upgrade / Downgrade / Maintain) ── */
.action-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Fredoka', sans-serif;
  background: var(--bg3);
  color: var(--text3);
  border: 1px solid var(--border);
}
.badge-upgrade   { background: rgba(0,229,160,0.12); color: var(--accent); border-color: rgba(0,229,160,0.3); }
.badge-downgrade { background: rgba(255,77,106,0.12); color: var(--red);    border-color: rgba(255,77,106,0.3); }
.badge-maintain  { background: rgba(245,200,66,0.10); color: var(--gold);   border-color: rgba(245,200,66,0.25); }
body.light .badge-upgrade   { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
body.light .badge-downgrade { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
body.light .badge-maintain  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* ── Grade text ── */
.grade-text { font-size: 13px; color: var(--text2); font-family: 'Fredoka', sans-serif; }
.grade-text-new { color: var(--text); font-weight: 600; }

/* ── Analyst News ── */
.analyst-news-list { display: flex; flex-direction: column; gap: 12px; }
.anews-item {
  display: block;
  padding: 14px 18px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, background 0.18s;
}
.anews-item:hover { border-color: var(--accent); background: var(--card2); text-decoration: none; }
.anews-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.anews-firm {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  font-family: 'Fredoka', sans-serif;
}
.anews-grade {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--bg3);
  color: var(--text3);
  border: 1px solid var(--border);
  font-family: 'Fredoka', sans-serif;
}
.anews-target {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
}
.anews-title {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 8px;
}
.anews-footer {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text4);
  font-family: 'Fredoka', sans-serif;
}
.anews-source { color: var(--text3); }
.anews-price  { color: var(--text4); }

/* ── Insider Trading ── */
.insider-role { font-size: 11px; color: var(--text4); font-family: 'Fredoka', sans-serif; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insider-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  background: var(--bg3);
  color: var(--text3);
  border: 1px solid var(--border);
}
.insider-buy  { background: rgba(0,229,160,0.12); color: var(--accent); border-color: rgba(0,229,160,0.3); }
.insider-sell { background: rgba(255,77,106,0.12); color: var(--red);    border-color: rgba(255,77,106,0.3); }
body.light .insider-buy  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
body.light .insider-sell { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── Peers Grid ── */
.peers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.peer-logo {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg3);
}
.peer-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.peer-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.peer-sym {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.peer-name {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.peer-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.peer-price {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.peer-chg {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 600;
}
.peer-mktcap {
  font-size: 11px;
  color: var(--text4);
  font-family: 'Fredoka', sans-serif;
  margin-left: auto;
}

/* ── About Box ── */
.about-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.about-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 6px;
  flex-shrink: 0;
}
.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text4);
}
.about-meta span { display: flex; align-items: center; gap: 5px; }

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .ratings-grid { flex-direction: column; }
  .rating-scores { min-width: unset; }
  .about-box { flex-direction: column; }
  .about-logo { width: 48px; height: 48px; }
  .peers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-target-panel { min-width: unset; width: 100%; }
  .section-tabs-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .analyst-news-list .anews-footer { flex-wrap: wrap; }
  .insider-role { max-width: 100px; }
  .analyst-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  .radar-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  .radar-canvas-wrap { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1; }
}
@media (max-width: 480px) {
  .peers-grid { grid-template-columns: 1fr; }
  .stats-grid-wide { grid-template-columns: 1fr 1fr; }
}

/* ===================================================
   VALUATION RADAR
   =================================================== */
.radar-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: center;
}
.radar-canvas-wrap {
  position: relative;
  width: 400px;
  height: 400px;
  background: var(--bg2);
  border-radius: 12px;
}
.radar-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===================================================
   INTRINSIC VALUE CALCULATOR
   =================================================== */

.iv-page { padding: 0 0 60px 0; overflow-x: clip; }

/* ── Title bar ── */
.iv-titlebar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 20px; flex-wrap: wrap;
}
.iv-badge {
  display: inline-block; background: var(--accent); color: #080d14;
  font-size: 16px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px;
}
.iv-title {
  font-size: 46px; font-weight: 800; font-family: 'Fredoka', sans-serif; color: var(--text); margin: 0; line-height: 1.2;
}
.iv-title-sym { color: var(--text3); font-weight: 600; }
.iv-sym-tag {
  background: var(--bg3); color: var(--accent); font-size: 16px; font-weight: 800;
  padding: 4px 12px; border-radius: 8px; margin-left: 0; border: 1px solid var(--border);
  vertical-align: middle; line-height: 1;
}
.iv-price-pill {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 18px;
}
.iv-price-label { font-size: 13px; color: var(--text2); font-family: 'Fredoka', sans-serif; }
.iv-price-val   { font-size: 22px; font-weight: 800; color: var(--text); font-family: 'Fredoka', sans-serif; }
.iv-price-chg   { font-size: 13px; font-weight: 600; }
.iv-price-chg.up   { color: var(--green); }
.iv-price-chg.down { color: var(--red); }

/* ── Method tabs ── */
.iv-tabs-bar {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.iv-tab {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text3); font-size: 18px; font-weight: 700; padding: 10px 22px;
  cursor: pointer; transition: all .2s;
}
.iv-tab:hover  { border-color: var(--accent); color: var(--accent); }
.iv-tab.active { background: var(--accent); border-color: var(--accent); color: #080d14; font-weight: 800; }

/* ── Main 2-col layout ── */
.iv-main-layout {
  display: grid; grid-template-columns: 1fr 420px; gap: 24px; align-items: start;
}

/* ── Sliders panel ── */
.iv-sliders-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px;
}

.iv-slider-group { margin-bottom: 22px; }

.iv-slider-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.iv-slider-label {
  font-size: 15px; font-weight: 600; color: var(--text); display: flex;
  align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Stepper (+/−) */
.iv-stepper {
  display: flex; align-items: center; gap: 0;
  background: var(--bg3); border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
}
.iv-step-btn {
  background: var(--accent); border: none; color: #080d14;
  font-size: 18px; font-weight: 700; width: 36px; height: 36px;
  cursor: pointer; transition: background .15s; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.iv-step-btn:hover { background: var(--accent2); }
.iv-stepper-val {
  display: flex; align-items: center; gap: 2px;
  padding: 0 6px; min-width: 90px; justify-content: center;
}
.iv-stepper-cur { font-size: 13px; color: var(--text3); }
.iv-step-input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; font-weight: 400;
  font-family: 'Fredoka', sans-serif; text-align: center;
  width: 70px;
}
/* hide number input arrows */
.iv-step-input::-webkit-outer-spin-button,
.iv-step-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.iv-step-input[type=number] { -moz-appearance: textfield; }

/* Range slider */
.iv-range {
  width: 100%; height: 6px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 50%), var(--border) var(--pct, 50%), var(--border) 100%);
  border-radius: 3px; outline: none;
}
.iv-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); box-shadow: 0 2px 8px rgba(0,229,160,.4);
  cursor: pointer; transition: transform .15s;
}
.iv-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.iv-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); cursor: pointer;
}

.iv-slider-divider {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); padding: 16px 0 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.iv-slider-divider-note {
  font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--text3); font-style: italic;
}

.iv-chk-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: var(--text3); cursor: pointer;
}
.iv-chk-label input { accent-color: var(--accent); cursor: pointer; }

/* CAPM note under discount rate slider */
.iv-capm-note {
  margin-top: 6px; padding: 8px 11px;
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  display: flex; flex-direction: column; gap: 6px;
  width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; overflow: hidden;
}
.iv-capm-formula {
  font-size: 15px; color: var(--text);
  font-family: 'Fredoka', sans-serif; letter-spacing: 0.2px;
}
.iv-capm-formula strong { color: var(--accent); font-size: 16px; }
.iv-capm-rows { display: flex; flex-direction: column; gap: 3px; }
.iv-capm-row {
  display: grid; grid-template-columns: 36px 54px 1fr; min-width: 0;
  align-items: baseline; gap: 6px; font-size: 14px;
}
.iv-capm-term {
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  color: var(--accent); font-size: 15px;
}
.iv-capm-val { font-weight: 700; color: var(--text); font-family: 'Fredoka', sans-serif; }
.iv-capm-desc { color: var(--text); line-height: 1.4; }
.iv-capm-src { color: var(--text2); font-style: italic; font-size: 13px; }
.iv-capm-link { color: var(--accent); text-decoration: none; }
.iv-capm-link:hover { color: var(--accent2); }
.iv-capm-floor { color: var(--text3); font-size: 13px; font-style: italic; cursor: help; }
.iv-capm-apply {
  display: inline-block; margin-left: 8px;
  padding: 2px 10px; border-radius: 20px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .18s; vertical-align: middle; font-family: inherit;
}
.iv-capm-apply:hover { background: var(--accent); color: #080d14; }

/* Action buttons */
.iv-action-row { display: flex; gap: 10px; margin-top: 8px; }
.iv-save-btn, .iv-load-btn, .iv-reset-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.iv-save-btn  { background: var(--accent); color: #080d14; border-color: var(--accent); }
.iv-save-btn:hover  { background: var(--accent2); }
.iv-load-btn  { background: var(--bg3); color: var(--text3); }
.iv-load-btn:hover  { border-color: var(--accent); color: var(--accent); }
.iv-reset-btn { background: var(--bg3); color: #f87171; border-color: #f87171; font-weight: 700; letter-spacing: 0.03em; }
.iv-reset-btn:hover { background: #f87171; color: #080d14; border-color: #f87171; }

/* ── Results panel ── */
.iv-results-panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 120px; }
.iv-results-panel.iv-panel-stuck .iv-gauge-card {
  border-top: 2px solid var(--accent);
  box-shadow: 0 -3px 16px rgba(0,229,160,.18), 0 0 32px rgba(0,229,160,.08);
}

/* Gauge card */
.iv-gauge-card {
  background: var(--card); border: 1.5px solid var(--accent);
  border-radius: 16px; padding: 20px;
  box-shadow: 0 0 32px rgba(0,229,160,.08);
  text-align: center;
}
.iv-gauge-needle-label {
  display: none;
}

.iv-gauge-divider {
  border-top: 1px solid var(--border);
  margin: 16px 0 12px;
}
.iv-gauge-digit-wrap {
  display: flex; flex-direction: column; align-items: center; margin-bottom: 4px;
}
.iv-gauge-row-label {
  font-size: 18px; color: var(--text3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.iv-gauge-price-row {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 4px; border-top: 1px solid var(--border2);
}
.iv-gauge-price-label { display: none; }
.iv-gauge-price-val {
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  font-size: 46px; color: var(--text);
}
.iv-gauge-pct-row {
  text-align: center; padding: 6px 0 4px;
}
.iv-gauge-pct-row strong {
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  font-size: 32px;
}

/* Result card */
.iv-result-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 0;
}
.iv-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border2);
  font-size: 14px; color: var(--text2);
}
.iv-result-row:last-child { border-bottom: none; }
.iv-res-price { font-weight: 700; color: var(--text); font-family: 'Fredoka', sans-serif; }
.iv-result-main {
  background: var(--bg3); margin: 4px -8px; padding: 10px 8px;
  border-radius: 10px; border: none !important;
}

/* Animated digit display */
.iv-digit-display {
  display: inline-flex; align-items: center; gap: 1px;
  background: var(--bg2); border: 1.5px solid var(--accent);
  border-radius: 10px; padding: 10px 18px;
  box-shadow: 0 0 16px rgba(0,229,160,.12);
}
.iv-digit {
  display: inline-block; font-size: 46px; font-weight: 800;
  font-family: 'Fredoka', sans-serif; color: var(--text);
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  min-width: 28px; text-align: center;
}
.iv-digit-sep { color: var(--text2); min-width: 12px; font-size: 38px; }
.iv-digit.animating { transform: translateY(-4px) scale(1.15); color: var(--accent); }
.iv-disc-under { color: var(--green) !important; font-size: 15px; }
.iv-disc-over  { color: var(--red)   !important; font-size: 15px; }
.iv-disc-fair  { color: #f59e0b     !important; font-size: 15px; }

/* DCF breakdown table */
.iv-breakdown-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; overflow: hidden;
}
.iv-breakdown-title {
  font-size: 14px; font-weight: 700; color: var(--text); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 12px;
}
.iv-breakdown-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.iv-breakdown-table th {
  text-align: right; color: var(--text3); font-weight: 600; padding: 4px 6px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-family: 'Fredoka', sans-serif;
}
.iv-breakdown-table th:first-child { text-align: left; }
.iv-breakdown-table td {
  text-align: right; color: var(--text); padding: 3px 6px;
  border-bottom: 1px solid var(--border2); font-family: 'Fredoka', sans-serif;
}
.iv-breakdown-table td:first-child { text-align: left; color: var(--text); font-family: 'Fredoka', sans-serif; }
.iv-tbl-phase-end td { border-bottom: 2px solid var(--accent) !important; }
.iv-breakdown-table tfoot td { color: var(--text); font-weight: 700; padding: 5px 6px; }
.iv-breakdown-table tfoot tr:first-child td { border-top: 2px solid var(--border); }

/* Growth rate derivation block */
.iv-growth-derive {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  padding: 14px 16px; margin: 10px 0 6px;
  max-width: 100%; overflow-x: auto;
}
.iv-growth-derive-title {
  font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .4px;
  text-transform: uppercase; margin-bottom: 10px;
}
.iv-eps-table {
  width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px;
}
.iv-eps-table th {
  text-align: center; color: var(--text3); font-weight: 600; padding: 3px 4px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.iv-eps-table th:first-child { text-align: left; }
.iv-eps-table td {
  text-align: center; color: var(--text2); padding: 4px 4px; font-family: 'Fredoka', sans-serif;
}
.iv-eps-table td:first-child { text-align: left; color: var(--text2); font-weight: 600; font-family: 'Fredoka', sans-serif; }
.iv-eps-cagr { color: var(--accent) !important; font-weight: 700 !important; }
.iv-growth-formula-wrap { overflow-x: auto; max-width: 100%; width: 100%; }
.iv-growth-formula-wrap > div { padding: 4px 2px; }
.iv-growth-formula-wrap > div:is(#katex-g1-model, #katex-g2-derive) { padding-top: 10px; border-top: 1px solid var(--border2); }
.iv-growth-formula-wrap > div:is(#katex-g1-model) { border-top: none; }
.iv-reg-chart-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border2); }
.iv-reg-chart-wrap canvas { max-height: 220px; }
.iv-reg-chart-note { margin-top: 8px; font-size: 0.78rem; color: var(--text2); line-height: 1.4; }
.iv-debt-cash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .iv-debt-cash-row { grid-template-columns: 1fr; } }
.iv-growth-formula-wrap .katex { color: var(--text) !important; font-size: 1.1em; }
body.light .iv-growth-derive { background: #f4f7f5; }
body.light .iv-growth-formula-wrap .katex { color: #111 !important; }

/* Light mode */
body.light .iv-sliders-panel { background: #fff; }
body.light .iv-gauge-card    { background: #fff; }
body.light .iv-result-card   { background: #fff; }
body.light .iv-breakdown-card { background: #fff; }
body.light .iv-stepper       { background: #f4f7f5; }
body.light .iv-step-input    { color: #111; }
body.light .iv-digit-display { background: #f0faf5; }
body.light .iv-tab.active    { color:#f4f4f4; }
body.light .iv-save-btn      { color:#f4f4f4; }

/* Responsive */
@media (max-width: 1100px) {
  .iv-main-layout { grid-template-columns: 1fr; width: 100%; max-width: 100%; }
  .iv-results-panel { position: static; order: -1; width: 100%; box-sizing: border-box; min-width: 0; }
  .iv-sliders-panel { width: 100%; box-sizing: border-box; min-width: 0; overflow: hidden; }
  .iv-gauge-card { width: 100%; box-sizing: border-box; }
  .iv-digit-display { display: flex; width: 100%; box-sizing: border-box; justify-content: center; }
}
@media (max-width: 600px) {
  .iv-titlebar { flex-direction: column; align-items: center; text-align: center; }
  .iv-title { font-size: 28px; }
  .iv-price-pill { width: 100%; justify-content: center; }
  .iv-slider-header { flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; }
  .iv-stepper { width: 100%; box-sizing: border-box; min-width: 0; }
  .iv-tabs-bar { flex-wrap: wrap; }
  .iv-legend-phases { grid-template-columns: 1fr; }
  .iv-gauge-card { padding: 14px 10px; }
  .iv-gauge-price-val { font-size: 28px; }
  .iv-gauge-pct-row strong { font-size: 24px; }
  .iv-digit { font-size: 36px; min-width: 20px; }
  .iv-breakdown-card { padding: 12px 8px; overflow-x: auto; }
  .iv-breakdown-table { font-size: 12px; }
  .iv-sliders-panel { padding: 16px 12px; }
  .iv-formula-card { padding: 16px 12px; }
  .iv-stepper { flex-shrink: 1; max-width: 100%; }
  .iv-stepper-val { flex: 1; min-width: 0; justify-content: center; }
  .iv-capm-formula { white-space: nowrap; display: block; overflow-x: auto; max-width: 100%; }
}

/* ── Formula card ── */
.iv-formula-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 24px; margin-top: 32px; margin-bottom: 20px; overflow: hidden;
}
.iv-formula-tabs {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.iv-formula-tab {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text4); font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 4px 12px; cursor: pointer; transition: all .2s; text-transform: uppercase;
}
.iv-formula-tab:hover  { border-color: var(--accent); color: var(--accent); }
.iv-formula-tab.active { background: var(--accent); border-color: var(--accent); color: #080d14; }

.iv-formula-block { display: none; }
.iv-formula-block.active { display: block; }

.iv-formula-desc {
  font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: 14px;
}
.iv-formula-main {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  padding: 16px; overflow-x: auto; text-align: center; margin-bottom: 14px;
}
/* KaTeX color in dark mode */
.iv-formula-main .katex { color: var(--text) !important; font-size: 1.1em; }
body.light .iv-formula-main .katex { color: #111 !important; }

.iv-formula-legend { margin-top: 12px; }

/* Phase cards */
.iv-legend-phases {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px;
}
.iv-legend-phase {
  border-radius: 10px; padding: 12px 14px; border-left: 4px solid transparent;
}
.iv-phase-growth     { background: rgba(34,197,94,.12);  border-color: #22c55e; }
.iv-phase-transition { background: rgba(234,179,8,.12);  border-color: #eab308; }
.iv-phase-terminal   { background: rgba(239,68,68,.12);  border-color: #ef4444; }
.iv-phase-label {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.iv-phase-growth .iv-phase-label     { color: #22c55e; }
.iv-phase-transition .iv-phase-label { color: #eab308; }
.iv-phase-terminal .iv-phase-label   { color: #ef4444; }
.iv-phase-desc {
  font-size: 14px; color: var(--text); line-height: 1.6;
}
.iv-phase-desc em { color: var(--accent); font-style: italic; font-weight: 600; }

/* Symbol legend */
.iv-legend-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0 16px;
}
.iv-legend-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 10px 0 10px; border-bottom: 1px solid var(--border2);
}
.iv-legend-item:last-child { border-bottom: none; }
.iv-legend-sym {
  flex-shrink: 0; width: auto; min-width: 0;
  font-size: 15px; font-style: italic; color: var(--accent); font-weight: 700;
  white-space: nowrap; padding-right: 4px;
}
.iv-legend-def { font-size: 15px; color: var(--text); line-height: 1.6; }
/* keep old em styling for inline formula refs */
.iv-legend-grid em { font-style: italic; color: var(--accent); font-weight: 600; }

body.light .iv-phase-growth     { background: rgba(34,197,94,.06); }
body.light .iv-phase-transition { background: rgba(234,179,8,.06); }
body.light .iv-phase-terminal   { background: rgba(239,68,68,.06); }

body.light .iv-formula-card { background: #fff; }
body.light .iv-formula-main { background: #f4f7f5; }

/* KEEP these from old code */
.up   { color: var(--green); }
.down { color: var(--red); }

/* ── OLD Hero (no longer used, kept for safety) ── */
.iv-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
  background: linear-gradient(135deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px;
}
.iv-hero-badge {
  display: inline-block; background: var(--accent); color: #080d14;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.iv-hero-title {
  font-size: 24px; font-weight: 800; color: var(--text); margin: 0 0 8px 0;
}
.iv-hero-sym {
  background: var(--bg3); color: var(--accent); font-size: 14px; font-weight: 700;
  padding: 2px 10px; border-radius: 6px; margin-left: 8px;
  vertical-align: middle; border: 1px solid var(--border);
}
.iv-hero-desc { color: var(--text3); font-size: 13px; margin: 0; max-width: 480px; }
.iv-hero-price-box {
  text-align: right; flex-shrink: 0;
}
.iv-hero-label { font-size: 11px; color: var(--text4); text-transform: uppercase; letter-spacing: 1px; }
.iv-hero-price { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1.1; }
.iv-hero-chg { font-size: 14px; font-weight: 600; margin-top: 4px; }
.iv-hero-chg.up   { color: var(--green); }
.iv-hero-chg.down { color: var(--red); }

/* Method bar */
.iv-method-bar {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
}
.iv-method-label { font-size: 13px; font-weight: 600; color: var(--text3); white-space: nowrap; }
.iv-method-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-method-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text3); font-size: 13px; padding: 7px 16px; cursor: pointer;
  transition: all .2s;
}
.iv-method-btn:hover { border-color: var(--accent); color: var(--accent); }
.iv-method-btn.active {
  background: var(--accent); border-color: var(--accent);
  color: #080d14; font-weight: 700;
}

/* Two-panel layout */
.iv-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px;
}

/* Panel */
.iv-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden;
}
.iv-panel-my { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(0,229,160,.08); }

.iv-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.iv-panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.iv-panel-sub   { font-size: 12px; color: var(--text4); }
.iv-panel-actions { display: flex; gap: 8px; }
.iv-btn-sm {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text3); font-size: 12px; padding: 5px 12px; cursor: pointer;
  transition: all .2s;
}
.iv-btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Result block */
.iv-result-block {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.iv-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 14px; color: var(--text2);
}
.iv-result-price { font-weight: 600; color: var(--text); }
.iv-result-iv    { background: var(--bg3); margin: 4px -4px; padding: 8px 4px; border-radius: 8px; }
.iv-result-iv strong { font-size: 20px; font-weight: 800; color: var(--text); }
.iv-disc-under { color: var(--green) !important; }
.iv-disc-over  { color: var(--red)   !important; }
.iv-disc-fair  { color: #f59e0b     !important; }

/* Gauge */
.iv-gauge-wrap {
  display: block; width: 300px; max-width: 100%; margin: 0 auto;
}
.iv-gauge-wrap canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 300 / 160;
}
.iv-gauge-labels {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text2); margin-top: -4px; padding: 0 6px;
}
.iv-gauge-iv-label {
  text-align: center; font-size: 13px; color: var(--text2); margin-top: 6px; line-height: 1.4;
}
.iv-gauge-iv-label span { font-size: 30px; font-weight: 800; color: var(--accent); }

/* Inputs */
.iv-inputs-section { padding: 12px 20px 20px; }
.iv-input-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border2); font-size: 13px;
  color: var(--text3); gap: 10px;
}
.iv-input-row:last-of-type { border-bottom: none; }
.iv-input-editable label { flex: 1; color: var(--text3); }
.iv-input-editable input[type=number] {
  width: 100px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 5px 10px;
  font-size: 13px; text-align: right; outline: none; transition: border .2s;
}
.iv-input-editable input[type=number]:focus { border-color: var(--accent); }
.iv-input-divider {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text4); padding: 12px 0 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.iv-checkbox-inline {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-size: 11px; color: var(--text4); cursor: pointer;
}
.iv-checkbox-inline input { cursor: pointer; accent-color: var(--accent); }

.iv-calc-btn {
  width: 100%; margin-top: 16px; padding: 12px;
  background: var(--accent); border: none; border-radius: 10px;
  color: #080d14; font-size: 15px; font-weight: 800; cursor: pointer;
  letter-spacing: .5px; transition: all .2s;
}
.iv-calc-btn:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,229,160,.3); }
.iv-calc-btn:active { transform: translateY(0); }

/* History section */
.iv-history-section {
  margin-top: 8px;
}
.iv-history-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 16px;
}
.iv-history-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.iv-history-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px;
}
.iv-history-card-title {
  font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 10px;
}
.iv-history-row {
  display: flex; justify-content: space-between; font-size: 13px;
  color: var(--text3); padding: 4px 0; border-bottom: 1px solid var(--border2);
}
.iv-history-row:last-child { border-bottom: none; }
.iv-history-cagr { font-weight: 700; }
.up   { color: var(--green); }
.down { color: var(--red); }

/* Light mode overrides */
body.light .iv-hero       { background: linear-gradient(135deg,#f8faf9 0%,#e8f5ee 100%); }
body.light .iv-panel      { background: #fff; }
body.light .iv-panel-header { background: #f4f7f5; }
body.light .iv-digit-display { background: #f4f7f5; }
body.light .iv-input-editable input[type=number] { background: #f4f7f5; }
body.light .iv-history-card { background: #fff; }
body.light .iv-calc-btn   { color:#f4f4f4; }

/* Responsive */
@media (max-width: 900px) {
  .iv-panels { grid-template-columns: 1fr; }
  .iv-history-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .iv-hero { flex-direction: column; }
  .iv-hero-price-box { text-align: left; }
  .iv-method-tabs { flex-direction: column; }
  .iv-history-grid { grid-template-columns: 1fr; }
}
