#sa-chat{--sa-accent:#225b51;--sa-header:#225b51;--sa-frame:#225b51;--sa-header-on:white;--sa-ink:#182d28;--sa-surface:white;--sa-on:white;position:fixed;right:18px;bottom:max(16px,env(safe-area-inset-bottom));z-index:99991;font:15px/1.55 system-ui,sans-serif;color:var(--sa-ink)}#sa-chat *{box-sizing:border-box}#sa-chat [hidden]{display:none!important}#sa-chat button{font:inherit;cursor:pointer;border:0;border-radius:12px;padding:8px 12px}#sa-chat .sa-launch,#sa-chat .sa-send{background:var(--sa-accent)!important;color:var(--sa-on)!important}#sa-chat .sa-panel .sa-head{background:var(--sa-header)!important;color:var(--sa-header-on)!important}#sa-chat .sa-head strong,#sa-chat .sa-head .sa-close{color:var(--sa-header-on)!important}#sa-chat .sa-launch{float:right;border-radius:30px;padding:12px 20px;box-shadow:0 4px 20px #142d242f}#sa-chat .sa-panel{position:absolute;right:0;bottom:58px;width:min(380px,calc(100vw - 28px));height:min(600px,calc(100vh - 108px));height:min(600px,calc(100dvh - 92px - max(16px,env(safe-area-inset-bottom))));background:var(--sa-surface);border:2px solid var(--sa-frame)!important;border-radius:18px;box-shadow:0 10px 40px #173c322b;display:flex;flex-direction:column;overflow:hidden}#sa-chat .sa-head{display:flex;justify-content:space-between;align-items:center;padding:8px 14px}#sa-chat .sa-close{color:inherit;background:transparent;font-size:22px}#sa-chat .sa-feed{flex:1;overflow:auto;padding:14px}#sa-chat .sa-feed p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 10px;padding:9px 12px;border-radius:13px}#sa-chat .sa-bot{border:1px solid #9ba99e66;margin-right:22px!important}#sa-chat .sa-user{background:var(--sa-accent);color:var(--sa-on);margin-left:26px!important}#sa-chat a{color:inherit;text-decoration:underline;font-size:13px;display:block;margin:3px 6px}#sa-chat .sa-links{display:flex;flex-wrap:wrap;padding:0 8px}#sa-chat form{display:flex;gap:5px;padding:8px;margin:0}#sa-chat textarea{font:inherit;flex:1;min-width:0;padding:7px;border:1px solid #aaa;border-radius:10px}#sa-chat .sa-status{padding:0 12px 5px}#sa-chat audio{max-width:100%}

#sa-chat .sa-avatar{width:36px;height:36px;object-fit:cover;border-radius:50%;margin-right:8px}#sa-chat .sa-head strong{flex:1}#sa-chat .sa-product{border:1px solid #9ba99e66;padding:8px;border-radius:10px;margin:6px 0}#sa-chat .sa-product button,#sa-chat .sa-question{background:var(--sa-accent);color:var(--sa-on);font-size:12px;margin:3px}#sa-chat button:disabled{opacity:.6;cursor:not-allowed}

#sa-chat .sa-invite{position:absolute;bottom:62px;right:0;width:min(330px,calc(100vw - 36px));border:2px solid var(--sa-frame);border-radius:16px 16px 4px 16px;background:var(--sa-surface)!important;color:var(--sa-ink)!important;box-shadow:0 8px 30px #0002;display:flex;align-items:flex-start;padding:0;isolation:isolate}
#sa-chat .sa-invite-open{display:flex;align-items:center;gap:11px;text-align:left;width:100%;padding:14px 34px 14px 12px;border-radius:14px;background:transparent!important;color:inherit!important;white-space:normal;line-height:1.45}
#sa-chat .sa-invite-face{display:grid;place-items:center;width:46px;height:46px;flex:0 0 46px;border-radius:50%;background:var(--sa-header);color:var(--sa-header-on);font-size:22px;overflow:hidden}
#sa-chat .sa-invite-face .sa-avatar{width:100%;height:100%;margin:0;object-fit:cover}
#sa-chat .sa-invite-copy{min-width:0;overflow-wrap:anywhere;display:block}#sa-chat .sa-invite-copy small{display:block;font-size:11px;opacity:.8;margin-bottom:3px}#sa-chat .sa-invite-question{font-size:14px;font-weight:600;display:block}
#sa-chat .sa-invite-dismiss{position:absolute;top:3px;right:4px;padding:4px 9px;line-height:1.2;background:transparent!important;color:inherit!important;font-size:21px}
#sa-chat .sa-invite-open:focus-visible,#sa-chat .sa-invite-dismiss:focus-visible{outline:2px solid var(--sa-accent);outline-offset:-3px}
@media(max-width:480px){#sa-chat{right:12px}#sa-chat .sa-panel{width:min(380px,calc(100vw - 24px))}#sa-chat .sa-invite{width:min(330px,calc(100vw - 24px))}}

/* V3.3 — the uploaded brand image is the launcher, not a text button. */
#sa-chat .sa-launch{position:relative;display:grid;place-items:center;width:68px;height:68px;padding:0;border-radius:50%;overflow:hidden;box-shadow:0 5px 22px #0003;transition:transform .18s ease;isolation:isolate}
#sa-chat .sa-launch.has-logo{background:transparent!important;box-shadow:none}
#sa-chat .sa-launch-logo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none}
#sa-chat .sa-launch.has-logo .sa-launch-logo{opacity:1}
#sa-chat .sa-launch.has-logo .sa-launch-icon{visibility:hidden}
#sa-chat .sa-launch:hover{transform:translateY(-2px)}
#sa-chat .sa-launch:focus-visible{outline:2px solid var(--sa-accent);outline-offset:4px}
#sa-chat .sa-panel{bottom:80px}
#sa-chat .sa-invite{right:84px;bottom:8px;width:max-content;max-width:min(290px,calc(100vw - 124px));border-radius:15px;filter:drop-shadow(0 5px 12px #0001)}
#sa-chat .sa-invite:after{content:'';position:absolute;right:-7px;bottom:17px;width:12px;height:12px;transform:rotate(-45deg);border-right:2px solid var(--sa-frame);border-bottom:2px solid var(--sa-frame);background:var(--sa-surface);pointer-events:none}
#sa-chat .sa-invite-open{padding:12px 32px 12px 14px;min-width:0}
#sa-chat .sa-invite-copy small{display:none}
#sa-chat .sa-invite-question{animation:sa-invite-in .24s ease both}
@keyframes sa-invite-in{from{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
@media(max-width:480px){#sa-chat .sa-launch{width:60px;height:60px}#sa-chat .sa-invite{right:74px;max-width:calc(100vw - 108px);width:max-content}#sa-chat .sa-panel{bottom:72px}}
@media(prefers-reduced-motion:reduce){#sa-chat .sa-launch{transition:none}#sa-chat .sa-invite-question{animation:none}}
#sa-chat .sa-launch.has-logo{border-radius:0;overflow:visible}

/* V3.4: predictable launcher footprint; invitation points directly at the logo. */
#sa-chat{width:68px;height:68px;overflow:visible!important;isolation:isolate}
#sa-chat .sa-launch{float:none;margin:0}
#sa-chat .sa-invite:not([hidden]){display:flex!important;visibility:visible!important;opacity:1!important;position:absolute;left:auto;right:82px;bottom:7px;width:245px;max-width:calc(100vw - 118px);z-index:2;overflow:visible}
#sa-chat .sa-invite-open{min-height:48px;max-width:100%;text-align:left}
#sa-chat .sa-invite-question{white-space:normal;overflow-wrap:anywhere}
#sa-chat .sa-products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0 0 14px}
#sa-chat .sa-products .sa-product{display:flex;flex-direction:column;min-width:0;border:1px solid color-mix(in srgb,var(--sa-frame) 22%,transparent);background:var(--sa-surface);border-radius:13px;padding:0;margin:0;overflow:hidden;text-decoration:none;color:var(--sa-ink);font-size:13px;box-shadow:0 3px 10px #0000000c;transition:transform .18s ease,box-shadow .18s ease}
#sa-chat .sa-products .sa-product:hover{transform:translateY(-2px);box-shadow:0 5px 15px #0002;text-decoration:none}
#sa-chat .sa-products .sa-product:focus-visible{outline:2px solid var(--sa-accent);outline-offset:-2px}
#sa-chat .sa-product-visual{position:relative;aspect-ratio:14/11;display:grid;place-items:center;background:#f8f9fa;overflow:hidden}
#sa-chat .sa-product-visual img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;padding:4px;max-width:100%}
#sa-chat .sa-product-visual img.sa-loaded{opacity:1}
#sa-chat .sa-product-placeholder{font-size:11px;color:#64748b;text-align:center;padding:8px}
#sa-chat .sa-product-info{padding:10px;display:flex;flex-direction:column;gap:6px;flex:1}
#sa-chat .sa-product-name{font-weight:600;line-height:1.4;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
#sa-chat .sa-product-price{font-size:16px;font-weight:750;margin-top:auto;color:var(--sa-ink)}
#sa-chat .sa-product-stock{font-size:10px;line-height:1.4;opacity:.8;display:flex;align-items:center;gap:5px}
#sa-chat .sa-product-stock:before{content:'';width:6px;height:6px;flex:none;border-radius:50%;background:#a3a3a3}
#sa-chat .sa-product-stock.is-available:before{background:#16a34a}
@media(max-width:480px){#sa-chat{width:60px;height:60px}#sa-chat .sa-invite:not([hidden]){right:74px;max-width:calc(100vw - 108px);bottom:4px}}
@media(max-width:340px){#sa-chat .sa-products{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){#sa-chat .sa-products .sa-product{transition:none}}

/* V3.5: foreground colors independently controlled by the company theme. */
#sa-chat .sa-bot,#sa-chat .sa-status{color:var(--sa-ink)!important}
#sa-chat .sa-user{color:var(--sa-on)!important}
#sa-chat .sa-mic{background:var(--sa-accent)!important;color:var(--sa-on)!important}
#sa-chat textarea{background:var(--sa-surface);color:var(--sa-ink)!important}
#sa-chat textarea::placeholder{color:var(--sa-ink);opacity:.65}

#sa-chat .sa-bot strong{font-weight:700;color:inherit}

#sa-chat[dir=rtl] .sa-feed,#sa-chat[dir=rtl] textarea,#sa-chat[dir=rtl] .sa-invite-copy{text-align:right;direction:rtl}
#sa-chat[dir=rtl] .sa-product-info{text-align:right}

#sa-chat .sa-privacy{font-size:11px;padding:0 13px 8px;color:var(--sa-ink);opacity:.8;flex-shrink:0}#sa-chat .sa-privacy summary{cursor:pointer}#sa-chat .sa-privacy div{padding:5px 0;max-height:90px;overflow:auto}#sa-chat .sa-checkout{display:flex;flex-direction:column;gap:9px;width:100%;max-width:100%}#sa-chat .sa-cart-line{display:flex;justify-content:space-between;gap:8px;padding:7px 0;border-bottom:1px solid #8884;overflow-wrap:anywhere}#sa-chat .sa-cart-line strong{white-space:nowrap}#sa-chat .sa-cart-total{font-weight:600;font-size:13px}#sa-chat .sa-checkout-link{display:block;text-align:center;border-radius:10px;padding:9px 12px;text-decoration:none;background:var(--sa-accent);color:var(--sa-on)!important;font-weight:600}#sa-chat .sa-checkout-link:focus-visible{outline:2px solid var(--sa-frame);outline-offset:2px}

/* V4.5 — header availability and native registration assistance. */
#sa-chat .sa-head-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;line-height:1.25}
#sa-chat .sa-head-copy strong{overflow-wrap:anywhere}
#sa-chat .sa-presence{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:500;color:var(--sa-header-on);opacity:.95}
#sa-chat .sa-presence i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#a3a3a3;flex:none}
#sa-chat .sa-presence[data-state=online] i{background:#ffdc35;box-shadow:0 0 7px #ffdc35b0;animation:sa-online-pulse 2.2s ease-out infinite}
@keyframes sa-online-pulse{0%,100%{box-shadow:0 0 0 0 #ffdc3566}50%{box-shadow:0 0 0 4px #ffdc3520}}
@media(prefers-reduced-motion:reduce){#sa-chat .sa-presence[data-state=online] i{animation:none}}
#sa-chat .sa-register-form{display:grid;grid-template-columns:1fr;gap:8px;padding:0;margin:0}
#sa-chat .sa-register-form label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--sa-ink)}
#sa-chat .sa-register-form input{font:inherit;width:100%;min-width:0;padding:7px 9px;border:1px solid #8887;border-radius:8px;background:var(--sa-surface);color:var(--sa-ink)}
#sa-chat .sa-register-form button{width:100%;margin:2px 0 0;font-size:13px}

/* V4.6: unified brand color and taller, viewport-safe chat. */
#sa-chat .sa-feed{min-height:0;scrollbar-width:thin;scrollbar-color:var(--sa-accent) transparent}#sa-chat .sa-feed::-webkit-scrollbar,#sa-chat .sa-privacy div::-webkit-scrollbar{width:7px;height:7px}#sa-chat .sa-feed::-webkit-scrollbar-thumb,#sa-chat .sa-privacy div::-webkit-scrollbar-thumb{background:var(--sa-accent);border-radius:8px}#sa-chat .sa-privacy div{scrollbar-width:thin;scrollbar-color:var(--sa-accent) transparent}#sa-chat .sa-head,#sa-chat form,#sa-chat .sa-status{flex-shrink:0}

/* V4.7: inline assistant typing indicator, using the current chat theme. */
#sa-chat .sa-status:empty{display:none}
#sa-chat .sa-feed .sa-typing{position:relative;display:flex;align-items:center;justify-content:center;width:max-content;max-width:100%;min-height:34px;margin:0 0 10px!important;padding:10px 13px;border:1px solid #9ba99e66;border-radius:13px;background:var(--sa-surface);color:var(--sa-ink)!important}
#sa-chat .sa-typing-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
#sa-chat .sa-typing-dots{display:flex;align-items:center;gap:5px;height:12px;direction:ltr}
#sa-chat .sa-typing-dots i{display:block;width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.55;animation:sa-typing-bounce 1.2s ease-in-out infinite}
#sa-chat .sa-typing-dots i:nth-child(2){animation-delay:.15s}
#sa-chat .sa-typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes sa-typing-bounce{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}
@media(prefers-reduced-motion:reduce){#sa-chat .sa-typing-dots i{animation:none;opacity:.8}}


/* V6.0.2: microphone, recording stop control and temporary voice waveform. */
#sa-chat .sa-mic{display:grid;place-items:center;align-self:stretch;flex:0 0 42px;width:42px;min-width:42px;padding:0;line-height:1}
#sa-chat .sa-mic svg{display:block;flex:none;pointer-events:none}
#sa-chat .sa-mic:focus-visible{outline:2px solid var(--sa-frame);outline-offset:2px}
#sa-chat .sa-mic[data-recording="1"]{background:#c62828!important;color:#fff!important}
#sa-chat .sa-feed .sa-voice-pending{display:flex;align-items:center;justify-content:center;width:max-content;max-width:calc(100% - 26px);margin-inline-start:auto!important;min-height:40px;padding:9px 14px}
#sa-chat .sa-voice-wave{display:flex;align-items:center;gap:3px;height:24px;direction:ltr}
#sa-chat .sa-voice-wave i{display:block;width:3px;height:14px;border-radius:3px;background:currentColor;transform-origin:center;animation:sa-voice-wait 1.1s ease-in-out infinite}
#sa-chat .sa-voice-wave i:nth-child(3n+1){height:10px;animation-delay:-.2s}
#sa-chat .sa-voice-wave i:nth-child(3n+2){height:20px;animation-delay:-.55s}
#sa-chat .sa-voice-wave i:nth-child(3n){height:16px;animation-delay:-.85s}
@keyframes sa-voice-wait{0%,100%{transform:scaleY(.55);opacity:.65}50%{transform:scaleY(1);opacity:1}}
@media(prefers-reduced-motion:reduce){#sa-chat .sa-voice-wave i{animation:none;opacity:1}}

/* Spatial open/close motion, anchored to the launcher. */
#sa-chat .sa-panel{transform-origin:calc(100% - 34px) 100%;backface-visibility:hidden;}
#sa-chat .sa-panel.sa-closing{pointer-events:none;}
@media(max-width:480px){#sa-chat .sa-panel{transform-origin:calc(100% - 30px) 100%;}}

#sa-chat .sa-ai-disclosure{display:block;font-size:10px;line-height:1.25;font-weight:500;color:var(--sa-header-on);overflow-wrap:anywhere;margin-top:2px}
