/* «سلطان» على الموقع: نافذة محادثة فوق زرار الواتساب */
.sx{--sx-deep:#04342C;--sx-ink:#020F0C;--sx-lime:#CDEE8F;--sx-mist:#DDEBE5;--sx-line:rgba(205,238,143,.18);--sx-gap:24px;--sx-lift:98px;font-family:'IBM Plex Sans Arabic',system-ui,sans-serif;line-height:1.7;color:#fff}
.sx *{box-sizing:border-box}
.sx[hidden],.sx [hidden]{display:none!important}

.sx-launch{position:fixed;inset-inline-end:var(--sx-gap);bottom:var(--sx-lift);z-index:60;display:flex;align-items:center;gap:10px;min-height:56px;padding:6px;padding-inline-end:20px;border-radius:999px;border:1px solid var(--sx-line);background:var(--sx-deep);color:#fff;font:inherit;font-weight:700;font-size:15px;cursor:pointer;box-shadow:0 14px 34px rgba(2,15,12,.35);transition:transform .25s ease,box-shadow .25s ease}
.sx-launch:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(2,15,12,.45)}
.sx-launch:focus-visible,.sx button:focus-visible,.sx textarea:focus-visible,.sx input:focus-visible{outline:2px solid var(--sx-lime);outline-offset:2px}
.sx-face{flex:none;width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--sx-lime);color:var(--sx-deep);font-family:'Alexandria','IBM Plex Sans Arabic',sans-serif;font-weight:900;font-size:22px;line-height:1}
.sx-dot{position:absolute;top:4px;inset-inline-start:4px;width:12px;height:12px;border-radius:50%;background:#FF6B4A;border:2px solid var(--sx-deep)}

.sx-panel{position:fixed;inset-inline-end:var(--sx-gap);bottom:var(--sx-gap);z-index:70;width:380px;height:min(600px,calc(100vh - 48px));display:flex;flex-direction:column;border-radius:24px;overflow:hidden;background:var(--sx-ink);border:1px solid var(--sx-line);box-shadow:0 30px 80px rgba(0,0,0,.45);transform-origin:bottom left;animation:sx-in .28s cubic-bezier(.2,.8,.2,1)}
.sx[dir=ltr] .sx-panel{transform-origin:bottom right}
@keyframes sx-in{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:none}}

.sx-head{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--sx-deep);border-bottom:1px solid var(--sx-line)}
.sx-head .sx-face{width:40px;height:40px;font-size:20px;border-radius:12px}
.sx-who{flex:1;display:flex;flex-direction:column;min-width:0}
.sx-who strong{font-family:'Alexandria','IBM Plex Sans Arabic',sans-serif;font-size:17px;font-weight:800}
.sx-who span{font-size:12.5px;color:var(--sx-mist);display:flex;align-items:center;gap:6px}
.sx-who i{width:8px;height:8px;border-radius:50%;background:var(--sx-lime);display:inline-block}
.sx-x{width:40px;height:40px;border-radius:12px;border:0;background:transparent;color:var(--sx-mist);cursor:pointer;display:grid;place-items:center}
.sx-x:hover{background:rgba(255,255,255,.08);color:#fff}
.sx-x svg{width:20px;height:20px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round}

.sx-log{flex:1;overflow-y:auto;padding:18px 14px 8px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth;overscroll-behavior:contain}
.sx-msg{max-width:86%;padding:10px 14px;border-radius:18px;font-size:14.5px;white-space:pre-wrap;word-break:break-word}
.sx-msg a{color:inherit;text-decoration:underline}
.sx-msg.bot,.sx-msg.agent{align-self:flex-start;background:var(--sx-deep);color:#fff;border-start-start-radius:6px}
.sx-msg.agent{border:1px solid var(--sx-lime)}
.sx-msg.me{align-self:flex-end;background:var(--sx-lime);color:var(--sx-deep);border-start-end-radius:6px;font-weight:500}
.sx-msg.pending{opacity:.65}
.sx-msg small{display:block;font-size:11.5px;color:var(--sx-lime);font-weight:700;margin-bottom:2px}
.sx-err{align-self:center;font-size:12.5px;color:#FFB4A3;text-align:center}

.sx-chips{display:flex;flex-wrap:wrap;gap:8px;align-self:flex-start;max-width:100%}
.sx-chips button{font:inherit;font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px;border:1px solid var(--sx-lime);background:transparent;color:var(--sx-lime);cursor:pointer;text-align:start;transition:background .2s ease,color .2s ease}
.sx-chips button:hover{background:var(--sx-lime);color:var(--sx-deep)}

.sx-typing{align-self:flex-start;display:flex;gap:5px;padding:14px 16px;border-radius:18px;background:var(--sx-deep)}
.sx-typing span{width:7px;height:7px;border-radius:50%;background:var(--sx-lime);animation:sx-dot 1s infinite ease-in-out}
.sx-typing span:nth-child(2){animation-delay:.15s}.sx-typing span:nth-child(3){animation-delay:.3s}
@keyframes sx-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.sx-card{align-self:stretch;padding:14px;border-radius:18px;border:1px dashed var(--sx-line);background:rgba(205,238,143,.05)}
.sx-card p{margin:0 0 10px;font-size:13.5px;color:var(--sx-mist)}
.sx-card .sx-row{display:flex;gap:8px;margin-bottom:8px}
.sx-card input{flex:1;min-width:0;height:42px;padding:0 12px;border-radius:12px;border:1px solid var(--sx-line);background:var(--sx-ink);color:#fff;font:inherit;font-size:14px}
.sx-card input::placeholder{color:#7E9C92}
.sx-card .sx-acts{display:flex;align-items:center;gap:14px}
.sx-card .sx-ok{height:40px;padding:0 20px;border-radius:999px;border:0;background:var(--sx-lime);color:var(--sx-deep);font:inherit;font-weight:700;cursor:pointer}
.sx-card .sx-skip{border:0;background:none;color:var(--sx-mist);font:inherit;font-size:13px;cursor:pointer;text-decoration:underline;padding:0}
.sx-card .sx-cerr{margin:6px 0 0;font-size:12.5px;color:#FFB4A3}

.sx-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--sx-line);background:var(--sx-ink)}
.sx-form textarea{flex:1;resize:none;max-height:120px;min-height:44px;padding:11px 14px;border-radius:14px;border:1px solid var(--sx-line);background:var(--sx-deep);color:#fff;font:inherit;font-size:14.5px;line-height:1.5}
.sx-form textarea::placeholder{color:#7E9C92}
.sx-send{flex:none;width:44px;height:44px;border-radius:14px;border:0;background:var(--sx-lime);color:var(--sx-deep);cursor:pointer;display:grid;place-items:center}
.sx-send:disabled{opacity:.5;cursor:default}
.sx-send svg{width:20px;height:20px;fill:currentColor}
.sx[dir=rtl] .sx-send svg{transform:scaleX(-1)}
.sx-note{margin:0;padding:0 14px 10px;font-size:11.5px;color:#7E9C92;text-align:center;background:var(--sx-ink)}

@media (max-width:640px){
  .sx{--sx-gap:26px;--sx-lift:98px}
  .sx-hint{display:none}
  .sx-launch{padding:6px}
  .sx-panel{inset:0;width:auto;height:100dvh;border-radius:0;border:0}
}
@media (prefers-reduced-motion:reduce){
  .sx-panel,.sx-typing span{animation:none}
  .sx-log{scroll-behavior:auto}
  .sx-launch{transition:none}
}
