/*-----------------------[ Live Chat Widget ]------------------------*/
.chat_panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 48px);
    display: none;
    flex-direction: column;
    background: #09101A;
    border: 1px solid #141C27;
    border-radius: 16px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    font-family: inherit;
}

.chat_panel.chat_open {
    display: flex;
}

.chat_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #141C27;
    color: #FFF;
}

.chat_header_title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.chat_header_status {
    font-size: 12px;
    color: #6994E0;
    margin: 2px 0 0;
}

.chat_close {
    background: none;
    border: none;
    color: #FFF;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.chat_close:hover {
    color: #6994E0;
}

.chat_messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat_bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat_bubble.chat_mine {
    align-self: flex-end;
    background: #6994E0;
    color: #02050A;
    border-bottom-right-radius: 4px;
}

.chat_bubble.chat_theirs {
    align-self: flex-start;
    background: #141C27;
    color: #FFF;
    border-bottom-left-radius: 4px;
}

.chat_notice {
    align-self: center;
    text-align: center;
    font-size: 12.5px;
    color: #A2A2A2;
    padding: 8px 12px;
}

.chat_input_row {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #141C27;
}

.chat_input {
    flex: 1;
    background: #09101A;
    border: 1px solid #2a3648;
    border-radius: 22px;
    color: #FFF;
    font-size: 14px;
    padding: 10px 16px;
    outline: none;
}

.chat_input:focus {
    border-color: #6994E0;
}

.chat_send {
    background: #6994E0;
    color: #02050A;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.chat_send:hover {
    filter: brightness(1.1);
}

/* Owner (admin) sign-in form */
.chat_login {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 24px;
}

.chat_login_hint {
    color: #FFF;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 6px;
}

.chat_send_wide {
    background: #6994E0;
    color: #02050A;
    border: none;
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.chat_send_wide:hover {
    filter: brightness(1.1);
}

.chat_login_error {
    min-height: 18px;
    color: #e07069;
    padding: 0;
}

.chat_signout {
    background: none;
    border: 1px solid #2a3648;
    border-radius: 14px;
    color: #A2A2A2;
    font-size: 12px;
    padding: 4px 10px;
    margin-right: 8px;
    cursor: pointer;
    vertical-align: middle;
}

.chat_signout:hover {
    color: #6994E0;
    border-color: #6994E0;
}

/* Owner (admin) conversation list */
.chat_convo_list {
    flex: 1;
    overflow-y: auto;
}

.chat_convo_item {
    padding: 14px 18px;
    border-bottom: 1px solid #141C27;
    cursor: pointer;
}

.chat_convo_item:hover {
    background: #141C27;
}

.chat_convo_name {
    color: #FFF;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

.chat_convo_preview {
    color: #A2A2A2;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat_back {
    background: none;
    border: none;
    color: #6994E0;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px 4px 0;
}

@media screen and (max-width: 576px) {
    .chat_panel {
        right: 8px;
        bottom: 8px;
        height: calc(100vh - 16px);
    }
}
