.map-page {
  width: min(calc(100% - 3rem), 72rem);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4rem) 0 5rem;
}

.map-page-heading {
  margin-bottom: 1.1rem;
}

.map-page-heading h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.map-vector-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--paper);
}

.map-toolbar {
  min-height: 3.7rem;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.96);
}

.map-pan-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.map-zoom-controls {
  display: flex;
  direction: ltr;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--white);
}

.map-zoom-controls button {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
}

.map-zoom-controls button:first-child {
  border-left: 0;
}

.map-zoom-controls button:hover:not(:disabled),
.map-zoom-controls button:focus-visible {
  background: var(--sage);
}

.map-zoom-controls button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--coral);
  outline-offset: -3px;
}

.map-zoom-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}

.map-zoom-controls .map-zoom-reset {
  width: 3.7rem;
  font-size: 0.72rem;
}

.map-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2020 / 1406;
  background: #f8f3e7;
}

.map-viewport.is-zoomed {
  cursor: grab;
  touch-action: none;
}

.map-viewport.is-panning {
  cursor: grabbing;
}

.map-transform-layer {
  transform-origin: center center;
  will-change: transform;
}

.map-vector-image {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  pointer-events: none;
}

.map-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.map-hotspot {
  position: absolute;
  width: 1rem;
  height: 1rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: help;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.map-hotspot > span {
  display: none;
}

.map-hotspot:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 0.18rem;
  border-radius: 50%;
}

.map-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: max-content;
  max-width: min(13rem, calc(100% - 1rem));
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--ink);
  border-radius: 0.3rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0.5rem 1.2rem rgba(23, 63, 52, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.map-tooltip.is-visible {
  visibility: visible;
  opacity: 1;
}

.hotspot-waste {
  left: 34.01%;
  top: 30.23%;
  width: 8%;
  height: 7.5%;
  border-radius: 50%;
}

.hotspot-bus {
  left: 58.81%;
  top: 14.83%;
}

.hotspot-synagogue {
  left: 81.63%;
  top: 8.04%;
}

.hotspot-shelter {
  left: 84.7%;
  top: 12.1%;
}

.map-legend {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(255, 254, 250, 0.82);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.legend-swatch {
  width: 1.35rem;
  height: 0.75rem;
  border-radius: 0.25rem;
}

.legend-swatch.road {
  height: 0.34rem;
  background: #c5a97d;
}

.legend-swatch.collection {
  height: 0.32rem;
  background: repeating-linear-gradient(
    to left,
    #5f8b72 0,
    #5f8b72 0.55rem,
    transparent 0.55rem,
    transparent 0.82rem
  );
}

.legend-swatch.house {
  border: 1px solid #50695c;
  background: #dce8dc;
}

.legend-swatch.waste {
  border-radius: 50%;
  background: #e9bc55;
}

.legend-swatch.bus {
  width: 0.8rem;
  background: #d86f4a;
}

.legend-swatch.synagogue {
  width: 0.8rem;
  background: #7467b5;
}

.legend-swatch.shelter {
  width: 0.8rem;
  background: #74a96d;
}

@media (max-width: 680px) {
  .map-page {
    width: min(100% - 1.5rem, 42rem);
    padding-top: 2rem;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-zoom-controls {
    align-self: stretch;
  }

  .map-zoom-controls button {
    flex: 1 1 0;
  }

  .map-legend {
    justify-content: flex-start;
  }
}
