/* Éditeur de photo : chargé uniquement sur les pages de formats.
   Toutes les couleurs viennent des variables du site (elles suivent donc le thème choisi dans l'admin). */

.editor {
  /* Icônes (masques SVG) : elles prennent la couleur du texte et fonctionnent avec les boutons dont le texte change */
  --i-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0L8 8m4-4 4 4M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  --i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v12m0 0-4-4m4 4 4-4M4 20h16'/%3E%3C/svg%3E");
  --i-qr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3 3h7v7H3zm2 2v3h3V5zm9-2h7v7h-7zm2 2v3h3V5zM3 14h7v7H3zm2 2v3h3v-3zm9-2h3v3h-3zm5 0h2v2h-2zm-5 5h2v2h-2zm4-2h3v3h-3z'/%3E%3C/svg%3E");
  --i-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-2h6l2 2h3v11H4z'/%3E%3Ccircle cx='12' cy='13.5' r='3.2'/%3E%3C/svg%3E");
  --i-auto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2.5l2.2 6.3 6.3 2.2-6.3 2.2L12 19.5l-2.2-6.3L3.5 11l6.3-2.2zM19 3l.8 2.2L22 6l-2.2.8L19 9l-.8-2.2L16 6l2.2-.8z'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14.5-4M4 4v4h4M4 13a8 8 0 0 0 14.5 4M20 20v-4h-4'/%3E%3C/svg%3E");
  --i-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5m0 0 6-6m-6 6 6 6'/%3E%3C/svg%3E");
  --i-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14m0 0-6-6m6 6-6 6'/%3E%3C/svg%3E");
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");

  background: var(--surface);
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(14px, 2vw, 22px);
  margin-block: 8px 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.editor::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent) 60%, var(--primary));
}

/* ---------- Boutons avec icône ---------- */
.editor .btn { min-height: 38px; padding-inline: 14px; font-size: 14px; transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease; }
.editor .btn.sm { min-height: 34px; padding-inline: 12px; font-size: 13px; }
.editor .btn:not([disabled]):hover { transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in srgb, var(--btn-bg) 28%, transparent); }
.editor .btn.ghost:not([disabled]):hover { border-color: var(--btn-bg); box-shadow: none; }
.editor .btn:not([disabled]):active { transform: translateY(0); }
.editor .btn.ic::before,
.editor .btn.ic-right::after {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.editor .btn.ic-right::before { content: none; }
.editor .btn.ic-right::after { --ic: var(--i-right); }
.editor .ic-upload { --ic: var(--i-upload); }
.editor .ic-download { --ic: var(--i-download); }
.editor .ic-camera { --ic: var(--i-camera); }
.editor .ic-qr { --ic: var(--i-qr); }
.editor .ic-auto { --ic: var(--i-auto); }
.editor .ic-check { --ic: var(--i-check); }
.editor .ic-refresh { --ic: var(--i-refresh); }
.editor .ic-left { --ic: var(--i-left); }
html[dir="rtl"] .editor .ic-left::before, html[dir="rtl"] .editor .ic-right::after { transform: scaleX(-1); }

/* ---------- Progression ---------- */
.steps { display: flex; align-items: center; list-style: none; margin: 0 0 clamp(14px, 2.4vw, 22px); padding: 0; font-size: 13px; color: var(--muted); }
.steps li { display: flex; align-items: center; white-space: nowrap; transition: color .2s ease; }
.steps li + li::before { content: ""; width: clamp(12px, 5vw, 44px); height: 2px; margin-inline: 8px; border-radius: 2px; background: var(--line); transition: background-color .25s ease; }
.steps li.done + li::before, .steps li.on::before { background: linear-gradient(90deg, var(--ok), var(--primary)); }
.steps span {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin-inline-end: 7px;
  border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12px;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.steps .on { color: var(--ink); font-weight: 700; }
.steps .on span {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent)));
  border-color: transparent; color: var(--primary-ink); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-sm); transform: scale(1.05);
}
.steps .done span { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* ---------- Mise en page ---------- */
.ed-grid { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: clamp(14px, 2.4vw, 26px); align-items: start; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; }
.controls > * { margin: 0; }
.group { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.group > * { margin: 0; }
.group > h3 { font-size: 15px; letter-spacing: 0; font-family: var(--body); font-weight: 700; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 150px; }

/* ---------- Zone de la photo ---------- */
.stage {
  position: relative; width: 100%; max-width: 270px; overflow: hidden;
  border-radius: 14px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.ed-step[data-step="1"] .stage, .ed-step[data-step="2"] .stage { aspect-ratio: var(--ar, 35 / 45); } /* réserve la place : pas de saut de mise en page */
.ed-step[data-step="2"] .stage { position: sticky; top: 12px; }
.cv { display: block; width: 100%; height: 100%; touch-action: none; }
.cv.pick { cursor: crosshair; }
.guides { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Repères façon viseur d'appareil photo, dans les coins du cadre (étapes 1 et 2 seulement) */
.stage:not(.paper)::after {
  content: ""; position: absolute; inset: 7px; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--primary) 2px, transparent 2px), linear-gradient(90deg, var(--primary) 2px, transparent 2px),
    linear-gradient(var(--primary) 2px, transparent 2px), linear-gradient(to left, var(--primary) 2px, transparent 2px),
    linear-gradient(to top, var(--primary) 2px, transparent 2px), linear-gradient(90deg, var(--primary) 2px, transparent 2px),
    linear-gradient(to top, var(--primary) 2px, transparent 2px), linear-gradient(to left, var(--primary) 2px, transparent 2px);
  background-repeat: no-repeat;
  background-size: 13px 13px;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right;
}

.drop {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px; text-align: center; border-radius: 14px;
  border: 2px dashed color-mix(in srgb, var(--primary) 35%, var(--line));
  background: radial-gradient(120% 70% at 50% 0%, var(--primary-soft), transparent 70%), var(--surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.drop:hover, .drop.dragover { border-color: var(--primary); }
.drop.dragover { background: var(--primary-soft); }
.drop[hidden] { display: none; }
.drop strong { font-family: var(--display); font-size: clamp(15px, 2vw, 17px); line-height: 1.2; }
.drop-hint { color: var(--muted); font-size: 12.5px; max-width: 24ch; }
.drop-ico {
  width: 46px; height: 46px; border-radius: 50%; position: relative; margin-bottom: 0;
  background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--accent) 30%, var(--primary-soft)));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 6%, transparent);
}
.drop-ico::after {
  content: ""; position: absolute; inset: 12px; background: var(--primary);
  -webkit-mask: var(--i-upload) center / contain no-repeat; mask: var(--i-upload) center / contain no-repeat;
}
.drop-actions { display: grid; gap: 6px; width: min(100%, 220px); margin-top: 4px; }
.drop-actions .btn { width: 100%; }
/* État initial : le cadre s'agrandit pour contenir tout le panneau d'import.
   Le ratio photo ne s'applique qu'une fois qu'une image est chargée. */
.stage:has(.drop:not([hidden])) { aspect-ratio: auto !important; }
.stage:has(.drop:not([hidden])) .cv,
.stage:has(.drop:not([hidden])) .guides { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage:has(.drop:not([hidden])) .drop { position: relative; inset: auto; min-height: 340px; }
.drop-remote-hint { max-width: 30ch; }

/* ---------- Messages d'état ---------- */
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.35; padding: 8px 11px; border-radius: 10px; background: var(--primary-soft); color: var(--ink); }
.ai-status.ok { background: var(--ok-soft); color: var(--ok); }
.ai-status.warn { background: var(--warn-soft); color: var(--warn); }
.ai-status.busy::before { content: ""; flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Curseurs ---------- */
.slider { display: grid; gap: 2px; }
.slider > span, .field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.slider input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--line); }
.slider input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--primary); border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--primary), 0 2px 6px rgba(20, 24, 58, .3); }
.slider input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--primary); }
.slider input[type="range"]:focus-visible { outline: none; }
.slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--primary), 0 0 0 6px var(--primary-soft); }
.slider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--primary), 0 0 0 6px var(--primary-soft); }

/* ---------- Fond : pastilles ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }
.sw { position: relative; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); cursor: pointer; transition: transform .12s ease; }
.sw:hover { transform: scale(1.07); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.sw[aria-pressed="true"]::after {
  content: ""; position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--surface);
}
.sw[aria-pressed="true"]::before {
  content: ""; position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; z-index: 1; background: var(--primary-ink);
  -webkit-mask: var(--i-check) center / 62% no-repeat; mask: var(--i-check) center / 62% no-repeat;
}
.sw.custom { display: block; overflow: hidden; background: conic-gradient(#f33, #fd3, #3d6, #3cf, #33f, #d3d, #f33); }
.sw.custom input { position: absolute; inset: -8px; width: 64px; height: 64px; opacity: 0; cursor: pointer; }
.sw:focus-visible, .sw.custom:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }

/* ---------- Outils manuels ---------- */
.controls details.manual { border: 1px dashed var(--line); border-radius: 14px; padding: 0; }
.manual > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; }
.manual > summary::-webkit-details-marker { display: none; }
.manual > summary::after { content: ""; width: 16px; height: 16px; background: currentColor; transition: transform .2s ease; -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; }
.manual[open] > summary::after { transform: rotate(180deg); }
.manual > :not(summary) { margin: 0 11px 11px; }

/* ---------- Contrôles automatiques ---------- */
.checks-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.checks-head h3 { font-size: 15px; font-family: var(--body); font-weight: 700; margin: 0; }
.score { font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); white-space: nowrap; }
.score:empty { display: none; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--p, 0%); background: var(--ok); border-radius: inherit; transition: width .35s ease; }

/* Bandeau : points signalés par les contrôles, avec leur liste précise */
.checks-alert {
  display: grid; gap: 5px; padding: 11px 13px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
}
.checks-alert-title { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--warn); line-height: 1.35; }
.checks-alert-title::before {
  content: ""; flex: none; margin-top: 1px; width: 18px; height: 18px; background: var(--warn);
  -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat;
}
.checks-alert-body { margin: 0; font-size: 13px; color: var(--ink); }
.checks-alert-list { margin: 2px 0 0; padding-inline-start: 20px; font-size: 13px; color: var(--ink); display: grid; gap: 2px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.checks li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-inline-start: 3px solid var(--ok); border-radius: 9px; font-size: 12.5px; line-height: 1.25; background: var(--surface); box-shadow: var(--shadow-sm); }
.checks li:has(.warn) { order: -1; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); border-inline-start-color: var(--warn); background: var(--warn-soft); }
.ico { display: grid; place-items: center; flex: none; width: 19px; height: 19px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--surface); color: var(--warn); }

/* ---------- Cases à cocher ---------- */
.mchecks { display: grid; gap: 6px; }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; line-height: 1.35; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.check input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); cursor: pointer; }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: var(--ok-soft); }
.group > .check { padding: 9px 11px; }

/* ---------- Champs ---------- */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field select, .field input {
  width: 100%; height: 38px; padding: 0 11px; font-size: 14px; font-weight: 500; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px; background-color: var(--surface);
}
.field select {
  -webkit-appearance: none; appearance: none; padding-inline-end: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90b4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
html[dir="rtl"] .field select { background-position: left 12px center; }
.field select:hover, .field input:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.field select:focus-visible, .field input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ---------- Planche et téléchargements ---------- */
.stage.paper { max-width: 300px; padding: clamp(10px, 2vw, 16px); display: grid; place-items: center; background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--primary) 5%, var(--bg)), var(--bg)); }
.stage.paper .cv { width: auto; height: auto; max-width: 100%; max-height: min(72vh, 740px); background: #fff; border-radius: 2px; box-shadow: 0 10px 30px rgba(20, 24, 58, .24); }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl > #dl-pdf { grid-column: 1 / -1; min-height: 42px; font-size: 14.5px; }
.webbox { grid-column: 1 / -1; display: grid; gap: 8px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.webbox > * { margin: 0; }
.webrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--primary-soft); font-size: 12.5px; line-height: 1.45; }
.info::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; background: var(--primary); -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat; }

/* ---------- Tablette et mobile ---------- */
@media (max-width: 900px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: min(62%, 260px); margin-inline: auto; }
  .stage.paper { max-width: min(85%, 300px); }
  .ed-step[data-step="2"] .stage { position: relative; top: auto; }
  /* Les boutons d'action restent accessibles en bas de l'écran pendant que l'on fait défiler les réglages */
  .actions {
    position: sticky; bottom: 0; z-index: 5; margin-inline: calc(-1 * clamp(14px, 2vw, 22px)); padding: 10px clamp(14px, 2vw, 22px) calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--surface) 72%, transparent);
  }
}
@media (max-width: 560px) {
  .editor { border-radius: 14px; padding: 10px; }
  .steps li:not(.on) { font-size: 0; }
  .steps li:not(.on) span { margin-inline-end: 0; font-size: 12px; }
  .stage { max-width: min(78%, 220px); }
  .stage:has(.drop:not([hidden])) .drop { min-height: 360px; }
  .drop { gap: 5px; padding: 10px; }
  .drop-ico { width: 38px; height: 38px; }
  .drop-ico::after { inset: 10px; }
  .drop-actions { gap: 5px; margin-top: 2px; }
  .drop-actions .btn, .drop-remote .btn { min-height: 34px; padding-block: 6px; }
  .drop-remote { margin-top: 1px; padding-top: 6px; }
  .drop-remote-hint { font-size: 10.5px; line-height: 1.25; }
  .group { padding: 10px 11px; }
  .pair { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .webrow { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .actions { margin-inline: -10px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .editor *, .editor *::before, .editor *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- Finitions ---------- */
.editor #btn-auto, .editor #btn-bgauto {
  background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--accent) 26%, var(--primary-soft)));
  border-color: transparent; color: var(--ink); font-weight: 700;
}
.editor #btn-auto:not([disabled]):hover, .editor #btn-bgauto:not([disabled]):hover { border-color: var(--primary); box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 22%, transparent); }
.editor .ic-auto::before { color: var(--primary); }
.group > .check:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-soft); }
.dl .btn.ghost { font-size: 15px; }
@media (max-width: 560px) {
  .steps { font-size: 13px; }
  .steps li + li::before { width: 10px; margin-inline: 6px; }
  .steps span { width: 28px; height: 28px; margin-inline-end: 8px; }
  .actions .btn { flex: 1 1 0; min-width: 0; padding-inline: 10px; font-size: 15px; }
}
@media (max-width: 380px) {
  .steps li.on { min-width: 0; white-space: normal; line-height: 1.2; }
  .steps li + li::before { width: 6px; margin-inline: 4px; }
}
.guides { direction: ltr; } /* les repères du cadrage restent alignés à gauche, y compris en arabe */
/* À l'étape 3, l'action principale (télécharger) est déjà visible : pas de barre fixe pour « Retour » */
.ed-step[data-step="3"] .actions { position: static; margin-inline: 0; padding: 0; background: none; }

.drop-remote {
  width: min(100%, 280px); margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line);
}
.drop-remote .btn { width: 100%; }
.drop-remote-hint { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.transfer-dialog .btn { min-height: 38px; }
