:root {
  --paper: #F7F5EF;
  --surface: #FFFFFF;
  --ink: #202722;
  --muted: #526158;
  --forest: #294F3D;
  --soft: #E7EEE6;
  --line: #78867A;
  --rule: #D6DCD4;
  --error: #9C302B;
  --error-bg: #FFF0EC;
  --disabled: #E1E5DF;
  --focus: #805200;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { container-type: inline-size; margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--forest); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
button, summary, select { cursor: pointer; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 18px; background: var(--surface); font-size: 16px; font-weight: 600; text-align: center; }
button:hover:not(:disabled) { background: var(--soft); }
button.primary, .button.primary { background: var(--forest); border-color: var(--forest); color: var(--surface); }
button.primary:hover:not(:disabled) { background: var(--ink); }
button:disabled { cursor: not-allowed; background: var(--disabled); color: var(--muted); border-color: var(--line); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.1; letter-spacing: -.03em; }
h1 { font-size: clamp(34px, 4vw, 58px); margin: 10px 0 16px; max-width: 25ch; }
h2 { font-size: 32px; margin-bottom: 18px; }
h3 { font-size: 20px; line-height: 1.4; }
p { margin-bottom: 16px; }
small, .small { font-size: 14px; line-height: 1.5; color: var(--muted); }
.muted, .hint { color: var(--muted); }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { font-size: 13px; letter-spacing: .13em; font-weight: 700; text-transform: uppercase; color: var(--forest); }
.skip { position: absolute; top: -100px; left: 16px; background: white; padding: 12px; z-index: 100; }
.skip:focus { top: 10px; }
.site-header { max-width: 1248px; margin: auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); font-size: 23px; font-weight: 650; letter-spacing: -.7px; text-decoration: none; line-height: 1.1; }
.brand small { display: block; font-size: 11px; letter-spacing: .04em; font-weight: 400; margin-top: 6px; }
.brand-dot { color: var(--forest); }
.brand-mark { height: 32px; width: 32px; display: flex; gap: 4px; align-items: flex-end; }
.brand-mark i { width: 7px; background: var(--forest); display: block; }
.brand-mark i:nth-child(1) { height: 14px; }
.brand-mark i:nth-child(2) { height: 23px; }
.brand-mark i:nth-child(3) { height: 32px; }
.menu-toggle { display: none; }
#primary-nav { display: flex; align-items: center; gap: 25px; font-size: 14px; }
#primary-nav a, #primary-nav summary { color: var(--ink); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
#primary-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
#primary-nav summary { list-style: none; gap: 8px; }
#primary-nav summary::after { content: '⌄'; font-size: 18px; }
#primary-nav details { position: relative; }
#primary-nav details[open] summary { color: var(--forest); }
.nav-panel { position: absolute; top: 50px; right: 0; min-width: 280px; padding: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px #20272214; border-radius: 6px; z-index: 20; }
.nav-panel a { padding: 8px 12px; }
.nav-panel a:hover { background: var(--soft); }
main { max-width: 1248px; margin: auto; padding: 40px 24px 48px; outline: none; }
.intro { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.intro > div { min-width: 0; }
.intro p { max-width: 70ch; margin: 0; color: var(--muted); font-size: 17px; }
.intro .side-note { flex: 0 0 190px; font-size: 14px; border-left: 1px solid var(--line); padding-left: 20px; margin-bottom: 4px; }
.scope-note { max-width: 100ch; margin: 0 0 28px; border-left: 3px solid var(--forest); padding: 12px 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.scope-note strong { color: var(--ink); }
.calculator-mount { margin: 28px 0 48px; }
.workbench { display: grid; grid-template-columns: minmax(0,420px) minmax(0,1fr); gap: 24px; align-items: start; }
.workbench > *, .comparison-grid > *, .worksheet-content > *, .form-grid > *, .field { min-width: 0; }
.calculation-output { min-width: 0; }
.calculation-output > .form-status { padding: 18px 22px; margin: 0 0 18px; background: var(--soft); border: 1px solid var(--rule); border-radius: 8px; }
[data-page-id="P06"] > .workbench { display: block; }
[data-page-id="P06"] #scenario-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
[data-page-id="P06"] #scenario-form > :not(fieldset), [data-page-id="P06"] #scenario-form > fieldset:last-of-type { grid-column: 1 / -1; }
[data-page-id="P06"] #scenario-form > fieldset { margin: 0; }
[data-page-id="P06"] .calculation-output { margin-top: 24px; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; min-width: 0; }
.panel + .panel { margin-top: 24px; }
.workbench > .panel + .panel { margin-top: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.panel-heading h2 { font-size: 24px; margin: 0; }
.fields, .form-grid { display: grid; gap: 18px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.field input:not([type="radio"]):not([type="checkbox"]), .field select { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 13px; background: var(--surface); font-variant-numeric: tabular-nums; font-size: 18px; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border: 2px solid var(--error); padding: 9px 12px; }
.input-wrap { position: relative; }
.input-wrap input:not([type="radio"]):not([type="checkbox"]) { padding-right: 70px; }
.unit { position: absolute; right: 14px; top: 13px; font-size: 14px; color: var(--muted); pointer-events: none; }
.hint, .field-error, .field small { font-size: 14px; line-height: 1.5; margin: 5px 0 0; }
.field-error { color: var(--error); font-weight: 600; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions, .form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.actions .primary, .form-actions .primary { flex: 1; }
.form-status { font-size: 15px; margin: 16px 0 0; }
.status-stale { background: #fff7df; color: #604300; border-left: 3px solid #805200; padding: 12px 16px; }
.error-summary { padding: 16px; background: var(--error-bg); border-left: 3px solid var(--error); color: var(--error); margin: 0 0 20px; font-size: 16px; }
.error-summary a { color: var(--error); }
.error-summary ul { margin-bottom: 0; padding-left: 24px; }
fieldset { min-width: 0; padding: 20px; border: 1px solid var(--rule); border-radius: 6px; margin: 20px 0; }
legend { padding: 0 8px; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.option-line { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
input[type="radio"], input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 22px; margin: 2px 8px 0 0; accent-color: var(--forest); }
.event-group, .event-row { background: var(--paper); padding: 16px; border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 16px; }
.event-group button, .event-row button { margin-top: 12px; }
.result-panel, .result-summary { background: var(--soft); }
.result-label { font-size: 16px; margin: 24px 0 0; }
.big-number { font-size: clamp(32px,4vw,55px); line-height: 1.15; font-weight: 550; letter-spacing: -.045em; font-variant-numeric: tabular-nums; margin: 8px 0 18px; overflow-wrap: anywhere; }
.big-number span { font-size: 23px; letter-spacing: 0; font-weight: 400; }
.result-metrics, .metrics, dl.result-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.result-metrics dt, .metrics dt, .metric-label, .metric dt { font-size: 14px; color: var(--muted); }
.result-metrics dd, .metrics dd, .metric-value, .metric dd { font-size: 24px; margin: 3px 0 0; font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
.metric { min-width: 0; }
.result-footnote { font-size: 14px; line-height: 1.5; max-width: 64ch; }
.assumptions, .notice { border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; margin: 18px 0; background: var(--surface); font-size: 16px; }
.assumptions summary { font-size: 16px; font-weight: 600; min-height: 32px; }
.assumptions p { font-size: 15px; margin: 12px 0 0; color: var(--muted); }
.comparison-grid, .compare-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.comparison-grid .full, .compare-form .full { grid-column: 1 / -1; }
.table-wrap, .table-shell, .result-table { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin: 16px 0; scrollbar-gutter: stable; }
.table-wrap:focus-visible, .table-shell:focus-visible, .result-table:focus-visible { outline-offset: 4px; }
table { border-collapse: collapse; width: 100%; min-width: 580px; font-size: 15px; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 14px 16px; font-weight: 600; color: var(--ink); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th { font-size: 14px; background: var(--paper); font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
.table-hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.editorial { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 48px; margin-top: 48px; align-items: start; }
.contents { border-top: 1px solid var(--line); padding-top: 16px; font-size: 15px; }
.contents a { display: block; padding: 8px 0; color: var(--ink); overflow-wrap: anywhere; }
.article-body { min-width: 0; max-width: 68ch; }
.article-body h2 { font-size: 32px; margin-top: 40px; scroll-margin-top: 24px; }
.article-body h2:first-child { margin-top: 0; }
.article-body p, .article-body li { font-size: 17px; }
.article-body li + li { margin-top: 10px; }
.article-body ul, .article-body ol { padding-left: 26px; }
.article-body code { font: .92em/1.6 ui-monospace, Consolas, monospace; background: var(--soft); padding: 2px 4px; border-radius: 2px; overflow-wrap: anywhere; }
.article-body pre { max-width: 100%; overflow: auto; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.article-body pre code { background: transparent; padding: 0; }
.article-body table { min-width: 580px; }
.article-body table th, .article-body table td { white-space: normal; text-align: left; min-width: 140px; }
.article-body table td:last-child { min-width: 190px; }
.article-body table td.numeric { white-space: nowrap; text-align: right; min-width: 100px; }
.worksheet-content { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 36px; align-items: start; margin: 32px 0 48px; }
.worksheet-preview { min-width: 0; margin: 0; background: var(--surface); padding: 24px; border: 1px solid var(--line); box-shadow: 8px 8px 0 var(--soft); }
.worksheet-preview img { display: block; width: 100%; height: auto; }
.worksheet-preview figcaption { font-size: 14px; margin-top: 16px; color: var(--muted); }
.download-box { padding: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.download-box button { width: 100%; }
.download-box .small { margin-top: 16px; }
.site-footer { max-width: 1248px; padding: 32px 24px 42px; margin: auto; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.site-footer strong { font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.site-footer p { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.site-footer a { display: inline-block; font-size: 14px; margin: 0 18px 8px 0; min-height: 32px; }
@container (max-width: 1050px) {
  .site-header { flex-wrap: wrap; }
  .menu-toggle { display: inline-flex; }
  #primary-nav { display: none; width: 100%; align-items: stretch; flex-direction: column; gap: 0; padding: 10px 0; }
  #primary-nav.menu-open { display: flex; }
  #primary-nav > a, #primary-nav summary { min-height: 48px; border-top: 1px solid var(--rule); padding: 10px 6px; }
  .nav-panel { position: static; min-width: 0; width: 100%; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 0 12px; background: transparent; }
  .intro .side-note { display: none; }
  .panel { padding: 22px; }
  .workbench, .worksheet-content { grid-template-columns: minmax(0,1fr); }
  .editorial { grid-template-columns: 180px minmax(0,1fr); gap: 28px; }
  .comparison-grid .result-metrics { grid-template-columns: 1fr; }
}
@container (max-width: 720px) {
  .site-header { padding: 18px 16px; gap: 12px; }
  .brand { font-size: 22px; }
  main { padding: 28px 16px 40px; }
  .intro { margin-bottom: 24px; }
  .intro p { font-size: 16px; }
  h1 { max-width: 20ch; }
  .scope-note { padding: 12px 14px; }
  .workbench, .comparison-grid, .compare-form, .editorial, .site-footer { grid-template-columns: 1fr; }
  [data-page-id="P06"] #scenario-form { grid-template-columns: minmax(0,1fr); }
  .panel { padding: 22px 18px; }
  .workbench { gap: 18px; }
  .field-pair { gap: 12px; }
  .result-metrics, .metrics { gap: 16px; }
  .result-metrics dd, .metrics dd { font-size: 22px; }
  .big-number { font-size: 38px; }
  .editorial { gap: 28px; }
  .contents { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .article-body h2 { font-size: 28px; }
  .site-footer { padding: 28px 16px; gap: 28px; }
  .worksheet-preview { padding: 16px; }
  .download-box { padding: 22px 18px; }
  .table-wrap, .table-shell, .result-table { scrollbar-gutter: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
