/* QG+ — Aperçu HTML en direct (V33, 10/10/2026 ; v2 : taille réglable « − 100 % + », iPhone compris) : voir qg-apercu.js.
   Retour arrière : remettre qg-apercu.css.v1 (ou retirer les lignes qg-apercu de index.html). */

/* Le bloc de code d'origine reste dans le fil, caché : on le lit dans « Code » */
#hermes-signature #hs-feed pre[data-qg-ap] { display: none !important; }

/* ---------- La carte dans la conversation ---------- */
#hermes-signature .qg-ap-carte {
  margin: 10px 0 6px; max-width: 720px; border-radius: 16px; overflow: hidden;
  background: #fff; border: 1px solid rgba(11, 13, 14, .1); box-shadow: 0 12px 30px -20px rgba(11, 13, 14, .4);
}
#hermes-signature .qg-ap-ecran {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; cursor: pointer;
  background: #f5f5f7; outline: none;
}
#hermes-signature .qg-ap-carte[data-type="svg"] .qg-ap-ecran { aspect-ratio: 16 / 8; background: #fff; }
#hermes-signature .qg-ap-ecran:focus-visible { box-shadow: inset 0 0 0 2px #0a84ff; }
#hermes-signature .qg-ap-mini {
  position: absolute; left: 0; top: 0; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0;
  pointer-events: none; background: transparent; opacity: 0; transition: opacity .45s ease;
}
#hermes-signature .qg-ap-carte[data-type="svg"] .qg-ap-mini { width: 100%; height: 100%; transform: none; }
#hermes-signature .qg-ap-mini.est-pret { opacity: 1; }
/* « Ouvrir » apparaît au survol de l'aperçu */
#hermes-signature .qg-ap-ecran::after {
  content: "Ouvrir en grand"; position: absolute; right: 12px; bottom: 12px; padding: 7px 12px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 12.5px; line-height: 1; color: #fff; background: rgba(11, 13, 14, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
@media (hover: hover) { #hermes-signature .qg-ap-ecran:hover::after { opacity: 1; transform: none; } }
#hermes-signature .qg-ap-pied { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid rgba(11, 13, 14, .08); }
#hermes-signature :is(.qg-ap-ic, .qg-ap-pic) {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
}
#hermes-signature :is(.qg-ap-ic, .qg-ap-pic, .qg-ap-btn, .qg-ap-outil) svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#hermes-signature .qg-ap-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
#hermes-signature :is(.qg-ap-titre, .qg-ap-ptitre) { font-weight: 650; font-size: 14px; color: #0b0d0e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature :is(.qg-ap-meta, .qg-ap-pmeta) { font-size: 12px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hermes-signature .qg-ap-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; color: #0b0d0e; background: #fff; border: 1px solid rgba(11, 13, 14, .14);
  transition: transform .15s ease, background .2s ease;
}
#hermes-signature .qg-ap-btn svg { width: 15px; height: 15px; }
#hermes-signature .qg-ap-btn.qg-ap-ouvrir { color: #fff; background: #0b0d0e; border-color: #0b0d0e; }
#hermes-signature .qg-ap-btn:active { transform: scale(.96); }
/* Réponse encore en cours d'écriture : la carte attend, sans aperçu */
#hermes-signature .qg-ap-attente .qg-ap-ecran {
  cursor: default; background: linear-gradient(100deg, #f2f2f5 30%, #fafafc 50%, #f2f2f5 70%) 0 0 / 220% 100%;
  animation: qg-ap-reflet 1.4s linear infinite;
}
#hermes-signature .qg-ap-attente .qg-ap-ecran::after { content: none; }
#hermes-signature .qg-ap-attente .qg-ap-btn { display: none; }
@keyframes qg-ap-reflet { to { background-position: -220% 0; } }
/* Fichiers .html / .svg : ils s'ouvrent en aperçu en direct */
#hermes-signature .qg-pj-doc:is([data-nom$=".html" i], [data-nom$=".htm" i], [data-nom$=".svg" i]) .qg-pj-meta::after { content: " · Aperçu en direct"; color: #0a84ff; font-weight: 600; }

/* ---------- Le grand panneau ---------- */
#hermes-signature .qg-ap-panneau {
  position: fixed; z-index: 10030; top: 84px; right: 16px; bottom: 16px; width: min(56vw, 980px);
  display: none; flex-direction: column; overflow: hidden; border-radius: 18px; outline: none;
  background: #fff; border: 1px solid rgba(11, 13, 14, .1);
  box-shadow: 0 34px 90px -26px rgba(11, 13, 14, .5), 0 0 0 1px rgba(11, 13, 14, .03);
  transition: top .35s cubic-bezier(.2, .8, .2, 1), right .35s cubic-bezier(.2, .8, .2, 1), bottom .35s cubic-bezier(.2, .8, .2, 1), width .35s cubic-bezier(.2, .8, .2, 1), border-radius .35s ease;
}
#hermes-signature .qg-ap-panneau.est-ouvert { display: flex; }
#hermes-signature .qg-ap-panneau.qg-ap-plein { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
#hermes-signature .qg-ap-tete { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid rgba(11, 13, 14, .08); }
#hermes-signature .qg-ap-tt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
#hermes-signature .qg-ap-barre { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
#hermes-signature .qg-ap-seg { flex: 0 0 auto; display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(120, 120, 128, .12); }
#hermes-signature .qg-ap-seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; color: #3a3a3c; transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
#hermes-signature .qg-ap-seg button[aria-pressed="true"] { background: #fff; color: #0b0d0e; box-shadow: 0 1px 4px rgba(11, 13, 14, .16); }
/* La taille réglable « − 100 % + » (ordinateur comme iPhone) */
#hermes-signature .qg-ap-zoom { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 2px; border-radius: 12px; background: rgba(120, 120, 128, .1); }
#hermes-signature .qg-ap-zoom .qg-ap-outil { width: 30px; height: 30px; border-radius: 9px; }
#hermes-signature .qg-ap-pc {
  min-width: 54px; height: 30px; padding: 0 6px; border: 0; border-radius: 9px; cursor: pointer; background: transparent; color: #3a3a3c;
  font-family: inherit; font-weight: 650; font-size: 12.5px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
#hermes-signature .qg-ap-pc:active { transform: scale(.94); }
#hermes-signature .qg-ap-outils { flex: 0 0 auto; display: flex; gap: 2px; }
#hermes-signature .qg-ap-outil {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  color: #3a3a3c; background: transparent; transition: background .2s ease, transform .15s ease, opacity .2s ease;
}
@media (hover: hover) {
  #hermes-signature :is(.qg-ap-outil, .qg-ap-pc):hover { background: rgba(120, 120, 128, .12); }
}
#hermes-signature .qg-ap-outil:active { transform: scale(.92); }
#hermes-signature .qg-ap-outil:disabled { opacity: .32; cursor: default; background: transparent; transform: none; }
#hermes-signature .qg-ap-panneau:not([data-type="svg"]) [data-a="fond"],
#hermes-signature .qg-ap-panneau[data-type="svg"] [data-a="taille"] { display: none; }
#hermes-signature .qg-ap-scene { position: relative; flex: 1 1 auto; min-height: 0; display: flex; background: #f2f2f5; }
/* La boîte centre l'écrin ; l'écrin découpe le cadre, que qg-apercu.js met à l'échelle (zoom, taille téléphone) */
#hermes-signature .qg-ap-boite {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
}
#hermes-signature .qg-ap-ecrin {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff;
  transition: width .4s cubic-bezier(.2, .8, .2, 1), height .4s cubic-bezier(.2, .8, .2, 1), border-radius .4s ease, box-shadow .4s ease;
}
#hermes-signature .qg-ap-panneau[data-type="svg"] .qg-ap-ecrin { background: transparent; }
#hermes-signature .qg-ap-grand {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; transform-origin: 0 0; background: transparent;
  opacity: 0; transition: opacity .35s ease;
}
#hermes-signature .qg-ap-grand.est-pret { opacity: 1; }
/* Au clic sur « − / + » ou « taille téléphone », le cadre glisse vers sa nouvelle taille */
#hermes-signature .qg-ap-zoome .qg-ap-grand {
  transition: opacity .35s ease, transform .4s cubic-bezier(.2, .8, .2, 1), width .4s cubic-bezier(.2, .8, .2, 1), height .4s cubic-bezier(.2, .8, .2, 1), margin .4s cubic-bezier(.2, .8, .2, 1);
}
#hermes-signature .qg-ap-tel .qg-ap-ecrin {
  border-radius: 34px; box-shadow: 0 0 0 9px #0b0d0e, 0 0 0 10px rgba(255, 255, 255, .14), 0 28px 60px -22px rgba(0, 0, 0, .55);
}
#hermes-signature .qg-ap-source {
  display: none; flex: 1 1 auto; min-width: 0; margin: 0; overflow: auto; padding: 16px 18px; white-space: pre; tab-size: 2;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: calc(12.5px * var(--qg-ap-z, 1)); color: #1d1d1f; background: #fbfbfd;
}
#hermes-signature .qg-ap-panneau[data-vue="code"] .qg-ap-boite { display: none; }
#hermes-signature .qg-ap-panneau[data-vue="code"] .qg-ap-source { display: block; }
#hermes-signature .qg-ap-alerte {
  position: absolute; left: 50%; bottom: 16px; z-index: 2; max-width: min(80%, 560px); padding: 9px 14px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.3; color: #fff; background: rgba(11, 13, 14, .86); text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
#hermes-signature .qg-ap-alerte.est-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- iPhone : plein écran, la barre d'outils passe sous le titre ---------- */
@media (max-width: 760px) {
  #hermes-signature .qg-ap-panneau { top: 0; right: 0; bottom: 0; left: 0; width: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  #hermes-signature .qg-ap-tete {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tt x" "barre barre";
    align-items: center; gap: 8px 6px; padding: 8px 8px 8px 14px;
  }
  #hermes-signature .qg-ap-pic { display: none; }
  #hermes-signature .qg-ap-tt { grid-area: tt; }
  #hermes-signature .qg-ap-tete > [data-a="fermer"] { grid-area: x; }
  #hermes-signature .qg-ap-barre { grid-area: barre; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
  #hermes-signature .qg-ap-seg button { padding: 8px 10px; }
  #hermes-signature .qg-ap-zoom .qg-ap-outil { width: 32px; height: 32px; }
  #hermes-signature .qg-ap-pc { min-width: 50px; height: 32px; }
  #hermes-signature .qg-ap-outils .qg-ap-outil { width: 32px; }
  #hermes-signature .qg-ap-panneau :is([data-a="taille"], [data-a="plein"], [data-a="recharger"]) { display: none; }
  #hermes-signature .qg-ap-scene { padding-bottom: env(safe-area-inset-bottom); }
  #hermes-signature .qg-ap-pied { flex-wrap: wrap; }
  #hermes-signature .qg-ap-voircode { display: none; }
  /* Miniature plus lisible : la page est rendue à 143 % puis réduite à 70 % (au lieu de 200 % → 50 %) */
  #hermes-signature .qg-ap-mini { width: 142.857%; height: 142.857%; transform: scale(.7); }
}

/* ---------- Sombre (ambiance Nexus) ---------- */
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-carte {
  background: rgba(2, 14, 12, .74); border-color: rgb(var(--nx, 77 255 216) / .34);
  box-shadow: 0 0 0 1px rgb(var(--nx, 77 255 216) / .06), 0 16px 36px -20px rgba(0, 0, 0, .85), 0 0 26px -12px rgb(var(--nx, 77 255 216) / .45);
}
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-ecran { background: #050b0a; }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-pied { border-top-color: rgb(var(--nx, 77 255 216) / .16); }
#hermes-signature[data-theme]:not([data-theme="light"]) :is(.qg-ap-ic, .qg-ap-pic) {
  color: #021a15; background: linear-gradient(135deg, rgb(var(--nx, 77 255 216)), #00b8d4); box-shadow: 0 0 14px rgb(var(--nx, 77 255 216) / .45);
}
#hermes-signature[data-theme]:not([data-theme="light"]) :is(.qg-ap-titre, .qg-ap-ptitre) { color: #e8fffa; }
#hermes-signature[data-theme]:not([data-theme="light"]) :is(.qg-ap-meta, .qg-ap-pmeta) { color: rgb(var(--nx, 77 255 216) / .68); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-btn { color: rgb(var(--nx, 77 255 216)); background: transparent; border-color: rgb(var(--nx, 77 255 216) / .42); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-btn.qg-ap-ouvrir { color: #021a15; background: rgb(var(--nx, 77 255 216)); border-color: transparent; box-shadow: 0 0 16px rgb(var(--nx, 77 255 216) / .45); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-attente .qg-ap-ecran {
  background: linear-gradient(100deg, #06110f 30%, rgb(var(--nx, 77 255 216) / .1) 50%, #06110f 70%) 0 0 / 220% 100%;
}
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-panneau {
  background: rgba(3, 12, 11, .94); border-color: rgb(var(--nx, 77 255 216) / .42); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgb(var(--nx, 77 255 216) / .08), 0 34px 90px -26px rgba(0, 0, 0, .9), 0 0 40px -18px rgb(var(--nx, 77 255 216) / .5);
}
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-tete { border-bottom-color: rgb(var(--nx, 77 255 216) / .18); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-seg { background: rgb(var(--nx, 77 255 216) / .08); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-seg button { color: rgb(var(--nx, 77 255 216) / .75); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-seg button[aria-pressed="true"] { color: #021a15; background: rgb(var(--nx, 77 255 216)); box-shadow: 0 0 12px rgb(var(--nx, 77 255 216) / .5); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-zoom { background: rgb(var(--nx, 77 255 216) / .08); }
#hermes-signature[data-theme]:not([data-theme="light"]) :is(.qg-ap-outil, .qg-ap-pc) { color: rgb(var(--nx, 77 255 216) / .85); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-pc { color: rgb(var(--nx, 77 255 216)); text-shadow: 0 0 8px rgb(var(--nx, 77 255 216) / .45); }
@media (hover: hover) {
  #hermes-signature[data-theme]:not([data-theme="light"]) :is(.qg-ap-outil, .qg-ap-pc):hover { background: rgb(var(--nx, 77 255 216) / .1); }
}
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-outil:disabled { background: transparent; }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-scene { background: #020807; }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-tel .qg-ap-ecrin {
  box-shadow: 0 0 0 9px #000, 0 0 0 10px rgb(var(--nx, 77 255 216) / .42), 0 0 36px -6px rgb(var(--nx, 77 255 216) / .35), 0 28px 60px -22px rgba(0, 0, 0, .9);
}
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-source { color: #c9fff3; background: #030a09; }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-ap-alerte { color: #021a15; background: rgb(var(--nx, 77 255 216)); }
#hermes-signature[data-theme]:not([data-theme="light"]) .qg-pj-doc:is([data-nom$=".html" i], [data-nom$=".htm" i], [data-nom$=".svg" i]) .qg-pj-meta::after { color: rgb(var(--nx, 77 255 216)); }
@media (prefers-reduced-motion: reduce) {
  #hermes-signature :is(.qg-ap-panneau, .qg-ap-boite, .qg-ap-ecrin, .qg-ap-mini, .qg-ap-grand) { transition: none !important; }
  #hermes-signature .qg-ap-attente .qg-ap-ecran { animation: none; }
}

/* 26/10/2026 (le Général : « attention au bug des boutons en haut ») : dans un panneau étroit, les outils débordaient sous
   la croix (Télécharger et Fermer se chevauchaient, Plein écran coupé). La barre passe à la ligne à droite, la croix reste fixe. */
#hermes-signature .qg-ap-tete { flex-wrap: nowrap; }
#hermes-signature .qg-ap-tt { flex: 1 1 140px; }
#hermes-signature .qg-ap-barre { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
#hermes-signature .qg-ap-tete > [data-a="fermer"] { flex: 0 0 auto; }
