:root {
  --ink: #192f34;
  --muted: #52666a;
  --line: #cfdbd8;
  --paper: #f4f6f3;
  --green: #174b48;
  --dark: #123b40;
  --soft: #e4eeea;
  --gold: #a15e23;
  --shadow: 0 8px 24px #193b3520;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.55;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #145b63;
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid #9aafaa;
  border-radius: 6px;
  padding: 9px 13px;
  min-height: 40px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover,
.button:hover {
  background: #e3eee9;
  border-color: var(--green);
}
button.primary,
.button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button[aria-pressed="true"],
.tabs button.active {
  background: var(--dark);
  color: white;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
input,
select,
textarea {
  border: 1px solid #99adaa;
  border-radius: 5px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
  max-width: 100%;
  min-width: 0;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
textarea {
  width: 100%;
  min-height: 130px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 650;
}
label.inline {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
  font-size: 14px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -1px;
  font-weight: 650;
  margin-bottom: 10px;
}
h2 {
  font-size: 21px;
  line-height: 1.3;
  margin-bottom: 16px;
}
h3 {
  font-size: 16px;
  margin-bottom: 9px;
}
small,
.small {
  font-size: 13px;
}
*:focus-visible {
  outline: 3px solid #ce7f28;
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  background: white;
  padding: 12px;
  z-index: 2000;
}
.skip:focus {
  top: 10px;
}
header {
  background: var(--dark);
  color: white;
  padding: 20px max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 4px solid #b2cfc2;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.brand > a {
  font-size: 19px;
  font-weight: 650;
  color: white;
  text-decoration: none;
}
.brand > span {
  font-size: 14px;
  color: #d1e4db;
}
.brand-icon {
  display: inline-block;
  color: #b9dacc;
  margin-right: 10px;
  font-size: 25px;
}
nav {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}
nav a {
  color: #d9e5e1;
  text-decoration: none;
  padding-bottom: 8px;
  font-size: 14px;
}
nav a[aria-current="page"] {
  color: white;
  border-bottom: 2px solid #b9dacc;
  font-weight: 700;
}
main {
  max-width: 1488px;
  margin: auto;
  padding: 32px 24px 48px;
  min-height: 70vh;
}
.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-top p {
  color: var(--muted);
  max-width: 790px;
  margin: 0;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.page-top .actions {
  flex-shrink: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0 24px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid #779b8c;
  border-radius: 7px;
  padding: 18px 20px;
}
.stat strong {
  display: block;
  font-size: 29px;
  letter-spacing: -0.7px;
  font-weight: 650;
  line-height: 1.3;
  margin: 6px 0;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.stat .label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.workspace {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 20px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
}
.controls {
  align-self: start;
}
.controls label {
  margin: 14px 0;
}
.controls h2 {
  font-size: 16px;
  margin-bottom: 13px;
}
.controls .rule {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}
.control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}
.control-row label {
  margin-top: 8px;
}
.muted {
  color: var(--muted);
}
.map-panel {
  padding: 0;
  overflow: hidden;
}
.panel-head {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.panel-head h2 {
  margin-bottom: 4px;
  font-size: 18px;
}
.panel-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
#map {
  height: 490px;
  background: #e7eeea;
  z-index: 0;
}
.map-bottom {
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  align-items: center;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.swatch {
  height: 12px;
  width: 18px;
  display: inline-block;
  border: 1px solid #70837c;
}
.below-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.chart {
  min-height: 220px;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart svg text {
  font-family: inherit;
  fill: #364d50;
  font-size: 11px;
}
.chart svg .point {
  cursor: pointer;
  stroke: white;
  stroke-width: 1.4;
}
.chart svg .point:focus {
  outline: none;
  stroke: #bb7428;
  stroke-width: 4;
}
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.tabs button {
  font-size: 13px;
  padding: 7px 12px;
}
.table-panel {
  margin-top: 18px;
}
.table-wrap {
  overflow: auto;
  max-height: 520px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid #dce5e1;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: #edf3ef;
  z-index: 1;
}
th button {
  min-height: 30px;
  padding: 2px;
  border: none;
  background: transparent;
  text-align: left;
  white-space: normal;
  max-width: 210px;
  font-size: 13px;
  font-weight: 650;
}
td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
tr.selected td {
  background: #e0eee6;
}
td button {
  padding: 1px;
  min-height: 28px;
  border: 0;
  color: #145b63;
  text-decoration: underline;
  background: transparent;
}
.selection {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.chip {
  font-size: 12px;
  background: #e5eee9;
  border: 1px solid #c2d5cc;
  border-radius: 4px;
  padding: 5px 8px;
}
.chip button {
  font-size: 13px;
  padding: 0 4px;
  min-height: 20px;
  border: 0;
  background: transparent;
}
.indicator-chip {
  border-bottom: 1px solid #e0e7e2;
  padding: 10px 0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
}
.indicator-chip .key {
  font-size: 11px;
  display: block;
  color: var(--muted);
  word-break: break-word;
}
.indicator-chip button {
  min-width: 28px;
  min-height: 28px;
  padding: 2px;
}
.full {
  width: 100%;
}
.source-note {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 0;
}
.error {
  background: #fff0e8;
  color: #813d19;
  border: 1px solid #deb294;
  padding: 13px;
  border-radius: 5px;
}
.note {
  background: #edf3ef;
  border-left: 3px solid #6c9985;
  padding: 14px;
  font-size: 14px;
}
.status {
  border-radius: 20px;
  padding: 3px 9px;
  background: #e2ece7;
  font-size: 12px;
  white-space: nowrap;
}
.loading {
  padding: 50px;
  color: var(--muted);
}
.skeleton {
  background: #e5ece8;
  min-height: 40px;
  border-radius: 4px;
}
.goal {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.goal:last-child {
  border: 0;
}
.goal-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.goal progress {
  width: 100%;
  height: 14px;
  accent-color: var(--green);
}
.goal p {
  margin: 5px 0;
  font-size: 13px;
}
.trend-section {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.article {
  max-width: 960px;
  margin: auto;
}
.article p,
.article li {
  line-height: 1.7;
}
.article section {
  margin: 28px 0;
}
.article h2 {
  margin-top: 30px;
}
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-row h3 {
  margin-bottom: 5px;
}
.timeline-row p {
  margin: 0;
}
.admin-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 560px;
  overflow: auto;
}
.admin-list button {
  justify-content: flex-start;
  text-align: left;
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  margin: 18px 0;
}
.form-grid label.wide {
  grid-column: 1/-1;
}
.field-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 10px;
}
.field-list label {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  font-weight: 400;
  padding: 5px;
}
.field-editor {
  display: grid;
  grid-template-columns: 1fr 2fr 110px;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.admin-top {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 20px 0;
  flex-wrap: wrap;
}
.danger {
  color: #8e352c;
}
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.result label {
  flex: 1;
  display: block;
  font-weight: 400;
  font-size: 14px;
}
.result strong {
  display: block;
}
.result small {
  color: var(--muted);
}
.result input {
  margin-top: 5px;
}
.result a {
  font-size: 12px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
dialog {
  width: min(820px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 25px;
  border: 1px solid #9fb4aa;
  border-radius: 12px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #14303899;
}
#notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 20px;
  border-radius: 8px;
  background: #183e42;
  color: white;
  box-shadow: var(--shadow);
  z-index: 3000;
  display: none;
}
footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  max-width: 1440px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}
footer div {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.leaflet-container {
  font-family: inherit;
}
.leaflet-control-attribution {
  font-size: 11px !important;
}
.leaflet-popup-content {
  font-size: 14px;
  min-width: 180px;
}
.leaflet-popup-content strong {
  display: block;
}
.leaflet-interactive:focus {
  outline: 2px solid #a96524;
}
.counties {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.counties button {
  font-size: 12px;
  min-height: 32px;
  padding: 5px 9px;
}
.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
}
.chart-toolbar {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.chart-toolbar select {
  max-width: 60%;
  font-size: 12px;
}
.check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
}
.check-grid label {
  margin: 0;
}
.min-label {
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  #map {
    height: 540px;
  }
}
@media (max-width: 1000px) {
  .page-top {
    display: block;
  }
  .page-top .actions {
    margin-top: 18px;
  }
  .workspace {
    grid-template-columns: 245px minmax(0, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .below-map {
    grid-template-columns: minmax(0, 1fr);
  }
  .stat strong {
    font-size: 27px;
  }
  .trend-section {
    grid-template-columns: minmax(0, 1fr);
  }
  header {
    padding: 18px 22px;
  }
  nav {
    gap: 17px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 24px 14px 30px;
  }
  header {
    padding: 16px 14px;
  }
  .brand {
    margin-bottom: 15px;
  }
  .brand > a {
    font-size: 16px;
  }
  .brand > span {
    display: none;
  }
  nav {
    gap: 14px;
  }
  nav a {
    font-size: 12px;
  }
  h1 {
    font-size: 29px;
  }
  .workspace,
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .controls {
    display: block;
  }
  .controls .control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 12px;
  }
  .controls label {
    margin: 8px 0;
  }
  .controls .rule {
    margin-top: 16px;
    padding-top: 12px;
  }
  #map {
    height: 410px;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 13px;
  }
  .stat strong {
    font-size: 24px;
  }
  .stat span,
  .stat .label {
    font-size: 12px;
  }
  .panel {
    padding: 16px;
  }
  .map-panel {
    padding: 0;
  }
  .panel-head {
    padding: 15px;
  }
  .below-map,
  .doc-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid label.wide {
    grid-column: auto;
  }
  .field-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .timeline-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }
  .check-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  footer {
    display: block;
    padding: 20px 14px;
  }
  footer div {
    margin-top: 12px;
  }
  .admin-list {
    max-height: 220px;
  }
  .brand-icon {
    font-size: 21px;
    margin-right: 5px;
  }
  dialog {
    padding: 17px;
  }
  .source-note {
    word-break: break-word;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  header,
  footer,
  .controls,
  .actions,
  .tabs,
  button {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .workspace {
    display: block;
  }
  .panel {
    break-inside: avoid;
  }
  #map {
    height: 450px;
  }
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

[hidden] {
  display: none !important;
}

/* Permit long native option labels and source fields to shrink on phones. */
label, .workspace > *, .form-grid > *, .control-grid > * { min-width: 0; }
select, input, textarea { max-width: 100%; min-width: 0; }
