.bzh-live-chat {
    position: fixed;
    /* پیش‌فرض: فقط safe-area. روی تک‌محصول وقتی نوار موبایل bazeh فعال است،
       PHP همان صفحه `--bzh-mpb-chat-clearance` را داخل مدیا کوئری BP ست می‌کند. */
    bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + var(--bzh-mpb-chat-clearance, 0px));
    z-index: 10000;
    --bzh-chat-font: "Vazirmatn", "Vazir", Tahoma, sans-serif;
    font-family: var(--bzh-chat-font) !important;
    -webkit-font-smoothing: antialiased;
}

.bzh-live-chat *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline) {
    font-family: var(--bzh-chat-font) !important;
}

.bzh-live-chat--left {
    left: max(16px, env(safe-area-inset-left));
}

.bzh-live-chat--right {
    right: max(16px, env(safe-area-inset-right));
}

.bzh-live-chat--loading .bzh-live-chat__fab {
    animation: bzh-chat-pulse-soft 1.2s ease-in-out infinite;
}

@keyframes bzh-chat-pulse-soft {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat--loading .bzh-live-chat__fab {
        animation: none;
    }
}

.bzh-live-chat__fab {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #6366f1 0%, #8b5cf6 45%, #a855f7 100%);
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.45),
        0 12px 28px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.bzh-live-chat__fab:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.5),
        0 16px 36px rgba(15, 23, 42, 0.22);
}

.bzh-live-chat__fab:focus-visible {
    outline: 3px solid #c4b5fd;
    outline-offset: 3px;
}

.bzh-live-chat__fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bzh-live-chat__fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.45);
    pointer-events: none;
    animation: bzh-chat-ring 2.4s ease-out infinite;
}

@keyframes bzh-chat-ring {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__fab-pulse {
        display: none;
    }
}

.bzh-live-chat__panel {
    position: absolute;
    bottom: calc(58px + 14px);
    width: min(100vw - 32px, 380px);
    /* Lock the panel to a SINGLE source of truth for height. The previous
       `min(520px, 72vh)` cap let the children (header + ribbon + msgs +
       form) sum past the cap on smaller viewports — and because the
       panel is `overflow: hidden`, the form (last child) was clipped at
       the bottom, which is why the «ارسال» button looked half-cut.
       Using `min` against both vh and a fixed pixel value AND giving
       the panel `display: flex` + `flex-direction: column` lets msgs
       absorb the slack; combined with `flex: 1; min-height: 0` on the
       msgs region the form is GUARANTEED to render fully. */
    height: min(560px, calc(100vh - 110px));
    max-height: min(560px, calc(100vh - 110px));
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 24px 48px -12px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    transform-origin: bottom center;
    animation: bzh-chat-panel-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.bzh-live-chat__panel[hidden] {
    display: none;
}

@keyframes bzh-chat-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__panel {
        animation: none;
    }
}

.bzh-live-chat--right .bzh-live-chat__panel {
    right: 0;
}

.bzh-live-chat--left .bzh-live-chat__panel {
    left: 0;
}

.bzh-live-chat__hdr {
    /* All chrome (header, ribbon, gate, banner) is `flex-shrink: 0` so
       only the messages region absorbs the panel's variable height. */
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 55%, #312e81 100%);
    color: #f8fafc;
}
.bzh-live-chat__ticket-ribbon,
.bzh-live-chat__notif-banner { flex: 0 0 auto; }
/* Gate (guest lead form) also fills the panel so its submit button
   sits at a sensible position regardless of viewport height. */
.bzh-live-chat__gate { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.bzh-live-chat__hdr-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bzh-live-chat__title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.bzh-live-chat__subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
}

.bzh-live-chat__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a5b4fc;
    white-space: nowrap;
}

.bzh-live-chat__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.35);
}

.bzh-live-chat__close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e2e8f0;
    font-size: 1.35rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.bzh-live-chat__close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.bzh-live-chat__close:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

.bzh-live-chat__msgs {
    /* `min-height: 0` is the magic that lets a flex child shrink below
       its content size when the parent has limited height — without it
       the msgs region pushes the form off-screen on short viewports. */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 12px;
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* پیام‌ها به‌صورت ردیف‌های flex با جهت‌بندی مخصوص هر طرف */
.bzh-live-chat__msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 86%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    line-height: 1.55;
}

/* بازدیدکننده — راست (در RTL) */
.bzh-live-chat__msg--visitor {
    align-self: flex-start;
    flex-direction: row;
}

/* پشتیبان — چپ (در RTL از سمت چپ نمایش داده می‌شود) */
.bzh-live-chat__msg--staff {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bzh-live-chat__msg-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.bzh-live-chat__msg-bubble {
    padding: 9px 12px 10px;
    font-size: 0.9rem;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    word-break: break-word;
    position: relative;
}

.bzh-live-chat__msg--visitor .bzh-live-chat__msg-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    border-bottom-right-radius: 4px;
}

.bzh-live-chat__msg--staff .bzh-live-chat__msg-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    border: 1px solid rgba(99, 102, 241, 0.55);
    color: #fff;
    border-bottom-left-radius: 4px;
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.28),
        0 1px 2px rgba(15, 23, 42, 0.05);
}

.bzh-live-chat__msg--staff .bzh-live-chat__msg-bubble a {
    color: #ddd6fe;
    text-decoration: underline;
}

.bzh-live-chat__msg-meta {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 3px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.bzh-live-chat__msg--staff .bzh-live-chat__msg-meta {
    color: rgba(255, 255, 255, 0.85);
}

.bzh-live-chat__msg--staff .bzh-live-chat__msg-who {
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.bzh-live-chat__msg-body {
    word-break: break-word;
}

.bzh-live-chat__msg--staff .bzh-live-chat__msg-body {
    color: #fff;
}

/* URL bubbles must render LTR even inside a Persian (RTL) chat bubble; */
/* otherwise slashes / colons jump to the wrong end and the link looks broken. */
.bzh-live-chat__msg-body a.bzh-chat-msg-link {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    vertical-align: bottom;
    color: #1d4ed8;
    text-decoration: underline;
}
.bzh-live-chat__msg-body a.bzh-chat-msg-link bdi {
    direction: ltr;
    unicode-bidi: isolate;
}
.bzh-live-chat__msg--staff .bzh-live-chat__msg-body a.bzh-chat-msg-link {
    color: #fff;
}

/* نشانگر «در حال نوشتن» پشتیبان */
.bzh-live-chat__typing {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    color: #4338ca;
    font-size: 0.78rem;
    font-weight: 600;
}

.bzh-live-chat__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.bzh-live-chat__typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
    animation: bzh-chat-typing-dot 1s infinite ease-in-out;
}

.bzh-live-chat__typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.bzh-live-chat__typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bzh-chat-typing-dot {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__typing-dots i {
        animation: none;
        opacity: 0.7;
    }
}

.bzh-live-chat__form {
    /* Pinned at the bottom of the panel — `flex-shrink: 0` prevents the
       form from being squeezed when many messages are visible. */
    flex: 0 0 auto;
    padding: 12px 14px 18px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.98);
}

/* مهمان: تا قبل از تکمیل فرم و زدن «شروع گفتگو» پیام/ارسال پنهان بماند. */
.bzh-live-chat--guest-lock #bzh-live-chat-msgs,
.bzh-live-chat--guest-lock .bzh-live-chat__form:not(.bzh-live-chat__gate-form) {
    display: none !important;
}

.bzh-live-chat__form textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 0.92rem;
    resize: none;
    min-height: 46px;
    max-height: 130px;
    direction: rtl;
    text-align: right;
    background: #f8fafc;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.bzh-live-chat__form textarea:hover {
    background: #fff;
}

.bzh-live-chat__form textarea:focus {
    outline: none;
    background: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
}

.bzh-live-chat__send {
    align-self: flex-end;
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    margin-top: 2px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.bzh-live-chat[dir="rtl"] .bzh-live-chat__send {
    align-self: flex-start;
}

.bzh-live-chat__send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.42);
}

.bzh-live-chat__send:disabled {
    opacity: 0.65;
    cursor: wait;
}

.bzh-live-chat__hint {
    margin: 0;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Guest lead form (مهمان) */
.bzh-live-chat__gate {
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: #f8fafc;
}
.bzh-live-chat__gate-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}
.bzh-live-chat__gate-lead {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}
.bzh-live-chat__gate-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bzh-live-chat__gate-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}
.bzh-live-chat__gate-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    font-family: var(--bzh-chat-font) !important;
    font-size: 0.88rem;
    direction: rtl;
    text-align: right;
}
.bzh-live-chat__gate-input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}
.bzh-live-chat__gate-err {
    margin: 0;
    font-size: 0.75rem;
    color: #b91c1c;
}
.bzh-live-chat__send--gate {
    align-self: stretch;
    margin-top: 4px;
    font-family: var(--bzh-chat-font) !important;
}

/* روبان تیکت سفارش — فشرده، ریسپانسیو، تولتیپ با انیمیشن */
.bzh-live-chat__ticket-ribbon {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.bzh-live-chat__ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 7px 11px;
    margin: 0;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e3a8a;
    background: transparent;
    border: none;
    border-inline-end: 1px solid rgba(148, 163, 184, 0.45);
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.bzh-live-chat__ticket-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    color: #1d4ed8;
}

.bzh-live-chat__ticket-btn:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: -2px;
}

.bzh-live-chat__ticket-ico {
    display: flex;
    color: #4f46e5;
}

.bzh-live-chat__ticket-lbl {
    white-space: nowrap;
}

.bzh-live-chat__ticket-tip {
    flex: 1 1 140px;
    min-width: 0;
    padding: 7px 10px;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #64748b;
    align-self: center;
    opacity: 0.88;
    transition:
        opacity 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.bzh-live-chat__ticket-ribbon:hover .bzh-live-chat__ticket-tip,
.bzh-live-chat__ticket-ribbon:focus-within .bzh-live-chat__ticket-tip {
    opacity: 1;
    color: #475569;
    transform: translateY(-0.5px);
}

@media (max-width: 420px) {
    .bzh-live-chat__ticket-tip {
        flex-basis: 100%;
        border-top: 1px solid rgba(226, 232, 240, 0.9);
        font-size: 0.65rem;
        padding: 6px 10px 8px;
    }

    .bzh-live-chat__ticket-btn {
        flex: 1 1 auto;
        justify-content: center;
        border-inline-end: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__ticket-tip {
        transition: none;
    }
}

/* ربان تیکت سفارش — فشرده، تولتیپ با انیمیشن */
.bzh-live-chat__ticket-ribbon {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.bzh-live-chat__ticket-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.65);
    border-inline-end: 1px solid rgba(226, 232, 240, 0.9);
    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.bzh-live-chat__ticket-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.bzh-live-chat__ticket-ico {
    display: flex;
    color: inherit;
}

.bzh-live-chat__ticket-lbl {
    white-space: nowrap;
}

.bzh-live-chat__ticket-tip {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #64748b;
    display: flex;
    align-items: center;
    opacity: 0.88;
    transition:
        opacity 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.bzh-live-chat__ticket-ribbon:hover .bzh-live-chat__ticket-tip,
.bzh-live-chat__ticket-ribbon:focus-within .bzh-live-chat__ticket-tip {
    opacity: 1;
    color: #334155;
    transform: translateY(-1px);
}

@media (max-width: 420px) {
    .bzh-live-chat__ticket-tip {
        display: none;
    }

    .bzh-live-chat__ticket-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__ticket-tip {
        transition: none;
    }
}

/* نوار ابزار شکلک / Buzz + پالس تیکت + فوکوس پس از فرم مهمان */
.bzh-live-chat__composer-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    position: relative;
    margin-bottom: 2px;
}

.bzh-live-chat__emoji-toggle {
    font-size: 1.05rem !important;
    line-height: 1;
    padding: 4px 9px !important;
}

.bzh-live-chat__emoji-toggle,
.bzh-live-chat__buzz-btn {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    background: linear-gradient(180deg, #f8fafc, #e2e8f0);
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.12s ease,
        color 0.15s ease;
}

.bzh-live-chat__attach-btn {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    background: linear-gradient(180deg, #f8fafc, #e2e8f0);
    color: #334155 !important;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 700;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.bzh-live-chat__attach-btn,
.bzh-live-chat__attach-btn:hover,
.bzh-live-chat__attach-btn:focus,
.bzh-live-chat__attach-btn:active,
.bzh-live-chat__attach-btn:visited {
    color: #334155 !important;
}
.bzh-live-chat__attach-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.45);
    color: #1e293b !important;
    background: linear-gradient(180deg, #ffffff, #eef2ff);
}

.bzh-chat-image-link {
    display: inline-flex;
    margin-top: 4px;
    text-decoration: none;
}
.bzh-chat-image-thumb {
    width: 140px;
    height: 140px;
    max-width: min(45vw, 180px);
    max-height: min(45vw, 180px);
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.bzh-chat-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 100200;
    background: rgba(2, 6, 23, 0.82);
    display: grid;
    place-items: center;
    padding: 28px 16px;
    backdrop-filter: blur(3px);
}
.bzh-chat-image-viewer[hidden] {
    display: none !important;
}
.bzh-chat-image-viewer__img {
    max-width: min(95vw, 1100px);
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 22px 60px rgba(2, 6, 23, 0.55);
}
.bzh-chat-image-viewer__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.bzh-chat-image-viewer__download {
    position: absolute;
    top: 18px;
    right: 68px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #f59e0b !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}
.bzh-chat-image-viewer__download,
.bzh-chat-image-viewer__download:visited,
.bzh-chat-image-viewer__download:hover,
.bzh-chat-image-viewer__download:focus,
.bzh-chat-image-viewer__download:active {
    color: #f59e0b !important;
}

.bzh-live-chat__upload-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 8px;
    margin-top: -2px;
    font-family: "Vazirmatn", "Vazir", Tahoma, sans-serif;
}
.bzh-live-chat__upload-progress[hidden] {
    display: none !important;
}
.bzh-live-chat__upload-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.bzh-live-chat__upload-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.18s ease;
}
.bzh-live-chat__upload-text {
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    min-width: 40px;
    text-align: right;
}
.bzh-live-chat__upload-status {
    grid-column: 1 / 2;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}
.bzh-live-chat__upload-cancel {
    grid-column: 2 / 3;
    justify-self: end;
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.bzh-live-chat__buzz-btn {
    background: linear-gradient(180deg, #fef3c7, #fde68a);
    border-color: rgba(245, 158, 11, 0.55);
    color: #92400e;
}

.bzh-live-chat__emoji-toggle:hover,
.bzh-live-chat__buzz-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.45);
}
.bzh-live-chat__emoji-toggle:hover {
    color: #1e293b;
    background: linear-gradient(180deg, #ffffff, #eef2ff);
}
.bzh-live-chat__buzz-btn:hover {
    color: #7c2d12; /* requested: dark text on hover */
    background: linear-gradient(180deg, #fff7ed, #fed7aa);
}
.bzh-live-chat__tool-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bzh-live-chat__tool-ico svg {
    display: block;
}
.bzh-live-chat__tool-txt {
    display: none;
}

.bzh-live-chat__emoji-toggle:focus-visible,
.bzh-live-chat__buzz-btn:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

/* display:flex بالاتر از رفتار پیش‌فرض [hidden] می‌نشیند؛ پنهان بودن پیش‌فرض را صریح کن */
.bzh-live-chat__emoji-palette[hidden] {
    display: none !important;
}

.bzh-live-chat__emoji-palette {
    position: absolute;
    bottom: calc(100% + 6px);
    inset-inline-start: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: min(280px, 92vw);
    padding: 8px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.06);
}

.bzh-live-chat__emoji-item {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1;
    padding: 6px 8px;
    cursor: pointer;
    transition:
        background 0.12s ease,
        transform 0.1s ease;
}

.bzh-live-chat__emoji-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.bzh-live-chat__ticket-btn--pulse {
    animation: bzh-chat-ticket-pulse 2.2s ease-in-out infinite;
}

@keyframes bzh-chat-ticket-pulse {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
    }
}

.bzh-live-chat__composer-input.bzh-live-chat__composer-focus-hint {
    caret-color: #4f46e5;
    border-color: #6366f1 !important;
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.35),
        0 0 20px rgba(99, 102, 241, 0.18) !important;
    animation: bzh-chat-composer-glow 1.15s ease-in-out 3;
}

@keyframes bzh-chat-composer-glow {
    0%,
    100% {
        box-shadow:
            0 0 0 3px rgba(99, 102, 241, 0.35),
            0 0 20px rgba(99, 102, 241, 0.18);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(129, 140, 248, 0.45),
            0 0 26px rgba(99, 102, 241, 0.28);
    }
}

.bzh-live-chat--buzz {
    animation: bzh-chat-buzz-shake 0.72s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes bzh-chat-buzz-shake {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0);
    }
    12% {
        transform: translate3d(-4px, 2px, 0) rotate(-0.45deg);
    }
    24% {
        transform: translate3d(4px, -2px, 0) rotate(0.45deg);
    }
    36% {
        transform: translate3d(-3px, -2px, 0) rotate(-0.35deg);
    }
    48% {
        transform: translate3d(3px, 2px, 0) rotate(0.35deg);
    }
    60% {
        transform: translate3d(-2px, 1px, 0) rotate(-0.2deg);
    }
    72% {
        transform: translate3d(2px, -1px, 0) rotate(0.2deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bzh-live-chat__ticket-btn--pulse {
        animation: none;
    }
    .bzh-live-chat__composer-input.bzh-live-chat__composer-focus-hint {
        animation: none;
    }
    .bzh-live-chat--buzz {
        animation: none;
    }
}

/* باز شدن چت از لینک اعلان + نوتیس پاسخ پشتیبان */
.bzh-live-chat__notif-banner {
    margin: 0 12px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
    color: #0f172a;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border: 1px solid rgba(99, 102, 241, 0.35);
}
.bzh-live-chat__fab.bzh-live-chat__fab--alert {
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.35),
        0 10px 28px rgba(15, 23, 42, 0.18);
}
