/* Ali Gator · v230 · Images dans l’atelier : survol, sélection, barre d’actions, choix des pages, placement à la souris.
   Retour arrière : retirer atelier-image-v230.css et atelier-image-v230.js d’index.html. */

html:root body .pdf-sheet > .agim-layer{position:absolute;inset:0;z-index:3;pointer-events:none}
html:root body .pdf-sheet.agim-can > canvas{cursor:pointer}
html:root body .agim-layer > .agim-hover{position:absolute;border:1.5px dashed rgba(47,122,74,.85);border-radius:4px;background:rgba(120,176,67,.08);
  box-shadow:0 0 0 3px rgba(120,176,67,.12);animation:agim-fade .14s ease-out both}
html:root body .agim-layer > .agim-frame{position:absolute;border:2px solid #2f7a4a;border-radius:4px;background:rgba(120,176,67,.06);
  box-shadow:0 0 0 4px rgba(120,176,67,.22),0 12px 30px -14px rgba(23,68,47,.5);opacity:0;transform:scale(.97);
  transition:opacity .16s ease,transform .22s cubic-bezier(.2,.8,.2,1)}
html:root body .agim-layer > .agim-frame.is-in{opacity:1;transform:none}
html:root body .agim-layer > .agim-frame::before,
html:root body .agim-layer > .agim-frame::after{content:"";position:absolute;width:7px;height:7px;border:2px solid #2f7a4a;border-radius:2px;background:#fff}
html:root body .agim-layer > .agim-frame::before{left:-5px;top:-5px}
html:root body .agim-layer > .agim-frame::after{right:-5px;bottom:-5px}

/* Barre d’actions au-dessus de l’image */
html:root body > .agim-bar{position:fixed;z-index:90;display:flex;align-items:center;gap:2px;padding:4px;border:1px solid #d8e6d2;border-radius:14px;
  background:rgba(255,255,255,.97);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 14px 34px -14px rgba(23,68,47,.42),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:translateY(5px) scale(.97);transition:opacity .16s ease,transform .22s cubic-bezier(.2,.8,.2,1)}
html:root body > .agim-bar.is-below{transform:translateY(-5px) scale(.97)}
html:root body > .agim-bar.is-in{opacity:1;transform:none}
html:root body > .agim-bar .agim-b{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 12px;border:0;border-radius:10px;background:transparent;
  color:#24533a;font:inherit;font-size:13px;font-weight:650;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,transform .15s ease}
html:root body > .agim-bar .agim-b:hover{background:#eef6e6}
html:root body > .agim-bar .agim-b:active{transform:scale(.97)}
html:root body > .agim-bar .agim-b svg{width:17px;height:17px;flex:none}
html:root body :is(.agim-bar,.agim-hint) .agim-x{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:9px;background:transparent;
  color:#7d8e7d;cursor:pointer;transition:background-color .15s ease,color .15s ease}
html:root body :is(.agim-bar,.agim-hint) .agim-x:hover{background:#f1f5ee;color:#24533a}
html:root body :is(.agim-bar,.agim-hint) .agim-x svg{width:16px;height:16px}

/* Choix des pages */
html:root body > .agim-pop{position:fixed;z-index:91;width:min(320px,calc(100vw - 16px));box-sizing:border-box;padding:14px;border:1px solid #d8e6d2;border-radius:18px;
  background:#fff;box-shadow:0 24px 54px -20px rgba(23,68,47,.48),0 2px 10px rgba(23,68,47,.08);
  font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#26432f;
  opacity:0;transform:translateY(-5px) scale(.98);transition:opacity .16s ease,transform .22s cubic-bezier(.2,.8,.2,1)}
html:root body > .agim-pop.is-in{opacity:1;transform:none}
html:root body > .agim-pop .agim-pop-head strong{display:block;font-size:14px;font-weight:700;letter-spacing:-.01em}
html:root body > .agim-pop .agim-pop-head span{display:block;margin-top:2px;font-size:12px;color:#6b8170}
html:root body > .agim-pop .agim-quick{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 10px}
html:root body > .agim-pop .agim-chip{height:28px;padding:0 11px;border:1px solid #dfeacf;border-radius:999px;background:#f8fbf4;color:#2f5139;font:inherit;
  font-size:12px;font-weight:650;cursor:pointer;transition:background-color .14s ease,border-color .14s ease}
html:root body > .agim-pop .agim-chip:hover{background:#eef6e6;border-color:#cfe0bf}
html:root body > .agim-pop .agim-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:6px;max-height:190px;overflow:auto;padding:2px;
  overscroll-behavior:contain}
html:root body > .agim-pop .agim-page{height:34px;padding:0;border:1px solid #e1eadb;border-radius:10px;background:#fff;color:#2f5139;font:inherit;font-size:13px;
  font-weight:650;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease,transform .14s ease}
html:root body > .agim-pop .agim-page:hover:enabled{border-color:#bcd6ac;transform:translateY(-1px)}
html:root body > .agim-pop .agim-page:active:enabled{transform:scale(.95)}
html:root body > .agim-pop .agim-page.is-on{border-color:#2f7a4a;background:#2f7a4a;color:#fff}
html:root body > .agim-pop .agim-page.is-own{border-style:dashed;color:#a6b4a3;background:#fafcf7;cursor:default}
html:root body > .agim-pop .agim-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
html:root body > .agim-pop .agim-ghostbtn{height:36px;padding:0 14px;border:0;border-radius:11px;background:transparent;color:#56705a;font:inherit;font-size:13px;
  font-weight:650;cursor:pointer;transition:background-color .14s ease}
html:root body > .agim-pop .agim-ghostbtn:hover{background:#f1f5ee}
html:root body > .agim-pop .agim-go{height:36px;padding:0 16px;border:1px solid #255b3b;border-radius:11px;background:linear-gradient(150deg,#357852,#17442f);
  color:#f2ffe0;font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .15s ease,filter .15s ease,opacity .15s ease}
html:root body > .agim-pop .agim-go:hover:enabled{transform:translateY(-1px);filter:brightness(1.06)}
html:root body > .agim-pop .agim-go:active:enabled{transform:scale(.97)}
html:root body > .agim-pop .agim-go:disabled{opacity:.45;cursor:default}

/* Placement : l’image suit la souris */
html:root body.agim-placing .pdf-sheet,
html:root body.agim-placing .pdf-sheet *{cursor:crosshair!important}
html:root body > .agim-ghost{position:fixed;z-index:85;pointer-events:none;box-sizing:border-box;border:2px solid #2f7a4a;border-radius:3px;
  background:rgba(255,255,255,.35) center/100% 100% no-repeat;box-shadow:0 14px 30px -12px rgba(23,68,47,.55);opacity:0;transition:opacity .12s ease}
html:root body > .agim-ghost.is-on{opacity:.92}
html:root body > .agim-ghost.is-snap{border-color:#78b043;box-shadow:0 0 0 4px rgba(120,176,67,.35),0 14px 30px -12px rgba(23,68,47,.55)}
html:root body > .agim-ghost.is-busy{animation:agim-pulse 1s ease-in-out infinite}
html:root body > .agim-hint{position:fixed;left:50%;bottom:22px;z-index:92;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 24px);box-sizing:border-box;
  padding:8px 8px 8px 16px;border:1px solid #d8e6d2;border-radius:16px;background:rgba(255,255,255,.97);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 16px 40px -14px rgba(23,68,47,.35),0 2px 8px rgba(23,68,47,.08);font-family:"Hellix",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  color:#26432f;opacity:0;transform:translate(-50%,10px);transition:opacity .2s ease,transform .26s cubic-bezier(.2,.8,.2,1)}
html:root body > .agim-hint.is-in{opacity:1;transform:translate(-50%,0)}
html:root body > .agim-hint strong{flex:none;font-size:13px;font-weight:700;white-space:nowrap}
html:root body > .agim-hint span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:#5f7864}
html:root body.agim-working{cursor:progress}

@keyframes agim-fade{from{opacity:0}to{opacity:1}}
@keyframes agim-pulse{50%{opacity:.5}}
@media (max-width:700px){
  html:root body > .agim-bar .agim-b span,
  html:root body > .agim-hint span{display:none}
}
@media (prefers-reduced-motion:reduce){
  html:root body :is(.agim-bar,.agim-pop,.agim-hint,.agim-ghost,.agim-layer > *){animation:none!important;transition-duration:.01s!important}
}
