/* CalabriaVera — hardening responsive globale. Incluso nel bundle finale della build. */
html,body{width:100%;max-width:100%;overflow-x:hidden!important}body,#main-content,#site-header,#site-footer{min-width:0;max-width:100%}*,*::before,*::after{box-sizing:border-box}img,picture,video,canvas,svg,iframe{max-width:100%}img{height:auto}input,select,textarea,button{max-width:100%}:where(.container,.section,.card,.notice,.empty-state,.result-list,.activity-item,.catalog-layout,.map-layout,.split,.grid-2,.grid-3,.grid-4,.card-grid,.filters-grid,.form-grid,.admin-layout,.table-wrap,.cv-messages-shell,.cv-conversations-panel,.cv-thread-panel,.cv-thread-heading,.cv-thread,.cv-message-composer,.cv-conversation-row,.cv-conversation-copy){min-width:0!important;max-width:100%}:where(h1,h2,h3,h4,p,a,span,strong,small,label,td,th,code,pre){overflow-wrap:anywhere;word-break:normal}.button,button{white-space:normal}.table-wrap{width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}.table-wrap table{width:100%;max-width:none}.card,.notice,.activity-item{overflow-wrap:anywhere}

/* Checkbox consenso profilo: controllo nativo, quadrato e sempre cliccabile. */
#profile-form label:has(input[name="marketingConsent"]){cursor:pointer}#profile-form label:has(input[name="marketingConsent"])>span{display:flex!important;align-items:center!important;gap:.65rem!important;font-weight:600}#profile-form input[name="marketingConsent"]{appearance:auto!important;-webkit-appearance:checkbox!important;accent-color:var(--brand,#075b8f);width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;max-width:20px!important;flex:0 0 20px!important;margin:0!important;padding:0!important;border-radius:2px!important;cursor:pointer!important;pointer-events:auto!important}

/* Consenso Aggiungi attività: hit target esplicito e indipendente dagli input testuali. */
body[data-page="addBusiness"] .cv-business-consent input[type="checkbox"]{appearance:auto!important;-webkit-appearance:checkbox!important;accent-color:var(--brand,#075b8f);width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;max-width:20px!important;max-height:20px!important;flex:0 0 20px!important;margin:3px 0 0!important;padding:0!important;border-radius:2px!important;cursor:pointer!important;pointer-events:auto!important}body[data-page="addBusiness"] .cv-business-consent label{cursor:pointer!important}

/* Messaggi: niente colonne che spingono la pagina fuori viewport. */
body[data-page="messages"] #main-content>.section.container{width:min(calc(100% - 32px),1200px)!important;max-width:1200px!important;padding-block:24px!important}
#messages-root{width:100%;min-width:0;max-width:100%;overflow:hidden}
.cv-messages-shell{display:grid!important;grid-template-columns:minmax(250px,34%) minmax(0,1fr)!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:560px!important;height:min(720px,calc(100dvh - 150px))!important;overflow:hidden!important}
.cv-conversations-panel,.cv-thread-panel{width:100%!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}
.cv-conversations-panel{overflow-y:auto!important;overscroll-behavior:contain}.cv-conversation-list{min-width:0!important;max-width:100%!important}.cv-conversation-item{min-width:0!important;max-width:100%!important}.cv-conversation-row{width:100%!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}.cv-conversation-copy{min-width:0!important;max-width:100%!important;overflow:hidden!important}.cv-conversation-top{min-width:0!important;max-width:100%!important}.cv-conversation-top strong,.cv-conversation-preview{min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis}.cv-conversation-preview{display:block;white-space:nowrap}.cv-conversation-top strong{overflow-wrap:anywhere}.cv-thread-panel{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important}.cv-thread-heading{width:100%!important;display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;gap:10px!important;overflow:hidden!important}.cv-thread-heading>div{min-width:0!important;flex:1 1 220px}.cv-thread-actions{min-width:0!important;max-width:100%!important;display:flex!important;flex-wrap:wrap!important;gap:7px!important}.cv-thread-actions>*{max-width:100%!important}.cv-thread{width:100%!important;min-width:0!important;max-width:100%!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;padding-inline:clamp(12px,2.3vw,24px)!important}.cv-message-bubble,.message{max-width:min(82%,720px)!important;min-width:0!important;overflow-wrap:anywhere!important}.cv-message-composer{width:100%!important;min-width:0!important;max-width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;padding:max(10px,env(safe-area-inset-bottom)) 12px!important}.cv-message-composer input{width:100%!important;min-width:0!important;max-width:100%!important}.cv-send-button{min-width:48px!important;max-width:100%!important}.cv-quick-replies{display:none!important}

/* Admin e contenuti dinamici: nessun elemento deve imporre una larghezza desktop. */
.admin-layout,#admin-content,#admin-content>.stack,#admin-content .result-list,#admin-content .card,#admin-content .cv-admin-toolbar,#admin-content .cv-admin-card-head{min-width:0!important;max-width:100%!important}#admin-content .cv-admin-card-head,#admin-content .section-heading{flex-wrap:wrap!important}#admin-content .cv-admin-card-head>*{min-width:0!important;max-width:100%!important}#admin-content input:not([type="checkbox"]):not([type="radio"]),#admin-content select,#admin-content textarea{width:100%!important;min-width:0!important;max-width:100%!important}#admin-content input[type="checkbox"],#admin-content input[type="radio"]{width:1.18rem!important;height:1.18rem!important;min-width:1.18rem!important;min-height:1.18rem!important;max-width:1.18rem!important;pointer-events:auto!important}#admin-content pre{max-width:100%!important;overflow:auto!important;white-space:pre-wrap!important}.cv-admin-toolbar{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))!important;gap:10px!important}

/* Il responsive globale protegge dagli overflow, senza imporre densità alle liste specializzate. */
@media(max-width:1100px){
  .cv-messages-shell{grid-template-columns:minmax(230px,38%) minmax(0,1fr)!important}
}

/* Tablet: Messaggi diventa verticale prima che le colonne inizino a tagliarsi. */
@media(max-width:980px){
  .cv-messages-shell{grid-template-columns:1fr!important;height:auto!important;min-height:0!important;overflow:visible!important}
  .cv-conversations-panel{max-height:360px!important;border-right:0!important;border-bottom:1px solid var(--line,#e2e8ee)!important;overflow-y:auto!important}
  .cv-thread-panel{min-height:520px!important;grid-template-rows:auto minmax(300px,1fr) auto!important}
  .cv-thread{min-height:300px!important}
  .admin-layout{grid-template-columns:1fr!important}.admin-layout>aside{position:static!important;max-width:100%!important;width:100%!important;display:flex!important;gap:8px!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}.admin-layout>aside .button{flex:0 0 auto!important;width:auto!important;white-space:nowrap!important}
  .catalog-layout,.map-layout,.split,.article-layout{grid-template-columns:1fr!important}.filter-panel,.map-panel,.split>aside{position:static!important}
}

@media(max-width:760px){
  .container,.section.container,body[data-page="messages"] #main-content>.section.container{width:min(calc(100% - 24px),1200px)!important;max-width:1200px!important}
  .grid-2,.grid-3,.grid-4,.filters-grid,.form-grid{grid-template-columns:1fr!important}
  .section-heading,.cta-band,.result-toolbar{align-items:flex-start!important;flex-wrap:wrap!important}.section-heading>*{min-width:0!important;max-width:100%!important}
  .filter-actions,.form-actions{display:grid!important;grid-template-columns:1fr!important;width:100%!important}.filter-actions>*,.form-actions>*{width:100%!important;max-width:100%!important}
  .activity-item{grid-template-columns:1fr!important}.activity-item>*{min-width:0!important;max-width:100%!important}
  .cv-conversations-panel{max-height:320px!important}.cv-thread-panel{min-height:480px!important}.cv-thread-heading{padding-inline:12px!important}.cv-message-bubble,.message{max-width:92%!important}
  #admin-content .table-wrap{margin-inline:0!important}
}

@media(max-width:560px){
  .container,.section.container,body[data-page="messages"] #main-content>.section.container{width:min(calc(100% - 18px),1200px)!important}
  .cv-message-filter{grid-template-columns:1fr!important}.cv-conversations-panel{max-height:290px!important}.cv-thread-panel{min-height:450px!important}.cv-thread{padding:12px 10px!important}.cv-message-bubble,.message{max-width:96%!important}
  .cv-message-composer{grid-template-columns:1fr!important;padding:10px max(9px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))!important}.cv-send-button{width:100%!important;min-height:44px!important}
  .cv-thread-actions{width:100%!important}.cv-thread-actions .button,.cv-thread-business-link{width:100%!important;justify-content:center!important;text-align:center!important}
  .cv-favorite-actions{grid-template-columns:1fr!important}.cv-favorite-actions>*{width:100%!important}
  .toast,.cookie-banner{left:9px!important;right:9px!important;max-width:none!important;width:auto!important}
}

@media(max-width:360px){
  .container,.section.container,body[data-page="messages"] #main-content>.section.container{width:min(calc(100% - 14px),1200px)!important}
  .card,.notice,.filter-panel{padding:12px!important}.cv-message-tools{padding-inline:10px!important}.cv-messages-panel-head{padding-inline:10px!important}.cv-conversation-row{padding-inline:9px!important}.cv-thread-heading{padding-inline:9px!important}
}

@media(max-height:520px) and (orientation:landscape){
  .cv-messages-shell{height:auto!important;min-height:0!important}.cv-conversations-panel{max-height:220px!important}.cv-thread-panel{min-height:360px!important}.cv-thread{min-height:220px!important}
}

@media(pointer:coarse){a,button,.button,input,select,textarea,summary,[role="button"]{touch-action:manipulation}.cv-conversation-row,.cv-send-button,.cv-remove-favorite{min-height:44px!important}#profile-form input[name="marketingConsent"],#admin-content input[type="checkbox"],#admin-content input[type="radio"]{min-height:20px!important}}
