﻿@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Prompt:wght@500;600;700&display=swap");

:root {
  --bg: #f4f8ff;
  --bg-2: #edf4ff;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --text: #12365f;
  --muted: #5f7897;
  --accent: #f08a24;
  --accent-2: #1b66c9;
  --accent-2-soft: #eaf2ff;
  --danger: #da3d35;
  --warn: #e29a17;
  --ok: #1f9b56;
  --border: #d8e6f6;
  --shadow: 0 10px 30px rgba(15, 57, 105, 0.08);
  --topbar-offset: 190px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Kanit", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f9fcff 0%, #eef5ff 48%, #f7fbff 100%);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  padding: 5px;
  background: var(--accent-2-soft);
  border: 1px solid #cfe0f5;
}

.brand h1 {
  margin: 0;
  font-family: "Prompt", sans-serif;
  font-size: 22px;
  line-height: 1.2;
  color: #114783;
}

.brand span {
  font-size: 12px;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tabs button,
.bottom-nav button {
  border: 1px solid transparent;
  background: #f5f9ff;
  color: #22558d;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Kanit", sans-serif;
  transition: all 0.18s ease;
}

.nav-tabs button:hover,
.bottom-nav button:hover {
  border-color: #bdd5f1;
}

.nav-tabs button.active,
.bottom-nav button.active {
  background: linear-gradient(90deg, var(--accent-2), #2e78d5);
  color: #fff;
  box-shadow: 0 6px 16px rgba(27, 102, 201, 0.25);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.controls select,
.controls input,
.inline-controls select,
.inline-controls input {
  min-width: 130px;
  border: 1px solid #c9dcf3;
  background: #fff;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 10px;
  font-family: "Kanit", sans-serif;
}

button {
  border: none;
  background: linear-gradient(90deg, var(--accent), #f5a348);
  color: #512a00;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #edf4ff;
  color: #1c5aa0;
  border: 1px solid #bed6f2;
}

.page-shell {
  padding: calc(var(--topbar-offset) + 16px) 16px 16px;
}

.page-section.hidden { display: none; }

.page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.map-slot {
  min-height: 50vh;
}

.map-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
}

.map-header {
  background: linear-gradient(90deg, #edf5ff, #fff8ef);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.map-header h3 {
  margin: 0;
  color: #0f4f93;
  font-size: 16px;
}

.map-sub {
  color: #6f86a4;
  font-size: 12px;
}

.map-canvas {
  width: 100%;
  min-height: 52vh;
  flex: 1 1 auto;
}

.content-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0;
  font-size: 13px;
  color: #5f7798;
  font-weight: 500;
}

.card p {
  margin: 7px 0 0;
  font-size: 24px;
  color: #124d8e;
  font-weight: 700;
}

.panel-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel-section.compact {
  padding: 10px 12px;
}

.panel-section h2 {
  margin: 0 0 10px;
  font-size: 19px;
  color: #0f4d8f;
}

.panel-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.province-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.province-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7fbff;
  border: 1px solid #d5e6f9;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 13px;
}

.province-check-item input {
  width: 16px;
  height: 16px;
}

.inline-controls input[type="number"] {
  min-width: 150px;
}

.ai-feedback-controls select,
.ai-feedback-controls input {
  min-width: 170px;
}

.ai-feedback-controls input[type="text"] {
  flex: 1 1 280px;
}

.ops-output {
  margin: 10px 0 0;
  padding: 10px;
  min-height: 96px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #d4e2f5;
  border-radius: 10px;
  background: #10273f;
  color: #d8ebff;
  font-size: 12px;
  line-height: 1.45;
}

#aiOpsPanel .inline-controls input[type="password"] {
  min-width: 220px;
}

#aiOpsPanel .inline-controls input[type="date"],
#aiOpsPanel .inline-controls select,
#aiOpsPanel .inline-controls input[type="text"] {
  min-width: 150px;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f7ff;
  border: 1px solid #d1e2f6;
  color: #1c5ea5;
  font-size: 12px;
}

.chip span {
  font-weight: 700;
}

.kpi-gate-pass {
  color: var(--ok);
}

.kpi-gate-fail {
  color: var(--danger);
}

.kpi-split-pass {
  color: var(--ok);
  font-weight: 600;
}

.kpi-split-fail {
  color: var(--danger);
  font-weight: 600;
}

.info-body {
  display: grid;
  gap: 8px;
}

#rainSummaryContent {
  --rain-visible-rows: 3;
  --rain-row-gap: 10px;
  --rain-row-height: 120px;
}

.rain-summary-list {
  display: grid;
  gap: 10px;
}

.rain-summary-viewport {
  position: relative;
  overflow: hidden;
  height: calc(
    (var(--rain-row-height) * var(--rain-visible-rows))
    + (var(--rain-row-gap) * (var(--rain-visible-rows) - 1))
  );
}

.rain-summary-track {
  display: flex;
  flex-direction: column;
  gap: var(--rain-row-gap);
  will-change: transform;
}

.rain-summary-track.is-animated {
  animation: rain-summary-scroll-up var(--rain-scroll-duration, 40s) linear infinite;
}

.rain-summary-set {
  display: grid;
  gap: var(--rain-row-gap);
}

.rain-item-card {
  height: var(--rain-row-height);
  padding: 8px;
  border-left: 3px solid #1b66c9;
  background: #f9fbff;
  border-radius: 4px;
  overflow: hidden;
}

.rain-item-title {
  font-weight: 600;
  color: #114783;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rain-item-meta,
.rain-item-time {
  margin-top: 4px;
  font-size: 12px;
  color: #5f7897;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rain-item-status-row {
  margin-top: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rain-item-badge {
  background: #fff3cd;
  padding: 2px 6px;
  border-radius: 3px;
  color: #e29a17;
}

.rain-item-advice {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

@keyframes rain-summary-scroll-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(-1 * var(--rain-scroll-distance, 0px)));
  }
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.info-row span {
  color: #4e6d91;
}

.meta-line {
  font-size: 12px;
  color: #6f87a5;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.value-box {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.value-box .value {
  font-size: 18px;
  font-weight: 700;
  color: #114c8d;
}

.value-box .label {
  font-size: 12px;
  color: #6880a0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff4e8;
  border: 1px solid #f5c995;
  color: #875116;
  font-size: 12px;
  font-weight: 600;
}

.list {
  display: grid;
  gap: 8px;
  max-height: 38vh;
  overflow: auto;
}

.list-item,
.mini-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fcff;
  padding: 8px 10px;
  cursor: pointer;
}

.list-item h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.list-item p,
.mini-item {
  margin: 0;
  font-size: 12px;
  color: #5d7697;
}

.list-item:hover,
.mini-item:hover {
  background: #edf5ff;
}

.mini-list {
  display: grid;
  gap: 8px;
}

#earthquakeList {
  --earthquake-visible-rows: 5;
  --earthquake-row-gap: 8px;
  --earthquake-row-height: 58px;
}

.earthquake-scroll-viewport {
  position: relative;
  overflow: hidden;
  height: calc(
    (var(--earthquake-row-height) * var(--earthquake-visible-rows))
    + (var(--earthquake-row-gap) * (var(--earthquake-visible-rows) - 1))
  );
}

.earthquake-scroll-track {
  display: flex;
  flex-direction: column;
  gap: var(--earthquake-row-gap);
  will-change: transform;
}

.earthquake-scroll-track.is-animated {
  animation: earthquake-scroll-up var(--earthquake-scroll-duration, 60s) linear infinite;
}

.earthquake-scroll-set {
  display: grid;
  gap: var(--earthquake-row-gap);
}

.earthquake-item {
  height: var(--earthquake-row-height);
  overflow: hidden;
}

@keyframes earthquake-scroll-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(-1 * var(--earthquake-scroll-distance, 0px)));
  }
}

.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 1px solid #d7e6f7;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: linear-gradient(90deg, #ecf4ff, #fff4e8);
  color: #0e4e91;
  font-weight: 600;
}

.data-table tbody tr:nth-child(odd) {
  background: #f9fcff;
}

.sub-title {
  margin: 0 0 8px;
  font-size: 15px;
  color: #2c5f96;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.aqi-divicon-wrap,
.hotspot-divicon-wrap {
  background: transparent;
  border: none;
}

.aqi-divicon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #154f8c;
  background: color-mix(in srgb, var(--aqi-color) 68%, #ffffff 32%);
  color: #083a72;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(7, 45, 94, 0.25);
}

.hotspot-divicon {
  width: 18px;
  height: 18px;
  display: inline-block;
  transform: rotate(45deg);
  border: 1.8px solid #1a1a1a;
  border-radius: 3px;
  background: var(--hs-color);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.hotspot-divicon.is-night {
  opacity: 0.9;
}

.hotspot-divicon.is-day {
  opacity: 1;
}

.hotspot-count-label {
  background: rgba(214, 28, 28, 0.92);
  border: 1px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.ai-map-legend {
  width: 272px;
  max-width: 72vw;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #c7daf2;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 57, 105, 0.22);
  padding: 10px 10px 8px;
  color: #134b85;
  font-size: 12px;
  line-height: 1.35;
}

.ai-legend-toggle {
  width: 100%;
  border: 1px solid #c7daf2;
  border-radius: 8px;
  background: #f5f9ff;
  color: #0f4f93;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding: 6px 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.ai-legend-body {
  max-height: 46vh;
  overflow: auto;
}

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

.ai-map-legend.is-hidden {
  display: none;
}

.ai-legend-title {
  font-weight: 700;
  color: #0f4f93;
  margin-bottom: 2px;
}

.ai-legend-sub {
  color: #446b95;
  font-weight: 600;
  margin-bottom: 4px;
}

.ai-legend-note {
  color: #6b84a4;
  margin-bottom: 6px;
}

.ai-legend-group {
  border-top: 1px dashed #d4e4f7;
  padding-top: 6px;
  margin-top: 6px;
}

.ai-legend-group-title {
  font-weight: 600;
  color: #0f4f93;
  margin-bottom: 4px;
}

.ai-legend-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ai-legend-swatch {
  display: inline-block;
  width: 30px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid #c6d8ee;
}

.ai-risk-none {
  background: rgba(160, 172, 190, 0.28);
}

.ai-risk-low {
  background: rgba(31, 155, 86, 0.56);
}

.ai-risk-medium {
  background: rgba(230, 179, 26, 0.56);
}

.ai-risk-high {
  background: rgba(239, 127, 26, 0.56);
}

.ai-risk-critical {
  background: rgba(216, 58, 58, 0.56);
}

.ai-legend-flow-line {
  position: relative;
  display: inline-block;
  width: 32px;
  border-top: 2px dashed #1b66c9;
  height: 0;
}

.ai-legend-flow-arrow {
  position: absolute;
  right: -2px;
  top: -10px;
  font-size: 12px;
  color: #1b66c9;
  font-weight: 700;
}

.ai-legend-flow-buffer {
  display: inline-block;
  width: 30px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(27, 102, 201, 0.65);
  background: rgba(74, 168, 255, 0.24);
}

.ai-legend-impact {
  display: inline-flex;
  min-width: 34px;
  height: 20px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  border: 2px solid #1f9b56;
  color: #1f9b56;
  font-weight: 700;
  font-size: 10px;
  background: rgba(31, 155, 86, 0.1);
}

.ai-legend-impact.g1 {
  border-color: #1f9b56;
  color: #1f9b56;
}

.ai-legend-evac {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(12, 139, 69, 0.95);
  border: 2px solid #e9ffe9;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
}

.ai-legend-boundary {
  display: inline-block;
  width: 32px;
  border-top: 2px solid #2d6ddf;
}

.ai-area-breadcrumb {
  min-width: 240px;
  max-width: min(520px, 80vw);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c7daf2;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 57, 105, 0.2);
  padding: 6px 10px;
  color: #144a83;
  font-size: 12px;
  line-height: 1.3;
}

.ai-area-breadcrumb .crumb-level {
  font-weight: 700;
  color: #0f4f93;
  margin-right: 6px;
}

.ai-area-breadcrumb .crumb-path {
  font-weight: 600;
  color: #2b5f96;
}

.flow-arrow {
  background: rgba(27, 102, 201, 0.9);
  color: #fff;
  border-radius: 999px;
  border: 1px solid #fff;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 57, 105, 0.25);
}

.ai-evac-icon {
  background: rgba(12, 139, 69, 0.95);
  color: #fff;
  border-radius: 999px;
  border: 2px solid #e9ffe9;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(9, 79, 39, 0.34);
}

.impact-label {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #c7daf2;
  border-radius: 8px;
  padding: 2px 6px;
  color: #154f8c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.boundary-label {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #c8daf1;
  border-radius: 6px;
  color: #0f4f93;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(15, 57, 105, 0.15);
}

.risk-low {
  background: #e7f8ee;
  border: 1px solid #95ddb2;
  color: #1b7f46;
}

.risk-medium {
  background: #fff7dc;
  border: 1px solid #f3d37b;
  color: #996b04;
}

.risk-high {
  background: #ffe8e8;
  border: 1px solid #efabab;
  color: #b33131;
}

.badge {
  background: #e9f2ff;
  color: #1f5ca2;
  border: 1px solid #bfd7f2;
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 10px;
}

.footer-note {
  margin-top: 8px;
  font-size: 12px;
  color: #607a9b;
}

.panel-grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.risk-cards .card p {
  font-size: 22px;
}

.chart-wrap {
  height: 260px;
}

@media (min-width: 980px) {
  .page-grid {
    grid-template-columns: minmax(620px, 62vw) minmax(360px, 1fr);
    align-items: start;
  }

  .map-slot {
    position: sticky;
    top: calc(var(--topbar-offset) + 10px);
    align-self: start;
    min-height: calc(100dvh - var(--topbar-offset) - 24px);
  }

  .map-slot .map-panel {
    height: calc(100dvh - var(--topbar-offset) - 24px);
    min-height: 620px;
  }

  .page-grid .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid .panel-grid-2 {
    grid-template-columns: 1fr;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 23, 43, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: min(420px, 92vw);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.modal-content h3 {
  margin: 0 0 8px;
}

.modal-content label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.modal-content input {
  width: 100%;
  margin-top: 4px;
  border: 1px solid #c9dcf3;
  border-radius: 8px;
  padding: 8px;
  font-family: "Kanit", sans-serif;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none !important;
  gap: 6px;
  justify-content: space-around;
  align-items: center;
  padding: 9px 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  z-index: 120;
}

#backoffice-btn {
  position: fixed;
  right: 18px;
  bottom: 20px;
  background: linear-gradient(90deg, var(--accent-2), #3f85de);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(27, 102, 201, 0.3);
  z-index: 150;
}

@media (max-width: 1080px) {
  .summary-cards,
  .risk-cards,
  .panel-grid-2,
  .province-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: calc(var(--topbar-offset) + 10px) 10px 12px;
    padding-bottom: 12px;
  }

  .topbar {
    padding: 10px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .nav-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
  }
  .nav-tabs button {
    flex: 0 0 auto;
  }

  .summary-cards,
  .risk-cards,
  .panel-grid-2,
  .value-grid,
  .province-check-grid {
    grid-template-columns: 1fr;
  }

  .map-canvas,
  .map-panel,
  .map-slot {
    min-height: 44vh;
  }

  .controls select,
  .controls input,
  .inline-controls select,
  .inline-controls input {
    min-width: 100%;
  }

  .leaflet-bottom.leaflet-left .ai-map-legend {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 0 0 8px 0;
    border-radius: 12px 12px 0 0;
  }

  .ai-area-breadcrumb {
    max-width: calc(100vw - 88px);
    font-size: 11px;
    padding: 5px 8px;
  }
}

.hidden { display: none !important; }
/* Loading spinner for hotspot data */
.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid #1b66c9;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Map Layer Toggle */
.map-layer-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: #f9fbff;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}

.map-layer-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.map-layer-toggle input[type="radio"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-2);
}

.map-layer-toggle label:hover {
  color: var(--accent-2);
}

.map-layer-toggle input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--accent-2);
}

/* AI hazard selector */
.hazard-picker {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7fbff;
}

.hazard-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hazard-picker-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.hazard-picker-row input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: #1b66c9;
}
