/* QG+ — 14/10/2026 (le Général : « la PJ est restée en chargement, gère-moi mieux la gestion des pièces jointes »).
   Avec qg-joints.js v2 et app.js studio103 : vraie progression de l'envoi (anneau qui se remplit + « 37 % »), croix pour
   annuler un envoi en cours, vignette rouge « Réessayer » si l'envoi rate, et la pièce qui continue de partir DANS la
   bulle du message envoyé pendant son envoi (le message attend sa pièce et part avec, jamais sans).
   Retour arrière : retirer cette feuille d'index.html (voir RETOUR-ARRIERE.txt). */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }

/* ── vignettes de la saisie ─────────────────────────────────────────────────────────────────────────── */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-prog { display: grid; justify-items: center; align-content: center; gap: 4px; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-anneau:not(.est-indef) {
  border: 0; animation: none; width: 24px; height: 24px;
  background: conic-gradient(#ffffff calc(var(--p, 0) * 1turn), rgba(255, 255, 255, .3) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  transition: --p .35s linear;
}
#hermes-signature#hermes-signature #hs-attachment .qg-joint-taux {
  display: block; min-height: 9px; font: 700 9px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-style: normal;
  color: #ffffff; letter-spacing: .01em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); white-space: nowrap;
}
#hermes-signature#hermes-signature #hs-attachment .qg-joint-taux:empty { min-height: 0; }
/* raté : voile rouge, flèche « Réessayer » ; toute la vignette se touche */
#hermes-signature#hermes-signature #hs-attachment .qg-joint.est-envoi.est-echec { cursor: pointer; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat.est-ko { background: rgba(229, 53, 43, .62); transition: background .2s ease; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat.est-ko svg { width: 21px; height: 21px; stroke-width: 2.4; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint.est-echec:active .qg-joint-etat.est-ko { background: rgba(200, 40, 32, .72); }
/* arrivée : l'anneau plein s'efface en douceur sur la vignette prête */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat.est-fin { pointer-events: none; animation: qg-pj-fondu .42s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes qg-pj-fondu { from { opacity: 1; } to { opacity: 0; } }

/* ── la pièce dans la bulle du message qui l'attend ─────────────────────────────────────────────────── */
#hermes-signature .qg-msg-pj.qg-msg-pj-envoi { position: relative; cursor: default; }
#hermes-signature .qg-msg-pj-doc.qg-msg-pj-envoi::before { content: none; }
#hermes-signature .qg-msg-pj-anneau {
  flex: none; display: block; width: 15px; height: 15px; border-radius: 50%; color: inherit;
  background: conic-gradient(currentColor calc(var(--p, 0) * 1turn), rgba(255, 255, 255, .28) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  transition: --p .35s linear;
}
#hermes-signature .qg-msg-pj-anneau.est-indef { background: conic-gradient(currentColor 0 .27turn, rgba(255, 255, 255, .28) 0); animation: qg-pj-tour .9s linear infinite; }
@keyframes qg-pj-tour { to { transform: rotate(1turn); } }
#hermes-signature .qg-msg-pj-taux { font-size: 11.5px; font-weight: 600; opacity: .78; font-variant-numeric: tabular-nums; white-space: nowrap; }
#hermes-signature .qg-msg-pj-taux:empty { display: none; }
#hermes-signature .qg-msg-pj-img.qg-msg-pj-envoi img { filter: brightness(.7) saturate(.9); transition: filter .3s ease; }
#hermes-signature .qg-msg-pj-img.qg-msg-pj-envoi .qg-msg-pj-anneau { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; color: #ffffff; }
#hermes-signature .qg-msg-pj-img.qg-msg-pj-envoi .qg-msg-pj-taux { position: absolute; left: 0; right: 0; top: calc(50% + 21px); text-align: center; color: #ffffff; opacity: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }

@media (prefers-reduced-motion: reduce) {
  #hermes-signature .qg-msg-pj-anneau, #hermes-signature#hermes-signature #hs-attachment .qg-joint-anneau { transition: none !important; }
  #hermes-signature .qg-msg-pj-anneau.est-indef { animation: none !important; }
}
