.leave-chat {
    --chat-accent: #08afe1;
    --chat-panel: #191b20;
    --chat-panel-soft: #22252b;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1400;
    font-family: inherit;
}

html[dir="rtl"] .leave-chat {
    right: auto;
    left: 24px;
}

.leave-chat__launcher {
    position: relative;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #13c7ef, #008fd2);
    box-shadow: 0 14px 32px rgba(0, 139, 201, .34);
    font-size: 25px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.leave-chat__launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(0, 139, 201, .42);
}

.leave-chat__launcher-close,
.leave-chat--open .leave-chat__launcher-open,
.leave-chat--open .leave-chat__badge {
    display: none;
}

.leave-chat--open .leave-chat__launcher-close {
    display: inline-block;
}

.leave-chat__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
}

.leave-chat__panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    display: flex;
    width: min(410px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 118px));
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    color: #f8fafc;
    background: var(--chat-panel);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .38);
    transform-origin: bottom right;
    animation: leave-chat-in .2s ease-out;
}

html[dir="rtl"] .leave-chat__panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.leave-chat__panel[hidden] {
    display: none;
}

@keyframes leave-chat-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.leave-chat__header {
    display: flex;
    min-height: 88px;
    align-items: center;
    gap: 12px;
    padding: 17px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: #202227;
}

.leave-chat__avatar,
.leave-chat__bot-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #1cccef, #087cbf);
}

.leave-chat__avatar { width: 46px; height: 46px; font-size: 21px; }
.leave-chat__bot-avatar { width: 32px; height: 32px; margin-top: 4px; font-size: 15px; }

.leave-chat__heading {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.leave-chat__heading strong { font-size: 16px; }
.leave-chat__heading span { color: #aeb6c2; font-size: 12px; }

.leave-chat__online {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 5px;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 0 3px rgba(57, 217, 138, .12);
}

.leave-chat__close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #cbd5e1;
    background: transparent;
}

.leave-chat__close:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.leave-chat__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    padding: 22px 18px;
}

.leave-chat__date {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #84909e;
    font-size: 11px;
}

.leave-chat__date::before,
.leave-chat__date::after {
    height: 1px;
    flex: 1;
    content: "";
    background: rgba(255, 255, 255, .08);
}

.leave-chat__message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.leave-chat__message-row > div:last-child { max-width: 85%; }
.leave-chat__message-row small { display: block; margin-top: 7px; color: #7f8996; font-size: 10px; }

.leave-chat__bubble {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.8;
}

.leave-chat__bubble--bot {
    border-start-start-radius: 4px;
    color: #f1f5f9;
    background: var(--chat-panel-soft);
}

.leave-chat__message-row--user { justify-content: flex-start; }
.leave-chat__message-row--user .leave-chat__bubble {
    max-width: 85%;
    border-end-end-radius: 4px;
    color: #fff;
    background: #087db1;
}

.leave-chat__typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.leave-chat__typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: leave-chat-dot 1s infinite alternate;
}

.leave-chat__typing i:nth-child(2) { animation-delay: .18s; }
.leave-chat__typing i:nth-child(3) { animation-delay: .36s; }

@keyframes leave-chat-dot { to { opacity: .25; transform: translateY(-3px); } }

.leave-chat__composer {
    display: flex;
    min-height: 68px;
    align-items: flex-end;
    gap: 9px;
    margin: 0 14px 14px;
    padding: 8px 9px 8px 13px;
    border: 2px solid var(--chat-accent);
    border-radius: 14px;
    background: #111317;
    box-shadow: 0 0 0 3px rgba(8, 175, 225, .09);
}

.leave-chat__composer textarea {
    min-height: 42px;
    max-height: 110px;
    flex: 1;
    resize: none;
    border: 0;
    outline: 0;
    color: #f8fafc;
    background: transparent;
    font: inherit;
    font-size: 13px;
    line-height: 1.7;
}

.leave-chat__composer textarea::placeholder { color: #7d8794; }

.leave-chat__composer button {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--chat-accent);
    font-size: 17px;
}

.leave-chat__composer button:disabled { cursor: wait; opacity: .65; }

@media (max-width: 575.98px) {
    .leave-chat { right: 14px; bottom: 14px; }
    html[dir="rtl"] .leave-chat { right: auto; left: 14px; }
    .leave-chat__launcher { width: 58px; height: 58px; }
    .leave-chat__panel {
        bottom: 70px;
        width: calc(100vw - 28px);
        height: min(620px, calc(100vh - 98px));
        border-radius: 18px;
    }
}
