#sa-root{position:fixed;right:20px;bottom:20px;z-index:99990;font-family:inherit;font-size:15px;line-height:1.5;color:#1f2327}
#sa-root *{box-sizing:border-box}
#sa-toggle{width:60px;height:60px;border-radius:50%;border:0;background:var(--sa-accent,#4FD1A0);color:var(--sa-bg,#1B1D1F);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.28);transition:transform .15s ease;animation:sa-pop .5s ease-out}
@keyframes sa-pop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
#sa-toggle:hover{transform:scale(1.05)}
#sa-toggle .sa-ic-close{display:none}
#sa-root.sa-open #sa-toggle .sa-ic-open{display:none}
#sa-root.sa-open #sa-toggle .sa-ic-close{display:block}
#sa-panel{position:absolute;right:0;bottom:72px;width:370px;max-width:calc(100vw - 40px);height:560px;max-height:calc(100vh - 110px);background:#fff;border-radius:18px;box-shadow:0 18px 48px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(0,0,0,.06)}
#sa-panel[hidden]{display:none}
.sa-head{display:flex;align-items:center;gap:12px;padding:16px 18px;background:var(--sa-bg,#1B1D1F);color:#fff}
.sa-dot{width:10px;height:10px;border-radius:50%;background:var(--sa-accent,#4FD1A0);box-shadow:0 0 0 4px rgba(255,255,255,.12)}
.sa-head-text{display:flex;flex-direction:column;line-height:1.25}
.sa-head-text strong{font-size:15px}
.sa-head-text span{font-size:12px;opacity:.75}
#sa-log{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:#f6f7f7}
.sa-msg{max-width:85%;padding:10px 14px;border-radius:16px;white-space:pre-wrap;word-wrap:break-word}
.sa-msg.sa-bot{align-self:flex-start;background:#fff;border:1px solid #e4e6e8;border-bottom-left-radius:6px}
.sa-msg.sa-user{align-self:flex-end;background:var(--sa-bg,#1B1D1F);color:#fff;border-bottom-right-radius:6px}
.sa-msg.sa-typing{color:#6b7280;font-style:italic}
.sa-msg a{color:inherit;text-decoration:underline}
#sa-form{display:flex;gap:8px;padding:12px;border-top:1px solid #e4e6e8;background:#fff}
#sa-form #sa-input{flex:1;resize:none;border:1px solid #d7dadd;border-radius:12px;padding:10px 12px;margin:0;font:inherit;font-size:16px;line-height:1.4;height:44px;min-height:44px;max-height:120px;outline:none;background:#fff;color:#1f2327;box-shadow:none}
#sa-form #sa-input:focus{border-color:var(--sa-accent,#4FD1A0);box-shadow:0 0 0 3px rgba(79,209,160,.25)}
#sa-form #sa-send{width:44px;height:44px;flex:0 0 44px;padding:0;margin:0;border:0;border-radius:12px;background:var(--sa-accent,#4FD1A0);color:var(--sa-bg,#1B1D1F);cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}
#sa-form #sa-send svg,#sa-toggle svg{width:20px;height:20px;display:block;stroke:currentColor;fill:none}
#sa-toggle svg{width:26px;height:26px}
#sa-send:disabled{opacity:.5;cursor:default}
.sa-foot{font-size:11px;color:#6b7280;padding:8px 14px 10px;background:#fff;text-align:center}
.sa-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@media (max-width:600px){
  #sa-root{right:14px;bottom:14px}
  #sa-root.sa-open{position:fixed;inset:0;right:0;bottom:0;width:100%;height:100%}
  #sa-panel{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0;border:0}
  @supports (height:100dvh){#sa-panel{height:100dvh;max-height:100dvh}}
  .sa-head{padding-right:64px;padding-top:max(16px,env(safe-area-inset-top))}
  #sa-root.sa-open #sa-toggle{position:fixed;right:12px;top:max(10px,env(safe-area-inset-top));bottom:auto;width:40px;height:40px;z-index:99992;box-shadow:0 0 0 3px rgba(255,255,255,.35);animation:none}
  #sa-root.sa-open #sa-toggle svg{width:18px;height:18px}
  #sa-form{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  #sa-form #sa-input{min-width:0}
}
}
@media (prefers-reduced-motion:reduce){#sa-toggle{transition:none;animation:none}}
