/* Phase 2 return loop: calm chapter completion and private monthly rediscovery. */

html body .app-shell .life-chapter-editor-intro {
  max-width: 430px !important;
  margin: -7px 0 0 !important;
  color: #58777d !important;
  font-size: 0.8rem !important;
  font-weight: 590 !important;
  line-height: 1.5 !important;
}

html body .app-shell .life-chapter-detail-field {
  display: grid !important;
  gap: 8px !important;
  color: #2c5d64 !important;
  font-size: 0.72rem !important;
  font-weight: 820 !important;
}

html body .app-shell .life-chapter-detail-field textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 92px !important;
  max-height: 180px !important;
  padding: 12px 13px !important;
  resize: vertical !important;
  border: 1px solid rgba(17, 101, 103, 0.17) !important;
  border-radius: 15px !important;
  color: #103f49 !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
  font: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 610 !important;
  line-height: 1.45 !important;
}

html body .app-shell .life-chapter-detail-field textarea:focus {
  outline: 3px solid rgba(26, 169, 139, 0.13) !important;
  border-color: rgba(13, 132, 118, 0.48) !important;
}

html body .app-shell .life-chapter-detail-field > small {
  color: #71898e !important;
  font-size: 0.67rem !important;
  font-weight: 590 !important;
  line-height: 1.42 !important;
}

html body .app-shell .life-chapter-private-note {
  display: inline-flex !important;
  width: fit-content !important;
  min-height: 30px !important;
  margin: -4px 0 0 !important;
  padding: 6px 10px !important;
  align-items: center !important;
  gap: 6px !important;
  border: 1px solid rgba(31, 126, 115, 0.12) !important;
  border-radius: 999px !important;
  color: #57777b !important;
  background: rgba(231, 247, 241, 0.68) !important;
  font-size: 0.66rem !important;
  font-weight: 720 !important;
}

html body .app-shell .life-chapter-private-note svg {
  width: 13px !important;
  height: 13px !important;
  color: #178979 !important;
}

html body .app-shell .life-chapter-card.has-finish-action .life-chapter-relive {
  background: linear-gradient(135deg, #084f5e 0%, #0b827a 58%, #19a474 100%) !important;
  box-shadow: 0 12px 25px rgba(7, 108, 98, 0.2) !important;
}

html body .app-shell .life-chapter-card.has-finish-action .life-chapter-relive:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 15px 28px rgba(7, 108, 98, 0.24) !important;
}

html body .app-shell .monthly-recap-dialog,
html body .app-shell .return-loop-settings-dialog {
  box-sizing: border-box !important;
  width: min(620px, calc(100vw - 28px)) !important;
  max-width: 620px !important;
  max-height: min(88vh, 820px) !important;
  max-height: min(88dvh, 820px) !important;
  margin: auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 28px !important;
  color: #123f4b !important;
  background: transparent !important;
  box-shadow: 0 36px 90px rgba(2, 25, 38, 0.34) !important;
}

html body .app-shell .monthly-recap-dialog::backdrop,
html body .app-shell .return-loop-settings-dialog::backdrop {
  background: rgba(3, 25, 37, 0.64) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

html body .app-shell .monthly-recap-panel,
html body .app-shell .return-loop-settings-panel {
  position: relative !important;
  display: grid !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-height: min(88vh, 820px) !important;
  max-height: min(88dvh, 820px) !important;
  padding: 24px !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  gap: 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  border: 1px solid rgba(220, 255, 246, 0.72) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(134, 239, 205, 0.22), transparent 34%),
    radial-gradient(circle at 100% 30%, rgba(107, 210, 205, 0.14), transparent 36%),
    linear-gradient(150deg, #fffefa, #eef8f5) !important;
}

html body .app-shell .monthly-recap-close,
html body .app-shell .return-loop-settings-panel > header > button {
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(16, 91, 96, 0.12) !important;
  border-radius: 50% !important;
  color: #174f5a !important;
  background: rgba(255, 255, 255, 0.76) !important;
  box-shadow: 0 8px 20px rgba(5, 48, 56, 0.08) !important;
}

html body .app-shell .monthly-recap-close {
  position: sticky !important;
  top: 18px !important;
  margin-left: auto !important;
  margin-bottom: -62px !important;
  justify-self: end !important;
  z-index: 2 !important;
}

html body .app-shell .monthly-recap-close svg,
html body .app-shell .return-loop-settings-panel > header > button svg {
  width: 18px !important;
  height: 18px !important;
}

html body .app-shell .monthly-recap-panel > header {
  display: grid !important;
  max-width: calc(100% - 54px) !important;
  gap: 5px !important;
}

html body .app-shell .monthly-recap-panel > header > span,
html body .app-shell .return-loop-settings-panel > header > div > span {
  color: #258273 !important;
  font-size: 0.68rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

html body .app-shell .monthly-recap-panel h2,
html body .app-shell .return-loop-settings-panel h2 {
  margin: 0 !important;
  color: #083f4b !important;
  font-size: clamp(1.45rem, 4vw, 2rem) !important;
  font-weight: 840 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.035em !important;
}

html body .app-shell .monthly-recap-panel > header p,
html body .app-shell .return-loop-settings-panel > header p {
  max-width: 480px !important;
  margin: 1px 0 0 !important;
  color: #58777d !important;
  font-size: 0.82rem !important;
  font-weight: 580 !important;
  line-height: 1.5 !important;
}

html body .app-shell .monthly-recap-hero {
  position: relative !important;
  display: grid !important;
  min-height: 220px !important;
  width: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(38, 130, 120, 0.14) !important;
  border-radius: 22px !important;
  color: #fff !important;
  text-align: left !important;
  cursor: pointer !important;
  background: linear-gradient(145deg, #0a4c5a, #0b8178 60%, #1aa577) !important;
  box-shadow: 0 16px 38px rgba(7, 88, 83, 0.16) !important;
}

html body .app-shell .monthly-recap-hero > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: var(--home-photo-position, center 36%) !important;
}

html body .app-shell .monthly-recap-hero::after {
  position: absolute !important;
  inset: 0 !important;
  content: "" !important;
  background: linear-gradient(180deg, rgba(2, 22, 31, 0.05), rgba(2, 28, 35, 0.78)) !important;
}

html body .app-shell .monthly-recap-hero:focus-visible {
  outline: 3px solid rgba(51, 205, 170, 0.4) !important;
  outline-offset: 3px !important;
}

html body .app-shell .monthly-recap-hero-copy {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  align-self: end !important;
  padding: 22px !important;
  gap: 5px !important;
}

html body .app-shell .monthly-recap-hero-copy > small {
  color: rgba(232, 255, 248, 0.82) !important;
  font-size: 0.67rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
}

html body .app-shell .monthly-recap-hero-copy > strong {
  color: #fff !important;
  font-size: clamp(1.25rem, 4.5vw, 1.8rem) !important;
  font-weight: 850 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em !important;
}

html body .app-shell .monthly-recap-hero-copy > span {
  color: rgba(237, 255, 250, 0.8) !important;
  font-size: 0.77rem !important;
  font-weight: 620 !important;
}

html body .app-shell .monthly-recap-memories {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

html body .app-shell .monthly-recap-memory {
  display: grid !important;
  grid-template-columns: 68px minmax(0, 1fr) 28px !important;
  min-width: 0 !important;
  min-height: 84px !important;
  padding: 8px !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
  border: 1px solid rgba(28, 105, 105, 0.12) !important;
  border-radius: 18px !important;
  color: #113f49 !important;
  text-align: left !important;
  background: rgba(255, 255, 255, 0.76) !important;
  box-shadow: 0 9px 22px rgba(8, 66, 70, 0.06) !important;
}

html body .app-shell .monthly-recap-memory:hover {
  border-color: rgba(20, 139, 122, 0.3) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  transform: translateY(-1px) !important;
}

html body .app-shell .monthly-recap-memory-media {
  display: grid !important;
  width: 68px !important;
  height: 68px !important;
  overflow: hidden !important;
  place-items: center !important;
  border-radius: 14px !important;
  color: #fff !important;
  background: linear-gradient(145deg, #0d6670, #18a177) !important;
}

html body .app-shell .monthly-recap-memory-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: var(--home-photo-position, center 36%) !important;
}

html body .app-shell .monthly-recap-memory-media img.is-mymappi-image-fallback {
  box-sizing: border-box !important;
  padding: 8px !important;
  object-fit: contain !important;
}

html body .app-shell .monthly-recap-memory-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 3px !important;
}

html body .app-shell .monthly-recap-memory-copy strong {
  overflow: hidden !important;
  color: #0e4650 !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body .app-shell .monthly-recap-memory-copy small {
  overflow: hidden !important;
  color: #617d82 !important;
  font-size: 0.69rem !important;
  font-weight: 610 !important;
  line-height: 1.32 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body .app-shell .monthly-recap-memory > svg {
  width: 18px !important;
  height: 18px !important;
  justify-self: center !important;
  color: #278f7f !important;
}

html body .app-shell .monthly-recap-panel > footer,
html body .app-shell .return-loop-settings-panel > footer {
  display: flex !important;
  min-height: 48px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

html body .app-shell .monthly-recap-panel > footer > span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #607c81 !important;
  font-size: 0.69rem !important;
  font-weight: 700 !important;
}

html body .app-shell .monthly-recap-panel > footer > span svg {
  width: 14px !important;
  height: 14px !important;
  color: #188778 !important;
}

html body .app-shell .monthly-recap-panel > footer > button,
html body .app-shell .return-loop-settings-save {
  min-height: 44px !important;
  padding: 9px 16px !important;
  border: 1px solid #0b756d !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: linear-gradient(135deg, #0b5965, #138d73) !important;
  box-shadow: 0 10px 22px rgba(8, 101, 91, 0.18) !important;
  font: inherit !important;
  font-size: 0.74rem !important;
  font-weight: 820 !important;
}

html body .app-shell .return-loop-settings-panel > header {
  display: flex !important;
  align-items: start !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

html body .app-shell .return-loop-settings-panel > header > div {
  display: grid !important;
  gap: 5px !important;
}

html body .app-shell .return-loop-setting-list {
  display: grid !important;
  gap: 9px !important;
}

html body .app-shell .return-loop-setting-list > label {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 72px !important;
  padding: 13px 14px !important;
  align-items: center !important;
  gap: 14px !important;
  border: 1px solid rgba(24, 108, 104, 0.12) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

html body .app-shell .return-loop-setting-list > label > span {
  display: grid !important;
  min-width: 0 !important;
  gap: 3px !important;
}

html body .app-shell .return-loop-setting-list strong {
  color: #124851 !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
}

html body .app-shell .return-loop-setting-list small {
  color: #648086 !important;
  font-size: 0.69rem !important;
  font-weight: 590 !important;
  line-height: 1.4 !important;
}

html body .app-shell .return-loop-setting-list input[type="checkbox"] {
  width: 46px !important;
  height: 26px !important;
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: #0d8e7c !important;
}

html body .app-shell .return-loop-cadence-note {
  display: flex !important;
  margin: 0 !important;
  padding: 11px 13px !important;
  align-items: center !important;
  gap: 9px !important;
  border: 1px solid rgba(31, 126, 115, 0.11) !important;
  border-radius: 15px !important;
  color: #57777b !important;
  background: rgba(231, 247, 241, 0.66) !important;
  font-size: 0.7rem !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
}

html body .app-shell .return-loop-cadence-note svg {
  width: 17px !important;
  height: 17px !important;
  flex: 0 0 17px !important;
  color: #168878 !important;
}

html body .app-shell .return-loop-settings-panel > footer > small {
  max-width: 300px !important;
  color: #6b8589 !important;
  font-size: 0.67rem !important;
  font-weight: 590 !important;
  line-height: 1.4 !important;
}

html body main.app-shell .notification-private-note {
  justify-content: space-between !important;
  gap: 10px !important;
}

html body main.app-shell .notification-private-copy {
  display: inline-flex !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 6px !important;
}

html body main.app-shell .notification-settings-button {
  display: inline-flex !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 8px 10px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid rgba(135, 226, 201, 0.2) !important;
  border-radius: 999px !important;
  color: #b8f4e3 !important;
  background: rgba(135, 226, 201, 0.08) !important;
  font: inherit !important;
  font-size: 0.66rem !important;
  font-weight: 790 !important;
}

html body main.app-shell .notification-settings-button svg {
  width: 14px !important;
  height: 14px !important;
}

html body main.app-shell .notification-icon.chapter {
  background: linear-gradient(145deg, #1d9a83, #176e85) !important;
}

html body main.app-shell .notification-icon.recap {
  background: linear-gradient(145deg, #2fae92, #1d7c8c) !important;
}

@media (max-width: 640px) {
  html body .app-shell .life-chapter-editor-dialog,
  html body .app-shell .monthly-recap-dialog,
  html body .app-shell .return-loop-settings-dialog {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 26px) !important;
    max-height: calc(100dvh - 26px) !important;
  }

  html body .app-shell .life-chapter-editor-panel,
  html body .app-shell .monthly-recap-panel,
  html body .app-shell .return-loop-settings-panel {
    max-height: calc(100vh - 26px) !important;
    max-height: calc(100dvh - 26px) !important;
    padding: 18px !important;
    padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
    gap: 15px !important;
    border-radius: 24px !important;
  }

  html body .app-shell .life-chapter-editor-panel > footer {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  html body .app-shell .life-chapter-editor-panel > footer > span {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  html body .app-shell .life-chapter-editor-panel > footer button {
    min-height: 44px !important;
  }

  html body .app-shell .monthly-recap-hero {
    min-height: 200px !important;
  }

  html body .app-shell .monthly-recap-memories {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .app-shell .monthly-recap-panel > footer,
  html body .app-shell .return-loop-settings-panel > footer {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  html body .app-shell .monthly-recap-panel > footer > button,
  html body .app-shell .return-loop-settings-save {
    width: 100% !important;
  }

  html body main.app-shell .notification-private-note {
    align-items: center !important;
  }

  html body main.app-shell .notification-settings-button {
    min-width: 44px !important;
    padding-inline: 9px !important;
  }

  html body main.app-shell .notification-settings-button > span:last-child {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .life-chapter-card.has-finish-action .life-chapter-relive,
  html body .app-shell .monthly-recap-memory {
    transition: none !important;
  }
}
