/* Shared voice-player and recording styles. */
.voice-recording-bar {
  background: var(--bs-body-bg, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(220, 38, 38, 0.3);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08);
}
.voice-rec-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.voice-rec-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: pmVoicePulse 1.2s infinite ease-in-out;
}
.voice-rec-timer {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: #dc2626;
  letter-spacing: 0.5px;
  user-select: none;
  flex-shrink: 0;
}
.voice-rec-waves {
  height: 20px;
  flex-shrink: 0;
}
.vwave-bar {
  width: 3px;
  height: 4px;
  background-color: #ef4444;
  border-radius: 3px;
  display: inline-block;
  animation: pmWaveBounce 1.2s infinite ease-in-out;
}
.tg-voice-player {
  gap: 10px;
  padding: 8px 12px;
  min-width: 230px;
  border-radius: 18px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.tg-voice-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #3390ec;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(51, 144, 236, 0.35);
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.tg-voice-play-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.05);
}
.tg-voice-body {
  flex-grow: 1;
  min-width: 0;
  gap: 4px;
}
.tg-voice-waveform {
  gap: 2px;
  height: 24px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.tg-vbar {
  flex: 1 1 0;
  min-width: 2px;
  max-width: 3.5px;
  border-radius: 2px;
  background-color: #cbd5e1;
  transition: background-color 0.04s linear;
  pointer-events: none;
}
.tg-voice-meta {
  font-size: 11px;
  line-height: 1;
  color: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.tg-voice-speed-btn {
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tg-voice-speed-btn:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}
.tg-voice-speed-btn.is-fast {
  background: #0d6efd;
  color: #ffffff;
  border-color: #0d6efd;
  font-weight: 800;
}
[data-bs-theme="dark"] .voice-recording-bar,
body[data-bs-theme="dark"] .voice-recording-bar {
  background: #1e293b;
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-bs-theme="dark"] .tg-voice-player,
body[data-bs-theme="dark"] .tg-voice-player {
  background: #1e293b;
  border-color: #334155;
}
[data-bs-theme="dark"] .tg-voice-speed-btn,
body[data-bs-theme="dark"] .tg-voice-speed-btn {
  border-color: #475569;
  color: #94a3b8;
}
@keyframes pmVoicePulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }

  70% {
    transform: scale(1.18);
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(0.9);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
@keyframes pmWaveBounce {
  0%,
  100% {
    height: 4px;
  }

  50% {
    height: 18px;
  }
}
.vwave-bar:nth-child(1) {
  animation-delay: 0s;
}
.vwave-bar:nth-child(2) {
  animation-delay: 0.15s;
}
.vwave-bar:nth-child(3) {
  animation-delay: 0.3s;
}
.vwave-bar:nth-child(4) {
  animation-delay: 0.45s;
}
.vwave-bar:nth-child(5) {
  animation-delay: 0.6s;
}
.vwave-bar:nth-child(6) {
  animation-delay: 0.75s;
}
.vwave-bar:nth-child(7) {
  animation-delay: 0.9s;
}
.vwave-bar:nth-child(8) {
  animation-delay: 1.05s;
}
.tg-voice-play-btn:active {
  transform: scale(0.96);
}
.tg-vbar.active {
  background-color: #3390ec !important;
}
/* Keep the outgoing PM variant before the dark active-bar color. */
:where(.pm-page) .align-self-end .tg-vbar.active {
  background-color: #0d6efd !important;
}
.tg-voice-time {
  letter-spacing: 0.2px;
}
[data-bs-theme="dark"] .tg-vbar,
body[data-bs-theme="dark"] .tg-vbar {
  background-color: #475569;
}
[data-bs-theme="dark"] .tg-vbar.active,
body[data-bs-theme="dark"] .tg-vbar.active {
  background-color: #38bdf8 !important;
}
[data-bs-theme="dark"] .tg-voice-meta,
body[data-bs-theme="dark"] .tg-voice-meta {
  color: #94a3b8;
}
