/* =========================================================================
 * BAZA-S241 — MESSAGES VOCAUX sur la lignée LIVE (portage du bloc S164 de la
 * lignée main, ordre Philippe 2026-07-30 : « le micro à droite de la saisie —
 * on n'a pas fait le transfert de messages audio »).
 *
 * Fichier PUBLIC séparé, chargé par <link> dans index.html : Vite ne le
 * fusionne PAS dans `index-*.css` ⇒ le hash CSS GELÉ S141 reste byte-identique
 * (aucun re-pin des gates s141/s145/s147/s149/s155). Les classes gardent le
 * préfixe historique `.s164-voice*` (composants portés tels quels).
 * Catégories « composant additif » seulement — AUCUNE hauteur de coque, AUCUNE
 * unité de viewport, AUCUNE safe-area (coque gelée S141 / S173G intactes).
 * Règles EXTRAITES à l'identique de la section S164 de main (accolade du
 * media query FERMÉE — correctif de lignée S169 déjà appliqué).
 * ========================================================================= */
.s164-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  max-width: 240px;
  padding: 2px 0;
}
.s164-voice-play {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background-color: #2f9e79;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.s164-voice-play:disabled {
  opacity: 0.55;
  cursor: default;
}
.s164-voice-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.s164-voice-progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #2f9e79 calc(var(--s164-voice-fraction, 0) * 100%),
    rgba(0, 0, 0, 0.14) calc(var(--s164-voice-fraction, 0) * 100%)
  );
  cursor: pointer;
}
.s164-voice-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #2f9e79;
  border: none;
}
.s164-voice-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #2f9e79;
  border: none;
}
.s164-voice-time {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
.s164-voice-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  animation: s164-voice-spin 0.8s linear infinite;
}
@keyframes s164-voice-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Composer vocal (enregistrement / préécoute), remplace la ligne de saisie */
.s164-voice-composer {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 4px;
}
.s164-voicerec,
.s164-voiceprev {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.s164-voicerec-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #e5484d;
  animation: s164-voice-pulse 1.2s ease-in-out infinite;
}
@keyframes s164-voice-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.s164-voicerec-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #e5484d;
}
.s164-voicerec-hint {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.85rem;
}
.s164-voicerec-actions,
.s164-voiceprev-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.s164-voiceprev-time {
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
}
.s164-voiceprev-progress {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.s164-voiceprev-progress-bar {
  display: block;
  height: 100%;
  background-color: #2f9e79;
  transition: width 0.15s linear;
}
.s164-voice-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}
.s164-voice-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.s164-voice-cancel {
  background-color: transparent;
  color: rgba(0, 0, 0, 0.6);
}
.s164-voice-stop,
.s164-voice-send {
  background-color: #2f9e79;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .s164-voice-spin,
  .s164-voicerec-dot,
  .s164-voiceprev-progress-bar {
    animation: none;
    transition: none;
  }
}

/* -------------------------------------------------------------------------
 * BAZA-S242 — VUMÈTRE d'enregistrement (recette Philippe 2026-07-30 : « il
 * manque des LED ou crêtes pour la modulation pendant l'enregistrement »).
 * Segments type LED pilotés par le NIVEAU RÉEL du micro (AnalyserNode sur le
 * flux MediaRecorder — jamais une animation décorative) + CRÊTE tenue à
 * décroissance lente. Repli honnête : sans Web Audio, la mention texte
 * « Enregistrement… » reste affichée (aucun vumètre factice).
 * ------------------------------------------------------------------------- */
.s164-voicemeter {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
}
.s164-voicemeter-seg {
  flex: 1 1 0;
  min-width: 2px;
  height: 5px;
  border-radius: 2px;
  background-color: rgba(0, 0, 0, 0.12);
  transition: background-color 60ms linear, height 60ms linear;
}
.s164-voicemeter-seg.is-on {
  background-color: #2f9e79;
  height: 13px;
}
.s164-voicemeter-seg.is-hot.is-on {
  background-color: #e8a13c;
}
.s164-voicemeter-seg.is-peak {
  background-color: #e5484d;
  height: 13px;
}
@media (prefers-reduced-motion: reduce) {
  .s164-voicemeter-seg {
    transition: none;
  }
}

/* -------------------------------------------------------------------------
 * BAZA-S243 — ENREGISTREUR PLUS ÉPAIS (recette Philippe 2026-07-30 : « je
 * voudrais plus d'épaisseur, c'est un peu petit l'enregistreur »). Surcharges
 * par ORDRE SOURCE dans CE fichier (mêmes sélecteurs, plus bas ⇒ gagnent) —
 * portée : le COMPOSER vocal seul ; la bulle de lecture du fil est INTACTE
 * (bouton 34px conservé hors `.s164-voice-composer`).
 * ------------------------------------------------------------------------- */
.s164-voice-composer {
  padding: 12px 6px;
}
.s164-voicerec,
.s164-voiceprev {
  min-height: 54px;
  gap: 12px;
}
.s164-voicerec-dot {
  width: 16px;
  height: 16px;
}
.s164-voicerec-timer {
  font-size: 1.15rem;
}
.s164-voicemeter {
  height: 28px;
  gap: 3px;
}
.s164-voicemeter-seg {
  height: 8px;
  border-radius: 3px;
}
.s164-voicemeter-seg.is-on,
.s164-voicemeter-seg.is-peak {
  height: 24px;
}
.s164-voice-composer .s164-voice-play {
  width: 46px;
  height: 46px;
  font-size: 1.15rem;
}
.s164-voice-btn {
  padding: 10px 16px;
  font-size: 0.95rem;
}
.s164-voiceprev-time {
  font-size: 1.05rem;
}
