/* Gabarit - grille 4 px, icônes 18 px trait 1,75, cibles 36 px, violet = sélection. */
:root {
  --plum: #714b67; --plum-d: #5e3d55; --plum-t: #f3e9f0; --plum-l: #e6d3e0;
  --ink: #1f1d24; --mut: #77737f; --line: #e7e5ea; --bg: #eceaef; --surf: #fff; --soft: #f6f5f8;
  --dark: #2a2730; --dark2: #34303b; --dark3: #46414e; --ondark: #e9e6ee; --mutdark: #a19aab;
  --ok: #2e7d4f; --ok-t: #e6f3ea; --warn: #a8711a; --warn-t: #fbf1df; --err: #b3261e; --err-t: #fbe7e6;
  --r: 10px; --r-s: 8px; --sh: 0 1px 2px rgba(20, 16, 28, .06), 0 8px 24px rgba(20, 16, 28, .08);
  --ui: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
.ic { flex: none; display: block; }
code { font-family: var(--mono); font-size: 12px; }
.grow { flex: 1; }
.mut { color: var(--mut); margin: 0; }
.sm { font-size: 12px; }
.err { color: var(--err); margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--plum); margin: 0 0 8px; }
h1 { font-size: 32px; line-height: 1.08; letter-spacing: -.025em; margin: 0 0 12px; font-weight: 700; }
.lead { color: var(--mut); font-size: 16px; margin: 0 0 24px; max-width: 46ch; }

/* boutons */
.pri, .sec, .ghost { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid transparent; font-weight: 600; white-space: nowrap; }
.pri { background: var(--plum); color: #fff; box-shadow: 0 2px 8px rgba(113, 75, 103, .35); }
.pri:hover:not(:disabled) { background: var(--plum-d); }
.sec { background: var(--surf); border-color: var(--line); box-shadow: var(--sh); }
.sec:hover { border-color: var(--plum-l); }
.ghost { background: var(--surf); border-color: var(--line); font-weight: 500; }
.ghost:hover:not(:disabled) { background: var(--soft); }
.ghost.sm, .sec.sm { height: 30px; padding: 0 10px; font-size: 12px; gap: 6px; }
.big { height: 44px; padding: 0 18px; font-size: 15px; border-radius: var(--r); }
.ib { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-s); border: 0; background: transparent; color: inherit; }
.ib:hover:not(:disabled) { background: rgba(127, 120, 140, .14); }
.ib.on { background: var(--surf); color: var(--plum); box-shadow: var(--sh); }
.ib.sm { width: 30px; height: 30px; }

/* barre du haut */
.bar { position: sticky; top: 0; z-index: 30; height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 12px; background: var(--dark); color: var(--ondark); }
.bl, .br { display: flex; align-items: center; gap: 8px; min-width: 0; }
.br { justify-content: flex-end; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--plum); flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.brand { font-weight: 600; margin-right: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--r-s); border: 0; background: var(--dark2); color: var(--ondark); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { background: var(--dark3); }
.steps { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.stp { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: 99px; background: transparent; color: var(--mutdark); font-size: 13px; }
.stp span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--dark3); font-size: 11px; font-weight: 600; }
.stp.on { color: #fff; }
.stp.on span { background: var(--plum); color: #fff; }
.stp.done span { background: #3b5e48; color: #cfe9d8; }
.stp:hover { color: #fff; }
.sep { width: 12px; height: 1px; background: var(--dark3); display: inline-block; }
.modes { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--dark2); }
.modes button { display: grid; place-items: center; width: 40px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--mutdark); }
.modes button.on { background: #fff; color: var(--dark); }
.modes button:hover:not(.on) { color: #fff; }
.vb { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 7px; font: 500 12px var(--mono); }
.vb.ok { background: rgba(46, 125, 79, .22); color: #8fd3a8; }
.vb.warn { background: rgba(168, 113, 26, .25); color: #f0c879; }
.br .ib { color: var(--ondark); }
.br .ib:hover:not(:disabled) { background: var(--dark2); }
.conn { font-size: 12px; color: var(--mutdark); display: inline-flex; align-items: center; gap: 6px; }
.conn::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dark3); }
.conn.on::before { background: #5cc489; }

#app { min-height: calc(100vh - 52px); }

/* écran 1 : base */
.wiz { display: grid; grid-template-columns: minmax(360px, 560px) 1fr; gap: 40px; max-width: 1320px; margin: 0 auto; padding: 48px 32px; align-items: start; }
.frm { display: grid; gap: 16px; margin-top: 32px; }
.fr { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px; }
.fr.top { align-items: start; }
.fr > span { font-weight: 600; font-size: 13px; }
.fr select { height: 36px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 10px; background: var(--surf); max-width: 240px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e3e1e7; }
.seg button { height: 30px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--mut); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--surf); color: var(--plum); box-shadow: 0 1px 3px rgba(20, 16, 28, .12); }
.seg.w { display: flex; width: 100%; }
.seg.w button { flex: 1; }
.lgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lcard { display: grid; gap: 6px; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surf); text-align: center; font-size: 12px; }
.lcard b { font-weight: 600; }
.lcard:hover { border-color: var(--plum-l); }
.lcard.on { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-t); }
.th { display: block; aspect-ratio: 210 / 297; overflow: hidden; border-radius: 4px; background: #fff; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.thz { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(.13); pointer-events: none; }
.lcard .thz { transform: scale(.14); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipb { height: 32px; padding: 0 12px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--surf); font-weight: 500; }
.chipb.on { border-color: var(--plum); color: var(--plum); background: var(--plum-t); }
.dots { display: flex; gap: 10px; }
.dot { position: relative; display: block; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 0 0 3px var(--surf), 0 0 0 4px var(--line); cursor: pointer; flex: none; }
.dot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.wact { display: flex; gap: 8px; margin-top: 32px; }
.wr { position: sticky; top: 84px; }
.live { background: #dcd9e0; border-radius: 16px; padding: 28px; display: flex; justify-content: center; overflow: hidden; max-height: calc(100vh - 120px); }
.livez { zoom: .62; }
.livez .pg { box-shadow: 0 20px 50px rgba(20, 16, 28, .18); }

/* écran 2 : document */
.pick { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.dgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.dcard { display: grid; gap: 4px; padding: 10px 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surf); text-align: left; transition: transform .15s, box-shadow .15s; }
.dcard:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--plum-l); }
.dcard.on { border-color: var(--plum); }
.dcard b { font-size: 15px; margin-top: 6px; }
.dcard code { color: var(--mut); }
.dth { display: block; aspect-ratio: 210 / 230; overflow: hidden; border-radius: 8px; background: #fff; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.dth .thz { transform: scale(.29); }

/* écran 3 : atelier */
.atl { display: grid; grid-template-columns: 56px 232px 1fr 288px; height: calc(100vh - 52px); }
.atl.prev { grid-template-columns: 1fr; }
.atl.code { grid-template-columns: 1fr minmax(420px, 46%); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--surf); border-right: 1px solid var(--line); }
.rail button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--mut); }
.rail button:hover { background: var(--soft); color: var(--ink); }
.rail button.on { background: var(--plum); color: #fff; box-shadow: 0 2px 8px rgba(113, 75, 103, .35); }
.pal { background: var(--surf); border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; }
.pal h3 { font-size: 13px; margin: 2px 0 12px; }
.pal h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 16px 0 6px; }
.srch { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-s); background: var(--soft); color: var(--mut); margin-bottom: 12px; }
.srch input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surf); font-size: 12px; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 16, 28, .05); cursor: grab; user-select: none; }
.tile:hover { border-color: var(--plum-l); color: var(--plum); box-shadow: var(--sh); }
.tile:active { cursor: grabbing; }
.hint { font-size: 12px; color: var(--mut); text-align: center; margin: 14px 0 0; }
.trows { display: grid; gap: 4px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: var(--r-s); background: transparent; text-align: left; }
.trow i { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.trow span { display: grid; min-width: 0; }
.trow b { font-size: 13px; font-weight: 600; }
.trow small { color: var(--mut); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow:hover { background: var(--soft); }
.trow.on { border-color: var(--plum); background: var(--plum-t); }
.tune { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fr2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.fr2 select, .fr2 input[type=number] { height: 32px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 8px; background: var(--surf); width: 140px; }
.fr2 .dot { width: 26px; height: 26px; }
.lrow { display: flex; align-items: center; gap: 4px; border-radius: var(--r-s); }
.lrow.on { background: var(--plum-t); }
.lsel { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border: 0; background: transparent; text-align: left; font-size: 13px; border-radius: var(--r-s); }
.lsel small { margin-left: auto; color: var(--mut); font-size: 11px; }
.lsel:hover { background: var(--soft); }

.cv { position: relative; min-width: 0; display: flex; flex-direction: column; }
.stage { flex: 1; overflow: auto; padding: 32px 24px 96px; background: var(--bg); }
.pages { width: max-content; margin: 0 auto; display: grid; gap: 24px; }
.dock { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surf); box-shadow: var(--sh); border: 1px solid var(--line); }
.dock .ib { width: 30px; height: 30px; font-size: 16px; }
.zv { font: 500 12px var(--mono); min-width: 44px; text-align: center; }
.lnb { height: 28px; min-width: 30px; border: 0; border-radius: 7px; background: transparent; font: 500 12px var(--mono); color: var(--mut); }
.lnb.on { background: var(--soft); color: var(--ink); }
.rec { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--plum-t); color: var(--plum); font: 500 12px var(--mono); margin-left: 4px; }

.ins { background: var(--surf); border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ins input:not([type=checkbox]):not([type=color]), .ins textarea, .ins select { width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; background: var(--soft); outline: none; }
.ins input:focus, .ins textarea:focus, .ins select:focus { border-color: var(--plum); background: var(--surf); }
.ins textarea { resize: vertical; min-height: 84px; }
.ih { display: flex; align-items: center; gap: 10px; }
.ih b { font-size: 15px; }
.ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-s); background: var(--plum-t); color: var(--plum); }
.cap { font-size: 12px; color: var(--mut); margin: -6px 0 0; text-align: center; }
.ib-body { display: grid; gap: 8px; }
.inp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 10px; background: var(--soft); color: var(--mut); }
.inp:focus-within { border-color: var(--plum); background: var(--surf); }
.ins .inp input { border: 0 !important; background: transparent !important; padding: 8px 0 !important; font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.cond { display: grid; gap: 8px; padding: 8px 10px; border-radius: var(--r-s); background: var(--soft); }
.cond.on { background: var(--plum-t); }
.tg2 { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tg2 .lb { flex: 1; }
.tg2 input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg2 input + span { width: 36px; height: 22px; border-radius: 99px; background: #cfcbd5; position: relative; transition: background .15s; flex: none; }
.tg2 input + span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.tg2 input:checked + span { background: var(--plum); }
.tg2 input:checked + span::after { transform: translateX(14px); }
.tg2 input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 2px; }
.fmt { display: flex; gap: 4px; }
.fmt .ib { width: 34px; height: 34px; border: 1px solid var(--line); }
.fmt .ib.on { border-color: var(--plum); }
.anc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--r-s); background: var(--ok-t); color: var(--ok); font-size: 11px; }
.anc code { font-size: 11px; flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; order: -1; }
.anc span { display: inline-flex; align-items: center; gap: 2px; font: 600 11px var(--mono); }
.anc span.warn { color: var(--warn); }
.empty { margin: auto; text-align: center; color: var(--mut); display: grid; justify-items: center; gap: 10px; max-width: 220px; }
.empty p { margin: 0; font-size: 13px; }
.warnbox, .okbox { display: flex; gap: 8px; padding: 10px; border-radius: var(--r-s); font-size: 12px; margin: 0; }
.warnbox { background: var(--warn-t); color: #6e4a0f; }
.okbox { background: var(--ok-t); color: var(--ok); }

/* éléments éditables sur la page */
.editing .nblk, .editing .ublk, .editing th[data-c], .editing th[data-x] { cursor: pointer; }
.editing .nblk, .editing .ublk { position: relative; border-radius: 4px; outline: 1.5px solid transparent; outline-offset: 3px; transition: outline-color .1s; }
.editing .nblk:hover, .editing .ublk:hover { outline-color: var(--plum-l); }
.editing .nblk.sel, .editing .ublk.sel { outline-color: var(--plum); background: color-mix(in srgb, var(--plum-t) 55%, transparent); }
.editing th.sel { box-shadow: inset 0 0 0 2px var(--plum) !important; }
.editing .ublk { cursor: grab; }
.ublk.dragsrc { opacity: .35; }
.hid { opacity: .32; }
.gone { display: none !important; }
th.hid, td.hid { opacity: .25; text-decoration: line-through; }
.hidtag, .condtag { position: absolute; top: -8px; right: 6px; font: 600 10px var(--ui); font-style: normal; padding: 1px 6px; border-radius: 99px; background: var(--dark); color: #fff; opacity: 1; }
.condtag { background: var(--plum); left: -10px; right: auto; }
.zone { display: grid; gap: 6px; margin: 6px 0; }
.zone.ed { position: relative; min-height: 18px; border-radius: 6px; }
.zadd { height: 18px; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; opacity: 0; transition: opacity .12s; }
.zadd::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--plum-l); }
.zadd span { position: relative; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--plum); color: #fff; font: 600 13px/1 var(--ui); }
.zone.ed:hover .zadd, .zone.ed.empty .zadd { opacity: 1; }
.zone.ed.empty .zadd { opacity: .35; }
.zone.ed.empty:hover .zadd { opacity: 1; }
.dragging.drag-blk .zone.ed { outline: 1.5px dashed var(--plum-l); outline-offset: 4px; min-height: 28px; }
.dragging.drag-blk .zone.ed .zadd { opacity: 0; }
.zone.over { outline-color: var(--plum) !important; background: color-mix(in srgb, var(--plum-t) 60%, transparent); }
.dropline { height: 3px; border-radius: 3px; background: var(--plum); box-shadow: 0 0 0 3px var(--plum-t); margin: -1px 0; }
.coldrop { display: none; }
.dragging.drag-col .coldrop { display: flex; align-items: center; justify-content: center; height: 34px; margin-bottom: 6px; border: 1.5px dashed var(--plum); border-radius: 6px; color: var(--plum); font: 600 11px var(--ui); background: var(--plum-t); }
.coldrop.over { background: var(--plum) !important; color: #fff !important; }
.float { position: absolute; top: -40px; right: 0; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 9px; background: var(--dark); color: #fff; box-shadow: var(--sh); z-index: 5; }
.float button, .float .grip { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #fff; }
.float button:hover { background: var(--dark3); }
.float .grip { cursor: grab; color: var(--mutdark); }
.dragghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px; background: var(--plum); color: #fff; font-weight: 600; font-size: 13px; box-shadow: 0 10px 30px rgba(113, 75, 103, .45); }
.dragging, .dragging * { cursor: grabbing !important; user-select: none; }
.tile, .editing .ublk { touch-action: none; }
.addmenu { position: fixed; z-index: 40; width: 180px; padding: 4px; border-radius: var(--r); background: var(--surf); box-shadow: 0 12px 40px rgba(20, 16, 28, .22); border: 1px solid var(--line); display: grid; }
.addmenu button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.addmenu button:hover { background: var(--plum-t); color: var(--plum); }

/* panneau code */
.codep { background: var(--dark); color: var(--ondark); display: flex; flex-direction: column; min-width: 0; }
.ctabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--dark2); overflow-x: auto; align-items: center; }
.ctabs button:not(.ghost) { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--mutdark); font-size: 12px; white-space: nowrap; }
.ctabs button.on { background: var(--dark2); color: #fff; }
.ctabs.light { border-color: var(--line); background: var(--surf); }
.ctabs.light button.on { background: var(--plum-t); color: var(--plum); }
.cbody { flex: 1; overflow: auto; padding: 10px 0; font: 12px/1.7 var(--mono); }
.cl { display: flex; gap: 14px; padding: 0 14px; white-space: pre; }
.cl span { color: #6d6677; min-width: 22px; text-align: right; user-select: none; flex: none; }
.cl code { font-size: 12px; }
.tk { color: #e5a6d3; font-weight: 400; }
.at { color: #9fc2ff; font-style: normal; }
.st { color: #c6e3a6; font-style: normal; }
.cissues { display: grid; gap: 6px; padding: 10px; }
.ci { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: var(--r-s); background: var(--dark2); font-size: 12px; }
.ci.warn { color: #f0c879; }
.ci.err { color: #ff9c94; }
.ci span { color: var(--ondark); }

/* écran 4 : publier */
.pub { display: grid; grid-template-columns: 220px 1fr 300px; height: calc(100vh - 52px); }
.pvl, .pvr { background: var(--surf); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pvl { border-right: 1px solid var(--line); }
.pvr { border-left: 1px solid var(--line); }
.pvl h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 2px 0 6px; }
.pvr h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 8px 0 0; }
.vrow { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: var(--r-s); background: var(--soft); font-size: 13px; position: relative; }
.vrow small { color: var(--mut); font-size: 11px; margin-left: auto; }
.vrow.cur { background: var(--plum); color: #fff; justify-content: space-between; }
.vrow .ib { margin-right: -6px; }
.pvc { display: flex; flex-direction: column; min-width: 0; }
.split { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.spl { overflow: auto; padding: 24px; background: var(--bg); }
.spr { overflow: auto; background: var(--dark); color: var(--ondark); display: flex; flex-direction: column; }
.spr .meta { margin: 0; padding: 10px 14px; font-size: 11px; color: var(--mutdark); border-bottom: 1px solid var(--dark2); }
.spr .meta code { font-size: 11px; color: #e5a6d3; }
.checks { display: grid; gap: 6px; }
.ck { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: var(--r-s); font-size: 12.5px; font-weight: 500; }
.ck span { flex: 1; }
.ck.ok { background: var(--ok-t); color: var(--ok); }
.ck.warn { background: var(--warn-t); color: var(--warn); }
.ck.err { background: var(--err-t); color: var(--err); }
.hrow { display: flex; align-items: center; gap: 2px; font-size: 12px; padding-left: 8px; border-radius: var(--r-s); background: var(--soft); }
.hrow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pubact { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pubact .seg { grid-column: 1 / -1; }
.pubact .ib { border: 1px solid var(--line); width: 44px; height: 44px; }

/* dialogues */
dialog { border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(20, 16, 28, .35); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(31, 29, 36, .45); backdrop-filter: blur(2px); }
.dform { display: grid; gap: 10px; padding: 24px; width: 420px; max-width: 100%; }
.dform.wide { width: 640px; }
.dform h3 { margin: 0 0 2px; font-size: 18px; }
.dform input, .dform textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: var(--soft); outline: none; }
.dform input:focus, .dform textarea:focus { border-color: var(--plum); background: var(--surf); }
.dform textarea { font: 12px/1.5 var(--mono); }
.dact { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; align-items: center; }
.msg { margin: 0; padding: 10px; border-radius: var(--r-s); font-size: 12.5px; background: var(--soft); }
.msg.err { background: var(--err-t); color: var(--err); }
.rep { max-height: 60vh; overflow-y: auto; display: grid; }
.rep .g { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); padding: 12px 4px 4px; }
.rr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.rr span { display: grid; font-size: 13px; }
.rr small { color: var(--mut); font: 11px var(--mono); }

/* palette de commandes */
.cmdk { position: fixed; inset: 0; z-index: 50; background: rgba(31, 29, 36, .35); display: flex; justify-content: center; padding-top: 14vh; }
.cmdk[hidden] { display: none; }
.ck-box { width: 560px; max-width: calc(100vw - 32px); align-self: flex-start; background: var(--surf); border-radius: 16px; box-shadow: 0 30px 90px rgba(20, 16, 28, .4); overflow: hidden; }
.ck-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); color: var(--plum); }
.ck-in input { flex: 1; border: 0; outline: none; font-size: 16px; color: var(--ink); background: transparent; }
.ck-list { display: grid; padding: 6px; max-height: 50vh; overflow-y: auto; }
.ck-list button { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; color: var(--ink); }
.ck-list button span { flex: 1; }
.ck-list button.on { background: var(--plum); color: #fff; }
kbd { font: 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, .2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; padding: 10px 16px; border-radius: 10px; background: var(--dark); color: #fff; font-size: 13px; box-shadow: var(--sh); transition: opacity .2s, transform .2s; max-width: min(560px, calc(100vw - 32px)); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--err); }

/* ---------- page A4 (aperçu) ---------- */
.pg { position: relative; width: 794px; min-height: 1123px; padding: 48px 54px 84px; background: #fff; color: #1f1d24; font-size: 12.5px; line-height: 1.45; box-shadow: 0 1px 3px rgba(20, 16, 28, .1), 0 12px 32px rgba(20, 16, 28, .1); overflow: hidden; display: flex; flex-direction: column; }
.pg b { font-weight: 700; }
.pg { isolation: isolate; }
.pshape { position: absolute; z-index: -1; pointer-events: none; }
.t-bubble { left: 0; top: 0; width: 794px; height: 400px; }
.t-wave { left: 0; top: 0; width: 794px; height: 261px; }
.t-folder { left: 0; top: 0; width: 794px; height: 250px; }
.t-center { left: 0; top: 0; width: 794px; height: 181px; }
.t-dual { left: 0; top: 0; width: 794px; height: 68px; }
.t-dual2 { left: 0; top: 0; width: 79px; height: 159px; }
.t-lines { right: -408px; top: -189px; width: 1064px; height: 748px; }
.b-bubble { left: 0; bottom: 0; width: 567px; height: 259px; }
.b-wave { left: 0; bottom: 0; width: 794px; height: 204px; }
.b-dual { left: 0; bottom: 0; width: 794px; height: 68px; }
.b-dual2 { right: 0; bottom: 0; width: 79px; height: 159px; }
.b-lines { left: 0; bottom: 0; width: 794px; height: 108px; }
.hd { position: relative; margin-bottom: 24px; }
.lh.row { display: flex; gap: 16px; align-items: flex-start; }
.lh.sb { justify-content: space-between; }
.lh.mid { align-items: center; margin-bottom: 8px; }
.lh.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: start; }
.lh .c { display: grid; justify-items: center; gap: 6px; text-align: center; }
.lh .r { display: grid; justify-items: end; gap: 6px; text-align: right; }
.center-head { min-height: 133px; }
.fold-head { min-height: 154px; }
.lg { display: inline-flex; align-items: center; gap: 8px; font: 700 30px/1 var(--ui); letter-spacing: -.02em; color: #4d4252; white-space: nowrap; }
.lg span { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.lg-mid { font-size: 26px; } .lg-mid span { width: 30px; height: 30px; }
.lg-sm { font-size: 20px; } .lg-sm span { width: 22px; height: 22px; }
.lg-xs { font-size: 16px; } .lg-xs span { width: 18px; height: 18px; }
.ca { font-size: 11.5px; color: #3c3a42; line-height: 1.5; }
.ca.r { text-align: right; }
.tg { font-weight: 700; font-size: 12px; margin-top: 6px; }
.addr { display: flex; margin-bottom: 18px; }
.addr.right { justify-content: flex-end; }
.addr > div { width: 44%; font-size: 12px; line-height: 1.5; }
.addr.withtitle { justify-content: space-between; align-items: flex-end; }
.addr.withtitle > div { width: auto; }
.dt { font-size: 28px; font-weight: 500; margin: 0 0 14px; letter-spacing: -.01em; line-height: 1.2; }
.info { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 18px; font-size: 11.5px; }
.info > div { display: grid; }
.info b { font-weight: 700; }
.tw { position: relative; }
.ln { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ln th { font-weight: 700; padding: 6px 6px; text-align: left; }
.ln td { padding: 6px 6px; vertical-align: top; }
.ln .r { text-align: right; }
.ln .l { text-align: left; }
.tb-light thead th { border-bottom: 1px solid #1f1d24; }
.tb-light tbody tr + tr td { border-top: 1px solid #ececec; }
.tb-boxed th, .tb-boxed td { border: 1px solid #cfcfcf; }
.tb-boxed thead th { background: #f3f3f3; }
.tb-bold thead th { color: var(--acc); border-bottom: 2px solid var(--acc); text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; }
.tb-bold tbody td { border-bottom: 1px solid #e3e3e3; }
.tb-striped thead th { border-bottom: 1px solid #1f1d24; }
.tb-striped tbody tr:nth-child(odd) td { background: #f2f2f4; }
.tb-bubble { border-collapse: separate; border-spacing: 0; border: 1px solid #d6d6d6; border-radius: 10px; overflow: hidden; }
.tb-bubble thead th { background: color-mix(in srgb, var(--acc) 10%, #fff); }
.tb-bubble tbody tr + tr td { border-top: 1px solid #ececec; }
.tb-column th + th, .tb-column td + td { border-left: 1px solid #dcdcdc; }
.tb-column thead th { border-bottom: 1px solid #1f1d24; }
.tb-compact th, .tb-compact td { padding: 3px 5px; }
.tb-compact thead th { border-bottom: 1px solid #1f1d24; }
.th-lines thead th { border-bottom: 1.5px solid var(--acc); }
.th-lines tbody td { border-bottom: .5px solid #d9d9d9; }
.th-minimal thead th { border-bottom: 1px solid #1f1d24; }
.th-minimal tbody td { border-bottom: .5px solid #e4e4e4; }
.th-zebra thead th { background: var(--tint); }
.th-zebra tbody tr:nth-child(even) td { background: var(--tint); }
.th-filled thead th { background: var(--acc); color: var(--on); }
.th-filled tbody td { border-bottom: .5px solid #d9d9d9; }
.tail { margin-top: 14px; display: grid; gap: 12px; }
.tot { margin-left: auto; min-width: 46%; border-collapse: collapse; font-size: 11.5px; }
.tot td { padding: 5px 6px; }
.tot .r { text-align: right; }
.tot-native tr:first-child td { border-top: 1px solid #1f1d24; }
.tot-native tr.g td { font-weight: 700; border-top: 1px solid #1f1d24; color: var(--acc); }
.tot-plain tr.g td { border-top: 1.5px solid var(--acc); font-weight: 700; }
.tot-box { border: 1.5px solid var(--acc); }
.tot-box tr.g td { font-weight: 700; }
.tot-band tr.g td { background: var(--acc); color: var(--on); font-weight: 700; }
.pay { font-size: 11px; color: #3c3a42; }
.qr { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #555; }
.qr i { width: 52px; height: 52px; background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 10px 10px; border: 3px solid #fff; outline: 1px solid #ddd; }
.sig { margin-left: auto; width: 45%; min-height: 70px; border: 1px solid #cfcfcf; padding: 6px 8px; font-size: 11px; color: #666; }
.psign { width: 45%; min-height: 70px; border: 1px solid #c9c9c9; padding: 6px 8px; font-size: 10.5px; color: #555; }
.pimg { display: inline-grid; place-items: center; min-width: 90px; padding: 0 12px; border-radius: 4px; background: repeating-linear-gradient(45deg, #f1eef3 0 6px, #e8e3ec 6px 12px); color: var(--mut); font: 600 11px var(--ui); }
.pspace { background: repeating-linear-gradient(0deg, transparent 0 3px, #f3f0f5 3px 4px); border-radius: 3px; }
.editing .pspace { outline: 1px dashed #ddd; }
.ppage { position: relative; height: 18px; display: flex; align-items: center; justify-content: center; }
.ppage::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px dashed #c8c2cc; }
.ppage span { position: relative; background: #fff; padding: 0 8px; font: 600 10px var(--ui); color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.ft { position: absolute; left: 54px; right: 54px; bottom: 28px; display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: #777; padding-top: 6px; }
.ft > *:not(.shape) { position: relative; z-index: 1; }
.ft.rule { border-top: 1px solid #ddd; }
.ft.center { flex-direction: column; align-items: center; text-align: center; gap: 2px; }

/* petits écrans */
@media (max-width: 1100px) {
  .wiz { grid-template-columns: 1fr; padding: 32px 16px; }
  .wr { position: static; }
  .lgrid { grid-template-columns: repeat(4, 1fr); }
  .dgrid { grid-template-columns: repeat(2, 1fr); }
  .atl { grid-template-columns: 56px 200px 1fr 260px; }
  .steps .stp { font-size: 0; gap: 0; }
}
@media (max-width: 760px) {
  h1 { font-size: 28px; }
  .bar { grid-template-columns: 1fr auto; }
  .bc { display: none; }
  .vb { display: none; }
  .fr { grid-template-columns: 1fr; gap: 8px; }
  .lgrid { grid-template-columns: repeat(3, 1fr); }
  .pick { padding: 32px 16px; }
  .dgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .atl, .atl.code { grid-template-columns: 1fr; height: auto; }
  .rail, .pal, .ins { display: none; }
  .codep { min-height: 60vh; }
  .stage { padding: 16px 8px 80px; min-height: 70vh; }
  .pub { grid-template-columns: 1fr; height: auto; }
  .split { grid-template-columns: 1fr; }
  .live { padding: 12px; }
  .livez { zoom: .4; }
}
.cl code, .cbody { font-variant-ligatures: none; }
.codep .ib { color: var(--mutdark); }

/* habillage signalé à l'étape 1 */
.note { display: flex; align-items: center; gap: 10px; margin: 24px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--plum-t); color: var(--plum); font-size: 13px; }
.note span { flex: 1; }

/* atelier mobile : barre de blocs en bas, réglages en feuilles */
.mdock, .mclose { display: none; }
@media (max-width: 760px) {
  .atl, .atl.code { height: calc(100dvh - 52px); }
  .atl { position: relative; }
  .atl .cv { height: 100%; }
  .atl .stage { min-height: 0; padding: 12px 8px 120px; }
  .atl .dock { display: none; }
  .mdock { display: flex; position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 25; gap: 2px; padding: 6px; border-radius: 16px; background: var(--dark); box-shadow: 0 12px 32px rgba(20, 16, 28, .35); overflow-x: auto; scrollbar-width: none; }
  .mdock::-webkit-scrollbar { display: none; }
  .mt { flex: none; display: grid; justify-items: center; gap: 3px; width: 58px; padding: 8px 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--ondark); font-size: 10.5px; touch-action: pan-x; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .mt:active { background: var(--dark3); }
  .mt[data-sheet] { color: var(--mutdark); }
  .msep { flex: none; width: 1px; margin: 8px 4px; background: var(--dark3); }
  .editing .ublk { touch-action: pan-y; }
  .editing .ublk.sel { touch-action: none; }
  .atl.si .ins, .atl.sp .pal { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 58dvh; overflow-y: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(20, 16, 28, .25); animation: up .2s ease-out; }
  .atl.sp .pal { display: block; }
  .atl.si .mdock, .atl.sp .mdock { display: none; }
  .atl.si .ins::before, .atl.sp .pal::before { content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line); }
  .mclose { display: grid; place-items: center; position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--soft); z-index: 2; }
  .atl.si .ins .ih { padding-right: 40px; }
  .atl.si .ins .anc { display: none; }
  .bc { display: flex; }
  .bar { grid-template-columns: auto 1fr auto; gap: 6px; padding: 0 8px; }
  body[data-step="atelier"] .steps, body[data-step="pub"] .steps { display: none; }
  .bl .chip { max-width: 120px; }
  .modes button { width: 34px; }
  .br .ib[data-act="redo"] { display: none; }
  .br .pri { padding: 0 10px; }
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .atl.si .ins, .atl.sp .pal { animation: none; } }
.fatal { max-width: 420px; margin: 80px auto; padding: 16px; border-radius: 10px; background: var(--surf); text-align: center; }

/* réglages par élément (aperçu) */
.hbg-tint { background: var(--tint); padding: 14px 16px; border-radius: 2px; }
.hbg-solid { background: var(--acc); color: var(--on); padding: 14px 16px; border-radius: 2px; }
.hbg-solid .ca, .hbg-solid .tg, .hbg-solid .lg { color: inherit !important; }
.hbg-solid .lg span { background: currentColor !important; }
.hrule { border-bottom: 1.5px solid var(--acc); padding-bottom: 10px; }
.logo-S .lg { font-size: 18px; } .logo-S .lg span { width: 20px; height: 20px; }
.logo-M .lg { font-size: 26px; } .logo-M .lg span { width: 30px; height: 30px; }
.logo-L .lg { font-size: 40px; } .logo-L .lg span { width: 46px; height: 46px; }
.logo-hide .lg { display: none; }
.noaddr .ca:not(.cli) { display: none; }
.notag .tg { display: none; }
.ts-S { font-size: 10.5px; } .ts-M { font-size: 12px; } .ts-L { font-size: 13.5px; }
.ft.split { flex-direction: row; justify-content: space-between; align-items: flex-end; text-align: left; }
.ft.rule.acc { border-top-color: var(--acc); }
.ft.fs-S { font-size: 9px; } .ft.fs-M { font-size: 11.5px; }
.editing [data-h] { cursor: pointer; outline: 1.5px solid transparent; outline-offset: 4px; border-radius: 4px; transition: outline-color .1s; }
.editing [data-h]:hover { outline-color: var(--plum-l); }
.editing [data-h][data-sel] { outline-color: var(--plum); }
.pick.wide { max-width: 1280px; }
.dgrid.five { grid-template-columns: repeat(5, 1fr); }
.dcard small { font-size: 12px; }
.orow { display: grid; gap: 6px; }
.orow > span { font-size: 12px; font-weight: 600; color: var(--mut); }
.orow .seg button { padding: 0 6px; font-size: 12px; min-width: 0; }
@media (max-width: 1100px) { .dgrid.five { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .dgrid.five { grid-template-columns: 1fr 1fr; } }
.acct { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; margin-left: 4px; border-radius: 8px; background: var(--dark2); color: var(--ondark); font-size: 12.5px; text-decoration: none; max-width: 150px; }
.acct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct:hover { background: var(--dark3); }
a.mark { display: block; }
.cbody.locked { filter: blur(5px); user-select: none; pointer-events: none; }
.codep, .spr { position: relative; }
.locknote { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 10px; padding: 20px 22px; border-radius: 14px; background: var(--surf); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); text-align: center; width: min(320px, 90%); }
.locknote p { margin: 0; font-weight: 600; }
.locknote .pri { text-decoration: none; }
.dact a { text-decoration: none; }
@media (max-width: 760px) { .acct span { display: none; } }
