:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #151719;
  --muted: #62676d;
  --line: rgb(255 255 255 / 58%);
  --glass: rgb(255 255 255 / 50%);
  --glass-strong: rgb(255 255 255 / 72%);
  --accent: #337fc5;
  --shadow: 0 18px 55px rgb(22 30 38 / 18%), inset 0 1px 0 rgb(255 255 255 / 72%);
  --shadow-soft: 0 8px 30px rgb(22 30 38 / 14%), inset 0 1px 0 rgb(255 255 255 / 65%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; color: var(--ink); background: #d9dde0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.layout, .map-shell, #map { position: absolute; inset: 0; }
.map-shell { min-width: 0; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 9px 13px; font-weight: 650; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.secondary { color: var(--ink); background: rgb(255 255 255 / 36%); border-color: rgb(255 255 255 / 42%); }
.button.secondary:hover { background: rgb(255 255 255 / 66%); }
.button.primary { width: 100%; margin-top: 18px; color: white; background: #202327; box-shadow: 0 8px 24px rgb(20 23 26 / 16%); }
.button.primary:hover { background: #08090a; }

.sidebar {
  position: fixed;
  z-index: 15;
  top: 24px;
  left: 24px;
  width: 58px;
  overflow: visible;
  transition: width .26s cubic-bezier(.2, .75, .25, 1);
}

.sidebar.open { width: min(350px, calc(100vw - 48px)); }
.drawer-toggle { width: 58px; height: 58px; display: flex; align-items: center; gap: 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; padding: 0 12px; color: var(--ink); background: var(--glass); backdrop-filter: blur(24px) saturate(155%); -webkit-backdrop-filter: blur(24px) saturate(155%); box-shadow: var(--shadow-soft); text-align: left; transition: width .22s ease, background .15s ease; }
.sidebar.open .drawer-toggle { width: 142px; }
.drawer-toggle:hover { background: rgb(255 255 255 / 66%); }
.drawer-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 10px; background: rgb(255 255 255 / 46%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%); font-size: 16px; }
.drawer-label { opacity: 0; font-size: 13px; font-weight: 700; transition: opacity .12s ease; }
.drawer-chevron { margin-left: auto; opacity: 0; font-size: 22px; transition: opacity .12s ease, transform .2s ease; }
.sidebar.open .drawer-label, .sidebar.open .drawer-chevron { opacity: 1; }
.sidebar.open .drawer-chevron { transform: rotate(180deg); }
.sidebar-content { width: 350px; max-width: calc(100vw - 48px); max-height: calc(100vh - 94px); overflow-y: auto; padding: 0 7px 18px 0; opacity: 0; visibility: hidden; transform: translateY(-5px); scrollbar-width: thin; transition: opacity .16s ease .08s, transform .16s ease .08s, visibility 0s linear .22s; }
.sidebar.open .sidebar-content { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: .08s, .08s, 0s; }
.glass-card { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); backdrop-filter: blur(26px) saturate(155%); -webkit-backdrop-filter: blur(26px) saturate(155%); box-shadow: var(--shadow-soft); }

.sidebar-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; }
.sidebar-heading p { color: var(--muted); font-size: 12px; }
.eyebrow { margin-bottom: 5px; color: #555b61; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 45%); border-radius: 10px; padding: 0; color: var(--ink); background: rgb(255 255 255 / 26%); font-size: 20px; line-height: 1; }
.icon-button:hover { background: rgb(255 255 255 / 55%); }

.field-label { display: block; margin: 15px 0 6px; color: #575d62; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
select, input, textarea { width: 100%; border: 1px solid rgb(255 255 255 / 58%); border-radius: 11px; padding: 10px 11px; color: var(--ink); background: rgb(255 255 255 / 48%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 62%); transition: background .15s ease, box-shadow .15s ease; }
select:focus, input:focus, textarea:focus { outline: none; background: rgb(255 255 255 / 76%); box-shadow: 0 0 0 3px rgb(58 126 188 / 13%); }
textarea { resize: vertical; }
.map-search { margin-top: 8px; }
.map-search .field-label { margin-top: 0; }
.search-input-row { display: grid; grid-template-columns: 1fr 40px; gap: 6px; }
.search-input-row input { min-width: 0; }
.search-button { display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 55%); border-radius: 11px; color: var(--ink); background: rgb(255 255 255 / 48%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 62%); font-size: 20px; }
.search-button:hover { background: rgb(255 255 255 / 75%); }
.search-results { display: grid; gap: 5px; margin-top: 7px; }
.search-note { margin: 3px 2px 0; color: var(--muted); font-size: 11px; }
.search-result { width: 100%; border: 1px solid rgb(255 255 255 / 48%); border-radius: 10px; padding: 8px 10px; color: var(--ink); background: rgb(255 255 255 / 32%); text-align: left; }
.search-result:hover { background: rgb(255 255 255 / 62%); }
.search-result strong, .search-result span { display: block; }
.search-result strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search-result span { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.pursuit-list { margin-top: 16px; display: grid; gap: 15px; }
.glass-control { width: 100%; border-color: rgb(255 255 255 / 55%); color: var(--ink); background: rgb(255 255 255 / 42%); }
.glass-control:hover { background: rgb(255 255 255 / 68%); }
.control-card > .field-label:first-child { margin-top: 0; }
.zoom-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.control-button { height: 38px; border: 1px solid rgb(255 255 255 / 55%); border-radius: 11px; color: var(--ink); background: rgb(255 255 255 / 42%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%); font-size: 18px; }
.control-button:hover { background: rgb(255 255 255 / 72%); }
.home-control { font-size: 16px; }
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.theme-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.theme-swatch { height: 34px; border: 1px solid rgb(255 255 255 / 58%); border-radius: 11px; padding: 4px; background: rgb(255 255 255 / 30%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%); }
.theme-swatch span { display: block; width: 100%; height: 100%; border-radius: 7px; }
.theme-swatch.active { box-shadow: 0 0 0 2px rgb(25 28 31 / 70%), inset 0 1px 0 rgb(255 255 255 / 55%); }
.swatch-natural { background: linear-gradient(135deg, #9cc58e, #76a9d4); }
.swatch-mist { background: linear-gradient(135deg, #d9d8cf, #9eb0b4); }
.swatch-mono { background: linear-gradient(135deg, #eee, #6e7377); }
.swatch-warm { background: linear-gradient(135deg, #ddb36e, #b77e64); }
.swatch-night { background: linear-gradient(135deg, #86ff73, #071b0a); }
.swatch-vivid { background: linear-gradient(135deg, #5ed36f, #347de0); }
.swatch-paper { background: linear-gradient(135deg, #f4ead2, #b6a88e); }
.swatch-ocean { background: linear-gradient(135deg, #65c7c9, #356da7); }
.swatch-forest { background: linear-gradient(135deg, #8eae69, #315f4b); }
.swatch-rose { background: linear-gradient(135deg, #e3a5b8, #9273aa); }
.empty-state { margin: 4px 2px; color: #4f555b; font-size: 12px; line-height: 1.55; }
.status-group h3 { display: flex; justify-content: space-between; color: #565c62; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.pursuit-row { width: 100%; margin-top: 6px; border: 1px solid rgb(255 255 255 / 55%); border-left: 4px solid var(--stage-color); border-radius: 11px; padding: 10px; color: var(--ink); background: rgb(255 255 255 / 42%); text-align: left; box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%); transition: transform .15s ease, background .15s ease; }
.pursuit-row:hover { transform: translateY(-1px); background: rgb(255 255 255 / 70%); }
.pursuit-row strong, .pursuit-row span { display: block; }
.pursuit-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.legend { display: grid; gap: 5px; min-height: 39px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: rgb(255 255 255 / 34%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 58%); font-size: 10px; }
.legend-row { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }

.zoom-hint { position: absolute; z-index: 5; top: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 260px); padding: 9px 13px 9px 9px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--glass); backdrop-filter: blur(24px) saturate(155%); -webkit-backdrop-filter: blur(24px) saturate(155%); box-shadow: var(--shadow-soft); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.zoom-hint.is-hidden { opacity: 0; transform: translate(-50%, -8px); }
.zoom-hint-icon { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: rgb(255 255 255 / 42%); font-size: 18px; }
.zoom-hint strong, .zoom-hint small { display: block; }
.zoom-hint strong { font-size: 11px; }
.zoom-hint small { margin-top: 2px; color: var(--muted); font-size: 10px; }
#map canvas { transition: filter .25s ease; }

.detail-panel { position: fixed; z-index: 18; top: 88px; right: 26px; bottom: 24px; width: min(390px, calc(100vw - 52px)); overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 58%); backdrop-filter: blur(30px) saturate(165%); -webkit-backdrop-filter: blur(30px) saturate(165%); box-shadow: var(--shadow); }
.county-fields { display: grid; grid-template-columns: 105px 1fr; gap: 7px 12px; margin: 16px 0; padding: 14px 0; border-block: 1px solid rgb(255 255 255 / 54%); font-size: 12px; }
.county-fields dt { color: var(--muted); }
.county-fields dd { margin: 0; overflow-wrap: anywhere; }
.notice, .map-message { border: 1px solid rgb(255 255 255 / 55%); border-radius: 11px; padding: 10px; font-size: 12px; }
.notice { margin-top: 14px; background: rgb(255 244 211 / 64%); }
.map-message { position: absolute; z-index: 7; top: 88px; left: 50%; transform: translateX(-50%); background: var(--glass-strong); backdrop-filter: blur(20px); box-shadow: var(--shadow-soft); }

.maplibregl-ctrl-attrib { border-radius: 8px 0 0; background: rgb(255 255 255 / 58%); backdrop-filter: blur(12px); }
.maplibregl-popup-content { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--glass-strong); backdrop-filter: blur(20px); box-shadow: var(--shadow-soft); font: 11px/1.5 inherit; }
.maplibregl-popup-tip { opacity: .72; }

@media (max-width: 760px) {
  .sidebar { top: 12px; left: 12px; }
  .sidebar.open { width: calc(100vw - 24px); }
  .sidebar-content { width: calc(100vw - 24px); max-width: none; max-height: calc(100vh - 78px); }
  .zoom-hint { top: 16px; max-width: calc(100% - 90px); }
  .zoom-hint small { display: none; }
  .detail-panel { top: 12px; right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
