/* Transient source legend control for MapLibre route overlays. */
.map-route-legend-control {
  position: absolute;
  right: 8px;
  bottom: var(--route-legend-bottom, 36px);
  z-index: 3;
  display: block;
  pointer-events: none;
}
.map-route-legend-control[hidden] { display: none; }
.map-route-legend {
  box-sizing: border-box;
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 0;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 6px;
  color: #fff;
  background: rgba(10, 14, 24, 0.9);
  border-radius: 4px;
  font: 10px/14px sans-serif;
  pointer-events: none;
  user-select: none;
}
.map-route-legend[hidden] { display: none; }
.map-route-legend-row { display: flex; align-items: center; gap: 6px; height: 14px; min-width: 0; white-space: nowrap; }
.map-route-legend-swatch { display: inline-block; width: 16px; height: 2px; flex: 0 0 16px; }
.map-route-legend-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Mobile's playback seekbar overlays the lower map edge. PC has controls above. */
.mobile-map .map-route-legend-control { top: 8px; bottom: auto; }
.mobile-map .map-route-legend { top: 0; bottom: auto; }
