/* QG+ — Pièces jointes en vignettes dans la saisie (Vague 27, 10/10/2026, demande du Général).
   Vignettes carrées arrondies (1re page du PDF, image ; type + nom pour le reste), croix ronde sombre en haut
   à droite, anneau pendant l'envoi, rouge si refusé. Les puces de l'app sont simplement habillées (qg-joints.js). */
#hermes-signature#hermes-signature #hs-attachment.qg-joints:not(:empty) {
  display: flex; flex-wrap: nowrap; gap: 8px; margin: 2px 0 8px; padding: 2px 2px 4px; overflow-x: auto; overflow-y: visible;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
#hermes-signature#hermes-signature #hs-attachment.qg-joints::-webkit-scrollbar { display: none; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint {
  position: relative; flex: none; display: block; width: 68px; height: 68px; margin: 0; padding: 0; border-radius: 14px; overflow: hidden;
  background: #ffffff; border: 1px solid rgba(60, 60, 67, .16); box-shadow: 0 2px 8px rgba(0, 0, 0, .10); background-image: none !important;
  animation: none; cursor: pointer; -webkit-tap-highlight-color: transparent; color: #1c1c1e; font-size: 0;
}
#hermes-signature#hermes-signature:not([data-theme="light"]) #hs-attachment .qg-joint { border-color: rgba(77, 255, 216, .28); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .45); }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-vue { position: absolute; inset: 0; display: block; overflow: hidden; background: #ffffff; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-vue > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* PDF : le haut de la 1re page, cadré comme une loupe sur le début du document */
#hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="pdf"] .qg-joint-vue > img { width: 165%; height: auto; min-height: 100%; object-fit: cover; object-position: 0 0; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-badge {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 4px 1.5px; border-radius: 4px; background: #e5352b; color: #fff;
  font: 800 7.5px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: .04em; font-style: normal;
}
/* image ou PDF pas encore prêt : un léger reflet passe */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-vue.est-attente { background: linear-gradient(100deg, #eef1f3 30%, #f9fbfc 50%, #eef1f3 70%); background-size: 220% 100%; animation: qg-joint-reflet 1.2s linear infinite; }
#hermes-signature#hermes-signature:not([data-theme="light"]) #hs-attachment .qg-joint-vue.est-attente { background-image: linear-gradient(100deg, #0d2420 30%, #16352f 50%, #0d2420 70%); }
@keyframes qg-joint-reflet { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* autres fichiers : type + nom */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-vue.est-doc { display: flex; flex-direction: column; justify-content: space-between; padding: 7px 7px 6px; background: #f2f4f7; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-doc { display: flex; align-items: center; gap: 3px; color: #5b6573; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-doc svg { width: 15px; height: 15px; stroke-width: 2; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-doc b { font: 800 8px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: .04em; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-nom {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
  font: 600 9px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; color: #1c1c1e;
}
#hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="mot"] .qg-joint-vue.est-doc { background: #e8f0fe; } #hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="mot"] .qg-joint-doc { color: #2b63d9; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="tableur"] .qg-joint-vue.est-doc { background: #e6f6ec; } #hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="tableur"] .qg-joint-doc { color: #1e8a4a; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="diapo"] .qg-joint-vue.est-doc { background: #fdeee6; } #hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="diapo"] .qg-joint-doc { color: #d2551e; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="pdf"] .qg-joint-vue.est-doc { background: #fdecea; } #hermes-signature#hermes-signature #hs-attachment .qg-joint[data-fam="pdf"] .qg-joint-doc { color: #e5352b; }
/* la croix : rond sombre en haut à droite (zone tactile agrandie) */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-x {
  position: absolute; top: 4px; right: 4px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; min-width: 0; min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(18, 18, 20, .82); color: #ffffff;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .88), 0 1px 5px rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer; transition: transform .15s ease, background .2s ease;
}
#hermes-signature#hermes-signature #hs-attachment .qg-joint-x::before { content: ""; position: absolute; inset: -6px; }   /* zone tactile 34 px, sans couvrir le centre de la vignette */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-x svg { width: 11px; height: 11px; display: block; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-x:active { transform: scale(.88); }
@media (hover: hover) { #hermes-signature#hermes-signature #hs-attachment .qg-joint-x:hover { background: rgba(0, 0, 0, .95); } }
/* envoi en cours : voile + anneau ; refusé : voile rouge */
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: rgba(10, 14, 16, .42); }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-anneau {
  display: block; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #ffffff;
  animation: qg-joint-tour .9s linear infinite;
}
@keyframes qg-joint-tour { to { transform: rotate(1turn); } }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat.est-ko { background: rgba(229, 53, 43, .55); color: #ffffff; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint-etat.est-ko svg { width: 24px; height: 24px; }
#hermes-signature#hermes-signature #hs-attachment .qg-joint.est-envoi { cursor: default; }

/* les messages éphémères (« Envoi 1/2 », « Document prêt ») passent au-dessus des vignettes */
/* 14/10/2026 : classe posée par qg-pj-etat.js au lieu de « #hermes-signature:has(#hs-attachment.qg-joints:not(:empty)) » — ce :has() sur la racine faisait recalculer toute la page à chaque retouche du fil sur Safari (≈ 180 ms) */
#hermes-signature#hermes-signature#hermes-signature#hermes-signature#hermes-signature#hermes-signature.qg-pj-pleines.qg-pj-pleines .hs-toast { bottom: calc(150px + var(--qg-att-h, 0px) + var(--qg-file-h, 0px)) !important; transition: bottom .42s cubic-bezier(.2, .8, .2, 1); }

@media (min-width: 900px) { #hermes-signature#hermes-signature #hs-attachment .qg-joint { width: 76px; height: 76px; border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) {
  #hermes-signature#hermes-signature #hs-attachment :is(.qg-joint-vue.est-attente, .qg-joint-anneau) { animation: none !important; }
}
