/* =========================================================================
   Media, memories, and scrapbook
   ========================================================================= */

.media-strip-section {
  gap: 12px;
}

.media-strip-head {
  align-items: center;
}

.media-upload-button {
  position: relative;
  overflow: hidden;
}

.media-upload-button.is-disabled {
  opacity: 0.58;
  pointer-events: none;
}

.media-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.media-upload-tray {
  position: fixed;
  z-index: 80;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(82px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  max-width: 520px;
  margin-inline: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.media-upload-tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

.media-upload-tray-head span {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.media-upload-progress-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.media-upload-progress-item {
  display: grid;
  gap: 6px;
}

.media-upload-progress-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.media-upload-progress-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
}

.media-upload-progress-copy small {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.media-upload-progress-track {
  height: 5px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface-2);
}

.media-upload-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.media-upload-progress-item.is-done .media-upload-progress-track span {
  background: var(--free);
}

.media-upload-progress-item.is-failed .media-upload-progress-copy small {
  color: var(--busy);
  white-space: normal;
  text-align: right;
}

.media-upload-progress-item.is-failed .media-upload-progress-track span {
  background: var(--busy);
}

.memory-drop-target {
  position: absolute;
  inset: 12px;
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-radius: calc(var(--r-xl) - 4px);
  border: 2px dashed color-mix(in srgb, var(--accent) 54%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 120ms ease, transform 120ms ease;
  backdrop-filter: blur(12px);
}

.memory-drop-target strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.memory-drop-target span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.memory-detail-sheet.is-memory-drop-target .memory-drop-target {
  opacity: 1;
  transform: scale(1);
}

.media-strip-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 34%);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}

.media-thumb-card {
  appearance: none;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  scroll-snap-align: start;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.media-thumb-card:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--surface-2);
}

.media-thumb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
}

.media-thumb-card-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 8px 9px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 750;
}

.media-thumb-card-caption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-thumb-card-caption small {
  flex: none;
  color: var(--ink-mute);
  font-size: 0.7rem;
}

.media-strip-empty {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (min-width: 760px) {
  .media-strip-grid {
    grid-auto-columns: minmax(130px, 160px);
  }
}

.profile-photo-button,
.past-media-upload {
  justify-self: start;
}

.profile-hero-avatar,
.member-hero-avatar,
.hub-member-avatar {
  overflow: hidden;
}

.profile-hero-avatar img,
.member-hero-avatar img,
.hub-story-avatar img,
.hub-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-story-avatar img {
  border-radius: var(--r-full);
}

.hub-member-avatar img {
  border-radius: inherit;
}

.past-media-draft-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.past-media-draft-list span,
.memory-photo-upload {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.memory-photo-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.memory-photo-upload {
  position: relative;
  overflow: hidden;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: var(--r-full);
  background: var(--ink);
  border-color: transparent;
  color: var(--bg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.memory-photo-upload:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.memory-photo-upload.is-disabled {
  opacity: 0.58;
  pointer-events: none;
}

.memory-tiny-photo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.memory-card-photo.has-image {
  padding: 0;
  background: var(--surface-2);
  border-color: var(--line);
  overflow: hidden;
}

.memory-card-photo.has-image img {
  width: 100%;
  height: 100%;
  min-height: 108px;
  object-fit: cover;
}

.memory-stop-media-list {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-2);
}

.memory-stop-media-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.memory-stop-media-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.memory-stop-media-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.memory-search-section {
  gap: 12px;
}

.memory-search-box input {
  width: 100%;
  min-height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow-xs);
}

.memory-search-box input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.memory-result-list {
  display: grid;
  gap: 8px;
}

.memory-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.memory-result strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.04rem;
  letter-spacing: 0;
}

.memory-result span {
  color: var(--ink-mute);
  font-size: 0.8rem;
}

.memory-result p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.memory-wall-section {
  gap: 16px;
}

.memory-log-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.memory-privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.memory-privacy-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.memory-audience-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 850;
  vertical-align: middle;
  white-space: nowrap;
}

.memory-audience-indicator.is-shared {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}

button.memory-audience-indicator {
  cursor: pointer;
}

.memory-month-list {
  display: grid;
  gap: 18px;
}

.memory-month-section {
  display: grid;
  gap: 10px;
  position: relative;
  padding-left: 16px;
}

.memory-month-section::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: -22px;
  left: 4px;
  width: 2px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.memory-month-section:last-child::before {
  bottom: 16px;
}

.memory-month-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.memory-month-label::before {
  content: "";
  position: absolute;
  left: -18px;
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.memory-card-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .memory-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.memory-wall-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.memory-wall-card.is-clickable {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.memory-wall-card.is-clickable:hover,
.memory-wall-card.is-clickable:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  outline: none;
}

.memory-wall-card.is-cancelled {
  opacity: 0.72;
}

.memory-wall-card.is-birthday {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from 160deg, #ff7d59, #ffd166, #7bd88f, #5dc4ff, #b693ff, #ff7d59) border-box;
  box-shadow:
    var(--shadow-xs),
    0 0 0 1px color-mix(in srgb, #ffd166 16%, transparent),
    0 10px 24px color-mix(in srgb, #b693ff 12%, transparent);
}

.memory-wall-card.is-birthday .memory-card-photo {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.95), transparent 20%),
    radial-gradient(circle at 72% 16%, rgba(255, 197, 90, 0.72), transparent 24%),
    linear-gradient(150deg, #ffe8a3, #ffd1d6 52%, #d9f1ff);
  border-color: rgba(188, 116, 0, 0.24);
}

.memory-card-photo {
  position: relative;
  min-height: 108px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 22%, color-mix(in srgb, var(--accent) 50%, #fff), transparent 32%),
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}

.past-birthday-panel {
  display: grid;
  gap: 10px;
}

.past-birthday-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #ffd166 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 92%, #ffd166 8%);
}

.past-birthday-panel:has(input[name="birthdayOccasion"]:not(:checked)) .past-birthday-body {
  display: none;
}

.past-birthday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.past-trip-stops {
  display: grid;
  gap: 10px;
}

.past-trip-stops-head,
.past-trip-stop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.memory-edit-stop-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.past-trip-stops-head > div {
  display: grid;
  gap: 2px;
}

.past-trip-stops-head small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.past-trip-stop-list {
  display: grid;
  gap: 10px;
}

.past-trip-stop {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-1) 78%, var(--accent) 8%);
}

.past-trip-stop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.past-trip-stop-people {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.past-trip-stop-people legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 620px) {
  .past-trip-stop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.memory-card-photo > span:not(.memory-card-photo-count) {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0;
}

.memory-card-photo-count {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: var(--r-full);
  background: rgba(15, 14, 10, 0.72);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 850;
}

.memory-card-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.memory-card-date,
.memory-card-parent,
.memory-card-footer {
  color: var(--ink-mute);
  font-size: 0.76rem;
  font-weight: 750;
}

.memory-card-body h4 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.memory-card-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}

.memory-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.memory-card-open-cue {
  margin-left: auto;
  color: var(--ink-mute);
  font-size: 1.1rem;
  line-height: 1;
}

.memory-detail-sheet {
  max-width: 680px;
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 32%),
    var(--surface);
}

.memory-detail-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 170px;
  max-height: 320px;
  margin: 10px clamp(12px, 3vw, 18px) 0;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 28% 22%, color-mix(in srgb, var(--accent) 48%, #fff), transparent 34%),
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 24%, var(--surface-2)), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  width: calc(100% - clamp(24px, 6vw, 36px));
  padding: 0;
  color: var(--ink);
  font: inherit;
}

button.memory-detail-cover {
  cursor: pointer;
  touch-action: manipulation;
}

.memory-detail-cover > span:not(.memory-detail-photo-count) {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 500;
  letter-spacing: 0;
}

.memory-detail-cover.has-image {
  background: #e9e9e4;
  border-color: var(--line);
  box-shadow: none;
}

.memory-detail-cover.is-birthday:not(.has-image) {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 213, 151, 0.62), transparent 28%),
    radial-gradient(circle at 75% 10%, rgba(120, 210, 255, 0.28), transparent 26%),
    linear-gradient(150deg, color-mix(in srgb, #ff7d59 18%, var(--surface-2)), color-mix(in srgb, #5dc4ff 14%, var(--surface-2)));
  border-color: color-mix(in srgb, #ffd166 34%, var(--line));
}

.memory-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-detail-photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 14, 10, 0.62);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
}

.memory-detail-body {
  display: grid;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 24px) calc(24px + env(safe-area-inset-bottom));
}

.memory-detail-summary {
  display: grid;
  gap: 9px;
  margin-top: 0;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.memory-detail-summary.is-birthday {
  border-color: color-mix(in srgb, #ff7d59 28%, var(--line));
  background: transparent;
  box-shadow: none;
}

.memory-detail-summary h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.04;
}

.memory-detail-summary p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.memory-detail-meta-row,
.memory-detail-place-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.memory-detail-meta-row span,
.memory-detail-place-line span {
  color: var(--ink-mute);
  font-size: 0.76rem;
  font-weight: 800;
}

.memory-detail-meta-row {
  justify-content: space-between;
}

.memory-detail-meta-row .button {
  min-height: 34px;
  border-radius: var(--r-full);
}

.memory-edit-disclosure {
  margin-left: auto;
}

.memory-edit-disclosure[open] {
  flex: 1 1 100%;
  margin-left: 0;
}

.memory-edit-disclosure > summary {
  width: max-content;
  margin-left: auto;
  list-style: none;
  cursor: pointer;
}

.memory-edit-disclosure > summary::-webkit-details-marker {
  display: none;
}

.memory-edit-disclosure .memory-edit-form {
  margin-top: 12px;
}

.memory-edit-date-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, max-content);
  align-items: end;
  gap: 10px;
}

.memory-edit-date-time-row > .field {
  min-width: 0;
}

.memory-edit-date-time-row input[type="date"] {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.memory-edit-time-disclosure {
  min-width: 0;
}

.memory-edit-time-disclosure[open] {
  grid-column: 1 / -1;
}

.memory-edit-time-disclosure > summary {
  width: 100%;
  margin-left: auto;
  list-style: none;
  cursor: pointer;
  padding-inline: 14px;
  white-space: nowrap;
}

.memory-edit-time-disclosure > summary::-webkit-details-marker {
  display: none;
}

.memory-edit-entity-input-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
}

.memory-edit-entity-input-row input {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.memory-edit-entity-input-row .button {
  min-height: 100%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-inline: 16px;
}

.memory-edit-time-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.memory-edit-clear-time {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .memory-edit-date-time-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .memory-edit-time-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .memory-edit-entity-input-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .memory-edit-clear-time {
    width: 100%;
  }
}

.memory-edit-form .button.danger {
  border-color: color-mix(in srgb, var(--danger, #ff6f61) 32%, var(--line));
  color: color-mix(in srgb, var(--danger, #ff6f61) 82%, var(--ink));
}

.memory-hiking-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.memory-hiking-rating-list,
.memory-hiking-impression-list {
  display: grid;
  gap: 10px;
}

.memory-hiking-rating-row,
.memory-hiking-impression {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.memory-hiking-rating-fields,
.memory-hiking-impression > span {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.memory-hiking-rating-fields > strong,
.memory-hiking-impression strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.memory-hiking-impression small {
  display: block;
  color: var(--ink-mute);
  font-size: 0.76rem;
  font-weight: 800;
}

.memory-hiking-impression em {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

.memory-detail-place-line span + span::before {
  content: none;
}

.memory-detail-place-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-detail-place-chip-glyph {
  flex: 0 0 auto;
  line-height: 1;
}

.memory-detail-place-chip > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-detail-movie-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.memory-detail-movie-card img,
.memory-detail-movie-card > span {
  width: 46px;
  height: 62px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.memory-detail-movie-card img {
  object-fit: cover;
}

.memory-detail-movie-card > span {
  display: grid;
  place-items: center;
}

.memory-detail-movie-card strong,
.memory-detail-movie-card small {
  display: block;
  min-width: 0;
}

.memory-detail-movie-card strong {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.memory-detail-movie-card small {
  margin-top: 3px;
  color: var(--ink-mute);
  font-size: 0.74rem;
  font-weight: 800;
}

button.memory-detail-place-chip {
  appearance: none;
  cursor: pointer;
}

button.memory-detail-place-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  color: var(--ink);
}

.memory-detail-chip-row,
.memory-detail-pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.memory-detail-chip-row {
  margin-top: 4px;
}

.memory-detail-pill-row > span,
.participant-name-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 11px 4px 5px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.participant-name-chip {
  appearance: none;
  cursor: pointer;
  max-width: 100%;
}

.participant-name-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  color: var(--ink);
}

.participant-chip-avatar {
  width: 26px;
  height: 26px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--member-color, var(--accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.participant-chip-avatar.has-image {
  border: 1px solid color-mix(in srgb, white 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 72%, transparent);
}

.participant-name-chip > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-detail-section {
  display: grid;
  gap: 10px;
}

.memory-detail-section-head,
.memory-detail-stop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.memory-detail-section-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.memory-detail-section-head > div > span {
  color: var(--ink-mute);
  font-size: 0.74rem;
  font-weight: 750;
}

.memory-detail-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.memory-detail-stop {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.memory-detail-photo-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-detail-photo-grid.small {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.memory-photo-section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.memory-photo-pile-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-1);
}

.memory-photo-pile-toolbar span {
  padding-left: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.memory-photo-pile-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
}

.memory-photo-pile-toolbar button:last-child {
  background: var(--accent);
  color: #fff;
}

.memory-detail-photo-frame {
  position: relative;
  margin: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  appearance: none;
  text-align: left;
  touch-action: manipulation;
}

.memory-detail-photo-pile::before,
.memory-detail-photo-pile::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: inherit;
  pointer-events: none;
}

.memory-detail-photo-pile::before {
  transform: translate(7px, -7px);
}

.memory-detail-photo-pile::after {
  transform: translate(3px, -3px);
}

.memory-detail-photo-pile-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.memory-detail-photo-frame:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.memory-detail-photo-grid.has-feature .memory-detail-photo-frame.is-featured {
  grid-column: 1 / -1;
}

.memory-detail-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.memory-detail-photo-select {
  display: grid;
}

.memory-detail-photo-select > button:first-child {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.memory-detail-photo-select.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.memory-detail-photo-select-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-weight: 950;
}

.memory-detail-photo-cover-choice {
  min-height: 34px;
  border: 0;
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.memory-detail-photo-select.is-cover .memory-detail-photo-cover-choice {
  background: var(--accent);
  color: #fff;
}

.memory-detail-photo-grid.has-feature .memory-detail-photo-frame.is-featured img {
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #0a0a0d;
}

.memory-photo-viewer-shell {
  z-index: 82;
  align-items: stretch;
  padding: 0;
  background: #07080b;
}

.memory-photo-viewer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: #07080b;
  border: 0;
  color: #fffaf0;
  transition: background-color 180ms ease;
}

.memory-photo-viewer-topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(42px, auto);
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  position: relative;
  z-index: 8;
  transition: opacity 180ms ease, transform 180ms ease;
}

.memory-photo-icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fffaf0;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.memory-photo-icon-button:active {
  transform: scale(0.96);
}

.memory-photo-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
}

.memory-photo-title strong,
.memory-photo-title span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-title strong {
  font-size: 0.94rem;
}

.memory-photo-title span,
.memory-photo-viewer-foot {
  color: rgba(255, 250, 240, 0.66);
  font-size: 0.78rem;
  font-weight: 750;
}

.memory-photo-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.memory-photo-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(250px, calc(100vw - 28px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(20, 21, 24, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  text-align: left;
}

.memory-photo-action-menu span,
.memory-photo-action-menu button {
  min-width: 0;
  padding: 10px 12px;
  color: rgba(255, 250, 240, 0.82);
  font-size: 0.84rem;
  font-weight: 800;
}

.memory-photo-action-menu span {
  color: rgba(255, 250, 240, 0.56);
}

.memory-photo-action-menu button {
  width: 100%;
  border-radius: 10px;
  text-align: left;
}

.memory-photo-action-menu button:active {
  background: rgba(255, 255, 255, 0.08);
}

.memory-photo-action-menu button.is-danger {
  color: #ffb7ad;
}

[data-memory-photo-stage] {
  min-height: 0;
  display: grid;
  place-items: center;
}

.memory-photo-stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #050609;
  touch-action: none;
  user-select: none;
}

.memory-photo-backdrop {
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(28px) saturate(1.1);
  opacity: 0.28;
  transform: scale(1.08);
}

.memory-photo-carousel-track {
  position: relative;
  z-index: 1;
  justify-self: start;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  transition: transform 190ms cubic-bezier(0.2, 0.78, 0.22, 1);
  will-change: transform;
}

.memory-photo-stage.has-multiple .memory-photo-carousel-track {
  width: 300%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  transform: translate3d(calc(-33.333% + var(--photo-drag-x, 0px)), var(--photo-drag-y, 0px), 0);
}

.memory-photo-stage.is-dragging .memory-photo-carousel-track,
.memory-photo-stage.is-closing .memory-photo-carousel-track {
  transition: none;
}

.memory-photo-slide {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
}

.memory-photo-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: opacity 140ms ease, transform 190ms ease;
  -webkit-user-drag: none;
}

.memory-photo-stage.is-zoomed .memory-photo-slide.is-current .memory-photo-image {
  cursor: grab;
  transform: translate3d(var(--photo-pan-x, 0px), var(--photo-pan-y, 0px), 0) scale(var(--photo-scale, 2));
}

.memory-photo-preloads {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.memory-photo-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(5, 6, 9, 0.58);
  backdrop-filter: blur(8px);
  color: #fffaf0;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.memory-photo-nav.is-prev {
  left: 10px;
}

.memory-photo-nav.is-next {
  right: 10px;
}

.memory-photo-viewer-foot {
  display: grid;
  gap: 8px;
  text-align: center;
  position: relative;
  z-index: 4;
  max-height: 24dvh;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(12px + env(safe-area-inset-bottom));
  padding-top: 8px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.memory-photo-footer-card {
  display: grid;
  gap: 7px;
  padding: 7px 4px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.memory-photo-viewer-shell.is-details-open .memory-photo-viewer-foot {
  max-height: min(50dvh, 430px);
}

.memory-photo-viewer-shell.is-details-open .memory-photo-footer-card {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(20, 21, 24, 0.86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px) saturate(1.12);
}

.memory-photo-footer-card.is-editing {
  gap: 10px;
}

.memory-photo-footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.memory-photo-tag-summary {
  display: flex;
  flex: 1 1 160px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.memory-photo-tag-summary.expanded {
  justify-content: flex-start;
}

.memory-photo-tag-summary > span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 250, 240, 0.8);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-place-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.14);
  color: rgba(255, 250, 240, 0.9);
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-footer-tags {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.memory-photo-footer-tags.is-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.memory-photo-no-tags {
  color: rgba(255, 250, 240, 0.52);
  font-size: 0.76rem;
  font-weight: 760;
}

.memory-photo-footer-tags .participant-name-chip {
  min-height: 30px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 250, 240, 0.9);
}

.memory-photo-reactions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.memory-photo-reactions::-webkit-scrollbar {
  display: none;
}

.memory-photo-pile-cover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 250, 240, 0.72);
}

.memory-photo-pile-cover-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-pile-cover-row button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.16);
  color: #fffaf0;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.memory-photo-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: #fffaf0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}

.memory-photo-reaction.is-selected {
  background: rgba(255, 250, 240, 0.22);
  border-color: rgba(255, 250, 240, 0.38);
}

.memory-photo-reaction:active {
  transform: scale(0.95);
}

.memory-photo-reaction.is-busy {
  cursor: wait;
  opacity: 0.72;
}

.memory-photo-reaction strong {
  font-size: 0.72rem;
}

.memory-photo-comments {
  display: grid;
  gap: 7px;
}

.memory-photo-comment-list {
  display: grid;
  gap: 5px;
  max-height: 96px;
  overflow: auto;
}

.memory-photo-comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  color: rgba(255, 250, 240, 0.85);
  font-size: 0.8rem;
}

.memory-photo-comment strong {
  color: #fffaf0;
}

.memory-photo-comment span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.memory-photo-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.memory-photo-comment-form input {
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #fffaf0;
  font-size: 16px;
}

.memory-photo-comment-form button {
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: #fffaf0;
  color: #101114;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.memory-photo-manage-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fffaf0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.memory-photo-add-tag-pill {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 250, 240, 0.62);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
}

.memory-photo-tag-name-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  white-space: normal;
}

.memory-photo-tag-name-row .participant-name-chip {
  min-height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 250, 240, 0.9);
}

.memory-photo-tag-picker {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 5;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.memory-photo-edit-controls {
  display: grid;
  gap: 8px;
}

.memory-photo-footer-card.is-editing .memory-photo-tag-picker,
.memory-photo-footer-card.is-editing .memory-photo-place-picker {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.memory-photo-place-picker {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}

.memory-photo-place-picker span {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-photo-place-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-photo-place-choice {
  max-width: 100%;
}

.memory-photo-place-choice.is-selected {
  box-shadow: 0 0 0 1px rgba(255, 250, 240, 0.14) inset;
}

.memory-photo-memory-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fffaf0;
  text-align: left;
  cursor: pointer;
}

.memory-photo-memory-link.is-placeholder {
  cursor: default;
}

.memory-photo-memory-link span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-memory-link-glyph {
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.13);
  color: #fffaf0;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.memory-photo-memory-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.memory-photo-memory-copy strong,
.memory-photo-memory-copy small,
.memory-photo-memory-placeholder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-memory-copy strong {
  color: #fffaf0;
  font-size: 0.95rem;
  font-weight: 920;
}

.memory-photo-memory-copy small,
.memory-photo-memory-placeholder {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.74rem;
  font-weight: 820;
}

.memory-photo-tag-group {
  display: grid;
  gap: 6px;
}

.memory-photo-tag-group > span {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-photo-tag-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-photo-tag-chip {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 250, 240, 0.86);
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.memory-photo-tag-chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #101114;
}

.memory-photo-tag-chip:disabled {
  cursor: wait;
  opacity: 0.72;
}

.memory-photo-viewer-shell.is-chrome-hidden:not(.is-managing):not(.is-actions-open) .memory-photo-viewer-topbar {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.memory-photo-viewer-shell.is-chrome-hidden:not(.is-managing):not(.is-actions-open) .memory-photo-viewer-foot {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.memory-photo-viewer-shell.is-chrome-hidden:not(.is-managing):not(.is-actions-open) .memory-photo-nav {
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 720px) {
  .memory-photo-viewer-shell {
    align-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  }

  .memory-photo-viewer {
    width: min(100%, 1040px);
    height: min(92vh, 820px);
    height: min(92dvh, 820px);
    max-height: min(92vh, 820px);
    max-height: min(92dvh, 820px);
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(8, 9, 12, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-lg);
  }

  .memory-photo-viewer-topbar {
    padding-bottom: 0;
  }

  .memory-photo-viewer-foot {
    max-height: 26dvh;
    padding-top: 0;
  }

  .memory-photo-nav {
    opacity: 0.84;
  }

  .memory-photo-stage:hover .memory-photo-nav {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .memory-photo-nav {
    width: 36px;
    height: 50px;
    font-size: 1.9rem;
  }

  .memory-photo-nav.is-prev {
    left: 6px;
  }

  .memory-photo-nav.is-next {
    right: 6px;
  }

  .memory-photo-title strong {
    font-size: 0.86rem;
  }

  .memory-photo-delete-button {
    min-width: 42px;
    padding-inline: 10px;
  }
}

.memory-detail-empty {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  color: var(--ink-mute);
  font-size: 0.86rem;
  font-weight: 750;
}

.memory-detail-stop-list {
  display: grid;
  gap: 10px;
}

.memory-detail-stop {
  display: grid;
  gap: 10px;
}

.memory-detail-stop-head strong,
.memory-detail-stop-head span {
  display: block;
}

.memory-detail-stop-head strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.memory-detail-stop-head span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

@media (max-width: 480px) {
  .memory-detail-cover {
    min-height: 170px;
    margin-inline: 10px;
  }

  .memory-detail-summary h3 {
    font-size: 1.55rem;
  }

  .memory-detail-section-head,
  .memory-detail-stop-head {
    align-items: flex-start;
  }
}

/* Scrapbook (shared child idea) */
.shared-child-idea-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .shared-child-idea-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shared-child-idea-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.shared-child-idea-copy {
  display: grid;
  gap: 4px;
}

.shared-child-idea-copy strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
}

.shared-child-idea-items {
  display: grid;
  gap: 6px;
}

.shared-child-idea-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.memory-escape-room-panel {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.memory-escape-room-card > span {
  background: var(--surface-2);
}
