/* Shared chat pieces: ticks, voice notes, recorder (inbox + docked chat) */

/* Ticks: ✓ sent · ✓✓ delivered · blue ✓✓ seen */
.msg-tick, .cd-tick { display: inline-flex; font-size: .72rem; line-height: 1; }
.msg-tick.is-read, .cd-tick.is-read { color: #4cc9ff; filter: drop-shadow(0 0 1.5px rgba(0, 30, 70, .7)); }

/* Voice note player */
.vn { display: flex; align-items: center; gap: 9px; min-width: 190px; max-width: 260px; padding: 2px 0 2px; }
.vn-play { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--brand); color: #fff; font-size: .85rem; }
.vn-play .fa-play { margin-left: 2px; }
.is-mine .vn-play { background: #fff; color: var(--brand); }
.vn-bar { position: relative; flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink-400) 35%, transparent); cursor: pointer; }
.vn-bar::before { content: ""; position: absolute; inset: -10px 0; } /* bigger tap target */
.is-mine .vn-bar { background: rgba(255, 255, 255, .35); }
.vn-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--brand); transition: width .2s linear; }
.is-mine .vn-fill { background: #fff; }
.vn-time { min-width: 32px; font-size: .74rem; font-variant-numeric: tabular-nums; opacity: .85; }
.vn.is-playing .vn-play { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.is-mine .vn.is-playing .vn-play { box-shadow: 0 0 0 4px rgba(255, 255, 255, .3); }

/* Mic button: shown instead of Send while the box is empty (WhatsApp style) */
.vn-mic { display: grid; place-items: center; width: var(--vn-btn, 44px); height: var(--vn-btn, 44px); flex-shrink: 0; border-radius: 50%; border: 0;
    background: var(--brand); color: #fff; cursor: pointer; box-shadow: 0 8px 18px -10px var(--brand); transition: transform .15s; }
.vn-mic:active { transform: scale(.92); }
.vn-mic:disabled { opacity: .5; cursor: default; }
.can-record:not(.has-content) .ch-send, .can-record:not(.has-content) .cd-send { display: none; }
.can-record.has-content .vn-mic { display: none; }

/* Recording bar */
.vn-rec { display: flex; align-items: center; gap: 10px; min-height: var(--vn-btn, 44px); }
.vn-rec[hidden], [hidden].ch-row { display: none !important; }
.vn-rec-cancel { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-500); cursor: pointer; }
.vn-rec-cancel:hover { background: var(--danger-50, #fde8e8); color: var(--danger, #c81e1e); }
.vn-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e11d48; animation: vn-blink 1s ease-in-out infinite; }
.vn-rec-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.vn-rec-wave { flex: 1; min-width: 0; height: 30px; color: var(--brand); }
.vn-rec-send { display: grid; place-items: center; width: var(--vn-btn, 44px); height: var(--vn-btn, 44px); border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; }
@keyframes vn-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .vn-rec-dot { animation: none; } }

/* WhatsApp-style recording: the bar replaces the text box inside the composer row */
.is-recording .ch-row > :not(.vn-rec):not(.vn-mic),
.is-recording .cd-row > :not(.vn-rec):not(.vn-mic) { display: none !important; }
.is-recording .vn-rec { flex: 1; min-width: 0; padding: 0 6px; border-radius: 22px; background: var(--surface-2); }
.vn-mic { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.is-holding .vn-mic { transform: scale(1.35); background: #e11d48; box-shadow: 0 0 0 8px rgba(225, 29, 72, .18); transition: none; z-index: 2; }
.is-locked .vn-mic { display: none; }
/* holding: "Slide to cancel" instead of trash/send */
.vn-rec-slide { display: none; align-items: center; gap: 6px; margin-left: auto; font-size: .82rem; font-weight: 600; color: var(--ink-500); white-space: nowrap; animation: vn-slide-hint 1.4s ease-in-out infinite; }
.is-holding .vn-rec-slide { display: inline-flex; }
.is-holding .vn-rec-cancel, .is-holding .vn-rec-send { display: none; }
.is-holding .vn-rec-wave { flex: 0 1 90px; }
@keyframes vn-slide-hint { 50% { transform: translateX(-6px); } }
/* "slide up to lock" pill above the mic */
.vn-lock { position: absolute; left: 50%; bottom: calc(100% + 14px); margin-left: -18px; width: 36px; padding: 8px 0; border-radius: 999px; display: grid; justify-items: center; gap: 6px;
    background: var(--surface); color: var(--ink-500); border: 1px solid var(--line); box-shadow: 0 10px 24px -12px rgba(40, 10, 25, .5); font-size: .8rem; pointer-events: none; }
.vn-lock[hidden] { display: none; }
.vn-lock .fa-chevron-up { animation: vn-lock-hint 1.2s ease-in-out infinite; color: var(--brand); }
@keyframes vn-lock-hint { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .vn-rec-slide, .vn-lock .fa-chevron-up { animation: none; } }
