:root {
  color-scheme: light;
  --background: #f7f8f3;
  --white: #fff;
  --ink: #1b3027;
  --muted: #506359;
  --line: #e1e8df;
  --green: #235740;
  --dark-green: #163d30;
  --lime: #e0efb9;
  --warm: #926022;
  --shadow: 0 3px 10px #163d3006;
  --sans: Inter, "Avenir Next", Avenir, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
input, button { font: inherit; }
button, summary { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid #3c7f60; outline-offset: 4px; }
.shell { width: min(1216px, calc(100% - 80px)); margin-inline: auto; }

.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.mast-inner { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.brand { display: inline-flex; align-items: center; font-size: 22px; font-weight: 760; letter-spacing: -.065em; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--dark-green); color: var(--lime); margin-right: 9px; }
.brand-period { color: #4f805c; }
.guide-link { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 660; color: var(--muted); padding: 8px 0; }
.guide-link:hover, footer a:hover { color: var(--green); text-decoration: underline; }

.hero { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(105deg, #e7f0e5, #ecf0d7); border: 1px solid #dbe7d9; border-radius: 24px; margin: 30px 0 30px; min-height: 267px; display: flex; align-items: center; }
.hero-copy { position: relative; padding: 29px 42px 33px; width: 61%; }
.eyebrow { font-size: 10px; line-height: 1.4; font-weight: 790; letter-spacing: .15em; color: #386249; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #447650; box-shadow: 0 0 0 3px #49734b23; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(43px, 5.5vw, 76px); letter-spacing: -.064em; line-height: .99; margin: 10px 0 13px; }
.hero h1 span { color: #4c8158; }
.hero-copy > p:last-child { max-width: 390px; color: #40594a; font-size: 14px; line-height: 1.55; }
.horizon-art { position: absolute; inset: 0 0 0 auto; width: 56%; height: 100%; z-index: -1; mask-image: linear-gradient(90deg, transparent, black 16%); }

.workspace { display: grid; grid-template-columns: minmax(280px, .93fr) minmax(0, 2.53fr); align-items: start; gap: 23px; }
.panel { border: 1px solid var(--line); background: var(--white); border-radius: 17px; box-shadow: var(--shadow); }
.settings { padding: 19px 20px 17px; }
.panel-heading { display: flex; gap: 11px; align-items: center; min-width: 0; }
.section-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; color: #316347; background: #eaf2e8; }
.panel-heading h2, .panel-heading h3 { font-size: 16px; font-weight: 740; letter-spacing: -.03em; line-height: 1.25; }
.panel-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; }
fieldset { border: 0; padding: 0; min-width: 0; margin: 15px 0 0; }
legend { padding: 12px 0 0; width: 100%; border-top: 1px solid var(--line); font-size: 12px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
legend span { font-size: 9px; letter-spacing: .04em; font-weight: 760; color: #3e684c; border-radius: 5px; background: #edf4eb; padding: 3px 5px; }
.group-fields { display: grid; gap: 10px; padding-top: 9px; }
.age-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.field { min-width: 0; }
.field label { display: block; font-size: 11.5px; font-weight: 650; margin-bottom: 5px; }
.input-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; border: 1px solid #dbe4da; border-radius: 8px; background: #fafbf8; padding: 0 9px; }
.input-wrap:focus-within { background: #fff; border-color: #548364; box-shadow: 0 0 0 2px #739c7d30; }
.input-wrap.invalid { border-color: #a74c39; }
.input-wrap input { width: 100%; min-width: 0; min-height: 37px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.unit { color: var(--muted); font-weight: 600; font-size: 11px; white-space: nowrap; }
.field small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 5px; }
.field small.error { color: #943d2b; }
.reset { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; background: #f2f5ef; color: #315c43; border: 1px solid #e5ece2; border-radius: 8px; min-height: 38px; margin-top: 16px; font-size: 12px; font-weight: 700; }
.reset:hover { background: #e8f0e5; }

.results { min-width: 0; display: grid; gap: 14px; }
.results-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 1px 0 1px; }
.results-heading h2 { font-size: clamp(21px, 2.35vw, 31px); font-weight: 745; letter-spacing: -.06em; line-height: 1.12; margin-top: 5px; }
.period { display: inline-flex; align-items: center; gap: 6px; background: #eaf0e5; border: 1px solid #e0e9da; border-radius: 999px; padding: 6px 10px; color: #3b5d45; font-weight: 700; font-size: 11px; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.metric { position: relative; isolation: isolate; overflow: hidden; min-width: 0; border: 1px solid transparent; padding: 16px 18px 17px; border-radius: 16px; }
.metric.nominal { background: linear-gradient(120deg, #173e30 25%, #22563e 100%); color: #fafff5; }
.metric.nominal::after { content: ""; position: absolute; z-index: -1; right: -35px; bottom: -82px; width: 200px; height: 200px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 8px, #dcebb629 8.5px 9px); mask-image: linear-gradient(90deg, transparent, black); }
.metric.real { background: #e9f0d9; border-color: #dce7cc; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 670; }
.nominal .metric-label { color: #e2edcf; }
.real .metric-label { color: #3e5f41; }
.metric strong { display: block; margin: 9px 0 4px; font-size: clamp(19px, 2.5vw, 36px); font-weight: 720; letter-spacing: -.065em; line-height: 1.12; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric p { font-size: 11px; line-height: 1.4; color: var(--muted); }
.nominal p { color: #d3e0d2; }
.real p { color: #465a40; }

.chart-card { padding: 17px 18px 13px; }
.chart-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; font-size: 11px; font-weight: 620; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 17px; border-top: 2px solid #2b7150; border-radius: 3px; }
.chart-legend span:last-child i { border-top: 2px dashed #a56e2d; }
.chart-frame { position: relative; margin-top: 10px; }
.chart { display: block; overflow: visible; touch-action: pan-y; }
.chart text { font-family: var(--sans); font-size: 10px; fill: #53675b; }
.grid-tick line { stroke: #e7ede5; stroke-dasharray: 4 4; }
.nominal-line, .real-line { fill: none; stroke-width: 2.7; stroke-linejoin: round; stroke-linecap: round; }
.nominal-line { stroke: #2c7250; }
.real-line { stroke: #a46d2c; stroke-dasharray: 6 4; }
.nominal-dot, .real-dot { stroke: white; stroke-width: 1.6; }
.nominal-dot { fill: #2c7250; }
.real-dot { fill: #a46d2c; }
.tooltip { position: absolute; top: 18px; pointer-events: none; display: grid; gap: 6px; width: 208px; padding: 11px; background: #fff; border: 1px solid #dce6dc; border-radius: 10px; box-shadow: 0 5px 20px #234d3c19; font-size: 10px; overflow-wrap: anywhere; }
.tooltip > b { font-size: 12px; }
.tooltip span { display: flex; justify-content: space-between; gap: 7px; }
.tooltip strong { text-align: right; }
.insight { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: #f3f5ed; border-radius: 8px; color: #415b48; }
.insight svg { flex-shrink: 0; color: #587744; }
.insight p { font-size: 12px; line-height: 1.45; }

.breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 5px; }
.breakdown div { padding: 2px 13px; border-left: 1px solid var(--line); }
.breakdown div:first-child { border: 0; }
.breakdown span { display: block; font-size: 11px; color: var(--muted); }
.breakdown strong { display: block; margin-top: 4px; font-size: 15px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.year-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; padding: 12px 17px; font-size: 13px; font-weight: 730; border-radius: 17px; }
.year-details summary::-webkit-details-marker { display: none; }
.year-details summary:hover { background: #f6f9f4; }
.year-details[open] summary svg { transform: rotate(180deg); }
.table-scroll { max-height: 325px; overflow: auto; margin: 0 11px 11px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: right; padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: #edf3ea; }
tbody small { color: var(--muted); }
.empty { display: grid; justify-items: start; gap: 9px; padding: 26px; }
.empty p { color: var(--muted); font-size: 14px; }

.method { margin-top: 29px; padding: 20px 23px; border-radius: 17px; border: 1px solid #e0e8dc; background: #eef3eb; scroll-margin-top: 20px; }
.method-heading { display: flex; align-items: center; gap: 8px; color: #335e44; }
.method h2 { font-size: 16px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 13px; }
.method h3 { font-size: 12px; margin-bottom: 4px; }
.method-grid p, .fine-print { font-size: 12px; color: var(--muted); line-height: 1.52; }
.fine-print { margin-top: 14px; padding-top: 11px; border-top: 1px solid #dce6d9; }
footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-top: 15px; padding: 10px 0 23px; font-size: 12px; }
footer > span { font-size: 15px; font-weight: 750; letter-spacing: -.05em; }
footer a { display: flex; align-items: center; gap: 6px; }

@media (max-width: 1040px) {
  .shell { width: calc(100% - 48px); }
  .workspace { gap: 17px; grid-template-columns: 265px minmax(0, 1fr); }
  .settings { padding-inline: 15px; }
  .results-heading { flex-wrap: wrap; align-items: flex-start; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 34px); }
  .mast-inner { height: 59px; }
  .hero { margin: 19px 0; min-height: 230px; border-radius: 18px; }
  .hero-copy { padding: 23px; width: 74%; }
  .hero h1 { font-size: clamp(39px, 8vw, 61px); }
  .horizon-art { width: 60%; opacity: .7; mask-image: linear-gradient(90deg, transparent, black 38%); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .settings { padding: 17px; }
  .results-heading h2 { font-size: clamp(22px, 5.9vw, 30px); }
  .metric strong { font-size: clamp(17px, 4vw, 29px); }
  .method-grid { grid-template-columns: 1fr; gap: 11px; }
}

@media (max-width: 420px) {
  .hero-copy { width: 93%; padding: 20px 15px; }
  .hero-copy > p:last-child { max-width: 225px; font-size: 13px; }
  .horizon-art { width: 64%; opacity: .49; }
  .metrics { gap: 8px; }
  .metric { padding: 12px 10px; }
  .metric-label { font-size: 11px; gap: 5px; }
  .metric-label svg { width: 14px; }
  .chart-card { padding-inline: 10px; }
  .breakdown { grid-template-columns: 1fr; padding: 5px 12px; }
  .breakdown div { border-left: 0; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; }
  .breakdown strong { margin-top: 0; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

[hidden] { display: none !important; }
[data-icon] { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-icon[data-icon], .section-icon[data-icon] { display: grid; }
.insight > [data-icon] { align-self: flex-start; }
.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: 420px) {
  .mast-inner { gap: 12px; }
  .brand { font-size: 20px; }
  .guide-link { font-size: 11px; white-space: nowrap; }
}

@media (max-width: 365px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { padding: 13px 14px; }
  .metric strong { font-size: 23px; }
}
