html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #020814;
  color: #e2f1ff;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

.panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  background: rgba(3, 17, 34, 0.78);
  border: 1px solid rgba(166, 209, 250, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(9px);
  box-shadow: 0 8px 24px rgba(2, 7, 15, 0.45);
  width: min(320px, calc(100vw - 28px));
  box-sizing: border-box;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.panel-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  background: rgba(166, 209, 250, 0.1);
  border: 1px solid rgba(166, 209, 250, 0.2);
  border-radius: 8px;
  color: #eef7ff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  z-index: 21;
}

.panel-toggle:hover {
  background: rgba(166, 209, 250, 0.2);
  border-color: rgba(166, 209, 250, 0.4);
}

.panel.collapsed {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 12px;
}

.panel.collapsed > *:not(.panel-toggle) {
  opacity: 0;
  pointer-events: none;
}

.panel.collapsed .panel-toggle {
  top: 10px;
  right: 10px;
}

.panel.collapsed .panel-toggle svg {
  transform: rotate(180deg);
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #bfe2ff;
  padding-right: 32px;
}

.label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b7d9fb;
  font-weight: 600;
}

.label-spaced {
  margin-top: 4px;
}

select {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(166, 209, 250, 0.4);
  border-radius: 8px;
  background: rgba(4, 26, 50, 0.9);
  color: #e4f3ff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

select:hover {
  border-color: rgba(166, 209, 250, 0.7);
}

input[type="range"] {
  width: 100%;
  accent-color: #7bc5ff;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  color: #7bc5ff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #bfe2ff;
}

.nav-link svg {
  margin-right: 6px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d4e9ff;
}

.row input[type="checkbox"] {
  accent-color: #7bc5ff;
}

.hint {
  font-size: 11px;
  line-height: 1.4;
  color: #c4dbf2;
  opacity: 0.7;
}

.status {
  font-size: 11px;
  color: #c4dbf2;
  opacity: 0.8;
}

#legend-container {
  margin-top: 10px;
  display: none;
}

#legend-container .label {
  margin-bottom: 6px;
}

#legend-gradient {
  height: 10px;
  width: 100%;
  border-radius: 4px;
  border: 1px solid rgba(166, 209, 250, 0.3);
}

#legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-top: 4px;
  color: #c4dbf2;
  opacity: 0.8;
}

.maplibregl-popup.depth-popup .maplibregl-popup-close-button {
  color: #eef7ff;
  font-size: 16px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  outline: none;
}

.maplibregl-popup.depth-popup .maplibregl-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 8px 0 0;
}

.maplibregl-popup.depth-popup .maplibregl-popup-content {
  background: rgba(6, 18, 34, 0.96);
  color: #eef7ff;
  border: 1px solid rgba(166, 209, 250, 0.45);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(2, 7, 15, 0.55);
  font-size: 12px;
  line-height: 1.35;
  padding: 10px 30px 10px 12px;
  backdrop-filter: blur(8px);
}

.maplibregl-popup.depth-popup .maplibregl-popup-tip {
  border-top-color: rgba(6, 18, 34, 0.96);
  border-bottom-color: rgba(6, 18, 34, 0.96);
}

.maplibregl-popup.depth-popup strong {
  color: #bfe2ff;
  font-weight: 700;
}

.maplibregl-popup.depth-popup .depth-zoom {
  opacity: 0.8;
}
