/* Build 650: one calm Home-page rhythm, a search-only scrolled Memory Lane,
   refined chapter titles, and a branded no-photo Memory Capsule. */

/* Memory Lane keeps its welcome title at the top, then gives scrolling space
   back to the archive while the compact search remains available. */
html body .app-shell .map-stage.memories-focus .memory-database-page .memory-hub-heading,
html body main.app-shell section.map-stage.memories-focus .memory-database-page .memory-hub-heading {
  max-height: 116px !important;
  overflow: hidden !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  transform-origin: top center !important;
  transition:
    max-height 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 150ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

html body .app-shell .map-stage.memories-focus .memory-database-page.is-search-condensed .memory-lane-toolbar,
html body main.app-shell section.map-stage.memories-focus .memory-database-page.is-search-condensed .memory-lane-toolbar {
  gap: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-radius: 17px !important;
  background: rgba(241, 249, 246, 0.965) !important;
  box-shadow: 0 14px 32px rgba(7, 55, 61, 0.075) !important;
}

html body .app-shell .map-stage.memories-focus .memory-database-page.is-search-condensed .memory-hub-heading,
html body main.app-shell section.map-stage.memories-focus .memory-database-page.is-search-condensed .memory-hub-heading {
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  pointer-events: none !important;
}

html body .app-shell .map-stage.memories-focus .memory-database-page.is-search-condensed .memory-lane-search,
html body main.app-shell section.map-stage.memories-focus .memory-database-page.is-search-condensed .memory-lane-search {
  min-height: 48px !important;
  border-color: rgba(10, 102, 98, 0.14) !important;
  background: rgba(255, 255, 253, 0.94) !important;
  box-shadow: 0 8px 20px rgba(8, 58, 63, 0.055) !important;
}

/* Home uses one 1080px outer rail, one 980px content rail, and a consistent
   760px preview rail for a brand-new account. */
html body .app-shell .map-stage.home-focus #homeDashboard,
html body main.app-shell section.map-stage.home-focus #homeDashboard {
  width: min(calc(100% - 32px), 1080px) !important;
  max-width: 1080px !important;
  row-gap: clamp(44px, 4.8vw, 60px) !important;
}

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

html body .app-shell .map-stage.home-focus #homeDashboard .home-section-heading,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-section-heading {
  display: grid !important;
  min-height: 54px !important;
  align-content: start !important;
  justify-items: center !important;
  gap: 8px !important;
  margin: 0 auto 16px !important;
  text-align: center !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-section-heading > strong,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-section-heading > strong {
  max-width: 720px !important;
  color: rgba(14, 63, 70, 0.66) !important;
  font-size: clamp(0.72rem, 1.15vw, 0.84rem) !important;
  font-weight: 780 !important;
  line-height: 1.3 !important;
  letter-spacing: 0 !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-section-title,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-section-title,
html body .app-shell .map-stage.home-focus #homeDashboard .home-kicker,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-kicker {
  display: inline-grid !important;
  grid-template-columns: 38px auto !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 48px !important;
  padding: 5px 17px 5px 7px !important;
  border: 1px solid rgba(12, 111, 109, 0.1) !important;
  border-radius: 999px !important;
  color: #0a3d49 !important;
  background: rgba(255, 255, 252, 0.76) !important;
  box-shadow:
    0 12px 26px rgba(7, 60, 64, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  font-weight: 900 !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .section-title-icon,
html body main.app-shell section.map-stage.home-focus #homeDashboard .section-title-icon {
  box-sizing: border-box !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-action-section,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-action-section {
  width: 100% !important;
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding-right: max(0px, env(safe-area-inset-right)) !important;
  padding-left: max(0px, env(safe-area-inset-left)) !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-quick-actions,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-quick-actions {
  width: min(100%, 980px) !important;
  max-width: 980px !important;
  margin: 0 auto !important;
  gap: clamp(10px, 1.5vw, 15px) !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card,
html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card:hover,
html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card:focus-visible,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-action-card,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-action-card:hover,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-action-card:focus-visible {
  min-height: 108px !important;
  border-radius: 22px !important;
  transform: none !important;
  transition: border-color 170ms ease, background-color 170ms ease, box-shadow 190ms ease !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card:hover,
html body main.app-shell section.map-stage.home-focus #homeDashboard .home-action-card:hover {
  border-color: rgba(11, 125, 114, 0.2) !important;
  box-shadow: 0 16px 34px rgba(8, 67, 70, 0.09) !important;
}

/* Early previews share the same width, corner language, and restrained depth. */
html body .app-shell .map-stage.home-focus #homeDashboard.is-empty-home :is(
  #homeMemoryOfDay .today-memory-card,
  #homeMemoryOfDay .today-memory-main,
  #homeMemoryOfDay .today-empty-preview-card,
  #homeOnThisDay .memory-echo-feature,
  #homeOnThisDay .memory-echo-feature-card,
  #homeJourney .life-chapter-empty,
  #homeTimelineStrip .recent-memories-panel,
  #homeTimelineStrip .recent-memories-empty
),
html body main.app-shell section.map-stage.home-focus #homeDashboard.is-empty-home :is(
  #homeMemoryOfDay .today-memory-card,
  #homeMemoryOfDay .today-memory-main,
  #homeMemoryOfDay .today-empty-preview-card,
  #homeOnThisDay .memory-echo-feature,
  #homeOnThisDay .memory-echo-feature-card,
  #homeJourney .life-chapter-empty,
  #homeTimelineStrip .recent-memories-panel,
  #homeTimelineStrip .recent-memories-empty
) {
  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;
  border-radius: 26px !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard :is(
  .today-memory-card,
  .memory-echo-feature-card,
  .life-chapter-card,
  .life-chapter-empty,
  .recent-memories-panel,
  .recent-memories-empty
),
html body main.app-shell section.map-stage.home-focus #homeDashboard :is(
  .today-memory-card,
  .memory-echo-feature-card,
  .life-chapter-card,
  .life-chapter-empty,
  .recent-memories-panel,
  .recent-memories-empty
) {
  border-color: rgba(12, 98, 99, 0.105) !important;
  box-shadow:
    0 18px 44px rgba(8, 61, 66, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

html body .app-shell .map-stage.home-focus #homeDashboard :is(
  .today-memory-photo-frame,
  .memory-echo-photo img,
  .life-chapter-cover img,
  .recent-memory-shelf-card img
),
html body main.app-shell section.map-stage.home-focus #homeDashboard :is(
  .today-memory-photo-frame,
  .memory-echo-photo img,
  .life-chapter-cover img,
  .recent-memory-shelf-card img
) {
  object-position: var(--home-photo-position, center 30%) !important;
  filter: saturate(0.96) contrast(1.015) !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-note,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-note {
  min-width: 0 !important;
  overflow: hidden !important;
  border-radius: 13px !important;
}

html body .app-shell .map-stage.home-focus #homeMemoryOfDay .today-memory-note-text,
html body main.app-shell section.map-stage.home-focus #homeMemoryOfDay .today-memory-note-text {
  display: -webkit-box !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

/* Chapter titles read like quiet editorial covers instead of labels. */
html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-cover-caption,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-cover-caption {
  display: grid !important;
  align-content: end !important;
  justify-items: start !important;
  gap: 4px !important;
  padding: clamp(20px, 3vw, 30px) !important;
  text-align: left !important;
  background: linear-gradient(180deg, transparent 6%, rgba(3, 35, 43, 0.12) 30%, rgba(3, 35, 43, 0.88) 100%) !important;
}

html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-number,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-number {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 0 9px !important;
  border: 1px solid rgba(226, 255, 247, 0.2) !important;
  border-radius: 999px !important;
  color: rgba(242, 255, 251, 0.86) !important;
  background: rgba(4, 50, 58, 0.42) !important;
  font-size: 0.58rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.11em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-cover-caption > strong,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-cover-caption > strong {
  display: -webkit-box !important;
  max-width: 92% !important;
  overflow: hidden !important;
  color: #fffdf6 !important;
  font-size: clamp(1.28rem, 2.2vw, 1.78rem) !important;
  font-weight: 900 !important;
  line-height: 1.03 !important;
  letter-spacing: -0.025em !important;
  text-wrap: balance !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

html body .app-shell .map-stage.home-focus #homeJourney .life-chapter-cover-caption > small,
html body main.app-shell section.map-stage.home-focus #homeJourney .life-chapter-cover-caption > small {
  max-width: 92% !important;
  overflow: hidden !important;
  color: rgba(244, 255, 252, 0.78) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* No-photo capsules keep the atmosphere but replace the blurred emoji with
   Mappi: a soft branded glow behind one clear, centered mascot. */
html body .app-shell .full-memory-capsule .memory-capsule-cover-placeholder.has-mappi-atmosphere,
html body main.app-shell .full-memory-capsule .memory-capsule-cover-placeholder.has-mappi-atmosphere {
  isolation: isolate !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--sheet-accent) 28%, transparent), transparent 34%),
    radial-gradient(circle at 18% 6%, rgba(153, 235, 211, 0.14), transparent 42%),
    linear-gradient(145deg, #063744, #086166 58%, #0a776d) !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-cover-placeholder.has-mappi-atmosphere > img,
html body main.app-shell .full-memory-capsule .memory-capsule-cover-placeholder.has-mappi-atmosphere > img {
  position: absolute !important;
  inset: 50% auto auto 50% !important;
  display: block !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-mappi-blur,
html body main.app-shell .full-memory-capsule .memory-capsule-mappi-blur {
  z-index: 0 !important;
  width: min(68%, 430px) !important;
  opacity: 0.28 !important;
  filter: blur(22px) saturate(0.88) !important;
  transform: translate(-50%, -48%) scale(1.24) !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-mappi-focus,
html body main.app-shell .full-memory-capsule .memory-capsule-mappi-focus {
  z-index: 1 !important;
  width: min(38%, 220px) !important;
  max-height: 74% !important;
  opacity: 0.96 !important;
  filter: drop-shadow(0 18px 26px rgba(2, 27, 35, 0.24)) !important;
  transform: translate(-50%, -46%) !important;
}

@media (min-width: 721px) and (max-width: 1366px) {
  html body .app-shell .map-stage.home-focus #homeDashboard > .home-action-section,
  html body main.app-shell section.map-stage.home-focus #homeDashboard > .home-action-section {
    width: 100% !important;
    max-width: 1080px !important;
    padding-right: max(8px, env(safe-area-inset-right)) !important;
    padding-left: max(8px, env(safe-area-inset-left)) !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard .home-quick-actions,
  html body main.app-shell section.map-stage.home-focus #homeDashboard .home-quick-actions {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
  }
}

@media (max-width: 720px) {
  html body .app-shell .map-stage.home-focus #homeDashboard,
  html body main.app-shell section.map-stage.home-focus #homeDashboard {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    row-gap: 34px !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard .home-section-heading {
    min-height: 48px !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard .home-section-title,
  html body .app-shell .map-stage.home-focus #homeDashboard .home-kicker {
    grid-template-columns: 34px auto !important;
    min-height: 44px !important;
    padding: 4px 15px 4px 6px !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard .section-title-icon {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
  }

  html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card,
  html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card:hover,
  html body .app-shell .map-stage.home-focus #homeDashboard .home-action-card:focus-visible {
    min-height: 92px !important;
    border-radius: 19px !important;
  }

  html body .app-shell .full-memory-capsule .memory-capsule-mappi-blur,
  html body main.app-shell .full-memory-capsule .memory-capsule-mappi-blur {
    width: min(82%, 360px) !important;
  }

  html body .app-shell .full-memory-capsule .memory-capsule-mappi-focus,
  html body main.app-shell .full-memory-capsule .memory-capsule-mappi-focus {
    width: min(48%, 180px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .map-stage.memories-focus .memory-database-page .memory-hub-heading,
  html body main.app-shell section.map-stage.memories-focus .memory-database-page .memory-hub-heading {
    transition: none !important;
  }
}
