/* Pearl — support widget (expects --accent/--accent2/--ink/--dim/--line/--bg/--bg-soft on the host page) */
.sw-bubble{position:fixed;right:22px;bottom:22px;z-index:150;width:58px;height:58px;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-size:24px;box-shadow:0 8px 26px rgba(59,130,246,.45);transition:.18s}
.sw-bubble:hover{transform:scale(1.06)}
.sw-bubble.open{transform:scale(.9)}
.sw-header-btn{width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:transparent;color:var(--ink);font-size:17px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:.15s}
.sw-header-btn:hover{border-color:var(--accent)}
.sw-header-btn.open{background:linear-gradient(135deg,var(--accent),var(--accent2));border-color:transparent}
.sw-panel{position:fixed;right:22px;bottom:90px;z-index:150;width:360px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - 130px);
  background:var(--bg-soft);border:1px solid var(--line);border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.5);display:flex;flex-direction:column;overflow:hidden}
.sw-panel.sw-top-anchored{bottom:auto;top:78px;right:22px;height:min(520px,calc(100vh - 110px))}
@media(max-width:480px){.sw-panel.sw-top-anchored{right:10px;left:10px;width:calc(100vw - 20px)}}
.sw-head{display:flex;align-items:center;gap:10px;padding:14px 16px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff}
.sw-head .sw-ava{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:19px}
.sw-head b{font-size:15px;display:block}
.sw-head span{font-size:12px;opacity:.9}
.sw-head .sw-x{margin-left:auto;background:rgba(255,255,255,.18);border:none;color:#fff;font-size:20px;cursor:pointer;line-height:1;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:.15s}
.sw-head .sw-x:hover{background:rgba(255,255,255,.32)}
.sw-gate{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;text-align:center}
.sw-gate p{color:var(--dim);font-size:14.5px;margin:0}
.sw-start{display:inline-block;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;text-decoration:none;border:none;border-radius:999px;padding:12px 26px;font-weight:700;font-size:14.5px;cursor:pointer}
.sw-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.sw-msg{display:flex}
.sw-msg.user{justify-content:flex-end}
.sw-bub{max-width:82%;padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.5;font-weight:500;word-wrap:break-word}
.sw-msg.assistant .sw-bub{background:var(--bg);border:1px solid var(--line);border-bottom-left-radius:4px;color:var(--ink)}
.sw-msg.user .sw-bub{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;border-bottom-right-radius:4px}
.sw-bub a{color:inherit;text-decoration:underline}
.sw-dots{display:flex;gap:4px}
.sw-dots i{width:7px;height:7px;border-radius:50%;background:var(--dim);animation:swb 1s infinite}
.sw-dots i:nth-child(2){animation-delay:.15s}
.sw-dots i:nth-child(3){animation-delay:.3s}
@keyframes swb{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.sw-input{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);background:var(--bg-soft)}
.sw-input input{flex:1;border:1px solid var(--line);border-radius:11px;padding:10px 13px;font-size:14px;outline:none;background:var(--bg);color:var(--ink)}
.sw-input input:focus{border-color:var(--accent)}
.sw-input button{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;border:none;border-radius:11px;width:42px;font-size:16px;cursor:pointer}
@media(max-width:480px){
  .sw-panel{width:calc(100vw - 20px);right:10px;left:10px;bottom:80px;height:72vh;max-height:none}
  .sw-bubble{right:16px;bottom:16px}
}
.sw-panel[hidden],.sw-gate[hidden],.sw-body[hidden],.sw-input[hidden]{display:none}
