/* Ground Truth — Institutional UI System */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap");

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════ */
:root {
  /* Brand — Deep Naval Blue */
  --brand:      #152047;
  --brand-2:    #1E3272;
  --brand-3:    #3659B8;
  --brand-soft: #EDF0FA;
  --brand-soft-2:#E2E8F5;

  /* Accent — Warm Brass Gold */
  --accent:      #C49332;
  --danger:      #C74040;
  --up:          #157a3c;
  --down:        #b91c1c;

  /* Background master token — change only this */
  --app-bg:          #ffffff;

  /* Backgrounds */
  --bg:              var(--app-bg);
  --bg-2:            var(--app-bg);
  --surface:         var(--app-bg);
  --surface-solid:   var(--app-bg);
  --surface-soft:    var(--app-bg);
  --surface-soft-2:  var(--app-bg);

  /* Borders */
  --line:   rgba(21,32,71,0.07);
  --line-2: rgba(21,32,71,0.11);
  --line-3: rgba(21,32,71,0.17);

  /* Text */
  --text:        #1A2C50;
  --text-strong: #0B1728;
  --muted:       #5C6D8E;
  --muted-2:     #8292AE;

  /* Shadows */
  --shadow-xs: 0 2px 10px rgba(21,32,71,0.05);
  --shadow-sm: 0 8px 22px rgba(21,32,71,0.06);
  --shadow-md: 0 12px 30px rgba(21,32,71,0.09);
  --shadow-lg: 0 20px 44px rgba(21,32,71,0.12);
  --shadow-xl: 0 32px 84px rgba(21,32,71,0.18);

  /* Layout */
  --headerH: 58px;
  --leftW:   clamp(240px, 17vw, 278px);
  --rightW:  clamp(268px, 19vw, 320px);

  /* Radii — institutional, not pill-heavy */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  --pad: 8px;
  --font:         "Open Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Open Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "DM Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }

button, input, select {
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(54,89,184,0.18);
}

/* ═══════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.gt-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   FIELD / LABEL
═══════════════════════════════════════════════════ */
.gt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gt-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

/* ═══════════════════════════════════════════════════
   LOADER FRAME
═══════════════════════════════════════════════════ */
#loaderFrame {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#loaderFrame.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   ROOT CONTAINER
═══════════════════════════════════════════════════ */
.gt-container {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: var(--headerH) 1fr;
  gap: 8px;
  padding: 8px;
}

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
.gt-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--headerH);
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
  z-index: 3000;
}

/* Subtle brand accent on header bottom edge */
.gt-header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--brand-soft-2) 30%, var(--brand-3) 50%, var(--brand-soft-2) 70%, transparent 100%);
  border-radius: 0 0 2px 2px;
  opacity: 0.6;
  pointer-events: none;
}

.gt-header-left,
.gt-header-search,
.gt-header-right { position: relative; z-index: 1; }

.gt-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
}

.gt-title {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.04em;
}

/* ═══════════════════════════════════════════════════
   SEARCH ROW
═══════════════════════════════════════════════════ */
.gt-header-search {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 700px;
  overflow: visible;
  z-index: 20;
}

.gt-search-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.gt-search-row:focus-within {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10), var(--shadow-xs);
}

.gt-search-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  outline: 0;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  padding: 0 30px 0 12px;
  background: var(--surface-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'><path d='M7 10l5 5 5-5' stroke='%231E3272' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.gt-search-select:focus { background-color: var(--brand-soft); }

.gt-search-input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  padding: 0 12px 0 36px;
  background: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='%235C6D8E' stroke-width='1.8'/><path d='M19.5 19.5l-3.5-3.5' stroke='%235C6D8E' stroke-width='1.8' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.gt-search-input::placeholder { color: var(--muted-2); }

/* ─── Search Results Dropdown ────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow: auto;
  display: none;
  z-index: 5000;
  padding: 4px;
}

.search-results.active { display: block; }

.search-result-item {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.11s ease;
  border-bottom: 1px solid var(--line);
}

.search-result-item:last-child { border-bottom: 0; }

.search-result-item:hover { background: var(--brand-soft); }

.search-result-item strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 2px;
}

.search-result-item small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   HEADER RIGHT
═══════════════════════════════════════════════════ */
.gt-header-right {
  min-width: 162px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.gt-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.gt-tip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════
   SHELL LAYOUT
═══════════════════════════════════════════════════ */
.gt-shell {
  display: grid;
  grid-template-columns: var(--leftW) minmax(0, 1fr) var(--rightW);
  gap: 8px;
  height: calc(100vh - var(--headerH) - 16px);
  min-height: 0;
}

.gt-left,
.gt-right {
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gt-left  { overflow-y: auto; overflow-x: hidden; }
.gt-right { display: flex; flex-direction: column; gap: 8px; }
.gt-map   { min-width: 0; min-height: 0; overflow: hidden; }

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.gt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 6px;
  overflow: hidden;
  position: relative;
}

.gt-card:last-child { margin-bottom: 0; }

.gt-card-title {
  padding: 9px 12px 9px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accent bar left of card title */
.gt-card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-3) 0%, var(--brand) 100%);
  flex: 0 0 auto;
}

.gt-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════
   TIMELINE CHIPS
═══════════════════════════════════════════════════ */
.gt-chip-grid { display: flex; flex-wrap: wrap; gap: 4px; }

.time-btn {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.time-btn:hover {
  border-color: var(--brand-soft-2);
  color: var(--brand);
  background: var(--brand-soft);
}

.time-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21,32,71,0.24);
}

/* ═══════════════════════════════════════════════════
   CUSTOM DATE RANGE
═══════════════════════════════════════════════════ */
.custom-date-range { display: none; padding-top: 8px; }
.custom-date-range.active { display: block; }

.gt-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gt-date-grid input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 500;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.gt-date-grid input:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10);
}

.gt-btn-row { display: flex; gap: 6px; margin-top: 8px; }

.apply-date-btn,
.clear-date-btn,
.clear-selection {
  flex: 1;
  min-height: 32px;
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.apply-date-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(21,32,71,0.22);
}

.apply-date-btn:hover { background: var(--brand-2); border-color: var(--brand-2); }

.clear-date-btn,
.clear-selection {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
}

.clear-date-btn:hover,
.clear-selection:hover {
  border-color: var(--line-3);
  background: var(--surface-soft);
}

.timeline-date {
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  background: var(--brand-soft);
  letter-spacing: 0.03em;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════
   TOGGLE / FILTER ROWS
═══════════════════════════════════════════════════ */
.gt-toggle-list { display: flex; flex-direction: column; gap: 3px; }

.gt-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 7px 10px;
  cursor: pointer;
}

.gt-toggle-row:hover {
  border-color: var(--brand-soft-2);
  background: var(--surface-soft);
}

.gt-toggle-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

/* ─── Toggle Switch ──────────────────────────────── */
.gt-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  position: relative;
  flex: 0 0 auto;
}

.gt-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.gt-toggle-row.active {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.gt-toggle-row.active .gt-toggle-label { color: var(--brand); font-weight: 600; }

.gt-toggle-row.active .gt-switch {
  background: var(--brand-2);
  border-color: var(--brand);
}

.gt-toggle-row.active .gt-switch::after { transform: translateX(13px); }

.gt-hidden-select { display: none; }

/* ═══════════════════════════════════════════════════
   AREA INFO BANNER
═══════════════════════════════════════════════════ */
.area-info {
  display: none;
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.area-info.active { display: block; }

.area-info p {
  margin: 0 0 6px;
  font-size: 10.5px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   MAP
═══════════════════════════════════════════════════ */
.gt-map-frame {
  position: relative;
  height: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

#map { width: 100%; height: 100%; }

.map-zoom {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 800;
}

.project-zones-map-toggle {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 800;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.project-zones-map-toggle:hover {
  background: var(--brand-soft);
  border-color: var(--brand-3);
  color: var(--brand);
}

.project-zones-map-toggle.active {
  background: #1e40af;
  border-color: #1e3a8a;
  color: #fff;
}

.project-zones-map-toggle[hidden] {
  display: none !important;
}

.map-zoom button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
  font-weight: 300;
}

.map-zoom button:hover {
  background: var(--brand-soft);
  border-color: var(--brand-3);
  color: var(--brand);
}

/* ═══════════════════════════════════════════════════
   RIGHT PANEL — STATS TABLE
═══════════════════════════════════════════════════ */
.gt-table-shell { min-height: 0; flex: 1; overflow: hidden; }

.gt-table-wrap {
  height: 100%;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.gt-table-card { background: transparent; }

.gt-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.gt-stats-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--text-strong);
  font-size: 9.5px;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line-2);
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.gt-stats-table tbody td {
  font-size: 11px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 400;
}

.gt-stats-table tbody tr:hover td { background: var(--brand-soft); }

.gt-stats-table tbody tr.section-gap td {
  border-bottom: 0;
  height: 6px;
  padding: 0;
  background: transparent;
}

/* ═══════════════════════════════════════════════════
   LOGOUT FAB
═══════════════════════════════════════════════════ */
.logout-fab {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 10.5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
}

.logout-fab:hover {
  color: var(--danger);
  border-color: rgba(199,64,64,0.24);
  background: rgba(192,57,43,0.03);
}

.logout-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════════ */
.mobile-topbar  { display: none; }
.sidebar-overlay { display: none; }

/* ═══════════════════════════════════════════════════
   LEAFLET OVERRIDES
═══════════════════════════════════════════════════ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--line-2) !important;
  background: var(--surface) !important;
  backdrop-filter: none !important;
}

.leaflet-popup-content {
  margin: 11px 14px !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-tip { box-shadow: none !important; }

.leaflet-tooltip.cluster-count-label {
  border: 1px solid var(--line-2) !important;
  border-radius: 999px !important;
  padding: 3px 8px !important;
  background: var(--surface) !important;
  color: var(--text-strong) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: none !important;
}

.survey-project-number-icon {
  background: transparent !important;
  border: none !important;
}

.survey-project-number-badge {
  position: relative;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(22, 101, 52, 0.24);
  background: rgba(240, 253, 244, 0.94);
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(20, 83, 45, 0.12);
  pointer-events: auto;
  cursor: pointer;
}

.leaflet-tooltip.tgiic-info-tooltip {
  pointer-events: none;
  border: 1px solid var(--line-2) !important;
  border-radius: var(--radius-md) !important;
  padding: 0 !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-lg) !important;
}

.tgiic-tooltip {
  width: min(360px, 78vw);
  max-width: calc(100vw - 40px);
  padding: 11px 12px;
}

.tgiic-tooltip-title {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

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

.tgiic-tooltip-row {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(237,240,250,0.72);
  font-size: 11px;
  line-height: 1.3;
}

.tgiic-tooltip-row:nth-child(4),
.tgiic-tooltip-row:nth-child(5),
.tgiic-tooltip-row:nth-child(6),
.tgiic-tooltip-row:nth-child(7) {
  grid-column: 1 / -1;
}

.tgiic-tooltip-row span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.tgiic-tooltip-row strong {
  display: block;
  min-width: 0;
  color: var(--text-strong);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tgiic-tooltip-hint {
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

/* ═══════════════════════════════════════════════════
   TGIIC DETAIL PAGE
═══════════════════════════════════════════════════ */
.tgiic-detail-body {
  min-height: 100%;
  overflow: auto;
  background: #f8fafc;
}

.tgiic-detail-page {
  width: min(1440px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 24px;
}

.tgiic-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
}

.tgiic-detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.tgiic-detail-back:hover {
  border-color: var(--brand-soft-2);
  background: var(--brand-soft);
}

.tgiic-detail-header h1 {
  margin: 12px 0 4px;
  color: var(--text-strong);
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.16;
  letter-spacing: 0;
}

.tgiic-detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tgiic-detail-status {
  min-height: 20px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tgiic-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.tgiic-detail-stat {
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tgiic-detail-stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.tgiic-detail-stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tgiic-detail-table-section {
  min-width: 0;
}

.tgiic-detail-table-wrap {
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tgiic-detail-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.tgiic-detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
  border-bottom: 2px solid var(--line-2);
  background: var(--surface-soft);
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-transform: uppercase;
}

.tgiic-detail-table td {
  max-width: 240px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.tgiic-detail-table tbody tr:hover td {
  background: var(--brand-soft);
}

.tgiic-detail-table .tgiic-detail-empty {
  max-width: none;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.tgiic-detail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tgiic-detail-pagination[hidden] {
  display: none;
}

.tgiic-detail-pagination-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.tgiic-detail-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.tgiic-detail-page-btn {
  min-width: 30px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.tgiic-detail-page-btn:hover:not(:disabled) {
  border-color: var(--brand-soft-2);
  background: var(--brand-soft);
  color: var(--brand);
}

.tgiic-detail-page-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tgiic-detail-page-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.tgiic-detail-page-gap {
  min-width: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   PROJECTS SURVEY DETAIL PAGE
═══════════════════════════════════════════════════ */
.projects-survey-detail-body {
  position: relative;
  min-height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(34, 197, 94, 0.12), transparent 24%),
    linear-gradient(180deg, #eef5fb 0%, #e6eef6 100%);
}

.projects-survey-detail-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.projects-survey-detail-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.75;
}

.projects-survey-detail-orb-a {
  top: -120px;
  left: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0) 72%);
}

.projects-survey-detail-orb-b {
  top: 180px;
  right: -110px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0) 74%);
}

.projects-survey-detail-page {
  position: relative;
  width: min(1280px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 24px;
}

.projects-survey-detail-shell {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow:
    0 22px 54px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
}

.projects-survey-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
}

.projects-survey-detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.projects-survey-detail-back:hover {
  border-color: var(--brand-soft-2);
  background: var(--brand-soft);
}

.projects-survey-detail-header h1 {
  margin: 12px 0 4px;
  color: var(--text-strong);
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.16;
  letter-spacing: 0;
}

.projects-survey-detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.projects-survey-detail-status {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.projects-survey-detail-section {
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.projects-survey-detail-section + .projects-survey-detail-section {
  margin-top: 14px;
}

.projects-survey-detail-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.projects-survey-detail-kicker {
  margin: 0 0 6px;
  color: #0369a1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.projects-survey-detail-section-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.projects-survey-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.projects-survey-detail-stat {
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.projects-survey-detail-stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.projects-survey-detail-stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.projects-survey-detail-list {
  display: grid;
  gap: 12px;
}

.projects-survey-detail-empty {
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.projects-survey-detail-card {
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.projects-survey-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.projects-survey-detail-card-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.projects-survey-detail-card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.projects-survey-detail-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  flex: 1 1 420px;
}

.projects-survey-detail-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.projects-survey-detail-field {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(237, 240, 250, 0.72);
}

.projects-survey-detail-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.projects-survey-detail-field strong {
  display: block;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤ 900px
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --headerH: 50px;
    --leftW:   100vw;
    --rightW:  100vw;
  }

  body { overflow: hidden; }

  .gt-container { gap: 0; padding: 0; }
  .gt-header    { display: none; }

  .tgiic-detail-page {
    width: calc(100vw - 16px);
    padding: 10px 0 16px;
  }

  .projects-survey-detail-page {
    width: calc(100vw - 16px);
    padding: 10px 0 16px;
  }

  .projects-survey-detail-shell {
    padding: 14px;
    border-radius: 24px;
  }

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

  .projects-survey-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-survey-detail-section {
    padding: 14px;
  }

  .projects-survey-detail-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .projects-survey-detail-card-head {
    flex-direction: column;
  }

  .tgiic-detail-table-wrap {
    max-height: calc(100vh - 330px);
  }

  .tgiic-detail-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .tgiic-detail-pagination-controls {
    justify-content: flex-start;
  }

  .mobile-topbar {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 9005;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .mobile-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-strong);
  }

  .kebab-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(10,18,40,0.22);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .gt-shell { display: block; height: 100vh; }

  .gt-map,
  .gt-map-frame {
    height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .gt-left,
  .gt-right {
    position: fixed;
    top: 62px;
    bottom: 8px;
    width: min(88vw, 350px);
    z-index: 9003;
    border-radius: var(--radius-xl);
    padding: 10px;
    overflow: auto;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
  }

  .gt-left {
    left: 8px;
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .gt-left.open,
  .gt-left.mobile-active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .gt-right { display: none; }

  .map-zoom { right: 10px; bottom: 70px; }
  .map-zoom button { width: 36px; height: 36px; border-radius: var(--radius-md); }
  .project-zones-map-toggle { right: 10px; bottom: 154px; }

  .gt-search-row {
    grid-template-columns: 128px minmax(0, 1fr);
    min-height: 40px;
  }

  .gt-search-select { font-size: 10px; padding-left: 10px; }
  .gt-search-input  { font-size: 12px; }

  .gt-card          { border-radius: var(--radius-lg); }
  .gt-card-title    { padding: 8px 10px; }
  .gt-card-body     { padding: 8px; }
  .gt-chip-grid     { gap: 4px; }
  .time-btn         { padding: 4px 8px; font-size: 10px; }
  .gt-date-grid     { grid-template-columns: 1fr; }

  .logout-fab {
    left: auto;
    right: 10px;
    bottom: 14px;
    z-index: 9006;
  }
}

/* ═══════════════════════════════════════════════════
   HEADER — PAGE LINK & ACCOUNT
═══════════════════════════════════════════════════ */
.header-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.header-page-link:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(21,32,71,0.22);
}

.header-account { position: relative; flex: 0 0 auto; }

.header-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--shadow-xs);
  color: var(--text-strong);
  cursor: pointer;
}

.header-account-btn:hover {
  border-color: var(--brand-3);
  background: var(--brand-soft);
}

.header-account-btn[aria-expanded="true"] {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10);
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header-account-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}

.header-account-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 5000;
  animation: menu-in 0.14s ease;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-account.open .header-account-menu { display: block; }

.header-account-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px 9px;
  border-bottom: 1px solid var(--line);
}

.header-account-user .header-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

.header-account-user-meta { min-width: 0; }

.header-account-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.header-account-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-account-action,
.header-account-logout {
  width: 100%;
  margin-top: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.header-account-action:hover {
  border-color: var(--brand-3);
  color: var(--brand-2);
  background: var(--brand-soft);
}

.header-account-logout:hover {
  border-color: rgba(199,64,64,0.24);
  color: var(--danger);
  background: rgba(199,64,64,0.04);
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 24, 54, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 6000;
}

.auth-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,255,0.98)),
    var(--surface);
  box-shadow: 0 28px 80px rgba(21,32,71,0.24);
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  border-color: var(--brand-3);
  color: var(--brand-2);
  background: var(--brand-soft);
}

.auth-modal-head {
  margin-bottom: 18px;
}

.auth-modal-eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.auth-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.03em;
}

.auth-modal-copy {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.auth-modal-message {
  display: none;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-modal-message.show {
  display: block;
}

.auth-modal-message.is-error {
  border: 1px solid rgba(199,64,64,0.18);
  background: rgba(199,64,64,0.08);
  color: var(--danger);
}

.auth-modal-message.is-success {
  border: 1px solid rgba(42,140,98,0.18);
  background: rgba(42,140,98,0.08);
  color: #1d7d57;
}

.auth-modal-form {
  display: grid;
  gap: 10px;
}

.auth-modal-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-modal-input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.auth-modal-input:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 4px rgba(54,89,184,0.10);
}

.auth-modal-hint {
  margin-top: -2px;
  font-size: 12px;
  color: var(--muted);
}

.auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.auth-modal-secondary,
.auth-modal-primary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-modal-secondary {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
}

.auth-modal-secondary:hover {
  border-color: var(--brand-3);
  color: var(--brand-2);
  background: var(--brand-soft);
}

.auth-modal-primary {
  border: 1px solid var(--brand);
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 10px 24px rgba(54,89,184,0.16);
}

.auth-modal-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 900px) {
  .header-page-link        { min-height: 30px; padding: 0 10px; font-size: 10px; }
  .header-account-btn      { min-height: 30px; min-width: 30px; padding: 0 6px; }
  .header-avatar           { width: 24px; height: 24px; font-size: 10px; }
  .header-account-caret    { display: none; }
  .header-account-menu     { min-width: 195px; }
  .logout-fab              { display: none !important; }
  .auth-modal-card         { padding: 22px 18px 18px; }
  .auth-modal-actions      { flex-direction: column-reverse; }
  .auth-modal-secondary,
  .auth-modal-primary      { width: 100%; }
}

/* ── Survey Maps — premium map controls (reference palette) ───────────── */
.survey-maps-map-controls {
  --sm-c1: #f9a8d4;
  --sm-c2: #93c5fd;
  --sm-c3: #86efac;
  --sm-c4: #86efac;
  --sm-orange: #ef4444;
  --sm-green: #00c853;
  --sm-cream: #fff8f0;
  --sm-ink: #2c2a26;
  --sm-muted: #8a8175;
  --sm-paper: #faf6ef;
  --sm-line: rgba(44, 42, 38, 0.1);
  --sm-sage: #2979ff;

  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 820;
  width: min(286px, calc(100% - 24px));
  max-height: min(78vh, 640px);
  overflow: visible;
  padding: 14px 14px 16px;
  border: 1px solid var(--sm-line);
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(255, 252, 247, 0.97) 0%, rgba(247, 237, 226, 0.94) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 16px 36px rgba(44, 42, 38, 0.14);
  pointer-events: auto;
  backdrop-filter: blur(12px);
  color: var(--sm-ink);
}

.survey-maps-map-controls[hidden] {
  display: none !important;
}

.survey-maps-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.survey-maps-map-kicker[hidden],
.survey-maps-map-hint[hidden],
.survey-maps-map-search-note {
  display: none !important;
}

.survey-maps-map-kicker {
  color: var(--sm-sage);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.survey-maps-map-title {
  color: var(--sm-ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.survey-maps-map-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--sm-c1) 0 33.33%,
    var(--sm-c2) 33.33% 66.66%,
    var(--sm-c3) 66.66% 100%
  );
}

.survey-maps-map-stats {
  color: var(--sm-muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  line-height: 1.35;
  padding-top: 2px;
}

.survey-maps-map-stats span {
  color: #ef4444;
  font-weight: 760;
}

.survey-maps-map-crumb {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
}

.survey-maps-map-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  padding: 6px 11px;
  border: 1px solid var(--sm-line);
  border-radius: 999px;
  background: #fffefb;
  color: var(--sm-ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.survey-maps-map-back:hover {
  background: var(--sm-cream);
  border-color: rgba(98, 163, 109, 0.4);
}

.survey-maps-map-back[hidden] {
  display: none !important;
}

.survey-maps-map-fields,
.survey-maps-map-search {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.survey-maps-map-section-label {
  color: var(--sm-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.survey-maps-map-search-note {
  margin: -2px 0 0;
  color: var(--sm-muted);
  font-size: 10px;
  line-height: 1.3;
}

.survey-maps-map-divider {
  height: 1px;
  margin: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(44, 42, 38, 0.14), transparent);
}

.survey-maps-map-search {
  position: relative;
  margin-top: 0;
  padding-top: 0;
}

.survey-maps-color-toggles {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(44, 42, 38, 0.08);
}

.survey-maps-color-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  color: var(--sm-ink, #2c2a26);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
}

.survey-maps-color-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.survey-maps-color-toggle-ui {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: rgba(44, 42, 38, 0.18);
  box-shadow: inset 0 0 0 1px rgba(44, 42, 38, 0.08);
  transition: background 0.15s ease;
}

.survey-maps-color-toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.survey-maps-color-toggle input:checked + .survey-maps-color-toggle-ui {
  background: #0f766e;
}

.survey-maps-color-toggle input:checked + .survey-maps-color-toggle-ui::after {
  transform: translateX(12px);
}

.survey-maps-color-toggle input:focus-visible + .survey-maps-color-toggle-ui {
  box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.28);
}

.survey-maps-color-toggle-text {
  flex: 1 1 auto;
  min-width: 0;
}

.survey-maps-color-legend {
  --sm-legend-green: #22c55e;
  --sm-legend-red: #ef4444;
  --sm-legend-orange: #f97316;
  margin-top: 8px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(44, 42, 38, 0.1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.survey-maps-color-legend[hidden],
.survey-maps-color-legend-panel[hidden] {
  display: none !important;
}

.survey-maps-color-legend > .survey-maps-map-section-label {
  margin-bottom: 7px;
}

.survey-maps-color-legend-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.survey-maps-color-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  column-gap: 8px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.survey-maps-color-swatch {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.survey-maps-color-swatch--green {
  background-color: var(--sm-legend-green);
}

.survey-maps-color-swatch--red {
  background-color: var(--sm-legend-red);
}

.survey-maps-color-swatch--orange {
  background-color: var(--sm-legend-orange);
}

.survey-maps-color-legend-label {
  color: var(--sm-ink, #2c2a26);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.survey-maps-map-control {
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  min-height: 28px;
  height: 28px;
  border: 1px solid rgba(44, 42, 38, 0.14);
  border-radius: 7px;
  background: #fff;
  color: var(--sm-ink);
  font-size: 12px;
  line-height: 1.2;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.survey-maps-map-control:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.2);
}

.survey-maps-map-control:disabled {
  background: rgba(247, 237, 226, 0.55);
  color: #b0a89c;
  cursor: not-allowed;
}

.survey-maps-map-results {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid rgba(44, 42, 38, 0.16);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

.survey-maps-map-results[hidden] {
  display: none !important;
}

.survey-maps-map-results li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  color: #111827;
}

.survey-maps-map-results li + li {
  margin-top: 2px;
}

.survey-maps-map-results li:last-child {
  border-bottom: none;
}

.survey-maps-map-results li:hover,
.survey-maps-map-results li.active {
  background: #e8f0ff;
}

.survey-maps-map-results .name {
  display: block;
  color: #0f172a;
  font-weight: 750;
  font-size: 12.5px;
  line-height: 1.25;
}

.survey-maps-map-results .meta {
  display: block;
  margin-top: 2px;
  color: #475569;
  font-size: 11px;
  line-height: 1.3;
}

.survey-maps-map-active {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1),
    rgba(0, 200, 83, 0.08)
  );
  color: #b91c1c;
  font-size: 11px;
  line-height: 1.35;
}

.survey-maps-map-active strong {
  font-weight: 760;
  color: var(--sm-ink);
}

.survey-maps-map-hint {
  margin: 8px 0 0;
  color: var(--sm-muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.leaflet-tooltip.survey-maps-zone-tooltip {
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: rgba(44, 42, 38, 0.92);
  color: var(--sm-cream, #f7ede2);
  font-size: 11px;
  box-shadow: 0 8px 18px rgba(44, 42, 38, 0.28);
}

.leaflet-tooltip.survey-maps-zone-tooltip::before {
  border-top-color: rgba(44, 42, 38, 0.92);
}

.project-zone-label {
  background: transparent !important;
  border: none !important;
}

.project-zone-label-card {
  display: none;
}

.leaflet-tooltip.project-zone-tooltip {
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
}

.leaflet-tooltip.project-zone-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.94);
}

.project-zone-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  padding: 0;
}

.project-zone-popup .leaflet-popup-content {
  margin: 10px 34px 10px 12px;
  line-height: 1.35;
}

.project-zone-popup .leaflet-popup-close-button {
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  color: #64748b;
  font-size: 20px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.project-zone-popup .leaflet-popup-close-button:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.project-zone-name-popup {
  min-width: 120px;
  max-width: 240px;
}

.project-zone-name-popup-text {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  word-break: break-word;
}

.survey-maps-popup {
  min-width: 260px;
  max-width: 400px;
  color: #2c2a26;
}

.survey-maps-popup-title {
  padding: 0.65rem 0.85rem 0.25rem;
  color: #3d6b48;
  font-size: 1rem;
  font-weight: 700;
}

.survey-maps-popup-meta {
  padding: 0 0.85rem 0.45rem;
  color: #8a8175;
  font-size: 0.78rem;
}

.survey-maps-popup-projects {
  margin: 0 0.85rem 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.survey-maps-popup-projects-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.survey-maps-popup-projects-list {
  margin: 0;
  padding-left: 1rem;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.survey-maps-popup-projects-more {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #64748b;
}

.survey-maps-popup-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.65rem;
}

.survey-maps-popup-facts span {
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(98, 163, 109, 0.14);
  color: #3d6b48;
  font-size: 0.7rem;
}

.survey-maps-ror {
  border-top: 1px solid rgba(44, 42, 38, 0.08);
  padding: 0.55rem 0.65rem 0.55rem;
  background: #faf6ef;
}

.survey-maps-ror-title {
  margin-bottom: 0.25rem;
  color: #3d6b48;
  font-size: 0.8rem;
  font-weight: 700;
}

.survey-maps-ror-summary {
  margin: 0 0 0.4rem;
  color: #8a8175;
  font-size: 0.72rem;
}

.survey-maps-ror-empty {
  margin: 0;
  color: #a39a8e;
  font-size: 0.75rem;
}

.survey-maps-ror-table-wrap {
  max-height: 160px;
  overflow: auto;
  border: 1px solid rgba(44, 42, 38, 0.1);
  border-radius: 6px;
  background: #fffefb;
}

.survey-maps-ror-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.survey-maps-ror-table th,
.survey-maps-ror-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(44, 42, 38, 0.06);
  text-align: left;
  vertical-align: top;
}

.survey-maps-ror-table th {
  position: sticky;
  top: 0;
  background: rgba(98, 163, 109, 0.16);
  color: #3d6b48;
  font-weight: 600;
  z-index: 1;
}

.survey-maps-ror-table tr:last-child td {
  border-bottom: none;
}

.survey-maps-ror-survey {
  color: #3d6b48;
  font-weight: 600;
  white-space: nowrap;
}

.survey-maps-ror-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.survey-maps-popup-more {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(44, 42, 38, 0.08);
  background: #fffefb;
}

.survey-maps-more-details-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: #f46d43;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.survey-maps-more-details-btn:hover {
  text-decoration: underline;
}

body.survey-maps-detail-modal-open {
  overflow: hidden;
}

.survey-maps-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
}

.survey-maps-detail-modal[hidden] {
  display: none !important;
}

.survey-maps-detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.survey-maps-detail-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
}

.survey-maps-detail-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.survey-maps-detail-modal-kicker {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.survey-maps-detail-modal-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
}

.survey-maps-detail-modal-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.survey-maps-detail-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.survey-maps-detail-modal-close:hover {
  background: #eef2ff;
}

.survey-maps-detail-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

.survey-maps-detail-modal-scroll::-webkit-scrollbar {
  width: 10px;
}

.survey-maps-detail-modal-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.survey-maps-detail-modal-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.survey-maps-detail-modal-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.survey-maps-detail-modal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.survey-maps-detail-modal-stat {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.survey-maps-detail-modal-stat span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.survey-maps-detail-modal-stat strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  word-break: break-word;
}

.survey-maps-detail-modal-text {
  padding: 16px 20px 24px;
  background: #fff;
}

.survey-maps-detail-text-block {
  padding: 0 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid #e2e8f0;
}

.survey-maps-detail-text-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.survey-maps-detail-text-title {
  margin: 0 0 10px;
  color: #14532d;
  font-size: 15px;
  font-weight: 800;
}

.survey-maps-detail-text-line {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.survey-maps-detail-text-line span {
  color: #64748b;
  font-weight: 700;
}

.survey-maps-detail-modal-empty {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

@media (max-width: 900px) {
  .survey-maps-detail-modal {
    padding: 0;
  }

  .survey-maps-detail-modal-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

.leaflet-popup.survey-maps-popup-wrap .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.leaflet-popup.survey-maps-popup-wrap .leaflet-popup-content {
  margin: 0;
  min-width: 280px;
  max-height: min(70vh, 420px);
  overflow: auto;
}

.survey-maps-number-icon {
  background: transparent !important;
  border: none !important;
}

.survey-maps-number-icon .survey-maps-number-text {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1.5px solid var(--survey-maps-label-color, #f59e0b);
  background: rgba(15, 23, 42, 0.88);
  color: #fff7ed;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.leaflet-tooltip.survey-maps-number-label {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  font-size: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.survey-maps-number-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1.5px solid var(--survey-maps-label-color, #f59e0b);
  background: rgba(15, 23, 42, 0.88);
  color: #fff7ed;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.leaflet-tooltip.survey-maps-tooltip {
  padding: 2px 6px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #111 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
}

@media (max-width: 900px) {
  .survey-maps-map-controls {
    top: 10px;
    right: 10px;
    width: min(260px, calc(100% - 20px));
    padding: 12px;
    max-height: min(70vh, 560px);
  }
}

/* Metro layer (Bangalore-style) */
.leaflet-pane.leaflet-metro-pane { z-index: 700 !important; }
.leaflet-pane.leaflet-metroLabel-pane { z-index: 705 !important; }
/* stage.html sets popup-pane to 650 — must sit above metro lines */
.leaflet-pane.leaflet-popup-pane {
  z-index: 750 !important;
  pointer-events: none;
}
.leaflet-pane.leaflet-popup-pane .leaflet-popup {
  pointer-events: auto;
}

.leaflet-popup.tg-metro-popup .leaflet-popup-content-wrapper {
  background: #fff;
  border-radius: 14px;
  border: none !important;
  padding: 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: none !important;
}

.leaflet-popup.tg-metro-popup .leaflet-popup-content {
  margin: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.leaflet-popup.tg-metro-popup .leaflet-popup-tip {
  background: #fff;
  box-shadow: none;
}

.leaflet-popup.tg-metro-popup .leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
  z-index: 2;
  pointer-events: auto;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
}

.tg-metro-popup-wrap {
  font-family: Inter, system-ui, sans-serif;
  min-width: 220px;
  max-width: 280px;
}

.tg-metro-popup-topbar {
  padding: 11px 28px 9px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.tg-metro-popup-stn-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.tg-metro-popup-body {
  padding: 9px 14px 12px;
}

.tg-metro-popup-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tg-metro-popup-detail {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.7;
}

.tg-metro-popup-ic-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.tg-metro-popup-ic-label {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.tg-metro-popup-ic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tg-metro-popup-ic-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
}

/* ── HMDA Master Plan 2031 overlay ─────────────────────────────────────── */
.tg-hmda-masterplan-opacity {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 810;
  width: 168px;
  max-height: min(58vh, 420px);
  overflow: auto;
  padding: 8px 9px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
}

.tg-hmda-masterplan-opacity[hidden] {
  display: none;
}

.tg-hmda-masterplan-opacity-label {
  margin-bottom: 5px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.55px;
  line-height: 1;
  text-transform: uppercase;
}

.tg-hmda-masterplan-opacity-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tg-hmda-masterplan-opacity-row input {
  flex: 1;
  height: 14px;
  accent-color: #2563eb;
}

.tg-hmda-masterplan-opacity-val {
  min-width: 34px;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

.leaflet-popup.tg-hmda-masterplan-popup .leaflet-popup-content-wrapper {
  background: #fff;
  border-radius: 12px;
  border: none;
  padding: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.leaflet-popup.tg-hmda-masterplan-popup .leaflet-popup-content {
  margin: 0;
}

.leaflet-popup.tg-hmda-masterplan-popup .leaflet-popup-tip {
  background: #fff;
}

.leaflet-popup.tg-hmda-masterplan-popup .leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
}

.tg-hmda-popup {
  min-width: 240px;
  max-width: 300px;
  padding: 14px 16px;
}

.tg-hmda-popup-code-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.tg-hmda-popup-zone {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.tg-hmda-popup-swatch {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  flex-shrink: 0;
}

.tg-hmda-popup-code {
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.tg-hmda-popup-reg {
  margin-top: 8px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.tg-hmda-popup-src {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.45;
}

.tg-hmda-legend {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #e2e8f0;
}

.tg-hmda-legend-title {
  margin-bottom: 5px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.tg-hmda-legend-sec {
  margin: 5px 0 2px;
  color: #64748b;
  font-size: 9px;
  font-weight: 600;
}

.tg-hmda-legend-row {
  display: grid;
  grid-template-columns: 9px 28px 1fr;
  align-items: center;
  gap: 4px;
  margin: 1px 0;
}

.tg-hmda-legend-sw {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.tg-hmda-legend-code {
  color: #0f172a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tg-hmda-legend-lab {
  color: #475569;
  font-size: 9px;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .tg-hmda-masterplan-opacity {
    top: auto;
    bottom: 88px;
    right: 10px;
    width: min(168px, calc(100vw - 80px));
    max-height: 38vh;
  }
}

.tg-hmda-masterplan-pack-status {
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
