:root{
  --bg:#DEE1E7;
  --surface:#FFFFFF;
  --surface-2:#EEF1F6;
  --border:#DFE3EA;
  --text:#151A23;
  --text-muted:#5B6472;
  --accent:#2A56D6;
  --accent-ink:#13224D;
  --accent-soft:rgba(42,86,214,0.08);
  --good:#2F8F5B;
  --good-soft:rgba(47,143,91,0.12);
  --warn:#B34632;
  --warn-soft:rgba(179,70,50,0.12);
  --caution:#A8660D;
  --caution-soft:rgba(168,102,13,0.12);
  --inject:#7C5CBF;
  --inject-soft:rgba(124,92,191,0.10);
  --grid:#E3E7ED;
  --shadow: 0 1px 2px rgba(20,24,32,0.06), 0 8px 24px rgba(20,24,32,0.06);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0E1320;
    --surface:#161F35;
    --surface-2:#1C2743;
    --border:#293A5C;
    --text:#ECEFF5;
    --text-muted:#A3ABC2;
    --accent:#6FA8FF;
    --accent-ink:#AAC9FF;
    --accent-soft:rgba(111,168,255,0.16);
    --good:#57C793;
    --good-soft:rgba(87,199,147,0.14);
    --warn:#E1785F;
    --warn-soft:rgba(225,120,95,0.14);
    --caution:#E8B563;
    --caution-soft:rgba(232,181,99,0.16);
    --inject:#B79AEB;
    --inject-soft:rgba(183,154,235,0.16);
    --grid:#26324E;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"]{
  --bg:#0E1320;
  --surface:#161F35;
  --surface-2:#1C2743;
  --border:#293A5C;
  --text:#ECEFF5;
  --text-muted:#A3ABC2;
  --accent:#6FA8FF;
  --accent-ink:#AAC9FF;
  --accent-soft:rgba(111,168,255,0.16);
  --good:#57C793;
  --good-soft:rgba(87,199,147,0.14);
  --warn:#E1785F;
  --warn-soft:rgba(225,120,95,0.14);
  --caution:#E8B563;
  --caution-soft:rgba(232,181,99,0.16);
  --inject:#B79AEB;
  --inject-soft:rgba(183,154,235,0.16);
  --grid:#26324E;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.35);
}

*{ box-sizing:border-box; }
html{ background:var(--bg); }
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif;
  margin:0;
  padding:0 20px 80px;
}
::selection{ background:var(--accent-soft); }
a{ color:var(--accent-ink); }

.wrap{ max-width:1180px; margin:0 auto; }

/* ---------- Site header / nav ---------- */
.site-header{
  max-width:1180px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:22px 0 0;
  gap:16px; flex-wrap:wrap;
}
.site-header .brand{
  display:flex; align-items:center; gap:9px;
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800; font-size:17px;
  color:var(--text); text-decoration:none; letter-spacing:-0.01em;
}
.brand-mark{ flex:none; }
.brand-wave{ stroke:var(--accent); }
.brand-wave.dim{ opacity:.5; }
.site-nav{ display:flex; gap:22px; }
.site-nav a{
  font-size:13.5px; font-weight:700; text-decoration:none; color:var(--text-muted);
  padding:4px 0; border-bottom:2px solid transparent;
}
.site-nav a:hover{ color:var(--text); }
.site-nav a.active{ color:var(--accent-ink); border-bottom-color:var(--accent); }

header.page{ padding:40px 0 32px; }
.eyebrow{
  font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase;
  color:var(--accent-ink); margin:0 0 14px;
}
h1{
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif;
  font-weight:800;
  font-size:clamp(1.9rem, 4vw, 2.9rem);
  line-height:1.12;
  letter-spacing:-0.02em;
  margin:0 0 16px;
  text-wrap:balance;
  max-width:20ch;
}
.lede{
  font-size:16.5px; line-height:1.6; color:var(--text-muted);
  max-width:62ch; margin:0;
}
.lede b{ color:var(--text); font-weight:700; }

.grid{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:28px;
  align-items:start;
}
@media (max-width: 860px){
  .grid{ grid-template-columns:1fr; }
}

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
}

/* ---------- Inputs panel ---------- */
.inputs{
  padding:22px 22px 24px;
  position:sticky;
  top:20px;
  display:flex;
  flex-direction:column;
  gap:16px;
  max-height:calc(100vh - 40px);
  overflow-y:auto;
}
.inputs h2{
  font-family:'Manrope'; font-size:13px; font-weight:800; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-muted); margin:0 0 2px;
}
.section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-top:2px; }
.section-head h3{ font-size:13px; font-weight:800; margin:0; color:var(--text); }
.section-hint{ font-size:11.5px; color:var(--text-muted); margin:-8px 0 0; line-height:1.5; }
.field{ display:flex; flex-direction:column; gap:6px; position:relative; }
.field label{ font-size:12.5px; color:var(--text-muted); font-weight:600; }
.field .row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.field input[type="number"], .field input[type="text"]{
  width:100%;
  font-family:'IBM Plex Mono', monospace;
  font-size:14.5px;
  font-variant-numeric: tabular-nums;
  color:var(--text);
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:9px;
  padding:9px 11px;
}
.field input[type="number"]:focus, .field input[type="text"]:focus{
  outline:2px solid var(--accent);
  outline-offset:1px;
}
.prefix-wrap{ position:relative; }
.prefix-wrap span{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  color:var(--text-muted); font-family:'IBM Plex Mono', monospace; font-size:14.5px;
  pointer-events:none;
}
.inputs .prefix-wrap input{ padding-left:26px; }
.suffix-wrap{ position:relative; }
.suffix-wrap span{
  position:absolute; right:11px; top:50%; transform:translateY(-50%);
  color:var(--text-muted); font-family:'IBM Plex Mono', monospace; font-size:14.5px;
  pointer-events:none;
}
.inputs .suffix-wrap input{ padding-right:28px; }

.divider{ height:1px; background:var(--border); margin:2px 0; }

.slider-block{ display:flex; flex-direction:column; gap:8px; position:relative; }
.slider-block .top{ display:flex; justify-content:space-between; align-items:baseline; }
.slider-block label{ font-size:12.5px; color:var(--text-muted); font-weight:600; }
.slider-block .val{ font-family:'IBM Plex Mono', monospace; font-size:13px; color:var(--accent-ink); font-weight:600; }
input[type="range"]{
  -webkit-appearance:none; appearance:none;
  width:100%; height:4px; border-radius:2px;
  background:var(--border); outline:none; margin:6px 0 2px;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:16px; height:16px; border-radius:50%;
  background:var(--accent); border:2px solid var(--surface); box-shadow:0 0 0 1px var(--accent);
  cursor:pointer;
}
input[type="range"]::-moz-range-thumb{
  width:16px; height:16px; border-radius:50%;
  background:var(--accent); border:2px solid var(--surface); box-shadow:0 0 0 1px var(--accent);
  cursor:pointer; border:none;
}
.footnote{
  font-size:11.5px; line-height:1.55; color:var(--text-muted); opacity:.85; margin-top:4px;
}

/* ---------- repeatable rows (contribution changes / injections) ---------- */
.rows{ display:flex; flex-direction:column; gap:8px; }
.row-item{
  display:grid; grid-template-columns:1fr 1fr auto; gap:6px; align-items:end;
  padding:10px; background:var(--surface-2); border:1px solid var(--border); border-radius:10px;
}
.row-item .mini-field{ display:flex; flex-direction:column; gap:4px; }
.row-item .mini-field label{ font-size:10.5px; color:var(--text-muted); font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.row-item input{
  width:100%; font-family:'IBM Plex Mono', monospace; font-size:13px; font-variant-numeric: tabular-nums;
  color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:7px; padding:7px 8px;
}
.row-item input:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.row-item .offset{ font-size:10px; color:var(--text-muted); margin-top:2px; white-space:nowrap; }
.row-remove{
  width:28px; height:28px; border-radius:7px; border:1px solid var(--border); background:var(--surface);
  color:var(--warn); font-size:15px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.row-remove:hover{ background:var(--warn-soft); }
.row-add{
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:9px; border:1.5px dashed var(--border); border-radius:10px;
  background:transparent; color:var(--accent-ink); font-weight:700; font-size:12.5px;
  cursor:pointer; font-family:'Manrope';
}
.row-add:hover{ background:var(--accent-soft); border-color:var(--accent); }
.field-hint{
  font-size:11.5px; line-height:1.55; color:var(--text-muted); opacity:.85; margin:0;
}
.label-row{ display:flex; align-items:center; gap:6px; }
.info-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:50%; padding:0; margin-bottom:1px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-muted);
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800; font-size:10px;
  line-height:1; cursor:pointer; flex:none;
}
.info-btn:hover, .info-btn[aria-expanded="true"]{
  background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent);
}
.info-pop{
  margin-top:2px;
  font-size:12.5px; line-height:1.6; color:var(--text-muted);
  background:var(--surface-2); border:1px solid var(--border); border-radius:10px;
  padding:13px 15px;
}
.info-pop b{ color:var(--text); font-weight:700; }
.info-pop[hidden]{ display:none; }

.share-btn{
  display:flex; align-items:center; justify-content:center; gap:7px;
  font-family:'Manrope'; font-size:12.5px; font-weight:700;
  color:var(--accent-ink); background:var(--accent-soft);
  border:1px solid var(--border); border-radius:9px;
  padding:9px 11px; cursor:pointer; width:100%;
}
.share-btn:hover{ filter:brightness(0.97); }
.share-btn svg{ width:14px; height:14px; flex:none; }

/* ---------- Results column ---------- */
.results{ display:flex; flex-direction:column; gap:20px; }

.headline{
  padding:26px 28px;
  display:flex; flex-direction:column; gap:10px;
}
.headline .status{
  display:inline-flex; align-items:center; gap:7px; width:fit-content;
  font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  padding:5px 11px 5px 9px; border-radius:999px;
}
.headline .status.good{ background:var(--good-soft); color:var(--good); }
.headline .status.caution{ background:var(--caution-soft); color:var(--caution); }
.headline .status.warn{ background:var(--warn-soft); color:var(--warn); }
.headline .status svg{ width:13px; height:13px; }
.headline h2{
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800;
  font-size:clamp(1.3rem, 2.4vw, 1.7rem); line-height:1.22; margin:2px 0 0;
  letter-spacing:-0.01em;
  text-wrap:balance;
}
.headline p{ margin:2px 0 0; color:var(--text-muted); font-size:14.5px; line-height:1.6; max-width:100ch; }
.headline p b{ color:var(--text); font-weight:700; }

/* timeline */
.timeline-card{ padding:20px 22px; }
.timeline-card h3{ font-size:14px; font-weight:800; margin:0 0 14px; }
.timeline{ position:relative; display:flex; flex-direction:column; gap:0; }
.timeline-item{ display:grid; grid-template-columns:64px 20px 1fr; gap:2px; position:relative; min-height:40px; }
.timeline-item .t-age{ font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--text-muted); padding-top:2px; font-variant-numeric: tabular-nums; }
.timeline-item .t-rail{ position:relative; display:flex; justify-content:center; }
.timeline-item .t-rail::before{
  content:''; position:absolute; top:16px; bottom:-8px; width:1.5px; background:var(--border);
}
.timeline-item:last-child .t-rail::before{ display:none; }
.timeline-item .t-dot{
  width:9px; height:9px; border-radius:50%; margin-top:5px; z-index:1;
  background:var(--text-muted); box-shadow:0 0 0 3px var(--surface);
}
.timeline-item.type-start .t-dot{ background:var(--text-muted); }
.timeline-item.type-contrib .t-dot{ background:var(--accent); }
.timeline-item.type-inject .t-dot{ background:var(--inject); }
.timeline-item.type-retire .t-dot{ background:var(--good); }
.timeline-item .t-text{ font-size:13px; color:var(--text); padding-bottom:16px; line-height:1.5; }
.timeline-item .t-text .tag{
  display:inline-block; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em;
  padding:1px 7px; border-radius:999px; margin-left:6px; position:relative; top:-1px;
}
.tag.contrib{ background:var(--accent-soft); color:var(--accent-ink); }
.tag.inject{ background:var(--inject-soft); color:var(--inject); }
.tag.retire{ background:var(--good-soft); color:var(--good); }

/* margin note */
.note{
  display:flex; gap:12px;
  padding:16px 18px;
  background:var(--surface-2);
  border-left:3px solid var(--accent);
  border-radius:0 10px 10px 0;
  margin-top:4px;
}
.note .mark{ font-family:'Manrope'; font-weight:800; font-size:18px; color:var(--accent-ink); line-height:1.3; }
.note p{
  margin:0; font-size:13.5px; line-height:1.6; color:var(--text-muted);
  font-family:'Manrope'; font-weight:500;
}
.note p b{ color:var(--text); font-weight:700; }

/* chart card */
.chart-card{ padding:22px 22px 14px; }
.chart-card .head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:6px; flex-wrap:wrap; }
.chart-card h3{ font-size:14px; font-weight:800; letter-spacing:.03em; margin:0; }
.chart-card .sub{ font-size:12.5px; color:var(--text-muted); margin:2px 0 0; }
.chart-legend{ display:flex; gap:14px; font-size:12px; color:var(--text-muted); flex-wrap:wrap; }
.chart-legend .item{ display:flex; align-items:center; gap:6px; }
.chart-legend .swatch{ width:12px; height:12px; border-radius:3px; flex:none; }
.chart-legend .swatch.line{ width:14px; height:2px; border-radius:1px; }
.chart-legend .swatch.dot{ border-radius:50%; }

svg.chart{ width:100%; height:auto; display:block; overflow:visible; }
.tick-label{ font-family:'IBM Plex Mono', monospace; font-size:10.5px; fill:var(--text-muted); }
.grid-line{ stroke:var(--grid); stroke-width:1; }
.axis-line{ stroke:var(--border); stroke-width:1; }
.area-fill{ fill:var(--accent); opacity:0.09; }
.balance-line{ fill:none; stroke:var(--accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.balance-line.depleted-seg{ stroke:var(--warn); }
.retire-guide{ stroke:var(--text-muted); stroke-width:1; stroke-dasharray:3 3; opacity:.55; }
.retire-label{ font-family:'Manrope'; font-size:11px; font-weight:700; fill:var(--text-muted); }
.end-dot{ fill:var(--accent); stroke:var(--surface); stroke-width:2; }
.end-dot.depleted{ fill:var(--warn); }
.end-label{ font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:700; font-size:13px; fill:var(--text); }
.end-label.depleted{ fill:var(--warn); }
.inject-marker{ fill:var(--inject); stroke:var(--surface); stroke-width:2; }
.inject-label{ font-family:'IBM Plex Mono', monospace; font-weight:600; font-size:11px; fill:var(--inject); }
.contrib-marker{ fill:var(--surface); stroke:var(--accent); stroke-width:2; }
.contrib-label{ font-family:'IBM Plex Mono', monospace; font-weight:600; font-size:10.5px; fill:var(--accent-ink); }
.crosshair{ stroke:var(--text-muted); stroke-width:1; opacity:0; pointer-events:none; }
.hover-dot{ fill:var(--accent); stroke:var(--surface); stroke-width:2; opacity:0; pointer-events:none; }
.cap-overlay{ fill:transparent; cursor:crosshair; }

.tooltip{
  position:absolute; pointer-events:none; opacity:0; transition:opacity .08s ease;
  background:var(--text); color:var(--bg);
  font-family:'IBM Plex Mono', monospace; font-size:12px; line-height:1.5;
  padding:8px 10px; border-radius:8px; white-space:nowrap; transform:translate(-50%,-115%);
  z-index:5;
}
.tooltip b{ font-family:'Manrope'; font-weight:800; font-size:12.5px; }
.tooltip .tt-tag{ display:block; font-size:11px; opacity:.8; margin-top:2px; }
.chart-wrap{ position:relative; }

/* stat tiles */
.stats{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:1px;
  background:var(--border);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  box-shadow:var(--shadow);
}
@media (max-width:760px){ .stats{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .stats{ grid-template-columns:1fr; } }
.stat{
  background:var(--surface);
  padding:18px 18px 16px;
  display:flex; flex-direction:column; gap:6px;
}
.stat .label{ font-size:11.5px; color:var(--text-muted); font-weight:700; letter-spacing:.02em; }
.stat .value{
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800; font-size:21px; color:var(--text);
  letter-spacing:-0.01em;
}
.stat .sub{ font-size:11.5px; color:var(--text-muted); }
.stat.accent .value{ color:var(--accent-ink); }
.stat.inject .value{ color:var(--inject); }
.stat.caution .value{ color:var(--caution); }
.stat.warn .value{ color:var(--warn); }

/* table */
.table-card{ padding:20px 22px 22px; }
.table-card h3{ font-size:14px; font-weight:800; margin:0 0 2px; }
.table-card .sub{ font-size:12.5px; color:var(--text-muted); margin:0 0 14px; }
.table-scroll{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; min-width:620px; }
thead th{
  text-align:right; font-size:11px; letter-spacing:.05em; text-transform:uppercase;
  color:var(--text-muted); font-weight:700; padding:0 10px 8px; border-bottom:1px solid var(--border);
}
thead th:first-child{ text-align:left; }
tbody td{
  text-align:right; font-family:'IBM Plex Mono', monospace; font-size:13px;
  font-variant-numeric: tabular-nums;
  padding:9px 10px; border-bottom:1px solid var(--border); color:var(--text);
}
tbody td:first-child{ text-align:left; font-family:'Manrope'; font-weight:700; color:var(--text); }
tbody tr:last-child td{ border-bottom:none; }
tbody tr.milestone td{ background:var(--accent-soft); }
tbody tr.event-row td{ background:var(--inject-soft); }
.pos{ color:var(--good); }
.neg{ color:var(--warn); }
.evt-note{ font-size:11px; color:var(--inject); font-weight:700; }

footer.legal{
  margin-top:28px; font-size:11.5px; line-height:1.6; color:var(--text-muted); opacity:.8;
  max-width:80ch;
}

.site-footer{
  max-width:1180px; margin:56px auto 0;
  padding-top:22px; border-top:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px;
}
.site-footer nav{ display:flex; gap:18px; }
.site-footer nav a{ font-size:12.5px; font-weight:700; color:var(--text-muted); text-decoration:none; }
.site-footer nav a:hover{ color:var(--text); }
.site-footer .copy{ font-size:12px; color:var(--text-muted); }

/* ---------- Simple prose pages (About / FAQ) ---------- */
.prose-card{ padding:36px 40px 44px; max-width:78ch; }
@media (max-width:640px){ .prose-card{ padding:26px 22px 32px; } }
.prose h2{
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800; font-size:1.3rem;
  margin:34px 0 10px; line-height:1.3; letter-spacing:-0.01em;
}
.prose h2:first-child{ margin-top:0; }
.prose h3{
  font-family:'Manrope'; font-weight:800; font-size:15px; margin:26px 0 8px;
}
.prose p{ font-size:15.5px; line-height:1.7; color:var(--text-muted); margin:0 0 14px; }
.prose p b, .prose li b{ color:var(--text); font-weight:700; }
.prose ul{ margin:0 0 16px; padding-left:22px; }
.prose li{ font-size:15.5px; line-height:1.7; color:var(--text-muted); margin-bottom:8px; }
.prose a{ color:var(--accent-ink); font-weight:600; }
.prose .callout{
  background:var(--surface-2); border-left:3px solid var(--accent);
  border-radius:0 10px 10px 0; padding:14px 18px; margin:20px 0;
  font-size:14px; line-height:1.65; color:var(--text-muted);
}
.faq-item{ border-bottom:1px solid var(--border); padding:22px 0; }
.faq-item:first-of-type{ padding-top:0; }
.faq-item:last-of-type{ border-bottom:none; }
.faq-item h2{ font-size:1.05rem; margin:0 0 8px; }
.faq-item p{ margin:0; }
.author-row{ display:flex; align-items:center; gap:12px; margin:-2px 0 14px; }
.author-avatar{
  width:40px; height:40px; border-radius:50%; flex:none;
  background:var(--accent-soft); color:var(--accent-ink);
  font-family:'Manrope', ui-sans-serif, system-ui, sans-serif; font-weight:800; font-size:16px;
  display:flex; align-items:center; justify-content:center;
}
.author-meta{ display:flex; flex-direction:column; line-height:1.35; }
.author-meta b{ font-size:14.5px; color:var(--text); }
.author-meta span{ font-size:12.5px; color:var(--text-muted); }

.cta-row{ margin-top:8px; }
.cta-row .cta-btn{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'Manrope'; font-weight:700; font-size:14px;
  color:#fff; background:var(--accent-ink);
  border-radius:10px; padding:11px 18px; text-decoration:none;
}
