:root {
  color-scheme: light dark;
  --brand: #2E7D5B; --brand-ink: #FFFFFF; --text: #1B1F1D; --muted: #4A524E; --bg: #FFFFFF; --surface: #F3F7F5; --line: #D5DBD8;
  --invested: #2E7D5B; --interest: #E0A526; --scenario-b: #3B6FD8; --scenario-c: #B4479B; --negative: #C62828; --positive: #2E7D5B;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7CC9A2; --brand-ink: #0D1F16; --text: #E6EAE8; --muted: #B4BCB8; --bg: #121513; --surface: #1B201D; --line: #3A413D;
    --invested: #7CC9A2; --interest: #F2C15B; --scenario-b: #8DB0F5; --scenario-c: #E59AD3; --negative: #FF8A80; --positive: #7CC9A2;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 880px; margin: 0 auto; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
main { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; }
article { max-width: 720px; }
h1 { color: var(--brand); font-size: 1.9rem; line-height: 1.2; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.3rem; margin-top: 2.25rem; line-height: 1.3; }
h3 { font-size: 1.05rem; margin-top: 1.5rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.crumbs { font-size: 0.9rem; }
.note, footer { color: var(--muted); font-size: 0.9rem; }
footer { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 1.5rem 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.combo { display: flex; gap: 6px; }
.combo input { flex: 1; min-width: 0; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.combo select { width: auto; }
input:focus-visible, select:focus-visible, summary:focus-visible, .button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--negative); }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; color: var(--brand); }
details .fields { margin-top: 12px; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 1.5rem 0 1rem; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card span { display: block; color: var(--muted); font-size: 0.85rem; }
.card strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.card.main strong { color: var(--brand); font-size: 1.6rem; }
.card.alert strong { color: var(--negative); }
.message { border-left: 4px solid var(--brand); background: var(--bg); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.message.alert { border-color: var(--negative); }
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-top: 16px; }
.donut { max-width: 220px; margin: 0 auto; }
@media (max-width: 700px) { .charts { grid-template-columns: minmax(0, 1fr); } }
figure { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; position: relative; }
figcaption { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: var(--muted); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { opacity: 0.35; }
.chart .hit { fill: transparent; }
.chart .track { fill: none; stroke: var(--line); }
.chart .ring { fill: none; }
.tone-invested { stroke: var(--invested); fill: var(--invested); }
.tone-interest { stroke: var(--interest); fill: var(--interest); }
.tone-a { stroke: var(--invested); }
.tone-b { stroke: var(--scenario-b); }
.tone-c { stroke: var(--scenario-c); }
.bar.tone-positive { fill: var(--positive); }
.bar.tone-negative { fill: var(--negative); }
.ring.tone-invested, .ring.tone-interest { fill: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--swatch); }
.swatch-invested { --swatch: var(--invested); }
.swatch-interest { --swatch: var(--interest); }
.swatch-a { --swatch: var(--invested); }
.swatch-b { --swatch: var(--scenario-b); }
.swatch-c { --swatch: var(--scenario-c); }
.swatch-negative { --swatch: var(--negative); }
.donut-center { text-align: center; margin-top: -4px; font-size: 0.9rem; color: var(--muted); }
.tip { position: absolute; top: 34px; transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 0.8rem; display: grid; pointer-events: none; white-space: nowrap; z-index: 1; }
.tip[hidden] { display: none; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td.negative { color: var(--negative); font-weight: 600; }
.cta { background: var(--brand); color: var(--brand-ink); border-radius: 16px; padding: 20px; margin-top: 2.5rem; }
.cta h2 { margin-top: 0; }
.cta .button { display: inline-block; background: var(--brand-ink); color: var(--brand); font-weight: 700; padding: 10px 18px; border-radius: 999px; text-decoration: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; list-style: none; padding: 0; }
.cards li { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
.cards a { font-weight: 700; font-size: 1.05rem; }
.cards p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }
.download { display: inline-block; background: var(--brand); color: var(--brand-ink); font-weight: 700; padding: 12px 20px; border-radius: 999px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
