.floating-chat {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 2147482500;
    direction: rtl;
    font-family: var(--system-font-family-fa, inherit);
}

.floating-chat__trigger {
    position: relative;
    width: 58px;
    height: 58px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent, #53693f) 55%, #fff);
    border-radius: 20px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent, #53693f) 88%, #000), var(--accent, #53693f));
    color: #fff;
    box-shadow: 0 18px 42px color-mix(in srgb, var(--accent, #53693f) 32%, transparent);
    font-size: 22px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.floating-chat__trigger:hover,
.floating-chat__trigger:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px color-mix(in srgb, var(--accent, #53693f) 40%, transparent);
}

.floating-chat.is-open .floating-chat__trigger {
    transform: rotate(-4deg);
}

.floating-chat__badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border: 3px solid var(--card);
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 950;
}

.floating-chat__badge[hidden] {
    display: none;
}

.floating-chat__panel {
    position: absolute;
    left: 0;
    bottom: 72px;
    width: min(370px, calc(100vw - 28px));
    max-height: min(610px, calc(100dvh - 118px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--card) 97%, var(--bg));
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    transform-origin: bottom left;
    animation: floating-chat-enter .2s ease both;
}

.floating-chat__panel[hidden] {
    display: none;
}

@keyframes floating-chat-enter {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-chat__head {
    padding: 15px 16px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.floating-chat__head > div {
    min-width: 0;
}

.floating-chat__head strong,
.floating-chat__head small {
    display: block;
}

.floating-chat__head strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.floating-chat__head small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.floating-chat__close {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 11px;
    background: var(--bg);
    color: var(--text);
}

.floating-chat__notification {
    margin: 10px 12px 0;
    min-height: 38px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--accent, #53693f) 24%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent, #53693f) 8%, var(--card));
    color: var(--accent, #53693f);
    font-size: 10px;
    font-weight: 850;
}

.floating-chat__notification:disabled {
    opacity: .8;
}

.floating-chat__list {
    min-height: 120px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
}

.floating-chat-item {
    padding: 9px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: var(--text);
    text-decoration: none;
}

.floating-chat-item:hover,
.floating-chat-item:focus-visible {
    border-color: color-mix(in srgb, var(--accent, #53693f) 25%, var(--border));
    background: color-mix(in srgb, var(--accent, #53693f) 8%, var(--card));
    color: var(--text);
}

.floating-chat-item__avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in srgb, var(--accent, #53693f) 12%, var(--card));
    color: var(--accent, #53693f);
}

.floating-chat-item__copy {
    min-width: 0;
}

.floating-chat-item__copy strong,
.floating-chat-item__copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floating-chat-item__copy strong {
    font-size: 12px;
    font-weight: 900;
}

.floating-chat-item__copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.floating-chat-item > em {
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent, #53693f);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.floating-chat-empty {
    min-height: 150px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
}

.floating-chat-empty i {
    color: var(--accent, #53693f);
    font-size: 28px;
}

.floating-chat__footer {
    padding: 11px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border);
}

.floating-chat__footer .btn {
    flex: 1;
}

.floating-chat-toast {
    position: absolute;
    left: 0;
    bottom: 74px;
    width: min(330px, calc(100vw - 28px));
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--accent, #53693f) 28%, var(--border));
    border-radius: 16px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
    text-decoration: none;
    animation: floating-chat-enter .2s ease both;
}

.floating-chat.is-open .floating-chat-toast {
    bottom: auto;
    top: -74px;
}

.floating-chat-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: .2s ease;
}

.floating-chat-toast > i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent, #53693f) 12%, var(--card));
    color: var(--accent, #53693f);
}

.floating-chat-toast strong,
.floating-chat-toast small {
    display: block;
}

.floating-chat-toast small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.manalia-version-badge-v1 {
    left: 94px !important;
}

html[data-theme="dark"] .floating-chat__panel,
html[data-theme="dark"] .floating-chat-toast {
    box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
}

@media (max-width: 620px) {
    .floating-chat {
        left: 14px;
        bottom: 14px;
    }
    .floating-chat__trigger {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }
    .floating-chat__panel {
        left: 0;
        bottom: 66px;
        width: calc(100vw - 28px);
        max-height: calc(100dvh - 100px);
    }
}

@media print {
    .floating-chat {
        display: none !important;
    }
}
