/* Search accuracy v2: one calm, accessible results surface on every screen size. */
html body .app-shell .map-stage.map-focus .pin-search-panel.open,
html body main.app-shell section.map-stage.map-focus .pin-search-panel.open {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 12px !important;
  overflow: hidden !important;
}

html body .app-shell .map-stage.map-focus .pin-search-heading,
html body main.app-shell section.map-stage.map-focus .pin-search-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  padding: 0 1px !important;
}

html body .app-shell .map-stage.map-focus .pin-search-heading-copy,
html body main.app-shell section.map-stage.map-focus .pin-search-heading-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 3px !important;
}

html body .app-shell .map-stage.map-focus .pin-search-heading-copy strong,
html body main.app-shell section.map-stage.map-focus .pin-search-heading-copy strong {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body .app-shell .map-stage.map-focus .pin-search-close,
html body main.app-shell section.map-stage.map-focus .pin-search-close {
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border: 1px solid rgba(224, 255, 248, 0.2) !important;
  border-radius: 15px !important;
  color: rgba(245, 255, 252, 0.9) !important;
  background: rgba(255, 255, 255, 0.085) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  font: inherit !important;
  font-size: 1.45rem !important;
  font-weight: 430 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease !important;
}

html body .app-shell .map-stage.map-focus .pin-search-close:hover,
html body .app-shell .map-stage.map-focus .pin-search-close:focus-visible,
html body main.app-shell section.map-stage.map-focus .pin-search-close:hover,
html body main.app-shell section.map-stage.map-focus .pin-search-close:focus-visible {
  border-color: rgba(132, 242, 196, 0.54) !important;
  color: #ffffff !important;
  background: rgba(132, 242, 196, 0.15) !important;
  outline: none !important;
  transform: translateY(-1px) !important;
}

html body .app-shell .map-stage.map-focus .pin-search-results,
html body main.app-shell section.map-stage.map-focus .pin-search-results {
  min-height: 0 !important;
  max-height: min(52vh, 430px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
  -webkit-overflow-scrolling: touch !important;
}

html body .app-shell .map-stage.map-focus .pin-search-section-label.saved-memory-results-label span::after,
html body main.app-shell section.map-stage.map-focus .pin-search-section-label.saved-memory-results-label span::after {
  display: none !important;
  content: none !important;
}

html body .app-shell .map-stage.map-focus .pin-search-result > span:nth-child(2),
html body main.app-shell section.map-stage.map-focus .pin-search-result > span:nth-child(2) {
  min-width: 0 !important;
}

html body .app-shell .map-stage.map-focus .pin-search-result > span:nth-child(2) > small,
html body main.app-shell section.map-stage.map-focus .pin-search-result > span:nth-child(2) > small {
  display: -webkit-box !important;
  overflow: hidden !important;
  white-space: normal !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

html body .app-shell .map-stage.map-focus .pin-search-result.is-search-active,
html body main.app-shell section.map-stage.map-focus .pin-search-result.is-search-active {
  border-color: rgba(132, 242, 196, 0.5) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 3px 0 0 #84f2c4 !important;
}

@media (max-width: 760px) {
  html body .app-shell .map-stage.map-focus .pin-search-panel.open,
  html body main.app-shell section.map-stage.map-focus .pin-search-panel.open {
    top: calc(env(safe-area-inset-top) + 66px) !important;
    right: 10px !important;
    bottom: auto !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(72dvh, calc(100dvh - var(--bottom-nav-height, 84px) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 88px), 620px) !important;
    padding: 14px !important;
    gap: 10px !important;
    overflow: hidden !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-results,
  html body main.app-shell section.map-stage.map-focus .pin-search-results {
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-box,
  html body main.app-shell section.map-stage.map-focus .pin-search-box {
    min-width: 0 !important;
    min-height: 52px !important;
    margin: 0 !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-box input,
  html body main.app-shell section.map-stage.map-focus .pin-search-box input {
    min-width: 0 !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-go-button,
  html body main.app-shell section.map-stage.map-focus .pin-search-go-button {
    min-width: 68px !important;
    min-height: 42px !important;
    padding-inline: 11px !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-result,
  html body main.app-shell section.map-stage.map-focus .pin-search-result {
    min-height: 58px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}

@media (max-width: 350px) {
  html body .app-shell .map-stage.map-focus .pin-search-panel.open,
  html body main.app-shell section.map-stage.map-focus .pin-search-panel.open {
    right: 8px !important;
    left: 8px !important;
    padding: 12px !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-heading,
  html body main.app-shell section.map-stage.map-focus .pin-search-heading {
    grid-template-columns: minmax(0, 1fr) 42px !important;
    gap: 8px !important;
  }

  html body .app-shell .map-stage.map-focus .pin-search-close,
  html body main.app-shell section.map-stage.map-focus .pin-search-close {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .map-stage.map-focus .pin-search-close,
  html body main.app-shell section.map-stage.map-focus .pin-search-close {
    transition: none !important;
  }
}
