/* QG+ · Mail — retouches (08/10/2026, demandes du Général).
   1. Rangées de puces (boîtes, dossiers) : le défilement garde la marge de 16 px. Sans cela, après un passage par
      « Spam », la rangée des dossiers revenait collée au bord et n'était plus alignée sur « Toutes / JAD / Perso ».
   2. Rédaction : la zone de message n'a plus de cadre teal au focus (il chevauchait le cadre « Idée de réponse »). */
#hermes-signature .mel-puces { scroll-padding-inline: 16px; }
#hermes-signature#hermes-signature .mel-panneau .mel-zone:is(:focus, :focus-visible) { outline: none !important; box-shadow: none !important; }

/* ═══ Lot 2 (08/10) : le Secrétaire général rédige et relit, mode Discussion, « Désabonné ✓ » (qg-mail-sg.js) ═══ */
#hermes-signature .sg-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; display: block; box-shadow: 0 0 0 1px var(--mel-sep); }
#hermes-signature .sg-av.sg-av-mini { width: 20px; height: 20px; display: inline-block; vertical-align: -5px; margin-right: 6px; }
#hermes-signature :is(.sg-bloc, .sg-chat, .sg-f, .sg-disc) svg { display: inline-block; width: 16px; height: 16px; flex: none; }
#hermes-signature .sg-points { display: inline-flex; gap: 4px; padding: 6px 2px; }
#hermes-signature .sg-points i { width: 7px; height: 7px; border-radius: 50%; background: var(--mel-doux); animation: sg-pt 1.2s ease-in-out infinite; }
#hermes-signature .sg-points i:nth-child(2) { animation-delay: .15s; }
#hermes-signature .sg-points i:nth-child(3) { animation-delay: .3s; }
@keyframes sg-pt { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
#hermes-signature :is(.sg-bloc, .sg-chat, .sg-f) mark { background: rgba(255, 196, 0, .32); color: inherit; border-radius: 4px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(255, 196, 0, .45); }
#hermes-signature .sg-principal { background: var(--mel-accent) !important; color: #fff !important; border-color: transparent !important; }
#hermes-signature:not([data-theme="light"]) .sg-principal { color: #02221c !important; }
#hermes-signature .sg-principal:disabled { opacity: .45; }

/* Rédaction (Répondre / Écrire) */
#hermes-signature .sg-bloc { margin: 12px 16px 0; border: 1px solid var(--mel-sep); border-radius: 16px; background: var(--mel-fond2); overflow: hidden; }
#hermes-signature .sg-tete { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
#hermes-signature .sg-tete-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
#hermes-signature .sg-tete-txt b { font-size: 15px; }
#hermes-signature .sg-tete-txt small { font-size: 12.5px; color: var(--mel-doux); }
#hermes-signature .sg-mode { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--mel-puce-bord, var(--mel-sep)); background: var(--mel-fond); font-weight: 600 !important; font-size: 13.5px !important; cursor: pointer; white-space: nowrap; }
#hermes-signature .sg-mode .sg-av-mini { margin-right: 0; vertical-align: middle; }
#hermes-signature .sg-fil { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; max-height: 240px; overflow-y: auto; }
#hermes-signature .sg-b { max-width: 88%; padding: 8px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
#hermes-signature .sg-b-sg { align-self: flex-start; background: var(--mel-fond); border: 1px solid var(--mel-sep); border-bottom-left-radius: 6px; }
#hermes-signature .sg-b-moi { align-self: flex-end; background: var(--mel-accent-fond); border-bottom-right-radius: 6px; }
#hermes-signature .sg-b.sg-attente { padding: 4px 12px; }
#hermes-signature .sg-erreur { color: var(--mel-rouge); }
#hermes-signature .sg-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
#hermes-signature .sg-sugg button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--mel-puce-bord, var(--mel-sep)); background: var(--mel-fond); font-size: 13.5px !important; cursor: pointer; }
#hermes-signature .sg-sugg button:hover { border-color: var(--mel-accent); }
#hermes-signature .sg-lettre-tete { margin: 16px 16px 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mel-accent); }
#hermes-signature .mel-panneau[data-sg-mode="sg"] .mel-zone { margin: 6px 16px 0; width: calc(100% - 32px); border: 1.5px dashed var(--mel-accent); border-radius: 14px; background: var(--mel-fond2); cursor: default; }
#hermes-signature .sg-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 4px; }
#hermes-signature :is(.sg-actions, .sg-c-actions, .sg-f-choix) button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--mel-puce-bord, var(--mel-sep)); background: var(--mel-puce); font-weight: 600 !important; font-size: 14px !important; cursor: pointer; }
#hermes-signature .sg-saisie { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--mel-sep); background: var(--mel-fond); }
#hermes-signature :is(.sg-champ, .sg-c-champ) { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 160px; padding: 11px 15px; border-radius: 22px; border: 1px solid var(--mel-sep); background: var(--mel-champ); color: var(--mel-texte); font: 15.5px/1.35 var(--mel-sans); outline: none; }
#hermes-signature :is(.sg-champ, .sg-c-champ):focus { border-color: var(--mel-accent); }
#hermes-signature .sg-go { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mel-accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
#hermes-signature:not([data-theme="light"]) .sg-go { color: #02221c; }
#hermes-signature .sg-go svg { width: 19px !important; height: 19px !important; }
#hermes-signature .sg-go:disabled { opacity: .45; }

/* Feuille « Je peux envoyer ? » */
#hermes-signature .sg-f-tete { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
#hermes-signature .sg-f-tete b { display: block; font-size: 16px; }
#hermes-signature .sg-f-tete small { color: var(--mel-doux); font-size: 13px; }
#hermes-signature .sg-f-objet { margin-bottom: 8px; font-size: 14px; }
#hermes-signature .sg-f-objet span { color: var(--mel-doux); margin-right: 4px; }
#hermes-signature .sg-f-texte { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 42vh; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--mel-fond2); border: 1px solid var(--mel-sep); font-size: 15px; line-height: 1.45; }
#hermes-signature .sg-f-question,
#hermes-signature .mel-feuille .sg-f-question {   /* 09/10 : décollée de l'encadré (.mel-feuille p la remontait de 6 px, en gris) */
  margin: 20px 2px 14px; color: var(--mel-texte); font-weight: 700; font-size: 16px; line-height: 1.3;
}
@media (prefers-reduced-motion: no-preference) {
  #hermes-signature .mel-feuille .sg-f-question { animation: sg-f-apparait .4s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes sg-f-apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#hermes-signature .sg-f-choix { display: flex; gap: 8px; }
#hermes-signature .sg-f-choix button { flex: 1; height: 46px; }

/* Bouton « Discussion » et liste des discussions */
#hermes-signature .sg-disc-bouton { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--mel-puce-bord, var(--mel-sep)); background: var(--mel-puce); color: var(--mel-puce-txt, var(--mel-texte)); font-weight: 600 !important; font-size: 14.5px !important; cursor: pointer; white-space: nowrap; }
#hermes-signature .sg-disc-bouton svg { width: 18px; height: 18px; }
#hermes-signature .sg-disc-bouton[aria-pressed="true"] { background: var(--mel-puce-on); border-color: var(--mel-puce-on-bord); color: var(--mel-puce-on-txt); }
@media (max-width: 520px) { #hermes-signature .sg-disc-bouton { width: 40px; padding: 0; justify-content: center; } #hermes-signature .sg-disc-bouton span { display: none; } }
#hermes-signature .mel.sg-disc-on :is(.mel-dossiers, .mel-sel-hote, .mel-zone-liste) { display: none !important; }
#hermes-signature .sg-disc { padding: 2px 0 24px; }
#hermes-signature .sg-d-info { display: flex; gap: 10px; justify-content: space-between; padding: 2px 16px 8px; font-size: 12.5px; color: var(--mel-doux); }
#hermes-signature .sg-d-err { color: var(--mel-ambre); }
#hermes-signature .sg-d-liste { list-style: none; margin: 0; padding: 0; }
#hermes-signature .sg-d { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--mel-sep); background: none; text-align: left; cursor: pointer; }
#hermes-signature .sg-d:hover { background: var(--mel-choisi); }
#hermes-signature .sg-d:focus-visible { outline: 2px solid var(--mel-accent); outline-offset: -2px; }
#hermes-signature .sg-d .mel-av { width: 50px; height: 50px; font-size: 17px; }
#hermes-signature .sg-d-corps { min-width: 0; display: grid; gap: 3px; }
#hermes-signature .sg-d-l1, #hermes-signature .sg-d-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
#hermes-signature .sg-d-nom { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature .sg-d-quand { flex: none; font-size: 12.5px; color: var(--mel-doux); font-variant-numeric: tabular-nums; }
#hermes-signature .sg-d[data-nl] .sg-d-quand { color: var(--mel-accent); font-weight: 700; }
#hermes-signature .sg-d-apercu { flex: 1; min-width: 0; color: var(--mel-doux); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature .sg-d[data-nl] .sg-d-apercu { color: var(--mel-texte); }
#hermes-signature .sg-d-vous { color: var(--mel-texte); opacity: .75; }
#hermes-signature .sg-d-nl { flex: none; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--mel-accent); color: #fff; font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
#hermes-signature:not([data-theme="light"]) .sg-d-nl { color: #02221c; }
#hermes-signature .sg-vide { padding: 40px 16px; text-align: center; color: var(--mel-doux); }

/* Une discussion */
@media (min-width: 900px) { #hermes-signature .mel-couche[data-type="discussion"]::before { content: ""; position: absolute; inset: 0; background: var(--mel-voile); } }
#hermes-signature .sg-chat .mel-barre { gap: 8px; }
#hermes-signature .sg-c-qui { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
#hermes-signature .sg-c-qui .mel-av { width: 38px; height: 38px; flex: none; }
#hermes-signature .sg-c-id { min-width: 0; display: grid; line-height: 1.2; }
#hermes-signature .sg-c-id b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature .sg-c-id small { font-size: 12.5px; color: var(--mel-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature .sg-c-fil { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 18px; }
#hermes-signature .sg-c-sq { height: 70px; border: 0; margin: 10px 0; border-radius: 16px; }
#hermes-signature .sg-c-jour { align-self: center; margin: 10px 0 4px; }
#hermes-signature .sg-c-jour span { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--mel-puce); color: var(--mel-doux); }
#hermes-signature .sg-c-msg { display: flex; }
#hermes-signature .sg-c-msg.moi { justify-content: flex-end; }
#hermes-signature .sg-c-bulle { max-width: min(80%, 580px); min-width: 0; padding: 9px 13px 6px; border-radius: 18px; background: var(--mel-carte); border: 1px solid var(--mel-sep); }
#hermes-signature .sg-c-msg.lui .sg-c-bulle { border-bottom-left-radius: 6px; }
#hermes-signature .sg-c-msg.moi .sg-c-bulle { border-bottom-right-radius: 6px; background: var(--mel-accent-fond); }
#hermes-signature .sg-c-objet { display: flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--mel-accent); margin-bottom: 4px; overflow-wrap: anywhere; }
#hermes-signature .sg-c-texte { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.45; }
#hermes-signature .sg-c-texte a { color: var(--mel-accent); }
#hermes-signature .sg-c-vide { color: var(--mel-doux); }
#hermes-signature .sg-c-suite { border: 0; background: none; color: var(--mel-accent); font-weight: 600 !important; font-size: 13.5px !important; padding: 6px 0 0; cursor: pointer; }
#hermes-signature .sg-c-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--mel-doux); font-variant-numeric: tabular-nums; }
#hermes-signature .sg-c-meta svg { width: 13px !important; height: 13px !important; }
#hermes-signature .sg-c-coche { color: var(--mel-accent); display: inline-flex; }
#hermes-signature .sg-c-pj { border: 0; background: none; color: inherit; padding: 0; cursor: pointer; display: inline-flex; }
#hermes-signature .sg-c-consigne .sg-c-bulle { background: none; border-style: dashed; opacity: .85; }
#hermes-signature .sg-c-consigne .sg-c-texte { font-size: 14px; }
#hermes-signature .sg-c-attente .sg-c-bulle { padding: 6px 13px; }
#hermes-signature .sg-c-brouillon .sg-c-bulle { border: 1.5px dashed var(--mel-accent); background: var(--mel-fond); max-width: min(88%, 620px); }
#hermes-signature .sg-c-brouillon .sg-c-objet { margin-bottom: 8px; }
#hermes-signature .sg-c-envoi { opacity: .7; }
#hermes-signature .sg-c-erreur .sg-c-texte { color: var(--mel-rouge); font-size: 14px; }
#hermes-signature .sg-c-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
#hermes-signature .sg-c-actions [data-s="b-jeter"] { width: 38px; padding: 0; }
#hermes-signature .sg-c-saisie { flex: none; display: grid; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--mel-sep); background: var(--mel-fond); }
#hermes-signature .sg-c-modes { display: flex; gap: 6px; }
#hermes-signature .sg-c-modes button { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--mel-puce-bord, var(--mel-sep)); background: none; font-size: 13px !important; font-weight: 600 !important; color: var(--mel-doux); cursor: pointer; }
#hermes-signature .sg-c-modes button .sg-av-mini { margin-right: 0; vertical-align: middle; }
#hermes-signature .sg-c-modes [aria-checked="true"] { background: var(--mel-puce-on); border-color: var(--mel-puce-on-bord); color: var(--mel-puce-on-txt); }
#hermes-signature .sg-c-ligne { display: flex; align-items: flex-end; gap: 8px; }

/* « Désabonné ✓ » dans la liste */
#hermes-signature .mel-cpt.sg-desabo { display: inline-flex; align-items: center; gap: 3px; color: #007a62; background: rgba(0, 168, 142, .12); border-color: rgba(0, 168, 142, .35); }
#hermes-signature:not([data-theme="light"]) .mel-cpt.sg-desabo { color: #4dffd8; background: rgba(77, 255, 216, .1); border-color: rgba(77, 255, 216, .35); }
#hermes-signature .mel-cpt.sg-desabo svg { display: inline-block; width: 12px; height: 12px; stroke-width: 3; }
@media (prefers-reduced-motion: reduce) { #hermes-signature .sg-points i { animation: none; opacity: .7; } }
/* Pièces jointes restées en balises (mail parti sans elles) — 08/10 */
#hermes-signature .sg-c-alerte { margin-top: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .35); color: var(--mel-rouge); font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
