:root{--cw-bg:#fafafa;--cw-panel:#fff;--cw-subtle:#f4f4f5;--cw-border:#e4e4e7;--cw-border-strong:#d4d4d8;--cw-text:#18181b;--cw-muted:#71717a;--cw-faint:#a1a1aa;--cw-dark:#09090b;--cw-success:#10b981;--cw-danger:#ef4444;--cw-shadow:0 24px 65px rgba(9,9,11,.22)}
html[data-theme="dark"]{--cw-bg:#09090b;--cw-panel:#18181b;--cw-subtle:#101014;--cw-border:#27272a;--cw-border-strong:#3f3f46;--cw-text:#f4f4f5;--cw-muted:#a1a1aa;--cw-faint:#71717a;--cw-shadow:0 28px 75px rgba(0,0,0,.5)}
.customer-widget{position:fixed;right:max(24px,env(safe-area-inset-right));bottom:max(24px,env(safe-area-inset-bottom));z-index:1900;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif}.customer-widget *{box-sizing:border-box}.customer-widget button,.customer-widget textarea{font:inherit}.customer-widget button:not(:disabled){cursor:pointer}.customer-widget button:focus-visible,.customer-widget textarea:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.customer-launcher{position:relative;width:58px;height:58px;padding:0;display:grid;place-items:center;color:#fff;background:#09090b;border:1px solid #27272a;border-radius:50%;box-shadow:0 12px 30px rgba(9,9,11,.3);transition:box-shadow .2s ease,opacity .2s ease,transform .2s ease}.customer-launcher:hover{box-shadow:0 16px 38px rgba(9,9,11,.38)}.customer-launcher.is-hidden{pointer-events:none;opacity:0;transform:scale(.7)}html[data-theme="dark"] .customer-launcher{color:#09090b;background:#fafafa;border-color:#fff}.customer-launcher svg{width:25px;height:25px}.customer-unread{position:absolute;right:-2px;top:-2px;min-width:19px;height:19px;padding:0 5px;display:grid;place-items:center;color:#fff;background:var(--cw-danger);border:2px solid var(--cw-panel);border-radius:999px;font-size:9px;font-weight:800}.customer-bubble{position:absolute;right:72px;bottom:7px;min-height:43px;width:max-content;max-width:min(255px,calc(100vw - 115px));padding:10px 10px 10px 14px;display:flex;align-items:center;gap:8px;color:var(--cw-text);background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:13px 13px 3px 13px;box-shadow:0 10px 30px rgba(9,9,11,.12);font-size:11px;font-weight:600;text-align:left}.customer-bubble svg{width:15px;height:15px;color:var(--cw-muted)}
.customer-panel{position:absolute;right:0;bottom:0;width:390px;height:min(610px,calc(100dvh - 48px));overflow:hidden;display:flex;flex-direction:column;color:var(--cw-text);background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:18px;box-shadow:var(--cw-shadow);opacity:0;transform:translateY(16px) scale(.98);transform-origin:bottom right;transition:opacity .2s ease,transform .2s ease}.customer-panel.is-open{opacity:1;transform:translateY(0) scale(1)}.customer-panel-header{min-height:70px;padding:13px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;color:#fff;background:#09090b;border-bottom:1px solid #27272a}.customer-agent-profile{min-width:0;display:flex;align-items:center;gap:10px}.customer-agent-avatar{position:relative;width:39px;height:39px;flex:0 0 auto;display:grid;place-items:center;overflow:visible;background:#fff;border:1px solid #3f3f46;border-radius:50%}.customer-agent-avatar>img{width:100%;height:100%;display:block;object-fit:cover;border-radius:50%}.customer-agent-avatar>span{position:absolute;right:0;bottom:0;width:10px;height:10px;background:var(--cw-success);border:2px solid #09090b;border-radius:50%}.customer-agent-profile>div:last-child{min-width:0;display:flex;flex-direction:column;gap:3px}.customer-agent-profile strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.customer-agent-profile span{color:#a1a1aa;font-size:9px}.customer-panel-close{width:38px;height:38px;padding:0;display:grid;place-items:center;color:#a1a1aa;background:transparent;border:0;border-radius:9px}.customer-panel-close:hover{color:#fff;background:#27272a}.customer-panel-close svg{width:19px;height:19px}
.customer-chat-body{min-height:0;flex:1;overflow-y:auto;padding:12px 14px 16px;background:color-mix(in srgb,var(--cw-bg) 55%,var(--cw-panel));scrollbar-gutter:stable}.customer-chat-body::-webkit-scrollbar{width:4px}.customer-chat-body::-webkit-scrollbar-thumb{background:var(--cw-border-strong);border-radius:99px}.customer-security-note{margin:0 auto 13px;width:max-content;max-width:100%;padding:5px 8px;display:flex;align-items:center;justify-content:center;gap:5px;color:var(--cw-faint);background:var(--cw-subtle);border-radius:999px;font-size:8px;text-align:center}.customer-security-note svg{width:11px;height:11px;flex:0 0 auto}.customer-messages{display:flex;flex-direction:column;gap:12px}.customer-message{display:flex;align-items:flex-start;gap:8px;max-width:87%}.customer-message-user{align-self:flex-end;justify-content:flex-end}.customer-message-system{align-self:center;max-width:94%}.customer-message-avatar{width:27px;height:27px;flex:0 0 auto;display:grid;place-items:center;overflow:hidden;color:#fff;background:#fff;border:1px solid var(--cw-border);border-radius:50%;font-size:7px;font-weight:800}.customer-message-avatar>img{width:100%;height:100%;display:block;object-fit:cover}.customer-message-user .customer-message-avatar{display:none}.customer-message-content{min-width:0}.customer-message-body{padding:10px 11px;color:var(--cw-text);background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:0 14px 14px 14px;box-shadow:0 3px 10px rgba(9,9,11,.04);font-size:10px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}.customer-message-user .customer-message-body{color:#fff;background:#09090b;border-color:#09090b;border-radius:14px 0 14px 14px}.customer-message-system .customer-message-avatar{display:none}.customer-message-system .customer-message-body{padding:6px 9px;color:#92400e;background:#fffbeb;border-color:#fde68a;border-radius:999px;box-shadow:none;font-size:8px;text-align:center}.customer-message small{display:block;margin-top:4px;color:var(--cw-faint);font-size:8px}.customer-message-user small{text-align:right}.customer-message-faqs{width:100%;max-width:100%}.customer-message-faqs .customer-message-content{flex:1}.customer-faqs{margin:0;display:grid;gap:6px}.customer-faqs-title{margin-bottom:1px;color:var(--cw-muted);font-size:9px;font-weight:700}.customer-faqs button{position:relative;width:100%;min-height:38px;padding:8px 31px 8px 10px;color:var(--cw-muted);background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:10px;font-size:9px;text-align:left;transition:color .18s ease,border-color .18s ease,background .18s ease}.customer-faqs button:hover{color:var(--cw-text);background:var(--cw-subtle);border-color:var(--cw-border-strong)}.customer-faqs button svg{position:absolute;right:10px;top:50%;width:14px;height:14px;transform:translateY(-50%)}
.customer-new-message{position:absolute;left:50%;bottom:126px;transform:translateX(-50%);padding:7px 11px;color:#fff;background:#18181b;border:0;border-radius:999px;box-shadow:0 8px 20px rgba(9,9,11,.2);font-size:9px;z-index:3}.customer-compose{padding:10px 12px 12px;flex:0 0 auto;background:var(--cw-panel);border-top:1px solid var(--cw-border)}.customer-tools{padding:0 2px 8px;display:flex;align-items:center;justify-content:space-between}.customer-tools>button{min-height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:5px;color:var(--cw-text);background:transparent;border:0;border-bottom:2px solid var(--cw-dark);font-size:9px;font-weight:700}.customer-tools>button:disabled{cursor:not-allowed;color:var(--cw-faint);border-bottom-color:var(--cw-border)}.customer-tools>button svg{width:13px;height:13px}.customer-tools>span{color:var(--cw-faint);font-size:8px}.customer-input-shell{padding:6px;background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:11px}.customer-input-shell:focus-within{border-color:var(--cw-border-strong)}.customer-input-shell textarea{width:100%;min-height:43px;max-height:90px;padding:4px 5px;resize:none;color:var(--cw-text);background:transparent;border:0;outline:0;font-size:10px;line-height:1.55}.customer-input-shell textarea::placeholder{color:var(--cw-faint)}.customer-input-footer{padding:6px 1px 0;display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--cw-border)}.customer-input-footer>span{color:var(--cw-faint);font-size:7px}.customer-input-footer button{min-height:31px;padding:0 10px;display:inline-flex;align-items:center;gap:5px;color:#fff;background:#09090b;border:1px solid #09090b;border-radius:7px;font-size:9px;font-weight:700}.customer-input-footer button:hover:not(:disabled){background:#27272a}.customer-input-footer button:disabled{cursor:not-allowed;opacity:.45}.customer-input-footer button svg{width:12px;height:12px}
.d-none{display:none!important}@media(max-width:600px){.customer-widget{inset:0;z-index:2500}.customer-launcher{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom))}.customer-bubble{position:fixed;right:84px;bottom:max(22px,env(safe-area-inset-bottom))}.customer-panel{position:fixed;inset:0;width:100vw;height:100dvh;border:0;border-radius:0;transform:translateY(20px);transform-origin:center}.customer-panel.is-open{transform:translateY(0)}.customer-panel-header{min-height:calc(64px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 13px 0}.customer-panel-close{min-width:44px;min-height:44px}.customer-panel-close svg{transform:none}.customer-chat-body{padding:12px 12px 16px}.customer-message{max-width:91%}.customer-message-faqs{max-width:100%}.customer-compose{padding:9px 10px max(9px,env(safe-area-inset-bottom))}.customer-input-footer button{min-width:70px;min-height:38px}.customer-tools>button{min-height:38px}.customer-new-message{bottom:140px}}
@media(prefers-reduced-motion:reduce){.customer-launcher,.customer-panel{transition:none!important}}
@media(max-width:600px){.customer-widget{inset:auto;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom))}}

/* Readability and closer alignment with the supplied widget reference */
.customer-launcher:hover{transform:scale(1.04)}.customer-launcher.is-hidden{transform:scale(.7)}.customer-bubble{font-size:13px}.customer-panel{width:380px;height:min(580px,calc(100dvh - 48px))}.customer-agent-profile strong{font-size:14px}.customer-agent-profile span{font-size:11px}.customer-security-note{font-size:10px}.customer-message-body{font-size:13px}.customer-message small{font-size:10px}.customer-faqs-title{font-size:11px;line-height:1.55}.customer-faqs button{min-height:42px;font-size:12px}.customer-tools>button{font-size:12px}.customer-tools>span{font-size:10px}.customer-input-shell textarea{font-size:13px}.customer-input-footer>span{font-size:9px}.customer-input-footer button{font-size:11px}.customer-new-message{font-size:11px}
@media(max-width:600px){.customer-bubble{font-size:13px}.customer-agent-profile strong{font-size:16px}.customer-agent-profile span{font-size:12px}.customer-security-note{font-size:11px}.customer-message-body{font-size:15px}.customer-message small{font-size:11px}.customer-faqs-title{font-size:13px}.customer-faqs button{min-height:48px;font-size:14px}.customer-tools>button{font-size:14px}.customer-tools>span{font-size:12px}.customer-input-shell textarea{font-size:16px}.customer-input-footer>span{font-size:10px}.customer-input-footer button{font-size:13px}.customer-new-message{font-size:12px}}

/* Strict monochrome focus and status colors */
.customer-widget button:focus-visible,.customer-widget textarea:focus-visible{outline-color:#18181b}html[data-theme="dark"] .customer-widget button:focus-visible,html[data-theme="dark"] .customer-widget textarea:focus-visible{outline-color:#fafafa}

/* Isolate the widget from the application's blue global dark-mode button rules. */
.customer-widget button{background-color:transparent!important;box-shadow:none!important;transform:none}.customer-widget button:hover{box-shadow:none!important}.customer-widget textarea:focus{border-color:var(--cw-border-strong)!important;box-shadow:none!important}.customer-widget .customer-launcher{color:#fff!important;background-color:#09090b!important;border-color:#27272a!important}.customer-widget .customer-launcher:hover{background-color:#18181b!important;transform:scale(1.04)}.customer-widget .customer-launcher.is-hidden{transform:scale(.7)}.customer-widget .customer-bubble{color:var(--cw-text)!important;background-color:var(--cw-panel)!important}.customer-widget .customer-panel-close{color:#a1a1aa!important;background-color:transparent!important}.customer-widget .customer-panel-close:hover{color:#fff!important;background-color:#27272a!important}.customer-widget .customer-faqs button{color:var(--cw-muted)!important;background-color:var(--cw-panel)!important;border-color:var(--cw-border)!important}.customer-widget .customer-faqs button:hover{color:var(--cw-text)!important;background-color:var(--cw-subtle)!important;border-color:var(--cw-border-strong)!important}.customer-widget #customerManualButton{color:var(--cw-text)!important;background-color:transparent!important}.customer-widget #customerSendButton{color:#fff!important;background-color:#09090b!important;border-color:#09090b!important}.customer-widget #customerSendButton:hover:not(:disabled){color:#fff!important;background-color:#27272a!important}.customer-widget #customerSendButton:disabled{color:var(--cw-faint)!important;background-color:var(--cw-subtle)!important;border-color:var(--cw-border)!important}html[data-theme="dark"] .customer-widget .customer-launcher{color:#09090b!important;background-color:#fafafa!important;border-color:#fafafa!important}html[data-theme="dark"] .customer-widget .customer-launcher:hover{background-color:#d4d4d8!important}html[data-theme="dark"] .customer-widget #customerSendButton{color:#09090b!important;background-color:#fafafa!important;border-color:#fafafa!important}html[data-theme="dark"] .customer-widget #customerSendButton:hover:not(:disabled){color:#09090b!important;background-color:#d4d4d8!important}

.customer-manual-confirmation{width:100%;max-width:100%}.customer-manual-confirmation .customer-message-content{min-width:0;flex:1}.customer-manual-confirmation-body strong{display:block;font-weight:800}.customer-manual-confirmation-body p{margin:10px 0 0;padding-top:10px;border-top:1px solid var(--cw-border);color:var(--cw-muted);font-weight:600}.customer-manual-confirmation-actions{margin-top:10px;display:flex;gap:8px}.customer-widget .customer-manual-confirmation-actions button{min-height:34px;padding:0 16px;border:1px solid var(--cw-border-strong)!important;border-radius:8px;font-size:12px;font-weight:700}.customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-apply{color:#fff!important;background:#09090b!important;border-color:#09090b!important}.customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-apply:hover:not(:disabled){background:#27272a!important}.customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-cancel{color:var(--cw-text)!important;background:var(--cw-panel)!important}.customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-cancel:hover:not(:disabled){background:var(--cw-subtle)!important}.customer-widget .customer-manual-confirmation-actions button:disabled{cursor:not-allowed;opacity:.55}.customer-manual-confirmation-result{color:var(--cw-muted);font-size:11px;font-weight:700}html[data-theme="dark"] .customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-apply{color:#09090b!important;background:#fafafa!important;border-color:#fafafa!important}html[data-theme="dark"] .customer-widget .customer-manual-confirmation-actions .customer-manual-confirmation-apply:hover:not(:disabled){background:#d4d4d8!important}

/* Final mobile override: keep the customer chat as a true full-screen view. */
@media(max-width:600px){.customer-panel{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0}.customer-panel-header{flex:0 0 auto}.customer-chat-body{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain}.customer-compose{position:relative;z-index:4;flex:0 0 auto;padding-bottom:max(9px,env(safe-area-inset-bottom));box-shadow:0 -1px 0 var(--cw-border),0 -10px 24px rgba(9,9,11,.05)}}
