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

:root {
  --bg:         #f0f2f5;
  --card:       #ffffff;
  --border:     #e2e8f0;
  --border-2:   #cbd5e1;
  --accent:     #2563eb;
  --accent-dim: rgba(37,99,235,.07);
  --accent-mid: rgba(37,99,235,.14);
  --green:      #059669;
  --green-dim:  rgba(5,150,105,.08);
  --orange:     #b45309;
  --orange-dim: rgba(180,83,9,.08);
  --red:        #dc2626;
  --red-dim:    rgba(220,38,38,.08);
  --text:       #0f172a;
  --text-sub:   #334155;
  --text-muted: #64748b;
  --sh-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --sh-md: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.05);
  --sh-lg: 0 10px 28px rgba(15,23,42,.1), 0 4px 8px rgba(15,23,42,.06);
  --radius: 10px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; font-size: 14px; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ── NAVBAR ──────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 2000;
  height: 72px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  justify-content: space-between; box-shadow: var(--sh-sm);
}
.navbar-left  { display: flex; align-items: center; gap: 16px; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.navbar-title-block { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 1px solid var(--border); }
.navbar-title { font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1.2; }
.navbar-subtitle { font-size: .69rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }

.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.03em; }
.logo-img { height: 52px; width: auto; display: block; object-fit: contain; }
.logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, #1d4ed8, #0284c7); border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(37,99,235,.28); }
.logo-icon svg { width: 16px; height: 16px; fill: #fff; }
.logo em { color: var(--accent); font-style: normal; }

.nav-links { display: flex; gap: 2px; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 6px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text-sub); background: var(--bg); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }

.location-badge { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: .72rem; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
.location-badge svg { width: 11px; height: 11px; fill: var(--text-muted); flex-shrink: 0; }
.nav-scan-badge { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 500; color: var(--text-muted); }
.scan-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(5,150,105,.2); flex-shrink: 0; animation: scan-pulse 2.4s ease-in-out infinite; }
@keyframes scan-pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(5,150,105,.2); } 50% { box-shadow: 0 0 0 4px rgba(5,150,105,.08); } }

.backend-pill { font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-sub); white-space: nowrap; }
.backend-pill[data-state="online"]   { color: #047857; border-color: rgba(5,150,105,.35); background: rgba(5,150,105,.08); }
.backend-pill[data-state="offline"]  { color: #991b1b; border-color: rgba(220,38,38,.35); background: rgba(220,38,38,.08); }
.backend-pill[data-state="checking"],
.backend-pill[data-state="working"]  { color: #1d4ed8; border-color: rgba(37,99,235,.35); background: rgba(37,99,235,.08); }
.backend-pill[data-state="error"]    { color: #b45309; border-color: rgba(180,83,9,.35); background: rgba(180,83,9,.08); }

.live-analysis { margin-top: 12px; }
.live-analysis-result { background: rgba(37,99,235,.04); border: 1px solid rgba(37,99,235,.18); border-radius: 10px; padding: 12px; }
.live-analysis-warn   { background: rgba(220,38,38,.05); border: 1px solid rgba(220,38,38,.20); border-radius: 10px; padding: 12px; }
.live-loading { font-size: .82rem; color: var(--text-muted); font-style: italic; }
.live-recommendation { margin-top: 10px; font-size: .82rem; line-height: 1.45; color: var(--text-sub); padding: 8px 10px; background: rgba(0,0,0,.025); border-left: 3px solid #2563eb; border-radius: 4px; }
.live-note { margin-top: 8px; font-size: .72rem; color: var(--text-muted); font-style: italic; }

/* ── MAIN ────────────────────────────────────────── */
.main { padding: 20px 24px 0; max-width: 1700px; margin: 0 auto; }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1.2; margin-bottom: 3px; }
.page-subtitle { font-size: .76rem; color: var(--text-muted); font-weight: 500; }

/* spring filter search */
.search-wrap { position: relative; display: flex; align-items: center; width: 340px; flex-shrink: 0; }
.search-icon { position: absolute; left: 13px; width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; transition: color .15s; }
.search-input { width: 100%; height: 40px; padding: 0 38px 0 38px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; font-size: .82rem; font-weight: 500; outline: none; transition: border-color .18s, box-shadow .18s; box-shadow: var(--sh-sm); }
.search-input::placeholder { color: var(--text-muted); font-weight: 400; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1), var(--sh-sm); }
.search-wrap:focus-within .search-icon { color: var(--accent); }
.search-clear { position: absolute; right: 10px; width: 22px; height: 22px; background: var(--bg); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.search-clear:hover { background: var(--border); }
.search-clear svg { width: 11px; height: 11px; color: var(--text-muted); }
.search-count { font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(37,99,235,.18); padding: 3px 9px; border-radius: 20px; }

/* ── SPLIT LAYOUT ────────────────────────────────── */
.split-layout {
  display: grid;
  grid-template-columns: 62fr 38fr;
  gap: 12px; margin-bottom: 12px;
  height: 600px;
  transition: grid-template-columns .45s cubic-bezier(.4,0,.2,1),
              height .35s cubic-bezier(.4,0,.2,1);
}
.split-layout.map-expanded {
  grid-template-columns: 1fr;
  height: 82vh;
  min-height: 520px;
}
.split-layout.map-expanded .detail-panel { display: none; }

/* ── MAP FULLSCREEN MODE ─────────────────────────── */
body.map-fullscreen { overflow: hidden; }
body.map-fullscreen .navbar,
body.map-fullscreen .footer { display: none !important; }
body.map-fullscreen .main { padding: 0; margin: 0; max-width: none; }
body.map-fullscreen .split-layout {
  display: block;
  margin: 0;
  height: auto;
}
body.map-fullscreen .map-card {
  position: fixed;
  inset: 0;
  height: 100vh !important;
  width: 100vw !important;
  border-radius: 0;
  border: none;
  z-index: 1500;
  box-shadow: none;
}
body.map-fullscreen .map-header {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  z-index: 1600;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
  padding: 9px 14px;
}
body.map-fullscreen .map-expand-btn-fs {
  width: auto;
  height: 32px;
  padding: 0 12px 0 10px;
  gap: 7px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
body.map-fullscreen .map-expand-btn-fs:hover {
  background: var(--accent-hover, #1d4ed8);
  border-color: var(--accent-hover, #1d4ed8);
}
body.map-fullscreen .map-expand-btn-fs svg { color: #fff; width: 14px; height: 14px; }
.map-expand-label {
  font: 700 .73rem 'Outfit', sans-serif;
  letter-spacing: .01em;
  white-space: nowrap;
}
body.map-fullscreen .map-body { height: 100vh; }

/* Push Leaflet zoom + attribution controls clear of the floating header bar */
body.map-fullscreen .leaflet-top.leaflet-left { top: 78px; }

/* Keep search bar visible and below the floating header in fullscreen */
body.map-fullscreen .map-overlay-search {
  top: 76px;
  z-index: 1700;
}
body.map-fullscreen:not(.landing) .map-overlay-search { width: 320px; }

/* Floating info dock — bottom right (detail panel = main card) */
body.map-fullscreen .detail-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 48vh;
  z-index: 1700;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  padding: 14px;
  font-size: .82rem;
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .25s;
}
body.map-fullscreen .below-map-grid {
  position: fixed;
  right: 16px;
  bottom: calc(16px + 48vh + 10px);
  width: 340px;
  max-width: calc(100vw - 32px);
  z-index: 1700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  pointer-events: none;
}
body.map-fullscreen .below-map-grid .bm-card {
  pointer-events: auto;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  padding: 10px 12px;
  font-size: .76rem;
  max-height: 22vh;
  overflow-y: auto;
}
body.map-fullscreen .below-map-grid .bm-card:nth-child(2) { display: none; } /* hide overview, keep sources list */
body.map-fullscreen .bm-sources-list { max-height: 16vh; }

/* Collapsed state */
body.fs-info-hidden .detail-panel,
body.fs-info-hidden .below-map-grid { transform: translateY(125%); opacity: 0; pointer-events: none; }

/* Chevron toggle to collapse the info dock — sits just above the dock */
.fs-info-dock-toggle {
  position: fixed;
  right: 22px; bottom: calc(16px + 48vh + 22vh + 22px);
  z-index: 1900;
  width: 30px; height: 30px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  transition: transform .25s ease, background .15s, bottom .35s;
}
.fs-info-dock-toggle:hover { background: var(--border); }
.fs-info-dock-toggle svg { width: 15px; height: 15px; transition: transform .25s ease; }
body.fs-info-hidden .fs-info-dock-toggle { bottom: 18px; }
body.fs-info-hidden .fs-info-dock-toggle svg { transform: rotate(180deg); }

/* ── MAP CARD ────────────────────────────────────── */
.map-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-sm); }
.map-header { padding: 11px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.map-header-title { font-size: .8rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.map-header-title svg { width: 14px; height: 14px; fill: var(--accent); }
.map-badges { display: flex; gap: 8px; align-items: center; }
.badge-live { font-size: .67rem; font-weight: 700; background: var(--green-dim); border: 1px solid rgba(5,150,105,.2); color: var(--green); padding: 2px 8px; border-radius: 5px; }
.badge-date { font-size: .7rem; color: var(--text-muted); font-weight: 500; }
.map-expand-btn { width: 28px; height: 28px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; flex-shrink: 0; }
.map-expand-btn:hover { background: var(--border); border-color: var(--border-2); }
.map-expand-btn svg { width: 13px; height: 13px; color: var(--text-muted); }

.map-body { position: relative; flex: 1; }
#map { width: 100%; height: 100%; }

/* ── LOCATION SEARCH (map overlay) — see full def below ── */

/* ── DETAIL PANEL ────────────────────────────────── */
.detail-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; padding: 18px; box-shadow: var(--sh-sm); min-width: 0; transition: opacity .35s ease .15s; }
.dp-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dp-title { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.dp-sub   { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.dp-section { margin-bottom: 14px; }
.dp-section-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 700; margin-bottom: 7px; }

@keyframes shimmer { 0% { background-position: -700px 0; } 100% { background-position: 700px 0; } }
.dp-placeholder { padding: 4px; }
.dp-ph-line { border-radius: 5px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 1400px 100%; animation: shimmer 1.8s infinite linear; display: block; }

/* badges */
.sbadge { padding: 3px 9px; border-radius: 20px; font-size: .69rem; font-weight: 700; white-space: nowrap; }
.sbadge-verified      { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(37,99,235,.2); }
.sbadge-high_priority { background: var(--red-dim); color: var(--red); border: 1px solid rgba(220,38,38,.2); }
.sbadge-pending       { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(180,83,9,.2); }
.sbadge-linked        { background: rgba(100,116,139,.08); color: var(--text-sub); border: 1px solid rgba(100,116,139,.2); font-family: 'Courier New', monospace; font-size: .68rem; }

/* gauge */
.gauge-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; }
.gauge-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.gauge-val { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.gauge-cap { font-size: .68rem; color: var(--text-muted); }
.gauge-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #0284c7); transition: width .6s cubic-bezier(.4,0,.2,1); }
.gauge-hint { font-size: .67rem; color: var(--text-muted); margin-top: 5px; }

/* confidence */
.conf-row { display: flex; align-items: center; gap: 10px; }
.conf-num { font-size: .9rem; font-weight: 800; min-width: 38px; }
.conf-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.conf-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* satellite grid */
.sat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sat-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 9px 11px; }
.sat-cell-full { grid-column: 1 / -1; }
.sat-lbl { font-size: .6rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.sat-val  { font-size: .86rem; font-weight: 700; color: var(--text); }
.sat-pass { font-size: .74rem; font-family: 'Courier New', monospace; font-weight: 600; color: var(--text-sub); }

/* geology */
.geology-badge { display: inline-flex; align-items: center; background: rgba(2,132,199,.06); border: 1px solid rgba(2,132,199,.2); color: #0284c7; font-size: .71rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; margin-top: 7px; }

/* coords */
.coord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.coord-item { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; }
.coord-lbl { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; }
.coord-val { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-sub); margin-top: 2px; }

/* cost table */
.cost-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; }
.cost-tbl tr { border-bottom: 1px solid var(--border); }
.cost-tbl tr:last-child { border-bottom: none; }
.cost-tbl td { padding: 6px 2px; color: var(--text-sub); }
.cost-tbl td:last-child { text-align: right; color: var(--text); font-weight: 600; }
.cost-tbl .total-row td { font-weight: 800; padding-top: 9px; }
.cost-tbl .total-row td:last-child { color: var(--accent); font-size: .9rem; }

/* eu badge */
.eu-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--green-dim); border: 1px solid rgba(5,150,105,.2); color: var(--green); font-size: .76rem; font-weight: 700; padding: 6px 11px; border-radius: 7px; }

/* buttons */
.btn-row { display: flex; gap: 8px; }
.btn { flex: 1; padding: 9px 13px; border-radius: 8px; font-size: .78rem; font-weight: 700; cursor: pointer; border: none; font-family: 'Plus Jakarta Sans', sans-serif; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.btn-secondary { background: transparent; color: var(--text-sub); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--text); border-color: var(--border-2); }
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── ANALYSIS GRID ───────────────────────────────── */
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.analysis-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--sh-sm); }
.ac-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ac-title { font-size: .83rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.ac-title svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.ac-sub { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }

/* bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 130px; font-size: .74rem; font-weight: 600; color: var(--text-sub); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-region { font-weight: 400; color: var(--text-muted); }
.bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .9s cubic-bezier(.4,0,.2,1); }
.bar-val { width: 48px; font-size: .74rem; font-weight: 700; color: var(--text); text-align: left; flex-shrink: 0; }

/* village coverage list */
.village-list { display: flex; flex-direction: column; gap: 0; }
.vc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.vc-row:last-child { border-bottom: none; }
.vc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.vc-info { flex: 1; min-width: 0; }
.vc-name { font-size: .78rem; font-weight: 600; color: var(--text); }
.vc-county { font-weight: 400; color: var(--text-muted); }
.vc-status { font-size: .7rem; font-weight: 600; margin-top: 1px; }
.vc-meta { text-align: right; flex-shrink: 0; }
.vc-pop { font-size: .72rem; font-weight: 600; color: var(--text-sub); }
.vc-need { font-size: .68rem; color: var(--text-muted); }
.vc-link { flex-shrink: 0; }

/* ── STAT CARDS ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; display: flex; align-items: flex-start; gap: 13px; box-shadow: var(--sh-sm); transition: box-shadow .2s, border-color .2s; }
.stat-card:hover { box-shadow: var(--sh-md); border-color: var(--border-2); }
.stat-icon { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 3px; }
.stat-value { font-size: 1.45rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.03em; margin-bottom: 7px; }
.stat-value small { font-size: .8rem; font-weight: 600; letter-spacing: 0; color: var(--text-sub); }
.stat-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.stat-tag.green  { background: var(--green-dim); border: 1px solid rgba(5,150,105,.18); color: var(--green); }
.stat-tag.blue   { background: var(--accent-dim); border: 1px solid rgba(37,99,235,.18); color: var(--accent); }
.stat-tag.orange { background: var(--orange-dim); border: 1px solid rgba(180,83,9,.18); color: var(--orange); }
.stat-tag.red    { background: var(--red-dim); border: 1px solid rgba(220,38,38,.18); color: var(--red); }

/* ── TABLE ───────────────────────────────────────── */
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; box-shadow: var(--sh-sm); }
.table-hdr { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-hdr-left { display: flex; align-items: center; gap: 10px; }
.table-hdr-right { display: flex; align-items: center; }
.table-hdr h3 { font-size: .85rem; font-weight: 800; color: var(--text); }
.table-count { font-size: .7rem; color: var(--text-muted); font-weight: 600; background: var(--bg); border: 1px solid var(--border); padding: 2px 9px; border-radius: 20px; }
.table-wrapper { overflow-x: auto; }

table.dtbl { width: 100%; border-collapse: collapse; font-size: .79rem; }
.dtbl thead th { padding: 8px 13px; text-align: left; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.dtbl tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; cursor: pointer; }
.dtbl tbody tr:last-child { border-bottom: none; }
.dtbl tbody tr:hover { background: var(--bg); }
.dtbl tbody tr.active-row { background: var(--accent-dim) !important; box-shadow: inset 3px 0 0 var(--accent); }
.dtbl td { padding: 10px 13px; color: var(--text-sub); white-space: nowrap; }
.dtbl td.id-col { font-family: 'Courier New', monospace; font-size: .7rem; color: var(--text-muted); }
.dtbl td.name-col { color: var(--text); font-weight: 600; }
.dtbl td.name-col span { color: var(--text-muted); font-weight: 400; }
.btn-view { background: var(--accent-dim); border: 1px solid rgba(37,99,235,.2); color: var(--accent); padding: 4px 11px; border-radius: 6px; font-size: .7rem; font-weight: 700; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; transition: all .15s; white-space: nowrap; }
.btn-view:hover { background: var(--accent-mid); }
.eu-ok { color: var(--green); font-size: .7rem; font-weight: 700; }
.no-results { text-align: center; padding: 36px 20px !important; color: var(--text-muted); font-weight: 500; white-space: normal !important; }
.no-results svg { width: 16px; height: 16px; display: inline; vertical-align: middle; margin-right: 6px; opacity: .5; }

/* ── FOOTER ──────────────────────────────────────── */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1.4fr;
  gap: 0;
  padding: 36px 36px 28px;
  max-width: 1700px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.footer-col { padding: 0 32px; }
.footer-col:first-child { padding-left: 0; border-right: 1px solid var(--border); }
.footer-col:nth-child(2) { border-right: 1px solid var(--border); }
.footer-col:last-child { padding-right: 0; }

/* brand col */
.footer-col-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  letter-spacing: -.03em; text-decoration: none;
}
.footer-logo em { color: var(--accent); font-style: normal; }
.footer-drop { width: 16px; height: 16px; fill: #0ea5e9; flex-shrink: 0; }
.footer-logo-img { height: 40px; width: auto; display: block; }
.footer-tagline { font-size: .76rem; color: var(--text-muted); line-height: 1.6; max-width: 240px; }
.footer-built-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .68rem; font-weight: 600; color: var(--text-sub);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; width: fit-content;
}
.footer-built-badge svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--accent); }

/* col headers */
.footer-col-title {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--text-muted); margin-bottom: 14px;
}

/* list */
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-list li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: .76rem; color: var(--text-sub); font-weight: 600; line-height: 1.3;
}
.footer-list li svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.footer-list li span { display: block; font-size: .66rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }

/* link cards */
.footer-link-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg);
  text-decoration: none; margin-bottom: 7px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.footer-link-card:last-child { margin-bottom: 0; }
.footer-link-card:hover { border-color: var(--border-2); background: var(--card); box-shadow: var(--sh-sm); }
.footer-link-card--primary { border-color: rgba(37,99,235,.3); background: var(--accent-dim); }
.footer-link-card--primary:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.flc-icon {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.footer-link-card--primary .flc-icon { background: var(--accent); border-color: transparent; }
.footer-link-card--primary .flc-icon svg { color: #fff; }
.flc-icon svg { width: 13px; height: 13px; color: var(--text-sub); }
.flc-body { min-width: 0; }
.flc-title { font-size: .76rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.flc-sub   { font-size: .64rem; color: var(--text-muted); margin-top: 1px; }

/* bottom bar */
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 14px 36px;
  max-width: 1700px; margin: 0 auto;
}
.footer-copy { font-size: .69rem; color: var(--text-muted); }
.footer-copy em { font-style: normal; color: var(--text-sub); font-weight: 600; }
.footer-bottom-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.footer-tech-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .65rem; font-weight: 600; color: var(--text-sub);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
}
.footer-tech-pill svg { width: 10px; height: 10px; flex-shrink: 0; }
.footer-tech-pill--eu { color: #1d4ed8; background: rgba(37,99,235,.06); border-color: rgba(37,99,235,.2); }

@media (max-width: 1100px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-col { border-right: none !important; padding: 0; }
  .footer-col:nth-child(1),
  .footer-col:nth-child(2) { border-bottom: 1px solid var(--border); padding-bottom: 24px; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; padding: 24px 20px 20px; }
  .footer-col:nth-child(1),
  .footer-col:nth-child(2) { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .footer-bottom { padding: 12px 20px; flex-direction: column; align-items: flex-start; }
}

/* ── LEAFLET ─────────────────────────────────────── */
.leaflet-popup-content-wrapper { background: #fff !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; box-shadow: var(--sh-lg) !important; }
.leaflet-popup-tip { background: #fff !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; top: 8px !important; right: 8px !important; }
.leaflet-popup-close-button:hover { color: var(--text) !important; }
.leaflet-popup-content { margin: 13px 15px !important; font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: .78rem !important; line-height: 1.6 !important; min-width: 215px !important; }
.leaflet-control-zoom a { background: #fff !important; color: var(--text-sub) !important; border-color: var(--border) !important; box-shadow: var(--sh-sm) !important; font-weight: 700 !important; }
.leaflet-control-zoom a:hover { background: var(--bg) !important; color: var(--text) !important; }
.leaflet-control-attribution { background: rgba(255,255,255,.88) !important; color: var(--text-muted) !important; font-size: .58rem !important; backdrop-filter: blur(4px); }
.leaflet-control-attribution a { color: var(--text-muted) !important; }

.popup-title { font-weight: 800; font-size: .85rem; color: var(--text); margin-bottom: 8px; }
.popup-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.popup-k { color: var(--text-muted); }
.popup-v { color: var(--text-sub); font-weight: 600; text-align: right; }
.popup-badge { display: inline-block; margin-top: 8px; }

.line-tooltip { background: rgba(15,23,42,.82) !important; border: none !important; border-radius: 6px !important; color: #f8fafc !important; font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: .72rem !important; font-weight: 600 !important; padding: 5px 10px !important; box-shadow: var(--sh-md) !important; white-space: nowrap; }
.line-tooltip::before { display: none !important; }

.map-legend { background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: .7rem; color: var(--text-sub); box-shadow: var(--sh-sm); backdrop-filter: blur(6px); }
.legend-title { font-size: .59rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-muted); font-weight: 700; margin-bottom: 7px; }
.legend-section { font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin-bottom: 5px; opacity: .7; }
.legend-item { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-weight: 500; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-source { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.legend-zone { width: 16px; height: 11px; border: 1.5px dashed #dc2626; background: rgba(220,38,38,.12); border-radius: 2px; flex-shrink: 0; }
.legend-village-dot { width: 14px; height: 14px; border-radius: 50%; background: #f59e0b; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(245,158,11,.4); flex-shrink: 0; }

@keyframes pulse-ring { 0% { transform: translate(-50%,-50%) scale(1); opacity: .55; } 100% { transform: translate(-50%,-50%) scale(2.5); opacity: 0; } }

/* ── PDF DOWNLOAD BUTTON ─────────────────────────── */
.dp-pdf-wrap {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--border);
}
.dp-pdf-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 12px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 10px;
  font-family: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer; letter-spacing: -.01em;
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
  transition: opacity .15s, box-shadow .15s, transform .1s;
}
.dp-pdf-btn:hover { opacity: .93; box-shadow: 0 6px 20px rgba(37,99,235,.4); transform: translateY(-1px); }
.dp-pdf-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.dp-pdf-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.dp-pdf-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.dp-pdf-badge {
  margin-left: auto; font-size: .68rem; font-weight: 600;
  background: rgba(255,255,255,.22); border-radius: 20px;
  padding: 2px 9px; letter-spacing: .02em; white-space: nowrap;
}
.dp-pdf-hint {
  margin-top: 7px; font-size: .72rem; color: var(--text-muted);
  text-align: center; line-height: 1.4;
}
.dark .dp-pdf-btn { box-shadow: 0 4px 14px rgba(37,99,235,.2); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1200px) {
  .split-layout { grid-template-columns: 1fr 1fr; }
  .analysis-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .split-layout { grid-template-columns: 1fr; height: auto; }
  .map-card { height: 400px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-scan-badge { display: none; }
  .navbar-subtitle { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .search-wrap { width: 100%; }
  .dtbl thead th:nth-child(5), .dtbl td:nth-child(5),
  .dtbl thead th:nth-child(7), .dtbl td:nth-child(7) { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main { padding: 12px; }
}

/* ── MISSING DETAIL PANEL CLASSES ────────────────── */
.dp-header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.dp-title { font-size:1rem; font-weight:800; color:var(--text); margin-bottom:3px; letter-spacing:-.02em; }
.dp-sub { font-size:.73rem; color:var(--text-muted); font-weight:500; }
.dp-section { margin-bottom:16px; }
.dp-section-label { font-size:.62rem; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted); font-weight:700; margin-bottom:7px; }
.dp-placeholder { padding:20px; }
.dp-ph-line { background:var(--border); border-radius:5px; animation:ph-pulse 1.5s ease-in-out infinite; }
@keyframes ph-pulse { 0%,100%{opacity:.6} 50%{opacity:1} }

/* ── STATUS BADGES ───────────────────────────────── */
.sbadge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:.7rem; font-weight:700; white-space:nowrap; }
.sbadge-verified     { background:rgba(37,99,235,.08);  color:#2563eb; border:1px solid rgba(37,99,235,.25); }
.sbadge-high_priority{ background:rgba(220,38,38,.08);  color:#dc2626; border:1px solid rgba(220,38,38,.25); }
.sbadge-pending      { background:rgba(180,83,9,.08);   color:#b45309; border:1px solid rgba(180,83,9,.25); }
.sbadge-linked       { background:var(--accent-dim);    color:var(--accent); border:1px solid rgba(37,99,235,.2); font-size:.65rem; }

/* ── GAUGE ───────────────────────────────────────── */
.gauge-box { background:var(--bg); border:1px solid var(--border); border-radius:9px; padding:11px 13px; }
.gauge-top { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:7px; }
.gauge-val { font-size:1.15rem; font-weight:800; color:var(--accent); letter-spacing:-.02em; }
.gauge-cap { font-size:.7rem; color:var(--text-muted); }
.gauge-track { height:6px; background:var(--border); border-radius:4px; overflow:hidden; }
.gauge-fill { height:100%; border-radius:4px; background:linear-gradient(90deg,var(--accent),#059669); transition:width .6s cubic-bezier(.4,0,.2,1); }
.gauge-hint { font-size:.68rem; color:var(--text-muted); margin-top:5px; }

/* ── CONFIDENCE ──────────────────────────────────── */
.conf-row { display:flex; align-items:center; gap:10px; }
.conf-num { font-size:.95rem; font-weight:800; min-width:38px; }
.conf-track { flex:1; height:5px; background:var(--border); border-radius:3px; overflow:hidden; }
.conf-fill { height:100%; border-radius:3px; transition:width .5s ease; }

/* ── SATELLITE GRID ──────────────────────────────── */
.sat-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sat-cell { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:8px 10px; }
.sat-cell-full { grid-column:1/-1; }
.sat-lbl { font-size:.63rem; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); font-weight:700; margin-bottom:3px; }
.sat-val { font-size:.9rem; font-weight:700; color:var(--text); }
.sat-pass { font-size:.75rem; font-weight:500; color:var(--text-sub); font-variant-numeric:tabular-nums; }

/* ── COORD GRID ──────────────────────────────────── */
.coord-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:14px; }
.coord-item { background:var(--bg); border:1px solid var(--border); border-radius:7px; padding:7px 10px; }
.coord-lbl { font-size:.62rem; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); font-weight:700; }
.coord-val { font-size:.8rem; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text); }

/* ── COST TABLE ──────────────────────────────────── */
.cost-tbl { width:100%; border-collapse:collapse; font-size:.8rem; }
.cost-tbl tr { border-bottom:1px solid var(--border); }
.cost-tbl tr:last-child { border-bottom:none; }
.cost-tbl td { padding:6px 2px; color:var(--text-sub); }
.cost-tbl td:last-child { text-align:right; color:var(--text); font-weight:600; }
.cost-tbl .total-row td { font-weight:800; color:var(--text); padding-top:10px; }
.cost-tbl .total-row td:last-child { color:var(--accent); font-size:.9rem; }

/* ── EU BADGE ────────────────────────────────────── */
.eu-badge { display:inline-flex; align-items:center; gap:7px; background:rgba(5,150,105,.07); border:1px solid rgba(5,150,105,.2); color:#059669; font-size:.78rem; font-weight:700; padding:7px 12px; border-radius:8px; }

/* ── GEOLOGY BADGE ───────────────────────────────── */
.geology-badge { display:inline-block; margin-top:8px; background:var(--accent-dim); border:1px solid rgba(37,99,235,.18); color:var(--accent); font-size:.72rem; font-weight:700; padding:4px 10px; border-radius:6px; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.btn { flex:1; min-width:100px; padding:9px 12px; border-radius:8px; font-size:.78rem; font-weight:700; cursor:pointer; border:none; font-family:inherit; transition:all .18s; display:flex; align-items:center; justify-content:center; gap:6px; }
.btn svg { width:13px; height:13px; flex-shrink:0; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:#1d4ed8; transform:translateY(-1px); box-shadow:0 4px 14px rgba(37,99,235,.35); }
.btn-secondary { background:var(--card); color:var(--text-sub); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--bg); color:var(--text); border-color:var(--border-2); }

/* ── ANALYSIS GRID ───────────────────────────────── */
.analysis-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.analysis-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--sh-sm); }
.ac-header { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:13px; gap:10px; }
.ac-title { display:flex; align-items:center; gap:7px; font-size:.83rem; font-weight:800; color:var(--text); }
.ac-title svg { width:15px; height:15px; flex-shrink:0; color:var(--accent); }
.ac-sub { font-size:.68rem; color:var(--text-muted); font-weight:500; white-space:nowrap; }

/* ── BAR CHART ───────────────────────────────────── */
.bar-chart { display:flex; flex-direction:column; gap:7px; }
.bar-row { display:flex; align-items:center; gap:9px; }
.bar-label { font-size:.72rem; font-weight:600; color:var(--text-sub); min-width:110px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-region { color:var(--text-muted); font-weight:400; }
.bar-track { flex:1; height:7px; background:var(--border); border-radius:4px; overflow:hidden; }
.bar-fill { height:100%; border-radius:4px; transition:width .5s ease; }
.bar-val { font-size:.72rem; font-weight:700; color:var(--text-sub); min-width:30px; text-align:right; }

/* ── VILLAGE LIST ────────────────────────────────── */
.village-list { display:flex; flex-direction:column; gap:8px; }
.vc-row { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--border); }
.vc-row:last-child { border-bottom:none; }
.vc-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.vc-info { flex:1; min-width:0; }
.vc-name { font-size:.78rem; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vc-county { font-size:.7rem; color:var(--text-muted); font-weight:400; margin-left:4px; }
.vc-status { font-size:.7rem; font-weight:600; margin-top:1px; }
.vc-meta { text-align:right; flex-shrink:0; }
.vc-pop { font-size:.72rem; font-weight:600; color:var(--text-sub); }
.vc-need { font-size:.68rem; color:var(--text-muted); }
.vc-link { flex-shrink:0; }

/* ── LIVE ANALYSIS ───────────────────────────────── */
.live-analysis { margin-top:12px; }
.live-analysis-result { background:rgba(37,99,235,.04); border:1px solid rgba(37,99,235,.15); border-radius:9px; padding:12px; }
.live-analysis-warn { background:rgba(220,38,38,.04); border:1px solid rgba(220,38,38,.15); border-radius:9px; padding:12px; }
.live-loading { font-size:.82rem; color:var(--text-muted); font-style:italic; }
.live-recommendation { margin-top:10px; font-size:.8rem; line-height:1.55; color:var(--text-sub); padding:9px 11px; background:rgba(0,0,0,.025); border-left:3px solid var(--accent); border-radius:4px; }
.live-note { margin-top:7px; font-size:.7rem; color:var(--text-muted); font-style:italic; }

/* ── MAP OVERLAY SEARCH ──────────────────────────── */
.map-overlay-search {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 1500; width: 300px;
  transition: top .42s cubic-bezier(.4,0,.2,1),
              width .42s cubic-bezier(.4,0,.2,1),
              transform .42s cubic-bezier(.4,0,.2,1);
}
.mos-input-wrap { position: relative; }
.mos-input { width:100%; height:38px; padding:0 14px 0 36px; border:1.5px solid rgba(255,255,255,.9); border-radius:9px; background:rgba(255,255,255,.96); color:var(--text); font-family:inherit; font-size:.8rem; font-weight:500; outline:none; box-shadow:var(--sh-md); transition:border-color .15s,box-shadow .15s,height .3s; }
.mos-input::placeholder { color:var(--text-muted); }
.mos-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.15),var(--sh-md); }
.mos-icon { position:absolute; left:11px; top:50%; transform:translateY(-50%); width:14px; height:14px; color:var(--text-muted); pointer-events:none; }
.mos-results { margin-top:4px; background:#fff; border:1px solid var(--border); border-radius:9px; overflow:hidden; box-shadow:var(--sh-lg); max-height:220px; overflow-y:auto; }
.mos-item { display:flex; align-items:center; gap:9px; padding:9px 12px; cursor:pointer; transition:background .13s; border-bottom:1px solid var(--border); }
.mos-item:last-child { border-bottom:none; }
.mos-item:hover { background:var(--bg); }
.mos-pin { width:13px; height:13px; fill:var(--accent); flex-shrink:0; }
.mos-name { font-size:.8rem; font-weight:600; color:var(--text); }
.mos-region { font-size:.7rem; color:var(--text-muted); margin-top:1px; }
.mos-no-result { padding:12px 14px; font-size:.8rem; color:var(--text-muted); text-align:center; }
.mos-section-label { padding:7px 12px 4px; font-size:.65rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-muted); border-bottom:1px solid var(--border); }
.mos-pin-outline { fill:none; color:var(--text-muted); }
.mos-hero { text-align: center; margin-bottom: 20px; }
.mos-hero-logo { height: 100px; width: auto; margin-bottom: 16px; filter: drop-shadow(0 4px 20px rgba(0,0,0,.35)); }
.mos-hero-title { font-size: 2rem; font-weight: 800; margin-bottom: 10px; letter-spacing: -.04em; line-height: 1.15; text-shadow: 0 2px 16px rgba(0,0,0,.55); }
.mos-hero-sub { font-size: .82rem; color: rgba(255,255,255,.88); text-shadow: 0 1px 6px rgba(0,0,0,.45); line-height: 1.6; margin-bottom: 14px; }
.mos-hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mos-pill { font-size: .7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff; letter-spacing: .02em; backdrop-filter: blur(4px); }
body:not(.landing) .mos-hero { display: none; }

/* ── DARK MODE ───────────────────────────────────── */
.dark-toggle { width:32px; height:32px; background:var(--bg); border:1px solid var(--border); border-radius:7px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.dark-toggle:hover { background:var(--border); }
.dark-toggle svg { width:15px; height:15px; color:var(--text-sub); }
html:not(.dark) .icon-moon { display:none; }
html.dark .icon-sun { display:none; }
html.dark { --bg:#0f172a; --card:#1e293b; --border:#334155; --border-2:#475569; --text:#f1f5f9; --text-sub:#e2e8f0; --text-muted:#94a3b8; --sh-sm:0 1px 3px rgba(0,0,0,.3); --sh-md:0 4px 12px rgba(0,0,0,.4); --sh-lg:0 10px 28px rgba(0,0,0,.5); }
html.dark .mos-input { background: rgba(30,41,59,.97); border-color: rgba(255,255,255,.15); color: var(--text); }
html.dark .mos-results { background: var(--card); }
html.dark .mos-item:hover { background: var(--border); }
html.dark .map-legend { background: rgba(30,41,59,.95); }
html.dark .dp-ph-line { background: linear-gradient(90deg, var(--border) 25%, var(--border-2) 50%, var(--border) 75%); background-size: 1400px 100%; }
html.dark .leaflet-popup-content-wrapper { background: var(--card) !important; color: var(--text) !important; border-color: var(--border) !important; }
html.dark .leaflet-popup-tip { background: var(--card) !important; }
html.dark .leaflet-control-zoom a { background: var(--card) !important; color: var(--text-sub) !important; border-color: var(--border) !important; }
html.dark .leaflet-control-zoom a:hover { background: var(--border) !important; }
html.dark .leaflet-control-attribution { background: rgba(15,23,42,.88) !important; color: var(--text-muted) !important; }

/* ── VILLAGE MARKER ──────────────────────────────── */
.vm-marker {
  width: 34px; height: 34px;
  background: #f59e0b; border: 2.5px solid #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2.5px rgba(245,158,11,.35), 0 2px 10px rgba(0,0,0,.5);
  cursor: pointer;
}
.vm-marker svg { width: 16px; height: 16px; fill: #fff; }

/* ── SOURCE MARKER ───────────────────────────────── */
.src-marker-hit {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.src-marker {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.85); border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .15s;
  pointer-events: none;
}
.src-marker-hit:hover .src-marker { transform: scale(1.35); }
.src-marker-hit.src-marker-hit-active .src-marker {
  transform: scale(1.45);
  box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 0 5px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.4);
}

/* ── COLLECTION POINT MARKER ─────────────────────── */
.cp-marker {
  width: 32px; height: 32px;
  background: #dc2626; border: 3px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(220,38,38,.5);
}
.cp-marker svg { width: 14px; height: 14px; fill: #fff; transform: rotate(45deg); }

.cp-pin {
  width: 20px; height: 20px;
  background: #fff;
  border: 3px solid #1d4ed8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37,99,235,.25), 0 2px 10px rgba(0,0,0,.4);
  animation: cp-pulse 2.2s ease-in-out infinite;
}
@keyframes cp-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37,99,235,.25), 0 2px 10px rgba(0,0,0,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(37,99,235,.08), 0 2px 10px rgba(0,0,0,.4); }
}

/* ── MAP INSTRUCTION BANNER ──────────────────────── */
#map-instruction {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 1400; background: rgba(15,23,42,.88); color: #f1f5f9;
  font-size: .78rem; font-weight: 600; padding: 8px 18px;
  border-radius: 20px; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); pointer-events: none;
  backdrop-filter: blur(6px); display: none;
}

/* ── VILLAGE SELECT PANEL ────────────────────────── */
.dp-welcome { padding: 12px 4px; text-align: center; }
.dp-welcome-icon { width: 52px; height: 52px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.dp-welcome-icon svg { width: 24px; height: 24px; fill: #f59e0b; }
.dp-welcome-title { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 7px; }
.dp-welcome-text { font-size: .78rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 18px; }
.dp-welcome-villages { display: flex; flex-direction: column; gap: 6px; }
.dp-village-btn {
  width: 100%; padding: 10px 14px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between;
  font-family: inherit; transition: all .15s;
}
.dp-village-btn:hover { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.dp-vbtn-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.dp-vbtn-county { font-size: .72rem; color: var(--text-muted); }

/* ── POINT SELECT PANEL ──────────────────────────── */
.dp-back-btn {
  flex-shrink: 0; align-self: center;
  font-size: .72rem; font-weight: 700; color: var(--text-sub);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap;
}
.dp-back-btn:hover { background: var(--border); color: var(--text); }

.dp-instruction-box {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(37,99,235,.06); border: 1px solid rgba(37,99,235,.18);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.dp-instruction-box svg { width: 22px; height: 22px; fill: var(--accent); flex-shrink: 0; margin-top: 1px; }
.dp-instr-title { font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: 3px; }
.dp-instr-text { font-size: .74rem; color: var(--text-sub); line-height: 1.45; }

/* ── SOURCE LIST PANEL ───────────────────────────── */
.src-list { display: flex; flex-direction: column; gap: 8px; }
.src-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; transition: all .15s; background: var(--bg);
}
.src-card:hover { border-color: var(--border-2); background: var(--card); box-shadow: var(--sh-sm); }
.src-card-active { border-color: var(--accent) !important; background: var(--accent-dim) !important; }
.src-card-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.src-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.src-icon svg { width: 15px; height: 15px; }
.src-icon-sm { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.src-icon-sm svg { width: 12px; height: 12px; }
.src-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.src-meta { font-size: .7rem; color: var(--text-muted); margin-top: 1px; text-transform: capitalize; }
.src-card-right { text-align: right; flex-shrink: 0; }
.src-reserve { font-size: .85rem; font-weight: 800; color: var(--text); }
.src-reserve span { font-size: .65rem; color: var(--text-muted); font-weight: 500; }
.src-conf { font-size: .72rem; font-weight: 700; }

/* ── FEASIBILITY CIRCLE ──────────────────────────── */
.dp-feas-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 18px; margin-bottom: 4px;
}
.dp-feas-svg { width: 140px; height: 140px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.1)); }
.dp-feas-label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); font-weight: 700; margin-top: 8px;
}

/* ── METRIC CARDS ────────────────────────────────── */
.dp-metric-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 18px;
}
.dp-metric-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px; transition: border-color .15s, box-shadow .15s;
}
.dp-metric-card:hover { border-color: var(--border-2); box-shadow: var(--sh-sm); }
.dp-metric-icon {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; margin-bottom: 4px;
}
.dp-metric-icon svg { width: 16px; height: 16px; }
.dp-metric-val {
  font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; line-height: 1.1;
}
.dp-metric-val span { font-size: .72rem; font-weight: 600; color: var(--text-muted); }
.dp-metric-lbl { font-size: .62rem; color: var(--text-muted); font-weight: 600; line-height: 1.3; }
.dp-metric-hint { font-size: .6rem; color: var(--text-muted); font-style: italic; margin-top: 2px; }

/* ── DATA SECTIONS (communities + sources below map) ── */
.data-section {
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--sh-sm);
}
.ds-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.ds-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 700; color: var(--text);
}
.ds-title svg { width: 16px; height: 16px; color: var(--accent); }
.ds-count {
  font-size: .72rem; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,.18);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

/* ── VILLAGE CARDS ───────────────────────────────── */
.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.vill-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.vill-card:hover {
  border-color: var(--border-2); box-shadow: var(--sh-md); transform: translateY(-1px);
}
.vill-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.vill-name {
  font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: -.02em;
}
.vill-county-badge {
  font-size: .62rem; font-weight: 700; color: var(--text-muted);
  background: var(--border); border-radius: 4px; padding: 2px 7px; white-space: nowrap;
}
.vill-status-badge {
  font-size: .65rem; font-weight: 700; border-radius: 5px;
  padding: 3px 9px; border: 1px solid; align-self: flex-start;
}
.vill-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.vill-metric { text-align: center; }
.vill-metric-val { font-size: .9rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.vill-metric-lbl { font-size: .58rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.vill-select-btn {
  width: 100%; padding: 7px; border-radius: 7px; border: 1.5px solid var(--accent);
  background: var(--accent-dim); color: var(--accent); font-size: .73rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s, color .15s;
}
.vill-select-btn:hover { background: var(--accent); color: #fff; }
.vill-select-btn svg { width: 13px; height: 13px; fill: currentColor; }

/* ── SOURCE ITEM CARDS ───────────────────────────── */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.src-item-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.src-item-card:hover {
  border-color: var(--border-2); box-shadow: var(--sh-md); transform: translateY(-1px);
}
.src-item-top { display: flex; align-items: flex-start; gap: 10px; }
.src-item-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.src-item-icon svg { width: 14px; height: 14px; fill: currentColor; }
.src-item-meta { flex: 1; min-width: 0; }
.src-item-name {
  font-size: .82rem; font-weight: 700; color: var(--text); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.src-item-village { font-size: .65rem; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.src-item-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.src-item-stat { text-align: center; }
.src-item-stat-val { font-size: .82rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.src-item-stat-lbl { font-size: .56rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.src-item-status { align-self: flex-start; }

/* ── BELOW-MAP TWO-COLUMN LAYOUT ─────────────────── */
.below-map-grid {
  display: grid;
  grid-template-columns: 58fr 42fr;
  gap: 12px;
  margin-bottom: 20px;
}
.bm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
}
.bm-card-header {
  display: flex; align-items: center; justify-content: flex-start;
  margin-bottom: 14px; gap: 10px; flex-shrink: 0;
}
.bm-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 700; color: var(--text);
}
.bm-card-title svg { width: 15px; height: 15px; color: var(--accent); }
.bm-count {
  font-size: .7rem; font-weight: 700; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,.18);
  padding: 2px 10px; border-radius: 20px; white-space: nowrap;
}

/* ── SOURCE ROWS (left card) ─────────────────────── */
.bm-sources-list {
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto; max-height: 460px;
}
.bm-src-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px;
}
.bm-src-icon {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bm-src-icon svg { width: 12px; height: 12px; fill: currentColor; }
.bm-src-info { flex: 1; min-width: 0; }
.bm-src-name {
  font-size: .8rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-src-meta { font-size: .63rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.bm-src-bar-track {
  height: 3px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.bm-src-bar-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.bm-src-stats {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0;
}
.bm-src-reserve { font-size: .78rem; font-weight: 700; color: var(--text); }
.bm-src-reserve em { font-style: normal; font-size: .6rem; color: var(--text-muted); font-weight: 500; }
.bm-src-conf { font-size: .68rem; font-weight: 700; }

/* ── OVERVIEW STATS (right card) ─────────────────── */
.ov-hero {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 14px;
}
.ov-hero-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ov-hero-val { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -.04em; }
.ov-hero-lbl { font-size: .55rem; font-weight: 700; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .06em; }
.ov-hero-side { flex: 1; min-width: 0; }
.ov-hero-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: .65rem; font-weight: 600; color: rgba(255,255,255,.8); margin-bottom: 4px;
}
.ov-hero-tag svg { width: 11px; height: 11px; flex-shrink: 0; }
.ov-hero-cap {
  font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: -.02em;
}
.ov-hero-cap span { font-size: .68rem; font-weight: 500; color: rgba(255,255,255,.75); }
.ov-hero-villages { font-size: .65rem; color: rgba(255,255,255,.65); font-weight: 500; margin-top: 2px; }

/* ── 3-COLUMN METRIC GRID (avg feasibility / tap / rain gauge) ─── */
.ov-metrics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 22px;
}
.ov-metric-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 12px 20px;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  min-height: 240px;
}
.ov-metric-label {
  font-size: .58rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700; text-align: center;
  line-height: 1.3; min-height: 2.6em;
  display: flex; align-items: flex-start; justify-content: center;
}
.ov-metric-stage {
  flex: 1; width: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}

/* Average-feasibility donut (smaller variant of dp-feas-svg) */
.ov-feas-svg {
  width: 124px; height: 124px;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.07));
}

/* Tap with daily-flow indicator */
.ov-tap-stage {
  position: relative; width: 90px; height: 96px;
  display: flex; flex-direction: column; align-items: center;
}
.ov-tap-svg { width: 80px; height: 50px; flex-shrink: 0; }
.ov-tap-value {
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  line-height: 1; text-align: center;
}
.ov-tap-value span {
  font-size: .58rem; font-weight: 600; color: var(--text-muted); margin-left: 3px;
}
.ov-tap-stream {
  position: absolute; left: 50%; top: 48px;
  width: 4px; height: 22px;
  background: linear-gradient(180deg, #38bdf8, rgba(56,189,248,0));
  border-radius: 2px;
  transform: translateX(-50%);
  transform-origin: top center;
  animation: ovTapStream 0.95s linear infinite;
}
@keyframes ovTapStream {
  0%   { transform: translateX(-50%) scaleY(0.3); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateX(-50%) scaleY(1.3); opacity: 0; }
}
.ov-tap-drop {
  position: absolute; left: 50%; top: 50px;
  width: 6px; height: 8px;
  background: #38bdf8;
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  transform: translate(-50%, 0) rotate(180deg);
  opacity: 0;
  animation: ovTapDrop 1.4s ease-in 0.45s infinite;
  box-shadow: 0 0 6px rgba(56,189,248,.45);
}
@keyframes ovTapDrop {
  0%   { transform: translate(-50%, 0) rotate(180deg); opacity: 0; }
  18%  { opacity: 1; }
  100% { transform: translate(-50%, 30px) rotate(180deg); opacity: 0; }
}
.ov-tap-puddle {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 6px;
  background: radial-gradient(ellipse, rgba(56,189,248,.55), transparent 70%);
  border-radius: 50%;
  animation: ovTapPuddle 1.4s ease-in-out infinite;
}
@keyframes ovTapPuddle {
  0%, 100% { transform: translateX(-50%) scaleX(.85); opacity: .55; }
  50%      { transform: translateX(-50%) scaleX(1.05); opacity: .85; }
}

/* Rain gauge: graduated cylinder filled to value */
.ov-gauge-stage {
  position: relative; width: 78px; height: 130px;
}
.ov-gauge-cylinder {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(148,163,184,.1), rgba(148,163,184,.04));
  border: 2px solid #94a3b8; border-top-width: 3px;
  border-radius: 4px 4px 14px 14px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
}
.ov-gauge-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #38bdf8 0%, #1d4ed8 100%);
  transition: height .8s cubic-bezier(.4,.2,.2,1);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 12px;
  z-index: 1;
}
.ov-gauge-wave {
  position: absolute;
  left: -50%; width: 200%;
  pointer-events: none; display: block;
}
.ov-gauge-wave-back {
  height: 8px; top: -4px;
  fill: #38bdf8;
  animation: ovGaugeWave 7s linear infinite;
}
.ov-gauge-wave-front {
  height: 6px; top: -3px;
  fill: rgba(255,255,255,.35);
  animation: ovGaugeWave 4.5s linear infinite reverse;
}
@keyframes ovGaugeWave {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ov-gauge-marks {
  position: absolute; inset: 6px 0; pointer-events: none; z-index: 2;
}
.ov-gauge-tick {
  position: absolute; right: 0; height: 1px;
  background: rgba(71,85,105,.4);
  width: 6px;
}
.ov-gauge-tick.lg { width: 12px; background: rgba(71,85,105,.6); }
.ov-gauge-value {
  font-size: .82rem; font-weight: 800; color: #fff;
  white-space: nowrap; line-height: 1; text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 8px rgba(0,0,0,.3);
  position: relative; z-index: 3;
}
.ov-gauge-value span {
  display: block; font-size: .56rem; font-weight: 600; opacity: .9; margin-top: 3px;
}

/* Source-type counters (streams / springs / lakes …) */
.ov-type-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.ov-type-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 9px; padding: 10px 12px;
  transition: transform .15s, box-shadow .15s;
}
.ov-type-card:hover {
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.ov-type-card-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ov-type-card-icon svg { width: 18px; height: 18px; fill: currentColor; }
.ov-type-card-body { display: flex; flex-direction: column; min-width: 0; }
.ov-type-card-num { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1; }
.ov-type-card-label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 700; color: var(--text-muted); margin-top: 3px;
}

.ov-best-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 22px;
  border-left: 3px solid var(--accent);
}
.ov-best-eyebrow {
  font-size: .58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--accent); margin-bottom: 3px;
}
.ov-best-name { font-size: .95rem; font-weight: 800; color: var(--text); margin-bottom: 5px; }
.ov-best-details {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ov-best-details span {
  font-size: .65rem; font-weight: 600; color: var(--text-muted);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 7px;
}

@media (max-width: 800px) {
  .below-map-grid { grid-template-columns: 1fr; }
}

/* ── VILLAGE DETAIL PANEL ────────────────────────── */
.vp-status-banner {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid; border-radius: 8px; padding: 8px 12px;
  margin-bottom: 14px;
}
.vp-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vp-status-text { font-size: .75rem; font-weight: 700; }

.vp-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px;
}
.vp-stat {
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 8px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px;
}
.vp-stat-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 2px;
}
.vp-stat-icon svg { width: 14px; height: 14px; }
.vp-stat-val { font-size: .95rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; line-height: 1.1; }
.vp-stat-lbl { font-size: .58rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.vp-coverage { margin-bottom: 14px; }
.vp-coverage-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.vp-coverage-lbl { font-size: .68rem; font-weight: 600; color: var(--text-muted); }
.vp-coverage-pct { font-size: .82rem; font-weight: 800; }
.vp-coverage-track {
  height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 5px;
}
.vp-coverage-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.vp-coverage-sub { font-size: .62rem; color: var(--text-muted); font-weight: 500; }

.vp-sources-row {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
.vp-src-badge {
  flex: 1; min-width: 60px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; text-align: center;
}
.vp-src-badge-wide { flex: 2; }
.vp-src-badge-val { font-size: .88rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.vp-src-badge-lbl { font-size: .58rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }

/* ── PIPELINE SECTION ────────────────────────────── */
.pipe-segment {
  display: flex; align-items: stretch; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.pipe-segment:last-of-type { border-bottom: none; }
.pipe-seg-line {
  width: 4px; border-radius: 2px; flex-shrink: 0;
}
.pipe-seg-blue  { background: #2563eb; }
.pipe-seg-green { background: #059669; }
.pipe-seg-body { flex: 1; }
.pipe-seg-title {
  font-size: .72rem; font-weight: 600; color: var(--text-sub); margin-bottom: 4px;
}
.pipe-seg-vals { display: flex; align-items: baseline; gap: 8px; }
.pipe-seg-km {
  font-size: 1.1rem; font-weight: 800; color: var(--text); letter-spacing: -.02em;
}
.pipe-seg-m {
  font-size: .7rem; font-weight: 600; color: var(--text-muted);
}
.pipe-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 10px 12px;
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,.18); border-radius: 8px;
}
.pipe-total-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
}
.pipe-total-val {
  font-size: 1rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em;
}
.pipe-total-val span {
  font-size: .68rem; font-weight: 600; color: var(--text-muted); margin-left: 4px;
}

/* ── BROWSE PANEL ────────────────────────────────── */
.dp-welcome-or {
  font-size: .68rem; font-weight: 600; color: var(--text-muted);
  text-align: center; margin: 4px 0 8px; letter-spacing: .04em;
}

/* ── LANDING STATE ───────────────────────────────── */
body.landing { overflow: hidden; }

body.landing .navbar       { display: none; }
body.landing .page-header  { display: none; }
body.landing .below-map-grid { display: none; }
body.landing .footer       { display: none; }
body.landing .main         { padding: 0; max-width: 100%; margin: 0; width: 100%; }

body.landing .split-layout {
  grid-template-columns: 1fr 0fr;
  height: 100vh;
  margin: 0;
  gap: 0;
}

body.landing .map-card {
  border-radius: 0;
  border: none;
  box-shadow: none;
}
body.landing .map-header { display: none; }
body.landing .map-body   { overflow: hidden; }

#map { transition: filter .6s ease, transform .6s ease; }
body.landing #map {
  filter: blur(7px) brightness(0.55);
  transform: scale(1.1);
  cursor: default !important;
}

body.landing .map-overlay-search {
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, 88%);
}
body.landing .mos-input { height: 50px; font-size: .92rem; }
body.landing .mos-results { max-height: 340px; }

body.landing .detail-panel { overflow: hidden; opacity: 0; padding: 0; }
body:not(.landing) .detail-panel { opacity: 1; }

/* ── WATER TOUCHES ───────────────────────────────── */

/* Logo drop — gently bobs */
.logo-drop {
  width: 15px; height: 15px;
  fill: #0ea5e9;
  flex-shrink: 0;
  animation: drop-bob 3.2s ease-in-out infinite;
}
@keyframes drop-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-3px) scale(1.08); }
}

/* Navbar — thin flowing water line */
.navbar { position: relative; }
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, #0ea5e9 25%, #2563eb 50%, #0ea5e9 75%, transparent 100%);
  background-size: 200% 100%;
  animation: nav-flow 5s ease-in-out infinite;
  opacity: 0;
  transition: opacity .4s ease;
}
body:not(.landing) .navbar::after { opacity: 0.45; }
@keyframes nav-flow {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Landing hero title — slow water shimmer */
.mos-hero-title {
  background: linear-gradient(90deg, #fff 0%, #bfdbfe 30%, #93c5fd 50%, #bfdbfe 70%, #fff 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0,0,0,.55));
  animation: title-shimmer 6s linear infinite;
}
@keyframes title-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}

/* Landing wave — two layers drift at different speeds */
.landing-wave {
  position: absolute;
  bottom: 0; left: -5%; width: 110%;
  z-index: 1400; pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
body.landing .landing-wave { opacity: 1; }
.lw-1 { animation: wave-drift 8s ease-in-out infinite alternate; transform-origin: center bottom; }
.lw-2 { animation: wave-drift 11s ease-in-out infinite alternate-reverse; transform-origin: center bottom; }
@keyframes wave-drift {
  from { transform: translateX(0%); }
  to   { transform: translateX(5%); }
}

/* ── REAL-TIME SCAN ELEMENTS ─────────────────────── */
.scan-center-pin {
  width: 16px; height: 16px;
  background: #f59e0b;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .35), 0 2px 8px rgba(0, 0, 0, .35);
}

.src-marker-blue { background: #2563eb; }

/* ── DETAIL-PANEL EXTRAS ─────────────────────────── */
.dp-eu-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: .65rem;
  font-weight: 700;
  vertical-align: middle;
}
.dp-eu-ok  { background: rgba(22, 163, 74, .12); color: #16a34a; }
.dp-eu-off { background: rgba(120, 113, 108, .15); color: var(--text-sub); }

.dp-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.dp-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px;
}
.dp-supply-method {
  font-size: .85rem; font-weight: 600; color: var(--text);
  text-transform: capitalize;
}
.dp-cost-total {
  font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 8px;
}
.dp-cost-breakdown { display: flex; flex-direction: column; gap: 4px; }
.dp-cost-row {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--text-sub);
}
.dp-cost-row.dp-cost-grant {
  color: #16a34a; font-weight: 600;
  border-top: 1px dashed var(--border); padding-top: 5px; margin-top: 3px;
}
.dp-cost-row.dp-cost-village {
  font-weight: 700; color: var(--text); font-size: .85rem;
  padding-top: 4px;
}
.dp-recommendation {
  font-size: .8rem; line-height: 1.45; color: var(--text-sub);
  background: rgba(37, 99, 235, .04);
  border-left: 3px solid #2563eb;
  padding: 8px 10px; border-radius: 0 6px 6px 0;
}

/* ── RECOMMENDATION CARD (verdict + body + bullet facts) ────────── */
.dp-rec-card {
  border-radius: 12px;
  border: 1px solid var(--rec-border, var(--border));
  background: var(--card);
  overflow: hidden;
  margin-top: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dp-rec-card-good { --rec-color: #16a34a; --rec-bg: rgba(22,163,74,.08);  --rec-bg-soft: rgba(22,163,74,.04);  --rec-border: rgba(22,163,74,.28); }
.dp-rec-card-okay { --rec-color: #65a30d; --rec-bg: rgba(101,163,13,.08); --rec-bg-soft: rgba(101,163,13,.04); --rec-border: rgba(101,163,13,.28); }
.dp-rec-card-mid  { --rec-color: #d97706; --rec-bg: rgba(217,119,6,.10);  --rec-bg-soft: rgba(217,119,6,.05);  --rec-border: rgba(217,119,6,.32); }
.dp-rec-card-low  { --rec-color: #ea580c; --rec-bg: rgba(234,88,12,.10);  --rec-bg-soft: rgba(234,88,12,.05);  --rec-border: rgba(234,88,12,.32); }
.dp-rec-card-bad  { --rec-color: #dc2626; --rec-bg: rgba(220,38,38,.10);  --rec-bg-soft: rgba(220,38,38,.05);  --rec-border: rgba(220,38,38,.32); }

.dp-rec-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--rec-bg);
  border-bottom: 1px solid var(--rec-border);
}
.dp-rec-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--rec-color);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 4px 10px rgba(0,0,0,.12);
}
.dp-rec-icon svg { width: 19px; height: 19px; color: #fff; }
.dp-rec-verdict { flex: 1; min-width: 0; }
.dp-rec-verdict-title {
  font-size: .92rem; font-weight: 800; color: var(--rec-color); line-height: 1.15;
  letter-spacing: -.01em;
}
.dp-rec-verdict-sub {
  font-size: .65rem; font-weight: 600; color: var(--text-muted);
  margin-top: 3px;
}
.dp-rec-score {
  font-size: 1.5rem; font-weight: 800; color: var(--rec-color);
  line-height: 1; font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
}

.dp-rec-body {
  padding: 12px 14px;
  font-size: .82rem; line-height: 1.5; color: var(--text-sub);
  background: var(--rec-bg-soft);
}
.dp-rec-points {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 14px 14px;
}
.dp-rec-point {
  display: flex; align-items: center; gap: 9px;
  font-size: .76rem; color: var(--text-sub); font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.35;
}
.dp-rec-point strong { color: var(--text); font-weight: 700; }
.dp-rec-point-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dp-rec-point-icon svg { width: 14px; height: 14px; }
.dp-rec-point-good    .dp-rec-point-icon { background: rgba(22,163,74,.12); color: #16a34a; }
.dp-rec-point-warn    .dp-rec-point-icon { background: rgba(217,119,6,.12); color: #d97706; }
.dp-rec-point-neutral .dp-rec-point-icon { background: rgba(37,99,235,.10); color: #2563eb; }

/* ── BELOW-MAP EXTRAS ────────────────────────────── */
.bm-empty {
  padding: 20px; text-align: center;
  color: var(--text-muted); font-size: .82rem;
}
.bm-empty-error { color: #dc2626; }
.bm-empty code {
  font-family: 'DM Mono', monospace; font-size: .75rem;
  background: rgba(0, 0, 0, .06); padding: 2px 5px; border-radius: 4px;
}

.bm-src-row-clickable { cursor: pointer; transition: background .15s, transform .1s; }
.bm-src-row-clickable:hover { background: rgba(37, 99, 235, .05); }
.bm-src-row-clickable.src-card-active {
  background: rgba(37, 99, 235, .08);
  outline: 2px solid #2563eb; outline-offset: -2px;
}
.bm-src-rank {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  border-radius: 8px;
  font-weight: 800; font-size: .82rem;
  font-family: 'Outfit', sans-serif;
}
.bm-src-meta-pill {
  font-size: .68rem; color: var(--text-muted);
  background: rgba(0, 0, 0, .04);
  padding: 3px 8px; border-radius: 6px;
}

/* Map-instruction banner */
#map-instruction {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .92); color: #fff;
  padding: 8px 16px; border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  z-index: 800; pointer-events: none;
  display: none;
}

/* ── PAGE ANIMATIONS ─────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Landing → app transition */
body.page-enter .navbar         { animation: fadeInDown .4s cubic-bezier(.4,0,.2,1) both; }
body.page-enter .below-map-grid { animation: fadeInUp .5s cubic-bezier(.4,0,.2,1) .28s both; }

/* Scroll-reveal */
.scroll-fade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .55s ease, transform .55s ease;
}
.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Landing hero stagger */
body.landing .mos-hero-logo  { animation: fadeInUp .5s ease .05s both; }
body.landing .mos-hero-title { animation: fadeInUp .5s ease .18s both, title-shimmer 6s linear .68s infinite; }
body.landing .mos-hero-sub   { animation: fadeInUp .45s ease .28s both; }
body.landing .mos-hero-pills { animation: fadeInUp .45s ease .38s both; }
body.landing .mos-input-wrap { animation: fadeInUp .45s ease .46s both; }
