:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --text: #111111;
  --muted: #52525b;
  --primary: #111111;
  --primary-hover: #27272a;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --blue: #2563eb;
  --indigo: #4f46e5;
  --danger: #dc2626;
  --border: #e4e4e7;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 4px 20px rgba(0, 0, 0, 0.04), 0 16px 48px rgba(0, 0, 0, 0.06);
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: var(--surface);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

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

/* Pure White Minimal Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

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

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.site-nav a[aria-current="page"] {
  color: var(--surface);
  background: var(--primary);
  font-weight: 600;
}

/* Centered Airy Hero */
.calc-hero {
  padding: 44px 0 64px;
  background: var(--bg);
}

.hero-header {
  text-align: center;
  max-width: 960px;
  margin: 0 auto 40px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero-subtitle {
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 58ch;
}

/* Frameless Left + Floating Right Card */
.calc-stage {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  gap: 48px;
  align-items: start;
}

.calc-inputs {
  min-width: 0;
  padding: 8px 0;
}

.calc-results {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 32px;
}

.field-group {
  margin-bottom: 22px;
  min-width: 0;
}

.field-group:last-of-type {
  margin-bottom: 16px;
}

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

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.field-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.field-select,
.field-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.25L6 7.75L9.5 4.25' stroke='%2352525b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.field-input-lg {
  font-size: 22px;
  font-weight: 700;
  min-height: 54px;
  letter-spacing: -0.02em;
}

.field-select:hover,
.field-input:hover {
  border-color: var(--muted);
}

.field-select:focus,
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--surface-soft);
  outline: none;
}

.input-currency {
  position: relative;
}

.currency-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

.input-currency .field-input {
  padding-left: 34px;
}

/* Sleek Graphite Slider */
.income-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 18px 0 14px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--pct, 23%), var(--border) var(--pct, 23%), var(--border) 100%);
  cursor: pointer;
}

.income-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: transform 0.14s ease;
}

.income-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

.income-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.preset-btn {
  min-height: 38px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

.field-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

/* Segmented Controls */
.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 14px;
}

.segmented-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seg-btn {
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.calc-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Right Results Card */
.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.result-headline {
  min-width: 0;
}

.result-eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.result-net {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 6px;
}

.result-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.yoy-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  flex-shrink: 0;
}

.yoy-badge.is-negative {
  background: var(--surface-soft);
}

.yoy-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.yoy-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.yoy-badge.is-negative .yoy-val {
  color: var(--danger);
}

/* Visual Donut + Clean 4-Row Summary */
.visual-overview {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px 0 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.donut-box {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: var(--surface-soft);
  stroke-width: 14;
}

.donut-seg {
  fill: none;
  stroke-width: 14;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.35s ease, stroke-dashoffset 0.35s ease;
}

.donut-net { stroke: var(--accent); }
.donut-fed { stroke: var(--blue); }
.donut-prov { stroke: var(--indigo); }
.donut-pay { stroke: var(--danger); }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  font-size: 12px;
  color: var(--muted);
}

.summary-rows {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.sum-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sum-label {
  color: var(--text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sum-meta {
  font-size: 13px;
  color: var(--muted);
}

.sum-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  min-width: 78px;
}

.sum-val-keep {
  color: var(--accent);
}

.sum-extra {
  font-size: 12px;
  color: var(--muted);
  padding-top: 2px;
}

.sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sw-net { background: var(--accent); }
.sw-fed { background: var(--blue); }
.sw-prov { background: var(--indigo); }
.sw-pay { background: var(--danger); }

/* Plain-Language Rate Cards */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-box {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.kpi-val {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-explain {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Emerald RRSP Advisor Card */
.rrsp-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.rrsp-tip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rrsp-tip-text strong {
  font-size: 14px;
  color: var(--accent);
}

.rrsp-tip-text span {
  font-size: 13px;
  color: var(--text);
}

.btn-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--surface);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

.rrsp-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 14px;
}

.val-positive {
  color: var(--accent) !important;
  font-weight: 700;
}

/* Expandable Drawers */
.drawer-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.calc-details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.calc-details summary {
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calc-details summary::-webkit-details-marker {
  display: none;
}

.calc-details summary::after {
  content: "+";
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}

.calc-details[open] summary::after {
  content: "\2212";
}

.calc-details-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.ledger {
  padding-top: 6px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--surface-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ledger-row strong {
  font-weight: 600;
  color: var(--text);
}

.ledger-total {
  border-bottom: 0;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 700;
}

.ledger-total strong {
  color: var(--accent);
  font-size: 17px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mini-table th,
.mini-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--surface-soft);
  white-space: nowrap;
}

.mini-table th:last-child,
.mini-table td:last-child,
.mini-table th.num,
.mini-table td.num {
  text-align: right;
}

.mini-table th {
  color: var(--muted);
  font-weight: 600;
}

.waterfall-title {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.info-banner {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13px;
  color: var(--muted);
}

.info-banner strong {
  color: var(--text);
}

/* Action Buttons */
.result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-primary,
.btn-secondary,
.btn-engage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-engage {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

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

.btn-engage[data-gf-liked],
.btn-engage[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.action-toast {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Mobile Sticky Real-Time Take-Home Bar */
.mobile-sticky-bar {
  display: none;
}

/* Page Banner (Legal / About) */
.page-banner {
  padding: 44px 0 36px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

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

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

.page-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 66ch;
}

/* Editorial Prose Content */
.content-section {
  padding: 64px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.prose {
  max-width: 860px;
  margin: 0 auto;
  min-width: 0;
}

.prose h2 {
  margin: 48px 0 14px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}

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

.prose h3 {
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.prose p {
  margin: 0 0 16px;
  max-width: 68ch;
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  max-width: 68ch;
}

.prose li {
  margin-bottom: 8px;
}

.prose blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--surface-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  max-width: 68ch;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose figure,
.chart-frame {
  margin: 28px 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Overflow-Safe Tables */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}

.prose > table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 20px 0 28px;
}

.prose th,
.prose td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--surface-soft);
  white-space: nowrap;
}

.prose thead th {
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose tbody tr:hover {
  background: var(--surface-soft);
}

/* Example Cards Grid */
.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.example-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
}

.example-card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.example-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.prov-jump-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 32px;
}

.prov-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.prov-card strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
}

.prov-card span {
  color: var(--muted);
  font-size: 13px;
}

/* Related Panel */
.related-panel {
  max-width: 860px;
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-heading {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 24px;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.related-card strong {
  color: var(--text);
  font-size: 16px;
}

.related-card span {
  color: var(--muted);
  font-size: 14px;
}

/* FAQ Section */
.faq-section {
  padding: 64px 0;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

.section-heading {
  margin: 0 auto 24px;
  max-width: 860px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.faq-q {
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "+";
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] .faq-q::after {
  content: "\2212";
}

.faq-a {
  padding: 0 22px 20px;
  color: var(--muted);
}

.faq-a p {
  margin: 0;
  max-width: 68ch;
}

/* Comments Section */
.comments-section {
  padding: 64px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.comments-head {
  max-width: 860px;
  margin: 0 auto 20px;
}

.comments-sub {
  margin: 0;
  color: var(--muted);
}

.comment-form {
  max-width: 860px;
  margin: 0 auto 24px;
  background: var(--surface-soft);
  border-radius: 18px;
  padding: 22px;
}

.comment-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.comment-fields textarea {
  resize: vertical;
  min-height: 88px;
}

.comment-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-msg {
  font-size: 14px;
  color: var(--muted);
}

.comment-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 14px;
}

.btn-link {
  border: 0;
  background: none;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.comment-list {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.comment-empty {
  display: none;
  margin: 0;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 14px;
  color: var(--muted);
}

.comment-list[data-gf-empty] .comment-empty {
  display: block;
}

.comment-card,
.comment-reply-card {
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 16px 18px;
}

.comment-card[data-gf-owner],
.comment-reply-card[data-gf-owner] {
  background: var(--accent-soft);
}

.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.comment-meta strong {
  color: var(--text);
  font-size: 14px;
}

.owner-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

.comment-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 10px;
}

/* 404 */
.not-found {
  padding: 72px 0;
}

.eyebrow-404 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 8px;
}

.not-found h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 38px;
}

.not-found p {
  max-width: 60ch;
  color: var(--muted);
}

.actions-404 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* Footer */
.site-footer {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  padding: 52px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 52ch;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-col a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

/* Mobile & Tablet Responsive + Real-Time Sticky Result Bar */
@media (max-width: 960px) {
  .calc-stage {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-header {
    text-align: left;
    margin-bottom: 24px;
  }
  .hero-subtitle {
    margin: 0;
  }
  .mobile-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .mobile-sticky-bar.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }
  .sticky-left {
    min-width: 0;
  }
  .sticky-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
  }
  .sticky-nums {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
  }
  .sticky-nums strong {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
  }
  .sticky-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
  }
  .sticky-jump {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: var(--surface);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .prov-jump-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
    gap: 8px;
  }
  .site-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 2px;
  }
  .site-nav a {
    flex-shrink: 0;
    padding: 6px 11px;
    font-size: 13px;
  }
  .calc-hero {
    padding: 20px 0 40px;
  }
  .hero-title,
  .page-title {
    font-size: 28px;
  }
  .hero-subtitle {
    font-size: 15px;
  }
  .calc-results {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .field-group {
    margin-bottom: 16px;
  }
  .field-row-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .result-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .yoy-badge {
    align-items: flex-start;
  }
  .result-net {
    font-size: 40px;
  }
  .visual-overview {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .kpi-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rrsp-tip {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-chip {
    width: 100%;
  }
  .example-grid {
    grid-template-columns: 1fr;
  }
  .result-actions .btn-secondary,
  .result-actions .btn-engage {
    flex: 1 1 calc(50% - 4px);
    padding: 0 12px;
  }
  .prose h2,
  .section-heading {
    font-size: 24px;
  }
  .site-footer {
    padding-bottom: 92px;
  }
}
