:root {
  --ink:        #14333d;
  --primary:    #0e7490;
  --primary-dk: #155e75;
  --accent:     #b45309;
  --accent-lt:  #f59e0b;
  --danger:     #b42318;
  --ok:         #15803d;
  --paper:      #f1f8fa;
  --card:       #ffffff;
  --line:       #bcd4dc;
  --muted:      #3f606c;
  --badge-bg:   #fef3e2;
  --badge-line: #ecc98f;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --body: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 8%, rgba(14,116,144,.06), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(245,158,11,.07), transparent 42%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Header & Layout ---------- */
header { border-bottom: 1px solid var(--line); background: var(--card); }
.header-inner { max-width: 1220px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: 12px; }
.seal { width: 42px; height: 42px; flex: none; }
.wordmark h1 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.wordmark span { display: block; font-weight: 600; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-dk); }
.est { font-family: var(--mono); font-size: .74rem; font-weight: 600; color: #0e4956; letter-spacing: .08em; text-decoration-line: underline; text-decoration-color: var(--accent-lt); text-decoration-thickness: 2px; text-underline-offset: 5px; }

main { max-width: 1220px; margin: 0 auto; padding: 36px 20px 72px; }

/* ---------- Intro & Methodology ---------- */
.intro { max-width: 860px; margin-bottom: 20px; }
.intro h2 { font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.intro h2 em { font-style: italic; color: var(--primary-dk); }
.intro > p { margin-top: 12px; color: var(--muted); font-size: .97rem; max-width: 100ch; line-height: 1.8; }

.method { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 22px 0 34px; }
.method .step { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(20,51,61,.06); }
.method .num { font-family: var(--mono); font-size: .7rem; font-weight: 600; color: var(--accent); letter-spacing: .12em; margin-bottom: 6px; }
.method h3, .method h4 { font-family: var(--display); font-size: .98rem; font-weight: 600; margin-bottom: 4px; }
.method p { font-size: .82rem; color: var(--muted); }

/* ---------- Main Grid & UX Stickiness ---------- */
.grid { display: grid; grid-template-columns: 440px 1fr; gap: 26px; align-items: start; }
.left-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.right-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ---------- Controls ---------- */
.controls { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: 0 1px 3px rgba(20,51,61,.07); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px dashed var(--line); }
.card-head h3 { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-dk); }
.card-head .phase-tag { font-family: var(--mono); font-size: .64rem; color: var(--accent); letter-spacing: .08em; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .84rem; font-weight: 600; margin-bottom: 7px; }
.hint { font-weight: 400; font-size: .74rem; color: var(--muted); }

/* ---------- Inputs ---------- */
.money-wrap { position: relative; }
.money-wrap::before { content: var(--cur-sym, '$'); position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .92rem; color: var(--primary-dk); pointer-events: none; }
input[type="text"], input[type="number"], select { width: 100%; padding: 10px 12px 10px 28px; font-family: var(--mono); font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 7px; -moz-appearance: textfield; appearance: textfield; }
select { padding: 10px 30px 10px 12px; font-family: var(--body); font-size: .86rem; appearance: auto; -moz-appearance: auto; -webkit-appearance: menulist; cursor: pointer; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: grid; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.seg.cols-2 { grid-template-columns: repeat(2,1fr); }
.seg button { font-family: var(--body); font-size: .8rem; font-weight: 500; padding: 9px 4px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 600; }


.slider-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; appearance: none; height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--fill,25%), var(--line) var(--fill,25%)); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); box-shadow: 0 1px 4px rgba(20,51,61,.3); cursor: grab; }
input.value-badge, .value-badge { font-family: var(--mono); font-size: .9rem; font-weight: 600; color: var(--primary-dk); background: var(--badge-bg); border: 1px solid var(--badge-line); border-radius: 6px; padding: 5px 6px !important; width: 78px; max-width: 78px; text-align: center; flex: none; }
.unit-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.unit-row .seg { width: 170px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Vehicles ---------- */
.vehicle { border: 1px solid var(--line); border-left: 4px solid var(--vcolor, var(--primary)); border-radius: 9px; padding: 16px 16px 14px; margin-bottom: 16px; background: #fdfeff; }
.vehicle:last-of-type { margin-bottom: 0; }
.v-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.v-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--vcolor); flex: none; }
.v-name { flex: 1; min-width: 0; border: none; background: transparent; padding: 4px 6px; font-family: var(--display); font-size: 1.02rem; font-weight: 600; color: var(--ink); border-bottom: 1px dashed transparent; border-radius: 0; }
.v-name:hover, .v-name:focus { border-bottom-color: var(--line); background: #fff; }
.v-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v-remove { flex: none; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.v-remove:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.v-section-label { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 16px 0 10px; display: flex; align-items: center; gap: 8px; }
.v-section-label::after { content: ''; flex: 1; border-top: 1px dashed var(--line); }

.add-vehicle { width: 100%; padding: 12px; border: 1.5px dashed var(--primary); border-radius: 8px; background: transparent; color: var(--primary-dk); font-family: var(--body); font-size: .88rem; font-weight: 600; cursor: pointer; margin-top: 16px; }
.add-vehicle:hover { background: #e5f4f8; }

/* ---------- Certificate ---------- */
.certificate { position: relative; background: linear-gradient(160deg, #ffffff 0%, #f2fafc 100%); border: 1px solid #a9c9d3; border-radius: 10px; padding: 30px 32px 26px; box-shadow: 0 2px 10px rgba(20,51,61,.08); overflow: hidden; }
.certificate::before { content: ''; position: absolute; inset: 8px; border: 1px solid var(--accent-lt); border-radius: 6px; pointer-events: none; opacity: .65; }
.cert-eyebrow { font-size: .66rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); text-align: center; margin-bottom: 6px; }
.cert-amount { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw + 1rem, 3.4rem); text-align: center; color: var(--primary-dk); font-variant-numeric: tabular-nums; line-height: 1.05; }
.cert-sub { text-align: center; font-size: .84rem; color: var(--muted); margin-top: 8px; }
.cert-sub strong { color: var(--ink); font-family: var(--mono); }
.cert-ending { text-align: center; margin-top: 12px; font-size: .9rem; }
.cert-ending .end-val { font-family: var(--mono); font-weight: 600; color: var(--primary-dk); }
.cert-status { text-align: center; margin-top: 10px; font-size: .84rem; font-weight: 600; }
.cert-status.ok { color: var(--ok); }
.cert-status.bad { color: var(--danger); }
.hidden { display: none !important; }

.cert-stats { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; gap: 8px 0; }
.cert-stats.three { grid-template-columns: repeat(3,1fr); }
.stat { text-align: center; padding: 0 6px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .lbl { font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.stat .val { font-family: var(--mono); font-size: .94rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .val.growth { color: var(--primary-dk); }
.stat .val.withdrawn { color: var(--accent); }

.v-breakdown { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.v-breakdown .bk-title { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; text-align: center; }
.bk-row { display: flex; align-items: baseline; gap: 8px; padding: 4px 2px; font-size: .82rem; flex-wrap: wrap; }
.bk-row .bk-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; align-self: center; }
.bk-row .bk-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-row .bk-fill { flex: 1; border-bottom: 1px dotted var(--line); min-width: 20px; }
.bk-row .bk-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bk-row .bk-tag { font-size: .7rem; font-weight: 600; color: var(--danger); }
.bk-row .bk-tag.ok { color: var(--ok); }
.tax-badge { font-size: .65rem; color: var(--muted); background: var(--paper); padding: 2px 6px; border-radius: 4px; margin-left: auto; }

/* ---------- Chart ---------- */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px 14px; box-shadow: 0 1px 3px rgba(20,51,61,.07); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.chart-head h3 { font-family: var(--display); font-size: 1.02rem; font-weight: 600; }
.legend { display: flex; gap: 12px; font-size: .72rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#chart, #mcChart { width: 100%; height: auto; aspect-ratio: 2 / 1; display: block; touch-action: pan-y; }
.chart-wrap { position: relative; }

/* --- Monte Carlo card --- */
.chart-sub { font-family: var(--body); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 8px; vertical-align: 2px; white-space: nowrap; }

.mc-summary { margin-top: 14px; background: #f0f8fa; border: 1px solid #bcd4dc; border-left: 3px solid var(--primary); border-radius: 8px; padding: 11px 14px; font-size: .83rem; line-height: 1.6; color: #2c4b56; text-align: left; }
.mc-summary strong { color: var(--primary-dk); }
.mc-summary .mc-rate { display: block; font-weight: 600; margin-bottom: 4px; }
.mc-summary .mc-rate.ok { color: var(--ok); }
.mc-summary .mc-rate.mid { color: #b45309; }
.mc-summary .mc-rate.bad { color: var(--danger); }
.mc-summary .mc-note { display: block; margin-top: 6px; font-size: .76rem; color: var(--muted); }
.mc-summary .mc-running { color: var(--muted); font-style: italic; }

.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #f0f8fa; font-family: var(--mono); font-size: .7rem; padding: 7px 10px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; z-index: 5; }

/* ---------- FAQs ---------- */
.faqs { margin-top: 50px; padding-top: 40px; border-top: 1px solid var(--line); }
.faqs h2 { font-family: var(--display); font-size: 2rem; color: var(--ink); margin-bottom: 24px; text-align: center; }
.faq-grid details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(20,51,61,.04); cursor: pointer; }
.faq-grid summary { font-weight: 600; font-size: 1rem; color: var(--primary-dk); }
.faq-grid summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.faq-grid p { margin-top: 12px; color: var(--muted); font-size: .95rem; line-height: 1.6; }

/* ---------- Footer & Cookie Banner ---------- */
footer { border-top: 1px solid var(--line); padding: 20px 24px; text-align: center; font-size: .75rem; color: var(--muted); }
footer .note { max-width: 100ch; margin: 0 auto; }

.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--ink); color: #fff; padding: 16px 24px; z-index: 100; box-shadow: 0 -4px 10px rgba(0,0,0,0.1); }
.cb-content { max-width: 1220px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cb-content p { font-size: .85rem; margin: 0; max-width: 800px; }
.cb-buttons { display: flex; gap: 12px; }
.cb-btn { padding: 8px 16px; border-radius: 6px; font-weight: 600; font-size: .85rem; cursor: pointer; border: none; }
.cb-accept { background: var(--accent-lt); color: var(--ink); }
.cb-decline { background: transparent; border: 1px solid #fff; color: #fff; }

/* ---------- Legal Document Styles ---------- */
.legal-wrapper { max-width: 820px; margin: 0 auto; padding: 40px 20px 80px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--primary); text-decoration: none; margin-bottom: 24px; }
.back-link:hover { text-decoration: underline; }
.legal-doc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 44px 48px; box-shadow: 0 1px 3px rgba(20,51,61,.06); }
.legal-doc .updated { font-family: var(--mono); font-size: .75rem; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 32px; display: block; }
.legal-doc h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 600; color: var(--primary-dk); margin: 36px 0 12px; }
.legal-doc h3:first-of-type { margin-top: 0; }
.legal-doc p, .legal-doc li { font-size: .95rem; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.legal-doc ul { padding-left: 24px; margin-bottom: 16px; color: var(--muted); }
.legal-doc strong { color: var(--ink); font-weight: 600; }
.legal-doc a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.legal-doc a:hover { color: var(--primary-dk); }
.legal-doc a[href^="mailto:"] { text-decoration: none; font-family: var(--mono); font-size: .92em; }
.legal-doc a[href^="mailto:"]:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1020px){ 
  .grid { grid-template-columns: 1fr; } 
}
@media (max-width: 720px){ 
  .method { grid-template-columns: 1fr; } 
  .certificate { padding: 24px 18px 22px; }
  .cert-stats { grid-template-columns: 1fr 1fr; } 
  .stat:nth-child(2n) { border-right: none; } 
  .controls { padding: 18px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .chart-tip { font-size: .64rem; }
  .legal-doc { padding: 28px 24px; } 
}
@media (max-width: 420px){
  .value-badge { width: 70px; max-width: 70px; font-size: .84rem; }
  .header-inner { padding: 14px 16px; }
  .est { display: none; }
}
@media (prefers-reduced-motion: reduce){
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}


/* ---------- Save as PDF button ---------- */
.pdf-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; font-family: var(--body, 'Public Sans', sans-serif); font-size: .85rem; font-weight: 600; color: #155e75; background: #fff; border: 1.5px solid #155e75; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.pdf-btn:hover { background: #155e75; color: #fff; }

/* ---------- Print layout (used by the Save as PDF button) ---------- */
.print-only { display: none; }

@media print {
  @page { size: letter; margin: 14mm; }
  body { background: #fff !important; color: #14333d; }
  header, .site-nav, .hero, .trust-bar, .intro, .method, .left-col, .faqs, footer, .cookie-banner,
  .results-toolbar, .chart-tip { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  .grid { display: block !important; }
  .right-col { display: block !important; width: 100% !important; }

  .print-only { display: block; }
  .print-head { display: flex !important; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #155e75; padding-bottom: 8px; margin-bottom: 18px; }
  .print-title { font-family: var(--display, 'Fraunces', serif); font-weight: 700; font-size: 1.15rem; color: #0e4956; }
  .print-meta { font-family: 'IBM Plex Mono', monospace; font-size: .8rem; color: #3f606c; }
  .print-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #bcd4dc; font-size: .72rem; color: var(--muted); text-align: center; }

  /* Page 1: the nest-egg certificate. Page 2: the chart. */
  .certificate { page-break-after: always; break-after: page; border: none !important; box-shadow: none !important; }
  .right-col, .certificate, .chart-card { position: static !important; }
  .chart-card { page-break-inside: avoid; break-inside: avoid; border: none !important; box-shadow: none !important; }
  #mcChartCard { page-break-before: always; break-before: page; }
  #incomeChartCard { page-break-before: always; break-before: page; background: #fff !important; }
  #incomeChartCard.empty { display: none !important; }
  #chart, #mcChart { max-height: 150mm; }

  /* Print exact colors where supported */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------- Skip link (keyboard & screen-reader users) ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--primary-dk); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0; font-weight: 600; font-size: .9rem; text-decoration: none; }
.skip-link:focus { left: 0; }






/* ---------- Saving / Spending zones (Timeline card) ---------- */
.zone { border: 1px solid; border-radius: 9px; padding: 14px 14px 16px; margin-bottom: 16px; }
.zone .field:last-child { margin-bottom: 0; }
.zone-save  { background: #f2fafb; border-color: #cfe6ec; }
.zone-spend { background: #fdf6ea; border-color: #f0ddb8; }
.zone-label { display: flex; align-items: center; gap: 7px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 13px; }
.zone-save  .zone-label { color: #155e75; }
.zone-spend .zone-label { color: #8a4a08; }
.zone-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.zone-save  .zone-dot { background: #0e7490; }
.zone-spend .zone-dot { background: #f59e0b; }
.zone-global { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 14px; }
.zone-global .zone-label.neutral { color: var(--muted); }
.zone-global .zone-dot { background: var(--muted); }

/* ---------- Per-account "In retirement" section: same spending tint ---------- */
.v-retire { background: #fdf6ea; border: 1px solid #f0ddb8; border-radius: 9px; padding: 12px 12px 14px; margin-top: 14px; }
.v-retire .field:last-child { margin-bottom: 0; }
.v-retire .v-section-label { color: #8a4a08; }
.v-retire .v-section-label::after { border-top-color: #f0ddb8; }



/* ---------- Support page ---------- */
.support-intro { color: var(--muted); font-size: .97rem; line-height: 1.8; margin: 12px 0 26px; }
.support-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; box-shadow: 0 1px 3px rgba(20,51,61,.06); margin-bottom: 16px; }
.support-card h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--primary-dk); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.support-card p { font-size: .93rem; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.support-num { font-family: var(--mono); font-size: .68rem; font-weight: 600; color: var(--accent); letter-spacing: .12em; }
.share-links { display: flex; flex-wrap: wrap; gap: 10px; }
.share-links a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 1.5px solid var(--primary-dk); border-radius: 8px; color: var(--primary-dk); font-size: .86rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.share-links a:hover { background: var(--primary-dk); color: #fff; }
.embed-code { background: #f4f9fa; border: 1px dashed var(--line); border-radius: 8px; padding: 14px 16px; font-family: var(--mono); font-size: .8rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.donate-soon { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1.5px dashed var(--badge-line); border-radius: 8px; background: var(--badge-bg); color: #8a4a08; font-size: .88rem; font-weight: 600; }


/* ---------- Today's-money annotations (inflation view) ---------- */
.cert-real { text-align: center; margin-top: 7px; font-size: .88rem; color: #a21caf; }
.cert-real strong { font-family: var(--mono); font-weight: 600; }
.end-real { font-size: .85em; color: var(--muted); }





/* ---------- Purchasing-power insight (inflation view) ---------- */
.inf-insight { margin-top: 14px; background: #fdf4ff; border: 1px solid #f0c8f7; border-left: 3px solid #c026d3; border-radius: 8px; padding: 11px 14px; font-size: .83rem; line-height: 1.6; color: #5b2e63; text-align: left; }
.inf-insight strong { color: #a21caf; }


/* end-real inherits the today's-money identity color */
.end-real { color: #a21caf; }


/* ---------- Guaranteed income card & chart ---------- */
.gi-row { margin-bottom: 4px; }
#incomeChart { width: 100%; height: auto; aspect-ratio: 720 / 300; display: block; }
.income-summary { margin-top: 12px; font-size: .84rem; line-height: 1.6; color: var(--muted); }
.income-summary strong { color: var(--primary-dk); }
.income-summary .today { color: #a21caf; font-weight: 600; }


/* ---------- Emerald identity: guaranteed lifetime income ---------- */
#incomeCard, #incomeChartCard { background: #f2faf6; border-color: #bfe3cf; }
#incomeCard .card-head, #incomeChartCard .chart-head { border-bottom-color: #cfe9da; }
#incomeCard .phase-tag { color: #047857; }
#incomeCard .money-wrap input, #incomeCard select { background: #fff; }
.income-summary strong { color: #047857; }


/* Income chart empty state: card stays visible with a prompt */
#incomeChartCard.empty .chart-wrap, #incomeChartCard.empty .chart-head .legend { display: none; }


/* ============================================================
   FRONT-PAGE REDESIGN (build 19): nav, hero, steps, trust bar
   ============================================================ */
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
#calculator, #accounts, #incomeCard, #faqs { scroll-margin-top: 86px; }

/* ---------- Sticky top navigation ---------- */
.site-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1220px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 22px; flex-wrap: nowrap; }
.site-nav .wordmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-nav .seal { width: 44px; height: 44px; flex: none; }
.site-nav h1 { font-family: var(--display); font-size: 1.28rem; font-weight: 700; color: var(--ink); line-height: 1.15; white-space: nowrap; }
.site-nav .wordmark span { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.top-links { display: flex; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.top-links a { padding: 8px 11px; border-radius: 7px; font-size: .88rem; font-weight: 600; color: var(--primary-dk); text-decoration: none; white-space: nowrap; }
.top-links a:hover { background: #eef6f8; }
.nav-cta { display: flex; align-items: center; gap: 14px; flex: none; }
.privacy-chip { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; color: #047857; }
.save-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--ink); color: #fff; border: none; border-radius: 9px; font-family: var(--body, 'Public Sans', sans-serif); font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.save-btn:hover { background: #0e7490; }

/* ---------- Hero with photo bleeding under the outlook card ---------- */
.hero { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 34px; border: 1px solid var(--line);
  background-color: #dfeef2;
  background-image:
    linear-gradient(90deg, #f7fafb 0%, rgba(247,250,251,.94) 26%, rgba(247,250,251,.55) 48%, rgba(247,250,251,.12) 66%, rgba(20,51,61,.10) 100%),
    linear-gradient(0deg, rgba(247,250,251,.55) 0%, rgba(247,250,251,0) 30%),
    url('header.webp');
  background-size: cover, cover, cover;
  background-position: center, center, center 30%;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) 380px; gap: 40px; align-items: center; padding: 44px 44px 26px; }
.hero-copy h2 { font-family: var(--display); font-size: clamp(1.45rem, 5.9vw, 2.7rem); font-weight: 700; color: var(--ink); line-height: 1.14; margin-bottom: 4px; }
.hero-copy .nowrap-line { white-space: nowrap; }
.hero-copy h2 em { display: block; font-style: italic; color: #047857; }
.hero-lede { margin: 14px 0 22px; max-width: 52ch; font-size: 1rem; line-height: 1.7; color: #23444f; }
.hero-feats { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.hero-feats li { display: flex; align-items: center; gap: 13px; }
.feat-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--fi-bg, #fff); border: 1.5px solid var(--fi-bd, var(--line)); box-shadow: 0 1px 4px rgba(20,51,61,.10); }
.hero-feats strong { display: block; font-size: .94rem; color: var(--ink); }
.hero-feats span:not(.feat-icon) { font-size: .84rem; color: #35545f; }

.hero-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 16px; box-shadow: 0 14px 40px rgba(20,51,61,.18); }
.hero-card-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 9px; margin-bottom: 8px; }
.hero-card h3 { font-family: var(--display); font-size: 1.08rem; font-weight: 600; color: var(--primary-dk); }
.hero-card-tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.hero-card svg { width: 100%; height: auto; display: block; }
.hero-cta { display: block; text-align: center; margin-top: 10px; padding: 11px; background: var(--primary-dk); color: #fff; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; transition: background .15s; }
.hero-cta:hover { background: #0e7490; }

/* ---------- Dark "Start your plan" panel ---------- */
.steps-panel { background: rgba(16, 41, 51, .93); backdrop-filter: blur(3px); padding: 22px 44px 26px; display: flex; gap: 34px; align-items: center; }
.steps-head { flex: none; max-width: 190px; }
.steps-head h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: #fff; }
.steps-head p { font-size: .8rem; color: #a8c6cf; margin-top: 4px; line-height: 1.5; }
.steps { display: flex; align-items: stretch; gap: 12px; flex: 1; min-width: 0; }
.step-card { flex: 1; min-width: 0; background: #fff; border-radius: 10px; padding: 14px 16px; }
.step-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; background: var(--si-bg); margin-bottom: 8px; }
.step-card strong { display: block; font-size: .86rem; color: var(--ink); margin-bottom: 4px; }
.step-card p { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.step-arrow { align-self: center; color: #7fb3c1; font-size: 1.3rem; flex: none; }

/* ---------- Trust bar ---------- */
.trust-bar { max-width: 1220px; margin: 8px auto 0; padding: 22px 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.trust-item { display: flex; align-items: flex-start; gap: 13px; }
.trust-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ti-bg, #fff); border: 1.5px solid var(--ti-bd, var(--line)); }
.trust-item strong { display: block; font-size: .92rem; color: var(--ink); margin-bottom: 3px; }
.trust-item span:not(.trust-icon) { font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .hero-inner { grid-template-columns: 1fr; gap: 26px; padding: 34px 28px 22px; }
  .hero-card { max-width: 460px; }
  .hero { background-image:
    linear-gradient(180deg, rgba(247,250,251,.93) 0%, rgba(247,250,251,.82) 55%, rgba(247,250,251,.94) 100%),
    url('header.webp'); background-size: cover, cover; background-position: center, center 25%; }
}
@media (max-width: 980px){
  .top-links { display: none; }
}
@media (max-width: 860px){
  .steps-panel { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px 22px; }
  .steps-head { max-width: none; }
  .steps { flex-direction: column; }
  .step-arrow { display: none; }
  .trust-bar { grid-template-columns: 1fr 1fr; margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 680px){
  /* Two-row header: logo + name on top, actions beneath */
  .nav-inner { padding: 10px 16px; row-gap: 10px; column-gap: 12px; flex-wrap: wrap; align-items: center; }
  .site-nav .wordmark { flex: 1 1 auto; min-width: 0; }
  .site-nav .wordmark span { display: none; }
  .site-nav h1 { font-size: 1.06rem; white-space: normal; }
  .nav-cta { flex: 1 0 100%; order: 3; justify-content: space-between; gap: 12px;
    border-top: 1px solid var(--line); padding-top: 10px; }
  .chip-text { display: inline; }              /* room now, so show the full text */
  .privacy-chip { font-size: .8rem; }
  .save-btn { padding: 9px 15px; font-size: .84rem; }
  .hero-inner { padding: 26px 18px 18px; }
  .hero-card { max-width: none; }
}
@media (max-width: 400px){
  /* very narrow phones: trim so both rows breathe */
  .site-nav h1 { font-size: .98rem; }
  .site-nav .seal { width: 38px; height: 38px; }
  .privacy-chip { font-size: .76rem; }
  .save-btn { padding: 8px 12px; font-size: .8rem; }
  .nav-cta { gap: 8px; }
}
@media (max-width: 540px){
  .trust-bar { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce){
  html { scroll-behavior: auto; }
}


/* ---------- Audit: keyboard focus for links & buttons added in redesign ---------- */
a:focus-visible, .save-btn:focus-visible, .hero-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.inf-nudge { color: #8a4a08; font-weight: 600; }


/* Mid-width nav: reclaim space so links, chip, and button share one line */
@media (max-width: 1180px){
  .site-nav .wordmark span { display: none; }
  .site-nav h1 { font-size: 1.08rem; }
  .nav-inner { gap: 14px; }
}


/* ---------- Dividend fields & insight ---------- */
.div-field label { color: #2f6f52; }
.div-field input[type="range"] { accent-color: #059669; }
.div-insight { margin-top: 12px; background: #f2faf6; border: 1px solid #bfe3cf; border-left: 3px solid #059669; border-radius: 8px; padding: 11px 14px; font-size: .83rem; line-height: 1.6; color: #2c4a3a; text-align: left; }
.div-insight strong { color: #047857; }
.div-insight em { font-style: italic; }


/* ============================================================
   BUILD 30: privacy, honesty, tax label, muting, a11y
   ============================================================ */

/* Muted / disabled inactive fields (contribution & withdrawal when "Nothing") */
.muted-field { opacity: .55; }
.muted-field input:disabled { background: #eef2f3; cursor: not-allowed; color: var(--muted); }

/* Double-count dividend warning inside the insight box */
.div-warn { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-left: 3px solid #f59e0b; border-radius: 8px; padding: 11px 14px; font-size: .83rem; line-height: 1.6; color: #7a4a08; text-align: left; }
.div-warn strong { color: #92400e; }
.div-warn em { font-style: italic; }

/* --- Accessibility: minimum text sizes (bump the smallest) --- */
.hint { font-size: .8rem; }                 /* was ~.72-.76 in places */
.est { font-size: .78rem; }
.cert-status { font-size: .92rem; }

/* --- 44x44 minimum interactive targets --- */
.seg button { min-height: 44px; }
.v-remove { width: 32px; height: 32px; }
.top-links a { min-height: 40px; display: inline-flex; align-items: center; }
select, .money-wrap input, input[type="text"], input[type="number"] { min-height: 42px; }
input[type="range"] { min-height: 32px; }   /* thumb hit area extended below */

/* --- Stronger, higher-contrast focus everywhere --- */
:focus-visible { outline: 3px solid #0e7490; outline-offset: 2px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid #0e7490; outline-offset: 2px; border-radius: 4px;
}

/* --- Success not by color alone: verdict carries an icon already (✓/⚠);
       reinforce with a weight + left rule so it reads without color --- */
.cert-status.ok, .cert-status.bad { border-left: 4px solid currentColor; padding-left: 12px; font-weight: 600; }

/* --- Larger chart axis text handled inline in JS; bump legend --- */
.legend span { font-size: .82rem; }

/* --- Not-financial-advice chip under the results certificate --- */
.cert-disclaimer { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .72rem; line-height: 1.55; color: var(--muted); text-align: center; }
