#qaKmChatFab {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 99990;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #9c0058;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(156, 0, 88, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    pointer-events: auto !important;
}

#qaKmChatFab .qa-km-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    display: none;
}

#qaKmChatPanel {
    position: fixed;
    bottom: 84px;
    left: 16px;
    z-index: 99989;
    width: min(360px, calc(100vw - 32px));
    height: min(480px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto !important;
}

#qaKmChatPanel.is-open {
    display: flex;
}

.qa-km-chat-head {
    background: #9c0058;
    color: #fff;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qa-km-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.qa-km-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #fafafa;
}

.qa-km-chat-msg {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.qa-km-chat-msg.visitor {
    margin-left: auto;
    background: #9c0058;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.qa-km-chat-msg.admin {
    margin-right: auto;
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.qa-km-chat-compose {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.qa-km-chat-compose textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 100px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}

.qa-km-chat-compose button {
    border: none;
    border-radius: 10px;
    background: #9c0058;
    color: #fff;
    font-weight: 700;
    padding: 0 14px;
    cursor: pointer;
}

html[dir='rtl'] .qa-km-chat-msg.visitor {
    margin-left: 0;
    margin-right: auto;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 4px;
}

html[dir='rtl'] .qa-km-chat-msg.admin {
    margin-right: 0;
    margin-left: auto;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
}
