:root {
  color-scheme: light;
  --ink: #152c31;
  --muted: #40585d;
  --surface: #fff;
  --page: #f4f7f6;
  --line: #c4d2cf;
  --control: #7a918f;
  --hero: #132e33;
  --hero-panel: #1b3c42;
  --hero-text: #cce1df;
  --accent: #85e4cc;
  --action: #12564b;
  --focus: #006f63;
  --warning: #824000;
  --warning-bg: #f8ead5;
  --radius: 0.65rem;
  --wrap: 72rem;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
h1, h2, h3, h4, h5, p, dl { margin: 0; }
h1, h2, h3, h4, h5 { line-height: 1.18; }
a { color: var(--action); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(calc(100% - 3rem), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: 0; transform: translateY(-150%); background: var(--surface); padding: 0.5rem; z-index: 1; }
.skip:focus { transform: none; }

.site-header, .hero { background: var(--hero); color: var(--surface); }
.masthead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 1rem; padding-block: 1.15rem; border-bottom: 1px solid #416166; }
.brand { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.02em; }
.brand strong { color: var(--accent); }
.masthead-note { color: var(--hero-text); font-size: 0.875rem; }

.hero-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(2.75rem, 6vw, 5.25rem); }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.875rem; margin-bottom: 0.7rem; }
.eyebrow.dark { color: var(--action); }
.hero h1 { font-size: clamp(2.6rem, 5.8vw, 4.65rem); letter-spacing: -0.055em; line-height: 1; }
.intro { max-width: 34rem; color: var(--hero-text); margin-block: 1.2rem 1.6rem; font-size: 1.125rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; border-radius: 0.45rem; padding: 0.55rem 1rem; border: 1px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.hero-button { color: var(--hero); background: var(--accent); }
.hero-button:hover { background: #b1f2e3; }
.hero-button:focus-visible { outline-color: var(--accent); }
.example { background: var(--hero-panel); border: 1px solid #4d6f73; border-radius: var(--radius); padding: clamp(1.15rem, 3vw, 1.8rem); }
.example h2 { font-size: 1.45rem; letter-spacing: -0.025em; }
.example h2 + p { color: var(--hero-text); margin-block: 0.65rem; }
.example a { color: var(--accent); font-weight: 650; }
.example a:focus-visible { outline-color: var(--accent); }

.content { padding-block: clamp(2.25rem, 5vw, 4.15rem); }
.content h2 { font-size: clamp(1.75rem, 3.3vw, 2.65rem); letter-spacing: -0.04em; }
.lede { max-width: 43rem; margin-block: 0.8rem; color: var(--muted); font-size: 1.0625rem; }
.privacy-line { margin-block: 0.75rem 1.75rem; color: var(--muted); }
#worksheet, #worked-example { scroll-margin-top: 1rem; }
.guide { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.guide h3 { margin-top: 1.35rem; }
.guide ol { padding-left: 1.35rem; }
.guide-result, .guide-sources { max-width: 48rem; margin-top: 0.9rem; }
.worked-table { width: min(100%, 51rem); table-layout: fixed; border-collapse: collapse; background: var(--surface); font-size: 0.9375rem; }
.worked-table caption { padding-bottom: 0.6rem; text-align: left; color: var(--muted); }
.worked-table th, .worked-table td { width: 33.33%; padding: 0.65rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; border: 1px solid var(--line); }
.worked-table thead th { background: #e5f2ee; }
.not-found { max-width: 36rem; }
.not-found h1 { margin-bottom: 0.75rem; }
.not-found p { margin-bottom: 1.25rem; }
.quote-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; padding: clamp(1rem, 2.5vw, 1.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quote { margin: 0; }
.quote legend { padding-inline: 0.4rem; font-weight: 700; font-size: 1.3rem; }
label { display: block; font-size: 0.9375rem; font-weight: 650; margin-bottom: 0.35rem; }
input, select, textarea { width: 100%; min-width: 0; min-height: 2.75rem; padding: 0.55rem 0.65rem; background: var(--surface); color: var(--ink); border: 1px solid var(--control); border-radius: 0.375rem; font: inherit; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23152c31' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 1rem; text-overflow: ellipsis; }
.help { color: var(--muted); font-size: 0.875rem; margin-top: 0.35rem; }
.quote > .help, .field-pair, .permit-owner { margin-bottom: 0.85rem; }
.quote > .help:last-child { margin-bottom: 0; }
.field-pair { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
[aria-invalid="true"] { border-color: var(--warning); outline-color: var(--warning); }

.rebate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr); gap: 1rem 2rem; margin-top: 1.1rem; }
.rebate h3 { font-size: 1.35rem; letter-spacing: -0.02em; }
.rebate p, .results > p { margin-top: 0.45rem; color: var(--muted); }
details { margin-top: 0.6rem; }
summary { cursor: pointer; color: var(--action); font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.primary { background: var(--action); color: var(--surface); }
.primary:hover { background: #0a463c; }
.secondary { background: var(--surface); color: var(--action); border-color: var(--control); }
.secondary:hover:not(:disabled) { background: #e5f2ee; }
button:disabled { cursor: default; opacity: 0.65; }
#credit-entry { margin-top: 0.85rem; }

.results { margin-top: 2rem; }
.results h3 { font-size: 1.65rem; }
.results .quote-grid { margin-top: 1rem; }
.result-card h4, .result-card h5 { font-size: 1rem; }
.result-card > p { margin-top: 0.45rem; }
.result-amount { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status { display: inline-block; padding: 0.2rem 0.5rem; background: var(--warning-bg); color: var(--warning); border-radius: 0.25rem; font-size: 0.875rem; font-weight: 650; }
.status.resolved { background: #dff5ed; color: var(--action); }
.scope-summary { margin-block: 1rem; }
.scope-summary div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0.45rem 0; border-top: 1px solid var(--line); gap: 0.75rem; }
.scope-summary dt { font-weight: 650; }
.scope-summary dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-card ul { margin-bottom: 0; padding-left: 1.2rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 1.5rem; gap: 1rem 2rem; font-size: 0.875rem; }
.footer-layout strong { color: var(--ink); }

@media (max-width: 54rem) {
  .field-pair { grid-template-columns: 1fr; }
}
@media (max-width: 43rem) {
  .wrap { width: calc(100% - 2rem); }
  .hero-layout, .quote-grid, .rebate, .footer-layout { grid-template-columns: 1fr; }
  .wide-break { display: none; }
  .worked-table th, .worked-table td { padding: 0.45rem; }
}
@media print {
  .site-header, .hero, .actions, .skip { display: none !important; }
  .wrap { width: 100%; }
}
