@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Roboto+Mono:wght@400;500&display=swap');

/* ===================================================================
   CSS VARIABLES — Google Maps-inspired design system
   =================================================================== */
:root {
  --bg: #09131f;
  --bg-elevated: #0e1b29;
  --card: #0c1724;
  --card-strong: #111f30;
  --card-soft: #132436;
  --border: rgba(136, 177, 215, 0.15);
  --border-strong: rgba(109, 190, 255, 0.3);
  --text: #edf5ff;
  --text-secondary: #9cb3cb;
  --text-muted: #6f849a;
  --primary: #59c7ff;
  --primary-dark: #1499e6;
  --primary-light: rgba(89, 199, 255, 0.14);
  --danger: #ff6b6b;
  --danger-light: rgba(255, 107, 107, 0.12);
  --success: #3dd9a1;
  --success-light: rgba(61, 217, 161, 0.12);
  --warning: #ffbd66;
  --warning-light: rgba(255, 189, 102, 0.14);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-sm: 0 10px 24px rgba(2,7,13,0.24);
  --shadow-md: 0 16px 34px rgba(1,10,19,0.32);
  --shadow-lg: 0 28px 54px rgba(1,8,15,0.42);
  --shadow-xl: 0 40px 84px rgba(0,0,0,0.5);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: 0.2s cubic-bezier(0.22,1,0.36,1);

  --leftW: 360px;
  --satW: 56%;
  --propH: 280px;
}

* { box-sizing: border-box; outline: none; }

html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(89,199,255,0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(61,217,161,0.08), transparent 24%),
    linear-gradient(180deg, #0b1522 0%, #08111b 100%);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(109,190,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109,190,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 92%);
  pointer-events: none;
  z-index: 0;
}

/* ===================================================================
   LAYOUT
   =================================================================== */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#leftPane {
  width: var(--leftW);
  min-width: 280px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15,29,44,0.98), rgba(10,22,34,0.98));
  border-right: 1px solid var(--border);
  z-index: 10;
  height: 100%;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

#mainPane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background:
    radial-gradient(circle at 20% 0%, rgba(89,199,255,0.08), transparent 24%),
    linear-gradient(180deg, #08111b, #06101a);
}

/* ===================================================================
   FALCON HEADER BAR
   =================================================================== */
#falconHeader {
  height: 40px;
  background: #1a73e8;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
}

.falcon-logo {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.falcon-tab {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.falcon-tab.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.falcon-tab:hover:not(.active) { background: rgba(255,255,255,0.12); }

/* ===================================================================
   PANE TITLE
   =================================================================== */
.pane-title {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,31,48,0.96), rgba(12,23,36,0.96));
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #7da6c8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
}

/* ===================================================================
   UPLOAD ROW  (kept for non-Falcon standalone use)
   =================================================================== */
.upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8f9fa;
  flex-shrink: 0;
}

.upload-row input[type="file"] {
  flex: 1;
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 0;
}

/* ===================================================================
   SEARCH / FILTER BAR
   =================================================================== */
#searchBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,16,26,0.92);
  flex-shrink: 0;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(19,36,54,0.9);
  border-radius: var(--radius-full);
  padding: 7px 12px;
  border: 1px solid rgba(109,190,255,0.12);
  transition: border-color var(--transition), background var(--transition);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.search-input-wrap:focus-within {
  background: rgba(19,36,54,0.98);
  border-color: rgba(89,199,255,0.45);
  box-shadow: 0 0 0 3px rgba(89,199,255,0.12);
}

.search-input-wrap svg { color: var(--text-secondary); flex-shrink: 0; }

.search-input-wrap input {
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}

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

.filter-btn {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(109,190,255,0.14);
  background: rgba(19,36,54,0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #b5cde5;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-btn:hover { background: rgba(22,42,62,0.98); border-color: rgba(89,199,255,0.4); color: var(--text); }

.sort-indicator {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(109,190,255,0.12);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #84b5d9;
  opacity: 0.9;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sort-indicator:hover {
  color: #dff5ff;
  border-color: rgba(89,199,255,0.24);
  background: rgba(18,34,50,0.78);
}

/* ===================================================================
   PROPERTY LIST — shrinks to fit content, street view fills remainder
   =================================================================== */
#propPane {
  /* Auto height: shrinks to fit list content */
 height: var(--propH);   /* uses the 280px CSS variable like old UI */
  min-height: 100px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#prop-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;     /* allows flex child to shrink below content size */
  scrollbar-width: thin;
  scrollbar-color: rgba(89,199,255,0.28) transparent;
  padding: 10px;
  background: linear-gradient(180deg, rgba(7,14,22,0.7), rgba(10,21,33,0.84));
}

#prop-list::-webkit-scrollbar { width: 4px; }
#prop-list::-webkit-scrollbar-track { background: transparent; }
#prop-list::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }

.prop-item {
  padding: 10px 12px;
  border: 1px solid rgba(136,177,215,0.1);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18,33,49,0.92), rgba(13,24,37,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.prop-item:hover {
  background: linear-gradient(180deg, rgba(22,40,58,0.96), rgba(16,29,43,0.96));
  border-left-color: rgba(89,199,255,0.55);
  border-color: rgba(89,199,255,0.22);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2,10,18,0.26);
}

.prop-item.active {
  background: linear-gradient(180deg, rgba(13,37,59,0.98), rgba(12,26,40,0.98));
  border-left: 3px solid var(--primary);
  border-color: rgba(89,199,255,0.35);
  box-shadow: 0 18px 34px rgba(5,17,29,0.35), inset 0 0 0 1px rgba(89,199,255,0.12);
}

.prop-item.active .prop-line1 { color: #dff5ff; }

.prop-pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(0,0,0,0.24);
}

.prop-item.active .prop-pin-badge { background: var(--danger); }
.prop-pin-badge-inner { transform: rotate(45deg); }
.prop-text { flex: 1; min-width: 0; }

.prop-line1-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.prop-line1 {
  font-weight: 600;
  font-size: 12px;
  color: #edf5ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.prop-line2 {
  color: #86a2bd;
  font-size: 10px;
  font-family: 'Roboto Mono', monospace;
}

.prop-tiv-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(89,199,255,0.2);
  background: rgba(89,199,255,0.1);
  color: #9ee6ff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.prop-item.active .prop-tiv-chip {
  border-color: rgba(123,219,255,0.32);
  background: rgba(89,199,255,0.14);
  color: #dff7ff;
}

.prop-meta-row { display: none; }

.prop-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.06);
}

.prop-meta-geo {
  background: rgba(89,199,255,0.1);
  color: #8fdcff;
}

.prop-meta-status {
  background: rgba(61,217,161,0.1);
  color: #8fe7c7;
}

.prop-meta-id {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: #7e96ad;
  margin-left: auto;
}

@keyframes activeCardGlow {
  0%, 100% { box-shadow: 0 18px 34px rgba(5,17,29,0.35), inset 0 0 0 1px rgba(89,199,255,0.12); }
  50% { box-shadow: 0 22px 40px rgba(8,26,40,0.42), inset 0 0 0 1px rgba(129,221,255,0.2); }
}

/* prop-line3 removed — lat/lng shown only in detail panel */

/* ===================================================================
   STREET PANE — scrollable, fills remaining left-panel space
   =================================================================== */
#streetPane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(89,199,255,0.25) transparent;
  background: linear-gradient(180deg, rgba(7,14,22,0.76), rgba(10,22,34,0.88));
}

#streetPane::-webkit-scrollbar { width: 4px; }
#streetPane::-webkit-scrollbar-track { background: transparent; }
#streetPane::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }

#streetPane > .pane-title {
  background: linear-gradient(90deg, rgba(17,31,48,0.98), rgba(10,22,34,0.96));
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ===================================================================
   LOCATION DETAIL CARD  (legacy — kept for compatibility)
   =================================================================== */
#locationDetailCard {
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  max-height: 0;
}

#locationDetailCard.visible { max-height: 400px; }

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
}

.detail-card-title {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-card-title .loc-id-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.detail-card-close {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  cursor: pointer; border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.detail-card-close:hover { background: #f1f3f4; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.detail-field {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.detail-field:nth-child(even) { border-right: none; }
.detail-field:nth-last-child(-n+2) { border-bottom: none; }

.detail-field-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #9aa0a6;
  margin-bottom: 3px;
}

.detail-field-value {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.detail-field-value.coords {
  font-family: 'Roboto Mono', monospace;
  font-size: 11.5px;
  color: var(--primary);
  background: #f0f4ff;
  border-radius: 4px;
  padding: 2px 5px;
  display: inline-block;
}

.detail-field-value.coords.updated { animation: coordFlash 0.6s ease; }

@keyframes coordFlash {
  0%  { background: #fef3c7; }
  100%{ background: #f0f4ff; }
}

/* ===================================================================
   STREET FRAME
   =================================================================== */
.street-frame {
  flex-shrink: 0;
  height: 240px;
  min-height: 180px;
  position: relative;
  background:
    radial-gradient(circle at top, rgba(89,199,255,0.12), transparent 36%),
    linear-gradient(180deg, #061018, #0a1824);
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.street-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.street-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.4), transparent 28%),
    linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.18)),
    repeating-linear-gradient(180deg, rgba(89,199,255,0.05) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.street-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  gap: 10px;
}

.street-empty svg { opacity: 0.3; }

/* ===================================================================
   CONTROLS
   =================================================================== */
.controls {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12,23,36,0.96), rgba(9,18,28,0.96));
  flex-shrink: 0;
  overflow: visible;
  max-height: none;
}

.control-row {
  display: flex;
  align-items: center;
  margin-bottom: 7px;
}
.control-row:last-child { margin-bottom: 0; }

.control-row label {
  width: 72px;
  color: #8ea7c1;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.control-row input[type="range"] {
  flex: 1; margin: 0 8px;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(89,199,255,0.16), 0 0 18px rgba(89,199,255,0.3);
  transition: transform 0.1s;
}

.control-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.val {
  width: 28px;
  text-align: right;
  color: #d6ecff;
  font-size: 11px;
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
}

/* ===================================================================
   TOP BANNER
   =================================================================== */
#topBanner {
  min-height: 56px;
  padding: 8px 104px 8px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,24,37,0.98), rgba(8,17,27,0.98));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.banner-left, .banner-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  flex-shrink: 0;
}

.banner-right {
  margin-left: auto;
  padding-left: 12px;
}

#topBanner.measure-open {
  min-height: 94px;
  align-items: stretch;
  flex-wrap: wrap;
  overflow: visible;
}

#topBanner.measure-open .banner-left,
#topBanner.measure-open .banner-right {
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

#topBanner.measure-open .banner-right {
  margin-left: 0;
  padding-left: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(109,190,255,0.12);
}

.banner-sep {
  width: 1px; height: 18px;
  background: rgba(109,190,255,0.14);
  margin: 0 4px;
  flex-shrink: 0;
}

.banner-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(17,31,48,0.92);
  padding: 6px 10px 6px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(109,190,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.banner-item input[type="range"] {
  width: 80px; margin: 0;
  -webkit-appearance: none; appearance: none;
  height: 3px; background: rgba(255,255,255,0.14); border-radius: 2px;
}

.banner-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--primary); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(89,199,255,0.14);
}

.pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #79cfff;
  background: rgba(89,199,255,0.1);
  padding: 4px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(89,199,255,0.16);
}

.lbl {
  font-weight: 600;
  color: #9ab4cf;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Top banner buttons */
.tbn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(109,190,255,0.16);
  background: rgba(17,31,48,0.92);
  color: #bad2e8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  height: 32px;
  line-height: 1;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.tbn-btn:hover { background: rgba(23,42,62,0.98); border-color: rgba(89,199,255,0.4); color: var(--text); }
.tbn-btn:active { transform: translateY(1px); }
.tbn-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tbn-btn.active {
  background: linear-gradient(180deg, rgba(39,149,211,0.95), rgba(15,118,176,0.95));
  color: #fff;
  border-color: rgba(137,227,255,0.46);
  box-shadow: 0 10px 18px rgba(8,57,83,0.3);
}

.tbn-btn-success {
  background: linear-gradient(180deg, rgba(31,174,126,0.96), rgba(20,136,98,0.96));
  color: #fff;
  border-color: rgba(61,217,161,0.4);
}
.tbn-btn-success:hover { background: linear-gradient(180deg, rgba(45,196,144,0.96), rgba(24,150,108,0.96)); border-color: rgba(61,217,161,0.55); color: #fff; }

/* Toggle Switch */
.map-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgba(17,31,48,0.92);
  border: 1px solid rgba(109,190,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.map-toggle-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #a6c1d8;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #128acf;
  transition: var(--transition);
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

input:checked + .toggle-slider { background-color: #20b47d; }
input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ===================================================================
   MAP LABEL CHIP
   =================================================================== */
.map-label-chip {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 10;
  background: rgba(6,16,24,0.84);
  border: 1px solid rgba(109,190,255,0.18);
  border-radius: var(--radius-full);
  padding: 5px 10px 5px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #dceeff;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-sat  { background: #4285f4; }
.dot-road { background: #34a853; }

/* ===================================================================
   MAP FRAME
   =================================================================== */
.map-frame {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at top, rgba(89,199,255,0.16), transparent 34%), linear-gradient(180deg, #0b1724, #08121c);
  overflow: hidden;
  border: 1px solid rgba(109,190,255,0.14);
  border-radius: 20px;
  margin: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 36px rgba(2,10,18,0.28);
}

.map-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(109,190,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(109,190,255,0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
  z-index: 1;
}

.map-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 -80px 120px rgba(0,0,0,0.18);
  pointer-events: none;
  z-index: 2;
}

.map-frame img {
  width: 100%; height: 100%;
  object-fit: fill;  /* fill ensures exact pixel alignment with overlay projection */
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  border-radius: inherit;
}

.map-frame canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  z-index: 5;
  border-radius: inherit;
}

.map-frame canvas:active { cursor: grabbing; }

/* ===================================================================
   MAPS ROW
   =================================================================== */
#mapsRow {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  padding: 8px;
}

.mapbox {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
}

.mapbox.is-visible-map {
  opacity: 1;
}

.mapbox.is-primary-map .map-frame {
  border-color: rgba(109,190,255,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 24px 42px rgba(4,16,28,0.34), 0 0 0 1px rgba(89,199,255,0.08);
}

#satBox  { width: var(--satW); min-width: 200px; }
#roadBox { flex: 1; min-width: 200px; }

.mapbox.fullscreen {
  position: absolute !important;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100% !important;
  min-width: unset !important;
  z-index: 50;
}

.mapbox.hidden { display: none !important; }

/* ===================================================================
   HOVER TOOLTIP
   =================================================================== */
.map-hover-tooltip {
  position: fixed;
  z-index: 99990;
  background: #202124;
  color: #fff;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 11.5px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.15);
  min-width: 180px;
  max-width: 260px;
  line-height: 1.55;
  animation: tooltipIn 0.14s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(255,255,255,0.08);
}

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

.map-hover-tooltip .tt-id {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 3px;
  color: #8ab4f8;
}

.map-hover-tooltip .tt-row {
  display: flex;
  gap: 4px;
  color: rgba(255,255,255,0.8);
  font-size: 11px;
}

.map-hover-tooltip .tt-label {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  flex-shrink: 0;
  width: 44px;
}

.tt-hint {
  margin-top: 5px;
  font-size: 10px;
  color: #8ab4f8;
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 4px;
}

/* ===================================================================
   ADDRESS POPUP
   =================================================================== */
.address-popup {
  position: absolute;
  z-index: 100;
  background: linear-gradient(180deg, rgba(12,21,32,0.96), rgba(8,15,24,0.96));
  border-radius: 18px;
  box-shadow: 0 20px 38px rgba(0,0,0,0.34), 0 0 0 1px rgba(109,190,255,0.1);
  min-width: 250px;
  max-width: 320px;
  pointer-events: all;
  animation: popupIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
  border: 1px solid rgba(109,190,255,0.14);
}

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.88) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(109,190,255,0.08);
  background: linear-gradient(180deg, rgba(17,31,48,0.96), rgba(12,22,34,0.96));
  padding-right: 32px;
}

.popup-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #eef7ff;
  margin-bottom: 2px;
  line-height: 1.3;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.popup-coords {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 0.3px;
}

.popup-body { padding: 8px 14px 10px; }

.popup-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
  color: #a7c0d7;
  line-height: 1.4;
}

.popup-row:last-child { margin-bottom: 0; }

.popup-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid rgba(109,190,255,0.08);
}

.popup-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(109,190,255,0.14);
  background: rgba(19,36,54,0.92);
  color: #7fd4ff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.popup-action-btn:hover { background: rgba(24,46,68,0.98); border-color: rgba(89,199,255,0.34); color: #dff4ff; }

.popup-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255,255,255,0.05);
  cursor: pointer; border-radius: 50%;
  color: #9eb8cf;
  transition: background var(--transition);
}

.popup-close:hover { background: rgba(255,255,255,0.12); color: #eef7ff; }

/* ===================================================================
   ZOOM CONTROLS
   =================================================================== */
.zoom-controls {
  position: absolute;
  bottom: 58px; right: 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(109,190,255,0.18);
}

.zoom-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,18,29,0.92);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  color: #dbf0ff;
  transition: background var(--transition);
  line-height: 1;
}

.zoom-btn:hover { background: rgba(17,34,49,0.98); color: var(--primary); }
.zoom-btn:first-child { border-bottom: 1px solid rgba(109,190,255,0.14); }

/* ===================================================================
   SCALE BAR
   =================================================================== */
.scale-bar {
  position: absolute;
  bottom: 22px; right: 68px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}

.scale-line {
  height: 2px; width: 60px;
  background: rgba(220,238,255,0.68);
  border: 1px solid rgba(89,199,255,0.24);
  border-top: none;
}

.scale-text {
  font-size: 9px;
  color: #d8efff;
  background: rgba(8,18,29,0.8);
  padding: 3px 6px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(109,190,255,0.14);
}

.map-status-strip { display: none !important; }

.map-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.map-status-kicker,
.map-status-sync {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.map-status-kicker {
  color: #8dbde6;
}

.map-status-sync {
  color: #8df0c9;
}

.map-status-sync.off {
  color: #f2b96d;
}

.map-status-focus {
  color: #f4fbff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-status-meta {
  margin-top: 3px;
  color: #8da7bf;
  font-size: 9px;
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes hudSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================================
   DRAG CONFIRM TOAST
   =================================================================== */
#dragConfirmToast { display: none !important; }


.toast-msg { flex: 1; }
.toast-coords {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  color: #8ab4f8;
}
.toast-actions { display: flex; gap: 8px; }

.toast-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.toast-btn-save { background: var(--primary); color: #fff; }
.toast-btn-save:hover { background: var(--primary-dark); }
.toast-btn-cancel { background: rgba(255,255,255,0.12); color: #fff; }
.toast-btn-cancel:hover { background: rgba(255,255,255,0.2); }

/* ===================================================================
   UNSAVED CHANGES MODAL
   =================================================================== */
#unsavedChangesModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
}

#unsavedChangesModal.visible {
  display: flex;
}

#unsavedChangesModal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at center, rgba(89,199,255,0.08), transparent 34%),
    rgba(2, 8, 14, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#unsavedChangesModal .modal-content {
  background: linear-gradient(180deg, rgba(12,21,32,0.98), rgba(8,15,23,0.98));
  border: 1px solid rgba(109,190,255,0.18);
  border-radius: 24px;
  box-shadow: 0 34px 72px rgba(0,0,0,0.46), 0 0 0 1px rgba(89,199,255,0.05);
  max-width: 520px;
  width: 90%;
  padding: 28px 30px;
  animation: modalSlideIn 0.28s cubic-bezier(0.22,1,0.36,1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#unsavedChangesModal .modal-header {
  font-size: 16px;
  font-weight: 700;
  color: #eef7ff;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

#unsavedChangesModal .modal-body {
  font-size: 14px;
  color: #a9bfd5;
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 420px;
}

#unsavedChangesModal .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#unsavedChangesModal .modal-btn {
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.03em;
}

#unsavedChangesModal .modal-btn-save {
  background: linear-gradient(180deg, rgba(62,171,230,0.98), rgba(25,137,201,0.98));
  color: #fff;
  box-shadow: 0 14px 24px rgba(10,74,107,0.26);
}

#unsavedChangesModal .modal-btn-save:hover {
  background: linear-gradient(180deg, rgba(82,186,241,0.98), rgba(32,148,214,0.98));
  transform: translateY(-1px);
}

#unsavedChangesModal .modal-btn-discard {
  background: linear-gradient(180deg, rgba(233,74,92,0.98), rgba(206,49,68,0.98));
  color: #fff;
  box-shadow: 0 14px 24px rgba(85,18,28,0.22);
}

#unsavedChangesModal .modal-btn-discard:hover {
  background: linear-gradient(180deg, rgba(242,92,109,0.98), rgba(219,60,79,0.98));
  transform: translateY(-1px);
}

#unsavedChangesModal .modal-btn-cancel {
  background: rgba(255,255,255,0.08);
  color: #edf5ff;
  border: 1px solid rgba(255,255,255,0.08);
}

#unsavedChangesModal .modal-btn-cancel:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

/* ===================================================================
   RESIZERS
   =================================================================== */
.h-resizer {
  height: 5px;
  background: #f1f3f4;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: row-resize;
  flex-shrink: 0;
  transition: background var(--transition);
}
.h-resizer:hover { background: #e8eaed; }

.v-resizer {
  width: 5px;
  background: #f1f3f4;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  z-index: 20;
}
.v-resizer:hover { background: #dadce0; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  height: 32px;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  font-family: inherit;
}

.btn:hover { background: #f8f9fa; border-color: #bdc1c6; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #d93025; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm { padding: 4px 10px; height: 26px; font-size: 11px; }

.chk {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: #a9c3da;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer; user-select: none;
  padding: 0 2px;
}
.chk input[type="checkbox"] { accent-color: var(--primary); width: 14px; height: 14px; }

/* ===================================================================
   OFFLINE BADGE
   =================================================================== */
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===================================================================
   PDF OVERLAY
   =================================================================== */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,18,28,0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-box {
  background: linear-gradient(180deg, rgba(13,24,37,0.98), rgba(9,18,28,0.98));
  padding: 28px 44px;
  border-radius: 22px;
  box-shadow: 0 28px 54px rgba(0,0,0,0.34);
  text-align: center;
  border: 1px solid rgba(109,190,255,0.16);
  min-width: 300px;
}

.pdf-text {
  font-size: 14px; font-weight: 500; color: var(--text); margin-top: 12px;
}

#pdfMsg {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #eef7ff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.pdf-spinner {
  width: 32px; height: 32px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===================================================================
   STATUS BADGE
   =================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-badge.active   { background: var(--success-light); color: #137333; }
.status-badge.inactive { background: #f1f3f4; color: var(--text-secondary); }
.status-badge.pending  { background: var(--warning-light); color: #92400e; }

/* ===================================================================
   SCROLLBAR GLOBAL
   =================================================================== */
.controls::-webkit-scrollbar { width: 4px; }
.controls::-webkit-scrollbar-track { background: transparent; }
.controls::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }

/* ===================================================================
   SCROLL HINT
   =================================================================== */
#streetScrollHint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  z-index: 200;
  background: #202124ee;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}
#streetScrollHint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   LOCATION DETAIL PANEL
   =================================================================== */
#locationDetailPanel {
  position: absolute;
  top: 54px;
  right: 10px;
  width: 274px;
  height: auto;
  max-height: calc(100% - 66px);
  background: linear-gradient(180deg, rgba(10,20,31,0.96), rgba(7,15,24,0.96));
  border: 1px solid rgba(109,190,255,0.18);
  box-shadow: 0 28px 54px rgba(0,0,0,0.36);
  border-radius: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}

#locationDetailPanel.open { 
  transform: translateX(0); 
}

#locationDetailPanel.dirty {
  border-color: rgba(255,189,102,0.32);
  box-shadow: 0 28px 54px rgba(0,0,0,0.36), 0 0 0 1px rgba(255,189,102,0.08);
}

#locationDetailPanel.dragging {
  box-shadow: 0 24px 50px rgba(0,0,0,0.42), 0 0 0 1px rgba(89,199,255,0.22);
  border: 1px solid rgba(89,199,255,0.4);
  transition: none;
  user-select: none;
}

.ldp-drag-icon {
  opacity: 0.6;
  margin-right: 4px;
  flex-shrink: 0;
  transition: opacity 0.2s;
  color: #fff;
}

.ldp-header:hover .ldp-drag-icon {
  opacity: 1;
}

.ldp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: linear-gradient(135deg, rgba(17,61,94,0.94), rgba(9,25,39,0.94));
  flex-shrink: 0;
  cursor: move;
  cursor: grab;
  user-select: none;
}

.ldp-header:active {
  cursor: grabbing;
}

.ldp-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#locationDetailPanel.open .ldp-header,
#locationDetailPanel.open .ldp-section,
#locationDetailPanel.open .ldp-footer {
  animation: panelSectionRise 0.28s cubic-bezier(0.22,1,0.36,1);
}

.ldp-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ldp-badge {
  background: rgba(89,199,255,0.18);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid rgba(164,230,255,0.4);
}

.ldp-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ldp-subtitle { display: none; }

.ldp-close {
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer !important;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.ldp-close:hover { background: rgba(255,255,255,0.18); }

.ldp-geo-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(9,18,29,0.88);
  border-bottom: 1px solid rgba(109,190,255,0.1);
  flex-shrink: 0;
}

.ldp-summary-row { display: none; }

.ldp-summary-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15,31,47,0.96);
  border: 1px solid rgba(109,190,255,0.12);
  color: #cae4fa;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ldp-geo-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 9px;
  text-transform: uppercase;
}

/* ===================================================================
   EXTENT GUIDE TOOLTIP
   =================================================================== */
.extent-guide-tooltip {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.97) 0%, rgba(13, 71, 161, 0.97) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 420px;
  pointer-events: auto;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
}

.extent-guide-tooltip.visible {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.extent-guide-tooltip.dismissed {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px) scale(0.95);
  pointer-events: none;
}

.extent-tooltip-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.extent-tooltip-content svg:first-child {
  margin-top: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.extent-tooltip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extent-tooltip-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.extent-tooltip-desc {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.92;
  font-weight: 400;
}

.extent-tooltip-close {
  position: absolute;
  top: -4px;
  right: -6px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: #ffffff;
}

.extent-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.extent-tooltip-close:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .extent-guide-tooltip {
    max-width: 90%;
    padding: 14px 16px;
    top: 12px;
  }
  
  .extent-tooltip-title {
    font-size: 13px;
  }
  
  .extent-tooltip-desc {
    font-size: 11px;
  }
}

.geo-rooftop { background: #d1fae5; color: #065f46; }
.geo-approx  { background: #fef3c7; color: #92400e; }
.geo-range   { background: #ffedd5; color: #9a3412; }
.geo-user    { background: #f3e8ff; color: #6b21a8; }
.geo-other   { background: #e0e7ff; color: #3730a3; }

.ldp-geo-label {
  font-size: 10px;
  color: #89a5c0;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ldp-body {
  overflow-y: auto;
  max-height: 460px;
  scrollbar-width: thin;
  scrollbar-color: rgba(89,199,255,0.24) transparent;
}
.ldp-body::-webkit-scrollbar { width: 4px; }
.ldp-body::-webkit-scrollbar-thumb { background: rgba(89,199,255,0.22); border-radius: 2px; }

.ldp-section {
  padding: 6px 12px 2px;
  border-bottom: 1px solid rgba(109,190,255,0.08);
}
.ldp-section:last-child { border-bottom: none; }

.ldp-section-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #78a8ca;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ldp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  min-height: 28px;
  gap: 6px;
}
.ldp-row:last-child { border-bottom: none; }

.editable-row {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  border-radius: 8px;
  padding-left: 4px;
  padding-right: 4px;
}

.editable-row.changed {
  background: rgba(255,189,102,0.045);
  box-shadow: inset 0 0 0 1px rgba(255,189,102,0.1);
  transform: translateX(1px);
}

.ldp-label {
  font-size: 11px;
  color: #9bb4cd;
  font-weight: 500;
  flex-shrink: 0;
  width: 92px;
}

.ldp-value {
  font-size: 11px;
  color: #edf5ff;
  font-weight: 500;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

.ldp-coord {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 10.5px;
  color: #7bd6ff;
}

.ldp-coord.updated { animation: ldpCoordFlash 0.8s ease; }

@keyframes ldpCoordFlash {
  0%   { color: #34a853; }
  60%  { color: #34a853; }
  100% { color: #1a73e8; }
}

.ldp-input {
  font-size: 11px;
  color: #edf5ff;
  font-weight: 500;
  border: 1px solid rgba(109,190,255,0.14);
  border-radius: 10px;
  padding: 5px 8px;
  width: 108px;
  text-align: right;
  background: rgba(19,36,54,0.88);
  transition: border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
}
.ldp-input:focus {
  outline: none;
  border-color: rgba(89,199,255,0.48);
  background: rgba(20,39,58,0.96);
  box-shadow: 0 0 0 3px rgba(89,199,255,0.12);
}
.ldp-input:hover:not(:focus) { border-color: rgba(89,199,255,0.24); background: rgba(20,39,58,0.92); }

.ldp-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239bb4cd' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 6px center;
  padding-left: 20px;
  padding-right: 6px;
  cursor: pointer;
}

.ldp-footer {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(109,190,255,0.08);
  background: linear-gradient(180deg, rgba(8,17,27,0.92), rgba(7,14,22,0.98));
  flex-shrink: 0;
}

.ldp-save-btn {
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(39,149,211,0.98), rgba(15,118,176,0.98));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 16px 26px rgba(4,39,61,0.28);
}
.ldp-save-btn:disabled {
  cursor: default;
  background: linear-gradient(180deg, rgba(24,47,69,0.84), rgba(17,35,52,0.84));
  color: #7f9ab3;
  box-shadow: none;
  opacity: 0.9;
}
.ldp-save-btn:disabled:hover {
  background: linear-gradient(180deg, rgba(24,47,69,0.84), rgba(17,35,52,0.84));
  box-shadow: none;
}
.ldp-save-btn:hover  { background: linear-gradient(180deg, rgba(62,171,230,0.98), rgba(21,131,192,0.98)); box-shadow: 0 18px 28px rgba(4,39,61,0.34); }
.ldp-save-btn:active { transform: scale(0.98); }
.ldp-save-btn.saved  { background: #34a853; pointer-events: none; }
.ldp-save-btn.ready  { box-shadow: 0 16px 26px rgba(12,76,110,0.3), 0 0 0 1px rgba(137,227,255,0.08); animation: saveReadyPulse 2.4s ease-in-out infinite; }

@keyframes panelSectionRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes saveReadyPulse {
  0%, 100% { box-shadow: 0 16px 26px rgba(12,76,110,0.28), 0 0 0 1px rgba(137,227,255,0.08); }
  50% { box-shadow: 0 19px 30px rgba(14,92,132,0.34), 0 0 0 1px rgba(173,237,255,0.12); }
}

@media (max-width: 1100px) {
  #topBanner {
    padding: 8px 10px;
  }

  .map-frame {
    margin: 6px;
    border-radius: 16px;
  }
}

/* ===================================================================
   COB (Class of Business) — expandable read-only row in detail panel
   =================================================================== */
.ldp-cob-row {
  display: flex;
  align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px solid #f9fafb;
  gap: 6px;
  min-height: 26px;
}

.ldp-cob-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ldp-cob-text {
  font-size: 11px;
  color: #111827;
  font-weight: 500;
  text-align: right;
  line-height: 1.4;
  word-break: break-word;
}

.ldp-cob-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 10px;
  color: #1a73e8;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-end;
}

.ldp-cob-toggle:hover { color: #1557b0; }
