/* SiYi Advisor — an additive overlay. It borrows the site's own tokens and type
   scale, and touches nothing in the page beneath it. */
#sa-root{position:fixed;right:clamp(.9rem,2vw,1.75rem);bottom:clamp(.9rem,2vw,1.75rem);z-index:9998;
  display:flex;flex-direction:column;align-items:flex-end;gap:.6rem;pointer-events:none;
  font-family:"Space Grotesk",ui-sans-serif,system-ui,sans-serif}
#sa-root *{box-sizing:border-box}
.sa-btn{display:flex;align-items:center;gap:.6rem;padding:.55rem 1.1rem .55rem .55rem;border:0;cursor:pointer;
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));pointer-events:auto;
  box-shadow:0 10px 30px -8px hsl(var(--primary)/.6);transition:background .25s,transform .5s cubic-bezier(.16,1,.3,1),opacity .3s,visibility 0s}
.sa-btn:hover{background:hsl(var(--foreground))}
.sa-btn[hidden]{display:none}
.sa-ava{position:relative;width:32px;height:32px;flex:0 0 auto;display:grid;place-items:center;background:hsl(var(--primary-foreground)/.18)}
.sa-ava svg{width:16px;height:16px;fill:currentColor}
.sa-ava i{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:50%;
  background:hsl(var(--primary-foreground));box-shadow:0 0 0 2px hsl(var(--primary));animation:sa-pulse 2.4s infinite}
.sa-btn:hover .sa-ava i{opacity:0}
@keyframes sa-pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.55);opacity:.4}}
.sa-lab{text-align:left;line-height:1.15}
.sa-lab b{display:block;font-family:Archivo,ui-sans-serif,system-ui,sans-serif;font-size:12px;font-weight:700;
  letter-spacing:2.4px;text-transform:uppercase}
.sa-lab span{display:block;font-size:9px;letter-spacing:1.6px;text-transform:uppercase;opacity:.72;margin-top:2px}

.sa-teaser{position:relative;width:min(84vw,300px);background:hsl(var(--background));border:1px solid hsl(var(--foreground));
  padding:.9rem .95rem .8rem;pointer-events:auto;text-align:left;box-shadow:0 18px 44px -18px hsl(var(--foreground)/.4);
  transform:translateY(12px) scale(.97);opacity:0;visibility:hidden;transform-origin:100% 100%;
  transition:transform .45s cubic-bezier(.16,1,.3,1),opacity .3s,visibility 0s .45s}
.sa-teaser.on{transform:none;opacity:1;visibility:visible;transition-delay:0s}
.sa-x{position:absolute;top:.35rem;right:.35rem;width:24px;height:24px;display:grid;place-items:center;
  background:none;border:0;cursor:pointer;color:hsl(var(--muted-foreground))}
.sa-x:hover{color:hsl(var(--foreground))}
.sa-x svg{width:12px;height:12px}
.sa-trow{display:flex;gap:.6rem;align-items:flex-start}
.sa-tava{width:28px;height:28px;flex:0 0 auto;display:grid;place-items:center;background:hsl(var(--primary));color:#fff}
.sa-tava svg{width:13px;height:13px;fill:currentColor}
.sa-teaser b{display:block;font-family:Archivo,ui-sans-serif,system-ui,sans-serif;font-size:11px;font-weight:700;
  letter-spacing:1.8px;text-transform:uppercase;color:hsl(var(--foreground))}
.sa-teaser p{margin:.3rem 0 0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground));padding-right:.7rem}
.sa-chips{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.7rem}
.sa-chips button{font-family:inherit;font-size:11px;padding:.3rem .55rem;border:1px solid hsl(var(--border));
  background:hsl(var(--card));color:hsl(var(--foreground));cursor:pointer;transition:.2s}
.sa-chips button:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}

.sa-panel{position:fixed;right:clamp(.9rem,2vw,1.75rem);bottom:clamp(.9rem,2vw,1.75rem);z-index:9999;
  width:min(94vw,404px);height:min(76vh,610px);display:flex;flex-direction:column;
  background:hsl(var(--background));border:1px solid hsl(var(--foreground));
  box-shadow:0 30px 70px -24px hsl(var(--foreground)/.45);
  transform:translateY(16px) scale(.98);opacity:0;visibility:hidden;transform-origin:100% 100%;
  transition:transform .45s cubic-bezier(.16,1,.3,1),opacity .3s,visibility 0s .45s}
.sa-panel.on{transform:none;opacity:1;visibility:visible;transition-delay:0s}
.sa-head{display:flex;align-items:center;gap:.6rem;padding:.85rem 1rem;border-bottom:1px solid hsl(var(--border));flex:0 0 auto}
.sa-head .sa-tava{width:26px;height:26px}
.sa-head b{font-family:Archivo,ui-sans-serif,system-ui,sans-serif;font-size:11px;font-weight:700;
  letter-spacing:1.8px;text-transform:uppercase;color:hsl(var(--foreground))}
.sa-head small{display:block;font-size:9px;letter-spacing:1.4px;text-transform:uppercase;color:hsl(var(--muted-foreground));margin-top:1px}
.sa-head .sa-x{position:static;margin-left:auto}
.sa-body{flex:1 1 auto;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.7rem}
.sa-msg{max-width:88%;font-size:13.5px;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.sa-msg.me{align-self:flex-end;background:hsl(var(--primary));color:#fff;padding:.5rem .75rem}
.sa-msg.ai{align-self:flex-start;color:hsl(var(--foreground));border-left:2px solid hsl(var(--primary));padding:.1rem 0 .1rem .7rem}
.sa-msg a{color:hsl(var(--primary));font-weight:600;text-decoration:underline;text-underline-offset:2px}
.sa-dots{display:inline-flex;gap:3px}
.sa-dots i{width:4px;height:4px;border-radius:50%;background:hsl(var(--muted-foreground));animation:sa-b 1.1s infinite}
.sa-dots i:nth-child(2){animation-delay:.16s}.sa-dots i:nth-child(3){animation-delay:.32s}
@keyframes sa-b{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.sa-seeds{padding:0 1rem .6rem;display:flex;flex-wrap:wrap;gap:.3rem;flex:0 0 auto}
.sa-seeds button{font-family:inherit;font-size:11px;padding:.3rem .55rem;border:1px solid hsl(var(--border));
  background:hsl(var(--card));color:hsl(var(--foreground));cursor:pointer;transition:.2s;text-align:left}
.sa-seeds button:hover{border-color:hsl(var(--primary));color:hsl(var(--primary))}
.sa-form{display:flex;gap:.4rem;padding:.75rem 1rem 1rem;border-top:1px solid hsl(var(--border));flex:0 0 auto}
.sa-form input{flex:1 1 auto;min-width:0;font-family:inherit;font-size:14px;padding:12px 14px;
  background:hsl(var(--background));border:1px solid hsl(var(--border));color:hsl(var(--foreground))}
.sa-form input:focus{outline:0;border-color:hsl(var(--primary));box-shadow:0 0 0 2px hsl(var(--primary)/.2)}
.sa-form button{flex:0 0 auto;width:44px;display:grid;place-items:center;background:hsl(var(--primary));
  color:#fff;border:0;cursor:pointer;transition:background .2s}
.sa-form button:hover{background:hsl(var(--foreground))}
.sa-form button svg{width:15px;height:15px}
@media (max-width:620px){
  .sa-panel{right:0;left:0;bottom:0;width:100%;height:88vh;border-left:0;border-right:0;border-bottom:0}
  .sa-lab span{display:none}
}
@media (prefers-reduced-motion:reduce){#sa-root *,.sa-panel{transition-duration:.01ms!important;animation:none!important}}
