body:has(.memory-ended) {
  margin: 0;
  background: var(--app-flow-bg);
  color: var(--app-flow-text);
  font-family: var(--app-flow-font);
}

body:has(.memory-ended) .footer-orb-1,
body:has(.memory-ended) .footer-orb-2 {
  display: none;
}

.memory-ended {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 72vh;
  max-width: 1104px;
  margin: 0 auto;
  padding: calc(var(--header-height, 4.5rem) + 56px) 32px 80px;
  font-family: var(--app-flow-font);
}

.memory-ended-summary {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.memory-ended-summary--without-cover {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.memory-ended-cover {
  margin: 0;
  min-width: 0;
}

.memory-ended-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  border-radius: var(--app-flow-radius);
}

.memory-ended-info {
  min-width: 0;
}

.memory-ended h1 {
  margin: 0;
  max-width: 26ch;
  color: var(--app-flow-heading);
  font-family: var(--app-flow-font);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.memory-ended-details {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.6;
}

.memory-ended-details li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.memory-ended-details svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--app-flow-muted);
}

.memory-ended-details time {
  font-variant-numeric: tabular-nums;
}

.memory-ended-status {
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--app-flow-border);
  color: var(--app-flow-muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .memory-ended {
    align-items: start;
    padding: calc(var(--header-height, 4.5rem) + 32px) 24px 56px;
  }
  .memory-ended-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .memory-ended-cover {
    width: 100%;
    max-width: 440px;
    justify-self: center;
  }
  .memory-ended-cover img { max-height: 360px; }
  .memory-ended-details { margin-top: 20px; }
}
