/* Editor de modelos — chrome neutro; a cor fica para a arte. */
.ed{--e-bg:#f4f4f5;--e-pn:#ffffff;--e-pn2:#fafafa;--e-fg:#18181b;--e-mut:#71717a;--e-bd:#e4e4e7;--e-hov:#f4f4f5;--e-ac:#4f46e5;--e-ac2:#eef2ff;--e-palco:#e9e9ec;--e-sh:0 1px 2px rgba(0,0,0,.06),0 8px 24px rgba(0,0,0,.08);
  position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;background:var(--e-bg);color:var(--e-fg);font:13px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
@media(prefers-color-scheme:dark){.ed{--e-bg:#111113;--e-pn:#1a1a1d;--e-pn2:#1f1f23;--e-fg:#f4f4f5;--e-mut:#a1a1aa;--e-bd:#2e2e33;--e-hov:#26262b;--e-ac:#818cf8;--e-ac2:#26264a;--e-palco:#0b0b0d;--e-sh:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.5)}}
.ed *{box-sizing:border-box}
.ed button{font:inherit;color:inherit;cursor:pointer}
.ed input,.ed select,.ed textarea{font:inherit;color:var(--e-fg);background:var(--e-pn);border:1px solid var(--e-bd);border-radius:8px;padding:6px 8px;min-width:0}
.ed input:focus-visible,.ed select:focus-visible,.ed textarea:focus-visible,.ed button:focus-visible{outline:2px solid var(--e-ac);outline-offset:1px}
.ed-ico{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ed-flex{flex:1}.ed-mut{color:var(--e-mut)}.ed-erro{color:#dc2626}
.ed-sep{width:1px;height:24px;background:var(--e-bd);margin:0 4px}

/* topo */
.ed-topo{display:flex;align-items:center;gap:6px;height:56px;padding:0 12px;background:var(--e-pn);border-bottom:1px solid var(--e-bd);flex:none;overflow-x:auto;scrollbar-width:none}
.ed-nome{border-color:transparent!important;background:transparent!important;font-weight:650!important;font-size:15px!important;width:min(280px,32vw)}
.ed-nome:hover,.ed-nome:focus{border-color:var(--e-bd)!important;background:var(--e-pn)!important}
.ed-estado{font-size:12px;color:var(--e-mut);white-space:nowrap}.ed-estado.sujo{color:#d97706}
.ed-zoom{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:var(--e-mut)}
.ed-lbl{display:flex;align-items:center;gap:6px;color:var(--e-mut);white-space:nowrap}
.ed-sel{max-width:100%}
.ed-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border:1px solid var(--e-bd);background:var(--e-pn);border-radius:9px;white-space:nowrap;font-weight:550}
.ed-btn:hover{background:var(--e-hov)}.ed-btn:disabled{opacity:.5;cursor:default}
.ed-prim{background:var(--e-ac)!important;border-color:var(--e-ac)!important;color:#fff!important}.ed-prim:hover{filter:brightness(1.08)}
.ed-ghost{border-color:transparent;background:transparent}
.ed-perigo{color:#dc2626!important}
.ed-ib{display:inline-grid;place-items:center;width:34px;height:34px;border:0;background:transparent;border-radius:9px;flex:none}
.ed-ib:hover{background:var(--e-hov)}.ed-ib:disabled{opacity:.35;cursor:default;background:transparent}
.ed-tog{height:34px;padding:0 12px;border:1px solid var(--e-bd);border-radius:999px;background:var(--e-pn);white-space:nowrap}
.ed-tog.on{background:var(--e-ac2);border-color:var(--e-ac);color:var(--e-ac);font-weight:600}

/* corpo */
.ed-corpo{flex:1;display:flex;min-height:0}
.ed-trilho{width:76px;flex:none;background:var(--e-pn);border-right:1px solid var(--e-bd);display:flex;flex-direction:column;gap:2px;padding:8px 6px;overflow-y:auto}
.ed-tab{display:flex;flex-direction:column;align-items:center;gap:4px;padding:9px 2px;border:0;background:transparent;border-radius:10px;font-size:11px;color:var(--e-mut)}
.ed-tab .ed-ico{width:22px;height:22px}
.ed-tab:hover{background:var(--e-hov);color:var(--e-fg)}.ed-tab.on{background:var(--e-ac2);color:var(--e-ac);font-weight:600}
.ed-gaveta{width:316px;flex:none;background:var(--e-pn);border-right:1px solid var(--e-bd);overflow-y:auto;padding:14px 14px 40px}
.ed-gaveta-off .ed-gaveta{display:none}
.ed-g-t{font-weight:700;font-size:13px;margin:14px 0 8px}.ed-g-t:first-child{margin-top:2px}
.ed-sub{font-size:11px;font-weight:650;text-transform:uppercase;letter-spacing:.06em;color:var(--e-mut);margin:14px 0 6px}
.ed-dica{font-size:12px;color:var(--e-mut);margin:6px 0}
.ed-galeria{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ed-galeria-3{grid-template-columns:repeat(3,1fr)}
.ed-card{display:flex;flex-direction:column;gap:4px;align-items:stretch;padding:6px;border:1px solid var(--e-bd);border-radius:10px;background:var(--e-pn2);text-align:left;transition:transform .12s,box-shadow .12s,border-color .12s}
.ed-card:hover{border-color:var(--e-ac);box-shadow:var(--e-sh);transform:translateY(-1px)}
.ed-card span{font-weight:600;font-size:12px;line-height:1.25}.ed-card small{color:var(--e-mut);font-size:11px}
.ed-card img{width:100%;aspect-ratio:1;object-fit:contain;background:repeating-conic-gradient(#e5e5e5 0 25%,#fff 0 50%) 0 0/12px 12px;border-radius:6px}
.ed-mini-svg{width:100%;aspect-ratio:1;display:grid;place-items:center;background:#e4e4e7;border-radius:6px;overflow:hidden;padding:5px}
.ed-mini-svg svg{max-width:100%;max-height:100%;width:auto!important;height:auto!important;box-shadow:0 1px 3px rgba(0,0,0,.18);background:#fff}
.ed-formas{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.ed-formas button{display:grid;place-items:center;aspect-ratio:1;border:1px solid var(--e-bd);border-radius:8px;background:var(--e-pn2);color:#71717a;padding:4px}
.ed-formas button .ed-ico{width:100%;height:100%}
.ed-formas button.on,.ed-formas button:hover{border-color:var(--e-ac);color:var(--e-ac)}
.ed-formas-g{grid-template-columns:repeat(4,1fr);gap:8px}.ed-formas-g button{color:#e30613;padding:10px}
.ed-addtxt{display:block;width:100%;text-align:left;padding:12px 14px;margin:0 0 8px;border:1px solid var(--e-bd);border-radius:10px;background:var(--e-pn2);line-height:1.1}
.ed-addtxt:hover{border-color:var(--e-ac)}
.ed-lista{display:flex;flex-direction:column;gap:4px;margin-top:6px}
.ed-li{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:8px 10px;border:1px solid var(--e-bd);border-radius:9px;background:var(--e-pn2);text-align:left}
.ed-li:hover{border-color:var(--e-ac);background:var(--e-ac2)}.ed-li small{color:var(--e-mut);font-size:11px}
.ed-in{width:100%;margin-top:6px}
.ed-real{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:12px;padding:8px;border-radius:8px;background:var(--e-hov)}
.ed-largo{width:100%;justify-content:center;margin-bottom:6px}
.ed-ativo{position:relative}.ed-x{position:absolute;top:2px;right:2px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;font-size:14px;line-height:1;opacity:0;transition:opacity .12s}
.ed-ativo:hover .ed-x,.ed-x:focus-visible{opacity:1}
.ed-pal{display:grid;grid-template-columns:repeat(8,1fr);gap:5px}
.ed-pal button{aspect-ratio:1;border-radius:7px;border:1px solid rgba(0,0,0,.12);padding:0}
.ed-pal button.on{outline:2px solid var(--e-ac);outline-offset:2px}
.ed-pal-g{grid-template-columns:repeat(6,1fr);gap:7px}.ed-pal-grad{grid-template-columns:repeat(5,1fr)}
.ed-camadas{display:flex;flex-direction:column;gap:3px}
.ed-cam{display:flex;align-items:center;gap:4px;padding:3px 4px 3px 10px;border:1px solid var(--e-bd);border-radius:9px;background:var(--e-pn2);cursor:grab;min-height:38px}
.ed-cam.on{border-color:var(--e-ac);background:var(--e-ac2)}.ed-cam.ocu .ed-cam-n{opacity:.45;text-decoration:line-through}
.ed-cam.alvo{box-shadow:0 -2px 0 var(--e-ac) inset}.ed-cam.arr{opacity:.4}
.ed-cam-n{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ed-cam em{font-style:normal;font-size:10px;padding:1px 6px;border-radius:99px;background:var(--e-hov);color:var(--e-mut)}
.ed-cam .ed-ib{width:28px;height:28px}.ed-cam .ed-ico{width:15px;height:15px}
.ed-cam-fundo{margin-top:3px;cursor:default;opacity:.8}

/* palco */
.ed-centro{flex:1;display:flex;flex-direction:column;min-width:0;position:relative}
.ed-palco{flex:1;overflow:auto;position:relative;background:var(--e-palco);touch-action:none;
  background-image:radial-gradient(circle,rgba(0,0,0,.07) 1px,transparent 1px);background-size:18px 18px}
.ed-palco-in{min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:56px;width:max-content}
.ed-pagina{position:relative;flex:none;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 10px 40px rgba(0,0,0,.18)}
.ed-arte,.ed-sobre{position:absolute;inset:0}
.ed-arte svg{width:100%;height:100%}
.ed-arte .cz-hit{cursor:move}
.ed-sobre{pointer-events:none;overflow:visible}
.ed-sobre .ed-h{pointer-events:all;cursor:nwse-resize}
.ed-sobre .ed-h[data-h=ne],.ed-sobre .ed-h[data-h=sw]{cursor:nesw-resize}
.ed-sobre .ed-h[data-h=n],.ed-sobre .ed-h[data-h=s]{cursor:ns-resize}.ed-sobre .ed-h[data-h=e],.ed-sobre .ed-h[data-h=w]{cursor:ew-resize}
.ed-sobre .ed-rot{cursor:grab}
.ed-status{display:flex;align-items:center;gap:16px;height:34px;padding:0 14px;font-size:12px;color:var(--e-mut);background:var(--e-pn);border-top:1px solid var(--e-bd);flex:none;overflow-x:auto;white-space:nowrap}
.ed-chk{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none}
.ed-chk input{width:15px;height:15px;accent-color:var(--e-ac);margin:0}
.ed-mini{position:absolute;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:var(--e-pn);border:1px solid var(--e-bd);border-radius:12px;box-shadow:var(--e-sh);z-index:3;white-space:nowrap}
.ed-mb-t{height:32px;padding:0 10px;border:0;background:var(--e-ac2);color:var(--e-ac);border-radius:8px;font-weight:600;margin-right:4px}
.ed-txt{position:absolute;z-index:4;background:var(--e-pn);border:1px solid var(--e-ac);border-radius:12px;box-shadow:var(--e-sh);padding:8px;max-width:min(560px,90vw)}
.ed-txt-in{width:100%;min-height:72px;resize:vertical;border:0!important;background:var(--e-pn2)!important;line-height:1.15}
.ed-txt-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;align-items:center;font-size:11px;color:var(--e-mut)}
.ed-txt-chips button{border:1px solid var(--e-bd);background:var(--e-pn2);border-radius:99px;padding:2px 8px;font:11px ui-monospace,monospace}
.ed-txt-chips button:hover{border-color:var(--e-ac);color:var(--e-ac)}
.ed-txt-dica{font-size:11px;color:var(--e-mut);margin-top:6px}

/* propriedades */
.ed-props{width:300px;flex:none;background:var(--e-pn);border-left:1px solid var(--e-bd);overflow-y:auto;padding:12px 14px 40px}
.ed-props-t{display:flex;align-items:center;gap:8px;margin:2px 0 6px}.ed-props-t b{font-size:15px}
.ed-nome-el{flex:1;border-color:transparent!important;background:transparent!important;color:var(--e-mut)!important;font-size:12px!important}
.ed-nome-el:hover,.ed-nome-el:focus{border-color:var(--e-bd)!important}
.ed-sec{padding:12px 0;border-top:1px solid var(--e-bd);display:flex;flex-direction:column;gap:9px}
.ed-sec:first-of-type{border-top:0}
.ed-sec-t{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--e-mut)}
.ed-campo{display:flex;flex-direction:column;gap:4px;min-width:0}.ed-campo>span{font-size:12px;color:var(--e-mut)}
.ed-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ed-row2{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}
.ed-num{display:flex;align-items:center;border:1px solid var(--e-bd);border-radius:8px;background:var(--e-pn);padding-right:8px}
.ed-num input{border:0!important;width:100%;background:transparent!important;font-variant-numeric:tabular-nums}
.ed-num em{font-style:normal;color:var(--e-mut);font-size:11px}
.ed-slider{display:flex;align-items:center;gap:8px}.ed-slider input{flex:1;accent-color:var(--e-ac);padding:0;border:0;background:transparent}
.ed-slider em{font-style:normal;font-size:11px;color:var(--e-mut);min-width:38px;text-align:right;font-variant-numeric:tabular-nums}
.ed-seg{display:flex;border:1px solid var(--e-bd);border-radius:9px;overflow:hidden;background:var(--e-pn)}
.ed-seg button{flex:1;display:grid;place-items:center;height:32px;border:0;background:transparent;font-size:12px;padding:0 6px;white-space:nowrap}
.ed-seg button+button{border-left:1px solid var(--e-bd)}.ed-seg button.on{background:var(--e-ac2);color:var(--e-ac);font-weight:650}
.ed-cor-l{display:flex;align-items:center;gap:8px}.ed-cor-l code{font-size:11px;color:var(--e-mut)}
.ed-cor{width:34px;height:30px;border-radius:8px;border:1px solid rgba(0,0,0,.15);box-shadow:inset 0 0 0 2px rgba(255,255,255,.6);flex:none}
.ed-fonte{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 12px;border:1px solid var(--e-bd);border-radius:9px;background:var(--e-pn);font-size:17px!important}
.ed-fonte i{font-style:normal;color:var(--e-mut);font-size:12px}
.ed-ta{width:100%;resize:vertical}
.ed-grade6{display:grid;grid-template-columns:repeat(6,1fr);gap:2px;padding:2px;border:1px solid var(--e-bd);border-radius:9px}
.ed-grade6 .ed-ib{width:100%}
.ed-tipos{display:flex;flex-wrap:wrap;gap:4px}
.ed-tipos button{border:1px solid var(--e-bd);background:var(--e-pn2);border-radius:99px;padding:3px 9px;font-size:11.5px;color:var(--e-mut)}
.ed-tipos button.on{background:var(--e-ac2);border-color:var(--e-ac);color:var(--e-ac);font-weight:600}
.ed-acoes{padding-top:12px;border-top:1px solid var(--e-bd)}
.ed-folha{display:flex;gap:12px;align-items:center;padding:10px;border-radius:10px;background:var(--e-hov)}
.ed-folha-svg{flex:none}
.ed-atalhos{display:grid;gap:5px;font-size:12px}.ed-atalhos div{display:flex;justify-content:space-between;gap:8px}
.ed-atalhos kbd{font:11px ui-monospace,monospace;padding:1px 6px;border:1px solid var(--e-bd);border-bottom-width:2px;border-radius:5px;background:var(--e-pn2);white-space:nowrap}
.ed-atalhos span{color:var(--e-mut);text-align:right}

/* popovers, modal, toast */
.ed-pop{position:fixed;z-index:60;width:276px;padding:12px;background:var(--e-pn);border:1px solid var(--e-bd);border-radius:12px;box-shadow:var(--e-sh);display:flex;flex-direction:column;gap:8px}
.ed-pop-t{font-size:11px;font-weight:650;color:var(--e-mut)}
.ed-pop input[type=color]{width:40px;height:32px;padding:2px}.ed-pop .ed-row input:not([type]){width:92px;font-family:ui-monospace,monospace}
.ed-pop-fontes{width:300px;max-height:min(460px,70vh);overflow-y:auto;gap:2px}
.ed-pop-fontes button{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:8px 10px;border:0;background:transparent;border-radius:8px;text-align:left}
.ed-pop-fontes button:hover,.ed-pop-fontes button.on{background:var(--e-ac2)}.ed-pop-fontes small{color:var(--e-mut);font-size:11px;white-space:nowrap}
.ed-modal-f{position:fixed;inset:0;z-index:70;background:rgba(9,9,11,.45);display:grid;place-items:center;padding:16px}
.ed-modal{width:min(520px,100%);max-height:92vh;overflow:auto;background:var(--e-pn);border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.35);padding:16px}
.ed-modal:has(.ed-modal-pdf){width:min(980px,100%)}
.ed-modal-t{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.ed-modal-t b{font-size:16px}
.ed-modal-b{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:14px}
.ed-modal-pdf iframe{width:100%;height:70vh;border:1px solid var(--e-bd);border-radius:8px;background:#525659}
.ed-carreg{padding:40px;text-align:center;color:var(--e-mut)}
.ed-toast{position:fixed;left:50%;bottom:calc(52px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:80;display:flex;gap:8px;align-items:center;padding:10px 16px;border-radius:12px;background:#18181b;color:#fff;box-shadow:var(--e-sh);font-weight:550;max-width:calc(100vw - 32px);animation:edIn .18s ease-out}
.ed-toast .ed-ico{color:#4ade80}.ed-toast.erro{background:#7f1d1d}.ed-toast.erro .ed-ico{color:#fecaca}
.ed-toast.sai{opacity:0;transition:opacity .3s}
@keyframes edIn{from{opacity:0;transform:translate(-50%,8px)}}
.ed-only-sm{display:none!important}

/* celular / tela estreita: trilho embaixo, gaveta e propriedades como folhas */
@media(max-width:900px){
  .ed-hide-sm{display:none!important}.ed-only-sm{display:flex!important}
  .ed-topo{gap:2px;padding:0 6px}.ed-nome{flex:1;width:auto;min-width:60px}.ed-estado,.ed-zoom,.ed-topo .ed-sep{display:none}.ed-topo .ed-btn{padding:0 9px}
  .ed-tab{min-width:54px;font-size:10px}
  .ed-corpo{flex-direction:column;position:relative}
  .ed-trilho{order:3;width:100%;flex-direction:row;border-right:0;border-top:1px solid var(--e-bd);padding:4px;overflow-x:auto}
  .ed-tab{flex:1;min-width:58px}
  .ed-gaveta,.ed-props{position:absolute;left:0;right:0;bottom:64px;max-height:56vh;width:auto;z-index:5;border:0;border-top:1px solid var(--e-bd);box-shadow:0 -10px 30px rgba(0,0,0,.15);border-radius:16px 16px 0 0}
  .ed-props{display:none}.ed-props-on .ed-props{display:block}.ed-props-on .ed-gaveta{display:none}
  .ed-fecha-props{width:100%;justify-content:center;margin-bottom:6px}
  .ed-status{display:none}
  .ed-palco-in{padding:24px}
}
