html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: #1E2228;
}

#map .scale-bar-slot {
  position: relative;
  /* Measured scale card: 36px including padding, plus its 8px bottom margin. */
  height: 44px;
  min-width: 120px;
  margin: 0 10px 8px 0;
}

#map .scale-bar {
  position: absolute;
  top: 0;
  right: 0;
  box-sizing: content-box;
  margin: 0;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #1E2228;
  font: 10px/14px Arial, sans-serif;
}

.scale-bar-ruler {
  display: flex;
  box-sizing: border-box;
  height: 8px;
  border: 1px solid #1E2228;
}

.scale-bar-ruler span {
  flex: 1;
  background: #1E2228;
}

.scale-bar-ruler span:nth-child(even) {
  background: #fff;
}

.scale-bar-labels {
  position: relative;
  height: 14px;
  margin-top: 2px;
}

.scale-bar-labels span {
  position: absolute;
  white-space: nowrap;
  transform: translateX(-50%);
}

.scale-bar-labels span:first-child {
  transform: none;
}

.scale-bar-labels span:last-child {
  transform: translateX(-100%);
}

.search-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  width: 25vw;
  min-width: 280px;
  height: 44px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #1E2228;
  font: 14px/1.4 Arial, sans-serif;
}

.search-bar:focus-within {
  outline: 2px solid rgba(30, 34, 40, 0.35);
  outline-offset: 2px;
}

.search-bar__menu {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px 0 0 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.search-bar__menu:hover {
  background: rgba(30, 34, 40, 0.08);
}

.search-bar__input {
  flex: 1;
  min-width: 0;
  padding: 0 12px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
}

@media (max-width: 599.98px) {
  .search-bar {
    width: calc(100% - 24px);
    min-width: 0;
  }
}

#map .style-lab {
  box-sizing: border-box;
  width: 240px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 100px);
  margin: 12px 12px 0 0;
  padding: 10px;
  overflow-y: auto;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #1E2228;
  font: 12px/1.4 Arial, sans-serif;
}

.style-lab h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.style-lab__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.style-lab__row select {
  min-width: 0;
  max-width: 120px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.style-lab__row input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1E2228;
}

@media (max-width: 599.98px) {
  #map .style-lab {
    margin-top: 68px;
  }
}

.map-mode-buttons {
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.map-mode-buttons button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--map-button-size);
  height: var(--map-button-size);
  padding: 0;
  border: 0;
  background: transparent;
  color: #1E2228;
  font: 600 calc(var(--map-button-size) * 0.4)/1 Arial, sans-serif;
  cursor: pointer;
}

.map-mode-buttons button:first-child {
  border-radius: 4px 4px 0 0;
}

.map-mode-buttons button:last-child {
  border-radius: 0 0 4px 4px;
}

.map-mode-buttons button + button {
  border-top: 1px solid #ddd;
}

#map .map-mode-buttons button[aria-pressed="false"]:hover {
  background: rgba(30, 34, 40, 0.08);
}

#map .map-mode-buttons button[aria-pressed="true"]:not([aria-busy="true"]) {
  background: #1E2228;
  color: #C8D44A;
}

.map-mode-buttons button:focus-visible {
  outline: 2px solid #C8D44A;
  outline-offset: -2px;
}

.map-mode-buttons svg {
  display: block;
  width: calc(var(--map-button-size) * 2 / 3);
  height: calc(var(--map-button-size) * 2 / 3);
}

.satellite-signal {
  opacity: 0;
  transform-origin: 14px 7px;
}

@media (prefers-reduced-motion: no-preference) {
  .map-mode-buttons button[aria-busy="true"] .satellite-icon {
    transform-origin: 50% 60%;
    animation: satellite-rock 0.8s ease-in-out infinite;
  }

  .map-mode-buttons button[aria-busy="true"] .satellite-signal {
    animation: satellite-signal-pulse 0.8s ease-out infinite;
  }

  .map-mode-buttons button[aria-busy="true"] .satellite-signal--far {
    animation-delay: 0.16s;
  }

  @keyframes satellite-rock {
    0%, 100% {
      transform: rotate(-4deg);
    }
    50% {
      transform: rotate(4deg);
    }
  }

  @keyframes satellite-signal-pulse {
    0% {
      opacity: 0;
      transform: translate(0, 0) scale(0.9);
    }
    35% {
      opacity: 0.75;
    }
    100% {
      opacity: 0;
      transform: translate(1px, -1px) scale(1.1);
    }
  }
}
