/* Afterwork Plan: calm, readable, built for 50-65 year-olds on a laptop or a phone. */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #fcfcfb;
  --ink: #16181c;
  --ink-2: #4a4d52;
  --ink-3: #6f7277;
  --line: #e3e0d8;
  --brand: #1f5e4e;          /* deep evergreen: steady, not flashy */
  --brand-ink: #ffffff;
  --brand-soft: #e4efeb;
  --yes: #1f6e3a;
  --notyet: #8a4b08;
  --series-1: #2a78d6;       /* guaranteed income (validated pair, light) */
  --series-2: #eb6834;       /* from savings */
  --focus: #2a78d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121412; --surface: #1a1a19; --ink: #f4f3ef; --ink-2: #c3c2b7; --ink-3: #9a998f;
    --line: #2d2e2b; --brand: #5fb39b; --brand-ink: #0d1a16; --brand-soft: #1f2d28;
    --yes: #6cc58a; --notyet: #f0a95b; --series-1: #3987e5; --series-2: #d95926; --focus: #6aa6ee;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121412; --surface: #1a1a19; --ink: #f4f3ef; --ink-2: #c3c2b7; --ink-3: #9a998f;
  --line: #2d2e2b; --brand: #5fb39b; --brand-ink: #0d1a16; --brand-soft: #1f2d28;
  --yes: #6cc58a; --notyet: #f0a95b; --series-1: #3987e5; --series-2: #d95926; --focus: #6aa6ee;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo b { font-weight: 500; color: var(--brand); }
.logo svg { width: 28px; height: 28px; }
.privacy { font-size: .8rem; color: var(--ink-3); }
@media (max-width: 560px) { .privacy { display: none; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin: 0 0 20px; }
@media (max-width: 560px) { .card { padding: 20px 18px; } }

/* ---------- wizard ---------- */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 22px; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.step-count { font-size: .8rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
h1, h2 { line-height: 1.2; margin: 0 0 10px; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
.help { color: var(--ink-2); margin: 0 0 18px; }
.field { margin: 0 0 18px; }
.field label { display: block; font-weight: 600; margin: 0 0 6px; }
.field .hint { display: block; font-size: .85rem; color: var(--ink-3); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
input[type=number], input[type=text], input[type=email], select {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.money input { padding-left: 28px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.slider-val { font-weight: 700; font-size: 1.2rem; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 12px 18px; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
button.ghost { background: transparent; }
button.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
button.small { padding: 8px 12px; font-size: .9rem; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 12px; background: var(--bg); }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

/* ---------- results ---------- */
.verdict .eyebrow { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.verdict .big { font-size: 2.3rem; font-weight: 800; line-height: 1.12; margin: 6px 0 12px; }
.verdict .big.yes { color: var(--yes); }
.verdict .big.notyet { color: var(--notyet); }
.verdict .sub { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 6px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 6px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr; } }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 1.45rem; }
.stat span { font-size: .85rem; color: var(--ink-3); }
.strict { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--line); color: var(--ink-2); font-size: .95rem; }

.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; gap: 16px; font-size: .9rem; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.marks { list-style: none; padding: 0; margin: 14px 0 0; font-size: .92rem; color: var(--ink-2); }
.marks li { padding: 7px 0; border-top: 1px dashed var(--line); display: flex; gap: 14px; }
.marks b { color: var(--ink); flex: 0 0 9.5em; }
@media (max-width: 560px) { .marks li { flex-direction: column; gap: 0; } .marks b { flex: none; } }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fine { font-size: .82rem; color: var(--ink-3); }
.loading { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
footer.foot { padding: 26px 0 40px; font-size: .8rem; color: var(--ink-3); }

/* ---------- accounts and Pro ---------- */
.hdr-r { display: flex; align-items: center; gap: 12px; }
button.wide { width: 100%; }
.err { color: var(--notyet); }
dialog#dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 28px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog#dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg-x { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; padding: 6px 10px; color: var(--ink-3); }
#cd { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.pro.locked { position: relative; }
.pro.locked .pro-body { filter: blur(6px); pointer-events: none; user-select: none; max-height: 1100px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.lock-panel { position: absolute; z-index: 2; left: 50%; top: 70px; transform: translateX(-50%); width: min(540px, calc(100% - 24px)); box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.lock-panel .eyebrow { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 4px; }
@media (max-width: 560px) { .lock-panel { top: 30px; } }

/* ---------- legal pages ---------- */
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.foot a { color: var(--ink-3); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.acct-actions:empty { display: none; }
#confirmCancel button { margin: 4px 8px 0 0; }

/* ---------- what-ifs ---------- */
table.cmp { min-width: 520px; }
table.cmp th, table.cmp td { vertical-align: top; }
table.cmp th:first-child, table.cmp td:first-child { position: sticky; left: 0; background: var(--surface); color: var(--ink-2); font-size: .88rem; min-width: 150px; max-width: 190px; }
table.cmp thead th { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .95rem; }
table.cmp tr.grp td { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding-top: 18px; background: var(--surface); }
table.cmp td.chg { font-weight: 700; color: var(--ink); background: var(--brand-soft); }
.cmp-act { display: flex; gap: 4px; margin-top: 6px; }
.cmp-act button { padding: 4px 8px; font-size: .78rem; }
.yes-t { color: var(--yes); font-weight: 700; }
.notyet-t { color: var(--notyet); font-weight: 700; }
.wi-edit { margin-top: 14px; }
.phone-only { display: none; }
@media (max-width: 560px) { .phone-only { display: block; } }

/* ---------- printable report ---------- */
@media screen { #report { position: absolute; left: -10000px; top: 0; width: 720px; } }
#report .rp-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 18px; }
#report h2 { font-size: 1.1rem; margin: 22px 0 6px; }
#report .verdict { box-shadow: none; }
#report table { font-size: .8rem; }
#report th, #report td { padding: 4px 6px; }
#report .rp-kv td:first-child { color: var(--ink-2); width: 45%; }
#report .rp-num td:not(:first-child), #report .rp-num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#report table.cmp { min-width: 0; }
#report table.cmp th:first-child, #report table.cmp td:first-child { position: static; }
#report .scroll { overflow: visible; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light; --bg: #ffffff; --surface: #ffffff; --ink: #16181c; --ink-2: #4a4d52; --ink-3: #6f7277;
    --line: #e3e0d8; --brand: #1f5e4e; --brand-soft: #e4efeb; --yes: #1f6e3a; --notyet: #8a4b08;
    --series-1: #2a78d6; --series-2: #eb6834;
  }
  @page { size: letter; margin: 14mm 14mm 16mm; }
  html, body { background: #fff; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body > *:not(#report) { display: none !important; }
  #report { position: static; width: auto; }
  #report h2 { break-after: avoid; }
  #report .rp-keep, #report tr, #report .chart { break-inside: avoid; }
  #report .rp-break { break-before: page; }
  #report .card { border: 1px solid var(--line); padding: 16px; }
}
pre.code { white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .8rem; color: var(--ink); }
.demo-bar { background: var(--brand-soft); border: 1px solid var(--brand); color: var(--ink); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: .95rem; }
.rec-by { display: inline-block; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: .9rem; border-radius: 99px; padding: 4px 12px; margin-bottom: 12px; }
.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; }
