/* 03 stt-mic-nova3 — 🎤 마이크 버튼 (#composer-tools 안), 녹음 중 상태, 버튼 옆 토스트 */

.stt-wrap {
  position: relative;
  display: flex;
  align-self: stretch;   /* 보내기 버튼과 같은 높이 (composer 줄 전체) */
}
.stt-wrap[hidden] { display: none; }

/* 마이크 버튼: 보내기 버튼과 같은 높이·둥글기, 민트 테두리 */
.stt-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-height: 44px;
  padding: 0;
  font: inherit;
  color: var(--mint);
  background: transparent;
  border: 1px solid var(--mint);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.stt-btn:hover:not(:disabled) { background: var(--mint-soft); }
.stt-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.stt-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.stt-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
}

/* 녹음 중: 빨간 테두리·글자, 오른쪽 위 빨간 점이 숨 쉬듯 깜빡임 */
.stt-btn.recording {
  color: #e5484d;
  border-color: #e5484d;
  background: #fdecec;
  animation: stt-breathe 1.6s ease-in-out infinite;
}
.stt-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5484d;
  opacity: 0;
}
.stt-btn.recording .stt-dot {
  opacity: 1;
  animation: stt-pulse 1.2s ease-out infinite;
}

@keyframes stt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
@keyframes stt-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.25); }
  50%      { box-shadow: 0 0 0 5px rgba(229, 72, 77, 0); }
}

/* 버튼 위에 뜨는 짧은 토스트 (오류·안내). 말풍선 대신 여기에 */
.stt-toast {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  max-width: min(320px, 80vw);
  width: max-content;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  animation: stt-toast-in 0.15s ease-out;
}
.stt-toast[hidden] { display: none; }
.stt-toast.error { color: #8a1c1c; background: #fde8e8; border-color: #f3b4b4; }
.stt-toast.info  { color: var(--gray); }

@keyframes stt-toast-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stt-btn.recording { background: rgba(229, 72, 77, 0.18); }
  :root:not([data-theme="light"]) .stt-toast.error { color: #ffb4b4; background: #4a1f22; border-color: #7a3035; }
}
:root[data-theme="dark"] .stt-btn.recording { background: rgba(229, 72, 77, 0.18); }
:root[data-theme="dark"] .stt-toast.error { color: #ffb4b4; background: #4a1f22; border-color: #7a3035; }

@media (prefers-reduced-motion: reduce) {
  .stt-btn.recording, .stt-btn.recording .stt-dot, .stt-toast { animation: none; }
}
