@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 750;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #222b23;
  --muted: #536052;
  --green: #294533;
  --paper: #f5f3eb;
  --white: #fffdf8;
  --line: #d6dbcf;
  --soft: #e9ede3;
  --sand: #eae7d9;
  --radius: 12px;
  font: 16px/1.625 "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .24em; }
a:hover { color: #43654d; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
[hidden] { display: none !important; }
p, h1, h2, h3, ul, ol { margin: 0 0 16px; }
p, li { color: var(--muted); }
h1, h2, h3 { font-weight: 650; }
h1 { font-size: 36px; line-height: 42px; letter-spacing: -.035em; }
h2 { font-size: 28px; line-height: 36px; letter-spacing: -.025em; }
h3 { font-size: 18px; line-height: 26px; }
.shell { width: min(calc(100% - 64px), 1200px); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; inset: 12px auto auto 12px; z-index: 2; background: var(--white); padding: 12px; }

.site-header, .site-footer { border-block-end: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.header-inner { min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; line-height: 24px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; width: 18px; height: 20px; border: 1px solid var(--green); flex: none; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--green); }
.brand-mark::before { inset: 0 50% 0 auto; width: 1px; }
.brand-mark::after { inset: 50% 0 auto; height: 1px; }
header nav, footer nav, .jump { display: flex; flex-wrap: wrap; gap: 8px 24px; }
header nav a, footer nav a { text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 600; }
nav a[aria-current="page"] { text-decoration: underline; }

.hero { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; gap: 32px; background: var(--sand); border-radius: var(--radius); padding: 16px; margin: 32px 0 48px; }
.hero-text { padding: clamp(24px, 4vw, 56px); align-self: center; }
.hero h1 { max-width: 17ch; font-size: 48px; line-height: 54px; }
.lede { max-width: 62ch; }
.hero .lede { max-width: 43ch; margin-bottom: 24px; }
.hero-photo { background: #cdd5c3 url("/assets/window-hero.jpg") center 49% / cover no-repeat; min-height: 320px; border-radius: var(--radius); }
.actions, .form-actions, .related > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: var(--green); border: 1px solid var(--green); color: white; text-decoration: none; border-radius: 8px; padding: 10px 16px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 650; line-height: 20px; cursor: pointer; }
.button:hover { background: #365840; color: white; }
.button.secondary { background: transparent; border-color: #778675; color: var(--green); }
.button.secondary:hover { background: var(--soft); }

.planning { margin-bottom: 48px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card, .callout, .related, .tool-fields, .tool-summary { background: var(--white); border: 1px solid var(--line); padding: 24px; border-radius: var(--radius); }
.card { display: flex; flex-direction: column; }
.card h3 { margin-bottom: 8px; }
.card p { flex: 1; }
.card a { font-size: 14px; font-weight: 650; }
.home-note { background: var(--soft); border-radius: var(--radius); padding: 24px; margin-bottom: 48px; }
.home-note h2 { margin-bottom: 8px; }
.home-note p, .tool-summary p:last-child { margin-bottom: 0; }
.site-footer { border-block-start: 1px solid var(--line); border-block-end: 0; padding: 24px 0; }
.site-footer p { margin: 8px 0 0; font-size: 13px; }

.page-intro { padding: 40px 0 8px; }
.page-intro h1 { max-width: 32ch; margin-bottom: 12px; }
.reading { max-width: 720px; margin-bottom: 48px; }
.reading section { margin-bottom: 32px; }
.reading li + li { margin-top: 4px; }
.stamp, .small { font-size: 13px; line-height: 19px; }
.callout, .related, .tool-summary { background: var(--soft); }
.jump { margin-bottom: 24px; font-size: 14px; }
.sources { border-top: 1px solid var(--line); padding-top: 24px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: 12px; border: 1px solid var(--line); overflow-wrap: anywhere; }
thead th { background: var(--soft); }
thead th:first-child { width: 25%; }
.table-label { display: none; }

.tool-wrap { margin-bottom: 48px; }
.tool { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tool-summary { position: sticky; top: 16px; overflow-wrap: anywhere; }
.tool-summary h2, .tool-section h2, .tool-section > legend { font-size: 18px; line-height: 26px; margin-bottom: 8px; font-weight: 650; }
.result-main { color: var(--green); font-size: 14px; font-weight: 650; }
.result-amount { display: block; font-size: 32px; line-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tool-summary ul { padding-inline-start: 20px; font-size: 14px; }
.tool-section { margin: 0 0 24px; padding: 0; border: 0; }
fieldset { min-width: 0; }
.window-group { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.window-group legend { padding: 0 4px; color: var(--green); font-weight: 650; }
.window-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
label { display: block; font-size: 14px; font-weight: 600; line-height: 20px; }
input, select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px; font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; border: 1px solid #778675; border-radius: 8px; color: var(--ink); background: var(--white); }
label input, label select { margin-top: 4px; }
input:disabled { background: #efefe7; }
.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9rem) minmax(0, 7rem); align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.text-button { background: none; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: .2em; font: inherit; font-size: 14px; font-weight: 650; padding: 8px 4px; min-height: 44px; cursor: pointer; }
.quote-row { border: 0; border-bottom: 1px solid var(--line); margin: 0 0 16px; padding: 0 0 16px; }
.quote-row legend { padding: 0; margin-bottom: 4px; font-weight: 650; }
.quote-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quote-pair label { color: var(--muted); }
.quote-print-value { display: none; }
#example-status:empty { display: none; }
#example-status { margin-top: 8px; }

@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .shell { width: calc(100% - 40px); }
  .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; gap: 12px; padding-block: 12px; }
  header nav, footer nav { gap: 8px 16px; }
  h1 { font-size: 30px; line-height: 36px; }
  h2 { font-size: 24px; line-height: 32px; }
  .hero h1 { font-size: 34px; line-height: 40px; }
  .hero { grid-template-columns: 1fr; gap: 16px; margin-block: 24px 32px; }
  .hero-text { padding: 8px; }
  .hero-photo { min-height: 0; aspect-ratio: 1.6; }
  .page-intro { padding-top: 24px; }
  .tool { grid-template-columns: minmax(0, 1fr); }
  .tool-summary { position: static; }
  .result-amount { font-size: 28px; line-height: 34px; }
  .card, .callout, .related, .tool-fields, .tool-summary { padding: 16px; }
  .window-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window-inputs label:last-child { grid-column: 1 / -1; }
  .fee-row { grid-template-columns: minmax(0, 1fr) minmax(0, 6rem); }
  .fee-row label { grid-column: 1 / -1; }
  .reading table, .reading tbody, .reading tr, .reading tbody th, .reading td { display: block; }
  .reading thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .reading tr { border: 1px solid var(--line); margin-bottom: 12px; }
  .reading tbody th { background: var(--soft); }
  .reading th, .reading td { border: 0; }
  .table-label { display: block; font-weight: 650; margin-bottom: 4px; }
}
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
}
@media print {
  header, footer, .skip, .form-actions, .related { display: none; }
  .shell { width: 100%; }
  body, .tool-fields, .tool-summary { background: white; }
  .tool { display: block; }
  .tool-summary { margin-top: 16px; }
  .quote-row { break-inside: avoid; }
  .quote-pair input, .quote-pair select { display: none; }
  .quote-print-value {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }
}
