.jdx-ed { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 0 14px; }
.jdx-ed-palco { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; container-type: size; touch-action: none; user-select: none; }
#jdx-ed-cenabox { display: contents; }
.jdx-ed-painel { width: 340px; overflow-y: auto; padding-right: 6px; color: #e9edef; }

.jdx-ed-painel section { padding: 10px 0 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.jdx-ed-painel h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #67B34D; }
.jdx-ed-painel textarea, .jdx-ed-painel input[type="text"], .jdx-ed-painel select {
    width: 100%; background: #0d1117; color: #e9edef; border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px; padding: 8px 10px; outline: 0; margin: 6px 0; font-size: 14px;
}
.jdx-ed-painel textarea { height: 70px; resize: none; }
.jdx-ed-painel input:focus, .jdx-ed-painel textarea:focus, .jdx-ed-painel select:focus { border-color: #67B34D; }
.jdx-ed-dica { color: #8696a0; font-size: 12px; line-height: 1.4; }

.jdx-ed-lin { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.jdx-ed-lin label { font-size: 12px; color: #8696a0; min-width: 52px; }
.jdx-ed-lin input[type="range"] { flex: 1; accent-color: #67B34D; }
.jdx-ed-painel input[type="color"] { width: 34px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }

.jdx-ed-bt {
    flex: 1; background: #21262d; color: #e9edef; border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px; padding: 7px 9px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.jdx-ed-bt:hover { background: #2b323b; }
.jdx-ed-bt.on { border-color: #67B34D; color: #67B34D; }
.jdx-ed-bt.cheio { width: 100%; }
.jdx-ed-bt.perigo { color: #f85149; }

.jdx-ed-cores { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.jdx-ed-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.jdx-ed-sw.on { border-color: #fff; box-shadow: 0 0 0 2px #67B34D; }

.jdx-ed-cm { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; margin-top: 5px; background: #0d1117; border: 1px solid transparent; border-radius: 10px; font-size: 13px; cursor: pointer; }
.jdx-ed-cm.on { border-color: #67B34D; }
.jdx-ed-cm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jdx-ed-cm button, .jdx-ed-lk button { background: none; border: 0; color: #f85149; cursor: pointer; }
.jdx-ed-lk { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; margin-top: 6px; background: #0d1117; border-radius: 10px; font-size: 13px; }
.jdx-ed-lk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modo desenho: só o painel de desenho aparece */
.jdx-ed-painel section.des { display: none; }
.jdx-ed-painel.desenhando section { display: none; }
.jdx-ed-painel.desenhando section.des { display: block; }
.jdx-ed-draw { position: absolute; z-index: 6; cursor: crosshair; touch-action: none; border-radius: 10px; }

/* itens editáveis no palco */
.jdx-ed-palco .jdx-cl { pointer-events: auto; cursor: move; touch-action: none; }
.jdx-ed-palco .jdx-cena-link { pointer-events: none; }

/* moldura de seleção e alças */
.jdx-ed-frame { position: absolute; display: none; pointer-events: none; z-index: 5; box-sizing: border-box; border: 1.5px solid #67B34D; }
.jdx-ed-frame::before { content: ''; position: absolute; left: 50%; top: -28px; width: 2px; height: 28px; margin-left: -1px; background: #67B34D; }
.jdx-ed-frame .h { position: absolute; width: 14px; height: 14px; box-sizing: border-box; background: #fff; border: 2px solid #67B34D; border-radius: 50%; pointer-events: auto; touch-action: none; }
.h[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.h[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.h[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.h[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.h[data-h="w"] { left: -7px; top: 50%; margin-top: -7px; border-radius: 4px; cursor: ew-resize; }
.h[data-h="e"] { right: -7px; top: 50%; margin-top: -7px; border-radius: 4px; cursor: ew-resize; }
.h[data-h="n"] { top: -7px; left: 50%; margin-left: -7px; border-radius: 4px; cursor: ns-resize; }
.h[data-h="s"] { bottom: -7px; left: 50%; margin-left: -7px; border-radius: 4px; cursor: ns-resize; }
.h[data-h="rot"] { top: -36px; left: 50%; margin-left: -8px; width: 16px; height: 16px; background: #67B34D; border-color: #fff; cursor: grab; }
.jdx-ed-frame[data-k="texto"] .h[data-h="n"], .jdx-ed-frame[data-k="texto"] .h[data-h="s"] { display: none; }
@media (pointer: coarse) { .jdx-ed-frame .h { width: 24px; height: 24px; } .h[data-h="rot"] { width: 26px; height: 26px; margin-left: -13px; top: -44px; } .jdx-ed-frame::before { top: -32px; height: 32px; } }

#jdx-ed-msg.erro { color: #f85149; }
#jdx-ed-msg.ok { color: #67B34D; }

@media (max-width: 768px) {
    .jdx-ed { flex-direction: column; padding: 0 10px; }
    .jdx-ed-palco { flex: 0 0 46%; }
    .jdx-ed-painel { width: auto; flex: 1; }
}