/* ==========================================================================
   Bhubaneswar Childcare Georeferencing Tool (GCT) — Google Maps-Style GIS UI
   ========================================================================== */

:root {
  --bg-surface: #ffffff;
  --bg-subtle: #f8f9fa;
  --bg-hover: #f1f3f4;
  --border: #e0e3e7;
  --border-light: #eef0f2;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;

  --g-blue: #1a73e8;
  --g-blue-dark: #1557b0;
  --g-blue-soft: #e8f0fe;
  --g-red: #ea4335;
  --g-red-dark: #c5221f;
  --g-red-soft: #fce8e6;
  --g-green: #1e8e3e;
  --g-green-soft: #e6f4ea;
  --g-amber: #e37400;
  --g-amber-soft: #fef7e0;
  --g-teal: #00796b;
  --g-teal-soft: #e0f2f1;

  --shadow-sm: 0 1px 3px rgba(60, 64, 67, 0.2), 0 1px 2px rgba(60, 64, 67, 0.12);
  --shadow-md: 0 2px 6px rgba(60, 64, 67, 0.28), 0 1px 2px rgba(60, 64, 67, 0.14);
  --shadow-lg: 0 4px 16px rgba(60, 64, 67, 0.26), 0 1px 4px rgba(60, 64, 67, 0.12);

  --drawer-width: 396px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --transition: 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background: #e5e9ec;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ---------- Full-Screen Map ---------- */
#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Subtle attribution styling */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(4px);
  color: var(--text-secondary) !important;
  padding: 2px 6px !important;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(248, 249, 250, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  padding: 18px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--g-blue-soft);
  border-top-color: var(--g-blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.loading-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.loading-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---------- Top-Left Search Bar & Zone Chips ---------- */
.top-left-bar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
  width: calc(var(--drawer-width) - 24px);
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.search-shell {
  pointer-events: auto;
  display: flex;
  align-items: center;
  height: 48px;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding: 0 6px 0 8px;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.18s ease, border-radius 0.18s ease;
}

.search-shell:focus-within {
  box-shadow: var(--shadow-lg);
}

.search-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  padding: 0 4px;
}

.search-shell input::placeholder {
  color: var(--text-muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn.search-lens {
  color: var(--g-blue);
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-btn-sm:hover {
  background: var(--bg-hover);
}

/* Search Autocomplete Dropdown */
.search-results {
  pointer-events: auto;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
}

.sr-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 14px 4px;
  background: var(--bg-subtle);
}

.sr-item {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--border-light);
}

.sr-item:last-child {
  border-bottom: none;
}

.sr-item:hover {
  background: var(--g-blue-soft);
}

.sr-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}

.sr-icon.ward {
  background: var(--g-blue-soft);
  color: var(--g-blue);
}

.sr-icon.awc {
  background: var(--g-red-soft);
  color: var(--g-red-dark);
}

.sr-text {
  flex: 1;
  min-width: 0;
}

.sr-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sr-empty {
  padding: 18px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* Zone Filter Chips */
.zone-chips {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  height: 32px;
  padding: 0 13px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.chip:hover {
  background: var(--bg-hover);
}

.chip.active {
  background: var(--g-blue);
  color: #ffffff;
  font-weight: 600;
}

/* ---------- Top-Right Compact Dashboard Statistics Bar ---------- */
.stats-bar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100vw - var(--drawer-width) - 28px);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-pill);
  padding: 7px 14px 7px 12px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  font-family: inherit;
}

.stat-pill:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.stat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-ward { background: var(--g-blue); }
.dot-awc { background: var(--g-red); }
.dot-pop { background: var(--g-teal); }
.dot-hh { background: var(--g-amber); }

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.stat-content strong {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-content small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- LEFT-SIDE Google Maps-Style Details Drawer ---------- */
.left-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-width);
  max-width: 92vw;
  background: var(--bg-surface);
  z-index: 1100;
  box-shadow: 2px 0 18px rgba(60, 64, 67, 0.24);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition);
}

.left-drawer.open {
  transform: translateX(0);
}

.drawer-header-spacer {
  height: 104px; /* Leaves clean breathing room for the floating search bar + zone chips */
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd1d8 transparent;
}

.drawer-scroll::-webkit-scrollbar {
  width: 6px;
}

.drawer-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
}

/* Google Maps-style Collapse Tab on right edge of drawer */
.drawer-collapse-tab {
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  width: 24px;
  height: 52px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: none;
  border-radius: 0 8px 8px 0;
  box-shadow: 3px 0 8px rgba(60, 64, 67, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.15s ease;
}

.left-drawer.has-content .drawer-collapse-tab {
  opacity: 1;
  pointer-events: auto;
}

.drawer-collapse-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.left-drawer:not(.open) .drawer-collapse-tab svg {
  transform: rotate(180deg);
}

/* ---------- Drawer Hero Banner & Content Styles ---------- */
.panel-hero {
  padding: 18px 20px 16px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.panel-hero.hero-awc {
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 62%, #eff6ff 100%);
}

.panel-hero.hero-ward {
  background: linear-gradient(135deg, #e8f0fe 0%, #ffffff 68%, #e6f4ea 100%);
}

.panel-hero.hero-overview {
  background: linear-gradient(135deg, #e0f2f1 0%, #ffffff 68%, #e8f0fe 100%);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.badge-red { background: var(--g-red-soft); color: var(--g-red-dark); }
.badge-blue { background: var(--g-blue-soft); color: var(--g-blue-dark); }
.badge-green { background: var(--g-green-soft); color: var(--g-green); }
.badge-amber { background: var(--g-amber-soft); color: #b06000; }
.badge-teal { background: var(--g-teal-soft); color: var(--g-teal); }
.badge-gray { background: var(--bg-hover); color: var(--text-secondary); }

.panel-close-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.panel-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.hero-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Google Maps-style Action Buttons Row */
.action-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--g-blue);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px;
  border-radius: 10px;
  transition: background 0.14s ease;
}

.action-btn:hover {
  background: var(--g-blue-soft);
}

.action-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #d2e3fc;
  background: #ffffff;
  color: var(--g-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease;
}

.action-btn.primary .action-circle {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #ffffff;
}

.action-btn:hover .action-circle {
  background: var(--g-blue);
  color: #ffffff;
}

/* Panel Sections */
.panel-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.panel-section:last-child {
  border-bottom: none;
}

.panel-sec-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* KPI Grid inside Drawer */
.kpi-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 11px 12px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3px;
  line-height: 1.2;
}

.kpi-value.muted {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Info List Rows (Google Maps style) */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.info-ico {
  width: 20px;
  height: 20px;
  color: var(--g-blue);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-body {
  flex: 1;
  min-width: 0;
}

.info-key {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.info-val {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.info-val a {
  color: var(--g-blue);
  text-decoration: none;
  font-weight: 600;
}

.info-val a:hover {
  text-decoration: underline;
}

/* Gender Split Bar */
.split-bar-wrap {
  margin-top: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
}

.split-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.split-male strong { color: #1967d2; }
.split-female strong { color: #c2185b; }

.split-bar {
  height: 9px;
  border-radius: 99px;
  background: #f8bbd0;
  overflow: hidden;
  display: flex;
}

.split-bar-fill {
  background: linear-gradient(90deg, #1a73e8, #4285f4);
  height: 100%;
  border-radius: 99px 0 0 99px;
}

/* Child Age Breakdown Bars */
.age-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}

.age-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.age-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.age-track {
  height: 7px;
  background: var(--bg-hover);
  border-radius: 99px;
  overflow: hidden;
}

.age-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--g-teal);
}

/* Clickable Centre Cards inside Ward Panel */
.centre-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}

.centre-mini-card {
  width: 100%;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.centre-mini-card:hover {
  border-color: #aecbfa;
  background: var(--g-blue-soft);
}

.cmc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cmc-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cmc-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--g-blue);
  background: var(--g-blue-soft);
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ---------- Facility Detail Card (Image 2 Reference Layout) ---------- */
.fc-card {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.fc-photo-wrap {
  position: relative;
  width: 100%;
  background: #edf2f7;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}

.fc-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.fc-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  transition: background 0.15s ease, transform 0.12s ease;
}

.fc-close-btn:hover {
  background: #ffffff;
  transform: scale(1.05);
}

.fc-header {
  padding: 16px 18px 18px;
  border-bottom: 1px solid #e8eaed;
}

.fc-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.fc-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  line-height: 1.3;
}

.fc-pill-cat {
  background: #dbeafe;
  color: #1d4ed8;
}

.fc-pill-cat-creche {
  background: #ccfbf1;
  color: #0f766e;
}

.fc-pill-cat-private {
  background: #ede9fe;
  color: #6d28d9;
}

.fc-pill-cat-service {
  background: #e0f2fe;
  color: #0369a1;
}

.fc-pill-functional {
  background: #dcfce7;
  color: #166534;
}

.fc-pill-partial {
  background: #fef3c7;
  color: #92400e;
}

.fc-pill-closed {
  background: #fee2e2;
  color: #991b1b;
}

.fc-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
  margin: 0;
}

.fc-subtitle {
  font-family: 'Noto Sans Oriya', 'Inter', sans-serif;
  font-size: 13px;
  color: #6b7280;
  margin-top: 5px;
  line-height: 1.45;
}

.fc-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.fc-meta-box {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 11px 13px;
}

.fc-meta-label {
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 400;
  line-height: 1.3;
}

.fc-meta-val {
  font-size: 13.5px;
  color: #111827;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.35;
}

.fc-contact-list {
  padding: 15px 18px;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-contact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.fc-contact-left {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6b7280;
  font-size: 13.5px;
  flex-shrink: 0;
  line-height: 1.4;
}

.fc-contact-ico {
  width: 17px;
  height: 17px;
  color: #6b7280;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fc-contact-val {
  font-size: 13.5px;
  color: #111827;
  font-weight: 500;
  text-align: right;
  line-height: 1.4;
  word-break: break-word;
}

.fc-contact-val a {
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}

.fc-contact-val a:hover {
  color: var(--g-blue);
  text-decoration: underline;
}

.fc-accordions {
  display: flex;
  flex-direction: column;
}

.fc-acc {
  border-bottom: 1px solid #eceef0;
}

.fc-acc:last-child {
  border-bottom: none;
}

.fc-acc-sum {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: #111827;
  user-select: none;
  transition: background 0.14s ease;
}

.fc-acc-sum::-webkit-details-marker {
  display: none;
}

.fc-acc-sum:hover {
  background: #f9fafb;
}

.fc-acc-chevron {
  width: 17px;
  height: 17px;
  color: #4b5563;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.fc-acc[open] .fc-acc-chevron {
  transform: rotate(180deg);
}

.fc-acc-body {
  padding: 0 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-desc {
  font-size: 12.8px;
  color: #4b5563;
  line-height: 1.5;
  background: #f9fafb;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  padding: 9px 11px;
}

.fc-kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fc-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.8px;
  line-height: 1.4;
}

.fc-kv-k {
  color: #6b7280;
  flex-shrink: 0;
}

.fc-kv-v {
  color: #111827;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.fc-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fc-tag {
  font-size: 11.5px;
  color: #374151;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 1.35;
}

.fc-status-yes {
  color: #166534;
  font-weight: 600;
}

.fc-status-no {
  color: #991b1b;
  font-weight: 600;
}

.fc-status-warn {
  color: #92400e;
  font-weight: 600;
}

.fc-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #eef0f2;
}

.fc-qbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.fc-qbtn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.fc-footer {
  padding: 13px 18px 18px;
  border-top: 1px solid #e8eaed;
  background: #fafafa;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.45;
}

.fc-footer-note {
  font-size: 11.2px;
  color: #9ca3af;
  margin-top: 4px;
}

/* Notice Callout */
.notice-box {
  background: var(--g-amber-soft);
  border: 1px solid #fde293;
  color: #7c4a03;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 10px;
}

/* Collapsible Details */
details.extra-details {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
}

details.extra-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.extra-details summary::after {
  content: '▾';
  font-size: 13px;
  color: var(--text-secondary);
}

details.extra-details[open] summary::after {
  content: '▴';
}

details.extra-details .info-list {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

/* Zone summary table in Overview */
.zone-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.zone-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.zone-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.zone-table th:not(:first-child),
.zone-table td:not(:first-child) {
  text-align: right;
}

.zone-table tr:last-child td {
  border-bottom: none;
}

/* ---------- Bottom-Left Google Maps-Style Layers Control ---------- */
.layers-widget {
  position: fixed;
  bottom: 20px;
  left: 16px;
  z-index: 1080;
  transition: left var(--transition);
}

body.drawer-open .layers-widget {
  left: calc(var(--drawer-width) + 28px);
}

.layers-fab {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  background: linear-gradient(145deg, #2e7d32 0%, #43a047 34%, #e8f0fe 35%, #dbeafe 68%, #fbbf24 100%);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.layers-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.72) 100%);
}

.layers-fab:hover {
  transform: scale(1.03);
}

.layers-fab-thumb,
.layers-fab-label {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.layers-fab-thumb {
  margin-bottom: 2px;
}

.layers-fab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.layers-popover {
  position: absolute;
  bottom: 82px;
  left: 0;
  width: 312px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 11px 16px;
  border-bottom: 1px solid var(--border-light);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.popover-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.popover-section:last-child {
  border-bottom: none;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 9px;
}

/* Basemap Grid */
.basemap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.basemap-card {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.bm-thumb {
  width: 56px;
  height: 44px;
  border-radius: 9px;
  border: 2px solid transparent;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.basemap-card.active .bm-thumb {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.25);
}

.basemap-card.active span:last-child {
  color: var(--g-blue);
  font-weight: 700;
}

.bm-voyager { background: linear-gradient(135deg, #f3f1eb 0%, #d4ebd0 45%, #fde293 75%, #aadaff 100%); }
.bm-satellite { background: linear-gradient(135deg, #1b3a2d 0%, #2d4a3e 50%, #4e5d52 100%); }
.bm-light { background: linear-gradient(135deg, #f8f9fa 0%, #e8eaed 60%, #dadce0 100%); }
.bm-terrain { background: linear-gradient(135deg, #d7e7c5 0%, #e7dec3 52%, #c9d8b6 100%); }

/* Layer Toggles */
.layer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  user-select: none;
}

.layer-toggle.sub-toggle {
  padding-left: 20px;
  font-size: 12.2px;
  color: var(--text-secondary);
}

.lt-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lt-left small {
  color: var(--text-muted);
  font-size: 11.5px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.swatch-ward { border: 2px solid #1a73e8; background: rgba(26, 115, 232, 0.14); }
.swatch-awc { border-radius: 50%; background: var(--g-red); border: 2px solid #ffffff; box-shadow: 0 0 0 1px var(--g-red); }
.swatch-cluster { border-radius: 50%; background: #f29900; opacity: 0.85; }
.swatch-road { height: 4px; border-radius: 2px; background: #f59e0b; }
.swatch-label { font-size: 9px; font-weight: 700; color: #1a73e8; background: var(--g-blue-soft); }

.layer-toggle input {
  display: none;
}

.switch {
  width: 34px;
  height: 19px;
  background: #dadce0;
  border-radius: 99px;
  position: relative;
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.layer-toggle input:checked + .switch {
  background: var(--g-blue);
}

.layer-toggle input:checked + .switch::after {
  transform: translateX(15px);
}

/* Choropleth Pills */
.choropleth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.c-pill {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.c-pill:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.c-pill.active {
  background: var(--g-blue-soft);
  border-color: var(--g-blue);
  color: var(--g-blue-dark);
  font-weight: 600;
}

.phase2-section {
  background: var(--bg-subtle);
}

.phase2-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p2-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.p2-btn:hover {
  border-color: var(--g-teal);
  color: var(--g-teal);
  background: #f0fdfa;
}

.p2-btn.active {
  background: var(--g-teal);
  border-color: var(--g-teal);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 121, 107, 0.28);
}

/* Proposed New Centre Pin */
.proposed-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.proposed-pin-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.16s ease;
}

.proposed-pin:hover .proposed-pin-badge {
  transform: scale(1.22);
}

/* Analysis Summary Badges & Mini Bars */
.analysis-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.analysis-rank-card {
  width: 100%;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.analysis-rank-card:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.arc-score {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.arc-critical { background: #fee2e2; color: #991b1b; }
.arc-high { background: #ffedd5; color: #9a3412; }
.arc-mod { background: #fef3c7; color: #92400e; }
.arc-good { background: #dcfce7; color: #166534; }

/* Sub-filter pills inside Analysis Drawer (Climate sub-layers & Proposed N selector) */
.sub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sf-pill {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.sf-pill:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.sf-pill.active {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #ffffff;
  font-weight: 600;
}

/* Climate Hazard Breakdown Bars */
.hazard-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hazard-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.hazard-track {
  height: 7px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.hazard-fill {
  height: 100%;
  border-radius: 99px;
}

/* Flood / Cyclone / Heat Wave Hotspot Pins */
.hotspot-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hotspot-pin-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.94);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.hotspot-pin-dot.pin-cyclone {
  background: rgba(234, 88, 12, 0.94);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.55);
  font-size: 13px;
}

.hotspot-pin-dot.pin-heat {
  background: rgba(220, 38, 38, 0.94);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.55);
  font-size: 12px;
}

/* Climate Risk Layers Popover Sub-Controls */
.climate-layers-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.climate-sub-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.climate-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.cm-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cm-pill:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.cm-pill.active {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #ffffff;
  font-weight: 600;
}

.climate-overlay-toggles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.climate-chk {
  padding: 4px 2px !important;
  font-size: 12px;
}

.swatch-flood { background: linear-gradient(135deg, #38bdf8, #1d4ed8); }
.swatch-cyclone { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.swatch-heat { background: linear-gradient(135deg, #f97316, #b91c1c); }

/* Climate Intensity Level Badges & 3-Hazard Breakdown Matrix */
.int-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.int-very-high { background: #fee2e2; color: #991b1b; }
.int-high      { background: #ffedd5; color: #9a3412; }
.int-medium    { background: #fef3c7; color: #92400e; }
.int-low       { background: #dcfce7; color: #166534; }

.climate-matrix {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-hazard-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 9px 11px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cm-hazard-card.active-hazard {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}

.cm-hazard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cm-hazard-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.cm-hazard-title:hover {
  color: var(--g-blue);
}

.cm-hazard-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cm-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.cm-overlay-toggle input {
  accent-color: var(--g-blue);
  cursor: pointer;
}

.cm-stacked-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: #f1f5f9;
  margin-bottom: 6px;
}

.cm-seg-vh  { background: #dc2626; }
.cm-seg-hi  { background: #f97316; }
.cm-seg-md  { background: #facc15; }
.cm-seg-lo  { background: #22c55e; }

.cm-counts-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.cm-count-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cm-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}

.ward-hazard-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.wh-chip {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.wh-chip strong {
  font-weight: 700;
}

/* K-Means Suggested Star Pin */
.kmeans-star-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kmeans-star-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.16s ease;
}

.kmeans-star-pin:hover .kmeans-star-badge {
  transform: scale(1.22);
}

/* ---------- Dedicated Ward-Wise Vulnerability Index Floating Box ---------- */
.vuln-widget {
  position: fixed;
  top: 66px;
  right: 12px;
  width: 296px;
  max-width: calc(100vw - 24px);
  z-index: 1045;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.vuln-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 55%, #fef2f2 100%);
  border-bottom: 1px solid var(--border-light);
}

.vuln-head-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.vuln-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #dc2626);
  flex-shrink: 0;
}

.vuln-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vuln-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 112px;
}

.vuln-select:focus {
  border-color: var(--g-blue);
}

.vuln-widget.collapsed .vuln-body {
  display: none;
}

.vuln-widget.collapsed #vulnCollapseBtn svg {
  transform: rotate(180deg);
}

.vuln-body {
  padding: 12px;
}

.vuln-empty {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.vuln-top-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vuln-score-block {
  display: flex;
  flex-direction: column;
}

.vuln-ward-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.vuln-score-num {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1.15;
}

.vuln-score-num small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.vuln-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.vuln-cat-low { background: #dcfce7; color: #166534; }
.vuln-cat-medium { background: #fef9c3; color: #854d0e; }
.vuln-cat-high { background: #ffedd5; color: #c2410c; }
.vuln-cat-very-high { background: #fee2e2; color: #991b1b; }

.vuln-meter {
  margin-top: 9px;
  height: 7px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.vuln-meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.25s ease;
}

.vuln-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.vuln-domains {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-light);
}

.vuln-dom-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vuln-dom-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.2px;
  color: var(--text-secondary);
}

.vuln-dom-head strong {
  color: var(--text-primary);
}

.vuln-dom-track {
  height: 5px;
  background: #eef0f2;
  border-radius: 99px;
  overflow: hidden;
}

.vuln-dom-fill {
  height: 100%;
  border-radius: 99px;
}

.vuln-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.vuln-mini-tile {
  background: #f8f9fa;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 8px;
}

.vuln-mini-tile span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
}

.vuln-mini-tile strong {
  font-size: 12px;
  color: var(--text-primary);
}

.vuln-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.vuln-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vuln-btn:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
  background: var(--g-blue-soft);
}

.vuln-btn.primary {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #ffffff;
}

.vuln-btn.primary:hover {
  background: var(--g-blue-dark);
}

@media (max-width: 960px) {
  .vuln-widget {
    top: 12px;
    width: 268px;
  }
}

@media (max-width: 600px) {
  .vuln-widget {
    top: auto;
    bottom: 98px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  body.drawer-open .vuln-widget {
    display: none;
  }
}

/* ---------- Bottom-Right Controls, Legend & Coordinates ---------- */
.bottom-right-stack {
  position: fixed;
  right: 12px;
  bottom: 24px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.map-legend,
.map-controls,
.coord-bar {
  pointer-events: auto;
}

.map-legend {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 10px 13px;
  min-width: 192px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.legend-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.legend-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-primary);
}

.lg-pin {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--g-red);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--g-red-dark);
}

.lg-ward {
  width: 14px;
  height: 10px;
  border: 2px solid var(--g-blue);
  background: rgba(26, 115, 232, 0.12);
  border-radius: 2px;
}

.lg-road-major {
  width: 14px;
  height: 3.5px;
  background: #f59e0b;
  border-radius: 2px;
}

.lg-road-minor {
  width: 14px;
  height: 2px;
  background: #64748b;
  border-radius: 2px;
}

.lg-ramp {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-controls {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.map-ctrl-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.map-ctrl-btn:hover {
  background: var(--bg-hover);
  color: var(--g-blue);
}

.ctrl-divider {
  height: 1px;
  background: var(--border-light);
}

.coord-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.crs-pill {
  background: var(--g-blue-soft);
  color: var(--g-blue-dark);
  font-weight: 600;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
}

/* ---------- Custom Leaflet Pins, Ward Labels & Clusters ---------- */
.awc-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.awc-pin-svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.awc-pin:hover .awc-pin-svg,
.awc-pin.selected .awc-pin-svg {
  transform: scale(1.28) translateY(-3px);
}

.ward-label-icon {
  background: transparent;
  border: none;
  pointer-events: none !important;
}

.ward-label-pill {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #1e3a8a;
  background: rgba(255, 255, 255, 0.78);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(26, 115, 232, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

/* Refined MarkerCluster bubbles */
.marker-cluster-custom {
  background: rgba(234, 67, 53, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-cluster-custom div {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--g-red);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(197, 34, 31, 0.42);
}

.marker-cluster-custom.cluster-md div {
  width: 34px;
  height: 34px;
  background: #d93025;
}

.marker-cluster-custom.cluster-lg div {
  width: 38px;
  height: 38px;
  background: #b31412;
}

/* Subtle hover tooltip */
.leaflet-tooltip.gmap-tooltip {
  background: rgba(32, 33, 36, 0.92);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.leaflet-tooltip.gmap-tooltip::before {
  border-top-color: rgba(32, 33, 36, 0.92);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  background: #202124;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 960px) {
  .stats-bar {
    display: none; /* Accessible via top-left Menu button on smaller screens */
  }
}

@media (max-width: 600px) {
  :root {
    --drawer-width: 100vw;
  }
  .top-left-bar {
    width: calc(100vw - 24px);
  }
  body.drawer-open .layers-widget {
    left: 16px;
    opacity: 0;
    pointer-events: none;
  }
  .map-legend {
    display: none;
  }
}
