/* Outils PDF, suite : grille de vignettes à glisser (organiser), aperçu de page (numéroter, filigrane, signer), signature. */
.pp-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.pp-page { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pp-glisse .pp-page { transition: transform .2s var(--ease); }
.pp-glisse .pp-page.pp-prise { z-index: 5; transition: none; cursor: grabbing; box-shadow: 0 0 0 2px var(--red), 0 22px 36px -14px rgba(12, 12, 24, .45); }
.pp-glisse, .pp-glisse .ib { cursor: grabbing; }
.pp-vue { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--soft); overflow: hidden; }
.pp-vue canvas { max-width: 86%; max-height: 86%; width: auto; height: auto; box-shadow: 0 0 0 1px var(--line), 0 6px 12px -8px rgba(12, 12, 24, .5); transition: transform .3s var(--ease); pointer-events: none; }
.pp-num { position: absolute; left: 6px; top: 6px; z-index: 1; min-width: 26px; padding: 4px 7px; border-radius: 8px; background: var(--ink); font: 600 13px/1.2 var(--head); color: #fff; text-align: center; }
.pp-acts { display: flex; justify-content: space-between; }
.pp-acts .ib { width: 32px; height: 32px; }

/* Aperçu à gauche, réglages à droite ; sur téléphone l'aperçu passe au-dessus. */
.pp-duo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pp-regl { display: grid; gap: 14px; align-content: start; min-width: 0; }
.pp-apercu { display: grid; gap: 8px; justify-items: center; padding: 14px 14px 8px; border-radius: 14px; background: #e6e7ec; }
.pp-cadre { position: relative; width: 100%; aspect-ratio: 210 / 297; background: #fff; box-shadow: 0 0 0 1px rgba(12, 12, 24, .1), 0 14px 26px -16px rgba(12, 12, 24, .5); }
.pp-feuille { display: block; width: 100%; height: 100%; }
.pp-calque { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pp-couche { position: absolute; inset: 0; }
.pp-nav { display: flex; align-items: center; justify-content: center; gap: 4px; }
.pp-lu { min-width: 9ch; font: 600 14px/1.2 var(--head); color: var(--ink); text-align: center; }

/* Les six emplacements du numéro, cliquables sur la page. */
.pp-zone { position: absolute; min-width: 30px; min-height: 30px; border: 1.5px dashed rgba(12, 12, 24, .32); border-radius: 8px; transform: translate(-50%, -50%); transition: background .2s, border-color .2s; }
.pp-zone:hover { border-color: var(--red); background: rgba(238, 47, 59, .08); }
.pp-zone.on { border: 2px solid var(--red); background: rgba(238, 47, 59, .07); }

/* Signature : l'objet posé sur la page, le cadre pour dessiner, les écritures au choix. */
.pp-sig { position: absolute; border-radius: 4px; outline: 2px dashed var(--red); outline-offset: 3px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pp-sig::before { content: ""; position: absolute; inset: -12px; } /* une petite signature reste facile à attraper au doigt */
.pp-sig.pp-tenue { cursor: grabbing; outline-style: solid; }
.pp-sig:focus-visible { outline-style: solid; box-shadow: 0 0 0 7px rgba(238, 47, 59, .18); }
.pp-sig img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pp-sig-vide { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: rgba(238, 47, 59, .1); font: 600 13px/1.1 var(--head); color: var(--red-deep); text-align: center; white-space: nowrap; }
.pp-poignee { position: absolute; right: -25px; bottom: -25px; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; background: var(--red); box-shadow: 0 4px 10px -3px rgba(12, 12, 24, .5); cursor: nwse-resize; touch-action: none; }
.pp-haut { align-items: center; gap: 10px; }
.pp-signe { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; border: 2px dashed rgba(12, 12, 24, .22); border-radius: 14px; background: #fff; cursor: crosshair; touch-action: none; }
.pp-styles { display: grid; gap: 8px; }
.pp-style { position: relative; display: block; cursor: pointer; }
.pp-style input { position: absolute; opacity: 0; }
.pp-style span { display: block; padding: 6px 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); font-size: 30px; line-height: 1.5; color: #11132b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-style input:checked + span { background: var(--tint); box-shadow: 0 0 0 1.5px rgba(238, 47, 59, .55); }
.pp-style input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.pp-style:nth-child(3) span { font-size: 21px; line-height: 2.1; }

@media (max-width: 760px) {
  .pp-duo { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .pp-apercu { padding: 8px 8px 4px; }
  .pp-grille { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .pp-glisse .pp-page { transition: none; }
}
