:root {
  --ink: #18202a;
  --muted: #607080;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --line: #d9dfd5;
  --danger: #ea580c;
  --warning: #facc15;
  --safe: #25805f;
  --road: #334155;
  --water: #2b78a0;
  --focus: #075985;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .72;
}

button:hover,
button:focus {
  border-color: var(--focus);
  outline: 2px solid color-mix(in srgb, var(--focus) 20%, transparent);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffe7d6;
  color: #9a3412;
  font-size: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

.subtitle,
.muted {
  color: var(--muted);
}

.subtitle {
  font-size: 14px;
  margin-top: 2px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.map-toggle-control {
  margin: 10px;
}

.map-toggle-control button {
  min-height: 36px;
  padding: 0 12px;
  border-color: #cfd8c8;
  background: #ffffff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 30%);
  font-size: 14px;
}

.map-toggle-control button.active {
  border-color: var(--focus);
  background: #e0f2fe;
  color: #0c4a6e;
}

.alert-strip {
  display: grid;
  gap: 4px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #f1c27a;
  border-radius: 8px;
  background: #fff8e6;
  color: #3a2c12;
  line-height: 1.3;
}

.alert-strip strong {
  font-size: 15px;
}

.alert-strip span {
  font-size: 14px;
}

.primary {
  background: var(--focus);
  border-color: var(--focus);
  color: #fff;
}

.danger-button {
  background: #fff5f2;
  border-color: #f5b7ad;
  color: #9f231b;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  min-height: 0;
}

.side-panel {
  overflow: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.map-panel {
  min-height: 0;
  position: relative;
}

.public-map-page {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #dfe7d8;
}

.public-map-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#map,
.fallback-map {
  position: absolute;
  inset: 0;
}

.public-map-legend {
  position: absolute;
  left: 14px;
  bottom: 30px;
  z-index: 10;
  width: min(270px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .22);
  backdrop-filter: blur(10px);
}

.public-location-button {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 10;
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: rgba(15, 23, 42, .22);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .20);
}

.public-location-button svg {
  width: 22px;
  height: 22px;
  fill: #075985;
}

.public-location-button.is-loading svg {
  opacity: .58;
}

.public-zoom-control {
  position: absolute;
  right: 14px;
  top: 72px;
  z-index: 1000;
  width: 44px;
}

.public-zoom-toggle {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .24);
}

.public-zoom-toggle svg {
  width: 24px;
  height: 24px;
  fill: #6b7280;
}

.public-zoom-slider-panel {
  position: absolute;
  top: 52px;
  left: 50%;
  width: 56px;
  padding: 10px 8px 12px;
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .22);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.public-map-page .gm-bundled-control,
.public-map-page .gm-fullscreen-control {
  display: none !important;
}

.public-zoom-slider-panel[hidden] {
  display: none;
}

.public-zoom-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 850;
}

.public-zoom-slider-row {
  display: grid;
  grid-template-rows: 34px 150px 34px;
  justify-items: center;
  gap: 8px;
}

.public-zoom-slider-row button {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: #f8fafc;
  color: #075985;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.public-zoom-slider-row input {
  width: 34px;
  height: 150px;
  display: block;
  accent-color: var(--focus);
  cursor: pointer;
  appearance: none;
  background: transparent;
  writing-mode: vertical-lr;
  direction: rtl;
}

.public-zoom-slider-row input::-webkit-slider-runnable-track {
  width: 10px;
  height: 100%;
  border: 1px solid rgba(7, 89, 133, .28);
  border-radius: 999px;
  background: linear-gradient(0deg, #075985, #38bdf8);
}

.public-zoom-slider-row input::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-left: -9px;
  appearance: none;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #075985;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
}

.public-zoom-slider-row input::-moz-range-track {
  width: 10px;
  height: 100%;
  border: 1px solid rgba(7, 89, 133, .28);
  border-radius: 999px;
  background: linear-gradient(0deg, #075985, #38bdf8);
}

.public-zoom-slider-row input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #075985;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
}

.public-resource-button {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 10;
  min-height: 40px;
  border-color: rgba(15, 23, 42, .22);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .20);
  color: #0f513f;
  font-weight: 850;
}

.public-resource-panel {
  position: absolute;
  left: 14px;
  top: 62px;
  z-index: 11;
  width: min(430px, calc(100vw - 28px));
  max-height: min(640px, calc(100vh - 84px));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .26);
}

.public-resource-panel[hidden] {
  display: none;
}

.public-resource-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.public-resource-panel-header button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 24px;
  line-height: 1;
}

.public-resource-panel-body {
  max-height: calc(min(640px, calc(100vh - 84px)) - 52px);
  overflow: auto;
  padding: 12px;
  color: #111827;
  font-size: 14px;
  line-height: 1.38;
}

.public-resource-panel-body p + p {
  margin-top: 10px;
}

.resource-info-block {
  margin-top: 18px;
}

.resource-info-block p + p {
  margin-top: 14px;
}

.public-resource-panel-body a {
  color: var(--focus);
  font-weight: 800;
}

.public-map-legend-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  font-weight: 800;
}

.public-map-legend.is-collapsed {
  width: 118px;
}

.public-map-legend.is-collapsed .public-map-legend-toggle span:last-child {
  transform: rotate(180deg);
}

.public-map-legend.is-collapsed .public-map-legend-body {
  display: none;
}

.public-map-legend-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.legend-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.legend-row:hover,
.legend-row:focus {
  border: 0;
  outline-offset: 3px;
}

.legend-row[aria-pressed="false"] {
  color: #64748b;
}

.legend-row[aria-pressed="false"] .legend-symbol {
  opacity: .34;
  filter: grayscale(1);
}

.legend-symbol {
  position: relative;
  width: 28px;
  height: 18px;
  display: block;
}

.legend-fire-boundary {
  border: 3px solid var(--danger);
  background:
    repeating-linear-gradient(45deg, rgba(185, 28, 28, .45) 0 2px, transparent 2px 7px),
    rgba(234, 88, 12, .16);
}

.legend-mandatory {
  border: 2px solid #991b1b;
  background: rgba(185, 28, 28, .38);
}

.legend-warning {
  border: 2px solid #ca8a04;
  background: rgba(250, 204, 21, .58);
}

.legend-road::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 8px;
  border-top: 5px solid var(--road);
}

.legend-road::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 8px;
  height: 5px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .92) 0 2px, transparent 2px 7px);
}

.legend-evacuation-center::before {
  content: "E";
  position: absolute;
  left: 5px;
  top: -2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 99px;
  background: #0f766e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .22);
}

.legend-county-lines::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  border-top: 2px dotted #334155;
}

.legend-county-lines::before {
  top: 9px;
}

.fallback-map {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(51,65,85,.08) 1px, transparent 1px),
    linear-gradient(rgba(51,65,85,.08) 1px, transparent 1px),
    #e8efe4;
  background-size: 42px 42px;
}

.fallback-card {
  max-width: 460px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 20px 70px rgba(24, 32, 42, .14);
}

.fallback-card h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.status-card,
.filter-panel,
.item-card,
.form-panel,
.source-card,
.proposal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-card {
  padding: 14px;
  margin-bottom: 12px;
}

.status-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f6f8f3;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.1;
}

.filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-chip:has(input:focus-visible) {
  border-color: var(--focus);
  outline: 2px solid color-mix(in srgb, var(--focus) 20%, transparent);
}

.filter-chip:has(input:not(:checked)) {
  background: #fff;
  color: var(--muted);
}

.filter-chip:has(input:not(:checked)) .dot {
  opacity: .35;
}

.filter-chip:has(input:checked)::after {
  content: "on";
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #075985;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  flex: 0 0 auto;
}

.dot.fire,
.badge.fire {
  background: var(--danger);
}

.dot.evacuation_mandatory,
.badge.evacuation_mandatory {
  background: #b91c1c;
}

.dot.evacuation_warning,
.badge.evacuation_warning {
  background: var(--warning);
}

.dot.evacuation_lifted,
.badge.evacuation_lifted {
  background: #64748b;
}

.dot.shelter,
.badge.shelter {
  background: var(--safe);
}

.dot.road_closure,
.badge.road_closure {
  background: var(--road);
}

.dot.update,
.badge.update {
  background: var(--water);
}

.dot.county-boundaries {
  border: 2px solid #64748b;
  background:
    linear-gradient(90deg, transparent 42%, #64748b 42% 58%, transparent 58%),
    #ffffff;
}

.county-boundary-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 6px;
  border: 1px solid rgba(51, 65, 85, .45);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
  color: #1f2937;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  pointer-events: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  padding: 12px;
}

.item-card.is-selected {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(35, 60, 210, .14);
}

.item-card header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-title-button {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.item-title-button:hover,
.item-title-button:focus-visible {
  color: var(--focus);
  text-decoration: underline;
}

.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}

.fire-badge {
  font-size: 16px;
  cursor: help;
}

.fire-map-marker-label {
  text-shadow:
    -1px -1px 0 #8b1e1e,
    1px -1px 0 #8b1e1e,
    -1px 1px 0 #8b1e1e,
    1px 1px 0 #8b1e1e,
    0 2px 4px rgba(60, 0, 0, .35);
}

.fire-marker-text {
  position: absolute;
  transform: translateX(-50%);
  min-width: 230px;
  padding: 0;
  color: #611414;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 1px 0 #fff,
    1px 0 0 #fff,
    0 -1px 0 #fff,
    -1px 0 0 #fff,
    1px 1px 0 #fff,
    -1px 1px 0 #fff,
    1px -1px 0 #fff,
    -1px -1px 0 #fff,
    0 2px 7px rgba(255, 255, 255, .96);
  pointer-events: none;
}

.fire-marker-name {
  font-size: 18px;
  font-weight: 900;
}

.fire-marker-summary {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 850;
}

.map-popup {
  max-width: min(360px, 78vw);
  padding: 10px 34px 10px 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.map-popup > strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
  font-size: 14px;
  line-height: 1.25;
}

.map-popup p {
  margin: 8px 0;
}

.map-popup a {
  color: var(--focus);
  font-weight: 800;
}

.map-popup-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-popup-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
  border-top: 1px solid rgba(24, 32, 42, .10);
  padding-top: 6px;
}

.map-popup-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-popup-row strong {
  min-width: 0;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.road-closure-popup {
  border-left: 4px solid #7f1d1d;
}

.resource-popup {
  border-left: 4px solid #0f766e;
}

.fire-hover-popup {
  padding: 8px 34px 8px 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.fire-hover-popup a {
  color: var(--focus);
  font-weight: 750;
}

.gm-style-iw-c:has(.fire-hover-popup) {
  padding: 0 !important;
  border: 1px solid rgba(139, 30, 30, .18);
  border-radius: 8px !important;
  background: #fff8f2 !important;
  box-shadow: 0 8px 24px rgba(24, 32, 42, .16) !important;
  overflow: visible !important;
}

.gm-style-iw-c:has(.map-popup) {
  padding: 0 !important;
  border: 1px solid rgba(24, 32, 42, .16);
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(24, 32, 42, .16) !important;
  overflow: visible !important;
}

.gm-style-iw-c:has(.fire-hover-popup) .gm-ui-hover-effect,
.gm-style-iw-c:has(.map-popup) .gm-ui-hover-effect {
  top: 6px !important;
  right: 6px !important;
  width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
}

.gm-style-iw-c:has(.fire-hover-popup) .gm-ui-hover-effect span,
.gm-style-iw-c:has(.map-popup) .gm-ui-hover-effect span {
  width: 12px !important;
  height: 12px !important;
  margin: 6px !important;
}

.gm-style-iw-c:has(.fire-hover-popup) .gm-style-iw-chr,
.gm-style-iw-c:has(.map-popup) .gm-style-iw-chr {
  position: absolute;
  top: 0;
  right: 0;
  height: 0;
  z-index: 1;
}

.gm-style-iw-c:has(.fire-hover-popup) .gm-style-iw-d,
.gm-style-iw-c:has(.map-popup) .gm-style-iw-d {
  max-height: none !important;
  overflow: hidden !important;
}

.gm-style-iw-t:has(.fire-hover-popup)::after {
  background: #fff8f2 !important;
  box-shadow: none !important;
}

.fire-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: max-content;
  max-width: min(320px, 78vw);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 34px rgba(24, 32, 42, .18);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.fire-tooltip span {
  display: block;
}

.fire-tooltip a {
  color: var(--focus);
}

.fire-badge:hover .fire-tooltip,
.fire-badge:focus .fire-tooltip,
.fire-badge:focus-within .fire-tooltip {
  display: block;
}

.item-title {
  font-weight: 750;
  line-height: 1.2;
}

.fire-summary {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.item-text {
  font-size: 15px;
  line-height: 1.35;
}

.review-flag {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff1f1;
  color: #9f231b;
  font-size: 12px;
  font-weight: 800;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  transition: grid-template-columns .18s ease;
  align-items: start;
  overflow-x: hidden;
}

.admin-layout.side-collapsed {
  grid-template-columns: 44px 1fr;
}

.admin-side-panel {
  grid-column: 1;
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 118px);
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
}

.admin-side-panel-content {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.admin-layout.side-collapsed .admin-side-panel-content {
  display: none;
}

.admin-layout.side-collapsed .admin-side-panel {
  overflow: hidden;
}

.side-panel-toggle {
  position: sticky;
  top: 12px;
  z-index: 4;
  width: 36px;
  min-height: 48px;
  padding: 0;
  border-color: var(--focus);
  background: var(--panel);
  color: var(--focus);
  font-size: 28px;
  line-height: 1;
}

.admin-layout.side-collapsed .side-panel-toggle {
  transform: rotate(180deg);
}

.admin-main-panel {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
}

.admin-side-panel .form-panel,
.admin-side-panel .source-card,
.admin-side-panel .source-list,
.admin-side-panel .form-grid,
.admin-side-panel .field,
.admin-side-panel .row-actions,
.admin-side-panel .geometry-tools,
.admin-side-panel input,
.admin-side-panel select,
.admin-side-panel textarea,
.admin-side-panel button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.admin-side-panel .form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.admin-side-panel .geometry-tools,
.admin-side-panel .row-actions {
  align-items: stretch;
}

.admin-side-panel .side-panel-toggle {
  width: 36px;
}

.proposal-sidebar-panel {
  margin-bottom: 16px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title-row h2 {
  min-width: 0;
}

.icon-button.panel-collapse-button,
.admin-side-panel .icon-button.panel-collapse-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.proposal-sidebar-panel.is-collapsed [data-proposal-panel-body] {
  display: none;
}

.admin-side-panel .proposal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-side-panel .proposal-tabs button {
  width: auto;
  padding: 8px;
  font-size: 14px;
}

.admin-side-panel .proposal-title-button {
  width: auto;
  max-width: 100%;
}

.admin-side-panel .proposal-card header {
  align-items: flex-start;
}

.form-panel {
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.geometry-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geometry-tools button {
  min-height: 36px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-map {
  height: 420px;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #e8efe4;
}

.admin-map #map {
  position: absolute;
  inset: 0;
}

.map-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  height: 18px;
  border-top: 1px solid rgba(51, 65, 85, .18);
  background: rgba(255, 255, 255, .82);
  cursor: ns-resize;
  touch-action: none;
}

.map-resize-handle span {
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: #64748b;
  box-shadow:
    0 -6px 0 rgba(100, 116, 139, .42),
    0 6px 0 rgba(100, 116, 139, .42);
}

.map-resize-handle:hover,
.map-resize-handle:focus-visible {
  background: rgba(224, 242, 254, .94);
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.resizing-admin-map {
  cursor: ns-resize;
  user-select: none;
}

.admin-list,
.source-list,
.proposal-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.proposal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.proposal-tabs button {
  border-color: var(--line);
  background: #fff;
}

.proposal-tabs button.active {
  border-color: var(--focus);
  color: #fff;
  background: var(--focus);
}

.proposal-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.proposal-visibility label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.proposal-visibility input {
  width: auto;
  min-height: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.button-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 99px;
  vertical-align: -2px;
  animation: spin .8s linear infinite;
}

.button-spinner.active,
button.is-loading .button-spinner {
  display: inline-block;
}

.fetch-progress {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eadf;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--focus);
  transition: width .2s ease;
}

.fetch-steps {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.fetch-step {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.fetch-step strong {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.step-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #bac5b2;
  border-radius: 99px;
}

.fetch-step.checking .step-dot {
  border-color: var(--focus);
  border-right-color: transparent;
  animation: spin .8s linear infinite;
}

.fetch-step.done {
  color: #1f6f4a;
}

.fetch-step.done .step-dot {
  border-color: #1f6f4a;
  background: #1f6f4a;
}

.fetch-step.failed {
  color: #9f231b;
}

.fetch-step.failed .step-dot {
  border-color: #9f231b;
  background: #fff5f2;
}

.source-card,
.proposal-card {
  padding: 12px;
}

.proposal-card:not(.is-expanded) {
  padding-block: 10px;
}

.proposal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.proposal-card-details {
  margin-top: 8px;
}

.proposal-card.pending {
  border-color: #f1c27a;
  background: #fffdf6;
}

.proposal-card.approved {
  border-color: #a7d7be;
}

.proposal-card.is-published {
  background: #f8fcf9;
}

.proposal-title-button {
  display: inline;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.proposal-delete-button,
.admin-side-panel .proposal-delete-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1;
}

.proposal-title-fire,
.proposal-title-update {
  color: var(--danger);
}

.proposal-title-evacuation_mandatory {
  color: #991b1b;
}

.proposal-title-evacuation_warning {
  color: #9a6700;
}

.proposal-title-evacuation_lifted {
  color: #475569;
}

.proposal-title-shelter {
  color: var(--safe);
}

.proposal-title-road_closure {
  color: #7f1d1d;
}

.proposal-title-button:hover,
.proposal-title-button:focus-visible {
  color: var(--focus);
  text-decoration: underline;
}

.published-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.published-note strong {
  color: var(--ink);
}

.proposal-card.rejected {
  opacity: .72;
}

.proposal-card.is-promoted {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(35, 60, 210, .14);
}

.proposal-card.is-hidden-on-map {
  opacity: .78;
}

.proposal-card.is-hidden-on-map::after {
  content: "Hidden on map";
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.proposal-card details {
  margin-top: 10px;
}

.proposal-card summary {
  cursor: pointer;
  color: var(--focus);
  font-weight: 700;
}

.source-excerpt {
  margin-top: 8px;
  max-height: 140px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #18202a;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 840px) {
  .app-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side-panel {
    grid-column: auto;
    max-width: none;
  }

  .admin-main-panel {
    grid-column: auto;
  }

  .admin-layout.side-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-layout.side-collapsed .admin-side-panel {
    min-height: 48px;
  }

  .side-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

  .map-panel {
    min-height: 58vh;
  }

  .admin-map {
    min-height: 360px;
  }
}
