/* ── Shared page-hero used by disclaimer, faq, privacy, terms ── */
.page-hero {
    position: relative; padding: 4rem 0 3rem;
    text-align: center; overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}
.page-hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(139,92,246,0.1) 0%, transparent 65%);
    pointer-events: none;
}
.page-hero .hero-badge { margin-bottom: 1.5rem; }
.page-title { font-size: clamp(2rem, 5vw, 4rem); font-weight: 700; margin-bottom: 1rem; }
.page-description { font-size: 1.05rem; color: var(--color-text-muted); max-width: 560px; margin: 0 auto; }
.page-meta {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 0.6rem 1.5rem; margin-top: 1.25rem;
    font-size: 0.85rem; color: var(--color-text-muted);
}
.page-content { max-width: 860px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.content-section { margin-bottom: 3rem; }
.content-section-title {
    font-size: 1.15rem; font-weight: 700;
    margin-bottom: 1rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; gap: 0.6rem;
}
.section-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
p { color: var(--color-text-muted); margin-bottom: 1rem; line-height: 1.7; }
p strong { color: var(--color-text); font-weight: 600; }
ul { padding-left: 1.5rem; color: var(--color-text-muted); margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; line-height: 1.65; }
li strong { color: var(--color-text); font-weight: 600; }
a { color: var(--color-primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; text-decoration: underline; }

/* ── Warning / info callout ── */
.callout-warning {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 0.75rem; margin-bottom: 2.5rem;
}
.callout {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 0.75rem; margin: 0 0 2.5rem;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-warning p, .callout p { margin: 0; font-size: 0.9rem; }

/* ── FAQ accordion ── */
.faq-item {
    border: 1px solid var(--color-border); border-radius: 0.75rem;
    margin-bottom: 0.75rem; overflow: hidden; transition: border-color 0.2s;
}
.faq-item:hover { border-color: rgba(139,92,246,0.4); }
.faq-item.open  { border-color: var(--color-primary); }
.faq-question {
    width: 100%; background: none; border: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem;
    font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600;
    color: var(--color-text); text-align: left; transition: background 0.2s;
    min-height: 52px; /* good tap target */
    gap: 0.75rem;
}
.faq-question:hover { background: var(--color-bg-secondary); }
.faq-icon {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(139,92,246,0.12); color: var(--color-primary);
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: transform 0.25s, background 0.2s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--color-primary); color: #fff; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-answer p { padding: 0 1.25rem 1.25rem; margin: 0; font-size: 0.9rem; }

/* ── TOC (terms, privacy) ── */
.toc {
    background: var(--color-bg-secondary); border: 1px solid var(--color-border);
    border-radius: 1rem; padding: 1.25rem; margin-bottom: 2.5rem;
}
.toc-title {
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 0.875rem;
}
.toc ol  { padding-left: 1.25rem; margin: 0; }
.toc li  { margin-bottom: 0.35rem; }
.toc a   { color: var(--color-text-muted); font-size: 0.9rem; }
.toc a:hover { color: var(--color-primary); text-decoration: none; }

/* ── Data table (privacy) ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
th {
    background: var(--color-bg-secondary); color: var(--color-text);
    font-weight: 600; text-align: left; padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
}
td { padding: 0.65rem 1rem; border: 1px solid var(--color-border); color: var(--color-text-muted); }
tr:hover td { background: rgba(255,255,255,0.02); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-hero, .page-content { animation: fadeUp 0.35s ease both; }

@media (prefers-reduced-motion: reduce) {
    .page-hero, .page-content { animation: none; }
}

/* ============================================
   RESPONSIVE — Mobile (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .page-hero    { padding: 2.5rem 0 2rem; }
    .page-content { padding: 2.5rem 1rem 4rem; }
    .faq-question { font-size: 0.9rem; padding: 0.875rem 1rem; }
    .faq-answer p { padding: 0 1rem 1rem; }
    .toc { padding: 1rem; }
    .callout-warning, .callout { flex-direction: row; }
    /* Navbar is ~62px sticky on mobile — give 76px top so content clears it with breathing room */
    .page-shell-hero { padding: 76px 16px 32px; }
    .page-shell-hero h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
    .page-shell-hero p { font-size: 0.9rem; margin-bottom: 24px; }
    .page-shell-tabs { gap: 6px; }
    .page-shell-tab { padding: 6px 14px; font-size: 0.78rem; min-height: 34px; }
    .page-shell-body { padding: 32px 16px 64px; }
}

@media (max-width: 480px) {
    .page-title { font-size: 1.85rem; }
    table { font-size: 0.82rem; }
    th, td { padding: 0.55rem 0.75rem; }
    /* Extra tight on small phones */
    .page-shell-hero { padding: 70px 12px 24px; }
    .page-shell-hero h1 { font-size: 1.5rem; }
    .page-shell-body { padding: 24px 12px 48px; }
}
/* ── Gold-theme pages: remap --gold to purple palette ─────────────────────── */
/* Applies to watchlist, portfolio, screener, blog pages that use --gold vars */
.dark-theme {
    --gold: #8b5cf6;
    --gold-dim: #7c3aed;
    --bg: var(--color-bg, #09090b);
    --surface: var(--color-surface, #0f0f11);
    --card: var(--color-card, #141417);
    --border: var(--color-border, #27272a);
    --text: var(--color-text, #fafafa);
    --muted: var(--color-text-muted, #71717a);
}

/* Ensure content clears fixed navbar (70px) on gold-theme pages */
.dark-theme .page {
    padding-top: 86px;
}

/* Fix old inline nav logo font (Playfair) appearing on these pages */
.dark-theme .nav-logo {
    font-family: var(--font-family, 'Inter', sans-serif);
    color: var(--color-primary, #8b5cf6);
}

/* ═══════════════════════════════════════════════════════════════════
   PAGE SHELL — matches resources.html hero + tab structure
   Used by: watchlist, portfolio, screener, scanner, sectors, blog
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page Hero ── */
.page-shell-hero {
  text-align: center;
  /* 96px top = 62px navbar + 34px breathing room. Fine on desktop. */
  padding: 96px 24px 48px;
  position: relative;
  overflow: hidden;
}
.page-shell-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 800px 400px at 50% -80px, var(--overlay-purple-md, rgba(124,92,252,.14)) 0%, transparent 70%);
  pointer-events: none;
}
.page-shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(124,92,252,.4);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: .78rem;
  color: #a78bfa;
  background: rgba(124,92,252,.08);
  margin-bottom: 20px;
  font-weight: 500;
}
.page-shell-badge .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7c5cfc;
  display: inline-block;
  flex-shrink: 0;
}
.page-shell-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 14px;
}
.page-shell-hero h1 em { font-style: normal; color: #a78bfa; }
.page-shell-hero p {
  max-width: 580px;
  margin: 0 auto 32px;
  color: #71717a;
  font-size: .97rem;
  line-height: 1.7;
}

/* ── Tab Strip (TOC-style like resources) ── */
.page-shell-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 0;
}
.page-shell-tab {
  border: 1px solid #27272a;
  border-radius: 100px;
  padding: 7px 18px;
  font-size: .83rem;
  color: #a1a1aa;
  text-decoration: none;
  background: #141417;
  transition: border-color .2s, color .2s, background .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  min-height: 34px;
}
.page-shell-tab:hover,
.page-shell-tab.active {
  border-color: #7c5cfc;
  color: #a78bfa;
  background: rgba(124,92,252,.08);
}

/* ── Page Body ── */
.page-shell-divider {
  border: none;
  border-top: 1px solid #27272a;
  margin: 0 24px;
}
.page-shell-body {
  max-width: 1680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-shell-section {
  display: none;
  animation: fadeInSection .25s ease;
}
.page-shell-section.active { display: block; }
@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section header inside body ── */
.shell-section-label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7c5cfc;
  font-weight: 600;
  margin-bottom: 8px;
}
.shell-section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}
.shell-section-sub {
  color: #71717a;
  font-size: .95rem;
  margin-bottom: 32px;
  max-width: 560px;
}
/* ── Layout: ensure footer sticks to bottom on all pages using this CSS ── */
body.dark-theme { min-height: 100vh; display: flex; flex-direction: column; }
