/**
 * Restored version of front_v21.css without recent mobile overrides.
 * Includes all desktop styles and general enhancements.
 */

/* Base Chatbox Styles */
#chatbox {
  position: fixed;
  z-index: 9999;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  padding: 20px;
}

#chatbox.bottom_right {
  bottom: 20px;
  right: 20px;
}

/* Desktop uniquement: déplacer le widget replié plus à gauche */
body:not(.mobile-view) #chatbox.bottom_right {
  right: 40px;
}

#chatbox.top_right {
  top: 20px;
  right: 20px;
}

#chatbox.bottom_left {
  bottom: 20px;
  left: 20px;
}

#chatbox.top_left {
  top: 20px;
  left: 20px;
}

#chatbox-title {
  font-weight: bold;
  margin-left: 10px;
}

/* Error message */
.message.chatbot-error {
  background: #FFCDD2;
  color: #D32F2F;
  padding: 8px 12px;
  border-radius: 8px;
}

/* Header button */
#chatbox-toggle {
  width: 100%;
  padding: 5px;
  border: none;
  cursor: pointer;
  float: left;
  background: #F98758;
  color: #fff;
  position: relative;
}

#chatbox-toggle:hover {
  background: #2aabd5;
}

/* Couleurs inversées pour la version déployée */
#chatbox.chatbox-open #chatbox-toggle {
  background: #2aabd5;
  /* Bleu au lieu d'orange */
}

#chatbox.chatbox-open #chatbox-toggle:hover {
  background: #F98758;
  /* Orange au survol au lieu de bleu */
}

.chatbox-close-icon {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}

#chatbox-toggle img {
  max-width: 30px;
  height: auto;
}

/* Content */
#chatbox-content {
  display: none;
}

#chatbox-content.open {
  display: flex;
  flex-direction: column;
  border-top: 1px solid grey;
  max-width: 410px;
  width: 100%;
  box-sizing: border-box;
}

#chatbox-messages {
  padding: 10px;
  flex: 1 1 auto;
  overflow-y: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Déployé desktop: réduire légèrement les paddings internes pour élargir l'espace utile */
#chatbox.chatbox-open #chatbox-messages {
  padding: 8px;
}

#chatbox.chatbox-open #chatbox-input {
  padding: 8px;
}

#chatbox-messages .message {
  padding-top: 7px;
  display: flex;
  align-items: flex-start;
}

#chatbox-messages .response {
  border: 1px solid #2aabd5;
  background: #f0faff;
  border-radius: 8px;
  padding: 10px 12px;
}

#chatbox-messages .user {
  border: 1px solid #F98758;
  background: #fff5f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: bold;
}

.msg-icon {
  margin-right: 6px;
  font-size: 18px;
}

.msg-icon img {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.msg-text {
  flex: 1 1 auto;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
}

.msg-time {
  margin-left: 8px;
  font-size: 11px;
  color: #777;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Links in messages */
#chatbox-messages a {
  color: #2aabd5 !important;
  text-decoration: underline !important;
}

#chatbox-messages a:hover {
  color: #F98758 !important;
  text-decoration: none !important;
}

/* Message de consentement centré */
#chatbox-messages .message.consent {
  text-align: center;
  font-style: italic;
  color: #666;
}

/* Boutons de consentement centrés */
#consent-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

/* Input area */
#chatbox-input {
  display: flex;
  align-items: center;
  padding: 10px;
  flex-wrap: wrap;
  /* permet de passer les actions à la ligne suivante */
  position: relative;
}

.input-with-mic {
  position: relative;
  flex: 1 1 auto;
}

/* ---- Overlay micro ---- */
#voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* Widget desktop: overlay local, centré dans la fenêtre du chat */
#voice-overlay.widget-local {
  position: fixed;
  /* on positionne par coordonnées plutôt que plein écran */
  inset: auto;
  /* remettre à zéro l'inset */
  background: rgba(0, 0, 0, .2);
  /* overlay léger local au chat */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

#voice-overlay.show {
  display: flex;
}

.voice-modal {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  min-width: 280px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
}

.voice-mic-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-mic-ring {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 0, 0, .12);
  animation: voicePulse 1.6s ease-in-out infinite;
}

.voice-mic-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
}

/* Icône micro plus grande dans l'overlay */
.voice-mic-btn .mic-icon {
  width: 36px;
  height: 36px;
}

.voice-text {
  font-weight: 600;
  color: #333;
  text-align: center;
}

.voice-sub {
  font-size: 12px;
  color: #777;
  text-align: center;
}

@keyframes voicePulse {
  0% {
    transform: scale(1);
    opacity: .9;
  }

  60% {
    transform: scale(1.15);
    opacity: .45;
  }

  100% {
    transform: scale(1);
    opacity: .9;
  }
}

/* Agrandir le champ sur desktop quand le chat est déployé */
body:not(.mobile-view) #chatbox.chatbox-open #chatbox-input #chatbox-input-text {
  height: 36px;
  padding: 8px 40px 8px 8px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  width: 100% !important;
}

/* Après le 1er message (ou historique), passer l'input à 100% de largeur */
body:not(.mobile-view) #chatbox.chatbox-open.has-first-msg #chatbox-input #chatbox-input-text {
  width: 100% !important;
}

/* Fond rouge pâle sur le bouton micro pendant enregistrement (widget déployé) */
body:not(.mobile-view) #chatbox #chatbox-voice-button.recording {
  background: #ffe6e6 !important;
  border: 1px solid #ffb3b3 !important;
  border-radius: 4px !important;
}

#chatbox-voice-button {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  height: 26px;
  width: 26px;
  line-height: 26px;
  padding: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  z-index: 2;
}

/* Icône micro en image */
.mic-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
}

#chatbox-voice-button.recording {
  background: transparent !important;
}

#chatbox-input-text {
  flex: 1;
  height: 30px;
  padding: 5px 40px 5px 5px;
  /* espace à droite pour l'icône micro */
  border: 1px solid #ccc;
  border-radius: 5px;
  min-width: 0;
}

/* Etat erreur champ vide (widget) */
#chatbox-input-text.input-error {
  border-color: #d93025 !important;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15) !important;
}

/* Ajustement spécifique Firefox desktop pour éviter la troncature du placeholder */
@-moz-document url-prefix() {
  body:not(.mobile-view) #chatbox-input-text {
    width: calc(90% + 5px);
    min-width: 185px;
  }
}

#chatbox-send-button {
  margin-left: 10px;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s ease;
}

#chatbox-send-button:hover {
  transform: translateY(0);
  box-shadow: none !important;
  background: #000 !important;
}

/* Conserver le rouge en hover quand en erreur (widget générique) */
#chatbox-send-button.ptt-error:hover {
  background: linear-gradient(145deg, #d93025, #b71c1c) !important;
}

#chatbox-send-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

#chatbox-send-button:disabled {
  cursor: inherit;
  opacity: 0.7;
}

#chatbox-actions {
  display: none !important;
  gap: 8px;
  flex: 0 0 100%;
  /* occupe toute la largeur sous la ligne input+envoyer */
  margin-top: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-in-out;
}

/* Actions visibles avec animation pour le chatbox principal */
#chatbox-actions.show {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

#chatbox-actions .btn {
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #e1e1e1;
  background: #f7f7f7;
  cursor: pointer;
  transition: all .15s ease;
}

/* Boutons plus compacts sur Firefox desktop */
@-moz-document url-prefix() {
  body:not(.mobile-view) #chatbox-actions .btn {
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 4px;
  }

  body:not(.mobile-view) #chatbox-actions {
    gap: 5px;
  }
}

#chatbox-actions .btn:hover {
  background: #eaeaea;
}

/* --- Widget: bloc de notation compact --- */
.widget-rating {
  width: 100%;
  margin-top: 6px;
}

/* Masquer notation par défaut sur widget avant 1ère question */
#chatbox:not(.has-first-msg) .widget-rating {
  display: none;
}

.widget-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-rating-avg-label {
  font-size: 12px;
  color: #555;
}

.rating-pill.compact {
  display: none;
}

.widget-rating-bar {
  margin-top: 6px;
}

.smeter {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.smeter.horizontal .smeter-track {
  width: 100%;
  height: 14px;
  position: relative;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 7px;
  overflow: hidden;
}

/* Séparateurs noirs S1..S9,S9+30 (10 segments) */
.smeter.horizontal .smeter-track::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .7) 1px, transparent 1px, transparent 10%);
  background-size: 10% 100%, 20% 100%, 30% 100%, 40% 100%, 50% 100%, 60% 100%, 70% 100%, 80% 100%, 90% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}

.smeter .smeter-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: linear-gradient(to right, #4caf50 0%, #4caf50 80%, #f44336 80%, #f44336 100%);
}

.smeter .smeter-ticks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: #777;
  margin-left: 8px;
}

.smeter .smeter-ticks .ticks-s {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.smeter .smeter-ticks .ticks-db.compact {
  gap: 12px;
}

/* Repères sous le bargraphe dans le widget */
.widget-rating-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-rating-bar .widget-smeter {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.widget-rating-bar .smeter-ticks {
  margin-left: 0;
  margin-top: 6px;
}

.widget-rating-bar .ticks-below {
  align-items: stretch;
}

.widget-rating-title {
  font-size: 12px;
  color: #555;
}

/* Bloc moyenne après vote */
.widget-average {
  margin-top: 8px;
}

.widget-average-title {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.widget-avg-smeter {
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .rating-pill.compact {
    font-size: 11px;
  }

  .smeter.horizontal .smeter-track {
    height: 12px;
  }
}

/* Footer links */
#chatbox-footer-links {
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
}

#chatbox-footer-links a {
  color: #2aabd5 !important;
  text-decoration: underline;
  position: relative;
  transition: color .2s ease, background-size .2s ease;
  background-image: linear-gradient(#F98758, #F98758);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
}

#chatbox-footer-links a:hover {
  color: #F98758 !important;
  text-decoration: none;
  background-size: 100% 2px;
}

/* Lien vers l'interface support plein écran */
#chatbox-footer-links a.support-full-link {
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(42, 171, 213, 0.35);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(42, 171, 213, 0.06);
}

#chatbox-footer-links a.support-full-link:hover {
  background: rgba(42, 171, 213, 0.12);
}

#chatbox-footer-links a:visited {
  color: #2aabd5 !important;
}

#waiting-dots {
  display: none;
}

/* Supprimer ancien indicateur */

/* Indicateur ping concentrique */
#radio-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
}

#radio-loading .ping {
  position: relative;
  width: 56px;
  height: 56px;
}

#radio-loading .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #2aabd5;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

#radio-loading .r1 {
  animation: ping 1.8s infinite ease-out;
}

#radio-loading .r2 {
  animation: ping 1.8s infinite ease-out 0.3s;
}

#radio-loading .r3 {
  animation: ping 1.8s infinite ease-out 0.6s;
}

@keyframes ping {
  0% {
    width: 8px;
    height: 8px;
    opacity: 0.8;
  }

  50% {
    width: 32px;
    height: 32px;
    opacity: 0.5;
  }

  100% {
    width: 56px;
    height: 56px;
    opacity: 0;
  }
}

/* Nettoyage ancien styles onde */
.wave {
  display: none;
}

/* --- General Chatbox Structure for Scrolling --- */
#chatbox {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  /* Limite la hauteur sur desktop */
}

#chatbox-content {
  flex: 1 1 auto;
  overflow-y: auto;
  /* Active le scroll interne sur desktop */
  display: flex;
  flex-direction: column;
}

#chatbox-messages {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* --- Scrolling Control for Desktop and Mobile --- */
#chatbox-content {
  display: none;
  /* Règle essentielle pour masquer par défaut */
}

#chatbox-content.open {
  max-height: 70vh;
  /* Limite la hauteur de la zone de contenu */
  display: flex;
  flex-direction: column;
}

#chatbox-messages {
  flex: 1 1 auto;
  /* Permet à la zone de message de prendre l'espace disponible */
  overflow-y: auto;
  /* Active le défilement vertical UNIQUEMENT ici */
}

/* --- Barre de défilement visible --- */
#chatbox-messages::-webkit-scrollbar {
  width: 8px;
}

#chatbox-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

#chatbox-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

#chatbox-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===== Mobile specific adjustments (scoped with .mobile-view) ===== */
@media (max-width:480px) {

  /* --- Replié --- */
  body.mobile-view #chatbox.chatbox-closed {
    width: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  body.mobile-view #chatbox.chatbox-closed #chatbox-toggle {
    padding: 8px;
    /* Espacement compact */
    border-radius: 8px;
    /* Coins arrondis */
  }

  body.mobile-view #chatbox.chatbox-closed .chatbox-close-icon,
  body.mobile-view #chatbox.chatbox-closed #chatbox-title {
    display: none;
    /* Masquer croix et titre */
  }

  /* --- Déplié --- */
  body.mobile-view #chatbox.chatbox-open {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    top: 0;
    left: 0;
    right: 0;
    position: fixed;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.mobile-view #chatbox.chatbox-open #chatbox-header {
    flex: 0 0 auto;
    z-index: 10;
    /* Assure que l'en-tête reste au-dessus */
  }

  body.mobile-view #chatbox.chatbox-open #chatbox-toggle {
    display: flex;
    justify-content: center;
    /* Centrer icone */
    background: #2aabd5 !important;
    /* Bleu au lieu d'orange sur mobile déployé */
    align-items: center;
    position: relative;
    width: 100%;
    padding: 10px 0;
    /* Padding réduit pour plus d'espace messages */
  }

  body.mobile-view #chatbox.chatbox-open #chatbox-toggle:hover {
    background: #F98758 !important;
    /* Orange au survol sur mobile déployé */
  }

  body.mobile-view #chatbox.chatbox-open #chatbox-toggle .chatbox-close-icon {
    position: absolute;
    right: 15px;
    /* Positionner la croix à droite */
  }

  body.mobile-view #chatbox-content.open {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    min-height: 0;
    /* Permet au contenu interne de rétrécir (fix iOS) */
    max-height: none;
    /* Annule la limite globale de 70vh en mobile */
    margin-top: 2px;
    /* Espace réduit entre l'en-tête et le contenu */
  }

  /* Spécifique page support: ne pas forcer plein écran, laisser support_page.css gérer la fenêtre compacte */
  body.mobile-view #gptchatbox-support-container #chatbox.chat-visible {
    width: auto;
    height: auto;
    max-height: none;
    top: auto;
    left: auto;
    right: auto;
  }

  body.mobile-view #chatbox-messages {
    flex: 7 1 0;
    /* Prend 70% de l'espace disponible (flex-grow: 7 sur un total de 10) */
    overflow-y: auto;
    overscroll-behavior: contain;
    /* empêcher l'effet rebond de la page parente */
    -webkit-overflow-scrolling: touch;
    /* Scroll fluide iOS */
    padding: 8px 10px;
    /* Padding réduit mais confortable pour les messages */
    max-height: none;
    /* Pas de limite fixe, utilise l'espace flex disponible */
    min-height: 0;
    /* Autorise le rétrécissement (fix iOS) */
  }

  /* --- Styles pour rendre la barre de défilement visible --- */
  body.mobile-view #chatbox-messages::-webkit-scrollbar {
    width: 8px;
  }

  body.mobile-view #chatbox-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }

  body.mobile-view #chatbox-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }

  body.mobile-view #chatbox-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
  }

  /* --- Input en colonne --- */
  body.mobile-view #chatbox-input {
    flex: 0 0 auto;
    /* Laisse l'input à sa hauteur auto pour garantir sa visibilité */
    display: flex !important;
    /* Assurer que c'est un conteneur flex */
    flex-direction: column !important;
    /* Disposition en colonne */
    align-items: stretch !important;
    /* Étirer les éléments */
    justify-content: flex-start !important;
    /* Alignement au début */
    flex-wrap: nowrap !important;
    /* Pas d'emballage */
    padding: 8px;
    /* Padding réduit pour plus d'espace messages */
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    /* Sécurité zone iOS */
    background: #fff;
    /* Fond visible */
  }

  body.mobile-view #chatbox-input-text {
    height: 32px !important;
    /* Hauteur réduite pour plus d'espace messages */
    padding: 8px 10px !important;
    /* Padding réduit mais confortable */
    font-size: 15px !important;
    /* Taille optimale pour mobile */
    line-height: 1.4 !important;
    /* Hauteur de ligne confortable */
    border: 2px solid #e0e0e0 !important;
    /* Bordure moderne */
    border-radius: 8px !important;
    /* Coins bien arrondis */
    background: #ffffff !important;
    /* Fond blanc pur */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    /* Ombre subtile */
    outline: none !important;
    /* Supprimer l'outline par défaut */
    transition: all 0.3s ease !important;
    /* Animations fluides */
    order: 0 !important;
    /* Premier élément */
    width: 100% !important;
    /* Pleine largeur */
    box-sizing: border-box !important;
    /* Include padding dans width */
  }

  /* États focus et hover du champ mobile */
  body.mobile-view #chatbox-input-text:focus {
    border-color: #2aabd5 !important;
    /* Bordure bleue au focus */
    box-shadow: 0 2px 8px rgba(42, 171, 213, 0.2) !important;
    /* Ombre bleue */
    background: #fafafa !important;
    /* Fond légèrement grisé */
  }

  body.mobile-view #chatbox-input-text::placeholder {
    color: #888 !important;
    /* Couleur placeholder */
    font-style: italic !important;
    /* Style italique pour le placeholder */
    opacity: 0.8 !important;
    /* Transparence subtile */
  }

  body.mobile-view #chatbox-send-button {
    margin-left: 0 !important;
    margin-top: 8px !important;
    /* Espacement réduit */
    margin-bottom: 0 !important;
    width: 50% !important;
    /* Bouton pleine largeur */
    height: 36px !important;
    /* Hauteur réduite pour plus d'espace messages */
    padding: 8px 16px !important;
    /* Padding réduit mais confortable */
    font-size: 15px !important;
    /* Taille cohérente avec le champ */
    font-weight: 600 !important;
    /* Police semi-bold */
    border-radius: 8px !important;
    /* Coins arrondis cohérents */
    border: none !important;
    /* Pas de bordure */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    /* Ombre plus prononcée */
    transition: all 0.3s ease !important;
    /* Animations fluides */
    text-transform: uppercase !important;
    /* Texte en majuscules */
    letter-spacing: 0.5px !important;
    /* Espacement des lettres */
    order: 1 !important;
    /* Forcer l'ordre : champ -> bouton envoyer -> actions */
    align-self: center !important;
    /* Centrer horizontalement le bouton demi-largeur */
  }

  body.mobile-view #chatbox-voice-button {
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    /* sur mobile, le bouton envoyer est en dessous */
    transform: translateY(-50%) !important;
    width: 24px !important;
    height: 24px !important;
    order: 0 !important;
  }

  /* Effet hover pour le bouton envoyer mobile */
  body.mobile-view #chatbox-send-button:hover {
    transform: translateY(0) !important;
    /* Effet de levée */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    /* Ombre renforcée */
  }

  body.mobile-view #chatbox-send-button:active {
    transform: translateY(1px) !important;
    /* Retour position normale */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    /* Ombre réduite */
  }

  /* Styles pour les boutons support et mail sur mobile avec animation */
  body.mobile-view #chatbox-actions {
    /* Ne pas forcer display ici - laissez JavaScript gérer la visibilité */
    flex-direction: row !important;
    /* Ligne horizontale pour mobile */
    gap: 6px !important;
    /* Gap réduit */
    margin: 6px 0 0 0 !important;
    /* Marge encore plus réduite */
    padding: 0 !important;
    /* Supprimer tout padding */
    width: 100% !important;
    order: 2 !important;
    /* Forcer l'ordre : après le bouton envoyer */
    min-height: auto !important;
    /* Pas de hauteur minimale */
    align-items: stretch !important;
    /* Étirer les boutons */
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
  }

  /* Quand les boutons sont visibles sur mobile avec animation */
  body.mobile-view #chatbox-actions.show {
    display: flex !important;
    /* Forcer flex seulement quand visible */
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  /* --- Mise en page mobile : critères et bargraphes (widget) --- */
  body.mobile-view .rating-criteria {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  body.mobile-view .rating-criteria label {
    font-size: 14px;
  }

  body.mobile-view .smeter.horizontal {
    max-width: 100%;
  }

  /* Trois notes globales sur une seule ligne */
  body.mobile-view #rating-break.rating-breakdown {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: space-between;
  }

  body.mobile-view #rating-break.rating-breakdown span {
    white-space: nowrap;
  }

  body.mobile-view #btn-support,
  body.mobile-view #btn-clear-chat {
    flex: 1 !important;
    /* Partage équitable de l'espace */
    margin: 0 !important;
    padding: 2px 4px !important;
    /* Padding encore plus réduit */
    height: 24px !important;
    /* Hauteur fixe réduite */
    font-size: 11px !important;
    /* Police encore plus petite */
    line-height: 1.1 !important;
    /* Hauteur de ligne très compacte */
    min-height: 24px !important;
    /* Hauteur minimale forcée */
    max-height: 24px !important;
    /* Hauteur maximale limitée */
    border-radius: 3px !important;
    /* Coins moins arrondis */
    white-space: nowrap !important;
    /* Empêcher le retour à la ligne du texte */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    /* Points de suspension si texte trop long */
    display: flex !important;
    align-items: center !important;
    /* Centrer le texte verticalement */
    justify-content: center !important;
    /* Centrer le texte horizontalement */
  }

  /* --- Masquer l'heure sur mobile --- */
  body.mobile-view .msg-time {
    display: none;
  }
}

/* Styles pour le champ email visiteur */
#visitor-email-field {
  margin-bottom: 8px;
}

#visitor-email {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 14px;
  box-sizing: border-box;
}

#visitor-email:focus {
  outline: none;
  border-color: #2aabd5;
  box-shadow: 0 0 5px rgba(42, 171, 213, 0.3);
}

/* Styles pour les notifications */
.chat-notification {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px 15px;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  z-index: 9999;
  max-width: 300px;
  word-wrap: break-word;
  font-size: 14px;
}

.chat-notification.success {
  background-color: #4CAF50;
}

.chat-notification.error {
  background-color: #f44336;
}

/* Badge ON AIR - Desktop version repliée (seulement le point) */
.on-air-badge {
  position: absolute;
  top: -0px;
  /* ajusté uniquement pour le widget replié (desktop) */
  right: -14px;
  /* ajusté légèrement vers l'intérieur */
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  min-width: 0 !important;
  width: 12px !important;
  height: 12px !important;
  border-radius: 50%;
  text-indent: -9999px !important;
  overflow: hidden !important;
  color: transparent !important;
  gap: 0 !important;
  /* Éviter les transitions sur position/taille pour ne pas faire bouger le badge */
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* S'assurer que le point reste visible en version repliée */
.on-air-badge .heartbeat-dot {
  display: block !important;
}

/* Position et style spécifique quand le chatbox est déployé - Bloc complet ON AIR */
#chatbox.chatbox-open .on-air-badge {
  /* Annuler complètement les styles de la version repliée */
  top: 8px !important;
  right: auto !important;
  left: 20px !important;
  /* Aligné à gauche, éloigné du bord */
  transform: none !important;
  padding: 4px 10px !important;
  background: #757575 !important;
  /* Gris par défaut (déconnecté) */
  border: 1px solid #333333 !important;
  /* Bordure grise foncée */
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: bold !important;
  color: white !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  min-width: 45px !important;
  justify-content: center !important;
  box-shadow: 0 0 4px rgba(117, 117, 117, 0.3) !important;
  text-indent: 0 !important;
  overflow: visible !important;
  width: auto !important;
  height: auto !important;
  line-height: normal !important;
}

/* État connecté - Badge rouge avec point vert pour version déployée */
#chatbox.chatbox-open .on-air-badge.online {
  background-color: #f44336 !important;
  /* Rouge quand connecté */
  border: 1px solid #222222 !important;
  /* Bordure noire pour contraste */
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.4) !important;
}

/* État déconnecté - Badge gris avec point gris pour version déployée */
#chatbox.chatbox-open .on-air-badge.offline {
  background-color: #757575 !important;
  /* Gris quand déconnecté */
  border: 1px solid #333333 !important;
  /* Bordure grise foncée */
  box-shadow: 0 0 4px rgba(117, 117, 117, 0.3) !important;
}

/* Point dans le badge déployé - taille réduite */
#chatbox.chatbox-open .heartbeat-dot {
  width: 8px !important;
  height: 8px !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
}

/* Masquer complètement le texte sur desktop */
.on-air-badge::before,
.on-air-badge::after {
  display: none !important;
}

/* Point qui bat comme un cœur - Desktop */
.heartbeat-dot {
  width: 12px !important;
  height: 12px !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  border-radius: 50%;
  display: block !important;
}

/* États desktop */
.on-air-badge.online .heartbeat-dot {
  background-color: #4CAF50 !important;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
  animation: heartbeat 1.8s infinite ease-in-out;
}

.on-air-badge.offline .heartbeat-dot {
  background-color: #757575 !important;
  box-shadow: 0 0 4px rgba(117, 117, 117, 0.3);
  animation: none !important;
  opacity: 0.8;
}

/* Animation battement de cœur réaliste */
@keyframes heartbeat {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  14% {
    transform: scale(1.3);
    opacity: 0.9;
  }

  28% {
    transform: scale(1);
    opacity: 1;
  }

  42% {
    transform: scale(1.3);
    opacity: 0.9;
  }

  70% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Style mobile - Ajustement taille et position */
@media (max-width: 480px) {
  .on-air-badge {
    top: -1px !important;
    right: -1px !important;
    width: 10px !important;
    height: 10px !important;
  }

  /* Position et style spécifique mobile quand le chatbox est déployé - Bloc complet */
  body.mobile-view #chatbox.chatbox-open .on-air-badge {
    /* Annuler complètement les styles de base et desktop pour mobile */
    top: 12px !important;
    /* Plus près du bord haut */
    right: auto !important;
    left: 20px !important;
    /* Aligné à gauche, éloigné du bord */
    transform: none !important;
    padding: 4px 8px !important;
    /* Padding augmenté pour plus gros */
    background: #757575 !important;
    border: 1px solid #333333 !important;
    /* Bordure grise foncée mobile */
    border-radius: 4px !important;
    /* Border-radius légèrement augmenté */
    font-size: 11px !important;
    /* Taille de police augmentée */
    font-weight: bold !important;
    color: white !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    min-width: 35px !important;
    justify-content: center !important;
    box-shadow: 0 0 3px rgba(117, 117, 117, 0.3) !important;
    text-indent: 0 !important;
    overflow: visible !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
  }

  /* États mobile déployé */
  body.mobile-view #chatbox.chatbox-open .on-air-badge.online {
    background-color: #f44336 !important;
    /* Rouge mobile connecté */
    border: 1px solid #222222 !important;
    /* Bordure noire mobile */
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.4) !important;
  }

  body.mobile-view #chatbox.chatbox-open .on-air-badge.offline {
    background-color: #757575 !important;
    /* Gris mobile déconnecté */
    border: 1px solid #333333 !important;
    /* Bordure grise foncée mobile */
    box-shadow: 0 0 3px rgba(117, 117, 117, 0.3) !important;
  }

  /* Point dans le badge mobile déployé */
  #chatbox.chatbox-open .heartbeat-dot {
    width: 8px !important;
    /* Point plus gros pour correspondre au bloc */
    height: 8px !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
  }

  .heartbeat-dot {
    width: 10px !important;
    height: 10px !important;
  }
}

/* État verrouillé après vote sur le widget */
.widget-rating.rated .widget-smeter,
.widget-rating.rated .widget-smeter * {
  pointer-events: none !important;
  cursor: default !important;
}

.widget-rating.rated #btn-widget-submit-rating {
  display: none !important;
}

/* Bouton PTT (widget) – style aligné version support (compact) */
#chatbox.chatbox-open #chatbox-input #chatbox-send-button {
  position: relative;
  height: 30px;
  /* plus petit */
  padding: 0 12px;
  /* plus compact */
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff !important;
  background: linear-gradient(145deg, #3a3a3a, #1e1e1e) !important;
  /* fond gris/noir */
  border: 2px solid #111 !important;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.08), inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.05s ease, box-shadow 0.05s ease !important;
}

/* Etat erreur (input vide) pour le widget déployé */
#chatbox.chatbox-open #chatbox-input #chatbox-send-button.ptt-error {
  background: linear-gradient(145deg, #d93025, #b71c1c) !important;
  border-color: #8b0000 !important;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.12), inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(217, 48, 37, 0.28) !important;
}

#chatbox.chatbox-open #chatbox-input #chatbox-send-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25) inset, 0 8px 16px rgba(0, 0, 0, 0.15) inset;
  pointer-events: none;
}

#chatbox.chatbox-open #chatbox-input #chatbox-send-button:hover {
  transform: translateY(0);
  box-shadow: none !important;
  background: #000 !important;
}

/* Conserver le rouge en hover quand en erreur (widget déployé) */
#chatbox.chatbox-open #chatbox-input #chatbox-send-button.ptt-error:hover {
  background: linear-gradient(145deg, #d93025, #b71c1c) !important;
  border-color: #8b0000 !important;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.12), inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(217, 48, 37, 0.28) !important;
}

#chatbox.chatbox-open #chatbox-input #chatbox-send-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.18) !important;
  background: linear-gradient(145deg, #222, #111) !important;
}

/* Stries (“grip”) internes – noir et gris foncé */
#chatbox.chatbox-open #chatbox-input #chatbox-send-button {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0.6) 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0px, rgba(0, 0, 0, 0.5) 3px, rgba(64, 64, 64, 0.35) 3px, rgba(64, 64, 64, 0.35) 6px) !important;
}