﻿:root {
    --lc-green: #00a884;
    --lc-green-dark: #00866a;
    --lc-bg: #f3f5f7;
    --lc-card: #ffffff;
    --lc-ink: #111827;
    --lc-muted: #6b7280;
    --lc-line: #e5e7eb;
    --lc-soft: #f8fafc;
    --lc-blue: #2563eb;
    --lc-purple: #7c3aed;
    --lc-danger: #dc2626;
    --lc-shadow: 0 18px 55px rgba(15, 23, 42, .14);
    --lc-soft-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--lc-ink);
    background: radial-gradient(circle at 15% 0%, rgba(0,168,132,.12), transparent 28%), var(--lc-bg);
}


.lc-primary-btn, .lc-send-btn {
    background: #7367f0;
    color: white;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0,168,132,.24);
}

    .lc-primary-btn:hover, .lc-send-btn:hover {
        background: #7367f0;
    }

.lc-secondary-btn, .lc-icon-btn, .lc-quick-replies button, .lc-inbox-tabs button, .lc-attach-btn {
    border: 1px solid var(--lc-line);
    background: white;
    color: #334155;
    border-radius: 13px;
    padding: 10px 13px;
    font-weight: 800;
    cursor: pointer;
}

.lc-danger-btn {
    border: 0;
    border-radius: 13px;
    background: #fee2e2;
    color: var(--lc-danger);
    padding: 10px 13px;
    font-weight: 900;
    cursor: pointer;
}

.lc-kicker, .lc-pill {
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lc-green-dark);
    font-size: 11px;
    font-weight: 900;
}

.lc-page {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 94px);
}

#lcWidget {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lc-launcher {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    background: var(--lc-green);
    color: white;
    padding: 16px 20px;
    font-weight: 900;
    box-shadow: var(--lc-shadow);
    cursor: pointer;
}

.lc-launcher-icon {
    font-size: 22px;
}

.lc-widget {
    position: fixed;
    right: 26px;
    bottom: 90px;
    z-index: 39;
    width: 390px;
    max-width: calc(100vw - 28px);
    height: auto;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    background: white;
    border-radius: 24px;
    box-shadow: var(--lc-shadow);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.8);
}

    .lc-widget.open {
        display: flex;
    }

.lc-widget-header {
    background: #7367f0;
    color: white;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .lc-widget-header h1 {
        font-size: 17px;
        margin: 0 0 3px;
    }

    .lc-widget-header p {
        font-size: 13px;
        margin: 0;
        color: rgba(255,255,255,.82);
    }

.lc-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255,255,255,.14);
    color: white;
    border-color: rgba(255,255,255,.22);
    font-size: 22px;
}

.lc-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lc-dots-btn {
    font-size: 20px;
    letter-spacing: 1px;
    transition: background 0.15s;
}

.lc-dots-menu {
    position: relative;
}

.lc-dots-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 160px;
    overflow: hidden;
    z-index: 999;
    animation: lcDropdownIn 0.15s ease;
}

@keyframes lcDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lc-dots-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 0;
}

    .lc-dots-dropdown-item:hover {
        background: #f3f4f6;
    }

.lc-prechat {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 240px);
}


.lc-intro-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

    .lc-intro-card h2 {
        margin: 8px 0 6px;
    }

    .lc-intro-card p, .lc-privacy {
        color: var(--lc-muted);
        margin: 0;
    }

.lc-form {
    display: grid;
    gap: 10px;
}

    .lc-form input, .lc-form textarea, .lc-composer input, .lc-agent-composer input, .lc-agent-login input {
        width: 100%;
        border: 1px solid var(--lc-line);
        background: #f8fafc;
        border-radius: 14px;
        padding: 13px 14px;
        outline: none;
    }

    .lc-form textarea {
        min-height: 92px;
        resize: vertical;
    }

        .lc-form input:focus, .lc-form textarea:focus, .lc-composer input:focus, .lc-agent-composer input:focus, .lc-agent-login input:focus {
            border-color: var(--lc-green);
            background: white;
            box-shadow: 0 0 0 4px rgba(0,168,132,.10);
        }

.lc-privacy {
    font-size: 11px;
    margin-top: 11px;
}

.lc-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: white;
    overflow: hidden;
    height: 100%;
}

.lc-message-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg,#f8fafc,#fff);
}

.lc-message {
    width: fit-content;
    max-width: 82%;
    padding: 11px 13px;
    border-radius: 18px;
    margin: 9px 0;
    background: #ffffff;
    border: 1px solid var(--lc-line);
    box-shadow: var(--lc-soft-shadow);
    word-break: break-word;
}

    .lc-message strong {
        display: block;
        margin-bottom: 4px;
        font-weight: 900;
    }

.lc-message-me {
    margin-left: auto;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.lc-message-support {
    margin-right: auto;
}

#messageList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.lc-composer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--lc-line);
}

.attachment-image,
.chat-attachment-image {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 8px;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}

.image-modal-content {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 16px;
    background: white;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    cursor: default;
}

.lc-message.attachment-only,
.msg.attachment-only,
.lc-bubble.attachment-only {
    padding: 10px;
    width: fit-content;
}

.attachment-image,
.chat-attachment-image {
    display: block;
    max-width: 250px;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    margin: 0;
}

.attachment-wrapper,
.image-attachment {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: fit-content;
}



.lc-back-start-wrap {
    padding: 10px 12px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
    border-top: 1px solid var(--lc-line);
    display: flex;
    justify-content: center;
}

.lc-back-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid #bfe8dc;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff, #ecfdf5);
    color: var(--lc-green-dark);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 168, 132, 0.12);
    transition: all 0.2s ease;
}

    .lc-back-start-btn:hover {
        background: #7367f0;
        border-color: #86efac;
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(0, 168, 132, 0.18);
    }

    .lc-back-start-btn:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(0, 168, 132, 0.12);
    }

    .lc-back-start-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.14), 0 10px 24px rgba(0, 168, 132, 0.16);
    }

.lc-back-start-icon {
    font-size: 15px;
    line-height: 1;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent !important;
}

    body.embedded {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        overflow: hidden !important;
    }

        body.embedded #lcWidget {
            position: absolute !important;
            inset: 0 !important;
            width: 100% !important;
            height: 100% !important;
            max-width: none !important;
            max-height: none !important;
            margin: 0 !important;
            padding: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            background: #ffffff !important;
            border-radius: 20px !important;
            overflow: hidden !important;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
            opacity: 1 !important;
            visibility: visible !important;
            transform: none !important;
        }

        body.embedded #lcLauncher {
            display: none !important;
        }

        body.embedded .lc-page {
            width: 100vw !important;
            height: 100vh !important;
            min-height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            background: transparent !important;
            overflow: hidden !important;
        }

        body.embedded .lc-widget-header {
            flex: 0 0 auto !important;
        }

        body.embedded .lc-prechat {
            flex: 1 1 auto !important;
            max-height: none !important;
            height: auto !important;
            overflow-y: auto !important;
            padding: 16px !important;
        }

        body.embedded .lc-form textarea {
            min-height: 70px !important;
        }

    body:not(.embedded) .lc-widget.open {
        position: fixed;
        inset: 0;
        margin: auto;
        right: auto;
        bottom: auto;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(680px, calc(100vw - 40px));
        height: min(780px, calc(100vh - 60px));
        max-width: none;
        max-height: none;
        z-index: 9999;
        border-radius: 24px;
        box-shadow: var(--lc-shadow);
    }

        body:not(.embedded) .lc-widget.open .lc-prechat {
            max-height: none;
            flex: 1 1 auto;
            overflow-y: auto;
        }

        body:not(.embedded) .lc-widget.open ~ #lcLauncher,
        body:not(.embedded) #lcLauncher.hidden {
            display: none !important;
        }

#lc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 9998;
    cursor: pointer;
}

    #lc-backdrop.active {
        display: block;
    }


@media (max-width: 1180px) {
    .lc-agent-workspace {
        grid-template-columns: 315px 1fr;
    }

    .lc-client-panel {
        display: none;
    }
}

@media (max-width: 860px) {
    .container {
        padding: 10px;
    }

    .lc-agent-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }

    .lc-widget {
        right: 14px;
        bottom: 86px;
    }

    .lc-launcher {
        right: 14px;
        bottom: 18px;
    }
}


@media (max-width: 480px) {
    .lc-widget {
        width: calc(100vw - 20px);
        right: 10px;
    }

    .lc-kb-cards {
        grid-template-columns: 1fr;
    }

    .lc-launcher-text {
        display: none;
    }
}




@media (max-width: 720px) {
    body:not(.embedded) .lc-widget.open {
        width: calc(100vw - 24px);
        height: calc(100vh - 40px);
    }
}
