/* v648: final empty-home alignment, natural capture actions, and tablet map lanes. */

/* Today's Memory is the featured empty-state card and shares the full 760px rail. */
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay,
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-memory-card.is-empty-today,
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .empty-memory-invite,
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-memory-card.is-empty-today,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .empty-memory-invite,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card {
  box-sizing: border-box !important;
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  min-width: 0 !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card {
  padding-right: clamp(22px, 6vw, 58px) !important;
  padding-left: clamp(22px, 6vw, 58px) !important;
}

/* The old orange Echo accent looked like a rendering error at the card edge. */
html body .app-shell .map-stage.home-focus #homeOnThisDay .memory-echo-feature-card::before,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay .memory-echo-feature-card::before {
  display: none !important;
  content: none !important;
}

/* Only one first-run message owns the map lane at a time. */
html body:has(#locationBanner:not([hidden])) .app-shell .map-stage.map-focus .map-empty-state.is-visible,
html body:has(#locationBanner:not([hidden])) main.app-shell section.map-stage.map-focus .map-empty-state.is-visible {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* The first saved memory keeps Echo stable while a second memory is still forming. */
html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading > strong,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading > strong {
  display: none !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading {
  margin-bottom: 12px !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-feature-card.is-empty,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-feature-card.is-empty {
  display: grid !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "art kicker"
    "art copy"
    "footer footer" !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  min-width: 0 !important;
  min-height: 166px !important;
  margin: 0 auto !important;
  padding: 22px 26px !important;
  column-gap: 24px !important;
  row-gap: 7px !important;
  overflow: hidden !important;
  border: 1px solid rgba(16, 111, 116, 0.11) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(145deg, rgba(253, 255, 254, 0.98), rgba(230, 247, 244, 0.9)) !important;
  box-shadow:
    0 18px 44px rgba(13, 66, 73, 0.085),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-body,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-body {
  display: contents !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-reason-stack,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-reason-stack {
  grid-area: kicker !important;
  justify-self: start !important;
  width: auto !important;
  margin: 0 !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit {
  grid-area: art !important;
  position: relative !important;
  display: block !important;
  justify-self: center !important;
  width: 68px !important;
  height: 68px !important;
  border: 1px solid rgba(29, 137, 157, 0.12) !important;
  border-radius: 20px !important;
  background: linear-gradient(145deg, #eef9f7, #dceef4) !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 9px 18px rgba(9, 86, 101, 0.08) !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i {
  position: absolute !important;
  inset: 50% auto auto 50% !important;
  display: block !important;
  border: 1px solid rgba(17, 130, 150, 0.3) !important;
  border-radius: 50% !important;
  transform: translate(-50%, -50%) !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(1),
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(1) {
  width: 46px !important;
  height: 46px !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(2),
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(2) {
  width: 28px !important;
  height: 28px !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(3),
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(3) {
  width: 9px !important;
  height: 9px !important;
  border: 2px solid #ffffff !important;
  background: #f36567 !important;
  box-shadow: 0 4px 10px rgba(201, 58, 66, 0.2) !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-copy-main,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-copy-main {
  grid-area: copy !important;
  align-self: start !important;
  justify-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  gap: 5px !important;
  text-align: left !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-unlock,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-unlock {
  grid-area: footer !important;
  justify-self: center !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 2px auto 0 !important;
  text-align: center !important;
}

/* A text-only Today's Memory looks intentional instead of showing a stray pin. */
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-main.has-text-only,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-main.has-text-only {
  overflow: hidden !important;
  border: 1px solid rgba(18, 119, 112, 0.12) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.88), transparent 38%),
    radial-gradient(circle at 86% 18%, color-mix(in srgb, var(--today-memory-accent, #18a978) 18%, transparent), transparent 42%),
    linear-gradient(145deg, rgba(244, 253, 249, 0.98), rgba(221, 246, 241, 0.94)) !important;
  box-shadow:
    0 18px 42px rgba(8, 64, 70, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback {
  align-self: stretch !important;
  justify-self: stretch !important;
  display: grid !important;
  place-content: center !important;
  justify-items: center !important;
  min-height: 188px !important;
  padding: 22px !important;
  gap: 9px !important;
  color: #0b5960 !important;
  text-align: center !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.66), transparent 54%),
    repeating-linear-gradient(135deg, rgba(19, 137, 119, 0.025) 0 1px, transparent 1px 13px) !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback-mark,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback-mark {
  display: grid !important;
  place-items: center !important;
  width: 52px !important;
  height: 52px !important;
  border: 1px solid rgba(18, 119, 112, 0.13) !important;
  border-radius: 18px !important;
  color: #0b5960 !important;
  background: rgba(255, 255, 255, 0.76) !important;
  box-shadow: 0 12px 24px rgba(8, 64, 70, 0.09) !important;
  font-size: 1.45rem !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback-label,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback-label {
  color: rgba(8, 73, 79, 0.64) !important;
  font-size: 0.68rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.1em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

/* Relive keeps its geometry on hover; only the surface responds. */
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button,
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:hover,
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:focus-visible,
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:active,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:hover,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:focus-visible,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:active {
  transform: translateY(-50%) !important;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:hover,
html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:focus-visible,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:hover,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-relive-button:focus-visible {
  border-color: rgba(219, 255, 247, 0.38) !important;
  background-color: rgba(235, 255, 250, 0.18) !important;
  box-shadow:
    0 12px 24px rgba(1, 30, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Keep the storybook tabs inside the artwork instead of pushing into the copy. */
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-starter-book,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-starter-book {
  overflow: hidden !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs {
  right: 5px !important;
  bottom: 8px !important;
  gap: 3px !important;
  max-width: 44% !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs em,
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs em {
  box-sizing: border-box !important;
  max-width: 100% !important;
  padding: 2px 5px !important;
  overflow: hidden !important;
  border-radius: 6px !important;
  font-size: clamp(0.34rem, 0.7vw, 0.43rem) !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* The complete action group remains part of the form's natural scroll flow. */
@media (max-width: 900px) {
  html body .app-shell .memory-editor.open #memoryEditorActions,
  html body main.app-shell .memory-editor.open #memoryEditorActions,
  html body.keyboard-open .app-shell .memory-editor.open #memoryEditorActions,
  html body.keyboard-open main.app-shell .memory-editor.open #memoryEditorActions {
    position: static !important;
    inset: auto !important;
    float: none !important;
    translate: none !important;
    transform: none !important;
    z-index: auto !important;
  }

  html body .app-shell .memory-editor.open #memoryEditorActions::before,
  html body .app-shell .memory-editor.open #memoryEditorActions::after,
  html body main.app-shell .memory-editor.open #memoryEditorActions::before,
  html body main.app-shell .memory-editor.open #memoryEditorActions::after {
    display: none !important;
    content: none !important;
  }
}

/* iPad portrait and landscape: invitation and gadget occupy one protected row. */
@media (min-width: 721px) and (max-width: 1366px) {
  html body main.app-shell section.map-stage.map-focus .map-empty-state.is-visible,
  html body .app-shell section.map-stage.map-focus .map-empty-state.is-visible {
    position: fixed !important;
    right: calc(max(18px, env(safe-area-inset-right)) + 102px) !important;
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom) + 20px) !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    display: grid !important;
    grid-template-columns: 58px 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: auto !important;
    min-width: 0 !important;
    min-height: 104px !important;
    max-height: 104px !important;
    margin: 0 !important;
    padding: 13px 18px !important;
    gap: 3px 13px !important;
    border-radius: 26px !important;
    text-align: left !important;
    transform: none !important;
  }

  html body main.app-shell section.map-stage.map-focus .map-empty-state.is-visible img,
  html body .app-shell section.map-stage.map-focus .map-empty-state.is-visible img {
    grid-area: mascot !important;
    align-self: center !important;
    justify-self: center !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  html body main.app-shell section.map-stage.map-focus .map-empty-state.is-visible strong,
  html body .app-shell section.map-stage.map-focus .map-empty-state.is-visible strong {
    grid-area: title !important;
    align-self: end !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    font-size: 1rem !important;
    line-height: 1.12 !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body main.app-shell section.map-stage.map-focus .map-empty-state.is-visible span,
  html body .app-shell section.map-stage.map-focus .map-empty-state.is-visible span {
    grid-area: copy !important;
    align-self: start !important;
    display: -webkit-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    font-size: 0.84rem !important;
    line-height: 1.28 !important;
    text-align: left !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  html body main.app-shell section.map-stage.map-focus .map-empty-state.is-visible::after,
  html body .app-shell section.map-stage.map-focus .map-empty-state.is-visible::after {
    right: -7px !important;
    bottom: 24px !important;
    left: auto !important;
    transform: rotate(45deg) !important;
  }

  html body:has(.map-empty-state.is-visible) main.app-shell section.map-stage.map-focus .map-navigation-gadget,
  html body:has(.map-empty-state.is-visible) .app-shell section.map-stage.map-focus .map-navigation-gadget {
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: calc(var(--bottom-nav-height, 78px) + env(safe-area-inset-bottom) + 20px) !important;
  }
}

@media (max-width: 720px) {
  /* Show the complete five-step guide on phones; no clipped rail or lone Place pill. */
  html body .app-shell .memory-editor .memory-editor-progress,
  html body main.app-shell .memory-editor .memory-editor-progress {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: stretch !important;
    box-sizing: border-box !important;
    width: calc(100% - 24px) !important;
    max-width: none !important;
    min-height: 44px !important;
    margin: 8px 12px 14px !important;
    padding: 5px !important;
    gap: 3px !important;
    overflow: hidden !important;
    border: 1px solid rgba(16, 89, 100, 0.09) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.68) !important;
    box-shadow: 0 9px 20px rgba(12, 64, 72, 0.055) !important;
  }

  html body .app-shell .memory-editor .memory-editor-progress::before,
  html body .app-shell .memory-editor .memory-editor-progress::after,
  html body main.app-shell .memory-editor .memory-editor-progress::before,
  html body main.app-shell .memory-editor .memory-editor-progress::after {
    display: none !important;
    content: none !important;
  }

  html body .app-shell .memory-editor .memory-editor-progress span,
  html body main.app-shell .memory-editor .memory-editor-progress span,
  html body .app-shell .memory-editor .memory-editor-progress span.active,
  html body main.app-shell .memory-editor .memory-editor-progress span.active {
    display: inline-flex !important;
    flex: 1 1 20% !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 5px 2px !important;
    overflow: hidden !important;
    border-radius: 11px !important;
    font-size: clamp(0.48rem, 2.45vw, 0.6rem) !important;
    line-height: 1 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .app-shell .memory-editor .memory-editor-progress i,
  html body main.app-shell .memory-editor .memory-editor-progress i {
    display: none !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card,
  html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeMemoryOfDay .today-empty-preview-card {
    max-width: 100% !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
  }

  html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback,
  html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-text-fallback {
    min-height: 220px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-feature-card.is-empty,
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-feature-card.is-empty {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    min-height: 152px !important;
    padding: 17px 16px !important;
    column-gap: 14px !important;
    row-gap: 6px !important;
    border-radius: 22px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit,
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit {
    width: 56px !important;
    height: 56px !important;
    border-radius: 18px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(1),
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(1) {
    width: 40px !important;
    height: 40px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(2),
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-empty-orbit i:nth-child(2) {
    width: 24px !important;
    height: 24px !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs,
  html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs {
    right: 3px !important;
    bottom: 5px !important;
    gap: 2px !important;
    max-width: 40% !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs em,
  html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home #homeJourney .life-chapter-book-tabs em {
    width: 15px !important;
    height: 4px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }
}
