.bf-chat{--bc-bg:#fff;--bc-panel:#f7f8f9;--bc-text:#22282d;--bc-muted:#737c85;--bc-line:#e4e7eb;--bc-accent:var(--brand,#ab2939);font:14px/1.6 'Microsoft YaHei',Arial,sans-serif;color:var(--bc-text);position:relative;z-index:2147483000}
.bf-chat[data-mode=dark]{--bc-bg:#202326;--bc-panel:#2c3034;--bc-text:#f3f4f5;--bc-muted:#abb3bb;--bc-line:#40464c}
.bf-chat *{box-sizing:border-box}.bf-chat button,.bf-chat textarea{font:inherit}.bf-chat button{cursor:pointer;white-space:nowrap}.bf-chat button:focus-visible,.bf-chat textarea:focus-visible{outline:2px solid var(--bc-accent);outline-offset:3px}.bf-chat [hidden]{display:none!important}
.bf-chat-launch{position:fixed;bottom:28px;right:28px;display:flex;align-items:center;gap:9px;border:0;border-radius:28px;padding:13px 20px;background:var(--bc-accent);color:white;box-shadow:0 8px 28px #0003;font-weight:bold}
.bf-chat svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.bf-chat-window{position:fixed;right:24px;bottom:24px;width:420px;height:min(710px,calc(100dvh - 48px));display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--bc-line);border-radius:20px;background:var(--bc-bg);box-shadow:0 20px 80px #0003;transition:width .15s}
.bf-chat[data-expanded=true] .bf-chat-window{width:min(860px,calc(100vw - 48px))}.bf-chat-header{display:flex;align-items:center;gap:10px;padding:17px 18px;border-bottom:1px solid var(--bc-line)}.bf-chat-avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;color:#e86529;background:#fff0e5;font-size:22px;font-weight:700}.bf-chat-heading{flex:1;line-height:1.45}.bf-chat-heading strong{display:block;font-size:16px}.bf-chat-heading small{font-size:11px;color:var(--bc-muted)}.bf-chat-tool{display:grid;place-items:center;width:30px;height:32px;border:0;background:transparent;color:var(--bc-muted);border-radius:8px}.bf-chat-tool:hover{background:var(--bc-panel);color:var(--bc-text)}
.bf-chat-messages{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:28px 22px;scrollbar-width:thin}.bf-chat-welcome{padding:25px 0 18px}.bf-chat-welcome h2{margin:12px 0 8px;font-size:24px;font-weight:650;color:var(--bc-text)}.bf-chat-welcome p{margin:0;color:var(--bc-muted);font-size:13px}.bf-chat-suggestions{display:grid;gap:9px;margin-top:24px}.bf-chat-suggestions button{white-space:normal;display:flex;justify-content:space-between;text-align:left;padding:12px 14px;background:var(--bc-bg);color:var(--bc-text);border:1px solid var(--bc-line);border-radius:11px;font-size:13px}.bf-chat-suggestions button:hover{background:var(--bc-panel);border-color:var(--bc-muted)}
.bf-chat-message{margin:12px 0;max-width:90%;padding:12px 16px;border-radius:15px;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--bc-panel)}.bf-chat-message[data-role=user]{margin-left:auto;background:var(--bc-accent);color:#fff}.bf-chat-message[data-role=notice]{font-size:12px;color:var(--bc-muted);background:none;border-left:2px solid var(--bc-line);border-radius:0}
.bf-chat-compose{padding:12px 18px 15px;background:var(--bc-bg);border-top:1px solid var(--bc-line)}.bf-chat-inputbox{border:1px solid var(--bc-line);border-radius:16px;background:var(--bc-panel);padding:11px}.bf-chat-inputbox:focus-within{border-color:var(--bc-muted)}.bf-chat textarea{display:block;resize:none;width:100%;height:72px;max-height:150px;padding:2px 4px;border:0;outline:none!important;background:none;color:var(--bc-text);font-size:14px}.bf-chat textarea::placeholder{color:var(--bc-muted)}.bf-chat-inputtools{display:flex;align-items:center;justify-content:space-between;padding-top:6px}.bf-chat-context{font-size:11px;color:var(--bc-muted);max-width:80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-chat-send{display:grid;place-items:center;width:34px;height:34px;background:var(--bc-accent);color:white;border:0;border-radius:50%}.bf-chat-send:disabled{opacity:.35;cursor:default}.bf-chat-hint{display:block;text-align:center;margin-top:9px;color:var(--bc-muted);font-size:10px}.bf-chat-status{border:0;padding:0;background:none;color:var(--bc-muted);white-space:normal!important;text-align:left;font-size:12px;display:block;margin:8px 0 0}
@media(max-width:600px){.bf-chat-window,.bf-chat[data-expanded=true] .bf-chat-window{right:0;bottom:0;width:100%;height:90dvh;border-radius:20px 20px 0 0}.bf-chat-compose{padding-bottom:max(14px,env(safe-area-inset-bottom))}.bf-chat-launch{bottom:20px;right:16px}.bf-chat-expand{display:none}.bf-chat-messages{padding:18px}.bf-chat-welcome{padding-top:10px}}
@media(prefers-reduced-motion:reduce){.bf-chat-window{transition:none}}

/* Keep chat text independent from storefront heading/input colors. */
#bf-chat h2,#bf-chat textarea{color:var(--bc-text)}
