/* Ali Gator · « Outils PDF » v246 — habillage des éléments ajoutés par outils-pdf-v246.js :
   lignes du menu d’une page, bouton « Ajouter un PDF », entrées du menu Exporter, et fenêtres
   (mot de passe, rognage, formulaire, autres exports). Rien d’existant n’est restylé.
   Polices : titres en Geist, texte en Hellix, comme le reste d’Ali (jetons de moderne-v244.css).
   Retour arrière : retirer outils-pdf-v246.css et outils-pdf-v246.js d’index.html. */

/* ---------- Menu d’une page ---------- */
html:root body > .page-context-menu > .agop-sep{display:block;height:1px;margin:5px 9px;background:var(--gm-line,#dde6dc)}
html:root body > .page-context-menu > button.agop-item > svg{flex:none;width:16px;height:16px;color:var(--gm-green-3,#0c8259)}
html:root body > .page-context-menu[data-agop]{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain}

/* ---------- Barre des pages : ajouter un PDF ---------- */
html:root body .project-sidebar .pages-scroll > .agop-add{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 4px);min-height:40px;margin:12px 2px 4px;padding:8px 10px;
  border:1px dashed var(--gm-line-3,#a5b6a7);border-radius:12px;background:transparent;color:var(--gm-green-2,#14553f);font:600 12.5px/1.2 var(--gm-sans,"Hellix",system-ui,sans-serif);cursor:pointer;
  transition:background .18s ease,border-color .18s ease,transform .18s ease}
html:root body .project-sidebar .pages-scroll > .agop-add:hover{background:var(--gm-green-softer,#edf7ef);border-color:var(--gm-green-3,#0c8259)}
html:root body .project-sidebar .pages-scroll > .agop-add:active{transform:scale(.98)}
html:root body .project-sidebar .pages-scroll > .agop-add:focus-visible{outline:2px solid var(--gm-emerald,#10b27a);outline-offset:2px}
html:root body .project-sidebar .pages-scroll > .agop-add > svg{flex:none;width:16px;height:16px}

/* ---------- Menu Exporter ---------- */
html:root body .export-menu > button.agop-more > svg,html:root body .export-menu > button.agop-fill > svg{flex:none;width:16px;height:16px}
html:root body .export-menu > button.agop-fill[hidden]{display:none!important}

/* ---------- Pendant qu’un outil travaille ---------- */
html.agop-working:root body .thumbnails{opacity:.55;pointer-events:none;transition:opacity .2s ease}
html.agop-working:root,html.agop-working:root body *{cursor:progress}

/* ---------- Fenêtres ---------- */
html:root body > dialog.agop-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:26px 26px 22px;overflow:hidden;
  border:1px solid var(--gm-line,#dde6dc);border-radius:22px;background:var(--gm-surface,#fff);color:var(--gm-ink-2,#2b3a32);
  box-shadow:0 30px 90px -20px rgba(11,20,16,.45),0 4px 14px rgba(11,20,16,.08);font:400 14px/1.5 var(--gm-sans,"Hellix",system-ui,sans-serif)}
html:root body > dialog.agop-dialog[open]{display:flex;flex-direction:column;animation:agop-in .22s cubic-bezier(.2,.8,.2,1) both}
html:root body > dialog.agop-dialog:focus{outline:0}
html:root body > dialog.agop-dialog.is-wide{width:min(580px,calc(100vw - 24px))}
html:root body > dialog.agop-dialog::backdrop{background:rgba(11,20,16,.42);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
html:root body > dialog.agop-dialog > .page-dialog-close{position:absolute;top:14px;right:14px}
html:root body > dialog.agop-dialog > h3{flex:none;margin:0 40px 6px 0;font:600 20px/1.25 var(--gm-title,"Geist",system-ui,sans-serif);letter-spacing:-.01em;color:var(--gm-ink,#0b1410)}
html:root body > dialog.agop-dialog > .agop-lead{flex:none;margin:0 0 4px;color:var(--gm-ink-3,#56675e);line-height:1.5}
html:root body > dialog.agop-dialog > .agop-body{display:block;flex:1 1 auto;min-height:0;margin:14px -6px 0;padding:2px 6px;overflow-y:auto;overscroll-behavior:contain}
html:root body > dialog.agop-dialog > .agop-foot{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:20px}
html:root body > dialog.agop-dialog > .agop-foot > .button{min-height:42px}
html:root body > dialog.agop-dialog.is-busy > .agop-foot > .button{opacity:.6;pointer-events:none}
html:root body > dialog.agop-dialog.is-busy > .agop-foot > .button[aria-busy]{opacity:1}
html:root body > dialog.agop-dialog.is-busy > .agop-foot > .button[aria-busy]::after{content:"";display:inline-block;width:13px;height:13px;margin-left:8px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;vertical-align:-2px;animation:agop-spin .7s linear infinite}
html:root body > dialog.agop-dialog .agop-error{flex:none;margin:12px 0 0;padding:10px 12px;border-radius:12px;background:var(--gm-red-soft,#fdecea);color:var(--gm-red,#b42318);font-weight:600;font-size:13px;line-height:1.45}
html:root body > dialog.agop-dialog .agop-error[hidden]{display:none}
html:root body > dialog.agop-dialog .agop-body > .agop-error{margin:0 0 12px}
html:root body > dialog.agop-dialog .agop-note{margin:12px 0 0;color:var(--gm-ink-3,#56675e);font-size:12.5px;line-height:1.5}

html:root body > dialog.agop-dialog .agop-input{box-sizing:border-box;display:block;width:100%;min-height:44px;margin:0;padding:10px 12px;border:1px solid var(--gm-line-2,#c8d5c8);border-radius:12px;
  background:var(--gm-surface,#fff);color:var(--gm-ink,#0b1410);font:500 14px/1.4 var(--gm-sans,"Hellix",system-ui,sans-serif);transition:border-color .15s ease,box-shadow .15s ease}
html:root body > dialog.agop-dialog textarea.agop-input{min-height:84px;resize:vertical}
html:root body > dialog.agop-dialog .agop-input:focus{outline:0;border-color:var(--gm-emerald,#10b27a);box-shadow:0 0 0 3px rgba(16,178,122,.18)}
html:root body > dialog.agop-dialog .agop-input:disabled{background:var(--gm-sunken,#e8efe7);color:var(--gm-ink-3,#56675e)}
html:root body > dialog.agop-dialog .agop-input::placeholder{color:var(--gm-ink-4,#88978e);font-weight:400}
html:root body > dialog.agop-dialog .agop-check,html:root body > dialog.agop-dialog .agop-radio{display:flex;align-items:center;gap:9px;min-height:36px;margin:6px 0 0;font-size:13.5px;color:var(--gm-ink-2,#2b3a32);cursor:pointer}
html:root body > dialog.agop-dialog .agop-check > input,html:root body > dialog.agop-dialog .agop-radio > input,html:root body > dialog.agop-dialog .agop-kind > input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--gm-green-3,#0c8259)}
html:root body > dialog.agop-dialog .agop-radios{display:flex;flex-direction:column;gap:2px}
html:root body > dialog.agop-dialog .agop-field{display:block;margin:14px 0 0}
html:root body > dialog.agop-dialog .agop-field[hidden]{display:none}
html:root body > dialog.agop-dialog .agop-field > span{display:block;margin:0 0 6px;font-weight:600;font-size:13px;color:var(--gm-ink,#0b1410)}
html:root body > dialog.agop-dialog .agop-field > small{display:block;margin:6px 0 0;color:var(--gm-ink-3,#56675e);font-size:12px;line-height:1.45}

/* Autres exports : choix du type */
html:root body > dialog.agop-dialog .agop-kinds{display:grid;gap:8px}
html:root body > dialog.agop-dialog .agop-kind{display:flex;align-items:center;gap:12px;padding:11px 13px;border:1px solid var(--gm-line,#dde6dc);border-radius:14px;cursor:pointer;transition:border-color .15s ease,background .15s ease}
html:root body > dialog.agop-dialog .agop-kind:hover{background:var(--gm-raise,#f7faf5)}
html:root body > dialog.agop-dialog .agop-kind:has(> input:checked){border-color:var(--gm-green-3,#0c8259);background:var(--gm-green-softer,#edf7ef)}
html:root body > dialog.agop-dialog .agop-kind > span{display:grid;gap:2px;min-width:0}
html:root body > dialog.agop-dialog .agop-kind strong{font:600 14px/1.3 var(--gm-sans,"Hellix",system-ui,sans-serif);color:var(--gm-ink,#0b1410)}
html:root body > dialog.agop-dialog .agop-kind small{font-size:12px;line-height:1.4;color:var(--gm-ink-3,#56675e)}

/* Formulaire */
html:root body > dialog.agop-dialog .agop-form > h4{margin:16px 0 4px;font:600 11.5px/1.2 var(--gm-mono,ui-monospace,monospace);letter-spacing:.08em;text-transform:uppercase;color:var(--gm-ink-4,#88978e)}
html:root body > dialog.agop-dialog .agop-form > h4:first-child{margin-top:0}
html:root body > dialog.agop-dialog .agop-row{display:grid;grid-template-columns:minmax(0,38%) minmax(0,1fr);align-items:start;gap:6px 14px;padding:10px 0;border-top:1px solid var(--gm-line,#dde6dc)}
html:root body > dialog.agop-dialog .agop-form > h4 + .agop-row{border-top:0}
html:root body > dialog.agop-dialog .agop-row > .agop-label{padding-top:11px;font-weight:600;font-size:13.5px;line-height:1.35;color:var(--gm-ink,#0b1410);overflow-wrap:anywhere}
html:root body > dialog.agop-dialog .agop-row > .agop-label > b{color:var(--gm-coral,#f4543f)}
html:root body > dialog.agop-dialog .agop-row > .agop-label > em{font-style:normal;font-weight:400;color:var(--gm-ink-4,#88978e)}
html:root body > dialog.agop-dialog .agop-row > .agop-check,html:root body > dialog.agop-dialog .agop-row > .agop-radios{margin-top:4px}
html:root body > dialog.agop-dialog .agop-row > .agop-note{margin:11px 0 0}
html:root body > dialog.agop-dialog .agop-row.is-off > .agop-label{color:var(--gm-ink-3,#56675e)}

/* Rognage */
html:root body > dialog.agop-dialog .agop-crop{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:18px;align-items:start}
html:root body > dialog.agop-dialog .agop-crop-stage{position:relative;width:100%;max-height:52vh;margin:0 auto;border-radius:6px;background:var(--gm-sunken,#e8efe7);box-shadow:0 0 0 1px var(--gm-line-2,#c8d5c8);overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
html:root body > dialog.agop-dialog .agop-crop-stage > img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none}
html:root body > dialog.agop-dialog .agop-crop-frame{position:absolute;inset:0;border:2px solid var(--gm-emerald,#10b27a);box-shadow:0 0 0 9999px rgba(11,20,16,.5);border-radius:2px}
html:root body > dialog.agop-dialog .agop-grip{position:absolute;display:block;touch-action:none}
html:root body > dialog.agop-dialog .agop-grip::after{content:"";position:absolute;inset:0;margin:auto;border-radius:99px;background:#fff;box-shadow:0 0 0 2px var(--gm-emerald,#10b27a),0 2px 6px rgba(11,20,16,.3)}
html:root body > dialog.agop-dialog .agop-grip.is-top,html:root body > dialog.agop-dialog .agop-grip.is-bottom{left:0;right:0;height:28px;cursor:ns-resize}
html:root body > dialog.agop-dialog .agop-grip.is-left,html:root body > dialog.agop-dialog .agop-grip.is-right{top:0;bottom:0;width:28px;cursor:ew-resize}
html:root body > dialog.agop-dialog .agop-grip.is-top{top:-15px} html:root body > dialog.agop-dialog .agop-grip.is-bottom{bottom:-15px}
html:root body > dialog.agop-dialog .agop-grip.is-left{left:-15px} html:root body > dialog.agop-dialog .agop-grip.is-right{right:-15px}
html:root body > dialog.agop-dialog .agop-grip.is-top::after,html:root body > dialog.agop-dialog .agop-grip.is-bottom::after{width:34px;height:8px}
html:root body > dialog.agop-dialog .agop-grip.is-left::after,html:root body > dialog.agop-dialog .agop-grip.is-right::after{width:8px;height:34px}
html:root body > dialog.agop-dialog .agop-crop-side{display:grid;gap:8px}
html:root body > dialog.agop-dialog .agop-crop-field{display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--gm-ink,#0b1410)}
html:root body > dialog.agop-dialog .agop-crop-field > i{font-style:normal;font-weight:400;color:var(--gm-ink-4,#88978e)}
html:root body > dialog.agop-dialog .agop-crop-size{margin-top:4px}

/* Message de secours (si la couche atelier-direct n’est pas chargée) */
html:root body > .agop-toast{position:fixed;left:50%;bottom:22px;z-index:10050;transform:translateX(-50%);max-width:calc(100vw - 24px);padding:12px 16px;border:1px solid var(--gm-line,#dde6dc);border-radius:16px;background:#fff;
  box-shadow:0 16px 40px -14px rgba(11,20,16,.35);font:500 13px/1.4 var(--gm-sans,"Hellix",system-ui,sans-serif);color:var(--gm-ink-2,#2b3a32)}
html:root body > .agop-toast > strong{display:block;color:var(--gm-ink,#0b1410)}
html:root body > .agop-toast > p{margin:4px 0 0}
html:root body > .agop-toast.is-err{border-color:#f3c4bd}

/* ---------- Écrans étroits ---------- */
@media (max-width:560px){
  html:root body > dialog.agop-dialog{padding:22px 18px 18px;border-radius:20px}
  html:root body > dialog.agop-dialog > h3{font-size:18px}
  html:root body > dialog.agop-dialog .agop-row{grid-template-columns:minmax(0,1fr)}
  html:root body > dialog.agop-dialog .agop-row > .agop-label{padding-top:0}
  html:root body > dialog.agop-dialog .agop-crop{grid-template-columns:minmax(0,1fr)}
  html:root body > dialog.agop-dialog .agop-crop-stage{max-height:38vh;width:auto;max-width:100%}
  html:root body > dialog.agop-dialog .agop-crop-side{grid-template-columns:1fr 1fr}
  html:root body > dialog.agop-dialog .agop-crop-size,html:root body > dialog.agop-dialog .agop-crop-side > .agop-check{grid-column:1 / -1}
  html:root body > dialog.agop-dialog > .agop-foot > .button{flex:1 1 0}
}
@media (pointer:coarse){
  html:root body > dialog.agop-dialog .agop-input{font-size:16px}
  html:root body > .page-context-menu > button.agop-item{min-height:44px}
}
@media (prefers-reduced-motion:reduce){
  html:root body > dialog.agop-dialog[open]{animation:none}
}
@keyframes agop-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes agop-spin{to{transform:rotate(360deg)}}
