:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --primary: #14532d;
  --primary-hover: #0f3f22;
  --accent: #15803d;
  --soft-accent: #f0fdf4;
  --soft-accent-border: #bbf7d0;
  --text: #1c1917;
  --muted: #57534e;
  --muted-light: #78716c;
  --surface-subtle: #f5f5f4;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 14px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 10px 28px rgba(20, 83, 45, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, 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(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

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

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.92rem;
  font-weight: 600;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--primary);
}

.header-nav .nav-all-tools {
  background-color: var(--soft-accent);
  color: var(--primary);
  border: 1px solid var(--soft-accent-border);
  padding: 6px 13px;
  border-radius: 999px;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

/* Breadcrumb Bar */
.breadcrumb-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
  font-size: 0.84rem;
  color: var(--muted);
}

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

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

.breadcrumb 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-section {
  padding: 28px 0 18px;
}

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

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

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

/* Quick Preset Bar */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.preset-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}

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

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

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

/* Calculator Workspace Layout */
.calc-workspace {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

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

/* Inputs Panel */
.calc-inputs-card {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.btn-reset {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

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

.input-section-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-section-label:first-of-type {
  margin-top: 0;
}

.field-group {
  margin-bottom: 14px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  gap: 8px;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

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

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

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

.input-prefix {
  left: 12px;
}

.input-suffix {
  right: 12px;
}

.num-input,
.select-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  font-size: 0.96rem;
  font-weight: 600;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background-color: 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);
}

/* Segmented Term Toggle */
.term-toggle-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.term-btn {
  appearance: none;
  height: 38px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.term-btn:hover {
  border-color: var(--accent);
}

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

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Range Slider */
.range-slider {
  width: 100%;
  margin-top: 7px;
  accent-color: var(--accent);
  cursor: pointer;
  height: 5px;
}

/* Biweekly Switch Card */
.biweekly-box {
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.switch-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.switch-sub {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.toggle-track::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-track {
  background-color: var(--accent);
}

.toggle-switch input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.25);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(20px);
}

.biweekly-live-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--soft-accent-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* Reverse Target Payoff Solver Box */
.goal-solver-box {
  margin-top: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}

.goal-solver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.goal-solver-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
}

.goal-solver-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.btn-apply-goal {
  appearance: none;
  height: 40px;
  padding: 0 14px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-apply-goal:hover {
  background: var(--accent);
}

.goal-chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.goal-chip {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.goal-chip:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.goal-result-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.goal-result-note strong {
  color: var(--primary);
}

/* Results Column */
.calc-results-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero KPI Banner */
.kpi-hero-banner {
  background: linear-gradient(135deg, #14532d 0%, #166534 60%, #15803d 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  box-shadow: var(--shadow-lg);
}

.kpi-primary-block,
.kpi-secondary-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-secondary-block {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 20px;
}

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

.kpi-big-value {
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.kpi-sub-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #f0fdf4;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.kpi-sub-text {
  margin-top: 6px;
  font-size: 0.84rem;
  color: #dcfce7;
}

/* 4-Card Metric Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.metric-label {
  font-size: 0.79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 5px;
}

.metric-main {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-main.accent-text {
  color: var(--primary);
}

.metric-compare {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

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

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

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.legend-swatch.orig {
  background: repeating-linear-gradient(
    90deg,
    #78716c 0,
    #78716c 5px,
    transparent 5px,
    transparent 8px
  );
}

.legend-swatch.accel {
  background: var(--accent);
  height: 4px;
}

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

#balanceSvgChart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(28, 25, 23, 0.94);
  color: #ffffff;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 20;
  min-width: 195px;
  font-variant-numeric: tabular-nums;
  display: none;
}

.chart-tooltip-title {
  font-weight: 800;
  color: #bbf7d0;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding-bottom: 3px;
}

.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Strategy Insights Tabs Card */
.strategy-card {
  padding: 18px 22px;
}

.strategy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.strategy-tab-btn {
  appearance: none;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.strategy-tab-btn:hover {
  color: var(--primary);
  border-color: var(--accent);
}

.strategy-tab-btn.active {
  background: var(--soft-accent);
  border-color: var(--accent);
  color: var(--primary);
}

.strategy-pane {
  display: none;
}

.strategy-pane.active {
  display: block;
}

.compare-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.compare-mini-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.compare-mini-box.highlight {
  background: var(--soft-accent);
  border-color: var(--soft-accent-border);
}

.compare-mini-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.compare-mini-box.highlight .compare-mini-title {
  color: var(--primary);
}

.compare-mini-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.compare-mini-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Amortization Schedule Section */
.schedule-section {
  margin-bottom: 28px;
  padding: 20px 24px;
}

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

.schedule-title-wrap h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.schedule-title-wrap p {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-outline,
.btn-primary {
  appearance: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-outline {
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

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

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
}

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

.schedule-table-container {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.schedule-table-container.collapsed {
  display: none;
}

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

.amort-table th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-weight: 700;
  text-align: right;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.amort-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.amort-table tbody tr:hover {
  background: var(--soft-accent);
}

.amort-table tr.payoff-row {
  background: var(--soft-accent);
  font-weight: 700;
}

.amort-table td.saved-col {
  color: var(--primary);
  font-weight: 700;
}

/* Affiliate / Partner Section */
.affiliate-section {
  margin-bottom: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

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

.ftc-disclosure {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.45;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

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

.affiliate-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

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

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

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

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

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

/* Optional Ad Slots */
.ad-slot {
  display: none;
  margin: 20px 0;
  text-align: center;
}

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

.ad-placeholder-box {
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 18px;
  color: var(--muted-light);
  font-size: 0.8rem;
  font-weight: 600;
}

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

.editorial-section h2 {
  margin: 28px 0 12px;
  font-size: 1.38rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.015em;
}

.editorial-section h2:first-child {
  margin-top: 0;
}

.editorial-section h3 {
  margin: 22px 0 8px;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
}

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

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

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

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

.benchmark-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  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 {
  background: var(--surface-subtle);
  text-align: left;
  padding: 11px 14px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.benchmark-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.benchmark-table tr.highlight-row {
  background: var(--soft-accent);
  font-weight: 600;
}

/* FAQ Section */
.faq-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.faq-section h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 800;
}

.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%;
  appearance: none;
  background: transparent;
  border: none;
  padding: 15px 18px;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: inherit;
}

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

.faq-chevron {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  background: var(--soft-accent);
  border-color: var(--soft-accent-border);
}

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

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

/* Cross-Linking Section */
.crosslink-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
}

.crosslink-section h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 800;
}

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

.crosslink-group-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 18px 0 10px;
}

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

.crosslink-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  transition: all 0.15s ease;
}

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

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

.crosslink-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.crosslink-card-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

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

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  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-bottom {
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.5;
}

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

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

  .compare-mini-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpi-hero-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .kpi-secondary-block {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 0;
    padding-top: 14px;
  }

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

  .editorial-section,
  .faq-section,
  .crosslink-section,
  .affiliate-section,
  .schedule-section {
    padding: 20px 18px;
  }

  .header-nav .hide-mobile {
    display: none;
  }
}
