.mapShell3d canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#baseCanvas {
  z-index: 0;
}

#glCanvas {
  z-index: 1;
  pointer-events: none;
}

#overlayCanvas {
  z-index: 2;
  cursor: grab;
}

#overlayCanvas.dragging {
  cursor: grabbing;
}

#overlayCanvas.orbiting {
  cursor: move;
}

.mapShell3d .mapControls,
.mapShell3d .infoPanel,
.mapShell3d .legend,
.mapShell3d .symbolLegend,
.mapShell3d .accidentPopup {
  z-index: 5;
}

.mapShell3d .infoPanel {
  z-index: 6;
}

.controlPanel {
  display: block;
  width: min(320px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  transition:
    width 220ms ease,
    box-shadow 220ms ease;
}

.controlPanel.collapsed {
  width: min(176px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}

#layerControls.controlPanel.collapsed {
  width: min(86px, calc(100vw - 32px));
}

.controlPanelTitle {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.controlPanelTitle::after {
  float: right;
  color: var(--muted);
  content: "⌄";
}

.controlPanel.collapsed .controlPanelTitle::after {
  content: "›";
}

.controlPanel:not(.collapsed) .controlPanelTitle {
  border-bottom: 1px solid rgba(65, 66, 66, 0.12);
}

.controlPanelBody {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 260px;
  padding: 10px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 240ms ease,
    padding 240ms ease,
    opacity 180ms ease;
}

.controlPanel.collapsed .controlPanelBody {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.mapShell3d .legend {
  display: grid;
}

.mapShell3d #resetView {
  flex: 0 0 auto;
}

@media (max-width: 860px) {
  .mapShell3d .mapControls {
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 32vh;
    overflow: auto;
  }

  .mapShell3d .controlGroup {
    gap: 6px;
    padding: 8px;
  }

  .mapShell3d .controlPanel {
    padding: 0;
  }

  .mapShell3d .controlPanelBody {
    gap: 6px;
    padding: 8px;
  }

  .mapShell3d .toggle {
    min-height: 27px;
    padding: 3px 7px;
    font-size: 12px;
  }

  .mapShell3d .legend {
    display: grid;
    right: auto;
    left: 10px;
    bottom: calc(var(--sheet-peek) + 12px);
    width: min(210px, calc(100vw - 20px));
    padding: 10px;
  }

  .mapShell3d .symbolLegend {
    display: block;
    right: auto;
    left: 10px;
    bottom: calc(var(--sheet-peek) + 12px);
    width: min(230px, calc(100vw - 20px));
    padding: 10px;
  }

  .mapShell3d .symbolLegend.legendOffset {
    bottom: calc(var(--sheet-peek) + 108px);
  }
}
