/* Build 722: keep the two post-save choices distinct in every viewport.
   The action wrapper is a single grid item, so older map-lane rules cannot
   assign both buttons to the same grid cell. */

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-status {
  display: none !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 4 / span 2 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: minmax(44px, auto) !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  width: min(100%, 248px) !important;
  min-width: 0 !important;
  margin: 0 !important;
  gap: 7px !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > :is(.memory-confirmation-view, .memory-confirmation-secondary) {
  display: inline-flex !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > .memory-confirmation-view {
  border: 1px solid rgba(221, 255, 245, 0.5) !important;
  color: #063b45 !important;
  background: linear-gradient(135deg, #ddfff5, #86edca) !important;
  box-shadow: 0 8px 18px rgba(2, 32, 43, 0.18) !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > .memory-confirmation-secondary {
  border: 1px solid rgba(226, 255, 249, 0.22) !important;
  color: rgba(244, 255, 252, 0.94) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > :is(.memory-confirmation-view, .memory-confirmation-secondary):is(:hover, :focus-visible) {
  transform: translateY(-1px) !important;
}

/* In Explore, the card stays aligned with the map gadget on larger screens.
   Both actions own a separate third row instead of competing for column 3. */
html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] {
  --memory-followup-edge: var(--map-notice-edge, var(--map-safe-edge, clamp(18px, 3vw, 28px)));
  --memory-followup-bottom: var(--map-notice-bottom, var(--map-safe-bottom, clamp(104px, 12vh, 122px)));
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: var(--memory-followup-bottom) !important;
  left: 50% !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  align-items: center !important;
  justify-items: stretch !important;
  box-sizing: border-box !important;
  width: min(420px, calc(100% - (2 * var(--memory-followup-edge)))) !important;
  max-width: calc(100% - (2 * var(--memory-followup-edge))) !important;
  min-width: 0 !important;
  min-height: 122px !important;
  max-height: 164px !important;
  padding: 12px 13px !important;
  gap: 3px 10px !important;
  overflow: hidden !important;
  border-radius: 23px !important;
  text-align: left !important;
  translate: none !important;
  transform: translate(-50%, 12px) scale(0.985) !important;
  transform-origin: 50% 100% !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"].show {
  transform: translate(-50%, 0) scale(1) !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] > span {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  align-self: center !important;
  justify-self: center !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] :is(strong, small) {
  grid-column: 2 !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  -webkit-box-orient: vertical !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] strong {
  display: -webkit-box !important;
  grid-row: 1 !important;
  font-size: 0.9rem !important;
  line-height: 1.15 !important;
  -webkit-line-clamp: 1 !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] small {
  display: -webkit-box !important;
  grid-row: 2 !important;
  font-size: 0.69rem !important;
  line-height: 1.22 !important;
  -webkit-line-clamp: 2 !important;
}

html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] .memory-confirmation-actions {
  display: grid !important;
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(44px, auto) !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  margin-top: 6px !important;
  gap: 8px !important;
}

/* Touch devices place the two-action card above the navigation gadget. This
   gives the labels enough room while preserving an unobstructed gadget and
   a full safe-area gap above the bottom navigation. */
@media (hover: none) and (pointer: coarse), (max-width: 520px) {
  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] {
    --memory-followup-gadget-size: var(--map-notice-gadget-size, var(--map-safe-gadget-size, 84px));
    position: fixed !important;
    right: auto !important;
    bottom: calc(
      var(--bottom-nav-height, 78px) +
      env(safe-area-inset-bottom, 0px) +
      18px +
      var(--memory-followup-gadget-size) +
      12px
    ) !important;
    left: calc(
      var(--mymappi-visual-offset-left, 0px) +
      (var(--mymappi-visible-width, 100vw) / 2)
    ) !important;
    width: min(
      420px,
      calc(
        var(--mymappi-visible-width, 100vw) -
        max(14px, env(safe-area-inset-left, 0px)) -
        max(14px, env(safe-area-inset-right, 0px))
      )
    ) !important;
    max-width: calc(
      var(--mymappi-visible-width, 100vw) -
      max(14px, env(safe-area-inset-left, 0px)) -
      max(14px, env(safe-area-inset-right, 0px))
    ) !important;
  }
}

@media (max-width: 380px) {
  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    min-height: 116px !important;
    padding: 10px 11px !important;
    gap: 2px 8px !important;
    border-radius: 21px !important;
  }

  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"][data-presentation="map-lane"] > span {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }

  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > :is(.memory-confirmation-view, .memory-confirmation-secondary) {
    padding-inline: 8px !important;
    font-size: 0.68rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"],
  html:not(#memory-followup-v722-a):not(#memory-followup-v722-b) body main.app-shell section.map-stage #memorySaveConfirmation.memory-save-confirmation.has-followup[data-kind="success"] .memory-confirmation-actions > button {
    transition: none !important;
  }
}
