/* One conversation entry, shared by marketing, opening, workspace and partner pages. */
html body :is(.public-ai[data-web-ai-launcher],.workspace-ai-chat[data-site-chat]){position:fixed!important;inset:auto 20px calc(20px + env(safe-area-inset-bottom)) auto!important;width:52px!important;max-width:none!important;min-height:0!important;height:52px!important;display:block!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;transform:none!important;z-index:110}
html body .site-chat-dot{position:relative!important;inset:auto!important;width:52px;height:52px;min-height:52px;padding:0;border:1px solid #38383A;border-radius:50%;display:grid!important;place-items:center;background:#111!important;color:#fff!important;box-shadow:0 6px 20px rgba(0,0,0,.16);cursor:pointer;transition:transform 150ms,opacity 150ms}
.site-chat-dot svg{width:24px;height:24px;pointer-events:none}.site-chat-dot:hover{transform:translateY(-2px)}.site-chat-dot:active{transform:scale(.96)}.site-chat-dot:focus-visible{outline:2px solid var(--bb-theme-accent,#b8ff3d);outline-offset:4px}
html body .public-ai .public-ai-panel,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel{position:absolute!important;inset:auto 0 68px auto!important;transform:none!important;width:min(420px,calc(100vw - 32px))!important;height:min(640px,calc(var(--public-ai-visible-height,100dvh) - 112px))!important;min-height:0!important;max-height:none!important;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--bb-theme-line,#e5e5e7)!important;border-radius:20px;background:var(--bb-theme-surface,#fff)!important;color:var(--bb-theme-ink,#111)!important;box-shadow:0 12px 40px rgba(0,0,0,.16);animation:site-chat-enter 400ms cubic-bezier(.2,.7,.2,1) both}
html body .public-ai .public-ai-panel[hidden]{display:none!important}
html body .public-ai .public-ai-head,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel-head{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;padding:12px;gap:8px;border-bottom:1px solid var(--bb-theme-line,#e5e5e7);color:inherit;background:var(--bb-theme-surface,#fff)}
.site-chat-tabs{display:flex;gap:4px}.site-chat-tabs button{min-height:44px;padding:0 12px;border:0;border-radius:24px;background:transparent;color:inherit;font:inherit;font-size:14px;cursor:pointer;transition:transform 250ms,opacity 150ms}.site-chat-tabs button[aria-pressed=true]{background:#111;color:#fff}.site-chat-tabs button:disabled{opacity:.55;cursor:wait}
.public-ai-head>[data-public-ai-close]{width:44px;height:44px;flex:0 0 44px;border:0;border-radius:50%;background:var(--bb-theme-inset,#f5f5f7);color:inherit;font-size:22px}
html body .public-ai .public-ai-welcome{flex:1;overflow:auto;padding:20px;text-align:center}.public-ai-welcome img{width:52px;height:52px;object-fit:contain}.public-ai-welcome h2{font-size:20px}.public-ai-welcome p{font-size:14px;line-height:1.6;color:var(--bb-theme-secondary,#666)}.public-ai-prompts{display:grid;gap:8px}.public-ai-prompts button{min-height:44px;border:1px solid var(--bb-theme-line,#e5e5e7);border-radius:12px;background:var(--bb-theme-inset,#f5f5f7);color:inherit;padding:10px;font:inherit;font-size:14px}
html body .public-ai [data-public-ai-frame],html[data-site-workspace] body .workspace-ai-chat[data-site-chat] [data-global-ai-frame]{width:100%;min-height:0;flex:1;border:0;background:var(--bb-theme-surface,#fff)}
html body .public-ai .public-ai-status{position:static!important;flex:0 0 auto;padding:6px 12px;margin:0;font-size:14px;line-height:1.6;background:var(--bb-theme-inset,#f5f5f7);color:var(--bb-theme-secondary,#666)}
html body .public-ai .public-ai-bar{position:static!important;inset:auto!important;transform:none!important;display:flex;width:100%!important;max-width:none!important;min-height:60px;margin:0!important;border:0!important;border-top:1px solid var(--bb-theme-line,#e5e5e7)!important;border-radius:0!important;padding:8px 12px!important;gap:8px;background:var(--bb-theme-surface,#fff)!important;box-shadow:none!important}
html body .public-ai .public-ai-bar[hidden]{display:none!important}.public-ai-orb{display:none!important}
html body .public-ai .public-ai-bar input{flex:1;min-width:0;height:44px;border:0;border-radius:12px;padding:0 12px;background:var(--bb-theme-inset,#f5f5f7)!important;color:var(--bb-theme-ink,#111);font:inherit;font-size:14px}
html body .public-ai .public-ai-send{width:44px;height:44px;flex:0 0 44px;border:0;border-radius:50%;background:#111!important;color:#fff!important;font-size:20px}
html body .public-ai :is(.arena-ai-hint,.web-ai-launch){display:none!important}
@keyframes site-chat-enter{from{translate:0 16px;opacity:0}to{translate:0 0;opacity:1}}
@media(max-width:760px){html body :is(.public-ai[data-web-ai-launcher],.workspace-ai-chat[data-site-chat]){right:16px!important;bottom:calc(16px + env(safe-area-inset-bottom) + var(--site-chat-bottom-clearance,0px))!important}html body .public-ai .public-ai-panel,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel{height:min(640px,calc(var(--public-ai-visible-height,100dvh) - 112px - var(--site-chat-bottom-clearance,0px)))!important}body:has(.tabbar){--site-chat-bottom-clearance:64px}}
@media(prefers-reduced-motion:reduce){html body .site-chat-dot,html body .public-ai-panel,html body .workspace-ai-panel,.site-chat-tabs button{animation:none!important;transition:none!important}}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat]:not(.expanded) .workspace-ai-panel,html[data-site-workspace] body .workspace-ai-chat[data-site-chat]:not(.voice-picker-open) .workspace-ai-voice-picker{display:none!important}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-bar{position:static!important;inset:auto!important;transform:none!important;display:flex;flex:0 0 auto;width:100%!important;max-width:none!important;border-radius:0!important;padding:8px 12px!important;gap:8px;min-height:60px!important;background:var(--bb-theme-surface,#fff)!important;border-top:1px solid var(--bb-theme-line,#e5e5e7)}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-mark-wrap{position:static!important;width:44px;height:44px;flex:0 0 44px}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-orb-surface,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-orb-core{position:static!important;width:44px!important;height:44px!important;transform:none!important;display:block!important;background:none!important;border:0!important;box-shadow:none!important}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-mark{width:44px!important;height:44px!important;position:static!important;transform:none!important;border-radius:50%;background:#111;color:#fff}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-mark img{width:32px;height:32px}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-orb-status{display:none!important}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel-head .workspace-ai-voice-choice{position:static!important;display:block!important;min-height:44px;border:0;border-radius:12px;padding:0 8px;background:var(--bb-theme-inset,#f5f5f7);color:inherit;font:inherit;font-size:12px}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-voice-picker{position:absolute!important;inset:auto 0 68px auto!important;width:min(340px,calc(100vw - 32px))!important;z-index:2;background:var(--bb-theme-surface,#fff);color:var(--bb-theme-ink,#111);border:1px solid var(--bb-theme-line,#e5e5e7);border-radius:16px;padding:16px}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-copy{flex:1;min-width:0}.workspace-ai-chat[data-site-chat] .workspace-ai-composer{display:flex;gap:6px;align-items:center;margin:0}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-composer textarea{min-width:0;flex:1;max-height:100px;min-height:44px;border-radius:12px;background:var(--bb-theme-inset,#f5f5f7);color:var(--bb-theme-ink,#111);padding:10px;font:inherit;font-size:14px}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] :is(.workspace-ai-voice,.workspace-ai-send){flex:0 0 44px;width:44px;height:44px;padding:10px;border-radius:50%;background:#111;color:#fff}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-status{position:static!important;flex:0 0 auto;font-size:14px;line-height:1.6;padding:6px 12px;margin:0;color:var(--bb-theme-secondary,#666);background:var(--bb-theme-inset,#f5f5f7)}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] :is(.workspace-ai-bar,[data-global-ai-frame])[hidden]{display:none!important}html[data-site-workspace] body .workspace-ai-chat[data-site-chat] [data-workspace-chat-access]{flex:1;overflow:auto;padding:24px;font-size:14px;line-height:1.6}html[data-site-workspace] body .workspace-ai-chat[data-site-chat] [data-workspace-chat-access][hidden]{display:none!important}html body .public-ai-welcome [hidden]{display:none!important}
/* Native workbench launcher was clipped to its old pill; the panel extends above it. */
html[data-site-workspace] body .workspace-ai-chat[data-site-chat]{overflow:visible!important}
html[data-site-workspace] .workspace-ai-panel-head>[data-ai-close]{min-width:44px;min-height:44px;border:0;border-radius:50%;background:var(--bb-theme-inset);color:var(--bb-theme-ink);font:inherit;cursor:pointer}

/* The native workspace stylesheet loads last; keep the expanded surface opaque. */
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel{display:flex!important;background:var(--bb-theme-surface)!important;color:var(--bb-theme-ink)!important;z-index:1}
html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel-head{background:var(--bb-theme-surface)!important;color:var(--bb-theme-ink)!important}

/* UI_SPEC 3.6: stable public panel; keep native iframe and workspace hooks. */
html body :is(.public-ai[data-web-ai-launcher],.workspace-ai-chat[data-site-chat]){right:24px!important;bottom:24px!important;view-transition-name:site-chat-launcher}
html body .site-chat-dot{background:var(--bb-theme-accent,#111)!important;color:var(--bb-theme-accent-ink,#fff)!important;transition:transform 150ms,opacity 150ms}
html body .site-chat-dot:hover{transform:none}
html body .site-chat-dot:active{transform:scale(.94)}
.site-chat-dot>svg,.site-chat-close-icon{grid-area:1/1;transition:opacity 250ms,transform 250ms}
.site-chat-close-icon{display:grid;place-items:center;opacity:0;transform:rotate(-90deg)}
.site-chat-dot[aria-expanded=true]>svg{opacity:0;transform:rotate(90deg)}
.site-chat-dot[aria-expanded=true] .site-chat-close-icon{opacity:1;transform:rotate(0)}
html body .public-ai .public-ai-panel,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel{inset:auto 0 64px auto!important;margin:0!important;width:min(400px,calc(100vw - 48px))!important;height:min(620px,calc(var(--public-ai-visible-height,100dvh) - 112px))!important;max-height:max(0px,calc(var(--public-ai-visible-height,100dvh) - 112px))!important;min-height:0!important;border-radius:28px;box-shadow:0 24px 64px rgba(0,0,0,.18);transform-origin:calc(100% - 26px) calc(100% + 38px);animation:site-chat-grow 280ms cubic-bezier(.16,1,.3,1) both;overflow:hidden;box-sizing:border-box}
html body .public-ai[data-chat-closing] .public-ai-panel{animation:site-chat-shrink 200ms ease-in both;pointer-events:none}
html body .public-ai .public-ai-head,html[data-site-workspace] body .workspace-ai-chat[data-site-chat] .workspace-ai-panel-head{height:64px;min-height:64px;flex:0 0 64px;box-sizing:border-box;padding:10px 12px;overflow:hidden}
.site-chat-tabs{min-width:0;overflow:hidden;gap:4px;align-items:center}
.site-chat-tabs button{height:36px;min-height:36px;min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:0 12px}
.site-chat-tabs button[aria-pressed=true]{background:var(--bb-theme-inset,#f5f5f7);color:var(--bb-theme-ink,#111);font-weight:600}
.public-ai-head>[data-public-ai-close]{cursor:pointer}.public-ai-head>[data-public-ai-close] svg{width:22px;height:22px}
html body .public-ai .public-ai-welcome{display:flex;flex-direction:column;align-items:center;min-height:0;overflow-x:hidden;overflow-y:auto;padding:20px 16px;box-sizing:border-box}
.public-ai-welcome h2,.public-ai-welcome p{overflow-wrap:anywhere}
.public-ai-prompts{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px;margin-top:auto;padding-top:16px;max-width:100%}
.public-ai-prompts button{min-height:36px;border-radius:999px;padding:7px 12px;background:transparent;text-align:left;max-width:100%;overflow-wrap:anywhere;font-size:13px}
html body .public-ai .public-ai-guest{flex:0 0 auto;display:flex;gap:8px;align-items:center;justify-content:space-between;padding:6px 12px;min-height:32px;font-size:12px;background:var(--bb-theme-inset,#f5f5f7);color:var(--bb-theme-secondary,#666);box-sizing:border-box}
html body .public-ai .public-ai-guest[hidden]{display:none!important}
.public-ai-guest span{min-width:0;overflow-wrap:anywhere}.public-ai-guest button{flex:0 0 auto;border:0;background:none;color:var(--bb-theme-ink,#111);text-decoration:underline;text-underline-offset:3px;font:inherit;padding:8px 0;cursor:pointer}
html body .public-ai .public-ai-bar{height:72px;min-height:72px;flex:0 0 72px;box-sizing:border-box;align-items:center;padding:12px!important}
html body .public-ai .public-ai-bar input{height:48px;border-radius:999px;font-size:16px}
html body .public-ai .public-ai-send{width:48px;height:48px;flex-basis:48px;background:var(--bb-theme-accent,#111)!important;color:var(--bb-theme-accent-ink,#fff)!important;cursor:pointer}
.public-ai-send:disabled{opacity:.5;cursor:wait}
html body:has(.public-ai[data-web-ai-launcher]),html[data-site-workspace] body:has(.workspace-ai-chat[data-site-chat]){padding-bottom:max(88px,env(safe-area-inset-bottom))}
@keyframes site-chat-grow{from{scale:.4;opacity:0}to{scale:1;opacity:1}}
@keyframes site-chat-shrink{from{scale:1;opacity:1}to{scale:.4;opacity:0}}
@keyframes site-chat-slide{from{translate:0 100%;opacity:0}to{translate:0 0;opacity:1}}
@keyframes site-chat-slide-close{from{translate:0 0;opacity:1}to{translate:0 100%;opacity:0}}
@media(max-width:760px){
  html body .public-ai .public-ai-panel{position:fixed!important;inset:calc(var(--public-ai-visible-top,0px) + var(--public-ai-visible-height,100dvh) * .08) 0 auto 0!important;width:100vw!important;height:calc(var(--public-ai-visible-height,100dvh) * .92)!important;max-height:calc(var(--public-ai-visible-height,100dvh) * .92)!important;border-radius:28px 28px 0 0;animation:site-chat-slide 280ms cubic-bezier(.16,1,.3,1) both;transform-origin:50% 100%;z-index:1}
  html body .public-ai[data-chat-open=true] .site-chat-dot,html body .public-ai[data-chat-closing] .site-chat-dot{visibility:hidden;pointer-events:none}
  html body .public-ai[data-chat-closing] .public-ai-panel{animation:site-chat-slide-close 200ms ease-in both}
  html body .public-ai .public-ai-bar{padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
}
@media(prefers-reduced-motion:reduce){html body .public-ai[data-chat-closing] .public-ai-panel,.site-chat-dot>svg,.site-chat-close-icon{animation:none!important;transition:none!important}}

/* Root integrated cascade: legacy H5 waiting mode hides its composer. The fixed
 * panel owns a visible composer whenever open; the native controller still gates sends. */
html body .public-ai[data-web-ai-launcher] .public-ai-bar:not([hidden]){display:flex!important;height:72px!important;min-height:72px!important;border-radius:0!important}
html body .public-ai[data-web-ai-launcher] .public-ai-bar input{height:48px!important;padding:0 12px!important;caret-color:var(--bb-theme-ink)!important;cursor:text!important}
html body .public-ai[data-web-ai-launcher] .public-ai-send{display:grid!important;place-items:center}

/* Marketing section headings must not resize the compact chat welcome. */
html body .public-ai[data-web-ai-launcher] .public-ai-welcome h2{font-size:20px!important;line-height:1.35!important;margin:12px 0!important}
html body .public-ai[data-web-ai-launcher] .public-ai-welcome p{font-size:14px!important;line-height:1.6!important}

/* Server-confirmed official unread count, shared across public/workspace chat. */
html body .site-chat-dot .site-chat-unread{position:absolute;top:-4px;right:-4px;display:grid;place-items:center;height:18px;min-width:18px;padding:0 5px;border-radius:999px;background:#B8FF3D;color:#111;font-size:11px;line-height:18px;font-weight:600;font-variant-numeric:tabular-nums;box-shadow:0 0 0 2px var(--bb-theme-canvas);pointer-events:none}
html body .site-chat-dot .site-chat-unread[hidden]{display:none!important}
/* Review 32: the page end can scroll clear of the chat dot (52 + 24 + 12). */
html body:has(.public-ai[data-web-ai-launcher]) :is(main>footer,body>footer){padding-bottom:calc(88px + env(safe-area-inset-bottom))}

/* Guest state (CHAT_GUEST_STATE.md section 6): the bar never leaves the panel bottom;
   signed-out visitors get one sign-in bar and one centred hint. */
html body .public-ai .public-ai-panel>:is(.public-ai-bar,.site-chat-tray){margin-top:auto!important}
html body .public-ai[data-guest] .public-ai-panel>:is(.public-ai-welcome,.public-ai-status,.public-ai-guest,iframe){display:none!important}
html body .public-ai[data-guest] .public-ai-bar>:is(input,.public-ai-send,.public-ai-orb){display:none!important}
html body .public-ai .public-ai-guest-hint{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:0 16px;box-sizing:border-box;text-align:center}
html body .public-ai .public-ai-guest-hint img{display:block;width:52px;height:52px;object-fit:contain}
html body .public-ai .public-ai-guest-hint p{margin:0!important;max-width:260px;font-size:15px!important;line-height:22px!important;font-weight:500;color:var(--bb-theme-secondary,#666)}
html body .public-ai .public-ai-guest-entry{flex:1 1 auto;min-width:0;height:48px;margin:0;padding:0 16px;border:0;border-radius:999px;background:var(--bb-theme-inset,#f5f5f7);color:var(--bb-theme-ink,#111);font:inherit;font-size:16px;line-height:22px;font-weight:600;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:opacity 120ms}
html body .public-ai .public-ai-guest-entry:active{opacity:.72}
html body .public-ai .public-ai-guest-entry:focus-visible{outline:2px solid var(--bb-theme-ink,#111);outline-offset:2px}
@media(prefers-reduced-motion:reduce){html body .public-ai .public-ai-guest-entry{transition:none}}


/* ===== Tray (owner 2026-10-08, sample mockups/chat-colours.html): one rounded block at the panel bottom; WhatsApp-style bar. Colours = theme tokens only. ===== */
html body .public-ai[data-web-ai-launcher] .site-chat-tray{position:relative;flex:0 0 auto;margin:0 12px 12px;padding:10px;border-radius:24px;background:var(--bb-theme-inset,#f5f5f7);box-sizing:border-box}
html body .public-ai[data-web-ai-launcher] .site-chat-tray .public-ai-bar,html body .public-ai[data-web-ai-launcher] .site-chat-tray .public-ai-bar:not([hidden]){display:flex!important;align-items:center;gap:8px;height:48px!important;min-height:48px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html body .public-ai[data-web-ai-launcher] .public-ai-bar[hidden]{display:none!important}
html body .public-ai .site-chat-ic{width:40px;height:40px;flex:0 0 40px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--bb-theme-ink,#111);display:grid;place-items:center;cursor:pointer;transition:background 150ms,transform 150ms}
html body .public-ai .site-chat-ic svg,html body .public-ai .site-chat-key svg,html body .public-ai .site-chat-voice-play svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
html body .public-ai .site-chat-ic:hover{background:var(--bb-theme-inset,#f5f5f7)}
html body .public-ai .site-chat-ic:active{transform:scale(.94)}
/* left: the 007 live-voice key (AI conversations only) */
html body .public-ai .site-chat-live{width:48px;height:48px;flex:0 0 48px;padding:0;border:0;border-radius:50%;background:var(--bb-theme-ink,#111);display:grid;place-items:center;cursor:pointer;overflow:hidden;transition:transform 150ms}
html body .public-ai .site-chat-live img{width:100%;height:100%;object-fit:cover;pointer-events:none}
html body .public-ai .site-chat-live:active{transform:scale(.94)}
html body .public-ai .site-chat-field{flex:1;min-width:0;height:48px;display:flex;align-items:center;gap:2px;padding:0 4px 0 4px;border-radius:999px;background:var(--bb-theme-surface,#fff);border:1px solid var(--bb-theme-line,#e5e5e7);box-sizing:border-box}
html body .public-ai[data-web-ai-launcher] .site-chat-field input{flex:1;min-width:0;height:44px!important;border:0;border-radius:999px;padding:0 4px 0 12px!important;background:transparent!important;color:var(--bb-theme-ink,#111);font:inherit;font-size:16px}
html body .public-ai .site-chat-key{width:48px;height:48px;flex:0 0 48px;padding:0;border:0;border-radius:50%;background:var(--bb-theme-accent,#b8ff3d);color:var(--bb-theme-accent-ink,#111);display:grid;place-items:center;cursor:pointer;box-shadow:0 0 0 5px rgba(184,255,61,.32);transition:background 150ms,transform 150ms,box-shadow 150ms}
html body .public-ai .site-chat-key svg{width:24px;height:24px}
html body .public-ai .site-chat-key:active{transform:scale(.94)}
html body .public-ai .site-chat-key:disabled{opacity:.5;box-shadow:none;cursor:default}
html body .public-ai .site-chat-key .site-chat-stop{display:none;width:16px;height:16px;border-radius:3px;background:currentColor}
@media(prefers-reduced-motion:no-preference){html body .public-ai:not([data-chat-voice=rec]) .site-chat-key:not(:disabled){animation:site-chat-halo 2.4s ease-in-out infinite}}
@keyframes site-chat-halo{50%{box-shadow:0 0 0 9px rgba(184,255,61,.16)}}
/* one main key: microphone while empty, send once there is text */
html body .public-ai[data-web-ai-launcher]:not([data-draft]) .public-ai-send{display:none!important}
html body .public-ai[data-web-ai-launcher][data-draft] .site-chat-key{display:none}
html body .public-ai[data-web-ai-launcher] .public-ai-send{box-shadow:0 0 0 5px rgba(184,255,61,.32)}
/* entries show only when the open conversation can take them; nothing before it reports itself (guests never see them) */
html body .public-ai:not([data-chat-kind]) .site-chat-key{display:none!important}
html body .public-ai:not([data-chat-emoji]) [data-chat-only=emoji],html body .public-ai:not([data-chat-image]) [data-chat-only=image],html body .public-ai:not([data-chat-kind=ai]) [data-chat-only=ai]{display:none!important}
/* recording: red dot + timer + wave + cancel; the main key becomes a stop square */
html body .public-ai .site-chat-rec{flex:1;min-width:0;height:48px;display:flex;align-items:center;gap:10px;padding:0 4px 0 12px;box-sizing:border-box}
html body .public-ai .site-chat-rec[hidden]{display:none!important}
html body .public-ai .site-chat-rec>i{width:10px;height:10px;border-radius:50%;background:#D64545;flex:none}
@media(prefers-reduced-motion:no-preference){html body .public-ai .site-chat-rec>i{animation:site-chat-blink 1s steps(2) infinite}}
@keyframes site-chat-blink{to{opacity:.3}}
html body .public-ai .site-chat-rec [data-chat-rec-time],html body .public-ai .site-chat-voice-preview [data-chat-voice-length]{font-variant-numeric:tabular-nums;font-size:15px;color:var(--bb-theme-ink,#111);min-width:36px}
html body .public-ai .site-chat-wave{flex:1;min-width:0;height:20px;border-radius:4px;opacity:.6;background:repeating-linear-gradient(90deg,var(--bb-theme-secondary,#666) 0 2px,transparent 2px 6px);-webkit-mask:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent);mask:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent)}
html body .public-ai .site-chat-rec [data-chat-rec-cancel]{height:32px;padding:0 12px;border:1px solid var(--bb-theme-line,#e5e5e7);border-radius:999px;background:var(--bb-theme-surface,#fff);color:var(--bb-theme-ink,#111);font:inherit;font-size:13px;cursor:pointer;flex:none}
html body .public-ai[data-chat-voice=rec] .public-ai-bar :is(.site-chat-live,.site-chat-field,.public-ai-send){display:none!important}
html body .public-ai[data-chat-voice=rec] .site-chat-key{display:grid!important;background:var(--bb-theme-ink,#111);color:var(--bb-theme-surface,#fff);animation:none}
html body .public-ai[data-chat-voice=rec] .site-chat-key svg{display:none}
html body .public-ai[data-chat-voice=rec] .site-chat-key .site-chat-stop{display:block;width:auto;height:auto;border-radius:0;background:none;font-size:20px;line-height:1}
html body .public-ai[data-chat-voice=rec] .site-chat-key .site-chat-stop::before{content:"↑"}
/* Transcription stays inside the same 48px composer; cancel remains interactive. */
html body .public-ai .site-chat-transcribing{flex:1;min-width:0;width:100%;height:48px;display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;color:var(--bb-theme-ink,#111);box-sizing:border-box}
html body .public-ai .site-chat-transcribing[hidden]{display:none!important}
html body .public-ai .site-chat-transcribing [data-chat-transcribe-cancel]{width:44px;height:44px;justify-self:center;background:var(--bb-theme-surface,#fff);border:1px solid var(--bb-theme-line,#e5e5e7)}
html body .public-ai .site-chat-transcribing [data-chat-transcribe-cancel]:focus-visible{outline:2px solid var(--bb-theme-ink,#111);outline-offset:2px}
html body .public-ai .site-chat-transcribing [data-chat-transcribe-status]{min-width:0;text-align:center;font-size:14px;line-height:20px;overflow-wrap:anywhere;color:var(--bb-theme-secondary,#666)}
html body .public-ai .site-chat-transcribe-spinner{width:20px;height:20px;justify-self:center;border:2px solid var(--bb-theme-line,#e5e5e7);border-top-color:var(--bb-theme-ink,#111);border-radius:50%;box-sizing:border-box}
html body .public-ai[data-web-ai-launcher][data-chat-voice=busy] .public-ai-bar :is(.site-chat-field,.site-chat-rec,.site-chat-live,.site-chat-key,.public-ai-send){display:none!important}
html body .public-ai[data-chat-voice=busy] :is(.public-ai-status,.site-chat-voice-confirm){display:none!important}
@keyframes site-chat-transcribe-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:no-preference){html body .public-ai[data-chat-voice=busy] .site-chat-transcribing:not([hidden]) .site-chat-transcribe-spinner{animation:site-chat-transcribe-spin 900ms linear infinite}}
@media(prefers-reduced-motion:reduce){html body .public-ai .site-chat-transcribe-spinner{animation:none!important}}
/* the voice confirm panel grows out of the tray */
html body .public-ai .site-chat-voice-confirm{position:absolute;left:0;bottom:calc(100% + 8px);z-index:3;border:1px solid var(--bb-theme-line,#e5e5e7);border-radius:20px;background:var(--bb-theme-surface,#fff);color:var(--bb-theme-ink,#111);box-shadow:0 12px 40px rgba(0,0,0,.16);box-sizing:border-box;transform-origin:0 100%;animation:site-chat-grow 200ms cubic-bezier(.16,1,.3,1) both}
html body .public-ai .site-chat-voice-confirm[hidden]{display:none!important}
html body .public-ai .site-chat-voice-confirm{right:0;padding:10px;display:grid;gap:10px}
html body .public-ai .site-chat-voice-preview{display:flex;align-items:center;gap:10px;height:56px;padding:0 12px 0 4px;border-radius:999px;background:var(--bb-theme-inset,#f5f5f7);box-sizing:border-box}
html body .public-ai .site-chat-voice-play{width:48px;height:48px;flex:0 0 48px;border:0;border-radius:50%;background:var(--bb-theme-surface,#fff);color:var(--bb-theme-ink,#111);display:grid;place-items:center;cursor:pointer}
html body .public-ai .site-chat-voice-confirm p{margin:0;font-size:13px;line-height:1.5;color:var(--bb-theme-secondary,#666)}
html body .public-ai .site-chat-voice-acts{display:flex;gap:8px}
html body .public-ai .site-chat-voice-acts button{flex:1;height:44px;border:1px solid var(--bb-theme-line,#e5e5e7);border-radius:999px;background:transparent;color:var(--bb-theme-ink,#111);font:inherit;font-size:14px;cursor:pointer}
html body .public-ai .site-chat-voice-acts .site-chat-voice-go{background:var(--bb-theme-ink,#111);color:var(--bb-theme-surface,#fff);border-color:transparent;font-weight:600}
html body .public-ai[data-chat-voice=busy] .site-chat-voice-acts button{opacity:.6;pointer-events:none}
/* first open: the big 007 ball and the greeting (sample "刚打开") */
html body .public-ai[data-web-ai-launcher] .public-ai-welcome{justify-content:center;gap:0}
html body .public-ai[data-web-ai-launcher] .public-ai-welcome>img{width:120px;height:120px;border-radius:50%;object-fit:cover;margin:0 0 20px;box-shadow:0 18px 40px rgba(0,0,0,.18)}
html body .public-ai[data-web-ai-launcher] .public-ai-welcome h2{font-size:24px!important;font-weight:500!important;line-height:1.35!important;margin:0 0 8px!important;text-wrap:balance}
html body .public-ai[data-web-ai-launcher] .public-ai-welcome p{color:var(--bb-theme-secondary,#666);margin:0}
html body .public-ai[data-web-ai-launcher] .public-ai-welcome .public-ai-prompts{display:none}
/* guest state: only the sign-in bar in the tray */
html body .public-ai[data-guest] .site-chat-tray{background:transparent;padding:0;margin:0 12px 12px}
html body .public-ai[data-guest] .public-ai-bar>:not(.public-ai-guest-entry){display:none!important}
html body .public-ai[data-guest] .public-ai-guest-hint{padding:0 16px 16px}
/* glass skin: the tray is a pressed inset, pop-ups float */
html[data-bigbit-skin=glass] body .public-ai .site-chat-tray{background:var(--glass-bg-soft);box-shadow:var(--glass-press)}
html[data-bigbit-skin=glass] body .public-ai .site-chat-field,html[data-bigbit-skin=glass] body .public-ai .site-chat-voice-preview{background:var(--glass-bg-soft);border-color:transparent;box-shadow:var(--glass-press)}
html[data-bigbit-skin=glass] body .public-ai .site-chat-voice-confirm{background:var(--glass-bg-float);backdrop-filter:var(--glass-filter-float);-webkit-backdrop-filter:var(--glass-filter-float);border-color:var(--glass-edge)}
html[data-bigbit-skin=glass] body .public-ai :is(.site-chat-rec [data-chat-rec-cancel],.site-chat-transcribing [data-chat-transcribe-cancel],.site-chat-voice-play,.site-chat-voice-acts button:not(.site-chat-voice-go)){background:var(--glass-bg-soft);border-color:transparent;box-shadow:var(--glass-raise)}
@media(max-width:760px){html body .public-ai[data-web-ai-launcher] .site-chat-tray{margin:0 8px calc(8px + env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){html body .public-ai .site-chat-key,html body .public-ai .site-chat-rec>i,html body .public-ai .site-chat-voice-confirm{animation:none!important}}
/* glass skin: keep the chat iframe on the page's colour scheme so the embedded page stays see-through (site-chat-glass-v7) */
html[data-bigbit-skin="glass"][data-bigbit-skin][data-bigbit-skin][data-bigbit-skin] body .public-ai iframe[data-public-ai-frame]{color-scheme:var(--bb-theme-color-scheme,light)}
/* the header's avatar menu opens over the chat window, not behind it (site-chat-fixes-v8) */
html body .web-header:has(.web-avatar[open]){z-index:120}
