/* Scoped Ask AI interface; leaves existing page layout untouched. */
.stx-ai-trigger{font:inherit;cursor:pointer;border:1px solid #5aaf68;border-radius:8px;background:#173827;color:#efffee;padding:8px 12px;white-space:nowrap}
.stx-ai-trigger:hover,.stx-ai-trigger:focus-visible{background:#245b38}
.stx-ai-panel[hidden]{display:none!important}
.stx-ai-panel{position:fixed;right:18px;top:85px;width:min(390px,calc(100vw - 24px));height:min(610px,calc(100dvh - 100px));z-index:99999;background:#101820;color:#f0f5f7;border:1px solid #426057;border-radius:13px;box-shadow:0 12px 55px #000b;display:flex;flex-direction:column;overflow:hidden;font:14px/1.5 system-ui,sans-serif}
.stx-ai-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:#18272d;border-bottom:1px solid #35504a;font-weight:700;flex:none}
.stx-ai-head button,.stx-ai-actions button{background:#223c3b;color:#fff;border:1px solid #456c61;border-radius:7px;padding:7px 10px;cursor:pointer}
.stx-ai-log{flex:1;min-height:0;overflow:auto;padding:13px;display:flex;flex-direction:column;gap:10px}
.stx-ai-bubble{max-width:92%;padding:10px 12px;border-radius:11px;white-space:pre-wrap;overflow-wrap:anywhere;background:#24313a;align-self:flex-start}
.stx-ai-bubble.user{background:#20583e;align-self:flex-end}
.stx-ai-bottom{flex:none;padding:10px;border-top:1px solid #35504a;background:#17242b}
.stx-ai-form{display:flex;align-items:flex-end;gap:7px}
.stx-ai-form textarea{flex:1;min-width:0;resize:none;height:60px;background:#0c161c;color:white;border:1px solid #54736b;border-radius:7px;padding:9px;font:inherit}
.stx-ai-form button{background:#357b50;color:white;border:0;border-radius:7px;padding:10px;cursor:pointer}
.stx-ai-form button:disabled{opacity:.5;cursor:wait}
.stx-ai-actions{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-top:7px}
.stx-ai-status{font-size:12px;color:#c5d7d4;min-height:17px}
@media(max-width:680px){.nav .stx-ai-trigger{display:inline-flex!important}.stx-ai-panel{top:8px;right:8px;width:calc(100vw - 16px);height:calc(100dvh - 16px)} }
/* Voice controls and compact composer */
.stx-ai-form textarea{height:54px}
.stx-ai-actions button[data-mic]:disabled{opacity:.6;cursor:not-allowed}
.stx-ai-actions button.recording{background:#863a3a;color:white}
.stx-ai-actions button[data-speak]{background:#244b42}
.stx-ai-panel{top:calc(var(--stx-nav-height,70px) + 8px);height:min(610px,calc(100dvh - var(--stx-nav-height,70px) - 18px))}
@media(max-width:680px){.stx-ai-panel{top:calc(var(--stx-nav-height,70px) + 5px);right:6px;width:calc(100vw - 12px);height:calc(100dvh - var(--stx-nav-height,70px) - 11px)}}

/* V3: reply-specific speech playback control */
.stx-ai-read-reply{display:block;margin-top:8px;padding:4px 8px;background:#1b4144;border:1px solid #527774;color:#e4f8f7;border-radius:6px;cursor:pointer;font:12px system-ui,sans-serif}
.stx-ai-read-reply:hover,.stx-ai-read-reply:focus-visible{background:#2d6162}

/* V4: desktop-only independent resizing of the floating chat and composer. */
@media (min-width:681px){
 .stx-ai-panel{resize:both;min-width:310px;min-height:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - var(--stx-nav-height,70px) - 12px);}
 .stx-ai-form textarea{resize:vertical;min-height:44px;max-height:min(45dvh,360px);height:54px;box-sizing:border-box;}
}
@media (max-width:680px){
 .stx-ai-panel{resize:none;min-width:0;min-height:0;}
 .stx-ai-form textarea{resize:none;}
}

/* V5: resizable desktop chat and readable reply audio from configured server-side TTS. */
.stx-ai-actions{flex-wrap:wrap}.stx-ai-read-reply{font-size:12px}

/* Coconut v2 — scoped voice-first UI */
.coco-v2{width:min(470px,calc(100vw - 24px));height:min(760px,calc(100dvh - var(--stx-nav-height,70px) - 18px));background:#0b1b19;color:#effbf5;border-color:#375d4d;font-size:15px;--glow:#70957c}
.coco-v2 [hidden]{display:none!important}.coco-v2 .stx-ai-head{background:#142b24;padding:13px 17px;font-size:18px}.coco-v2 .stx-ai-head small{display:block;font-weight:400;font-size:12px;color:#a9c9b5}.coco-v2 .stx-ai-bottom{background:#122820}.coco-v2 button{font:inherit;cursor:pointer}.coco-v2 .coco-stage{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;padding:12px 10px 10px;gap:9px;background:radial-gradient(ellipse at center,#163b2c,#0b1b19 72%)}
.coco-v2[data-phase=listening]{--glow:#46e387}.coco-v2[data-phase=transcribing]{--glow:#b58aff}.coco-v2[data-phase=thinking]{--glow:#ffbc54}.coco-v2[data-phase=speaking]{--glow:#65b7ff}.coco-v2[data-phase=editing]{--glow:#8096a0}.coco-orb{--level:0;position:relative;isolation:isolate;width:145px;height:145px;border:0;background:transparent;padding:0;display:grid;place-items:center}.coco-orb::before{content:'';position:absolute;z-index:-1;inset:12%;border-radius:50%;background:var(--glow);opacity:.42;filter:blur(20px);transform:scale(calc(1 + var(--level)*.55));transition:transform .1s;animation:coco-breathe 2.4s ease-in-out infinite}.coco-orb svg{width:100%;height:100%;transform:scale(calc(1 + var(--level)*.12));transition:transform .1s;filter:drop-shadow(0 5px 7px #0008)}@keyframes coco-breathe{50%{opacity:.72}}.coco-v2 .stx-ai-status{color:var(--glow);text-align:center;font-size:14px;min-height:22px}.coco-v2 .stx-ai-bubble small{display:block;color:#b1cbbd;font-size:11px;margin-bottom:4px}.coco-v2 .stx-ai-bubble{background:#19332b}.coco-v2 .stx-ai-bubble.user{background:#24543c}.coco-v2 .stx-ai-actions{justify-content:center;gap:6px}.coco-v2 .stx-ai-actions button{font-size:12px}.coco-v2 .coco-settings{font-size:12px;max-height:160px;overflow:auto;padding:10px 0}.coco-v2 .coco-settings pre{white-space:pre-wrap;margin:6px 0}.coco-v2 select{max-width:100%;background:#172b23;color:white}.coco-v2 [data-login]{color:#fff;background:#2f774b;border:1px solid #6aad80;border-radius:9px;padding:10px 20px}.coco-v2.coco-guest .stx-ai-log,.coco-v2.coco-guest .stx-ai-bottom{display:none}.coco-v2.coco-guest .coco-stage{flex:1}.coco-v2.coco-guest .coco-orb{cursor:default}.coco-v2 .stx-ai-form textarea{font-size:16px}
body.coco-mobile{overflow:hidden!important;background:#0b1b19!important}body.coco-mobile>*:not(#stx-ai-panel):not(script):not(style){display:none!important}body.coco-mobile #stx-ai-panel{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-width:none!important;max-height:none!important;min-width:0;min-height:0;border:0;border-radius:0;resize:none;z-index:2147483647;padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box}body.coco-mobile .coco-v2 [data-close]{display:none}body.coco-mobile .coco-orb{width:min(190px,28dvh);height:min(190px,28dvh)}body.coco-mobile .coco-stage{padding:15px 10px}body.coco-mobile .stx-ai-head{padding-top:max(13px,env(safe-area-inset-top));justify-content:center;text-align:center}body.coco-mobile .coco-v2.coco-guest .coco-orb{width:210px;height:210px}@media(prefers-reduced-motion:reduce){.coco-orb::before{animation:none}.coco-orb svg{transition:none}}
