/* The microphone in the topbar - the look of this module's own part, so it lives in its own
   package and not in the toolkit. States over classes, colours from the platform tokens. */

.voice-mic
{
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.voice-mic button
{
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0.3rem;
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
}

.voice-mic button:hover { background: rgba(255, 255, 255, 0.12); }

.voice-mic svg
{
    width: 20px;
    height: 20px;
}

/* What is being heard, shown by this module itself - the way where nobody offered an input line
   (2026-08-26). With prompt installed the words stand in its line and this element is not there
   at all.

   It grows to the right up to a limit and cuts what is longer: the topbar has a fixed height, and
   a sentence that wraps would push everything beside it. */
.voice-heard
{
    max-width: min(30rem, 30vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* The probe while it records: it has to be visible that something is happening, and that
   something is arriving (2026-08-26). Three parts - a red dot that beats, the running time, and
   a bar that moves with the voice. */
.voice-taking
{
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.voice-dot
{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--err-fg);
    animation: voice-pulse 1s ease-in-out infinite;
}

.voice-level
{
    flex: 0 0 8rem;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}

.voice-level > span
{
    display: block;
    height: 100%;
    background: var(--accent);
    transition: width 120ms linear;
}

.voice-heard-said { margin-top: var(--s2); }

/* a refusal stands where the answer would have stood - not in a toast that is gone three
   seconds later */
.voice-heard-said.error { color: var(--err-fg); }

/* muted is the quiet default look; blocked cannot be helped by clicking */
.mic-button.muted   { opacity: 0.45; }
.mic-button.blocked { opacity: 0.30; cursor: default; }
.mic-button.other   { opacity: 0.45; }

.mic-button.listening { color: var(--accent); }

/* shut because something is sounding - it looks like muted, and it must not pulse: a symbol that
   goes on glowing "I hear you" while an answer is spoken says the opposite of what is true
   (2026-09-01). */
.mic-button.speaking svg { animation: none; }

/* the pulse says "I hear you right now" - allowed on purpose, it is the signal */
.mic-button.active svg,
.mic-speaker svg
{
    animation: voice-pulse 1s ease-in-out infinite;
}

/* And the faster blinking says "I am setting up - nobody is listening YET". It runs from the
   moment the device is opened until the recognition really reports itself, which after a change
   of the microphone is the interesting second (2026-08-26). Two speeds, two meanings: slow it
   hears you, fast it is not ready. */
.mic-button.starting svg
{
    animation: voice-pulse 400ms ease-in-out infinite;
}

@keyframes voice-pulse
{
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
