/* ==========================================================================
   CalcBase Design System v2 — Executive, Clean, Zero-CLS Static Platform
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: rgba(29, 78, 216, 0.08);
  --success: #047857;
  --success-soft: rgba(4, 120, 87, 0.09);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.09);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --header-bg: rgba(255, 255, 255, 0.88);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --radius: 14px;
  --radius-sm: 9px;
  --max-width: 1440px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg-elevated: #111827;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.15);
  --header-bg: rgba(17, 24, 39, 0.88);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

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

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

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

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

a:hover {
  text-decoration: underline;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Redesigned Sticky Glass Header
   ========================================================================== */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.18rem;
  color: var(--text);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(29, 78, 216, 0.22));
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-left: 2px;
}

.top-strip {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-subtle);
  padding: 5px 32px;
  text-align: center;
}
.top-strip-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .top-strip { display: none; }
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.mobile-menu-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle:hover,
.mobile-menu-btn:hover {
  border-color: var(--border-strong);
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 980px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    z-index: 60;
  }
  .nav-links a {
    padding: 10px 12px;
  }
}

@media (max-width: 400px) {
  .brand-tag { display: none; }
  .brand { font-size: 1.05rem; }
  .theme-toggle, .mobile-menu-btn { padding: 6px 9px; font-size: 0.8rem; }
}

/* ==========================================================================
   Container, Breadcrumbs & Homepage Hero
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 32px 64px;
}

@media (max-width: 640px) {
  .header-inner,
  .top-strip { padding-left: 16px; padding-right: 16px; }
  .container { padding: 20px 16px 48px; }
  .card { padding: 18px 16px; }
  .editorial article { padding: 20px 16px; }
  .hero-search-row .btn { width: 100%; }
  .btn-row .btn { flex: 1 1 140px; }
  input[type="number"], input[type="text"], select, textarea { font-size: 16px; }
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-subtle);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--text-subtle);
}

.hero-banner {
  position: relative;
  background:
    radial-gradient(circle at 85% 15%, rgba(29, 78, 216, 0.09), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(4, 120, 87, 0.08), transparent 45%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 36px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .hero-banner {
    padding: 26px 20px;
  }
}

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

.hero-banner h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  max-width: 780px;
}

.hero-banner .subtitle {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 0 22px;
}

.hero-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 560px;
}

.hero-search-row input {
  flex: 1 1 260px;
  padding: 12px 16px;
  font-size: 0.96rem;
  border-radius: 10px;
}

.page-hero {
  margin-bottom: 24px;
}

.page-hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}

.page-hero .subtitle {
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 0 14px;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 500;
}

/* ==========================================================================
   Hub Cards & Value Pillars
   ========================================================================== */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1100px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hub-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.hub-tag {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.hub-card h3 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  color: var(--text);
  letter-spacing: -0.015em;
}

.hub-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0 0 18px;
}

.hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

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

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.pillar-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.pillar-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Calculator Workspace & Controls
   ========================================================================== */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.preset-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

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

.field .hint {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 400;
}

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

.input-prefix,
.input-suffix {
  position: absolute;
  color: var(--text-subtle);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }

input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 44px; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  margin-top: 4px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

/* Results Panel */
.results-sticky {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 920px) {
  .results-sticky {
    position: static;
  }
}

.kpi-hero {
  background: linear-gradient(135deg, var(--primary-soft), var(--success-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: clamp(1.9rem, 3.2vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 4px 0;
  color: var(--text);
}

.kpi-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

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

.kpi-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.kpi-mini .label {
  font-size: 0.77rem;
  color: var(--text-subtle);
}

.kpi-mini .val {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 2px;
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.breakdown-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stacked-bar {
  display: flex;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt);
  margin: 12px 0 10px;
}

.bar-seg {
  height: 100%;
  transition: width 0.25s ease;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text-muted);
}

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

/* Zero-CLS Ad Slots & House Promo Units */
.ad-slot {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.78rem;
  padding: 16px;
  overflow: hidden;
}

.ad-slot-rect { min-height: 250px; }
.ad-slot-banner { min-height: 90px; margin: 26px 0; }

.house-ad {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.house-ad:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
}
.house-ad-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.house-ad h4 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--text);
}
.house-ad p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 540px;
}
.house-ad-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}

.house-ad-banner {
  flex-direction: row;
  justify-content: space-between;
  text-align: left;
  gap: 16px;
  padding: 16px 24px;
  flex-wrap: wrap;
}
.house-ad-banner p {
  margin: 0;
}
@media (max-width: 640px) {
  .house-ad-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
}

/* Verification / Source Note */
.source-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.source-note strong {
  color: var(--text);
}

/* Editorial SEO Content */
.editorial {
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.editorial article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.editorial h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.editorial h2 {
  font-size: 1.32rem;
  margin: 26px 0 10px;
  letter-spacing: -0.015em;
}

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

.editorial h3 {
  font-size: 1.06rem;
  margin: 18px 0 8px;
}

.editorial p, .editorial li {
  color: var(--text-muted);
}

.formula-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 12px 0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

details.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

details.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.faq-item p {
  margin: 10px 0 0;
  font-size: 0.93rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal-backdrop.open { display: grid; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Redesigned Executive Footer
   ========================================================================== */
.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 48px 32px 30px;
  margin-top: 64px;
}

@media (max-width: 640px) {
  .site-footer {
    padding: 36px 16px 24px;
  }
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 820px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-inner h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-inner a {
  color: var(--text-muted);
}
.footer-inner a:hover {
  color: var(--primary);
}

.footer-disclaimer {
  max-width: var(--max-width);
  margin: 28px auto 0;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-subtle);
  line-height: 1.55;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 18px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-subtle);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Print / Save as PDF */
@media print {
  .site-header, .site-footer, .ad-slot, .btn-row, .header-actions, .source-note, .modal-backdrop {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .calc-layout { grid-template-columns: 1fr; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
