/* The chat's voice part (round 3, package C5: docs/CHAT_ROUND3_SPEC.md 5.9): the microphone and
   the row that stands in for the box while it listens or writes. Only the app's own tokens; no new
   colour and no new font. */

/* the microphone: a whole 44 by 44 target; a press never selects text, opens a callout or scrolls
   the page under the finger (the slide to cancel needs the finger's moves) */
#desk .desk-box .desk-mic { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#desk .desk-box .desk-mic:hover { color: var(--ink, inherit); }
#desk .desk-box .desk-mic.dv-live { color: var(--primary-ink, #fff); background: var(--bad, #d33); }
#desk .desk-box .desk-mic:disabled { opacity: .55; }
/* 5.4: the microphone only on an empty box with nothing attached (C3 holds the same rule) */
#desk .desk-box:not(.empty):not(.dv-on) .desk-mic { display: none; }

/* while it listens or writes, the row stands where the box was: the box, the + and the bolt step
   aside and his words in the box are kept as they were */
#desk .desk-box.dv-on > textarea, #desk .desk-box.dv-on > .desk-clip-btn, #desk .desk-box.dv-on > .desk-quick { display: none; }
#desk .desk-box.dv-on .desk-mic { display: grid; }
#desk .desk-box.dv-on .desk-mic[hidden] { display: none; }
#desk .desk-box.dv-on .desk-send { display: none; }

.dv-row { flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 0 0 12px; }
.dv-row[hidden] { display: none; }
.dv-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bad, #d33); }
.dv-row[data-state="writing"] .dv-dot, .dv-row[data-state="asking"] .dv-dot { background: var(--muted, #888); }
.dv-words { flex: none; font-size: 15px; line-height: 1.45; white-space: nowrap; color: var(--ink, inherit);
  font-variant-numeric: tabular-nums; }
/* the level, from the microphone's own sound; while it writes the same track carries a moving bar */
.dv-level { flex: 1 1 40px; min-width: 24px; height: 4px; border-radius: 2px; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--muted, #888) 25%, transparent); }
.dv-level i { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0);
  background: var(--primary, var(--accent, #3167ed)); transition: transform 80ms linear; }
.dv-row[data-state="writing"] .dv-level i { width: 35%; transform: none; transition: none; animation: dv-write 1.1s ease-in-out infinite; }
@keyframes dv-write { from { left: -35%; } to { left: 100%; } }
#desk .desk-box .dv-cancel { flex: none; min-width: 44px; min-height: 44px; height: 44px; padding: 0 12px; font-size: 14px;
  white-space: nowrap; color: var(--ink, inherit); border-radius: 12px;
  /* a button always reads as a button (D567): an edge and a quiet fill, never bare words */
  border: 1px solid var(--line, color-mix(in srgb, var(--muted, #888) 45%, transparent));
  background: color-mix(in srgb, var(--muted, #888) 12%, transparent); }
#desk .desk-box .dv-cancel[hidden] { display: none; }
@media (max-width: 359px) {
  .dv-row { gap: 6px; padding-left: 8px; }
  .dv-words { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .dv-level i { transition: none; }
  .dv-row[data-state="writing"] .dv-level i { animation: none; left: 0; width: 100%; opacity: .5; }
}
