/* One visual family for My Map / Our Map; privacy stays explicit in words. */
html body main.app-shell section.map-stage.map-focus .map-scope-caption {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 5px !important;
  row-gap: 2px !important;
  min-height: 38px !important;
  padding: 6px 8px !important;
  border-radius: 13px !important;
  background: #00243f !important;
  border: 1px solid #45667a !important;
  color: #c7dce6 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  box-shadow: 0 4px 12px #00243f20 !important;
}
html body main.app-shell section.map-stage.map-focus .map-scope-caption strong {
  grid-column: 2;
  font-size: 11px !important;
  line-height: 1.1;
}
html body main.app-shell section.map-stage.map-focus .map-scope-caption span {
  grid-column: 2;
  font-size: 10px !important;
  line-height: 1.1;
}
html body main.app-shell section.map-stage.map-focus .map-scope-caption span::before { content: none !important; }
.map-scope-caption svg { width: 14px; height: 16px; grid-column: 1; grid-row: 1 / 3; color: #75d9c3; }
.map-scope-caption[data-scope="mm"] .scope-public-icon,
.map-scope-caption[data-scope="om"] .scope-private-icon { display: none; }
html body main.app-shell section.map-stage.map-focus .map-scope-switch button[data-map-scope]:is(.active, [aria-pressed="true"]),
html body main.app-shell section.map-stage.map-focus .map-depth-switch button[aria-pressed="true"] {
  background: #75d9c3 !important;
  color: #00243f !important;
}

/* Native map transforms are intentionally replaced ONLY for search previews.
   The controller tracks the pin without moving the camera or covering chrome. */
/* Marker priority is local to the map, never above its address sheet. This
   also handles the dock fallback on short phones and constrained iPad windows.
   Using the live popup, not selection state, restores pin priority on close. */
html body main.app-shell section.map-stage.map-focus #map.maplibregl-map:has(.mymappi-search-popup-shell) .maplibregl-marker {
  z-index: 1 !important;
}
/* A docked address sheet owns the available map space on compact screens.
   Secondary map tools return automatically when it closes or fits beside a pin. */
html body main.app-shell section.map-stage.map-focus:has(.mymappi-search-popup-shell[data-destination-side="dock"])
  :is(#mapScopeSwitch, #mapDepthSwitch, #mapScopeCaption, #mappiIntelligenceButton, #mapNavigationGadget, #ourMapDiscoveryBar) {
  visibility: hidden !important;
  pointer-events: none !important;
}

html body main.app-shell section.map-stage #map .maplibregl-popup.mymappi-search-popup-shell {
  position: fixed !important;
  display: block !important;
  inset: auto !important;
  left: var(--destination-x, 14px) !important;
  top: var(--destination-y, 100px) !important;
  width: var(--destination-width, 360px) !important;
  max-width: none !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  z-index: 740 !important;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto !important;
}
html body #map .mymappi-search-popup-shell:not([data-positioned]) { visibility: hidden !important; }
html body #map .mymappi-search-popup-shell .maplibregl-popup-tip { display: none !important; }
html body #map .mymappi-search-popup-shell .maplibregl-popup-content {
  box-sizing: border-box !important;
  width: 100% !important;
  max-height: var(--destination-max-height, 60dvh) !important;
  margin: 0 !important;
  padding: 18px !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  border: 1px solid #c8dfe0 !important;
  border-radius: 23px !important;
  background: linear-gradient(140deg, #fbfefe, #edf8f6) !important;
  box-shadow: 0 12px 30px #00243f26 !important;
  color: #00243f !important;
}
html body #map .mymappi-search-popup-shell::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: #f1faf8;
  border: 1px solid #c8dfe0;
  transform: rotate(45deg);
  pointer-events: none;
}
html body #map .mymappi-search-popup-shell[data-destination-side="dock"]::after { display: none; }
html body #map .mymappi-search-popup-shell[data-destination-side="bottom"]::after { bottom: -7px; left: calc(var(--destination-arrow-x) - 7px); border-left: 0; border-top: 0; }
html body #map .mymappi-search-popup-shell[data-destination-side="top"]::after { top: -7px; left: calc(var(--destination-arrow-x) - 7px); border-right: 0; border-bottom: 0; }
html body #map .mymappi-search-popup-shell[data-destination-side="left"]::after { left: -7px; top: calc(var(--destination-arrow-y) - 7px); border-right: 0; border-top: 0; }
html body #map .mymappi-search-popup-shell[data-destination-side="right"]::after { right: -7px; top: calc(var(--destination-arrow-y) - 7px); border-left: 0; border-bottom: 0; }
html body #map .mymappi-search-popup-shell .maplibregl-popup-close-button {
  position: absolute !important;
  inset: 8px 8px auto auto !important;
  width: 44px !important; height: 44px !important;
  min-width: 44px !important; min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid #cadfe0 !important;
  border-radius: 50% !important;
  background: #e6f6f2 !important;
  color: #00243f !important;
  box-shadow: none !important;
  font-size: 26px !important;
}
html body #map .mymappi-search-popup-shell .search-destination-popup {
  width: 100% !important; min-width: 0 !important; max-width: none !important;
  padding: 0 !important; margin: 0 !important;
  text-align: left !important;
}
html body #map .mymappi-search-popup-shell .search-destination-kicker {
  display: inline-flex !important; max-width: calc(100% - 40px); margin: 0 0 12px !important;
  background: #e1f5ee !important; color: #225a55 !important;
  padding: 5px 8px !important; border-radius: 8px !important;
  font-size: 10px !important; line-height: 1.3 !important;
}
html body #map .mymappi-search-popup-shell .search-destination-popup h3 {
  margin: 0 0 8px !important; color: #00243f !important;
  font-size: 18px !important; line-height: 1.3 !important; overflow-wrap: anywhere;
}
html body #map .mymappi-search-popup-shell .popup-meta {
  color: #466373 !important; font-size: 13px !important; line-height: 1.45 !important;
  margin: 0 0 14px !important; overflow-wrap: anywhere;
}
html body #map .mymappi-search-popup-shell .popup-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; margin: 0 0 8px !important; }
html body #map .mymappi-search-popup-shell .search-destination-popup button {
  box-sizing: border-box !important; width: 100% !important; min-width: 0 !important;
  min-height: 44px !important; padding: 11px 12px !important;
  border-radius: 13px !important; border: 1px solid #bed7dc !important;
  color: #00243f !important; background: #fff !important; box-shadow: none !important;
  font-size: 13px !important; font-weight: 750 !important; line-height: 1.35 !important;
  white-space: normal !important;
}
html body #map .mymappi-search-popup-shell .search-destination-popup .our-map-request-search-action { margin: 0 0 8px !important; background: #e9f6f3 !important; }
html body #map .mymappi-search-popup-shell .search-request-review-note { margin: 2px 0 12px !important; color: #466373 !important; font-size: 11px !important; line-height: 1.5 !important; }
html body #map .mymappi-search-popup-shell .search-destination-popup .popup-edit {
  min-height: 50px !important; margin: 4px 0 0 !important;
  background: #00243f !important; color: #fff !important; border-color: #00243f !important;
  font-size: 14px !important;
}
html body #map .mymappi-search-popup-shell button:focus-visible { outline: 3px solid #21836f !important; outline-offset: 2px !important; }
