/* DISCOMATON Designer : outil zoetrope (assets/js/zoetrope/). Port de la maquette « La salle claire » (migration/zoetrope-client/maquette/app/css), scopé sous .zoe-ui / .zoe
   pour ne rien changer au reste de la page. Mode « outil » : le disque est la vedette, l'interface s'efface. Un seul moment de mouvement : l'aperçu qui tourne
   (animation transform seule, steps(N), jamais de rotation 3D : tout tourne dans le plan du disque).

   Jetons : mêmes valeurs que css/salle.css du site (papier #f5f3ee = --z-sol, encre #141311 = --z-encre, vert N2 #51cb96 = --z-menthe), écrites ici en toutes lettres
   pour que l'outil soit identique dans le plugin seul (aucun --black/--paper requis). Polices : Archivo et Prata viennent du site (fonts-v3.css, par nom de famille : aucun jeton du site requis) quand elles sont
   chargées ; sinon Montserrat (embarquée par designer.css), puis le système. Accent = --serif du site (Prata). Contrastes mesurés comme la maquette (AA). */

.zoe-ui { container: zoe / inline-size; }   /* la mise en page suit la largeur de la face (modale ou page), pas celle de la fenêtre */

.zoe-ui, .zoe {
  --z-sol: #f5f3ee; --z-sol-2: #ebe8e0; --z-sol-3: #dfdbd1;
  --z-encre: #141311; --z-encre-70: rgba(20, 19, 17, 0.72); --z-encre-45: rgba(20, 19, 17, 0.64); --z-encre-15: rgba(20, 19, 17, 0.14); --z-encre-08: rgba(20, 19, 17, 0.08);
  --z-menthe: #51cb96; --z-menthe-ink: #0b6a42; --z-menthe-lueur: rgba(81, 203, 150, 0.55);
  --z-rouge: #b8322a; --z-off: #cfcbc0;
  --z-sans: "Archivo", "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --z-display: "Archivo", "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --z-serif: "Prata", Georgia, serif;
  --z-ease-out: cubic-bezier(0.23, 1, 0.32, 1); --z-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --z-t-fast: 160ms; --z-t-ui: 240ms; --z-pilule: 999px;
  /* Ambre des alertes : valeurs de css/depot.css (5,3:1 sur le papier en texte). Fonds de bandeau : mêmes mélanges que designer-salle.css. */
  --z-ambre: #8a5a00; --z-ambre-fond: #cf8a14;
  --z-ok-bg: #e7f0e8; --z-warn-bg: #f0e6d4; --z-err-bg: #f0e4de;
  --z-table: var(--z-sol-2);
  --z-haut-h: 56px;
  --z-col: clamp(340px, 38%, 440px);
  --z-marge-disque: clamp(20px, 3.2vw, 44px);
  --z-hauteur-scene: clamp(420px, 62vh, 620px);   /* hauteur du disque + barres (le bloc reste collé en haut pendant qu'on parcourt les étapes) */
  --z-cible: 44px;
  --z-vh: calc((100vh - var(--z-hote-haut, 0px)) / 100);   /* repli : devient 1dvh (hauteur réellement visible, barres du navigateur déduites) là où il existe, voir @supports plus bas */
  /* Marges de sécurité (encoche, coins arrondis, barre d'accueil de l'iPhone) : nulles hors de ces appareils, donc sans effet sur la disposition large */
  --z-si-haut: env(safe-area-inset-top, 0px); --z-si-bas: env(safe-area-inset-bottom, 0px); --z-si-gauche: env(safe-area-inset-left, 0px); --z-si-droite: env(safe-area-inset-right, 0px);
  --z-collant-h: 0px;   /* hauteur du bloc collant : fixée par les dispositions étroites ci-dessous */
}
/* --z-hote-haut : hauteur de ce que l'HÔTE pose au-dessus de l'outil (en-tête du site), à poser par l'hôte sur un ancêtre ; absente = 0. Tout le calcul de hauteur de l'outil passe par --z-vh : il est borné à la hauteur réellement disponible. */
@supports (height: 1dvh) { .zoe-ui, .zoe { --z-vh: calc((100dvh - var(--z-hote-haut, 0px)) / 100); } }
.zoe {
  position: relative;
  font-family: var(--z-sans); font-size: 0.9375rem; line-height: 1.45; font-variant-numeric: tabular-nums;
  color: var(--z-encre); background: var(--z-sol);
  border: 1px solid var(--z-encre-15); border-radius: 14px; overflow: clip;
  accent-color: var(--z-menthe);
  color-scheme: light;
}
:where(.zoe) *, :where(.zoe) *::before, :where(.zoe) *::after { box-sizing: border-box; }
:where(.zoe) :where(button, input, select, textarea) { font-family: inherit; font-size: inherit; color: inherit; }
:where(.zoe) button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:where(.zoe) :where(p, h3, h4, ul, ol, fieldset, figure) { margin: 0; padding: 0; }
:where(.zoe) :where(ul, ol) { list-style: none; }
:where(.zoe) fieldset { border: 0; min-width: 0; margin: 0; padding: 0; }
:where(.zoe) ::selection { background: var(--z-menthe); color: #141311; }
/* Anneau de focus du site (salle.css) : un trait d'encre et un halo menthe (WCAG 1.4.11 : l'encre tient 17:1 sur le papier). */
/* L'attribut hidden doit toujours gagner (les composants ci-dessous donnent un display à des éléments que le code masque avec `hidden`) : comme salle.css du site. */
.zoe [hidden] { display: none !important; }
:where(.zoe) :focus-visible { outline: 2px solid var(--z-encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--z-menthe-lueur); }
:where(.zoe) :focus:not(:focus-visible) { outline: none; }
:where(.zoe) a { color: inherit; }
.zoe .z-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.z-ico { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.z-skip { position: absolute; left: 8px; top: 8px; z-index: 100; padding: 12px 18px; background: var(--z-encre); color: var(--z-sol); border-radius: var(--z-pilule); font-weight: 600; clip-path: inset(50%); white-space: nowrap; }
.z-skip:focus { clip-path: none; }

/* ---------- Mise en page ---------- */
.z-app { display: flex; flex-direction: column; background: var(--z-sol); padding: var(--z-si-haut) var(--z-si-droite) 0 var(--z-si-gauche); }   /* l'hôte ne doit PAS ajouter lui-même ces marges */
.z-haut { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; min-height: var(--z-haut-h); padding: 6px var(--z-gutter, 20px); border-bottom: 1px solid var(--z-encre-15); background: var(--z-sol); }
.z-titre { font-family: var(--z-display); font-weight: 800; font-stretch: 125%; font-size: 1rem; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.01em; }
.z-titre .it { font-family: var(--z-serif); font-weight: 400; font-style: normal; font-stretch: 100%; text-transform: none; font-size: 1.2em; letter-spacing: -0.01em; color: var(--z-encre); }   /* mot d’accent : la police d’accent du site (--z-serif), comme .giant .it de salle.css */
.z-note { flex: 1 1 280px; font-size: 0.8125rem; color: var(--z-encre-70); }
.z-note-bas { display: none; padding: 18px 16px calc(28px + var(--z-si-bas)); font-size: 0.8125rem; color: var(--z-encre-70); border-top: 1px solid var(--z-encre-15); }
.z-lien { display: inline-flex; align-items: center; gap: 8px; min-height: var(--z-cible); padding: 0 6px; font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-decoration-color: var(--z-menthe-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.z-corps { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--z-col); }
.z-scene { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.z-colonne { min-height: 0; border-left: 1px solid var(--z-encre-15); background: var(--z-sol); }
.z-colonne:focus { outline: none; }

/* Large : le disque à gauche (hauteur fixe, collé en haut pendant qu'on parcourt les étapes), les étapes à droite en hauteur naturelle (un seul défilement : celui de la page ou de la modale). Étroit : voir @container plus bas. */
.z-collant { height: var(--z-hauteur-scene); position: sticky; top: var(--z-si-haut); z-index: 20; }
.z-colonne { width: 100%; }

/* Barre de vues + table + transport */
.z-collant { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "vues" "table" "transport"; background: var(--z-sol); }
.z-vues, .z-etabar { grid-area: vues; }
.z-table { grid-area: table; }
.z-transport { grid-area: transport; }

.z-vues { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--z-encre-15); }
.z-opt { position: relative; display: block; }
.z-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: inherit; cursor: pointer; z-index: 1; }
.z-vue-btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--z-cible); padding: 0 16px 0 12px; border: 1px solid var(--z-encre-45); border-radius: var(--z-pilule); font-weight: 600; font-size: 0.875rem; white-space: nowrap; transition: background-color var(--z-t-fast) ease, color var(--z-t-fast) ease, border-color var(--z-t-fast) ease, transform var(--z-t-fast) var(--z-ease-out); }
.z-opt { border-radius: var(--z-pilule); }
.z-opt input:checked + .z-vue-btn { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
.z-opt input:active + .z-vue-btn { transform: scale(0.97); }
.z-vue-btn .z-court { display: none; }
@media (hover: hover) and (pointer: fine) { .z-opt input:not(:checked):hover + .z-vue-btn { background: var(--z-encre-08); } }

/* La table : paper-2, le disque posé dessus */
.z-table { position: relative; min-height: 0; background: var(--z-table); container-type: size; overflow: hidden; --d: calc(min(100cqw, 100cqh) - 2 * var(--z-marge-disque)); }
.z-vue { position: absolute; inset: 0; display: grid; place-items: center; }
.z-vue[hidden], .z-etabli[hidden] { display: none; }
[data-vide="1"] .z-vue { visibility: hidden; }

.z-disc { position: relative; width: var(--d); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--z-sol); }
.z-disc-pose { border-radius: 50%; box-shadow: 0 26px 44px -14px rgba(20, 19, 17, 0.34), 0 3px 8px rgba(20, 19, 17, 0.14); }
.z-disc img, .z-disc canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.z-disc::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2.4%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--z-table); box-shadow: inset 0 0 0 1px var(--z-encre-15); z-index: 2; }
.z-disc.z-sans-trou::after { display: none; }

@keyframes z-tour { to { transform: rotate(360deg); } }
.z-tourne { animation: z-tour var(--duree, 1.8s) steps(var(--n, 54)) infinite; animation-play-state: paused; will-change: transform; }
[data-lecture="1"] .z-tourne { animation-play-state: running; }

/* Gros plan : un quart de disque, centre au coin bas gauche */
.z-quart-pose { filter: drop-shadow(0 22px 28px rgba(20, 19, 17, 0.26)) drop-shadow(0 2px 5px rgba(20, 19, 17, 0.12)); }
.z-quart { position: relative; width: var(--d); aspect-ratio: 1; overflow: hidden; clip-path: circle(100% at 0% 100%); background: var(--z-sol); }
.z-quart img { position: absolute; width: 200%; height: 200%; left: -100%; top: 0; max-width: none; transform-origin: 50% 50%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.z-quart[data-quart="hg"] { clip-path: circle(100% at 100% 100%); }
.z-quart[data-quart="hg"] img { left: 0; top: 0; }
.z-quart[data-quart="bd"] { clip-path: circle(100% at 0% 0%); }
.z-quart[data-quart="bd"] img { left: -100%; top: -100%; }
.z-quart[data-quart="bg"] { clip-path: circle(100% at 100% 0%); }
.z-quart[data-quart="bg"] img { left: 0; top: -100%; }
.z-quart[data-quart="hg"] .z-quart-centre { left: 100%; bottom: 0; }
.z-quart[data-quart="bd"] .z-quart-centre { left: 0; bottom: 100%; translate: -50% 50%; }
.z-quart[data-quart="bg"] .z-quart-centre { left: 100%; bottom: 100%; }
.z-quart-centre { position: absolute; left: 0; bottom: 0; width: 1.6%; aspect-ratio: 1; translate: -50% 50%; border-radius: 50%; background: var(--z-table); z-index: 2; }

/* Téléphone : cadre portrait, disque réduit à ~1000 px */
.z-tel { --hf: min(calc(100cqh - 2 * var(--z-marge-disque)), calc((100cqw - 2 * var(--z-marge-disque)) * 17 / 9)); position: relative; height: var(--hf); width: calc(var(--hf) * 9 / 17); border: 1px solid var(--z-encre-45); border-radius: clamp(14px, calc(var(--hf) * 0.07), 30px); background: var(--z-sol); display: grid; place-items: center; overflow: hidden; }
.z-tel .z-disc { --d: calc(var(--hf) * 9 / 17 - 14px); }

/* Œil nu : image floue fixe + légende */
.z-legende { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; max-width: calc(100% - 32px); padding: 8px 16px; border-radius: var(--z-pilule); background: var(--z-encre); color: var(--z-sol); font-size: 0.8125rem; font-weight: 600; text-align: center; }

/* État vide = écran d'entrée (dcmt15) */
.z-vide { position: absolute; inset: 0; display: none; place-items: center; padding: var(--z-marge-disque); text-align: center; }
[data-entree="1"] .z-vide { display: grid; }   /* dcmt15 : l'état vide est l'écran d'entrée (démonstration animée), plus un cercle en pointillés */
[data-entree="1"][data-mode="etabli"] .z-vide { display: none; }

/* Transport */
.z-transport { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--z-encre-15); }
.z-info { flex: 1; min-width: 0; font-size: 0.8125rem; color: var(--z-encre-70); text-align: right; }
.z-info b { font-weight: 600; color: var(--z-encre); }

/* Zone sous le disque : légende de la vue, banc caméra, diagnostics */
.z-sous { padding: 14px 16px 18px; border-top: 1px solid var(--z-encre-15); font-size: 0.875rem; color: var(--z-encre-70); max-height: 42%; overflow-y: auto; }
.z-sous:empty { display: none; }
[data-vide="1"]:not([data-entree="1"]):not([data-mode="etabli"]) .z-sous { display: none; }   /* dcmt15 : sauf à l'entrée, où la zone porte le texte et les boutons */
.z-phrase:empty { display: none; }
.z-ligne-aide { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.z-ligne-aide .z-aide { flex: 1 1 200px; }
.z-phrase { max-width: 70ch; text-wrap: pretty; }
.z-mouvement-reduit { margin-top: 8px; font-size: 0.8125rem; color: var(--z-encre-70); }

/* ---------- Boutons et commandes ---------- */
.z-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--z-cible); padding: 0 18px; border-radius: var(--z-pilule); border: 1px solid var(--z-encre-45); font-weight: 600; font-size: 0.875rem; line-height: 1; color: var(--z-encre); background: transparent; white-space: nowrap; transition: transform var(--z-t-fast) var(--z-ease-out), background-color var(--z-t-ui) ease, color var(--z-t-ui) ease, border-color var(--z-t-ui) ease; }
.z-btn:active:not(:disabled) { transform: scale(0.97); }
.z-btn-mint { background: var(--z-menthe); border-color: var(--z-menthe); color: #141311; }
.z-btn-encre { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
.z-btn-fort { min-height: 50px; padding: 0 26px; font-size: 0.9375rem; }
.z-btn:disabled, .z-btn[aria-disabled="true"] { background: var(--z-off); border-color: var(--z-off); color: var(--z-encre-45); cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .z-btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
}
.z-puce { display: inline-grid; place-items: center; width: var(--z-cible); height: var(--z-cible); border: 1px solid var(--z-encre-45); border-radius: 50%; color: var(--z-encre); background: transparent; flex: none; transition: transform var(--z-t-fast) var(--z-ease-out), background-color var(--z-t-fast) ease, color var(--z-t-fast) ease, border-color var(--z-t-fast) ease; }
.z-puce:active:not(:disabled) { transform: scale(0.94); }
.z-puce[aria-pressed="true"], .z-puce.z-on { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
.z-puce:disabled { border-color: var(--z-encre-15); color: var(--z-encre-45); opacity: 0.55; cursor: default; }
@media (hover: hover) and (pointer: fine) { .z-puce:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); } }
.z-btn .z-ico { width: 18px; height: 18px; }

/* ---------- Colonne des étapes ---------- */
.z-etape { border-top: 1px solid var(--z-encre-15); }
.z-etape:first-child { border-top: 0; }
.z-etape h3 { font-size: inherit; }
.z-etape-tete { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; width: 100%; min-height: 68px; padding: 12px 20px; text-align: left; transition: background-color var(--z-t-fast) ease; }
@media (hover: hover) and (pointer: fine) { .z-etape-tete:hover { background: var(--z-encre-08); } }
.z-etape-num { font-family: var(--z-display); font-weight: 800; font-stretch: 125%; font-size: 1.125rem; line-height: 1; color: var(--z-encre-70); }
.z-etape.z-ouverte .z-etape-num { color: var(--z-menthe-ink); }
.z-etape-nom { display: block; font-family: var(--z-display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: 0.01em; font-size: 0.9375rem; line-height: 1.1; }
.z-etape-resume { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--z-encre-70); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-etape-etat { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--z-encre-70); }
.z-etape-chev { transition: transform var(--z-t-ui) var(--z-ease-out); }
.z-etape.z-ouverte .z-etape-chev { transform: rotate(180deg); }
.z-etape-corps { padding: 2px 20px 26px 58px; display: grid; gap: 20px; }
.z-etape-corps[hidden] { display: none; }

/* État d'une étape : une forme par état (la couleur seule ne suffit pas) ; 16 px. Le mot (« prêt », « à revoir »…) reste dans .z-mot, lu par le lecteur d'écran. */
.z-lampe { position: relative; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--z-encre-45); flex: none; --g: var(--z-encre-45); }
.z-lampe::before { content: ""; position: absolute; inset: 0; background: var(--g); -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat; }
.z-lampe { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='2.2'/%3E%3C/svg%3E"); }   /* à faire : un point dans un anneau vide */
.z-lampe[data-etat="ok"], .z-lampe[data-etat="auto"] { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.4 8.3l2.5 2.6 4.8-5.4'/%3E%3C/svg%3E"); }   /* coche */
.z-lampe[data-etat="warn"], .z-lampe[data-etat="stale"] { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='black' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M8 4.3v4.4' fill='none'/%3E%3Ccircle cx='8' cy='11.4' r='1.1' stroke='none'/%3E%3C/svg%3E"); }   /* point d'exclamation */
.z-lampe[data-etat="err"] { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6'/%3E%3C/svg%3E"); }   /* croix */
.z-lampe[data-etat="ok"] { background: var(--z-menthe); box-shadow: inset 0 0 0 1.5px var(--z-menthe-ink); --g: var(--z-encre); }
.z-lampe[data-etat="warn"], .z-lampe[data-etat="stale"] { background: var(--z-ambre-fond); box-shadow: inset 0 0 0 1.5px var(--z-ambre); --g: var(--z-encre); }
.z-lampe[data-etat="err"] { background: var(--z-rouge); box-shadow: inset 0 0 0 1.5px var(--z-rouge); --g: #fff; }
.z-lampe[data-etat="auto"] { background: transparent; box-shadow: inset 0 0 0 2px var(--z-menthe-ink); --g: var(--z-menthe-ink); }   /* réglé automatiquement : coche dans un anneau creux, distinct du « prêt » plein */

.z-aide { font-size: 0.8125rem; color: var(--z-encre-70); text-wrap: pretty; max-width: 60ch; }
.z-groupe { display: grid; gap: 10px; }
.z-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--z-encre-70); }
legend.z-label { padding: 0; margin-bottom: 10px; }

/* Tuiles de choix (radios) */
.z-tuiles { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
.z-tuile { position: relative; border-radius: 12px; }
.z-tuile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: inherit; cursor: pointer; z-index: 1; }
.z-tuile-corps { display: grid; align-content: center; gap: 2px; min-height: 56px; padding: 9px 14px; border: 1px solid var(--z-encre-45); border-radius: inherit; background: transparent; transition: background-color var(--z-t-fast) ease, color var(--z-t-fast) ease, border-color var(--z-t-fast) ease; }
.z-tuile-corps b { font-weight: 700; font-size: 0.9375rem; line-height: 1.15; }
.z-tuile-corps small { font-size: 0.75rem; color: var(--z-encre-70); line-height: 1.3; }
.z-tuile input:checked + .z-tuile-corps { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
.z-tuile input:checked + .z-tuile-corps small { color: rgba(245, 243, 238, 0.78); }
.z-tuile input:disabled + .z-tuile-corps { opacity: 0.5; }
@media (hover: hover) and (pointer: fine) { .z-tuile input:not(:checked):not(:disabled):hover + .z-tuile-corps { background: var(--z-encre-08); } }
.z-tuile-avec-icone .z-tuile-corps { grid-template-columns: 24px minmax(0, 1fr); align-items: center; column-gap: 10px; }
.z-tuile-avec-icone .z-ico { grid-row: 1 / span 2; }
.z-tuile-avec-icone .z-tuile-corps b, .z-tuile-avec-icone .z-tuile-corps small { grid-column: 2; }

/* Pastilles de format : le rectangle montre le rapport */
.z-format { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 88px; }
.z-format .z-rect { display: block; width: calc(30px * var(--rl)); height: calc(30px * var(--rh)); border: 1.5px solid currentColor; border-radius: 3px; }
.z-format b { font-size: 0.8125rem; }
.z-tuile-corps.z-format small { text-align: center; }
.z-tuile-corps.z-format { padding: 10px 6px; }

/* Réglage : libellé, valeur, − curseur + */
.z-reglage { display: grid; gap: 4px; }
.z-reglage-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.z-reglage-tete label { font-weight: 600; font-size: 0.875rem; }
.z-reglage-tete output { font-weight: 600; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.z-reglage-corps { display: grid; grid-template-columns: var(--z-cible) minmax(0, 1fr) var(--z-cible); align-items: center; gap: 4px; }
.z-mini { display: grid; place-items: center; width: var(--z-cible); height: var(--z-cible); border-radius: 50%; border: 1px solid var(--z-encre-45); background: transparent; transition: background-color var(--z-t-fast) ease, color var(--z-t-fast) ease; }
.z-mini .z-ico { width: 16px; height: 16px; }
.z-mini:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) and (pointer: fine) { .z-mini:hover:not(:disabled) { background: var(--z-encre); color: var(--z-sol); border-color: var(--z-encre); } }

input[type="range"].z-curseur { -webkit-appearance: none; appearance: none; width: 100%; height: var(--z-cible); margin: 0; background: transparent; cursor: pointer; --p: 50%; }
input[type="range"].z-curseur::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--z-encre) var(--p), var(--z-encre-15) var(--p)); }
input[type="range"].z-curseur::-moz-range-track { height: 4px; border-radius: 2px; background: var(--z-encre-15); }
input[type="range"].z-curseur::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--z-encre); }
input[type="range"].z-curseur::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--z-sol); border: 2px solid var(--z-encre); transition: transform var(--z-t-fast) var(--z-ease-out); }
input[type="range"].z-curseur::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--z-sol); border: 2px solid var(--z-encre); }
input[type="range"].z-curseur:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"].z-curseur:focus-visible { outline-offset: -4px; border-radius: var(--z-pilule); }
input[type="range"].z-curseur.z-bipolaire { --p: 50%; }

/* Interrupteur */
.z-bascule { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: var(--z-cible); cursor: pointer; }
.z-bascule > span { display: grid; gap: 2px; }
.z-bascule b { font-weight: 600; font-size: 0.875rem; }
.z-bascule small { font-size: 0.8125rem; color: var(--z-encre-70); }
.z-bascule input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: var(--z-cible); margin: 0; border: 0; border-radius: var(--z-pilule); background: transparent; cursor: pointer; }
.z-bascule input::before { content: ""; position: absolute; left: 0; top: 8px; width: 48px; height: 28px; box-sizing: border-box; border-radius: var(--z-pilule); border: 1px solid var(--z-encre-45); background: var(--z-sol-2); transition: background-color var(--z-t-ui) ease, border-color var(--z-t-ui) ease; }
.z-bascule input::after { content: ""; position: absolute; left: 4px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--z-encre-45); transition: transform var(--z-t-ui) var(--z-ease-out), background-color var(--z-t-ui) ease; }
.z-bascule input:checked::before { background: var(--z-menthe); border-color: var(--z-encre); }
.z-bascule input:checked::after { transform: translateX(20px); background: var(--z-encre); }

/* Sources (tuiles avec vignette) */
.z-source .z-tuile-corps { grid-template-columns: 48px minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 68px; padding: 10px 12px; }
.z-source .z-vignette { grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--z-sol-3); }
.z-source .z-tuile-corps b, .z-source .z-tuile-corps small { grid-column: 2; }
.z-source .z-ico-vignette { grid-row: 1 / span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; border: 1px dashed currentColor; }
.z-depot { display: grid; gap: 10px; justify-items: start; padding: 14px; border: 1px dashed var(--z-encre-45); border-radius: 12px; transition: background-color var(--z-t-fast) ease, border-color var(--z-t-fast) ease; }
.z-depot p { font-size: 0.8125rem; color: var(--z-encre-70); }
/* images déjà chargées : la zone de dépôt n'est plus qu'un bouton « Ajouter des images » (le glisser-déposer reste ouvert sur tout l'outil) */
.z-depot.z-depot-compact { padding: 0; border: 0; background: none; border-radius: 0; }
.z-depot.z-depot-compact p { display: none; }
.z-depot.z-survol, .z-app.z-survol .z-table { background: var(--z-sol); }
.z-depot.z-survol { border-color: var(--z-encre); border-style: solid; }
.z-app.z-survol .z-table::after { content: ""; position: absolute; inset: 10px; border: 2px dashed var(--z-encre); border-radius: 12px; pointer-events: none; }

/* Liste d’images du maintien */
.z-images { display: grid; gap: 6px; }
.z-image { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--z-encre-15); border-radius: 12px; }
.z-image img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--z-sol-2); }
.z-image-nom { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-image-actions { display: flex; }
.z-image-actions .z-mini { border-color: transparent; }

/* Avis : une ligne = une information (jamais une carte) */
.z-avis { display: grid; gap: 8px; }
.z-avis:empty { display: none; }
.z-avis-ligne { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 14px; border: 1px solid var(--z-encre-15); border-radius: 12px; font-size: 0.875rem; color: var(--z-encre); }
.z-avis-ligne .z-ico { margin-top: 1px; }
.z-avis-ligne[data-niveau="ok"] { background: var(--z-ok-bg); border-color: rgba(64, 206, 157, 0.55); }
.z-avis-ligne[data-niveau="ok"] .z-ico { color: #127050; }
.z-avis-ligne[data-niveau="info"] { background: var(--z-sol-2); }
.z-avis-ligne[data-niveau="warn"] { background: var(--z-warn-bg); border-color: rgba(207, 138, 20, 0.6); }
.z-avis-ligne[data-niveau="warn"] .z-ico { color: var(--z-ambre); }
.z-avis-ligne[data-niveau="err"] { background: var(--z-err-bg); border-color: rgba(184, 50, 42, 0.45); }
.z-avis-ligne[data-niveau="err"] .z-ico { color: var(--z-rouge); }
.z-avis-corps { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.z-avis-corps p { text-wrap: pretty; }
.z-mesure { font-size: 0.8125rem; color: var(--z-encre-70); }
.z-avis .z-btn { min-height: var(--z-cible); }
.z-avis-ligne .z-btn { font-size: 0.8125rem; }

/* Puces de couleur */
.z-teintes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.z-teinte { position: relative; width: var(--z-cible); height: var(--z-cible); border-radius: 50%; }
.z-teinte input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 50%; cursor: pointer; z-index: 1; }
.z-teinte i { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px var(--z-encre-45); }
.z-teinte input:checked + i { box-shadow: inset 0 0 0 1px var(--z-encre-45), 0 0 0 2px var(--z-sol), 0 0 0 4px var(--z-encre); }
.z-teinte-libre { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--z-cible); padding: 0 16px 0 0; border: 1px solid var(--z-encre-45); border-radius: var(--z-pilule); font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.z-teinte-libre input[type="color"] { width: var(--z-cible); height: var(--z-cible); padding: 5px; border: 0; background: none; cursor: pointer; }
.z-teinte-libre input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.z-teinte-libre input[type="color"]::-webkit-color-swatch { border: 1px solid var(--z-encre-45); border-radius: 50%; }
.z-teinte-libre input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.z-teinte-libre { border-radius: var(--z-pilule); }
.z-teinte-libre:focus-within { outline: 2px solid var(--z-encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--z-menthe-lueur); }
.z-teinte-libre input:focus-visible { outline: none; box-shadow: none; }

/* Fichier d’impression */
.z-prog { height: 4px; border-radius: 2px; background: var(--z-off); overflow: hidden; position: relative; }
.z-prog::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; background: var(--z-menthe-ink); animation: z-prog 1.1s var(--z-ease-in-out) infinite; }
@keyframes z-prog { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.z-resultat { display: grid; gap: 12px; justify-items: start; }
.z-champ { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--z-encre-45); border-radius: var(--z-pilule); background: #fff; }

/* Banc de la caméra virtuelle */
.z-banc { display: grid; gap: 14px; max-width: 760px; }
.z-banc-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; align-items: start; }
.z-cadences { display: flex; flex-wrap: wrap; gap: 6px; }
.z-cadence { position: relative; border-radius: var(--z-pilule); }
.z-cadence input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: inherit; cursor: pointer; z-index: 1; }
.z-cadence span { display: grid; place-items: center; min-width: 54px; min-height: var(--z-cible); padding: 0 12px; border: 1px solid var(--z-encre-45); border-radius: inherit; font-weight: 600; font-size: 0.875rem; transition: background-color var(--z-t-fast) ease, color var(--z-t-fast) ease; }
.z-cadence input:checked + span { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }
@media (hover: hover) and (pointer: fine) { .z-cadence input:not(:checked):hover + span { background: var(--z-encre-08); } }
.z-banc .z-reglage-tete label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--z-encre-70); }

/* ---------- Mobile : disque collant en haut, étapes en accordéon dessous ---------- */
@container zoe (max-width: 760px) {
  .zoe { --z-col: 100%; --z-marge-disque: 14px; --z-collant-h: min(45 * var(--z-vh), 420px); }   /* le bloc collant : au plus 45 % de la hauteur visible */
  .z-app { height: auto; }
  .z-haut { padding: 4px 16px; gap: 0 12px; flex-wrap: nowrap; }
  .z-titre { font-size: 0.8125rem; flex: 1; min-width: 0; }
  .z-note { display: none; }
  .z-note-bas { display: block; }
  .z-raz-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .z-raz { width: var(--z-cible); justify-content: center; padding: 0; text-decoration: none; }   /* seulement le bouton « tout remettre à zéro » : les autres .z-lien gardent leur libellé */
  .z-corps { display: block; }
  /* Marge de sécurité haute (encoche) : le collant se fige SOUS cette bande ; sans cache, les étapes y défilent à la vue. Un cache collant à 0, de la hauteur de la marge, la recouvre (zéro encombrement : il remonte dans le padding de .z-app). */
  .z-app::before { content: ""; display: block; flex: none; position: sticky; top: 0; z-index: 21; height: var(--z-si-haut); margin-top: calc(-1 * var(--z-si-haut)); background: var(--z-sol); pointer-events: none; }
  .z-scene { display: contents; }   /* le bloc collant doit avoir .z-corps pour parent, sinon il quitte l’écran avec .z-scene */
  .z-collant { position: sticky; top: var(--z-si-haut); z-index: 20; height: var(--z-collant-h); grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: "table" "vues"; border-bottom: 1px solid var(--z-encre-15); }
  .z-vues { flex-wrap: nowrap; justify-content: space-between; align-items: stretch; gap: 4px; padding: 6px 12px; border-bottom: 0; border-top: 1px solid var(--z-encre-15); }
  .z-opt { flex: 1 1 0; min-width: 0; max-width: 72px; }
  .z-vue-btn { width: 100%; min-height: 52px; padding: 4px 2px; flex-direction: column; justify-content: center; gap: 2px; border-radius: 14px; }   /* dcmt15 : un libellé court sous chaque icône */
  .z-vue-btn .z-long { display: none; }
  .z-vue-btn .z-court { display: block; font-size: 0.75rem; line-height: 1.1; font-weight: 600; white-space: nowrap; }
  .z-etabar { border-top: 1px solid var(--z-encre-15); }
  /* Lancer : dans le coin bas droit de la table (même case de la grille), à la même place dans toutes les vues */
  .z-transport { grid-area: table; justify-self: end; align-self: end; margin: 0 10px 10px 0; padding: 0; border-top: 0; background: none; position: relative; z-index: 2; }
  .z-app[data-mode="etabli"] .z-transport { display: none; }
  .z-transport .z-info, .z-transport .z-secondaire { display: none; }
  .z-transport .z-btn-lancer span { display: none; }
  .z-transport .z-btn-lancer { width: var(--z-cible); padding: 0; }
  .z-sous { max-height: none; padding: 14px 16px; border-top: 0; }
  .z-colonne { border-left: 0; border-top: 1px solid var(--z-encre-15); }
  .z-etape-tete { padding: 12px 16px; }
  .z-etape-corps { padding: 2px 16px 24px 16px; }
  .z-etape-ajuster { padding: 0 16px 14px 16px; }
  .z-etape { scroll-margin-top: calc(var(--z-collant-h) + var(--z-si-haut)); }   /* repli ; le calage exact est mesuré par etapes.js */
  .z-colonne :is(button, input, summary, a, select) { scroll-margin-top: calc(var(--z-collant-h) + var(--z-si-haut) + 8px); }   /* le clavier ne laisse pas un contrôle sous le disque collant */
  .z-etape-etat .z-mot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* masqué à l'œil, lu par le lecteur d'écran (display:none le retirait aussi de l'arbre d'accessibilité) */
  .z-banc-grille { grid-template-columns: 1fr; }
  .z-legende { bottom: 8px; font-size: 0.75rem; padding: 6px 12px; }
}

@container zoe (min-width: 761px) and (max-width: 1080px) {
  .z-vue-btn { padding: 0 12px 0 10px; }
  .z-vue-btn .z-long { display: none; }
  .z-vue-btn .z-court { display: inline; }
}

/* ---------- dcmt15 ---------- */
/* Écran d'entrée : sans image, ni barre de vues ni transport (rien à regarder que la démonstration) ; le texte et les boutons sont sous la scène. */
[data-entree="1"] .z-vues, [data-entree="1"] .z-transport { display: none; }
[data-entree="1"] .z-zone-vue { display: none; }
@container zoe (min-width: 761px) { [data-entree="1"] .z-collant { height: clamp(300px, 42vh, 440px); } }   /* à l'entrée le disque cède de la place : les boutons restent dans le 1er écran */
.z-entree { display: none; }
[data-entree="1"] .z-entree { display: grid; gap: 18px; }
[data-entree="1"] .z-sous { max-height: none; color: var(--z-encre); }
.z-entree-texte { display: grid; gap: 6px; }
.z-entree-phrase { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; text-wrap: balance; max-width: 46ch; }
.z-entree-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.z-entree-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.8125rem; color: var(--z-encre-70); }
.z-entree-legende { margin: 0; }
.z-entree-lecture { min-height: var(--z-cible); font-size: 0.8125rem; }
.z-entree-conseils { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--z-encre-15); }
.z-entree-conseils ul { display: grid; gap: 4px; padding-left: 1.1em; list-style: disc; font-size: 0.875rem; color: var(--z-encre); }
.z-entree-conseils li::marker { color: var(--z-menthe-ink); }
/* Étapes réglées automatiquement : une pastille creuse (anneau vert), distincte du plein « prêt » ; un seul bouton « Ajuster » */
.z-etape-ajuster { padding: 0 20px 14px 58px; margin-top: -4px; }
.z-etape-ajuster .z-btn { min-height: var(--z-cible); }
.z-detail { font-size: 0.8125rem; color: var(--z-encre-70); }
.z-detail summary { display: inline-flex; align-items: center; min-height: var(--z-cible); cursor: pointer; text-decoration: underline; text-decoration-color: var(--z-menthe-ink); text-underline-offset: 3px; }
.z-detail .z-mesure { margin-top: 2px; }
.z-phrase-figure { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; text-wrap: pretty; max-width: 52ch; }
.z-phrase-figure:empty { display: none; }
/* Pied de Vérifications : la case des droits + l'état du fichier d'impression */
.z-fichier-auto { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--z-encre-15); }
.z-fichier-statut { display: grid; gap: 8px; }
.z-fichier-statut:empty { display: none; }
.z-fichier-statut > p { display: block; }
.z-fichier-detail { margin-top: -4px; }
/* Zone « Fichier d'impression » : cachée tant que rien n'est composé (elle garde sa largeur : le canvas du plugin se mesure à son montage) */

@media (prefers-reduced-motion: reduce) {
  .zoe *, .zoe *::before, .zoe *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .z-prog::after { animation: none; width: 100%; }
}

/* L’établi de détourage : l’image en grand sur damier (ou sur la couleur du fond du disque), pipette, pinceau, comparaison.
   Même monde que zoe.css. L’anneau de focus est celui de salle.css (encre + halo menthe). */

.z-etabli { position: absolute; inset: 0; }
.z-etabli-vue { position: absolute; inset: 0; overflow: hidden; cursor: crosshair; background: var(--z-table); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.z-etabli-vue:focus-visible { outline-offset: -6px; }
.z-etabli-vue[data-outil="main"] { cursor: grab; }
.z-etabli-vue[data-outil="main"].z-saisi { cursor: grabbing; }
.z-etabli-vue[data-outil="effacer"], .z-etabli-vue[data-outil="restaurer"] { cursor: none; }

/* Le plan est transformé (déplacement + zoom) ; le damier garde sa taille à l’écran grâce à --zoom */
.z-plan { position: absolute; left: 0; top: 0; transform-origin: 0 0; --zoom: 1; --fond: #fff; outline: calc(1px / var(--zoom)) solid var(--z-encre-45); will-change: transform; }
.z-plan, .z-plan canvas { touch-action: none; }   /* le doigt dessine ou pince sur l’image seulement : autour, la page défile */
.z-plan canvas { display: block; width: 100%; height: 100%; max-width: none; image-rendering: auto; }
.z-etabli[data-fond="damier"] .z-plan { background-color: #f5f3ee; background-image: conic-gradient(#dcd8cd 25%, transparent 0 50%, #dcd8cd 0 75%, transparent 0); background-size: calc(20px / var(--zoom)) calc(20px / var(--zoom)); }
.z-etabli[data-fond="disque"] .z-plan { background: var(--fond); }

/* Pinceau : deux traits (encre puis papier) pour rester lisible sur toutes les teintes. Effacer = trait plein ; restaurer = pointillé. */
.z-anneau { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; border: 1.5px solid var(--z-encre); box-shadow: 0 0 0 1.5px rgba(245, 243, 238, 0.95), inset 0 0 0 1.5px rgba(245, 243, 238, 0.95); display: none; z-index: 3; }
.z-anneau[data-mode="restaurer"] { border-style: dashed; }
.z-anneau[data-mode="pipette"] { border-radius: 2px; }
.z-anneau.z-visible { display: block; }
.z-anneau::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--z-encre); box-shadow: 0 0 0 1.5px rgba(245, 243, 238, 0.95); }
.z-echantillon { position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; pointer-events: none; display: none; z-index: 4; border: 2px solid var(--z-encre); box-shadow: 0 0 0 2px rgba(245, 243, 238, 0.95); }
.z-echantillon.z-visible { display: block; }

.z-badge { position: absolute; z-index: 5; padding: 6px 12px; border-radius: var(--z-pilule); background: var(--z-encre); color: var(--z-sol); font-size: 0.75rem; font-weight: 600; pointer-events: none; }
.z-badge-zoom { left: 12px; bottom: 12px; }
.z-badge-orig { left: 12px; top: 12px; display: none; }
.z-etabli.z-compare .z-badge-orig { display: block; }

/* Barre de l’établi (remplace les vues) */
.z-etabar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--z-encre-15); }
.z-etabar[hidden] { display: none; }
.z-etabar .z-sep { width: 1px; height: 28px; background: var(--z-encre-15); margin: 0 4px; }
.z-btn-comparer { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.z-btn-comparer.z-on { background: var(--z-encre); border-color: var(--z-encre); color: var(--z-sol); }

/* Panneau de l’étape */
.z-outils-tuiles { --cols: 4; gap: 6px; }
.z-tuile-avec-icone .z-tuile-corps.z-outil { grid-template-columns: 1fr; column-gap: 0; }
.z-tuile-avec-icone .z-tuile-corps.z-outil .z-ico { grid-row: auto; justify-self: center; }
.z-tuile-avec-icone .z-tuile-corps.z-outil b { grid-column: 1; }
.z-tuile-corps.z-outil { justify-items: center; align-content: center; gap: 6px; min-height: 68px; padding: 8px 2px; text-align: center; }
.z-outil .z-ico { width: 22px; height: 22px; }
.z-outil b { font-size: 0.75rem; font-weight: 600; }
.z-miniatures { display: flex; flex-wrap: wrap; gap: 8px; }
.z-mini-image { position: relative; width: 56px; height: 56px; border-radius: 10px; }
.z-mini-image input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: inherit; cursor: pointer; z-index: 1; }
.z-mini-image img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: var(--z-sol-2); border: 1px solid var(--z-encre-45); }
.z-mini-image input:checked + img { border-color: var(--z-encre); box-shadow: 0 0 0 2px var(--z-sol), 0 0 0 4px var(--z-encre); }

.z-seulement-mobile { display: none; }
.z-raccourcis { font-size: 0.8125rem; color: var(--z-encre-70); }
@media (hover: none) and (pointer: coarse) { .z-raccourcis { display: none; } }   /* les raccourcis clavier n'ont pas de sens au doigt : un bloc de moins dans Détourage */

@container zoe (max-width: 760px) {
  .z-etabar { gap: 4px; padding: 6px 16px; justify-content: space-between; }
  .z-etabar .z-sep { display: none; }
  .z-bar-fond { display: none; }
  .z-seulement-mobile { display: flex; }
  .z-btn-comparer { padding: 0; width: var(--z-cible); }
  .z-btn-comparer span { display: none; }
  .z-badge { font-size: 0.75rem; padding: 4px 10px; }
  .z-badge-zoom { left: 8px; bottom: 8px; }
  .z-badge-orig { left: 8px; top: 8px; }
}

.z-etabli-vide { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--z-encre-70); }
.z-etabli-vide[hidden] { display: none; }
.z-etabli-vide p { max-width: 32ch; }

/* ---------- Ajouts du plugin (absents de la maquette) ---------- */

/* Étape 1 : format et vitesse imposés, une ligne d'information (pas un contrôle) */
.z-info-fixe { font-family: var(--z-display); font-weight: 800; font-stretch: 125%; font-size: 1.0625rem; line-height: 1.2; letter-spacing: 0.01em; }
.z-erreur-format { color: var(--z-rouge); font-weight: 600; }

/* Étape finale : case « droits », aperçu du fichier, bouton de validation */
.z-case { display: flex; align-items: flex-start; gap: 12px; min-height: var(--z-cible); padding: 8px 0; cursor: pointer; font-size: 0.875rem; }
.z-case input { flex: none; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.z-case span { text-wrap: pretty; }
.z-apercu-fichier { width: 160px; height: 160px; max-width: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--z-encre-15); background: var(--z-sol-2); }

/* Zone « Fichier d'impression » : l'UI d'upload du plugin, montrée en LECTURE SEULE (aperçu du JPEG composé, repères de coupe et d'étiquette). Ses commandes
   (remplir, zoom, remplacer, retirer, dépôt) sont masquées : le fichier ne vient que de l'outil. */
/* 21/11 (Arnaud) : la zone « Fichier d'impression » n'est plus montrée, même fichier prêt. Elle reste montée (l'UI d'upload interne porte le fichier composé jusqu'à la commande) et masquée
   comme avant la première composition : sans display:none, pour que l'UI garde sa largeur de mise en page ; visibility la retire aussi de l'arbre d'accessibilité. */
.zoe-fichier { visibility: hidden; height: 0; margin: 0; padding: 0; overflow: hidden; pointer-events: none; }
.zoe-fichier-titre { margin: 0; font-family: var(--z-display); font-weight: 800; font-stretch: 125%; font-size: 0.9375rem; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.01em; color: var(--z-encre); }
.zoe-fichier-etat { margin: 0; font-size: 0.8125rem; color: var(--z-encre-70); }
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-panel, .zoe-ui .zoe-fichier-hote .dmd-face .dmd-view, .zoe-ui .zoe-fichier-hote .dmd-face .dmd-pan-catcher,
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-dropzone, .zoe-ui .zoe-fichier-hote .dmd-face .dmd-draghint, .zoe-ui .zoe-fichier-hote .dmd-face .dmd-indicatif,
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-tpl-gallery { display: none; }   /* sélecteurs renforcés : designer.css redonne un display aux mêmes éléments (.dmd-face.is-empty .dmd-dropzone, .dmd-face.has-image .dmd-view…) */
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-stage-wrap { flex: none; height: 340px; min-height: 0; }
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-stage { position: absolute; inset: 0; height: auto; }
.zoe-ui .zoe-fichier-hote .dmd-face .dmd-stage-wrap { pointer-events: none; }   /* lecture seule : ni déplacer ni redimensionner le visuel (poignées Konva comprises) */

/* ---------- dcmt15 : correctifs après relectures du 22/10 ---------- */
/* UX10 : bandeau « Dernière étape » en tête de la liste des étapes (tout est réglé, il ne reste que la case des droits, cachée dans Vérifications). */
.z-bandeau { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 20px; background: var(--z-sol-2); border-bottom: 1px solid var(--z-encre-15); border-left: 4px solid var(--z-menthe-ink); }
.z-bandeau-txt { flex: 1 1 220px; font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
@container zoe (max-width: 760px) { .z-bandeau { padding: 12px 16px; } }
/* UX1 : face B, choix « même animation » / « autre animation » (hors de .zoe : ses jetons viennent de .zoe-ui) */
.zoe-b-choix { border: 0; margin: 0 0 10px; padding: 0; min-width: 0; display: grid; gap: 8px; font-family: var(--z-sans); color: var(--z-encre); }
.zoe-b-choix legend { padding: 0; margin: 0 0 8px; font-weight: 800; font-size: 0.9375rem; }
.zoe-b-opt { display: flex; align-items: center; gap: 12px; min-height: var(--z-cible); padding: 6px 14px; border: 1px solid var(--z-encre-45); border-radius: 14px; background: var(--z-sol); cursor: pointer; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.zoe-b-opt input { flex: none; width: 22px; height: 22px; margin: 0; cursor: pointer; accent-color: var(--z-menthe-ink); }
.zoe-b-opt input:checked + span { font-weight: 800; }
.zoe-b-opt:focus-within { outline: 2px solid var(--z-encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--z-menthe-lueur); }
.zoe-b-info { margin: 0 0 12px; padding: 12px 14px; background: var(--z-sol-2); border-radius: 14px; font-family: var(--z-sans); font-size: 0.875rem; line-height: 1.4; color: var(--z-encre); }
.zoe-b-info[hidden], .zoe-outil[hidden] { display: none !important; }
/* UX12 : cible de la case des droits = toute la ligne (≥ 44 px), la case de 24 px est centrée dedans */
.z-case { align-items: center; min-height: 48px; }
/* UX7a : sur téléphone, à l'entrée, le disque cède de la place : « Déposer ma photo » reste visible sans défiler, au-dessus de la barre « Enregistrer » du designer (écran de 812 px) */
@container zoe (max-width: 760px) {
  .zoe[data-entree="1"] { --z-collant-h: min(30 * var(--z-vh), 250px); }
  [data-entree="1"] .z-sous { padding-top: 10px; }
  [data-entree="1"] .z-entree { gap: 12px; }
  .z-entree-actions .z-btn { flex: 1 1 140px; justify-content: center; }
  .z-vues { padding: 6px 12px; }
}

/* ---------- Téléphone en hauteur courte (iPhone SE, 375 x 667) ---------- */
/* Règle : les 5 vues et Lancer restent TOUJOURS entiers et atteignables, quelle que soit la taille.
   - Colonne de 5 boutons de 44 px à droite du disque : seulement si le bloc collant la contient (5 x 44 + 4 x 2 + 6 = 234 px) ; 38 % de la hauteur visible
     donnent 235 px à partir de 620 px, 42 % à partir de 560 px. En dessous, ou en paysage court, on garde la rangée horizontale du haut (icône + libellé court).
   - Rangée horizontale : cinq boutons de 48 px ne tiennent pas toujours (zoom 200 %, 188 px) ; elle défile alors à l'horizontale
     (boutons jamais écrasés sous 48 px) et une ombre au bord dit qu'il y a de la suite. */
@media (min-height: 560px) and (max-height: 700px) and (orientation: portrait) {
  @container zoe (max-width: 760px) {
    .zoe { --z-collant-h: max(38 * var(--z-vh), 240px); --z-marge-disque: 8px; }   /* plancher 240 px : la colonne de cinq boutons (234 px) tient quelle que soit la hauteur que l'hôte prend au-dessus */
    .z-collant { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); grid-template-areas: "table vues"; }
    .z-vues { flex-direction: column; justify-content: center; gap: 2px; padding: 3px 3px; border-top: 0; border-left: 1px solid var(--z-encre-15); }
    .z-opt { flex: 1 1 0; max-width: none; min-height: var(--z-cible); }
    .z-vue-btn { height: 100%; min-height: var(--z-cible); }
    .z-app[data-mode="etabli"] .z-collant { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "table" "vues"; }
  }
}
@media (min-height: 560px) and (max-height: 619px) and (orientation: portrait) {
  @container zoe (max-width: 760px) { .zoe { --z-collant-h: max(42 * var(--z-vh), 240px); } }
}
/* Rangée horizontale compacte : rail qui défile si les cinq boutons ne tiennent pas, avec une ombre aux bords qui cachent du contenu */
@container zoe (max-width: 760px) {
  .z-vues { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
    background:
      linear-gradient(to right, var(--z-sol) 30%, transparent) left center / 24px 100% no-repeat local,
      linear-gradient(to left, var(--z-sol) 30%, transparent) right center / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.28), transparent) left center / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.28), transparent) right center / 10px 100% no-repeat scroll,
      var(--z-sol); }
  .z-vues::-webkit-scrollbar { display: none; }
  .z-opt { min-width: 48px; }
}
@media (min-height: 560px) and (max-height: 700px) and (orientation: portrait) {
  @container zoe (max-width: 760px) { .z-vues { overflow: visible; } }   /* la colonne tient toujours : pas de rail, et l'anneau de focus n'est pas rogné */
}
/* Petite hauteur de paysage (téléphone couché, étroit) : le bloc collant prend plus de la hauteur, sinon rangée de vues + disque + Lancer s'écrasent */
@media (orientation: landscape) and (max-height: 520px) {
  @container zoe (max-width: 760px) { .zoe { --z-collant-h: max(52 * var(--z-vh), 128px); --z-marge-disque: 6px; } }
}

/* ---------- Téléphone en paysage (844 x 390, 932 x 430) ---------- */
/* Deux colonnes : à gauche le disque, sa barre de vues (une ligne) et Lancer, en tout 100 % de la hauteur visible, collés pendant que les étapes défilent à droite.
   L'en-tête passe en haut de la colonne des étapes (il ne coûte plus de hauteur au disque). */
@media (orientation: landscape) and (max-height: 520px) {
  @container zoe (min-width: 761px) {
    .zoe { --z-haut-h: 44px; --z-marge-disque: 10px; }
    .z-app { display: grid; grid-template-columns: minmax(0, 1fr) var(--z-col); grid-template-rows: auto auto; align-content: start; }
    .z-corps { display: contents; }
    .z-haut { grid-column: 2; grid-row: 1; flex-wrap: nowrap; padding: 4px 12px 4px 16px; gap: 0 12px; }
    .z-titre { font-size: 0.8125rem; flex: 1; min-width: 0; }
    .z-note { display: none; }
    .z-note-bas { display: block; }
    .z-raz-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .z-raz { width: var(--z-cible); justify-content: center; padding: 0; text-decoration: none; }
    .z-colonne { grid-column: 2; grid-row: 2; }
    .z-scene { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: var(--z-si-haut); align-self: start; height: calc(100 * var(--z-vh) - var(--z-si-haut) - var(--z-si-bas)); }
    .z-collant { position: relative; top: auto; z-index: auto; flex: 1 1 0; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "vues" "table"; border-bottom: 1px solid var(--z-encre-15); }
    .z-vues { flex-wrap: nowrap; justify-content: space-between; align-items: stretch; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--z-encre-15); }
    .z-opt { flex: 1 1 0; min-width: 0; max-width: 88px; }
    .z-vue-btn { width: 100%; min-height: 48px; padding: 4px 2px; flex-direction: column; justify-content: center; gap: 2px; border-radius: 14px; }
    .z-vue-btn .z-long { display: none; }
    .z-vue-btn .z-court { display: block; font-size: 0.75rem; line-height: 1.1; font-weight: 600; white-space: nowrap; }
    .z-transport { grid-area: table; justify-self: end; align-self: end; margin: 0 10px 10px 0; padding: 0; border-top: 0; background: none; position: relative; z-index: 2; }
    .z-app[data-mode="etabli"] .z-transport { display: none; }
    .z-transport .z-info, .z-transport .z-secondaire { display: none; }
    .z-transport .z-btn-lancer span { display: none; }
    .z-transport .z-btn-lancer { width: var(--z-cible); padding: 0; }
    .z-scene { overflow-y: auto; overscroll-behavior: contain; }   /* rien n'est rogné : si les réglages sous le disque ne tiennent pas, la colonne de gauche défile */
    .z-collant { min-height: 210px; }
    .z-sous { flex: 0 0 auto; max-height: none; overflow: visible; padding: 8px 14px 10px; }
    .z-etabar { gap: 4px; padding: 6px 12px; justify-content: space-between; }
    .z-etabar .z-sep { display: none; }
    .z-btn-comparer { padding: 0; width: var(--z-cible); }
    .z-btn-comparer span { display: none; }
    .z-legende { bottom: 8px; font-size: 0.75rem; padding: 6px 12px; }
    .z-badge { font-size: 0.75rem; padding: 4px 10px; }
    .z-banc-grille { grid-template-columns: 1fr; }
    .z-colonne :is(button, input, summary, a, select) { scroll-margin-top: 8px; }
    /* à l'entrée : le disque de démonstration et le texte côte à côte dans la colonne de gauche */
    .zoe[data-entree="1"] .z-scene { flex-direction: row; }
    .zoe[data-entree="1"] .z-collant { flex: 0 0 46%; height: auto; border-bottom: 0; border-right: 1px solid var(--z-encre-15); }
    .zoe[data-entree="1"] .z-sous { flex: 1 1 0; max-height: none; min-width: 0; padding: 12px 14px; }
    .zoe[data-entree="1"] .z-entree { gap: 12px; }
    .zoe[data-entree="1"] .z-entree-actions .z-btn { flex: 1 1 100%; justify-content: center; }
  }
}
.z-actions-ligne { display: flex; flex-wrap: wrap; gap: 8px; }
.z-actions-ligne .z-btn[hidden] { display: none; }
.z-dev { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.z-dev-statut { color: var(--z-encre-70); }
