:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1e293b;
  --card-border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --danger: #ef4444;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app {
  display: flex;
  width: 100vw;
  height: 100vh;
}

#sidebar {
  width: 380px;
  min-width: 345px;
  max-width: 430px;
  background: var(--panel);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 500;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, #0f172a, #172554);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.sidebar-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.location-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #0b1120;
  border-bottom: 1px solid var(--card-border);
}

.location-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.location-bar .control {
  flex: 1;
  min-width: 0;
}

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #0b1120;
  border-bottom: 1px solid var(--card-border);
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 1px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.pill {
  display: inline-block;
  font-size: 10px;
  background: #334155;
  color: #e2e8f0;
  padding: 1px 5px;
  border-radius: 99px;
  margin-left: 2px;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.field-label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.control {
  width: 100%;
  background: #0f172a;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12.5px;
  outline: none;
}

.control:focus {
  border-color: var(--accent);
}

.control option:disabled {
  color: #64748b;
  background: #0b1120;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.row-gap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.meta-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}

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

.slider-row .field-label {
  margin-bottom: 0;
}

.slider-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 3px;
}

input[type="range"]:disabled {
  cursor: not-allowed;
}

.segmented-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 3px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35);
}

.scope-switch {
  margin-bottom: 10px;
  border-color: rgba(56, 189, 248, 0.35);
}

.scope-switch .seg-btn {
  font-size: 12px;
  padding: 7px 6px;
}

.layer-mixer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.mixer-row {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 9px 6px;
}

.mixer-row .slider-row {
  margin-top: 0;
}

.mixer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.mixer-toggle input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.orto-sub-wrap {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.mixer-hint {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
}

.overlay-group {
  border: 1px solid #334155;
  background: #0f172a;
  border-radius: 8px;
  padding: 7px 9px;
  margin-bottom: 8px;
}

.overlay-group:last-child {
  margin-bottom: 0;
}

.overlay-summary {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overlay-summary::-webkit-details-marker {
  display: none;
}

.overlay-summary::after {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}

.overlay-group[open] .overlay-summary::after {
  transform: rotate(90deg);
  color: var(--accent);
}

.group-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 7px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  color: #cbd5e1;
}

.checkbox-item:hover {
  color: #fff;
}

.checkbox-item input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-secondary,
.btn-danger,
.btn-link {
  border: none;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary {
  background: #334155;
  color: #f1f5f9;
  padding: 7px 10px;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 7px 10px;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
}

.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 1px 2px;
  font-size: 11px;
}

.btn-link:hover {
  text-decoration: underline;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.list-card:hover {
  border-color: var(--accent);
  background: #243247;
}

.list-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.list-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.badge {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-neg {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.badge-pos {
  background: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.badge-neu {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.badge-work-2324 {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.badge-work-2526 {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.badge-proj {
  background: rgba(192, 132, 252, 0.22);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.45);
}

.badge-sheet {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.repair-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.repair-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.list-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.license-box code,
.card code {
  background: #0f172a;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10.5px;
}

#map-container {
  flex: 1;
  position: relative;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: #0b1120;
}

.map-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tool-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

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

.tool-btn.active {
  background: var(--accent-strong);
  color: #fff;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--card-border);
  margin: 0 3px;
}

.basemap-pill {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 580;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  pointer-events: none;
}

.orto-loading-pill {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 610;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 99px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.mini-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.hud-card {
  position: absolute;
  z-index: 600;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.legend-panel {
  bottom: 24px;
  left: 14px;
  width: 280px;
}

.legend-title {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.colorbar {
  height: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, #053061, #2166ac, #67a9cf, #f7f7f7, #ef8a62, #b2182b, #67001f);
}

.colorbar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.summary-strip {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.bottom-right-hud {
  position: absolute;
  bottom: 24px;
  right: 14px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.bottom-right-hud .hud-card {
  position: static;
  pointer-events: auto;
}

.hover-panel {
  min-width: 210px;
  max-width: 340px;
}

.radius-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
}

.radius-hud-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.radius-hud input[type="range"] {
  width: 96px;
  margin: 0;
}

.pin-popup-del {
  margin-top: 7px;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pin-popup-del:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.hover-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hover-dz {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hover-street {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-details {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.profile-drawer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 132px;
  z-index: 650;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#profile-chart-wrap {
  width: 100%;
  height: 175px;
}

#profile-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(56, 189, 248, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: #1e293b;
  border: 1px solid var(--accent);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.hidden {
  display: none !important;
}

.lidar-pin-icon {
  background: #0f172a;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.lidar-pin-icon.neg {
  background: #1d4ed8;
}

.lidar-pin-icon.pos {
  background: #b91c1c;
}

/* Per-tile loading placeholder for GUGiK orthophotos (75% transparent so base OSM remains crisp) */
.tile-slot.leaflet-tile {
  visibility: visible !important;
  opacity: 1 !important;
  overflow: hidden;
  background: transparent;
}

.tile-slot.tile-ready {
  background: transparent;
}

.tile-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  background: repeating-linear-gradient(-45deg,
      rgba(30, 41, 59, 0.20),
      rgba(30, 41, 59, 0.20) 10px,
      rgba(15, 23, 42, 0.25) 10px,
      rgba(15, 23, 42, 0.25) 20px);
  pointer-events: none;
}

.tile-slot.tile-ready .tile-ph {
  display: none;
}

.tile-ph-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

.tile-ph-top .tile-ph-badge {
  transform: translateY(-20px);
  border-color: rgba(96, 165, 250, 0.45);
}

.tile-ph-bottom .tile-ph-badge {
  transform: translateY(20px);
  border-color: rgba(251, 191, 36, 0.45);
}

.tile-ph-spin {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.tile-ph-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}

.tile-ph-badge.tile-ph-err {
  border-color: rgba(248, 113, 113, 0.45);
}

.tile-ph-badge.tile-ph-err .tile-ph-lbl {
  color: #fca5a5;
}

.tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.16s ease-out;
}

.tile-img.loaded {
  opacity: 1;
}

/* One-time disclaimer modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(135deg, #0f172a, #172554);
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.modal-body {
  padding: 16px 20px 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.modal-body p {
  margin: 0 0 10px;
}

.modal-body ul {
  margin: 0 0 12px;
  padding-left: 18px;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-body code {
  background: #1e293b;
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
  font-size: 12px;
}

.modal-warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fde68a;
  font-size: 12.5px;
}

.modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: filter 0.15s, transform 0.1s;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Guide / Instrukcja tab */
.guide-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
}

.guide-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
}

.guide-list li {
  margin-bottom: 8px;
}

.guide-list li:last-child {
  margin-bottom: 0;
}

.guide-list code {
  background: #0f172a;
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
  font-size: 11px;
}

.scan-filter-box {
  margin-top: 9px;
  padding: 7px 9px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
}

.repair-label-icon {
  display: inline-block;
  width: max-content;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
}

.control-sm {
  padding: 5px 8px;
  font-size: 11.5px;
}

/* Right-hand Object Information Drawer */
.info-drawer {
  position: absolute;
  top: 62px;
  right: 14px;
  width: 380px;
  max-width: calc(100vw - 410px);
  max-height: calc(100vh - 185px);
  z-index: 685;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.info-drawer.hidden {
  display: none;
}

.info-header {
  flex-shrink: 0;
}

.info-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 0 6px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.info-tabs .hit-tab {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  padding: 3px 9px;
  font-size: 11px;
}

.info-tabs .hit-tab:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #f8fafc;
}

.info-tabs .hit-tab.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.info-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 9px 2px 4px 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.42;
  color: #0f172a;
}

.info-body .hit-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.info-foot {
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  justify-content: flex-end;
}

.info-foot .hit-ctx-btn {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}

.info-foot .hit-ctx-btn:hover {
  background: rgba(2, 132, 199, 0.34);
  color: #ffffff;
}

/* Context / Street-Level Inspection Drawer */
.context-drawer {
  position: absolute;
  top: 62px;
  right: 14px;
  width: 350px;
  max-width: calc(100vw - 410px);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  z-index: 680;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.context-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.context-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.btn-icon {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.context-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.ctx-chip {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 6px 8px;
}

.ctx-chip-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ctx-chip-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.context-live {
  margin-top: 9px;
  padding: 7px 9px;
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
}

.context-photo-wrap {
  margin-top: 9px;
}

.ctx-photo-card {
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
}

.ctx-photo-card img {
  width: 100%;
  max-height: 185px;
  object-fit: cover;
  display: block;
}

.ctx-photo-cap {
  padding: 5px 8px;
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.context-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.ctx-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #7dd3fc;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s;
}

.ctx-link-btn:hover {
  background: #243247;
  border-color: var(--accent);
  color: #fff;
}

.badge-bzp-notice {
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.55);
}

.badge-bzp-result {
  background: rgba(234, 179, 8, 0.22);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.55);
}

.badge-bzp-perf {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.55);
}

.badge-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.osm-calming-dot {
  background: #f97316;
  color: #0f172a;
  border: 1.5px solid #fff;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.bdot-tile-label {
  background: rgba(15, 23, 42, 0.72);
  color: #93c5fd;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

/* Dynamic active overlays legend inside #legend-panel */
.legend-panel {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.overlay-legend {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#legend-lidar-section.hidden + .overlay-legend {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ov-leg-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ov-leg-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.ov-leg-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  font-size: 10.5px;
  color: #e2e8f0;
  line-height: 1.3;
}

.ov-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ov-sw-line {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.ov-sw-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.ov-sw-box {
  display: inline-block;
  width: 10px;
  height: 8px;
  border-radius: 2px;
  border: 1.5px solid #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
}

.ov-sw-grad {
  display: inline-block;
  width: 54px;
  height: 7px;
  border-radius: 4px;
}

/* Unified multi-object overlap popup */
.hit-popup-wrap {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.4;
}

.hit-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}

.hit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.hit-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.hit-tab:hover {
  background: #e2e8f0;
}

.hit-tab.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.hit-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hit-tab.active .hit-tab-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75);
}

.hit-cards {
  max-height: 310px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}

.hit-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0284c7;
  border-radius: 6px;
  padding: 7px 8px;
}

.hit-card-kind {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  color: #fff;
}

.hit-popup-foot {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

.hit-ctx-btn {
  border: 1px solid #0284c7;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.hit-ctx-btn:hover {
  background: #0284c7;
  color: #fff;
}

/* Enriched BZP cards in Remonty tab */
.bzp-card-desc {
  margin-top: 5px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
}

.bzp-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.bzp-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  background: #0f172a;
  border: 1px solid #334155;
  color: #7dd3fc;
  cursor: pointer;
}

.bzp-chip-link:hover {
  border-color: #38bdf8;
  color: #fff;
  background: #1e3a5f;
}

.bzp-chip-map {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.bzp-chip-map:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
}

.badge-bzp-cancel {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.ctx-chip-sub {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 2px;
}

.ctx-method {
  margin-top: 8px;
}

.ctx-method details {
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #94a3b8;
}

.ctx-method summary {
  cursor: pointer;
  color: #7dd3fc;
  font-weight: 600;
  font-size: 11px;
  user-select: none;
}

.ctx-method ul {
  margin: 6px 0 2px;
  padding-left: 15px;
}

.ctx-method li {
  margin-bottom: 3px;
}

.ctx-method b {
  color: #e2e8f0;
}

.bzp-loc-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.bzp-src-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.bzp-src-api {
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
}

.bzp-src-llm {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.45);
}

.bzp-src-manual {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
}

/* Alerty do sprawdzenia tab & map markers */
.alert-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.alert-filter-btn {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}

.alert-filter-btn:hover {
  border-color: #64748b;
  color: #fff;
}

.alert-filter-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.alert-card {
  border-left: 3px solid #64748b;
}

.alert-card.sev-high {
  border-left-color: #ef4444;
}

.alert-card.sev-medium {
  border-left-color: #f59e0b;
}

.alert-card.sev-info {
  border-left-color: #38bdf8;
}

.alert-top-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.checkbox-sub {
  padding-left: 18px;
  font-size: 11px;
  color: var(--muted);
}

.alert-disclaimer {
  margin-bottom: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 11px;
  line-height: 1.42;
}

.alert-cat-group {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.alert-cat-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  background: rgba(15, 23, 42, 0.45);
}

.alert-cat-summary .pill {
  margin-left: auto;
}

.alert-cat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-cat-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}

.alert-title-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  text-align: left;
  background: #0f172a;
  border: 1px solid #263348;
  border-left: 3px solid #64748b;
  border-radius: 6px;
  padding: 6px 8px;
  color: #e2e8f0;
  font-size: 11.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.alert-title-row:hover {
  background: #172554;
  border-color: #38bdf8;
  color: #ffffff;
}

.alert-title-text {
  font-weight: 600;
  flex: 1;
}

.alert-id-tag {
  font-size: 9.5px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #94a3b8;
  background: #0f172a;
  border: 1px solid #334155;
  padding: 1px 5px;
  border-radius: 4px;
}

.alert-sev-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.alert-sev-high {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.alert-sev-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.alert-sev-info {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.alert-cat-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.alert-card-summary {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: #cbd5e1;
}

.alert-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.alert-metric-pill {
  font-size: 10px;
  background: #0b1120;
  border: 1px solid #263348;
  color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 5px;
}

.alert-metric-pill b {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 3px;
}

.alert-map-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #ffffff;
  border: 1.8px solid #ffffff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.bzp-popup-desc {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #cbd5e1;
  font-size: 10.8px;
  line-height: 1.45;
  color: #334155;
  max-height: 220px;
  overflow-y: auto;
}

.bzp-popup-desc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 4px;
}

.bzp-popup-desc p {
  margin: 0 0 5px;
}

.bzp-popup-desc p:last-child {
  margin-bottom: 0;
}

