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

:root {
  --brand:        #1d9e75;
  --brand-dark:   #0f7558;
  --brand-tint:   #ecfdf5;
  --brand-tint-2: #d1fae5;
  --brand-line:   #a7f3d0;
  --ink:          #0f172a;
  --ink-mute:     #475569;
  --ink-faint:    #94a3b8;
  --line:         #e5e7eb;
  --line-soft:    #f1f5f9;
  --bg:           #f7f8f6;
  --surface:      #ffffff;
  --danger:       #e24b4a;
  --danger-tint:  #fff5f5;
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md:    0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg:    0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --radius:       12px;
  --radius-sm:    8px;
}

body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, #ecfdf5 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 110%, #f1f5f9 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Nav ─────────────────────────────────────────── */
.topnav {
  height: 52px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 6px;
}

.breadcrumb-item {
  font-size: 13px;
  color: var(--ink-faint);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.breadcrumb-item:hover { color: var(--ink); }

.breadcrumb-sep {
  font-size: 13px;
  color: #d1d5db;
}

.breadcrumb-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Page ────────────────────────────────────────── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf8 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 220px at 80% -40%, rgba(29,158,117,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--brand-line);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.hero-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.18);
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.page-title-accent {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.page-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 8px;
  max-width: 56ch;
  line-height: 1.55;
}

.page-sub a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-sub a:hover {
  color: var(--brand);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  box-shadow: var(--shadow-sm);
}

.hero-chip svg {
  width: 12px;
  height: 12px;
  stroke: var(--brand);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(29,158,117,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(29,158,117,0.32), inset 0 1px 0 rgba(255,255,255,0.18);
}

.cta-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta-btn.cta-ghost {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-sm);
}

.cta-btn.cta-ghost:hover {
  background: var(--brand-tint);
  box-shadow: var(--shadow-md);
}

/* Hero illustration */
.hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art svg {
  width: 100%;
  height: auto;
  max-width: 320px;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.08));
  border-radius: 14px;
}

/* ── Two-column layout ───────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

.col-left  { display: flex; flex-direction: column; gap: 16px; }
.col-right { display: flex; flex-direction: column; gap: 16px; }

/* ── Card ────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--brand-line) 50%, transparent 100%);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  opacity: 0.7;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.card-icon {
  width: 13px;
  height: 13px;
  stroke: var(--brand);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── Input group ─────────────────────────────────── */
.input-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fafefa 100%);
}

.field {
  padding: 12px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-left: 3px solid transparent;
  transition: border-left-color 0.18s, background 0.18s;
}

.field:last-child { border-bottom: none; }

.field:focus-within {
  border-left-color: var(--brand);
  background: #fafffe;
}

.field:hover { background: #fbfffd; }

.field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.field input[type="number"] {
  width: 100%;
  border: none;
  outline: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  font-family: inherit;
  letter-spacing: -0.01em;
  -moz-appearance: textfield;
  appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

.field .hint {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 3px;
  display: block;
  font-weight: 500;
}

/* ── Tax field: label row with inline pill toggle ─── */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.field-label-row > label {
  display: inline-flex;
  margin-bottom: 0;
}

.field-label-row > label[for="fd-tax"] {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* Pill toggle */
.pill-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.pill-toggle input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  pointer-events: none;
  margin: 0;
}

.pill-track {
  display: inline-block;
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.18s;
  flex-shrink: 0;
}

.pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.18s;
}

.pill-toggle input:checked ~ .pill-track {
  background: var(--brand);
}

.pill-toggle input:checked ~ .pill-track .pill-thumb {
  transform: translateX(13px);
}

.pill-toggle input:focus-visible ~ .pill-track {
  box-shadow: 0 0 0 3px rgba(29,158,117,0.30);
}

.pill-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  transition: color 0.15s;
  line-height: 1;
}

.pill-toggle input:checked ~ .pill-text {
  color: var(--brand);
}

.field-tax.is-tax-off > input[type="number"],
.field-tax.is-tax-off > .slider-wrap {
  opacity: 0.4;
  pointer-events: none;
}

.field-tax.is-tax-off > .hint {
  color: #d1d5db;
}

/* ── Slider with progress fill ───────────────────── */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.slider-wrap input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--p, 50%),
    #e5e7eb var(--p, 50%),
    #e5e7eb 100%
  );
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.08s linear;
}

.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 3px rgba(29,158,117,0.40);
  transition: transform 0.12s;
}

.slider-wrap input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider-wrap input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.25); }

.slider-wrap input[type="range"]::-moz-range-track {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--p, 50%),
    #e5e7eb var(--p, 50%),
    #e5e7eb 100%
  );
  border-radius: 3px;
}

.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 3px rgba(29,158,117,0.40);
  cursor: pointer;
}

.slider-wrap input[type="range"]:disabled {
  background: #e5e7eb;
}
.slider-wrap input[type="range"]:disabled::-webkit-slider-thumb {
  border-color: #cbd5e1;
  box-shadow: none;
}

.slider-min, .slider-max {
  font-size: 9px;
  color: var(--ink-faint);
  white-space: nowrap;
  font-weight: 600;
  min-width: 22px;
  letter-spacing: 0.04em;
}

.slider-max { text-align: right; }

/* ── Results grid ────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.results-grid--quad .result-span {
  grid-column: 1 / -1;
}

.result-item {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.result-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

/* Hero card — Real Return */
.result-item.hero {
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(29,158,117,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #f0fdf8 0%, #ecfdf5 100%);
  border-color: var(--brand-line);
  padding: 18px 18px;
}

.result-item.hero.negative {
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(226,75,74,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #fff5f5 0%, #fef2f2 100%);
  border-color: #fecaca;
}

.hero-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  background: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  box-shadow: var(--shadow-sm);
}

.result-item.hero.negative .hero-badge {
  color: #b91c1c;
  border-color: #fecaca;
}

.r-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.r-icon {
  width: 11px;
  height: 11px;
  stroke: var(--brand);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.r-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.r-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.value-positive { color: #15803d; }
.value-negative { color: #b91c1c; }

.result-item.hero .r-value {
  font-size: 32px;
  letter-spacing: -0.025em;
}

.r-delta {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

.green { color: var(--brand); }
.red   { color: var(--danger); }

/* ── Insight lines ───────────────────────────────── */
.card-reality .insight-line + .insight-line { margin-top: 8px; }

.insight-line {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fafafa;
  border: 1px solid var(--line);
  border-left-width: 3px;
}

.insight-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  vertical-align: 1px;
}

.insight-good { border-left-color: #10b981; background: #ecfdf5; border-color: #a7f3d0; }
.insight-good .insight-tag { color: #047857; border-color: #a7f3d0; }

.insight-warn { border-left-color: #f59e0b; background: #fffbeb; border-color: #fde68a; }
.insight-warn .insight-tag { color: #b45309; border-color: #fde68a; }

.insight-risk { border-left-color: #ef4444; background: #fef2f2; border-color: #fecaca; }
.insight-risk .insight-tag { color: #b91c1c; border-color: #fecaca; }

/* ── Chart ───────────────────────────────────────── */
.card-chart .chart-wrap {
  background:
    linear-gradient(180deg, #ffffff 0%, #fafefb 100%);
  border-radius: var(--radius-sm);
  padding: 8px 4px 4px;
}

.chart-wrap {
  min-height: 260px;
  position: relative;
}

/* ── FAQ & How it works ──────────────────────────── */
.faq-section {
  max-width: 720px;
  margin: 22px 0 6px;
}

.faq-intro {
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.75;
  border-left: 3px solid var(--brand-line);
  background: linear-gradient(90deg, rgba(29,158,117,0.04), transparent 60%);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.faq-intro strong { color: var(--brand-dark); }

.content-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-icon {
  width: 16px;
  height: 16px;
  padding: 5px;
  box-sizing: content-box;
  background: var(--brand-tint);
  border-radius: 8px;
  stroke: var(--brand-dark);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.info-section h3 {
  font-size: 13.5px;
  margin: 14px 0 4px;
  font-weight: 600;
  color: var(--ink);
}

.info-section p,
.info-section li {
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.65;
}

.info-section ul,
.info-section ol {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.info-section ol > li { padding-left: 4px; }
.info-section ol > li strong { color: var(--ink); }

/* ── Touch devices — larger slider thumb ─────────── */
@media (pointer: coarse) {
  .slider-wrap input[type="range"]::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }
  .slider-wrap input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
  .slider-wrap input[type="range"] {
    padding: 10px 0;
  }
}

/* ── Tablet ───────────────────────────────────────── */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 360px; margin: 0 auto; }
}

@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .results-grid,
  .results-grid--quad { grid-template-columns: 1fr 1fr; }

  .results-grid--quad .result-span {
    grid-column: 1 / -1;
  }

  .topnav > .breadcrumb-sep:nth-child(2),
  .topnav > .breadcrumb-item:nth-child(3),
  .topnav > .breadcrumb-sep:nth-child(4),
  .topnav > .breadcrumb-item:nth-child(5) { display: none; }
}

/* ── Mobile ───────────────────────────────────────── */
@media (max-width: 480px) {
  .topnav { padding: 0 16px; }
  .page   { padding: 16px 16px 40px; }

  .hero { padding: 18px 18px; }
  .page-title { font-size: 22px; }
  .hero-art { display: none; }
  .hero { grid-template-columns: 1fr; }

  .breadcrumb-sep   { display: none; }
  .breadcrumb-item  { display: none; }
  .breadcrumb-current { font-size: 13px; }

  .field input[type="number"] { font-size: 18px; }

  .result-item.hero .r-value { font-size: 26px; }

  .results-grid,
  .results-grid--quad { grid-template-columns: 1fr; }

  .slider-min, .slider-max { display: none; }

  .chart-wrap { min-height: 220px; }

  .card { padding: 14px 16px; }

  .hero-badge { position: static; display: inline-block; margin-bottom: 6px; }
}
