#memory-open {
  color: var(--lilac);
  font-weight: 600;
  white-space: nowrap;
}
#memory-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #10101e;
  color: #fff2dc;
  overscroll-behavior: contain;
}
#memory-stage {
  position: absolute;
  inset: 0;
}
.memory-head, .memory-foot {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  pointer-events: none;
}
.memory-head {
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, #0c0c16e0, transparent);
}
.memory-head h2, #memory-photo-name {
  font: 500 clamp(1.12rem, 2.4vw, 1.4rem)/1.4 var(--serif);
}
.memory-head h2 { letter-spacing: .09em; }
.memory-track { color: #d2c2bb; font-size: .76rem; line-height: 1.5; }
.memory-actions { display: flex; align-items: center; }
.memory-return, .memory-controls button { pointer-events: auto; }
.memory-return {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 24px;
  color: #f6e8e0;
  font-size: .9rem;
}
.memory-return:hover { background: #ffffff16; }
.memory-foot {
  inset: auto 0 0;
  display: grid;
  justify-items: center;
  padding: 20px 14px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, #090b15f2, #10121dbe 66%, transparent);
  text-align: center;
}
#memory-photo-name {
  max-width: 92%;
  min-height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#memory-count { min-height: 1.3em; color: #d7c9c4; font: .83rem/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.memory-controls { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.memory-controls .round { display: grid; place-items: center; }
#memory-pause { background: #4c3a4d; border-color: #cfadbc7a; }
#memory-sound { margin-left: 5px; }
@media (max-width: 370px) {
  .collection-head { flex-wrap: wrap; gap: 0 7px; }
  .collection-options { gap: 4px; }
  #memory-open { gap: 3px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .memory-head { padding-block: 0; }
  .memory-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding-block: 5px max(5px, env(safe-area-inset-bottom));
  }
  #memory-photo-name { max-width: 35%; }
  .memory-controls { margin-top: 0; gap: 7px; }
}
