/* ---------- Share a memory ---------- */
.dropzone {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  padding: 1.4rem 1rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: #b9bcc0;
  background: rgba(255, 255, 255, 0.06);
}

.dropzone-hint { color: var(--ink-dim); font-size: 0.92rem; line-height: 1.7; }
.dropzone-hint small { font-size: 0.78rem; opacity: 0.8; }

/* Attachment tray — every photo/video/voice on the note, mixed, removable. */
.attach-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.attach-tray[hidden] { display: none; }
.attach-chip {
  position: relative;
  width: 68px; height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  flex: none;
}
.attach-chip img, .attach-chip video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.attach-audio {
  width: auto; min-width: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 0 0.8rem;
  color: var(--ink-dim);
}
.attach-audio-ic { width: 20px; height: 20px; opacity: 0.85; }
.attach-audio-ic svg { width: 100%; height: 100%; fill: currentColor; }
.attach-audio-lbl { font-size: 0.66rem; letter-spacing: 0.02em; }
.attach-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.1rem; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.attach-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.attach-remove:hover { background: rgba(0, 0, 0, 0.82); }
.attach-remove:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 1px; }
.attach-count {
  font-size: 0.72rem; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; margin-left: 0.15rem;
}

/* ---------- Voice messages ---------- */
.voice-row { margin-bottom: 0.8rem; }

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.voice-btn:hover { border-color: #b9bcc0; background: rgba(255, 255, 255, 0.06); }
.voice-btn:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 2px; }
.voice-btn small { font-size: 0.78rem; font-style: italic; opacity: 0.8; }

/* quiet ember of a dot; breathes red while the microphone is live */
.voice-dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(200, 90, 70, 0.55);
  transition: background 0.2s ease;
}

.voice-btn.recording {
  color: var(--ink);
  border-style: solid;
  border-color: rgba(200, 90, 70, 0.65);
  background: rgba(200, 90, 70, 0.08);
}

.voice-btn.recording .voice-dot {
  background: #c85a46;
  animation: rec-pulse 1.6s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 90, 70, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(200, 90, 70, 0); }
}

/* ---------- Voice-message player (custom — consistent on every device) ---------- */
/* Replaces native <audio controls>: a play/pause button, a waveform that fills
   as it plays (and scrubs), and current / total time. Built by makeAudioPlayer. */
.vmsg { display: flex; align-items: center; gap: 0.7rem; width: 100%; max-width: 460px; margin-inline: auto; min-width: 0; }
.vmsg > audio { display: none; }
.vplay {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; position: relative;
  background: transparent; border: 1.5px solid rgba(240, 200, 120, 0.55);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.vplay:hover { background: rgba(240, 200, 120, 0.12); border-color: rgba(240, 200, 120, 0.85); }
.vplay:active { transform: scale(0.94); }
.vplay:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 2px; }
.vplay svg { position: absolute; width: 15px; height: 15px; fill: #e6b35a; transition: opacity 0.15s ease; }
.vplay .i-play { margin-left: 2px; }                 /* optical centering of the triangle */
.vmsg:not(.playing) .i-pause { opacity: 0; }
.vmsg.playing .i-play { opacity: 0; }
.vscrub { position: relative; flex: 1; min-width: 0; height: 34px; cursor: pointer; touch-action: none; }
.vwave { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.vwave span { flex: 1; border-radius: 2px; }
.vwave.base span { background: rgba(231, 226, 214, 0.20); }
.vwave.hot span { background: #e6b35a; }
.vfillwrap { position: absolute; inset: 0; clip-path: inset(0 100% 0 0); }
.vtime {
  flex: none; font-size: 0.78rem; font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em; min-width: 5.8em; text-align: right; white-space: nowrap; color: #9a978c;
}
/* on the light letter (the candle viewer) */
.vmsg.on-paper .vplay { border-color: rgba(150, 120, 40, 0.6); }
.vmsg.on-paper .vplay:hover { background: rgba(150, 120, 40, 0.12); }
.vmsg.on-paper .vplay svg { fill: #8a6a1e; }
.vmsg.on-paper .vwave.base span { background: rgba(60, 55, 45, 0.18); }
.vmsg.on-paper .vwave.hot span { background: #b98d3e; }
.vmsg.on-paper .vtime { color: #7c7260; }

.voice-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.6rem;
}

.voice-preview[hidden] { display: none; }

.voice-preview #voice-player { flex: 1; min-width: 0; }

.voice-remove {
  flex-shrink: 0;
  width: 1.8rem; height: 1.8rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  font-size: 1rem; line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.voice-remove:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- Album ---------- */
/* Not a titled card — the album IS the book, floating on the night. The
   shell (opaque overlay, chromeless modal, pinned close, vigil de-rendered)
   is the shared .night/.bare one in modals.css; only the width is its own. */
.modal.album { width: min(920px, 96vw); }

