.cqfe-entry{margin-top:22px}.cqfe-open{display:block;width:100%;padding:13px 18px;border:1px solid #183153;border-radius:8px;background:#fff;color:#183153;font:700 14px Arial,sans-serif;cursor:pointer}
.cqfe-open:hover{background:#edf3f7}.cqfe-entry-note{font-size:12px;line-height:1.6;color:#66768a;margin:8px 0 12px}
dialog.cqfe{box-sizing:border-box;width:min(1160px,96vw);max-height:94dvh;border:1px solid #dce3ec;border-radius:16px;padding:0;color:#183153;background:#f5f6f8;font:14px Arial,sans-serif;overflow:auto}
.cqfe::backdrop{background:#0e2035b8}.cqfe *{box-sizing:border-box}.cqfe .cqfe-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;background:#fff;border-bottom:1px solid #e4e7ec}
.cqfe-head p{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:#66768a;margin:0 0 5px}.cqfe-head h2{font-size:22px;margin:0;letter-spacing:-.5px}.cqfe-head button{width:40px;height:40px;font-size:26px;flex:0 0 40px;padding:0}
.cqfe-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr);gap:22px;padding:24px}.cqfe-preview{min-width:0}.cqfe-preview canvas{display:block;width:100%;height:auto;background:#fff;border:1px solid #dce3ec;border-radius:10px;touch-action:none;cursor:move}.cqfe-preview p{font-size:12px;line-height:1.6;color:#66768a}
.cqfe-tools{background:#fff;padding:20px;border:1px solid #e4e7ec;border-radius:10px;min-width:0}.cqfe label{display:block;margin:16px 0 7px;font-size:12px;font-weight:700}.cqfe label:first-child{margin-top:0}.cqfe input,.cqfe select{width:100%;min-width:0;font:14px Arial,sans-serif;padding:10px;border:1px solid #ccd4df;border-radius:6px;color:#183153;background:#fff}.cqfe input[type=range]{padding:5px 0;border:0;accent-color:#183153}.cqfe input[type=color]{height:42px}.cqfe small{display:block;font-size:11px;color:#66768a;line-height:1.5;margin-top:6px}.cqfe button{border:1px solid #ccd4df;border-radius:7px;padding:11px;background:#fff;color:#183153;font:700 12px Arial,sans-serif;cursor:pointer}.cqfe button:disabled{opacity:.5;cursor:default}.cqfe button:focus-visible,.cqfe input:focus-visible,.cqfe select:focus-visible,.cqfe-open:focus-visible{outline:3px solid #9ac4f0;outline-offset:2px}.cqfe-actions{display:flex;gap:8px;margin:12px 0}.cqfe-actions button{flex:1}.cqfe details{margin-top:15px}.cqfe summary{cursor:pointer;font-size:12px;line-height:1.6}.cqfe .cqfe-primary{display:block;width:100%;margin-top:10px;background:#e8dc75;border-color:#e8dc75;color:#183153;padding:14px}.cqfe .cqfe-primary:hover:not(:disabled){background:#d6c954}.cqfe-note{font-size:11px!important;line-height:1.6;color:#66768a}#cqfe-status{font-size:12px;line-height:1.6;min-height:30px;margin:16px 0 8px}
@media(max-width:740px){dialog.cqfe{width:96vw;max-height:95dvh}.cqfe-layout{grid-template-columns:1fr;padding:14px;gap:14px}.cqfe .cqfe-head{padding:14px}.cqfe-head h2{font-size:19px}.cqfe-tools{padding:16px}}

.cqfe .cqfe-perspective{margin-top:18px;padding:14px;background:#f6f8fb;border:1px solid #dce3ec;border-radius:8px}.cqfe-perspective h3{font-size:13px;margin:0 0 10px}.cqfe .cqfe-check{display:flex;align-items:center;gap:9px;line-height:1.5;margin:0}.cqfe .cqfe-check input{width:18px;height:18px;flex:0 0 18px;accent-color:#183153}.cqfe-perspective output{float:right;color:#52657a;font-weight:400}.cqfe-perspective [hidden]{display:none!important}

.cqfe .cqfe-curvature{margin-top:18px;padding:14px;background:#f6f8fb;border:1px solid #dce3ec;border-radius:8px}.cqfe-curvature h3{font-size:13px;margin:0 0 10px}.cqfe-curvature output{float:right;color:#52657a;font-weight:400}.cqfe-curvature button{width:100%}

/* Editor compacto: altera só a apresentação, mantendo o canvas e a exportação. */
dialog.cqfe{width:min(900px,94vw);max-height:min(84dvh,700px);border-radius:12px}
.cqfe .cqfe-head{padding:12px 16px;gap:12px}.cqfe-head h2{font-size:19px}.cqfe-head p{margin-bottom:3px}.cqfe-head button{width:36px;height:36px;flex-basis:36px;font-size:24px}
.cqfe-layout{grid-template-columns:minmax(0,1fr) minmax(300px,1fr);gap:14px;padding:14px;align-items:start}
.cqfe-preview{width:min(100%,380px,max(160px,calc(84dvh - 200px)));justify-self:center}.cqfe-preview p{font-size:11px;line-height:1.5;margin:8px 0}
.cqfe-tools{padding:14px;max-height:calc(min(84dvh,700px) - 100px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.cqfe label{margin:11px 0 5px}.cqfe input,.cqfe select{padding:8px;font-size:13px}.cqfe input[type=range]{min-height:24px}.cqfe input[type=color]{height:36px}
.cqfe button{padding:9px;min-height:36px}.cqfe .cqfe-primary{padding:11px}.cqfe small{font-size:10px;line-height:1.5}.cqfe-note{line-height:1.5}.cqfe-actions{margin:10px 0}
.cqfe .cqfe-perspective,.cqfe .cqfe-curvature{margin-top:12px;padding:10px}.cqfe-perspective h3,.cqfe-curvature h3{margin-bottom:8px}#cqfe-status{margin:12px 0 6px;min-height:26px}
@media(max-width:740px){
 dialog.cqfe{width:94vw;max-height:92dvh}.cqfe-layout{grid-template-columns:1fr;padding:12px;gap:12px}.cqfe-preview{width:min(100%,260px)}
 .cqfe .cqfe-head{padding:12px}.cqfe-head h2{font-size:18px}.cqfe-tools{padding:12px;max-height:none;overflow:visible;scrollbar-gutter:auto}
 .cqfe button{min-height:44px}.cqfe input:not([type=range]):not([type=checkbox]),.cqfe select{min-height:40px}.cqfe input[type=range]{min-height:30px}
}

@media(max-width:740px){.cqfe .cqfe-head button{width:44px;height:44px;flex-basis:44px}.cqfe .cqfe-check{min-height:36px}}

/* Controlos reduzidos: metade da altura e dos espaçamentos da versão compacta. */
.cqfe-open{font-size:11px;padding:4px 8px;min-height:22px}.cqfe-entry-note{font-size:10px;line-height:1.4;margin:4px 0 6px}
dialog.cqfe{width:min(700px,94vw);max-height:min(84dvh,560px);font-size:11px;border-radius:8px}
.cqfe .cqfe-head{padding:6px 8px;gap:6px}.cqfe-head h2{font-size:15px}.cqfe-head p{font-size:9px;margin-bottom:2px}.cqfe .cqfe-head button{width:18px;height:18px;min-height:18px;flex-basis:18px;font-size:16px;line-height:16px;padding:0}
.cqfe-layout{grid-template-columns:minmax(0,1fr) minmax(210px,1fr);gap:7px;padding:7px}
.cqfe-preview{width:min(100%,190px)}.cqfe-preview p{font-size:9px;line-height:1.35;margin:4px 0}
.cqfe-tools{padding:7px;max-height:calc(min(84dvh,560px) - 64px)}
.cqfe label{font-size:10px;line-height:12px;margin:5px 0 2px}.cqfe input,.cqfe select{font-size:10px;line-height:12px;height:16px;min-height:0;padding:1px 3px;border-radius:3px}
.cqfe input[type=file]{padding:0;height:18px}.cqfe input[type=file]::file-selector-button{font:9px Arial,sans-serif;padding:1px 3px;height:16px;border:1px solid #ccd4df;border-radius:3px;background:#f5f6f8;color:#183153;margin-right:4px}
.cqfe input[type=color]{height:18px;padding:1px}.cqfe .cqfe-check{gap:5px;min-height:18px}.cqfe .cqfe-check input{width:9px;height:9px;min-height:9px;flex:0 0 9px;padding:0}
.cqfe input[type=range]{appearance:none;-webkit-appearance:none;height:12px;min-height:12px;padding:0;margin:0;background:transparent;cursor:pointer}
.cqfe input[type=range]::-webkit-slider-runnable-track{height:2px;background:#ccd4df;border-radius:2px}.cqfe input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:8px;height:8px;margin-top:-3px;border:0;border-radius:50%;background:#183153}
.cqfe input[type=range]::-moz-range-track{height:2px;background:#ccd4df;border-radius:2px}.cqfe input[type=range]::-moz-range-progress{height:2px;background:#183153}.cqfe input[type=range]::-moz-range-thumb{width:8px;height:8px;border:0;border-radius:50%;background:#183153}
.cqfe button{font-size:10px;line-height:12px;height:18px;min-height:18px;padding:2px 4px;border-radius:4px}.cqfe .cqfe-primary{height:19px;min-height:19px;padding:2px 4px;margin-top:5px}
.cqfe-actions{gap:4px;margin:5px 0}.cqfe small{font-size:9px;line-height:1.35;margin-top:3px}.cqfe .cqfe-note{font-size:9px!important;line-height:1.35}
.cqfe .cqfe-perspective,.cqfe .cqfe-curvature{padding:5px;margin-top:6px;border-radius:4px}.cqfe-perspective h3,.cqfe-curvature h3{font-size:11px;margin-bottom:4px}.cqfe details{margin-top:7px}.cqfe summary{font-size:10px;line-height:1.4}#cqfe-status{font-size:10px;line-height:1.4;min-height:13px;margin:6px 0 3px}
@media(max-width:740px){
 dialog.cqfe{width:94vw;max-height:90dvh}.cqfe-layout{grid-template-columns:1fr;padding:6px;gap:6px}.cqfe-preview{width:min(100%,130px)}.cqfe .cqfe-head{padding:6px}.cqfe-tools{padding:6px;max-height:none;overflow:visible}
 .cqfe button{height:22px;min-height:22px}.cqfe .cqfe-primary{height:22px;min-height:22px}.cqfe input:not([type=range]):not([type=checkbox]),.cqfe select{height:20px;min-height:20px}.cqfe input[type=range]{height:15px;min-height:15px}.cqfe .cqfe-check{min-height:18px}.cqfe .cqfe-head button{width:22px;height:22px;min-height:22px;flex-basis:22px}
}

/* Pré-visualização 3x maior; tamanhos dos controlos preservados. */
dialog.cqfe{width:min(932px,96vw);max-height:min(94dvh,760px)}
.cqfe-layout{grid-template-columns:minmax(0,1fr) 339px}
.cqfe-preview{width:100%;max-width:570px}
@media(max-width:740px){
 dialog.cqfe{width:94vw;max-height:94dvh}
 .cqfe-layout{grid-template-columns:1fr}
 .cqfe-preview{width:min(100%,390px);max-width:390px}
}
