html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f172a;
  overflow: hidden;
}

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

/* --- GŁÓWNY PANEL BOCZNY (MODERNY, PŁYWAJĄCY) --- */
.panel {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  width: 370px;
  font-size: 13px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Nagłówek aplikacji */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  color: #0f172a;
  letter-spacing: -0.4px;
}
.brand-icon {
  font-size: 20px;
  line-height: 1;
}
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-icon {
  cursor: pointer;
  font-size: 19px;
  opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s;
}
.action-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Pasek wyszukiwania działki */
.search-box {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.search-box input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.search-box input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.search-box button {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  transition: background-color 0.15s, transform 0.1s;
}
.search-box button:hover {
  background: #0369a1;
}
.search-box button:active {
  transform: scale(0.98);
}

/* Pasek zakładek */
.panel-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9px;
  margin-bottom: 10px;
  gap: 3px;
  flex-shrink: 0;
}
.panel-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  border-radius: 7px;
  cursor: pointer;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.panel-tab:hover {
  color: #1e293b;
}
.panel-tab.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Kontener aktywnej zakładki (płynny scroll) */
.panel-tab-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.panel-tab-content::-webkit-scrollbar {
  width: 5px;
}
.panel-tab-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.panel-tab-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- ZAKŁADKA 1: WARSTWY SYTUACYJNE --- */
.situational-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.btn-tool-action {
  flex: 1;
  padding: 7px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 7px !important;
  border: none !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.btn-tool-action.primary {
  background: #0284c7 !important;
  color: #fff !important;
}
.btn-tool-action.primary:hover {
  background: #0369a1 !important;
}
.btn-tool-action.secondary {
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.btn-tool-action.secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Rozwijane menu importu budynków */
.dropdown-import-wrap {
  position: relative;
  flex: 1;
}
.import-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  margin-top: 4px;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}
.import-opt {
  padding: 9px 11px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}
.import-opt:last-child {
  border-bottom: none;
}
.import-opt:hover {
  background: #f0f9ff;
  color: #0284c7;
}

/* Wyszukiwarka obiektów w warstwach */
.obj-filter-box {
  margin-bottom: 8px;
}
.obj-filter-box input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  box-sizing: border-box;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.obj-filter-box input:focus {
  border-color: #94a3b8;
  background: #ffffff;
}

/* Formularz nowej warstwy */
.new-layer-panel {
  background: #f8fafc;
  border: 1px solid #bce8f1;
  border-radius: 8px;
  padding: 9px;
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease-out;
}
.new-layer-panel input[type="text"],
.new-layer-panel select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 12px;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.new-layer-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}
.new-layer-types label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  background: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.new-layer-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 6px;
}
.new-layer-actions {
  display: flex;
  gap: 6px;
}
.new-layer-actions button {
  flex: 1;
  padding: 6px !important;
  font-size: 11px !important;
  margin: 0 !important;
}

/* Kontener kart warstw sytuacyjnych */
.layers-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Karta warstwy sytuacyjnej */
.layer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.layer-card:hover {
  border-color: #cbd5e1;
}
.layer-card-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: #f8fafc;
  user-select: none;
}
.layer-collapse-btn {
  cursor: pointer;
  font-size: 9px;
  color: #64748b;
  padding: 2px 4px;
  line-height: 1;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.layer-collapse-btn.expanded {
  transform: rotate(90deg);
}
.layer-cb {
  cursor: pointer;
  margin: 0;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.layer-color-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.layer-card-title {
  font-weight: 600;
  font-size: 12px;
  color: #1e293b;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.tag-type {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
  flex-shrink: 0;
}
.tag-obstacle {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  flex-shrink: 0;
  user-select: none;
  transition: background-color 0.15s;
}
.tag-obstacle.is-obstacle {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.tag-obstacle.not-obstacle {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.btn-draw-action {
  background: #10b981 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 3px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  flex-shrink: 0;
}
.btn-draw-action:hover {
  background: #059669 !important;
}
.btn-del-layer {
  background: none !important;
  color: #94a3b8 !important;
  border: none !important;
  padding: 0 3px !important;
  font-size: 13px !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  flex-shrink: 0;
}
.btn-del-layer:hover {
  color: #dc2626 !important;
}

/* Obiekty wewnątrz warstwy */
.layer-card-body {
  padding: 3px 6px;
  max-height: 180px;
  overflow-y: auto;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}
.layer-card-body.collapsed {
  display: none;
}
.layer-card-body::-webkit-scrollbar {
  width: 4px;
}
.layer-card-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.layer-obj-empty {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  padding: 5px;
  text-align: center;
}
.layer-obj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  margin: 2px 0;
  background: #fafafa;
  border-radius: 5px;
  font-size: 11px;
  border: 1px solid #f1f5f9;
  transition: background-color 0.15s;
}
.layer-obj-row:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.layer-obj-row.hidden-obj {
  opacity: 0.45;
}
.obj-left {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-grow: 1;
  overflow: hidden;
}
.obj-title {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1e293b;
  font-weight: 500;
}
.obj-title:hover {
  color: #0284c7;
  text-decoration: underline;
}
.obj-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* --- ZAKŁADKA 2: PODKŁADY & EWIDENCJA --- */
.section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}
.section-card-title {
  font-weight: 700;
  font-size: 12px;
  color: #1e293b;
  margin-bottom: 6px;
}
.btn-subtle {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  width: 100% !important;
  cursor: pointer;
  margin: 4px 0 0 0 !important;
}
.btn-subtle:hover {
  background: #e2e8f0 !important;
}

/* Style rozwijanych list (Dropdown Check List) */
.dropdown-check-list {
  display: inline-block;
  position: relative;
  width: 100%;
}
.dropdown-check-list .anchor {
  position: relative;
  cursor: pointer;
  display: block;
  padding: 8px 32px 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  width: 100%;
  font-size: 12px;
  box-sizing: border-box;
  color: #1e293b;
}
.dropdown-check-list .anchor::after {
  position: absolute;
  content: "";
  border-left: 2px solid #64748b;
  border-top: 2px solid #64748b;
  padding: 3px;
  right: 12px;
  top: 35%;
  transform: rotate(-135deg);
  transition: transform 0.2s;
}
.dropdown-check-list.visible .anchor::after {
  transform: rotate(45deg);
  top: 45%;
}
.dropdown-check-list ul.items {
  margin: 0;
  padding: 4px 0;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  max-height: 250px;
  overflow-y: auto;
}
.dropdown-check-list.visible ul.items {
  display: block;
}
.dropdown-check-list ul.items li {
  list-style: none;
  padding: 7px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  transition: background-color 0.15s;
}
.dropdown-check-list ul.items li:hover {
  background-color: #f1f5f9;
}
.dropdown-check-list ul.items li label {
  flex: 1;
  cursor: pointer;
  margin: 0;
  color: #1e293b;
}

/* --- ZAKŁADKA 3: NARZĘDZIA & POMIARY --- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.grid-btn {
  padding: 10px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  margin: 0 !important;
  cursor: pointer;
  transition: all 0.15s;
}
.grid-btn .btn-ico {
  font-size: 20px;
}
.grid-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}
.grid-btn.active {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #dc2626 !important;
}
.grid-btn.danger {
  color: #dc2626 !important;
}
.grid-btn.danger:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

/* --- FLOATING MODAL: WYBÓR TYPU DRZEWA --- */
.floating-choice-modal {
  position: absolute;
  top: 70px;
  left: 395px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  z-index: 1050;
  width: 260px;
  animation: fadeIn 0.18s ease-out;
}
.choice-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  text-align: center;
}
.choice-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-tree-choice {
  flex: 1;
  padding: 9px 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 7px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #1e293b !important;
  cursor: pointer;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.btn-tree-choice:hover {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
  transform: translateY(-1px);
}
.btn-choice-cancel {
  width: 100% !important;
  padding: 5px !important;
  font-size: 11px !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: none !important;
  border-radius: 5px !important;
  cursor: pointer;
  margin: 0 !important;
}
.btn-choice-cancel:hover {
  background: #e2e8f0 !important;
}

/* --- PASEK STATUSU / INFO --- */
.info {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  flex-shrink: 0;
  max-height: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info:empty {
  display: none;
}
.success { color: #16a34a; }
.error { color: #dc2626; }

/* --- SZUFLADA LOGÓW DIAGNOSTYCZNYCH --- */
.debug-drawer {
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
  padding-top: 3px;
  flex-shrink: 0;
}
.debug-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 10px;
  color: #94a3b8;
  padding: 3px 4px;
  font-family: monospace;
  user-select: none;
}
.debug-toggle-bar:hover {
  color: #475569;
}
#debug {
  background: #0f172a;
  color: #22c55e;
  padding: 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  overflow-y: auto;
  margin-top: 4px;
  max-height: 120px;
  white-space: pre-wrap;
  transition: max-height 0.25s ease-out;
}
#debug.collapsed {
  max-height: 0;
  padding: 0;
  border: none;
  margin-top: 0;
  overflow: hidden;
}

/* --- DYNAMICZNY PASEK SKALI --- */
.ol-scale-line {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(4px) !important;
  border-radius: 6px !important;
  bottom: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 3px 8px !important;
}
.ol-scale-line-inner {
  border-color: #fff !important;
  border-width: 2px !important;
  color: #fff !important;
  font-size: 11px !important;
  font-family: monospace !important;
}

/* --- PANEL KONFIGURACJI KAMERY --- */
.camera-panel {
  position: absolute;
  top: 12px;
  left: 395px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  z-index: 1000;
  width: 320px;
  font-size: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  animation: fadeIn 0.18s ease-out;
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.camera-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #6f42c1;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.camera-panel-header h4 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}
.close-cam-btn {
  cursor: pointer;
  font-size: 16px;
  color: #94a3b8;
  padding: 0 4px;
}
.close-cam-btn:hover {
  color: #dc2626;
}
.camera-panel .form-group {
  margin-bottom: 8px;
}
.camera-panel .field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.camera-panel label {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  margin: 0;
}
.val-badge {
  font-weight: bold;
  color: #6f42c1;
  font-size: 11px;
  background: #f3e8fd;
  padding: 1px 6px;
  border-radius: 4px;
}
.cam-prefix-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
  margin-bottom: 3px;
}
.cam-prefix-chip {
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.cam-prefix-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}
.cam-prefix-chip.active {
  background: #6f42c1;
  border-color: #5b21b6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(111, 66, 193, 0.35);
}
.camera-panel input[type="text"],
.camera-panel input[type="number"],
.camera-panel select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  box-sizing: border-box;
  margin: 2px 0;
  outline: none;
}
.camera-panel input[type="range"] {
  width: 100%;
  margin: 3px 0;
  cursor: pointer;
  accent-color: #6f42c1;
}
.azimuth-quick-btns {
  display: flex;
  gap: 4px;
  margin: 3px 0;
}
.btn-sub {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  flex: 1;
  padding: 4px 2px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  margin: 0 !important;
  cursor: pointer;
}
.btn-sub:hover {
  background: #e2e8f0 !important;
}
.cam-action-btn {
  width: 100%;
  padding: 8px !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: bold !important;
  cursor: pointer;
  margin: 3px 0 !important;
}
.cam-action-btn:hover {
  opacity: 0.9;
}
.cam-action-btn.active {
  background: #dc3545 !important;
}

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

/* --- FLOATING DRAWING HUD (RYSEK CIĄGŁY) --- */
.drawing-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1020;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  padding: 5px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.hud-main {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
}
.hud-icon-label {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  color: #38bdf8;
  white-space: nowrap;
}
.hud-options-group {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
  border-radius: 20px;
}
.hud-btn {
  background: transparent !important;
  color: #cbd5e1 !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  transition: all 0.15s;
}
.hud-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15) !important;
}
.hud-btn.active {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.hud-select {
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 3px 8px;
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
.hud-name-group {
  display: flex;
  align-items: center;
}
.hud-name-input {
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 11px;
  width: 135px;
  outline: none;
  transition: all 0.15s;
}
.hud-name-input:focus {
  border-color: #38bdf8;
  background: #0f172a;
  box-shadow: 0 0 0 1px #38bdf8;
}
.hud-name-input::placeholder {
  color: #94a3b8;
}
.hud-btn-toggle {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  border-radius: 16px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  white-space: nowrap;
}
.hud-btn-toggle.not-obs {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
.hud-counter {
  font-size: 11px;
  color: #94a3b8;
  padding: 0 4px;
  white-space: nowrap;
}
.hud-btn-close {
  background: #ef4444 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: pointer;
  margin: 0 !important;
  width: auto !important;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.hud-btn-close:hover {
  background: #dc2626 !important;
}

/* --- OBJECT INSPECTOR / EDIT PANEL --- */
.object-inspector {
  position: absolute;
  top: 12px;
  left: 395px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  z-index: 1000;
  width: 320px;
  font-size: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  animation: fadeIn 0.18s ease-out;
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.inspector-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inspector-title-wrap h4 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}
.close-insp-btn {
  cursor: pointer;
  font-size: 16px;
  color: #94a3b8;
  padding: 0 4px;
}
.close-insp-btn:hover {
  color: #dc2626;
}
.insp-group {
  margin-bottom: 9px;
}
.insp-group label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  display: block;
  margin-bottom: 3px;
}
.insp-group input[type="text"],
.insp-group select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  box-sizing: border-box;
  outline: none;
}
.insp-group input[type="text"]:focus,
.insp-group select:focus {
  border-color: #0284c7;
}
.insp-static-val {
  padding: 6px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
  font-weight: 500;
}
.insp-btn-group {
  display: flex;
  gap: 6px;
}
.insp-choice-btn {
  flex: 1;
  padding: 6px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  cursor: pointer;
  margin: 0 !important;
  transition: all 0.15s;
}
.insp-choice-btn:hover {
  background: #f1f5f9 !important;
}
.insp-choice-btn.active {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
  box-shadow: 0 0 0 1px #10b981;
}
.insp-chips-wrap {
  margin-top: 6px;
}
.insp-chips-wrap label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  display: block;
  margin-bottom: 4px;
}
.insp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 95px;
  overflow-y: auto;
  padding: 1px;
}
.insp-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.insp-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}
.insp-chip.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 700;
}
.insp-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
  color: #1e40af;
  margin-bottom: 10px;
  line-height: 1.4;
}
.insp-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.insp-action-btn {
  flex: 1;
  padding: 7px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  border: none !important;
  cursor: pointer;
  margin: 0 !important;
  transition: all 0.15s;
}
.insp-action-btn.primary {
  background: #0284c7 !important;
  color: #fff !important;
}
.insp-action-btn.primary:hover {
  background: #0369a1 !important;
}
.insp-action-btn.secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.insp-action-btn.secondary:hover {
  background: #e2e8f0 !important;
}
.insp-action-btn.danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
}
.insp-action-btn.danger:hover {
  background: #fecaca !important;
}

@media (max-width: 768px) {
  .panel {
    width: calc(100% - 24px);
    max-height: 50vh;
  }
  .camera-panel, .object-inspector {
    left: 12px;
    top: auto;
    bottom: 12px;
    width: calc(100% - 24px);
    max-height: 45vh;
  }
  .drawing-hud {
    width: calc(100% - 24px);
    border-radius: 12px;
    padding: 6px 8px;
  }
}

@media print {
  body > *:not(#map) {
    display: none !important;
  }
  #map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
  }
}