/* ============================================
   CHAT VOICE (SIM-43): request button + player bubbles
   ============================================ */

/* "Voice message" request toggle in the chat action row */
.chat-action-btn.voice-request-btn[hidden] { display: none !important; }

.chat-action-btn.voice-request-btn {
    border-color: rgba(64, 196, 255, 0.3);
    background: rgba(64, 196, 255, 0.08);
}

.chat-action-btn.voice-request-btn:hover {
    background: rgba(64, 196, 255, 0.18);
    border-color: rgba(64, 196, 255, 0.55);
    transform: scale(1.05);
}

.chat-action-btn.voice-request-btn.is-armed {
    background: rgba(64, 196, 255, 0.28);
    border-color: rgba(64, 196, 255, 0.9);
    box-shadow: 0 0 14px rgba(64, 196, 255, 0.35);
}

/* Player bubble (messenger style, 11 Oct 2026):
   [round play/pause] [waveform, tap/drag to seek]
   [mm:ss] [AI glyph] [Text chip]                 [time]
   Width grows with the duration (--cv-w: 200..280px, set inline).
   Padding/radius inside the qm chat: qm/qm-chat.css "C: voice bubble". */
.cv-bubble {
    --cv-accent: var(--qm-pink, #E91E63);
    --cv-bar-rest: rgba(255, 255, 255, 0.28);
    --cv-bar-played: var(--cv-accent);
    --cv-meta: var(--qm-fg2, rgba(255, 255, 255, 0.66));
    box-sizing: border-box;
    width: var(--cv-w, 220px);
    max-width: 78vw;
    min-width: 0;
}

.message.sent .cv-bubble {
    --cv-bar-rest: rgba(255, 255, 255, 0.42);
    --cv-bar-played: #fff;
    --cv-meta: rgba(255, 255, 255, 0.8);
}

.cv-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
}

.cv-play {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cv-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.message.sent .cv-play {
    background: #fff;
    color: var(--cv-accent);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.cv-play:active { transform: scale(0.94); }
.cv-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Optical centring of the play triangle */
.cv-play .cv-icon-play { margin-left: 2px; }
.cv-play .cv-icon-pause { display: none; }
.cv-bubble.is-playing .cv-play .cv-icon-play { display: none; }
.cv-bubble.is-playing .cv-play .cv-icon-pause { display: block; }

.cv-wave {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
}

.cv-wave:focus { outline: none; }
.cv-wave:focus-visible { outline: 2px solid var(--cv-bar-played); outline-offset: 3px; }

.cv-bar {
    flex: 0 1 3px;
    min-width: 1.5px;
    min-height: 4px;
    border-radius: 2px;
    background: var(--cv-bar-rest);
    pointer-events: none;
    transition: background-color 0.15s linear;
}

.cv-bar.is-played { background: var(--cv-bar-played); }

.cv-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding-left: 50px;   /* aligned with the waveform */
    min-height: 18px;
    font-size: 11px;
    line-height: 1;
    color: var(--cv-meta);
}

.cv-time {
    font-variant-numeric: tabular-nums;
    min-width: 28px;
}

.cv-time:empty { min-width: 0; }

.cv-ai-glyph {
    display: inline-flex;
    align-items: center;
    color: var(--cv-accent);
    opacity: 0.9;
}

.message.sent .cv-ai-glyph { color: #fff; }

.cv-chip {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font: 600 11px/1 var(--qm-sans, inherit);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.message.sent .cv-chip { background: rgba(255, 255, 255, 0.22); }
.cv-chip.is-open { background: rgba(255, 255, 255, 0.2); }
.cv-chip:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.cv-meta .message-time {
    display: inline;
    margin-left: auto;
    white-space: nowrap;
}

.cv-transcript {
    margin: 8px 2px 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cv-transcript[hidden] { display: none !important; }

.cv-audio { display: none; }

@media (prefers-reduced-motion: reduce) {
    .cv-play, .cv-bar { transition: none; }
    .cv-play:active { transform: none; }
}

/* Honest notices (fallback / transcription) */
.message.system.cv-notice .message-system-bubble {
    max-width: 92%;
    text-align: center;
}
