
    :root{
      --orange:#f37021; --orange-700:#e3641d;
      --warm:#2f2a27; --warm-600:#4a4541; --ring:#e5e5e7;
      --btn1:#f37021; --btn2:#4a4541; --btn3:#2a6df4; --btn4:#2f2a27;
      --focus:#2a6df4; --row:#f2f3f5; --logo-border:#e5e5e5; --accent:#ff6a00; --edit-az:#eaf4ff; --danger:#d92d20;
    }

@font-face{
  font-family:'CPSegoeSemi';
  src:url('../../segoe-ui-semibold.ttf') format('truetype');
  font-weight:600;
  font-style:normal;
}
@font-face{
  font-family:'CPSegoeBold';
  src:url('../../segoeuithibd.ttf') format('truetype');
  font-weight:700;
  font-style:normal;
}
@font-face{
  font-family:'CPSegoeThis';
  src:url('../../segoeuithis.ttf') format('truetype');
  font-weight:400;
  font-style:normal;
}

    *{ box-sizing:border-box; }
    html,body{ height:100%; margin:0; background:#f6f7f8; color:var(--warm); }
    body{ font-family:"CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif; }
    .toolbar{ position:sticky; top:0; z-index:5; background:#fff; border-bottom:1px solid var(--ring); padding:14px 12px; }
    .btns{ display:flex; gap:12px; justify-content:center; align-items:center; flex-wrap:wrap; }
    .btn{
      appearance:none; border:0; color:#fff; font-weight: 700; letter-spacing:.2px;
      padding:12px 18px; border-radius:12px; cursor:pointer; min-width:180px; text-align:center; font-size:16px;
      background: linear-gradient(to bottom, #3b7dff, #2356d8);
      box-shadow:0 3px 10px rgba(0,0,0,0.20);
      transition:all .18s ease-out;
    }

    .btn:hover{
      box-shadow:0 4px 14px rgba(0,0,0,0.30);
      transform: scale(1.02);
      background: linear-gradient(to bottom, #4a8aff, #204ec7);
    }

    .btn:active{
      transform: scale(0.99);
      box-shadow:0 2px 6px rgba(0,0,0,0.25) inset;
      background: linear-gradient(to bottom, #204ec7, #163a9b);
    }
    .btn:hover{ transform:translateY(-1px); box-shadow:0 12px 28px rgba(0,0,0,.12); }
    .b1{ background:var(--btn1); } .b1:hover{ background:var(--orange-700); }
    .b2{ background:var(--btn2); }
    .b3{ background:var(--btn3); }
    .b4{ background:var(--btn4); }
    .stage{ display:flex; flex-direction:column; align-items:center; padding:16px 16px 80px; height:calc(100vh - 78px); overflow:visible; }
    .zoomwrap{
  position:relative;
  transform-origin: top left;
  opacity:0;
  transition: opacity .15s ease-out;
}
    .sheet{ position:relative; width:420mm; height:297mm; background:#fff; box-shadow:0 8px 24px rgba(0,0,0,.08); }
    @page{ size: A3 landscape; margin:0; }
    @media print{
      body{ background:#fff; }
      .toolbar{ display:none !important; }
      .stage{ padding:0; height:calc(100vh - 78px); }
      .sheet{ box-shadow:none; }
      .logos{ border:1px solid var(--logo-border); background:transparent; }
      .editable, .label-edit{ outline:0 !important; background:transparent !important; }
      .logos .hint{ display:none; }
      .grid > *{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
      .perimeter *{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
      .logo-remove{ display:none !important; }
    }
    .frame{ border:none !important; box-shadow:none !important; }
    .content{ position:absolute; inset:12mm; display:flex; flex-direction:column; gap:0mm; line-height:1.05; }
.content-top{ display:flex; flex-direction:row; align-items:stretch; gap:15pt; }
    .content-top-left{ flex:1 1 auto; display:flex; flex-direction:column; gap:0mm; min-width:0; }
    .content-top-right{ flex:0 0 calc(79.79mm - 20pt); display:flex; align-items:stretch; justify-content:flex-end; }
    .qr-docs-box{ border:0.6mm solid #444444; padding:2mm; box-sizing:border-box; display:flex; flex-direction:column; justify-content:space-between; height:100%; background:#fff;  margin-top:-2mm; overflow:hidden; width:100%; max-width:100%; min-width:100%; min-height:100%; max-height:100%;}
    .qr-docs{ width:100%; aspect-ratio:1/1; flex:1 1 auto; min-height:0; max-height:100%; display:flex; align-items:center; justify-content:center;}
    

#qr-docs canvas,
#qr-docs img,
#qr-docs svg{
  max-width:100%;
  max-height:100%;
}

.qr-docs-label{ font-family:'CPSegoeThis','CPSegoeSemi','Segoe UI',SegoeUI,Tahoma,Geneva,Verdana,sans-serif; font-size: 17pt; font-weight:400; color:#000; text-align:center; line-height:1.05; margin:0; padding:0; max-width:100%; overflow:hidden; }

/* CP: QR placeholder (no impact on outer box size) */
#qr-placeholder{
  width:160pt;
  height:160pt;
  max-width:100%;
  max-height:100%;
  background: #d9d9d9;
  border-radius: 6px;
  display: none; /* shown only when QR box enabled and no real QR */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding:10pt; /* aria interna minima */
  box-sizing:border-box;
  font-family: "CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif;
  font-weight: 700;
  font-size: 16pt;
  line-height:1.05;
  color: #666666;
}


    
#qr-real{
  width:160pt;
  height:160pt;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
.logos{ display:flex; flex-wrap:nowrap; gap:12mm; justify-content:center; align-items:center; height:45mm; min-height:45mm; max-height:45mm; border:1px solid var(--logo-border); border-radius:6px; background:#fafbfc; margin-top:-2mm; overflow:hidden; padding:2mm; }
    .logo-wrap{ position:relative; flex:0 0 auto; display:flex; align-items:center; justify-content:center; max-height:41mm; max-width:68mm; padding:1mm; border-radius:6px; }
    .logo-wrap.drag-over{ outline:2px dashed var(--focus); }
    .logo-wrap img{ max-height:39mm; max-width:66mm; object-fit:contain; user-select:none; pointer-events:none; }
    .logo-remove{ position:absolute; top:2px; right:2px; width:13px; height:22px; border-radius:50%; background:var(--danger); color:#fff; border:none; font-weight:900; cursor:pointer; line-height:1; display:flex; align-items:center; justify-content:center; opacity:0.9; }
    .logo-remove:hover{ opacity:1; }
    .center-lines{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1.2mm; height:32mm; margin-top:5.92mm; }
    .line{ text-align:center; direction:ltr; unicode-bidi:plaintext; white-space:nowrap; }
    .title-line{ font-weight:800; font-size:36pt; line-height:1.18; margin-top:11.34px; }
    .subtitle-line{ font-weight:600; font-size:31pt; line-height:1.12; margin-top:-1.5mm; }
    #riga-lavori{ display:inline-block; white-space:pre-wrap; max-width:360mm; line-height:1.05; max-height:2.4em; overflow:hidden; }
    .editable{ display:inline-block; min-width:40mm; max-width:360mm; outline:1.8px dashed transparent; border-radius:8px; padding:6px 12px; white-space:nowrap; overflow:hidden; text-overflow:clip; vertical-align:baseline; color:inherit; background:var(--edit-az); }
    .editable:focus{ outline:2px solid var(--focus); }
    .label-edit{ outline:1.8px dashed transparent; border-radius:6px; background:var(--edit-az); }
    .label-edit:focus{ outline:2px solid var(--focus); }
    
    #lab-data-inizio{ text-transform:none !important; }
.grid{ display:grid; grid-template-columns: 3fr 4fr; column-gap:8mm; row-gap:0.5mm; align-items:center; margin-top:7.10mm;  grid-auto-rows:13mm;}
    .grid > *{ padding-left:6px; padding-right:6px; border-radius:6px; min-width:0; }
    #lab-data-inizio{
  font-size:29pt;
  font-weight:400;
  color:#000;
  font-style:normal;
  text-transform:none !important;
}
#val-data-inizio,
#val-data-inizio *{
  text-transform:uppercase !important;
}
.label, .label-edit{ font-weight:400; font-size:29pt; color:#444444; white-space:nowrap; text- line-height:1.12; padding-bottom:3.5pt; margin-top:0; text-align:left;  }
    .value{ font-size:28pt; font-weight:400; color:#444444; text-align:left; display:block; line-height:1.12; white-space:nowrap; overflow:hidden; text-overflow:clip; padding-bottom:  2.5pt; margin-top:0; text-transform:uppercase; }
.value.editable:empty::before{
  content:'Xgjypq';
  visibility:hidden;
}

.value *{ font-size:inherit; font-weight:inherit; color:inherit; }
    .footer{ margin-top:auto; display:flex; justify-content:space-between; align-items:flex-end; gap:8mm; }
    .row-odd{ background: var(--row) !important; }
    .perimeter{ position:absolute; inset:0; pointer-events:none; }
    .edge{ position:absolute; display:flex; align-items:center; justify-content:space-between; font-family:"Segoe UI", SegoeUI, Tahoma, Geneva, Verdana, sans-serif; font-weight:900; color:var(--accent);  letter-spacing:0.4px; white-space:nowrap; overflow:auto; font-size:18pt; line-height:1; }
    .edge span{ display:inline-block; }
    .edge-top, .edge-bottom{ left:6mm; right:6mm; height:6mm; }
    .edge-top{ top:0; } .edge-bottom{ bottom:0; }
    .sheet[data-exporting="1"] .editable, .sheet[data-exporting="1"] .label-edit{ background: transparent !important; }
    .sheet[data-exporting="1"] .row-odd{ background: var(--row) !important; }
    .sheet[data-exporting="1"] .logo-remove{ display:none !important; }
#cp-sidepanel{ position: fixed; top:0; left:-440px; right:auto; width: 440px; max-width: 96vw; height:100%; background:#fff; box-shadow: 18px 0 36px rgba(0,0,0,.18); border-right:1px solid var(--ring); z-index: 50; display:flex; flex-direction:column; transition: left .25s ease; }
#cp-sidepanel.cp-open{ left:0; }
#cp-sp-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 18px 16px 32px; border-bottom:1px solid var(--ring); }
#cp-sp-title{ font-size:22px; font-weight:900; }
#cp-sp-body{ padding:14px 16px 14px 32px; overflow-y:auto; overflow-x:hidden; }
#cp-sp-close{ background:var(--danger); color:#fff; border:0; border-radius:12px; padding:8px 12px; font-weight:800; cursor:pointer; }
.cp-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.cp-field label{ font-weight:800; font-size:14px; }
.cp-field input{ padding:12px 14px; border-radius:14px; border:1px solid var(--ring); font-size:16px; }
.cp-field textarea{ padding:12px 14px; border-radius:14px; border:1px solid var(--ring); font-size:16px; font-family:inherit; resize:none; }

.cp-field-qr label{ font-weight:600; font-size:14px; }
.cp-field-qr input[type="checkbox"]{ width:auto; height:auto; margin:0; }
.cp-qr-toggle-row{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.cp-qr-details{ margin-top:4px; }
.cp-qr-help{ margin-top:6px; font-size:12px; line-height:1.35; color:var(--warm-600); }



/* CP: QR URL info icon + note */
.cp-qr-url-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:2px;
}
.cp-qr-url-row label{
  margin:0;
}
.cp-qr-info-btn{
  appearance:none;
  border:1px solid var(--ring);
  background:#fff;
  color: var(--brand);
  width:24px;
  height:24px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-weight:900;
  font-size:14px;
  line-height:1;
  flex:0 0 auto;
}
.cp-qr-info-btn:hover{ background:#f1f5f9; }
.cp-qr-info-btn:active{ background:#e8edf3; }
.cp-qr-note{
  display:none;
  margin-top:10px;
  padding:12px 12px;
  border:1px solid var(--ring);
  border-radius:12px;
  background:#f8fafc;
  color: var(--warm);
  font-size:13px;
  line-height:1.45;
}
.cp-qr-note.cp-open{ display:block; }
.cp-qr-note strong{ display:block; margin-bottom:6px; font-size:13px; }
.cp-qr-note ol{ margin:6px 0 10px 18px; padding:0; }
.cp-qr-note ul{ margin:6px 0 10px 18px; padding:0; }
.cp-qr-note li{ margin:4px 0; }

.cp-field .cp-suggestions{
  display:none;
  margin-top:4px;
  border-radius:10px;
  border:1px solid var(--ring);
  background:#fff;
  box-shadow:0 8px 20px rgba(15,23,42,0.12);
  overflow:hidden;
  z-index:20;
}
.cp-field .cp-suggestions button{
  display:block;
  width:100%;
  padding:6px 10px;
  text-align:left;
  background:transparent;
  border:none;
  font-size:14px;
  cursor:pointer;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}
.cp-field .cp-suggestions button:hover{
  background:#f1f5f9;
}
.cp-section-title-additional{ font-weight:900; margin-top:18px; margin-bottom:8px; }
  

.grid{ align-items: stretch; transform: translateY(1pt); }                 
.grid > *{ display:flex; align-items:flex-end; } 
.editable, .label-edit{ background:transparent; } 



:root{
  --brand:#232955;         
  --brand-weak:#2C373D;    
  --text:#2C2C2C;          
  --neutral-200:#AAAAAA;   
}



#clear-logos{ display:none !important; }

#reset-fields{
  background:transparent !important;
  color:var(--neutral-200) !important;
  border:1px solid var(--neutral-200) !important;
  box-shadow:none !important;
  min-width:140px !important;
  font-weight:700 !important;
}
#reset-fields:hover{ transform:none !important; border-color: #142878 !important; color: #142878 !important; }

#cp-open-panel-btn{
  background:var(--brand) !important; color:#fff !important;
}
#cp-open-panel-btn:hover{ background:var(--brand-weak) !important; }

#export-btn{ background:var(--brand) !important; color:#fff !important; }
  font-family:"CPSegoeBold","CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif !important;
  font-weight:700 !important;
#export-btn:hover{ background:var(--brand-weak) !important; }

label[for="logo-input"]{
  background:transparent !important; color:var(--brand) !important;
  border:2px solid var(--brand) !important;
  box-shadow:none !important;
  font-family:"CPSegoeBold","CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif !important;
  font-weight:700 !important;
}
label[for="logo-input"]:hover{ background:rgba(35,41,85,0.06) !important; }


.logos{ position:relative; min-height:46mm; }
.logos .hint{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center;
  font-size:18px; line-height:1.3; color:var(--text); padding:10px 16px;
  opacity:.9;
}


.logo-remove{
  width:28px !important; height:28px !important; font-size:20px !important;
  background:#2C2C2C !important; color:#fff !important; border-radius:8px !important;
  opacity:.95 !important; top:4px !important; right:4px !important;
}
.logo-remove:hover{ opacity:1 !important; transform:none !important; }


#cp-fields .cp-field input{
  background-repeat:no-repeat; background-position: right 10px center; background-size: 16px 16px;
  padding-right: 2.2em; border-left: 2px solid transparent;
}
#cp-fields .cp-field input:placeholder-shown{
  border-left-color: var(--brand);
  
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23A9A9A9' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zm14.71-9.04c.39-.39.39-1.02 0-1.41L16.2 4.29a1 1 0 0 0-1.41 0l-1.34 1.34 3.75 3.75 1.31-1.17z'/></svg>");
}


.logos .hint{ font-weight:700; }



.btns{ display:flex; gap:12px; justify-content:center; align-items:center; flex-wrap:wrap; }
#cp-open-panel-btn{ order:1; }                 
label[for="logo-input"]{ order:2; }
#export-btn{ order:3; }

#reset-fields{ display:none !important; }




#cp-open-panel-btn{
  padding:18px 26px !important;
  font-size:20px !important;
  min-width:240px !important;
  border-radius:14px !important;
}


.logos{ min-height:90mm !important; }
.logos .hint{
  font-size:30px !important;
  line-height:1.4 !important;
  font-weight:800 !important;
  opacity:0.95 !important;
}



.logos{ min-height:46.5mm !important; }
.logos .hint{
  font-size:30px !important;
  color:#C9C9C9 !important;
  font-weight:800 !important;
  line-height:1.3 !important;
}



.brand-top{
  position:absolute; left:0; width:100%;
  top:0.5mm;
  display:flex; align-items:flex-start; justify-content:center;
  pointer-events:none;
  font-family:"Segoe UI Semibold","Segoe UI","Inter","Arial",sans-serif;
  font-weight:700; font-size:25pt; line-height:1;
  color: #142878; z-index:6; white-space:nowrap;
}


.frame{ border:none !important; box-shadow:none !important; }



#riga-lavori{ transform: translateY(-3mm); display:inline-block; }



#cp89-line-blue, #cp89-line-yellow, #cp89-gap{
  position:absolute; left:6mm; right:6mm; pointer-events:none; z-index:60;
}
#cp89-line-blue{ top:6mm; border-top:1px solid #142878; height:0; }
#cp89-line-yellow{ top:calc(6mm - 1.5px); border-top:2px solid #f0c828; height:0; }
#cp89-gap{ background:#ffffff; z-index:61; }
@media print{
  #cp89-line-blue, #cp89-line-yellow, #cp89-gap{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}



.cp90-line{ position:absolute; pointer-events:none; z-index:60; }
@media print{
  .cp90-line{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


#cp90-top-blue{ left:20px; right:20px; top:20px; height:0; border-top:2px solid #142878; }
#cp90-top-yellow{ left:18px; right:18px; top:18px; height:0; border-top:2px solid #f0c828; }


#cp90-bottom-blue{ left:20px; right:20px; bottom:20px; height:0; border-bottom:2px solid #142878; }
#cp90-bottom-yellow{ left:18px; right:18px; bottom:18px; height:0; border-bottom:2px solid #f0c828; }


#cp90-left-blue{ top:20px; bottom:20px; left:20px; width:0; border-left:2px solid #142878; }
#cp90-left-yellow{ top:18px; bottom:18px; left:18px; width:0; border-left:2px solid #f0c828; }


#cp90-right-blue{ top:20px; bottom:20px; right:20px; width:0; border-right:2px solid #142878; }
#cp90-right-yellow{ top:18px; bottom:18px; right:18px; width:0; border-right:2px solid #f0c828; }



#cp91-top-gap{
  position:absolute;
  width:85mm;                          
  left:calc(50% - 42.5mm);             
  top:4mm;                             
  height:3mm;                          
  background:#ffffff;
  pointer-events:none;
  z-index:61;
}
@media print{
  #cp91-top-gap{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}



#brand-top{
  position:relative !important;
  z-index:100 !important;
}



html, body{ overflow:hidden; }
@media print{ html, body{ overflow:visible !important; } }

.btns{ justify-content:center !important; }
label[for="logo-input"]{ order:1 !important; }
#cp-open-panel-btn{ order:2 !important; }
#export-btn{ order:3 !important; }

#cp-open-panel-btn{
  background:#2A6DF4 !important;
  color:#fff !important;
  padding:20px 28px !important;
  font-size:20px !important;
  min-width:260px !important;
  border-radius:14px !important;
}
#cp-open-panel-btn:hover{ background:#245CE0 !important; }



.toolbar{ display:flex; justify-content:center; align-items:center; }
.btns{
  display:inline-flex !important;
  justify-content:center !important;
  align-items:center !important;
  margin:0 auto !important;
  gap:12px !important;
  text-align:center !important;
}



label[for="logo-input"],
#cp-open-panel-btn,
#export-btn{
  flex:1 1 0 !important;
  max-width:260px !important;
  min-width:260px !important;
  text-align:center !important;
}
.btns{ justify-content:center !important; gap:14px !important; }



.sheet[data-exporting="1"] .logos .hint{ display:none !important; }



#cp-toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(35,41,85,0.96);
  color:#fff;
  padding:12px 16px;
  border-radius:12px;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  box-shadow:0 8px 28px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 2000;
}
#cp-toast.cp-show{ opacity:1; transform: translateX(-50%) translateY(-2px); }



@media screen{
  #lab-extra-1:empty::before{ content: "Etichetta 1"; }
  #lab-extra-2:empty::before{ content: "Etichetta 2"; }
  #lab-extra-1 + .value.editable:empty::before{ content: "Valore 1"; text-align:left; }
  #lab-extra-2 + .value.editable:empty::before{ content: "Valore 2"; text-align:left; }
  #lab-extra-1:empty::before,
  #lab-extra-2:empty::before,
  #lab-extra-1 + .value.editable:empty::before,
  #lab-extra-2 + .value.editable:empty::before{
    display:inline-block; width:100%;
    font-size:24pt; line-height:1.12;
    font-style: italic; font-weight:400;
    color: #b3b3b3; opacity:.7; letter-spacing:.1px;
    pointer-events:none;
  }
}#lab-extra-1,
  #lab-extra-2{
    color:#444444;
    font-weight:400;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }


@media print{
  #lab-extra-1:empty::before,
  #lab-extra-2:empty::before,
  #lab-extra-1 + .value.editable:empty::before,
  #lab-extra-2 + .value.editable:empty::before{ content:none !important; }
}
.sheet[data-exporting="1"] #lab-extra-1:empty::before,
.sheet[data-exporting="1"] #lab-extra-2:empty::before,
.sheet[data-exporting="1"] #lab-extra-1 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-2 + .value.editable:empty::before{ content:none !important; }


.sheet[data-exporting="1"] #lab-extra-1:empty,
.sheet[data-exporting="1"] #lab-extra-1:empty + .value.editable:empty,
.sheet[data-exporting="1"] #lab-extra-2:empty,
.sheet[data-exporting="1"] #lab-extra-2:empty + .value.editable:empty{ min-height:10mm; }



.cp-date-wrap{ position:relative; display:block; }
.cp-date-vis{
  width:100%; padding:12px 44px 12px 14px; border:1px solid var(--ring); border-radius:12px;
  font-size:16px; background:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'><path fill='%232A6DF4' d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.1 0 2-.89 2-2V6c0-1.11-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14z'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; background-size:22px 22px;
}
.cp-cal{
  position: fixed; z-index:5000;
  transform: scale(0.753); transform-origin: top left;
  width:min(92vw, 320px);
  background:#fff; border:1px solid var(--ring); border-radius:14px; box-shadow:0 16px 40px rgba(0,0,0,.18);
  padding:10px; display:none;
}
.cp-cal.cp-open{ display:block; }
.cp-cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; gap:6px; }
.cp-cal-mon{ font-weight:500; color: #4a4541; font-size:20px; }
.cp-cal-nav{ display:flex; gap:6px; }
.cp-cal-nav button, .cp-cal-head .close{
  appearance:none; border:1px solid var(--ring); background:#f6f7f8; color: #142878;
  border-radius:10px; padding:6px 8px; cursor:pointer; font-weight:800;
}
.cp-cal-head .close{ padding:6px 10px; font-weight:900; }
.cp-cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; padding-top:4px; }
.cp-cal-grid .dow{ text-align:center; font-weight:800; font-size:12px; color: #142878; padding:6px 0; }
.cp-cal-grid .d{ text-align:center; padding:6px 0; border-radius:10px; cursor:pointer; font-weight:500; font-size:22px; }
.cp-cal-grid .d:hover{ background:#eef2ff; }
.cp-cal-grid .out{ color: #142878; }
.cp-cal-grid .today{ background:#eef2ff; outline:2px solid var(--brand); outline-offset:-2px; }



#cp-fields .cp-field input[type="text"],
#cp-fields .cp-field textarea {
  border-left: 3px solid #2A6DF4 !important;
}



.no-playoff::before { content: none !important; }



#grid .label:where(:has(> :is(span,div):not([style*="font-weight"]))) ,
#grid .value:where(:has(> :is(span,div):not([style*="font-weight"]))) {}

#grid .label:has(> span, > div):where(:has(:contains("Inizio lavori | Fine lavori presunta"))),
#grid .label:where(:contains("Inizio lavori | Fine lavori presunta")),
#grid .value:has(> span, > div):where(:has(:contains("Inizio lavori | Fine lavori presunta"))),
#grid .value:where(:contains("Inizio lavori | Fine lavori presunta")){
  font-weight: 400 !important;
  color: inherit !important;
}

#grid .label,
#grid .value {
  color: #444444;
  font-weight: 400;
}

html,body{overflow-y:auto;}


#riga-comune{
  font-size:38pt;
  font-weight:750;
  font-family:"CPSegoeBold","CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif;
}



#cp-toggle-handle{
  position:fixed;
  top:0;
  left:0;
  transform:none;
  width:13px;
  height:100vh;
  border-radius:0;
  background:var(--brand);
  color:#fff;
  border:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  font-weight:800;
  cursor:pointer;
  z-index:1200;
  box-shadow:0 0 6px rgba(0,0,0,0.35);
}
#cp-toggle-handle:hover{
  background:var(--brand-weak);
}
#cp-toggle-handle span{
  pointer-events:none;
  display:block;
}


.topband{
  width:100%;
  background: var(--brand);
  color:#fff;
  text-align:center;
  font-size:13px;
  font-weight:600;
  padding:8px 0;
  margin-bottom:10px;
}

/* CP: topband "Torna al sito" without shifting centered disclaimer */
.cp-topband{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}
.cp-topband-text{
  text-align: center;
  width: 100%;
  max-width: 1200px;
  padding: 0 12px;
}
.cp-back-site{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}
.cp-back-site:hover{ background: rgba(255,255,255,0.18); }
.cp-back-site:active{ background: rgba(255,255,255,0.22); }
.cp-back-ico{ font-size: 16px; line-height: 1; }

/* Mobile / schermi stretti: impila (zero sovrapposizioni) */
@media (max-width: 520px){
  .cp-topband{
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .cp-back-site{
    position: static;
    transform: none;
  }
  .cp-topband-text{
    text-align: left;
    padding: 0;
  }
}




.logos .hint{
  display:flex !important;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:34px !important;
  font-weight:600 !important;
  color:#C9C9C9 !important;
  line-height:1.3 !important;
  padding:10px 16px;
  opacity:0.95 !important;
}


#riga-lavori{
 color:#000 !important;
}
#cp-fields textarea{
 font-family:'CPSegoeSemi',"Segoe UI",sans-serif !important;
 font-weight:600 !important;
}


#riga-comune{
 color:#000 !important;
 font-family:'CPSegoeBold',"Segoe UI",sans-serif !important;
}


#cp-fields .label,
#cp-fields .label-edit{
  padding-bottom:0;
}



/* CP SURGICAL FIX (v2): evita taglio gambette e garantisce zebra in export */
#sheet .perimeter{ z-index:0; }
#sheet .content{ z-index:2; }

/* CP FIX: extra labels descenders not clipped (no layout shift) */
#lab-extra-1, #lab-extra-2{
  position: relative;
  z-index: 9999;
  overflow: visible;
}


/* CP FIX (surgical): QR box fixed size; label does NOT push layout */
#qr-header, .content-top-right{ min-height:0; }
#qr-docs-box{
  border-color: #444444;
  position:relative;
  overflow:hidden;
  /* keep outer size fixed even if inner content grows */
  min-height:100%;
  max-height:100%;
}
#qr-docs{
  position:absolute;
  left:0;
  right:0;
  top:0;
  bottom:0;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
#qr-docs canvas,
#qr-docs img{
  width:100% !important;
  height:100% !important;
  max-width:100%;
  max-height:100%;
  display:block;
}
.qr-docs-label{
  position:absolute;
  left:0;
  right:0;
  bottom:2mm;
  margin:0 !important;
  padding:0 !important;
  width:100% !important;
  font-family:'CPSegoeThis','Segoe UI',Arial,sans-serif;
  font-size: 17pt;
  line-height:1.05;
  text-align:center;
  color:#000;
  pointer-events:none;
}



/* CP: keep QR URL input full width + visible instruction trigger */
#cp-qr-url{ width:100% !important; display:block; }
.cp-qr-url-row{ width:100%; }
.cp-qr-url-row label{ flex:1 1 auto; }
.cp-qr-instructions-btn{
  appearance:none;
  border:0;
  background:transparent;
  padding:6px 0 0 0;
  margin:0;
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  color: var(--brand);
  font-weight:800;
}
.cp-qr-instructions-btn:hover{ text-decoration: underline; }
.cp-qr-info-big{
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid var(--ring);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  background:#fff;
}


/* CP: QR URL validation (block local paths) */
.cp-qr-error{
  display:none;
  margin-top:6px;
  color: var(--danger);
  font-weight:900;
  font-size:12px;
  line-height:1.25;
}
.cp-qr-error.cp-show{ display:block; }


/* CP: QR note close (X) */
.cp-qr-note{ position:relative; }
.cp-qr-note-close{
  position:absolute;
  top:8px;
  right:8px;
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid var(--ring);
  background:#ffffff;
  color: var(--warm);
  font-weight:900;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cp-qr-note-close:hover{ background:#f1f5f9; }
.cp-qr-note-close:active{ background:#e8edf3; }


/* CP: Instructions block above preview (clean + readable) */
#cp-instructions{
  max-width: 980px;
  margin: 0 auto 22px auto;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--ring);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  color: var(--warm);
  font-family: "CPSegoeSemi","Segoe UI",SegoeUI,Tahoma,Geneva,Verdana,sans-serif;
}
#cp-instructions h2{
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--brand);
  text-align: center;
  letter-spacing: .2px;
}
#cp-instructions .cp-instr-sub{
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--warm-600);
  text-align: center;
}
#cp-instructions .cp-steps{
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
#cp-instructions .cp-step{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--ring);
}
#cp-instructions .cp-step-n{
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
#cp-instructions .cp-step-t{
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--warm);
}
#cp-instructions .cp-step-t strong{
  color: var(--brand);
  font-weight: 900;
}
#cp-instructions .cp-instr-foot{
  margin: 12px 0 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--warm-600);
  text-align: center;
}


/* CP: QR info icon inside instructions (opens the same QR help) */
#cp-instructions .cp-step-flex{
  display:flex;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}
#cp-instructions .cp-qr-info-inline{
  appearance:none;
  border:1px solid var(--ring);
  background:#fff;
  color:var(--brand);
  width:30px;
  height:30px;
  border-radius:999px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
#cp-instructions .cp-qr-info-inline:hover{ background:#f8fafc; }
#cp-instructions .cp-qr-info-inline:active{ transform: translateY(1px); }

@media (max-width: 720px){
  #cp-instructions{ padding: 14px 14px; margin-bottom: 18px; }
  #cp-instructions h2{ font-size: 18px; }
  #cp-instructions .cp-instr-sub,
  #cp-instructions .cp-instr-foot{ text-align: left; }
}


/* CP: inline info trigger in guide */
.cp-inline-info{
  appearance:none;
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  color: var(--brand);
  font-weight:900;
  text-decoration:none;
}
.cp-inline-info:hover{ text-decoration: underline; }
.cp-inline-info-ico{
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid var(--ring);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  line-height:1;
  background:#fff;
}

/* CP: modal */
.cp-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index: 9999;
}
.cp-modal.cp-open{ display:block; }
.cp-modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.45);
}
.cp-modal-card{
  position:relative;
  max-width: 720px;
  width: calc(100% - 24px);
  margin: 70px auto;
  background:#fff;
  border-radius: 18px;
  border: 1px solid var(--ring);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
}
.cp-modal-close{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  border-radius: 12px;
  border:1px solid var(--ring);
  background:#fff;
  color: var(--warm);
  font-weight:900;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cp-modal-close:hover{ background:#f1f5f9; }
.cp-modal-body{
  padding: 18px 18px 16px 18px;
}
.cp-modal-title{
  font-weight: 900;
  color: var(--brand);
  font-size: 18px;
  margin: 0 0 10px 0;
  padding-right: 42px;
}
.cp-modal-text{
  color: var(--warm);
  font-size: 14px;
  line-height: 1.5;
}
.cp-modal-text > div{ margin: 6px 0; }
.cp-modal-text ul{
  margin: 8px 0 12px 18px;
  padding:0;
}
.cp-modal-text li{ margin: 6px 0; }
.cp-modal-sub{
  margin-top: 10px;
  font-weight: 900;
  color: var(--warm);
}
@media (max-width: 520px){
  .cp-modal-card{ margin: 54px auto; }
}



/* --- CP: Disclaimer typography (single-flow, responsive) --- */
.cp-disclaimer{
  max-width: 980px;
  margin: 26px auto 34px;
  padding: 0 16px;
  color: #142878;
  font-family: 'Segoe UI', sans-serif;
}
.cp-disclaimer-title{
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px 0;
}
.cp-disclaimer-text{
  margin: 0;
  text-align: center;
  line-height: 1.35;
  font-size: clamp(12.5px, 1.05vw, 15px);
  text-wrap: balance;
}
.cp-legal-links{
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}
.cp-legal-links a{
  color: #142878;
  text-decoration: underline;
}
.cp-legal-dot{
  opacity: .55;
  margin: 0 8px;
}
.cp-copyright-line{
  margin-top: 10px;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(10px, 0.95vw, 13px);
  line-height: 1.25;
}
.cp-bottom-air{height: 24px;}
@media (max-width: 520px){
  .cp-copyright-line{ white-space: normal; }
}


/* CP FUTURO: placeholders per extra 3..8 (nessun impatto finché non esistono le righe) */
@media screen{
  #lab-extra-3:empty::before{ content: "Etichetta 3"; }
  #lab-extra-4:empty::before{ content: "Etichetta 4"; }
  #lab-extra-5:empty::before{ content: "Etichetta 5"; }
  #lab-extra-6:empty::before{ content: "Etichetta 6"; }
  #lab-extra-7:empty::before{ content: "Etichetta 7"; }
  #lab-extra-8:empty::before{ content: "Etichetta 8"; }

  #lab-extra-3 + .value.editable:empty::before{ content: "Valore 3"; text-align:left; }
  #lab-extra-4 + .value.editable:empty::before{ content: "Valore 4"; text-align:left; }
  #lab-extra-5 + .value.editable:empty::before{ content: "Valore 5"; text-align:left; }
  #lab-extra-6 + .value.editable:empty::before{ content: "Valore 6"; text-align:left; }
  #lab-extra-7 + .value.editable:empty::before{ content: "Valore 7"; text-align:left; }
  #lab-extra-8 + .value.editable:empty::before{ content: "Valore 8"; text-align:left; }
}

/* rimozione placeholders in export */
.sheet[data-exporting="1"] #lab-extra-1:empty::before,
.sheet[data-exporting="1"] #lab-extra-1 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-2:empty::before,
.sheet[data-exporting="1"] #lab-extra-2 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-3:empty::before,
.sheet[data-exporting="1"] #lab-extra-3 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-4:empty::before,
.sheet[data-exporting="1"] #lab-extra-4 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-5:empty::before,
.sheet[data-exporting="1"] #lab-extra-5 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-6:empty::before,
.sheet[data-exporting="1"] #lab-extra-6 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-7:empty::before,
.sheet[data-exporting="1"] #lab-extra-7 + .value.editable:empty::before,
.sheet[data-exporting="1"] #lab-extra-8:empty::before,
.sheet[data-exporting="1"] #lab-extra-8 + .value.editable:empty::before{ content:none !important; }