/* WhatsApp style voice note bubble */
.zz-voice-note-native {
  display: none !important;
}

.zz-voice-note-card {
  width: min(230px, 64vw);
  min-width: 190px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 18px;
  box-sizing: border-box;
  background: rgba(255,255,255,.14);
}

.zz-voice-note-play {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255,255,255,.24);
  color: currentColor;
  padding: 0;
}

.zz-voice-note-play svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.zz-voice-note-body {
  flex: 1;
  min-width: 0;
}

.zz-voice-note-wave {
  height: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: .88;
}

.zz-voice-note-wave span {
  width: 3px;
  border-radius: 99px;
  background: currentColor;
  opacity: .45;
}

.zz-voice-note-wave span:nth-child(1) { height: 7px; }
.zz-voice-note-wave span:nth-child(2) { height: 13px; }
.zz-voice-note-wave span:nth-child(3) { height: 9px; }
.zz-voice-note-wave span:nth-child(4) { height: 17px; }
.zz-voice-note-wave span:nth-child(5) { height: 10px; }
.zz-voice-note-wave span:nth-child(6) { height: 15px; }
.zz-voice-note-wave span:nth-child(7) { height: 8px; }
.zz-voice-note-wave span:nth-child(8) { height: 18px; }
.zz-voice-note-wave span:nth-child(9) { height: 11px; }
.zz-voice-note-wave span:nth-child(10) { height: 14px; }
.zz-voice-note-wave span:nth-child(11) { height: 7px; }
.zz-voice-note-wave span:nth-child(12) { height: 16px; }

.zz-voice-note-card.is-playing .zz-voice-note-wave span {
  opacity: .8;
  animation: zzVoiceWave 1s ease-in-out infinite;
}

.zz-voice-note-card.is-playing .zz-voice-note-wave span:nth-child(2n) {
  animation-delay: .15s;
}

.zz-voice-note-card.is-playing .zz-voice-note-wave span:nth-child(3n) {
  animation-delay: .3s;
}

@keyframes zzVoiceWave {
  0%, 100% { transform: scaleY(.65); }
  50% { transform: scaleY(1.15); }
}

.zz-voice-note-time {
  font-size: 11px;
  line-height: 1;
  opacity: .72;
  margin-top: 2px;
}

@media (max-width: 380px) {
  .zz-voice-note-card {
    width: min(210px, 62vw);
    min-width: 170px;
    height: 46px;
    gap: 7px;
    padding: 7px 9px;
  }

  .zz-voice-note-play {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
}

/* ===== Voice note middle alignment fix ===== */
.zz-voice-note-bubble {
  display: flex !important;
  align-items: center !important;
  min-height: 78px !important;
}

.zz-voice-note-card {
  margin: auto 0 !important;
  height: 56px !important;
  min-height: 56px !important;
  align-self: center !important;
  display: flex !important;
  align-items: center !important;
}

.zz-voice-note-body {
  height: 42px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.zz-voice-note-wave {
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
}

.zz-voice-note-time {
  margin-top: 1px !important;
  line-height: 13px !important;
}

.zz-voice-note-play {
  align-self: center !important;
}

/* ===== Compact voice note, no extra inner card box ===== */
.zz-voice-note-bubble {
  min-height: 58px !important;
  display: flex !important;
  align-items: center !important;
}

.zz-voice-note-card {
  width: clamp(165px, 44vw, 220px) !important;
  min-width: 0 !important;
  max-width: 100% !important;

  height: 34px !important;
  min-height: 34px !important;

  padding: 0 !important;
  margin: 0 !important;
  gap: 9px !important;

  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;

  display: flex !important;
  align-items: center !important;
}

.zz-voice-note-play {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;

  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.zz-voice-note-play svg {
  width: 20px !important;
  height: 20px !important;
}

.zz-voice-note-body {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 34px !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.zz-voice-note-wave {
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.zz-voice-note-wave span {
  width: 4px !important;
  border-radius: 99px !important;
  opacity: .42 !important;
}

.zz-voice-note-time {
  font-size: 11px !important;
  line-height: 12px !important;
  margin-top: 0 !important;
  opacity: .72 !important;
}

@media (max-width: 380px) {
  .zz-voice-note-card {
    width: clamp(150px, 42vw, 195px) !important;
    height: 32px !important;
    gap: 7px !important;
  }

  .zz-voice-note-play {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }

  .zz-voice-note-wave {
    gap: 2px !important;
  }

  .zz-voice-note-wave span {
    width: 3px !important;
  }
}

/* ===== Voice seek/scrub support ===== */
.zz-voice-note-wave {
  cursor: pointer !important;
  touch-action: none !important;
  user-select: none !important;
}

.zz-voice-note-wave span {
  transition: opacity .15s ease, transform .15s ease !important;
}

.zz-voice-note-wave span.is-passed {
  opacity: .95 !important;
}

.zz-voice-note-wave:active span {
  transform: scaleY(1.08);
}

/* ===== Voice vs music UI distinction ===== */
.zz-audio-card {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.zz-audio-card.is-voice {
  width: clamp(165px, 44vw, 220px) !important;
}

.zz-audio-card.is-music {
  width: clamp(190px, 52vw, 260px) !important;
  gap: 10px !important;
}

.zz-audio-solid {
  position: relative !important;
  width: 100% !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: rgba(17, 24, 39, .22) !important;
  overflow: hidden !important;
  cursor: pointer !important;
  touch-action: none !important;
}

.zz-audio-solid i {
  display: block !important;
  width: calc(var(--zz-audio-progress, 0) * 100%) !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: currentColor !important;
  opacity: .65 !important;
}

.zz-audio-music-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  background: rgba(17, 24, 39, .12) !important;
  opacity: .75 !important;
}

.zz-audio-card.is-music .zz-audio-body {
  height: 32px !important;
}

.zz-audio-card.is-music .zz-audio-time {
  margin-top: 6px !important;
}

.zz-audio-card.is-voice .zz-audio-music-icon {
  display: none !important;
}

@media (max-width: 380px) {
  .zz-audio-card.is-music {
    width: clamp(170px, 50vw, 225px) !important;
    gap: 8px !important;
  }

  .zz-audio-music-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    font-size: 19px !important;
  }
}
