.live-chat-header-badge {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    margin-left: 8px;
    padding: 0 5px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #e63946;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.live-chat-header-badge.is-hidden {
    display: none;
}

.live-chat-detail-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.live-chat-widget {
    width: 360px;
    max-width: calc(100vw - 24px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(16, 24, 40, 0.22);
    background: #fff;
    display: none;
}

.live-chat-widget.is-open {
    display: block;
}

.live-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 0;
    border-radius: 999px;
    background: #0e8b4f;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.28);
}

.live-chat-launcher .badge {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #22c55e;
    color: #052e16;
    font-size: 11px;
    font-weight: 700;
}

.live-chat-launcher .badge.is-hidden {
    display: none;
}

.live-chat-panel {
    display: flex;
    flex-direction: column;
    height: 520px;
    background: #f8fafc;
}

.live-chat-page-root .live-chat-panel {
    height: 72vh;
    min-height: 620px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.08);
}

.live-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #fff;
}

.live-chat-head h3,
.live-chat-head p {
    margin: 0;
}

.live-chat-head h3 {
    font-size: 16px;
    font-weight: 700;
}

.live-chat-head p {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.76);
}

.live-chat-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
}

.live-chat-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.live-chat-sidebar {
    width: 34%;
    min-width: 240px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    overflow-y: auto;
}

.live-chat-thread {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    background: transparent;
    text-align: left;
    padding: 14px 16px;
}

.live-chat-thread.is-active {
    background: #eff6ff;
}

.live-chat-thread-top,
.live-chat-thread-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.live-chat-thread strong,
.live-chat-thread small,
.live-chat-thread p {
    display: block;
    margin: 0;
}

.live-chat-thread strong {
    font-size: 14px;
    color: #0f172a;
}

.live-chat-thread small,
.live-chat-thread p {
    color: #64748b;
    font-size: 12px;
}

.live-chat-thread p {
    margin-top: 6px;
}

.live-chat-thread-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.live-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-chat-empty {
    padding: 18px;
    color: #64748b;
    font-size: 13px;
}

.live-chat-bubble {
    max-width: 84%;
    padding: 12px 14px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.live-chat-bubble p,
.live-chat-bubble small {
    margin: 0;
}

.live-chat-bubble small {
    display: block;
    margin-top: 6px;
    color: rgba(15, 23, 42, 0.56);
    font-size: 11px;
}

.live-chat-bubble.is-visitor {
    align-self: flex-start;
    background: #fff;
    color: #0f172a;
}

.live-chat-bubble.is-owner {
    align-self: flex-end;
    background: #111827;
    color: #fff;
}

.live-chat-bubble.is-owner small {
    color: rgba(255, 255, 255, 0.66);
}

.live-chat-form,
.live-chat-identity {
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.live-chat-identity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.live-chat-identity .full {
    grid-column: 1 / -1;
}

.live-chat-form textarea,
.live-chat-form input,
.live-chat-identity input {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 10px 12px;
    resize: none;
    background: #fff;
}

.live-chat-form-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.live-chat-form-actions .hint {
    color: #64748b;
    font-size: 12px;
}

.live-chat-form-actions button,
.live-chat-state-action {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

.live-chat-state {
    padding: 14px 16px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    border-top: 1px solid #fed7aa;
}

.live-chat-info-strip {
    padding: 10px 16px;
    background: #ecfeff;
    color: #155e75;
    font-size: 12px;
    border-bottom: 1px solid #cffafe;
}

.live-chat-page-root .live-chat-head {
    border-radius: 24px 24px 0 0;
}

@media (max-width: 991px) {
    .live-chat-page-root .live-chat-panel {
        height: auto;
        min-height: 0;
    }

    .live-chat-layout {
        flex-direction: column;
    }

    .live-chat-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 220px;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 767px) {
    .live-chat-detail-root {
        left: auto;
        right: 12px;
        bottom: 12px;
    }

    .live-chat-launcher {
        width: auto;
        justify-content: center;
    }

    .live-chat-widget {
        width: calc(100vw - 24px);
        max-width: 360px;
    }

    .live-chat-panel {
        height: 72vh;
    }

    .live-chat-identity {
        grid-template-columns: 1fr;
    }
}
