:root {
  color-scheme: light;
  --page: #f1f3ec;
  --paper: #fffefa;
  --ink: #172e29;
  --muted: #4f655e;
  --border: #dbe2d7;
  --forest: #103831;
  --green: #236353;
  --lime: #d5f394;
  --infiltrated: #277562;
  --stored: #afcb68;
  --spill: #ad5440;
  --baseline: #5b7974;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.68rem; letter-spacing: -.035em; line-height: 1.2; }
h3 { font-size: 1.17rem; letter-spacing: -.02em; line-height: 1.3; }
button, input, select { font: inherit; }
button:not(:disabled), summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid #327f69; outline-offset: 3px; }
button:disabled { opacity: .5; }
.shell { width: min(1440px, calc(100% - 80px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid #dde4d8; }
.masthead-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.035em; font-size: 1.2rem; }
.brand > span:last-child { color: var(--green); margin-left: -7px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; background: var(--forest); border-radius: 11px; }
.brand-mark span { position: relative; width: 13px; height: 17px; border-radius: 80% 35% 65% 65%; background: var(--lime); transform: rotate(21deg); }
.brand-mark span::after { content: ''; position: absolute; inset: 5px 4px 2px auto; border-left: 1px solid #466c49; transform: rotate(13deg); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 42px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: .89rem; white-space: nowrap; }
.secondary { background: var(--paper); color: var(--ink); border-color: var(--border); }
.secondary:hover:not(:disabled) { background: #e8efe1; }
.primary { background: var(--lime); color: #182d20; }
.primary:hover { background: #e4ffaf; }
.primary:focus-visible { outline-color: #fff; }
.hero { isolation: isolate; position: relative; overflow: hidden; margin: 22px 0 24px; border-radius: 19px; min-height: 305px; background: #10382f; display: flex; align-items: center; }
.hero-media { position: absolute; z-index: -1; inset: 0 0 0 34%; background: linear-gradient(90deg, #10382f, #10382f18 45%, transparent 80%), url('./assets/rain-garden.webp') center 58% / cover no-repeat; }
.hero-content { padding: 30px 42px; color: #f7f9ef; }
.eyebrow { margin-bottom: 10px; color: #d5f394; font-size: .74rem; font-weight: 750; letter-spacing: .16em; }
.hero h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(3.25rem, 5.4vw, 5.45rem); font-weight: 400; letter-spacing: -.065em; line-height: .88; }
.hero-content > p:not(.eyebrow) { max-width: 340px; margin: 16px 0; color: #e2e9dd; line-height: 1.45; font-size: .94rem; }
.lab { scroll-margin: 16px; }
.lab-heading, .card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lab-heading { margin-bottom: 13px; align-items: end; }
.muted { color: var(--muted); font-size: .89rem; line-height: 1.42; margin-top: 3px; }
.presets { display: flex; width: fit-content; padding: 3px; gap: 3px; border: 1px solid #d5ded3; background: #e9eee4; border-radius: 10px; }
.presets button { min-height: 37px; background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 13px; color: #344d43; font-size: .86rem; font-weight: 650; }
.presets button:hover { background: #f5f7f1; }
.presets button[aria-pressed='true'] { background: #fffefa; color: #174737; border-color: #dbe3d7; box-shadow: 0 1px 2px #16321f14; }
.compact button { min-height: 34px; padding-inline: 9px; }
.workspace { display: grid; grid-template-columns: minmax(270px, .87fr) minmax(0, 2.4fr); gap: 16px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--border); background: var(--paper); border-radius: 14px; padding: 18px 20px; }
.inputs h3 { margin-bottom: 14px; }
fieldset { margin: 0 0 12px; padding: 9px 0 0; border: 0; min-inline-size: 0; }
fieldset:not(:last-of-type) { padding-bottom: 12px; border-bottom: 1px solid #e0e5db; }
fieldset:last-of-type { margin-bottom: 0; }
legend { padding: 0; font-size: .72rem; text-transform: uppercase; color: var(--green); letter-spacing: .09em; font-weight: 750; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 11px; }
.fields .wide { grid-column: 1 / -1; }
.fields label { display: grid; gap: 4px; min-width: 0; font-size: .83rem; font-weight: 600; }
.number { position: relative; display: block; }
.number span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: .72rem; color: var(--muted); pointer-events: none; }
input, select { min-height: 37px; background: #f9faf5; color: var(--ink); border: 1px solid #d4ded1; border-radius: 7px; padding: 5px 8px; min-width: 0; }
input { appearance: textfield; width: 100%; padding-right: 40px; font-variant-numeric: tabular-nums; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; }
input[aria-invalid='true'] { border-color: #ad5440; }
.validation { font-size: .82rem; color: #8d3b2d; margin-top: 12px; }
.results { display: grid; gap: 12px; min-width: 0; }
.scenario-name { font-size: .68rem; background: #e6efe1; color: #215541; padding: 5px 8px; border-radius: 5px; letter-spacing: .075em; font-weight: 750; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.metrics > div { background: #f0f3ec; padding: 9px 13px; border-radius: 9px; display: grid; align-content: start; gap: 1px; }
.metrics .captured { background: #e5f3ce; }
.metrics span { font-size: .79rem; color: #344e44; font-weight: 650; }
.metrics strong { font-size: clamp(1.15rem, 2.3vw, 2rem); letter-spacing: -.045em; line-height: 1.1; margin-block: 3px; overflow-wrap: anywhere; }
.metrics small { font-size: .74rem; line-height: 1.35; color: #4e6258; }
.balance { display: flex; height: 9px; overflow: hidden; border-radius: 15px; background: #e8ece2; }
.balance span { width: 0; }
.infiltrated { background: var(--infiltrated); }
.stored { background: var(--stored); }
.spill { background: var(--spill); }
.baseline { background: var(--baseline); }
.legend { list-style: none; padding: 0; margin: 7px 0 0; display: flex; flex-wrap: wrap; gap: 4px 17px; font-size: .76rem; color: var(--muted); }
.legend li { display: flex; align-items: baseline; gap: 5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.legend b { color: var(--ink); }
.chart-heading { align-items: start; }
.chart-legend { margin-top: 8px; }
#chart { display: block; width: 100%; height: 172px; margin-top: 1px; }
.chart-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 4px; }
details { min-width: 0; flex: 1; }
summary, .text-button { color: #215d49; font-size: .83rem; font-weight: 700; }
summary { width: fit-content; min-height: 30px; padding-block: 6px; }
.text-button { background: transparent; border: none; padding: 6px 0 6px 5px; min-height: 31px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.table-wrap { overflow: auto; max-height: 250px; margin-top: 5px; }
table { border-collapse: collapse; width: 100%; text-align: right; font-size: .8rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding-block: 5px; color: var(--muted); }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: #edf2e8; }
.planner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 14px; }
.plan-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.plan-controls label { color: var(--muted); font-size: .82rem; }
.plan-controls strong { font-size: 1.12rem; color: #205743; min-width: 62px; }
.plan-controls .button { min-height: 36px; }
.plan-note { grid-column: 1 / -1; margin: 0; }
footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 13px 0 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }
footer span:first-child { font-weight: 700; white-space: nowrap; }
dialog { color: var(--ink); border: 1px solid var(--border); border-radius: 15px; width: min(620px, calc(100% - 28px)); background: var(--paper); padding: 23px; line-height: 1.53; }
dialog::backdrop { background: #142c25ac; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
dialog li { margin-block: 9px; }
dialog ol { padding-left: 25px; }
dialog p { background: #edf2e8; border-radius: 8px; padding: 10px 13px; font-size: .91rem; }
.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: fixed; top: 10px; left: 10px; z-index: 2; padding: 8px 12px; background: var(--paper); color: var(--ink); }
@media (max-width: 1050px) {
  .shell { width: calc(100% - 42px); }
  .planner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .results { display: contents; }
  .overview { grid-row: 1; }
  .hero { margin-top: 14px; min-height: 286px; }
  .hero-content { padding: 25px 21px; }
  .hero-media { inset: 0 0 0 15%; background-position: center, 62% 50%; background-image: linear-gradient(90deg, #10382f, #10382f88 60%, #10382f36), url('./assets/rain-garden.webp'); }
  .lab-heading { flex-direction: column; align-items: flex-start; }
  .masthead-inner { min-height: 59px; }
  .brand { font-size: 1.05rem; }
  .masthead .button { min-height: 36px; padding: 6px 9px; font-size: .76rem; gap: 5px; }
  .panel { padding: 13px 12px; }
  .metrics { gap: 5px; }
  .metrics > div { padding: 8px 6px; }
  .metrics span, .metrics small { font-size: .70rem; }
  .chart-heading { flex-wrap: wrap; }
  .chart-footer { flex-wrap: wrap-reverse; }
  .chart-footer > * { flex: 0 0 100%; }
  .text-button { text-align: left; padding-left: 0; }
  input, select { font-size: 1rem; }
}
