/* TriAxƎD — interface principale. Charte : noir profond, anthracite, orange lumineux, blanc métallique.
   © 2026 DMS-TECH */
:root {
  --bg: #08090b; --bg2: #101216; --panel: #15171c; --panel2: #1b1e24; --line: #2a2e36; --line2: #353a44;
  --text: #e9ecf1; --muted: #9aa1ad; --dim: #6b7280;
  --orange: #ff7a00; --orange2: #ff9a2e; --orange-glow: rgba(255, 122, 0, .35); --orange-soft: rgba(255, 122, 0, .14);
  --ok: #22c55e; --warn: #f59e0b; --err: #ef4444; --blue: #1e90ff;
  --radius: 8px; --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.35 var(--font); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---------- Écran de démarrage ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; background: radial-gradient(ellipse at 50% 40%, #1a1206 0%, #050505 70%); display: grid; place-items: center; transition: opacity .35s; }
#splash.done { opacity: 0; pointer-events: none; }
#splash .box { width: min(640px, 90vw); text-align: center; }
#splash img { width: 100%; height: auto; border-radius: 6px; }
#splash .bar { height: 4px; background: #222; border-radius: 4px; margin: 22px auto 10px; width: 70%; overflow: hidden; }
#splash .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange2)); box-shadow: 0 0 12px var(--orange-glow); transition: width .2s; }
#splash .msg { color: var(--muted); font-size: 12px; min-height: 16px; }
#splash .err { color: var(--err); margin-top: 12px; white-space: pre-wrap; }

/* ---------- Structure ---------- */
#app { display: grid; grid-template-rows: auto auto 1fr auto; height: 100vh; }
.topbar { display: flex; align-items: stretch; background: linear-gradient(#121418, #0b0c0f); border-bottom: 1px solid var(--line); min-height: 64px; }
.brand { display: flex; align-items: center; padding: 4px 12px 4px 8px; flex: none; cursor: pointer; }
.brand img { height: 56px; width: auto; display: block; }
.brand img.compact { display: none; height: 44px; }
.tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 96px; padding: 6px 12px; border: 0; background: none; color: var(--text); cursor: pointer; border-right: 1px solid #1c1f25; font-size: 13.5px; position: relative; }
.tab svg.i { width: 26px; height: 26px; }
.tab:hover { background: #191c22; }
.tab.active { background: linear-gradient(#ff8a1a, #e86a00); color: #fff; box-shadow: inset 0 -3px 0 #ffb366, 0 0 18px var(--orange-glow); border-radius: 6px 6px 0 0; }
.tab .soon { position: absolute; top: 4px; right: 6px; font-size: 9px; color: var(--orange2); }
.top-actions { display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { background: #1e2128; }
.icon-btn svg.i { width: 24px; height: 24px; }
.badge-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px var(--orange); }

.toolbar { display: flex; align-items: stretch; gap: 2px; padding: 6px 8px; background: #0e1013; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; min-height: 74px; }
.tb-group { display: flex; gap: 2px; padding-right: 6px; margin-right: 4px; border-right: 1px solid var(--line); }
.tb-group:last-child { border-right: 0; }
.tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 64px; max-width: 96px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text); cursor: pointer; font-size: 12px; line-height: 1.1; text-align: center; white-space: normal; }
.tb svg.i { width: 24px; height: 24px; }
.tb:hover:not(:disabled) { background: #1b1e24; border-color: var(--line2); }
.tb.active { background: linear-gradient(#ff8a1a, #e86a00); border-color: #ffb366; color: #fff; box-shadow: 0 0 14px var(--orange-glow); }
.tb:disabled { opacity: .38; cursor: not-allowed; }
.tb .caret { font-size: 9px; opacity: .7; margin-left: 2px; }
.tb-note { align-self: center; color: var(--muted); padding: 0 12px; max-width: 520px; font-size: 12px; }
.tb-note b { color: var(--orange2); }

.workspace { display: grid; grid-template-columns: 300px 1fr 330px; gap: 8px; padding: 8px; min-height: 0; background: var(--bg); }
.workspace.no-right { grid-template-columns: 300px 1fr; }
.col { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; scrollbar-width: thin; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.panel > h3 .grow { flex: 1; }
.panel > h3 .chev { transition: transform .15s; width: 16px; height: 16px; }
.panel.collapsed > h3 .chev { transform: rotate(-90deg); }
.panel.collapsed > .body { display: none; }
.panel > .body { padding: 8px 10px; }
.sub { border-top: 1px solid var(--line); }
.sub > h4 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 9px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.sub > h4 .chev { width: 14px; height: 14px; transition: transform .15s; }
.sub.collapsed > h4 .chev { transform: rotate(-90deg); }
.sub.collapsed > .body { display: none; }
.sub > .body { padding: 2px 10px 10px; }
.state-ok { color: var(--ok); } .state-warn { color: var(--warn); } .state-err { color: var(--err); }
.pill { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; }
.pill.ok { background: var(--ok); } .pill.warn { background: var(--warn); } .pill.err { background: var(--err); } .pill.na { background: #3a3f48; }

/* ---------- Arborescence ---------- */
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 16px; }
.node { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.node:hover { background: #1c1f25; }
.node.sel { background: linear-gradient(90deg, rgba(255,122,0,.35), rgba(255,122,0,.12)); border-color: var(--orange); }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.node .nm input { width: 100%; background: #0c0d10; border: 1px solid var(--orange); border-radius: 4px; padding: 1px 4px; }
.node .mini { width: 22px; height: 22px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 4px; padding: 0; }
.node .mini:hover { color: var(--text); background: #262a32; }
.node .mini svg.i { width: 16px; height: 16px; }
.node .mini.off { opacity: .45; }
.node.hidden-obj .nm { opacity: .45; text-decoration: line-through; }
.node .tw { width: 14px; height: 14px; color: var(--muted); }
.tree-actions { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 2px 0; }
.tree-actions button { font-size: 11.5px; }

/* ---------- Formulaires ---------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 5px 8px; align-items: center; }
.kv > label, .kv > .k { color: var(--muted); }
.kv .v { overflow: hidden; text-overflow: ellipsis; }
.xyz { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.xyz label { position: relative; }
.xyz label::before { content: attr(data-axis); position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; }
.xyz label[data-axis=X]::before { color: #ff5a4f; } .xyz label[data-axis=Y]::before { color: #45d16b; } .xyz label[data-axis=Z]::before { color: #4aa3ff; }
.xyz input { padding-left: 18px !important; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.xyz input { padding-right: 3px !important; font-size: 12px; }
.kv { grid-template-columns: 88px minmax(0, 1fr); }
input[type=number], input[type=text], select, textarea { width: 100%; background: #0c0d10; border: 1px solid var(--line2); border-radius: 6px; padding: 5px 7px; min-height: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }
input[type=color] { width: 44px; height: 28px; padding: 0 2px; border: 1px solid var(--line2); border-radius: 6px; background: #0c0d10; }
input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--orange); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line2); background: #1d2027; color: var(--text); cursor: pointer; min-height: 30px; }
.btn:hover:not(:disabled) { border-color: var(--orange); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(#ff8d22, #e86a00); border-color: #ffab55; color: #fff; font-weight: 600; box-shadow: 0 0 16px var(--orange-glow); }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }
.btn.small { padding: 3px 8px; min-height: 24px; font-size: 12px; }
.btn.danger:hover { border-color: var(--err); color: #ffb4b4; }
.row { display: flex; gap: 6px; align-items: center; }
.row > * { min-width: 0; }
.help { color: var(--muted); font-size: 12px; }

/* ---------- Zone centrale ---------- */
.center { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; min-width: 0; }
.doc-tabs { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.doc-tab { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px 7px 0 0; cursor: pointer; white-space: nowrap; font-size: 13.5px; }
.doc-tab.active { background: #20232a; border-color: var(--line2); border-bottom-color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.doc-tab .x { width: 20px; height: 20px; border: 0; background: none; border-radius: 4px; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.doc-tab .x:hover { background: #333842; color: #fff; }
.doc-tab .dirty { color: var(--orange); font-weight: 700; }
.doc-tab.add { padding: 7px 12px; font-size: 18px; line-height: 1; }
.stage { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-tools { display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; background: #121418; border-right: 1px solid var(--line); z-index: 2; }
.side-tools .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: #191c21; }
.side-tools .icon-btn.active { background: linear-gradient(#ff8a1a, #e86a00); border-color: #ffb366; color: #fff; box-shadow: 0 0 10px var(--orange-glow); }
.side-tools .sep { height: 1px; background: var(--line); margin: 2px 0; }
#viewport { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.viewport-canvas { display: block; outline: none; touch-action: none; }
.viewcube { position: absolute; top: 10px; right: 10px; cursor: pointer; z-index: 3; filter: drop-shadow(0 0 8px rgba(255,122,0,.35)); }
.viewport-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.rubber-band { position: absolute; display: none; border: 1px dashed var(--orange); background: var(--orange-soft); }
.dim-label, .measure-label { position: absolute; transform: translate(-50%, -140%); padding: 3px 8px; border-radius: 5px; background: rgba(10,10,12,.88); border: 1px solid var(--line2); font-weight: 600; font-size: 12.5px; white-space: nowrap; display: none; }
.measure-label { border-color: #ffd400; color: #ffe266; transform: translate(-50%, -50%); }
.plate-label { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: rgba(10,10,12,.85); padding: 3px 12px; border-radius: 5px; border: 1px solid var(--line); font-size: 12.5px; z-index: 2; pointer-events: none; }
.drop-hint { position: absolute; inset: 0; display: none; place-items: center; background: rgba(255,122,0,.08); border: 2px dashed var(--orange); z-index: 4; font-size: 18px; font-weight: 600; pointer-events: none; }
.stage.dragover .drop-hint { display: grid; }
.empty-hint { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: var(--muted); z-index: 1; pointer-events: none; }
.empty-hint b { color: var(--text); font-size: 15px; display: block; margin-bottom: 6px; }

.parts { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; min-height: 128px; }
.part { flex: none; width: 124px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.part:hover { border-color: var(--line2); }
.part.sel { border-color: var(--orange); box-shadow: 0 0 12px var(--orange-glow); background: #20170d; }
.part canvas, .part .ph { width: 108px; height: 64px; border-radius: 5px; background: #0c0d10; align-self: center; }
.part .n { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part .d { font-size: 11px; color: var(--muted); white-space: nowrap; }
.part.add { display: grid; place-items: center; color: var(--muted); }
.part.add svg.i { width: 30px; height: 30px; }

/* ---------- Panneau droit (préparation) ---------- */
.right .panel > .body { padding: 0; }
.prep-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.prep-row .k { flex: 1; display: flex; align-items: center; gap: 8px; }
.prep-row .k svg.i { width: 18px; height: 18px; color: var(--muted); }
.prep-row select, .prep-row input { width: 120px; flex: none; }
.prep-row .row input { width: 56px; min-width: 0; flex: 1; }
.prep-row > select:only-of-type { min-width: 0; }
.prep-row > span:first-child + select { flex: 1; width: auto; }
.progress { height: 8px; border-radius: 6px; background: #262a31; overflow: hidden; margin: 2px 12px 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange2)); box-shadow: 0 0 10px var(--orange-glow); }
.estimate .prep-row .v { font-weight: 600; }
.note { margin: 6px 12px 10px; padding: 7px 9px; border-radius: 6px; font-size: 11.5px; color: var(--muted); background: #121418; border: 1px solid var(--line); }
.note.warn { border-color: rgba(245,158,11,.5); color: #fcd34d; }
.note.err { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.prep-actions { padding: 10px 12px 12px; display: grid; gap: 8px; }

/* ---------- Barre d'état ---------- */
.statusbar { display: flex; align-items: center; gap: 0; background: #0d0f12; border-top: 1px solid var(--line); min-height: 40px; padding: 0 10px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13px; }
.statusbar .seg { padding: 0 14px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.statusbar .seg:last-child { border-right: 0; }
.statusbar .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.statusbar .dot.busy { background: var(--orange); box-shadow: 0 0 8px var(--orange); animation: pulse 1s infinite; }
.statusbar .grow { flex: 1; border: 0; }
.statusbar select { width: auto; min-height: 26px; }
.statusbar .icon-btn { width: 34px; height: 34px; }
.statusbar .icon-btn.active { color: var(--orange); }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Menus, dialogues, notifications ---------- */
.menu { position: fixed; z-index: 500; min-width: 220px; background: #17191e; border: 1px solid var(--line2); border-radius: 8px; padding: 5px; box-shadow: 0 12px 40px rgba(0,0,0,.6); max-height: 70vh; overflow: auto; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); cursor: pointer; text-align: left; }
.menu button:hover:not(:disabled) { background: var(--orange-soft); }
.menu button:disabled { opacity: .4; cursor: not-allowed; }
.menu button svg.i { width: 18px; height: 18px; }
.menu .hd { padding: 6px 10px 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .kbd { margin-left: auto; color: var(--dim); font-size: 11px; }

.modal-bg { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: #16181d; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.modal.wide { width: min(820px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.modal header .grow { flex: 1; }
.modal .content { padding: 14px 16px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 160px; gap: 8px 12px; align-items: center; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .err { grid-column: 1 / -1; color: #fca5a5; }
.bar-lg { height: 10px; border-radius: 6px; background: #262a31; overflow: hidden; margin: 10px 0; }
.bar-lg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange2)); transition: width .1s; }
.report { width: 100%; border-collapse: collapse; }
.report td, .report th { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.report td:last-child { text-align: right; font-weight: 600; }
.about-logo { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.plug { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.plug .meta { color: var(--muted); font-size: 12px; }
.log { font: 11.5px/1.4 Consolas, monospace; max-height: 180px; overflow: auto; background: #0b0c0f; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.log .error { color: #fca5a5; }

#toasts { position: fixed; right: 16px; bottom: 52px; z-index: 700; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; padding: 10px 14px; border-radius: 8px; background: #1b1e24; border: 1px solid var(--line2); border-left: 4px solid var(--orange); box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: tin .2s; }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Adaptatif ---------- */
@media (max-width: 1500px) { .workspace { grid-template-columns: 260px 1fr 300px; } .tab { min-width: 82px; } }
@media (max-width: 1250px) {
  .brand img.full { display: none; } .brand img.compact { display: block; }
  .workspace { grid-template-columns: 240px 1fr; } .workspace > .right { display: none; }
  .workspace.show-right > .right { display: flex; position: fixed; right: 8px; top: 150px; bottom: 50px; width: 320px; z-index: 50; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; } .workspace > .left { display: none; }
  .workspace.show-left > .left { display: flex; position: fixed; left: 8px; top: 150px; bottom: 50px; width: 290px; z-index: 50; }
  .tab { min-width: 70px; padding: 4px 8px; font-size: 12px; } .tab svg.i { width: 22px; height: 22px; }
  .tb { min-width: 56px; font-size: 11px; }
  .parts { min-height: 0; }
}
.pro-tag { color: var(--orange2); font-weight: 700; font-size: 10px; }
.brush-settings { flex-direction: column; justify-content: center; gap: 4px; min-width: 260px; }
.brush-row { display: grid; grid-template-columns: 64px 1fr 56px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.brush-row b { color: var(--text); text-align: right; }
.brush-settings .tb-note { padding: 0; font-size: 11.5px; }
/* Panneau « Outils de modélisation » */
.tools-panel .sub > .body { padding: 4px 10px 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.tool-grid.two { grid-template-columns: repeat(2, 1fr); margin-top: 5px; }
.tool-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 4px; border: 1px solid var(--line); border-radius: 7px; background: #191c21; color: var(--text); cursor: pointer; font-size: 11px; line-height: 1.15; text-align: center; }
.tool-btn svg.i { width: 18px; height: 18px; }
.tool-btn:hover:not(:disabled) { border-color: var(--orange); }
.tool-btn:disabled { opacity: .38; cursor: not-allowed; }
.tool-btn.active { background: linear-gradient(#ff8a1a, #e86a00); border-color: #ffb366; color: #fff; }

/* ===== Zone 3D agrandie (20/11/2026) : barres plus compactes, panneaux plus étroits et masquables, bandeau des pièces réduit ===== */
.topbar { min-height: 54px; }
.brand img { height: 46px; }
.tab { min-width: 84px; padding: 4px 10px; font-size: 13px; gap: 2px; }
.tab svg.i { width: 22px; height: 22px; }
.toolbar { min-height: 58px; padding: 4px 8px; }
.tb { min-width: 54px; padding: 3px 6px; gap: 3px; font-size: 11.5px; }
.tb svg.i { width: 20px; height: 20px; }
.workspace { grid-template-columns: 250px 1fr 270px; gap: 6px; padding: 6px; }
.workspace.hide-left { grid-template-columns: 0 1fr 270px; }
.workspace.hide-right { grid-template-columns: 250px 1fr 0; }
.workspace.hide-left.hide-right { grid-template-columns: 0 1fr 0; }
.workspace.hide-left > .left, .workspace.hide-right > .right { display: none; }
.center { gap: 4px; }
.parts { min-height: 0; padding: 0 2px 2px; gap: 6px; }
.part { width: 104px; padding: 4px; flex-direction: row; align-items: center; gap: 6px; text-align: left; }
.part img, .part canvas, .part .ph { width: 40px !important; height: 30px !important; flex: none; }
.part .n { font-size: 11.5px; }
.part .d { display: none; }
.part.add { padding: 4px 8px; }
.part.add svg.i { width: 18px; height: 18px; }
.parts.hidden-strip { display: none; }
.statusbar { min-height: 34px; }
@media (max-width: 1500px) { .workspace { grid-template-columns: 230px 1fr 250px; } }

/* ===== Interface simple (20/11/2026) ===== */
.workspace { grid-template-columns: 220px 1fr 240px; }
.stage { grid-template-columns: 1fr; }
.center { grid-template-rows: auto 1fr; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgba(255,255,255,.25); }
.swatch.hole { background: repeating-linear-gradient(45deg, #9aa3ad 0 3px, transparent 3px 6px); }
.group-head { color: var(--muted); }
.seg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 4px 0 10px; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg-btn { padding: 8px; border: 0; background: #1a1d22; color: var(--muted); cursor: pointer; font-weight: 600; }
.seg-btn.on { background: linear-gradient(#ff8a1a, #e86a00); color: #fff; }
.seg-btn.hole.on { background: repeating-linear-gradient(45deg, #6b7280 0 6px, #4b5563 6px 12px); }
.shapes-panel h3 { cursor: default; }
.shape-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; }
.shape-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 8px; background: #191c21; color: var(--text); cursor: pointer; font-size: 12px; text-align: center; }
.shape-tile:hover { border-color: var(--orange); }
.shape-ico svg.i { width: 30px; height: 30px; color: var(--orange2); }
.shapes-foot { display: grid; gap: 6px; padding: 8px; }
.linkish { background: none; border: 0; color: var(--text); cursor: pointer; text-decoration: underline dotted; padding: 0; font: inherit; }
.linkish:hover { color: var(--orange2); }
@media (max-width: 1250px) { .workspace { grid-template-columns: 200px 1fr; } }
/* Colonne de gauche assez large pour lire les cotes en entier */
.workspace { grid-template-columns: 270px 1fr 240px; }
.kv { grid-template-columns: 74px minmax(0, 1fr); }
.xyz { gap: 3px; }
.xyz input { padding-left: 16px !important; padding-right: 2px !important; font-size: 12px; min-width: 0; }
.shape-ico img { width: 64px; height: 48px; display: block; }
/* Panneaux latéraux repliables */
.workspace.hide-left { grid-template-columns: 0 1fr 240px; }
.workspace.hide-right { grid-template-columns: 270px 1fr 0; }
.workspace.hide-left.hide-right { grid-template-columns: 0 1fr 0; }
.workspace.hide-left > .left, .workspace.hide-right > .right { display: none; }
.pane-tab { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 16px; height: 56px; padding: 0; border: 1px solid var(--line2); background: var(--panel2, #1a1c22); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.pane-tab:hover { color: var(--text, #fff); background: var(--accent, #ff8a1a); }
.pane-tab.left { left: 0; border-left: 0; border-radius: 0 6px 6px 0; }
.pane-tab.right { right: 0; border-right: 0; border-radius: 6px 0 0 6px; }
@media (max-width: 1250px) { .workspace.hide-left { grid-template-columns: 0 1fr; } }
.workspace > .left { grid-column: 1; } .workspace > .center { grid-column: 2; } .workspace > .right { grid-column: 3; }
/* Champ image des plugins (lithophanie…) */
.img-field { display: grid; gap: 6px; }
.img-row { display: flex; align-items: center; gap: 10px; }
.img-preview { border: 1px solid var(--line2); border-radius: 6px; background: #fff; max-width: 120px; max-height: 120px; }
/* Pastilles de couleur */
.color-block { display: grid; gap: 6px; margin: 6px 0 4px; }
.color-block .k { color: var(--muted); font-size: 12px; }
.swatch-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.swatch-btn { aspect-ratio: 1; min-width: 0; border-radius: 50%; border: 2px solid var(--line2); cursor: pointer; padding: 0; position: relative; display: grid; place-items: center; color: var(--muted); font-size: 15px; background: var(--panel2, #1a1c22); }
.swatch-btn:hover { transform: scale(1.12); }
.swatch-btn.on { border-color: var(--accent, #ff7a00); box-shadow: 0 0 0 2px var(--accent, #ff7a00); }
.swatch-btn.more input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
/* Panneau Aligner (reste ouvert) */
.align-panel { position: fixed; z-index: 60; width: 330px; padding: 10px; background: var(--panel, #15171b); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: grid; gap: 8px; }
.al-top { display: flex; align-items: center; justify-content: space-between; }
.al-head { font-weight: 600; font-size: 13px; }
.al-grid { display: grid; grid-template-columns: 112px repeat(3, 1fr); gap: 5px; align-items: center; }
.al-axis { color: var(--muted); font-size: 12px; }
.al-row { display: grid; gap: 5px; }
.al-btn { padding: 6px 4px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2, #1d2026); color: inherit; font-size: 12px; cursor: pointer; }
.al-btn:hover:not(:disabled) { border-color: var(--accent, #ff7a00); color: var(--accent, #ff7a00); }
.al-btn:disabled { opacity: .4; cursor: default; }
/* Encadré « Effet » (Voronoï, texture…) */
.effect-box { margin: 8px 0; padding: 8px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2, #1a1c22); display: grid; gap: 6px; }
.effect-title { font-weight: 600; font-size: 12px; color: var(--accent, #ff7a00); }
.effect-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ratio-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: -2px 0 2px 74px; cursor: pointer; }
.backlit-btn.on { color: #ffcf7a; text-shadow: 0 0 8px rgba(255, 190, 90, .6); }
/* Éditeur de photos (boule de Noël…) */
.pe { display: grid; gap: 8px; }
.pe-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pe-gap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pe-num { width: 64px; }
.pe-canvas { width: 100%; max-width: 640px; aspect-ratio: 2 / 1; border: 1px solid var(--line2); border-radius: 8px; cursor: grab; touch-action: none; background: #1a1d22; }
.pe-canvas:active { cursor: grabbing; }
.pe-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.pe-panel.pe-off { opacity: .45; pointer-events: none; }
.pe-row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pe-row.pe-check { grid-template-columns: auto 1fr; }
.pe-val { text-align: right; font-variant-numeric: tabular-nums; }
.pe-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.pe-help { margin: 0; }
.modal.wide { width: min(760px, 96vw); }
/* Aperçu en direct dans les formulaires (silhouette du vase…) */
.form-with-preview { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.form-preview-col { position: sticky; top: 0; display: grid; gap: 4px; }
.form-preview { width: 300px; height: 380px; background: #15171b; border: 1px solid var(--line2); border-radius: 8px; }
.form-preview-note { text-align: center; }
@media (max-width: 760px) { .form-with-preview { grid-template-columns: 1fr; } .form-preview { width: 100%; height: auto; aspect-ratio: 300 / 380; } }

/* ======================================================================
   Nouvelle disposition : menus en haut, rail d'outils + tiroir à gauche,
   actions de la sélection et outils de vue sur la scène, Réglages / Pièces à droite.
   ====================================================================== */
.topbar { align-items: center; gap: 10px; min-height: 48px; padding: 0 0 0 6px; }
.topbar .brand { display: flex; align-items: center; padding: 0 4px; cursor: pointer; }
.topbar .brand .full { height: 34px; width: auto; }
.menubar { display: flex; gap: 1px; }
.menu-btn { background: none; border: 0; color: var(--text); padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; cursor: pointer; }
.menu-btn:hover, .menu-btn:focus-visible { background: var(--panel2); }
.topbar .doc-tabs { margin-left: 6px; align-self: flex-end; min-width: 0; }
.topbar .doc-tab { padding: 6px 8px 6px 12px; }
.topbar .doc-tab.active { border-color: var(--orange); color: #ffb066; background: var(--orange-soft); }
.top-actions { margin-left: auto; gap: 6px; }
.top-actions .icon-btn:disabled { opacity: .35; cursor: default; }
.btn-export { display: flex; align-items: center; gap: 6px; background: var(--orange); color: #1b0f00; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; margin: 0 4px; }
.btn-export:hover { background: var(--orange2); }
.btn-export svg { width: 17px; height: 17px; }

.workspace { grid-template-columns: 64px 236px minmax(0, 1fr) 280px !important; }
.workspace.no-drawer { grid-template-columns: 64px 0 minmax(0, 1fr) 280px !important; }
.workspace.hide-right { grid-template-columns: 64px 236px minmax(0, 1fr) 0 !important; }
.workspace.no-drawer.hide-right { grid-template-columns: 64px 0 minmax(0, 1fr) 0 !important; }
.workspace > .rail { grid-column: 1; } .workspace > .drawer { grid-column: 2; } .workspace > .center { grid-column: 3; } .workspace > .right { grid-column: 4; }
.workspace.no-drawer > .drawer, .workspace.hide-right > .right { display: none; }

.rail { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px; overflow-y: auto; scrollbar-width: none; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; background: none; border: 0; border-radius: 7px; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { background: var(--panel2); color: var(--text); }
.rail-btn.on { background: var(--orange-soft); color: var(--orange2); box-shadow: inset 2px 0 0 var(--orange); }

.drawer { min-width: 0; overflow-y: auto; scrollbar-width: thin; }
.drawer > .panel { margin: 0; height: 100%; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.drawer-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.drawer-btn svg { width: 22px; height: 22px; color: var(--orange2); }
.drawer-btn:hover { border-color: var(--orange); }
.drawer-btn.off { opacity: .45; }
.drawer-sub { margin: 6px 10px 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.drawer-help { margin: 4px 10px 10px; }
.drawer .brush-settings { display: grid; gap: 8px; padding: 8px 10px; }

.ctxbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 2px; padding: 4px; background: rgba(21, 23, 28, .94); border: 1px solid var(--line2); border-radius: 10px; max-width: calc(100% - 140px); overflow-x: auto; scrollbar-width: none; }
.ctxbar[hidden] { display: none; }
.ctx-btn { display: flex; align-items: center; gap: 5px; padding: 6px 9px; background: none; border: 0; border-radius: 7px; color: var(--text); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.ctx-btn svg { width: 17px; height: 17px; color: var(--muted); }
.ctx-btn:hover:not(:disabled) { background: var(--panel2); }
.ctx-btn.on { background: var(--orange-soft); color: #ffb066; } .ctx-btn.on svg { color: var(--orange2); }
.ctx-btn:disabled { opacity: .4; cursor: default; }

.viewtools { position: absolute; right: 10px; top: 104px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.vt-btn { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(21, 23, 28, .94); border: 1px solid var(--line2); border-radius: 8px; color: var(--muted); cursor: pointer; }
.vt-btn svg { width: 18px; height: 18px; }
.vt-btn:hover { color: var(--text); border-color: var(--orange); }
.vt-btn.on { color: #ffcf7a; border-color: var(--orange); background: var(--orange-soft); }

.right .side-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.side-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 0; font: inherit; font-size: 13px; cursor: pointer; }
.side-tab.on { color: var(--orange2); border-bottom-color: var(--orange); }
.right > .panel > h3 { display: none; }
.right #explorer { display: none; }
.right.show-parts #explorer { display: block; } .right.show-parts #properties { display: none; }
.right > .panel.collapsed > .body { display: block; }
.mirror-row { display: grid; grid-template-columns: 74px repeat(3, 1fr); gap: 4px; align-items: center; margin-top: 6px; }
.mirror-row button { padding: 5px 0; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); font: inherit; font-weight: 600; cursor: pointer; }
.mirror-row button:hover { border-color: var(--orange); }
/* La scène occupe toute la colonne (les onglets de projet sont dans la barre du haut) ; éléments masqués vraiment masqués. */
.workspace > .center { grid-template-rows: minmax(0, 1fr) !important; }
#app [hidden] { display: none !important; }
#app { grid-template-rows: auto minmax(0, 1fr) auto; } /* plus de barre d'outils sous l'en-tête */
.ctxbar { left: 12px; transform: none; max-width: calc(100% - 150px); } /* à gauche : ne touche jamais le cube de vue */
/* Barre du bas : hauteur fixe, quelle que soit la taille de la fenêtre (plein écran compris). */
#app { grid-template-rows: auto minmax(0, 1fr) 32px !important; }
.statusbar { height: 32px; min-height: 32px; max-height: 32px; overflow: hidden; align-items: center; }
/* Panneau de droite : le projet puis ses pièces, sans onglets. */
.right.project-view > .panel > h3 { display: flex; }
.right.project-view #explorer, .right.project-view #properties { display: block; }
.right.project-view #properties { flex: 0 0 auto; }
.right.project-view #explorer { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* Tourner : angle précis ou par pas (sous la barre d'actions) */
.rotbar { position: absolute; left: 12px; top: 62px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(21, 23, 28, .96); border: 1px solid var(--orange); border-radius: 10px; max-width: calc(100% - 150px); }
.rotbar .rot-k { color: var(--muted); font-size: 12px; }
.rotbar .rot-seg { display: flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.rotbar .rot-b { background: none; border: 0; color: var(--text); padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.rotbar .rot-seg .rot-b + .rot-b { border-left: 1px solid var(--line2); }
.rotbar .rot-b.on { background: var(--orange-soft); color: #ffcf7a; }
.rotbar .rot-b.ax-x { color: #ff6b6b; } .rotbar .rot-b.ax-y { color: #5fd38a; } .rotbar .rot-b.ax-z { color: #6aa8ff; }
.rotbar .rot-b.big { border: 1px solid var(--line2); border-radius: 7px; }
.rotbar .rot-b.primary { background: var(--orange); color: #111; border-radius: 7px; font-weight: 600; }
.rotbar input { width: 70px; background: var(--bg2, #0f1114); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 4px 6px; font: inherit; }
/* Bulle de l'outil en cours (Arrondir, Chanfreiner, Percer, Mesurer) : cote + croix pour quitter */
.tool-bubble { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; background: rgba(21, 23, 28, .97); border: 1px solid var(--orange); border-radius: 999px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); color: var(--text); font-size: 13px; white-space: nowrap; }
.tool-bubble b { color: #ffcf7a; }
.tool-bubble input { width: 64px; background: var(--bg2, #0f1114); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 3px 6px; font: inherit; }
.tool-bubble .tb-hint { color: var(--muted); }
.tool-bubble .tb-close { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; }
.tool-bubble .tb-close:hover { background: var(--orange); color: #111; border-color: var(--orange); }
/* Mini-barre au-dessus de la pièce sélectionnée */
.piece-bar { position: absolute; z-index: 6; display: flex; gap: 4px; padding: 4px; background: rgba(21, 23, 28, .96); border: 1px solid var(--line2); border-radius: 999px; box-shadow: 0 4px 16px rgba(0, 0, 0, .45); }
.piece-bar .pb-btn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; }
.piece-bar .pb-btn svg { width: 16px; height: 16px; }
.piece-bar .pb-btn:hover { background: var(--orange-soft); color: #ffcf7a; }
.piece-bar .pb-btn.danger:hover { background: #d23b3b; color: #fff; }
.piece-bar { align-items: center; padding-left: 12px; }
.piece-bar .pb-dims { color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.piece-bar .pb-dims { display: inline-flex; align-items: center; gap: 2px; }
.piece-bar .pb-dim { border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 4px; border-radius: 6px; cursor: text; }
.piece-bar .pb-dim:hover, .piece-bar .pb-dim:focus-visible { border-color: var(--orange); background: var(--orange-soft); color: #ffcf7a; outline: none; }
.piece-bar .pb-dim-in { width: 64px; padding: 2px 4px; border: 1px solid var(--orange); border-radius: 6px; background: var(--bg2, #0f1114); color: var(--text); font: inherit; font-weight: 600; text-align: right; }
.piece-bar .pb-x, .piece-bar .pb-unit { color: var(--muted); padding: 0 2px; }
.piece-bar .pb-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--line2); }
/* Pourcentage de chargement (démarrage et fenêtres de progression) */
#splash .pct { color: var(--orange2); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; margin: -2px 0 6px; }
.progress-pct { margin-top: 8px; color: var(--muted); font-size: 13px; }
.progress-pct b { color: var(--orange2); font-size: 18px; font-variant-numeric: tabular-nums; }
/* Place de marché des plugins */
.mk-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.mk-head input[type=search] { flex: 1 1 220px; max-width: 320px; background: var(--bg2, #0f1114); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); padding: 7px 10px; font: inherit; }
.mk-tabs { display: flex; gap: 4px; }
.mk-tab { background: none; border: 1px solid var(--line2); border-radius: 999px; color: var(--muted); padding: 6px 14px; font: inherit; cursor: pointer; }
.mk-tab.on { background: var(--orange); border-color: var(--orange); color: #111; font-weight: 600; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.mk-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel2, #15171c); border: 1px solid var(--line2); border-radius: 10px; padding: 12px; }
.mk-top { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; }
.mk-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--orange-soft); color: var(--orange2); }
.mk-ico svg { width: 18px; height: 18px; }
.mk-card .badge.free { background: rgba(46, 157, 87, .18); color: #7fdc9f; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.mk-card .badge.pro { background: var(--orange-soft); color: #ffcf7a; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.mk-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mk-rate, .mk-mine { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.mk-foot { margin-top: auto; display: flex; justify-content: flex-end; }
.mk-empty { grid-column: 1 / -1; text-align: center; padding: 40px 10px; color: var(--muted); }
.mk-stars { display: inline-flex; gap: 1px; font-size: var(--s, 16px); line-height: 1; }
.mk-stars i { font-style: normal; color: #4a4f58; }
.mk-stars i.on { color: #ffb020; }
.mk-stars i.half { background: linear-gradient(90deg, #ffb020 50%, #4a4f58 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mk-stars.pick button { background: none; border: 0; padding: 0 1px; cursor: pointer; color: #4a4f58; font-size: var(--s, 22px); line-height: 1; }
.mk-stars.pick button.on { color: #ffb020; }
.mk-stars.pick button:focus-visible { outline: 2px solid var(--orange); border-radius: 4px; }
.mk-open { width: 100%; margin-top: 8px; }
/* Fenêtre « Votre avis » : discrète, en bas à droite */
.mk-ask { position: fixed; right: 20px; bottom: 56px; z-index: 900; background: rgba(21, 23, 28, .98); border: 1px solid var(--orange); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 10px; align-items: center; min-width: 260px; }
.mk-ask-title { font-weight: 600; color: var(--text); text-align: center; }
.mk-ask-btns { display: flex; gap: 8px; }
/* Éditeur d'esquisse 2D (plein écran) */
.sk-bg { position: fixed; inset: 0; z-index: 700; background: rgba(5, 6, 8, .72); display: grid; place-items: stretch; padding: 14px; }
.sk { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; background: var(--panel, #121418); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; min-height: 0; }
.sk > header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sk > header .grow, .sk > footer .grow { flex: 1; }
.sk-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px 4px; }
.sk-tool { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2, #1a1d23); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.sk-tool svg { width: 15px; height: 15px; }
.sk-tool:hover { border-color: var(--orange); }
.sk-tool.on { background: var(--orange); border-color: var(--orange); color: #111; font-weight: 600; }
.sk-sep { width: 1px; background: var(--line2); margin: 2px 4px; }
.sk-hint { padding: 0 14px 8px; color: var(--muted); font-size: 12px; min-height: 16px; }
.sk-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; border-top: 1px solid var(--line); }
.sk-draw { position: relative; min-height: 0; }
.sk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; outline: none; }
.sk-side { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-left: 1px solid var(--line); min-height: 0; overflow: auto; }
.sk-props h4 { margin: 10px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sk-props h4:first-child { margin-top: 0; }
.sk-field { display: grid; grid-template-columns: 1fr 104px; align-items: center; gap: 6px; margin: 4px 0; font-size: 12.5px; }
.sk-field input, .sk-field select { width: 100%; background: var(--bg2, #0f1114); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 4px 6px; font: inherit; }
.sk-check { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 12.5px; }
.sk-preview { position: relative; height: 240px; flex: 0 0 auto; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.sk-preview canvas { display: block; }
.sk-pv-msg { font-size: 12px; color: var(--muted); text-align: center; min-height: 16px; }
.sk > footer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .sk-main { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1fr) auto; } .sk-side { border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; } .sk-help { display: none; } }
/* Tiroir Générateurs : recherche et catégories */
.gen-search { width: 100%; margin: 4px 0 8px; background: var(--bg2, #0f1114); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); padding: 6px 9px; font: inherit; font-size: 12.5px; }
.gen-cat { margin: 10px 2px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange2); }
.gen-list .gen-cat:first-child { margin-top: 2px; }
/* Tous les plateaux */
.doc-tab.all { display: grid; place-items: center; width: 34px; padding: 0; }
.doc-tab.all svg { width: 16px; height: 16px; }
.plates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.plate-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; background: var(--panel2, #15171c); border: 1px solid var(--line2); border-radius: 10px; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.plate-card:hover { border-color: var(--orange); }
.plate-card.on { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.plate-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #0b0c0f; }
.plate-noimg { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--muted); background: #0b0c0f; }
.plate-meta { padding: 8px 10px; }
.plate-meta .dirty { color: var(--orange2); }

/* ---------- Publication dans la galerie ---------- */
.pub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pub-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #0c0d10; display: block; }
.pub-meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pub-form { display: flex; flex-direction: column; gap: 6px; }
.pub-form > label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pub-form input[type=text], .pub-form textarea, .pub-form select { width: 100%; box-sizing: border-box; }
.pub-form textarea { resize: vertical; min-height: 64px; font: inherit; }
.pub-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pub-check input { margin-top: 3px; flex: none; }
.pub-check span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pub-check small { color: var(--muted); font-size: 12px; }
.pub-row { display: flex; flex-direction: column; gap: 4px; padding-left: 28px; }
.pub-row label { font-size: 12px; color: var(--muted); }
.pub .err:empty { display: none; }
@media (max-width: 720px) { .pub { grid-template-columns: 1fr; } }
#toasts .toast .btn.small { margin-left: 8px; }
.pub-row[hidden] { display: none; }
.pub-check span.pub-inline { display: block; }
