:root {
  color-scheme: light;
  --paper: #f3f2eb;
  --panel: #fcfbf5;
  --ink: #213328;
  --muted: #526257;
  --line: #cdd4c5;
  --forest: #183a30;
  --forest-ink: #f2f3e7;
  --clay: #9c4529;
  --leaf: #dce8d7;
  --water: #dbeaf1;
  --sand: #eee2cb;
  --error: #a02020;
  font-family: "Instrument Sans", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px max(24px, calc((100% - 1120px)/2)); background: var(--panel); border-bottom: 1px solid var(--line); }
.wordmark { font-family: Georgia, serif; font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.25rem; }
.top-actions, .row, .section-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-actions { justify-content: flex-end; }
.intro { background: var(--forest); color: var(--forest-ink); padding: 42px 0 28px; }
.region, .eyebrow { margin: 0; color: var(--muted); font: 600 .77rem/1.35 "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.region { color: #c4d7c7; }
h1, h2 { font-family: "Instrument Serif", Georgia, serif; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 500; margin: 15px 0 12px; }
h2 { font-size: clamp(1.65rem, 4vw, 2.45rem); margin: 0 0 9px; }
h3 { font-size: 1.1rem; margin: 0; line-height: 1.3; }
p { margin: 0 0 12px; }
.intro-copy { max-width: 60ch; color: #e3e8dc; }
.spotlight { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 26px; }
.spotlight button { text-align: left; color: var(--forest-ink); border: 1px solid #567669; background: #23463b; min-height: 70px; }
.spotlight button:hover { background: #315649; }
.spotlight strong, .spotlight span { display: block; }
.spotlight span { font-size: .79rem; color: #d0dfd0; }
.inventory { margin-top: 34px; margin-bottom: 48px; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heading p { color: var(--muted); font-size: .9rem; }
.filters, .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.filters { grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); margin: 12px 0 22px; }
label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; min-width: 0; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea, button { font: inherit; }
input, select, textarea { color: var(--ink); background: var(--panel); border: 1px solid #a8b3a4; border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
button { background: var(--panel); color: var(--ink); border: 1px solid #a8b3a4; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-size: .88rem; font-weight: 650; }
button:hover { background: #e8ede3; }
button:disabled { opacity: .6; cursor: wait; }
button.primary, .link-primary { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
button.primary:hover, .link-primary:hover { background: #2d5547; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
a { color: #235f55; text-underline-offset: 3px; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; min-height: 182px; padding: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.card h3 { font-family: Georgia, serif; font-size: 1.12rem; font-weight: 700; }
.card p { font-size: .88rem; color: var(--muted); margin: 0; }
.card .card-button { justify-self: start; }
.card-meta, .status-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; border-radius: 4px; padding: 2px 6px; background: var(--leaf); color: var(--ink); font-size: .75rem; }
.tag.river { background: var(--water); }
.tag.permit { background: var(--sand); }
.empty { grid-column: 1 / -1; padding: 20px 0; color: var(--muted); }
footer.wrap { padding: 16px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); color: var(--ink); background: var(--panel); }
dialog::backdrop { background: #10241d9c; }
.dialog-shell { padding: 24px; position: relative; }
.close { position: absolute; top: 10px; right: 10px; font-size: 1.2rem; line-height: 1; padding: 5px 9px; }
.dialog-shell h2 { max-width: calc(100% - 30px); }
.dialog-shell h3 { margin-bottom: 6px; }
.dialog-shell section { margin-top: 22px; }
.dialog-shell .eyebrow { margin-bottom: 6px; padding-right: 30px; }
.links { margin: 14px 0; }
.link-primary { display: inline-block; text-decoration: none; border-radius: 6px; padding: 8px 12px; font-size: .9rem; }
.section-title { justify-content: space-between; }
.notice, .status-panel { background: #e7eee1; padding: 12px; border-radius: 6px; }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status-panel label { width: min(220px,100%); }
.status-list { padding: 0; margin: 10px 0 0; list-style: none; }
.status-list .secondary { margin: 0; }
details { margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 9px; }
dl { margin: 0; }
dt { font-weight: 650; }
dd { color: var(--muted); margin: 0 0 10px; }
.stack { display: grid; gap: 11px; }
.stack > button { justify-self: start; }
.application ol { padding-left: 20px; }
.application li { margin-bottom: 4px; }
.application .row { margin-top: 13px; }
.secondary { color: var(--muted); font-size: .89rem; }
.topics { display: flex; flex-wrap: wrap; gap: 12px; }
.topics label { display: flex; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 6px; }
#signout { margin-top: 18px; }
.toast { position: fixed; z-index: 5; right: 16px; bottom: 12px; max-width: min(390px,calc(100% - 32px)); padding: 10px 14px; border-radius: 6px; background: var(--forest); color: var(--forest-ink); }
.toast.error { background: var(--error); color: #fff; }
.dialog-message { margin: 12px 0 0; padding: 8px 11px; background: var(--leaf); border-radius: 5px; }
.dialog-message.error { color: var(--error); background: #fae4de; }
@media (max-width: 860px) {
  .cards, .spotlight { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 28px); }
  .topbar { padding: 10px 14px; }
  .intro { padding: 30px 0 20px; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters > label:first-child { grid-column: 1 / -1; }
  .cards, .field-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-shell { padding: 16px; }
  .card { min-height: 0; }
}
