@font-face { font-family: "Parkinsans"; src: url("fonts/parkinsans-latin-600-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FEFDFB;
  --sand: #F5F2EC;
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #4A5568;
  --muted: #64748B;
  --faint: #94A3B8;
  --rule: #E2E8F0;
  --dot: #CBD5E1;
  --green: #10B981;
  --green-deep: #059669;
  --mint: #D1FAE5;
  --mint-soft: #F0FAF6;
  --amber-soft: #FEF3C7;
  --amber-ink: #92400E;
  --red: #059669;
  --danger: #DC2626;
  --hover: #F5F2EC;
  --focus: #059669;
  --sans: "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
  --display: "Parkinsans", "Inter", -apple-system, system-ui, sans-serif;
  --mono: var(--sans);
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h1, h2, .brand-name, .lg-total > span:first-child { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  font: 500 15px/1.2 var(--sans); color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 13px 20px; min-height: 48px; cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.btn.primary { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
@media (hover: hover) {
  .btn:hover { background: var(--hover); }
  .btn.primary:hover { background: #047857; border-color: #047857; }
}
.link-btn { font: inherit; font-size: 13px; font-weight: 500; color: var(--green-deep); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (hover: hover) { .link-btn:hover { color: var(--ink); } }

/* ---------- page frame ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { width: 32px; height: 32px; flex: none; display: block; }
.mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font: 400 12px var(--sans); color: var(--muted); display: none; }
.stamp { font: 600 10px var(--sans); color: var(--amber-ink); border: 1.5px solid #B45309; padding: 3px 7px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.stamp-long { display: none; }

.page { display: flex; flex-direction: column; gap: 18px; }
.col-main, .col-side { display: contents; }
.statement { order: 1; }
.share-tool { order: 2; }
.kids-panel { order: 3; }
.dates, .covers { order: 4; }
.more { order: 5; }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.panel.plain { background: transparent; }
.panel h2 { font-size: 17px; font-weight: 600; }

/* ---------- the statement ---------- */
.statement { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 18px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.st-head { display: flex; flex-direction: column; gap: 10px; }
.st-head h1 { font-size: 27px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.st-lede { font-size: 15px; color: var(--ink-2); line-height: 1.5; max-width: 60ch; }

.summary { margin: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.summary > div { padding: 14px 0 14px 16px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--rule); min-width: 0; }
.summary > div:first-child { padding-left: 0; border-left: 0; }
.summary dt { font-size: 12px; color: var(--muted); }
.summary dd { margin: 0; font: 600 17px/1.1 var(--sans); letter-spacing: -0.02em; margin-top: auto; }
.summary dd.big { font-size: 30px; font-weight: 600; }
.summary .sm-hide { display: none; }

.ticker { display: inline-grid; }
.ticker > span { grid-area: 1 / 1; font-variant-numeric: tabular-nums; }
.tk-ghost { visibility: hidden; }

.ledger { display: flex; flex-direction: column; }
.lg-cols, .lg-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; }
.lg-cols { padding-bottom: 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--ink); }
.lg-cols span:last-child { text-align: right; }
.lg-row { padding: 8px 0; border-bottom: 1px dotted var(--dot); font-size: 14px; align-items: baseline; }
.lg-row .when { font-size: 13px; color: var(--muted); }
.lg-row .num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.lg-row.head { border-bottom: 0; font-family: var(--display); padding: 18px 0 8px; font-weight: 600; font-size: 15px; }
.lg-row.head .what { grid-column: 1 / 3; }
.lg-row.head .num { font-weight: 600; font-family: var(--sans); }
.lg-group:first-child .lg-row.head { padding-top: 14px; }
.lg-group .lg-row:last-child { border-bottom: 1px solid var(--rule); }
.lg-row.pot { color: var(--muted); }
.lg-row.pot .num { white-space: normal; }
sup { color: var(--red); font-size: 0.7em; line-height: 0; }
.lg-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; padding: 12px 0 10px; border-top: 2px solid var(--ink); border-bottom: 4px double var(--ink); font-weight: 700; }
.lg-total .num { font-weight: 600; font-size: 17px; }

/* landing: what this is and how to start */
.gets { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.gets li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); line-height: 1.4; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.gets strong { color: var(--ink); font-weight: 600; }
.ico { width: 22px; height: 22px; flex: none; color: var(--green-deep); display: flex; }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.start-row { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.btn.start { font-weight: 600; font-size: 16px; min-height: 52px; padding: 15px 28px; }
.start-note { font-size: 13px; color: var(--muted); }

.preview { display: flex; flex-direction: column; margin-top: 4px; }
.preview-cap { font-size: 13px; color: var(--muted); padding-top: 10px; }
.sk-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px dotted #CBD5E1; }
.sk-row i { display: block; height: 8px; background: var(--sand); }
.sk-row i:last-child { margin-left: auto; }
.sk-row.head i { height: 10px; background: #ECE7DE; }

.wrap:not(.is-empty) .preview, .wrap:not(.is-empty) .gets, .wrap:not(.is-empty) .start-row { display: none; }
.is-empty .summary, .is-empty .ledger, .is-empty .st-notes { display: none; }
.st-notes { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* empty and filled states */
.is-empty #actions, .is-empty #share-tool, .is-empty #more, .is-empty #rep-dates, .is-empty .kids-panel, .is-empty .kids-panel { display: none !important; }
.wrap:not(.is-empty) #covers, .wrap:not(.is-empty) #none { display: none; }

/* ---------- your children ---------- */
.kids { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.kid { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 36px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.kid-n { font-weight: 600; }
.kid-text { display: flex; flex-direction: column; align-items: flex-start; }
.kid-born { font-weight: 500; }
.kid-amt { font-size: 14px; }
.kid-x { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.kid-x svg { width: 18px; height: 18px; }
@media (hover: hover) { .kid-x:hover { color: var(--danger); background: var(--hover); } }
.none { padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 15px; color: var(--muted); }

/* ---------- dates, coverage, glossary ---------- */
.dates { gap: 16px; }
.date { display: flex; flex-direction: column; gap: 4px; }
.date-when { font-size: 12px; font-weight: 600; color: var(--green-deep); text-transform: uppercase; letter-spacing: .05em; }
.date h3 { font-size: 15px; font-weight: 600; }
.date p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.cda-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.cda-list li strong { color: var(--ink); font-weight: 600; }

.cov { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.cov li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.cov li:last-child { border-bottom: 1px solid var(--rule); }
.cov .mono { font-size: 12px; color: var(--muted); white-space: nowrap; }

.more { gap: 18px; }
.more h2 { margin-bottom: 4px; }
.gloss { margin: 0; display: flex; flex-direction: column; }
.gloss > div { padding: 10px 0; border-top: 1px solid var(--rule); display: grid; gap: 2px; }
.gloss dt { font-weight: 600; font-size: 15px; }
.gloss dd { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.how { border-top: 2px solid var(--ink); padding-top: 12px; }
.how summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font: 500 20px var(--sans); color: var(--green-deep); }
.how[open] summary::after { content: "\2212"; }
.how .more { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.how h3 { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.how ul { margin: 0; padding-left: 18px; }

/* ---------- share the calculator ---------- */
.share-tool { background: var(--ink); border-color: var(--ink); color: #fff; }
.share-tool h2 { font-size: 22px; }
.share-tool p { font-size: 15px; color: #CBD5E1; line-height: 1.5; max-width: 52ch; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.btn.on-dark-primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.on-dark { background: transparent; border-color: #fff; color: #fff; }
@media (hover: hover) {
  .btn.on-dark-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
  .btn.on-dark:hover { background: rgba(255, 255, 255, 0.1); }
}
.share-tool :focus-visible { outline-color: #fff; }
@media (min-width: 600px) {
  .share-tool { padding: 28px; }
  .share-actions { display: flex; flex-wrap: wrap; }
}

/* ---------- credit ---------- */
.credit { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); line-height: 1.5; }
.credit a { color: var(--green-deep); font-weight: 600; text-underline-offset: 2px; }
@media (min-width: 600px) { .credit { flex-direction: row; justify-content: space-between; gap: 16px; } }

/* ---------- picker ---------- */
.picker {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 94vh; max-height: 94dvh;
  background: var(--paper); color: var(--ink); border-top: 2px solid var(--ink);
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); overflow: auto;
}
.picker[open] { display: flex; flex-direction: column; gap: 16px; animation: sheet-in .32s var(--ease); }
.picker.closing { animation: sheet-out .18s ease-in forwards; }
.picker::backdrop { background: rgba(26, 26, 26, 0.45); animation: fade-in .25s ease-out; }
.picker.closing::backdrop { animation: fade-out .18s ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.pk-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; }
.pk-step { font-size: 12px; color: var(--muted); }
#pk-close { font-size: 14px; padding: 6px 0; }
.pk-head { display: flex; flex-direction: column; gap: 6px; }
.pk-head h2 { font-size: 24px; font-weight: 600; line-height: 1.2; }
.pk-head p { font-size: 14px; color: var(--muted); }
.pk-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); font-size: 14px; }
.pk-chosen .mono { flex: 1; }
.pk-chosen .link-btn { font-size: 14px; }

.panes { position: relative; overflow: hidden; margin: -4px; padding: 4px; }
.pane { position: relative; z-index: 1; transition: transform .28s var(--ease), opacity .2s, visibility 0s; }
.pane.away-left, .pane.away-right { opacity: 0; visibility: hidden; pointer-events: none; transition: transform .28s var(--ease), opacity .2s, visibility 0s .28s; }
.pane.away-left, .pane.away-right { position: absolute; z-index: 0; top: 0; left: 0; width: 100%; }
.pane.away-left { transform: translateX(-24px); }
.pane.away-right { transform: translateX(24px); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); }
.opt { font: 500 15px var(--sans); color: var(--ink); background: var(--paper); border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-height: 52px; cursor: pointer; transition: background-color .12s, color .12s; }
.opt[aria-pressed="true"] { background: var(--green-deep); color: #fff; font-weight: 600; }
@media (hover: hover) { .opt:hover:not([aria-pressed="true"]) { background: var(--hover); } }
.opt:focus-visible { outline-offset: -3px; }

.mini { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.mini li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.mini .mono { font-weight: 600; }
.mini .tag { font: 600 13px var(--sans); color: var(--green-deep); }
.mini li.new { animation: row-in .4s var(--ease); }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } }
.more-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.more-actions .btn { padding-left: 10px; padding-right: 10px; }
.more-actions .primary { font-weight: 600; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 14px; padding: 11px 16px; border-radius: 4px; display: flex; align-items: center; gap: 8px; transition: opacity .2s, transform .25s var(--ease); z-index: 10; white-space: nowrap; }
.toast svg { width: 16px; height: 16px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- saved image ---------- */
.shot.offscreen { position: absolute; left: -10000px; top: 0; width: 760px; }
.card-shot { background: var(--bg); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.card-shot .brand-sub, .card-shot .stamp-long { display: inline; }
.card-shot .statement { box-shadow: none; }
.card-shot .statement { padding: 36px 40px 32px; }
.card-shot .st-head h1 { font-size: 30px; }
.card-shot .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-shot .summary > div { padding-left: 18px; }
.card-shot .summary > div:first-child { padding-left: 0; }
.card-shot .summary dd { font-size: 24px; }
.card-shot .summary dd.big { font-size: 32px; }
.card-shot .lg-cols, .card-shot .lg-row { grid-template-columns: 110px minmax(0, 1fr) auto; gap: 16px; }
.card-shot .lg-row { font-size: 15px; }
.card-shot .cta { margin-top: 6px; font: 600 13px var(--sans); color: var(--green-deep); }
.capturing * { font-variant-numeric: normal !important; animation: none !important; transition: none !important; }

/* ---------- wider screens ---------- */
@media (min-width: 600px) {
  .wrap { padding: 32px 24px 64px; gap: 26px; }
  .mark { width: 36px; height: 36px; }
  .brand-name { font-size: 16px; }
  .brand-sub { display: inline; }
  .stamp { font-size: 12px; padding: 5px 9px; }
  .stamp-long { display: inline; }
  .stamp-short { display: none; }
  .statement { padding: 36px 36px 32px; gap: 28px; }
  .st-head h1 { font-size: 32px; }
  .st-lede { font-size: 16px; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary .sm-hide { display: flex; }
  .summary > div { padding: 18px 20px; }
  .summary dd, .summary dd.big { font-size: 34px; }
  .summary dd.big { font-weight: 600; }
  .lg-cols, .lg-row { grid-template-columns: 110px minmax(0, 1fr) 150px; gap: 16px; }
  .lg-row { font-size: 15px; }
  .lg-row.pot .num { white-space: nowrap; }
  .lg-total { font-size: 17px; }
  .lg-total .num { font-size: 20px; }
  .start-row { flex-direction: row; align-items: center; gap: 16px; }
  .gets li { font-size: 16px; }
  .st-notes { font-size: 13px; }
  .actions { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .panel { padding: 24px; gap: 14px; }

  .picker { margin: auto; width: 540px; max-height: 90vh; border: 1px solid var(--ink); border-radius: 4px; padding: 24px 28px 28px; box-shadow: 0 20px 50px rgba(26, 26, 26, 0.2); }
  .picker[open] { animation: dlg-in .26s var(--ease); }
  .picker.closing { animation: dlg-out .16s ease-in forwards; }
  @keyframes dlg-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
  @keyframes dlg-out { to { transform: translateY(6px) scale(.98); opacity: 0; } }
  .years { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
  .col-main, .col-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .col-side { position: sticky; top: 24px; }
  .statement { padding: 44px 48px 40px; }
  .st-head h1 { font-size: 34px; }
  .summary dd, .summary dd.big { font-size: 38px; }
  .lg-cols, .lg-row { grid-template-columns: 120px minmax(0, 1fr) 160px; }
}
@media (min-width: 1100px) {
  .page { grid-template-columns: minmax(0, 1fr) 340px; }
}

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