/* A single cartographic workstation at the bottom-left of the map.
 *
 * Unlike the old independent Leaflet/control wrappers, all controls belong to
 * one collapsible surface. Only this dock animates; Leaflet never resizes.
 */
.map-pane .atc-unified-dock {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 660;
  display: flex;
  align-items: center;
  width: 44px;
  max-width: calc(100% - 66px);
  min-height: 76px;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition:
    width .65s cubic-bezier(.22, .65, .25, 1),
    background-color .65s ease;
}

/* Collapsed dock stays visually light; the map remains visible beneath it. */
.map-pane .atc-unified-dock:not(.atc-dock-expanded) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.map-pane .atc-unified-dock.atc-dock-expanded {
  width: min(565px, calc(100% - 66px));
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

/* The full horizontal bottom edge opens the dock on hover, without
 * requiring the pointer to reach the pin at its left end.
 * Only active while collapsed so it cannot cover actual map controls.
 */
.atc-unified-dock .atc-dock-hover-strip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(565px, calc(100vw - 66px));
  height: 18px;
  pointer-events: auto;
  border: 0;
  background: transparent;
}

.atc-unified-dock:not(.atc-dock-expanded) .atc-dock-hover-strip:hover {
  background: transparent;
}

.atc-unified-dock.atc-dock-expanded .atc-dock-hover-strip {
  pointer-events: none;
  opacity: 0;
}

.atc-unified-dock button {
  margin: 0;
}

.atc-unified-dock .atc-dock-handle {
  display: flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  height: 62px;
  min-width: 42px;
  padding: 5px;
  border: 1px solid rgba(94, 168, 197, .38);
  border-radius: 7px;
  background: rgba(9, 34, 51, .70);
  font-size: 21px;
  color: #d1effd;
}

.atc-unified-dock .atc-dock-handle:hover,
.atc-unified-dock .atc-dock-handle:focus-visible {
  background: rgba(20, 62, 86, .86);
  border-color: rgba(122, 205, 237, .70);
}

.atc-unified-dock .atc-dock-handle[aria-pressed="true"] {
  background: rgba(9, 34, 51, .84);
  border-color: rgba(245, 138, 171, .55);
}

.atc-unified-dock .atc-dock-body {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 8px 9px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .3s ease,
    visibility 0s linear .65s;
}

/* Apply the panel surface to its content only; the pin and the
 * full-width hover strip remain invisible to the map canvas in all states.
 */
.atc-unified-dock.atc-dock-expanded .atc-dock-body {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(9, 29, 46, .91);
  border: 1px solid rgba(100, 174, 205, .5);
  border-radius: 9px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px);
  transition:
    opacity .3s ease .18s,
    visibility 0s;
}

.atc-dock-controls,
.atc-dock-actions,
.atc-dock-zoom,
.atc-dock-status {
  display: flex;
  align-items: center;
  min-width: 0;
}

.atc-dock-controls {
  gap: 10px;
}

.atc-dock-actions {
  gap: 5px;
  overflow-x: auto;
}

.atc-dock-zoom {
  flex-shrink: 0;
}

.atc-unified-dock .leaflet-control-zoom {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.atc-unified-dock .leaflet-control-zoom a,
.atc-unified-dock .atc-dock-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(99, 174, 206, .42);
  border-radius: 5px;
  background: rgba(18, 52, 73, .68);
  color: #d8f2ff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.atc-unified-dock .leaflet-control-zoom a:hover,
.atc-unified-dock .atc-dock-action:hover,
.atc-unified-dock .atc-dock-action[aria-pressed="true"] {
  color: #fff;
  background: rgba(39, 111, 146, .77);
  border-color: #6dc7ee;
}

.atc-unified-dock .atc-dock-action[hidden] {
  display: none;
}

.atc-unified-dock #mizFit[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.atc-dock-status {
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  padding: 3px 2px 0;
  border-top: 1px solid rgba(101, 170, 200, .25);
}

.atc-unified-dock .atc-coordinates {
  width: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b9e2f4;
  font: 11px ui-monospace, monospace;
  white-space: nowrap;
}

.atc-dock-map-info {
  flex: 0 0 auto;
}

.atc-unified-dock .leaflet-control-scale {
  margin: 0 !important;
  color: #ccefff;
}

.atc-unified-dock .leaflet-control-scale-line {
  margin: 0;
  padding: 1px 5px;
  background: transparent;
  border-color: #8abdd4;
  color: #bfe0f2;
  font: 10px ui-monospace, monospace;
}

/* Show one useful metric scale value, not two overlapping scale bars. */
.atc-unified-dock .leaflet-control-scale-line:not(:first-child) {
  display: none;
}

.atc-unified-dock .atc-map-popup {
  position: absolute;
  left: 44px;
  bottom: calc(100% + 8px);
  max-width: min(310px, calc(100vw - 100px));
  max-height: min(330px, 52vh);
  overflow: auto;
  background: rgba(8, 27, 43, .94);
  border: 1px solid rgba(100, 174, 205, .65);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .32);
  backdrop-filter: blur(9px);
}

.atc-unified-dock .atc-map-popup[hidden] {
  display: none !important;
}

.atc-dock-legend {
  padding: 9px 0 0;
  margin-top: 9px;
  border-top: 1px solid rgba(100, 174, 205, .3);
}

.atc-dock-legend summary {
  cursor: pointer;
  color: #92dafa;
  font-size: 12px;
  font-weight: 600;
}

.map-pane.atc-measuring #map {
  cursor: crosshair;
}

@media (max-width: 700px) {
  .map-pane .atc-unified-dock {
    left: 9px;
    bottom: 9px;
    min-height: 72px;
  }

  .map-pane .atc-unified-dock.atc-dock-expanded {
    width: min(520px, calc(100% - 58px));
  }

  .atc-unified-dock .atc-dock-hover-strip {
    width: min(520px, calc(100vw - 58px));
  }

  .atc-dock-body {
    padding: 6px !important;
  }

  .atc-dock-controls {
    gap: 5px;
  }

  .atc-dock-actions {
    gap: 3px;
  }

  .atc-unified-dock .atc-coordinates {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pane .atc-unified-dock,
  .atc-unified-dock .atc-dock-body {
    transition: none;
  }
}
