/* Voice input in the AI chat boxes — js/shared/components/voice-input.js.
   Idle: a mic right before Send. Recording: a live sound wave, ✕ and ✓, in
   place of the mic and Send. */
.voice-input {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.voice-input-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s ease, color 0.15s ease;
}
.voice-input-btn:hover:not(:disabled) {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}
.voice-input-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.voice-input-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.voice-input[data-state="idle"] .voice-input-bar,
.voice-input:not([data-state="idle"]) .voice-input-btn { display: none; }

/* Bars grow from the middle; a quiet moment is a 3 px dot. */
.voice-input-wave {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    margin-right: 4px;
}
.voice-input-wave > span {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: var(--color-text-secondary);
    transition: height 0.08s linear;
}
.voice-input[data-state="transcribing"] .voice-input-wave > span { opacity: 0.4; }

.voice-input-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--color-bg-hover);
    border: none;
    border-radius: 8px;
    color: var(--color-text-primary);
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease;
}
.voice-input-action:hover:not(:disabled) { background: var(--color-border); }
.voice-input-action:disabled { cursor: progress; }
.voice-input-action[data-action="discard"]:disabled { opacity: 0.4; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
    .voice-input-wave > span { transition: none; }
}

/* ✓ stands where Send was until the dictation is done. */
.voice-input-covered { display: none !important; }

/* attachBefore's own span, beside a chat box's Send button. */
.voice-input-mount:empty { display: none; }
