.sp-root{position:fixed;right:22px;bottom:22px;z-index:50;font-family:inherit}
.sp-bubble{width:62px;height:62px;border-radius:50%;border:0;cursor:pointer;color:#fff;background:var(--grad,linear-gradient(135deg,#7c3aed,#4f46e5 55%,#06b6d4));box-shadow:0 14px 30px -10px rgba(79,70,229,.6);display:grid;place-items:center;position:relative;transition:transform .2s}
.sp-bubble:hover{transform:scale(1.06)}
.sp-dot{position:absolute;top:4px;right:4px;width:14px;height:14px;border-radius:50%;background:#f43f5e;border:2px solid #fff}
.sp-panel{position:absolute;right:0;bottom:78px;width:380px;height:min(600px,calc(100vh - 120px));background:#fff;border:1px solid var(--line,#e6e8f0);border-radius:22px;box-shadow:0 30px 60px -20px rgba(15,23,42,.35);display:flex;flex-direction:column;overflow:hidden;animation:sp-in .2s ease-out}
.sp-panel[hidden]{display:none}
@keyframes sp-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.sp-head{display:flex;align-items:center;gap:10px;padding:14px 14px;background:var(--grad,linear-gradient(135deg,#7c3aed,#4f46e5 55%,#06b6d4));color:#fff}
.sp-ava{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.2);display:grid;place-items:center}.sp-ava img{width:30px;height:30px}
.sp-title{flex:1;display:flex;flex-direction:column;line-height:1.25}.sp-title b{font-size:15.5px}.sp-title small{opacity:.9;font-size:12px}
.sp-online{display:inline-block;width:8px;height:8px;border-radius:50%;background:#4ade80;margin-right:4px;box-shadow:0 0 0 2px rgba(74,222,128,.3)}
.sp-icon{background:rgba(255,255,255,.15);border:0;color:#fff;width:34px;height:34px;border-radius:10px;cursor:pointer;display:grid;place-items:center;font-size:18px}.sp-icon:hover{background:rgba(255,255,255,.28)}
.sp-msgs{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:#f8f8fd}
.sp-msg{max-width:84%;padding:10px 13px;border-radius:16px;font-size:14.5px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.sp-assistant{align-self:flex-start;background:#fff;border:1px solid var(--line,#e6e8f0);border-bottom-left-radius:5px;color:var(--ink,#0f172a)}
.sp-user{align-self:flex-end;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-bottom-right-radius:5px}
.sp-typing{display:flex;gap:4px;padding:13px 14px}.sp-typing i{width:7px;height:7px;border-radius:50%;background:#a5b4fc;animation:sp-b 1s infinite}
.sp-typing i:nth-child(2){animation-delay:.15s}.sp-typing i:nth-child(3){animation-delay:.3s}
@keyframes sp-b{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}
.sp-quick{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 10px;background:#f8f8fd}.sp-quick:empty{display:none}
.sp-chip{border:1px solid #c7d2fe;background:#fff;color:#4338ca;border-radius:99px;padding:6px 11px;font:inherit;font-size:13px;cursor:pointer}.sp-chip:hover{background:#eef2ff}
.sp-form{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--line,#e6e8f0);align-items:flex-end}
.sp-form textarea{flex:1;resize:none;border:1px solid var(--line,#e6e8f0);border-radius:14px;padding:10px 12px;font:inherit;font-size:14.5px;max-height:110px;background:#fbfbfe}
.sp-form textarea:focus{outline:0;border-color:#4f46e5;box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.sp-send{width:42px;height:42px;border-radius:12px;border:0;cursor:pointer;color:#fff;background:var(--grad,linear-gradient(135deg,#7c3aed,#4f46e5))}
.sp-esc{padding:10px 12px;border-top:1px solid var(--line,#e6e8f0);background:#fffbeb}.sp-esc p{margin:0 0 6px;font-size:13.5px;font-weight:600}
.sp-esc[hidden]{display:none}.sp-row{display:flex;gap:6px;align-items:center}.sp-row input{flex:1;padding:8px 10px;font-size:14px}
.sp-btn{border:0;border-radius:10px;padding:8px 12px;background:#4f46e5;color:#fff;font:inherit;font-size:13.5px;cursor:pointer}
.sp-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 14px 10px;font-size:11.5px;color:var(--muted,#64748b)}
.sp-link{background:none;border:0;color:#4f46e5;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;padding:0}.sp-link[hidden]{display:none}
@media (max-width:520px){
  .sp-root{right:14px;bottom:14px}
  .sp-open .sp-bubble{display:none}
  .sp-panel{position:fixed;inset:0;width:100%;height:100%;border-radius:0;border:0}
  .sp-msg{max-width:88%}
}
.sp-link{white-space:nowrap}.sp-foot span{text-align:right}
.sp-ava{background:#fff;overflow:hidden}.sp-ava img{width:40px;height:40px}
.sp-assistant{position:relative;margin-left:32px}
.sp-assistant::before{content:"";position:absolute;left:-33px;bottom:0;width:26px;height:26px;border-radius:9px;background:#fff url(/mascota/plamti-avatar.svg) center/26px no-repeat;border:1px solid var(--line,#e6e8f0)}
/* ---- Tema cine claro ---- */
.sp-bubble{background:linear-gradient(180deg,rgba(255,255,255,.25),rgba(255,255,255,0) 50%),linear-gradient(135deg,#6d28d9,#c026d3 55%,#0e7490);box-shadow:inset 0 2px 0 rgba(255,255,255,.35),0 14px 30px -10px rgba(192,38,211,.55)}
.sp-bubble:focus-visible,.sp-icon:focus-visible,.sp-send:focus-visible,.sp-chip:focus-visible,.sp-link:focus-visible,.sp-btn:focus-visible{outline:3px solid #0891b2;outline-offset:2px}
.sp-panel{background:rgba(255,255,255,.96);border-color:#e3e0f5;box-shadow:0 2px 6px rgba(76,60,160,.08),0 30px 70px -24px rgba(76,60,160,.45)}
.sp-head{background:linear-gradient(120deg,#1e2347,#2b2f63 50%,#6d28d9)}
.sp-msgs,.sp-quick{background:linear-gradient(180deg,#faf9ff,#f3f1ff)}
.sp-assistant{background:#fff;border-color:#e3e0f5;color:#1c1f45;box-shadow:0 4px 12px -8px rgba(76,60,160,.3)}
.sp-user{background:linear-gradient(135deg,#6d28d9,#c026d3)}
.sp-chip{background:#fff;border-color:#c4b5fd;color:#5b21b6}.sp-chip:hover{background:#f5f3ff}
.sp-send{background:linear-gradient(135deg,#6d28d9,#c026d3 60%,#0e7490)}
.sp-btn{background:#6d28d9}
.sp-foot{color:#545a85}.sp-link{color:#6d28d9}
