.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%}

/* Vista com zoom e manipulação direta. Os controlos não são escalados. */
dialog.cqfe{width:min(1180px,97vw);max-height:95dvh;border-radius:14px;background:#fff;font-size:13px}
.cqfe .cqfe-head{padding:12px 18px}.cqfe-head h2{font-size:22px}.cqfe-head p{font-size:10px}
.cqfe .cqfe-head button{width:32px;height:32px;min-height:32px;flex-basis:32px;font-size:25px;padding:0}
.cqfe-layout{grid-template-columns:minmax(0,1fr) 320px;gap:12px;padding:12px;align-items:stretch;background:#fff}
.cqfe-preview{width:min(100%,calc(95dvh - 180px));min-width:0;max-width:none;justify-self:center}
.cqfe-stage{position:relative;width:100%;border:1px solid #d5deea;border-radius:10px;overflow:hidden;background:#fff}
.cqfe-preview canvas{width:100%;height:auto;display:block;border:0;border-radius:0;touch-action:none;cursor:default}
.cqfe-zoom-toolbar{position:absolute;z-index:1;top:9px;left:9px;right:9px;display:flex;align-items:center;gap:4px;pointer-events:none;flex-wrap:wrap}
.cqfe-zoom-toolbar>*{pointer-events:auto;box-shadow:0 1px 3px #1831530d}
.cqfe .cqfe-zoom-toolbar button{min-height:30px;width:auto;height:30px;padding:3px 9px;font-size:11px;line-height:1;background:#fff;white-space:nowrap}
.cqfe .cqfe-zoom-toolbar #cqfe-zoom-in,.cqfe .cqfe-zoom-toolbar #cqfe-zoom-out{font-size:20px;min-width:30px;padding:0}
.cqfe-zoom-toolbar output{font-size:11px;line-height:28px;padding:0 8px;background:#fff;border:1px solid #ccd4df;border-radius:5px;font-weight:700;min-width:50px;text-align:center}
.cqfe .cqfe-zoom-toolbar button[aria-pressed=true]{background:#183153;color:#fff}
.cqfe-preview p{font-size:11px;line-height:1.45;margin:7px 0;color:#66768a}
.cqfe-tools{display:flex;flex-direction:column;min-height:0;height:min(650px,calc(95dvh - 90px));max-height:none;padding:0;overflow:hidden;border-radius:10px;background:#fff}
.cqfe-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:#f3f5f8;padding:7px;border-bottom:1px solid #e4e7ec;flex:0 0 auto}
.cqfe .cqfe-tabs button{height:31px;min-height:31px;font-size:12px;padding:4px 2px;border-color:transparent;background:transparent;border-radius:6px}
.cqfe .cqfe-tabs button[aria-selected=true]{background:#183153;color:white}
.cqfe-tool-scroll{padding:14px;overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0}
.cqfe [role=tabpanel][hidden]{display:none!important}
.cqfe [role=tabpanel]{outline-offset:2px}
.cqfe label{font-size:12px;line-height:1.4;margin:10px 0 5px}
.cqfe input,.cqfe select{font-size:12px;line-height:1.4;height:31px;min-height:0;padding:4px 6px;border-radius:5px}
.cqfe input[type=file]{height:auto;min-height:29px;padding:2px;font-size:11px}
.cqfe input[type=file]::file-selector-button{font-size:11px;border:1px solid #ccd4df;border-radius:4px;background:#f5f6f8;color:#183153;padding:3px}
.cqfe input[type=color]{height:30px;padding:2px}
.cqfe input[type=range]{height:24px;min-height:24px;padding:0;accent-color:#183153}
.cqfe button{font-size:11px;line-height:1.4;min-height:28px;height:auto;padding:5px 7px}
.cqfe .cqfe-check input{width:15px;height:15px;flex-basis:15px}
.cqfe .cqfe-perspective,.cqfe .cqfe-curvature{padding:9px;margin-top:12px;border-radius:7px}
.cqfe .cqfe-note,.cqfe small{font-size:11px!important;line-height:1.45}
.cqfe-tool-footer{padding:10px 14px;border-top:1px solid #e4e7ec;background:#fafbfc;flex:0 0 auto}
.cqfe .cqfe-tool-footer .cqfe-primary{min-height:34px;height:auto;font-size:12px;padding:7px;margin-top:6px}
.cqfe #cqfe-continue{background:#183153;color:#fff;border-color:#183153}
.cqfe #cqfe-continue:hover:not(:disabled){background:#284d78}
.cqfe .cqfe-actions{gap:5px;margin:0 0 8px}.cqfe .cqfe-actions button{min-width:0;flex:1;min-height:30px}
.cqfe #cqfe-status{font-size:11px;line-height:1.4;min-height:15px;margin:8px 0 5px}
.cqfe-tool-footer .cqfe-note{margin:5px 0 0;font-size:10px!important}
.cqfe #cqfe-font-status{font-size:11px;line-height:1.4;color:#66768a;margin:7px 0}
.cqfe-font-preview{padding:14px 8px;border:1px dashed #ccd4df;border-radius:6px;font-size:23px;line-height:1.4;overflow-wrap:anywhere;color:#183153;background:#f7f9fb;margin:8px 0}
@media(max-width:740px){
 dialog.cqfe{width:97vw;max-height:96dvh}.cqfe-layout{grid-template-columns:1fr;padding:8px;gap:10px}.cqfe-preview{width:100%;max-width:520px;justify-self:center}.cqfe-tools{height:430px;max-height:none}.cqfe .cqfe-head{padding:10px 12px}.cqfe-head h2{font-size:18px}.cqfe .cqfe-head button{width:36px;height:36px;flex-basis:36px}.cqfe .cqfe-zoom-toolbar button{min-height:34px;height:34px}.cqfe-zoom-toolbar{left:6px;right:6px;top:6px;gap:3px}.cqfe-zoom-toolbar output{line-height:32px}.cqfe .cqfe-tabs button{min-height:36px}.cqfe .cqfe-actions button{min-height:34px}
}

.cqfe-zoom-toolbar button svg{width:14px;height:14px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
