/* Leaflet critical CSS bundled locally so the map never breaks if the CDN stylesheet is blocked. */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-container { overflow: hidden; background: #d8e4ee; outline-offset: 1px; }
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow { user-select: none; -webkit-user-drag: none; }
.leaflet-tile::selection { background: transparent; }
.leaflet-safari .leaflet-tile { image-rendering: -webkit-optimize-contrast; }
.leaflet-safari .leaflet-tile-container { width: 1600px; height: 1600px; transform-origin: 0 0; }
.leaflet-marker-icon,
.leaflet-marker-shadow { display: block; }
.leaflet-container .leaflet-overlay-pane svg { max-width: none !important; max-height: none !important; }
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; width: auto; padding: 0; }
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }
.leaflet-container.leaflet-touch-zoom { touch-action: pan-x pan-y; }
.leaflet-container.leaflet-touch-drag { touch-action: none; touch-action: pinch-zoom; }
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: none; }
.leaflet-container { -webkit-tap-highlight-color: transparent; }
.leaflet-container a { -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); }
.leaflet-tile { filter: inherit; visibility: hidden; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-zoom-box { width: 0; height: 0; box-sizing: border-box; z-index: 800; }
.leaflet-overlay-pane svg { -moz-user-select: none; }
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape { width: 1px; height: 1px; }
.lvml { behavior: url(#default#VML); display: inline-block; position: absolute; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.leaflet-top,
.leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; }
.leaflet-right { right: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-control { float: left; clear: both; }
.leaflet-right .leaflet-control { float: right; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-bottom .leaflet-control { margin-bottom: 10px; }
.leaflet-left .leaflet-control { margin-left: 10px; }
.leaflet-right .leaflet-control { margin-right: 10px; }
.leaflet-fade-anim .leaflet-popup { opacity: 0; transition: opacity 0.2s linear; }
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { opacity: 1; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition: transform 0.25s cubic-bezier(0,0,0.25,1); }
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile { transition: none; }
.leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; }
.leaflet-interactive { cursor: pointer; }
.leaflet-grab { cursor: grab; }
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive { cursor: crosshair; }
.leaflet-popup-pane,
.leaflet-control { cursor: auto; }
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable { cursor: grabbing; }
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container { pointer-events: none; }
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path { pointer-events: auto; }
.leaflet-container a { color: #0b66ad; }
.leaflet-zoom-box { border: 2px dotted #38f; background: rgba(255,255,255,0.5); }
.leaflet-container { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.leaflet-bar { box-shadow: 0 2px 10px rgba(0,0,0,0.16); border-radius: 10px; overflow: hidden; }
.leaflet-bar a { background-color: #fff; border-bottom: 1px solid #d8e1eb; width: 34px; height: 34px; line-height: 34px; display: block; text-align: center; text-decoration: none; color: #1f2d3d; font-size: 20px; }
.leaflet-bar a:hover,
.leaflet-bar a:focus { background-color: #f4f8fc; }
.leaflet-bar a:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.leaflet-bar a:last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-bottom: none; }
.leaflet-bar a.leaflet-disabled { cursor: default; background-color: #f4f4f4; color: #bbb; }
.leaflet-control-zoom-in,
.leaflet-control-zoom-out { font: 600 18px/34px Arial, Helvetica, sans-serif; text-indent: 1px; }
.leaflet-control-attribution { background: rgba(255,255,255,0.82); margin: 0; padding: 3px 7px; color: #516173; border-top-left-radius: 8px; }
.leaflet-control-attribution a { text-decoration: none; }
.leaflet-control-layers { box-shadow: 0 4px 16px rgba(17,43,70,.14); background: #fff; border-radius: 12px; }
.leaflet-control-layers-toggle { background-image: none; width: 36px; height: 36px; display: block; position: relative; }
.leaflet-control-layers-toggle:before { content: "☰"; position: absolute; inset: 0; display: grid; place-items: center; color: #0b66ad; font-size: 19px; }
.leaflet-control-layers-expanded { padding: 10px 12px; color: #263445; background: #fff; }
.leaflet-control-layers-scrollbar { overflow-y: scroll; overflow-x: hidden; padding-right: 5px; }
.leaflet-control-layers-selector { margin-top: 2px; position: relative; top: 1px; }
.leaflet-control-layers label { display: block; font-size: 13px; margin: 4px 0; }
.leaflet-control-layers-separator { height: 0; border-top: 1px solid #e0e8f2; margin: 8px -6px 8px -6px; }
.leaflet-popup { position: absolute; text-align: center; margin-bottom: 20px; }
.leaflet-popup-content-wrapper { padding: 1px; text-align: left; border-radius: 14px; box-shadow: 0 8px 26px rgba(15,43,74,.20); }
.leaflet-popup-content { margin: 14px 16px; line-height: 1.45; min-width: 210px; }
.leaflet-popup-tip-container { width: 40px; height: 20px; position: absolute; left: 50%; margin-left: -20px; overflow: hidden; pointer-events: none; }
.leaflet-popup-tip { width: 17px; height: 17px; padding: 1px; margin: -10px auto 0; transform: rotate(45deg); background: white; box-shadow: 0 3px 14px rgba(15,43,74,.16); }
.leaflet-popup-close-button { position: absolute; top: 0; right: 0; border: none; text-align: center; width: 30px; height: 30px; font: 18px/30px Tahoma, Verdana, sans-serif; color: #6f7d8d; text-decoration: none; background: transparent; }
.leaflet-popup-close-button:hover { color: #111827; }
.leaflet-popup-scrolled { overflow: auto; }
.leaflet-oldie .leaflet-popup-content-wrapper { zoom: 1; }
.leaflet-oldie .leaflet-popup-tip { width: 24px; margin: 0 auto; }
.leaflet-oldie .leaflet-popup-tip-container { margin-top: -1px; }
.leaflet-tooltip { position: absolute; padding: 6px 8px; background-color: #fff; border: 1px solid #d8e1eb; border-radius: 8px; color: #243547; white-space: nowrap; user-select: none; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.leaflet-tooltip.leaflet-interactive { cursor: pointer; pointer-events: auto; }
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before { position: absolute; pointer-events: none; border: 6px solid transparent; background: transparent; content: ""; }
.leaflet-tooltip-bottom { margin-top: 6px; }
.leaflet-tooltip-top { margin-top: -6px; }
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before { left: 50%; margin-left: -6px; }
.leaflet-tooltip-top:before { bottom: 0; margin-bottom: -12px; border-top-color: #d8e1eb; }
.leaflet-tooltip-bottom:before { top: 0; margin-top: -12px; margin-left: -6px; border-bottom-color: #d8e1eb; }


:root {
  --blue: #0869b2;
  --blue-dark: #064c82;
  --blue-soft: #e8f4ff;
  --green: #13a06f;
  --amber: #f0a52b;
  --red: #d9534f;
  --text: #1d2936;
  --muted: #647386;
  --line: #dbe7f2;
  --bg: #f2f7fc;
  --panel: #ffffff;
  --shadow: 0 14px 36px rgba(20, 50, 82, 0.09);
  --radius: 18px;
  --map-row-height: 360px;
}

* { box-sizing: border-box; }
html,
body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6fd 100%);
}
button,
input,
select,
table { font: inherit; }
h1,
h2,
p { margin: 0; }
button { font-weight: 400; }

.app-shell {
  width: min(1720px, calc(100% - 28px));
  height: 100vh;
  margin: 0 auto;
  padding: 12px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.eyebrow {
  margin-bottom: 4px;
  color: var(--blue-dark);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cfe5fa;
  background: var(--blue-soft);
  color: var(--blue-dark);
  white-space: nowrap;
  font-size: 13px;
}
.status-pill.soft {
  color: #536273;
  background: #f5f9fd;
  border-color: var(--line);
}

.dashboard-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 10px;
}
.sidebar,
.content-stack { min-height: 0; }
.sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, auto);
  align-content: start;
  gap: 10px;
}
.side-card,
.stat-card,
.map-card,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.side-card { padding: 14px; }
.section-label {
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: .12em;
  color: #315d82;
  text-transform: uppercase;
}
.filter-field { margin-bottom: 10px; }
.filter-field label {
  display: block;
  margin: 0 0 5px;
  font-size: 12px;
  color: #445569;
}
.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.filter-field input:focus,
.filter-field select:focus {
  border-color: #87c6f3;
  box-shadow: 0 0 0 4px rgba(8,105,178,.09);
}
.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.btn {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.primary-btn {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(8,105,178,.22);
}
.primary-btn:hover { background: var(--blue-dark); }
.soft-btn {
  color: #24384f;
  background: #edf4fb;
  border: 1px solid #d8e7f5;
}
.soft-btn:hover { background: #e4eef8; }
.selected-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  color: #24445f;
  line-height: 1.35;
  font-size: 14px;
}
.legend-list {
  display: grid;
  gap: 8px;
  color: #526174;
  font-size: 13px;
}
.legend-list span { display: flex; align-items: center; gap: 8px; }
.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.legend-dot.low { background: #1d8fd7; }
.legend-dot.mid { background: #16a270; }
.legend-dot.high { background: #f0a52b; }
.legend-dot.very-high { background: #d9534f; }

.content-stack {
  display: grid;
  grid-template-rows: auto minmax(300px, var(--map-row-height)) minmax(220px, 1fr);
  gap: 10px;
  overflow: hidden;
}
.stats-grid {
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stat-card {
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
}
.stat-card span {
  color: var(--muted);
  font-size: 12px;
}
.stat-card strong {
  color: #083e68;
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 500;
  letter-spacing: .02em;
}

.map-card,
.table-card {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.card-title-row h2 {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.card-title-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.map-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.map-size-control,
.map-note,
.table-count {
  flex: 0 0 auto;
  color: #526174;
  background: #f5f9fd;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.map-size-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.map-size-control input {
  width: 128px;
  accent-color: var(--blue);
}
.map-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #dce9f3;
}
.map-notice {
  position: absolute;
  inset: auto 16px 16px 16px;
  z-index: 3;
  padding: 12px 14px;
  border-radius: 12px;
  color: #65430d;
  background: #fff8e6;
  border: 1px solid #f0d38e;
  box-shadow: 0 10px 28px rgba(30,50,70,.12);
}
.table-title-row { padding-top: 10px; padding-bottom: 10px; }
.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 11px;
  text-align: left;
  color: #31465b;
  background: #f1f7fc;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
thead th:hover { background: #e7f1fa; }
thead th.sort-asc::after { content: "  ↑"; color: var(--blue); }
thead th.sort-desc::after { content: "  ↓"; color: var(--blue); }
tbody td {
  padding: 9px 11px;
  border-bottom: 1px solid #edf3f8;
  color: #26384b;
  vertical-align: top;
}
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #f6fbff; }
tbody tr.active-row td {
  background: #e8f4ff;
  color: #063d66;
}
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.popup-title {
  color: #0a4d80;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 3px;
}
.popup-subtitle {
  color: #526174;
  font-size: 13px;
  margin-bottom: 10px;
}
.popup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.popup-table td {
  padding: 5px 0;
  border-bottom: 1px solid #edf2f7;
}
.popup-table td:first-child {
  color: #6a7888;
  padding-right: 16px;
  white-space: nowrap;
}
.popup-table td:last-child {
  color: #1d2936;
  text-align: right;
}

.leaflet-control-layers {
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 24px rgba(15,43,74,.14) !important;
  overflow: hidden;
}
.leaflet-control-layers-expanded {
  max-width: min(260px, calc(100vw - 40px));
  max-height: 220px;
  overflow: auto;
}
.leaflet-control-zoom a {
  color: #163b5c !important;
  font-weight: 400 !important;
}
.leaflet-popup-content-wrapper { border-radius: 14px !important; }
.leaflet-popup-content { min-width: 230px; }
.leaflet-control-attribution {
  font-size: 10px !important;
  max-width: min(70vw, 650px);
  white-space: normal !important;
}

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 270px minmax(0,1fr); }
  .content-stack { grid-template-rows: auto minmax(300px, var(--map-row-height)) minmax(220px, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 10px 12px; }
  .stat-card strong { font-size: 24px; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .app-shell {
    width: min(100% - 18px, 760px);
    height: auto;
    min-height: 100vh;
    padding: 9px 0 18px;
  }
  .topbar { align-items: flex-start; flex-direction: column; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-rows: none; }
  .content-stack {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .map-card { min-height: 410px; }
  .map-frame { min-height: 300px; }
  .table-card { min-height: 420px; }
  .card-title-row { align-items: flex-start; flex-direction: column; }
  .map-toolbar { width: 100%; justify-content: flex-start; }
  .map-size-control input { width: min(170px, 42vw); }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .range-grid,
  .button-row { grid-template-columns: 1fr; }
  .status-pill { font-size: 12px; }
  h1 { font-size: 24px; }
  table { font-size: 12px; }
  thead th,
  tbody td { padding: 8px; }
}


/* Final one-page compact dashboard overrides */
html, body, button, input, select, table, .leaflet-container {
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 400 !important;
}
h1, h2, h3, h4, h5, h6, strong, th, .popup-title, .card-title-row h2, .stat-card strong, .leaflet-control-zoom-in, .leaflet-control-zoom-out {
  font-weight: 400 !important;
}
.app-shell {
  width: min(1780px, calc(100% - 24px));
  padding: 10px 0;
  gap: 8px;
}
.topbar {
  min-height: 58px;
  padding: 10px 16px;
  border-radius: 18px;
}
.eyebrow { margin-bottom: 2px; }
h1 { font-size: clamp(23px, 2vw, 31px); letter-spacing: -0.02em; }
.dashboard-grid { grid-template-columns: 300px minmax(0, 1fr); gap: 8px; }
.sidebar { overflow: auto; padding-right: 1px; gap: 8px; }
.side-card { padding: 13px; border-radius: 16px; }
.filter-field { margin-bottom: 9px; }
.filter-field input, .filter-field select, .btn { min-height: 38px; border-radius: 11px; }
.content-stack {
  grid-template-rows: auto minmax(300px, var(--map-row-height)) minmax(0, 1fr);
  gap: 8px;
}
.stats-grid { min-height: 60px; gap: 8px; }
.stat-card { padding: 9px 13px; border-radius: 16px; }
.stat-card strong { font-size: clamp(21px, 2vw, 28px); }
.card-title-row { padding: 9px 13px; }
.card-title-row h2 { font-size: 16px; }
.card-title-row p { font-size: 12px; margin-top: 3px; }
.map-size-control, .map-note, .table-count { font-size: 12px; padding: 5px 9px; }
.map-size-control input { width: 130px; }
thead th { padding: 9px 10px; font-weight: 400 !important; }
tbody td { padding: 8px 10px; }
.legend-note { margin-bottom: 8px; color: #647386; font-size: 12px; line-height: 1.35; }
.leaflet-control-layers-toggle:before { content: "▦"; font-size: 20px; }
.leaflet-control-layers-expanded label { white-space: nowrap; }
.leaflet-control-layers-expanded { max-width: min(280px, calc(100vw - 44px)); }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 270px minmax(0,1fr); }
  .content-stack { grid-template-rows: auto minmax(225px, 32vh) minmax(0,1fr); }
}

@media (max-height: 760px) and (min-width: 861px) {
  .topbar { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
  .content-stack { grid-template-rows: auto minmax(210px, 31vh) minmax(0,1fr); }
  .stats-grid { min-height: 56px; }
  .stat-card strong { font-size: 22px; }
  .side-card { padding: 11px 12px; }
  .filter-field input, .filter-field select, .btn { min-height: 36px; }
}

/* Professional final refinements */
html, body, button, input, select, table, .leaflet-container {
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 400 !important;
}
.sidebar { grid-template-rows: none; align-content: start; }
.slider-field { margin-bottom: 12px; }
.slider-field > label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: #445569;
}
.range-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #24445f;
  font-size: 12px;
  margin-bottom: 8px;
}
.range-values span {
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid #dbe7f2;
  border-radius: 999px;
  background: #f5f9fd;
  white-space: nowrap;
}
.dual-range {
  position: relative;
  height: 32px;
  display: grid;
  align-items: center;
}
.range-track {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #dbe7f2;
  overflow: hidden;
}
.range-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: inherit;
  background: #0869b2;
}
.dual-range input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}
.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
}
.dual-range input[type="range"]::-moz-range-track {
  height: 5px;
  background: transparent;
}
.dual-range input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0869b2;
  box-shadow: 0 3px 10px rgba(8,105,178,.28);
  cursor: pointer;
}
.dual-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0869b2;
  box-shadow: 0 3px 10px rgba(8,105,178,.28);
  cursor: pointer;
}
.full-btn { width: 100%; }
.download-card p {
  margin-top: 8px;
  color: #647386;
  font-size: 12px;
  line-height: 1.35;
}
.popup-kml-btn {
  width: 100%;
  margin-top: 11px;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: #0869b2;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
}
.popup-kml-btn:hover { background: #064c82; }
.leaflet-interactive { outline: none; }


/* Final production sizing and map-layer refinements */
:root { --map-row-height: 360px; }
.app-shell {
  width: min(1500px, calc(100% - 20px));
  padding: 8px 0;
  gap: 8px;
}
.dashboard-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 8px; }
.topbar { min-height: 56px; padding: 9px 15px; }
h1 { font-size: clamp(22px, 1.85vw, 30px); }
.stats-grid { min-height: 58px; }
.side-card { padding: 12px; }
.filter-field input,
.filter-field select,
.btn { min-height: 37px; }
.leaflet-control-layers-toggle:before { content: "▦"; font-size: 18px; }
.leaflet-control-layers-expanded {
  padding: 10px 12px !important;
  border-radius: 14px !important;
  max-width: min(300px, calc(100vw - 44px));
  max-height: min(300px, calc(100vh - 120px));
  overflow: auto;
}
.leaflet-control-layers-expanded label {
  display: flex !important;
  align-items: center;
  gap: 7px;
  margin: 6px 0 !important;
  white-space: nowrap;
  font-size: 13px !important;
  color: #2e4054;
}
.leaflet-control-layers-selector { margin: 0 !important; }
@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 250px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app-shell { width: min(100% - 16px, 760px); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Final tuning: slightly taller opening map and icon-based map/table size control */
:root { --map-row-height: 390px; }
.map-size-control { display: none !important; }
.map-size-popover {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.map-size-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dbe7f2;
  border-radius: 999px;
  color: #0869b2;
  background: #f5f9fd;
  box-shadow: 0 5px 14px rgba(15,43,74,.08);
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.map-size-icon-btn:hover,
.map-size-icon-btn[aria-expanded="true"] {
  color: #ffffff;
  background: #0869b2;
  border-color: #0869b2;
}
.map-size-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 238px;
  z-index: 80;
  padding: 12px;
  border: 1px solid #dbe7f2;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15,43,74,.18);
}
.map-size-panel[hidden] { display: none !important; }
.panel-title {
  margin-bottom: 8px;
  color: #24445f;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.map-size-panel input[type="range"] {
  width: 100%;
  accent-color: #0869b2;
}
.map-size-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: #647386;
  font-size: 11px;
  white-space: nowrap;
}
.map-toolbar { position: relative; }
@media (max-width: 860px) {
  :root { --map-row-height: 390px; }
  .map-size-panel {
    right: auto;
    left: 0;
    width: min(238px, calc(100vw - 38px));
  }
}


/* Meteorological dashboard symbology */
.legend-dot.manual { background: #1d8fd7; }
.legend-dot.tpb { background: #16a270; }
.legend-dot.aws { background: #f0a52b; }
.legend-dot.unknown { background: #7a869a; }
.table-wrap table th:nth-child(3),
.table-wrap table td:nth-child(3) { min-width: 160px; }
.table-wrap table th:nth-child(4),
.table-wrap table td:nth-child(4) { min-width: 110px; }
.table-wrap table th:nth-child(5),
.table-wrap table td:nth-child(5) { min-width: 140px; }
