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

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f3e9;
  --white: #fdfbf5;
  --ink: #1b2922;
  --muted: #525e53;
  --rule: #d7d9ca;
  --control: #969e8e;
  --green: #1c3d30;
  --green-deep: #19372c;
  --green-light: #dce6d9;
  --accent: #dce894;
  --accent-hover: #e8f2af;
  --neutral: #eeeade;
  --error: #8a342c;
  --sans: "DM Sans", "Avenir Next", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 1rem/1.58 var(--sans); }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
a { color: inherit; text-underline-offset: 4px; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #43724e; outline-offset: 4px; }
[hidden] { display: none !important; }

.wrap { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 8px 16px; background: var(--white); }

.masthead-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.masthead-inner { min-height: 80px; }
.brand { color: var(--green); display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 600; line-height: 1; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
nav { display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: .9rem; }
nav a, .header-action { text-decoration: none; }
nav a:hover, .header-action:hover { text-decoration: underline; }
.header-action { font-size: .88rem; font-weight: 600; }
.header-action span { margin-left: 4px; }

.hero { min-height: 508px; border-radius: 16px; background: #d2bea4; position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden; }
.hero-art { width: 82%; height: 100%; object-fit: cover; object-position: center 49%; position: absolute; inset: 0 0 0 auto; z-index: -1; mask-image: linear-gradient(to right, transparent, black 20%); }
.hero-copy { padding: 64px; }
.hero h1 { font-size: clamp(3.9rem, 6.7vw, 6.1rem); line-height: .95; letter-spacing: -.036em; }
.hero-lede { max-width: 32ch; margin-top: 24px; font-size: 1.15rem; line-height: 1.52; color: #2b3b30; }
.hero-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-actions { margin-top: 28px; }
.button, .text-button { font-size: .88rem; font-weight: 600; line-height: 1.25; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; color: var(--white); background: var(--green); text-align: center; text-decoration: none; }
.button:hover { background: #2e5142; }
.button.secondary { color: var(--green); background: transparent; border-color: var(--control); }
.button.secondary:hover { background: #edf0e3; }
.button.accent { background: var(--accent); color: var(--green-deep); }
.button.accent:hover { background: var(--accent-hover); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.arrow { font: 400 1rem/1 var(--sans); }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 0; min-height: 28px; background: transparent; border: 0; color: var(--green-deep); text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: #47664d; }

.scope-strip { border-bottom: 1px solid var(--rule); }
.scope-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; min-height: 64px; padding-block: 12px; color: #475548; font-size: .86rem; }
.scope-inner > * { display: inline-flex; align-items: center; gap: 8px; }
.scope-inner > :nth-child(2), .scope-inner > :nth-child(3) { margin-left: auto; }
.scope-inner a { text-decoration: none; }
.scope-inner a:hover { text-decoration: underline; }
.scope-dot { width: 8px; height: 8px; border-radius: 50%; background: #5e7747; }

.simulator-section { padding-block: 72px 80px; }
.section-intro { display: grid; grid-template-columns: 1.45fr 1fr; align-items: end; gap: 28px; margin-bottom: 28px; }
.meta { color: var(--muted); font-family: var(--mono); font-size: .76rem; line-height: 1.5; }
.section-title { font-size: clamp(3rem, 5vw, 4.75rem); line-height: .98; letter-spacing: -.025em; }
.section-intro p:not(.meta) { max-width: 45ch; color: var(--muted); }
.section-intro .meta { margin-bottom: 8px; }
.simulator-grid { display: grid; grid-template-columns: 1.45fr 1fr; align-items: start; gap: 24px; }
.panel { min-width: 0; border: 1px solid var(--rule); background: var(--white); border-radius: 16px; padding: 32px; }
.panel-title, .subsection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-title { margin-bottom: 20px; }
.panel-title h3 { font-size: 2.5rem; line-height: 1; }
.panel-title .text-button, .subsection-heading .text-button { flex: none; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fields + .subsection-heading { margin-top: 28px; }
.bank-choice { max-width: 320px; }
.bank-scope { margin-block: 8px 16px; }
label { display: block; font-size: .875rem; font-weight: 600; color: var(--ink); }
label > :is(input, select, textarea) { margin-top: 4px; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; color: var(--ink); background: #fffdf8; border: 1px solid var(--control); border-radius: 8px; font-size: .96rem; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #62685d; opacity: 1; }
input[type="number"] { appearance: textfield; font-variant-numeric: tabular-nums; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; }
input[type="file"] { font-size: .88rem; }
input::file-selector-button { margin-right: 8px; padding: 4px 8px; background: var(--neutral); border: 1px solid var(--rule); border-radius: 4px; font: inherit; color: var(--ink); cursor: pointer; }
textarea { min-height: 92px; resize: vertical; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-weight: 400; }
.check input { min-height: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.subsection-heading h4 { font-size: 1rem; font-weight: 600; }
.note { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.notice { background: #f1efdf; border-left: 3px solid #687f4f; color: var(--ink); padding: 12px 16px; font-size: .875rem; margin-bottom: 16px; }
.conditions { border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 20px; }
.conditions + .note { margin-top: 12px; }
.entry-actions { margin-top: 20px; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.input-table { table-layout: fixed; margin-top: 8px; text-align: left; }
.input-table .metric-label { width: 36%; }
.input-table th, .input-table td { padding: 4px; font-size: .84rem; }
.input-table th:first-child { padding-left: 0; }
.input-table :is(td, th):last-child { padding-right: 0; }
.input-table tbody th { line-height: 1.32; }
.input-table thead th { color: var(--muted); font-weight: 500; }
.input-table thead th:not(:first-child) { text-align: center; }
.input-table input { text-align: center; padding-inline: 4px; }
.input-table select { padding-inline: 4px; text-overflow: ellipsis; }
.input-table small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: .76rem; }
details { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 16px; }
details summary { color: var(--green); font-size: .89rem; font-weight: 600; }
details[open] summary { margin-bottom: 12px; }
.extra { margin-block: 12px 0; }

.result { min-width: 0; }
.result-head { padding: 32px; min-height: 220px; background: var(--green-deep); color: var(--white); border-radius: 16px 16px 0 0; }
.result-head:focus { outline: 2px solid var(--accent); outline-offset: -5px; }
.status { display: inline-block; color: var(--green-light); font-family: var(--mono); font-size: .74rem; line-height: 1.5; }
.result-head[data-state="supported"] .status { color: var(--accent); }
.result-head h3 { margin-top: 8px; font-size: clamp(2.6rem, 4.8vw, 4rem); line-height: .96; letter-spacing: -.018em; }
.result-head[data-state="supported"] h3 { color: var(--accent); font-variant-numeric: tabular-nums; }
.result-head p { margin-top: 16px; color: var(--green-light); font-size: .91rem; }
.receipt { padding: 24px 32px; background: var(--white); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 16px 16px; }
.result-measures > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 12px; border-bottom: 1px dashed #c7cbbb; font-size: .93rem; }
.result-measures > div:first-child { padding-top: 0; }
.result-measures dt { font-weight: 600; }
.result-measures dt span { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.result-measures dd { font-size: .94rem; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
#result-details { margin-top: 16px; }
.result .actions { margin-top: 20px; }
.warnings, .source-list { padding-left: 20px; margin: 12px 0 0; color: var(--muted); font-size: .85rem; }
.warnings li + li, .source-list li + li { margin-top: 4px; }
.output-table { margin-bottom: 12px; font-size: .82rem; }
.comparison-table-scroll { overflow-x: auto; }
.comparison-table-scroll .output-table { min-width: 22rem; }
.output-table caption { text-align: left; color: var(--muted); margin-bottom: 8px; }
.output-table :is(th, td) { border-bottom: 1px solid var(--rule); padding: 4px 3px; text-align: right; }
.output-table :is(th, td):first-child { text-align: left; }
.cost-cycle { border-top: 1px solid var(--rule); padding-block: 8px; color: var(--muted); font-size: .83rem; }
.cost-cycle > p { margin-bottom: 4px; font-weight: 600; color: var(--ink); }

.report { margin-top: 24px; border: 1px solid var(--rule); border-radius: 16px; padding: 24px 32px; background: #efeddf; }
.report h3 { font-size: 2.3rem; line-height: 1.1; margin-block: 4px 8px; }
.report p:not(.meta) { color: var(--muted); font-size: .92rem; }
.report .text-button { margin-top: 12px; }

.guide { scroll-margin-top: 24px; padding-block: 72px; background: #eeebdf; border-block: 1px solid var(--rule); }
.guide-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; }
.guide-grid > div > p { max-width: 38ch; margin-block: 20px 12px; color: var(--muted); }
.guide-grid a { font-size: .9rem; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps li { counter-increment: guide-step; display: grid; grid-template-columns: 28px 1fr; gap: 16px; padding-block: 20px; border-top: 1px solid var(--rule); }
.guide-steps li:last-child { border-bottom: 1px solid var(--rule); }
.guide-steps li::before { content: counter(guide-step, decimal-leading-zero); color: var(--muted); font: .78rem/2.4 var(--mono); }
.guide-steps h3 { font-size: 1.85rem; line-height: 1.1; }
.guide-steps p { margin-top: 4px; color: var(--muted); font-size: .92rem; }

.packages { padding-block: 72px 80px; }
.bank-directory { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.bank-directory a { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 16px; padding: 12px 8px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.bank-directory a:hover { background: var(--neutral); }
.bank-directory strong { font: 400 clamp(1.45rem, 4vw, 2.25rem) var(--serif); }
.bank-directory span { color: var(--muted); }
.bank-directory .directory-link { color: var(--green-deep); text-decoration: underline; font-size: .88rem; }

.footer { border-top: 1px solid var(--rule); padding-block: 24px; }
.footer .brand { font-size: 1rem; gap: 8px; }
.footer p { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.footer nav { flex-wrap: wrap; }

.dialog-dismiss { position: absolute; top: 16px; right: 16px; }
.dialog-dismiss button { width: 32px; min-height: 32px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 400; text-decoration: none; }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 32px; overflow: auto; color: var(--ink); background: var(--white); border: 1px solid var(--rule); border-radius: 16px; }
dialog::backdrop { background: #142719a8; }
dialog h2 { padding-right: 24px; font-size: clamp(2.35rem, 5vw, 3.2rem) !important; margin-bottom: 16px; }
dialog p + p, dialog p + label, dialog label + p, dialog .actions { margin-top: 12px; }
.share-preview { margin-block: 12px; padding: 16px; background: var(--neutral); border-radius: 8px; }
.share-preview dl div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; border-top: 1px dashed #c7cbbb; padding-block: 6px; font-size: .87rem; }
.share-preview dl div:first-child { border-top: 0; }
.share-preview dd { font-weight: 600; }
.share-preview .warnings { margin-top: 4px; }
#share-created label:not(:first-child) { margin-top: 12px; }
#ofx-review .check { margin-top: 12px; }
#ofx-total > li { margin-top: 8px; }
.form-status:not(:empty) { margin-top: 12px; font-size: .9rem; }
.form-status[data-error] { color: var(--error); }
.feedback-entry { margin-top: 12px; }
#feedback-form fieldset { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
#feedback-form label { margin-top: 12px; }

.subpage-main { padding-block: 64px 80px; }
.subpage-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 48px; align-items: start; }
.subpage-grid > header { max-width: 38ch; }
.subpage-grid > header > .meta { margin-block: 16px 8px; }
.subpage-grid > header > .section-title { margin-bottom: 16px; }
.subpage-grid > header > p:not(.meta) { color: var(--muted); }
.subpage-grid .panel > .actions, .interest-form .actions { margin-top: 16px; }
.interest-form { display: grid; gap: 16px; }
.interest-form .note { font-weight: 400; }
.interest-form .actions { margin: 0; }
.interest-form .form-status:not(:empty) { margin: 0; }
.interest-success h2 { font-size: 2.7rem; line-height: 1.02; margin-bottom: 12px; }
.interest-success p { margin-top: 8px; }
.interest-success input { margin-top: 4px; }
.interest-success label { margin-top: 16px; }
.policy { max-width: 720px; }
.policy h1, .policy h2 { margin-bottom: 16px; }
.policy h2 { margin-top: 32px; font-size: 2rem; }
.policy p + p { margin-top: 12px; }

.shared-page { min-height: 100dvh; }
.shared-wrap { max-width: 680px; padding-block: 48px 72px; }
.shared-card { margin-top: 24px; background: var(--white); padding: clamp(20px, 5vw, 40px); border: 1px solid var(--rule); border-radius: 16px; }
.shared-card h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); line-height: 1; margin-block: 8px 16px; }
.shared-card :is(p, form, .actions) + :is(p, form, .actions) { margin-top: 16px; }
.shared-card .status { color: var(--muted); }
.shared-card label { margin-bottom: 12px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (max-width: 960px) {
  .wrap { width: calc(100% - 48px); }
  .hero { min-height: 440px; }
  .hero-copy { padding: 40px; }
  .hero h1 { font-size: clamp(3.45rem, 7.6vw, 4.75rem); }
  .panel, .result-head, .receipt, .report { padding: 24px; }
  .simulator-grid { gap: 16px; grid-template-columns: 1.3fr 1fr; }
  .guide-grid { gap: 32px; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-inner { min-height: 64px; }
  .hero { min-height: 0; background: #d7c6ab; }
  .hero-art { position: relative; inset: auto; grid-row: 2; z-index: auto; width: 100%; aspect-ratio: 2.2 / 1; object-position: right 54%; height: auto; mask-image: linear-gradient(to bottom, transparent, black 24%); }
  .hero-copy { padding: 32px 28px 20px; }
  .hero h1 { font-size: clamp(2.9rem, 9vw, 4.25rem); }
  .hero-lede { font-size: 1rem; margin-top: 16px; }
  .hero-actions { margin-top: 20px; }
  .scope-inner { gap: 8px 16px; }
  .scope-inner > :nth-child(2), .scope-inner > :nth-child(3) { margin-left: 0; }
  .simulator-section, .guide, .packages { padding-block: 48px; }
  .section-intro, .simulator-grid, .guide-grid, .subpage-grid { grid-template-columns: 1fr; }
  .section-intro { gap: 12px; margin-bottom: 20px; }
  .simulator-grid { gap: 20px; }
  .result-head { min-height: 0; }
  .report { margin-top: 20px; }
  .subpage-main { padding-block: 32px 48px; }
  .subpage-grid { gap: 24px; }
  .header-action { display: none; }
}

@media (max-width: 440px) {
  .masthead-inner { gap: 8px; }
  .brand { gap: 8px; font-size: 1.04rem; }
  .brand img { width: 30px; height: 30px; }
  nav { gap: 12px; font-size: .81rem; }
  .hero-copy { padding: 28px 20px 16px; }
  .hero-actions { gap: 8px 16px; }
  .hero-actions .button { width: 100%; justify-content: space-between; }
  .hero-art { aspect-ratio: 2.1 / 1; }
  .scope-inner { column-gap: 16px; font-size: .79rem; }
  .panel, .result-head, .receipt, .report, dialog { padding: 20px; }
  .panel-title h3 { font-size: 2.15rem; }
  .fields { grid-template-columns: 1fr; gap: 12px; }
  .input-table .metric-label { width: 34%; }
  .input-table th, .input-table td { padding: 4px 2px; font-size: .77rem; }
  .input-table small { font-size: .7rem; }
  .input-table input, input, select, textarea { font-size: 1rem; }
  .bank-directory a { grid-template-columns: 1fr auto; gap: 0 12px; }
  .bank-directory .directory-link { grid-column: 2; grid-row: 1 / span 2; }
  .footer-inner { flex-direction: column; align-items: start; gap: 16px; }
}

.shared-card .section-title { font-size: clamp(1.9rem, 5vw, 2.45rem); }
.shared-card .table-wrap { overflow-x: auto; margin-top: 12px; }
.shared-card table th, .shared-card table td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; font-size: .86rem; }
.cost-cycle > div { margin-bottom: 12px; }
.cost-cycle > div > p { font-weight: 600; color: var(--ink); }
.cost-cycle ul { margin-block: 4px; padding-left: 18px; }
.policy-form { margin-top: 20px; }
.interest-success .actions { margin-top: 16px; }
.shared-card .result-measures { margin-top: 20px; }
.shared-card .result-measures + h2 { margin-top: 16px; }
