/* ============================================================================
 * VET Protech — Configurateur de personnalisation
 * Palette : navy profond + accent ambre (univers vêtement de travail).
 * ==========================================================================*/
:root {
  --navy: #0f1f33;
  --navy-2: #16263d;
  --ink: #1a2233;
  --paper: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --muted: #6b7688;
  --accent: #f59e0b;     /* ambre chantier */
  --accent-d: #d97706;
  --blue: #2563eb;
  --blue-d: #1d4ed8;
  --ok: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(15, 31, 51, 0.10);
  --shadow-sm: 0 2px 8px rgba(15, 31, 51, 0.07);
  font-synthesis: none;
}

* { box-sizing: border-box; }
/* L'attribut HTML `hidden` DOIT toujours masquer (sinon une modale en
   display:flex+opacity:0 reste posée sur la page et avale les clics → ouvrait
   par erreur un sélecteur de fichier). Cette règle prime sur tout `display:`. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- En-tête ---------------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 22px;
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: var(--navy); font-weight: 800; font-size: 17px; letter-spacing: -0.5px;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt strong { font-size: 16px; }
.brand-txt span { font-size: 11.5px; color: #9fb0c6; }

.steps { display: flex; gap: 6px; margin: 0 auto; }
.step {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: pointer;
  color: #9fb0c6; padding: 7px 12px; border-radius: 9px;
  font: inherit; font-size: 13px; transition: .15s;
}
.step b {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: #28394f; color: #cdd8e6;
}
.step span { font-weight: 600; }
.step:hover { color: #fff; }
.step.is-active { background: #28394f; color: #fff; }
.step.is-active b { background: var(--accent); color: var(--navy); }
.step.is-done b { background: var(--ok); color: #fff; }

.topbar-actions { display: flex; gap: 8px; }

/* ---------------- Mise en page ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  padding: 22px;
  max-width: 1320px; margin: 0 auto;
  align-items: start;
}

/* ---------------- Aperçu ---------------- */
.preview { position: sticky; top: 86px; }
.preview-stage {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  background:
    radial-gradient(120% 120% at 50% 0%, #ffffff 0%, #eef1f6 70%, #e6eaf1 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.garment-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; pointer-events: none; user-select: none;
}
/* Fabric dimensionne le canvas en pixels réels (voir app.js fitCanvas) ;
   on le cale juste en haut-gauche du stage, sans mise à l'échelle CSS. */
.canvas-container { position: absolute !important; inset: 0; z-index: 3; }
#designCanvas { position: absolute; inset: 0; }

.safe-frame {
  position: absolute; border: 2px dashed rgba(37, 99, 235, .65);
  border-radius: 6px; pointer-events: none; z-index: 2;
  box-shadow: 0 0 0 9999px rgba(15, 31, 51, 0.015);
}
.safe-label {
  position: absolute; top: -10px; left: 8px;
  background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.stage-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(15,31,51,.78); color: #fff; font-size: 12px;
  padding: 5px 12px; border-radius: 20px; pointer-events: none;
  opacity: 0; transition: .2s; white-space: nowrap;
}
.stage-hint.show { opacity: 1; }

.preview-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  opacity: .5; pointer-events: none; transition: .15s;
}
.preview-toolbar.active { opacity: 1; pointer-events: auto; }
.tool {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: inherit; font-size: 12.5px; padding: 7px 10px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; transition: .12s;
}
.tool:hover { border-color: var(--blue); color: var(--blue-d); }
.tool-danger:hover { border-color: var(--danger); color: var(--danger); }
.tool-sep { flex: 1; }
.tool-range { gap: 8px; color: var(--muted); }
.tool-range input { accent-color: var(--blue); }

/* ---------------- Panneau ---------------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; min-height: 60vh;
}
.pane { display: none; animation: fade .25s ease; }
.pane.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2 { font-size: 19px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
h2 .num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px;
  background: var(--navy); color: #fff;
}
h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin: 20px 0 10px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* Grille des vêtements */
.garment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.garment-card {
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; padding: 8px; text-align: center; transition: .15s;
}
.garment-card:hover { border-color: #c3cee0; }
.garment-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.garment-card img { width: 100%; aspect-ratio: 1/1; object-fit: contain;
  background: linear-gradient(160deg, #f7f9fc, #eef1f6); border-radius: 8px; }
.garment-card span { display: block; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.garment-card .gref { display: block; font-size: 10.5px; color: var(--muted); font-style: normal; }
.color-name { color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 700; }

/* Couleurs */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); transition: .12s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.sel { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }
.custom-color {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13px; color: var(--muted);
}
.custom-color input { width: 34px; height: 30px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer; }

/* Dropzones */
.dropzone, .add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed #c3cee0; border-radius: 11px; background: #fafbfd;
  padding: 14px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--ink); transition: .15s; text-align: center;
}
.dropzone:hover, .add-btn:hover { border-color: var(--blue); background: #f2f6ff; color: var(--blue-d); }
.dropzone.drag { border-color: var(--accent); background: #fff8ec; }

/* Étape 2 */
.view-tabs { display: flex; gap: 8px; }
.view-tab {
  flex: 1; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 10px; padding: 10px; font: inherit; font-weight: 600; font-size: 13.5px;
  transition: .15s;
}
.view-tab:hover { border-color: #c3cee0; }
.view-tab.sel { border-color: var(--blue); background: #f2f6ff; color: var(--blue-d); }
.zone-list { display: flex; flex-direction: column; gap: 8px; }
.zone-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-size: 13.5px; transition: .15s;
}
.zone-item:hover { border-color: #c3cee0; }
.zone-item.sel { border-color: var(--accent); background: #fff8ec; }
.zone-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }

/* Étape 3 — actions d'ajout */
.add-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-actions .add-btn:first-child { grid-column: 1 / -1; }

.text-tools, .img-tools { border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-top: 14px; background: #fafbfd; }
.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14px; background: #fff;
}
.input:focus { outline: none; border-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: end; }
.grid-2 label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.grid-2 input[type=range] { accent-color: var(--blue); }
.input-color { width: 100%; height: 38px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.text-style-btns { display: flex; gap: 6px; }
.sbtn { width: 40px; height: 38px; border: 1.5px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; font-size: 15px; }
.sbtn.on { border-color: var(--blue); background: #f2f6ff; color: var(--blue-d); }

.btn-secondary {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 100%; border: 1.5px solid var(--blue); background: #f2f6ff; color: var(--blue-d);
  border-radius: 10px; padding: 11px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn-secondary small { font-weight: 500; font-size: 11px; color: var(--muted); }
.btn-secondary:hover { background: #e6efff; }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.bg-progress { margin-top: 10px; }
.bg-progress .bar { height: 7px; background: #e6eaf1; border-radius: 20px; overflow: hidden; }
.bg-progress .bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.bg-progress span { font-size: 12px; color: var(--muted); display: block; margin-top: 5px; }

/* Calques */
.layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layers-empty { color: var(--muted); font-size: 13px; padding: 10px; text-align: center;
  border: 1px dashed var(--line); border-radius: 10px; }
.layer {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.layer.sel { border-color: var(--accent); background: #fff8ec; }
.layer .thumb { width: 34px; height: 34px; border-radius: 7px; background: #f0f2f7;
  display: grid; place-items: center; overflow: hidden; flex: none; font-size: 16px; }
.layer .thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer .lname { flex: 1; font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.layer .lact { border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 14px; padding: 4px; border-radius: 6px; }
.layer .lact:hover { color: var(--danger); background: #fef2f2; }

/* BAT */
.bat-recap {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px;
  background: #fafbfd; font-size: 13px; color: var(--ink); line-height: 1.7;
}
.bat-recap b { color: var(--navy); }
.sign-wrap { position: relative; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; overflow: hidden; }
#signPad { width: 100%; height: 180px; touch-action: none; cursor: crosshair; display: block; }
.btn-clear-sign { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 5px 10px; }
.consent { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; font-size: 13px; color: var(--ink); }
.consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--blue); }
.dtf-note { margin-top: 14px; font-size: 12px; color: var(--muted); background: #f2f6ff;
  border: 1px solid #dbe6ff; border-radius: 10px; padding: 10px 12px; }

/* Boutons */
.btn-primary, .btn-ghost {
  border-radius: 11px; padding: 13px 18px; font: inherit; font-weight: 700; font-size: 14.5px;
  cursor: pointer; border: 1.5px solid transparent; transition: .15s;
}
.btn-primary { background: var(--accent); color: var(--navy); width: 100%; margin-top: 18px; }
.btn-primary:hover { background: var(--accent-d); color: #fff; }
.btn-primary:disabled { background: #e3e8f0; color: #9aa6b8; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #c3cee0; background: #f7f9fc; }
.row-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.row-2 .btn-primary, .row-2 .btn-ghost { margin-top: 0; }
.next { margin-top: 18px; }

/* Étape 4 — Tailles & quantités */
.qty-grid { display: flex; flex-direction: column; gap: 8px; }
.qty-row { display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--line); border-radius: 11px; padding: 9px 13px; background: #fff; }
.qty-size { font-weight: 700; font-size: 14px; }
.qty-stepper { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 32px; height: 32px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink); }
.qty-btn:hover { border-color: var(--blue); color: var(--blue-d); }
.qty-input { width: 56px; height: 32px; text-align: center; border: 1.5px solid var(--line);
  border-radius: 8px; font: inherit; font-weight: 700; font-size: 14px; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 12px 14px; border-radius: 11px; background: #fafbfd; border: 1px solid var(--line); }
.qty-total { display: flex; align-items: baseline; gap: 7px; }
.qty-total span { color: var(--muted); font-size: 13px; }
.qty-total b { font-size: 24px; color: var(--navy); }
.qty-total small { color: var(--muted); font-size: 12px; }
.qty-min { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.qty-min.ok { color: var(--ok); }
.qty-price { margin-top: 12px; }
.qty-price-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
.qty-price-line.muted { color: var(--muted); }
.qty-price-line b { color: var(--navy); }
.qty-price-line.total { border-top: 1.5px solid var(--line); margin-top: 5px; padding-top: 9px;
  font-size: 15px; font-weight: 700; }
.qty-price-line.total b { color: var(--navy); font-size: 17px; }
.px-off { color: var(--ok); font-weight: 700; font-size: 11.5px; }
.cart-price-detail { font-size: 11px !important; color: var(--muted) !important; }
.recap-total { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.recap-total b { color: var(--navy); font-size: 15px; }

/* Bouton panier (en-tête) */
.btn-cart { background: var(--accent); color: var(--navy); border: 0; border-radius: 10px;
  padding: 8px 14px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.btn-cart:hover { background: var(--accent-d); color: #fff; }

/* Panier (tiroir) */
.cart-overlay { position: fixed; inset: 0; background: rgba(15,31,51,.4); z-index: 90;
  opacity: 0; transition: opacity .25s; }
.cart-overlay.show { opacity: 1; }
.cart-drawer { position: fixed; top: 0; right: 0; width: 420px; max-width: 92vw; height: 100%;
  background: #fff; z-index: 91; box-shadow: -10px 0 40px rgba(15,31,51,.2);
  transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; }
.cart-drawer.open { transform: translateX(0); }
.cart-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cart-head h3 { margin: 0; font-size: 17px; }
.cart-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 40px; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { width: 64px; height: 64px; object-fit: contain; background: #f4f6fa;
  border: 1px solid var(--line); border-radius: 9px; flex: none; }
.cart-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-info b { font-size: 14px; }
.cart-info span { font-size: 12px; color: var(--muted); }
.cart-sizes { font-weight: 600; color: var(--ink) !important; }
.cart-bat { color: var(--ok) !important; font-weight: 600; }
.cart-line-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cart-line-right b { font-size: 14px; color: var(--navy); white-space: nowrap; }
.cart-line-right small { font-size: 11px; color: var(--muted); }
.cart-del { border: 0; background: transparent; cursor: pointer; font-size: 14px; margin-top: 6px; }
.cart-del:hover { color: var(--danger); }
.cart-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.cart-tot { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.cart-tot b { font-size: 18px; color: var(--navy); }
.cart-note { font-size: 11.5px; color: var(--muted); margin: 8px 0 12px; }
.cart-foot .btn-primary { margin-top: 0; }

/* ============================================================================
 * V3 — Fiche produit + modale à onglets + technique
 * ==========================================================================*/
.site-top {
  display: flex; align-items: center; gap: 22px; padding: 12px 26px;
  background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50;
}
.site-nav { display: flex; gap: 20px; margin-left: auto; margin-right: 8px; }
.site-nav a { color: #aebacb; font-size: 14px; font-weight: 600; cursor: pointer; }
.site-nav a:hover { color: #fff; }

.demo-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 26px; background: #fff8ec; border-bottom: 1px solid #f3d28a;
  font-size: 12.5px; color: #92590a; }
.demo-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-chip { border: 1.5px solid #e7c884; background: #fff; color: #6b4708;
  border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.demo-chip:hover { border-color: var(--accent-d); }
.demo-chip.sel { background: var(--accent); border-color: var(--accent); color: var(--navy); }

/* Fiche produit */
.product-page { max-width: 1100px; margin: 28px auto; padding: 0 26px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.pp-gallery { background: linear-gradient(160deg, #fff, #eef1f6); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; }
.pp-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.pp-brand { color: var(--accent-d); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; }
.pp-title { font-size: 28px; margin: 4px 0 6px; }
.pp-ref { color: var(--muted); font-size: 13px; }
.pp-price { font-size: 18px; margin: 14px 0; }
.pp-price b { font-size: 24px; color: var(--navy); }
.pp-price small { color: var(--muted); font-size: 13px; }
.pp-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 9px; }
.pp-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-sizes { display: flex; flex-wrap: wrap; gap: 7px; }
.size-pill { border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 11px; font-size: 13px; font-weight: 600; color: var(--ink); }
.btn-perso { display: block; width: 100%; margin-top: 22px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-d)); color: var(--navy);
  border-radius: 12px; padding: 16px; font: inherit; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 22px rgba(245,158,11,.3); }
.btn-perso:hover { filter: brightness(1.05); }
.pp-add { width: 100%; margin-top: 10px; }
.pp-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* Modale */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,31,51,.55); z-index: 80;
  opacity: 0; transition: opacity .25s; }
.modal-overlay.show { opacity: 1; }
.modal { position: fixed; z-index: 81; top: 50%; left: 50%;
  width: min(1120px, 94vw); height: min(760px, 92vh);
  transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: .25s;
  background: var(--paper); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(15,31,51,.4); }
.modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--navy); color: #fff; }
.modal-title { font-weight: 700; font-size: 15px; }
.modal-head-actions { display: flex; align-items: center; gap: 8px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; cursor: pointer;
  background: #28394f; color: #fff; font-size: 15px; }
.modal-close:hover { background: #3a4f6b; }
.modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 18px; padding: 18px; }

/* Aperçu dans la modale (le carré est dimensionné en JS via fitCanvas) */
.modal .preview { position: static; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.modal .preview-stage { flex: none; aspect-ratio: auto; width: 100%; }
.preview-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; width: 100%; }
.view-seg { display: inline-flex; gap: 6px; }
.view-seg .view-tab { flex: none; padding: 8px 16px; }
/* Sélecteur Devant/Dos dans la section Emplacement : pleine largeur, visible */
.emplacement-views { display: flex; gap: 8px; margin: 0 0 8px; }
.emplacement-views .view-tab { flex: 1; padding: 11px; font-size: 14px; }
.preview-controls .preview-toolbar { flex: 1; margin-top: 0; }

/* Panneau onglets */
.modal .panel { min-height: 0; overflow-y: auto; padding: 0; border: 0; box-shadow: none; background: transparent; }
.tabs { display: flex; gap: 6px; position: sticky; top: 0; background: var(--paper); padding-bottom: 10px; z-index: 2; }
.tab { flex: 1; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 11px; padding: 11px; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab b { width: 20px; height: 20px; border-radius: 50%; background: #e3e8f0; color: var(--muted);
  display: grid; place-items: center; font-size: 12px; }
.tab.is-active { border-color: var(--navy); color: var(--navy); background: #fff; }
.tab.is-active b { background: var(--accent); color: var(--navy); }
.tabpane { display: none; }
.tabpane.is-active { display: block; animation: fade .2s; }
.micro { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
label.full { display: block; font-size: 12px; color: var(--muted); margin-top: 10px; }
label.full .input { margin-top: 5px; }

/* Technique */
.tech-tools { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; background: #fafbfd; }
.tech-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tech-btn { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.tech-btn small { font-weight: 500; font-size: 10.5px; color: var(--muted); }
.tech-btn:hover { border-color: #c3cee0; }
.tech-btn.on { border-color: var(--accent); background: #fff8ec; }
.tech-btn.disabled, .tech-btn:disabled { opacity: .45; cursor: not-allowed; }
.qty-consult { border: 1px solid #f3d28a; background: #fff8ec; border-radius: 11px; padding: 12px 14px;
  font-size: 14px; color: #92590a; }
.qty-consult b { color: var(--navy); }
.qty-consult span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.tech-note { font-size: 12px; color: #92590a; background: #fff8ec; border: 1px solid #f3d28a;
  border-radius: 9px; padding: 9px 11px; margin: 10px 0 0; display: none; line-height: 1.5; }
.tech-note.show { display: block; }

/* Préflight — analyse de faisabilité du logo */
.art-check { margin-top: 10px; border-radius: 10px; padding: 11px 12px; border: 1px solid var(--line);
  background: #fff; display: none; }
.art-check.show { display: block; }
.art-check .ac-title { font-weight: 700; font-size: 13.5px; }
.art-check .ac-lines { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.art-check.ok   { border-color: #b7e4c7; background: #f0faf3; }
.art-check.ok .ac-title { color: #15803d; }
.art-check.warn { border-color: #f3d28a; background: #fff8ec; }
.art-check.warn .ac-title { color: #b45309; }
.art-check.bad  { border-color: #f3b4b4; background: #fef2f2; }
.art-check.bad .ac-title { color: #b91c1c; }
.ac-action { margin-top: 9px; width: 100%; border: 1.5px solid var(--blue); background: #fff; color: var(--blue-d);
  border-radius: 9px; padding: 9px; font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.ac-action:hover { background: #f2f6ff; }

/* Responsive modale */
@media (max-width: 900px) {
  .product-page { grid-template-columns: 1fr; }
  .modal { width: 96vw; height: 94vh; }
  .modal-body { grid-template-columns: 1fr; overflow-y: auto; }
  .modal .preview-stage { aspect-ratio: 1/1; }
  .site-nav { display: none; }
}

/* Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 100;
  opacity: 0; transition: .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

/* Responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; }
  .steps { display: none; }
}
