/* Final Home rhythm: keep empty previews calm while preserving populated memories. */

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 {
  min-height: 0 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  gap: 10px !important;
}

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 {
  width: auto !important;
  max-width: 30rem !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #174753 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: clamp(1rem, 2vw, 1.14rem) !important;
  font-weight: 760 !important;
  line-height: 1.25 !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading::after,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .home-section-heading::after {
  content: none !important;
  display: none !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty {
  min-height: 0 !important;
  padding-bottom: 18px !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 {
  min-height: 190px !important;
  padding: 16px 18px !important;
  gap: 10px 16px !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-reason,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-reason {
  color: #456971 !important;
  background: rgba(255, 255, 255, 0.68) !important;
  text-transform: none !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-copy-main small,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-copy-main small {
  max-width: 28rem !important;
}

html body .app-shell .map-stage.home-focus #homeOnThisDay,
html body .app-shell .map-stage.home-focus #homeJourney,
html body .app-shell .map-stage.home-focus #homeTimelineStrip,
html body main.app-shell section.map-stage.home-focus #homeOnThisDay,
html body main.app-shell section.map-stage.home-focus #homeJourney,
html body main.app-shell section.map-stage.home-focus #homeTimelineStrip {
  scroll-margin-top: 88px !important;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  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;
    gap: 8px !important;
  }

  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 {
    max-width: 18rem !important;
    font-size: 0.98rem !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 {
    min-height: 0 !important;
    padding: 15px !important;
    gap: 10px !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 {
    grid-template-columns: 82px minmax(0, 1fr) !important;
    gap: 11px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-thumb,
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-thumb {
    width: 82px !important;
    height: 74px !important;
    min-width: 82px !important;
    min-height: 74px !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-relive,
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay.is-empty .memory-echo-relive {
    width: min(100%, 176px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .map-stage.home-focus #homeOnThisDay,
  html body .app-shell .map-stage.home-focus #homeJourney,
  html body .app-shell .map-stage.home-focus #homeTimelineStrip {
    scroll-behavior: auto !important;
  }
}

/* v583: let the empty Life Chapters preview read like a book cover. */
html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty-copy,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty-copy {
  width: 100% !important;
  min-width: 0 !important;
  justify-self: stretch !important;
  justify-items: start !important;
  align-content: center !important;
  text-align: left !important;
}

html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty-copy > span,
html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty-copy > strong,
html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty-copy > small,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty-copy > span,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty-copy > strong,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty-copy > small {
  justify-self: start !important;
  margin-inline: 0 !important;
  text-align: left !important;
}
/* v581: calmer new-account promises and a centered Life Chapters action. */
html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty.premium-empty-preview,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty.premium-empty-preview {
  grid-template-columns: minmax(210px, 236px) minmax(0, 1fr) !important;
  grid-template-areas:
    "starter copy"
    "action action" !important;
  column-gap: 12px !important;
}

html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty-action,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty-action {
  grid-area: action !important;
  justify-self: center !important;
  min-width: 190px !important;
  text-align: center !important;
}

@media (max-width: 920px) {
  html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-empty.premium-empty-preview,
  html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-empty.premium-empty-preview {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "starter"
      "copy"
      "action" !important;
  }
}

/* v582: final Home media and responsive reliability pass. */
html body .app-shell .map-stage.home-focus .home-dashboard,
html body main.app-shell section.map-stage.home-focus .home-dashboard,
html body .app-shell .map-stage.home-focus .home-section,
html body main.app-shell section.map-stage.home-focus .home-section {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body .app-shell .map-stage.home-focus .home-section-heading,
html body main.app-shell section.map-stage.home-focus .home-section-heading,
html body .app-shell .map-stage.home-focus .memory-day-topline,
html body main.app-shell section.map-stage.home-focus .memory-day-topline {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body .app-shell .map-stage.home-focus .today-memory-photo,
html body .app-shell .map-stage.home-focus .memory-echo-thumb,
html body .app-shell .map-stage.home-focus .life-chapter-cover,
html body .app-shell .map-stage.home-focus .life-chapter-preview,
html body .app-shell .map-stage.home-focus .recent-memory-art,
html body .app-shell .map-stage.home-focus .recent-memory-mini-art,
html body main.app-shell section.map-stage.home-focus .today-memory-photo,
html body main.app-shell section.map-stage.home-focus .memory-echo-thumb,
html body main.app-shell section.map-stage.home-focus .life-chapter-cover,
html body main.app-shell section.map-stage.home-focus .life-chapter-preview,
html body main.app-shell section.map-stage.home-focus .recent-memory-art,
html body main.app-shell section.map-stage.home-focus .recent-memory-mini-art {
  isolation: isolate !important;
  overflow: hidden !important;
  background-color: #e6f2ee !important;
}

html body .app-shell .map-stage.home-focus .today-memory-photo img,
html body .app-shell .map-stage.home-focus .memory-echo-thumb img,
html body .app-shell .map-stage.home-focus .life-chapter-cover img,
html body .app-shell .map-stage.home-focus .life-chapter-preview img,
html body .app-shell .map-stage.home-focus .recent-memory-art img,
html body .app-shell .map-stage.home-focus .recent-memory-mini-art img,
html body main.app-shell section.map-stage.home-focus .today-memory-photo img,
html body main.app-shell section.map-stage.home-focus .memory-echo-thumb img,
html body main.app-shell section.map-stage.home-focus .life-chapter-cover img,
html body main.app-shell section.map-stage.home-focus .life-chapter-preview img,
html body main.app-shell section.map-stage.home-focus .recent-memory-art img,
html body main.app-shell section.map-stage.home-focus .recent-memory-mini-art img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}

html body .photo-lightbox video,
html body .memory-sheet video,
html body .memory-card-video {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(72dvh, 720px) !important;
  object-fit: contain !important;
  background: #071f2a !important;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  html body .app-shell .map-stage.home-focus,
  html body main.app-shell section.map-stage.home-focus {
    overflow-x: clip !important;
  }

  html body .app-shell .map-stage.home-focus .home-dashboard,
  html body main.app-shell section.map-stage.home-focus .home-dashboard {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  html body .app-shell .map-stage.home-focus .home-dashboard > .home-section,
  html body main.app-shell section.map-stage.home-focus .home-dashboard > .home-section {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .app-shell .map-stage.home-focus .home-quick-actions,
  html body main.app-shell section.map-stage.home-focus .home-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body .app-shell .map-stage.home-focus .home-action-card,
  html body main.app-shell section.map-stage.home-focus .home-action-card {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  html body .app-shell .map-stage.home-focus .home-action-card strong,
  html body main.app-shell section.map-stage.home-focus .home-action-card strong {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    line-height: 1.16 !important;
  }

  html body .app-shell .map-stage.home-focus #homeOnThisDay .memory-echo-body,
  html body main.app-shell section.map-stage.home-focus #homeOnThisDay .memory-echo-body {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-row,
  html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-row,
  html body .app-shell .map-stage.home-focus #homeTimelineStrip .recent-memory-strip,
  html body main.app-shell section.map-stage.home-focus #homeTimelineStrip .recent-memory-strip {
    max-width: 100% !important;
    scroll-padding-inline: 12px !important;
    overscroll-behavior-inline: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  html body .app-shell .map-stage.home-focus #homeTimelineStrip .recent-memory-filter-row,
  html body main.app-shell section.map-stage.home-focus #homeTimelineStrip .recent-memory-filter-row {
    display: flex !important;
    justify-content: flex-start !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }

  html body .app-shell .map-stage.home-focus #homeTimelineStrip .recent-memory-filter-row::-webkit-scrollbar,
  html body main.app-shell section.map-stage.home-focus #homeTimelineStrip .recent-memory-filter-row::-webkit-scrollbar {
    display: none !important;
  }

  html body .app-shell .map-stage.home-focus #homeTimelineStrip .recent-memory-filter,
  html body main.app-shell section.map-stage.home-focus #homeTimelineStrip .recent-memory-filter {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  html body .photo-lightbox video,
  html body .memory-sheet video,
  html body .memory-card-video {
    max-height: 62dvh !important;
  }
}

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