:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #183330;
  background: #f3f5ef;
  line-height: 1.5;
  font-size: 16px;
  --border: #c7d2c9;
  --green: #245c46;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0 0 .75rem; }
h1 { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.25; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
a { color: #185c70; text-underline-offset: .15em; }
a:hover { color: #102f44; }
button, input, select { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem .85rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: white;
  color: #183330;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}
button:hover, .button:hover { background: #e6ede7; color: #183330; }
button:disabled { opacity: .6; cursor: wait; }
.primary, #upload-form button[type="submit"] { background: var(--green); color: white; border-color: var(--green); }
.danger { color: #9c2828; border-color: #ddb3ac; }
.quiet { background: transparent; }
:focus-visible { outline: 3px solid #185c9e; outline-offset: 3px; }
input[type="date"] { display: block; min-height: 44px; max-width: 100%; padding: .35rem; border: 1px solid var(--border); border-radius: .3rem; background: white; color: inherit; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
input[type="file"] { max-width: 100%; min-height: 44px; }
input::file-selector-button { font: inherit; padding: .5rem; border: 1px solid var(--border); border-radius: .3rem; margin-right: .4rem; cursor: pointer; }
label { display: block; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: .25rem; font-weight: 600; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1.5rem; background: #fffef9; border-bottom: 1px solid var(--border); }
.brand { color: #183330; text-decoration: none; font-size: 1.4rem; font-weight: 750; }
.brand span { display: block; color: #52635b; font-size: .8rem; font-weight: 400; }
.account, .actions, .section-heading, .run-heading, .update { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.account { font-size: .9rem; }
.section-heading { justify-content: space-between; margin-bottom: 1rem; }
.section-heading h1 { margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); gap: 1.5rem; padding: 1.5rem; max-width: 120rem; margin: auto; }
.map-panel { min-width: 0; position: sticky; top: 1rem; align-self: start; }
.sidebar { min-width: 0; }
.panel { background: #fffef9; border: 1px solid var(--border); border-radius: .8rem; padding: 1.2rem; margin-bottom: 1rem; scroll-margin-top: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: end; padding: 1rem; background: #fffef9; border: 1px solid var(--border); border-radius: .8rem .8rem 0 0; }
.runner { display: inline-flex; align-items: center; gap: .4rem; margin-right: .75rem; min-height: 44px; cursor: pointer; }
.swatch { display: inline-block; flex: 0 0 auto; width: .8rem; height: .8rem; border: 1px solid #0004; border-radius: 50%; }
.date-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.date-filters label { font-size: .85rem; }
#map { width: 100%; height: clamp(22rem, 60vh, 52rem); background: #e1e8df; border: 1px solid var(--border); }
.map-help, .attribution { font-size: .8rem; color: #52635b; margin: .4rem 0; }
.muted { color: #52635b; font-size: .85rem; font-weight: 400; }
.notice { background: #edf2e8; border-left: 3px solid #647c42; padding: .65rem .8rem; margin: .5rem 0; font-size: .9rem; }
.error { color: #8e2522; background: #fff0eb; padding: .65rem; border-left: 3px solid #b64336; overflow-wrap: anywhere; }
.empty { padding: 1rem .25rem; color: #52635b; }
.drop-zone { border: 2px dashed #7e9b86; border-radius: .6rem; padding: 1rem; margin: .75rem 0; background: #f2f6ef; }
.drop-zone label { font-weight: 600; margin-bottom: .5rem; }
.drop-zone.dragging { border-color: #185c9e; background: #e2eff7; }
.selected-files { padding: 0; list-style: none; }
.selected-files li { display: flex; gap: .5rem; justify-content: space-between; align-items: center; margin-bottom: .5rem; overflow-wrap: anywhere; }
.selected-files li span { min-width: 0; }
#upload-form > input[type="date"] { margin: .4rem 0 .8rem; }
progress { display: block; width: 100%; margin-top: .5rem; accent-color: var(--green); }
#upload-progress { margin-top: .8rem; }
.run-card { border-top: 1px solid var(--border); padding: 1rem 0; overflow-wrap: anywhere; }
.run-heading { margin-bottom: .4rem; }
.state { border: 1px solid var(--border); border-radius: 1rem; padding: .1rem .55rem; font-size: .8rem; }
.filename { font-size: .9rem; color: #52635b; }
.actions { margin-top: .65rem; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; }
.upload-results ul { padding-left: 1.25rem; overflow-wrap: anywhere; }
.upload-results li { margin-bottom: .7rem; }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem .8rem; }
dt { font-weight: 600; }
dd { margin: 0; overflow-wrap: anywhere; }
.maplibregl-popup-content { color: #183330; font: 14px/1.5 system-ui, sans-serif; max-width: 18rem; padding: 1rem; overflow-wrap: anywhere; }
.maplibregl-popup-close-button { min-width: 32px; min-height: 32px; padding: 0; }
.global-message { position: sticky; bottom: 0; z-index: 20; padding: 1rem; background: #fff0d6; border-top: 2px solid #a87b2c; margin: 0; }
.skip-link { position: absolute; top: -10rem; left: 1rem; padding: .7rem; background: white; z-index: 30; }
.skip-link:focus { top: .5rem; }
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(140deg, #f3f5ef, #c4d6c5); }
.login-card { max-width: 30rem; padding: clamp(1.5rem, 5vw, 3rem); background: #fffef9; border: 1px solid var(--border); border-radius: 1rem; }
.login-card h1 { font-size: 2.5rem; }
.login-card .button { margin: .5rem 0 1.25rem; width: 100%; }
.eyebrow { color: var(--green); font-size: .8rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem; }
  .map-panel { position: static; }
  #map { height: 55svh; min-height: 20rem; }
}
@media (max-width: 450px) {
  .topbar { padding: .75rem; }
  .workspace { padding: .65rem; }
  .panel { padding: 1rem; }
  .filters { padding: .75rem; }
  .date-filters { width: 100%; }
  .date-filters label { flex: 1; min-width: 0; }
  .date-filters input { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}