/* ST KOOL AI Sales Bot — widget + talking mechanic mascot */
#stk-bot{
	--stk-bot-accent:#F5921F;
	--stk-bot-bg:#0B2A5B;
	position:fixed;bottom:22px;z-index:2147482000;
	font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}
#stk-bot.stk-bot--right{right:22px;}
#stk-bot.stk-bot--left{left:22px;}
#stk-bot *{box-sizing:border-box;}

/* ---------- Launcher ---------- */
.stk-bot__launch{
	width:66px;height:66px;border:0;border-radius:50%;cursor:pointer;padding:0;
	background:#fff;box-shadow:0 8px 24px rgba(11,42,91,.32);
	position:relative;transition:transform .2s ease;
}
.stk-bot__launch:hover{transform:scale(1.06);}
.stk-bot__launch svg{width:66px;height:66px;border-radius:50%;}
.stk-bot__launch-badge{
	position:absolute;top:-8px;right:-6px;
	background:var(--stk-bot-accent);color:#17263f;
	font-size:10px;font-weight:800;padding:3px 7px;border-radius:10px;white-space:nowrap;
	box-shadow:0 2px 6px rgba(0,0,0,.2);animation:stk-bot-pop 2.4s ease-in-out infinite;
}
@keyframes stk-bot-pop{0%,100%{transform:translateY(0);}50%{transform:translateY(-3px);}}
#stk-bot[data-open="1"] .stk-bot__launch{display:none;}

/* ---------- Panel ---------- */
.stk-bot__panel{
	position:absolute;bottom:0;width:360px;max-width:calc(100vw - 30px);
	height:540px;max-height:calc(100vh - 60px);
	background:#fff;border-radius:16px;overflow:hidden;
	box-shadow:0 20px 55px rgba(11,42,91,.4);
	display:none;flex-direction:column;
}
.stk-bot--right .stk-bot__panel{right:0;}
.stk-bot--left  .stk-bot__panel{left:0;}
#stk-bot[data-open="1"] .stk-bot__panel{display:flex;animation:stk-bot-in .25s ease;}
@keyframes stk-bot-in{from{opacity:0;transform:translateY(16px);}to{opacity:1;transform:none;}}

/* ---------- Header ---------- */
.stk-bot__head{
	display:flex;align-items:center;gap:11px;padding:12px 14px;
	background:var(--stk-bot-bg);color:#fff;
}
.stk-bot__avatar{width:46px;height:46px;flex:0 0 46px;}
.stk-bot__avatar svg{width:46px;height:46px;}
.stk-bot__head-txt{display:flex;flex-direction:column;line-height:1.25;flex:1;}
.stk-bot__head-txt strong{font-size:15px;}
.stk-bot__status{font-size:11px;opacity:.8;}
.stk-bot__status::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#37d67a;margin-right:5px;vertical-align:middle;}
.stk-bot__close{margin-left:auto;background:transparent;border:0;color:#fff;font-size:26px;line-height:1;cursor:pointer;opacity:.85;}
.stk-bot__close:hover{opacity:1;}

/* ---------- Messages ---------- */
.stk-bot__msgs{flex:1;overflow-y:auto;padding:14px;background:#f4f7fc;display:flex;flex-direction:column;gap:10px;}
.stk-bot__row{display:flex;gap:8px;max-width:88%;}
.stk-bot__row--bot{align-self:flex-start;}
.stk-bot__row--me{align-self:flex-end;flex-direction:row-reverse;}
.stk-bot__bubble{padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word;}
.stk-bot__row--bot .stk-bot__bubble{background:#fff;color:#1f2733;border:1px solid #e5ebf5;border-bottom-left-radius:4px;}
.stk-bot__row--me .stk-bot__bubble{background:var(--stk-bot-accent);color:#17263f;border-bottom-right-radius:4px;}
.stk-bot__mini{width:28px;height:28px;flex:0 0 28px;border-radius:50%;overflow:hidden;align-self:flex-end;}
.stk-bot__mini svg{width:28px;height:28px;}

/* typing */
.stk-bot__typing{display:inline-flex;gap:4px;padding:12px 14px;}
.stk-bot__typing span{width:7px;height:7px;border-radius:50%;background:#b9c5d8;animation:stk-bot-blink 1.2s infinite;}
.stk-bot__typing span:nth-child(2){animation-delay:.2s;}
.stk-bot__typing span:nth-child(3){animation-delay:.4s;}
@keyframes stk-bot-blink{0%,60%,100%{opacity:.3;}30%{opacity:1;}}

/* ---------- Quick chips ---------- */
.stk-bot__quick{display:flex;gap:6px;padding:8px 10px 0;flex-wrap:wrap;}
.stk-bot__quick button{
	background:#eef3fb;border:1px solid #d9e3f2;color:var(--stk-bot-bg);
	font-size:12px;font-weight:600;padding:6px 10px;border-radius:14px;cursor:pointer;
}
.stk-bot__quick button:hover{background:var(--stk-bot-accent);color:#17263f;border-color:var(--stk-bot-accent);}

/* ---------- Lead form ---------- */
.stk-bot__lead{padding:12px 14px;background:#fff;border-top:1px solid #eef2f8;display:flex;flex-direction:column;gap:7px;}
.stk-bot__lead-title{font-weight:700;color:var(--stk-bot-bg);font-size:14px;}
.stk-bot__lead input,.stk-bot__lead textarea{border:1px solid #d5deec;border-radius:8px;padding:8px 10px;font-size:13px;width:100%;}
.stk-bot__lead input:focus,.stk-bot__lead textarea:focus{outline:none;border-color:var(--stk-bot-accent);box-shadow:0 0 0 2px rgba(245,146,31,.2);}
.stk-bot__lead-btns{display:flex;gap:8px;}
.stk-bot__send-lead{background:var(--stk-bot-accent);color:#17263f;border:0;border-radius:8px;padding:9px 14px;font-weight:700;cursor:pointer;flex:1;}
.stk-bot__cancel-lead{background:#eef2f8;border:0;border-radius:8px;padding:9px 14px;cursor:pointer;}

/* ---------- Input ---------- */
.stk-bot__input{display:flex;align-items:center;gap:6px;padding:10px;border-top:1px solid #eef2f8;background:#fff;}
.stk-bot__field{flex:1;border:1px solid #d5deec;border-radius:22px;padding:10px 14px;font-size:14px;}
.stk-bot__field:focus{outline:none;border-color:var(--stk-bot-accent);box-shadow:0 0 0 2px rgba(245,146,31,.2);}
.stk-bot__send,.stk-bot__mic{
	width:40px;height:40px;flex:0 0 40px;border:0;border-radius:50%;cursor:pointer;
	display:flex;align-items:center;justify-content:center;
}
.stk-bot__send{background:var(--stk-bot-accent);color:#17263f;}
.stk-bot__mic{background:#eef3fb;color:var(--stk-bot-bg);}
.stk-bot__mic.is-listening{background:#e8402f;color:#fff;animation:stk-bot-pulse 1s ease-in-out infinite;}
@keyframes stk-bot-pulse{0%,100%{box-shadow:0 0 0 0 rgba(232,64,47,.5);}50%{box-shadow:0 0 0 8px rgba(232,64,47,0);}}

.stk-bot__foot{font-size:11px;color:#8a97ab;text-align:center;padding:6px;background:#fff;}
.stk-bot__speak-toggle{background:none;border:0;color:#5b6b83;cursor:pointer;font-size:11px;}

/* ---------- Talking mascot animation ---------- */
#stk-bot-mouth{transform-box:fill-box;transform-origin:center;transition:transform .1s;}
.stk-bot__avatar.is-speaking #stk-bot-mouth{animation:stk-bot-talk .26s ease-in-out infinite alternate;}
@keyframes stk-bot-talk{from{transform:scaleY(.28);}to{transform:scaleY(1.05);}}
.stk-bot__avatar.is-speaking .stk-bot__figure{animation:stk-bot-bob 1.1s ease-in-out infinite;}
@keyframes stk-bot-bob{0%,100%{transform:translateY(0) rotate(0);}50%{transform:translateY(-2px) rotate(-1.5deg);}}
/* eye blink */
.stk-bot__eyes{animation:stk-bot-blinkeyes 5s infinite;transform-box:fill-box;transform-origin:center;}
@keyframes stk-bot-blinkeyes{0%,96%,100%{transform:scaleY(1);}98%{transform:scaleY(.1);}}

@media (max-width:480px){
	.stk-bot__panel{height:calc(100vh - 40px);width:calc(100vw - 24px);}
}
@media (prefers-reduced-motion:reduce){
	.stk-bot__launch-badge,.stk-bot__avatar.is-speaking .stk-bot__figure,.stk-bot__eyes{animation:none;}
}
