/* AI lab chatbot: the bubble and its panel (chat.js). Colours follow style.css / ai-lab.css. */
.stx-chat,.stx-chat *{box-sizing:border-box}
.stx-chat *{margin-left:0;margin-right:0} /* the theme gives divs side margins */
.stx-chat-panel{text-align:left}
.stx-chat{position:fixed;right:20px;bottom:20px;z-index:99990;font:14px/1.5 Roboto,Arial,sans-serif;color:#3c3c3c}
.stx-chat-bubble{width:60px;height:60px;border-radius:50%;border:0;background:#3c3c3c;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;position:relative;transition:transform .15s}
.stx-chat-bubble:hover{transform:scale(1.06)}
.stx-chat-bubble svg{width:28px;height:28px}
.stx-chat.open .stx-chat-bubble{display:none}
.stx-chat-panel{display:none;flex-direction:column;width:380px;height:min(600px,calc(100vh - 40px));background:#fff;border-radius:14px;box-shadow:0 10px 40px rgba(0,0,0,.28);overflow:hidden}
.stx-chat.open .stx-chat-panel{display:flex}
.stx-chat-head{background:#3c3c3c;color:#fff;padding:12px 14px;display:flex;align-items:center;gap:10px}
.stx-chat-head b{font-size:15px;display:block;line-height:1.2}
.stx-chat-head small{color:#c9c9c9;font-size:11px}
.stx-chat-head button{margin-left:auto;background:none;border:0;color:#fff;cursor:pointer;font-size:13px;opacity:.8;padding:4px 6px}
.stx-chat-head button:hover{opacity:1}
.stx-chat-head .stx-chat-new{margin-left:auto;display:flex;align-items:center;gap:4px;border:1px solid rgba(255,255,255,.35);border-radius:6px;padding:4px 8px;font-size:12px}
.stx-chat-head .stx-chat-new+button{margin-left:0;font-size:22px;line-height:1}
.stx-chat-log{flex:1;overflow-y:auto;padding:14px;background:#f5f7f9;display:flex;flex-direction:column;gap:10px}
.stx-chat-msg{max-width:88%;padding:9px 12px;border-radius:12px;word-wrap:break-word}
.stx-chat-msg p{margin:0 0 6px}.stx-chat-msg p:last-child{margin:0}
.stx-chat-msg ul{margin:4px 0 6px;padding-left:18px}.stx-chat-msg li{margin:2px 0}
.stx-chat-msg a{color:#0066cb;text-decoration:underline}
.stx-chat-user{align-self:flex-end;background:#3c3c3c;color:#fff;border-bottom-right-radius:4px}
.stx-chat-bot{align-self:flex-start;background:#fff;border:1px solid #e1e7ed;border-bottom-left-radius:4px}
.stx-chat-error{align-self:flex-start;background:#fde2e1;color:#a5281b}
.stx-chat-retry{margin-left:6px;background:#a5281b;color:#fff;border:0;border-radius:6px;padding:3px 9px;font-size:12px;cursor:pointer}
.stx-chat-meta{font-size:11px;color:#878787;margin-top:4px;white-space:pre-wrap}
.stx-chat-typing span{display:inline-block;width:7px;height:7px;margin:0 2px;border-radius:50%;background:#a5a5a5;animation:stx-chat-b 1.2s infinite}
.stx-chat-typing span:nth-child(2){animation-delay:.2s}.stx-chat-typing span:nth-child(3){animation-delay:.4s}
@keyframes stx-chat-b{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.stx-chat-sugg{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start}
.stx-chat-sugg button{background:#fff;border:1px solid #00dbc1;color:#3c3c3c;border-radius:14px;padding:5px 10px;font-size:12px;cursor:pointer;text-align:left}
.stx-chat-sugg button:hover{background:#e6fbf8}
.stx-chat-form{display:flex;gap:8px;padding:10px;border-top:1px solid #e1e7ed;background:#fff}
.stx-chat-form textarea{flex:1;resize:none;border:1px solid #d0d7de;border-radius:8px;padding:9px 10px;font:inherit;line-height:20px;height:40px;max-height:100px;outline:none;margin:0}
.stx-chat-form textarea:focus{border-color:#00dbc1}
.stx-chat-form button{border:0;background:#00dbc1;color:#3c3c3c;border-radius:8px;width:44px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.stx-chat-form button:disabled{opacity:.5;cursor:default}
.stx-chat-form .stx-chat-mic{background:#fff;border:1px solid #d0d7de;color:#3c3c3c}
.stx-chat-form .stx-chat-mic[hidden]{display:none}
.stx-chat-listening .stx-chat-mic{background:#e5484d;border-color:#e5484d;color:#fff;animation:stx-chat-pulse 1.2s infinite}
.stx-chat-listening .stx-chat-form textarea{border-color:#e5484d}
@keyframes stx-chat-pulse{0%{box-shadow:0 0 0 0 rgba(229,72,77,.5)}70%{box-shadow:0 0 0 8px rgba(229,72,77,0)}100%{box-shadow:0 0 0 0 rgba(229,72,77,0)}}
.stx-chat-foot{font-size:10.5px;color:#878787;text-align:center;padding:0 10px 8px;background:#fff}
.stx-chat-foot a{color:#878787;text-decoration:underline}
@media (max-width:480px){
	.stx-chat{right:12px;bottom:12px}
	/* full screen; chat.js sets top and height to the visible area while the keyboard is open */
	.stx-chat.open{right:0;bottom:auto;left:0;top:0;height:100vh;height:100dvh}
	.stx-chat-panel{width:100%;height:100%;border-radius:0}
	.stx-chat-head{flex-shrink:0}
	.stx-chat-form textarea{font-size:16px} /* below 16px iOS zooms the page on focus */
	html.stx-chat-lock,html.stx-chat-lock body{overflow:hidden}
}
