.sb-chat-fab{position:fixed;right:22px;bottom:22px;z-index:99920;width:58px;height:58px;border-radius:50%;border:0;background:linear-gradient(135deg,#d8a716,#f7cf54);color:#07182f;box-shadow:0 18px 48px rgba(7,24,47,.22);display:flex;align-items:center;justify-content:center;font-size:24px;cursor:pointer}.sb-chat-fab b{display:none;position:absolute;right:5px;top:5px;width:13px;height:13px;border-radius:50%;background:#ef4444;border:2px solid #fff}.sb-chat-fab.has-new b{display:block}.sb-chat-panel{position:fixed;right:22px;bottom:92px;z-index:99919;width:385px;max-width:calc(100vw - 24px);height:560px;max-height:calc(100vh - 130px);border-radius:22px;overflow:hidden;background:#fff;border:1px solid rgba(226,232,240,.9);box-shadow:0 30px 90px rgba(7,24,47,.28);display:none;flex-direction:column}.sb-chat-panel.open{display:flex}.sb-chat-head{display:flex;align-items:center;gap:11px;background:linear-gradient(135deg,#07182f,#0b2341);color:#fff;padding:14px 15px}.sb-chat-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#d8a716,#f7cf54);display:flex;align-items:center;justify-content:center;color:#07182f}.sb-chat-title-wrap{flex:1;min-width:0}.sb-chat-title{font-weight:900;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sb-chat-sub{font-size:11px;opacity:.78;display:flex;gap:6px;align-items:center}.sb-online-dot{width:8px;height:8px;border-radius:50%;background:#94a3b8;display:inline-block}.sb-online-dot.on{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}.sb-call-btn,.sb-chat-close{border:0;border-radius:12px;background:rgba(255,255,255,.1);color:#fff;width:36px;height:36px;cursor:pointer}.sb-call-btn:hover,.sb-chat-close:hover{background:#d8a716;color:#07182f}.sb-chat-lockline{display:flex;align-items:center;justify-content:space-between;padding:9px 14px;background:#f8fafc;border-bottom:1px solid #e6edf5;font-size:12px;font-weight:800}.sb-mini-btn{border:0;border-radius:999px;background:#22c55e;color:#fff;padding:7px 13px;font-weight:900;cursor:pointer}.sb-mini-btn.locked{background:#ef4444}.sb-chat-mode{display:flex;justify-content:space-between;gap:8px;padding:8px 14px;border-bottom:1px solid #eef2f7;background:#fffdf3;color:#64748b;font-size:11px;font-weight:800}.sb-chat-msgs{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:linear-gradient(180deg,#f8fbff,#fff)}.sb-msg{display:flex;gap:8px;max-width:88%}.sb-msg.mine{align-self:flex-end;flex-direction:row-reverse}.sb-msg.bot,.sb-msg.human{align-self:flex-start}.sb-msg .ava{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e2e8f0;font-size:12px;flex-shrink:0}.sb-msg.mine .ava{background:#d8a716;color:#07182f}.sb-msg.bot .ava{background:#0b2341;color:#fff}.sb-bubble{background:#eef4fb;border:1px solid #dfe9f4;color:#10223a;padding:9px 12px;border-radius:14px 14px 14px 4px;font-size:13px;line-height:1.45;word-break:break-word}.sb-msg.mine .sb-bubble{background:#07182f;color:#fff;border-color:#07182f;border-radius:14px 14px 4px 14px}.sb-msg.bot .sb-bubble{background:#fff8db;border-color:#f4d76a}.sb-time{font-size:10px;color:#94a3b8;margin-top:3px}.sb-chat-form{display:flex;gap:8px;padding:11px;border-top:1px solid #e6edf5;background:#fff}.sb-chat-input{flex:1;border:1px solid #dfe9f4;border-radius:14px;padding:10px 12px;resize:none;outline:none;max-height:92px;font-size:13px}.sb-chat-input:focus{border-color:#d8a716;box-shadow:0 0 0 4px rgba(216,167,22,.12)}.sb-chat-send{width:42px;border:0;border-radius:14px;background:linear-gradient(135deg,#d8a716,#f7cf54);color:#07182f;font-weight:900;cursor:pointer}.sb-call-toast{position:fixed;right:22px;bottom:665px;z-index:99930;background:#07182f;color:#fff;padding:12px 14px;border-radius:14px;box-shadow:0 18px 55px rgba(7,24,47,.24);max-width:360px}.sb-call-toast a{color:#f7cf54;font-weight:900}.sb-empty{padding:16px;text-align:center;color:#64748b;font-size:13px}.sb-ring{animation:sbpulse 1s infinite}@keyframes sbpulse{50%{transform:scale(1.08)}}@media(max-width:560px){.sb-chat-panel{right:10px;bottom:80px;width:calc(100vw - 20px);height:72vh}.sb-chat-fab{right:14px;bottom:14px}.sb-call-toast{left:10px;right:10px;bottom:calc(72vh + 92px)}}
.sb-incoming-call{position:fixed;inset:0;z-index:99999;background:rgba(2,8,19,.68);backdrop-filter:blur(10px);display:flex;align-items:center;justify-content:center;padding:18px}.sb-incoming-card{width:min(390px,94vw);border-radius:28px;background:linear-gradient(180deg,#102a4d,#07182f);border:1px solid rgba(255,255,255,.16);box-shadow:0 30px 100px rgba(0,0,0,.45);padding:28px;text-align:center;color:#fff}.sb-ring-avatar{width:92px;height:92px;margin:0 auto 16px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#d8a716,#f7cf54);font-size:40px;animation:sbpulse 1s infinite;color:#07182f}.sb-incoming-title{font-size:13px;text-transform:uppercase;letter-spacing:.12em;color:#f7cf54;font-weight:900}.sb-incoming-name{font-size:24px;font-weight:950;margin:10px 0 22px}.sb-incoming-actions{display:flex;gap:12px;justify-content:center}.sb-incoming-actions button{border:0;border-radius:999px;padding:13px 24px;font-weight:950;cursor:pointer}.sb-answer{background:#22c55e;color:#fff}.sb-decline{background:#ef4444;color:#fff}@media(max-width:520px){.sb-incoming-actions{flex-direction:column}.sb-incoming-actions button{width:100%}}


/* SB Live chat positioning and guest support — production safe */
.sb-chat-fab{
  left:auto !important;
  right:max(16px, env(safe-area-inset-right)) !important;
  bottom:max(18px, env(safe-area-inset-bottom)) !important;
  transform:none !important;
  margin:0 !important;
}
.sb-chat-panel{
  left:auto !important;
  right:max(16px, env(safe-area-inset-right)) !important;
}
.sb-guest-chat{padding:26px 22px 28px;text-align:center;background:#fff;display:flex;flex-direction:column;align-items:stretch;gap:12px;overflow:auto}
.sb-guest-icon{font-size:42px;line-height:1}
.sb-guest-chat h3{margin:2px 0 0;color:#0b2341;font-size:20px}
.sb-guest-chat p{margin:0 0 6px;color:#64748b;font-size:13px;line-height:1.6}
.sb-guest-primary,.sb-guest-whatsapp{display:block;text-decoration:none;border-radius:12px;padding:12px 14px;font-weight:800;font-size:13px}
.sb-guest-primary{background:#0b2341;color:#fff}
.sb-guest-whatsapp{background:#25d366;color:#fff}
@media(max-width:560px){
  .sb-chat-fab{
    width:52px !important;height:52px !important;font-size:21px !important;
    right:calc(14px + env(safe-area-inset-right)) !important;
    bottom:calc(18px + env(safe-area-inset-bottom)) !important;
  }
  .sb-chat-panel{
    right:calc(10px + env(safe-area-inset-right)) !important;
    left:calc(10px + env(safe-area-inset-left)) !important;
    width:auto !important;
    bottom:calc(82px + env(safe-area-inset-bottom)) !important;
    max-height:calc(100dvh - 110px - env(safe-area-inset-bottom)) !important;
  }
}

/* Patch 51: fixed portal chat placement on every viewport */
.sb-chat-fab{position:fixed!important;left:auto!important;right:calc(16px + env(safe-area-inset-right))!important;bottom:calc(18px + env(safe-area-inset-bottom))!important;top:auto!important;margin:0!important;transform:none!important;z-index:2147482000!important}
.sb-chat-panel{position:fixed!important;left:auto!important;right:calc(16px + env(safe-area-inset-right))!important;bottom:calc(88px + env(safe-area-inset-bottom))!important;top:auto!important;z-index:2147481999!important}
@media(max-width:560px){.sb-chat-fab{width:50px!important;height:50px!important;right:calc(12px + env(safe-area-inset-right))!important;bottom:calc(14px + env(safe-area-inset-bottom))!important}.sb-chat-panel{left:calc(8px + env(safe-area-inset-left))!important;right:calc(8px + env(safe-area-inset-right))!important;bottom:calc(74px + env(safe-area-inset-bottom))!important;width:auto!important;height:min(72dvh,580px)!important;max-height:calc(100dvh - 92px - env(safe-area-inset-bottom))!important}}

/* Patch 57: portal chat bubbles use the actual JS class names */
.sb-chat-msg{display:flex;flex-direction:column;align-self:flex-start;max-width:86%;padding:9px 12px;background:#eef4fb;border:1px solid #dfe9f4;color:#10223a;border-radius:14px 14px 14px 4px;font-size:13px;line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap}
.sb-chat-msg.mine{align-self:flex-end;margin-left:auto;background:#07182f;color:#fff;border-color:#07182f;border-radius:14px 14px 4px 14px}
.sb-chat-msg small{display:block;margin-top:4px;font-size:10px;line-height:1.2;color:#7f8da0}
.sb-chat-msg.mine small{color:rgba(255,255,255,.62);text-align:right}
.sb-chat-panel.keyboard-open{height:var(--sb-chat-vh,72dvh)!important;max-height:var(--sb-chat-vh,72dvh)!important}
.sb-chat-panel.keyboard-open .sb-chat-msgs{min-height:0;overscroll-behavior:contain}

.sb-call-btn.app-only{opacity:.8}.sb-call-btn.app-only:hover{opacity:1}
