/* QG+ · Bulle de la Secrétaire — échange rapide (12/10/2026). Voir qg-sg-rapide.js. */
#hermes-signature .qg-sgr-bulle {
  position: fixed; z-index: 45; right: 24px; bottom: 58px; width: 58px; height: 58px; padding: 0; border-radius: 50%;
  border: 2px solid rgba(77, 255, 216, .75); background: #03100e; cursor: pointer; overflow: visible;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 4px rgba(77, 255, 216, .10), 0 0 22px rgba(77, 255, 216, .35);
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.3), box-shadow .2s ease; -webkit-tap-highlight-color: transparent;
  animation: qg-sgr-respire 3.2s ease-in-out infinite;
}
#hermes-signature .qg-sgr-bulle[hidden] { display: none; }
#hermes-signature .qg-sgr-bulle.au-dessus-saisie { bottom: 128px; }
#hermes-signature .qg-sgr-bulle:hover { transform: scale(1.07); }
#hermes-signature .qg-sgr-bulle:active { transform: scale(.94); }
#hermes-signature .qg-sgr-bulle img, #hermes-signature .qg-sgr-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
#hermes-signature .qg-sgr-ini { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; color: #4dffd8; }
#hermes-signature .qg-sgr-plus {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #4dffd8; color: #01241f; box-shadow: 0 0 0 2px #03100e;
}
#hermes-signature .qg-sgr-plus svg { width: 14px; height: 14px; stroke-width: 3; }
@keyframes qg-sgr-respire { 50% { box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 6px rgba(77, 255, 216, .14), 0 0 30px rgba(77, 255, 216, .5); } }

#hermes-signature .qg-sgr-panneau {
  position: fixed; z-index: 46; right: 24px; bottom: 58px; width: 390px; max-height: min(600px, calc(100vh - 140px));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; color: #e9fffa;
  background: rgba(3, 16, 14, .97); border: 1px solid rgba(77, 255, 216, .28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3), 0 0 40px rgba(77, 255, 216, .12);
  opacity: 0; transform: translateY(16px) scale(.96); transform-origin: 100% 100%; pointer-events: none; visibility: hidden;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, .9, .25, 1.1), visibility 0s .3s;
}
#hermes-signature .qg-sgr-panneau.est-ouvert { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .22s ease, transform .3s cubic-bezier(.2, .9, .25, 1.1); }
#hermes-signature .qg-sgr-tete { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 14px; border-bottom: 1px solid rgba(77, 255, 216, .12); }
#hermes-signature .qg-sgr-tete > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
#hermes-signature .qg-sgr-tete strong { font-size: 15px; }
#hermes-signature .qg-sgr-tete small { font-size: 12px; opacity: .65; }
#hermes-signature .qg-sgr-av { width: 38px; height: 38px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(77, 255, 216, .6); }
#hermes-signature .qg-sgr-ico {
  appearance: none; width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  border: 0; background: transparent; color: inherit; opacity: .8;
}
#hermes-signature .qg-sgr-ico:hover { background: rgba(77, 255, 216, .1); opacity: 1; }
#hermes-signature .qg-sgr-ico svg { width: 19px; height: 19px; }
#hermes-signature .qg-sgr-fil { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#hermes-signature .qg-sgr-m { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.42; }
#hermes-signature .qg-sgr-m p { margin: 0; overflow-wrap: anywhere; }
#hermes-signature .qg-sgr-m.sg { align-self: flex-start; background: rgba(77, 255, 216, .08); border: 1px solid rgba(77, 255, 216, .14); border-bottom-left-radius: 6px; }
#hermes-signature .qg-sgr-m.moi { align-self: flex-end; background: #4dffd8; color: #01241f; border-bottom-right-radius: 6px; font-weight: 500; }
#hermes-signature .qg-sgr-m.fait { border-color: rgba(77, 255, 216, .55); box-shadow: 0 0 18px rgba(77, 255, 216, .18); }
#hermes-signature .qg-sgr-jour { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
#hermes-signature .qg-sgr-jour b { display: flex; align-items: center; gap: 6px; font-weight: 700; text-transform: capitalize; }
#hermes-signature .qg-sgr-jour svg { width: 14px; height: 14px; }
#hermes-signature .qg-sgr-jour span { opacity: .85; }
#hermes-signature .qg-sgr-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#hermes-signature .qg-sgr-actions button, #hermes-signature .qg-sgr-puces button {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13.5px;
  color: inherit; background: rgba(77, 255, 216, .08); border: 1px solid rgba(77, 255, 216, .3);
}
#hermes-signature .qg-sgr-actions button:hover, #hermes-signature .qg-sgr-puces button:hover { background: rgba(77, 255, 216, .16); }
#hermes-signature .qg-sgr-actions svg { width: 15px; height: 15px; }
#hermes-signature .qg-sgr-puces { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
#hermes-signature .qg-sgr-puces:empty { display: none; }
#hermes-signature .qg-sgr-ecrit { display: flex; gap: 5px; padding: 13px 15px; }
#hermes-signature .qg-sgr-ecrit i { width: 7px; height: 7px; border-radius: 50%; background: #4dffd8; opacity: .4; animation: qg-sgr-point 1s ease-in-out infinite; }
#hermes-signature .qg-sgr-ecrit i:nth-child(2) { animation-delay: .15s; } #hermes-signature .qg-sgr-ecrit i:nth-child(3) { animation-delay: .3s; }
@keyframes qg-sgr-point { 50% { opacity: 1; transform: translateY(-3px); } }
#hermes-signature .qg-sgr-saisie { display: flex; align-items: flex-end; gap: 6px; padding: 10px 10px 12px 14px; border-top: 1px solid rgba(77, 255, 216, .12); }
#hermes-signature .qg-sgr-saisie textarea {
  flex: 1; min-width: 0; resize: none; border: 1px solid rgba(77, 255, 216, .22); border-radius: 14px; padding: 10px 12px; max-height: 120px;
  background: rgba(0, 0, 0, .25); color: inherit; font: inherit; font-size: 16px; line-height: 1.35; outline: none;
}
#hermes-signature .qg-sgr-saisie textarea:focus { border-color: rgba(77, 255, 216, .6); }
#hermes-signature .qg-sgr-envoi { background: #4dffd8; color: #01241f; opacity: 1; border-radius: 14px; }
#hermes-signature .qg-sgr-envoi:hover { background: #7affe2; }
#hermes-signature .qg-sgr-micro.enregistre { background: #ff4d6d; color: #fff; opacity: 1; animation: qg-sgr-rec 1.1s ease-in-out infinite; }
@keyframes qg-sgr-rec { 50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, .25); } }

/* thème clair */
#hermes-signature[data-theme="light"] .qg-sgr-bulle { background: #fff; border-color: #0b0d0e; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); animation: none; }
#hermes-signature[data-theme="light"] .qg-sgr-plus { background: #0b0d0e; color: #fff; box-shadow: 0 0 0 2px #fff; }
#hermes-signature[data-theme="light"] .qg-sgr-panneau { background: rgba(255, 255, 255, .98); color: #0b0d0e; border-color: rgba(0, 0, 0, .1); box-shadow: 0 24px 60px rgba(0, 0, 0, .2); }
#hermes-signature[data-theme="light"] .qg-sgr-m.sg { background: #f2f4f5; border-color: transparent; }
#hermes-signature[data-theme="light"] .qg-sgr-m.moi { background: #0b0d0e; color: #fff; }
#hermes-signature[data-theme="light"] .qg-sgr-saisie textarea { background: #f6f7f8; border-color: rgba(0, 0, 0, .1); }
#hermes-signature[data-theme="light"] .qg-sgr-envoi { background: #0b0d0e; color: #fff; }
#hermes-signature[data-theme="light"] :is(.qg-sgr-actions, .qg-sgr-puces) button { background: #f2f4f5; border-color: rgba(0, 0, 0, .1); }
#hermes-signature[data-theme="light"] .qg-sgr-jour { background: rgba(0, 0, 0, .05); }

/* iPhone : au-dessus de la barre d'onglets ; panneau en bas, pleine largeur */
@media (max-width: 760px) {
  #hermes-signature .qg-sgr-bulle { right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 98px); width: 54px; height: 54px; }
  #hermes-signature .qg-sgr-panneau { left: 8px; right: 8px; width: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); max-height: min(72vh, 620px); }
}
@media (prefers-reduced-motion: reduce) {
  #hermes-signature .qg-sgr-bulle, #hermes-signature .qg-sgr-ecrit i, #hermes-signature .qg-sgr-micro.enregistre { animation: none; }
  #hermes-signature .qg-sgr-panneau { transition: none; }
}

/* 12/10/2026 (demande du Général) : apparition en douceur avec un flou qui se dissipe ; disparition instantanée. */
#hermes-signature .qg-sgr-bulle.au-dessus-saisie { bottom: 58px; }
#hermes-signature .qg-sgr-bulle.qg-sgr-entre { animation: qg-sgr-entre .6s cubic-bezier(.2, .85, .25, 1) .08s both, qg-sgr-respire 3.2s ease-in-out .7s infinite; }
@keyframes qg-sgr-entre {
  0% { opacity: 0; filter: blur(14px); transform: scale(.72) translateY(10px); }
  60% { opacity: 1; filter: blur(2px); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}
#hermes-signature .qg-sgr-panneau.sans-transition { transition: none !important; }
@media (max-width: 760px) { #hermes-signature .qg-sgr-bulle.au-dessus-saisie { bottom: calc(env(safe-area-inset-bottom, 0px) + 98px); } }
@media (prefers-reduced-motion: reduce) { #hermes-signature .qg-sgr-bulle.qg-sgr-entre { animation: none; } }
#hermes-signature[data-theme="light"] .qg-sgr-bulle.qg-sgr-entre { animation: qg-sgr-entre .6s cubic-bezier(.2, .85, .25, 1) .08s both; }
/* 12/10 : le champ reste sur une ligne au repos (le texte d'aide ne passe jamais à la ligne) */
#hermes-signature .qg-sgr-saisie textarea { min-height: 44px; }
#hermes-signature .qg-sgr-saisie textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .55; }

/* 14/11/2026 (Dali : « quand je change de page, l'apparition de cette tuile en bas à droite n'est pas fluide du tout, elle doit
   apparaître très progressivement »). Deux défauts :
   1. la bulle était affichée une image entière, nette, AVANT que son entrée ne démarre (la classe d'entrée est posée à l'image
      suivante) : elle clignotait — visible, invisible, puis fondu. Elle est maintenant invisible tant que l'entrée n'a pas démarré ;
   2. l'entrée était presque finie en 0,15 s (opaque à 60 % d'une courbe très vive). Elle dure désormais 1,3 s, après 0,2 s
      d'attente (le temps que la page se pose) : opacité, netteté et taille montent ensemble, lentement, sans à-coup.
   Disparition : toujours instantanée. « Réduire les animations » : pas de mouvement, bulle affichée directement. */
#hermes-signature#hermes-signature .qg-sgr-bulle:not(.qg-sgr-entre) { opacity: 0; }
#hermes-signature#hermes-signature .qg-sgr-bulle.qg-sgr-entre { animation: qg-sgr-entre2 1.3s cubic-bezier(.42, 0, .3, 1) .2s both, qg-sgr-respire 3.2s ease-in-out 1.7s infinite; }
#hermes-signature#hermes-signature[data-theme="light"] .qg-sgr-bulle.qg-sgr-entre { animation: qg-sgr-entre2 1.3s cubic-bezier(.42, 0, .3, 1) .2s both; }
@keyframes qg-sgr-entre2 {   /* deux étapes seulement : une seule courbe pour tout, donc aucun palier en chemin */
  from { opacity: 0; filter: blur(10px); transform: scale(.84) translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #hermes-signature#hermes-signature .qg-sgr-bulle.qg-sgr-entre { animation: none; }
  #hermes-signature#hermes-signature .qg-sgr-bulle:not(.qg-sgr-entre) { opacity: 1; }
}
