.satellite-map {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #757f4a;
}

.satellite-map::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  background: rgb(5 5 5 / 18%);
  pointer-events: none;
  transition: opacity 160ms ease;
}

.satellite-map.interaction-active::after {
  opacity: 0;
}

.satellite-map.map-fullscreen-fallback {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  border-radius: 0;
}

.satellite-map.map-fullscreen-fallback {
  position: fixed;
  z-index: 10000;
  inset: 0;
  transform: none;
  box-shadow: none;
}

.satellite-map:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.satellite-map-canvas,
.satellite-map-canvas .maplibregl-map,
.satellite-map-canvas .maplibregl-canvas-container,
.satellite-map-canvas .maplibregl-canvas {
  width: 100%;
  height: 100%;
}

.satellite-map-canvas {
  position: absolute;
  inset: 0;
}

.map-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  touch-action: none;
}

.map-overlay .map-mask {
  fill: rgb(17 21 15 / 46%);
  pointer-events: none;
}

.map-overlay .map-selection {
  fill: none;
  stroke: var(--cream);
  stroke-width: 1;
  filter: drop-shadow(0 1px 1px var(--ink));
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.map-overlay #mapTrail {
  fill: none;
  stroke: #d94f3d;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px var(--ink));
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.satellite-map-canvas .maplibregl-canvas {
  display: block;
  outline: none;
}

.satellite-map-toolbar {
  position: absolute;
  z-index: 4;
  inset: 18px 18px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.satellite-map-switch,
.satellite-map-actions {
  display: flex;
  overflow: hidden;
  border: var(--container-border);
  border-radius: var(--container-radius);
  background: rgb(5 5 5 / 72%);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

#mapZoomLabel { display: none; }
.mobile-map-fullscreen { display: none; }

.satellite-map-toolbar button {
  min-width: 42px;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid rgb(252 252 251 / 24%);
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  font-size: var(--type-t3-size);
  font-weight: var(--type-t3-weight);
  line-height: var(--type-t3-line-height);
  letter-spacing: var(--type-t3-letter-spacing);
}

.satellite-map-toolbar button:last-child {
  border-right: 0;
}

.satellite-map-toolbar button:focus-visible,
.satellite-map-toolbar button.is-active,
.satellite-map-toolbar button:active {
  color: var(--ink);
  background: var(--acid);
}

@media (hover: hover) and (pointer: fine) {
  .satellite-map-toolbar button:hover {
    color: var(--ink);
    background: var(--acid);
  }
}

.satellite-map-toolbar button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: -3px;
}

.satellite-map-status {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 8px 12px;
  border: var(--container-border);
  border-radius: var(--container-radius);
  color: var(--cream);
  background: rgb(5 5 5 / 72%);
  backdrop-filter: blur(10px);
  font-size: var(--type-t3-size);
  font-weight: var(--type-t3-weight);
  line-height: var(--type-t3-line-height);
  letter-spacing: var(--type-t3-letter-spacing);
}

.satellite-map-interaction-gate {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.satellite-map.interaction-active {
  box-shadow: inset 0 0 0 2px var(--acid);
}

.satellite-map.interaction-active .satellite-map-interaction-gate {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.satellite-map-status:empty {
  display: none;
}

@media (max-width: 743px) {
  .satellite-map-toolbar {
    inset: 12px 12px auto;
    gap: 12px;
  }

  .satellite-map-toolbar button {
    min-width: 38px;
    min-height: 34px;
    padding: 7px 10px;
  }

  .satellite-map-switch [data-map-type="map"],
  .satellite-map-actions :is(#mapZoomIn, #mapZoomOut) { display: none; }

  .mobile-map-fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .satellite-map-status {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}
