.chat-launcher{position:fixed;left:24px;bottom:24px;z-index:1000;display:flex;align-items:center;gap:10px;padding:14px 18px;border-radius:32px;background:#900019;color:#fff!important;box-shadow:0 6px 22px #0003;text-decoration:none;font-weight:bold;border:2px solid #fff}.chat-launcher:hover{background:#6e0013}.chat-launcher:focus-visible{outline:3px solid #dfab51;outline-offset:3px}#chat-unread-badge{background:white;color:#900019;border-radius:20px;min-width:24px;text-align:center;padding:2px 7px;font-size:.85rem}#chat-unread-badge[hidden]{display:none}main{padding-bottom:100px!important}@media(max-width:640px){.chat-launcher{left:14px;bottom:14px;padding:11px 14px;font-size:.9rem}}
.chat-popup{position:fixed;left:24px;bottom:94px;width:390px;height:540px;max-height:calc(100dvh - 120px);z-index:1001;border:1px solid #dedede;border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 12px 40px #0004;display:flex;flex-direction:column}.chat-popup[hidden]{display:none}.chat-popup-header{background:#900019;color:#fff;padding:12px 16px;display:flex;align-items:center;justify-content:space-between}.chat-popup-header button{background:transparent;border:0;color:#fff;font-size:25px;line-height:1;padding:2px 8px;cursor:pointer}.chat-popup iframe{border:0;width:100%;flex:1;min-height:0;background:#fff}@media(max-width:640px){.chat-popup{left:10px;right:10px;bottom:80px;width:auto;height:520px;max-height:calc(100dvh - 100px)}}
.chat-popup{width:380px;height:550px;border:0;border-radius:18px;box-shadow:0 14px 50px #25101938;animation:chatAppear .16s ease-out}.chat-popup-header{padding:14px 16px;background:#900019;font-size:14px;border-bottom:1px solid #ffffff25}.chat-popup-header button{border-radius:50%;width:28px;height:28px;padding:0;background:#ffffff18;font-size:23px;margin:0;display:grid;place-items:center}.chat-popup-header button:hover{background:#ffffff30}@keyframes chatAppear{from{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}@media(max-width:640px){.chat-popup{width:auto;height:520px}}@media(prefers-reduced-motion:reduce){.chat-popup{animation:none}}

.chat-launcher{background:#626a74;border-color:#fff;box-shadow:0 5px 20px #00000018}.chat-launcher:hover{background:#4d555f}.chat-launcher:focus-visible{outline-color:#b5bbc3}#chat-unread-badge{color:#606770}.chat-popup-header{background:#646c76}.chat-popup{box-shadow:0 12px 40px #0000001f}

.chat-launcher{background:#254367;font-size:15px}.chat-launcher:hover{background:#1c3555}#chat-unread-badge{color:#254367}.chat-popup-header{background:#254367;font-size:15px}

.chat-popup{width:min(760px,calc(100vw - 48px));height:720px;max-height:calc(100dvh - 120px)}
.chat-popup iframe{display:block;min-width:0}.chat-popup-header{flex-shrink:0}
@media(max-width:640px){.chat-popup{left:8px;right:8px;top:calc(8px + env(safe-area-inset-top));bottom:calc(76px + env(safe-area-inset-bottom));width:auto;height:auto;max-height:none;border-radius:14px}.chat-launcher{bottom:calc(12px + env(safe-area-inset-bottom))}}
@media(max-height:480px){.chat-popup{top:6px;bottom:6px;height:auto;max-height:none}}

/* اعلان درشت پیام جدید */
.chat-toast{position:fixed;left:24px;bottom:96px;z-index:1002;display:flex;align-items:flex-start;gap:14px;width:min(420px,calc(100vw - 28px));padding:18px 20px 18px 44px;background:#fff;border-radius:18px;border-right:6px solid #254367;box-shadow:0 18px 50px rgba(15,23,42,.28);cursor:pointer;direction:rtl;text-align:right}
.chat-toast[hidden]{display:none!important}
.chat-toast.is-in{animation:chatToastIn .38s cubic-bezier(.2,1.4,.4,1)}
.chat-toast-icon{flex:0 0 auto;display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#254367;color:#fff;animation:chatRing 1.2s ease-in-out 2}
.chat-toast-body{min-width:0;flex:1}
.chat-toast-title{display:block;font-size:18px;font-weight:800;color:#0f172a;line-height:1.5}
.chat-toast-text{margin:4px 0 6px;font-size:16px;line-height:1.7;color:#334155;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.chat-toast-text:empty{display:none}
.chat-toast-more{display:block;font-size:13px;font-weight:700;color:#254367}
.chat-toast-close{position:absolute;left:10px;top:10px;width:30px;height:30px;min-height:0!important;padding:0!important;margin:0!important;border:0!important;border-radius:50%!important;background:#f1f5f9!important;color:#475569!important;font-size:22px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:none!important}
.chat-toast-close:hover{background:#e2e8f0!important}
.chat-toast:hover{box-shadow:0 22px 56px rgba(15,23,42,.34)}
.chat-launcher.has-new{animation:chatShake .7s ease-in-out 2}
.chat-launcher.has-unread #chat-unread-badge{font-size:1rem;min-width:28px;padding:3px 8px;font-weight:800;background:#ffd84d;color:#3b2a00}
@keyframes chatToastIn{from{transform:translateY(30px) scale(.92);opacity:0}to{transform:none;opacity:1}}
@keyframes chatRing{0%,100%{transform:rotate(0)}20%{transform:rotate(-14deg)}40%{transform:rotate(12deg)}60%{transform:rotate(-8deg)}80%{transform:rotate(5deg)}}
@keyframes chatShake{0%,100%{transform:none}20%{transform:translateY(-6px) scale(1.06)}40%{transform:translateY(0) scale(1)}60%{transform:translateY(-4px) scale(1.04)}80%{transform:none}}
@media(max-width:640px){.chat-toast{left:10px;right:10px;width:auto;bottom:calc(78px + env(safe-area-inset-bottom));padding:16px 16px 16px 42px}.chat-toast-title{font-size:16.5px}.chat-toast-text{font-size:15px}.chat-toast-icon{width:46px;height:46px}}
@media(prefers-reduced-motion:reduce){.chat-toast.is-in,.chat-toast-icon,.chat-launcher.has-new{animation:none}}
