/* Spidy — Spidery Web Institute chat assistant */
.spx{position:fixed;right:max(30px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:60;font-family:var(--sans)}
.spx-btn{position:relative;width:84px;height:80px;border:0;background:none;cursor:pointer;padding:0;display:block;transition:transform .2s}
.spx-btn img{width:84px;height:auto;display:block;filter:drop-shadow(0 10px 14px rgba(22,17,15,.28));animation:spxBob 3.2s ease-in-out infinite}
.spx-btn:hover img{animation-play-state:paused;transform:rotate(-6deg) scale(1.04)}
.spx-badge{position:absolute;top:-6px;right:-20px;width:30px;height:30px;border-radius:50%;background:var(--red);color:#fff;display:grid;place-items:center;border:3px solid #fff;box-shadow:0 4px 10px -3px rgba(22,17,15,.35)}
.spx-badge svg{width:15px;height:15px}
@keyframes spxBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
.spx.open .spx-btn{transform:scale(.9)}
.spx.open{z-index:90}
.spx.spx-lift{bottom:calc(74px + env(safe-area-inset-bottom))}
.spx-teaser{position:absolute;right:20px;bottom:92px;width:330px;background:rgba(255,255,255,.97);border-radius:22px;padding:18px 20px 16px;color:var(--text);box-shadow:0 24px 50px -18px rgba(22,17,15,.45),0 0 0 1px var(--line);cursor:pointer;animation:spxIn .35s ease;backdrop-filter:blur(6px)}
.spx-tt{display:flex;align-items:center;gap:12px;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line-2)}
.spx-tt img{width:56px;height:auto;flex:none}
.spx-tt b{display:block;font-size:20px;color:var(--red);line-height:1.2}
.spx-tt span{display:block;font-size:14px;line-height:1.3;color:var(--muted);white-space:nowrap}
.spx-teaser strong{display:block;font-size:17px;color:var(--ink);line-height:1.3;margin-bottom:4px}
.spx-teaser p{margin:0;font-size:15px;line-height:1.55;color:var(--muted)}
.spx-teaser button{position:absolute;top:12px;right:12px;border:0;background:none;font-size:22px;line-height:1;color:var(--muted);cursor:pointer;padding:2px 6px}
.spx-panel{position:absolute;right:-12px;bottom:92px;width:370px;max-width:calc(100vw - 24px);height:min(600px,calc(100vh - 190px));background:#fff;border-radius:20px;box-shadow:0 30px 60px -20px rgba(22,17,15,.45),0 0 0 1px var(--line);display:flex;flex-direction:column;overflow:hidden;animation:spxIn .22s ease}
.spx-panel[hidden],.spx-teaser[hidden],.spx [hidden]{display:none!important}
@keyframes spxIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.spx-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--red);color:#fff}
.spx-head img{width:40px;height:auto;background:#fff;border-radius:50%;padding:3px}
.spx-head b{display:block;font-size:16px}
.spx-head small{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.9}
.spx-head small:before{content:"";width:7px;height:7px;border-radius:50%;background:#7CF0A4}
.spx-head .spx-x{margin-left:auto;width:32px;height:32px;border-radius:50%;border:0;background:rgba(255,255,255,.16);color:#fff;font-size:20px;cursor:pointer;line-height:1}
.spx-body{flex:1;overflow-y:auto;padding:14px;background:var(--bg);display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.spx-pre{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px}
.spx-hi{display:flex;gap:10px;align-items:flex-start;margin-bottom:12px}
.spx-hi img{width:64px;height:auto;flex:none}
.spx-hi p{margin:0;background:var(--blush);border-radius:4px 14px 14px 14px;padding:10px 12px;font-size:14px;line-height:1.45;color:var(--text)}
.spx-pre label{display:block;font-size:13px;font-weight:700;color:var(--ink);margin:10px 0 5px}
.spx-pre input{width:100%;box-sizing:border-box;border:1px solid var(--line-2);border-radius:10px;padding:11px 12px;font:inherit;font-size:15px;color:var(--ink);background:#fff}
.spx-pre input:focus{outline:2px solid var(--red-soft);border-color:var(--red)}
.spx-ph{display:flex;border:1px solid var(--line-2);border-radius:10px;overflow:hidden}
.spx-ph span{padding:11px 10px;background:var(--blush);font-weight:700;color:var(--muted);font-size:14px}
.spx-ph input{border:0;border-radius:0}
.spx-pre .spx-go{width:100%;margin-top:14px;border:0;border-radius:10px;background:var(--red);color:#fff;font:inherit;font-weight:800;font-size:15px;padding:12px;cursor:pointer}
.spx-pre .spx-go:disabled{opacity:.6}
.spx-note{font-size:11.5px;color:var(--muted);margin:10px 0 0;line-height:1.4}
.spx-note a{color:var(--muted)}
.spx-err{color:var(--red);font-size:13px;font-weight:700;margin:8px 0 0}
.spx-sr{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0}
.cm{display:flex}
.cm-b{max-width:86%;padding:10px 13px;font-size:14.5px;line-height:1.5;border-radius:16px;word-wrap:break-word}
.cm-bot .cm-b{background:#fff;border:1px solid var(--line);color:var(--text);border-top-left-radius:4px}
.cm-user{justify-content:flex-end}
.cm-user .cm-b{background:var(--red);color:#fff;border-top-right-radius:4px}
.cm-b a{color:var(--red);font-weight:700}
.cm-b ul{margin:6px 0 0;padding-left:18px}
.cm-b li{margin:3px 0}
.cm-b small{color:var(--muted)}
.cm-dots{display:inline-flex;gap:4px;padding:4px 0}
.cm-dots i{width:7px;height:7px;border-radius:50%;background:#C9BEBA;animation:spxDot 1s infinite}
.cm-dots i:nth-child(2){animation-delay:.15s}.cm-dots i:nth-child(3){animation-delay:.3s}
@keyframes spxDot{0%,80%,100%{opacity:.35;transform:none}40%{opacity:1;transform:translateY(-3px)}}
.spx-bt{display:grid;gap:6px;margin-top:8px}
.spx-bt div{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--bg)}
.spx-bt b{display:block;color:var(--ink);font-size:14px}
.spx-bt span{font-size:13px;color:var(--muted)}
.spx-chips{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px 4px;background:#fff;border-top:1px solid var(--line);max-height:150px;overflow-y:auto}
.spx-chips:empty{display:none}
.spx-chip{border:1px solid var(--red);background:#fff;color:var(--red);font:inherit;font-weight:700;font-size:13px;padding:7px 12px;border-radius:999px;cursor:pointer}
.spx-chip:hover{background:var(--red-soft)}
.spx-in{display:flex;gap:8px;padding:10px 12px 12px;background:#fff}
.spx-in input{flex:1;min-width:0;border:1px solid var(--line-2);border-radius:999px;padding:10px 14px;font:inherit;font-size:14.5px}
.spx-in button{width:42px;height:42px;flex:none;border-radius:50%;border:0;background:var(--red);color:#fff;cursor:pointer;display:grid;place-items:center}
.spx-in button svg{width:18px;height:18px}
@media (max-width:560px){
.spx-panel{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));width:auto;max-width:none;height:calc(100dvh - 90px)}
.spx.open .spx-btn{display:none}
.spx-teaser{width:min(290px,calc(100vw - 40px));right:6px}
.spx-btn,.spx-btn img{width:72px}.spx-btn{height:68px}
}
@media print{.spx{display:none!important}}
