/* One quiet navigation surface; map gestures stay owned by MapLibre. */
.memory-density-picker {
  width: min(290px, calc(100vw - 80px));
  display: grid;
  gap: 12px;
  color: #f3fbff;
  font: 600 14px/1.45 system-ui, sans-serif;
}
.memory-density-picker strong { padding-right: 32px; }
.memory-density-picker p { margin: 0; color: #c1d6df; }
html body main.app-shell section.map-stage.map-focus .maplibregl-popup.mymappi-memory-density-popup-shell .maplibregl-popup-content {
  padding: 20px !important;
  background: #00243f !important;
  border: 1px solid #426378 !important;
  border-radius: 20px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html body main.app-shell section.map-stage.map-focus .maplibregl-popup.mymappi-memory-density-popup-shell .maplibregl-popup-close-button {
  top: 4px !important; right: 4px !important;
  width: 44px !important; height: 44px !important;
  color: #f3fbff !important;
  background: transparent !important;
  font-size: 26px !important;
}
.mymappi-memory-density-popup-shell .maplibregl-popup-tip { display: none !important; }
.memory-density-picker label { display: grid; gap: 6px; }
.memory-density-picker select, .memory-density-picker button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #b4d5d9;
  border-radius: 12px;
  background: #f3fbfb;
  color: #00243f;
  font: inherit;
}
.memory-density-picker button { background: #00243f; color: #f4fbff; cursor: pointer; }
.memory-density-picker :is(select, button):focus-visible { outline: 3px solid #72d8c5; outline-offset: 2px; }
html body main.app-shell section.map-stage.map-focus #mapNavigationGadget {
  --gadget-size: 96px !important;
  --gadget-line: rgba(213, 239, 241, .17);
  background: var(--mymappi-action-navy, #00243f) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 22px rgba(0, 25, 43, .19), inset 0 0 0 1px rgba(222, 248, 245, .25) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

html body main.app-shell section.map-stage.map-focus {
  --map-safe-gadget-size: 96px !important;
}

html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button {
  background: transparent !important;
  color: #f4fcff !important;
  transition: background-color 120ms ease, color 120ms ease !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button:disabled {
  color: #8ba6b8 !important;
  background: transparent !important;
  cursor: default !important;
}

@media (hover: hover) and (pointer: fine) {
  html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button:hover:not(:disabled) {
    background: #163b52 !important;
  }
}

html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button:active:not(:disabled),
html body main.app-shell section.map-stage.map-focus #mapNavigationGadget #locateButton.is-centering {
  background: #1c4e5c !important;
}

html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button:focus-visible {
  outline: 2px solid #99e4d4 !important;
  outline-offset: -4px !important;
}

html body main.app-shell section.map-stage.map-focus #mapNavigationGadget #mapCompass .map-compass-needle {
  top: calc(50% - 10px) !important;
}

/* Reserve the new 48px-per-button gadget plus a clear 14px beside previews. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  html body main.app-shell section.map-stage.map-focus {
    --mymappi-map-gadget-lane: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body main.app-shell section.map-stage.map-focus #mapNavigationGadget > button {
    transition: none !important;
  }
}
