:root{--navy:#101b2b;--navy2:#19283a;--bg:#f3f6f8;--panel:#fff;--ink:#192a3d;--muted:#7a8a9c;--line:#e4eaf0;--lime:#c1f180;--blue:#408deb;--shadow:0 5px 24px rgba(18,36,58,.045)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--ink);-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #84baff;outline-offset:2px}button:disabled{cursor:not-allowed;opacity:.45}h1,h2,p{margin:0}h2{font-size:17px;font-weight:760;letter-spacing:-.45px}a{color:inherit}.app-shell{display:flex;min-height:100vh}.sidebar{background:var(--navy);color:#edf5fa;width:264px;flex:0 0 264px;min-height:100vh;padding:30px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:11px;margin:3px 6px 58px}.brand strong{font-size:14px;letter-spacing:.35px;white-space:nowrap}.brand strong span{color:var(--lime)}.brand small{display:block;color:#8898a8;font-size:10px;margin-top:5px;letter-spacing:.6px}.brand-symbol{width:37px;height:37px;position:relative;flex:0 0 37px;background:#273a4b;border-radius:10px}.brand-symbol span{position:absolute;border-radius:2px}.brand-symbol span:first-child{background:var(--lime);left:10px;top:9px;width:7px;height:20px}.brand-symbol span:nth-child(2){background:var(--lime);left:20px;top:9px;width:9px;height:8px}.brand-symbol span:nth-child(3){background:#67baff;left:20px;top:20px;width:9px;height:9px}.workarea-label{font-size:10px;color:#657b8e;letter-spacing:1.9px;font-weight:800;padding:0 15px;margin-bottom:16px;display:flex;justify-content:space-between}.tiny-dot{width:4px;height:4px;background:#c5ef85;border-radius:50%}.menu{display:flex;flex-direction:column;gap:6px}.nav-item{width:100%;padding:14px 16px;display:flex;align-items:center;gap:14px;color:#a5b7c6;border:0;border-radius:11px;background:transparent;font-size:13px;font-weight:620;text-align:left;transition:.2s}.nav-item:hover{background:#243448;color:#fff}.nav-item.active{background:#2a3a4b;color:#e8f5ff;box-shadow:inset 3px 0 0 var(--lime)}.nav-icon{font-size:21px;line-height:1;width:23px;text-align:center;color:#8c9cae}.nav-item.active .nav-icon{color:var(--lime)}.sidebar-foot{margin-top:auto}.status-card{background:#1d2e40;border:1px solid #2e4256;border-radius:11px;padding:13px;display:flex;align-items:center;gap:10px}.status-card strong{font-size:11px;display:block;color:#eaf3f8}.status-card small{font-size:10px;color:#8ba1b5;display:block;margin-top:4px}.status-pulse{display:inline-block;width:7px;height:7px;border-radius:50%;background:#a5e570;box-shadow:0 0 0 3px rgba(162,225,110,.14)}.sidebar-foot p{color:#607689;font-size:10px;margin:11px 3px;line-height:1.5}.workspace{flex:1;min-width:0}.topbar{height:76px;border-bottom:1px solid #e6ecf1;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 42px}.crumb{font-size:11px;letter-spacing:1.15px;font-weight:800;color:#95a1ab}.crumb span{color:#c7d0d8;margin:0 11px}.crumb strong{color:#364758}.top-actions{display:flex;align-items:center;gap:10px}.local-tag{font-size:11px;font-weight:700;color:#718395;margin-right:10px}.local-tag .status-pulse{margin-right:7px}.btn{border-radius:9px;padding:12px 16px;font-size:12px;font-weight:790;border:1px solid transparent;display:inline-flex;align-items:center;gap:9px;justify-content:center;white-space:nowrap}.btn-outline{background:white;border-color:#dbe4ec;color:#314458}.btn-outline:hover{background:#f4f7fb}.btn-primary{background:var(--navy);color:var(--lime)}.btn-primary:hover{background:#22374a}.content{max-width:1550px;padding:39px 42px 45px;margin:0 auto}.page-section{display:none}.page-section.active{display:block}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:27px}.page-heading h1{font-size:clamp(26px,3.1vw,38px);letter-spacing:-1.6px;line-height:1.13;margin:10px 0 10px;font-weight:790}.page-heading h1 em{font-style:normal;color:#6f8593}.page-heading p{font-size:13px;color:var(--muted);line-height:1.5}.page-heading.compact h1{margin-top:8px;font-size:clamp(26px,2.7vw,36px)}.eyebrow,.kicker{letter-spacing:1.45px;color:#6c8295;font-size:10px;font-weight:900}.work-badge{border:1px solid #dae4eb;background:#fff;border-radius:9px;padding:12px 16px;font-size:11px;font-weight:800;letter-spacing:1.2px;white-space:nowrap}.work-badge span{color:#bec8d2;margin:0 5px}.metric-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:19px}.metric{background:var(--panel);border:1px solid #e6edf1;box-shadow:var(--shadow);border-radius:12px;padding:19px 20px;position:relative;min-height:112px}.metric-label{font-size:11px;color:#8392a2;font-weight:700;margin-bottom:15px;display:block}.metric-value{font-size:27px;font-weight:800;letter-spacing:-1.1px;font-variant-numeric:tabular-nums}.metric-sub{font-size:10px;color:#8c9caa;margin-left:5px}.metric-icon{position:absolute;right:17px;top:16px;color:#97a8b5;font-size:15px}.panel{background:var(--panel);border:1px solid #e5ebf0;border-radius:14px;box-shadow:var(--shadow);min-width:0}.project-layout{display:grid;grid-template-columns:minmax(325px,395px) minmax(0,1fr);gap:18px;align-items:start}.panel-header{padding:23px 24px 19px;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #edf0f3}.panel-header h2{margin-top:7px}.chip{font-size:10px;font-weight:700;color:#71869a;background:#f0f3f7;border:1px solid #e1e8ef;border-radius:100px;padding:7px 10px;white-space:nowrap}.chip-blue{color:#397dc1;background:#eef6ff;border-color:#e1edfa}.chip-green{color:#438a58;background:#eefaf1;border-color:#dff0e2}.form-stack{padding:22px 24px 24px;display:flex;flex-direction:column;gap:17px}.field{display:flex;flex-direction:column;gap:8px;min-width:0}.field span{font-size:11px;font-weight:770;color:#526578}.field span i{color:#98a7b5;font-weight:500;font-style:normal;font-size:10px;margin-left:5px}.field input,.field select{height:43px;width:100%;border:1px solid #dce5ed;border-radius:8px;background:#fbfcfe;padding:0 13px;font-size:13px;color:#233e52;min-width:0}.field input:focus,.field select:focus{background:#fff}.fields-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field-line{height:1px;background:#ecf0f3}.section-mini{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.section-mini strong{font-size:13px}.section-mini span{font-size:10px;color:#9aabb9}.checkbox-line{display:flex;gap:9px;align-items:center;font-size:12px;color:#4c5f6f;font-weight:620;cursor:pointer}.checkbox-line input{appearance:none;flex:0 0 17px;width:17px;height:17px;border-radius:5px;border:1px solid #afc0cc;background:#fff;margin:0}.checkbox-line input:checked{background:#2a826d;border-color:#2a826d}.checkbox-line input:checked:after{content:'✓';display:block;text-align:center;color:white;font-size:12px;line-height:15px;font-weight:bold}.manual-doors{padding:12px;background:#f8fafc;border-radius:9px}.manual-doors .field{margin-bottom:9px}.manual-doors .field:last-child{margin:0}.validation{background:#fff3ee;border:1px solid #ffcab6;border-radius:9px;padding:12px;color:#a0472f;font-size:12px;line-height:1.55}.diagram-holder{padding:28px 17px 5px;overflow:auto;min-height:375px;display:flex;justify-content:center;align-items:center}.diagram-holder svg{display:block;width:100%;min-width:610px;max-width:1200px}.diagram-holder.large{min-height:400px;padding-top:10px}.diagram-hint{display:none}.legend{display:flex;gap:18px;flex-wrap:wrap;padding:5px 24px 21px;border-bottom:1px solid #ecf0f4}.legend span{font-size:10px;color:#738599;font-weight:660;display:flex;align-items:center;gap:7px}.swatch{display:inline-block;width:13px;height:10px;border-radius:2px;background:#557e9c}.swatch-ua{background:#eea15c}.swatch-door{background:#f7f8fa;border:1px solid #a7bfcd}.swatch-short{background:#85b6ce}.insight{display:flex;gap:12px;align-items:flex-start;background:#f3f8fc;margin:19px 24px;padding:14px;border-radius:9px;border:1px solid #e5f0f6}.insight-icon{flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:#d9eaf5;color:#5785a3;font-weight:900;display:grid;place-items:center;font-size:12px}.insight strong{font-size:11px;color:#3d5c73}.insight p{font-size:11px;color:#8094a4;margin-top:5px;line-height:1.6}.bottom-summary{display:flex;gap:35px;align-items:center;margin:0 24px 23px;padding-top:3px}.bottom-summary>div{display:flex;flex-direction:column;gap:7px}.bottom-summary small{font-size:10px;color:#93a3b0}.bottom-summary strong{font-size:17px;white-space:nowrap}.text-action{margin-left:auto;border:0;background:transparent;color:#2664a3;font-size:11px;font-weight:790;white-space:nowrap}.spacious{margin-top:18px}.columns-2{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:18px}.spaced{padding-bottom:20px}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}.data-table th{background:#f7f9fb;color:#8797a4;font-size:10px;text-transform:uppercase;letter-spacing:.55px;font-weight:800;padding:13px 18px;white-space:nowrap}.data-table td{padding:12px 18px;border-bottom:1px solid #ecf0f4;color:#354b5d;vertical-align:middle}.data-table tbody tr:last-child td{border-bottom:0}.data-table td strong{color:#25394b}.data-table .r{text-align:right;font-variant-numeric:tabular-nums}.data-table .mini-text{color:#91a1ae;font-size:10px;display:block;margin-top:4px;line-height:1.4}.data-table .type{display:inline-flex;justify-content:center;padding:4px 7px;border-radius:4px;font-weight:780;font-size:10px}.type-cw{color:#4d7f9c;background:#e8f1f6}.type-ua{color:#b06b2b;background:#fff0df}.type-short{color:#557faa;background:#edf3fc}.data-table .rate-input{width:78px;height:32px;border:1px solid #dce6ed;border-radius:6px;background:#fff;padding:0 6px;text-align:right;color:#30495c;font-size:12px;font-variant-numeric:tabular-nums}.table-footer{background:#f7fafb;border-top:1px solid #e7eef3;margin:5px 0 0;display:flex;align-items:center;justify-content:space-between;padding:20px 24px}.table-footer strong{font-size:14px}.table-footer p{font-size:10px;color:#8ba0ae;margin-top:6px}.table-footer .big-num{font-size:24px;letter-spacing:-.9px}.body-copy{padding:22px 24px;font-size:12px;line-height:1.8;color:#526779}.body-copy p+p{margin-top:10px}.body-copy .title-small{font-weight:800;color:#304a5c;margin-top:10px}.mini-tags{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}.mini-tag{border:1px solid #dbe4ec;background:#f7fafc;padding:6px 8px;border-radius:5px;color:#59778c;font-weight:680;font-size:10px}.wide{margin:20px 0 0}.price-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,1fr);gap:18px}.profit-panel{background:#132239;color:#fff}.profit-panel .panel-header{border-color:#2d4056}.profit-panel .kicker{color:#85a2b8}.profit-panel h2{color:white}.profit-panel .chip{background:#23493b;color:#a8e5b4;border-color:#315c4b}.profit-summary{padding:26px}.profit-summary .big-price{font-size:52px;font-weight:850;letter-spacing:-2px;margin:10px 0}.profit-summary .subheading{font-size:11px;color:#91a7b8}.profit-summary .detail-line{display:flex;justify-content:space-between;border-bottom:1px solid #2f4153;padding:12px 0;font-size:12px;color:#bed0df}.profit-summary .detail-line strong{color:#fff}.profit-summary .margin-pill{display:inline-flex;padding:8px 13px;background:#2c5147;border-radius:60px;color:#b5f4bc;font-weight:800;font-size:12px}.profit-summary .bar{height:10px;display:flex;border-radius:10px;overflow:hidden;background:#314257;margin:26px 0 10px}.profit-summary .bar .cost{background:#67809a}.profit-summary .bar .gain{background:var(--lime)}.profit-summary .subnote{font-size:10px;color:#9fb1c3;line-height:1.6;margin-top:17px}.profit-summary .loss{color:#ff998b;background:#5c2f36}.quote-description{padding:22px 26px;font-size:13px;color:#476075;line-height:1.85}.quote-description ul{padding-left:20px}.quote-description li{margin-bottom:5px}.archive-actions{display:flex;gap:8px}.archive-item{padding:17px 24px;border-bottom:1px solid #ebf0f3;display:flex;align-items:center;justify-content:space-between;gap:12px}.archive-item:last-child{border:0}.archive-item strong{font-size:13px}.archive-item p{font-size:10px;margin-top:8px;color:#899ba9}.archive-item .item-actions{display:flex;gap:6px}.archive-item button{padding:8px 10px;font-size:11px;border:1px solid #dfe7ed;background:#fff;border-radius:7px;color:#426078;font-weight:700}.archive-item button.danger{color:#a15151}.archive-empty{padding:30px;text-align:center;color:#92a1af;font-size:12px;line-height:1.8}.global-footer{max-width:1550px;margin:0 auto;padding:0 42px 30px;color:#a3b0bc;font-size:10px;letter-spacing:.6px}.global-footer span{margin:0 9px}.mobile-nav{display:none}.toast{position:fixed;right:28px;bottom:25px;background:#18283b;color:#e8fff2;font-size:12px;padding:13px 18px;border-radius:10px;box-shadow:0 10px 35px #14223645;z-index:9;opacity:0;pointer-events:none;transform:translateY(8px);transition:.25s}.toast.on{opacity:1;transform:translateY(0)}.print-report{display:none}
@media(max-width:1280px){.sidebar{width:229px;flex-basis:229px}.brand{margin-left:2px}.brand strong{font-size:12px}.content{padding:31px 26px}.topbar{padding:0 26px}.project-layout{grid-template-columns:minmax(300px,365px) minmax(0,1fr)}.fields-2{gap:10px}.form-stack{padding:20px}.panel-header{padding:19px 20px}.metric{padding:16px}.metric-value{font-size:24px}.legend{padding-left:18px}}
@media(max-width:980px){.sidebar{display:none}.topbar{height:67px}.content{padding:26px 20px 100px}.project-layout{grid-template-columns:1fr}.metric-row{grid-template-columns:repeat(2,minmax(0,1fr))}.price-layout,.columns-2{grid-template-columns:1fr}.mobile-nav{position:fixed;z-index:5;bottom:0;left:0;width:100%;display:flex;justify-content:space-around;align-items:center;background:#112031;padding:9px 4px calc(8px + env(safe-area-inset-bottom));box-shadow:0 -5px 24px #071b2630}.mobile-item{color:#8fa8b9;background:transparent;border:0;font-size:19px;display:flex;flex-direction:column;align-items:center;gap:5px;flex:1}.mobile-item span{font-size:10px;font-weight:690}.mobile-item.active{color:var(--lime)}.global-footer{display:none}.toast{bottom:90px}.diagram-holder{justify-content:flex-start}}
@media(max-width:620px){.topbar{padding:0 14px}.crumb{font-size:10px;letter-spacing:.4px}.local-tag{display:none}.top-actions{gap:6px}.top-actions .btn{font-size:10px;padding:10px 9px}.content{padding:23px 14px 100px}.page-heading{align-items:flex-start;margin-bottom:22px}.page-heading h1{font-size:29px;letter-spacing:-1px}.page-heading p{font-size:12px}.page-heading .work-badge{display:none}.page-heading.compact{display:block}.page-heading.compact>.btn,.page-heading.compact>.archive-actions{margin-top:15px}.metric-row{gap:9px}.metric{padding:14px 13px;min-height:95px}.metric-label{margin-bottom:13px;font-size:10px}.metric-value{font-size:24px}.metric-icon{right:11px;top:10px}.panel-header{padding:19px 16px 17px}.panel-header h2{font-size:16px}.chip{font-size:9px;padding:7px 8px}.form-stack{padding:18px 16px}.diagram-holder{padding-left:0;padding-right:0}.diagram-holder svg{min-width:650px}.insight{margin:14px 16px}.bottom-summary{margin:0 15px 18px;gap:13px;flex-wrap:wrap}.bottom-summary strong{font-size:15px}.text-action{margin:10px 0 0;width:100%;text-align:left}.legend{gap:10px;padding:8px 16px 15px}.data-table th,.data-table td{padding:11px 12px}.profit-summary .big-price{font-size:43px}.archive-item{padding:15px;align-items:flex-start}.archive-item .item-actions{flex-direction:column}.table-footer{padding:19px 15px}.archive-actions .btn{padding:11px}.wide{margin:14px 0 0}}
@media print{@page{size:A4 landscape;margin:10mm}html,body{background:#fff!important;color:#13283a!important}.app-shell,.mobile-nav,.toast{display:none!important}.print-report{display:block!important;font-size:9pt;color:#192c3d}.print-heading{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #273d4e;padding-bottom:8mm;margin-bottom:6mm}.print-heading small{font-size:8pt;letter-spacing:1px;color:#668196;font-weight:800}.print-heading h1{font-size:22pt;margin-top:5mm}.print-heading p{font-size:9pt;color:#647886;margin-top:3mm}.report-mark{font-size:22pt;color:#a3b98a;font-weight:900}.report-metrics{display:flex;gap:6mm;margin:7mm 0}.report-metrics span{display:block;border:1px solid #e0e9ef;padding:3mm 7mm;font-size:9pt}.print-report h2{font-size:12pt;margin:3mm 0 2mm;border-left:3px solid #679cb6;padding-left:3mm}.print-report #reportDiagram{height:112mm;overflow:hidden}.print-report #reportDiagram svg{width:100%;height:100%;display:block}.print-report table{border-collapse:collapse;width:100%;font-size:7.4pt}.print-report th{background:#eaf1f5;font-weight:800}.print-report #reportMaterials td,.print-report #reportMaterials th{padding:.45mm 2mm;font-size:7pt}.print-report td,.print-report th{border:1px solid #d6e1e7;padding:1.15mm 2.5mm;text-align:left}.print-report .report-columns{display:grid;grid-template-columns:1fr 1fr;gap:7mm}.print-report h2:has(+ #reportStuds){break-before:page;page-break-before:always}.print-report .print-break{break-before:page;page-break-before:always}.print-report .report-warning{break-inside:avoid;margin-top:3mm!important;font-size:7.5pt;line-height:1.5;border:1px solid #dfc7a1;padding:3mm;background:#fffaed;margin-top:7mm}.print-report #reportPrice{font-size:10pt}.print-report #reportPrice p{margin:2mm 0}.print-report #reportPrice strong{font-size:13pt}}

@media(max-width:620px){.diagram-hint{display:block;text-align:center;font-size:10px;font-weight:720;color:#8097a9;margin:-6px 0 12px}}

/* Cartongesso Pro V2 */
[hidden]{display:none!important}
#ceilingFields .fields-2{margin-top:13px}
.special-toolbar{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}
.special-toolbar select{min-width:175px;flex:1;padding:12px;border:1px solid var(--line);border-radius:9px;background:white}
.special-list{display:flex;flex-direction:column;gap:11px}
.special-work{padding:13px;background:#f8fbfd;border:1px solid #e1eaf1;border-radius:12px}
.special-work .special-head{display:flex;align-items:center;gap:9px;margin-bottom:10px}
.special-work .special-head input{flex:1;min-width:0;padding:10px;border:1px solid #d6e3ec;border-radius:8px;font-weight:650}
.special-work .special-head button{border:0;background:#fff4f1;color:#ab3b2c;padding:8px 10px;border-radius:8px}
.special-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.special-fields label{display:flex;flex-direction:column;font-size:10px;color:#667d90;gap:4px}
.special-fields input,.special-fields select{width:100%;min-width:0;border:1px solid #d6e3ec;border-radius:8px;padding:8px;background:#fff;font-size:12px}
.stud-tools{display:flex;gap:14px;align-items:end;padding:0 22px 10px;flex-wrap:wrap}
.stud-tools .field{max-width:240px;min-width:180px;flex:1}
.stud-tools .btn{margin-bottom:2px}
.editor-note{font-size:12px;line-height:1.65;color:#637c8d;padding:2px 22px 16px}
#manualStudEditor{padding:0 22px 18px}
.stud-editor-actions{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:9px}
.stud-editor-actions input{width:130px;border:1px solid #d6e3ec;border-radius:8px;padding:10px}
.stud-chip-list{display:flex;flex-wrap:wrap;gap:8px}
.stud-chip{display:flex;align-items:center;gap:5px;background:#eef6fd;border:1px solid #cee2f0;border-radius:9px;padding:5px}
.stud-chip input{width:67px;border:1px solid #afc9dc;border-radius:6px;padding:6px;text-align:right;font-size:12px}
.stud-chip span{font-size:11px;color:#536d82}
.stud-chip button{border:0;background:transparent;font-size:17px;color:#aa4141;padding:3px 6px}
.drag-handle{cursor:ew-resize;touch-action:none}
.technical-notes{display:flex;flex-direction:column;gap:7px;padding:0 22px 20px}
.technical-notes p{color:#6c4c18;background:#fff8e9;border:1px solid #f6e8bc;padding:10px 12px;border-radius:9px;font-size:12px;line-height:1.45}
@media(max-width:650px){.special-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.stud-tools{padding:0 14px 12px}.editor-note{padding:0 14px 12px}#manualStudEditor,.technical-notes{padding-left:14px;padding-right:14px}}
@media print{#studEditorPanel,.special-toolbar,.special-list{display:none!important}}
@media print{
  .print-report .print-heading{padding-bottom:4mm!important;margin-bottom:4mm!important}
  .print-report #reportPrice{font-size:8.5pt!important}
  .print-report #reportPrice p{margin:1mm 0!important}
  .print-report #reportPrice strong{font-size:10.5pt!important}
  .print-report .report-warning{font-size:6.8pt!important;line-height:1.15!important;padding:1.6mm!important;margin-top:2mm!important}
}
/* V3 · Taglio lastre, interazione e rendering */
.cut-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:8px 20px 16px}
.cut-side{padding:12px;border:1px solid #d8e5ee;border-radius:12px;background:#f8fbfd;min-width:0}
.cut-side strong{display:block;font-size:13px;color:#1d435e;margin-bottom:6px}
.cut-side svg{width:100%;display:block;max-height:190px}
#panelCutTable{margin:0 20px 20px}#panelCutTable .mini-tags{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
#panelCutTable .editor-note{padding:12px 2px 2px}
.joint-entry{display:block;margin:10px 0}
#manualJointEditor{padding:0 24px 22px}#manualJointEditor .editor-note{padding:0 0 8px}
#manualJointEditor .btn{margin-top:8px}
.report-cuts{display:grid;grid-template-columns:1fr 1fr;gap:2mm}
.report-cuts svg{width:100%;height:auto;max-height:40mm;page-break-inside:avoid}
@media(max-width:800px){.cut-grid{grid-template-columns:1fr}.cut-side svg{max-height:250px}}
@media(max-width:650px){#manualJointEditor{padding:0 14px 16px}.cut-grid{margin:5px 12px 12px}#panelCutTable{margin:0 10px 14px}}
@media print{.report-cuts{display:flex;gap:1mm}.report-cuts svg{width:48%;max-height:35mm}#reportPanelCuts h2{font-size:10pt!important;margin:3mm 0 1mm!important}#reportPanelCuts p{font-size:6.5pt!important}}

/* V3.1: anteprima dei giunti in tempo reale */
.joint-live-preview{margin:12px 0 9px;padding:13px;background:#f5f9fc;border:1px solid #cfdfeb;border-radius:12px}
.joint-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px;color:#234b63;margin-bottom:10px}
.joint-preview-heading span{color:#6b8090;font-size:11px}
.joint-preview-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.joint-preview-pair>div{min-width:0;background:white;border:1px solid #dce9f0;border-radius:8px;padding:8px}
.joint-preview-pair b{font-size:12px;letter-spacing:.7px}.joint-side-a,.legend-joint-a{color:#8b44b5!important}.joint-side-b,.legend-joint-b{color:#167d72!important}
.joint-preview-pair svg{width:100%;height:auto;display:block}
.joint-preview-summary{font-size:10px;line-height:1.65;margin-top:10px;color:#526b7c;overflow-wrap:anywhere}
.joint-preview-error{font-size:12px;color:#a64032;padding:11px;background:#fff1ec;border:1px solid #f1b8a8;border-radius:8px}
@media(max-width:720px){.joint-preview-pair{grid-template-columns:1fr}}
/* ============= Cartongesso Pro V4 / Laboratorio speciale ============= */
.v4-catalog-intro,.v4-workspace,#v4DetailWorkspace{margin-bottom:19px}
.v4-group{margin-bottom:22px}.v4-group-heading{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 11px}.v4-group-heading h2{font-size:14px;letter-spacing:.1px}.v4-group-heading small{font-size:11px;color:#8498a8}
.v4-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:10px}
.v4-cat-card{border:1px solid #dfe8ee;border-radius:12px;padding:14px 12px;min-height:127px;background:#fff;text-align:left;display:flex;flex-direction:column;gap:6px;transition:border-color .12s,background .12s,box-shadow .12s}
.v4-cat-card:hover{border-color:#91b9d6;box-shadow:0 3px 14px rgba(27,65,95,.08)}.v4-cat-card.v4-selected{background:#f0f8fb;border:2px solid #4583a5;padding:13px 11px}
.v4-card-icon{display:grid;place-items:center;background:#e7f0f7;border-radius:7px;color:#477b9e;font-size:19px;width:31px;height:31px}.v4-cat-card strong{font-size:12px;line-height:1.2;color:#294b62}.v4-cat-card small{font-size:10px;line-height:1.4;color:#7a90a0}
.v4-editor-layout{display:grid;grid-template-columns:minmax(315px,415px) minmax(0,1fr);gap:16px;align-items:start}.v4-right{display:flex;flex-direction:column;gap:16px}.v4-form{padding:21px 23px;display:flex;flex-direction:column;gap:17px}.v4-form .fields-2{gap:12px}
.v4-drawing{padding:18px 16px}.v4-drawing svg{width:100%;max-width:780px;display:block;margin:auto}.v4-note{font-size:11px;color:#697f8e;margin:0 18px 19px;line-height:1.55}
.v4-small-hint{font-size:11px;color:#7b8b9b;line-height:1.6;margin:0 0 12px}.v4-textarea{border:1px solid #dce5ed;border-radius:8px;background:#fbfcfe;padding:11px;color:#2a4358;font:inherit;font-size:12px;resize:vertical}
.v4-hint{font-size:10px;color:#7a8b9a;line-height:1.55}.v4-action-row{display:flex;gap:8px;flex-wrap:wrap}.v4-action-row .btn{font-size:11px;white-space:normal}
.v4-results{padding:18px 20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.v4-results>div{background:#f7fafc;border:1px solid #e6eff3;padding:12px;border-radius:8px;display:flex;flex-direction:column;gap:6px}.v4-results small{font-size:10px;color:#788a9b}.v4-results strong{font-size:18px;color:#233e52}
.v4-estimate>.v4-small-hint{padding:0 20px}.v4-estimate>.v4-warning{margin:8px 20px}.v4-cost{border-top:1px solid #edf0f3;padding:17px 20px;display:grid;grid-template-columns:1fr auto;gap:10px}.v4-cost span{font-size:11px;color:#698193}.v4-cost b{font-size:13px;color:#213f53}
.v4-warning{padding:13px 14px;border:1px solid #efd8b4;background:#fff9ed;border-radius:9px;color:#8b6023;font-size:11px;line-height:1.6;margin:12px 0}.v4-warning strong{font-size:12px}.v4-warning p{margin-top:4px}
.v4-detail-layout{display:grid;grid-template-columns:minmax(240px,320px) minmax(0,1fr);gap:16px;align-items:start}.v4-detail-index{overflow:hidden}.v4-detail-group{padding:10px 15px}.v4-detail-group h3{font-size:10px;text-transform:uppercase;letter-spacing:1px;color:#92a2b1;margin:10px 0}.v4-detail-item{display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;padding:11px 12px;border:0;border-radius:7px;color:#385269;background:transparent;font-size:12px;line-height:1.3}.v4-detail-item:hover{background:#f2f7fb}.v4-detail-item.active{background:#e9f3fa;color:#25658c;font-weight:800}
.v4-detail-content{padding:20px 23px;display:flex;flex-direction:column;gap:14px}.v4-detail-content>p{font-size:12px;color:#546e80}.v4-detail-input{max-width:650px}.v4-ref-link{text-decoration:none}
.v4-print{display:none}
@media(max-width:1110px){.v4-editor-layout{grid-template-columns:1fr}.v4-detail-layout{grid-template-columns:1fr}}
@media(max-width:720px){.v4-card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.v4-cat-card{min-height:125px;padding:10px}.v4-cat-card.v4-selected{padding:9px}.v4-form{padding:16px 14px}.v4-results{padding:12px;gap:7px}.v4-results>div{padding:10px}.v4-detail-content{padding:12px}.v4-drawing{padding:8px}.mobile-nav{display:flex;overflow-x:auto;justify-content:flex-start;scrollbar-width:thin}.mobile-item{flex:0 0 76px;min-width:76px}.mobile-item span{font-size:9px}}
@media print{
 body.v4-print-active .print-report{display:none!important}
 body.v4-print-active .v4-print{display:block!important;color:#243b50!important;background:white!important;font-size:10pt!important}
 body.v4-print-active .v4-print-heading{border-bottom:2px solid #446f89;padding:0 0 8mm;margin-bottom:5mm}
 body.v4-print-active .v4-print-heading p{font-size:8pt;color:#657e8f;letter-spacing:.8px}
 body.v4-print-active .v4-print-heading h1{font-size:20pt;margin:5mm 0 2mm}
 body.v4-print-active .v4-print h2{font-size:12pt;padding-left:3mm;border-left:3px solid #8fbad0;margin:5mm 0 4mm}
 body.v4-print-active .v4-print-svg{height:auto;max-height:115mm;overflow:hidden}
 body.v4-print-active .v4-print-svg svg{max-height:110mm;height:auto;width:100%}
 body.v4-print-active .v4-results{display:grid;grid-template-columns:repeat(3,1fr);padding:6mm 0;gap:2mm}
 body.v4-print-active .v4-results>div{padding:3mm}
 body.v4-print-active .v4-results strong{font-size:12pt}
 body.v4-print-active .v4-cost{padding:3mm 0}
 body.v4-print-active .v4-warning{padding:3mm;break-inside:avoid}
 body.v4-print-active p{line-height:1.45}
}

@media print{body.v4-print-active .v4-print h2:nth-of-type(2){break-before:page;page-break-before:always;padding-top:9mm!important}body.v4-print-active .v4-results>div{break-inside:avoid;page-break-inside:avoid}body.v4-print-active .v4-print-svg{break-inside:avoid;page-break-inside:avoid}body.v4-print-active .v4-warning{break-inside:avoid;page-break-inside:avoid}}
