/* QG+ — Transférer un message à un autre agent (19/10/2026, qg-transfert.js).
   Feuille « Transférer » : même base que « Nouvelle tâche » (.qg-crr-feuille de qg-courrier.css, .qa-* de qg-actions.css).
   Couleurs : jetons --crr-* (clair / sombre). Retour arrière : retirer qg-transfert.css/js d'index.html. */

/* Agents : portrait + nom, choix unique */
#hermes-signature .qt-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
#hermes-signature .qt-agents .qa-squelette { height: 74px; }
#hermes-signature .qt-agent {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  height: 74px; padding: 6px 4px; box-sizing: border-box; border-radius: 13px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--crr-btn-bord, rgba(60, 60, 67, .1)); background: var(--crr-btn, rgba(118, 118, 128, .08)); color: var(--crr-btn-txt, #1c1c1e);
  font: 500 12px/1.15 var(--crr-sans, system-ui, sans-serif); transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
#hermes-signature .qt-portrait { width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--crr-champ, rgba(118, 118, 128, .12)); transition: box-shadow .2s ease; }
#hermes-signature .qt-portrait img { width: 100% !important; height: 100% !important; margin: 0 !important; object-fit: cover; border-radius: 50%; display: block; }
#hermes-signature .qt-initiale { font: 700 15px/1 var(--crr-sans, system-ui, sans-serif); color: var(--crr-doux, #8e8e93); }
#hermes-signature .qt-nom { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 2px; }
#hermes-signature .qt-agent[aria-checked="true"] { font-weight: 650; border-color: var(--crr-prim-bord); background: var(--crr-prim); color: var(--crr-prim-txt); }
#hermes-signature .qt-agent[aria-checked="true"] .qt-portrait { box-shadow: 0 0 0 2px var(--crr-feuille, #fff), 0 0 0 4px var(--crr-accent, #00a88e); }
#hermes-signature .qt-agent:focus-visible { outline: 2px solid var(--crr-accent, #00a88e); outline-offset: 2px; }
#hermes-signature .qt-vide { margin: 0; color: var(--crr-doux, #8e8e93); font: 400 13px/1.3 var(--crr-sans, system-ui, sans-serif); }

/* Mot du Général */
#hermes-signature .qt-champ-mot textarea { min-height: 52px; }

/* Message complet / Uniquement les pièces jointes */
#hermes-signature#hermes-signature#hermes-signature .qt-modes { grid-template-columns: 1fr 1fr; }
#hermes-signature#hermes-signature#hermes-signature .qt-modes .qg-crr-opt { height: auto; min-height: 44px; padding: 6px 10px; white-space: normal; line-height: 1.15; text-align: left; }
#hermes-signature .qt-zone-pieces { display: flex; flex-direction: column; gap: 14px; }
#hermes-signature .qt-zone-pieces:empty { display: none; }
#hermes-signature .qt-mode-pieces .qt-source { opacity: .42; transition: opacity .25s ease; }
#hermes-signature .qt-source { transition: opacity .25s ease; }

/* Cases des pièces */
#hermes-signature .qt-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#hermes-signature .qt-tete > span { font: 600 9.5px/1 var(--crr-mono, ui-monospace, monospace); letter-spacing: .18em; text-transform: uppercase; color: var(--crr-doux, #8e8e93); }
#hermes-signature .qt-tout {
  border: 0; background: none; padding: 6px 2px; margin: -6px 0; cursor: pointer; color: var(--crr-accent, #00a88e);
  font: 600 12.5px/1 var(--crr-sans, system-ui, sans-serif); -webkit-tap-highlight-color: transparent;
}
#hermes-signature .qt-pieces { max-height: min(34vh, 290px); overflow-y: auto; overscroll-behavior: contain; padding: 1px; }
#hermes-signature .qt-piece .qa-joint-txt { flex: 1; }
#hermes-signature .qt-taille { flex: none; color: var(--crr-doux, #8e8e93); font: 500 11px/1 var(--crr-mono, ui-monospace, monospace); }
#hermes-signature .qt-piece[aria-checked="false"] .qa-joint-txt { opacity: .62; }
#hermes-signature .qt-cherche .qt-envoyer { opacity: .6; }

/* Confirmation « Transféré à … · Voir » */
#hermes-signature .qt-toast {
  position: fixed; z-index: 95; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); min-height: 44px; padding: 0 6px 0 14px; box-sizing: border-box;
  border-radius: 999px; background: var(--crr-feuille, #fff); color: var(--crr-texte, #1c1c1e); border: 1px solid var(--crr-bord, rgba(60, 60, 67, .12));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font: 500 13.5px/1.2 var(--crr-sans, system-ui, sans-serif);
}
#hermes-signature:not([data-theme="light"]) .qt-toast { background: rgba(3, 16, 14, .96); border-color: rgba(77, 255, 216, .25); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#hermes-signature .qt-toast-ic { display: grid; place-items: center; color: var(--crr-accent, #00a88e); }
#hermes-signature .qt-toast-ic svg { width: 16px; height: 16px; }
#hermes-signature .qt-toast-txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 12px 0; }
#hermes-signature .qt-toast:not(:has(.qt-toast-voir)) { padding-right: 16px; }
#hermes-signature .qt-toast-voir {
  flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--crr-accent-fond, rgba(0, 201, 173, .14)); color: var(--crr-accent, #00a88e); font: 700 13px/1 var(--crr-sans, system-ui, sans-serif);
}

/* Bulle du Général : en-tête « ↪ Message transféré depuis … » et citation */
#hermes-signature .qt-transfere .qt-entete {
  display: flex; align-items: center; gap: 6px; margin: 6px 0 6px; font: 600 12px/1.3 var(--crr-sans, system-ui, sans-serif); opacity: .8;
}
#hermes-signature .qt-transfere .qt-entete:first-child { margin-top: 0; }
#hermes-signature .qt-transfere .qt-entete svg { width: 13px; height: 13px; flex: none; }
#hermes-signature .qt-transfere .qt-cite {
  display: block; padding: 2px 0 2px 10px; border-left: 2px solid color-mix(in srgb, currentColor 35%, transparent);
  opacity: .88; white-space: pre-line; max-height: 9.6em; overflow: hidden;
}
#hermes-signature .qt-transfere .qt-cite.qt-long { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent); }
#hermes-signature .qt-transfere .qt-apres { display: block; margin-top: 6px; white-space: pre-line; font-size: .9em; opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  #hermes-signature .qt-agent, #hermes-signature .qt-portrait, #hermes-signature .qt-source { transition: none; }
}
/* 19/10/2026 (le Général : « la possibilité d'écrire un message pour que l'agent comprenne le contexte ») : champ plus grand */
#hermes-signature .qt-champ-mot textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
