/* Sending and receiving have their own sections so a paused listener cannot
   mistake that choice for a muted microphone. Theme tokens preserve the room's
   appearance; only actual microphone level drives the speaking marks. */
.fw-voice-desk, .spatial-peer, .w2d-avatar { --fw-accent:var(--fw-acc); --fw-muted:var(--fw-dim); }
.fw-voice-desk { display:grid; gap:18px; padding-block:8px 20px; }
.fw-voice-desk p { margin:0; line-height:1.5; }
.fw-voice-connection { border-inline-start:4px solid var(--fw-line); padding:8px 12px; }
.fw-voice-connection[data-phase=connected] { border-color:var(--fw-accent); }
.fw-voice-instrument { display:grid; gap:10px; padding:18px; border:1px solid var(--fw-line); border-radius:12px; }
.fw-voice-desk h3 { font-size:1.05em; line-height:1.4; margin:0; }
.fw-voice-listening { display:grid; gap:14px; padding-block:4px 18px; border-bottom:1px solid var(--fw-line); }
.fw-voice-instrument { gap:14px; }
.fw-voice-desk .fw-input { width:100%; min-width:0; }
.fw-voice-desk button, .fw-voice-desk summary { min-height:44px; }
.fw-voice-error { border-inline-start:4px solid var(--fw-fg); padding:8px 12px; }
.fw-voice-field output { font-weight:400; color:var(--fw-muted); }
.fw-voice-volume { grid-template-columns:1fr auto; }
.fw-voice-volume input { grid-column:1 / -1; margin-inline:0; box-sizing:border-box; }
.fw-voice-desk > *, .fw-voice-instrument > *, .fw-voice-field { min-width:0; }
.fw-voice-details { line-height:1.5; }
.fw-voice-details summary { cursor:pointer; align-content:center; }
.fw-voice-details[open] > :not(summary) { margin-block-start:12px; }
.fw-voice-desk [hidden] { display:none; }
.fw-voice-desk :focus-visible { outline:2px solid var(--fw-accent); outline-offset:3px; }
.fw-voice-instrument meter { width:100%; height:24px; accent-color:var(--fw-accent); }
.fw-voice-mic-state { font-size:.9em; color:var(--fw-muted); }
.fw-voice-actions { display:flex; flex-wrap:wrap; gap:8px; }
.fw-voice-field { display:grid; gap:10px; font-weight:600; }
.fw-voice-field input { width:100%; accent-color:var(--fw-accent); }
.fw-voice-check { display:flex; align-items:center; gap:10px; line-height:1.4; cursor:pointer; }
.fw-voice-check input { width:20px; height:20px; accent-color:var(--fw-accent); flex:none; }
.spatial-peer::before, .w2d-avatar::before { content:''; position:absolute; left:3px; bottom:-2px; width:40px; height:12px; border:2px solid var(--fw-accent); border-radius:50%; opacity:0; transform:scale(.85); transition:opacity 120ms, transform 120ms; pointer-events:none; }
.spatial-peer[data-speaking=true]::before, .w2d-avatar[data-speaking=true]::before { opacity:.9; transform:scale(calc(1 + var(--voice-level,0) * .6)); box-shadow:0 0 10px color-mix(in srgb,var(--fw-accent) 45%,transparent); }
.spatial-peer::after, .w2d-avatar::after { content:'•••'; position:absolute; right:-12px; top:-8px; padding:1px 5px 3px; border-radius:8px 8px 8px 0; background:var(--fw-accent); color:var(--fw-bg); font:700 12px/1 sans-serif; opacity:0; transition:opacity 120ms; pointer-events:none; }
.spatial-peer[data-speaking=true]::after, .w2d-avatar[data-speaking=true]::after { opacity:1; }
.spatial-peer[data-voice-muted=true]::after, .w2d-avatar[data-voice-muted=true]::after { content:'×'; opacity:.8; background:var(--fw-bg); color:var(--fw-fg); border:1px solid var(--fw-line); }
@media (prefers-reduced-motion:reduce) {
  .spatial-peer::before, .spatial-peer::after, .w2d-avatar::before, .w2d-avatar::after { transition:none; }
  .spatial-peer[data-speaking=true]::before, .w2d-avatar[data-speaking=true]::before { transform:none; }
}

/* The sound check inside the join-with-voice dialog (lib/sound-check.js, lib/voice-join.js). */
.fw-join-voice { max-height:90vh; overflow:auto; }
.fw-sound-check { display:grid; gap:8px; margin:0 0 14px; }
.fw-sound-check > button { justify-self:start; }
.fw-sound-check .fw-sound-stage:not([hidden]) { display:grid; gap:10px; margin-top:10px; }
.fw-sound-check meter { width:100%; height:14px; }
.fw-sound-check p { margin:0; line-height:1.5; }
.fw-sound-verdict { border-inline-start:4px solid var(--fw-line); padding:6px 10px; }
.fw-sound-verdict[data-kind=good] { border-color:var(--fw-ok, #6fd19a); }
.fw-sound-verdict[data-kind=quiet], .fw-sound-verdict[data-kind=listening] { border-color:var(--fw-warn, #f2c46d); }
.fw-sound-verdict[data-kind=silent], .fw-sound-verdict[data-kind=hot] { border-color:var(--fw-alert, #ff9b9b); }
.fw-sound-error { border-inline-start:4px solid var(--fw-alert, #ff9b9b); padding:6px 10px; }
