/* Compact floating voice control. Does not cover the consultation form. */

.voice-first {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2.5rem));
  font: 13px/1.4 system-ui, sans-serif;
}

body:not(.auth-pending):not(.guest) .voice-first {
  display: flex;
}

.voice-first-mic {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: 1px solid #234;
  background: #0f3d38;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 61, 56, 0.28);
}

.voice-first-mic:focus-visible {
  outline: 3px solid #c9a227;
  outline-offset: 2px;
}

.voice-first[data-state="listening"] .voice-first-mic {
  background: #b42318;
  border-color: #7a140e;
}

.voice-first[data-state="transcribing"] .voice-first-mic,
.voice-first[data-state="interpreting"] .voice-first-mic,
.voice-first[data-state="saving"] .voice-first-mic {
  background: #8a5a00;
}

.voice-first[data-state="error"] .voice-first-mic {
  background: #7a140e;
}

.voice-first[data-state="completed"] .voice-first-mic {
  background: #17664a;
}

.voice-first-panel {
  width: 100%;
  background: #fff;
  border: 1px solid #c5d0cc;
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 10px 28px rgba(20, 40, 36, 0.16);
}

.voice-first-state,
.voice-first-status,
.voice-first-duration {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.voice-first-timeline-wrap {
  margin: 0 0 0.5rem;
  color: #243;
}

.voice-first-timeline {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  max-height: 7rem;
  overflow: auto;
}

.voice-first-transcript,
.voice-first-note {
  margin: 0 0 0.5rem;
  color: #243;
}

.voice-first-changes {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
}

.voice-first-changes li {
  margin: 0 0 0.4rem;
  padding: 0.35rem 0.4rem;
  background: #f4f8f6;
  border-left: 3px solid #0f3d38;
}

.voice-first-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.voice-first-actions button {
  border: 1px solid #9aaba6;
  background: #fff;
  border-radius: 0.4rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.voice-first-actions .is-primary {
  background: #0f3d38;
  color: #fff;
  border-color: #0f3d38;
}

.consult-root [data-voice].voice-proposed,
.cl-consult [data-voice].voice-proposed {
  outline: 2px dashed #c9a227;
  background: #fff8e1;
}

@media (prefers-reduced-motion: reduce) {
  .voice-first-mic {
    box-shadow: none;
  }
}
