/* ===== Studio de design (dossards / certificats) – js/design-studio.js ===== */
.ds-modal { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: #0f172a; color: #e2e8f0; font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; }
.ds-modal.hidden { display: none !important; }
.ds-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #1e293b; border-bottom: 1px solid #334155; }
.ds-title { font-weight: 700; font-size: 15px; color: #fbbf24; display: flex; align-items: center; gap: 8px; }
.ds-top-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ds-sep { width: 1px; height: 22px; background: #475569; margin: 0 4px; }
.ds-zoom { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; color: #cbd5e1; }
.ds-label-inline { color: #94a3b8; font-size: 12px; }
.ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: #334155; color: #e2e8f0; border: 1px solid #475569; cursor: pointer; font-size: 12px; line-height: 1.2; }
.ds-btn:hover { background: #475569; }
.ds-btn:disabled { opacity: 0.4; cursor: default; }
.ds-btn.on { background: #6366f1; border-color: #818cf8; color: #fff; }
.ds-primary { background: #059669; border-color: #10b981; color: #fff; font-weight: 600; }
.ds-primary:hover { background: #047857; }
.ds-danger { background: #7f1d1d; border-color: #b91c1c; }
.ds-danger:hover { background: #991b1b; }
.ds-w100 { width: 100%; margin-top: 6px; }
.ds-file { cursor: pointer; }
.ds-active { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: #0b3b2e; border: 1px solid #10b981; color: #a7f3d0; font-size: 12px; cursor: pointer; }
.ds-body { flex: 1; display: flex; min-height: 0; }
.ds-left, .ds-right { width: 250px; flex-shrink: 0; overflow-y: auto; padding: 10px; background: #111827; border-right: 1px solid #1f2937; }
.ds-right { width: 290px; border-right: 0; border-left: 1px solid #1f2937; }
.ds-h { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 700; }
.ds-h:first-child { margin-top: 0; }
.ds-h2 { margin: 10px 0 4px; font-size: 11px; color: #a5b4fc; font-weight: 600; }
.ds-muted { color: #94a3b8; font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.ds-help { margin-top: 12px; color: #64748b; font-size: 11px; line-height: 1.45; }
.ds-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ds-mt { margin-top: 6px; }
.ds-tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 8px; background: #1e293b; border: 1px solid #334155; color: #e2e8f0; cursor: pointer; font-size: 11px; }
.ds-tool i { font-size: 16px; color: #fbbf24; }
.ds-tool:hover { background: #334155; }
.ds-input { width: 100%; background: #1e293b; color: #f1f5f9; border: 1px solid #334155; border-radius: 6px; padding: 5px 7px; font-size: 12px; }
.ds-input:focus { outline: none; border-color: #818cf8; }
textarea.ds-input { resize: vertical; font-family: inherit; }
.ds-color { padding: 1px; height: 30px; }
.ds-mini { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.ds-mini .ds-input { margin-top: 2px; }
.ds-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: #cbd5e1; font-size: 12px; }
.ds-row .ds-input { max-width: 140px; }
.ds-row input[type=color] { width: 60px; height: 28px; border: 0; background: none; }
.ds-check { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0; font-size: 12px; color: #cbd5e1; cursor: pointer; }
.ds-seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ds-seg .ds-btn { padding: 5px 8px; }
.ds-center { flex: 1; min-width: 0; overflow: auto; background: #0b1220; background-image: radial-gradient(#1e293b 1px, transparent 1px); background-size: 18px 18px; position: relative; padding: 20px; }
.ds-stage-wrap { position: relative; margin: 0 auto; }
.ds-stage { position: absolute; left: 20px; top: 20px; transform-origin: 0 0; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #fff; overflow: hidden; }
.ds-bg-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.ds-els { position: absolute; inset: 0; }
.ds-el { position: absolute; cursor: move; transform-origin: 50% 50%; touch-action: none; }
.ds-el canvas { position: absolute; pointer-events: none; }
.ds-el:hover { outline: 1px dashed rgba(129,140,248,.8); }
.ds-el.selected { outline: 2px solid #6366f1; z-index: 5; }
.ds-el.locked { cursor: default; }
.ds-el.locked.selected { outline-color: #f59e0b; }
.ds-handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 2px solid #6366f1; border-radius: 3px; z-index: 6; }
.ds-h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ds-h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ds-h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ds-h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ds-h-n { left: calc(50% - 5px); top: -6px; cursor: ns-resize; }
.ds-h-s { left: calc(50% - 5px); bottom: -6px; cursor: ns-resize; }
.ds-h-e { right: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.ds-h-w { left: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.ds-rot { position: absolute; left: calc(50% - 7px); top: -30px; width: 14px; height: 14px; border-radius: 50%; background: #fbbf24; border: 2px solid #fff; cursor: grab; z-index: 6; }
.ds-rot::after { content: ''; position: absolute; left: 5px; top: 12px; width: 1px; height: 14px; background: #fbbf24; }
.ds-guide { position: absolute; background: #ec4899; pointer-events: none; z-index: 7; }
.ds-guide-v { top: 0; bottom: 0; width: 1px; }
.ds-guide-h { left: 0; right: 0; height: 1px; }
.ds-guide.hidden { display: none; }
.ds-status { position: sticky; left: 0; bottom: 0; margin-top: 8px; font-size: 11px; color: #94a3b8; }
.ds-layers { display: flex; flex-direction: column; gap: 3px; }
.ds-layer { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; background: #1e293b; cursor: pointer; border: 1px solid transparent; }
.ds-layer:hover { background: #273449; }
.ds-layer.active { border-color: #6366f1; background: #312e81; }
.ds-li { width: 14px; color: #94a3b8; font-size: 11px; }
.ds-ln { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ds-ib { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 2px 4px; }
.ds-ib:hover { color: #fff; }
.ds-sample { max-width: 220px; }
@media (max-width: 1100px) {
  .ds-left { width: 200px; }
  .ds-right { width: 240px; }
}
@media (max-width: 800px) {
  .ds-body { flex-direction: column; overflow-y: auto; }
  .ds-left, .ds-right { width: 100%; max-height: none; border: 0; }
  .ds-center { min-height: 60vh; }
}
/* Les notifications restent visibles au-dessus du Studio */
body.ds-open #toast { z-index: 100 !important; }

/* fusion8 – Studio façon Canva : rail d'icônes + panneaux */
.ds-left.ds-canva { width: 330px; padding: 0; display: flex; overflow: hidden; }
.ds-rail { width: 72px; flex: 0 0 72px; background: #0b1220; border-right: 1px solid #1f2937; display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; overflow-y: auto; }
.ds-rail-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px; border-radius: 10px; border: 0; background: transparent; color: #94a3b8; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.ds-rail-btn i { font-size: 17px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.ds-rail-btn:hover { color: #e2e8f0; background: #111a2e; }
.ds-rail-btn.on { color: #fff; } .ds-rail-btn.on i { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; }
.ds-rail-btn[data-tab="textes"].on i { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.ds-rail-btn[data-tab="champs"].on i { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.ds-rail-btn[data-tab="elements"].on i { background: linear-gradient(135deg, #10b981, #0d9488); }
.ds-rail-btn[data-tab="images"].on i { background: linear-gradient(135deg, #ec4899, #e11d48); }
.ds-rail-btn[data-tab="fond"].on i { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.ds-rail-btn[data-tab="qr"].on i { background: linear-gradient(135deg, #64748b, #334155); }
.ds-panels { flex: 1; overflow-y: auto; padding: 10px; min-width: 0; }
.ds-panel { display: none; } .ds-panel.on { display: block; }
.ds-tpreset { display: block; width: 100%; text-align: left; margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid #1f2937; background: #0f172a; color: #f1f5f9; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-tpreset:hover { border-color: #6366f1; background: #151f38; }
.ds-row2 { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; } .ds-row2 .ds-input { flex: 1; min-width: 0; } .ds-row2 input[type=color] { width: 42px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; }
.ds-lib { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.ds-lib-item { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 9px; border-radius: 9px; background: #0f172a; border: 1px solid #1f2937; }
.ds-lib-item > span { flex: 1; min-width: 0; font-size: 12px; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-lib-item .ds-btn { padding: 4px 7px; font-size: 11px; }
.ds-lib-races .ds-row > span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-tb { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.ds-tb .ds-btn { padding: 6px 8px; }
label:has(#ds-cert-active-toggle) { display: none !important; }
@media (max-width: 900px) {
  .ds-left.ds-canva { width: 100%; flex-direction: column; }
  .ds-rail { width: 100%; flex: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #1f2937; }
  .ds-rail-btn { min-width: 64px; }
  .ds-tb { display: none; }
}
/* fusion12-8f : panneau tableau classement */
.ds-rank-box { border: 1px solid #334155; border-radius: 8px; padding: 6px 8px; margin: 8px 0; background: rgba(30,41,59,.45); }
.ds-rank-box .ds-h2 { margin-top: 2px; }
.ds-rank-allbtn { flex-wrap: wrap; margin-bottom: 4px; }
.ds-rank-col { border-top: 1px dashed #334155; padding: 2px 0; }
.ds-rank-col:first-of-type { border-top: 0; }
.ds-rank-col .ds-check { margin: 4px 0 2px; }
.ds-rank-col.off .ds-rank-w { opacity: .4; }
.ds-rank-w { display: flex; align-items: center; gap: 6px; margin: 0 0 4px 22px; }
.ds-rank-w input[type=range] { flex: 1; margin: 0; padding: 0; height: 18px; }
.ds-rank-w [data-wout] { min-width: 32px; color: #cbd5e1; }
