:root {
  --paper: #f7f5ef;
  --ink: #17201d;
  --muted: #5f6965;
  --line: #d8ddd8;
  --card: #fffefa;
  --green: #116149;
  --green-soft: #e1efe8;
  --gold: #cf8c21;
  --red: #a9362d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
a { color: var(--green); text-underline-offset: 3px; }
a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.site-header, footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header { min-height: 72px; border-bottom: 1px solid var(--line); }
.site-header nav, footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-header nav a, footer nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.brand { color: var(--ink); font-size: 19px; font-weight: 850; text-decoration: none; letter-spacing: -.04em; }
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 64px 0 72px; max-width: 850px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 12px 0 20px; font-size: clamp(38px, 7vw, 76px); line-height: 1.03; letter-spacing: -.065em; }
h2 { line-height: 1.15; letter-spacing: -.035em; }
.lead { max-width: 720px; color: var(--muted); font-size: clamp(18px, 2.5vw, 23px); }
.hero-tagline { margin: -8px 0 12px; color: var(--ink); font-size: clamp(20px, 2.4vw, 24px); font-weight: 850; line-height: 1.1; letter-spacing: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 32px; }
.button { display: inline-block; padding: 13px 20px; border-radius: 8px; background: var(--green); color: white; font-weight: 750; text-decoration: none; }
.text-link { font-weight: 700; }
.feature-grid, .results, .article-grid { display: grid; gap: 18px; }
.feature-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 72px; }
.feature-grid article, .article-grid section, .article-grid aside {
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 24px;
}
.feature-grid strong { font-size: 18px; }
.feature-grid p { color: var(--muted); }
.calculator-page { max-width: 1120px; margin: 0 auto; padding: 48px 0 72px; }
.article h1 { font-size: clamp(36px, 6vw, 62px); }
.calculator-page h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 10px 0 12px; }
.calculator-page > .lead { margin: 0; }
.calculator-card { margin-top: 28px; padding: clamp(18px, 3.5vw, 36px); border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 24px 70px rgba(23, 32, 29, .1); }
.calculator-card h2 { margin: 12px 0 0; font-size: clamp(24px, 3vw, 32px); }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0; padding: 18px; border: 1px solid #e0ddd3; border-radius: 14px; background: #f5f3ed; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
.money-input { margin-top: 7px; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px solid #ccd3ce; border-radius: 9px; background: white; color: var(--muted); font-size: 17px; box-shadow: 0 1px 2px rgba(23, 32, 29, .04); }
.money-input:focus-within { border-color: var(--green); outline: 3px solid var(--green-soft); }
input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.select-input { margin-top: 7px; display: flex; min-height: 48px; padding: 10px 12px; border: 1px solid #ccd3ce; border-radius: 9px; background: white; box-shadow: 0 1px 2px rgba(23, 32, 29, .04); }
.select-input:focus-within { border-color: var(--green); outline: 3px solid var(--green-soft); }
select { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.results { grid-template-columns: repeat(2, 1fr); padding-top: 24px; border-top: 1px solid var(--line); }
.results div:not(.zone-badge) { min-height: 112px; padding: 18px; border: 1px solid #c8ded3; border-radius: 12px; background: var(--green-soft); }
.results div:not(.zone-badge):nth-of-type(n+4) { border-color: #e0ddd3; background: #f5f3ed; }
.results span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.results strong { display: block; margin-top: 8px; font-size: clamp(22px, 3vw, 30px); line-height: 1.1; }
.fine-print { margin-bottom: 0; color: var(--muted); font-size: 12px; }

/* slider */
.slider-label { display: flex; flex-direction: column; }
.slider-wrap { margin-top: 7px; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 1px solid #ccd3ce; border-radius: 9px; background: white; box-shadow: 0 1px 2px rgba(23, 32, 29, .04); }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--green); cursor: pointer; }
.slider-value { white-space: nowrap; font-size: 17px; color: var(--ink); font-weight: 700; min-width: 44px; }

/* zone badge */
.zone-badge { display: none; grid-column: 1 / -1; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.zone-badge:not(:empty) { display: flex; }
.zone-badge strong { font-size: 15px; letter-spacing: .04em; }
.zone-badge span { color: inherit; opacity: .85; }
.zone-heavy { background: #fdecea; color: #8c2a23; border: 1px solid #f0b3ae; }
.zone-even  { background: #fff8e7; color: #5a430a; border: 1px solid #e6d18a; }
.zone-easy  { background: var(--green-soft); color: var(--green); border: 1px solid #b3d9c5; }
.result-disclosure { margin-top: 24px; padding: 16px 18px; border: 1px solid #d8c79e; border-radius: 9px; background: #fff8e7; color: #584b2e; font-size: 13px; }
.result-disclosure p { margin: 6px 0 0; }
.comparison { margin-top: 28px; padding: 22px; border: 1px solid #e0ddd3; border-radius: 14px; background: #f5f3ed; }
.breakdown-eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.breakdown-title { margin: 0 0 16px; font-size: clamp(16px, 2vw, 20px); font-weight: 700; letter-spacing: -.02em; }
.milestones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.milestone-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.milestone-card > span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.milestone-card > strong { display: block; margin: 4px 0 2px; font-size: 20px; letter-spacing: -.03em; }
.milestone-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.chart-wrap { height: 240px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
#balance-chart { width: 100%; height: 100%; overflow: visible; }
#balance-chart path { fill: none; vector-effect: non-scaling-stroke; }
.bar-principal { fill: var(--green); opacity: .75; }
.bar-interest { fill: var(--gold); opacity: .75; }
.chart-grid { stroke: #e5e7e3; stroke-width: .5; }
.chart-balance { stroke: #3a4a46; stroke-width: 2; }
.chart-extra-balance { stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 3 2; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.principal-dot { background: var(--green); }
.interest-dot { background: var(--gold); }
.balance-dot { background: #3a4a46; border-radius: 50%; }
.extra-impact { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.extra-impact div { min-height: 72px; padding: 14px 16px; border: 1px solid #c8ded3; border-radius: 9px; background: var(--green-soft); }
.extra-impact span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.extra-impact strong { display: block; margin-top: 4px; font-size: 20px; }
.error { padding: 12px; border-left: 3px solid var(--red); background: #f6e6e4; color: var(--red); }
.trust-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; font-size: 14px; font-weight: 700; }
.article { max-width: 980px; margin: 0 auto; padding: 64px 0 80px; }
.article-grid { grid-template-columns: 1fr 1fr; margin-top: 42px; }
.article-grid aside { border-left: 4px solid var(--gold); }
.article-grid p { color: var(--muted); }
footer { margin-top: 40px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-copy p { margin: 0; }
.footer-independence { white-space: nowrap; }

/* compact calculator workflow */
.calculator-page { padding: 8px 0 56px; }
.calculator-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 18px; margin-bottom: 8px; }
.calculator-heading .eyebrow { width: 100%; margin: 0; }
.calculator-heading h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); }
.calculator-subtitle { width: 100%; margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.35; }
.answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; min-height: 74px; margin-bottom: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.step-label { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.answer-row h2 { margin: 2px 0 0; font-size: clamp(19px, 2.3vw, 28px); }
.result-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding-top: 9px; border-top: 1px solid var(--line); }
.result-metrics div { min-width: 0; }
.result-metrics span, .result-metrics strong { display: block; }
.result-metrics span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.result-metrics strong { margin-top: 1px; font-size: 14px; line-height: 1.2; }
.workspace { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(0, 1.4fr); min-height: 440px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: 0 18px 55px rgba(23, 32, 29, .08); }
.controls-panel, .visual-panel { padding: 14px; }
.controls-panel { border-right: 1px solid var(--line); background: #f5f3ed; }
.visual-panel { display: flex; flex-direction: column; min-width: 0; }
.method-picker { margin: 0 0 10px; padding: 0; border: 0; }
.method-picker legend, .input-section h2 { margin: 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.method-picker > p { margin: 0 0 6px; color: var(--muted); font-size: 10px; }
.method-picker label { display: flex; align-items: flex-start; gap: 7px; margin-top: 5px; padding: 7px 8px; border: 1px solid #d7dcd7; border-radius: 8px; background: white; cursor: pointer; }
.method-picker label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.method-picker input { width: auto; margin-top: 3px; accent-color: var(--green); }
.method-picker strong, .method-picker small { display: block; }
.method-picker strong { color: var(--ink); font-size: 11px; }
.method-picker small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.25; }
.compact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 5px; }
.compact-fields label:last-child { grid-column: 1 / -1; }
.compact-fields label, .slider-label { font-size: 10px; }
.compact-fields small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; line-height: 1.25; }
.compact-fields .money-input, .slider-wrap { min-height: 34px; margin-top: 3px; padding: 4px 8px; font-size: 13px; }
.compact-fields input { font-size: 13px; }
.slider-label { margin-top: 7px; }
.slider-label small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }
.extra-notice { margin: 5px 0 0; padding: 6px 8px; border-left: 2px solid var(--gold); background: #fff8e7; color: #584b2e; font-size: 8px; font-weight: 650; line-height: 1.35; }
.extra-notice[hidden] { display: none; }
.slider-wrap { padding: 0 8px; }
.slider-value { font-size: 12px; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 8px; }
.chart-help { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.chart-controls { display: flex; align-items: center; gap: 8px; }
.chart-toggle, .period-toggle { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #f5f3ed; }
.period-toggle[hidden] { display: none; }
.chart-toggle button, .period-toggle button { padding: 5px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.chart-toggle button.active, .period-toggle button.active { background: white; color: var(--ink); box-shadow: 0 1px 3px rgba(23, 32, 29, .12); }
.period-toggle button { padding-inline: 8px; font-size: 9px; }
.chart-wrap { position: relative; flex: none; height: 310px; min-height: 0; padding: 10px; }
.chart-endpoint-grid { stroke-width: .5; stroke-dasharray: 2 2; }
.chart-active-grid { stroke: #c8ded3; }
.chart-baseline-grid { stroke: #d8ddd8; }
.chart-axis-label { fill: var(--muted); font-size: 2.8px; font-weight: 700; }
.chart-endpoint { stroke: white; stroke-width: .6; }
.chart-active-endpoint { fill: var(--green); }
.chart-baseline-endpoint { fill: #89928e; }
.chart-baseline { stroke: #89928e; stroke-width: 1.7; stroke-dasharray: 4 3; }
.chart-active { stroke: var(--green); stroke-width: 2.6; }
.bar-principal { fill: var(--green); opacity: .82; }
.bar-interest { fill: #dc715f; opacity: .86; }
.chart-bar { outline: none; cursor: pointer; }
.chart-bar:focus .bar-principal, .chart-bar:hover .bar-principal { fill: #0b4f3a; opacity: 1; }
.chart-bar:focus .bar-interest, .chart-bar:hover .bar-interest { fill: #c45343; opacity: 1; }
.chart-tooltip { position: absolute; z-index: 2; display: grid; gap: 1px; min-width: 132px; padding: 7px 9px; border: 1px solid #c9d0cc; border-radius: 7px; background: rgba(255, 254, 250, .97); color: var(--ink); box-shadow: 0 5px 18px rgba(23, 32, 29, .16); pointer-events: none; font-size: 9px; line-height: 1.35; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { font-size: 10px; }
.chart-tooltip span { color: var(--muted); }
.baseline-dot { background: #89928e; }
.active-dot { background: var(--green); border-radius: 50%; }
.visual-panel .legend { margin: 0; }
.visual-panel .legend b { margin-left: 3px; color: var(--ink); }
.zone-timeline { display: flex; gap: 2px; height: 9px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--line); }
.zone-legend { margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.zone-legend + .zone-timeline { margin-top: 3px; }
.zone-segment { min-width: 2px; }
.zone-segment.zone-heavy { background: #d85b50; border: 0; }
.zone-segment.zone-even { background: #d8ab45; border: 0; }
.zone-segment.zone-easy { background: #4b9b79; border: 0; }
.zone-summary { min-height: 18px; margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.answer-row .zone-badge { display: grid; grid-column: auto; grid-template-columns: 1fr; justify-items: start; gap: 1px; width: 172px; padding: 8px 12px; }
.answer-row .zone-badge > span { font-size: 9px; white-space: nowrap; }
.answer-row .zone-badge > strong { margin: 0; font-size: 15px; line-height: 1.15; white-space: nowrap; }
.answer-row .zone-badge > small { font-size: 9px; white-space: nowrap; }
.below-workspace > * { width: 100%; }
.scope-note { margin-top: 22px; padding: 14px 16px; border-left: 3px solid #4b9b79; background: #f1f7f3; font-size: 13px; }
.scope-note p { margin: 3px 0 0; color: var(--muted); }
.below-workspace .trust-links { justify-content: center; }

@media (min-width: 900px) {
  .calculator-card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "title"
      "fields"
      "error"
      "results"
      "comparison"
      "disclosure";
    row-gap: 20px;
    align-items: start;
  }
  .calculator-card h2 { grid-area: title; margin: 0; }
  .calculator-card .fields { grid-area: fields; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-card #error { grid-area: error; }
  .calculator-card .results { grid-area: results; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-card .comparison { grid-area: comparison; }
  .calculator-card .result-disclosure { grid-area: disclosure; margin-top: 0; }
}

@media (min-width: 1080px) {
  .calculator-card .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calculator-card .results { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding: 18px 0; }
  .site-header nav { justify-content: flex-end; gap: 8px 14px; }
  .feature-grid, .fields, .results, .article-grid, .comparison-head { grid-template-columns: 1fr; }
  .fields, .comparison { padding: 14px; }
  .milestones, .extra-impact { grid-template-columns: 1fr; }
  .hero { padding-top: 64px; }
  footer { align-items: flex-start; flex-direction: column; }
  .footer-independence { white-space: normal; }
  .answer-row, .workspace { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace { height: auto; }
  .answer-row .zone-badge { width: 100%; }
  .controls-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .chart-wrap { min-height: 250px; }
}
