.m3-docs-panel {
  --m3-blue: #173f67;
  --m3-cyan: #38a9cf;
  --m3-ink: #1d2935;
  --m3-muted: #617181;
  --m3-line: #d9e2e9;
  --m3-soft: #f5f8fa;
  max-width: 1080px;
  margin: 28px auto;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--m3-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(17, 55, 87, .08);
  color: var(--m3-ink);
}
.m3-docs-panel *, .m3-docs-panel *::before, .m3-docs-panel *::after { box-sizing: border-box; }
.m3-docs-panel__head { max-width: 800px; margin-bottom: 22px; }
.m3-docs-panel__head h2 { margin: 0 0 10px; color: var(--m3-blue); font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.16; }
.m3-docs-panel__head p { margin: 0; color: var(--m3-muted); }
.m3-docs-eyebrow { margin: 0 0 7px !important; color: var(--m3-cyan) !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.m3-docs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.m3-docs-field { min-width: 0; }
.m3-docs-field--wide { grid-column: 1 / -1; }
.m3-docs-field label, .m3-docs-unlock-form > label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--m3-blue); }
.m3-docs-field input, .m3-docs-field select, .m3-docs-field textarea, .m3-docs-unlock-form input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bccbd6;
  border-radius: 8px;
  background: #fff;
  color: var(--m3-ink);
  font: inherit;
}
.m3-docs-field textarea { min-height: 96px; resize: vertical; }
.m3-docs-field input:focus, .m3-docs-field select:focus, .m3-docs-field textarea:focus, .m3-docs-unlock-form input:focus { outline: 3px solid rgba(56, 169, 207, .2); border-color: var(--m3-cyan); }
.m3-docs-field small { display: block; margin-top: 5px; color: var(--m3-muted); line-height: 1.35; }
.m3-docs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.m3-docs-actions .button, .m3-docs-login-required .button, .m3-docs-password-row .button, .m3-docs-sync .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 17px;
  cursor: pointer;
}
.m3-docs-legal { margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid var(--m3-cyan); background: var(--m3-soft); color: var(--m3-muted); font-size: .9rem; line-height: 1.45; }
.m3-docs-login-required { padding: 20px; border-radius: 12px; background: var(--m3-soft); }
.m3-docs-password-row { display: flex; gap: 10px; align-items: stretch; }
.m3-docs-password-row input { flex: 1 1 auto; }
.m3-docs-unlock-form { max-width: 620px; padding: 22px; border-radius: 12px; background: var(--m3-soft); }
.m3-docs-unlock-message { min-height: 22px; margin: 8px 0 0; color: #a33131; font-weight: 600; }
.m3-docs-unlocked { margin-bottom: 20px; padding: 10px 13px; border-radius: 8px; background: #eaf7ef; color: #235c35; font-weight: 700; }
.m3-docs-sync { display: flex; gap: 12px; align-items: center; margin: 18px 0 0; }
.m3-docs-sync-status { color: #235c35; font-weight: 700; }
.m3-docs-details { border: 1px solid var(--m3-line); border-radius: 12px; overflow: hidden; }
.m3-docs-details > summary { cursor: pointer; padding: 15px 18px; background: var(--m3-soft); color: var(--m3-blue); font-weight: 800; }
.m3-docs-details[open] > summary { border-bottom: 1px solid var(--m3-line); }
.m3-docs-details .m3-docs-form { padding: 20px; }
.m3-docs-panel.is-compact { margin-top: 22px; padding: 20px; }
.m3-docs-panel.is-compact .m3-docs-panel__head h2 { font-size: 1.35rem; }
@media (max-width: 720px) {
  .m3-docs-grid { grid-template-columns: 1fr; }
  .m3-docs-field--wide { grid-column: auto; }
  .m3-docs-password-row { flex-direction: column; }
  .m3-docs-actions { flex-direction: column; }
  .m3-docs-actions .button { width: 100%; }
  .m3-docs-sync { align-items: flex-start; flex-direction: column; }
}
@media print {
  .m3-docs-panel { box-shadow: none; border: 0; }
  .m3-docs-actions, .m3-docs-sync, .m3-docs-unlock-form { display: none !important; }
}

/* Revisione 1.1 - pulsante reale e posizionamento compatibile con configuratori custom */
.m3-docs-primary-button {
  width: 100%;
  min-height: 52px !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  text-align: center;
}
.m3-docs-form-shell {
  margin-top: 18px;
  scroll-margin-top: 90px;
}
.m3-docs-form-shell[hidden] {
  display: none !important;
}
.m3-docs-footer-fallback {
  width: min(1080px, calc(100% - 32px));
  margin: 30px auto;
}
.m3-docs-hook-output {
  clear: both;
  width: 100%;
}
.product .summary .m3-docs-panel,
.single-product .m3-docs-panel {
  width: 100%;
  max-width: 100%;
}

/* Revisione 1.2 - documenti generati dal carrello */
.m3-docs-cart-panel {
  margin: 24px 0;
  width: 100%;
  max-width: 100%;
}
.m3-docs-cart-hook-output,
.m3-docs-cart-footer-fallback {
  clear: both;
  width: 100%;
}
.m3-docs-cart-footer-fallback {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto;
}
.m3-docs-cart-summary {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--m3-line);
  border-radius: 12px;
  background: var(--m3-soft);
}
.m3-docs-cart-summary h3 {
  margin: 0 0 12px;
  color: var(--m3-blue);
  font-size: 1.15rem;
}
.m3-docs-cart-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.m3-docs-cart-counts span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--m3-line);
  color: var(--m3-blue);
}
.m3-docs-cart-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 9px;
}
.m3-docs-cart-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}
.m3-docs-cart-table th,
.m3-docs-cart-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--m3-line);
  vertical-align: middle;
  text-align: left;
}
.m3-docs-cart-table thead th {
  background: var(--m3-blue);
  color: #fff;
}
.m3-docs-cart-table td:nth-child(3),
.m3-docs-cart-table th:nth-child(3) {
  text-align: center;
  width: 70px;
}
.m3-docs-cart-table td:last-child,
.m3-docs-cart-table th:last-child {
  text-align: right;
  white-space: nowrap;
  width: 140px;
}
.m3-docs-cart-table td small {
  display: block;
  margin-top: 4px;
  color: var(--m3-muted);
  font-size: .82rem;
  line-height: 1.35;
}
.m3-docs-cart-table tfoot th {
  text-align: right;
  color: var(--m3-blue);
}
.m3-docs-cart-table tfoot .is-total th,
.m3-docs-cart-table tfoot .is-total td {
  font-weight: 800;
  background: #eef6fa;
}
.m3-docs-cart-note {
  margin: 12px 0 0;
  color: var(--m3-muted);
  font-size: .86rem;
}
.m3-docs-deduction-field {
  padding: 14px;
  border: 2px solid var(--m3-cyan);
  border-radius: 10px;
  background: #f1fbff;
}
.m3-docs-status-good {
  color: #21643a !important;
  font-weight: 700;
}
.m3-docs-status-warning {
  color: #8a5513 !important;
  font-weight: 700;
}
.m3-docs-security-confirmation[hidden] {
  display: none !important;
}
.m3-docs-form input[readonly],
.m3-docs-form textarea[readonly] {
  background: #f1f4f6;
  color: #45545f;
  cursor: not-allowed;
}
.woocommerce-cart .cart_totals .m3-docs-panel {
  float: none;
  width: 100%;
  margin-top: 24px;
}
@media (max-width: 720px) {
  .m3-docs-cart-counts { flex-direction: column; }
  .m3-docs-cart-counts span { border-radius: 8px; }
}

/* Revisione 1.3 - download affidabile, costo bene e anteprima IVA */
.m3-docs-cost-mode {
  padding: 14px;
  border: 1px solid var(--m3-line);
  border-radius: 10px;
  background: #f7fafc;
}
.m3-docs-vat-preview {
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef6fa;
  border: 1px solid #c7dce8;
}
.m3-docs-vat-preview > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0;
}
.m3-docs-vat-preview strong {
  color: var(--m3-blue);
  white-space: nowrap;
}
.m3-docs-download-all {
  background: var(--m3-blue) !important;
  color: #fff !important;
  border-color: var(--m3-blue) !important;
  font-weight: 800 !important;
}
.m3-docs-download-status {
  min-height: 24px;
  margin-top: 10px;
  color: #21643a;
  font-weight: 700;
}
.m3-docs-download-status.is-error {
  color: #a32828;
}
.m3-docs-form.is-downloading {
  opacity: .86;
}
.m3-docs-form.is-downloading .m3-docs-actions .button {
  cursor: progress;
}
@media (max-width: 720px) {
  .m3-docs-vat-preview > div { align-items: flex-start; }
}

/* Revisione 1.4 - preventivo, piano di pagamento e download nativo */
.m3-docs-quote-button {
  background: var(--m3-cyan) !important;
  border-color: var(--m3-cyan) !important;
  color: #fff !important;
  font-weight: 800 !important;
}
.m3-docs-payment-block {
  padding: 14px;
  border: 2px solid var(--m3-blue);
  border-radius: 10px;
  background: #f4f8fb;
}
.m3-docs-payment-zero,
.m3-docs-payment-agos-one,
.m3-docs-payment-standard {
  padding: 12px;
  border: 1px solid var(--m3-line);
  border-radius: 9px;
  background: #fbfcfd;
}
.m3-docs-payment-zero[hidden],
.m3-docs-payment-agos-one[hidden],
.m3-docs-payment-standard[hidden] {
  display: none !important;
}
.m3-docs-vat-preview .is-gross {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid #bfd5e1;
  font-size: 1.03rem;
}

/* Revisione 1.5 - tre piani pagamento */
.m3-docs-payment-zero small, .m3-docs-payment-agos-one small { display:block; margin-top:6px; }


/* Revisione 1.5.1 - guida Agos One */
.m3-docs-agos-guide-link { border-left:4px solid #00aeb8; background:#eefafa; padding:12px 14px; border-radius:6px; }
.m3-docs-agos-guide-link p { margin:0; }
.m3-agos-guide { max-width:980px; margin:0 auto; font-size:17px; line-height:1.65; }
.m3-agos-guide__hero { padding:32px; border-radius:16px; background:linear-gradient(135deg,#006f7a,#00aeb8); color:#fff; margin-bottom:28px; }
.m3-agos-guide__hero h1 { color:#fff; margin:4px 0 8px; }
.m3-agos-guide__eyebrow { text-transform:uppercase; letter-spacing:.08em; font-weight:700; margin:0; }
.m3-agos-guide__cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:18px 0; }
.m3-agos-guide__cards div { background:#f3f7f8; border:1px solid #dbe7e8; border-radius:10px; padding:18px; text-align:center; }
.m3-agos-guide__cards strong { display:block; font-size:28px; color:#006f7a; }
.m3-agos-guide__cards span { display:block; font-size:14px; }
.m3-agos-guide__table { width:100%; border-collapse:collapse; margin:16px 0 26px; }
.m3-agos-guide__table th,.m3-agos-guide__table td { padding:12px 14px; border:1px solid #dbe2e4; text-align:left; }
.m3-agos-guide__table th { width:62%; background:#f5f7f8; }
.m3-agos-guide__notice { background:#fff8e8; border-left:4px solid #d7a11e; padding:18px 22px; border-radius:6px; }
.m3-agos-guide__actions { margin-top:24px; }
@media (max-width:700px){ .m3-agos-guide__cards{grid-template-columns:repeat(2,minmax(0,1fr));}.m3-agos-guide__hero{padding:24px 20px;} }

/* Revisione 1.6 - calcolo fiscale completo e download isolato */
.m3-docs-calculation-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf7ef;
  color: #235c35;
  font-weight: 700;
}
.m3-docs-calculation-message.is-error {
  background: #fff1f0;
  color: #9b2923;
}
.m3-docs-vat-preview > div:nth-last-of-type(-n+4) {
  border-top: 1px solid rgba(23,63,103,.12);
  margin-top: 4px;
  padding-top: 8px;
}
.m3-docs-vat-preview .is-gross {
  font-size: 1.05rem;
  border-top: 2px solid var(--m3-blue) !important;
  margin-top: 8px !important;
  padding-top: 10px !important;
}
.m3-docs-generate-button {
  position: relative;
  z-index: 2;
}
.m3-docs-download-frame {
  width: 1px;
  height: 1px;
  border: 0;
  position: absolute;
  left: -9999px;
}
[data-m3-legacy-hidden="yes"] { display: none !important; }

/* Revisione 2.0 - editor righe, percorso agente, foto e download a token */
.m3-docs-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}.m3-docs-kicker{margin:0 0 3px;text-transform:uppercase;letter-spacing:.06em;font-size:.76rem;font-weight:800;color:var(--m3-muted)}
.m3-docs-items-editor{min-width:1180px}.m3-docs-items-editor th:first-child{width:72px}.m3-docs-items-editor th:nth-child(2){min-width:300px}.m3-docs-items-editor th:nth-child(3){width:135px}.m3-docs-items-editor th:nth-child(4){min-width:240px}.m3-docs-items-editor th:nth-child(5){min-width:240px}.m3-docs-items-editor select{width:100%;min-width:120px;font-size:.82rem;padding:7px}
.m3-docs-item-image-cell img{display:block;width:62px;height:62px;object-fit:cover;border-radius:7px;border:1px solid var(--m3-line)}.m3-docs-no-image{display:flex;width:62px;height:62px;align-items:center;justify-content:center;background:#f2f4f5;border:1px solid var(--m3-line);border-radius:7px;color:var(--m3-muted);font-size:.75rem}.m3-docs-item-description>strong{display:block;color:var(--m3-blue);margin-bottom:7px}.m3-docs-config-parts{display:flex;flex-wrap:wrap;gap:4px 7px}.m3-docs-config-parts span{display:inline-block;padding:3px 7px;border-radius:5px;background:#f4f7f9;color:#4a5a64;font-size:.76rem;line-height:1.25}.m3-docs-config-parts span.is-highlight{background:#fff3cf;color:#5d4300;font-weight:900;border:1px solid #e5c768}.m3-docs-cart-table .is-center{text-align:center}.m3-docs-cart-table .is-money{text-align:right;white-space:nowrap;font-weight:700}
.m3-docs-agent-panel{padding:16px;border:2px solid #c89522;border-radius:12px;background:#fff9e9}.m3-docs-agent-panel output{display:block;min-height:42px;padding:10px 12px;border:1px solid #d3dde2;border-radius:7px;background:#fff;color:var(--m3-blue);font-weight:800}.m3-docs-agent-panel[hidden]{display:none!important}
.m3-docs-photo-panel{padding:16px;border:1px solid var(--m3-line);border-radius:12px;background:#f8fafb}.m3-docs-photo-preview{margin:12px 0}.m3-docs-photo-preview img{display:block;max-width:340px;max-height:240px;object-fit:contain;border-radius:10px;border:1px solid var(--m3-line)}.m3-docs-checkbox{display:flex!important;align-items:center;gap:8px;margin-top:10px}.m3-docs-checkbox input{width:auto!important}.m3-docs-technical-note{margin:10px 0 0;padding:10px 12px;background:#fff7e3;border-left:4px solid #d6a52c;color:#604d20;font-size:.86rem}
.m3-docs-payment-note{margin-top:9px;padding:9px 11px;border-radius:7px;background:#fff;color:#34434d;font-size:.88rem}.m3-docs-vat-preview h3{margin:0 0 9px;color:var(--m3-blue)}
.m3-docs-download-status{padding-top:6px}.m3-docs-download-status:not(:empty){padding:10px 12px;border-radius:8px;background:#eaf7ef}.m3-docs-download-status.is-error{background:#fff1f0}
@media(max-width:720px){.m3-docs-section-head{flex-direction:column}.m3-docs-photo-preview img{max-width:100%}}


/* Revisione 2.1 - campi fiscali solo per righe prodotto */
.m3-docs-product-only-cell[hidden] { display: table-cell !important; }
.m3-docs-product-only-cell[hidden] select { display: none !important; }
.m3-docs-product-only-cell:not([hidden]) .m3-docs-not-applicable { display: none; }
.m3-docs-not-applicable { display: block; color: var(--m3-muted); font-size: .8rem; line-height: 1.3; font-style: italic; }


/* Revisione 2.2 - interfaccia sempre visibile e download progressivo */
.m3-docs-version-badge{display:inline-block;margin:8px 0 0;padding:5px 9px;border-radius:999px;background:#e8f6fb;color:#0b5e80;font-size:.78rem;font-weight:800;letter-spacing:.02em}
.m3-docs-quick-actions{margin:0 0 22px;padding:16px;border:2px solid var(--m3-blue);border-radius:12px;background:linear-gradient(180deg,#f9fcfe,#eef7fb)}
.m3-docs-quick-actions__intro{display:flex;flex-direction:column;gap:3px;margin-bottom:12px}.m3-docs-quick-actions__intro strong{font-size:1.08rem;color:var(--m3-blue)}.m3-docs-quick-actions__intro span{color:var(--m3-muted);font-size:.9rem}
.m3-docs-actions{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:9px;align-items:stretch}.m3-docs-actions .button{display:flex!important;align-items:center;justify-content:center;min-height:48px;height:auto!important;padding:10px 12px!important;white-space:normal;text-align:center;line-height:1.18;font-weight:800}
.m3-docs-actions--top{margin:0}.m3-docs-actions--bottom{margin-top:18px;padding-top:18px;border-top:1px solid var(--m3-line)}
.m3-docs-quick-actions__note{margin:10px 0 0;color:var(--m3-muted);font-size:.8rem}
.m3-docs-form-shell[hidden]{display:none!important}
@media(max-width:1100px){.m3-docs-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.m3-docs-actions .button:last-child{grid-column:1/-1}}
@media(max-width:620px){.m3-docs-actions{grid-template-columns:1fr}.m3-docs-actions .button:last-child{grid-column:auto}.m3-docs-quick-actions{padding:13px}.m3-docs-cart-panel{padding-left:12px!important;padding-right:12px!important}}

.m3-docs-source-status{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;margin:0 0 16px;padding:12px 14px;border:1px solid #9bc7a8;border-radius:8px;background:#f1fbf4;color:#173f25;font-size:14px}.m3-docs-source-status.has-warning{border-color:#e0bd66;background:#fff8e6;color:#614b0c}.m3-docs-source-status strong{font-size:15px}.m3-docs-source-status small{flex-basis:100%;line-height:1.4}.m3-docs-download-status.is-error{color:#a40000;font-weight:700}.m3-docs-download-status:not(.is-error){color:#135e2a}

/* Revisione 2.4 - riepilogo compatto, prezzi sempre visibili e diagnostica download */
.m3-docs-panel{max-width:1000px;padding:22px;margin:22px auto}.m3-docs-cart-footer-fallback{width:min(1000px,calc(100% - 20px))}.m3-docs-cart-table-wrap{overflow:visible;background:transparent}.m3-docs-items-editor{display:block;min-width:0!important;width:100%;border:0}.m3-docs-items-editor thead{display:none}.m3-docs-items-editor tbody{display:grid;gap:12px}.m3-docs-items-editor tbody tr.m3-docs-item-row{display:grid;grid-template-columns:76px minmax(0,1fr) 150px;grid-template-areas:"image description amount" "image type qty" "image profile profile" "image deduction deduction";gap:9px 12px;padding:12px;border:1px solid var(--m3-line);border-radius:12px;background:#fff;box-shadow:0 5px 16px rgba(17,55,87,.05)}.m3-docs-items-editor tbody td{display:block!important;width:auto!important;min-width:0!important;padding:0!important;border:0!important;text-align:left!important}.m3-docs-items-editor tbody td:nth-child(1){grid-area:image}.m3-docs-items-editor tbody td:nth-child(2){grid-area:description}.m3-docs-items-editor tbody td:nth-child(3){grid-area:type}.m3-docs-items-editor tbody td:nth-child(4){grid-area:profile}.m3-docs-items-editor tbody td:nth-child(5){grid-area:deduction}.m3-docs-items-editor tbody td:nth-child(6){grid-area:qty;align-self:end;text-align:right!important}.m3-docs-items-editor tbody td:nth-child(7){grid-area:amount;align-self:start;text-align:right!important;font-size:1.02rem;color:var(--m3-blue)}.m3-docs-items-editor tbody td:nth-child(3)::before,.m3-docs-items-editor tbody td:nth-child(4)::before,.m3-docs-items-editor tbody td:nth-child(5)::before,.m3-docs-items-editor tbody td:nth-child(6)::before,.m3-docs-items-editor tbody td:nth-child(7)::before{display:block;margin:0 0 4px;color:var(--m3-muted);font-size:.68rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.m3-docs-items-editor tbody td:nth-child(3)::before{content:"Classificazione"}.m3-docs-items-editor tbody td:nth-child(4)::before{content:"Profilo documentale"}.m3-docs-items-editor tbody td:nth-child(5)::before{content:"Agevolazione"}.m3-docs-items-editor tbody td:nth-child(6)::before{content:"Quantita"}.m3-docs-items-editor tbody td:nth-child(7)::before{content:"Imponibile base"}.m3-docs-items-editor select{min-width:0!important;width:100%;font-size:.8rem;padding:7px 9px}.m3-docs-config-parts{gap:4px}.m3-docs-config-parts span{font-size:.71rem;padding:3px 6px}.m3-docs-item-description>strong{font-size:.96rem}.m3-docs-item-image-cell img,.m3-docs-no-image{width:66px;height:66px}.m3-docs-items-editor tfoot{display:grid;margin-top:12px;border:1px solid var(--m3-line);border-radius:10px;overflow:hidden;background:#fff}.m3-docs-items-editor tfoot tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}.m3-docs-items-editor tfoot th,.m3-docs-items-editor tfoot td{display:block!important;padding:8px 12px!important;border-bottom:1px solid var(--m3-line)!important}.m3-docs-items-editor tfoot th{text-align:left!important}.m3-docs-items-editor tfoot td{text-align:right!important;white-space:nowrap;font-weight:800;color:var(--m3-blue)}.m3-docs-items-editor tfoot tr:last-child th,.m3-docs-items-editor tfoot tr:last-child td{border-bottom:0!important}.m3-docs-runtime-status{margin:8px 0 0;padding:7px 10px;border-radius:7px;background:#fff4d6;color:#755600;font-size:.8rem;font-weight:800}.m3-docs-runtime-status.is-active{background:#eaf7ef;color:#235c35}.m3-docs-download-status--top:not(:empty){margin:10px 0 0}.m3-docs-field-error{border-color:#b42318!important;box-shadow:0 0 0 3px rgba(180,35,24,.12)!important}.m3-docs-form .m3-docs-download-frame{position:fixed!important;width:1px!important;height:1px!important;left:-9999px!important;top:-9999px!important;border:0!important}.m3-docs-section-head{align-items:center}.m3-docs-quick-actions{padding:14px}.m3-docs-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.m3-docs-actions .button:nth-child(4),.m3-docs-actions .button:nth-child(5){grid-column:auto}.m3-docs-source-status{font-size:12px}.m3-docs-cart-summary{padding:14px}.m3-docs-vat-preview{max-width:720px;margin:18px auto 0}.m3-docs-grid{gap:12px}.m3-docs-field input,.m3-docs-field select,.m3-docs-field textarea{min-height:40px;padding:8px 10px}.m3-docs-actions .button{min-height:44px;padding:9px 10px!important;font-size:.84rem}.m3-docs-panel__head{margin-bottom:16px}.m3-docs-cart-note{font-size:.8rem}.m3-docs-product-only-cell[hidden]{display:block!important}.m3-docs-product-only-cell[hidden]::before{display:block}.m3-docs-product-only-cell[hidden] select{display:none!important}
@media(max-width:820px){.m3-docs-panel{max-width:100%;padding:14px;margin:12px auto}.m3-docs-items-editor tbody tr.m3-docs-item-row{grid-template-columns:66px minmax(0,1fr);grid-template-areas:"image description" "amount amount" "type qty" "profile profile" "deduction deduction"}.m3-docs-items-editor tbody td:nth-child(7){text-align:left!important}.m3-docs-items-editor tbody td:nth-child(6){text-align:left!important}.m3-docs-actions{grid-template-columns:1fr 1fr}.m3-docs-actions .button:last-child{grid-column:1/-1}.m3-docs-section-head{align-items:flex-start}.m3-docs-section-head .button{width:100%}}
@media(max-width:520px){.m3-docs-items-editor tbody tr.m3-docs-item-row{grid-template-columns:1fr;grid-template-areas:"image" "description" "amount" "type" "qty" "profile" "deduction"}.m3-docs-item-image-cell img,.m3-docs-no-image{width:84px;height:84px}.m3-docs-actions{grid-template-columns:1fr}.m3-docs-actions .button:last-child{grid-column:auto}.m3-docs-cart-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.m3-docs-cart-counts span{text-align:center;padding:6px;font-size:.75rem}.m3-docs-vat-preview>div{font-size:.86rem}.m3-docs-source-status{gap:5px 10px}}
.m3-docs-panel{box-sizing:border-box}


/* M3 PRO v2.5.0 - layout a schede, senza scorrimento orizzontale */
.m3x-pro-v250, .m3x-pro-v250 * { box-sizing: border-box; }
.m3x-pro-v250 { width: 100% !important; max-width: 100% !important; overflow: visible !important; }
.m3x-pro-v250 .m3-docs-cart-summary { width: 100% !important; max-width: 100% !important; overflow: hidden !important; }
.m3x-pro-v250 .m3-docs-items-cards { display: grid !important; grid-template-columns: 1fr !important; gap: 12px !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
.m3x-pro-v250 .m3-docs-item-card { display: grid !important; grid-template-columns: 76px minmax(0,1fr) minmax(150px,190px) !important; grid-template-areas: "image description amount" "image type amount" "image profile amount" "image deduction amount" !important; gap: 8px 12px !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; padding: 13px !important; margin: 0 !important; border: 1px solid var(--m3-line, #d9e2ec) !important; border-radius: 12px !important; background: #fff !important; box-shadow: 0 5px 16px rgba(17,55,87,.05) !important; }
.m3x-pro-v250 .m3-docs-item-card__image { grid-area: image; min-width: 0; }
.m3x-pro-v250 .m3-docs-item-card__description { grid-area: description; min-width: 0; overflow-wrap: anywhere; }
.m3x-pro-v250 .m3-docs-item-card__amount { grid-area: amount; min-width: 0; padding: 10px; border-radius: 9px; background: #f3f8fc; text-align: right; align-self: stretch; display:flex; flex-direction:column; justify-content:center; gap:4px; }
.m3x-pro-v250 .m3-docs-item-card__amount small { color: #5c6b78; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.m3x-pro-v250 .m3-docs-item-card__amount strong { color: var(--m3-blue, #113757); font-size: 1.06rem; white-space: normal; overflow-wrap: anywhere; }
.m3x-pro-v250 .m3-docs-item-card__amount span { color:#5c6b78; font-size:.76rem; }
.m3x-pro-v250 .m3-docs-item-card__control { min-width:0; }
.m3x-pro-v250 .m3-docs-item-card__control:nth-of-type(4) { grid-area: type; }
.m3x-pro-v250 .m3-docs-item-card__control:nth-of-type(5) { grid-area: profile; }
.m3x-pro-v250 .m3-docs-item-card__control:nth-of-type(6) { grid-area: deduction; }
.m3x-pro-v250 .m3-docs-item-card__control label { display:block; margin:0 0 3px; color:#5c6b78; font-size:.68rem; font-weight:800; text-transform:uppercase; }
.m3x-pro-v250 .m3-docs-item-card select { width:100% !important; max-width:100% !important; min-width:0 !important; font-size:.82rem !important; padding:7px 9px !important; }
.m3x-pro-v250 .m3-docs-config-parts { display:flex; flex-wrap:wrap; gap:4px; min-width:0; }
.m3x-pro-v250 .m3-docs-config-parts span { max-width:100%; overflow-wrap:anywhere; }
.m3x-pro-v250 .m3-docs-items-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin-top:12px; border:1px solid var(--m3-line,#d9e2ec); border-radius:10px; overflow:hidden; background:var(--m3-line,#d9e2ec); }
.m3x-pro-v250 .m3-docs-items-summary > div { display:flex; justify-content:space-between; gap:12px; min-width:0; padding:10px 12px; background:#fff; }
.m3x-pro-v250 .m3-docs-items-summary span { min-width:0; overflow-wrap:anywhere; }
.m3x-pro-v250 .m3-docs-items-summary strong { flex:0 0 auto; white-space:nowrap; color:var(--m3-blue,#113757); }
.m3x-pro-v250 .m3-docs-items-summary .is-total { grid-column:1/-1; background:#eef6fb; font-weight:800; }
.m3x-pro-v250 .m3-docs-runtime-status.is-error { background:#fdecec !important; color:#8a1c1c !important; }
@media (max-width: 900px) {
  .m3x-pro-v250 .m3-docs-item-card { grid-template-columns:66px minmax(0,1fr) !important; grid-template-areas:"image description" "amount amount" "type type" "profile profile" "deduction deduction" !important; }
  .m3x-pro-v250 .m3-docs-item-card__amount { text-align:left; }
  .m3x-pro-v250 .m3-docs-items-summary { grid-template-columns:1fr; }
  .m3x-pro-v250 .m3-docs-items-summary .is-total { grid-column:auto; }
}
@media (max-width: 520px) {
  .m3x-pro-v250 .m3-docs-item-card { grid-template-columns:1fr !important; grid-template-areas:"image" "description" "amount" "type" "profile" "deduction" !important; padding:11px !important; }
  .m3x-pro-v250 .m3-docs-item-card__image img, .m3x-pro-v250 .m3-docs-no-image { width:84px !important; height:84px !important; }
}
