/* 08 tts-speaker — 챗봇 말풍선 오른쪽 아래 작은 원형 🔊 버튼, 재생 중·받는 중 표시 */

/* 버튼이 들어갈 자리 (말풍선 오른쪽 아래) */
.msg.bot.has-tts {
  position: relative;
  padding-right: 44px;
  padding-bottom: 12px;
}

.tts-btn {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--gray);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s, background 0.15s;
  white-space: normal;
}
.tts-btn:hover,
.tts-btn:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  background: var(--mint-soft);
  color: var(--ink);
  outline: none;
}
.tts-btn:disabled { cursor: progress; }

/* 재생 중: 민트색 + 은은한 맥박 */
.tts-btn.playing {
  opacity: 1;
  background: var(--mint);
  border-color: var(--mint);
  color: #fff;
  animation: tts-pulse 1.2s ease-in-out infinite;
}
@keyframes tts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 196, 138, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(43, 196, 138, 0); }
}

/* 받는 중: 아이콘 대신 도는 테두리(스피너) */
.tts-btn.loading {
  color: transparent;
  border-color: var(--line);
  border-top-color: var(--mint);
  animation: tts-spin 0.8s linear infinite;
}
@keyframes tts-spin {
  to { transform: rotate(360deg); }
}

/* 짧은 안내(토스트) — 버튼 아래 작은 글 */
.tts-toast {
  position: absolute;
  right: 8px;
  bottom: -26px;
  max-width: 260px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2;
}
.tts-toast.show { opacity: 0.95; }

@media (prefers-reduced-motion: reduce) {
  .tts-btn.playing { animation: none; }
  .tts-btn { transition: none; }
}
