/* ═══════════════════════════════════════════════════════════════
   SPEECH-TO-TEXT — mic button & live preview styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Mic button ── */
.speech-mic-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border, #2a2a3a);
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    color: var(--text-secondary, #888);
    transition: all 0.15s ease;
}
.speech-mic-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary, #e0e0e0);
    border-color: var(--border-light, #3a3a4a);
}

/* Active (listening) state */
.speech-mic-btn.speech-active {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #ef4444;
}
.speech-mic-btn.speech-active:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Pulsing red dot */
.speech-mic-btn.speech-active::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    animation: speech-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes speech-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

/* ── Mic in FF action bar ── */
.ns-transform-bar .speech-mic-btn {
    height: 28px;
    padding: 2px 8px;
}

/* ── Mic in FSN toolbar ── */
.note-toolbar .speech-mic-btn {
    height: 28px;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* ── Mic in FSN header ── */
.note-header-actions .speech-mic-btn {
    height: 28px;
    padding: 2px 8px;
}

/* ── Live preview bar ── */
.speech-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    margin: 4px 12px;
    font-size: 13px;
    color: var(--text-primary, #e0e0e0);
    min-height: 28px;
    animation: speech-preview-in 0.2s ease;
    overflow: hidden;
}
@keyframes speech-preview-in {
    from { opacity: 0; max-height: 0; padding: 0 12px; margin: 0 12px; }
    to { opacity: 1; max-height: 60px; }
}

.speech-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    animation: speech-dot-pulse 1.2s ease-in-out infinite;
}

.speech-preview-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.speech-preview-text em {
    color: var(--text-secondary, #888);
    font-style: italic;
}

/* ── Light mode ── */
body.light-mode .speech-mic-btn {
    border-color: #ddd;
    color: #666;
}
body.light-mode .speech-mic-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}
body.light-mode .speech-mic-btn.speech-active {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
    color: #ef4444;
}
body.light-mode .speech-preview {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.12);
    color: #333;
}
