/* 1.200.20 · Gerador de layout técnico · papel CAD branco real / PNG anti-dark-mode */
#technicalLayoutDialog{position:fixed;inset:0;z-index:1300;display:none;align-items:stretch;justify-content:center;background:rgba(0,0,0,.72);backdrop-filter:blur(7px);padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
#technicalLayoutDialog.show{display:flex}
.technicalLayoutShell{width:min(1540px,100%);height:100%;min-height:0;background:#111;border:1px solid #343434;border-radius:22px;box-shadow:0 24px 80px rgba(0,0,0,.5);display:flex;flex-direction:column;overflow:hidden;color:#f4f4f4}
.technicalLayoutHead{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;border-bottom:1px solid #2f2f2f;background:#151515}
.technicalLayoutHead>div{display:flex;flex-direction:column;gap:3px;min-width:0}.technicalLayoutHead strong{font-size:21px}.technicalLayoutHead span{font-size:12px;color:#aaa}
.technicalLayoutToolbar{display:grid;grid-template-columns:minmax(190px,1.4fr) repeat(3,minmax(130px,.8fr));gap:10px;padding:10px 14px;background:#191919;border-bottom:1px solid #303030}
.technicalLayoutToolbar label{font-size:11px;color:#aaa;display:flex;flex-direction:column;gap:5px}.technicalLayoutToolbar select{width:100%;min-height:40px}
.technicalLayoutViewTabs{display:flex;gap:7px;padding:9px 12px;overflow-x:auto;background:#121212;border-bottom:1px solid #2d2d2d}.technicalLayoutViewTabs button{white-space:nowrap;min-height:38px}.technicalLayoutViewTabs button.active{background:#1451d8;border-color:#2c6fff;color:#fff}
.technicalLayoutMain{flex:1;min-height:0;display:grid;grid-template-columns:310px 1fr;background:#0e0e0e}
.technicalLayoutSide{min-height:0;overflow:auto;padding:12px;border-right:1px solid #2d2d2d;display:flex;flex-direction:column;gap:10px;background:#141414}
.layoutSideCard{border:1px solid #313131;border-radius:14px;padding:12px;background:#0e0e0e;display:flex;flex-direction:column;gap:9px}.layoutSideCard>strong{font-size:14px}.layoutSideCard small{color:#999;line-height:1.45}
.layoutCheck{display:flex;align-items:center;gap:9px;font-size:13px;color:#ddd}.layoutCheck input{width:20px;height:20px;flex:0 0 auto}
.layoutSectionControl{display:flex;flex-direction:column;gap:6px;padding:8px 0;border-top:1px solid #272727}.layoutSectionControl:first-of-type{border-top:0}.layoutSectionControl>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.layoutSectionControl b{font-size:12px;color:#d9d9d9}.layoutSectionControl button{font-size:11px;padding:7px 9px}.layoutSectionControl input[type=range]{width:100%}
.layoutLegendCard{min-height:120px}.layoutLegendCard #layoutPieceLegend{display:grid;gap:5px}.layoutLegendCard #layoutPieceLegend>div{display:grid;grid-template-columns:28px 1fr;align-items:center;gap:7px;font-size:11px;color:#bbb}.layoutLegendCard #layoutPieceLegend span{display:grid;place-items:center;width:23px;height:23px;border:1px solid #3572e8;border-radius:50%;color:#8db5ff;font-weight:800}.layoutLegendCard #layoutPieceLegend b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#ddd}
.technicalLayoutPreview{min-width:0;min-height:0;display:flex;flex-direction:column;background:#fff;color-scheme:only light;forced-color-adjust:none}.layoutSvgWrap{flex:1;min-height:0;overflow:auto;display:grid;place-items:center;padding:18px;touch-action:pan-x pan-y pinch-zoom;background:#fff;color-scheme:only light;forced-color-adjust:none}.layoutSvgWrap svg,.layoutPreviewCanvas{display:block;width:min(100%,1500px);height:auto;max-height:100%;background:#fff!important;box-shadow:none;border:1px solid #000;border-radius:0;color-scheme:only light!important;forced-color-adjust:none!important;filter:none!important;mix-blend-mode:normal!important}.layoutPreviewCanvas{image-rendering:auto;touch-action:pan-x pan-y;cursor:crosshair}
#technicalLayoutSvg,#technicalLayoutSvg *{forced-color-adjust:none!important;color-scheme:only light!important}.layoutEmpty{color:#222;background:#fff;border:1px solid #aaa;padding:40px}.layoutStatus{padding:8px 12px;border-top:1px solid #3a3a3a;background:#151515;color:#aaa;font-size:12px}
.technicalLayoutActions{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid #303030;background:#151515}.technicalLayoutActions button{min-width:95px}
@media(max-width:900px){
  #technicalLayoutDialog{padding:0}.technicalLayoutShell{border-radius:0;border:0}.technicalLayoutHead{padding:10px 12px}.technicalLayoutHead strong{font-size:18px}.technicalLayoutHead span{font-size:10px}
  .technicalLayoutToolbar{grid-template-columns:1fr 1fr;padding:8px}.technicalLayoutViewTabs{padding:7px 8px}.technicalLayoutMain{grid-template-columns:1fr;grid-template-rows:auto 1fr}.technicalLayoutSide{border-right:0;border-bottom:1px solid #2d2d2d;display:grid;grid-template-columns:1fr 1fr;max-height:255px;padding:8px;overflow:auto}.layoutLegendCard{grid-column:1/-1;max-height:100px;overflow:auto}.layoutSideCard{padding:9px;gap:7px}.layoutSideCard small{font-size:10px}.layoutCheck{font-size:11px}.layoutSectionControl button{padding:6px 8px}
  .layoutSvgWrap{padding:8px;align-items:start}.layoutSvgWrap svg,.layoutPreviewCanvas{width:100%;max-height:none}.technicalLayoutActions{overflow-x:auto;justify-content:flex-start;padding:8px}.technicalLayoutActions button{min-width:84px;white-space:nowrap}
}
@media(max-width:560px){.technicalLayoutToolbar{grid-template-columns:1fr 1fr}.technicalLayoutSide{grid-template-columns:1fr;max-height:310px}.layoutLegendCard{grid-column:auto}.technicalLayoutHead #closeTechnicalLayout{min-width:72px}.technicalLayoutViewTabs button{font-size:11px;padding:8px 10px}}

/* 1.200.18 · o papel do desenho permanece branco mesmo com tema escuro forçado no Android */
#technicalLayoutDialog .technicalLayoutPreview,#technicalLayoutDialog .layoutSvgWrap,#technicalLayoutDialog .layoutPreviewCanvas{background-color:#fff!important;background-image:none!important;filter:none!important;opacity:1!important;mix-blend-mode:normal!important}

/* 1.200.23: no PWA Android o desenho é exibido como PNG, evitando Auto Dark em canvas/SVG. */
.layoutPreviewImageHolder{display:grid;place-items:center;width:100%;min-width:100%;background:#fff!important;color-scheme:only light!important;forced-color-adjust:none!important}
.layoutPreviewImage{display:block;width:min(100%,1500px);height:auto;max-height:none;background:#fff!important;border:1px solid #000;border-radius:0;filter:none!important;opacity:1!important;mix-blend-mode:normal!important;forced-color-adjust:none!important;color-scheme:only light!important}

/* 1.200.23: preview recebe PNG vindo do renderer Canvas 2D direto, sem SVG intermediário. */
.layoutPreviewImage{background:#fff!important;isolation:isolate!important;}


/* 1.200.25 — prévia exata da folha antes de imprimir */
#layoutPrintPreviewDialog{position:fixed;inset:0;z-index:1425;display:none;align-items:stretch;justify-content:center;background:rgba(0,0,0,.82);padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
#layoutPrintPreviewDialog.show{display:flex}
.layoutPrintPreviewShell{width:min(1500px,100%);height:100%;min-height:0;display:flex;flex-direction:column;background:#111;border:1px solid #333;border-radius:18px;overflow:hidden;box-shadow:0 24px 80px rgba(0,0,0,.55);color:#f5f5f5}
.layoutPrintPreviewHead{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;background:#151515;border-bottom:1px solid #333}.layoutPrintPreviewHead>div{display:flex;flex-direction:column;gap:2px;min-width:0}.layoutPrintPreviewHead strong{font-size:18px}.layoutPrintPreviewHead span{font-size:11px;color:#aaa}
.layoutPrintPreviewTools{display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;background:#181818;border-bottom:1px solid #333}.layoutPrintPreviewTools button{min-width:46px}.layoutPrintPreviewTools strong{min-width:58px;text-align:center;font-variant-numeric:tabular-nums}
.layoutPrintPreviewViewport{flex:1;min-height:0;overflow:auto;background:#d7d7d7;padding:20px;display:flex;align-items:flex-start;justify-content:center;touch-action:pan-x pan-y pinch-zoom}
.layoutPrintPreviewImage{display:block;background:#fff;box-shadow:0 3px 24px rgba(0,0,0,.35);border:1px solid #888;max-width:none;height:auto;transform-origin:top center;filter:none!important;forced-color-adjust:none!important;color-scheme:only light!important}
.layoutPrintPreviewActions{display:flex;justify-content:flex-end;gap:8px;padding:10px 12px;background:#151515;border-top:1px solid #333}.layoutPrintPreviewActions button{min-width:118px}
@media(max-width:700px){#layoutPrintPreviewDialog{padding:0}.layoutPrintPreviewShell{border-radius:0;border:0}.layoutPrintPreviewHead{padding:9px 10px}.layoutPrintPreviewViewport{padding:10px}.layoutPrintPreviewActions{overflow-x:auto;justify-content:flex-start;padding:8px}.layoutPrintPreviewActions button{min-width:130px;white-space:nowrap}}

/* 1.200.28 · Perfis de saída do Layout */
.layoutProfileHint{padding:8px 16px 10px;color:#8f9aa6;font-size:12px;border-bottom:1px solid rgba(255,255,255,.08)}
@media (max-width:720px){.layoutProfileHint{padding:7px 14px 9px;font-size:11px}}
