/* ==========================================================================
   ClearWealthCalc — Compound Interest, HYSA & Investment Growth Suite
   Zero External Dependencies | Responsive Modern Financial UI
   ========================================================================== */

:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --primary: #14532d;
  --primary-hover: #0f3f22;
  --accent: #15803d;
  --accent-mid: #22c55e;
  --soft-accent: #f0fdf4;
  --soft-accent-border: #bbf7d0;
  --text: #1c1917;
  --muted: #57534e;
  --muted-light: #78716c;
  --stone-soft: #f5f5f4;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  flex-shrink: 0;
}

.brand-link {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.header-nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.header-nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.header-cta:hover {
  background: #dcfce7;
  border-color: #86efac;
  text-decoration: none;
}

/* Breadcrumb */
.breadcrumb-bar {
  padding: 14px 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumb-list a {
  color: var(--muted);
  font-weight: 500;
}

.breadcrumb-list a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--muted-light);
  user-select: none;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* Hero Section */
.hero {
  padding: 14px 0 22px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  font-weight: 800;
}

.hero-lead {
  margin: 0;
  max-width: 840px;
  font-size: 1.04rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Preset Scenario Pills */
.preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.preset-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 4px;
}

.preset-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--primary);
  background: var(--soft-accent);
}

.preset-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Main Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 375px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.inputs-card {
  padding: 22px;
}

.card-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.reset-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.reset-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.form-group {
  margin-bottom: 15px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted-light);
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.affix-prefix,
.affix-suffix {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.affix-prefix {
  left: 12px;
}

.affix-suffix {
  right: 12px;
}

.num-input,
.select-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.num-input.has-prefix {
  padding-left: 28px;
}

.num-input.has-suffix {
  padding-right: 34px;
}

.num-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.14);
}

/* Range Slider */
.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.years-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 10px;
  align-items: center;
}

input[type="range"].range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e7e5e4;
  outline: none;
  cursor: pointer;
}

input[type="range"].range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

input[type="range"].range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  background: var(--accent);
}

input[type="range"].range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted-light);
  margin-top: 4px;
}

/* Inflation & Tax Sub-box */
.adjustments-box {
  margin-top: 16px;
  padding: 14px;
  background: var(--stone-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.toggle-subnote {
  margin: 5px 0 10px;
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Results Panel */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kpi-hero-card {
  padding: 22px 24px;
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.kpi-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #bbf7d0;
  margin-bottom: 4px;
}

.kpi-main-value {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f0fdf4;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.kpi-hero-sub {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #dcfce7;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.kpi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .kpi-grid-3 {
    grid-template-columns: 1fr;
  }
}

.kpi-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-stat-label {
  font-size: 0.79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-stat-value {
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-stat-value.is-green {
  color: var(--accent);
}

.kpi-stat-meta {
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Composition Bar */
.composition-strip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.comp-bar-track {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--stone-soft);
  margin-bottom: 10px;
}

.comp-seg-init {
  background: #78716c;
  transition: width 0.25s ease;
}

.comp-seg-contrib {
  background: #4ade80;
  transition: width 0.25s ease;
}

.comp-seg-growth {
  background: #14532d;
  transition: width 0.25s ease;
}

.comp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Pure SVG Chart Card */
.chart-card {
  padding: 20px 22px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.chart-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart-type-toggle {
  display: inline-flex;
  background: var(--stone-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.chart-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.chart-mode-btn.is-active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.svg-chart-wrap {
  position: relative;
  width: 100%;
}

.growth-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-tooltip {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

/* Smart Benchmarks Callout Grid */
.insight-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 680px) {
  .insight-strip {
    grid-template-columns: 1fr;
  }
}

.insight-box {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  font-size: 0.85rem;
  color: var(--text);
}

.insight-box strong {
  color: var(--primary);
}

/* Year-by-Year Milestone Table */
.schedule-section {
  margin-top: 26px;
  padding: 22px 24px;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.schedule-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--soft-accent);
  border-color: var(--accent);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.milestone-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  background: var(--card);
}

.milestone-table th,
.milestone-table td {
  padding: 10px 13px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.milestone-table th:first-child,
.milestone-table td:first-child {
  text-align: left;
}

.milestone-table thead th {
  background: var(--stone-soft);
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}

.milestone-table tbody tr:last-child td {
  border-bottom: none;
  font-weight: 700;
  background: var(--soft-accent);
}

.milestone-table tbody tr:hover td {
  background: #f7fee7;
}

.milestone-table tbody tr.is-crossover td {
  background: #f0fdf4;
}

.milestone-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  vertical-align: middle;
}

.milestone-tag.is-crossover-tag {
  background: var(--accent);
}

/* Optional Ad Slots */
.ad-slot {
  display: none;
  margin: 24px 0;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--stone-soft);
  text-align: center;
  color: var(--muted-light);
  font-size: 0.78rem;
}

.ad-slot.is-visible {
  display: block;
}

/* Partner / Affiliate Cards */
.partners-section {
  margin-top: 28px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.partners-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.partners-header h2 {
  margin: 0;
  font-size: 1.22rem;
  color: var(--text);
}

.ftc-disclosure {
  margin: 0 0 18px;
  font-size: 0.78rem;
  color: var(--muted-light);
  line-height: 1.45;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 880px) {
  .partners-grid {
    grid-template-columns: 1fr;
  }
}

.partner-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.partner-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.partner-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.partner-name {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.partner-desc {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.partner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.partner-cta:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

/* Editorial Content & Benchmarks */
.editorial-section {
  margin-top: 32px;
  padding: 28px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (max-width: 640px) {
  .editorial-section {
    padding: 20px 18px;
  }
}

.editorial-section h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  line-height: 1.28;
  color: var(--text);
  letter-spacing: -0.015em;
}

.editorial-section h3 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  color: var(--primary);
}

.editorial-section p {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.7;
}

.editorial-section ul,
.editorial-section ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.editorial-section li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.formula-box {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--soft-accent);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--primary);
  overflow-x: auto;
}

.benchmark-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.benchmark-table th,
.benchmark-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.benchmark-table thead th {
  background: var(--stone-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
}

.benchmark-table tbody tr:last-child td {
  border-bottom: none;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 28px;
  padding: 28px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.faq-section h2 {
  margin: 0 0 18px;
  font-size: 1.4rem;
  color: var(--text);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--soft-accent);
  color: var(--primary);
  font-weight: 800;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.65;
}

.faq-item.is-open .faq-answer {
  display: block;
}

/* Related Tools & Cross-Linking */
.related-section {
  margin-top: 28px;
  padding: 26px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.related-section h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--text);
}

.related-sub {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.related-group-title {
  margin: 16px 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

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

.related-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.related-card:hover {
  border-color: var(--accent);
  background: var(--soft-accent);
  text-decoration: none;
}

.related-card.is-current {
  border-color: var(--primary);
  background: var(--soft-accent);
}

.related-card-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.related-card-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Footer */
.site-footer {
  margin-top: 44px;
  padding: 32px 0 40px;
  background: var(--card);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

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

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

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

.footer-disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted-light);
  line-height: 1.55;
}
