/* Ali Gator · v226 · Édition directe dans l’atelier (thème clair).
   Jaune : texte modifié en attente. Orange : bloc à supprimer. Bulle d’édition façon QG+.
   Retour arrière : remettre atelier-direct-v225.css à la place de atelier-direct-v226.css dans index.html. */

html:root body[data-agde-on] .pdf-sheet > svg.zones > rect.zone{cursor:text;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
html:root body .pdf-sheet:has(> .agde-layer){isolation:isolate}
html:root body .pdf-sheet > .agde-layer{position:absolute;inset:0;z-index:3;pointer-events:none;--agde-k:1}
html:root body[data-agde-swap] .pdf-sheet > .pdf-loading{opacity:0!important;transition:none!important}
html:root body > .agde-freeze{position:fixed;z-index:65;overflow:hidden;pointer-events:none;background:#fff;transition:opacity .3s ease}
html:root body > .agde-freeze.is-out{opacity:0}
html:root body > .agde-freeze > :is(canvas,img){position:absolute;inset:0;display:block;width:100%;height:100%}
html:root body > .agde-freeze > .agde-layer{position:absolute;inset:0;z-index:3;pointer-events:none}

/* Marques sur la page */
html:root body .agde-mark{position:absolute;box-sizing:border-box;border-radius:3px;pointer-events:none;
  opacity:0;transform:scale(.97);
  transition:opacity .2s ease,transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .2s ease,background-color .2s ease}
html:root body .agde-mark.is-in{opacity:1;transform:none}
html:root body .agde-mark.is-leaving{opacity:0;transform:scale(.985);transition-duration:.26s}
html:root body .agde-mark > .agde-txt{position:relative;z-index:1;display:block;padding:0 1px;white-space:pre-wrap;
  overflow-wrap:break-word;line-height:1.16;letter-spacing:0;pointer-events:none}
html:root body .agde-mark.is-line > .agde-txt{white-space:pre;overflow-wrap:normal}
html:root body .agde-mark.is-edit{background:var(--agde-bg,#fff);box-shadow:0 0 0 1.5px #e3b100,0 0 0 4px rgba(255,208,0,.2)}
html:root body .agde-mark.is-edit::before{content:"";position:absolute;inset:0;border-radius:inherit;background:rgba(255,218,40,.3)}
html:root body .agde-mark.is-del{background:rgba(255,136,0,.15);box-shadow:0 0 0 1.5px #ee8600,0 0 0 4px rgba(255,136,0,.15)}
html:root body .agde-mark.is-del::after{content:"";position:absolute;left:3px;right:3px;top:50%;height:1.5px;margin-top:-.75px;
  border-radius:2px;background:#e07800}
html:root body .agde-mark.is-active{box-shadow:0 0 0 2px #6e9f4f,0 0 0 5px rgba(150,205,95,.28)}
html:root body .agde-mark.is-active.is-edit::before{background:rgba(255,218,40,.2)}
html:root body .agde-mark.is-problem{box-shadow:0 0 0 1.5px #d4452b,0 0 0 4px rgba(212,69,43,.18)}
html:root body .agde-mark.is-busy{animation:agde-pulse 1s ease-in-out infinite}
@keyframes agde-pulse{50%{opacity:.5}}

/* Bulle d’édition : une seule boîte, texte à gauche, OK rond dans la bulle en bas à droite */
html:root body .agde-ed{position:fixed;left:0;top:0;z-index:2147483000;box-sizing:border-box;display:flex;align-items:flex-end;gap:6px;
  padding:5px 5px 5px 14px;border:1px solid #c0d5b6;border-radius:18px;background:#fff;
  box-shadow:0 18px 44px -14px rgba(23,68,47,.3),0 3px 10px rgba(23,68,47,.08);
  font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  opacity:0;transform:translateY(5px) scale(.985);transform-origin:top left;
  transition:opacity .18s ease,transform .22s cubic-bezier(.2,.8,.2,1),border-color .2s ease,box-shadow .25s ease}
html:root body .agde-ed.is-in{opacity:1;transform:none}
html:root body .agde-ed.is-out{opacity:0;transform:translateY(3px) scale(.99);transition-duration:.15s}
html:root body .agde-ed.is-hidden{visibility:hidden}
html:root body .agde-ed:focus-within{border-color:#719b66;box-shadow:0 0 0 3px rgba(201,226,170,.55),0 18px 44px -14px rgba(23,68,47,.3)}
html:root body:not(#agde) .agde-ed > textarea.agde-ta,html:root body:not(#agde) .agde-ed > textarea.agde-ta:focus,html:root body:not(#agde) .agde-ed > textarea.agde-ta:focus-visible{
  flex:1 1 auto;min-width:0;height:32px;min-height:32px;max-height:176px;margin:0;padding:6px 0;border:0!important;border-radius:0!important;
  outline:0!important;resize:none;background:transparent!important;box-shadow:none!important;font:inherit;font-size:14px;font-weight:450;
  line-height:20px;letter-spacing:-.005em;color:#1d4430;overflow-y:auto;transition:none}
html:root body .agde-ed > .agde-ta::placeholder{color:#8b9a88;opacity:1}
html:root body .agde-ed > .agde-ok{flex:none;position:relative;display:grid;place-items:center;width:32px;height:32px;min-width:32px;padding:0;
  border:0;border-radius:50%;color:#e8ffbd;background:linear-gradient(150deg,#357852,#17442f);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 3px 9px rgba(32,73,45,.24);cursor:pointer;
  opacity:0;transform:scale(.9);visibility:hidden;pointer-events:none;
  transition:opacity .14s ease,transform .14s ease,visibility 0s linear .14s}
html:root body .agde-ed.is-dirty > .agde-ok{opacity:1;transform:none;visibility:visible;pointer-events:auto;transition:opacity .14s ease,transform .14s ease,visibility 0s}
html:root body .agde-ed.is-dirty > .agde-ok:hover{filter:brightness(1.08)}
html:root body .agde-ed.is-dirty > .agde-ok:active{transform:scale(.93);transition-duration:.08s}
html:root body .agde-ed > .agde-ok::before{content:"";position:absolute;inset:-6px;border-radius:50%}
html:root body .agde-ed > .agde-ok svg{width:17px;height:17px;position:relative}
html:root body .agde-ed > .agde-del{flex:none;display:grid;place-items:center;width:32px;height:32px;min-width:32px;padding:0;border:0;border-radius:50%;
  background:transparent;color:#98a698;cursor:pointer;transition:background-color .15s ease,color .15s ease,transform .12s ease}
html:root body .agde-ed > .agde-del:hover{background:#fff1e8;color:#c2410c}
html:root body .agde-ed > .agde-del:active{transform:scale(.92)}
html:root body .agde-ed > .agde-del svg{width:16px;height:16px}

/* Menu du clic droit */
html:root body .agde-menu{position:fixed;z-index:2147483001;box-sizing:border-box;min-width:232px;padding:5px;border:1px solid #d8e6d2;border-radius:14px;
  background:#fff;box-shadow:0 16px 40px -12px rgba(23,68,47,.28),0 2px 8px rgba(23,68,47,.08);
  font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  opacity:0;transform:scale(.96);transform-origin:top left;transition:opacity .14s ease,transform .17s cubic-bezier(.2,.8,.2,1)}
html:root body .agde-menu.is-in{opacity:1;transform:none}
html:root body .agde-menu > .agde-mi{display:flex;align-items:center;gap:10px;width:100%;margin:0;padding:9px 12px;border:0;border-radius:10px;
  background:transparent;color:#1d4430;font:inherit;font-size:13.5px;font-weight:560;line-height:1.3;text-align:left;cursor:pointer;
  transition:background-color .12s ease}
html:root body .agde-menu > .agde-mi:hover,html:root body .agde-menu > .agde-mi:focus-visible{background:#f1f7ea;outline:none}
html:root body .agde-menu > .agde-mi svg{flex:none;width:16px;height:16px}
html:root body .agde-menu > .agde-mi.is-apply{color:#1f5a37}
html:root body .agde-menu > .agde-mi.is-danger{color:#b4441d}
html:root body .agde-menu > .agde-mi.is-danger:hover,html:root body .agde-menu > .agde-mi.is-danger:focus-visible{background:#fff1e8}

/* Barre en haut à droite du document */
html:root body .agde-bar{position:fixed;z-index:70;box-sizing:border-box;display:flex;align-items:center;gap:6px;padding:5px 5px 5px 12px;
  border:1px solid #d8e6d2;border-radius:16px;background:rgba(255,255,255,.95);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 12px 30px -12px rgba(23,68,47,.28),0 2px 6px rgba(23,68,47,.06);
  font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  opacity:0;transform:translateY(-6px);transition:opacity .2s ease,transform .24s cubic-bezier(.2,.8,.2,1)}
html:root body .agde-bar.is-in{opacity:1;transform:none}
html:root body .agde-bar > .agde-n{display:flex;align-items:center;gap:5px;margin-right:4px;white-space:nowrap;font-size:12.5px;font-weight:620;color:#3d5a45}
html:root body .agde-bar > .agde-n > b{font-weight:inherit;margin-left:2px}
html:root body .agde-dot{display:inline-block;width:8px;height:8px;border-radius:50%}
html:root body .agde-dot[hidden]{display:none}
html:root body .agde-dot.is-edit{background:#f2c200;box-shadow:0 0 0 3px rgba(242,194,0,.2)}
html:root body .agde-dot.is-del{background:#f08a00;box-shadow:0 0 0 3px rgba(240,138,0,.18)}
html:root body :is(.agde-bar,.agde-toast) .agde-b{display:inline-flex;align-items:center;gap:6px;height:32px;margin:0;padding:0 13px;border-radius:11px;
  font:inherit;font-size:12.5px;font-weight:650;white-space:nowrap;cursor:pointer;
  transition:background-color .15s ease,transform .15s ease,opacity .15s ease,filter .15s ease}
html:root body :is(.agde-bar,.agde-toast) .agde-b-ghost{border:1px solid #dfe8d8;background:#fff;color:#4c6352}
html:root body :is(.agde-bar,.agde-toast) .agde-b-ghost:hover:enabled{background:#f5f9f1}
html:root body :is(.agde-bar,.agde-toast) .agde-b-main{border:1px solid #255b3b;background:linear-gradient(150deg,#357852,#17442f);color:#f2ffe0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 4px 10px rgba(32,73,45,.2)}
html:root body :is(.agde-bar,.agde-toast) .agde-b-main:hover:enabled{transform:translateY(-1px);filter:brightness(1.06)}
html:root body :is(.agde-bar,.agde-toast) .agde-b:disabled{opacity:.6;cursor:default}
html:root body .agde-bar .agde-ico{display:inline-grid;place-items:center}
html:root body .agde-bar .agde-ico svg{width:15px;height:15px}
html:root body .agde-bar.is-busy .agde-ico svg{animation:agde-spin .8s linear infinite}
@keyframes agde-spin{to{transform:rotate(360deg)}}

/* Messages courts sous la barre */
html:root body .agde-toast{position:fixed;z-index:71;box-sizing:border-box;width:max-content;max-width:min(360px,calc(100vw - 24px));padding:10px 34px 11px 13px;
  border:1px solid #d8e6d2;border-radius:14px;background:#fff;box-shadow:0 14px 34px -14px rgba(23,68,47,.3),0 2px 6px rgba(23,68,47,.06);
  font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-size:12.5px;color:#26432f;
  opacity:0;transform:translateY(-5px);transition:opacity .2s ease,transform .24s cubic-bezier(.2,.8,.2,1)}
html:root body .agde-toast.is-in{opacity:1;transform:none}
html:root body .agde-toast.is-warn{border-color:#efd9a2;background:#fffdf5}
html:root body .agde-toast.is-err{border-color:#efc6b8;background:#fffaf8}
html:root body .agde-toast > strong{display:block;font-size:13px;font-weight:700;line-height:1.35;color:#1d4430}
html:root body .agde-toast > p{margin:3px 0 0;line-height:1.4;color:#56695a;overflow-wrap:anywhere}
html:root body .agde-toast > .agde-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
html:root body .agde-toast > .agde-x{position:absolute;top:6px;right:6px;display:grid;place-items:center;width:24px;height:24px;padding:0;
  border:0;border-radius:8px;background:transparent;color:#7d8e7d;cursor:pointer;transition:background-color .12s ease}
html:root body .agde-toast > .agde-x:hover{background:#f1f5ee}
html:root body .agde-toast > .agde-x svg{width:14px;height:14px}

/* Indication en bas du document */
html:root body .document-footer > span[data-agde-hint]{font-size:0!important}
html:root body .document-footer > span[data-agde-hint] > .shift-hint{display:none}
html:root body .document-footer > span[data-agde-hint]::after{content:"Clic : modifier · Clic droit : supprimer";font-size:var(--agde-fs,12px)}
html:root body .document-footer > span[data-agde-hint="touch"]::after{content:"Touchez : modifier · Appui long : supprimer"}

@media (max-width:760px){
  html:root body .agde-bar > .agde-n > b{display:none}
  html:root body :is(.agde-bar,.agde-toast) .agde-b{padding:0 10px}
  html:root body .agde-ed > .agde-ta{font-size:16px}
}
@media (prefers-reduced-motion:reduce){
  html:root body :is(.agde-mark,.agde-ed,.agde-menu,.agde-bar,.agde-toast,.agde-ok){transition-duration:.01s!important;animation:none!important}
}
