:root {
  --surface: #f7f4ec;
  --surface-raised: #ffffff;
  --surface-inset: #e9e3d5;
  --button-surface: #ffffff;
  --text-bright: #20332c;
  --text-muted: #607068;
  --observed-accent: #27865d;
  --observed-bright: #e4f6eb;
  --future-accent: #d77722;
  --future-bright: #ffe8cc;
  --info: #315a85;
  --track: #b7cbe0;
  --danger: #c84e45;
  --map-dark: #d6e1d8;
  --on-accent: #ffffff;
  --ink: var(--text-bright);
  --paper: var(--surface);
  --line: var(--track);
  --pine: var(--observed-accent);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text-bright); font: 16px/1.55 system-ui, -apple-system, Segoe UI, sans-serif; }
header { height: 62px; display: flex; align-items: center; gap: 24px; padding: 0 4vw; border-bottom: 1px solid var(--track); background: var(--surface-raised); }
a { color: var(--info); }
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-bright); text-decoration: none; }
nav { display: flex; gap: 15px; flex-wrap: wrap; }
nav a { font-size: .88rem; }
.map-page { height: calc(100vh - 62px); min-height: 580px; position: relative; }
.search-control { position: absolute; z-index: 2; top: 16px; left: 4vw; width: min(360px, calc(100% - 8vw)); padding: 12px; background: #ffffffec; border-left: 4px solid var(--observed-accent); box-shadow: 0 5px 18px #20332c26; }
.search-control label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.combobox { position: relative; margin-top: 5px; }
.search-control input { display: block; width: 100%; padding: 9px 38px 9px 9px; border: 1px solid var(--track); border-radius: 4px; background: var(--surface-raised); color: var(--text-bright); font: inherit; }
.combobox button { position: absolute; right: 1px; top: 1px; height: calc(100% - 2px); width: 35px; border: 0; border-left: 1px solid var(--track); background: var(--surface-inset); color: var(--text-bright); cursor: pointer; font-size: 1.2rem; }
.combobox ul { position: absolute; top: calc(100% + 3px); left: 0; right: 0; max-height: 270px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface-raised); border: 1px solid var(--track); border-radius: 4px; box-shadow: 0 8px 22px #20332c33; }
.combobox li { padding: 6px 8px; cursor: pointer; }
.combobox li:hover { background: var(--observed-bright); }
.location-actions { display: flex; align-items: center; gap: 9px; min-height: 30px; margin-top: 8px; }
#locate-county { appearance: none; flex-shrink: 0; border: 1px solid var(--track); border-radius: 4px; padding: 6px 9px; background: var(--button-surface); color: var(--text-bright); font: inherit; font-size: .8rem; cursor: pointer; }
#locate-county:hover, #locate-county:focus { background: var(--observed-accent); color: var(--on-accent); }
#locate-county:disabled { cursor: wait; opacity: .65; }
#location-status { font-size: .72rem; color: var(--text-muted); }
.layer-picker { position: absolute; z-index: 2; bottom: 18px; left: 4vw; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(510px, calc(100% - 8vw)); padding: 8px; background: #ffffffe8; box-shadow: 0 5px 18px #20332c26; }
.layer-picker button, .button { appearance: none; border: 1px solid var(--track); background: var(--button-surface); color: var(--text-bright); padding: 7px 9px; border-radius: 4px; font: inherit; font-size: .82rem; cursor: pointer; text-decoration: none; }
.layer-picker button:hover, .layer-picker button:focus, .button { background: var(--observed-accent); color: var(--on-accent); }
.layer-picker button[aria-pressed="true"] { background: var(--observed-accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--text-bright); }
.map-shell { height: 100%; position: relative; }
#map { height: 100%; width: 100%; background: var(--map-dark); }
#county-panel { position: absolute; z-index: 2; top: 18px; right: 4vw; max-width: 350px; max-height: calc(100% - 36px); overflow: auto; background: #ffffffee; padding: 18px 20px; border-left: 4px solid var(--observed-accent); box-shadow: 0 7px 25px #20332c33; }
#close-panel { position: absolute; top: 7px; right: 9px; border: 0; background: transparent; color: var(--text-muted); font-size: 1.65rem; line-height: 1; cursor: pointer; }
#county-panel h2 { margin: 0 28px 10px 0; font-size: 1.35rem; }
#county-panel p { margin: .55em 0; }
#legend { position: absolute; z-index: 2; right: 4vw; bottom: 18px; max-width: min(370px, calc(100% - 8vw)); padding: 9px 12px; background: #ffffffe8; box-shadow: 0 5px 18px #20332c26; font-size: .76rem; color: var(--text-muted); }
.article { max-width: 820px; margin: 0 auto; padding: 44px 24px 80px; }
.article h1 { font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.02; margin: .1em 0; }
.lead { font-size: 1.18rem; }
.crumb { font-size: .9rem; color: var(--text-muted); }
.county-links { columns: 3; list-style: none; padding: 0; }
.county-links li { margin: .3em 0; }

@media (max-width: 760px) {
  header { height: auto; min-height: 56px; padding: 11px 18px; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
  nav { gap: 10px; }
  .map-page { height: calc(100vh - 106px); min-height: 620px; }
  .search-control { top: 10px; left: 10px; width: calc(100% - 20px); padding: 10px; }
  .layer-picker { bottom: 10px; left: 10px; right: 10px; max-width: none; }
  .map-shell { height: 100%; }
  #county-panel { top: auto; bottom: 0; left: 0; right: 0; max-width: none; max-height: 43%; border-left: 0; border-top: 4px solid var(--observed-accent); }
  #legend { right: 10px; bottom: 83px; max-width: calc(100% - 20px); }
  .county-links { columns: 2; }
}
/* Keep source details and controls usable on small screens. */
body:has(.map-page) { height: 100dvh; display: flex; flex-direction: column; }
body:has(.map-page) header { flex-shrink: 0; }
.map-page { flex: 1; height: auto; min-height: 0; }
.search-control { z-index: 4; }
#county-panel { background: #fff; }
#county-panel details { margin: .6em 0; }
#county-panel summary { cursor: pointer; font-weight: 600; }
.pilot-notice { margin: 10px 0 16px; padding: 10px 12px; border-left: 4px solid #16877d; background: #e7f4f1; }
.pilot-notice h3 { margin: 0 0 6px; }
.pilot-notice p { margin: 5px 0; }
.article table { display: block; overflow-x: auto; border-collapse: collapse; }
.article th, .article td { padding: 10px; text-align: left; border-bottom: 1px solid var(--track); }
.article pre { overflow-x: auto; white-space: pre-wrap; }
.maplibregl-ctrl-bottom-left { bottom: 90px; }
@media (max-width: 760px) {
  .layer-picker { top: 143px; bottom: auto; z-index: 3; flex-wrap: nowrap; overflow-x: auto; }
  .layer-picker button { flex-shrink: 0; }
  #legend { top: 202px; bottom: auto; left: 10px; right: 10px; }
  .map-shell:has(#county-panel:not([hidden])) .maplibregl-ctrl-bottom-left { bottom: 44%; }
}

.county-section { margin: 2rem 0; padding: 1.4rem; border: 1px solid var(--track); border-radius: 8px; background: var(--surface-raised); }
.county-section h2 { margin-top: 0; }
.county-facts { display: flex; flex-wrap: wrap; gap: 1rem 3rem; }
.county-facts dt { color: var(--text-muted); font-size: .85rem; }
.county-facts dd { margin: 0; font-size: 1.6rem; font-weight: 700; }
.county-directory { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: .6rem 1rem; }
.county-directory li { padding: .6rem; background: var(--surface-raised); border-radius: 4px; }
.county-directory [hidden] { display: none; }
.directory-search, .email-form input[type=email] { width: 100%; max-width: 480px; padding: 12px; font: inherit; border: 1px solid var(--text-muted); border-radius: 4px; background: white; color: var(--text-bright); }
.email-form { margin: 2rem 0; }
.email-form fieldset { margin: 0; border: 1px solid var(--track); padding: 1.25rem; border-radius: 8px; }
.email-form legend { font-weight: 700; }
.email-form label[for=alert-email] { display: block; margin-bottom: .4rem; }
.check-row { display: flex; align-items: flex-start; gap: .7rem; padding: .65rem 0; cursor: pointer; }
.check-row input { width: 18px; height: 18px; flex-shrink: 0; margin-top: .25rem; }
.check-row small { display: block; color: var(--text-muted); }
.development-warning { margin: 1.25rem 0; padding: 1rem; color: #991b1b; background: #fef2f2; border: 1px solid #991b1b; border-left-width: 4px; border-radius: 6px; }
.development-warning strong, .development-warning-text { display: block; }
.development-warning strong { margin-bottom: .35rem; }
.development-warning input { accent-color: #991b1b; }
.alert-summary { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--track); border-radius: 8px; }
.alert-summary h2 { margin-top: 0; }
.alert-summary li { margin-bottom: .75rem; }
.email-result { max-width: 760px; }
.email-result-hero { padding: clamp(1.5rem, 5vw, 3rem); background: #edf4fa; border: 1px solid #b7cbe0; border-radius: 16px; text-align: center; }
.email-result-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: white; color: #315a85; font-size: 2rem; }
.email-result-badge { display: inline-block; margin: 0 0 .75rem; padding: .25rem .7rem; border-radius: 99px; background: #fff1d6; color: #74450b; font-size: .8rem; font-weight: 700; }
.email-result-hero h1 { margin: 0 0 .5rem; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; letter-spacing: -.035em; }
.email-result-hero .lead { margin: 0; color: #315a85; }
.email-result-instruction { margin: 1.5rem 0 .75rem; padding: 1rem; background: white; border-radius: 10px; text-align: left; }
.email-result-instruction strong, .email-result-instruction span { display: block; }
.email-result-instruction strong { font-size: 1.15rem; margin-bottom: .3rem; }
.email-result-status { margin: 0; font-size: .9rem; font-weight: 600; color: #74450b; }
.alert-summary { background: white; }
.alert-summary ul { padding: 0; list-style: none; }
.alert-summary li { display: flex; gap: .8rem; align-items: center; padding: .8rem 0; margin: 0; border-bottom: 1px solid #e4e9e6; }
.alert-choice-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: #edf4fa; color: #315a85; border-radius: 8px; font-size: 1.3rem; }
.alert-summary li strong, .alert-summary li small { display: block; }
.alert-summary li strong { font-size: .95rem; }
.alert-summary li small, .alert-summary-scope, .email-result-help { color: #52635b; font-size: .85rem; }
.alert-beta-note { margin-bottom: 0; padding: .8rem; border-left: 3px solid #991b1b; background: #fef2f2; color: #991b1b; font-size: .85rem; }
.email-result-help { text-align: center; }
.water-choices { max-height: 340px; overflow-y: auto; padding: .3rem 1rem; border: 1px solid var(--track); border-radius: 4px; }
.form-honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice-card { margin: 1rem 0; padding: 1rem; background: white; border-left: 4px solid var(--text-muted); overflow-wrap: anywhere; }
.notice-card h3 { margin-top: 0; }
.notice-active { border-left-color: var(--danger); }
.notice-unknown { border-left-color: var(--future-accent); }
.system-list { padding-left: 1.2rem; }
.system-list li { margin: .6rem 0; }
.pilot-label { margin-left: .5rem; padding: .15rem .4rem; background: var(--observed-bright); color: var(--text-bright); font-size: .75rem; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 3px; }
button:disabled { opacity: .6; cursor: default; }
@media(max-width:760px) { .county-section { padding: 1rem; } .page-actions { display: flex; flex-wrap: wrap; gap: .7rem; } }
