/**
 * Voice / video-note / image bubbles — shared by profile chat and /messages.html
 */
.tg-app .msg-bubble:has(.msg-video-note-wrap),
.tg-app .msg-bubble:has(.msg-image-wrap) {
  padding: 4px 6px 4px 4px;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}

.tg-app .msg-row.me .msg-bubble:has(.msg-video-note-wrap),
.tg-app .msg-row.me .msg-bubble:has(.msg-image-wrap) {
  background: transparent;
  border: none;
}

.tg-app .msg-bubble:has(.msg-voice-player) {
  min-width: min(240px, 78vw);
  padding: 8px 10px 6px;
}

.msg-image-wrap {
  margin: -2px 0 2px;
}

.msg-image {
  display: block;
  max-width: min(280px, 100%);
  max-height: 320px;
  border-radius: 12px;
  object-fit: contain;
  cursor: pointer;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(2, 6, 23, 0.45);
}

.msg-image--error {
  min-height: 48px;
  min-width: 120px;
  opacity: 0.7;
}

.msg-caption {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--tg-text, #eef2ef);
  word-wrap: break-word;
}

.msg-forward-label {
  font-size: 0.72rem;
  line-height: 1.3;
  color: #86efac;
  opacity: 0.92;
  margin-bottom: 5px;
  padding-left: 1px;
}

.msg-forward-label::before {
  content: "↪ ";
  opacity: 0.85;
}

.msg-text-body {
  word-wrap: break-word;
}

/* ── Voice ── */
.msg-voice-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  width: 100%;
}

.msg-voice-play,
.chat-cyber-audio-play {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.55);
  background: linear-gradient(155deg, rgba(6, 78, 59, 0.45) 0%, rgba(2, 6, 23, 0.92) 100%);
  color: #86efac;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.18), inset 0 1px 0 rgba(167, 243, 208, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.msg-voice-play:hover,
.chat-cyber-audio-play:hover {
  border-color: rgba(34, 197, 94, 0.8);
  color: #ecfccb;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.28);
}

.msg-voice-play--playing,
.chat-cyber-audio-play--playing {
  background: linear-gradient(155deg, rgba(22, 101, 52, 0.55) 0%, rgba(2, 6, 23, 0.95) 100%);
  border-color: rgba(110, 231, 183, 0.9);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.38), inset 0 1px 0 rgba(167, 243, 208, 0.22);
}

.chat-audio-play-ico {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #86efac;
  margin-left: 2px;
  display: block;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
  flex-shrink: 0;
}

.msg-voice-play--playing .chat-audio-play-ico,
.chat-cyber-audio-play--playing .chat-audio-play-ico {
  width: 11px;
  height: 13px;
  margin-left: 0;
  border: none;
  background: linear-gradient(90deg, #86efac 0 42%, transparent 42% 58%, #86efac 58% 100%);
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
}

.msg-voice-bar {
  flex: 1;
  min-width: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.msg-voice-bar-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.1s linear;
}

.msg-voice-dur,
.msg-video-note-dur {
  font-size: 0.72rem;
  color: var(--tg-text-muted, #7a8f82);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chat-cyber-audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: linear-gradient(155deg, rgba(6, 78, 59, 0.22) 0%, rgba(2, 6, 23, 0.96) 55%, rgba(15, 23, 42, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(110, 231, 183, 0.08);
}

.chat-cyber-audio-track {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-cyber-audio-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  overflow: hidden;
  cursor: pointer;
}

.chat-cyber-audio-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.08s linear;
}

.chat-cyber-audio-time {
  font-size: 0.72rem;
  color: var(--tg-text-muted, #7a8f82);
  font-variant-numeric: tabular-nums;
}

/* ── Video note (circle) ── */
.msg-video-note-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.msg-video-note-ring {
  position: relative;
  width: 152px;
  height: 152px;
  max-width: min(152px, 72vw);
  max-height: min(152px, 72vw);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(34, 197, 94, 0.55);
  background: #000;
  flex-shrink: 0;
  cursor: pointer;
  transition: width 0.28s ease, height 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.msg-video-note-ring--playing {
  width: 190px;
  height: 190px;
  max-width: min(190px, 84vw);
  max-height: min(190px, 84vw);
  border-color: rgba(110, 231, 183, 0.75);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.28);
}

.msg-video-note {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.msg-video-note-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.7);
  background: linear-gradient(155deg, rgba(6, 78, 59, 0.55) 0%, rgba(2, 6, 23, 0.92) 100%);
  color: #ecfccb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(167, 243, 208, 0.2);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.28s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.msg-video-note-play:hover {
  border-color: rgba(167, 243, 208, 0.85);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.4);
}

.msg-video-note-play--faded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.msg-video-note-play-ico {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #86efac;
  margin-left: 3px;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
}

.msg-video-note-play--pause .msg-video-note-play-ico {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: none;
  background: linear-gradient(90deg, #86efac 0 42%, transparent 42% 58%, #86efac 58% 100%);
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
}

.msg-video-note-ring .msg-video-note-dur {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #d1fae5;
}

@media (max-width: 520px) {
  .msg-video-note-ring {
    width: 140px;
    height: 140px;
    max-width: min(140px, 68vw);
    max-height: min(140px, 68vw);
  }

  .msg-video-note-ring--playing {
    width: 172px;
    height: 172px;
    max-width: min(172px, 78vw);
    max-height: min(172px, 78vw);
  }
}
