:root {
  --ink: #14201a;
  --muted: #617068;
  --brand: #2f6f4e;
  --brand-dark: #1f4d36;
  --blue: #2d6f8f;
  --paper: #f5f6f2;
  --panel: #ffffff;
  --line: #d8dfda;
  --message-paper: #f2f1df;
  --message-border: #cbd2ae;
  --shadow: 0 18px 50px rgba(27, 51, 38, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: .75rem 1rem; background: #fff; z-index: 30; }
.skip-link:focus { left: 1rem; }
.site-header { min-height: 70px; padding: .65rem clamp(1rem, 4vw, 3rem); background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1.5rem; }
.brand-lockup { justify-self: start; display: flex; align-items: center; gap: .75rem; font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-logo-link, .brand-title-link { border-radius: .25rem; color: var(--ink); text-decoration: none; }
.brand-logo-link { display: inline-flex; }
.brand-logo-link:focus-visible, .brand-title-link:focus-visible { outline: 3px solid rgba(47, 111, 78, .35); outline-offset: 3px; }
.brand-prefix, .brand-section { display: inline-block; }
.brand-section { color: var(--brand); }
.brand-logo { display: block; width: 48px; height: 48px; object-fit: contain; }
.site-title { justify-self: center; color: var(--ink); font-size: clamp(1.15rem, 2vw, 1.75rem); font-weight: 800; letter-spacing: -.02em; text-align: center; white-space: nowrap; }
nav { justify-self: end; display: flex; align-items: center; flex-wrap: nowrap; gap: 1.2rem; font-size: clamp(.75rem, 1.0875vw, .975rem); white-space: nowrap; }
nav > a, .nav-menu summary { position: relative; color: var(--ink); font-weight: 500; text-decoration: none; }
nav > a::after, .nav-menu summary::before { content: ""; position: absolute; right: 0; bottom: -.45rem; left: 0; height: 2px; background: var(--brand); transform: scaleX(0); transition: transform .18s ease; }
nav > a:hover::after, nav > a:focus-visible::after, nav > a.active::after, .nav-menu summary:hover::before, .nav-menu summary:focus-visible::before, .nav-menu summary.active::before { transform: scaleX(1); }
.nav-menu { position: relative; }
.nav-menu summary { padding-right: 1rem; list-style: none; cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; position: absolute; top: 50%; right: .05rem; width: .38rem; height: .38rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .18s ease; }
.nav-menu[open] summary::after { transform: translateY(-25%) rotate(225deg); }
.nav-menu summary:focus-visible { outline: 3px solid rgba(47, 111, 78, .3); outline-offset: 5px; border-radius: 2px; }
.nav-dropdown { position: absolute; z-index: 20; top: calc(100% + .75rem); left: -.8rem; min-width: 11rem; padding: .45rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 .65rem 1.5rem rgba(16, 37, 29, .14); }
.nav-menu-end .nav-dropdown { right: 0; left: auto; }
.nav-dropdown a { display: block; padding: .6rem .7rem; border-radius: 7px; color: var(--ink); text-decoration: none; }
.nav-dropdown a:hover, .nav-dropdown a:focus-visible { color: var(--brand-dark); background: var(--message-paper); outline: none; }
.nav-dropdown a.active { color: #fff; background: var(--brand); }
main { width: min(1240px, calc(100% - 2.4rem)); margin: 0 auto; }
.hero { margin: 1.25rem 0 0; padding: clamp(1.5rem, 4vw, 3rem); color: white; border-radius: 24px 24px 0 0; background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.12), transparent 30%), linear-gradient(135deg, #163c2b, #2f6f4e); box-shadow: var(--shadow); }
.hero h1 { margin: 0; max-width: 900px; font: 700 clamp(2.5rem, 5vw, 4.4rem)/.98 Georgia, serif; letter-spacing: -.04em; }
.eyebrow { margin: 0 0 .55rem; text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 800; }
.lede { max-width: 830px; margin: 1rem 0 0; font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.6; }
.cards { margin: 0 0 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.cards article { min-height: 126px; padding: 1.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--message-paper); border: 1px solid var(--brand-dark); border-left: 0; text-align: center; box-shadow: var(--shadow); }
.cards article:first-child { border-left: 1px solid var(--brand-dark); }
.cards span { color: var(--muted); font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.cards strong { margin-top: .55rem; font: 700 clamp(1.5rem, 3vw, 2.35rem)/1.1 Georgia, serif; }
.notice { margin: 1rem 0; padding: 1.2rem 1.3rem; color: var(--brand-dark); background: var(--message-paper); border: 1px solid var(--message-border); border-radius: 14px; line-height: 1.6; }
.notice h2 { margin-top: 0; font-family: Georgia, serif; }
.table-section, .content-page { margin: 1rem 0 2rem; padding: clamp(1.1rem, 3vw, 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.section-heading { margin-bottom: 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; }
.section-heading h2, .content-page h1, .content-page h2 { margin: 0; font-family: Georgia, serif; }
.section-heading p:last-child { max-width: 540px; margin: 0; color: var(--muted); line-height: 1.5; text-align: right; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.confidence { display: inline-block; min-width: 3.8rem; padding: .25rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 800; text-align: center; }
.confidence-high { color: var(--brand-dark); background: #dcefe3; }
.confidence-med { color: #65540e; background: #f3edc9; }
.confidence-low { color: #8f3f2e; background: #fae2db; }
.confidence-na { color: var(--muted); background: #e9ecea; }
.content-page { margin-top: 2rem; }
.content-page > h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.prose { max-width: 900px; }
.prose h2 { margin-top: 1.8rem; }
.prose p, .prose li { color: var(--muted); line-height: 1.65; }
.prose li + li { margin-top: .7rem; }
code { font-size: .82rem; }
.proposal-intro { margin: 1.25rem 0 1rem; padding: clamp(1.3rem, 3vw, 2.2rem); display: flex; align-items: end; justify-content: space-between; gap: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.proposal-intro h1 { margin: 0; max-width: 850px; font: 700 clamp(2.1rem, 4vw, 3.6rem)/1 Georgia, serif; letter-spacing: -.035em; }
.proposal-intro p:last-child { max-width: 850px; margin: .8rem 0 0; color: var(--muted); line-height: 1.55; }
.settings-button { min-height: 42px; padding: .65rem 1rem; flex: 0 0 auto; color: #fff; background: var(--brand); border: 0; border-radius: 9px; font: 750 .95rem system-ui, sans-serif; cursor: pointer; }
.settings-button:hover { background: var(--brand-dark); }
.proposal-infographic { margin-bottom: 2rem; }
.timeline-controls { margin-bottom: 1rem; padding: .85rem 1rem; display: flex; align-items: end; justify-content: center; gap: 1rem; background: var(--message-paper); border: 1px solid var(--message-border); border-radius: 14px; }
.scenario-label { align-self: center; padding: .35rem .55rem; color: var(--brand-dark); background: #fff; border: 1px solid var(--message-border); border-radius: 999px; font-size: .72rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.mode-toggle { display: inline-flex; padding: 3px; background: #dfe5df; border-radius: 10px; }
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mode-toggle label { padding: .55rem .8rem; border-radius: 8px; color: var(--muted); font-size: .82rem; font-weight: 800; cursor: pointer; }
.mode-toggle input:checked + label { color: #fff; background: var(--brand); }
.mode-toggle input:focus-visible + label { outline: 3px solid rgba(47,111,78,.3); outline-offset: 2px; }
.year-control span { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.year-control select { min-height: 38px; padding-top: .35rem; padding-bottom: .35rem; }
.playback-controls { display: inline-flex; align-items: center; gap: .35rem; }
.playback-controls button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--brand-dark); background: #fff; border: 1px solid #9fb2a6; border-radius: 8px; font: 800 1rem/1 system-ui, sans-serif; cursor: pointer; }
.playback-controls button:hover, .playback-controls button[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.playback-controls button:focus-visible { outline: 3px solid rgba(47,111,78,.3); outline-offset: 2px; }
.money-flow { display: grid; grid-template-columns: minmax(190px, .7fr) 72px minmax(420px, 1.8fr) 72px minmax(190px, .7fr); align-items: stretch; gap: 0; }
.flow-kpi, .allocation-stage { min-height: 390px; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--brand-dark); background: var(--panel); box-shadow: var(--shadow); }
.flow-kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.flow-primary { color: #fff; background: linear-gradient(145deg, #163c2b, var(--brand)); border-radius: 22px 0 0 22px; }
.flow-payout { background: var(--message-paper); border-radius: 0 22px 22px 0; }
.flow-step { margin: 0 0 1rem; font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.flow-kpi > strong { font: 700 clamp(2.1rem, 4vw, 3.5rem)/1 Georgia, serif; }
.flow-kpi > span { margin-top: .7rem; font-weight: 750; }
.flow-kpi > small { margin-top: .65rem; color: inherit; opacity: .78; line-height: 1.4; }
.flow-arrow { position: relative; display: grid; place-items: center; color: var(--brand-dark); background: linear-gradient(transparent 48%, var(--brand) 48%, var(--brand) 52%, transparent 52%); }
.flow-arrow::after { content: ""; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 14px solid var(--brand); }
.flow-arrow span { position: absolute; margin-top: -2.4rem; padding: .15rem .35rem; background: var(--paper); font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.allocation-stage { border-radius: 18px; }
.allocation-heading { text-align: center; }
.allocation-heading .flow-step { margin-bottom: .35rem; }
.allocation-heading > strong { font: 700 2rem Georgia, serif; }
.allocation-heading > span { display: block; color: var(--muted); font-size: .78rem; }
.allocation-branches { margin: 1.1rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.allocation-branches article { min-height: 190px; padding: .9rem; display: flex; flex-direction: column; justify-content: center; background: var(--message-paper); border-top: 8px solid var(--brand); border-radius: 10px; text-align: center; }
.allocation-branches article:nth-child(2) { border-top-color: var(--blue); }
.allocation-branches article:nth-child(3) { border-top-color: #9b633b; }
.branch-name { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.allocation-branches strong { margin: .35rem 0; font: 700 1.4rem Georgia, serif; }
.allocation-branches small { color: var(--muted); }
.allocation-branches em { margin-top: .65rem; color: var(--brand-dark); font-size: .8rem; font-style: normal; font-weight: 800; }
.allocation-branches em + small { margin-top: .25rem; font-size: .72rem; font-weight: 750; }
.return-kpi { padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #fff; background: var(--brand-dark); border-radius: 10px; }
.return-kpi span { font-size: .78rem; font-weight: 750; }
.return-kpi strong { font: 700 1.8rem Georgia, serif; white-space: nowrap; }
.reserve-waterfall { margin-top: 1.5rem; padding: clamp(1.2rem, 3vw, 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.waterfall-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.waterfall-heading .flow-step { margin-bottom: .35rem; }
.waterfall-heading h2 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.25rem)/1.1 Georgia, serif; }
.waterfall-heading > p { margin: 0; color: var(--muted); font-size: .84rem; font-weight: 750; }
.waterfall-chart { --opening-height: 0%; --contribution-bottom: 0%; --contribution-height: 90%; --return-bottom: 90%; --return-height: 5%; --payout-bottom: 75%; --payout-height: 20%; --total-height: 75%; height: 330px; margin-top: 1.5rem; padding: 0 1rem 2rem; display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: clamp(.7rem, 2.5vw, 2.5rem); align-items: stretch; border-bottom: 2px solid var(--brand-dark); }
.waterfall-item { position: relative; min-width: 0; }
.waterfall-item span, .waterfall-item strong { position: relative; z-index: 2; display: block; text-align: center; }
.waterfall-item span { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.waterfall-item strong { margin-top: .25rem; font: 700 clamp(1.35rem, 2.5vw, 2rem) Georgia, serif; }
.waterfall-bar { position: absolute; right: 8%; bottom: 0; left: 8%; min-height: 8px; background: var(--brand); border-radius: 5px 5px 0 0; box-shadow: 0 8px 18px rgba(22,60,43,.15); }
.waterfall-opening .waterfall-bar { height: var(--opening-height); background: #7c8b83; }
.waterfall-item:nth-child(2) .waterfall-bar { bottom: var(--contribution-bottom); height: var(--contribution-height); }
.waterfall-item:nth-child(3) .waterfall-bar { bottom: var(--return-bottom); height: var(--return-height); background: var(--blue); border-radius: 5px; }
.waterfall-item:nth-child(3).is-negative .waterfall-bar { background: #b96a4a; }
.waterfall-item:nth-child(4) .waterfall-bar { bottom: var(--payout-bottom); height: var(--payout-height); background: #b96a4a; border-radius: 5px; }
.waterfall-total .waterfall-bar { height: var(--total-height); background: var(--brand-dark); }
.waterfall-total strong { color: var(--brand-dark); }
.waterfall-caption { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.infographic-note { margin: 1rem auto 0; max-width: 920px; color: var(--muted); font-size: .88rem; line-height: 1.55; text-align: center; }
.assumptions-dialog { width: min(900px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; color: var(--ink); border: 0; border-radius: 18px; box-shadow: 0 24px 70px rgba(20,32,26,.28); }
.assumptions-dialog::backdrop { background: rgba(20,32,26,.55); }
.dialog-header { padding: 1.25rem 1.5rem .75rem; display: flex; align-items: start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font: 700 2rem Georgia, serif; }
.dialog-close { width: 38px; height: 38px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; font: 400 1.6rem/1 system-ui, sans-serif; cursor: pointer; }
.dialog-body { padding: 1.25rem 1.5rem; }
.dialog-body h3 { margin: 1.5rem 0 .75rem; font-family: Georgia, serif; }
.dialog-actions { padding: .85rem 1.5rem 1.25rem; display: flex; justify-content: flex-end; gap: .7rem; }
.dialog-actions .button { border: 0; cursor: pointer; }
.dialog-actions .button-secondary { color: var(--brand-dark); background: var(--message-paper); border: 1px solid var(--message-border); }
.dialog-note { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.input-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: .8rem; }
.input-grid label, .bucket-grid label { color: var(--muted); font-size: .78rem; font-weight: 750; }
.input-grid input, .bucket-grid input { width: 100%; margin-top: .35rem; }
.bucket-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.bucket-grid article { padding: 1rem; display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: .7rem; background: var(--message-paper); border: 1px solid var(--message-border); border-radius: 12px; }
.bucket-grid article > strong { grid-column: 1 / -1; font: 700 1.25rem Georgia, serif; }
.bucket-grid article > span { min-width: 3.2rem; padding: .45rem; color: #fff; background: var(--brand); border-radius: 999px; font-weight: 800; text-align: center; }
.form-error { min-height: 1.2em; margin: .75rem 0 0; color: #9b3d2e; font-weight: 700; }
.site-footer { min-height: 76px; padding: 1.5rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); }

@media (max-width: 1400px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-title { justify-self: end; }
  .site-header nav { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 1050px) {
  .money-flow { grid-template-columns: 1fr; }
  .flow-kpi, .allocation-stage { min-height: auto; border-radius: 18px; }
  .flow-kpi { min-height: 250px; }
  .flow-arrow { min-height: 66px; background: linear-gradient(90deg, transparent 48%, var(--brand) 48%, var(--brand) 52%, transparent 52%); }
  .flow-arrow::after { border-top: 14px solid var(--brand); border-right: 10px solid transparent; border-bottom: 0; border-left: 10px solid transparent; }
  .flow-arrow span { margin: 0 0 0 5rem; }
}
@media (max-width: 760px) {
  .site-header { grid-template-columns: 1fr; align-items: start; }
  .site-title, .site-header nav { justify-self: start; }
  .cards { grid-template-columns: 1fr; }
  .cards article { border-top: 0; border-left: 1px solid var(--brand-dark); }
  .cards article:first-child { border-top: 1px solid var(--brand-dark); }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading p:last-child { text-align: left; }
  .proposal-intro, .timeline-controls { align-items: stretch; flex-direction: column; }
  .playback-controls { justify-content: center; }
  .playback-controls button { flex: 1; }
  .allocation-branches { grid-template-columns: 1fr; }
  .input-grid { grid-template-columns: repeat(2, 1fr); }
  .bucket-grid { grid-template-columns: 1fr; }
  .waterfall-heading { align-items: start; flex-direction: column; gap: .6rem; }
  .waterfall-chart { height: 270px; padding-right: 0; padding-left: 0; grid-template-columns: repeat(5, minmax(58px, 1fr)); gap: .3rem; }
  .waterfall-item span { font-size: .62rem; letter-spacing: 0; }
  .waterfall-item strong { font-size: 1rem; }
}
@media (max-width: 580px) {
  .site-header { grid-template-columns: 1fr; align-items: start; }
  .site-title, .site-header nav { justify-self: start; }
  nav { gap: .8rem 1rem; }
  main { width: min(calc(100% - 1.2rem), 1240px); }
  .hero { margin-top: .7rem; border-radius: 16px 16px 0 0; }
  .site-footer { align-items: stretch; flex-direction: column; }
  th, td { padding: .65rem .55rem; }
  .input-grid { grid-template-columns: 1fr; }
  .mode-toggle { width: 100%; }
  .mode-toggle label { flex: 1; text-align: center; }
}
