.jspanel-floating{position:fixed;z-index:2147483000;right:var(--jf-right,22px);bottom:var(--jf-bottom,22px);font-family:inherit;direction:rtl;overflow:visible!important}.jspanel-floating>summary{list-style:none}.jspanel-floating>summary::-webkit-details-marker{display:none}.jspanel-floating__launcher{width:var(--jf-size,56px);height:var(--jf-size,56px);display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:var(--jspanel-primary,#e63946);color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.2);cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;position:relative;z-index:3}.jspanel-floating__launcher:focus{outline:2px solid rgba(0,0,0,.18);outline-offset:3px}.jspanel-floating__launcher svg{width:27px;height:27px;pointer-events:none}.jspanel-floating__launcher>img{width:58%;height:58%;object-fit:contain;pointer-events:none}.jspanel-floating__actions{position:absolute;right:0;bottom:calc(var(--jf-size,56px) + 12px);display:none;flex-direction:column;align-items:stretch;gap:8px;width:min(180px,calc(100vw - 28px));z-index:2}.jspanel-floating[open]>.jspanel-floating__actions,.jspanel-floating.is-open>.jspanel-floating__actions{display:flex!important}.jspanel-floating.is-chat-open>.jspanel-floating__actions{display:none!important}.jspanel-floating__actions[hidden]{display:none!important}.jspanel-floating__action{display:flex!important;align-items:center;justify-content:flex-start;gap:9px;width:100%;min-width:0;box-sizing:border-box;padding:6px 7px 6px 12px!important;border:1px solid rgba(0,0,0,.08)!important;border-radius:999px!important;background:#fff!important;color:#222!important;text-decoration:none!important;box-shadow:0 8px 24px rgba(0,0,0,.12)!important;cursor:pointer;position:relative;z-index:4}.jspanel-floating__action span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#f4f4f4;color:var(--jspanel-primary,#e63946);overflow:hidden}.jspanel-floating__action svg,.jspanel-floating__action img{width:21px;height:21px;object-fit:contain;pointer-events:none}.jspanel-floating__action b{font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-align:right}.jspanel-chat-widget{position:absolute;right:0;bottom:calc(var(--jf-size,56px) + 12px);width:min(360px,calc(100vw - 28px));height:min(520px,70vh);display:none;flex-direction:column;overflow:hidden;border:1px solid rgba(0,0,0,.08);border-radius:18px;background:#fff;box-shadow:0 18px 55px rgba(0,0,0,.2);z-index:10}.jspanel-chat-widget.is-open,.jspanel-chat-widget:target{display:flex!important}.jspanel-floating:has(.jspanel-chat-widget:target)>.jspanel-floating__actions{display:none!important}.jspanel-chat-widget header{display:flex;align-items:center;justify-content:space-between;padding:15px 16px;background:#111;color:#fff}.jspanel-chat-widget header div{display:flex;flex-direction:column;gap:3px}.jspanel-chat-widget header small{opacity:.72;font-size:10px}.jspanel-chat-widget header button,.jspanel-chat-widget header [data-close-chat]{border:0;background:transparent;color:#fff!important;font-size:25px;cursor:pointer;text-decoration:none!important;line-height:1}.jspanel-chat-widget__body{flex:1;overflow:auto;padding:14px;background:#f6f6f6}.jspanel-chat-welcome{margin-bottom:12px;padding:10px 12px;border-radius:12px;background:#fff;font-size:12px;line-height:1.8}.jspanel-chat-msg{max-width:82%;margin:7px 0;padding:9px 11px;border-radius:13px;font-size:12px;line-height:1.7;white-space:pre-wrap}.jspanel-chat-msg.is-user{margin-right:auto;background:var(--jspanel-primary,#e63946);color:#fff;border-bottom-left-radius:4px}.jspanel-chat-msg.is-admin{margin-left:auto;background:#fff;color:#222;border-bottom-right-radius:4px}.jspanel-chat-offline{padding:11px;border:1px solid #f0d6d6;border-radius:12px;background:#fff5f5;color:#8d2e2e;font-size:12px;line-height:1.8}.jspanel-chat-widget form{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px;border-top:1px solid #eee;background:#fff}.jspanel-chat-widget textarea{resize:none;min-height:44px;max-height:90px;border:1px solid #ddd;border-radius:10px;padding:10px;font:inherit;font-size:12px}.jspanel-chat-widget form button{border:0;border-radius:10px;padding:0 15px;background:var(--jspanel-primary,#e63946);color:#fff;font-weight:700;cursor:pointer}.jspanel-chat-widget form button:disabled,.jspanel-chat-widget textarea:disabled{opacity:.5;cursor:not-allowed}@media(max-width:575px){.jspanel-floating{right:14px;bottom:14px;z-index:2147483646!important;isolation:isolate}.jspanel-floating__launcher{z-index:2147483646!important}.jspanel-floating__actions{position:fixed!important;right:14px!important;bottom:calc(14px + var(--jf-size,56px) + 12px)!important;max-height:calc(100dvh - var(--jf-mobile-safe-top,12px) - var(--jf-size,56px) - 38px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:2147483646!important;padding:2px 2px 4px;scrollbar-width:thin}.jspanel-floating__action{flex:0 0 auto}.jspanel-chat-widget{position:fixed;right:10px;left:10px;bottom:82px;width:auto;height:min(560px,72vh);z-index:2147483646!important}}
.jspanel-chat-notice{margin:8px 0;padding:9px 11px;border-radius:11px;font-size:11px;line-height:1.7}.jspanel-chat-notice.is-success{background:#eefaf2;color:#21623a;border:1px solid #ccebd7}.jspanel-chat-notice.is-info{background:#f3f7ff;color:#315585;border:1px solid #dbe7fb}.jspanel-chat-notice.is-warning{background:#fff8e8;color:#7a5a18;border:1px solid #f3e1ad}.jspanel-chat-notice.is-offline{background:#fff7ee;color:#7a4b1f;border:1px solid #f1d9bf}.jspanel-chat-notice.is-error{background:#fff1f1;color:#8a2d2d;border:1px solid #efcaca}.jspanel-chat-contact[hidden]{display:none!important}.jspanel-chat-contact{margin-top:10px;padding:11px;border-radius:12px;background:#fff;border:1px solid #e3e5e8}.jspanel-chat-contact>strong{display:block;font-size:12px;margin-bottom:4px}.jspanel-chat-contact>p{margin:0 0 8px;font-size:10.5px;line-height:1.7;color:#666}.jspanel-chat-contact>div{display:grid;grid-template-columns:1fr auto;gap:6px}.jspanel-chat-contact input{min-width:0;border:1px solid #d8dadd;border-radius:9px;padding:8px 9px;font:inherit;font-size:11px;direction:ltr;text-align:left}.jspanel-chat-contact button{border:0;border-radius:9px;padding:0 11px;background:#111;color:#fff;font-size:10.5px;font-weight:700;cursor:pointer}.jspanel-chat-contact>small{display:block;min-height:15px;margin-top:5px;color:#666;font-size:9.5px}.jspanel-chat-widget form button:disabled,.jspanel-chat-widget textarea:disabled{opacity:.65;cursor:wait}


.jspanel-floating.has-chat-unread .jspanel-floating__launcher:after{content:"";position:absolute;top:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#ef4056;border:2px solid #fff;box-shadow:0 2px 8px rgba(239,64,86,.35)}
.jspanel-chat-admin.has-chat-error .jspanel-chat-admin-status{border-color:#ef4056!important;background:#fff4f5!important}

/* 1.9.3 realtime connection state + WhatsApp fallback */
.jspanel-chat-notice.is-connecting{display:flex;align-items:center;gap:5px;background:#eef8ff;color:#285575;border:1px solid #cfe7f7}
.jspanel-chat-typing-text{min-height:1.7em}
.jspanel-chat-typing-dots{display:inline-flex;gap:3px;direction:ltr;align-items:center}
.jspanel-chat-typing-dots i{width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.25;animation:jspanelChatDot 1.05s infinite ease-in-out}
.jspanel-chat-typing-dots i:nth-child(2){animation-delay:.16s}.jspanel-chat-typing-dots i:nth-child(3){animation-delay:.32s}
@keyframes jspanelChatDot{0%,60%,100%{opacity:.2;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.jspanel-chat-notice.is-whatsapp{display:grid;gap:9px;background:#f1fbf5;color:#215c38;border:1px solid #cbe9d6}
.jspanel-chat-notice.is-whatsapp>small{color:#5d6d64}
.jspanel-chat-whatsapp-link{display:flex!important;justify-content:center;align-items:center;min-height:38px;padding:7px 10px;border-radius:9px;background:#16a34a!important;color:#fff!important;text-decoration:none!important;font-weight:800;font-size:11px}

/* 1.9.5 chat receipts + two-way typing */
.jspanel-chat-msg-text{display:block;white-space:pre-wrap}
.jspanel-chat-msg-receipt{display:block;margin-top:4px;font-size:8.5px;line-height:1.2;opacity:.72;text-align:left;direction:rtl}
.jspanel-chat-msg-receipt.is-delivered{opacity:.82}.jspanel-chat-msg-receipt.is-seen{opacity:1;color:#8fe4ff}
.jspanel-chat-peer-typing{display:flex;align-items:center;gap:7px;width:max-content;max-width:82%;margin:7px 0 7px auto;padding:8px 10px;border-radius:13px 13px 4px 13px;background:#fff;color:#555;font-size:10.5px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.jspanel-chat-peer-typing b,.jspanel-admin-chat-typing b{display:inline-flex;gap:3px;direction:ltr}
.jspanel-chat-peer-typing i,.jspanel-admin-chat-typing i{display:block;width:4px;height:4px;border-radius:50%;background:currentColor;animation:jspanelChatDot 1.05s infinite ease-in-out}
.jspanel-chat-peer-typing i:nth-child(2),.jspanel-admin-chat-typing i:nth-child(2){animation-delay:.16s}.jspanel-chat-peer-typing i:nth-child(3),.jspanel-admin-chat-typing i:nth-child(3){animation-delay:.32s}


/* 1.9.6 chat lifecycle: sent -> notified -> seen */
.jspanel-chat-notice.is-notified{
    background:#f3f7ff;
    border:1px solid #d5e2ff;
    color:#355b91;
    font-size:10px;
}
.jspanel-chat-notice.is-seen{
    background:#edf9f2;
    border:1px solid #c7ead6;
    color:#18794e;
    font-size:10px;
    font-weight:700;
}
.jspanel-chat-msg-receipt.is-delivered{opacity:1;color:#d8eaff}
.jspanel-chat-msg-receipt.is-seen{opacity:1;color:#a8f0cb;font-weight:700}


/* 1.9.7 online presence + user sound/typing disclosure */
.jspanel-chat-title-line{display:flex;align-items:center;gap:7px}
.jspanel-chat-online-dot{width:8px;height:8px;border-radius:50%;background:#6b7280;box-shadow:0 0 0 3px rgba(255,255,255,.07);flex:0 0 auto;transition:.2s}
.jspanel-chat-online-dot.is-online{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18)}
.jspanel-chat-widget form{grid-template-columns:1fr auto}
.jspanel-chat-draft-disclosure{grid-column:1/-1;color:#8a8f98;font-size:8px;line-height:1.6;padding:0 2px;margin-top:-3px}

/* 1.9.8: presence dot belongs beside online/offline status, not the chat title. */
.jspanel-chat-presence-line{
    display:flex!important;
    align-items:center;
    gap:6px;
}
.jspanel-chat-presence-line .jspanel-chat-online-dot{
    width:7px;
    height:7px;
    flex:0 0 7px;
    background:#8b9098;
    box-shadow:0 0 0 3px rgba(139,144,152,.12);
}
.jspanel-chat-presence-line .jspanel-chat-online-dot.is-online{
    background:#22c55e;
    box-shadow:0 0 0 3px rgba(34,197,94,.18);
}


/* 1.9.9: no horizontal scrolling in any customer chat surface. */
.jspanel-chat-widget,
.jspanel-chat-widget *,
.jspanel-chat-widget__body,
.jspanel-chat-contact,
.jspanel-chat-notice{
    box-sizing:border-box;
}
.jspanel-chat-widget,
.jspanel-chat-widget__body{
    max-width:100%;
    overflow-x:hidden!important;
}
.jspanel-chat-widget header,
.jspanel-chat-widget header > *,
.jspanel-chat-head-copy,
.jspanel-chat-title-line,
.jspanel-chat-presence-line,
.jspanel-chat-widget form,
.jspanel-chat-widget form > *,
.jspanel-chat-contact > *,
.jspanel-chat-contact > div{
    min-width:0;
    max-width:100%;
}
.jspanel-chat-widget textarea,
.jspanel-chat-widget input,
.jspanel-chat-widget button{
    max-width:100%;
}
.jspanel-chat-msg,
.jspanel-chat-msg *,
.jspanel-chat-notice,
.jspanel-chat-notice *,
.jspanel-chat-welcome,
.jspanel-chat-welcome *,
.jspanel-chat-contact,
.jspanel-chat-contact *,
.jspanel-chat-peer-typing,
.jspanel-chat-peer-typing *{
    overflow-wrap:anywhere;
    word-break:break-word;
}
.jspanel-chat-msg,
.jspanel-chat-notice,
.jspanel-chat-welcome{
    min-width:0;
}
.jspanel-chat-whatsapp-link{
    max-width:100%;
    white-space:normal!important;
    text-align:center;
    overflow-wrap:anywhere;
}

/* 1.10.1: restore independent chat-window width.
   1.9.9 constrained the widget to the floating launcher's width via max-width:100%. */
@media (min-width:576px){
    .jspanel-floating .jspanel-chat-widget{
        width:min(360px,calc(100vw - 28px))!important;
        max-width:min(360px,calc(100vw - 28px))!important;
    }
}
@media (max-width:575px){
    .jspanel-floating .jspanel-chat-widget{
        right:10px!important;
        left:10px!important;
        width:auto!important;
        max-width:calc(100vw - 20px)!important;
    }
}
/* Keep no-horizontal-scroll protections on the contents, not on the widget width. */
.jspanel-chat-widget__body,
.jspanel-chat-widget form,
.jspanel-chat-widget header{
    min-width:0;
    overflow-x:hidden!important;
}

/* 1.10.2: customer messages on the RIGHT, support messages on the LEFT. */
.jspanel-chat-msg.is-user{
    margin-right:0!important;
    margin-left:auto!important;
    border-bottom-right-radius:4px!important;
    border-bottom-left-radius:13px!important;
}
.jspanel-chat-msg.is-admin{
    margin-right:auto!important;
    margin-left:0!important;
    background:#fff!important;
    color:#222!important;
    border:1px solid var(--jspanel-primary,#e63946)!important;
    border-bottom-left-radius:4px!important;
    border-bottom-right-radius:13px!important;
}

/* Support receipt colors must remain readable on white bubbles. */
.jspanel-chat-msg.is-admin .jspanel-chat-msg-receipt{
    color:#666!important;
}

/* Subtle message arrival transition; short enough to feel instant. */
@keyframes jspanelChatMessageIn{
    from{opacity:0;transform:translateY(5px) scale(.985)}
    to{opacity:1;transform:translateY(0) scale(1)}
}
.jspanel-chat-msg.is-new{
    animation:jspanelChatMessageIn .16s ease-out both;
}

/* Optimistic outgoing state. */
.jspanel-chat-msg.is-pending{
    opacity:.82;
}
.jspanel-chat-msg.is-failed{
    background:#fff7f7!important;
    color:#8d1f1f!important;
    border:1px solid #e7a3a3!important;
}
.jspanel-chat-msg.is-failed .jspanel-chat-msg-receipt{
    color:#a11!important;
    opacity:1!important;
}

/* Keep scroll behavior smooth but don't force the whole page. */
.jspanel-chat-widget__body{
    scroll-behavior:smooth;
    overscroll-behavior:contain;
}

/* 1.10.4: match frontend message styling to the admin inbox.
   No red backgrounds or red borders in the conversation area. */
.jspanel-chat-widget__body{
    background:#f8fafc!important;
}

/* Customer's own messages: same soft green visual language as admin's own messages. */
.jspanel-chat-msg.is-user{
    align-self:flex-end!important;
    margin-right:0!important;
    margin-left:auto!important;
    background:#dcfce7!important;
    color:#14532d!important;
    border:0!important;
    box-shadow:0 1px 2px rgba(0,0,0,.04)!important;
    border-radius:11px!important;
    border-bottom-right-radius:3px!important;
}

/* Support messages: white card with the same subtle neutral border used in backend. */
.jspanel-chat-msg.is-admin{
    align-self:flex-start!important;
    margin-right:auto!important;
    margin-left:0!important;
    background:#fff!important;
    color:#222!important;
    border:1px solid #e5e7eb!important;
    box-shadow:0 1px 2px rgba(0,0,0,.04)!important;
    border-radius:11px!important;
    border-bottom-left-radius:3px!important;
}

/* Receipts follow the neutral backend palette. */
.jspanel-chat-msg.is-user .jspanel-chat-msg-receipt{
    color:#4b6f57!important;
    opacity:.72!important;
}
.jspanel-chat-msg.is-user .jspanel-chat-msg-receipt.is-delivered{
    color:#3f6b50!important;
    opacity:.9!important;
}
.jspanel-chat-msg.is-user .jspanel-chat-msg-receipt.is-seen{
    color:#166534!important;
    opacity:1!important;
    font-weight:700!important;
}

/* Keep welcome / typing / notices visually consistent with the backend inbox. */
.jspanel-chat-welcome,
.jspanel-chat-peer-typing{
    background:#fff!important;
    border:1px solid #e5e7eb!important;
    color:#4b5563!important;
    box-shadow:0 1px 2px rgba(0,0,0,.025);
}

/* 1.10.5: compact chat composer — about 60% of the previous field/button height. */
.jspanel-chat-widget form{
    gap:6px!important;
    padding:7px!important;
    align-items:start;
}
.jspanel-chat-widget textarea{
    min-height:27px!important;
    height:27px;
    max-height:54px!important;
    padding:4px 7px!important;
    border-radius:8px!important;
    line-height:1.45!important;
}
.jspanel-chat-widget form button{
    height:27px!important;
    min-height:27px!important;
    padding:0 10px!important;
    border-radius:8px!important;
    align-self:start;
    line-height:27px!important;
}
.jspanel-chat-draft-disclosure{
    margin-top:-2px!important;
    line-height:1.35!important;
}

/* 1.11.1: timestamp/date metadata under frontend chat bubbles. */
.jspanel-chat-msg-meta-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-top:5px;
    min-width:0;
    direction:rtl;
}
.jspanel-chat-msg-time{
    display:block;
    color:#8b949e;
    font-size:8px;
    line-height:1.25;
    font-weight:400;
    white-space:nowrap;
    direction:rtl;
}
.jspanel-chat-msg.is-user .jspanel-chat-msg-time{
    color:#557663;
}
.jspanel-chat-msg-meta-row .jspanel-chat-msg-receipt{
    display:block!important;
    margin-top:0!important;
    margin-right:auto;
    flex:0 0 auto;
    white-space:nowrap;
}
.jspanel-chat-msg.is-admin .jspanel-chat-msg-meta-row{
    justify-content:flex-start;
}

/* 1.11.2: compact collapsed history for frontend chat. */
.jspanel-chat-load-older{
    width:max-content;
    max-width:100%;
    margin:2px auto 10px;
    padding:6px 11px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    border:1px solid #dfe3e8;
    border-radius:999px;
    background:#fff;
    color:#647080;
    box-shadow:0 1px 2px rgba(0,0,0,.025);
    font:inherit;
    font-size:9px;
    line-height:1.2;
    cursor:pointer;
}
.jspanel-chat-load-older:hover{
    background:#f3f5f7;
    color:#303846;
}
.jspanel-chat-load-older span{
    font-size:11px;
    line-height:1;
}
.jspanel-chat-load-older b{
    font-size:inherit;
    font-weight:700;
}
.jspanel-chat-load-older:disabled{
    opacity:.58;
    cursor:wait;
}
.jspanel-chat-load-older[hidden]{
    display:none!important;
}
