/* Final Explore behavior: stable map surface and deterministic memory zoom states. */
html body main.app-shell section.map-stage.map-focus #map,
html body main.app-shell section.map-stage.map-focus .maplibregl-canvas-container,
html body main.app-shell section.map-stage.map-focus .maplibregl-canvas {
  background: #dcece7 !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  transition: none !important;
}

html body main.app-shell section.map-stage.map-focus .maplibregl-marker.mymappi-memory-pin-icon {
  width: 30px !important;
  min-width: 30px !important;
  height: 45px !important;
  min-height: 45px !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  contain: layout size style !important;
}

html body main.app-shell section.map-stage.map-focus .mymappi-pin-only {
  position: relative !important;
  display: block !important;
  width: 30px !important;
  height: 45px !important;
  transform-origin: 50% 91.67% !important;
  transition: transform 160ms ease, opacity 140ms ease !important;
}

html body main.app-shell section.map-stage.map-focus.memory-zoom-world .mymappi-pin-only {
  transform: scale(0.76) !important;
}

html body main.app-shell section.map-stage.map-focus.memory-zoom-country .mymappi-pin-only {
  transform: scale(0.84) !important;
}

html body main.app-shell section.map-stage.map-focus.memory-zoom-city .mymappi-pin-only {
  transform: scale(0.94) !important;
}

html body main.app-shell section.map-stage.map-focus.memory-zoom-street .mymappi-pin-only {
  transform: scale(1) !important;
}

html body main.app-shell section.map-stage.map-focus.map-interacting .mymappi-pin-only,
html body main.app-shell section.map-stage.map-focus.map-zooming .mymappi-pin-only,
html body main.app-shell section.map-stage.map-focus.map-interacting .memory-cluster-marker,
html body main.app-shell section.map-stage.map-focus.map-zooming .memory-cluster-marker {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  box-shadow: none !important;
}

html body main.app-shell section.map-stage.map-focus .maplibregl-marker:has(.memory-cluster-marker),
html body main.app-shell section.map-stage.map-focus .memory-cluster-marker,
html body main.app-shell section.map-stage.map-focus .memory-cluster-marker.constellation-cluster {
  width: 58px !important;
  min-width: 58px !important;
  height: 34px !important;
  min-height: 34px !important;
}

html body main.app-shell section.map-stage.map-focus .memory-cluster-marker,
html body main.app-shell section.map-stage.map-focus .memory-cluster-marker.constellation-cluster {
  display: grid !important;
  grid-template-columns: 19px minmax(18px, auto) !important;
  place-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 7px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.94) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--marker-color, #18a978) 82%, #0b5262 18%) !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: border-color 140ms ease, background-color 140ms ease !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: geometricPrecision !important;
}

html body main.app-shell section.map-stage.map-focus .memory-cluster-marker .cluster-count {
  min-width: 18px !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1 !important;
  text-align: center !important;
  text-shadow: none !important;
}

html body main.app-shell section.map-stage.map-focus .memory-cluster-marker small {
  display: none !important;
}

/* A selected search result gets one clean destination card. Supporting
   permission and empty-state messages return after the destination closes. */
html body main.app-shell section.map-stage.map-focus.search-destination-active #locationBanner,
html body main.app-shell section.map-stage.map-focus.search-destination-active #mapEmptyState,
html body main.app-shell section.map-stage.map-focus.search-destination-active .memory-peek-card {
  display: none !important;
}

@media (max-width: 720px) {
  html body main.app-shell section.map-stage.map-focus .map-depth-switch {
    position: absolute !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 60px) !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    left: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2px !important;
    box-sizing: border-box !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 3px !important;
    overflow: hidden !important;
    transform: none !important;
    contain: layout paint style !important;
  }

  html body main.app-shell section.map-stage.map-focus .map-depth-switch button {
    width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner:not([hidden]) {
    position: absolute !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 60px) !important;
    right: calc(max(14px, env(safe-area-inset-right)) + 96px) !important;
    bottom: auto !important;
    left: max(14px, env(safe-area-inset-left)) !important;
    z-index: 717 !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 7px !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 4px 5px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(3, 29, 42, 0.14) !important;
    transform: none !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner img {
    grid-column: 1 !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    object-fit: contain !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner > div {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner strong {
    display: block !important;
    overflow: hidden !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner span {
    display: none !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner button {
    grid-column: 3 !important;
    width: auto !important;
    min-width: 48px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 0.61rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

}

@media (max-width: 350px) {
  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner:not([hidden]) {
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    gap: 5px !important;
    right: calc(max(8px, env(safe-area-inset-right)) + 90px) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner img {
    width: 24px !important;
    height: 24px !important;
  }

  html body main.app-shell section.map-stage.map-focus #locationBanner.location-banner button {
    min-width: 42px !important;
    padding-inline: 6px !important;
    font-size: 0.56rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body main.app-shell section.map-stage.map-focus .mymappi-pin-only,
  html body main.app-shell section.map-stage.map-focus .memory-cluster-marker {
    animation: none !important;
    transition: none !important;
  }
}

/* Search confidence: each result explains what it is and, when available,
   how far it is from the user's real location. */
html body main.app-shell section.map-stage.map-focus .pin-search-result-eyebrow {
  display: flex !important;
  min-width: 0 !important;
  gap: 7px !important;
  align-items: center !important;
  margin-bottom: 1px !important;
}

html body main.app-shell section.map-stage.map-focus .pin-search-result-type,
html body main.app-shell section.map-stage.map-focus .pin-search-result-distance {
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  margin: 0 !important;
  font-style: normal !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

html body main.app-shell section.map-stage.map-focus .pin-search-result-type {
  min-height: 19px !important;
  padding: 0 7px !important;
  border: 1px solid rgba(166, 239, 222, 0.2) !important;
  border-radius: 999px !important;
  color: rgba(224, 255, 247, 0.9) !important;
  font-size: 0.57rem !important;
  font-weight: 820 !important;
  background: rgba(92, 215, 184, 0.1) !important;
}

html body main.app-shell section.map-stage.map-focus .pin-search-result-type.saved {
  color: #d8fff4 !important;
  border-color: color-mix(in srgb, var(--result-color, #22bd8b) 45%, transparent) !important;
  background: color-mix(in srgb, var(--result-color, #22bd8b) 18%, transparent) !important;
}

html body main.app-shell section.map-stage.map-focus .pin-search-result-distance {
  overflow: hidden !important;
  color: rgba(220, 245, 241, 0.58) !important;
  font-size: 0.59rem !important;
  font-weight: 720 !important;
  text-overflow: ellipsis !important;
}

/* A chosen memory rises gently while the surrounding pins quiet down. */
html body main.app-shell section.map-stage.map-focus.memory-pin-selected .mymappi-pin-only.is-muted-memory-pin {
  opacity: 0.34 !important;
  filter: saturate(0.72) !important;
}

html body main.app-shell section.map-stage.map-focus.memory-pin-selected .maplibregl-marker.is-selected-memory-marker {
  z-index: 2500 !important;
}

html body main.app-shell section.map-stage.map-focus.memory-pin-selected .mymappi-pin-only.is-reliving-memory {
  opacity: 1 !important;
  filter: none !important;
}

html body main.app-shell section.map-stage.map-focus.memory-pin-selected .mymappi-pin-only.is-reliving-memory .memory-pin-svg {
  transform: translateY(-4px) scale(1.08) !important;
  transform-box: fill-box !important;
  transform-origin: center bottom !important;
}

html body main.app-shell section.map-stage.map-focus.search-destination-active .mymappi-memory-pin-icon:not(.is-selected-search-destination) .mymappi-pin-only {
  opacity: 0.38 !important;
  filter: saturate(0.72) !important;
}

html body main.app-shell section.map-stage.map-focus .maplibregl-marker.is-selected-search-destination {
  z-index: 2600 !important;
}

html body main.app-shell section.map-stage.map-focus .maplibregl-marker.is-selected-search-destination .search-destination-pin .memory-pin-svg {
  transform: translateY(-4px) scale(1.09) !important;
  transform-box: fill-box !important;
  transform-origin: center bottom !important;
}

html body main.app-shell section.map-stage.map-focus .search-destination-kicker {
  display: inline-flex !important;
  min-height: 20px !important;
  align-items: center !important;
  margin: 0 38px 8px 0 !important;
  padding: 0 8px !important;
  border: 1px solid rgba(139, 246, 217, 0.24) !important;
  border-radius: 999px !important;
  color: #bdf9e8 !important;
  font-size: 0.58rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  background: rgba(63, 211, 173, 0.11) !important;
}

html body main.app-shell section.map-stage.map-focus .search-destination-popup h3 {
  margin-top: 0 !important;
  color: #ffffff !important;
}

html body main.app-shell section.map-stage.map-focus .search-destination-popup .popup-meta {
  color: rgba(218, 249, 242, 0.78) !important;
}

html body main.app-shell section.map-stage.map-focus .search-destination-popup > p:not(.popup-meta) {
  color: rgba(235, 252, 248, 0.68) !important;
}

html body main.app-shell section.map-stage.map-focus .search-destination-popup .popup-edit {
  color: #e9fff8 !important;
  border-color: rgba(126, 235, 207, 0.24) !important;
  background: rgba(72, 211, 176, 0.12) !important;
}

@media (max-width: 720px) {
  html body main.app-shell section.map-stage.map-focus .pin-search-result-eyebrow {
    gap: 5px !important;
  }

  html body main.app-shell section.map-stage.map-focus .pin-search-result-type {
    padding-inline: 6px !important;
    font-size: 0.54rem !important;
  }

  html body main.app-shell section.map-stage.map-focus .pin-search-result-distance {
    font-size: 0.55rem !important;
  }

  html body main.app-shell section.map-stage.map-focus .maplibregl-popup:has(.search-destination-popup) {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(var(--bottom-nav-height, 84px) + 16px) !important;
    left: max(13px, env(safe-area-inset-left)) !important;
    width: min(268px, calc(100vw - 122px)) !important;
    max-width: none !important;
    transform: none !important;
  }

  html body main.app-shell section.map-stage.map-focus .maplibregl-popup:has(.search-destination-popup) .maplibregl-popup-content {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
  }

  html body main.app-shell section.map-stage.map-focus .maplibregl-popup:has(.search-destination-popup) .maplibregl-popup-tip {
    display: none !important;
  }

  html body main.app-shell section.map-stage.map-focus .search-destination-popup .popup-edit {
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
  }
}
