/* Build 662: the fresh-account Explore invitation is one compact Mappi moment.
   It is deliberately scoped to #mapEmptyState so saved-memory previews keep
   their existing protected lane beside the map gadget. */

html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom) + 22px) !important;
  left: 50% !important;
  z-index: 716 !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  grid-template-areas:
    "mascot title"
    "mascot copy" !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: min(326px, calc(100vw - 28px)) !important;
  min-width: 0 !important;
  max-width: 326px !important;
  min-height: 78px !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px 13px !important;
  column-gap: 9px !important;
  row-gap: 2px !important;
  overflow: visible !important;
  border: 1px solid rgba(9, 82, 86, 0.13) !important;
  border-radius: 22px !important;
  color: #073b45 !important;
  text-align: left !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.98), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 253, 0.97), rgba(238, 250, 246, 0.96)) !important;
  box-shadow:
    0 16px 38px rgba(3, 29, 42, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  text-wrap: pretty !important;
  translate: none !important;
  transform: translate3d(-50%, 0, 0) !important;
  pointer-events: none !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.05) !important;
  backdrop-filter: blur(18px) saturate(1.05) !important;
}

html body .app-shell section.map-stage.map-focus #mapEmptyState[hidden],
html body main.app-shell section.map-stage.map-focus #mapEmptyState[hidden] {
  display: none !important;
}

html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible > img,
html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible > img {
  grid-area: mascot !important;
  align-self: center !important;
  justify-self: center !important;
  box-sizing: border-box !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}

html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible > strong,
html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible > strong {
  grid-area: title !important;
  align-self: end !important;
  justify-self: stretch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: visible !important;
  color: #073b45 !important;
  font-size: clamp(0.82rem, 0.78rem + 0.15vw, 0.9rem) !important;
  font-weight: 850 !important;
  line-height: 1.16 !important;
  text-align: left !important;
  text-wrap: balance !important;
  white-space: normal !important;
}

html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible > span,
html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible > span {
  grid-area: copy !important;
  align-self: start !important;
  justify-self: stretch !important;
  display: -webkit-box !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: rgba(7, 59, 69, 0.7) !important;
  font-size: clamp(0.67rem, 0.64rem + 0.12vw, 0.73rem) !important;
  line-height: 1.28 !important;
  text-align: left !important;
  text-wrap: pretty !important;
  white-space: normal !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible::after,
html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible::after {
  position: absolute !important;
  right: auto !important;
  bottom: -7px !important;
  left: 50% !important;
  z-index: -1 !important;
  box-sizing: border-box !important;
  width: 15px !important;
  height: 15px !important;
  content: "" !important;
  border: 0 !important;
  border-right: 1px solid rgba(9, 82, 86, 0.13) !important;
  border-bottom: 1px solid rgba(9, 82, 86, 0.13) !important;
  background: rgba(241, 251, 247, 0.98) !important;
  box-shadow: none !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

/* The navigation gadget owns one stable lane above the bottom navigation in
   every Explore state. Empty accounts must never move that shared control. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  html body .app-shell section.map-stage.map-focus .map-navigation-gadget,
  html body main.app-shell section.map-stage.map-focus .map-navigation-gadget {
    position: fixed !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom) + 18px) !important;
  }
}

/* On narrow phones the compact invitation moves into its own row: the normal
   18px gadget offset + its 84px height + a calm 14px separation. */
@media (max-width: 520px) {
  html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
  html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible {
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom) + 116px) !important;
  }
}

/* Permission prompts and modal dialogs temporarily own the user's attention.
   Keep the first-memory invitation out of those overlay states. */
html body:has(#locationBanner:not([hidden])) .app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
html body:has(#locationBanner:not([hidden])) main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
html body:has(dialog[open]) .app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
html body:has(dialog[open]) main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 350px) {
  html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible,
  html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    padding-right: 11px !important;
    padding-left: 11px !important;
    column-gap: 9px !important;
  }

  html body .app-shell section.map-stage.map-focus #mapEmptyState.is-visible > img,
  html body main.app-shell section.map-stage.map-focus #mapEmptyState.is-visible > img {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
}

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