/* Interface de l'éditeur Gen2 (hors fiche). */
:root:not(.sheet *){
  --bg:#EFEDEA; --panel:#FFFFFF; --panel2:#F7F6F4; --ink:#1D1A18; --muted:#6A625C; --line:#DDD7D1; --focus:#E2561F; --brandc:#C9481A;
  --danger:#B42318; --ok:#1F7A4D;
  --a:#FF6B35; --a-ink:#141414; --logo:url(img/logo-ordiplus.webp);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root{ --bg:#141210; --panel:#1E1B19; --panel2:#262220; --ink:#F1ECE8; --muted:#A99E96; --line:#38312C; --brandc:#FF8452; --danger:#F97066; --ok:#47CD89; color-scheme:dark; }
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 "Instrument Sans",system-ui,sans-serif;display:flex;flex-direction:column}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}.bar:not(.sheet *){display:flex;align-items:center;gap:16px;padding:10px 16px;padding-top:calc(10px + env(safe-area-inset-top,0px));background:var(--panel);border-bottom:1px solid var(--line);flex-wrap:wrap}.brand:not(.sheet *){display:flex;align-items:center;gap:10px;font-size:17px}.brand b:not(.sheet *){font-weight:700}.actions:not(.sheet *){display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-left:auto}.sep:not(.sheet *){width:1px;height:24px;background:var(--line);margin:0 4px}.btn:not(.sheet *){background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:7px 12px;cursor:pointer;font-weight:500;white-space:nowrap;line-height:1.2;display:inline-flex;align-items:center;gap:6px}.btn:hover:not(.sheet *){border-color:var(--muted)}.btn.primary:not(.sheet *){background:var(--ink);color:var(--bg);border-color:var(--ink)}.btn.ghost:not(.sheet *){background:transparent}.btn.danger:not(.sheet *){color:var(--danger)}.btn.icon:not(.sheet *){width:36px;justify-content:center;font-size:20px;padding:4px}.btn.small:not(.sheet *){padding:4px 8px;font-size:13px}.btn[disabled]:not(.sheet *){opacity:.5;cursor:progress}.file:not(.sheet *){position:relative;overflow:hidden}.file input:not(.sheet *){position:absolute;inset:0;opacity:0;cursor:pointer}.layout:not(.sheet *){flex:1;min-height:0;display:grid;grid-template-columns:minmax(340px,420px) 1fr}.editor:not(.sheet *){overflow-y:auto;background:var(--panel);border-right:1px solid var(--line);padding:10px 14px 60px}.stagewrap:not(.sheet *){min-width:0;min-height:0;display:flex;flex-direction:column;padding:12px 18px 18px;gap:10px}.stagebar:not(.sheet *){display:flex;align-items:center;gap:8px;flex-wrap:wrap}.picker:not(.sheet *){flex-direction:column;align-items:flex-start;gap:0;min-width:220px}.picker span:not(.sheet *){font-weight:700;font-size:15px}.picker small:not(.sheet *){color:var(--muted);font-size:12px}.color:not(.sheet *){display:flex;align-items:center;gap:6px;margin-left:auto;font-size:13px;color:var(--muted)}.color input:not(.sheet *){width:36px;height:32px;border:1px solid var(--line);border-radius:8px;padding:2px;background:var(--panel2);cursor:pointer}.swatches:not(.sheet *){display:flex;gap:5px}.swatches button:not(.sheet *){width:22px;height:22px;border-radius:50%;border:2px solid var(--panel);box-shadow:0 0 0 1px var(--line);cursor:pointer;padding:0}.stage:not(.sheet *){flex:1;min-height:0;position:relative;display:flex;align-items:flex-start;justify-content:center}.stage .frame:not(.sheet *){position:relative;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.15),0 16px 40px -14px rgba(0,0,0,.35);background:#fff}.stage .frame .sheet:not(.sheet *){position:absolute;left:0;top:0;transform-origin:0 0}.hint:not(.sheet *){margin:0;color:var(--muted);font-size:13px;min-height:1.2em}.hint.err:not(.sheet *){color:var(--danger)}.hint.ok:not(.sheet *){color:var(--ok)}/* Formulaire */
.sec:not(.sheet *){border-bottom:1px solid var(--line)}.sec > summary:not(.sheet *){list-style:none;cursor:pointer;padding:12px 2px;font-weight:700;font-size:14px;display:flex;align-items:center;gap:8px}.sec > summary:not(.sheet *)::-webkit-details-marker{display:none}.sec > summary:not(.sheet *)::after{content:"";margin-left:auto;width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);transition:transform .15s}.sec[open] > summary:not(.sheet *)::after{transform:rotate(45deg)}.sec .body:not(.sheet *){display:flex;flex-direction:column;gap:10px;padding:0 2px 16px}.f:not(.sheet *){display:flex;flex-direction:column;gap:4px;min-width:0}.f > span:not(.sheet *){font-size:12px;font-weight:600;color:var(--muted)}.f input[type=text]:not(.sheet *),.f input:not([type]):not(.sheet *),.f select:not(.sheet *),.f textarea:not(.sheet *),.cell input:not(.sheet *),.cell select:not(.sheet *){width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:7px 9px}.f textarea:not(.sheet *){resize:vertical;min-height:70px;line-height:1.4}.grid2:not(.sheet *){display:grid;grid-template-columns:1fr 1fr;gap:10px}.grid3:not(.sheet *){display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}.tog:not(.sheet *){display:flex;align-items:center;gap:8px;font-weight:600;cursor:pointer}.tog input:not(.sheet *){width:18px;height:18px;accent-color:var(--focus)}.note:not(.sheet *){font-size:12px;color:var(--muted);margin:0}.list:not(.sheet *){display:flex;flex-direction:column;gap:8px}.item:not(.sheet *){border:1px solid var(--line);border-radius:9px;padding:8px;display:flex;flex-direction:column;gap:6px;background:var(--panel2)}.item .row:not(.sheet *){display:flex;gap:6px;align-items:center}.item .row > *:not(.sheet *){min-width:0}.cell:not(.sheet *){flex:1}.cell.ico:not(.sheet *){flex:0 0 132px}.cell.col:not(.sheet *){flex:0 0 44px}.cell.col input:not(.sheet *){padding:2px;height:34px}.mini:not(.sheet *){display:flex;gap:4px}.mini .btn:not(.sheet *){padding:3px 7px;font-size:13px}.chips:not(.sheet *){display:flex;flex-wrap:wrap;gap:5px}.chips .btn:not(.sheet *){font-size:12px;padding:4px 8px}.photos:not(.sheet *){display:grid;grid-template-columns:1fr 1fr;gap:10px}.phbox:not(.sheet *){border:1px dashed var(--line);border-radius:9px;padding:8px;display:flex;flex-direction:column;gap:6px;align-items:stretch;background:var(--panel2)}.phbox img:not(.sheet *){width:100%;height:110px;object-fit:contain;background:#fff;border-radius:6px}.phbox .row:not(.sheet *){display:flex;gap:6px;flex-wrap:wrap}/* Modales */
.modal:not(.sheet *){border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--ink);padding:0;width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 40px)}.modal.wide:not(.sheet *){width:min(1280px,calc(100vw - 24px));height:calc(100vh - 40px)}.modal.small:not(.sheet *){width:min(400px,calc(100vw - 24px))}.modal:not(.sheet *)::backdrop{background:rgba(10,8,7,.6)}.modal-head:not(.sheet *){display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--panel);z-index:1;flex-wrap:wrap}.modal-head h2:not(.sheet *){margin:0;font-size:18px}.modal-head .btn:not(.sheet *){margin-left:auto}.modal .muted:not(.sheet *),.muted:not(.sheet *){color:var(--muted);font-size:13px;margin:10px 18px}.tabs:not(.sheet *){display:flex;gap:4px}.tabs button:not(.sheet *){background:transparent;border:1px solid transparent;border-radius:999px;padding:5px 12px;cursor:pointer;font-weight:600;color:var(--muted)}.tabs button[aria-selected=true]:not(.sheet *){background:var(--ink);color:var(--bg)}.gallery:not(.sheet *){display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:22px 18px;padding:18px;align-items:start}.gcard:not(.sheet *){display:flex;flex-direction:column;gap:6px;background:none;border:0;padding:0;cursor:pointer;text-align:left}.gcard .frame:not(.sheet *){position:relative;overflow:hidden;width:100%;box-shadow:0 1px 2px rgba(0,0,0,.15),0 6px 18px -8px rgba(0,0,0,.3);background:#fff;border-radius:3px;outline:3px solid transparent;outline-offset:3px}.gcard .frame.P:not(.sheet *){aspect-ratio:210/297}.gcard .frame.L:not(.sheet *){aspect-ratio:297/210}.gcard .frame .sheet:not(.sheet *){position:absolute;left:0;top:0;transform-origin:0 0;pointer-events:none}.gcard[aria-current=true] .frame:not(.sheet *){outline-color:var(--focus)}.gcard b:not(.sheet *){font-size:14px}.gcard small:not(.sheet *){color:var(--muted);font-size:12px}.saved:not(.sheet *){list-style:none;margin:0;padding:0 18px 18px;display:flex;flex-direction:column;gap:8px}.saved li:not(.sheet *){display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;padding:8px 10px}.saved li div:not(.sheet *){flex:1;min-width:0}.saved li b:not(.sheet *){display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.saved li small:not(.sheet *){color:var(--muted)}.login:not(.sheet *){display:flex;flex-direction:column;gap:12px;padding:20px}.login h2:not(.sheet *){margin:0}.login .muted:not(.sheet *){margin:0}.login label:not(.sheet *){display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:13px}.login input:not(.sheet *){background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:8px 10px}.login .row:not(.sheet *){display:flex;gap:8px;justify-content:flex-end}.err:not(.sheet *){color:var(--danger);min-height:1em;margin:0;font-size:13px}

#print-root{display:none}
@media print{
  body > *:not(#print-root){display:none !important}
  html,body{background:#fff;height:auto;display:block}
  #print-root{display:block}#print-root .sheet:not(.sheet *){transform:none !important}
}

@media (max-width:900px){.layout:not(.sheet *){grid-template-columns:1fr;grid-template-rows:auto auto}.stagewrap:not(.sheet *){order:-1;min-height:60vh}.editor:not(.sheet *){border-right:0;border-top:1px solid var(--line);overflow:visible}
  body{height:auto}.color:not(.sheet *){margin-left:0}
}
@media (max-width:520px){.grid3:not(.sheet *){grid-template-columns:1fr 1fr}.cell.ico:not(.sheet *){flex-basis:104px}.picker:not(.sheet *){min-width:0;flex:1}
}
@media (prefers-reduced-motion:reduce){*{transition:none !important}}

/* Recherche de modèle, catalogue,réglages du magasin */
.finder:not(.sheet *){position:sticky;top:-10px;z-index:2;background:var(--panel);padding:10px 0 8px;margin-top:-10px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:8px}.finder input[type=search]:not(.sheet *),.catphotos input[type=search]:not(.sheet *){width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:9px;padding:9px 11px;font-size:15px}.finder .f > span:not(.sheet *){font-size:13px;color:var(--ink)}.results:not(.sheet *){display:flex;flex-direction:column;gap:4px;max-height:52vh;overflow-y:auto}.res:not(.sheet *){display:flex;gap:10px;align-items:center;text-align:left;background:var(--panel2);border:1px solid var(--line);border-radius:9px;padding:6px 8px;cursor:pointer}.res:hover:not(.sheet *),.res:focus-visible:not(.sheet *){border-color:var(--focus)}.res img:not(.sheet *),.res .noimg:not(.sheet *){width:64px;height:46px;object-fit:contain;background:#fff;border-radius:6px;flex:none}.res span:not(.sheet *){display:flex;flex-direction:column;min-width:0}.res b:not(.sheet *){font-size:14px}.res small:not(.sheet *){color:var(--muted);font-size:12px}.banner:not(.sheet *){display:flex;gap:10px;align-items:center;justify-content:space-between;background:color-mix(in srgb,var(--focus) 12%,var(--panel));border:1px solid color-mix(in srgb,var(--focus) 40%,var(--line));border-radius:9px;padding:8px 10px;font-size:13px}.catphotos:not(.sheet *){display:flex;flex-direction:column;gap:8px}.catgrid:not(.sheet *){display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}.cat:not(.sheet *){margin:0;border:1px solid var(--line);border-radius:8px;background:var(--panel2);padding:5px;display:flex;flex-direction:column;gap:5px}.cat img:not(.sheet *){width:100%;height:78px;object-fit:contain;background:#fff;border-radius:5px}.cat figcaption:not(.sheet *){display:flex;gap:4px;justify-content:center}.shopform:not(.sheet *){display:flex;flex-direction:column;gap:10px;padding:0 18px 18px}.shopform h3:not(.sheet *){margin:6px 0 0;font-size:14px}.row2:not(.sheet *){display:flex;gap:10px;align-items:center;flex-wrap:wrap}.row2.end:not(.sheet *){justify-content:flex-end;margin-top:6px}.shopform input[type=text]:not(.sheet *){width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:7px 9px}.shopform select:not(.sheet *){width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:7px 9px}.shopform input[type=color]:not(.sheet *){width:40px;height:30px;border:1px solid var(--line);border-radius:7px;padding:2px;background:var(--panel2)}.sheet iframe.gen1{display:block;border:0;width:100%;height:100%;background:#fff}.btn.switch:not(.sheet *){color:var(--ink);text-decoration:none;font-size:13px;font-weight:600;margin-left:4px;padding:5px 10px}/* Portail de connexion : rien de l'éditeur n'est visible avant la connexion */
body.locked > header:not(.sheet *),body.locked > main:not(.sheet *){ display: none !important; }.gate:not(.sheet *){ display: none; }body.locked.gate-on .gate:not(.sheet *){ display: flex; }.gate:not(.sheet *){ min-height: 100vh; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }.gate-card:not(.sheet *){ width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.35); }.gate-card img:not(.sheet *){ align-self: center; }.gate-card h1:not(.sheet *){ margin: 6px 0 0; font-size: 19px; text-align: center; text-wrap: balance; }.gate-sub:not(.sheet *){ margin: 0 0 10px; text-align: center; color: var(--muted); font-size: 13px; }.gate-card label:not(.sheet *){ font-weight: 600; font-size: 13px; margin-top: 4px; }.gate-card input:not(.sheet *){ background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }.gate-card .btn.primary:not(.sheet *){ justify-content: center; padding: 10px; margin-top: 6px; }.gate-alt:not(.sheet *){ text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
