/* Modifier un PDF : barre d'outils, réglages, page affichée avec les ajouts (SVG) et leurs poignées. */

.zone.mod-zone-compacte { padding: .8rem 1rem; }
.zone.mod-zone-compacte .trou-zone { display: none; }
.zone.mod-zone-compacte .zone-titre { font-size: 1rem; }

.mod-editeur { display: grid; gap: .9rem; min-width: 0; }
.mod-cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mod-cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barre d'outils : icône + nom, 44 px minimum. */
.mod-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem; }
.mod-outil {
  display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 56px; padding: .35rem .25rem;
  font: inherit; font-size: .8rem; line-height: 1.15; text-align: center; color: var(--texte);
  background: transparent; border: 1px solid var(--bord-fort); border-radius: 10px; cursor: pointer;
}
.mod-outil svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod-outil:hover { border-color: var(--accent); }
.mod-outil[aria-pressed="true"] { background: var(--teinte-accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 650; }
.mod-outil:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mod-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mod-editeur .bouton-secondaire { min-height: 44px; }
.mod-editeur .bouton-secondaire:disabled { opacity: .4; cursor: default; }
.mod-editeur .bouton-secondaire:disabled:hover { border-color: var(--bord-fort); }

/* Réglages de l'élément choisi ou de l'outil. */
.mod-proprietes {
  display: flex; flex-wrap: wrap; align-items: end; gap: .7rem 1rem; padding: .9rem 1rem;
  border: 1px solid var(--bord); border-radius: 12px; min-width: 0;
}
.mod-aide { flex: 1 1 100%; margin: 0; color: var(--texte-doux); font-size: .9rem; }
.mod-large { flex: 1 1 14rem; min-width: 0; }
.mod-etroit { flex: 0 1 6.5rem; }
.mod-proprietes textarea {
  font: inherit; color: var(--texte); background: var(--fond-champ); border: 1px solid var(--bord-fort);
  border-radius: 8px; padding: .55rem .7rem; min-height: 44px; box-sizing: border-box; width: 100%; resize: vertical;
}
.mod-proprietes textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mod-proprietes input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.mod-couleur input[type="color"] {
  width: 56px; height: 44px; padding: 2px; border: 1px solid var(--bord-fort); border-radius: 8px;
  background: var(--fond-champ); cursor: pointer;
}
.mod-couleur input[type="color"]:disabled { opacity: .4; cursor: default; }
.mod-cases { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; min-height: 44px; }

/* Navigation et page */
.mod-barre { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.mod-barre .bouton-icone { width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; }
.mod-numero { min-width: 8.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.mod-consigne { margin: 0; text-align: center; color: var(--texte-doux); font-size: .92rem; }
.mod-consigne:empty { display: none; }
.mod-scene { display: grid; justify-items: center; min-width: 0; }
.mod-feuille { position: relative; max-width: 100%; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); }
.mod-canvas { display: block; width: 100%; height: 100%; }
.mod-dessin { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.mod-texte { white-space: pre; }
.mod-surligne { mix-blend-mode: multiply; }
.mod-calque {
  position: absolute; inset: 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mod-calque.mod-creation { cursor: crosshair; }
.mod-calque.mod-creation .mod-cible { pointer-events: none; }
.mod-compteur { margin: 0; color: var(--texte-doux); font-size: .92rem; text-align: center; }
.mod-compteur:empty { display: none; }

/* Cible de chaque ajout : sélection, déplacement (souris, doigt, clavier). */
.mod-cible { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; }
.mod-cible:hover { outline: 1px dashed rgba(180, 83, 9, .7); }
.mod-cible.choisi { outline: 2px solid #F59E0B; }
.mod-cible:focus { outline: 2px solid #F59E0B; }
.mod-cible:focus:not(:focus-visible):not(.choisi) { outline: none; }
.mod-suppr, .mod-poignee, .mod-bout { display: none; }
.mod-cible.choisi .mod-suppr, .mod-cible.choisi .mod-poignee, .mod-cible.choisi .mod-bout { display: grid; }
.mod-suppr {
  position: absolute; top: -14px; right: -14px; width: 28px; height: 28px; padding: 0; z-index: 2;
  border-radius: 50%; border: 2px solid #fff; background: #B45309; color: #fff;
  font: 700 1rem/1 system-ui, sans-serif; cursor: pointer; place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.mod-suppr:hover, .mod-suppr:focus-visible { background: #DC2626; outline: none; }
.mod-poignee {
  position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; box-sizing: border-box;
  border-radius: 4px; background: #F59E0B; border: 2px solid #fff; cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.mod-bout {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; box-sizing: border-box;
  border-radius: 50%; background: #F59E0B; border: 2px solid #fff; cursor: crosshair;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
@media (pointer: coarse) {
  .mod-suppr { width: 34px; height: 34px; top: -17px; right: -17px; }
  .mod-poignee { width: 26px; height: 26px; right: -13px; bottom: -13px; }
  .mod-bout { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
}

.mod-mention {
  margin: 0; padding: .7rem .9rem; border-left: 3px solid var(--accent); border-radius: 6px;
  background: var(--teinte-accent); font-size: .92rem;
}

@media (max-width: 420px) {
  .mod-outils { grid-template-columns: repeat(3, 1fr); }
}
