/* Globe app: Memories. The section on a profile (cards for words, voice and video, the thank-you heart, the share
   button), and the composer sheet: big choices, prompt chips, the recorder (one round record button, a live timer),
   the privacy choices and the posting bar. Tap targets are at least 44px; colours come from tokens.css. */

/* ---------- the section ---------- */
.memories.mem-top { margin-top: 20px; }
:root[data-layout="sheet"][data-detent="half"] .memories.mem-top { margin-top: 12px; }
.mem-cells { padding: 0; }
.mem-actions { margin-top: 10px; }
.mem-share .ph { font-size: 20px; }
.mem-card { position: relative; padding: 14px 16px 10px; }
.mem-card + .mem-card::before, .mem-card + .mem-more-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(0.5); transform-origin: top; }
.mem-card.is-hidden { background: color-mix(in srgb, var(--fill) 60%, transparent); }
.mem-head { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.mem-who { color: inherit; text-decoration: none; }
.mem-who:hover { text-decoration: underline; }
.mem-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--fill-strong); color: var(--label-2); font-size: var(--s-foot); line-height: var(--l-foot); font-weight: 500; vertical-align: middle; }
.mem-more { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--label-2); }
.mem-more .ph { font-size: 22px; }
.mem-more:active { background: var(--fill); }
.mem-quote { margin: 12px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--accent-soft); font-size: var(--s-body); line-height: var(--l-body); white-space: pre-line; overflow-wrap: anywhere; }
.mem-line { margin: 10px 0 0; color: var(--label-2); }
.mem-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.mem-thank { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--label-2); font-size: var(--s-sub); font-weight: 500; transition: background-color 120ms ease, color 120ms ease; }
.mem-thank .ph { font-size: 20px; }
.mem-thank.is-on { color: var(--danger); }
.mem-thank:active { background: var(--fill); }
.mem-thank-n:empty { display: none; }

/* voice */
.mem-voice { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.mem-play { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform 160ms var(--ease); }
.mem-play .ph { font-size: 22px; }
.mem-play:active:not(:disabled) { transform: scale(0.95); }
.mem-play:disabled { background: var(--fill); color: var(--label-3); }
.mem-voice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mem-kind { color: var(--label-2); }
.mem-bar { display: block; height: 4px; border-radius: 2px; overflow: hidden; background: var(--fill-strong); }
.mem-bar span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; }
.mem-len { color: var(--label-2); font-size: var(--s-foot); line-height: var(--l-foot); }
.mem-voice audio { display: none; }

/* video */
.mem-video { margin-top: 12px; border-radius: var(--rad-thumb); overflow: hidden; background: #100f0e; }
.mem-poster { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; }
.mem-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem-poster-blank { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.5); }
.mem-poster-blank .ph { font-size: 40px; }
.mem-play-badge { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #100f0e; box-shadow: var(--shadow-1); }
.mem-play-badge .ph { font-size: 26px; margin-left: 3px; }
.mem-len-badge { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.mem-player { display: block; width: 100%; max-height: 70vh; background: #000; }

/* ---------- the composer ---------- */
.mem-compose { padding-bottom: calc(24px + var(--safe-b)); }
.mem-step-head { padding: 8px var(--gutter) 0; }
.mem-step-head .t-sub { margin-top: 4px; }
.mem-resumed { margin: 8px var(--gutter) 0; }
.mem-choice { min-height: 68px; }
.mem-choice .row-icon { width: 44px; height: 44px; }
.mem-choice .row-icon .ph { font-size: 22px; }
.mem-nav { display: flex; justify-content: space-between; gap: 10px; margin: 28px var(--gutter) 0; }
.mem-nav .btn { min-height: 50px; }
.mem-nav .mem-next { margin-left: auto; }
.mem-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 4px; }
.mem-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--fill); color: var(--label); font-size: var(--s-sub); font-weight: 500; transition: background-color 120ms ease, color 120ms ease; }
.mem-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.sub-title + .mem-chips { margin-top: 2px; }
.mem-text { min-height: 180px; }
.mem-compose .gf-hint { margin: 8px 4px 0; }
.mem-pick { display: grid; gap: 10px; }
.mem-pick .gf-err, .mem-rec .gf-err { margin: 0 4px; }
.mem-vis .row-sub { margin-top: 2px; }
.mem-posting { display: grid; gap: 12px; }

/* the recorder */
.mem-rec { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 16px var(--gutter) 0; }
.mem-stage { width: 100%; max-width: 420px; border-radius: var(--rad-cell); overflow: hidden; background: #100f0e; display: grid; place-items: center; }
.mem-stage.is-video { aspect-ratio: 4 / 3; }
.mem-stage.is-audio { aspect-ratio: 16 / 9; background: var(--cell); }
.mem-live { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.mem-mic { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mem-mic .ph { font-size: 44px; }
.mem-rec.is-recording .mem-mic { animation: mem-pulse 1.4s ease-in-out infinite; }
@keyframes mem-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 18px transparent; } }
.mem-time { margin: 0; font-size: var(--s-t2); line-height: var(--l-t2); font-weight: 600; font-variant-numeric: tabular-nums; }
.mem-state { margin: 0; color: var(--label-2); }
.mem-controls, .mem-review { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mem-btn-row { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.mem-btn-row .btn { min-height: 48px; }
.mem-rec-btn { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--cell); box-shadow: 0 0 0 3px var(--danger) inset; transition: transform 160ms var(--ease); }
.mem-rec-btn:active { transform: scale(0.95); }
.mem-rec-dot { width: 56px; height: 56px; border-radius: 50%; background: var(--danger); transition: border-radius 200ms ease, transform 200ms ease; }
.mem-playback { width: 100%; max-width: 420px; border-radius: var(--rad-thumb); background: #100f0e; }
audio.mem-playback { background: none; }
@media (prefers-reduced-motion: reduce) { .mem-rec.is-recording .mem-mic { animation: none; } }
