/* ============================================================
   457(b) Calculator — styles
   ============================================================ */

:root {
  --violet-50:  #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-900: #3b0f7a;

  --ink:        #14101f;
  --ink-soft:   #3d3654;
  --muted:      #6b6480;
  --line:       #e8e4f2;
  --surface:    #ffffff;
  --canvas:     #fbfaff;

  --mint:       #34d399;

  --radius-lg: 28px;
  --radius:    16px;
  --radius-sm: 12px;

  --shadow-sm: 0 1px 2px rgba(20,16,31,.05);
  --shadow:    0 4px 24px -6px rgba(52,32,110,.12);
  --shadow-lg: 0 24px 60px -18px rgba(52,32,110,.28);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --shell: 1180px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* `clip`, not `hidden`: hidden would turn this into a scroll container and
     silently break the sticky nav and sticky results panel. */
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-x: none;   /* no rubber-band swipe on trackpads/touch */
}

/* Nothing may push the page wider than the viewport. */
img, svg, canvas, table { max-width: 100%; }
/* Long unbroken strings (pasted numbers, URLs) wrap instead of overflowing. */
h1, h2, h3, p, li, summary, label, .stat-value, .headline-value { overflow-wrap: break-word; }
/* Grid and flex children default to min-width:auto, which refuses to shrink
   below their content and is the usual source of mystery overflow. */
.calc-grid > *, .stat-grid > *, .compare-grid > *, .field-row > *,
.limit-grid > *, .hero-inner > *, .faq-inner > *, .income-break li { min-width: 0; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; line-height: 1.1; margin: 0; }

p { margin: 0; }

a { color: inherit; text-decoration: none; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ---------------- nav ---------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner { display: flex; align-items: center; justify-content: center; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--violet-600), var(--violet-800, #5b21b6));
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -.03em;
  box-shadow: 0 4px 12px -2px rgba(109,40,217,.45);
}
.brand-name { font-family: var(--display); font-size: 16px; letter-spacing: -.02em; }
.brand-tld { color: var(--violet-600); }
.footer-tag { font-size: 14px; color: var(--ink-soft); font-weight: 500; }

/* ---------------- hero ---------------- */

.hero {
  position: relative; overflow: hidden;
  padding: 76px 0 96px;
  background:
    radial-gradient(1100px 560px at 8% -12%, var(--violet-100) 0%, transparent 62%),
    radial-gradient(900px 480px at 96% 4%, #f0ebff 0%, transparent 58%),
    var(--canvas);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--line);
}

.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }

.pill {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--violet-700); background: #fff;
  border: 1px solid var(--violet-200); border-radius: 999px;
  padding: 7px 15px; margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.pill.dark { background: var(--violet-100); border-color: transparent; }

h1 {
  font-size: clamp(40px, 5.4vw, 62px);
  font-weight: 800;
  margin-bottom: 22px;
}
h1 em { font-style: normal; color: var(--violet-700); }

.hero-sub { font-size: 18px; color: var(--ink-soft); max-width: 52ch; margin-bottom: 32px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  display: inline-block; background: var(--violet-600); color: #fff;
  font-weight: 600; font-size: 15.5px; padding: 15px 30px; border-radius: 999px;
  box-shadow: 0 10px 24px -8px rgba(124,58,237,.6);
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn-primary:hover { background: var(--violet-700); transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(124,58,237,.65); }
.btn-primary.light { background: #fff; color: var(--violet-700); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.btn-primary.light:hover { background: #fff; color: var(--violet-900); }

.btn-ghost {
  display: inline-block; font-weight: 600; font-size: 15.5px; padding: 15px 26px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: border-color .2s ease, color .2s ease;
}
.btn-ghost:hover { border-color: var(--violet-300); color: var(--violet-700); }

.hero-trust {
  display: flex; gap: 22px; flex-wrap: wrap; list-style: none;
  padding: 0; margin: 30px 0 0; font-size: 13.5px; color: var(--muted);
}
.hero-trust li { display: flex; align-items: center; gap: 7px; }
.hero-trust li::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%;
  background: var(--violet-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2L9.5 3.6' fill='none' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
}

.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 30px 18px; box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(139,92,246,.16), transparent 42%);
}
.hc-label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.hc-value {
  font-family: var(--display); font-size: clamp(38px, 4.4vw, 52px); font-weight: 800;
  letter-spacing: -.035em; margin: 6px 0 10px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hc-meta { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.hc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
#heroSpark { display: block; width: 100%; margin-top: 14px; }

/* ---------------- calculator layout ---------------- */

.calc { padding: 72px 0 8px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

.panel { border-radius: var(--radius-lg); }

.inputs {
  background: var(--surface); border: 1px solid var(--line);
  padding: 34px; box-shadow: var(--shadow);
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.panel-head h2 { font-size: 22px; }

.link-btn {
  background: none; border: 0; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.link-btn:hover { color: var(--violet-700); background: var(--violet-50); }

.group { border: 0; padding: 0; margin: 26px 0 0; }
.group legend {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-600); padding: 0 0 14px;
}

/* Collapsible advanced group. Open by default on desktop, collapsed on small
   screens so the primary inputs are reachable without a long scroll. */
.group.adv { border-top: 1px solid var(--line); padding-top: 4px; }
.group.adv > summary {
  cursor: pointer; list-style: none; position: relative;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-600); padding: 16px 30px 16px 0;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.group.adv > summary::-webkit-details-marker { display: none; }
.adv-hint { font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.group.adv > summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 11px; height: 11px; margin-top: -5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1v10M1 6h10' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/11px no-repeat;
  transition: transform .25s ease;
}
.group.adv[open] > summary::after { transform: rotate(135deg); }
.group.adv > summary:focus-visible { outline: 2px solid var(--violet-400); outline-offset: 3px; border-radius: 6px; }

.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label { display: block; font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-bottom: 8px; }
.hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }

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

.out {
  font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--violet-700);
  font-variant-numeric: tabular-nums;
}

.input-wrap {
  display: flex; align-items: center; gap: 2px;
  background: #f7f6fb; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: 0 14px; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.input-wrap:focus-within {
  background: #fff; border-color: var(--violet-400);
  box-shadow: 0 0 0 4px rgba(139,92,246,.13);
}
.input-wrap .prefix, .input-wrap .suffix { color: var(--muted); font-size: 15px; font-weight: 500; }

.input-wrap input {
  flex: 1; width: 100%; min-width: 0; border: 0; background: none; outline: none;
  font-family: var(--font); font-size: 17px; font-weight: 600; color: var(--ink);
  padding: 13px 4px; font-variant-numeric: tabular-nums;
}
.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.inline-num {
  width: 46px; border: 0; border-bottom: 1.5px solid var(--violet-300); background: none;
  font-family: inherit; font-size: inherit; font-weight: 600; color: var(--violet-700);
  text-align: center; padding: 0 2px; outline: none;
}
.inline-num:focus { border-bottom-color: var(--violet-600); }

/* range */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px;
  background: none; cursor: pointer; display: block; margin: 0;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(var(--violet-600), var(--violet-600)) 0/var(--fill,0%) 100% no-repeat, var(--violet-100);
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--violet-100); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--violet-600); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--violet-600);
  box-shadow: 0 2px 8px -1px rgba(109,40,217,.45);
  transition: transform .12s ease;
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--violet-600);
  background: #fff; box-shadow: 0 2px 8px -1px rgba(109,40,217,.45);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(139,92,246,.22); }

.scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.micro { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.micro.warn { color: #b45309; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; flex: none; margin: 2px 0 0;
  border: 1.5px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.check input[type=checkbox]:checked {
  background: var(--violet-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2L9.5 3.6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--violet-600);
}
.check input[type=checkbox]:focus-visible { box-shadow: 0 0 0 4px rgba(139,92,246,.2); }
.check label { margin: 0; cursor: pointer; }
.check label strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.check label span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------------- results ---------------- */

.results {
  position: sticky; top: 96px;
  background: linear-gradient(165deg, var(--violet-600) 0%, #6423cf 48%, #57189f 100%);
  color: #fff; padding: 34px; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.results::before {
  content: ""; position: absolute; top: -140px; right: -110px; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 68%);
  pointer-events: none;
}

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-head h2 { font-size: 22px; }
.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}

.headline { margin: 26px 0 28px; }
.headline-label { font-size: 14px; color: rgba(255,255,255,.72); }
.headline-value {
  font-family: var(--display); font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(44px, 5.6vw, 62px); line-height: 1.02; margin: 6px 0 6px;
  font-variant-numeric: tabular-nums;
}
.headline-sub { font-size: 13.5px; color: rgba(255,255,255,.7); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(255,255,255,.16); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 24px;
}
.stat { background: rgba(255,255,255,.07); padding: 16px 18px; backdrop-filter: blur(2px); }
.stat-label { display: block; font-size: 12.5px; color: rgba(255,255,255,.72); }
.stat-value {
  display: block; font-family: var(--display); font-size: 21px; font-weight: 700;
  letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums;
}
.stat-value.accent { color: #a7f3d0; }

.income-box {
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 20px 20px 8px; margin-bottom: 24px;
}
.income-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.income-head h3 { font-size: 15px; font-weight: 700; }
.income-note { font-size: 12px; color: rgba(255,255,255,.66); }
.income-main {
  font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.03em;
  margin: 6px 0 10px; font-variant-numeric: tabular-nums;
}
.income-break { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.income-break li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-top: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
}
.income-break li[hidden] { display: none; }   /* the flex rule above outranks [hidden] */
.income-break li b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.income-break li.sep { color: rgba(255,255,255,.6); }

.compare h3 { font-size: 15px; font-weight: 700; }
.compare-sub { font-size: 12.5px; color: rgba(255,255,255,.68); margin-top: 4px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 12px; }
.cmp {
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm); padding: 15px 16px;
}
.cmp.win { background: rgba(167,243,208,.16); border-color: rgba(167,243,208,.45); }
.cmp-name { display: block; font-size: 12.5px; color: rgba(255,255,255,.75); font-weight: 600; }
.cmp-value {
  display: block; font-family: var(--display); font-size: 25px; font-weight: 800;
  letter-spacing: -.03em; margin: 3px 0 4px; font-variant-numeric: tabular-nums;
}
.cmp-meta { display: block; font-size: 11.5px; color: rgba(255,255,255,.66); }
.cmp-cost { display: block; font-size: 11.5px; color: rgba(255,255,255,.6); margin-top: 8px; }
.cmp-cost b { color: rgba(255,255,255,.9); font-weight: 600; }

.verdict {
  font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.14); border-radius: var(--radius-sm); padding: 12px 14px;
}

.results-foot { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 20px; }

/* ---------------- chart ---------------- */

.chart-section { padding: 28px 0 76px; }
.chart-panel { background: #fff; border: 1px solid var(--line); padding: 30px 30px 22px; box-shadow: var(--shadow); }

.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.chart-head h2 { font-size: 22px; }
.chart-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }

.legend { display: flex; gap: 20px; font-size: 13px; color: var(--ink-soft); }
.lg { display: flex; align-items: center; gap: 8px; }
.sw { width: 11px; height: 11px; border-radius: 3.5px; display: block; }
.sw-contrib { background: var(--violet-200); }
.sw-growth { background: var(--violet-600); }

.chart-wrap { position: relative; }
#chart { display: block; width: 100%; height: 340px; }

.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.5; white-space: nowrap;
  box-shadow: 0 10px 28px -8px rgba(20,16,31,.5);
  transform: translate(-50%, -112%);
  transition: opacity .12s ease;
}
.tooltip b { font-weight: 600; }
.tt-age { color: rgba(255,255,255,.6); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.tt-row { display: flex; justify-content: space-between; gap: 16px; }
.tt-row span { color: rgba(255,255,255,.68); }
.tt-total { border-top: 1px solid rgba(255,255,255,.2); margin-top: 6px; padding-top: 6px; }

/* ---------------- limits ---------------- */

.limits { padding: 84px 0; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head.left { text-align: left; margin-left: 0; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 40px); font-weight: 800; margin-bottom: 14px; }
.section-head p { font-size: 16.5px; color: var(--ink-soft); }

.limit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.limit-card {
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.limit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--violet-200); }
.limit-card.highlight { background: linear-gradient(160deg, var(--violet-50), #fff); border-color: var(--violet-200); }
.limit-age { display: block; font-size: 12.5px; font-weight: 600; color: var(--violet-700); letter-spacing: .02em; }
.limit-value {
  display: block; font-family: var(--display); font-size: 32px; font-weight: 800;
  letter-spacing: -.035em; margin: 8px 0 10px; font-variant-numeric: tabular-nums;
}
.limit-card p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.limits-foot { font-size: 13px; color: var(--muted); margin-top: 24px; text-align: center; }

/* ---------------- faq ---------------- */

.faq { padding: 84px 0; }
.faq-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.faq .section-head { margin-bottom: 0; position: sticky; top: 100px; }

.faq-list { display: flex; flex-direction: column; }
details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
details:first-child { border-top: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.015em;
  transition: color .18s ease;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--violet-700); }
summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
  margin-top: -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1v10M1 6h10' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat;
  transition: transform .25s ease;
}
details[open] summary::after { transform: rotate(135deg); }
details p { font-size: 15px; color: var(--ink-soft); padding: 0 40px 22px 0; line-height: 1.65; }
details em { color: var(--violet-700); font-style: normal; font-weight: 600; }

/* ---------------- cta ---------------- */

.cta { padding: 0 0 84px; }
.cta-inner {
  background: linear-gradient(150deg, var(--violet-700), #4c1d95);
  border-radius: var(--radius-lg); padding: 62px 40px; text-align: center; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cta-inner::before {
  content: ""; position: absolute; top: -120px; left: 50%; width: 520px; height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 68%);
}
.cta-inner h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; position: relative; }
.cta-inner p { font-size: 16.5px; color: rgba(255,255,255,.8); margin: 14px auto 30px; max-width: 46ch; position: relative; }
.cta-inner .btn-primary { position: relative; }

/* ---------------- footer ---------------- */

.footer { border-top: 1px solid var(--line); background: #fff; padding: 46px 0 56px; }
.footer-inner { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.disclaimer { font-size: 12.5px; color: var(--muted); line-height: 1.65; max-width: 78ch; }
.copyright { font-size: 12.5px; color: var(--muted); }

/* ---------------- mobile live result bar ---------------- */

/* Width is pinned to the document, not the viewport. On a real device the two
   are identical; inside an emulated/zoomed viewport they are not, and a plain
   left:0/right:0 fixed bar would overhang the page and create side-scroll. */
.livebar {
  position: fixed; left: 0; bottom: 0; z-index: 60;
  width: var(--page-w, 100%); max-width: 100%;
  display: none; align-items: center; gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #581cac;
  color: #fff;
  box-shadow: 0 -8px 28px -12px rgba(52,32,110,.6);
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.livebar[hidden] { display: none; }
.livebar.on { transform: translateY(0); }
.livebar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.livebar-label { font-size: 11.5px; color: rgba(255,255,255,.72); }
.livebar-value {
  font-family: var(--display); font-size: 25px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.livebar-btn {
  flex: none; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--violet-700); background: #fff; border: 0; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; white-space: nowrap;
}
.livebar-btn:active { transform: scale(.97); }

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .calc-grid { grid-template-columns: 1fr; }
  .results { position: static; }
  .faq-inner { grid-template-columns: 1fr; gap: 32px; }
  .faq .section-head { position: static; }
  .limit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .shell { padding: 0 18px; }

  .nav-inner { height: 56px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
  .brand-name { font-size: 15px; }

  /* Hero: was eating a full screen and change before the tool appeared. */
  .hero { padding: 34px 0 44px; }
  h1 { font-size: clamp(25px, 6.6vw, 31px); line-height: 1.18; margin-bottom: 14px; }
  .pill { margin-bottom: 16px; padding: 6px 13px; font-size: 12px; }
  .hero-sub { font-size: 16px; margin-bottom: 24px; }
  .hero-inner { gap: 30px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn-primary, .hero-actions .btn-ghost {
    flex: 1 1 100%; text-align: center; padding: 15px 20px;
  }
  .hero-trust { gap: 8px 18px; margin-top: 22px; font-size: 13px; }
  .hero-card { padding: 22px 22px 14px; border-radius: 22px; }
  .hc-value { font-size: 38px; }

  .calc { padding: 40px 0 8px; }
  .inputs, .results, .chart-panel { padding: 24px 20px; }
  .panel { border-radius: 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .stat-grid, .compare-grid { grid-template-columns: 1fr; }
  .group { margin-top: 22px; }

  /* Results: give the headline room, tighten everything around it. */
  .headline { margin: 20px 0 22px; }
  .headline-value { font-size: clamp(38px, 11vw, 50px); }
  .income-main { font-size: 30px; }

  .chart-section { padding: 22px 0 56px; }
  .chart-head { margin-bottom: 16px; }
  #chart { height: 260px; }

  .limits, .faq { padding: 56px 0; }
  .limit-grid { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 30px; }
  .section-head h2 { font-size: 27px; }
  .section-head p { font-size: 15.5px; }
  summary { font-size: 16px; padding: 17px 34px 17px 0; }
  details p { font-size: 14.5px; padding-right: 8px; }
  .cta { padding: 0 0 56px; }
  .cta-inner { padding: 40px 22px; border-radius: 22px; }
  .cta-inner p { font-size: 15.5px; }

  /* The live bar is fixed over the page, so the footer needs clearance. */
  .livebar { display: flex; }
  body.has-livebar { padding-bottom: 88px; }
}

@media (max-width: 400px) {
  .brand-name { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; font-size: 10.5px; }
  .shell { padding: 0 14px; }
  .inputs, .results, .chart-panel { padding: 20px 16px; }
}

/* Coarse pointers need larger hit targets on the sliders. */
@media (pointer: coarse) {
  input[type=range] { height: 34px; }
  input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; }
  input[type=range]::-moz-range-thumb { width: 26px; height: 26px; }
  .check input[type=checkbox] { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .nav, .cta, .hero-actions, .livebar { display: none; }
  body { background: #fff; }
  .results { background: #fff !important; color: #000; box-shadow: none; border: 1px solid #ccc; }
}
