/* Omni-Photo — © 2026 Ferrus Dantioch
   Licence : Creative Commons BY-NC-ND 4.0 (texte complet dans le fichier LICENSE)
   https://creativecommons.org/licenses/by-nc-nd/4.0/ */

/* ============================================================
   OMNI-PHOTO — feuille de style
   Principes appliqués :
   - pensé pour un téléphone en portrait ET une tablette (portrait et paysage)
   - boutons larges (au moins 56 px de haut), toujours une icône ET un texte
   - aucune animation agressive, aucun clignotement
   - le réglage « réduire les animations » du téléphone est respecté
   - aucun blanc pur ni noir pur dans l'interface : pas de lumière forte
   ============================================================ */


/* ---------- 1. Polices ----------
   Rangées DANS l'application : elles marchent hors ligne.
   Toutes sous licence Apache 2.0 (voir LICENCES-TIERS.md).
   Elles servent aux textes ajoutés sur les photos ; Roboto Slab sert
   aussi aux titres de l'application. Le reste de l'interface utilise
   la police du téléphone. */
@font-face { font-family: "Roboto Slab"; src: url("./roboto-slab.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("./roboto-slab-gras.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("./special-elite.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("./permanent-marker.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url("./luckiest-guy.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Coming Soon"; src: url("./coming-soon.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satisfy"; src: url("./satisfy.woff2") format("woff2"); font-weight: 400; font-display: swap; }


/* ---------- 2. Couleurs et formes du thème Omni-système ----------
   Valeurs reprises À L'IDENTIQUE des autres applications de
   l'Omni-système (mêmes noms de variables). Ne pas les « améliorer ». */
:root {
  --fond:        #14111d;   /* « nuit » : encre violette très sombre */
  --surface:     #1d1929;   /* « table » : cartes, panneaux */
  --surface-2:   #251f35;   /* « table haute » : boutons, un cran plus clair */
  --trait:       #332c47;   /* filets et bordures */
  --texte:       #e9e4f2;   /* texte principal, jamais blanc pur */
  --discret:     #a59cbb;   /* texte secondaire */
  --accent:      #a777ff;   /* violet du logo */
  --accent-texte:#140d24;   /* texte posé sur un bouton violet */
  --halo:        #d6c2ff;   /* lueur de l'anneau (focus, liens) */
  --lien:        #d6c2ff;
  --or:          #c9a24a;   /* avertissements */
  --bleu:        #5fb4ff;   /* informations */
  --danger:      #e0705f;   /* actions qui font perdre quelque chose */
  --danger-fond: #3a2027;
  --danger-texte:#e9e4f2;

  --f-titre:     "Roboto Slab", Georgia, serif;
  --f-texte:     system-ui, "Roboto", "Segoe UI", sans-serif;
  --f-chiffres:  ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

  --carte-bord:   1px solid #332c47;
  --carte-lisere: 4px solid #a777ff;
  --rayon-carte:  6px 6px 14px 14px;
  --rayon-bouton: 10px;
  --bord-bouton: color-mix(in srgb, var(--discret) 45%, var(--fond));
  --duree: 400ms;           /* toutes les transitions, volontairement lentes */

  color-scheme: dark;
}


/* ---------- 3. Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--f-texte);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

main {
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.vue-etroite { max-width: 720px; margin: 0 auto; }

h1, h2, h3 { font-family: var(--f-titre); line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h1:focus, h2:focus { outline: none; }
p { margin: 0; }
a { color: var(--lien); text-underline-offset: 3px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--halo); outline-offset: 3px; border-radius: 6px; }
small, .aide { color: var(--discret); font-size: 0.92rem; }
.mono { font-family: var(--f-chiffres); color: var(--discret); font-size: 0.95rem; }

/* Caché à l'œil, mais lu par les lecteurs d'écran */
.invisible {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.chargement { padding: 40px 20px; text-align: center; color: var(--discret); }

.etiquette {
  font-family: var(--f-titre);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--discret);
}

/* Le nom « Omni-Photo » : « -Photo » en violet */
.marque { font-family: var(--f-titre); font-size: 1.9rem; font-weight: 700; }
.marque span { color: var(--accent); }
.marque-petite { font-size: 1.4rem; }

.pile { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.pile.serree { gap: 10px; margin-top: 14px; }
.rangee { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rangee.fin { justify-content: flex-end; margin-top: 16px; }

/* Cartes à la façon du portfolio : liseré violet en haut */
.bloc {
  background: var(--surface);
  border: var(--carte-bord);
  border-top: var(--carte-lisere);
  border-radius: var(--rayon-carte);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bandeau {
  background: var(--surface-2);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--bleu);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}


/* ---------- 4. Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px;
  border: 1.5px solid var(--bord-bouton);
  border-radius: var(--rayon-bouton);
  background: var(--surface-2);
  color: var(--texte);
  font: 600 1rem var(--f-texte);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--duree), border-color var(--duree), opacity var(--duree);
}
.bouton:active { background: var(--trait); }
.bouton:disabled { opacity: 0.4; cursor: default; }
.bouton.large { width: 100%; justify-content: flex-start; padding-left: 18px; }
.bouton.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.bouton.principal:active { background: var(--halo); }
.bouton.discret { background: transparent; }
.bouton.danger { border-color: color-mix(in srgb, var(--danger) 60%, var(--fond)); color: var(--danger); }
.bouton.arme { background: var(--danger-fond); border-color: var(--danger); color: var(--danger-texte); }
.bouton.petit { min-height: 48px; padding: 6px 12px; font-size: 0.95rem; gap: 6px; }
.bouton.retour { min-height: 48px; }

.icone { width: 24px; height: 24px; flex: none; }

/* Bouton « outil » : l'icône au-dessus du texte (barres de l'éditeur) */
.bouton.outil {
  flex-direction: column;
  gap: 2px;
  padding: 6px 4px;
  font-size: 0.86rem;
  line-height: 1.15;
  min-width: 0;
}


/* ---------- 5. Accueil et À propos ---------- */

.entete-accueil { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.entete-accueil img { flex: none; }
.barre { display: flex; align-items: center; gap: 14px; }
.apropos-entete { display: flex; align-items: center; gap: 16px; }
.liste-licences { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.adresse-mail { font-family: var(--f-chiffres); overflow-wrap: anywhere; color: var(--halo); }


/* ---------- 6. L'éditeur ----------
   Téléphone (et tablette en portrait) : la barre en haut, la photo au
   milieu, les réglages en bas. Tablette en paysage : les réglages
   passent à droite de la photo. */

body[data-vue="editeur"] main { padding: 0; max-width: none; }

.vue-editeur {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "barre" "toile" "panneau";
  padding-top: env(safe-area-inset-top);
}

.barre-editeur {
  grid-area: barre;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
}

.zone-toile {
  grid-area: toile;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #100e17;
}
#toile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;      /* les doigts servent au montage, pas au défilement de la page */
  display: block;
}

.panneau {
  grid-area: panneau;
  background: var(--surface);
  border-top: 1px solid var(--trait);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  max-height: 46dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.grille-outils {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.grille-outils.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.grille-outils.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
#fenetre-fond .bandeau { margin-top: 4px; border-left-color: var(--or); }
/* Version 1.1 : les outils en trois onglets, quatre outils par onglet */
.grille-outils.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 6px; }
.onglets {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--fond); border: 1px solid var(--trait);
}
.onglet {
  min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--discret);
  font: 600 0.95rem var(--f-texte); cursor: pointer; touch-action: manipulation;
  transition: background-color var(--duree), color var(--duree);
}
.onglet.actif { background: var(--surface-2); color: var(--texte); box-shadow: inset 0 -3px 0 var(--accent); }
.titre-retouches { margin-top: 10px; }

/* « Voir tout », posé en bas à droite de la photo */
.bouton.voir-tout {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  min-height: 44px;
}
.panneau-outil { display: flex; flex-direction: column; gap: 4px; }
.panneau-outil .choix-groupe { margin-top: 4px; }
.etat-outil { font-weight: 600; color: var(--halo); font-size: 0.95rem; min-height: 1.4em; }
.astuce { margin-top: 8px; font-size: 0.86rem; }

.tete-calque { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.nom-choisi { font-family: var(--f-titre); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reglages-calque { display: flex; flex-direction: column; gap: 2px; }
#btn-modifier-texte { margin-bottom: 4px; min-height: 52px; }

/* Tablette en paysage (ou grand écran) : panneau à droite */
@media (min-width: 900px) and (orientation: landscape) {
  .vue-editeur {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "barre barre" "toile panneau";
  }
  .barre-editeur { grid-template-columns: repeat(4, minmax(0, 150px)); justify-content: start; }
  .panneau { max-height: none; border-top: 0; border-left: 1px solid var(--trait); padding: 14px; }
  .grille-outils { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-outils.trois { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-outils.quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-outils .bouton.outil { flex-direction: row; justify-content: flex-start; gap: 10px; padding-left: 12px; font-size: 0.95rem; }
}

/* Téléphone couché (peu de hauteur) : panneau à droite aussi */
@media (max-height: 500px) and (orientation: landscape) {
  .vue-editeur {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "barre barre" "toile panneau";
  }
  .panneau { max-height: none; border-top: 0; border-left: 1px solid var(--trait); }
  .bouton.outil { min-height: 48px; }
}


/* ---------- 7. Curseurs, choix, couleurs ---------- */

.curseur {
  display: grid;
  grid-template-columns: 5.6em minmax(0, 1fr) 3.6em;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}
.curseur span { font-size: 0.95rem; }
.curseur output { font-family: var(--f-chiffres); font-size: 0.9rem; color: var(--discret); text-align: right; }

input[type="range"] {
  width: 100%;
  height: 44px;
  background: transparent;
  accent-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--trait); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px; margin-top: -11px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--fond);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--trait); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 3px solid var(--fond); }

.choix-groupe { border: 0; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choix-groupe.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choix-groupe.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choix-groupe.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille-choix { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.champ-texte {
  width: 100%; min-height: 52px; padding: 10px 12px; font: 1.1rem var(--f-texte);
  color: var(--texte); background: var(--fond); border: 1.5px solid var(--bord-bouton); border-radius: 10px;
}
.choix-groupe legend { font-size: 0.95rem; color: var(--discret); margin-bottom: 6px; padding: 0; }

/* Un choix = une grande case qu'on touche (le rond radio est caché) */
.choix { position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 6px 8px;
  border: 1.5px solid var(--bord-bouton); border-radius: var(--rayon-bouton);
  background: var(--surface-2); text-align: center; font-weight: 600; font-size: 0.95rem;
  transition: background-color var(--duree), border-color var(--duree);
}
.choix small { font-weight: 400; font-size: 0.8rem; }
.choix input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.choix input:focus-visible + span { outline: 3px solid var(--halo); outline-offset: 2px; }

.grille-polices { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choix-police { position: relative; }
.choix-police input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix-police span {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 4px 8px;
  border: 1.5px solid var(--bord-bouton); border-radius: var(--rayon-bouton);
  background: var(--surface-2); font-size: 1.1rem; text-align: center; line-height: 1.1;
}
.choix-police input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.choix-police input:focus-visible + span { outline: 3px solid var(--halo); outline-offset: 2px; }

.reglage-couleur { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.champ-couleur { display: flex; align-items: center; gap: 12px; }
.champ-couleur input[type="color"] {
  width: 64px; height: 44px; padding: 2px; cursor: pointer;
  border: 1.5px solid var(--bord-bouton); border-radius: 8px; background: var(--surface-2);
}
.nuancier { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.pastille {
  aspect-ratio: 1; min-height: 32px; width: 100%;
  border-radius: 50%; border: 2px solid var(--trait); cursor: pointer; padding: 0;
}

.interrupteur { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; }
.interrupteur input { width: 26px; height: 26px; accent-color: var(--accent); margin: 0; }

.sous-bloc { margin-top: 12px; padding: 6px 12px 10px; border: 1px solid var(--trait); border-radius: 10px; }
.sous-bloc.inactif .reglages-secondaires { opacity: 0.4; pointer-events: none; }
fieldset.inactif { opacity: 0.4; pointer-events: none; }

.champ { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.champ span { font-size: 0.95rem; color: var(--discret); }
textarea {
  width: 100%; min-height: 64px; resize: vertical;
  padding: 10px 12px; font: 1.1rem var(--f-texte);
  color: var(--texte); background: var(--fond);
  border: 1.5px solid var(--bord-bouton); border-radius: 10px;
}


/* ---------- 8. Fenêtres ---------- */

.fenetre {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 18px;
  color: var(--texte);
  background: var(--surface);
  border: var(--carte-bord);
  border-top: var(--carte-lisere);
  border-radius: var(--rayon-carte);
}
.fenetre > .aide { margin-top: 10px; }
.fenetre::backdrop { background: rgba(10, 8, 16, 0.6); }

/* « Feuille » : la fenêtre colle au bas de l'écran et laisse voir la
   photo au-dessus (pour voir le résultat en direct). */
.fenetre.feuille {
  margin: auto auto 0;
  width: min(640px, 100vw);
  max-width: 100vw;
  max-height: 58dvh;
  border-radius: 14px 14px 0 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.fenetre.feuille::backdrop { background: rgba(10, 8, 16, 0.15); }

/* Tablette en paysage : la feuille passe sur le côté droit */
@media (min-width: 900px) and (orientation: landscape) {
  .fenetre.feuille {
    margin: 0 0 0 auto;
    height: 100dvh;
    max-height: 100dvh;
    width: 400px;
    border-radius: 14px 0 0 14px;
  }
}

.tete-fenetre {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: -18px; z-index: 1;
  margin: -18px -18px 8px; padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
}

.liste-calques { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ligne-calque { border: 1px solid var(--trait); border-radius: 10px; padding: 8px; background: var(--fond); display: flex; flex-direction: column; gap: 6px; }
.ligne-calque.choisi { border-color: var(--accent); }
.ligne-calque.masque .nom-calque { opacity: 0.55; }
.nom-calque { width: 100%; justify-content: flex-start; min-height: 50px; overflow: hidden; }
.actions-calque { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.actions-calque .bouton { flex-direction: column; gap: 0; font-size: 0.76rem; padding: 4px 2px; }
.actions-calque .icone { width: 20px; height: 20px; }


/* ---------- 9. Message et « Patiente… » ---------- */

.message {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--bleu);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.message p { flex: 1; font-size: 0.98rem; }
.message[data-type="erreur"] { border-left-color: var(--or); }
/* Dans l'éditeur, le message s'affiche en haut de la photo : en bas, il
   cacherait les boutons du panneau (« Valider »…). */
body[data-vue="editeur"] .message { top: calc(78px + env(safe-area-inset-top)); bottom: auto; }

.patience {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 13, 24, 0.8);
  padding: 24px;
}
.patience-boite {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: var(--carte-bord); border-top: var(--carte-lisere);
  border-radius: var(--rayon-carte); padding: 20px 22px;
}
#patience-texte { font-size: 1.05rem; text-align: center; }
.progression { display: flex; flex-direction: column; gap: 6px; }
.progression-piste { height: 12px; border-radius: 6px; background: var(--trait); overflow: hidden; }
.progression-barre { height: 100%; width: 0; border-radius: 6px; background: var(--accent); transition: width var(--duree) linear; }
#patience-pourcent { text-align: center; }

/* Le message et « Patiente… » sont des « popover » (voir outils.js) :
   on efface les réglages par défaut du navigateur pour ces éléments. */
.message[popover] { top: auto; right: auto; height: auto; margin: 0; overflow: visible; color: var(--texte); }
.patience[popover] { width: auto; height: auto; margin: 0; border: 0; color: var(--texte); }
.patience[popover]::backdrop { background: transparent; }


/* ---------- 10. Moins d'animations si le téléphone le demande ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* ---------- 11. Version 1.1 : « Mes montages » et le guide ---------- */

.liste-montages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.carte-montage { border: 1px solid var(--trait); border-radius: 12px; padding: 8px; background: var(--fond); display: flex; flex-direction: column; gap: 6px; }
.ouvrir-montage {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 6px;
  border: 0; border-radius: 10px; background: transparent; color: var(--texte); text-align: left;
  font: inherit; cursor: pointer; touch-action: manipulation;
}
.ouvrir-montage:active { background: var(--surface-2); }
.vignette {
  flex: none; width: 72px; height: 72px; border-radius: 8px; object-fit: cover;
  background: repeating-conic-gradient(#4a4458 0 25%, #3a3547 0 50%) 0 0 / 16px 16px;
}
.textes-montage { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.textes-montage strong { overflow-wrap: anywhere; }
.carte-montage .actions-calque { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.guide[popover] {
  position: fixed; inset: auto; left: 50%; transform: translateX(-50%); margin: 0;
  width: min(420px, calc(100vw - 24px)); height: auto; overflow: visible;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; color: var(--texte);
  background: var(--surface-2); border: 1px solid var(--trait); border-top: 4px solid var(--accent);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.guide[popover]:not(:popover-open) { display: none; }
.guide-cible { outline: 3px solid var(--halo); outline-offset: 3px; border-radius: 10px; }


/* ---------- 12. Version 1.2 : vérifier, collage ---------- */

.liste-verif { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ligne-verif { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.ligne-verif p { color: var(--discret); font-size: 0.95rem; }
.marque-verif {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 700 1rem var(--f-titre); background: var(--surface-2); border: 1.5px solid var(--trait);
}
.ligne-verif.ok .marque-verif { color: #76c893; border-color: color-mix(in srgb, #76c893 60%, var(--fond)); }
.ligne-verif.attention .marque-verif { color: var(--or); border-color: color-mix(in srgb, var(--or) 60%, var(--fond)); }
.ligne-verif.info .marque-verif { color: var(--bleu); border-color: color-mix(in srgb, var(--bleu) 60%, var(--fond)); }

.apercu-collage {
  display: block; margin: 12px auto 0; max-width: 100%; height: auto;
  border-radius: 8px; border: 1px solid var(--trait);
}
.choix-disposition span { gap: 2px; padding: 6px 4px; }
.mini-disposition rect { fill: currentColor; opacity: 0.55; }
.choix-disposition input:checked + span .mini-disposition rect { opacity: 0.9; }

.grille-modeles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.carte-modele {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  min-height: 150px; padding: 10px 6px; cursor: pointer; touch-action: manipulation;
  border: 1.5px solid var(--bord-bouton); border-radius: var(--rayon-bouton); background: var(--surface-2);
  color: var(--texte); font: 600 0.95rem var(--f-texte);
}
.carte-modele:active { background: var(--trait); }
.apercu-modele { max-width: 100%; height: auto; max-height: 120px; border-radius: 6px; }
@media (min-width: 560px) { .grille-modeles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Version 1.3 ---------- */
.apercu-impression {
  display: block; margin: 12px auto 0; max-width: 100%;
  border-radius: 3px; box-shadow: 0 2px 10px rgba(5, 3, 10, 0.55);
}
#i-qualite { text-align: center; margin-top: 10px; }
#i-qualite.alerte { color: var(--or); }
#fenetre-impression .interrupteur { display: flex; margin-top: 6px; }

/* L'impression (impression.js) : seule la feuille préparée est imprimée.
   Le blanc pur est ici celui du papier, pas de l'interface. */
#impression { display: none; }
@media print {
  html, body {
    margin: 0 !important; padding: 0 !important; background: #fff !important;
    height: auto !important; min-height: 0 !important; overflow: visible !important;
  }
  body > :not(#impression) { display: none !important; }
  #impression { display: block !important; }
  #impression img { display: block; break-inside: avoid; }
}
