.send-btn.voice-enabled {
  position: relative;
  color: #8fd8ff;
}

.send-btn.voice-enabled.is-recording::before {
  width: 12px;
  height: 12px;
  border: none;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 999px;
  background: #ff5f6d;
  transform: none;
  box-shadow: 0 0 0 3px rgba(255,95,109,0.14);
  animation: voiceRecordDotPulse 1s ease-in-out infinite;
}

.send-btn.voice-enabled.is-recording::after {
  display: none;
}

.send-btn.voice-enabled::after {
  content: '🎤';
  position: absolute;
  right: -2px;
  bottom: -1px;
  font-size: 11px;
  line-height: 1;
  background: var(--bg-sidebar);
  border-radius: 999px;
  padding: 1px 2px;
}

@keyframes voiceRecordDotPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(255,95,109,0.24);
  }
  60% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(255,95,109,0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(255,95,109,0);
  }
}

.voice-admin-modal {
  max-width: 560px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.voice-provider-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.voice-form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-admin-actions {
  margin-top: 12px;
}

.voice-selected-model-meta {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-inline-btn {
  background: var(--bg-input);
  color: var(--text-primary);
}

.voice-inline-danger {
  margin: 0;
  padding: 8px 10px;
}

.voice-key-state {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: -4px;
  margin-bottom: 2px;
}

.voice-admin-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.voice-admin-status.success {
  background: rgba(123,200,98,0.14);
  color: var(--success);
}

.voice-admin-status.error {
  background: rgba(225,112,118,0.14);
  color: var(--danger);
}

.voice-admin-status.pending {
  background: rgba(94,181,247,0.14);
  color: var(--accent);
}

.voice-last-test {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-input);
  font-size: 13px;
  line-height: 1.45;
}

.voice-last-test.success {
  border: 1px solid rgba(123,200,98,0.2);
}

.voice-last-test.error {
  border: 1px solid rgba(225,112,118,0.2);
}

.voice-last-test-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.voice-last-test-body {
  margin-top: 8px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.voice-recorder-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
  border-radius: 10px;
  background: rgba(225,112,118,0.12);
  color: var(--text-primary);
}

.voice-recorder-bar.pending {
  background: rgba(94,181,247,0.12);
}

.voice-recorder-bar.error {
  background: rgba(225,112,118,0.18);
}

.voice-recorder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6a6a;
  animation: voicePulse 1s infinite;
}

.voice-recorder-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.voice-recorder-time {
  font-size: 13px;
  color: var(--text-secondary);
}

.voice-note-row.voice-note-full .msg-audio {
  max-width: 340px;
}

.voice-note-title {
  font-weight: 700;
}

.msg-row.own.voice-note-compact .msg-bubble {
  background: #355f8a;
  padding-right: 9px;
  padding-left: 9px;
  padding-bottom: 4px;
}

.msg-row.other.voice-note-compact .msg-bubble {
  background: #223447;
  padding-right: 9px;
  padding-left: 9px;
  padding-bottom: 4px;
}

.voice-note-row.voice-note-compact .msg-audio {
  display: none;
}

.voice-footer-play {
  border: 1px solid rgba(255,255,255,0.14);
  padding: 0.02em 0.42em 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.94);
  font-size: 1.12em;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.05;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  width: auto;
  height: auto;
  min-width: 1.55em;
  min-height: 1.45em;
  margin-right: 0;
  margin-left: -0.06em;
  transform: translateY(0.03em);
  flex: 0 0 auto;
}

.voice-footer-play:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  opacity: 1;
}

.voice-footer-play:focus,
.voice-footer-play:focus-visible,
.voice-footer-play:active {
  outline: none;
  box-shadow: none;
  background: rgba(255,255,255,0.17);
}

.voice-footer-play.is-playing {
  color: #d8eeff;
  border-color: rgba(191,227,255,0.3);
}

.voice-compact-audio {
  display: none;
}

.voice-transcription {
  margin-top: 8px;
}

.voice-note-row.voice-note-compact .voice-transcription {
  margin-top: 4px;
}

.voice-transcription-status {
  font-size: 13px;
  color: var(--accent);
}

.voice-transcription-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 24px;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-transcription-inline.pending {
  color: var(--accent);
}

.voice-transcription-inline.error {
  color: var(--danger);
}

.voice-transcription-inline-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.voice-transcription-block {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.voice-transcription-block.error {
  background: rgba(225,112,118,0.12);
}

.voice-transcription-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.voice-transcription-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.voice-transcription-compact-text {
  padding: 0;
  font: inherit;
  line-height: inherit;
  color: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.voice-note-row.voice-note-compact .msg-footer {
  margin-top: 2px;
  gap: 2px;
  align-items: center;
  overflow: visible;
}

.voice-transcribe-btn {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(94,181,247,0.14);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(94,181,247,0.22);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.voice-transcribe-btn:hover {
  background: rgba(94,181,247,0.2);
  border-color: rgba(94,181,247,0.34);
}

.voice-transcribe-btn:focus,
.voice-transcribe-btn:focus-visible,
.voice-transcribe-btn:active {
  outline: none;
  box-shadow: none;
}

.voice-transcribe-btn.retry {
  margin-top: 8px;
}

.voice-transcribe-btn.compact {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
}

.voice-transcription-inline .voice-transcribe-btn.retry {
  margin-top: 0;
}

@keyframes voicePulse {
  0% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.35; transform: scale(0.9); }
}

@media (max-width: 768px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .voice-admin-modal {
    max-width: 100%;
  }
}
