/* Memory Capsule v4: a calm keepsake surface with an expressive heart state. */
html body .app-shell .memory-bottom-sheet.open,
html body main.app-shell .memory-bottom-sheet.open {
  background: rgba(3, 26, 34, 0.24) !important;
  backdrop-filter: blur(12px) saturate(0.88) !important;
  -webkit-backdrop-filter: blur(12px) saturate(0.88) !important;
}

html body .app-shell .memory-bottom-sheet.open .memory-sheet-card.full-memory-capsule,
html body main.app-shell .memory-bottom-sheet.open .memory-sheet-card.full-memory-capsule {
  max-width: 900px !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  background:
    linear-gradient(180deg, rgba(253, 255, 253, 0.995), rgba(242, 249, 246, 0.995)) !important;
  box-shadow:
    0 38px 96px rgba(2, 26, 34, 0.28),
    0 12px 32px rgba(4, 77, 75, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

.full-memory-capsule .memory-capsule-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.full-memory-capsule .memory-capsule-heart-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(12, 79, 82, 0.08);
  border-radius: 50%;
  color: #8aa0a3;
  background: rgba(255, 255, 255, 0.72);
  transition:
    color 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 260ms ease,
    transform 260ms cubic-bezier(0.2, 0.78, 0.22, 1);
}

.full-memory-capsule .memory-capsule-heart-mark svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.full-memory-capsule .memory-capsule-heart-mark.is-hearted {
  color: #e84867;
  border-color: rgba(232, 72, 103, 0.18);
  background: #fff0f3;
  box-shadow: 0 8px 20px rgba(211, 54, 87, 0.12);
}

.full-memory-capsule .memory-capsule-heart-mark.is-hearted svg {
  fill: currentColor;
}

html body .app-shell .full-memory-capsule .memory-capsule-hero,
html body main.app-shell .full-memory-capsule .memory-capsule-hero {
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--sheet-accent) 24%, transparent), transparent 38%),
    radial-gradient(circle at 6% 112%, rgba(73, 210, 163, 0.18), transparent 42%),
    linear-gradient(135deg, #063744 0%, #07595e 50%, #0a756b 100%) !important;
  box-shadow:
    0 20px 44px rgba(3, 54, 61, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-media,
html body main.app-shell .full-memory-capsule .memory-capsule-media {
  border-color: rgba(9, 91, 88, 0.08) !important;
  background: rgba(237, 247, 243, 0.82) !important;
  box-shadow:
    0 14px 34px rgba(5, 65, 70, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-action-dock,
html body main.app-shell .full-memory-capsule .memory-capsule-action-dock {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  padding: 10px 0 0 !important;
  gap: 16px !important;
  border: 0 !important;
  border-top: 1px solid rgba(8, 79, 80, 0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-action-group,
html body main.app-shell .full-memory-capsule .memory-capsule-action-group {
  padding: 8px 0 0 !important;
  gap: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.full-memory-capsule .memory-capsule-action-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 2px;
}

.full-memory-capsule .memory-capsule-action-heading small {
  overflow: hidden;
  color: #71878b;
  font-size: 0.58rem;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .app-shell .full-memory-capsule .memory-capsule-memory-controls,
html body main.app-shell .full-memory-capsule .memory-capsule-memory-controls {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 7px !important;
}

.full-memory-capsule .memory-capsule-secondary-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

html body .app-shell .full-memory-capsule .memory-capsule-heart-action,
html body main.app-shell .full-memory-capsule .memory-capsule-heart-action {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  min-height: 58px !important;
  padding: 9px 12px !important;
  gap: 10px !important;
  justify-content: stretch !important;
  border-color: rgba(12, 86, 87, 0.1) !important;
  border-radius: 16px !important;
  color: #174c58 !important;
  text-align: left !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 8px 20px rgba(8, 68, 72, 0.06) !important;
  transition:
    color 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 260ms ease,
    transform 220ms ease !important;
}

.full-memory-capsule .memory-capsule-heart-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #6e898e;
  background: rgba(13, 105, 104, 0.07);
  transition: inherit;
}

.full-memory-capsule .memory-capsule-heart-icon svg {
  width: 19px !important;
  height: 19px !important;
}

.full-memory-capsule .memory-capsule-heart-action .memory-capsule-action-copy {
  align-content: center;
  text-align: left;
}

.full-memory-capsule .memory-capsule-heart-action .memory-capsule-action-copy strong {
  color: inherit !important;
  font-size: 0.76rem !important;
  line-height: 1.1 !important;
}

.full-memory-capsule .memory-capsule-heart-action .memory-capsule-action-copy small {
  margin-top: 3px;
  color: #778b8f !important;
  font-size: 0.61rem !important;
}

html body .app-shell .full-memory-capsule .memory-capsule-heart-action.is-hearted,
html body main.app-shell .full-memory-capsule .memory-capsule-heart-action.is-hearted {
  color: #a92e48 !important;
  border-color: rgba(227, 71, 102, 0.24) !important;
  background:
    linear-gradient(135deg, rgba(255, 248, 249, 0.98), rgba(255, 234, 239, 0.98)) !important;
  box-shadow:
    0 12px 28px rgba(201, 48, 79, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.full-memory-capsule .memory-capsule-heart-action.is-hearted .memory-capsule-heart-icon {
  color: #e84867;
  background: rgba(232, 72, 103, 0.12);
  box-shadow: 0 0 0 6px rgba(232, 72, 103, 0.055);
}

.full-memory-capsule .memory-capsule-heart-action.is-hearted .memory-capsule-heart-icon svg {
  fill: currentColor;
}

.full-memory-capsule .memory-capsule-heart-action.just-hearted .memory-capsule-heart-icon {
  animation: memoryCapsuleHeartbeat 720ms cubic-bezier(0.18, 0.8, 0.2, 1);
}

.full-memory-capsule .memory-capsule-heart-action.just-unhearted {
  animation: memoryCapsuleUnheart 360ms ease;
}

.full-memory-capsule .memory-capsule-heart-confirmation {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 3;
  padding: 7px 10px;
  border: 1px solid rgba(232, 72, 103, 0.18);
  border-radius: 999px;
  color: #a92e48;
  background: rgba(255, 244, 247, 0.96);
  box-shadow: 0 10px 24px rgba(145, 35, 59, 0.13);
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px) scale(0.96);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.2, 0.78, 0.22, 1);
  font-size: 0.64rem;
  font-weight: 850;
}

.full-memory-capsule .memory-capsule-heart-confirmation.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.full-memory-capsule .memory-capsule-heart-confirmation.is-unhearted {
  color: #506d73;
  border-color: rgba(8, 86, 87, 0.12);
  background: rgba(246, 251, 249, 0.96);
}

.full-memory-capsule .memory-capsule-manage-group {
  position: relative;
}

@keyframes memoryCapsuleHeartbeat {
  0%, 100% { transform: scale(1); }
  28% { transform: scale(1.14); }
  48% { transform: scale(0.96); }
  70% { transform: scale(1.09); }
}

@keyframes memoryCapsuleUnheart {
  0% { transform: scale(1); }
  55% { transform: scale(0.985); }
  100% { transform: scale(1); }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  html body .app-shell .full-memory-capsule .memory-capsule-action-dock,
  html body main.app-shell .full-memory-capsule .memory-capsule-action-dock {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .full-memory-capsule .memory-capsule-action-heading {
    display: grid;
    gap: 2px;
  }

  .full-memory-capsule .memory-capsule-action-heading small {
    text-align: left;
  }

  .full-memory-capsule .memory-capsule-heart-confirmation {
    right: 10px;
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .full-memory-capsule .memory-capsule-heart-mark,
  .full-memory-capsule .memory-capsule-heart-action,
  .full-memory-capsule .memory-capsule-heart-icon,
  .full-memory-capsule .memory-capsule-heart-confirmation {
    animation: none !important;
    transition: none !important;
  }
}
