/* Forge | voice.css — recorder bar + voice note player */

/* ---------- Composer mic button ---------- */
.composer-row .mic {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease-in), color var(--t-fast) var(--ease-in),
              transform var(--t-fast) var(--ease-in);
}
.composer-row .mic svg { width: 20px; height: 20px; }
.composer-row .mic:active { transform: scale(0.94); }
.composer-row .mic.armed { background: var(--primary); color: #fff; }

/* ---------- Recording bar (replaces composer row while recording) ---------- */
.rec-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  animation: rec-in 220ms var(--ease-in);
}
@keyframes rec-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rec-bar .rec-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease-in), color var(--t-fast) var(--ease-in);
}
.rec-bar .rec-btn svg { width: 18px; height: 18px; }
.rec-bar .rec-btn.cancel { background: rgba(239,68,68,0.14); color: var(--error); }
.rec-bar .rec-btn.send   { background: var(--primary); color: #fff;
  box-shadow: 0 6px 16px rgba(79,126,255,0.35); }
.rec-bar .rec-btn.lock   { background: var(--surface-2); color: var(--text); }
.rec-bar .rec-btn:active { transform: scale(0.94); }

.rec-bar .rec-center {
  flex: 1; display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.rec-bar .rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--error);
  box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
  animation: rec-pulse 1.2s infinite;
  flex-shrink: 0;
}
@keyframes rec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.rec-bar .rec-timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600;
  color: var(--text-strong);
  min-width: 52px;
}
.rec-bar .rec-wave {
  flex: 1; display: flex; align-items: center; gap: 2px;
  height: 30px; overflow: hidden;
}
.rec-bar .rec-wave span {
  display: block; width: 3px;
  background: var(--primary);
  border-radius: 2px;
  min-height: 3px;
  transition: height 60ms linear;
}

.rec-hint {
  position: absolute; left: 50%; top: -34px;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(239,68,68,0.92);
  color: #fff;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 160ms var(--ease-in);
}
.rec-hint.show { opacity: 1; }

/* ---------- Voice player inside a bubble ---------- */
.voice-player {
  display: flex; align-items: center; gap: 10px;
  min-width: 200px; max-width: 260px;
}
.voice-player .play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.22);
  color: #fff;
  transition: background var(--t-fast) var(--ease-in);
}
.msg:not(.mine) .voice-player .play-btn {
  background: var(--primary); color: #fff;
}
.voice-player .play-btn:active { transform: scale(0.94); }
.voice-player .play-btn svg { width: 18px; height: 18px; }

.voice-player .vp-main {
  flex: 1; min-width: 0;
}
.voice-player .vp-bars {
  display: flex; align-items: center; gap: 2px;
  height: 26px;
  cursor: pointer;
  user-select: none;
}
.voice-player .vp-bars span {
  display: block; width: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.35);
  min-height: 3px;
  transition: background 80ms linear;
}
.msg:not(.mine) .voice-player .vp-bars span {
  background: var(--border);
}
.voice-player .vp-bars span.played {
  background: currentColor;
}
.msg:not(.mine) .voice-player .vp-bars span.played {
  background: var(--primary);
}
.voice-player .vp-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 11px; opacity: 0.9;
}
.voice-player .vp-time { font-variant-numeric: tabular-nums; }
.voice-player .vp-speed {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.03em;
}
.msg:not(.mine) .voice-player .vp-speed {
  background: var(--primary-soft);
  color: var(--primary);
}
.voice-player .vp-speed:active { transform: scale(0.94); }
