@font-face {
  font-family: Geist;
  src: url('fonts/geist-latin.9b6f5ff4.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8fafc;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --control: #94a3b8;
  --card: #fff;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --gain: #15803d;
  --loss: #b91c1c;
  font: 16px/1.5 Geist, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.shell { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 3.75rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar a { text-decoration: none; }
.topbar a:last-child { color: var(--muted); font-size: .875rem; }
.topbar a:hover { color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.125rem; font-weight: 650; letter-spacing: -.035em; }
.brand-mark { color: var(--accent); font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
.intro { padding-block: clamp(2.25rem, 6vw, 4rem) 2rem; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.65rem); font-weight: 650; line-height: 1.07; letter-spacing: -.055em; text-wrap: balance; }
h1 span { color: var(--accent); }
.intro p { margin-top: .75rem; color: var(--muted); }

.workspace { display: grid; grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.card h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; }
.inputs { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .875rem; font-weight: 600; }
.optional { margin-inline-start: .35rem; font-size: .75rem; color: var(--muted); font-weight: 450; }
.input-box { display: flex; align-items: center; min-height: 2.75rem; background: var(--paper); border: 1px solid var(--control); border-radius: .5rem; }
.input-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-box:has([aria-invalid='true']) { border-color: var(--loss); }
.input-box input { appearance: textfield; min-width: 0; flex: 1; padding: .55rem .7rem; border: 0; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; outline: none; }
.input-box input::-webkit-inner-spin-button, .input-box input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-box input::placeholder { color: var(--muted); opacity: 1; }
.prefix, .suffix { color: var(--muted); font-size: .875rem; }
.prefix { padding-inline-start: .7rem; }
.suffix { padding-inline-end: .7rem; }
.prefix + input { padding-inline-start: .4rem; }
.inflation-field { border-top: 1px solid var(--line); padding-top: 1rem; }
.hint, .error, .notice, .assumptions { font-size: .8125rem; }
.hint, .assumptions { color: var(--muted); }
.error { color: var(--loss); }
.notice { color: var(--muted); }
noscript .notice { margin-bottom: 1rem; }

.results { display: grid; gap: 1.25rem; }
.summary { background: linear-gradient(115deg, var(--card) 55%, var(--accent-soft)); }
.balance { margin-top: .25rem; color: var(--accent); font-size: clamp(2rem, 5vw, 3.35rem); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.12; letter-spacing: -.05em; overflow-wrap: anywhere; }
.balance + .hint { margin-top: .25rem; }
.breakdown { display: flex; flex-wrap: wrap; gap: .85rem 1.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.breakdown > div { flex: 1 1 8rem; min-width: 0; }
.breakdown dt { color: var(--muted); font-size: .8125rem; }
.breakdown dd { font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.positive { color: var(--gain); }
.negative { color: var(--loss); }

.chart-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: 0; list-style: none; font-size: .75rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: .35rem; }
.legend li::before { content: ''; width: .9rem; border-top: 2px solid var(--accent); }
.legend li + li::before { border-top: 2px dashed #64748b; }
#growth-chart { display: block; width: 100%; height: clamp(13rem, 33vw, 18rem); margin-top: .75rem; }
.annual { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .65rem; }
.annual summary { color: var(--accent); font-size: .875rem; font-weight: 600; cursor: pointer; padding: .2rem 0; }
.table-scroll { overflow-x: auto; margin-top: .5rem; }
table { width: 100%; border-collapse: collapse; font-size: .8125rem; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .3rem; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child { text-align: left; }
thead th { color: var(--muted); }
tbody th { font-weight: 550; }
.assumptions { max-width: 68ch; padding-block: 1.25rem; }
footer { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; border-top: 1px solid var(--line); padding-block: 1rem 1.75rem; font-size: .8125rem; color: var(--muted); }
footer a { text-underline-offset: .15em; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 46rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .shell { width: calc(100% - 2rem); }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 25rem) {
  .breakdown { gap: .65rem; }
  .breakdown > div { flex-basis: 6.8rem; }
}
