/* V4.10.0 · CHAT BUSINESS 375 · MOBILE EXPERIENCE */
#chatweb .bizChatPanel{padding:0;overflow:hidden}
#chatweb .bizChatGrid{grid-template-columns:minmax(300px,370px) minmax(500px,1fr);gap:0;min-height:690px}
#chatweb .bizChatSidebar{border:0;border-right:1px solid #dfe5e8;border-radius:0;background:#fff}
#chatweb .bizChatSidebarTop{padding:12px;background:#f7f9fa;position:sticky;top:0;z-index:3}
#chatweb .webWaChatList{max-height:640px}
#chatweb .bizChatItem{min-height:72px;padding:9px 12px;align-items:center}
#chatweb .bizChatItem.active{background:#f0f2f5}#chatweb .bizChatItem.unread{background:#f3fff6}
#chatweb .bizChatLead{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
#chatweb .bizAvatar{width:46px;height:46px;border-radius:50%;overflow:hidden;background:#d9e2e7;display:grid;place-items:center;flex:0 0 auto;color:#52616b;font-weight:800}
#chatweb .bizAvatar img{width:100%;height:100%;object-fit:cover;display:block}
#chatweb .bizHeaderAvatar{width:42px;height:42px}
#chatweb .bizChatItemMain{flex:1}#chatweb .bizChatItemMain b{font-size:14px}
#chatweb .bizConversation{position:relative;border:0;border-radius:0;background:#efeae2;min-height:690px}
#chatweb .bizConversation:before{content:"";position:absolute;inset:66px 0 78px;pointer-events:none;opacity:.22;background-image:radial-gradient(circle at 20px 20px,#94a3b8 1px,transparent 1.5px);background-size:38px 38px}
#chatweb .webWaHeader{position:relative;z-index:2;background:#f7f9fa;min-height:66px}
#chatweb .bizHeaderIdentity{display:flex;align-items:center;gap:10px;min-width:0}
#chatweb .bizHeaderIdentity>div:last-child{min-width:0}#chatweb .bizHeaderIdentity b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#chatweb .bizHeaderActions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
#chatweb .webWaMessages{position:relative;z-index:1;height:530px;padding:18px 6% 14px;scroll-behavior:smooth}
#chatweb .bizDay{display:flex;justify-content:center;margin:12px 0}
#chatweb .bizDay span{background:#fff9c8;border-radius:8px;padding:5px 10px;font-size:11px;color:#52616b;box-shadow:0 1px 2px #0001}
#chatweb .bizMsg{max-width:min(72%,620px);padding:7px 9px 5px;border-radius:8px;position:relative}
#chatweb .bizMsgRow.in .bizMsg{border-top-left-radius:2px}#chatweb .bizMsgRow.out .bizMsg{border-top-right-radius:2px}
#chatweb .bizMsgText{white-space:normal;overflow-wrap:anywhere}
#chatweb .bizMsgMeta{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-height:14px;margin-top:3px;color:#667781;font-size:10px}
#chatweb .bizAck{font-size:12px;font-weight:800;letter-spacing:-2px}#chatweb .bizAck.read{color:#53bdeb}#chatweb .bizAck.delivered,#chatweb .bizAck.sent{color:#8696a0}#chatweb .bizAck.err{color:#dc2626;letter-spacing:0}#chatweb .bizAck.pending{letter-spacing:0}
#chatweb .bizImageWrap{position:relative;margin:-3px -4px 5px;min-width:220px;max-width:360px;border-radius:7px;overflow:hidden;background:#e5e7eb}
#chatweb .bizInlineImage{display:block;width:100%;max-height:330px;object-fit:cover;cursor:pointer}
#chatweb .bizMediaSkeleton{height:150px;display:grid;place-items:center;font-size:12px;color:#64748b}
#chatweb .bizMediaOpen{position:absolute;right:6px;bottom:6px;border:0;border-radius:999px;background:rgba(0,0,0,.58);color:#fff;padding:5px 8px;font-size:10px;cursor:pointer}
#chatweb .bizMediaOpen.inline{position:static;background:transparent;color:#0f766e;padding:0;margin-left:5px}
#chatweb .bizAudioWrap{min-width:260px;padding:3px}#chatweb .bizPlayVoice{border:0;border-radius:999px;padding:9px 13px;background:#f0f2f5;cursor:pointer;font-weight:700}#chatweb .bizInlineAudio{width:280px;max-width:100%}
#chatweb .bizAttachment,#chatweb .bizVoicePanel{position:relative;z-index:3;margin:0;padding:8px 12px;background:#f7f9fa;border-top:1px solid #e3e8eb}
#chatweb .bizAttachment>img,#chatweb .bizAttachment>video{display:block;max-width:180px;max-height:140px;border-radius:9px;margin-bottom:6px}
#chatweb .bizAttachmentInfo{display:flex;align-items:center;gap:8px}#chatweb .bizAttachmentInfo span{display:grid;min-width:0}#chatweb .bizAttachmentInfo small{color:#64748b}#chatweb .bizAttachmentInfo button{margin-left:auto;border:0;background:#e2e8f0;width:28px;height:28px;border-radius:50%;cursor:pointer}
#chatweb .bizVoicePanel.recording{background:#fff3f3}#chatweb .bizVoiceStatus{display:flex;align-items:center;gap:7px;font-weight:800}#chatweb .bizVoiceStatus>span{width:10px;height:10px;border-radius:50%;background:#ef4444;animation:bizPulse 1s infinite}#chatweb .bizVoiceReady{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#chatweb .bizVoiceReady audio{min-width:260px;flex:1}
@keyframes bizPulse{50%{opacity:.3}}
#chatweb .bizComposer{position:relative;z-index:3;grid-template-columns:44px minmax(0,1fr) 44px 48px;gap:7px;align-items:end;padding:9px 11px;background:#f0f2f5}
#chatweb .bizComposer textarea{resize:none;min-height:42px;max-height:120px;border:0;border-radius:20px;padding:11px 14px;background:#fff;outline:none;box-shadow:none}
#chatweb .bizComposerIcon,#chatweb .bizSendBtn{width:42px;height:42px;border:0;border-radius:50%;display:grid;place-items:center;cursor:pointer;font-size:19px;background:transparent}
#chatweb .bizComposerIcon:hover{background:#e2e8f0}#chatweb .bizComposerIcon.recording{background:#fee2e2!important}
#chatweb .bizSendBtn{background:#00a884;color:#fff;font-size:21px}#chatweb .bizSendBtn:disabled,#chatweb .bizComposerIcon:disabled{opacity:.4;cursor:not-allowed}
#chatweb .bizComposerHint{position:relative;z-index:3;background:#f0f2f5;color:#71808a;text-align:center;font-size:9px;padding:0 8px 7px}
#chatweb .bizDropOverlay{display:none;position:absolute;inset:70px 14px 78px;z-index:20;border:2px dashed #00a884;border-radius:18px;background:rgba(240,253,250,.96);align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#0f766e;text-align:center}
#chatweb .bizDropOverlay div{font-size:42px}#chatweb .bizDropOverlay span{font-size:12px;color:#64748b}
#chatweb .bizConversation.dragging .bizDropOverlay{display:flex}
@media(max-width:980px){#chatweb .bizChatGrid{grid-template-columns:1fr}#chatweb .webWaChatList{max-height:280px}#chatweb .bizConversation{min-height:620px}#chatweb .webWaMessages{height:450px}}
@media(max-width:640px){#chatweb .bizChatPanel{margin-left:-8px;margin-right:-8px}#chatweb .bizChatGrid{min-height:0}#chatweb .bizConversation{min-height:600px}#chatweb .webWaMessages{height:440px;padding-left:3%;padding-right:3%}#chatweb .bizMsg{max-width:86%}#chatweb .bizHeaderActions button{font-size:10px;padding:6px 7px}#chatweb .bizComposer{grid-template-columns:40px minmax(0,1fr) 40px 44px;padding:7px}#chatweb .bizComposerHint{display:none}}


/* V4.10.1 · Scheda cliente + profilo Business reale */
.bizSideSection{border-top:1px solid #edf0f4;padding-top:12px;margin-top:12px}.bizSideSection>b{display:block;margin-bottom:9px}.bizKv{display:grid;grid-template-columns:82px 1fr;gap:7px 8px;font-size:12px}.bizKv span{color:#64748b}.bizKv strong{overflow-wrap:anywhere}.bizCustomerNote{font-size:12px;line-height:1.45;background:#f8fafc;border-radius:10px;padding:9px;min-height:42px}.bizSideActions{display:flex;gap:6px;flex-wrap:wrap}.bizSideActions button{padding:7px 9px;border:1px solid #dbe2ea;background:#fff;border-radius:9px;cursor:pointer;font-weight:700;font-size:11px}
.bizBusinessCard label{display:grid;gap:5px;margin:10px 0;font-size:12px;font-weight:800}.bizBusinessCard input,.bizBusinessCard textarea{width:100%;box-sizing:border-box;border:1px solid #d1d5db;border-radius:10px;padding:9px;font:inherit;font-weight:400}.bizBusinessSave{width:100%;margin-top:4px}.bizSideLoading{padding:20px;text-align:center;color:#64748b}
.bizBusinessButtons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:6px}.bizProfilePicBtn{display:flex;align-items:center;justify-content:center;border:1px solid #d1d5db;border-radius:10px;padding:9px;cursor:pointer;font-weight:800;font-size:12px}.bizProfilePicBtn input{display:none}@media(max-width:520px){.bizBusinessButtons{grid-template-columns:1fr}}

/* V4.10.2 · Nuovi numeri 375 */
.bizRegisterCard{margin:12px 0;padding:12px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc;display:grid;gap:6px}
.bizRegisterCard b{font-size:14px}.bizRegisterCard span{font-size:12px;color:#64748b}.bizRegisterCard button{justify-self:start}
.bizRegisteredBadge{margin:10px 0;padding:8px 10px;border-radius:10px;background:#ecfdf5;font-size:12px;font-weight:700}


/* WhatsApp Occhialiweb · QR connection */
.webWaConnectOverlay{position:fixed;inset:0;z-index:10050;background:rgba(8,16,31,.58);display:flex;align-items:center;justify-content:center;padding:24px}
.webWaConnectOverlay.hidden{display:none}
.webWaConnectPanel{width:min(560px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:20px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.28)}
.webWaConnectPanel header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.webWaConnectPanel header button{border:0;background:#eef2f6;border-radius:50%;width:36px;height:36px;font-size:22px;cursor:pointer}
.webWaConnectState{padding:14px;border-radius:14px;background:#f5f7fb;margin-bottom:14px}
.webWaConnected{font-weight:800;color:#087f5b;margin-bottom:5px}
.webWaWaiting{font-weight:800;color:#b45309;margin-bottom:5px}
.webWaQrWrap{text-align:center;padding:12px}
.webWaQrWrap img{width:min(380px,78vw);height:auto;border-radius:14px;background:#fff}
.webWaReady{padding:24px;border:1px dashed #ccd5e0;border-radius:14px;color:#566577}
.webWaConnectActions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:12px}
.webWaConnectActions .danger{background:#fee2e2;color:#991b1b;border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}

/* V4.11.3 · chat viewport fix */
#chatweb .bizConversation{height:clamp(600px,calc(100vh - 145px),720px);min-height:0!important;display:flex;flex-direction:column;overflow:hidden}
#chatweb .webWaHeader{flex:0 0 auto}
#chatweb .webWaMessages{height:auto!important;min-height:0!important;flex:1 1 auto;overflow-y:auto;box-sizing:border-box;padding-bottom:34px!important;scroll-padding-bottom:34px}
#chatweb .bizAttachment,#chatweb .bizVoicePanel,#chatweb .bizComposer,#chatweb .bizComposerHint{flex:0 0 auto}
@media(max-width:980px){#chatweb .bizConversation{height:620px}#chatweb .webWaMessages{height:auto!important}}
@media(max-width:640px){#chatweb .bizConversation{height:600px}#chatweb .webWaMessages{height:auto!important}}
/* V4.11.4 · direct photo click */
.bizImageClickable{cursor:pointer;outline:none}
.bizImageClickable .bizInlineImage{cursor:pointer;transition:transform .14s ease,box-shadow .14s ease}
.bizImageClickable:hover .bizInlineImage{transform:scale(1.012);box-shadow:0 8px 22px rgba(0,0,0,.18)}
.bizImageClickable:focus-visible{box-shadow:0 0 0 3px rgba(14,165,233,.35);border-radius:12px}

/* V4.11.6 · two-column chat + avatar customer/business popup */
#chatweb .bizChatGrid,#chat375 .bizChatGrid{grid-template-columns:minmax(300px,370px) minmax(0,1fr)!important}
#chatweb .bizAvatar[data-biz-avatar],#chat375 .bizAvatar[data-biz-avatar]{cursor:pointer}
.omCustOverlay,.omCustPhotoOverlay{position:fixed;inset:0;z-index:10060;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:24px}
.omCustCard{width:min(650px,92vw);max-height:86vh;overflow:auto;background:#fff;border-radius:20px;box-shadow:0 24px 80px rgba(0,0,0,.38);position:relative}
.omCustClose{position:absolute;right:14px;top:12px;width:38px;height:38px;border:0;border-radius:50%;background:#eef2f7;font-size:24px;cursor:pointer;z-index:3}
.omCustHead{display:flex;gap:18px;align-items:center;padding:24px 58px 18px 24px;border-bottom:1px solid #e5e7eb}
.omCustAvatar{width:88px;height:88px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#e2e8f0;font-size:28px;font-weight:800;flex:0 0 auto;cursor:pointer}
.omCustAvatar img{width:100%;height:100%;object-fit:cover}
.omCustHead h2{margin:0 0 5px;font-size:22px}.omCustHead .sub{color:#64748b;font-size:14px}
.omCustTabs{display:flex;gap:6px;padding:12px 18px 0;border-bottom:1px solid #e5e7eb}
.omCustTabs button{border:0;background:transparent;padding:11px 14px;font-weight:700;color:#64748b;cursor:pointer;border-bottom:3px solid transparent}
.omCustTabs button.active{color:#0f172a;border-bottom-color:#0ea5e9}
.omCustBody{padding:20px 24px 26px}.omCustPane.hidden{display:none!important}
.omCustGrid{display:grid;grid-template-columns:145px minmax(0,1fr);gap:10px 16px;align-items:start}
.omCustGrid span{color:#64748b}.omCustGrid strong{word-break:break-word}
.omCustSection{margin-top:20px}.omCustSection h3{font-size:15px;margin:0 0 8px}.omCustNote{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:12px;min-height:48px}
.omBizBadge{display:inline-flex;align-items:center;gap:6px;background:#dcfce7;color:#166534;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:800;margin-top:6px}
.omCustPhotoOverlay{z-index:10080;background:rgba(0,0,0,.9);padding:2vh 2vw;cursor:zoom-out;overflow:hidden}.omCustPhotoStage{width:min(78vw,900px);height:min(82vh,900px);display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;border-radius:18px}.omCustPhotoOverlay img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:18px;box-shadow:0 24px 90px rgba(0,0,0,.78);transform-origin:center center;user-select:none;-webkit-user-drag:none}.omCustZoomHint{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);background:rgba(0,0,0,.62);color:#fff;padding:7px 12px;border-radius:999px;font-size:12px;white-space:nowrap;pointer-events:none}
@media(max-width:760px){.omCustOverlay{padding:10px}.omCustCard{width:100%;max-height:94vh}.omCustGrid{grid-template-columns:110px minmax(0,1fr)}.omCustAvatar{width:72px;height:72px}}

/* V4.11.7 · 2-column chat layout, Business side panel retired */
#chatweb .bizSidePanel,#chat375 .bizSidePanel{display:none!important}
@media (min-width:981px){
  #chatweb .bizChatGrid,#chat375 .bizChatGrid{
    grid-template-columns:minmax(300px,370px) minmax(0,820px)!important;
    justify-content:start!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:none!important;
  }
  #chatweb .bizConversation,#chat375 .bizConversation{
    width:100%!important;
    max-width:820px!important;
    min-width:0!important;
  }
}
@media (max-width:980px){
  #chatweb .bizChatGrid,#chat375 .bizChatGrid{
    grid-template-columns:minmax(0,1fr)!important;
    justify-content:stretch!important;
    width:100%!important;
  }
  #chatweb .bizChatSidebar,#chat375 .bizChatSidebar,
  #chatweb .bizConversation,#chat375 .bizConversation{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}

/* V4.12 · larger avatars and clearer media */
@media(min-width:761px){
 #chatweb .bizAvatar{width:54px;height:54px}
 #chatweb .bizHeaderAvatar{width:60px;height:60px}
 #chatweb .bizImageWrap{min-width:260px;max-width:500px}
 #chatweb .bizInlineImage{max-height:460px;object-fit:contain;background:#111}
 .omCustAvatar{width:180px;height:180px;font-size:34px}
 .omCustPhotoStage{width:min(98vw,1700px);height:min(96vh,1300px)}
}

/* V4.12.1 speed/media UX */
#chatweb .bizAvatar{width:58px;height:58px}
#chatweb .bizHeaderAvatar{width:66px;height:66px}
#chatweb .bizInlineImage{max-height:560px;object-fit:contain;background:#111}
.omCustPhotoStage{width:min(98vw,1700px);height:min(96vh,1300px)}
.omCustPhotoOverlay img{max-width:98%;max-height:96%}

/* V4.12.2 · avatar/media leggibili */
#chatweb .bizAvatar{width:64px!important;height:64px!important;flex:0 0 64px!important}
#chatweb .bizHeaderAvatar{width:78px!important;height:78px!important;flex-basis:78px!important}
#chatweb .bizSideAvatar{width:92px!important;height:92px!important;flex:0 0 92px!important}
#chatweb .bizInlineImage{max-width:min(720px,82vw)!important;max-height:68vh!important;object-fit:contain!important;background:#0b0f14}
@media(max-width:700px){#chatweb .bizAvatar{width:52px!important;height:52px!important;flex-basis:52px!important}#chatweb .bizHeaderAvatar{width:62px!important;height:62px!important;flex-basis:62px!important}#chatweb .bizSideAvatar{width:76px!important;height:76px!important;flex-basis:76px!important}#chatweb .bizInlineImage{max-width:92vw!important;max-height:58vh!important}}


/* V4.12.3 large avatars crisp media */
#chatweb .bizAvatar{width:76px!important;height:76px!important;flex:0 0 76px!important}
#chatweb .bizAvatar img{width:100%!important;height:100%!important;object-fit:cover!important;image-rendering:auto!important}
#chatweb .bizHeaderAvatar{width:96px!important;height:96px!important;flex-basis:96px!important}
#chatweb .bizSideAvatar{width:112px!important;height:112px!important;flex:0 0 112px!important}
#chatweb .bizInlineImage{max-width:min(900px,88vw)!important;max-height:74vh!important;cursor:zoom-in!important;image-rendering:auto!important}
@media(max-width:700px){#chatweb .bizAvatar{width:60px!important;height:60px!important;flex-basis:60px!important}#chatweb .bizHeaderAvatar{width:76px!important;height:76px!important;flex-basis:76px!important}#chatweb .bizSideAvatar{width:92px!important;height:92px!important;flex-basis:92px!important}#chatweb .bizInlineImage{max-width:94vw!important;max-height:64vh!important}}

/* V4.12.4 OCCHIALIWEB LARGE SHARP CHAT MEDIA */
#chatweb .bizMsg:has(.bizImageWrap){max-width:min(84%,780px)!important}
#chatweb .bizImageWrap{min-width:300px!important;max-width:min(700px,78vw)!important}
#chatweb .bizInlineImage{width:100%!important;height:auto!important;max-height:72vh!important;object-fit:contain!important;image-rendering:auto!important}
@media(max-width:700px){#chatweb .bizMsg:has(.bizImageWrap){max-width:94%!important}#chatweb .bizImageWrap{min-width:0!important;max-width:90vw!important}#chatweb .bizInlineImage{max-width:100%!important;max-height:64vh!important}}


/* V4.12.6 COMPACT SHARP CHAT MEDIA */
#chatweb .bizMsg:has(.bizImageWrap){max-width:300px!important;padding:6px!important}
#chatweb .bizImageWrap{min-width:0!important;width:min(260px,68vw)!important;max-width:260px!important;max-height:270px!important;margin:-2px -2px 4px!important;background:#111!important}
#chatweb .bizInlineImage{display:block!important;width:100%!important;height:auto!important;max-width:260px!important;max-height:270px!important;object-fit:contain!important;background:#111!important;image-rendering:auto!important;cursor:zoom-in!important}
@media(max-width:700px){#chatweb .bizMsg:has(.bizImageWrap){max-width:76%!important}#chatweb .bizImageWrap{width:min(230px,70vw)!important;max-width:230px!important;max-height:250px!important}#chatweb .bizInlineImage{max-width:230px!important;max-height:250px!important}}
