.project-review-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.project-review-row {
  border-left: 3px solid #f59e0b;
  background: rgba(15, 23, 42, 0.58);
  padding: 7px 8px;
}

.project-review-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.project-review-warnings {
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.35;
  margin: 3px 0 6px;
}
/* ============================================
   CesiumViewer — Custom Styles
   ============================================ */

/* --- Bottom Navigation Bar (always visible) --- */
#bottomNav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  justify-content: space-around;
  align-items: center;
  padding: 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

#bottomNav .nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 0;
  flex: 1;
  gap: 3px;
  -webkit-tap-highlight-color: transparent;
}

#bottomNav .nav-btn span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#bottomNav .nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

#bottomNav .nav-btn:active {
  transform: scale(0.9);
}

#bottomNav .nav-btn.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

#bottomNav .nav-btn.active:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* --- Bottom menu: workflow categories & tool panel --- */

/* Subtle separators between workflow clusters */
#bottomNav .nav-btn.nav-group-sep {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 8px 8px 0;
  margin-left: 2px;
}

/* Category with its panel open (distinct from blue "tool active" state) */
#bottomNav .nav-btn.nav-group-open {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* "More" is a small-screen affordance only */
#bottomNav .nav-more-btn {
  display: none;
}

#bottomMenuPanel {
  position: fixed;
  bottom: 66px;
  left: 0;
  z-index: 1100;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  padding: 8px;
  min-width: 220px;
  max-width: 420px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
#bottomMenuPanel.hidden {
  display: none;
}

.bottom-menu-panel-header {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 6px 6px;
}

.bottom-menu-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.bottom-menu-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  padding: 10px 6px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-menu-tool span {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bottom-menu-tool:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.bottom-menu-tool.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

/* Small screens: collapse low-priority categories into "More"
   (priority order: Layers, Draw, Measure, AI, More) */
@media (max-width: 640px) {
  #bottomNav .nav-btn[data-priority="low"] {
    display: none;
  }
  #bottomNav .nav-more-btn {
    display: flex;
  }
  #bottomMenuPanel {
    left: 8px !important;
    right: 8px;
    max-width: none;
  }
}

/* --- Cesium Container — accounts for header (50px) + bottom nav (60px) --- */
#cesiumContainer {
  height: calc(100vh - 50px - 60px) !important;
  overscroll-behavior: none;
}

/* Ensure Cesium canvas receives wheel events */
#cesiumContainer canvas {
  touch-action: none;
}

/* ============================================
   ViewCube — Interactive 3D Orientation Cube
   ============================================ */
#viewCubeContainer {
  position: absolute;
  top: 120px;
  right: 10px;
  z-index: 150;
  width: 130px;
  height: 150px;
  pointer-events: none;
  perspective: 400px;
}

#viewCube {
  width: 80px;
  height: 80px;
  position: relative;
  margin: 20px auto 0;
  transform-style: preserve-3d;
  transform: rotateX(-25deg) rotateY(-35deg);
  transition: transform 0.1s ease-out;
  cursor: grab;
  pointer-events: auto;
}

#viewCube:active {
  cursor: grabbing;
}

.vc-face {
  position: absolute;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  background: rgba(40, 50, 65, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backface-visibility: visible;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.vc-face:hover {
  background: rgba(59, 130, 246, 0.6);
  border-color: rgba(59, 130, 246, 0.8);
  color: #fff;
}

.vc-front  { transform: translateZ(40px); }
.vc-back   { transform: rotateY(180deg) translateZ(40px); }
.vc-left   { transform: rotateY(-90deg) translateZ(40px); }
.vc-right  { transform: rotateY(90deg) translateZ(40px); }
.vc-top    { transform: rotateX(90deg) translateZ(40px); }
.vc-bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Compass ring around cube */
#viewCubeCompass {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.vc-compass-n,
.vc-compass-e,
.vc-compass-s,
.vc-compass-w {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.vc-compass-n { top: 2px; left: 50%; transform: translateX(-50%) translateY(-100%); color: #ef4444; }
.vc-compass-s { bottom: 2px; left: 50%; transform: translateX(-50%) translateY(100%); }
.vc-compass-e { right: -2px; top: 50%; transform: translateY(-50%) translateX(100%); }
.vc-compass-w { left: -2px; top: 50%; transform: translateY(-50%) translateX(-100%); }

/* --- Layer Panel (sidebar) --- */
#LayerContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background: #1f2937;
  border-right: 1px solid #374151;
  color: #e5e7eb;
  z-index: 100;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  font-size: 13px;
}

#LayerContainer.open {
  display: flex;
}

#layerPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  min-height: 40px;
  background: #111827;
  flex-shrink: 0;
}

.layer-panel-title {
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
}

.layer-panel-close {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  width: 28px;
}

.layer-panel-close:hover {
  background: #374151;
  color: #e5e7eb;
}

.layer-panel-close-icon {
  height: 18px;
  width: 18px;
}

#divider {
  height: 1px;
  background: #374151;
}

#layerPanelContainer {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}

#layerPanel {
  padding: 0 12px;
}

#layerPanel .layer-empty-state {
  padding: 10px 0;
  color: #9ca3af;
  font-size: 12px;
}

#layerPanel .layer-item {
  display: flex;
  align-items: center;
  padding: 6px;
  border-bottom: 1px solid #374151;
  border-radius: 4px;
  gap: 6px;
}

#layerPanel .layer-item:hover {
  background: #374151;
}

#layerPanel .layer-item label {
  cursor: pointer;
  font-size: 12px;
  color: #d1d5db;
  flex: 1;
  line-height: 1.25;
  word-break: break-word;
}

#layerPanel .layer-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

/* Layer zoom-to button */
.layer-zoom-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}

.layer-zoom-btn:hover {
  color: #60a5fa;
  background: #4b5563;
}

/* Layer item container with height controls */
.layer-item-container {
  background: #111827;
  border-radius: 4px;
  margin-bottom: 4px;
  padding: 2px 4px 4px;
}
/* The row anatomy itself lives on `#layerPanel .layer-item`, so a row built
   from the same markup ANYWHERE else (the GIS Explorer catalog's raster and
   photo-collection rows) rendered as run-together inline text. Repeat the
   anatomy on the container so those rows read identically; the id-scoped rule
   still wins inside #layerPanel, where the values are the same anyway. */
.layer-item-container .layer-item {
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}

/* Height offset controls */
.layer-height-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 4px 26px;
  font-size: 11px;
}

.layer-height-btn {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  color: #d1d5db;
  transition: background 0.15s;
  padding: 0;
}
.layer-height-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.layer-height-label {
  min-width: 42px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  font-family: monospace;
}

.layer-height-step {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 3px;
  color: #d1d5db;
  cursor: pointer;
  margin-left: auto;
  outline: none;
}

.layer-height-step:focus {
  border-color: #3b82f6;
}

.layer-transform-btn {
  margin-left: 2px;
}

/* Section headers match the GIS Explorer group-header look (faint, uppercase). */
.ai-layer-section-title {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 10px 4px 4px;
  text-transform: uppercase;
}

.ai-layer-item-container {
  background: #111827;
  border: 1px solid #374151;
}

#layerPanel .ai-layer-item label {
  font-size: 12px;
}

.ai-layer-swatch {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
  height: 10px;
  width: 10px;
}

.ai-layer-opacity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 8px 26px;
  color: #9ca3af;
  font-size: 11px;
}

/* Progressive disclosure (skylens-ui-design): opacity tuning appears only
   via the row's ⋯ -> "Adjust opacity", never as permanent row furniture. */
.ai-layer-opacity-row.hidden {
  display: none;
}

.ai-layer-opacity-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #3b82f6;
}

/* (.ai-layer-export-row removed — exports live in the row's ⋯ overflow menu.) */

/* --- Compare Slider --- */
#slider {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: #3b82f6;
  z-index: 80;
  cursor: ew-resize;
  display: none;
  transform: translateX(-50%);
  /* Wider invisible touch target */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#slider::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 100%;
  background: transparent;
}

#slider.active {
  display: block;
}

#sliderIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 40px;
  background: #3b82f6;
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: ew-resize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

/* --- Compare Dropdowns --- */
#left_part,
#right_part {
  position: absolute;
  top: 10px;
  z-index: 80;
  display: none;
}

#left_part {
  left: 10px;
}

#right_part {
  right: 10px;
}

#left_part.active,
#right_part.active {
  display: block;
}

#left_part select,
#right_part select {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: white;
  font-size: 13px;
  min-width: 160px;
}

/* --- Measurement Panel (sits above bottom nav) --- */
#measurementPanel {
  bottom: 0 !important;
}

/* --- Volume Measurement Panel --- */
#volumePanel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(31, 41, 55, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f3f4f6;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

.volume-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 14px;
}

.volume-panel-close {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s;
}

.volume-panel-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.volume-panel-body {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  align-items: flex-start;
}

.volume-panel-controls {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.volume-control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.volume-control-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.volume-control-group select,
.volume-control-group input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  min-width: 130px;
}

.volume-control-group select:focus,
.volume-control-group input:focus {
  border-color: #3b82f6;
}

.volume-control-group select option {
  background: #1f2937;
  color: #fff;
}

#volumeCalcBtn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  height: 30px;
}

#volumeCalcBtn:hover {
  background: #2563eb;
}

#volumeCalcBtn:disabled {
  background: #4b5563;
  cursor: not-allowed;
  opacity: 0.7;
}

.volume-panel-results {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.volume-hint {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  font-size: 12px;
  padding: 6px 0;
}

.volume-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.volume-result-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
}

.volume-result-item .volume-result-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  margin-bottom: 2px;
}

.volume-result-item .volume-result-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.volume-result-item .volume-result-value.highlight {
  color: #3b82f6;
}

.volume-result-item .volume-result-unit {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
}

/* --- Volume panel status bar --- */
.volume-status {
  color: #fbbf24;
  font-size: 12px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-status .spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#measurementPanel .form-select {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

#measureText {
  font-size: 14px;
  line-height: 25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Share Modal --- */
#ShareViewerModal .modal-dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0 auto;
  max-width: 500px;
  padding: 20px;
}

#ShareViewerModal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

/* --- Export Panel positioning fix --- */
#ExportPanel {
  transform: translate(-50%, -50%);
}

/* --- Spinner positioning fix --- */
#spinnerDiv {
  transform: translate(-50%, -50%);
}

/* --- Cesium overrides --- */
#cesiumContainer .cesium-viewer-bottom {
  display: none !important;
}

#cesiumContainer .cesium-viewer {
  width: 100%;
  height: 100%;
  z-index: 0;
}

#cesiumContainer .cesium-widget {
  z-index: 0;
}

#cesiumContainer .cesium-viewer-toolbar {
  z-index: 10;
}

/* --- General form styles --- */
.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* --- Modal backdrop and animation --- */
.modal.fade {
  transition: opacity 0.15s linear;
}

.modal.show {
  display: flex !important;
  background: rgba(0, 0, 0, 0.5);
}

/* Btn close */
.btn-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.btn-close:hover {
  opacity: 0.7;
}

/* ============================================
   Responsive — Tablets & Mobile (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* --- Bottom Nav: horizontal scroll --- */
  #bottomNav {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 2px;
    padding: 0 4px;
    scrollbar-width: none; /* Firefox */
  }

  #bottomNav::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  #bottomNav .nav-btn {
    flex: 0 0 auto;
    min-width: 52px;
    font-size: 16px;
    padding: 4px 6px;
    scroll-snap-align: start;
  }

  #bottomNav .nav-btn span {
    font-size: 9px;
  }

  /* --- Header --- */
  .header-auth-btn {
    padding: 4px 10px;
    font-size: 12px;
  }
  .header-auth-name {
    display: none;
  }

  /* Keep the icon (the link still works) but drop the word, so the header
     right-hand group cannot push into the centred logo on a phone. */
  .header-docs-link {
    padding: 4px 8px;
  }
  .header-docs-link span {
    display: none;
  }

  /* Hide model name on mobile for cleaner header */
  #activeModelName {
    display: none;
  }

  /* Header shrink */
  #appHeader {
    height: 40px;
  }

  #appHeader img {
    width: 150px;
  }

  /* Fix Cesium container height for 40px header */
  #cesiumContainer {
    height: calc(100vh - 40px - 60px) !important;
  }

  /* --- ViewCube: top-right (matching desktop position), smaller --- */
  #viewCubeContainer {
    width: 90px;
    height: 110px;
    top: 80px;
    right: 10px;
    left: auto;
  }

  #viewCube {
    width: 55px;
    height: 55px;
  }

  .vc-face {
    width: 55px;
    height: 55px;
    font-size: 7px;
  }

  .vc-front  { transform: translateZ(27.5px); }
  .vc-back   { transform: rotateY(180deg) translateZ(27.5px); }
  .vc-left   { transform: rotateY(-90deg) translateZ(27.5px); }
  .vc-right  { transform: rotateY(90deg) translateZ(27.5px); }
  .vc-top    { transform: rotateX(90deg) translateZ(27.5px); }
  .vc-bottom { transform: rotateX(-90deg) translateZ(27.5px); }

  #viewCubeCompass {
    width: 90px;
    height: 90px;
  }

  .vc-compass-n, .vc-compass-e, .vc-compass-s, .vc-compass-w {
    font-size: 9px;
  }

  /* Layer panel full-screen on mobile */
  #LayerContainer {
    width: 100% !important;
    max-width: 100%;
  }

  /* Compare dropdowns smaller */
  #left_part {
    left: 5px;
    top: 5px;
  }

  #right_part {
    right: 5px;
    top: 5px;
  }

  #left_part select,
  #right_part select {
    min-width: 120px;
    font-size: 12px;
  }

  /* Export panel */
  #ExportPanel {
    width: 85vw !important;
    max-width: 300px;
  }

  /* Share modal */
  #ShareViewerModal .modal-dialog {
    max-width: calc(100vw - 20px);
    padding: 10px;
  }

  /* Cesium controls smaller on mobile */
  .cesium-viewer .cesium-viewer-toolbar {
    right: 5px;
  }

  .cesium-viewer .cesium-viewer-geocoderContainer {
    width: auto;
  }

  /* Volume panel stacks on mobile */
  .volume-panel-body {
    flex-direction: column;
  }

  .volume-panel-controls {
    width: 100%;
  }

  .volume-control-group select,
  .volume-control-group input {
    min-width: 0;
    width: 100%;
  }

  .volume-result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small phones */
@media (max-width: 380px) {
  #bottomNav .nav-btn {
    min-width: 46px;
    font-size: 14px;
    padding: 4px 4px;
  }

  #bottomNav .nav-btn span {
    font-size: 8px;
  }
}

/* ============================================
   Profile Panel
   ============================================ */
#profilePanel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #1f2937;
  border-top: 2px solid #374151;
  color: #e5e7eb;
  max-height: 45vh;
  display: none;
  flex-direction: column;
}
#profilePanel.active {
  display: flex;
}

.profile-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 14px;
}

.profile-panel-close {
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.profile-panel-close:hover { background: rgba(255,255,255,0.1); }

.profile-panel-body {
  padding: 8px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.profile-panel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profile-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-control-group label {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}
.profile-control-group input {
  width: 70px;
  padding: 3px 6px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #374151;
  color: #e5e7eb;
  font-size: 12px;
}

.profile-resample-btn,
.profile-export-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #fff;
}
.profile-resample-btn { background: #3b82f6; }
.profile-resample-btn:hover { background: #2563eb; }
.profile-export-btn { background: #10b981; }
.profile-export-btn:hover { background: #059669; }

.profile-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 12px;
  flex-wrap: wrap;
  color: #d1d5db;
}
.profile-stats b { color: #34d399; }

.profile-chart-container {
  flex: 1;
  min-height: 120px;
  max-height: 200px;
  position: relative;
}

.profile-hint {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 13px;
}

.profile-status {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Heatmap Panel
   ============================================ */
#heatmapPanel {
  position: absolute;
  top: 60px;
  right: 10px;
  z-index: 50;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  width: 220px;
}

.heatmap-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px 8px 0 0;
}

.heatmap-panel-close {
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.heatmap-panel-close:hover { background: rgba(255,255,255,0.1); }

.heatmap-panel-body {
  padding: 10px 12px;
}

.heatmap-control-group {
  margin-bottom: 8px;
}
.heatmap-control-group label {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}
.heatmap-control-group input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #374151;
  color: #e5e7eb;
  font-size: 12px;
}

#heatmapGenBtn {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}
#heatmapGenBtn:hover { background: #dc2626; }
#heatmapGenBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.heatmap-status {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  min-height: 16px;
}

/* Heatmap Legend */
#heatmapLegend {
  position: absolute;
  bottom: 70px;
  right: 10px;
  z-index: 50;
  background: rgba(31,41,55,0.9);
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e5e7eb;
  width: 160px;
}

.heatmap-legend-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.heatmap-legend-bar {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
}

/* DSM elevation legend — gradient MUST match _RAMP in server/db/dsm_ingest.py. */
.dsm-legend {
  margin-top: 4px;
}

.dsm-legend-bar {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right,
    rgb(46, 82, 102), rgb(60, 140, 132), rgb(120, 176, 108),
    rgb(222, 214, 128), rgb(196, 142, 88), rgb(150, 104, 78), rgb(245, 245, 245));
}

.dsm-legend-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}

.heatmap-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 3px;
}

/* ============================================
   Annotation Panel
   ============================================ */
#annotationPanel {
  position: absolute;
  top: 60px;
  left: calc(10px + var(--skylens-left-dock, 0px)); /* beside the GIS Explorer rail */
  z-index: 50;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  width: 280px;
  max-height: calc(100vh - 230px);
  display: none;
  flex-direction: column;
}
#annotationPanel.active {
  display: flex;
}

.annotation-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px 8px 0 0;
}

.annotation-panel-actions {
  display: flex;
  gap: 4px;
}

.annotation-action-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
}
.annotation-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.annotation-danger:hover { color: #ef4444; }

.annotation-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.annotation-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
}
.annotation-list-item:hover { background: rgba(255,255,255,0.05); }

.annotation-list-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.annotation-list-content { flex: 1; min-width: 0; }
.annotation-list-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.annotation-list-meta {
  font-size: 10px;
  color: #9ca3af;
}
.annotation-list-cat {
  text-transform: capitalize;
}

.annotation-list-edit {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 11px;
  padding: 4px;
}
.annotation-list-edit:hover { color: #3b82f6; }

.annotation-empty {
  text-align: center;
  padding: 20px 10px;
  color: #6b7280;
  font-size: 12px;
}

/* Annotation Editor */
#annotationEditor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 10px;
  color: #e5e7eb;
  width: 300px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.annotation-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #111827;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px 10px 0 0;
}

.annotation-editor-body {
  padding: 14px;
}

.annotation-field {
  margin-bottom: 10px;
}
.annotation-field label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.annotation-field input,
.annotation-field select,
.annotation-field textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: #374151;
  color: #e5e7eb;
  font-size: 13px;
  box-sizing: border-box;
}
.annotation-field textarea { resize: vertical; }

.annotation-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.annotation-save-btn {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: 5px;
  background: #10b981;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.annotation-save-btn:hover { background: #059669; }
.annotation-delete-btn {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: 5px;
  background: #ef4444;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.annotation-delete-btn:hover { background: #dc2626; }

/* ============================================
   Slope Panel (reuses heatmap styling + extras)
   ============================================ */
#slopePanel {
  position: absolute;
  top: 60px;
  right: 10px;
  z-index: 50;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  width: 220px;
}

.slope-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px 8px 0 0;
}

.slope-panel-close {
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.slope-panel-close:hover { background: rgba(255,255,255,0.1); }

.slope-panel-body {
  padding: 10px 12px;
}

#slopeGenBtn {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #f59e0b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}
#slopeGenBtn:hover { background: #d97706; }
#slopeGenBtn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Slope Legend */
#slopeLegend {
  position: absolute;
  bottom: 70px;
  right: 10px;
  z-index: 50;
  background: rgba(31,41,55,0.9);
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e5e7eb;
  width: 160px;
}

.slope-legend-bar {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right, #00ff00, #ffff00, #ff8800, #ff0000);
}

/* ============================================
   Report Panel
   ============================================ */
#reportPanel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 10px;
  color: #e5e7eb;
  width: 340px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.report-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #111827;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px 10px 0 0;
}
.report-panel-close {
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #9ca3af;
}
.report-panel-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.report-panel-body {
  padding: 14px;
}

.report-field {
  margin-bottom: 10px;
}
.report-field label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.report-field input,
.report-field textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: #374151;
  color: #e5e7eb;
  font-size: 13px;
  box-sizing: border-box;
}
.report-field textarea { resize: vertical; }

.report-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #d1d5db;
}
.report-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.report-checkboxes input[type="checkbox"] {
  accent-color: #3b82f6;
}

#reportGenBtn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 5px;
  background: #ef4444;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
#reportGenBtn:hover { background: #dc2626; }
#reportGenBtn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================
   Temporal Comparison Panel
   ============================================ */
#temporalPanel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #1f2937;
  border-top: 2px solid #374151;
  color: #e5e7eb;
}

.temporal-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #111827;
  font-weight: 600;
  font-size: 14px;
}
.temporal-panel-close {
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.temporal-panel-close:hover { background: rgba(255,255,255,0.1); }

.temporal-panel-body {
  padding: 10px 14px;
}

.temporal-current-label {
  font-size: 14px;
  margin-bottom: 8px;
  text-align: center;
}

.temporal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.temporal-nav-btn {
  background: #374151;
  border: none;
  color: #e5e7eb;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.temporal-nav-btn:hover { background: #4b5563; }

.temporal-slider {
  flex: 1;
  accent-color: #3b82f6;
}

.temporal-labels {
  position: relative;
  height: 18px;
  margin-top: 4px;
  margin-bottom: 8px;
}
.temporal-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
}

.temporal-play-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.temporal-play-btn {
  background: #3b82f6;
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.temporal-play-btn:hover { background: #2563eb; }

.temporal-speed-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.temporal-speed-group label {
  font-size: 11px;
  color: #9ca3af;
}
.temporal-speed-group input {
  width: 70px;
  padding: 3px 6px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #374151;
  color: #e5e7eb;
  font-size: 12px;
}

/* ============================================
   Cut/Fill Panel
   ============================================ */
#cutfillPanel {
  position: absolute;
  top: 60px;
  left: calc(10px + var(--skylens-left-dock, 0px)); /* beside the GIS Explorer rail */
  z-index: 50;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  width: 280px;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
}

.cutfill-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px 8px 0 0;
  position: sticky;
  top: 0;
}
.cutfill-panel-close {
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.cutfill-panel-close:hover { background: rgba(255,255,255,0.1); }

.cutfill-panel-body {
  padding: 10px 12px;
}

.cutfill-selects { margin-bottom: 6px; }
.cutfill-selects select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #374151;
  color: #e5e7eb;
  font-size: 12px;
}

.cutfill-options {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.cutfill-options input {
  width: 100%;
}

#cutfillCalcBtn {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #8b5cf6;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}
#cutfillCalcBtn:hover { background: #7c3aed; }
#cutfillCalcBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.cutfill-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.cutfill-result-item {
  background: #374151;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.cutfill-result-item span {
  display: block;
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 2px;
}
.cutfill-result-item b {
  font-size: 14px;
}
.cutfill-cut b { color: #ef4444; }
.cutfill-fill b { color: #3b82f6; }
.cutfill-net b { color: #10b981; }

.cutfill-export-btn {
  width: 100%;
  padding: 5px;
  border: none;
  border-radius: 4px;
  background: #374151;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
}
.cutfill-export-btn:hover { background: #4b5563; color: #fff; }

/* Cut/Fill Legend */
#cutfillLegend {
  position: absolute;
  bottom: 70px;
  right: 10px;
  z-index: 50;
  background: rgba(31,41,55,0.9);
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e5e7eb;
  width: 160px;
}

.cutfill-legend-bar {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right, #ef4444, #ffffff, #3b82f6);
}

/* ============================================
   Phase 3 — Shared Panel Styles
   ============================================ */

.phase3-panel {
  position: fixed;
  bottom: 70px;
  /* Left dock (skylens-ui-design): panels sit beside the GIS Explorer rail,
     never under it. ToggleGisExplorer keeps --skylens-left-dock in sync. */
  left: calc(10px + var(--skylens-left-dock, 0px));
  z-index: 200;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid #374151;
  border-radius: 8px;
  width: 280px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-size: 13px;
}

/* Auth panel — override to drop from header top-right */
#authPanel {
  bottom: auto;
  left: auto;
  top: 50px;
  right: 10px;
  max-height: calc(100vh - 120px);
}

/* ── Header right-hand group (Developers link + Account button) ──
   The group owns the absolute positioning that the auth button used to carry,
   so a second item can sit beside it without either one being placed by hand. */
.header-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-docs-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.header-docs-link:hover {
  color: #2563eb;
  border-color: #93c5fd;
}

/* ── Header Auth Button ── */
.header-auth-btn {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.header-auth-btn:hover {
  background: #2563eb;
}
.header-auth-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase3-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #374151;
  color: #e5e7eb;
  font-weight: 600;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: rgba(17, 24, 39, 0.98);
  z-index: 1;
}

.phase3-panel-header i {
  margin-right: 6px;
  color: #60a5fa;
}

.phase3-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}
.phase3-close-btn:hover {
  color: #ef4444;
}

.phase3-panel-body {
  padding: 10px 12px;
}

.phase3-control-group {
  margin-bottom: 8px;
}
.phase3-control-group label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.phase3-control-group input[type="number"],
.phase3-control-group input[type="text"],
.phase3-control-group input[type="email"],
.phase3-control-group input[type="password"],
.phase3-control-group textarea {
  width: 100%;
  box-sizing: border-box;
}

.phase3-text-input {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.phase3-text-input:focus {
  border-color: #3b82f6;
}

.phase3-select {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.phase3-select:focus {
  border-color: #3b82f6;
}

.phase3-file-input {
  font-size: 11px;
  color: #9ca3af;
  width: 100%;
}
.phase3-file-input::file-selector-button {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  margin-right: 8px;
}
.phase3-file-input::file-selector-button:hover {
  background: #4b5563;
}

.phase3-action-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}
.phase3-action-btn:hover {
  background: #2563eb;
}

.phase3-secondary-btn {
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}
.phase3-secondary-btn:hover {
  background: #4b5563;
}

.phase3-status {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
  min-height: 16px;
}

/* Account panel — password lifecycle (ADR 0053 D-6/D-14).
   Tokens: danger #f87171, success #34d399, accent #38bdf8. */
.auth-status-error { color: #f87171; }
.auth-status-success { color: #34d399; }
.auth-status-info { color: #38bdf8; }

.auth-strength {
  height: 3px;
  background: #111827;
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}
.auth-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: #f87171;
  transition: width 0.3s, background 0.3s;
}
.auth-strength-label {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.35;
}

.auth-inline-link {
  font-size: 11px;
  color: #38bdf8;
  text-decoration: none;
  cursor: pointer;
}
.auth-inline-link:hover {
  text-decoration: underline;
}
.auth-inline-link:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-strength-bar { transition: none; }
}

.phase3-layer-list {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 4px 6px;
  margin-top: 6px;
}

/* ============================================
   Coverage overlay (skill: skylens-spatial-overlay-analysis)
   ============================================ */

.spatial-overlay-panel {
  width: 300px;
}
.spatial-overlay-help {
  font-size: 11px;
  color: #9ca3af;
  margin: 0 0 10px;
  line-height: 1.4;
}
.spatial-overlay-hint {
  font-size: 10.5px;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.35;
}
.spatial-overlay-hint-warn {
  color: #fbbf24;
}
.spatial-overlay-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.spatial-overlay-actions button {
  flex: 1;
  justify-content: center;
}
.spatial-overlay-result {
  margin-top: 10px;
}
.spatial-overlay-result:empty {
  margin-top: 0;
}
.spatial-overlay-metrics {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 10px;
}
.spatial-overlay-metric {
  font-size: 12px;
  color: #e5e7eb;
  padding: 2px 0;
}
.spatial-overlay-warn {
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 4px;
  padding: 5px 8px;
  margin-top: 6px;
  line-height: 1.35;
}
.spatial-overlay-outputs {
  margin-top: 8px;
}
.spatial-overlay-output-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.spatial-overlay-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3);
  flex: 0 0 auto;
}
.spatial-overlay-output-name {
  flex: 1;
  font-size: 12px;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spatial-overlay-eye {
  padding: 3px 8px;
  font-size: 11px;
}
.spatial-overlay-note {
  font-size: 10.5px;
  color: #9ca3af;
  margin-top: 8px;
  line-height: 1.4;
  border-top: 1px solid #374151;
  padding-top: 8px;
}
.spatial-overlay-msg {
  font-size: 12px;
  color: #9ca3af;
  padding: 6px 0;
}
.spatial-overlay-msg-error {
  color: #f87171;
}

/* ============================================
   AI Top View Extraction
   ============================================ */

#aiTopViewPanel {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 150px);
}

.entity-studio-panel .entity-workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 14px;
}

.entity-studio-panel .entity-workflow-strip span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.44);
}

.entity-studio-panel .entity-workflow-strip span.active {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.15);
}

.entity-studio-panel .entity-workflow-strip b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
}

.entity-studio-panel .entity-studio-section {
  border-inline-start: 3px solid rgba(56, 189, 248, 0.45);
}

.entity-studio-panel .entity-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 700;
}

.entity-studio-panel .entity-section-title i {
  width: 18px;
  color: #38bdf8;
}

.entity-studio-panel .entity-context-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.entity-studio-panel .entity-context-summary span {
  padding: 5px 7px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.08);
  font-size: 10px;
}

.entity-studio-panel .entity-class-groups {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.entity-studio-panel .entity-class-group {
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
}

.entity-studio-panel .entity-class-group .gte-check-line {
  display: grid;
  grid-template-columns: auto 18px minmax(90px, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
}

.entity-studio-panel .entity-class-group small {
  color: #94a3b8;
  font-size: 9px;
  text-align: end;
}

.entity-studio-panel .entity-mode-selector {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.entity-studio-panel .entity-mode-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.4);
}

.entity-studio-panel .entity-mode-card:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(14, 165, 233, 0.12);
}

.entity-studio-panel .entity-mode-card input {
  grid-row: 1 / span 2;
  align-self: center;
}

.entity-studio-panel .entity-mode-card strong span {
  margin-inline-start: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  font-size: 9px;
}

.entity-studio-panel .entity-mode-card small {
  color: #94a3b8;
  line-height: 1.35;
}

.entity-studio-panel .entity-strategy-details {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.24);
}

.entity-studio-panel .entity-strategy-details > summary,
.entity-studio-panel #entityStudioOperations > summary,
.entity-studio-panel #aiCaptureDebugSection > summary {
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 650;
}

.entity-studio-panel .entity-run-summary {
  margin-top: 10px;
  border-color: rgba(56, 189, 248, 0.32);
}

.entity-studio-panel .entity-review-queue-preview {
  max-height: 180px;
  margin-top: 8px;
  overflow: auto;
}

@media (min-width: 700px) {
  .entity-studio-panel .entity-workflow-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .entity-studio-panel .entity-class-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ai-panel-kicker {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ai-panel-warning,
.ai-inline-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.4;
  padding: 7px 8px;
  margin-bottom: 8px;
}

.ai-readonly-field,
.ai-metric-line {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #d1d5db;
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 8px;
}

.ai-metric-line {
  margin-top: 6px;
}

.ai-button-row,
.ai-status-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-file-input {
  margin-top: 7px;
}

.ai-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ai-checkbox-grid label,
.ai-inline-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #d1d5db;
  font-size: 12px;
}

.ai-inline-checkbox {
  margin-top: 7px;
}

.ai-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ai-settings-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-settings-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  margin-bottom: 2px;
}

.ai-status-badge {
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}

.ai-status-badge.online { background: #059669; }
.ai-status-badge.cpu-debug { background: #7c3aed; }
.ai-status-badge.checking { background: #2563eb; }
.ai-status-badge.offline,
.ai-status-badge.cuda-unavailable,
.ai-status-badge.model-not-loaded { background: #b45309; }

.ai-run-btn {
  width: 100%;
  justify-content: center;
  margin: 4px 0 10px;
}

#aiTopViewPanel .phase3-action-btn:disabled,
#aiTopViewPanel .phase3-secondary-btn:disabled,
#buildingEntityPanel .phase3-action-btn:disabled,
#buildingEntityPanel .phase3-secondary-btn:disabled,
#gtExtractionPanel .phase3-action-btn:disabled,
#gtExtractionPanel .phase3-secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Building Entity Extraction V7: armed seed tool highlight */
.be-seed-tool-active {
  background: #3b82f6 !important;
  color: #fff !important;
}

/* Ground Truth Building Extraction: armed marking tool highlight */
.gte-tool-active {
  background: #16a34a !important;
  color: #fff !important;
}

/* Ground Truth Building Extraction: Advanced Algorithm Settings (Prompt 9) */
.gte-advanced-settings {
  border-top: 1px solid #374151;
  padding-top: 8px;
}

.gte-advanced-toggle {
  width: 100%;
  text-align: left;
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.gte-advanced-toggle:hover {
  background: #374151;
}

/* Advanced Capture Debug Settings (Prompt 20): collapsed legacy pipeline
   controls inside the AI Building Entity Extraction hub panel. */
.ai-capture-debug {
  border-top: 1px solid #374151;
  padding-top: 8px;
}

.ai-capture-debug > summary {
  cursor: pointer;
  color: #d1d5db;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  user-select: none;
  list-style-position: inside;
}

.ai-capture-debug > summary:hover {
  background: #374151;
}

.ai-capture-debug[open] > summary {
  color: #93c5fd;
  margin-bottom: 8px;
}

.gte-advanced-toggle i {
  width: 12px;
  margin-right: 4px;
}

.gte-advanced-body {
  margin-top: 8px;
  padding: 8px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.gte-advanced-group {
  margin-bottom: 10px;
}

.gte-advanced-group > label {
  display: block;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gte-radio-line,
.gte-check-line {
  display: block;
  color: #d1d5db;
  font-size: 12px;
  margin: 2px 0;
  cursor: pointer;
}

.gte-radio-line input,
.gte-check-line input {
  margin-right: 6px;
}

.gte-check-title {
  color: #9ca3af;
  font-size: 11px;
  margin: 6px 0 2px;
}

.gte-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}

.gte-field-label {
  color: #9ca3af;
  font-size: 11px;
  flex: 1;
}

.gte-num-input {
  width: 90px;
}

.gte-inline-select {
  max-width: 160px;
}

.gte-textarea {
  width: 100%;
  resize: vertical;
  font-size: 11px;
  margin-bottom: 6px;
}


.ai-job-status-block {
  border-top: 1px solid #374151;
  padding-top: 8px;
}

.ai-job-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ai-job-status-list span {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 999px;
  color: #9ca3af;
  font-size: 10px;
  padding: 3px 7px;
}

.ai-job-status-list span.active {
  background: #1d4ed8;
  border-color: #60a5fa;
  color: #eff6ff;
}

.ai-job-qa-summary {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  font-size: 11px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 8px;
}

.ai-job-qa-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.6);
}

.ai-job-qa-row span {
  color: #9ca3af;
}

.ai-job-qa-row strong {
  color: #f3f4f6;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.ai-job-qa-row.warn strong {
  color: #fbbf24;
}

.ai-job-qa-note {
  color: #9ca3af;
  font-size: 10px;
  font-style: italic;
  padding-top: 5px;
}

.ai-result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.ai-result-actions .phase3-secondary-btn {
  justify-content: center;
  min-height: 31px;
}

.ai-feature-popup {
  position: absolute;
  z-index: 250;
  width: 286px;
  max-width: calc(100vw - 24px);
  background: rgba(17, 24, 39, 0.97);
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: #e5e7eb;
  font-size: 12px;
  overflow: hidden;
}

.ai-feature-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(31, 41, 55, 0.96);
  border-bottom: 1px solid #374151;
  color: #f9fafb;
  font-weight: 700;
  padding: 8px 10px;
  cursor: move;
  user-select: none;
}

.ai-feature-popup-header button {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.ai-feature-popup-header button:hover {
  color: #ef4444;
}

.ai-feature-popup-body {
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 10px;
}

.ai-feature-popup-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px 0;
}

.ai-feature-flag-chip {
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.75);
  border-radius: 999px;
  color: #fdba74;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
}

.ai-feature-popup-note {
  border-top: 1px solid rgba(55, 65, 81, 0.72);
  color: #9ca3af;
  font-size: 10px;
  font-style: italic;
  padding: 6px 10px 0;
}

.ai-feature-popup-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.72);
}

.ai-feature-popup-row span {
  color: #9ca3af;
}

.ai-feature-popup-row strong {
  color: #f3f4f6;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ai-feature-popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px 10px;
}

.ai-feature-popup-actions button {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 11px;
  padding: 6px 8px;
}

.ai-feature-popup-actions button:hover {
  background: #4b5563;
}

.ai-feature-popup-actions button.danger {
  border-color: rgba(239, 68, 68, 0.65);
  color: #fecaca;
}

.ai-feature-popup-edit-toggle {
  grid-column: 1 / -1;
  border-color: rgba(59, 130, 246, 0.65) !important;
  color: #bfdbfe !important;
}

.ai-feature-popup-edit {
  border-top: 1px solid #374151;
  padding: 8px 10px 2px;
}

.ai-feature-popup-edit label {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  margin-bottom: 6px;
}

.ai-feature-popup-edit select,
.ai-feature-popup-edit textarea,
.ai-feature-popup-edit input[type="text"],
.ai-feature-popup-edit input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 2px;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #f3f4f6;
  font-size: 11px;
  padding: 4px 6px;
}

#gtEntityEditForm {
  max-height: 260px;
  overflow-y: auto;
}

.ai-feature-popup-edit textarea {
  resize: vertical;
  min-height: 34px;
}

.ai-feature-popup-edit .ai-feature-popup-actions {
  padding: 6px 0 8px;
}

.ai-feature-popup-edit button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 520px) {
  #aiTopViewPanel {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .ai-checkbox-grid,
  .ai-settings-grid,
  .ai-settings-grid-3,
  .ai-result-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   3D Model Store
   ============================================ */

#storePanel {
  width: 380px;
  max-height: calc(100vh - 150px);
}

.store-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.store-product-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  overflow: hidden;
}

.store-product-thumb {
  position: relative;
  height: 140px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  font-size: 34px;
}

.store-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-access-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.store-access-badge.licensed {
  background: #059669;
  color: #fff;
}

.store-access-badge.purchased {
  background: #059669;
  color: #fff;
}

.store-access-badge.preview-only {
  background: #f59e0b;
  color: #111827;
}

.store-access-badge.locked {
  background: #f59e0b;
  color: #111827;
}

.store-product-body {
  padding: 10px;
}

.store-product-title {
  color: #f9fafb;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.store-product-description {
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.store-product-meta,
.store-product-price {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.store-product-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.store-disabled-btn {
  opacity: 0.55;
  cursor: not-allowed;
}

.store-preview-btn,
.store-full-btn,
.store-request-btn {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 32px;
}

.store-request-btn:disabled,
.store-disabled-btn:disabled {
  pointer-events: none;
}

.store-product-admin,
.store-admin-panel {
  border-top: 1px solid #374151;
  margin-top: 10px;
  padding-top: 10px;
}

.store-section-title {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.store-admin-grant-row {
  display: flex;
  gap: 6px;
}

.store-admin-grant-row input {
  min-width: 0;
}

.store-product-grants-title {
  margin-top: 10px;
}

.store-product-grant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-product-grants-empty {
  padding: 4px 0 0;
  text-align: left;
}

.store-empty-state {
  color: #9ca3af;
  font-size: 12px;
  padding: 10px 0;
  text-align: center;
}

.store-entitlement-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-entitlement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 6px 8px;
}

.store-entitlement-info {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d1d5db;
  font-size: 11px;
}

.store-revoke-btn {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #991b1b;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}

.store-revoke-btn:hover {
  background: #991b1b;
  color: #fff;
}

.store-admin-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.store-admin-tab {
  justify-content: center;
  min-height: 30px;
  font-size: 11px;
}

.store-admin-tab.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.store-admin-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-admin-card {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px;
}

.store-admin-card-title {
  color: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.store-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.store-admin-form-grid .full-span {
  grid-column: 1 / -1;
}

.store-admin-field label {
  color: #9ca3af;
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.store-admin-field input,
.store-admin-field select,
.store-admin-field textarea,
.store-admin-filter {
  background: #0f172a;
  border: 1px solid #374151;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

.store-admin-field textarea {
  min-height: 64px;
  resize: vertical;
}

.store-admin-check-row {
  align-items: center;
  color: #d1d5db;
  display: flex;
  font-size: 12px;
  gap: 8px;
  min-height: 32px;
}

.store-admin-check-row input {
  width: auto;
}

.store-admin-actions,
.store-admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.store-admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-admin-row {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 7px;
  color: #d1d5db;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px;
}

.store-admin-row-main {
  min-width: 0;
}

.store-admin-row-title {
  color: #f9fafb;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-admin-row-meta {
  color: #9ca3af;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.store-admin-row-actions {
  align-items: flex-start;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.store-admin-mini-btn {
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 5px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 11px;
  min-height: 26px;
  padding: 4px 7px;
}

.store-admin-mini-btn:hover {
  border-color: #60a5fa;
  color: #fff;
}

.store-admin-mini-btn.danger {
  border-color: #991b1b;
  color: #fecaca;
}

.store-admin-badge {
  background: #374151;
  border-radius: 999px;
  color: #e5e7eb;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-right: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
}

.store-admin-badge.published,
.store-admin-badge.active,
.store-admin-badge.paid {
  background: #047857;
  color: #d1fae5;
}

.store-admin-badge.draft,
.store-admin-badge.pending-approval {
  background: #92400e;
  color: #fef3c7;
}

.store-admin-badge.archived,
.store-admin-badge.revoked,
.store-admin-badge.canceled,
.store-admin-badge.refunded {
  background: #7f1d1d;
  color: #fecaca;
}

.store-admin-inline-input {
  background: #0f172a;
  border: 1px solid #374151;
  border-radius: 5px;
  color: #e5e7eb;
  font-size: 11px;
  min-height: 26px;
  padding: 3px 6px;
  width: 120px;
}

.preview-watermark {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  overflow: hidden;
}

.preview-watermark-grid {
  position: absolute;
  inset: -25%;
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 54px;
  transform: rotate(-28deg);
  align-content: center;
}

.preview-watermark-tile {
  color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.preview-watermark--licensed .preview-watermark-tile {
  color: rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.preview-watermark-badge {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.preview-watermark--licensed .preview-watermark-badge {
  background: rgba(17, 24, 39, 0.62);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
}

/* Contour Legend */
#contourLegend {
  position: fixed;
  bottom: 70px;
  right: 10px;
  z-index: 50;
  background: rgba(31,41,55,0.9);
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e5e7eb;
  width: 160px;
}
.contour-legend-bar {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(to right, #0000ff, #00ff00, #ffff00, #ff0000);
}

/* ============================================
   Transform Gizmo Panel
   ============================================ */

/* Mode toggle buttons */
.transform-mode-group {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.transform-mode-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 4px;
  border: 1px solid #374151;
  background: rgba(55,65,81,0.5);
  color: #d1d5db;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s;
}
.transform-mode-btn:hover {
  background: rgba(55,65,81,0.9);
}
.transform-mode-btn.active {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
}

/* Axis input rows */
.transform-axis-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.transform-axis-label {
  width: 110px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.transform-axis-label.axis-x { color: #ef4444; }
.transform-axis-label.axis-y { color: #22c55e; }
.transform-axis-label.axis-z { color: #3b82f6; }

.transform-axis-row input[type="number"] {
  flex: 1;
  min-width: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}
.transform-axis-row input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
}

.transform-nudge-btn {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid #374151;
  background: rgba(55,65,81,0.5);
  color: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}
.transform-nudge-btn:hover {
  background: rgba(55,65,81,0.9);
}

/* Step selector */
.transform-step-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9ca3af;
}
.transform-step-row select {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 3px 6px;
  font-size: 11px;
}
.transform-step-row select:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Layer selector */
.transform-layer-select {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 5px 8px;
  font-size: 12px;
  margin-bottom: 10px;
}
.transform-layer-select:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Action row */
.transform-action-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Wizard */
.transform-wizard-box {
  margin-top: 10px;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px;
  background: rgba(17,24,39,0.7);
}
.transform-wizard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.transform-wizard-title {
  font-size: 12px;
  color: #e5e7eb;
  font-weight: 600;
}
.transform-wizard-step {
  font-size: 11px;
  color: #93c5fd;
}
.transform-wizard-step-title {
  font-size: 12px;
  color: #f3f4f6;
  font-weight: 600;
}
.transform-wizard-step-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 8px;
}
.transform-wizard-box #wizardInputs .transform-axis-row input[type="number"] {
  flex: 1;
  min-width: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}
.transform-wizard-box #wizardInputs .transform-axis-row input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
}
.transform-wizard-review {
  font-size: 11px;
  color: #d1d5db;
  line-height: 1.45;
  background: rgba(31,41,55,0.6);
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  word-break: break-word;
}
.transform-wizard-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.transform-wizard-actions .phase3-action-btn,
.transform-wizard-actions .phase3-secondary-btn {
  flex: 1;
}

.transform-wizard-actions .phase3-secondary-btn:disabled,
.transform-wizard-actions .phase3-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Dashboard Overlay
   ============================================ */

#dashboardOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  overflow-y: auto;
}
#dashboardOverlay.active {
  display: flex;
}

.dashboard-container {
  width: 90vw;
  max-width: 1100px;
  background: #111827;
  border-radius: 12px;
  border: 1px solid #374151;
  padding: 24px;
  margin-bottom: 40px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* Project Edit Modal */
#projectEditModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
}
#projectEditModal.active {
  display: flex;
}

.project-edit-container {
  width: 90vw;
  max-width: 420px;
  background: #111827;
  border-radius: 10px;
  border: 1px solid #374151;
  overflow: hidden;
}

/* ============================================
   Phase 3 — Responsive
   ============================================ */

@media (max-width: 640px) {
  .phase3-panel {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
  }
  #storePanel {
    width: calc(100vw - 20px);
  }
  .store-product-thumb {
    height: 120px;
  }
  .preview-watermark-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .preview-watermark-tile {
    font-size: 13px;
  }
  .dashboard-container {
    width: 96vw;
    padding: 12px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Phase 4 — Panels & Components
   ============================================ */

.phase4-panel {
  position: absolute;
  z-index: 1000;
  bottom: 80px;
  left: calc(10px + var(--skylens-left-dock, 0px)); /* beside the GIS Explorer rail */
  width: 300px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: #e5e7eb;
  font-size: 13px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.phase4-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #111827;
  border-bottom: 1px solid #374151;
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: 13px;
}

/* Coordinate system buttons */
.coord-sys-btn {
  padding: 4px 12px;
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.coord-sys-btn:hover {
  background: #4b5563;
}
.coord-sys-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #2563eb;
}

/* Ortho mode buttons */
.ortho-mode-btn {
  padding: 4px 12px;
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}
.ortho-mode-btn:hover {
  background: #4b5563;
}
.ortho-mode-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #2563eb;
}

.gis-view-mode-controls {
  position: absolute;
  top: 82px;
  right: 10px;
  z-index: 170;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(75, 85, 99, 0.9);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gis-view-mode-controls .ortho-mode-btn {
  min-width: 44px;
  padding: 4px 10px;
  flex: 0 0 auto;
}

/* KPI progress bar */
.kpi-progress-fill {
  transition: width 0.5s ease;
}

/* Photo lightbox */
.photo-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.photo-lightbox-content img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.photo-pano-viewer {
  width: 85vw;
  height: 75vh;
  max-width: 1200px;
  max-height: 80vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #000;
}

.photo-pano-fallback {
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
}

.photo-add-url-box {
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px;
  background: rgba(17,24,39,0.6);
}

.photo-lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 10001;
}

.photo-lightbox-caption {
  color: #e5e7eb;
  margin-top: 10px;
  font-size: 14px;
}

.photo-lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  color: #e5e7eb;
  font-size: 13px;
}

.photo-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 18px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.photo-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   Tel Aviv Municipal GIS Layers — tree view,
   checkboxes and right-click context menu
   ============================================ */

.tlv-tree-container {
  max-height: 320px;
  overflow-y: auto;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px;
}

.tlv-display-mode-row,
.tlv-cadastre-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.tlv-cadastre-card {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px;
}

.tlv-cadastre-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tlv-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #d1d5db;
  user-select: none;
}

.tlv-tree-row:hover {
  background: #1f2937;
}

.tlv-tree-chevron {
  width: 14px;
  text-align: center;
  color: #9ca3af;
  font-size: 10px;
  flex-shrink: 0;
}

.tlv-tree-checkbox {
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

.tlv-tree-icon {
  width: 16px;
  text-align: center;
  color: #60a5fa;
  font-size: 11px;
  flex-shrink: 0;
}

.tlv-tree-label {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tlv-tree-children {
  border-right: 1px dashed #374151;
  margin-right: 12px;
}

.tlv-context-menu {
  position: fixed;
  z-index: 3000;
  min-width: 200px;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 4px;
  direction: rtl;
}

.tlv-context-menu-title {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  border-bottom: 1px solid #374151;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.tlv-context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #e5e7eb;
  border-radius: 5px;
  cursor: pointer;
}

.tlv-context-menu-item:hover {
  background: #374151;
}

.tlv-context-menu-item i {
  width: 14px;
  text-align: center;
  color: #9ca3af;
}

.tlv-context-menu-danger {
  color: #f87171;
}

.tlv-context-menu-danger i {
  color: #f87171;
}

/* ============================================
   Radius Search — results list
   ============================================ */

.radius-results-container {
  max-height: 220px;
  overflow-y: auto;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px;
}

.radius-result-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #d1d5db;
}

.radius-result-row:hover {
  background: #1f2937;
}

.radius-result-index {
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b;
  color: #111827;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radius-result-row i {
  color: #60a5fa;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.radius-result-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radius-result-type {
  color: #9ca3af;
  font-size: 10px;
  flex-shrink: 0;
}

.radius-result-distance {
  color: #34d399;
  font-weight: 600;
  flex-shrink: 0;
}

/* ============================================
  GIS Explorer sidebar — model/server tree,
  My Layers + active layers (left docked)
   ============================================ */

.gis-explorer-sidebar {
  position: absolute;
  z-index: 1001;
  top: 50px;
  bottom: 60px;
  left: 0;
  width: 330px;
  background: #1f2937;
  border-left: 1px solid #374151;
  border-right: 1px solid #374151;
  color: #e5e7eb;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
}

.gis-explorer-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gis-servers-section {
  flex: 1 1 45%;
  border-bottom: 2px solid #111827;
}

.gis-active-section {
  flex: 1 1 55%;
}

.gis-explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.gis-explorer-tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  min-height: 0;
}

.gis-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #d1d5db;
  user-select: none;
}

.gis-model-layers-branch {
  border-bottom: 1px solid #374151;
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.gis-model-layer-controls {
  padding: 2px 4px 4px 12px;
}

.gis-model-layer-controls #layerPanel {
  padding: 0;
}

.gis-tree-row:hover {
  background: #374151;
}

.gis-server-row {
  font-weight: 600;
  color: #93c5fd;
}

.gis-active-row {
  background: #111827;
  margin-bottom: 2px;
}

.gis-tree-chevron {
  width: 14px;
  text-align: center;
  color: #9ca3af;
  font-size: 10px;
  flex-shrink: 0;
}

.gis-tree-icon {
  width: 16px;
  text-align: center;
  color: #60a5fa;
  font-size: 11px;
  flex-shrink: 0;
}

.gis-tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gis-tree-children {
  border-right: 1px dashed #374151;
  margin-right: 10px;
}

.gis-tree-note {
  padding: 6px 10px;
  color: #9ca3af;
  font-size: 11px;
}

.gis-tree-checkbox {
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

.gis-layer-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid #fff3;
}

.gis-layer-color-picker {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #ffffff4d;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.gis-layer-color-picker::-webkit-color-swatch-wrapper {
  padding: 1px;
}

.gis-layer-color-picker::-webkit-color-swatch {
  border: 0;
  border-radius: 2px;
}

.gis-layer-color-picker:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.gis-layer-count {
  color: #34d399;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.gis-layer-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.gis-action-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
}

.gis-action-btn:hover {
  background: #4b5563;
  color: #e5e7eb;
}

.gis-action-danger:hover {
  color: #f87171;
}

.gis-objects-list {
  margin-right: 20px;
  border-right: 1px dashed #374151;
  max-height: 180px;
  overflow-y: auto;
}

.gis-object-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 3px;
}

.gis-object-row:hover {
  background: #374151;
  color: #e5e7eb;
}

.gis-object-row i {
  font-size: 9px;
  color: #60a5fa;
}

/* --- Backend GIS catalog: Planning section, catalog rows and the feature
       card (planning.urban_renewal_declared, ...) --- */
.gis-catalog-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-bottom: 1px solid #1f2937;
}
.gis-catalog-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gis-catalog-count {
  font-size: 10px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.gis-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
}
.gis-badge-auth {
  background: #92400e;
  color: #fde68a;
}
/* --- Import wizard (scripts/import-wizard.js): unified layer-import modal
       opened by the bottom-menu Import tool -> OpenLayerImport --- */
.import-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000; /* above the global #spinnerDiv (z-[99999]) — the modal is always topmost */
  background: rgba(2, 6, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.import-wizard-overlay.hidden {
  display: none;
}
/* "Pick on map" temporarily steps the modal aside so the click can reach the
   Cesium canvas. The wizard stays OPEN (isOpen() reads .hidden) — Esc, a
   successful pick, or closing the form all restore it. */
.import-wizard-overlay.map-picking {
  display: none;
}
.import-wizard {
  width: min(460px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.97);
  border: 1px solid #374151;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  color: #e5e7eb;
  font-size: 12px;
}
.import-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #374151;
  font-weight: 600;
}
.import-wizard-body {
  padding: 12px;
  overflow-y: auto;
}
.import-wizard-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.import-wizard-view.hidden {
  display: none;
}
.import-wizard-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 12px;
  border: 2px dashed #4b5563;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  color: #cbd5e1;
  transition: border-color 0.15s, background 0.15s;
}
.import-wizard-dropzone:hover,
.import-wizard-dropzone:focus-visible,
.import-wizard-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  outline: none;
}
.import-wizard-dropzone i {
  font-size: 26px;
  color: #38bdf8;
}
.import-wizard-dropzone-title {
  font-size: 13px;
  font-weight: 600;
}
.import-wizard-folder-btn {
  align-self: center;
  margin-top: -4px; /* tucks under the drop zone it complements */
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
}
/* My Projects (project index) — rows follow the shared anatomy:
   icon · name · badges · count · ⋯ */
.project-index-list {
  display: flex;
  flex-direction: column;
  max-height: 46vh;
  overflow-y: auto;
}
.project-index-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #2a3548;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.project-index-row:hover,
.project-index-row:focus-visible {
  background: #243041;
  outline: none;
}
.project-index-icon {
  color: #38bdf8;
  width: 16px;
  text-align: center;
}
.project-index-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-index-role {
  font-size: 10px;
  color: #9ca3af;
  background: #1a2536;
  border: 1px solid #2a3548;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
/* Two-line project cell: name on top, owner · client · content summary below. */
.project-index-namecell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.project-index-namecell .project-index-name {
  flex: 0 0 auto;
}
.project-index-sub {
  font-size: 10px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-index-sub .owner { color: #94a3b8; }
.project-index-sub .client { color: #fbbf24; }  /* amber marks the client party */
/* Project detail — per-family content sections (reality models, layers, …). */
.project-index-section { margin-top: 4px; }
.project-index-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 2px 2px;
}
.project-index-section-head .count { color: #6b7280; font-weight: 400; }
.project-index-section .project-index-list { max-height: none; }
.project-index-row--static { cursor: default; }
.project-index-row--static:hover { background: transparent; }
.project-index-empty-fam {
  font-size: 11px;
  color: #6b7280;
  padding: 4px 8px;
}
/* Projects panel = a card grid of reality models (one PNG preview per model).
   Widen the shared wizard shell so 3–4 cards sit per row. */
.project-index {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(88vh, 780px);
}
.pi-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pi-toolbar .pi-count {
  color: #9ca3af;
  font-size: 12px;
  margin-right: auto;
}
.pi-toolbar .phase3-select {
  width: auto;
  min-width: 128px;
}
.pi-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  overflow-y: auto;
}
.pi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pi-card:hover,
.pi-card:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  outline: none;
}
.pi-card--static,
.pi-card--static:hover {
  cursor: default;
  border-color: #374151;
  box-shadow: none;
}
.pi-card-thumb {
  position: relative;
  height: 118px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pi-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pi-card-ph {
  font-size: 34px;
  color: #4b5563;
}
.pi-status {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  text-transform: capitalize;
  background: #6b7280;
}
.pi-status-available,
.pi-status-active { background: #16a34a; }
.pi-status-processing { background: #ca8a04; }
.pi-status-archived { background: #6b7280; }
.pi-card-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pi-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #f3f4f6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pi-card-sub {
  font-size: 11px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pi-card-sub .pi-client { color: #fbbf24; }  /* amber marks the client party */
.pi-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  min-height: 16px;
  font-size: 10px;
  color: #6b7280;
}
.pi-card-meta .pi-type {
  background: #374151;
  color: #cbd5e1;
  border-radius: 4px;
  padding: 0 5px;
}
.pi-card-meta .pi-dot { color: #4b5563; }
.pi-card-menu { margin-left: auto; }
/* System-admin asset catalog (mockup layout in the Skylens dark palette) */
.admin-assets { width: min(920px, 96vw); max-height: min(88vh, 760px); }
.admin-assets .import-wizard-view { gap: 10px; }
.aa-filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) repeat(4, minmax(90px, 1fr));
  gap: 8px;
}
.aa-filters input,
.aa-filters select { width: 100%; }
.aa-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.aa-toolbar-actions { display: flex; gap: 6px; }
.aa-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid #2a3548;
}
.aa-selection-bar.hidden { display: none; }
.aa-table {
  border: 1px solid #2a3548;
  border-radius: 8px;
  overflow: hidden;
}
.aa-row {
  display: grid;
  grid-template-columns: 26px minmax(150px, 1.5fr) minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(96px, 0.8fr) 96px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  font-size: 12px;
}
.aa-head {
  background: #1a2536;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
  border-bottom: 1px solid #2a3548;
}
.aa-asset-row {
  border-bottom: 1px solid #2a3548;
}
.aa-asset-row:last-child { border-bottom: 0; }
.aa-asset-row:hover { background: #243041; }
.aa-cell-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aa-name {
  border: 0;
  background: transparent;
  color: #e5e7eb;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aa-name i { color: #38bdf8; }
.aa-name:hover { color: #38bdf8; }
.aa-meta { color: #64748b; font-size: 10px; }
.aa-col-scope,
.aa-col-reg { min-width: 0; color: #9ca3af; overflow-wrap: anywhere; }
.aa-chat { display: flex; align-items: center; gap: 5px; color: #64748b; font-size: 10px; margin-top: 2px; }
.aa-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}
.aa-chip-neutral { background: #1a2536; color: #9ca3af; border: 1px solid #2a3548; }
.aa-chip-info { background: rgba(56, 189, 248, 0.14); color: #38bdf8; }
.aa-chip-success { background: rgba(52, 211, 153, 0.14); color: #34d399; }
.aa-chip-warning { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.aa-chip-danger { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.aa-tabs { display: flex; gap: 4px; border-bottom: 1px solid #2a3548; }
.aa-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #9ca3af;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 12px;
}
.aa-tabs button[aria-selected="true"] { color: #38bdf8; border-color: #38bdf8; font-weight: 600; }
.aa-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #2a3548;
  font-size: 12px;
}
.aa-kv > span:first-child { color: #9ca3af; }
.aa-section { border-top: 1px solid #2a3548; padding-top: 8px; font-size: 12px; }
.aa-section b { display: block; font-size: 11px; margin-bottom: 4px; }
.aa-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.aa-step {
  border-top: 3px solid #2a3548;
  padding-top: 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}
.aa-step.is-active { border-color: #38bdf8; color: #38bdf8; }
.aa-step.is-done { border-color: #34d399; color: #34d399; }
.aa-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aa-summary-item {
  border: 1px solid #2a3548;
  border-radius: 8px;
  padding: 9px;
  background: #1a2536;
}
.aa-summary-item span { display: block; color: #64748b; font-size: 10px; }
.aa-summary-item strong { display: block; margin-top: 3px; font-size: 15px; }
.aa-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.aa-field > label { font-size: 11px; color: #9ca3af; }
.aa-field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aa-radio-group { display: grid; gap: 8px; }
.aa-radio {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #2a3548;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 12px;
}
.aa-radio.is-selected { border-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }
.aa-radio strong { display: block; }
.aa-radio small { display: block; color: #9ca3af; margin-top: 2px; }
.aa-impact-item { border-top: 1px solid #2a3548; padding-top: 8px; }
.aa-path {
  direction: ltr;
  border: 1px solid #2a3548;
  border-radius: 6px;
  background: #111827;
  color: #9ca3af;
  padding: 7px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
  margin: 5px 0;
}
@media (max-width: 720px) {
  .aa-filters { grid-template-columns: 1fr 1fr; }
  .aa-row { grid-template-columns: 24px minmax(0, 1fr) 90px; }
  .aa-col-kind, .aa-col-scope, .aa-col-reg { display: none; }
  .aa-field-2, .aa-summary { grid-template-columns: 1fr; }
}
.import-wizard-folder-btn:hover,
.import-wizard-folder-btn:focus-visible {
  background: rgba(56, 189, 248, 0.12);
  outline: none;
}
.import-wizard-hint {
  font-size: 10px;
  opacity: 0.75;
}
.import-wizard-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  opacity: 0.6;
}
.import-wizard-divider::before,
.import-wizard-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #374151;
}
.import-wizard-sources {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.import-wizard-source-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
}
.import-wizard-source-btn:hover,
.import-wizard-source-btn:focus-visible {
  border-color: #38bdf8;
  background: #243041;
  outline: none;
}
.import-wizard-source-btn i {
  font-size: 16px;
  color: #38bdf8;
}
.import-wizard-source-btn small {
  display: block;
  font-size: 9px;
  opacity: 0.65;
}
.import-wizard-detection {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid #374151;
  border-radius: 8px;
}
.import-wizard-detection-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.import-wizard-detection-head i {
  color: #38bdf8;
}
.import-wizard-warn {
  color: #fbbf24;
  font-size: 11px;
}
.import-wizard-error {
  color: #f87171;
  font-size: 11px;
}
.import-wizard-cad-epsg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.import-wizard-cad-epsg input {
  width: 90px;
}
.import-wizard-dest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #374151;
  border-radius: 8px;
}
/* Two-column rows for the Architectural / BIM import form. */
.import-wizard-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 0;
}
#bimImportForm .phase3-text-input {
  width: 100%;
  margin: 4px 0;
}
/* Picked-feature BIM object popup (Viewer). */
.bim-feature-popup {
  position: fixed;
  z-index: 1200;
  min-width: 240px;
  max-width: 320px;
  max-height: 60vh;
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  display: none;
}
.bim-feature-popup.visible {
  display: block;
}
.bim-feature-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #374151;
}
.bim-feature-popup-head button {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
}
.bim-feature-popup-body {
  padding: 8px 10px;
}
.bim-feature-pset {
  margin-top: 6px;
  font-weight: 600;
  opacity: 0.8;
}
.bim-feature-prop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 0;
}
.bim-feature-prop span:last-child {
  opacity: 0.85;
  text-align: right;
}
.import-wizard-dest.hidden {
  display: none;
}
.import-wizard-dest legend {
  font-size: 11px;
  padding: 0 4px;
  opacity: 0.8;
}
.import-wizard-dest label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.import-wizard-dest small {
  opacity: 0.65;
}
.import-wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.import-wizard-primary {
  border-color: #0ea5e9;
}
.import-wizard-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.import-wizard-status {
  padding: 8px 12px;
  border-top: 1px solid #374151;
  font-size: 11px;
  color: #fbbf24;
}
.import-wizard-status:empty {
  display: none;
}
/* Photos & 360 view: solution reports + panorama confirmation list. */
.import-wizard-extras {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.photo-import-pano-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e5e7eb;
  padding: 3px 4px;
  border-radius: 5px;
}
.photo-import-pano-row:hover {
  background: #243041;
}
.photo-import-pano-row small {
  color: #9ca3af;
}
/* Photos & 360 ownership + panorama declaration (scripts/import-wizard.js
   markup, scripts/photo-import.js behaviour). */
.photo-import-ownership,
.photo-import-declaration {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.photo-import-declaration.hidden {
  display: none;
}
.photo-import-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: #9ca3af;
}
.photo-import-field > span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.photo-import-placement {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px;
  margin: 0;
}
.photo-import-placement.hidden {
  display: none;
}
.photo-import-placement legend {
  font-size: 10px;
  color: #9ca3af;
  padding: 0 4px;
}
.photo-import-check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: #e5e7eb;
}
.photo-import-check small {
  color: #9ca3af;
}
/* Inline camera-height editor under a Photo Collection row (GIS Explorer).
   The sidebar is too narrow for a modal and a prompt() cannot carry the unit
   or the "still approximate" caveat, so it renders in place. */
.photo-height-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin: 2px 0 6px;
  border: 1px solid #334155;
  border-left: 2px solid #38bdf8;
  border-radius: 6px;
  background: #1a2332;
}
.photo-height-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.photo-height-actions {
  display: flex;
  gap: 6px;
}

/* Inline "create a new project" row inside the ownership block — revealed by
   the "Create a new project…" option, never a second modal. */
.photo-import-newproject {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #334155;
  border-left: 2px solid #38bdf8;
  border-radius: 6px;
  padding: 8px;
}
.photo-import-newproject.hidden {
  display: none;
}
.photo-import-newproject-actions {
  display: flex;
  gap: 6px;
}
#photoImportReloadOwnership.hidden {
  display: none;
}
@media (max-width: 480px) {
  .import-wizard-sources {
    grid-template-columns: 1fr;
  }
}
.gis-feature-card {
  position: absolute;
  top: 72px;
  inset-inline-end: 16px;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  color: #e5e7eb;
  font-size: 12px;
}
.gis-feature-card.hidden {
  display: none;
}
.gis-feature-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #374151;
  font-weight: 600;
}
.gis-feature-card-body {
  padding: 8px 10px;
}
.gis-feature-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #1f2937;
}
.gis-feature-row .k {
  flex: 0 0 42%;
  opacity: 0.7;
}
.gis-feature-row .v {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.gis-server-search-row {
  padding: 6px;
  border-bottom: 1px solid #374151;
  background: #111827;
  flex-shrink: 0;
}

.gis-server-search-row input {
  width: 100%;
}

.gis-explorer-status {
  padding: 6px 10px;
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid #374151;
  flex-shrink: 0;
  max-height: 48px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .gis-explorer-sidebar {
    width: calc(100vw - 40px);
  }
}

/* ============================================
   Skylens Chat Assistant
   ============================================ */
#chatPanel {
  position: absolute;
  right: 12px;
  bottom: 72px;
  width: 360px;
  max-height: min(560px, calc(100vh - 140px));
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  z-index: 1002;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

#chatPanel.hidden {
  display: none;
}

.chat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.chat-panel-header i {
  margin-right: 6px;
  color: #60a5fa;
}

.chat-status {
  padding: 3px 12px;
  font-size: 11px;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
  min-height: 20px;
}

.chat-status-muted { color: #9ca3af; }
.chat-status-ok { color: #34d399; }
.chat-status-error { color: #f87171; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}

.chat-msg {
  display: flex;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 85%;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-user .chat-bubble {
  background: #3b82f6;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-msg-assistant .chat-bubble {
  background: #111827;
  border: 1px solid #374151;
  color: #d1d5db;
  border-bottom-left-radius: 3px;
}

.chat-bubble-thinking {
  color: #9ca3af;
  font-style: italic;
  animation: chatPulse 1.2s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.chat-action-note {
  align-self: center;
  color: #34d399;
  font-size: 10px;
  padding: 0 6px;
}

.chat-action-note i {
  margin-right: 4px;
}

/* Active AOI spatial-context indicator (works in RTL and LTR layouts) */
.chat-aoi-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 5px 10px;
  border-top: 1px solid #374151;
  background: #111827;
  font-size: 11px;
  color: #93c5fd;
  flex-shrink: 0;
}

.chat-aoi-indicator.hidden {
  display: none;
}

.chat-aoi-indicator.chat-aoi-detached {
  color: #9ca3af;
}

.chat-aoi-indicator-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.chat-aoi-indicator-main i {
  color: #60a5fa;
  flex-shrink: 0;
}

.chat-aoi-indicator.chat-aoi-detached .chat-aoi-indicator-main i {
  color: #6b7280;
}

.chat-aoi-indicator-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-aoi-btn {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 5px;
  color: #d1d5db;
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
}

.chat-aoi-btn:hover {
  background: #374151;
  color: #fff;
}

.chat-aoi-share {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

.chat-aoi-share input {
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Segmentation confirmation / convert cards inside chat messages */
.chat-seg-card {
  background: #111827;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-seg-card-title {
  font-weight: 600;
  color: #93c5fd;
  font-size: 12px;
}

.chat-seg-card-row {
  color: #9ca3af;
}

.chat-seg-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  color: #6b7280;
}

.chat-seg-run-btn {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #fff;
}

.chat-seg-run-btn:hover {
  background: #2563eb;
}

.chat-seg-card-done {
  opacity: 0.65;
  border-color: #4b5563;
}

/* My Layers tree (GIS Explorer persistent section) */
.gis-my-layers-section .gis-explorer-tree {
  max-height: 180px;
  overflow-y: auto;
}

.gis-my-layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gis-my-layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gis-my-layer-group {
  font-weight: 600;
  color: #93c5fd;
}

.gis-my-layer-badge {
  background: #7c2d12;
  color: #fdba74;
  border-radius: 4px;
  font-size: 9px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.gis-my-layer-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.gis-my-layer-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  margin-top: 4px;
}

.gis-my-layer-hint {
  font-size: 9px;
  color: #9ca3af;
  flex-shrink: 0;
  white-space: nowrap;
}

.gis-my-layer-active .gis-my-layer-name {
  color: #93c5fd;
}

.gis-my-layer-group .gis-my-layer-actions {
  margin-inline-start: auto;
}

/* ---------- Doc 09 frontend integration ---------- */

.gis-tree-row-selected {
  background: rgba(59, 130, 246, 0.18);
  outline: 1px solid rgba(59, 130, 246, 0.45);
}

.gis-my-layer-review {
  background: #1e3a8a;
  color: #bfdbfe;
}

.gis-my-layer-warn {
  color: #fbbf24;
  font-size: 10px;
  flex-shrink: 0;
}

.gis-search-results {
  max-height: 180px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 4px;
}

.gis-search-results.hidden {
  display: none;
}

.gis-search-group-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  padding: 4px 6px 2px;
}

.gis-search-result-row {
  font-size: 11px;
  color: #d1d5db;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.gis-search-result-row:hover,
.gis-search-result-row:focus {
  background: rgba(59, 130, 246, 0.2);
  outline: none;
}

.gis-context-menu {
  position: fixed;
  z-index: 10000;
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  padding: 4px;
  display: flex;
  flex-direction: column;
  min-width: 170px;
}

.gis-context-menu-item {
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 12px;
  text-align: right;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.gis-context-menu-item:hover,
.gis-context-menu-item:focus {
  background: rgba(59, 130, 246, 0.25);
}

.chat-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-context-chips.hidden {
  display: none;
}

.chat-context-chip {
  font-size: 10px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DB-grounding chip (skill: skylens-chat-database): grounded answers available? */
.chat-chip-db-connected {
  color: #86efac;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
}

.chat-chip-db-offline {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}

.chat-job-card .chat-seg-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid #374151;
  background: #111827;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-width: 0;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 12px;
  resize: none;
  outline: none;
  max-height: 72px;
}

.chat-input:focus {
  border-color: #3b82f6;
}

.chat-lang-select {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 10px;
  padding: 5px 2px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

.chat-btn {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #d1d5db;
  cursor: pointer;
  font-size: 12px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.chat-btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.chat-btn-active {
  color: #60a5fa;
  border-color: #3b82f6;
}

.chat-send-btn {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.chat-send-btn:hover {
  background: #2563eb;
}

.chat-mic-active {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
  animation: chatPulse 1s ease-in-out infinite;
}

@media (max-width: 640px) {
  #chatPanel {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* ============================================
   Phase 4 — Responsive
   ============================================ */

@media (max-width: 640px) {
  .phase4-panel {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
  }
}


/* ============================================
   Building Entity Draft Review popup (PROMPT 14)
   ============================================ */

#beReviewPopup {
  position: fixed;
  right: 12px;
  top: 70px;
  width: 300px;
  z-index: 60;
  background: rgba(17, 24, 39, 0.95);
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

#beReviewPopup.hidden {
  display: none;
}

.be-review-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #374151;
  font-weight: 600;
}

.be-review-popup-header button {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.be-review-popup-header button:hover {
  color: #f3f4f6;
}

.be-review-popup-body {
  padding: 8px 12px;
  max-height: 40vh;
  overflow-y: auto;
}

.be-review-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.be-review-row span:first-child {
  color: #9ca3af;
  white-space: nowrap;
}

.be-review-row span:last-child {
  text-align: right;
  word-break: break-word;
}

.be-review-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #374151;
}

.be-review-popup-actions button {
  flex: 1 1 45%;
  background: #1f2937;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 12px;
  cursor: pointer;
}

.be-review-popup-actions button:hover:not(:disabled) {
  background: #374151;
}

.be-review-popup-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#beReviewPopupStatus {
  padding: 6px 12px 10px;
}

/* ============================================
   User Spatial Layers
   ============================================ */

#userLayersPanel {
  position: absolute;
  top: 60px;
  left: calc(10px + var(--skylens-left-dock, 0px)); /* beside the GIS Explorer rail */
  z-index: 50;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #e5e7eb;
  width: 320px;
  max-height: calc(100vh - 230px);
  display: none;
  flex-direction: column;
}
#userLayersPanel.active {
  display: flex;
}

.user-layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.user-layer-row:hover { background: rgba(255,255,255,0.05); }
.user-layer-drag {
  cursor: grab;
  color: #6b7280;
  padding: 0 2px;
  font-size: 12px;
  flex: 0 0 auto;
}
.user-layer-drag:active { cursor: grabbing; }
.user-layer-row:hover .user-layer-drag { color: #9ca3af; }
.sortable-ghost { opacity: 0.4; }
.user-layer-row-active {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.12);
}

.user-layer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-layer-name-wrap { flex: 1; min-width: 0; }
.user-layer-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-layer-meta {
  font-size: 10px;
  color: #9ca3af;
}

#userLayerDrawTools {
  border-top: 1px solid #374151;
  padding: 8px;
}

.user-layer-draw-buttons {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.user-layer-draw-buttons button {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: #374151;
  color: #e5e7eb;
  font-size: 11px;
  cursor: pointer;
}
.user-layer-draw-buttons button:hover:not(:disabled) { background: #4b5563; }
.user-layer-draw-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }
.user-layer-draw-buttons button.user-layer-draw-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.user-layer-status {
  margin-top: 6px;
  font-size: 11px;
  color: #93c5fd;
  min-height: 14px;
}

/* Style editor + feature inspector share the annotation editor look */
#userLayerStyleEditor,
#userFeatureInspector {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 10px;
  color: #e5e7eb;
  width: 320px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
#userLayerStyleEditor.hidden,
#userFeatureInspector.hidden { display: none; }

/* While editing geometry, dock the inspector so map clicks are not blocked */
#userFeatureInspector.user-inspector-docked {
  top: 70px;
  left: auto;
  right: 10px;
  transform: none;
}

.user-feature-inspector-body {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.user-feature-geom-badge {
  font-size: 10px;
  font-weight: 600;
  background: #374151;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  color: #93c5fd;
}

.user-feature-style-fields {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
}
.user-feature-style-fields input[type="color"] {
  vertical-align: middle;
  margin-left: 4px;
  width: 32px;
  height: 20px;
  padding: 0;
  border: 1px solid #4b5563;
  background: #374151;
}

.user-attachment-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  font-size: 12px;
}
.user-attachment-row i { color: #9ca3af; font-size: 11px; }
.user-attachment-link {
  flex: 1;
  min-width: 0;
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-attachment-link:hover { text-decoration: underline; }

.user-attachment-add {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  align-items: center;
}
.user-attachment-add input[type="text"],
.user-attachment-add input[type="url"] {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: #374151;
  color: #e5e7eb;
  font-size: 11px;
}

.user-feature-tool-btn {
  padding: 7px 10px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: #374151;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
}
.user-feature-tool-btn:hover { background: #4b5563; }
.user-feature-apply-geom {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

/* ============================================
   Spatial OS viewer integration
   ============================================ */
.spatial-os-layer-section { border-top: 1px solid #334155; margin-top: 6px; padding-top: 6px; }
.spatial-os-layer-title { font-size: 10px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.1em; padding: 10px 4px 4px; }

.spatial-os-context-panel {
  position: absolute; top: 70px; right: 12px; width: 300px; z-index: 30;
  background: rgba(15, 23, 42, 0.95); border: 1px solid #334155; border-radius: 10px;
  color: #e2e8f0; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.spatial-os-context-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid #334155; font-weight: 700; font-size: 13px;
}
.spatial-os-context-close { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 14px; }
.spatial-os-context-close:hover { color: #f8fafc; }
#spatialOsContextBody { padding: 8px 12px; max-height: 260px; overflow-y: auto; }
.spatial-os-context-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #1e293b; }
.spatial-os-context-key { color: #94a3b8; flex-shrink: 0; }
.spatial-os-context-value { text-align: right; word-break: break-all; }
#spatialOsContextActions { display: flex; gap: 6px; padding: 8px 12px; }
.spatial-os-action-btn {
  flex: 1; padding: 6px 0; border: none; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #fff;
}
.spatial-os-approve { background: #16a34a; }
.spatial-os-approve:hover { background: #15803d; }
.spatial-os-reject { background: #dc2626; }
.spatial-os-reject:hover { background: #b91c1c; }
.spatial-os-regenerate { background: #475569; }
.spatial-os-regenerate:hover { background: #334155; }

.spatial-os-job-progress {
  position: absolute; bottom: 76px; right: 12px; z-index: 25;
  background: rgba(15, 23, 42, 0.9); border: 1px solid #334155; border-radius: 8px;
  color: #cbd5e1; font-size: 11px; padding: 6px 10px; max-width: 320px;
}
.spatial-os-job-row { padding: 2px 0; }

.spatial-os-status {
  position: absolute; bottom: 76px; left: calc(12px + var(--skylens-left-dock, 0px)); z-index: 25;
  background: rgba(15, 23, 42, 0.9); border: 1px solid #334155; border-radius: 8px;
  color: #cbd5e1; font-size: 11px; padding: 6px 10px; max-width: 340px;
}


/* ============================================================
   Skylens UI kit + GIS Explorer two-tab shell
   Design language: .claude/skills/skylens-ui-design
   ============================================================ */

/* ---------- shared primitives (scripts/ui-kit.js) ---------- */

.sky-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 5px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}
.sky-icon-btn:hover,
.sky-icon-btn:focus-visible {
  background: rgba(148, 163, 184, 0.16);
  color: #e5e7eb;
  outline: none;
}
.sky-eye-btn.sky-eye-on {
  color: #38bdf8;
}

.sky-menu {
  position: fixed;
  z-index: 100001;
  min-width: 190px;
  background: #1a2536;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  padding: 4px;
}
.sky-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 7px 9px;
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.sky-menu button:hover,
.sky-menu button:focus-visible {
  background: #243041;
  outline: none;
}
.sky-menu button i {
  width: 14px;
  text-align: center;
  color: #9ca3af;
  flex-shrink: 0;
}
.sky-menu button.sky-menu-danger,
.sky-menu button.sky-menu-danger i {
  color: #f87171;
}
.sky-menu hr {
  border: none;
  border-top: 1px solid #2a3548;
  margin: 4px 6px;
}

.sky-toasts {
  position: fixed;
  left: 50%;
  bottom: 76px; /* above the bottom menu */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100002;
  pointer-events: none;
}
.sky-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a2536;
  border: 1px solid #374151;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  color: #e5e7eb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: sky-toast-in 0.18s ease-out;
}
@keyframes sky-toast-in {
  from { opacity: 0; transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .sky-toast { animation: none; }
}
.sky-toast-undo {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sky-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 22px 16px;
  color: #9ca3af;
  font-size: 12px;
}
.sky-empty > i {
  font-size: 22px;
  color: #64748b;
}
.sky-empty-error > i {
  color: #fbbf24;
}
.sky-empty-title {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 12.5px;
}
.sky-empty p {
  margin: 0;
  max-width: 30ch;
}
.sky-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.sky-btn:hover,
.sky-btn:focus-visible {
  background: rgba(56, 189, 248, 0.2);
  outline: none;
}

/* ---------- GIS Explorer: titlebar, tabs, accordion ---------- */

.gis-explorer-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111827;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.gis-explorer-titlebar i {
  color: #38bdf8;
  margin-right: 6px;
}

.gis-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 10px 0;
  padding: 3px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  flex-shrink: 0;
}
.gis-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.gis-tab.active {
  background: #243041;
  color: #e5e7eb;
}
.gis-tab-count {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 16px;
}

.gis-tab-panel {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gis-tab-panel.hidden {
  display: none;
}
.gis-tab-panel .gis-explorer-tree {
  flex: 1;
  padding: 0;
}

.gis-acc {
  border: 1px solid #2a3548;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.gis-acc.open {
  display: flex;
  flex-direction: column;
  flex-shrink: 1;
  min-height: 0;
}
.gis-acc-h {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #111827;
  border: none;
  color: #e5e7eb;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}
.gis-acc-icon {
  color: #38bdf8;
  width: 15px;
  text-align: center;
  flex-shrink: 0;
}
.gis-acc-n {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.gis-acc-spacer {
  flex: 1;
}
.gis-acc-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
}
.gis-acc-cta:hover,
.gis-acc-cta:focus-visible {
  background: rgba(56, 189, 248, 0.22);
  outline: none;
}
.gis-acc-chev {
  color: #64748b;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.gis-acc.open .gis-acc-chev {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .gis-acc-chev { transition: none; }
}
.gis-acc-body {
  display: none;
}
.gis-acc.open .gis-acc-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  background: #1f2937;
}

/* Row hover reveals actions; rows stay quiet at rest. */
.gis-my-layer-actions,
.gis-layer-actions {
  opacity: 0;
  transition: opacity 0.12s;
}
.gis-tree-row:hover .gis-my-layer-actions,
.gis-tree-row:focus-within .gis-my-layer-actions,
.gis-tree-row:hover .gis-layer-actions,
.gis-tree-row:focus-within .gis-layer-actions {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .gis-my-layer-actions,
  .gis-layer-actions { transition: none; }
}

/* ---------- left dock: panels slide beside/back as the rail opens ---------- */

.phase3-panel,
.phase4-panel,
#annotationPanel,
#cutfillPanel,
#userLayersPanel,
.spatial-os-status {
  transition: left 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
  .phase3-panel,
  .phase4-panel,
  #annotationPanel,
  #cutfillPanel,
  #userLayersPanel,
  .spatial-os-status {
    transition: none;
  }
}

/* ---------- model rows (#layerPanel) — unified anatomy ---------- */

.layer-item-icon {
  color: #9ca3af;
  flex-shrink: 0;
  font-size: 12px;
}
.layer-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #d1d5db;
}
.layer-item-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
}
.layer-item:hover .layer-item-actions,
.layer-item:focus-within .layer-item-actions {
  opacity: 1;
}
.layer-height-controls.hidden {
  display: none;
}
.layer-height-done {
  margin-left: auto;
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
}
.layer-height-done:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* ---------------------------------------------------------------------------
   Project → AI → Memory & Dreams (Spatial Dream Cycle).

   Four knowledge kinds must stay visually distinct and must never be encoded
   in colour alone — every chip carries its label:
     approved   green   an activated, reviewed memory item
     candidate  amber   unreviewed dream output
     hypothesis violet  an open hypothesis or an unresolved contradiction
     danger/warn/info/ok  run + finding severity
   Tokens only (see .claude/skills/skylens-ui-design).
   --------------------------------------------------------------------------- */

.agent-memory-panel {
  left: calc(10px + var(--skylens-left-dock, 0px)); /* beside the GIS Explorer rail */
  width: 420px;
  max-height: 78vh;
}
.agent-memory-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mem-section {
  border-top: 1px solid #2a3548;
  padding-top: 10px;
}
.mem-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.mem-section h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}
.mem-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.mem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.mem-hash {
  font-size: 10px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}
.mem-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* One row anatomy: icon, body, badge, overflow menu. */
.mem-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #1f2937;
  cursor: default;
}
.mem-row:hover,
.mem-row:focus-within {
  background: #243041;
}
.mem-row:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}
.mem-row-selected {
  background: rgba(56, 189, 248, 0.12);
}
.mem-row-icon {
  color: #64748b;
  font-size: 11px;
  flex: 0 0 auto;
}
.mem-row-body {
  flex: 1 1 auto;
  min-width: 0;
}
.mem-row-title {
  font-size: 12px;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mem-row-sub {
  font-size: 10px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mem-row-warn {
  font-size: 10px;
  color: #fbbf24;
  margin-top: 2px;
}

/* Chips — label always present, colour is reinforcement only. */
.mem-chip {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.mem-chip-neutral   { background: #1a2536; color: #9ca3af; border-color: #374151; }
.mem-chip-info      { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.mem-chip-ok,
.mem-chip-approved  { background: rgba(52, 211, 153, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.mem-chip-warn,
.mem-chip-candidate { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.mem-chip-danger    { background: rgba(248, 113, 113, 0.12); color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
/* Hypotheses and unresolved contradictions: deliberately NOT green, so a
   proposal can never read as settled guidance. */
.mem-chip-hypothesis { background: rgba(167, 139, 250, 0.12); color: #a78bfa; border-color: rgba(167, 139, 250, 0.45); }

.mem-finding-group {
  margin-bottom: 10px;
}
.mem-finding-head {
  font-size: 11px;
  text-transform: capitalize;
  color: #9ca3af;
  margin-bottom: 4px;
}

.mem-eval {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 8px;
}
.mem-eval th {
  text-align: left;
  color: #9ca3af;
  font-weight: 500;
  padding: 4px 6px;
  border-bottom: 1px solid #2a3548;
}
.mem-eval td {
  padding: 4px 6px;
  color: #e5e7eb;
  border-bottom: 1px solid #1f2937;
}
.mem-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mem-better { color: #34d399; }
.mem-worse  { color: #f87171; }

.mem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mem-btn-primary {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}
.mem-btn-danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}
.mem-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.mem-run-btn { flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .mem-row { transition: none; }
}
