:root {
  --bg-dark: #090d16;
  --bg-panel: rgba(15, 23, 42, 0.88);
  --bg-card: rgba(30, 41, 59, 0.7);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body.god-view-layout {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* 100% Viewport Map Canvas */
#map {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #090d16;
}

/* ==============================================================================
   Top Floating Command Bar
   ============================================================================== */
.top-command-bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  height: 56px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  min-width: 180px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.brand-tag {
  font-size: 10px;
  color: #93c5fd;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Bar Container (Defect 3: Positioned dead-center so loading bar never shifts search bar) */
.search-bar-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  max-width: calc(100vw - 520px);
  z-index: 1010;
  margin: 0;
}

/* ==============================================================================
   Defect 5: Task Progress & Countdown Loading Bar (Fixed slot right of search bar)
   ============================================================================== */
.task-progress-container {
  position: absolute;
  left: calc(50% + 225px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 200px;
  max-width: 260px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px rgba(59, 130, 246, 0.25);
  animation: fadeIn 0.2s ease-out;
  z-index: 1010;
}

.task-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-desc {
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}

.task-progress-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-percent {
  font-size: 11px;
  font-weight: 800;
  color: #60a5fa;
  min-width: 28px;
  text-align: right;
}

.task-timer {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.task-progress-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.task-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 0.15s ease-out;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.search-input-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 6px 4px 10px;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-box:focus-within {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.search-icon {
  font-size: 13px;
  opacity: 0.7;
}

#global-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 13px;
  width: 100%;
  padding: 4px 2px;
  font-family: inherit;
}

#global-search-input::placeholder {
  color: #64748b;
  font-size: 12px;
}

.search-action-btn {
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  padding: 5px 12px;
  transition: all 0.15s ease;
}

.search-clear-btn {
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  padding: 2px 6px;
}

.search-clear-btn:hover {
  color: #f87171;
}

.search-run-btn {
  background: #3b82f6;
  color: #ffffff;
  white-space: nowrap;
}

.search-run-btn:hover {
  background: #2563eb;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Search History Popover */
.search-history-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 1050;
  padding: 8px;
  animation: fadeIn 0.15s ease-out;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.history-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.history-clear-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.history-clear-btn:hover {
  color: #ef4444;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.history-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.history-item-text {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-remove {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

.history-item-remove:hover {
  color: #ef4444;
}

.history-empty {
  font-size: 11px;
  color: #64748b;
  padding: 8px;
  text-align: center;
  font-style: italic;
}

/* Autocomplete Suggestion Items (TASK-010) */
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.autocomplete-item:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateX(2px);
}

.autocomplete-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.autocomplete-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  flex: 1;
}

.autocomplete-title {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-subtitle {
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Geocode Center Marker Pulse Pin */
.geocode-center-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.geocode-center-dot {
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border: 2px solid #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 5px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
  z-index: 2;
}

.geocode-center-pulse {
  width: 24px;
  height: 24px;
  background: rgba(59, 130, 246, 0.4);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: geocodePulse 1.8s infinite ease-out;
  z-index: 1;
}

@keyframes geocodePulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Geocode Pin Action Popup */
.geocode-popup-inner {
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  min-width: 200px;
  padding: 2px;
}

.geocode-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.geocode-popup-sub {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 8px;
}

.geocode-buffer-tools {
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
  margin-top: 4px;
}

.geocode-buffer-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.geocode-btn-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.buffer-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.buffer-btn:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.buffer-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.buffer-btn-clear {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.buffer-btn-clear:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.icon-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-toggle-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.zoom-indicator {
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ==============================================================================
   Top Floating Basemap Drawer
   ============================================================================== */
/* ==============================================================================
   Top Floating Basemap Drawer (Defect 1: No Overlap)
   ============================================================================== */
.basemap-floating-drawer,
.basemap-selector-widget {
  position: absolute;
  top: 76px;
  right: 16px;
  z-index: 1050;
  animation: fadeIn 0.2s ease-out;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When right drawer is open, smoothly offset basemap drawer so it never overlaps right panel */
body:has(#right-drawer:not(.collapsed)) .basemap-floating-drawer,
body:has(#right-drawer:not(.collapsed)) .basemap-selector-widget {
  right: 432px;
}

.basemap-drawer-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.basemap-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.basemap-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.basemap-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.basemap-icon {
  font-size: 14px;
  line-height: 1;
}

/* ==============================================================================
   Floating Sliding Drawers (Left Layers & Right Results)
   ============================================================================== */
.floating-drawer {
  position: absolute;
  top: 76px;
  bottom: 16px;
  z-index: 900;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Left Drawer */
.left-drawer {
  left: 16px;
  width: 360px;
}

.left-drawer.collapsed {
  transform: translateX(calc(-100% - 20px));
}

/* Right Drawer */
.right-drawer {
  right: 16px;
  width: 400px;
}

.right-drawer.collapsed {
  transform: translateX(calc(100% + 20px));
}

/* Peek Tab Handles (Defect 4: Larger when nested with clearly visible labels) */
.drawer-peek-tab {
  position: absolute;
  top: 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 920;
  white-space: nowrap;
}

.drawer-peek-tab:hover {
  background: rgba(30, 41, 59, 0.98);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.4);
}

.left-tab {
  left: 100%;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  border-left: none;
}

.left-drawer.collapsed .left-tab .tab-arrow {
  transform: rotate(0deg);
}

.left-drawer:not(.collapsed) .left-tab .tab-arrow {
  transform: rotate(180deg);
}

.right-tab {
  right: 100%;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  border-right: none;
}

.right-drawer.collapsed .right-tab .tab-arrow {
  transform: rotate(180deg);
}

.right-drawer:not(.collapsed) .right-tab .tab-arrow {
  transform: rotate(0deg);
}

.tab-icon {
  font-size: 15px;
  line-height: 1;
}

.tab-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.tab-arrow {
  font-size: 11px;
  color: #93c5fd;
  transition: transform 0.25s ease;
}

/* Inside Left Drawer: Headers & Layer Toggles */
.drawer-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vertical-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.vertical-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.vertical-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.layer-item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.layer-toggle-row:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

.layer-checkbox {
  width: 15px;
  height: 15px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
}

.layer-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  flex: 1;
}

/* Temporal Section Card Inside Left Drawer */
.temporal-section-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.temporal-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.temporal-icon {
  font-size: 13px;
}

.temporal-title-text {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.temporal-badge {
  font-size: 10px;
  font-weight: 800;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
}

.temporal-presets {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.preset-chip.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.7);
  color: #93c5fd;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.temporal-slider-wrapper {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.temporal-slider-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.temporal-slider-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 3px;
  left: 0%;
  width: 100%;
  transition: left 0.05s ease, width 0.05s ease;
}

.temporal-range-input {
  position: absolute;
  width: 100%;
  height: 20px;
  top: 0;
  left: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.temporal-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.1s ease;
}

.temporal-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.temporal-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  padding: 0 2px;
}

/* Layer-Specific Temporal Mini Controls */
.layer-temporal-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  gap: 8px;
}

.layer-temporal-label {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

.layer-temporal-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
}

.layer-temporal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60a5fa;
  cursor: pointer;
}

.layer-temporal-badge {
  font-size: 9px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

.layer-temporal-reset {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 10px;
  padding: 1px 3px;
  border-radius: 2px;
}

.layer-temporal-reset:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* ==============================================================================
   Inside Right Drawer: Header, KPIs, Chart & Summary Dossier
   ============================================================================== */
.panel-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  position: relative;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.kpi-card.disabled {
  opacity: 0.45;
  filter: grayscale(60%);
}

.kpi-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.kpi-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-wrapper {
  position: relative;
  height: 200px;
  width: 100%;
}

.summary-card {
  gap: 10px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-badge {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.results-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.result-row-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.result-row-item:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.result-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-row-title {
  font-weight: 700;
  color: #f8fafc;
}

.result-row-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: white;
}

.result-row-desc {
  color: #94a3b8;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state-text {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  padding: 16px 8px;
  font-style: italic;
}

/* ==============================================================================
   Configuration Settings Modal Dialog
   ============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon {
  font-size: 16px;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-info {
  flex: 1;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.setting-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.4;
}

.custom-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

/* Custom Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s ease;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s ease;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: #3b82f6;
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Mode selector group */
.mode-selector-group {
  display: flex;
  gap: 6px;
}

.mode-pill {
  position: relative;
  cursor: pointer;
}

.mode-pill input {
  position: absolute;
  opacity: 0;
}

.mode-label {
  display: inline-block;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.mode-pill input:checked + .mode-label {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  color: #60a5fa;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.btn-primary {
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.danger-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

/* ==============================================================================
   Custom MarkerCluster Glassmorphic Badges (FEAT-017 / Bug 1)
   ============================================================================== */
.custom-cluster-icon {
  background: transparent;
}

.cluster-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 12px;
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.cluster-bubble:hover {
  transform: scale(1.15);
}

.cluster-master_applications {
  background: rgba(59, 130, 246, 0.9) !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.7) !important;
}

.cluster-appeals {
  background: rgba(245, 158, 11, 0.9) !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.7) !important;
}

.cluster-enforcements {
  background: rgba(239, 68, 68, 0.9) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.7) !important;
}

.cluster-uk_property_market {
  background: rgba(16, 185, 129, 0.9) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.7) !important;
}

/* ==============================================================================
   AC-1: High-Contrast Leaflet Popup Styling
   ============================================================================== */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #0f172a !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  padding: 2px !important;
}

.leaflet-popup-tip {
  background: #ffffff !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.4 !important;
  color: #0f172a !important;
  font-family: var(--font-family) !important;
}

.leaflet-popup-content .popup-badge {
  display: inline-block;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaflet-popup-content .popup-ref {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 4px;
}

.leaflet-popup-content .popup-desc {
  font-size: 11px;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.4;
}

.leaflet-popup-content .popup-address {
  font-size: 11px;
  color: #475569;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
}

.leaflet-popup-content .popup-date {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
}

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

/* ==============================================================================
   Defect 1: Leaflet Draw Controls Offset (Zero Overlap with Left Drawer Tab)
   ============================================================================== */
.leaflet-top.leaflet-left {
  top: 135px !important;
  left: 16px !important;
  z-index: 850 !important;
}

.leaflet-draw-toolbar {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid var(--border-glass) !important;
}

.leaflet-draw-toolbar a {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  transition: all 0.15s ease !important;
}

.leaflet-draw-toolbar a:hover {
  background-color: rgba(59, 130, 246, 0.3) !important;
}

/* ==============================================================================
   Defect 2: Floating Histogram Widget (Centered under Search Bar, 3x width, same height)
   ============================================================================== */
.top-histogram-bar {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1260px, calc(100vw - 32px));
  height: 56px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 950;
  display: flex;
  align-items: center;
  padding: 0 16px;
  animation: fadeIn 0.25s ease-out;
}

.histogram-bar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 16px;
}

.histogram-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 190px;
  flex-shrink: 0;
}

.histogram-icon {
  font-size: 16px;
  line-height: 1;
}

.histogram-bar-title {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.histogram-chart-wrapper {
  flex: 1;
  height: 40px;
  position: relative;
}

/* ==============================================================================
   Defect 4: Glassmorphic Search Button at Drawn Polygon Center Point
   ============================================================================== */
.poly-center-marker-container {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.polygon-center-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(59, 130, 246, 0.7);
  color: #f8fafc;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(59, 130, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
  animation: pulseGlow 2.5s infinite;
}

.polygon-center-search-btn:hover {
  background: rgba(30, 58, 138, 0.95);
  border-color: #60a5fa;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), 0 0 24px rgba(59, 130, 246, 0.7);
}

.poly-search-icon {
  font-size: 13px;
  line-height: 1;
}

.poly-search-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 22px rgba(59, 130, 246, 0.7); }
}

/* ==============================================================================
   Inline Search Entity Selector Pill & Menu
   ============================================================================== */
.search-entity-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.search-entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.search-entity-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.pill-arrow {
  font-size: 9px;
  color: #94a3b8;
}

.search-entity-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  min-width: 190px;
  animation: fadeIn 0.15s ease-out;
}

.entity-menu-item {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.entity-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.entity-menu-item.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 700;
}

/* ==============================================================================
   Top Floating Visualisation Drawer
   ============================================================================== */
.visualization-selector-widget {
  top: 76px;
  right: 16px;
  z-index: 1050;
  animation: fadeIn 0.2s ease-out;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body:has(#right-drawer:not(.collapsed)) .visualization-selector-widget {
  right: 432px;
}

.viz-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.viz-mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.viz-mode-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #a5b4fc;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* ==============================================================================
   Hierarchical Entity Accordions (Left Drawer)
   ============================================================================== */
.entity-accordions-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.entity-accordion-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.entity-accordion-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.entity-accordion-card.expanded {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(15, 23, 42, 0.6);
}

.entity-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.entity-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entity-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.entity-master-checkbox {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.15s ease;
}

.entity-master-checkbox:checked {
  background: #10b981;
  border-color: #10b981;
}

.entity-master-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
}

.entity-icon {
  font-size: 14px;
}

.entity-title-wrap {
  display: flex;
  flex-direction: column;
}

.entity-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.entity-desc {
  font-size: 10px;
  color: #94a3b8;
}

.entity-chevron {
  font-size: 11px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.entity-accordion-card.expanded .entity-chevron {
  transform: rotate(180deg);
}

.entity-accordion-body {
  display: none;
  padding: 8px 12px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.entity-accordion-card.expanded .entity-accordion-body {
  display: block;
}

/* Nested Feature Groups inside Entity Accordion */
.nested-feature-group {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.nested-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* EPC Rating Chips A–G */
.epc-chips-wrap {
  display: flex;
  gap: 4px;
}

.epc-chip {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.epc-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.epc-chip.active.epc-chip-a { background: #059669; color: #ffffff; border-color: #34d399; }
.epc-chip.active.epc-chip-b { background: #10b981; color: #ffffff; border-color: #6ee7b7; }
.epc-chip.active.epc-chip-c { background: #84cc16; color: #ffffff; border-color: #bef264; }
.epc-chip.active.epc-chip-d { background: #eab308; color: #ffffff; border-color: #fde047; }
.epc-chip.active.epc-chip-e { background: #f97316; color: #ffffff; border-color: #fdba74; }
.epc-chip.active.epc-chip-f { background: #ef4444; color: #ffffff; border-color: #fca5a5; }
.epc-chip.active.epc-chip-g { background: #b91c1c; color: #ffffff; border-color: #f87171; }

/* Price input filters */
.nested-price-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-prefix {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

.price-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 11px;
  padding: 3px 6px;
  outline: none;
  font-family: inherit;
}

.price-input:focus {
  border-color: #3b82f6;
}

.nested-layer-toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
}

.nested-layer-checkbox {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  outline: none;
}

.nested-layer-checkbox:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.nested-layer-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
}

.nested-layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nested-layer-label {
  font-size: 11px;
  color: #cbd5e1;
}

/* ==============================================================================
   Results Category Tabs & 360° Property Dossier Cards (Right Drawer)
   ============================================================================== */
.results-category-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  overflow-x: auto;
}

.category-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.category-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.category-tab.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.dossier-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dossier-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.dossier-card.expanded {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dossier-card-header {
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.dossier-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.dossier-uprn-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.dossier-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dossier-epc-badge {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 3px;
}

.dossier-sales-count-badge {
  font-size: 10px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
}

.dossier-address {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  margin-bottom: 4px;
}

.dossier-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dossier-last-price {
  font-size: 14px;
  font-weight: 800;
  color: #34d399;
}

.dossier-sale-date {
  font-size: 10px;
  color: #94a3b8;
}

.dossier-chevron {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.dossier-velocity-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dossier-velocity-badge.high-velocity {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.dossier-velocity-badge.moderate-velocity {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.dossier-velocity-badge.long-held {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.dossier-velocity-badge.unsold {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.dossier-lineage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lineage-chip {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 2px 5px;
  letter-spacing: 0.2px;
}

.dossier-card.expanded .dossier-chevron {
  transform: rotate(180deg);
}

.dossier-card-body {
  display: none;
  padding: 0 12px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dossier-card.expanded .dossier-card-body {
  display: block;
}

.dossier-subtabs {
  display: flex;
  gap: 4px;
  margin: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.dossier-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dossier-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.dossier-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  font-weight: 700;
}

.dossier-subtab-pane {
  display: none;
  font-size: 11px;
}

.dossier-subtab-pane.active {
  display: block;
}

.dossier-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
}

.spec-val {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
}

.dossier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.dossier-table th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dossier-table td {
  padding: 4px 2px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-price {
  color: #34d399;
  font-weight: 700;
}

.dossier-empty-tab {
  color: #64748b;
  font-style: italic;
  font-size: 10px;
  padding: 6px 0;
}

.planning-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.planning-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px;
}

.planning-item-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.planning-ref {
  font-weight: 700;
  color: #93c5fd;
  font-size: 10px;
}

.planning-status-badge {
  font-size: 9px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 1px 4px;
  border-radius: 3px;
}

.planning-desc {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.3;
}

.planning-date {
  font-size: 9px;
  color: #64748b;
  margin-top: 2px;
}

/* Sprint 8: Debt Charges & Organisation Provenance Chips */
.lineage-chip.chip-debt {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.lineage-chip.chip-corporate {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.lineage-chip.chip-charity {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.dossier-debt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 4px 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dossier-debt-title {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
}

.dossier-debt-count {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.dossier-charges-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.dossier-charge-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 6px 8px;
}

.dossier-charge-card.charge-active {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.03);
}

.dossier-charge-card.charge-satisfied {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.03);
}

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

.charge-lender {
  font-size: 10px;
  font-weight: 700;
  color: #f1f5f9;
}

.charge-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.charge-status-badge.badge-outstanding {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.charge-status-badge.badge-satisfied {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.charge-type-row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 3px;
}

.charge-type-tag {
  color: #38bdf8;
  font-weight: 600;
}

.charge-date {
  color: #64748b;
}

.charge-desc {
  font-size: 9.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* ==============================================================================
   Full-Screen Auth Wall Overlay & Card (HONC! Security Gateway)
   ============================================================================== */
.auth-wall-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.15);
  padding: 32px 28px;
  color: #f8fafc;
  animation: authCardFadeIn 0.3s ease-out;
}

@keyframes authCardFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 6px 0;
}

.auth-brand-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.auth-input-group {
  margin-bottom: 16px;
  text-align: left;
}

.auth-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.auth-input-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.auth-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.auth-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 2px 6px;
  border-radius: 10px;
}