/* Portal-specific bindings; palette, shared controls and dialogs come from CRM. */
#app-view.app-shell #contratti-view.agent-practice-open>:not(#agent-practice-page){display:none!important}
#app-view.app-shell #contratti-view.agent-practice-open:not([hidden]){display:block!important}
#app-view.app-shell #agent-practice-page{width:100%;color:var(--gt-text,#343b3f)}
#app-view.app-shell .agent-practice-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 24px}
#app-view.app-shell .agent-practice-heading h1{margin:12px 0 8px;color:var(--gt-heading,#173f31);font-size:clamp(26px,3vw,36px);line-height:1.2}
#app-view.app-shell .agent-practice-heading p{margin:0;color:var(--gt-text,#343b3f)}
#app-view.app-shell .agent-practice-heading [data-practice-back]{padding:0;background:none;border:0;color:var(--muted,#687b72);font-size:.85rem;box-shadow:none}
#app-view.app-shell .agent-practice-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:20px;align-items:start}
#app-view.app-shell .agent-practice-card{background:#fff;border:1px solid var(--gt-line,#dfe3e5);border-radius:14px;padding:24px;min-width:0;box-shadow:none}
#app-view.app-shell .agent-practice-card h2{color:var(--gt-heading,#173f31);font-size:1.3rem;margin:0 0 20px}
#app-view.app-shell .agent-message{background:#fff;padding:18px 0;border-bottom:1px solid var(--gt-line,#dfe3e5);color:var(--gt-text,#343b3f);overflow-wrap:anywhere}
#app-view.app-shell .agent-message:first-child{padding-top:0}
#app-view.app-shell .agent-message header{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
#app-view.app-shell .agent-message time{font-size:.78rem;color:#68757c}
#app-view.app-shell .agent-message p{white-space:pre-wrap;margin:10px 0 0;line-height:1.6}
#app-view.app-shell .agent-message-file{display:inline-block;padding:6px 10px;border:1px solid var(--gt-line,#dfe3e5);border-radius:8px;margin:10px 8px 0 0;font-size:.8rem}
#app-view.app-shell .agent-document{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--gt-line,#dfe3e5);border-radius:10px;padding:14px;margin:0 0 10px;min-width:0;font-size:.85rem}
#app-view.app-shell .agent-document span{overflow-wrap:anywhere;min-width:0}
#app-view.app-shell .agent-document a{flex:none;color:var(--gt-heading,#173f31);font-weight:600}
#app-view.app-shell .agent-practice-info{margin-top:20px;font-size:.85rem}
#app-view.app-shell .agent-practice-info summary{cursor:pointer;color:#68757c}
#app-view.app-shell .agent-practice-info dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;margin-top:16px}
#app-view.app-shell .agent-practice-info dd{margin:0;overflow-wrap:anywhere}
#app-view.app-shell .agent-practice-reply{padding-top:22px;background:#fff}
#app-view.app-shell .agent-practice-reply h3{font-size:1rem;color:var(--gt-text,#343b3f);margin:0 0 12px}
#app-view.app-shell .agent-practice-reply textarea{width:100%;border:1px solid var(--gt-line,#dfe3e5);border-radius:10px;padding:12px;font:inherit;resize:vertical;background:#fff;color:var(--gt-text,#343b3f)}
#app-view.app-shell .agent-reply-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
#app-view.app-shell .agent-attach-button{position:relative;overflow:hidden;display:inline-flex;align-items:center;min-height:42px;padding:10px 14px;border:1px solid var(--gt-line,#dfe3e5);border-radius:10px;cursor:pointer;font-size:.85rem;font-weight:600}
#app-view.app-shell .agent-attach-button:focus-within{outline:2px solid var(--selection-border,#9bc52b);outline-offset:2px}
#app-view.app-shell .agent-attach-button input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
#app-view.app-shell .agent-practice-reply button.primary{background:var(--gt-lime,#b9f12b);color:var(--gt-heading,#173f31);border:1px solid var(--gt-lime,#b9f12b);box-shadow:none;border-radius:10px;font-weight:700}
#app-view.app-shell .agent-supply-statuses{display:inline-flex;align-items:center;flex-wrap:wrap;gap:8px}
#app-view.app-shell .agent-unread{display:inline-flex;align-items:center;gap:7px;font-size:.8rem;font-weight:650;color:var(--gt-text,#343b3f);white-space:nowrap}
#app-view.app-shell .agent-unread i{width:7px;height:7px;border-radius:50%;background:var(--gt-lime,#b9f12b)}
#app-view.app-shell .agent-contract-row .contract-row-check{display:none}
#app-view.app-shell .agent-contract-row.is-selected .production-summary-head::after{display:none}
@media(max-width:800px){#app-view.app-shell .agent-practice-grid{grid-template-columns:minmax(0,1fr)}#app-view.app-shell .agent-practice-heading{align-items:flex-start;flex-direction:column}#app-view.app-shell .agent-practice-card{padding:18px}#app-view.app-shell .agent-unread{white-space:normal}}
/* Status adapters: one vocabulary in collapsed rows and expanded practices. */
#app-view.app-shell .contract-status.agent-status,#app-view.app-shell .agent-contract-row.needs-integration .contract-row-actions .contract-status.agent-status{display:inline-flex;align-items:center;flex:none;max-width:100%;min-width:0;padding:5px 9px;border:1px solid var(--agent-status-border,#dfe3e5);border-radius:8px;background:var(--agent-status-surface,#f1f3f4);color:var(--agent-status-ink,#58636a);font-size:.875rem;font-weight:600;line-height:1.4;letter-spacing:.01em;white-space:normal;overflow-wrap:anywhere;text-align:left;box-shadow:none}
#app-view.app-shell .agent-status.is-waiting{--agent-status-surface:var(--gt-waiting-bg,#fbf8ed);--agent-status-border:var(--gt-waiting-line,#e9dfc3);--agent-status-ink:var(--gt-waiting-text,#756443)}
#app-view.app-shell .agent-status.is-received{--agent-status-surface:#edf5fb;--agent-status-border:#cbdfea;--agent-status-ink:#365f79}
#app-view.app-shell .agent-status.is-completed{--agent-status-surface:var(--gt-done-bg,#edf6ef);--agent-status-border:var(--gt-done-line,#cfe2d3);--agent-status-ink:var(--gt-done-text,#316449)}
#app-view.app-shell .agent-status.is-ko{--agent-status-surface:var(--gt-ko-bg,#fde8e8);--agent-status-border:var(--gt-ko-line,#efcaca);--agent-status-ink:var(--gt-ko-text,#a12632)}
#app-view.app-shell .agent-status.is-canceled{--agent-status-surface:var(--gt-canceled-bg,#f8eeee);--agent-status-border:var(--gt-canceled-line,#e7cdcd);--agent-status-ink:var(--gt-canceled-text,#8a5558)}
#app-view.app-shell,#editor-view{color:var(--crm-ink,#173f31)}
#app-view.app-shell :is(.is-filtered,.contract-agent-filters select.is-filtered),#editor-view :is(button,[role=tab]):is(.active,[aria-pressed=true],[aria-selected=true]){
 background:var(--selection-surface,#b9f12b)!important;border-color:var(--selection-border,#9bc52b)!important;color:var(--selection-text,#173f31)!important;box-shadow:none!important;
}
#editor-view.quote-editor-page[data-sector] .quote-sector-tabs button:is(.active,[aria-pressed=true]){background:var(--selection-surface,#b9f12b)!important;color:var(--selection-text,#173f31)!important;border-color:var(--selection-border,#9bc52b)!important;box-shadow:none!important}
#editor-view .catalog-channel-options label:has(input:checked){background:#f4fbdf;border-color:var(--selection-border,#9bc52b);box-shadow:none}
#editor-view .primary{background:var(--crm-action-primary,#078b76);color:#fff;border:1px solid var(--crm-action-primary,#078b76);border-radius:12px;box-shadow:none}
:is(#app-view.app-shell,#editor-view) :is(.contract-row-actions,.contract-integration-actions,.archive-head-actions,.dialog-actions,.quote-actions,.contract-flow-actions,.dc-actions){display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0}
:is(#app-view.app-shell,#editor-view) :is(.contract-row-actions,.contract-integration-actions,.archive-head-actions,.dialog-actions,.quote-actions,.contract-flow-actions,.dc-actions)>:is(button,a.secondary,a.primary){box-sizing:border-box;min-width:0;max-width:100%;min-height:40px;margin:0;padding:9px 14px;font-family:inherit;font-size:.85rem;line-height:1.35;border-radius:12px;white-space:normal;overflow-wrap:anywhere}
:is(#app-view.app-shell,#editor-view) :is(.contract-metadata,.contract-review-data,.archive-card,.production-panel,.quote-card,.contract-card,.quote-panel,.agent-contract-detail){min-width:0}
:is(#app-view.app-shell,#editor-view) :is(.contract-metadata,.contract-review-data,.archive-card,.production-panel,.quote-card,.contract-card) :is(strong,dd,p,h2,h3,a){min-width:0;overflow-wrap:anywhere;white-space:normal}
:is(#app-view.app-shell,#editor-view) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;min-width:0;max-width:100%;font-family:inherit}
#app-view.app-shell .agent-contract-row{border-radius:var(--crm-radius,14px);border-color:var(--crm-line,#d6e7db)}
#app-view.app-shell .agent-contract-row.is-selected:not(.needs-integration){background:#f4fbdf;border-color:var(--selection-border,#9bc52b);box-shadow:none}
#app-view.app-shell .agent-contract-row .production-summary-head{align-items:flex-start}
#app-view.app-shell .contract-row-select{min-width:0}
#app-view.app-shell .contract-row-actions{flex:0 1 auto;max-width:100%}
#app-view.app-shell .production-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px}
#app-view.app-shell .production-head h1{margin:0;line-height:1.3;overflow-wrap:anywhere}
#app-view.app-shell .production-head label{min-width:0;max-width:100%}
#app-view.app-shell .production-panel{border:1px solid var(--crm-line,#d6e7db);border-radius:var(--crm-radius,14px);background:#fff;box-shadow:none}
#app-view.app-shell .production-integration-block{box-sizing:border-box;min-width:0;max-width:100%}
#app-view.app-shell .production-integration-block>span{min-width:0;overflow-wrap:anywhere}
#app-view.app-shell .production-integration-block>b{flex:none}
dialog .crm-normalized-dialog-head{font-family:inherit}
@media(max-width:760px){
 #app-view.app-shell .agent-contract-row .production-summary-head{align-items:stretch}
 #app-view.app-shell .contract-row-actions{justify-content:flex-start}
 :is(#app-view.app-shell,#editor-view) :is(.contract-row-actions,.dialog-actions,.quote-actions,.contract-flow-actions)>:is(button,a.secondary,a.primary){min-height:44px}
 #app-view.app-shell .contract-agent-filters>label{max-width:none!important;flex:1 1 145px}
 #app-view.app-shell .production-integration-block{padding:16px;gap:16px}
}
@media(max-width:480px){
 #app-view.app-shell .contract-row-actions{width:100%}
 #app-view.app-shell .contract-row-actions>button{flex:1 1 auto}
 #app-view.app-shell .production-head>label{width:100%}
}

/* Portal geometry: preserve the CRM palette while giving each region room. */
#app-view.app-shell #admin-agent-preview{
 display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
 gap:12px 24px;min-height:0;width:100%;margin:0 0 20px;padding:16px 20px;
 border-radius:var(--crm-radius,14px);box-shadow:none;
}
#app-view.app-shell #admin-agent-preview>strong{flex:1 1 320px;min-width:0;font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}
#app-view.app-shell #admin-agent-preview>button{flex:0 0 auto;min-height:44px;margin:0;padding:10px 16px;font-size:.85rem;line-height:1.35}
#app-view.app-shell #admin-agent-preview>label{flex:1 1 280px;max-width:480px;min-width:0;margin:0;gap:8px}
#app-view.app-shell #admin-agent-preview>[role=status]:empty{display:none}
#app-view.app-shell .crm-context{align-items:center;gap:16px 24px;padding:16px 20px;margin-bottom:16px;box-shadow:none}
#app-view.app-shell .crm-context-main{flex:1 1 340px;min-width:0}
#app-view.app-shell .crm-context-path{font-size:.9rem;line-height:1.4}
#app-view.app-shell .crm-context-count{margin-top:6px;font-size:.77rem;line-height:1.5;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
#app-view.app-shell .crm-context-tools{flex:1.4 1 420px;min-width:0;gap:12px}
#app-view.app-shell .crm-context-search{flex:1 1 auto;width:auto;min-width:0}
#app-view.app-shell .crm-context-search input{min-height:44px;font-size:.85rem;padding:10px 12px}
#app-view.app-shell .crm-context-reset{flex:none;min-height:44px;margin:0;padding:10px 12px;font-size:.8rem}
#app-view.app-shell .crm-active-filters{gap:10px 12px;padding-top:14px}
#app-view.app-shell .crm-product-navigation{gap:8px;margin:0 0 16px;padding:0 0 2px}
#app-view.app-shell #contratti-view .crm-product-navigation{padding:0 0 8px}
#app-view.app-shell :is(.crm-product-navigation,.crm-context-jumps) button{min-height:40px;padding:9px 12px;line-height:1.35;border-radius:10px}
#app-view.app-shell .has-workspace-navigation :is(.archive-tools,.contract-manager-filters)>label{gap:7px}
#app-view.app-shell .has-workspace-navigation :is(.archive-tools,.contract-manager-filters) :is(input,select,button){min-height:44px}
#app-view.app-shell #contratti-view.has-workspace-navigation #contract-agent-summary{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;margin:0;border:0}
#app-view.app-shell :is(.production-list-head,.production-recent-row){flex-wrap:wrap;min-width:0}
#app-view.app-shell .production-recent-row>span{min-width:0;overflow-wrap:anywhere}
#app-view.app-shell .production-products button{grid-template-columns:minmax(0,1fr) auto;align-items:start}
#app-view.app-shell .production-products button>span{min-width:0;overflow-wrap:anywhere}
@media(max-width:900px){
 #app-view.app-shell .crm-context-main,#app-view.app-shell .crm-context-tools{flex-basis:100%}
}
@media(max-width:760px){
 #app-view.app-shell #admin-agent-preview{padding:14px 16px;gap:12px;margin-bottom:16px}
 #app-view.app-shell #admin-agent-preview>strong{flex-basis:100%}
 #app-view.app-shell .crm-context{padding:14px 16px;gap:14px}
 #app-view.app-shell .crm-context-tools{flex-wrap:wrap;gap:8px}
 #app-view.app-shell .crm-context-search{flex:1 1 220px}
 #app-view.app-shell .crm-context-reset{margin-left:auto}
 #app-view.app-shell :is(.crm-product-navigation,.crm-context-jumps) button{min-height:44px}
}

#app-view.app-shell .agent-contract-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 20px;margin:16px 0;color:var(--muted,#687b72)}
#app-view.app-shell .agent-contract-pagination>div{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}
#app-view.app-shell .agent-contract-pagination button{min-height:40px;margin:0;padding:9px 12px;font-size:.8rem;line-height:1.35}
@media(min-width:761px){
 #app-view.app-shell #contratti-view[data-contract-section=archive]:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;align-items:start}
 #app-view.app-shell #contratti-view[data-contract-section=archive]>.crm-context{grid-column:1/-1}
 #app-view.app-shell #contratti-view[data-contract-section=archive]>.crm-product-navigation{grid-column:1;grid-row:2;min-width:0;align-self:center}
 #app-view.app-shell #contratti-view[data-contract-section=archive]>.contracts-hero{display:none}
 #app-view.app-shell #contratti-view[data-contract-section=archive]>#contract-agent-navigation{grid-column:2;grid-row:2;align-self:start;margin:0 0 16px}
 #app-view.app-shell #contratti-view[data-contract-section=archive]>:is(#contract-receipt,#contract-agent-panel){grid-column:1/-1;min-width:0}
}
@media(max-width:760px){
 #app-view.app-shell .agent-contract-pagination>div{justify-content:flex-start}
 #app-view.app-shell .agent-contract-pagination button{min-height:44px}
}

/* The archive used a legacy edge-to-edge shell, unlike the other sections. */
#app-view.app-shell.archive-mode .workspace{padding:clamp(16px,2.3vw,30px);background:var(--crm-workspace,#f5f5f2)}
#app-view.app-shell #archivio-view.has-workspace-navigation .archive-head{position:static;min-height:0;padding:0;margin:0 0 16px;background:transparent;border:0;border-radius:0;box-shadow:none}
#app-view.app-shell #archivio-view.has-workspace-navigation .archive-head>div:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0;padding:0}
#app-view.app-shell #archivio-view.has-workspace-navigation .archive-head-actions{margin-left:auto}
#app-view.app-shell #archivio-view.has-workspace-navigation :is(.archive-list,.archive-summary){margin-left:0;margin-right:0}
#app-view.app-shell #archivio-view.has-workspace-navigation #archive-summary{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;margin:0;border:0}
@media(max-width:760px){#app-view.app-shell.archive-mode .workspace{padding:16px 12px calc(92px + env(safe-area-inset-bottom))}}

/* Production KPI cards use the same title/value/unit/action hierarchy as CRM. */
#app-view.app-shell .production-stats{gap:16px;align-items:stretch}
#app-view.app-shell .production-stats>.production-stat{display:flex;flex-direction:column;align-items:flex-start;gap:16px;min-width:0;margin:0;padding:24px;border:1px solid var(--crm-border,#e1e4dd);border-top:3px solid var(--selection-surface,#b9f12b);border-radius:20px;background:var(--crm-surface,#fff);box-shadow:0 6px 20px #173f3106;text-align:left}
#app-view.app-shell .production-stat h2{min-height:2.7em;margin:0;font-size:.85rem;line-height:1.35;font-weight:750;text-transform:uppercase;letter-spacing:.01em;color:var(--crm-ink,#173f31);overflow-wrap:anywhere}
#app-view.app-shell .production-stat .production-stat-value{font-size:2.5rem;line-height:1.1;font-weight:750;color:#00895d;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;max-width:100%}
#app-view.app-shell .production-stat .production-stat-unit{min-height:2.7em;font-size:.9rem;line-height:1.35;color:var(--crm-ink,#173f31);overflow-wrap:anywhere}
#app-view.app-shell .production-stats>.production-stat>button{display:inline-flex;align-items:center;justify-content:center;flex:none;gap:0;min-height:44px;min-width:0;max-width:100%;margin:auto 0 0;padding:10px 14px;border:1px solid #00a65a;border-radius:12px;background:#fff;color:#00895d;font-size:.85rem;font-weight:750;line-height:1.35;white-space:normal;overflow-wrap:anywhere;text-align:center;box-shadow:none}
@media(max-width:760px){
 #app-view.app-shell .production-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 #app-view.app-shell .production-stats>.production-stat{padding:18px 16px;gap:12px;border-radius:17px}
 #app-view.app-shell .production-stat h2{font-size:.8rem}
 #app-view.app-shell .production-stat .production-stat-value{font-size:2.2rem}
 #app-view.app-shell .production-stat .production-stat-unit{font-size:.8rem}
 #app-view.app-shell .production-stats>.production-stat>button{width:100%;padding:10px 8px;font-size:.8rem}
}

/* Identical calendar-month controls in production and contract filters. */
#app-view.app-shell .portal-month-stepper{display:flex;align-items:center;gap:8px;width:100%;min-width:0}
#app-view.app-shell .portal-month-stepper>select{flex:1 1 auto;width:0;min-width:0;margin:0;min-height:44px}
#app-view.app-shell .portal-month-stepper>.portal-month-arrow{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid var(--crm-border,#e1e4dd);border-radius:10px;background:#fff;color:var(--crm-ink,#173f31);font-size:1.15rem;line-height:1;box-shadow:none}
#app-view.app-shell .portal-month-stepper>.portal-month-arrow:disabled{opacity:.4;cursor:default}
#app-view.app-shell .production-head>.portal-month-label{width:300px;max-width:100%}
#app-view.app-shell #contratti-view .contract-agent-filters>.portal-month-label{flex:1 1 280px;min-width:0;max-width:320px}
@media(max-width:760px){
 #app-view.app-shell #contratti-view .contract-agent-filters>.portal-month-label{flex-basis:100%;max-width:none}
 #app-view.app-shell .production-head>.portal-month-label{width:100%}
}


/* Selection and workflow status remain independent. */
#app-view.app-shell .agent-contract-row.is-selected{background:#fbfdf7!important;border:2px solid var(--selection-border,#9bc52b)!important;box-shadow:none!important}
#app-view.app-shell .agent-contract-row.is-selected :is(.production-summary-head,.production-summary-main){background:transparent!important}
#app-view.app-shell .agent-contract-row.is-selected .production-summary-head::after{content:"✓";color:#14533d;font-weight:700;margin-left:auto}


/* Layout adapters only; archive controls and geometry come from the CRM proxy. */
#app-view.app-shell #contratti-view[data-contract-section=archive]:not([hidden]){display:block!important}
#app-view.app-shell #contratti-view[data-contract-section=archive]>.crm-context{gap:12px 20px;padding:16px 18px}
#app-view.app-shell #contratti-view[data-contract-section=archive] .crm-context-path strong{font-size:20px;line-height:1.3;letter-spacing:-.3px}
#app-view.app-shell #contratti-view[data-contract-section=archive] .crm-context-count{display:block!important;margin-top:4px;font-size:12px;line-height:1.4}
#app-view.app-shell #contratti-view[data-contract-section=archive] .crm-context-main{flex-basis:auto}
#app-view.app-shell #contratti-view[data-contract-section=archive] .crm-context-tools{flex-basis:auto}
#app-view.app-shell #contratti-view[data-contract-section=archive] .contract-manager-toolbar:empty{display:none}
#app-view.app-shell #contratti-view[data-contract-section=archive] #contract-agent-navigation{margin:0 0 12px}
#app-view.app-shell #contratti-view[data-contract-section=archive] .contract-agent-filters label:nth-child(n){max-width:none;min-width:0}
#app-view.app-shell #contratti-view[data-contract-section=archive] .contract-agent-filters .portal-month-label[hidden]{display:none!important}
#app-view.app-shell #contratti-view[data-contract-section=archive] .archive-month-dialog footer{flex-wrap:wrap}
#app-view.app-shell #contratti-view[data-contract-section=send] .crm-context :is(.archive-month-control,.archive-filter-toggle,.archive-export-menu,.contract-agent-filters){display:none!important}
#app-view.app-shell #contratti-view[data-contract-section=send] .crm-context-tools:has(.archive-month-control) .crm-context-search{display:none!important}
#app-view.app-shell #contratti-view[data-contract-section=archive] .crm-active-filters .crm-filter-chip{background:var(--selection-surface);border-color:var(--selection-border)}

/* Preventivi: balanced header and compact admin selector. */
#app-view.app-shell #pratiche-view .dashboard-intro{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);align-items:stretch;gap:20px;margin:0 0 20px}
#app-view.app-shell #pratiche-view .dashboard-intro>.page-head{display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:24px;min-width:0;min-height:220px;margin:0;padding:24px;border:1px solid var(--crm-border,#e1e4dd);border-radius:var(--crm-radius,14px);background:#fff;box-shadow:none}
#app-view.app-shell #pratiche-view .page-head .eyebrow{margin:0 0 10px;font-size:.72rem;line-height:1.4}
#app-view.app-shell #pratiche-view .page-head h1{margin:0 0 10px;font-size:clamp(1.8rem,2.5vw,2.25rem);line-height:1.15}
#app-view.app-shell #pratiche-view #summary{margin:0;font-size:.9rem;line-height:1.5}
#app-view.app-shell #pratiche-view .page-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0}
#app-view.app-shell #pratiche-view .page-actions>button{min-height:44px;margin:0;padding:10px 16px;font-size:.85rem;line-height:1.35;white-space:normal}
#app-view.app-shell #pratiche-view .dashboard-intro>.workspace-hero{min-width:0;min-height:220px;height:auto;margin:0;border-radius:var(--crm-radius,14px)}
#app-view.app-shell #pratiche-view .workspace-hero>div{left:24px;right:24px;bottom:24px;max-width:none}
#app-view.app-shell #pratiche-view .workspace-hero strong{font-size:clamp(1.15rem,1.8vw,1.55rem);line-height:1.25}
#app-view.app-shell #admin-agent-preview>label{display:flex;align-items:center;flex:1 1 420px;gap:16px;max-width:620px;font-size:.85rem;line-height:1.4}
#app-view.app-shell #admin-agent-preview>label>select{flex:1 1 260px;width:auto;min-width:0;min-height:44px;margin:0;padding:10px 12px;font-size:.85rem}
@media(max-width:1050px){#app-view.app-shell #pratiche-view .dashboard-intro{grid-template-columns:minmax(0,1fr)}#app-view.app-shell #pratiche-view .dashboard-intro>.page-head{min-height:0;gap:20px}#app-view.app-shell #pratiche-view .dashboard-intro>.workspace-hero{min-height:180px}}
@media(max-width:600px){#app-view.app-shell #admin-agent-preview>label{align-items:stretch;flex-direction:column;gap:8px}#app-view.app-shell #admin-agent-preview>label>select{flex:auto;width:100%}#app-view.app-shell #pratiche-view .dashboard-intro>.page-head{padding:20px}}

/* Assigned work and received integrations share the agent-facing BO state. */
#app-view.app-shell .agent-status.is-handling{--agent-status-surface:var(--gt-handling-bg,#edf3f6);--agent-status-border:var(--gt-handling-line,#d5e1e7);--agent-status-ink:var(--gt-handling-text,#46616f)}

#app-view.app-shell .agent-contract-row.needs-integration{background:#fff;border-color:var(--gt-line,#dfe3e5);box-shadow:none}

#app-view.app-shell .agent-status.is-pending{--agent-status-surface:var(--gt-sent-bg,#f1f3f4);--agent-status-border:var(--gt-sent-line,#dfe3e5);--agent-status-ink:var(--gt-sent-text,#58636a)}

/* Compact customer card: the approved palette, with visible essentials. */
#app-view.app-shell #agent-practice-page .agent-practice-back{padding:4px 0;margin:0 0 14px;border:0;background:transparent;color:#58636a;box-shadow:none;font-size:.85rem}
#app-view.app-shell #agent-practice-page .agent-practice-heading{display:flex;flex-wrap:wrap;gap:20px;margin:0 0 18px;padding:22px 24px 0;background:#fff;border:1px solid var(--gt-line,#dfe3e5);border-radius:14px;box-shadow:none}
#app-view.app-shell #agent-practice-page .agent-practice-person{display:flex;align-items:center;gap:14px;flex:1 1 360px;min-width:0}
#app-view.app-shell #agent-practice-page .agent-practice-person>div{min-width:0}
#app-view.app-shell #agent-practice-page .agent-person-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:12px;background:#f3f8e7;color:var(--gt-heading,#173f31)}
#app-view.app-shell #agent-practice-page .agent-person-icon svg{width:23px;height:23px}
#app-view.app-shell #agent-practice-page .agent-practice-heading h1{margin:0 0 6px;font-size:clamp(23px,2vw,29px);font-weight:700;line-height:1.2;letter-spacing:-.5px;overflow-wrap:anywhere}
#app-view.app-shell #agent-practice-page .agent-practice-heading p{font-size:.88rem;line-height:1.4;color:#58636a}
#app-view.app-shell #agent-practice-page .agent-practice-essentials{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px 24px;flex-basis:100%;width:100%;margin:0;padding:17px 0 19px;border-top:1px solid #edf0ea}
#app-view.app-shell #agent-practice-page .agent-practice-essentials:empty{display:none}
#app-view.app-shell #agent-practice-page .agent-essential{min-width:0}
#app-view.app-shell #agent-practice-page .agent-essential dt{font-size:.71rem;font-weight:550;color:#738078;margin:0 0 6px}
#app-view.app-shell #agent-practice-page .agent-essential dd{margin:0;font-size:.84rem;font-weight:550;line-height:1.45;color:var(--gt-text,#343b3f);overflow-wrap:anywhere}
#app-view.app-shell #agent-practice-page .agent-practice-grid{grid-template-columns:minmax(0,1.35fr) minmax(280px,1fr);gap:18px}
#app-view.app-shell #agent-practice-page .agent-practice-card{padding:20px}
#app-view.app-shell #agent-practice-page .agent-practice-card h2{display:flex;align-items:center;gap:9px;position:relative;font-size:1.08rem;margin:0 0 17px;padding-bottom:12px;border-bottom:1px solid #edf0ea}
#app-view.app-shell #agent-practice-page .agent-practice-card h2:after{content:"";position:absolute;bottom:-1px;left:0;width:32px;height:3px;background:var(--gt-lime,#b9f12b);border-radius:3px}
#app-view.app-shell #agent-practice-page .agent-practice-card h2 svg{width:19px;height:19px;flex:none}
#app-view.app-shell #agent-practice-page .agent-message{padding:12px 0;font-size:.86rem}
#app-view.app-shell #agent-practice-page .agent-message:last-child{border-bottom:0;padding-bottom:0}
#app-view.app-shell #agent-practice-page .agent-message p{margin-top:7px;line-height:1.55}
#app-view.app-shell #agent-practice-page .agent-document{gap:10px;padding:10px 11px;margin-bottom:8px;min-height:46px;font-size:.79rem;border-radius:9px}
#app-view.app-shell #agent-practice-page .agent-document>span:not(.agent-document-icon){flex:1}
#app-view.app-shell #agent-practice-page .agent-document-icon{display:grid;place-items:center;flex:0 0 30px;height:32px;border-radius:7px;background:#f5f7f2;color:#526b5c}
#app-view.app-shell #agent-practice-page .agent-document-icon svg{width:16px;height:18px}
#app-view.app-shell #agent-practice-page .agent-document a{display:inline-flex;align-items:center;gap:6px;padding:6px;border-radius:6px;text-decoration:none;font-size:.76rem}
#app-view.app-shell #agent-practice-page .agent-document a:hover{background:#f3f8e7}
#app-view.app-shell #agent-practice-page .agent-document a svg{width:15px;height:15px}
#app-view.app-shell #contratti-view .agent-contract-row .contract-row-select,#app-view.app-shell #contratti-view .agent-contract-row .contract-row-select[aria-pressed=true]{background:transparent!important;box-shadow:none!important;border-color:transparent!important;color:var(--gt-heading,#173f31)!important;cursor:pointer}
#app-view.app-shell .agent-contract-row.is-selected{background:#fff!important;border:1px solid var(--gt-line,#dfe3e5)!important}
#app-view.app-shell .agent-contract-row:hover,#app-view.app-shell .agent-contract-row.is-selected:hover{border-color:var(--selection-border,#9bc52b)!important;box-shadow:none!important}
#app-view.app-shell #contratti-view .agent-contract-row .contract-row-select:focus-visible{outline:2px solid var(--selection-border,#9bc52b);outline-offset:2px}
@media(max-width:1050px){#app-view.app-shell #agent-practice-page .agent-practice-essentials{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){#app-view.app-shell #agent-practice-page .agent-practice-grid{grid-template-columns:minmax(0,1fr)}#app-view.app-shell #agent-practice-page .agent-practice-heading{padding:18px 18px 0;gap:16px}#app-view.app-shell #agent-practice-page .agent-practice-person{flex-basis:auto}#app-view.app-shell #agent-practice-page .agent-practice-essentials{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}#app-view.app-shell #agent-practice-page .agent-practice-card{padding:18px}}
#app-view.app-shell .agent-contract-row [data-contract-details]{border:1px solid transparent!important;background:transparent!important;box-shadow:none!important}
#app-view.app-shell .agent-contract-row [data-contract-details]:hover{border-color:var(--selection-border,#9bc52b)!important;background:#fff!important}
#app-view.app-shell .agent-contract-row{cursor:pointer}
#app-view.app-shell #contratti-view .agent-contract-row .contract-row-select:focus:not(:focus-visible){outline:none!important;box-shadow:none!important}

/* Compact production overview; integration colors are the canonical CRM tokens. */
#app-view.app-shell #commercial-home .production-head{align-items:center;flex-direction:row;gap:12px 20px;margin-bottom:0}
#app-view.app-shell #commercial-home .production-head h1{font-size:1.45rem;line-height:1.25;margin:0}
#app-view.app-shell #commercial-home .production-head>.portal-month-label{width:280px;min-width:0;margin:0;gap:0}
#app-view.app-shell #commercial-home .production-head .portal-month-stepper{gap:8px}
#app-view.app-shell #commercial-home .production-head .portal-month-stepper>select{min-height:40px;padding:8px 12px;font-size:.85rem}
#app-view.app-shell #commercial-home .production-head .portal-month-arrow{flex-basis:40px;width:40px;height:40px;min-height:40px;font-size:1rem}
#app-view.app-shell #commercial-home .production-notice{margin:10px 0 12px;min-height:0;line-height:1.45}
#app-view.app-shell #commercial-home .production-integration-block{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:12px;width:100%;min-height:48px;margin:12px 0 18px;padding:12px 16px;border:1px solid var(--gt-waiting-line,#e9dfc3)!important;border-radius:10px;background:var(--gt-waiting-bg,#fbf8ed)!important;color:var(--gt-waiting-text,#756443)!important;box-shadow:none!important;text-align:left}
#app-view.app-shell #commercial-home .production-integration-block strong{font-size:.9rem;line-height:1.4;font-weight:650}
#app-view.app-shell #commercial-home .production-integration-block>span{display:inline-flex;gap:0;font-size:.85rem;line-height:1.4;flex:none;white-space:nowrap}
#app-view.app-shell #commercial-home .production-integration-block:focus-visible{outline:2px solid var(--gt-waiting-text,#756443);outline-offset:3px}
#app-view.app-shell #commercial-home .production-integration-empty{margin:12px 0 18px;padding:0;border:0;background:none;color:var(--gt-sent-text,#58636a);font-size:.85rem;line-height:1.45}
@media(max-width:600px){#app-view.app-shell #commercial-home .production-head>.portal-month-label{width:100%}#app-view.app-shell #commercial-home .production-head h1{font-size:1.3rem}#app-view.app-shell #commercial-home .production-integration-block{padding:12px;gap:8px}}

/* Balanced hierarchy: customer-contract count first, compact and aligned KPI cards. */
#app-view.app-shell #commercial-home .production-head h1{font-size:1.8rem;line-height:1.2;font-weight:700}
#app-view.app-shell #commercial-home .production-notice{margin:12px 0 10px;font-size:.9rem;line-height:1.5}
#app-view.app-shell #commercial-home .production-contract-total{font-size:1.1rem;font-weight:650;color:var(--gt-heading,#173f31)}
#app-view.app-shell #commercial-home .production-summary-detail{color:var(--gt-sent-text,#58636a)}
#app-view.app-shell #commercial-home .production-stats{margin:18px 0;gap:16px}
#app-view.app-shell #commercial-home .production-stats>.production-stat{padding:20px;gap:10px;border-radius:16px;box-shadow:none}
#app-view.app-shell #commercial-home .production-stat h2{min-height:1.4em;font-size:.88rem;line-height:1.4;font-weight:650;text-transform:none;letter-spacing:0}
#app-view.app-shell #commercial-home .production-stat .production-stat-value{font-size:2.3rem;line-height:1.1}
#app-view.app-shell #commercial-home .production-stat .production-stat-unit{min-height:1.4em;font-size:.83rem;line-height:1.4;color:var(--gt-sent-text,#58636a)}
#app-view.app-shell #commercial-home .production-stats>.production-stat>button{min-height:38px;margin:8px 0 0;padding:8px 12px;font-size:.8rem;border-radius:9px;font-weight:650}
@media(max-width:600px){#app-view.app-shell #commercial-home .production-head h1{font-size:1.6rem}#app-view.app-shell #commercial-home .production-stats{gap:12px}#app-view.app-shell #commercial-home .production-stats>.production-stat{padding:16px}#app-view.app-shell #commercial-home .production-stat h2{min-height:2.8em}#app-view.app-shell #commercial-home .production-stat .production-stat-value{font-size:2.1rem}}

/* A hidden contract workspace must never leak into the quote editor or other views. */
#app-view.app-shell #contratti-view[hidden]{display:none!important}
/* The visible production month is an active selection, matching CRM filters. */
#app-view.app-shell #commercial-home .production-head select[data-production-month]{background:var(--selection-surface,#b9f12b)!important;border-color:var(--selection-border,#9bc52b)!important;color:var(--selection-text,#173f31)!important;font-weight:700;box-shadow:none!important}


/* Provider badge sizing in the agent list; colors come from the canonical CRM design. */
.agent-contract-row .provider-badge{margin-right:6px}


/* PDP states reuse the established GreenTech status palette. */
.provider-status{display:inline-flex;align-items:center;padding:7px 12px;border:1px solid;border-radius:12px;font-weight:600;font-size:.875rem;line-height:1.35}
.provider-status.is-handling{background:var(--gt-handling-bg,#edf3f6);border-color:var(--gt-handling-line,#d5e1e7);color:var(--gt-handling-text,#46616f)}
.provider-status.is-completed{background:var(--gt-done-bg,#edf6ef);border-color:var(--gt-done-line,#cfe2d3);color:var(--gt-done-text,#316449)}
.provider-status.is-waiting{background:var(--gt-waiting-bg,#fbf8ed);border-color:var(--gt-waiting-line,#e9dfc3);color:var(--gt-waiting-text,#756443)}
.provider-status.is-ko{background:var(--gt-ko-bg,#fde8e8);border-color:var(--gt-ko-line,#efcaca);color:var(--gt-ko-text,#a12632)}
.provider-progress-detail{margin:12px 0}.provider-progress-detail p{margin:6px 0}.provider-progress-detail details{margin-top:8px}.provider-progress-detail summary{cursor:pointer}.provider-list-reason{display:block;max-width:32rem;white-space:normal;overflow-wrap:anywhere}

/* Administrative payment uses the approved petrol-green/lime label matrix. */
#app-view.app-shell .is-paid{--agent-status-surface:#087F6B;--agent-status-border:#087F6B;--agent-status-ink:#C4F136}
#app-view.app-shell :is(.provider-status.is-paid,.agent-status.is-paid,.contract-status.is-paid){color:#C4F136;background:#087F6B;border-color:#087F6B;font-weight:700}


/* Practice progress is display-only: no events, notices or read receipts. */
.practice-progress{margin:18px 0 24px;padding:20px;border:1px solid var(--border,#dce5dd);border-radius:16px;background:var(--surface,#fafaf7)}
.practice-progress-lane+ .practice-progress-lane{margin-top:20px;padding-top:20px;border-top:1px solid var(--border,#dce5dd)}
.practice-progress-lane h2{font-size:.95rem;margin:0 0 16px;color:var(--text,#193f35)}
.practice-progress ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;margin:0;list-style:none}
.practice-progress li{position:relative;display:flex;flex-direction:column;gap:10px;font-size:.85rem;font-weight:600;min-width:0}
.practice-progress li:before{content:'';position:absolute;top:15px;left:38px;right:-12px;height:2px;background:var(--border,#dce5dd)}
.practice-progress li:last-child:before{display:none}
.practice-progress-dot{position:relative;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--border,#e6ece6);color:var(--text,#193f35)}
.practice-progress .is-done .practice-progress-dot{background:var(--brand,#008572);color:#fff}
.practice-progress .is-current .practice-progress-dot{background:var(--lime,#c4f124);color:#193f35}
.practice-progress .is-future{opacity:.65}
.practice-progress-detail{margin-top:18px;font-size:.9rem;padding:14px 16px;border-radius:12px;background:var(--surface-soft,#f0f5e7)}
.practice-progress-detail p{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:520px){.practice-progress{padding:16px 12px}.practice-progress ol{gap:8px}.practice-progress li{font-size:.75rem}.practice-progress-detail{padding:12px}}

/* Keep customer identity readable when a practice has several long status badges. */
#app-view.app-shell .agent-contract-row .production-summary-head{flex-wrap:wrap}
#app-view.app-shell .agent-contract-row .contract-row-select{flex:1 1 22rem;min-width:min(100%,22rem);max-width:100%}
#app-view.app-shell .agent-contract-row .contract-row-select>span:last-child{flex:1;min-width:0}
#app-view.app-shell .agent-contract-row .contract-row-select strong{overflow-wrap:normal;word-break:normal}
#app-view.app-shell .agent-contract-row .contract-row-actions{flex:1 1 34rem;min-width:0;justify-content:flex-end}
@media(max-width:760px){
 #app-view.app-shell .agent-contract-row .contract-row-select{flex:0 1 auto;min-width:0;width:100%}
 #app-view.app-shell .agent-contract-row .contract-row-actions{flex:0 1 auto;width:100%;justify-content:flex-start}
}

/* Compact product totals and their outcomes retain the existing chart geometry. */
#app-view.app-shell .production-products .production-product-row>button{width:100%}
#app-view.app-shell .production-products strong small{font-size:.72rem;font-weight:400;color:var(--muted,#687b72)}
#app-view.app-shell .production-product-outcomes{display:flex;flex-wrap:wrap;gap:4px 14px}
#app-view.app-shell .production-products .production-product-outcomes button{display:inline-flex;gap:5px;align-items:baseline;padding:3px 0;font-size:.75rem;line-height:1.5;color:var(--muted,#687b72);min-height:32px}
#app-view.app-shell .production-product-outcomes b{color:var(--selection-text,#173f31)}

/* Keep the agent's work queue above the production summary. */
#commercial-home[data-personal="true"] > .home-work {
  order: -1;
}

@media (min-width: 761px) {
  #commercial-home[data-personal="true"] #home-work-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#app-view.app-shell .agent-contract-row :is(.provider-badge,.contract-status.agent-status),
#app-view.app-shell .agent-contract-row.needs-integration .contract-row-actions .contract-status.agent-status{
 box-sizing:border-box;display:inline-flex;align-items:center;min-height:30px;padding:5px 9px;border-radius:8px;font-size:.83rem;font-weight:650;line-height:18px;letter-spacing:0;
}

/* Bind the CRM row presentation to Agenti controls. */
#app-view.app-shell #contratti-view .production-row-main h3 .contract-row-select{
 display:inline;
 width:auto;
 padding:0;
 border:0;
 color:#167a55!important;
 font:inherit;
 font-weight:700;
 text-decoration:underline;
 text-underline-offset:.12em;
}
#app-view.app-shell #contract-agent-list .production-list-row.is-selected{
 background:#f8faf5!important;
}
#app-view.app-shell #contract-agent-list .production-row-controls [data-contract-details]{
 border-color:#dbe4d8!important;
 background:#fff!important;
}
#contract-agent-list .production-list-row>.agent-contract-detail{grid-column:1/-1}

/* Portal dialog adapters: use the CRM's live tokens and single-exit heading. */
html body dialog[data-dialog-single-exit]{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px)!important;border:1px solid var(--crm-line,var(--gt-line,#dce5df))!important;border-radius:var(--crm-radius,14px)!important;background:var(--crm-surface,#fff)!important;color:var(--crm-ink,var(--gt-heading,#173f31))!important;font-family:inherit;line-height:1.5;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c3d0c6 transparent;box-shadow:0 20px 64px #173f3126!important}
html body dialog[data-dialog-single-exit]::backdrop{background:#17352b66;backdrop-filter:blur(2px)}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head{position:sticky!important;top:0;z-index:8;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin:0!important;padding:18px 22px 18px 34px!important;border:0!important;border-bottom:1px solid var(--crm-line,var(--gt-line,#dce5df))!important;background:#fff!important;flex:none;box-sizing:border-box}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head::before{content:"";position:absolute;left:20px;top:22px;width:3px;height:22px;border-radius:3px;background:var(--selection-surface,#b9f12b)}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head>div{min-width:0;flex:1}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head :is(h2,h3){margin:0;font-size:clamp(1.05rem,2vw,1.25rem)!important;font-weight:700;line-height:1.35;letter-spacing:-.02em;overflow-wrap:anywhere;color:var(--crm-ink,#173f31)}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head p{margin:5px 0 0;color:var(--crm-muted,#63766b);font-size:.85rem;line-height:1.5}
html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head .eyebrow{margin:0 0 6px;font-size:.7rem;letter-spacing:.06em;font-weight:650;text-transform:uppercase}
html body dialog[data-dialog-single-exit] [data-dialog-exit]{flex:none;min-height:40px;min-width:78px;max-width:100%;margin:0!important;padding:8px 14px!important;border:1px solid var(--crm-line,#dce5df)!important;border-radius:10px!important;background:#fff!important;color:var(--crm-ink,#173f31)!important;font:inherit;font-size:.875rem;font-weight:600;box-shadow:none!important;cursor:pointer}
html body dialog[data-dialog-single-exit] [data-dialog-exit]:hover{background:var(--selection-surface-soft,#eff7dd)!important;border-color:var(--selection-border,#b3d271)!important}
html body dialog[data-dialog-single-exit] [data-dialog-exit]:focus-visible{outline:3px solid var(--selection-border,#b3d271);outline-offset:2px}
html body dialog.dc-dialog[data-dialog-single-exit]{padding:0}
html body dialog.dc-dialog[data-dialog-single-exit]>.dc-dialog-body{padding:20px 22px}
html body dialog.dc-dialog.dc-preview[data-dialog-single-exit][open]{display:flex;flex-direction:column;overflow:hidden}
html body dialog.dc-dialog.dc-preview[data-dialog-single-exit]>.dc-dialog-body{flex:1;min-height:0;height:auto;padding:0;overflow:auto}
html body dialog.share-dialog[data-dialog-single-exit] .share-files{max-height:none;overflow:visible}
@media(max-width:650px){html body dialog[data-dialog-single-exit]{max-width:calc(100vw - 16px);max-height:calc(100dvh - 20px)!important}html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head{gap:12px;padding:16px 16px 16px 28px!important}html body dialog[data-dialog-single-exit] .crm-normalized-dialog-head::before{left:14px;top:19px}html body dialog[data-dialog-single-exit] [data-dialog-exit]{min-width:68px;min-height:40px;padding:8px 12px!important}html body dialog.dc-dialog[data-dialog-single-exit]>.dc-dialog-body{padding:16px}}

/* Indirizzi e VAS nel modulo interno di Agenti. */
#contract-submit-form .contract-address-locality {
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
}
#contract-submit-form label.contract-same-address,
#contract-submit-form .contract-entry-vas-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}
#contract-submit-form label.contract-same-address > input[type="checkbox"],
#contract-submit-form .contract-entry-vas-options input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #b7d83f;
}
#contract-submit-form .contract-entry-vas {
  min-width: 0;
  margin: 0;
  padding: 4px 14px 8px;
  border: 1px solid #dce6df;
  border-radius: 14px;
  background: #f6faf6;
}
#contract-submit-form .contract-entry-vas legend {
  padding: 0 6px;
  color: #0f3d2e;
  font-weight: 700;
}
#contract-submit-form .contract-entry-vas-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
@media (max-width: 640px) {
  #contract-submit-form .contract-address-locality {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #contract-submit-form .contract-address-locality > label:first-child {
    grid-column: 1 / -1;
  }
  #contract-submit-form .contract-entry-vas-options {
    grid-template-columns: minmax(0, 1fr);
  }
}
