/* Scoped to the optional Amazon view. The original Global layout stays intact. */
.amazon-explorer[hidden],
.amazon-explorer [hidden] {
  display: none !important;
}
.amazon-explorer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  scroll-margin-top: 80px;
  border-radius: 8px;
  overflow: hidden;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
}
.amazon-explorer-header {
  padding: 12px 14px 0;
}
.amazon-explorer-header p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amazon-imagery-experiment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 11px;
}
.amazon-imagery-experiment select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 6px 10px;
  font: inherit;
}
.amazon-imagery-experiment select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.amazon-levels {
  display: flex;
  gap: 6px;
}
.amazon-explorer button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #637976;
  border-radius: 24px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.amazon-levels button {
  flex: 1;
}
.amazon-explorer button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.amazon-explorer button:hover {
  border-color: var(--amber);
}
.amazon-explorer button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: -3px;
}
.amazon-explorer button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.amazon-surface {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 10px;
}
.amazon-explorer .amazon-map {
  position: absolute;
  inset: 0;
  background: #dfebd7;
}
.amazon-explorer .amazon-recenter {
  position: absolute;
  top: 10px;
  left: 10px;
  box-shadow: 0 2px 6px #173a3333;
}
.amazon-area-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 48px;
  width: fit-content;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5ecddf5;
  color: #493919;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.amazon-explorer-footer {
  padding: 9px 14px;
  background: var(--paper);
}
.amazon-explorer-footer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.amazon-explorer-footer button {
  margin-top: 8px;
}
.amazon-explorer .amazon-device-marker {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.amazon-device-marker::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #a86617;
  box-shadow:
    0 0 0 2px #173a33,
    0 2px 7px #173a3380;
}
.amazon-device-marker.is-lab::after {
  border-radius: 4px;
  background: #007f7e;
}
.amazon-device-marker.is-lab::before {
  content: "LAB";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 4px;
  background: #112c30;
  color: #edf6f5;
  font-size: 12px;
}
.amazon-explorer .maplibregl-ctrl-group button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 0;
}
.amazon-explorer .maplibregl-ctrl-attrib {
  font-size: 10px;
  line-height: 1.3;
  max-width: 100%;
  background: #fffef2ed;
}
.amazon-explorer .maplibregl-ctrl-bottom-left { max-width: 100%; }
.amazon-explorer .maplibregl-ctrl-attrib-inner { overflow-wrap: anywhere; }
.satellite-provider-logo {
  position: absolute; top: 62px; left: 10px; display: flex; align-items: center;
  min-height: 44px; padding: 4px 8px; border-radius: 4px; background: #ffffffde;
}
.satellite-provider-logo img { width: 88px; height: auto; }
.amazon-explorer[data-amazon-level="global"] {
  bottom: auto;
  overflow: visible;
  background: transparent;
  color: #fff;
}
.amazon-explorer[data-amazon-level="global"] .amazon-explorer-header,
.amazon-explorer[data-amazon-level="global"] .amazon-explorer-footer {
  background: #112c30eb;
}
/* Region/Station reserve separate columns instead of overlaying the sidebar. */
@media (min-width: 1041px) {
  .hero-b .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"]):has(.network-panel[data-catalog-open="false"]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 12px;
  }
  .hero-b .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"]):has(.network-panel[data-catalog-open="false"]) .globe-viewport {
    grid-column: 1;
    grid-row: 2;
  }
  .hero-b .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"]):has(.network-panel[data-catalog-open="false"]) .network-panel {
    grid-column: 1;
    grid-row: 1;
    width: 250px;
    justify-self: end;
  }
}
.hero-b .hero-visual[data-exploration-level] .network-panel[data-catalog-open="false"] {
  height: auto;
  align-self: start;
}
.hero-b .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(225px, 17.2vw, 320px);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
}
.hero-b
  .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"])
  .globe-viewport {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.hero-b
  .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"])
  .network-panel {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  margin: 0;
  overflow: auto;
}
.station-context-choice {
  position: absolute;
  z-index: 10;
  width: min(280px, calc(100% - 16px));
  border: 1px solid #8fc3d0;
  border-radius: 10px;
  padding: 10px;
  background: #112c30;
  color: #edf6f5;
  box-shadow: 0 4px 16px #07191f66;
  font-size: 14px;
}
.station-context-choice header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.station-context-choice header strong {
  flex: 1;
}
.station-context-choice button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #8fc3d0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}
.station-context-choice label {
  display: block;
}
.station-context-choice select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid #8fc3d0;
  border-radius: 6px;
  padding: 6px;
  background: #f5f7ef;
  color: #112c30;
  font: inherit;
  font-size: 16px;
}
.station-context-choice :is(button, select):focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.station-popover:is([data-selection="group"], [data-selection="lab"])
  :is(
    .station-state,
    .station-measurement,
    .station-filter-metadata,
    [data-station-resources],
    .station-meta,
    .station-members,
    .station-kpis
  ) {
  display: none;
}
.station-popover[data-selection="lab"] .station-popover-footer small {
  display: none;
}
.station-popover [data-station-record-select] {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
}
.amazon-explorer[data-amazon-level="global"] .amazon-explorer-footer {
  border-radius: 0 0 8px 8px;
}
.hero-visual[data-exploration-level="region"] .globe-map-modes,
.hero-visual[data-exploration-level="station"] .globe-map-modes {
  visibility: hidden;
  pointer-events: none;
}
.hero-visual[data-exploration-level="region"] .globe-stage,
.hero-visual[data-exploration-level="station"] .globe-stage {
  visibility: hidden;
  pointer-events: none;
}
.hero-visual[data-exploration-level="region"] :is(.globe-rotation-toggle, .globe-dock),
.hero-visual[data-exploration-level="station"] :is(.globe-rotation-toggle, .globe-dock) {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 1040px) {
  .hero-b .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 560px auto;
    height: auto;
    padding: 12px;
  }
  .hero-b
    .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"])
    .globe-viewport {
    height: 560px;
  }
  .hero-b
    .hero-visual:is([data-exploration-level="region"], [data-exploration-level="station"])
    .network-panel {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .amazon-explorer-header {
    padding: 10px 10px 0;
  }
  .amazon-explorer-footer {
    padding: 8px 10px;
  }
  .amazon-explorer .maplibregl-cooperative-gesture-screen {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .amazon-surface {
    animation: amazon-map-appear 240ms ease-out;
  }
  @keyframes amazon-map-appear {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
