:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --white: #fffefa;
  --ink: #162b25;
  --muted: #52625a;
  --border: #dcded4;
  --pay: #ac6239;
  --invest: #18745b;
  font: 16px/1.55 system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p, dl, dd, figure { margin: 0; }
.frame { width: min(1540px, calc(100% - 40px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--border); }
.masthead, .footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.masthead { min-height: 66px; }
.wordmark { display: flex; align-items: center; gap: 10px; font: bold 27px Georgia, serif; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: var(--ink); color: #ebf6d4; font: italic 23px Georgia, serif; }
.edition, .eyebrow { font-size: .72rem; letter-spacing: .13em; font-weight: 750; text-transform: uppercase; }
.edition { color: var(--muted); }
.intro { padding: 20px 0 16px; }
.intro .eyebrow { color: var(--invest); }
.intro .eyebrow span { margin-left: 7px; padding-left: 10px; border-left: 1px solid var(--border); }
h1 { font: normal clamp(2.1rem, 4vw, 3rem)/1.06 Georgia, serif; letter-spacing: -.05em; margin: 8px 0 12px; }
.intro > p:last-child { max-width: 55ch; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 24px; }
.comparison { border: 1px solid var(--border); background: var(--white); border-radius: 12px; }
.comparison.assumptions-panel { margin: 0; padding: 12px 16px; }
.assumptions-panel form { padding-top: 12px; }
.assumptions-panel form > .subtle { margin-top: 6px; }
form h2 { font: normal 1.7rem/1.2 Georgia, serif; }
.subtle { color: var(--muted); font-size: .825rem; }
#return-mode { margin-bottom: 10px; }
#market-help { margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 22px 0 0; min-inline-size: 0; }
legend { width: 100%; border-top: 1px solid var(--border); padding: 12px 0 9px; font-weight: 700; }
legend span { margin-right: 7px; font-size: .74rem; color: var(--invest); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
label { font-size: .81rem; font-weight: 650; }
input, select { display: block; width: 100%; min-width: 0; min-height: 43px; margin-top: 4px; padding: 8px; border-radius: 7px; border: 1px solid #c5ccc0; color: var(--ink); background: var(--white); font: 1rem system-ui, sans-serif; }
.checkbox-option { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; cursor: pointer; }
.checkbox-option input { width: 1rem; height: 1rem; min-height: 0; margin: 0; accent-color: var(--invest); }
:focus-visible { outline: 2px solid var(--invest); outline-offset: 3px; }
details { margin-top: 11px; }
summary { cursor: pointer; color: var(--invest); font-size: .82rem; font-weight: 700; }
details[open] .fields, details .subtle, #tax > * { margin-top: 8px; }
button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-top: 24px; border: 0; border-radius: 8px; padding: 12px 15px; background: var(--ink); color: white; font: 700 .93rem/1.4 system-ui, sans-serif; cursor: pointer; }
button:hover { background: #275043; }
.help-trigger { display: inline-flex; justify-content: center; vertical-align: middle; width: 24px; height: 24px; margin: 0 0 0 4px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: var(--invest); font-size: .75rem; }
.help-trigger:hover, .help-trigger:focus-visible { background: var(--paper); }
.verdict .help-trigger:not(:hover):not(:focus-visible) { color: inherit; }
.help-popup { width: min(18rem, calc(100% - 24px)); max-height: min(16rem, calc(100dvh - 24px)); overflow: auto; padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--white); color: var(--ink); box-shadow: 0 6px 18px #162b2524; font: normal .85rem/1.5 system-ui, sans-serif; }
@supports (top: anchor(bottom)) and (position-try-fallbacks: flip-block) {
  .help-popup { inset: auto; margin: 6px 0 0; top: anchor(bottom); left: clamp(12px, calc(anchor(center) - 9rem), max(12px, calc(100% - 18rem - 12px))); position-try-fallbacks: flip-block; }
}
.secondary { display: inline-block; width: auto; margin-top: 10px; padding: 7px 10px; border: 1px solid var(--border); background: var(--white); color: var(--invest); font-size: .82rem; }
.secondary:hover { background: var(--paper); }
.scenario-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.scenario-actions .secondary { margin-top: 0; }
.change { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; padding: 0 10px 10px; }
.change legend { width: auto; padding: 0 4px; border: 0; font-size: .82rem; }
#cash-preview-years { padding-inline-start: 1.25rem; }
.results { display: grid; gap: 14px; }
.verdict { background: var(--ink); color: #f6f9ed; border-radius: 10px; padding: 16px 20px; }
.verdict .eyebrow { color: #a9ccb7; }
.winner { font: normal clamp(1.65rem, 3vw, 2.25rem)/1.07 Georgia, serif; letter-spacing: -.035em; margin: 4px 0; }
.lead { color: #d4ded5; font-size: .9rem; }
.verdict-stats { border-top: 1px solid #476158; margin-top: 20px; padding-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; }
.verdict-stats dt { font-size: .76rem; color: #d4ded5; }
.verdict-stats dd { font-size: 1.1rem; font-weight: 700; }
.pending, .warning { border-radius: 8px; padding: 10px 14px; font-size: .85rem; background: #f5e5cb; color: #5e3c18; }
.comparison, .plot { padding: 16px 20px; min-width: 0; }
.results details { margin: 0; }
.plan-rules-copy { display: grid; gap: 8px; margin-top: 10px; max-width: 75ch; font-size: .85rem; color: var(--muted); }
.plan-model { padding-top: 10px; border-top: 1px solid var(--border); }
.plan-model-copy { display: grid; gap: 8px; margin-top: 8px; }
#change-results .change-summary { display: block; margin-top: 6px; font-family: system-ui, sans-serif; }
#change-results tbody th, #change-results tbody td { vertical-align: top; padding-block: 10px; }
#change-results tbody td { font-weight: 400; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
caption, figcaption { text-align: left; font: normal 1.25rem Georgia, serif; }
caption { margin-bottom: 10px; }
th, td { padding: 7px 0 7px 6px; text-align: right; }
th:first-child { text-align: left; padding-left: 0; }
tbody th, tbody td { border-top: 1px solid var(--border); }
tbody th { color: var(--muted); font-weight: 550; }
tbody tr:first-child td { font-weight: 750; }
.comparison-note { margin-top: 10px; }
.comparison-note a { color: var(--invest); }
.section-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.section-controls button, .year-picker button, .yearly-summary button:not(.calculation-trigger) {
  display: inline-flex; justify-content: center; width: auto; min-height: 34px; margin: 0;
  padding: 5px 9px; border: 1px solid var(--border); background: var(--white); color: var(--ink); font-size: .8rem;
}
.section-controls button:hover, .year-picker button:hover, .yearly-summary button:not(.calculation-trigger):hover { background: var(--paper); }
.section-controls button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.year-picker button:disabled { opacity: .48; cursor: default; }
#yearly-projections { padding: 15px; scroll-margin-top: 12px; }
.projection-heading h2 { font: normal 1.7rem/1.15 Georgia, serif; margin-bottom: 4px; }
.year-picker { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; max-width: 26rem; margin-block: 12px; }
.year-picker select { margin: 0; }
.projection-views { margin-bottom: 12px; }
.projection-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.projection-workspace[data-view="chart"] .projection-audit,
.projection-workspace[data-view="audit"] :is(.plot, .year-comparison) { display: none; }
.projection-workspace .plot { padding: 6px 8px; }
.chart-year { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.chart-year input { margin: 0; min-height: 28px; padding: 0; accent-color: var(--invest); }
.year-comparison, .projection-audit { min-width: 0; padding: 12px; border-radius: 8px; }
.year-comparison { background: #eff3eb; }
.year-comparison-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.year-comparison-heading h3 { margin: 0; font: normal 1.45rem Georgia, serif; }
.yearly-lead { color: var(--invest); font-weight: 750; font-size: .8rem; }
.projection-audit { border: 1px solid var(--border); }
.projection-audit h3 { margin: 0; font-size: .95rem; }
.audit-table { table-layout: fixed; }
.audit-table caption { margin: 4px 0; color: var(--muted); font: 700 .825rem/1.5 system-ui, sans-serif; }
.audit-table th:first-child { width: 40%; }
.audit-table :is(th, td) { vertical-align: top; overflow-wrap: anywhere; }
.audit-table td { font-weight: 400; }
.audit-table ul { margin: 0; padding: 0; list-style: none; }
.audit-table li + li { margin-top: 6px; }
.audit-table .account-subgroup { padding: 6px 8px; background: var(--paper); color: var(--invest); font-weight: 700; }
.schedule-scroll { overflow: auto; max-height: 24rem; margin-top: 8px; }
.schedule-scroll table { min-width: 345px; border-collapse: separate; border-spacing: 0; }
.schedule-scroll thead th { position: sticky; top: 0; background: var(--white); }
.yearly-summary th, .yearly-summary td { vertical-align: top; }
.yearly-summary td { font-weight: 550; }
.yearly-summary td > div + div { color: var(--muted); font-size: .76rem; }
.yearly-summary button:not(.calculation-trigger) { border-color: transparent; color: var(--invest); white-space: nowrap; }
.yearly-summary button[aria-current="true"] { border-color: var(--border); }
.calculation-trigger { width: 26px; height: 26px; font: 700 .85rem Georgia, serif; }
.calculation-popup { position: fixed; inset: auto; margin: 0; text-align: left; position-try-fallbacks: none; }
.calculation-popup[data-side="above"] { transform: translateY(-100%); }
.calculation-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px;
  position: sticky; top: -10px; padding: 10px 0 8px; margin-top: -10px; border-bottom: 1px solid var(--border); background: var(--white); }
.calculation-result { color: var(--invest); font-variant-numeric: tabular-nums; }
tr:has(.calculation-popup:popover-open) { background: #eff3eb; }
td:has(.calculation-popup:popover-open) { background: #e0ece0; }
.calculation-trigger:has(+ .calculation-popup:popover-open) { background: var(--invest); color: white; }
.calculation-popup dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin-top: 10px; }
.calculation-popup dt { overflow-wrap: anywhere; }
.calculation-popup dd { text-align: right; white-space: nowrap; }
.calculation-popup p { margin-top: 8px; color: var(--muted); font-size: .76rem; }
.results .calculation-popup .cash-out-tax { margin-top: 10px; }
.results .calculation-popup .cash-out-tax ul { margin: 6px 0 0; padding: 0; list-style: none; }
.calculation-popup .cash-out-tax li + li { margin-top: 6px; }
.calculation-popup .cash-out-tax li p { margin-top: 2px; }
.dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; margin-right: 3px; vertical-align: .1em; }
.dot.pay { background: var(--pay); }
.dot.invest { background: var(--invest); }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 9px; margin-top: 12px; }
.plot-scale, .plot-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.plot-scale { flex-direction: column; align-items: flex-end; }
.plot-labels { grid-column: 2; }
.chart-plot { position: relative; }
.chart-point { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.chart-point-pay { width: 12px; height: 12px; border: 2px solid var(--pay); }
.chart-point-invest { width: 7px; height: 7px; background: var(--invest); border: 1px solid var(--white); }
.key { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; font-size: .75rem; color: var(--muted); }
.key strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.key span::before { content: ''; display: inline-block; width: 14px; margin-right: 5px; vertical-align: .22em; }
.key-pay::before { border-top: 2px dashed var(--pay); }
.key-invest::before { border-top: 2px solid var(--invest); }
.key-change::before { border-top: 2px dotted var(--muted); }
.key-prime::before { border-top: 2px dashed var(--invest); }
svg { display: block; width: 100%; height: clamp(150px, 28vh, 280px); }
svg path, svg polyline { fill: none; vector-effect: non-scaling-stroke; }
.gridlines { stroke: var(--border); }
.change-markers { stroke: var(--muted); stroke-dasharray: 2 3; }
.prime-markers { stroke: var(--invest); stroke-dasharray: 6 4; opacity: .5; }
.pay-line { stroke: var(--pay); stroke-width: 2; stroke-dasharray: 5 3; }
.invest-line { stroke: var(--invest); stroke-width: 2; }
.selected-year-marker { stroke: var(--invest); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.footer { border-top: 1px solid var(--border); padding-block: 16px; color: var(--muted); font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (min-width: 880px) {
  .projection-views { display: none; }
  .projection-workspace { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr; grid-template-areas: 'chart comparison' 'chart audit'; align-items: start; gap: 12px 14px; }
  .projection-workspace .plot { grid-area: chart; }
  .projection-workspace .year-comparison { grid-area: comparison; }
  .projection-workspace .projection-audit { grid-area: audit; }
  .projection-workspace[data-view] :is(.plot, .year-comparison, .projection-audit) { display: block; }
  .audit-scroll { max-height: clamp(240px, 42vh, 460px); overflow: auto; scrollbar-gutter: stable; padding-inline-end: 12px; }
  .audit-table { border-collapse: separate; border-spacing: 0; }
  .audit-table thead th { position: sticky; top: 0; background: var(--white); }
}
@media (min-width: 1160px) {
  .layout { grid-template-columns: minmax(230px, .6fr) minmax(0, 2.4fr); }
  .verdict { grid-column: 1 / -1; display: grid; grid-template-columns: 1.5fr 1fr; column-gap: 18px; align-items: center; }
  .verdict-stats { grid-column: 2; grid-row: 1 / 4; border-top: 0; border-left: 1px solid #476158; margin: 0; padding: 0 0 0 18px; }
  .comparison.assumptions-panel { position: sticky; top: 12px; padding: 14px; max-height: calc(100dvh - 24px); overflow: auto; }
  .assumptions-panel > summary { display: none; }
  .assumptions-panel form { padding: 0; }
  .scenario-actions .secondary { font-size: .72rem; padding: 5px 7px; }
}
@media (max-width: 780px) {
  .frame { width: calc(100% - 32px); }
  .comparison { padding: 14px; }
}
@media (max-width: 400px) {
  .year-picker { gap: 5px; }
  .year-picker button { padding-inline: 6px; }
  table { font-size: .75rem; }
  .year-comparison table { table-layout: fixed; overflow-wrap: anywhere; }
}
@media (max-width: 355px) {
  .fields { grid-template-columns: 1fr; }
}
