/* Ali Gator · Atelier « ergonomie » v245 (10/11/2026).
   Demande de Dali (capture iPhone Duo ouvert, environ 875 px de large) : « faire en sorte que cette page soit beaucoup
   plus ergonomique ». Constat sur sa capture : le PDF n’avait que 340 px (panneau Documents d’un côté, assistant de
   l’autre), la page était rognée à droite, « Exporter » débordait sur l’assistant, le nom et la ligne « Version… »
   étaient coupés, la barre d’outils tenait sur deux lignes, les suggestions de l’assistant étaient coupées et les
   boutons étaient trop petits pour le doigt.
   Ce que fait cette couche (additive : aucun bouton, aucune fonction n’est retirée) :
   1. en-tête du document sur une ligne, rien ne déborde, le nom du fichier prend toute la place libre ;
   2. page ajustée à la largeur à l’ouverture (classe html.agx-fit posée par atelier-ergo-v245.js) ; « + » et « − »
      reprennent la main, le bouton à droite du zoom ré-ajuste ;
   3. fenêtre moyenne (851 à 1100 px) : le panneau Documents devient un volet qui passe par-dessus la page, replié à
      l’ouverture d’un document (bouton à gauche du nom pour l’ouvrir) → le PDF gagne toute la colonne ;
   4. téléphone (850 px et moins) : même repli à l’ouverture ; sous 420 px, où l’app n’avait plus de bouton pour le
      panneau, il revient à gauche du nom ;
   5. assistant : « Mode intelligent » sur une ligne ; écran peu haut : accueil compact, les trois suggestions entières ;
   6. écran tactile : boutons de 38 px au moins, saisie en 16 px (plus de zoom automatique d’iOS quand on tape).
   Fluidité : aucun flou, aucun transform sur le panneau Documents (WebKit, voir sidebar-v224.css) : seule sa largeur
   s’anime, comme avant.
   Technique : tout est dans « @layer gm-patch » (déclaré avant « gm » par moderne-v244.css : il gagne toujours).
   Retour arrière : retirer atelier-ergo-v245.css et atelier-ergo-v245.js d’index.html. */
@layer gm-patch {

/* =====================================================================
   1. EN-TÊTE DU DOCUMENT — une ligne, rien ne déborde
   ===================================================================== */
.workspace .editor-main > .document-heading{flex-wrap:nowrap!important;align-items:center!important}
.workspace .document-heading > .row:first-child{flex:1 1 0!important;min-width:0!important}
.workspace .document-heading > .row + .row{flex:0 0 auto!important;min-width:max-content!important}
.workspace .document-heading .document-name{flex:1 1 0!important;min-width:0!important}
.workspace .document-heading .document-name h1{max-width:none!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.workspace .document-heading .document-name > span{display:block!important;height:auto!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.workspace .document-heading .document-name > span > i{display:inline-block!important;vertical-align:middle!important;margin:-2px 6px 0 0!important}
.workspace .document-heading .document-name > span > .dot-divider{display:inline!important;margin:0 8px!important}
.workspace .document-heading .icon-button{flex:0 0 auto!important}

/* =====================================================================
   2. PAGE AJUSTÉE À LA LARGEUR (html.agx-fit)
   La feuille garde la largeur demandée par le zoom, mais ne dépasse plus la zone : plus de page rognée à droite.
   La vue « Comparer » (deux pages côte à côte) n’est pas touchée.
   ===================================================================== */
html.agx-fit .workspace .pdf-stage:not(.comparison-stage) > .comparison-page{flex-shrink:1!important;min-width:0!important;max-width:100%!important}
html.agx-fit .workspace .pdf-stage:not(.comparison-stage) > .comparison-page > .pdf-sheet{max-width:100%!important}
html.agx-fit .workspace .zoom-value[data-agx-zoom]{font-size:0!important}
html.agx-fit .workspace .zoom-value[data-agx-zoom]::after{content:attr(data-agx-zoom)!important;font-size:12.5px!important}
html.agx-fit .workspace .viewer-controls > button[data-agx-fit]{color:var(--gm-green-3,#0c8259)!important}

/* =====================================================================
   3. ASSISTANT — « Mode intelligent » sur une ligne
   ===================================================================== */
aside.assistant-panel .single-smart-disclosure > strong{min-width:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
@media (max-width:1250px){
  aside.assistant-panel .single-smart.is-enabled .single-smart-disclosure > strong::after{content:"auto"!important}
}

/* =====================================================================
   4. FENÊTRE MOYENNE ET TÉLÉPHONE (1100 px et moins) — barres plus basses, plus de place pour la page
   ===================================================================== */
@media (max-width:1100px){
  .workspace .editor-main > .document-heading{gap:10px!important;padding:9px 12px!important;min-height:60px!important;height:auto!important}
  .workspace .document-heading > .row:first-child{gap:8px!important}
  .workspace .document-heading > .row + .row{gap:4px!important}
  .workspace .document-heading .document-name > span{margin-top:3px!important;font-size:12px!important}
  .workspace .document-heading .export-wrap{margin-left:4px!important}
  .workspace .document-heading .export-wrap > .button{padding:0 13px!important;gap:6px!important}
  .workspace .editor-main > .document-toolbar{padding:8px 10px!important;min-height:54px!important;height:auto!important;row-gap:8px!important}
  .workspace .document-toolbar .view-switch button{padding:6px 9px!important}
  .workspace .document-toolbar .eraser-launch{margin-right:6px!important}
  .workspace .document-toolbar .toolbar-divider{display:none!important}
  .workspace .pdf-stage{padding:18px 14px 28px!important}
}

/* --- 851 à 1100 px : le panneau Documents devient un volet par-dessus la page (seulement quand un document est ouvert) --- */
.workspace > .agx-scrim{display:none!important}
@media (min-width:851px) and (max-width:1100px){
  html.agx-doc .workspace{position:relative!important;--sidebar-width:292px!important}
  html.agx-doc .workspace > .sidebar-frame{position:absolute!important;z-index:60!important;left:14px!important;top:12px!important;bottom:14px!important;
    height:auto!important;max-height:none!important;box-shadow:0 26px 60px -22px rgba(11,20,16,.42),0 3px 10px rgba(11,20,16,.08)!important}
  html.agx-doc .workspace.sidebar-collapsed > .sidebar-frame{box-shadow:none!important}
  html.agx-doc .workspace > .agx-scrim{display:block!important;position:absolute!important;inset:0!important;z-index:55!important;margin:0!important;
    background:rgba(11,20,16,.24)!important;opacity:1!important;transition:opacity .32s ease!important;-webkit-tap-highlight-color:transparent}
  html.agx-doc .workspace.sidebar-collapsed > .agx-scrim{opacity:0!important;pointer-events:none!important}
}

/* --- juste au-dessus de 850 px : « Gomme » en icône pour que la barre d’outils reste sur une ligne --- */
@media (min-width:851px) and (max-width:862px){
  .workspace .document-toolbar .eraser-launch > span{display:none!important}
  .workspace .document-toolbar .eraser-launch{padding:0 11px!important}
}

/* --- petit téléphone (420 px et moins) : l’app n’y affichait plus aucun bouton pour le panneau → il revient à gauche du nom --- */
@media (max-width:420px){
  .workspace .document-heading .collapse-button{display:inline-flex!important}
}
/* --- petit téléphone : « Exporter » en icône, la page presque bord à bord --- */
@media (max-width:560px){
  .workspace .editor-main > .document-heading{padding:8px 10px!important;gap:6px!important}
  .workspace .document-heading > .row:first-child{gap:6px!important}
  .workspace .document-heading > .row + .row{gap:2px!important}
  .workspace .document-heading .export-wrap > .button{font-size:0!important;gap:1px!important;padding:0 12px!important;min-width:0!important}
  .workspace .pdf-stage{padding:14px 10px 24px!important}
}

/* =====================================================================
   5. ÉCRAN PEU HAUT (740 px et moins) — l’accueil de l’assistant tient sans défilement
   ===================================================================== */
@media (max-height:740px) and (min-width:851px){
  aside.assistant-panel .assistant-intro h2{font-size:18px!important;line-height:1.2!important;margin:8px 0 4px!important}
  aside.assistant-panel .assistant-intro p{display:none!important}
  aside.assistant-panel .suggestions{margin-top:10px!important}
}

/* =====================================================================
   6. ÉCRAN TACTILE — de vraies cibles pour le doigt
   ===================================================================== */
@media (pointer:coarse){
  .workspace .document-heading .icon-button{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
  .workspace .document-heading .export-wrap > .button{height:42px!important;min-height:42px!important}
  .workspace .document-toolbar .view-switch{height:auto!important}
  .workspace .document-toolbar .view-switch button{height:34px!important}
  .workspace .document-toolbar .eraser-launch{height:38px!important;min-height:38px!important}
  .workspace .document-toolbar .viewer-controls .icon-button{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}
  .workspace .document-footer{height:52px!important}
  .workspace .document-footer .icon-button{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
  aside.assistant-panel .assistant-tabs > button:not(.active){min-width:44px!important}
  aside.assistant-panel .suggestions button{min-height:42px!important}
  aside.assistant-panel form.composer textarea{font-size:16px!important}
  aside.assistant-panel form.composer .send-button{width:40px!important;height:40px!important}
  aside.assistant-panel .composer-area label:has(> select){height:34px!important}
  aside.assistant-panel .composer-area label > select{height:32px!important;font-size:12.5px!important}
  aside.assistant-panel .composer-tools select{width:152px!important}
  aside.assistant-panel .composer-caption select{width:90px!important}
  aside.assistant-panel .composer-area > .icon-button,aside.assistant-panel .composer-tools > .icon-button{width:34px!important;min-width:34px!important;height:34px!important}
}
@media (pointer:coarse) and (max-width:560px){
  .workspace .document-heading .icon-button{width:36px!important;min-width:36px!important}
}

}
