body.live-chat-open {
    overflow: hidden;
}

.live-chat {
    --live-chat-accent: #0071e3;
    --live-chat-bubble-radius: 14px;
    --live-chat-panel-radius: 18px;
    position: fixed;
    inset-inline-start: max(1rem, env(safe-area-inset-left));
    inset-block-end: max(1rem, env(safe-area-inset-bottom));
    z-index: 1200;
    font-family: inherit;
    isolation: isolate;
}

.live-chat--end {
    inset-inline-start: auto;
    inset-inline-end: max(1rem, env(safe-area-inset-right));
}

.live-chat--bubble-round {
    --live-chat-bubble-radius: 22px;
    --live-chat-panel-radius: 24px;
}

.live-chat--bubble-sharp {
    --live-chat-bubble-radius: 8px;
    --live-chat-panel-radius: 10px;
}

.live-chat__backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 0;
}

.live-chat__launcher {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .72rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--live-chat-accent);
    color: #fff;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--live-chat-accent) 36%, transparent);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
    touch-action: manipulation;
}

.live-chat__launcher--circle {
    width: 3.35rem;
    height: 3.35rem;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
}

.live-chat__launcher--circle .live-chat__launcher-label {
    display: none;
}

.live-chat__launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--live-chat-accent) 42%, transparent);
}

.live-chat__launcher-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

.live-chat__launcher-label {
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
}

.live-chat__badge {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.live-chat__panel {
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: calc(100% + .75rem);
    z-index: 3;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(34rem, calc(100dvh - 7rem));
    display: flex;
    flex-direction: column;
    border-radius: var(--live-chat-panel-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    transform-origin: bottom center;
    animation: live-chat-panel-in .22s ease-out;
}

.live-chat--end .live-chat__panel {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform-origin: bottom left;
}

.live-chat--end:not(.live-chat--bubble-sharp) .live-chat__panel {
    transform-origin: bottom left;
}

.live-chat:not(.live-chat--end) .live-chat__panel {
    transform-origin: bottom right;
}

@keyframes live-chat-panel-in {
    from {
        opacity: 0;
        transform: translateY(.55rem) scale(.98);
    }

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

.live-chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--live-chat-accent) 88%, #000), var(--live-chat-accent));
    color: #fff;
    flex-shrink: 0;
}

.live-chat__head-copy {
    min-width: 0;
    flex: 1;
}

.live-chat__title {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.35;
}

.live-chat__subtitle {
    margin: .15rem 0 0;
    font-size: .74rem;
    opacity: .88;
    line-height: 1.45;
}

.live-chat__close {
    flex-shrink: 0;
    border: 0;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: background .15s ease, transform .15s ease;
}

.live-chat__close:hover,
.live-chat__close:focus-visible {
    background: rgba(255, 255, 255, .28);
    outline: none;
}

.live-chat__close:active {
    transform: scale(.96);
}

.live-chat__messages {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: .85rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
    min-height: 8rem;
    flex: 1 1 auto;
}

.live-chat__bubble {
    max-width: 88%;
    padding: .55rem .7rem;
    border-radius: var(--live-chat-bubble-radius);
    font-size: .84rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.live-chat__bubble--visitor {
    align-self: flex-end;
    background: var(--live-chat-accent);
    color: #fff;
    border-end-start-radius: 4px;
}

.live-chat__bubble--support {
    align-self: flex-start;
    background: #fff;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, .06);
    border-end-end-radius: 4px;
}

.live-chat__bubble--system {
    align-self: center;
    max-width: 100%;
    background: transparent;
    color: #6e6e73;
    font-size: .76rem;
    text-align: center;
    padding: .2rem .4rem;
}

.live-chat__starters {
    padding: .55rem .75rem .15rem;
    border-top: 1px solid rgba(0, 0, 0, .05);
    background: #fff;
    flex-shrink: 0;
    max-height: 6.5rem;
    overflow-y: auto;
}

.live-chat__starters-label {
    margin: 0 0 .45rem;
    font-size: .72rem;
    color: #6e6e73;
}

.live-chat__starter-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.live-chat__starter {
    border: 1px solid color-mix(in srgb, var(--live-chat-accent) 24%, #d2d2d7);
    background: color-mix(in srgb, var(--live-chat-accent) 8%, #fff);
    color: #1d1d1f;
    border-radius: 999px;
    padding: .35rem .65rem;
    font: inherit;
    font-size: .76rem;
    line-height: 1.35;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    touch-action: manipulation;
}

.live-chat__starter:hover {
    background: color-mix(in srgb, var(--live-chat-accent) 14%, #fff);
    border-color: color-mix(in srgb, var(--live-chat-accent) 40%, #d2d2d7);
}

.live-chat__composer {
    display: grid;
    gap: .55rem;
    padding: .75rem;
    padding-block-end: max(.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
    flex-shrink: 0;
}

.live-chat__identity {
    display: grid;
    gap: .45rem;
    padding: .55rem .75rem 0;
    border-top: 1px solid rgba(0, 0, 0, .05);
    background: #fff;
    flex-shrink: 0;
}

.live-chat__identity-title {
    margin: 0 0 .35rem;
    font-size: .72rem;
    font-weight: 700;
    color: #1d1d1f;
}

.live-chat__identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
}

.live-chat__identity.is-collapsed .live-chat__identity-fields {
    display: none;
}

.live-chat__identity:not(.is-collapsed) .live-chat__identity-summary {
    display: none;
}

.live-chat__identity-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    margin: 0;
    padding: .4rem .55rem;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 10px;
    background: #f8fafc;
    color: #1d1d1f;
    font: inherit;
    font-size: .76rem;
    line-height: 1.35;
    cursor: pointer;
    text-align: start;
    touch-action: manipulation;
}

.live-chat__identity-summary:hover {
    background: #f1f5f9;
}

.live-chat__identity-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.live-chat__identity-edit {
    flex-shrink: 0;
    color: var(--live-chat-accent);
    font-size: .72rem;
    font-weight: 700;
}

.live-chat__identity-fields {
    display: grid;
    gap: .45rem;
}

.live-chat__field {
    display: grid;
    gap: .25rem;
    font-size: .74rem;
    color: #6e6e73;
}

.live-chat__field input,
.live-chat__input-row textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 12px;
    padding: .55rem .7rem;
    font: inherit;
    font-size: .84rem;
    background: #fff;
    resize: none;
}

.live-chat__input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .45rem;
    align-items: end;
}

.live-chat__send {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--live-chat-accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

.live-chat.is-open {
    z-index: 1300;
}

.live-chat.is-open .live-chat__launcher {
    box-shadow: 0 8px 22px color-mix(in srgb, var(--live-chat-accent) 28%, transparent);
}

.live-chat__starters[hidden],
.live-chat__panel[hidden],
.live-chat__backdrop[hidden],
.live-chat__identity-summary[hidden] {
    display: none !important;
}

@keyframes live-chat-nudge {
    0%, 100% { transform: translate3d(0, 0, 0); }
    12% { transform: translate3d(-2px, 0, 0) rotate(-1.5deg); }
    24% { transform: translate3d(2px, 0, 0) rotate(1.5deg); }
    36% { transform: translate3d(-1px, 0, 0); }
    48% { transform: translate3d(1px, 0, 0); }
}

@keyframes live-chat-ring {
    0% {
        box-shadow: 0 10px 28px color-mix(in srgb, var(--live-chat-accent) 36%, transparent),
            0 0 0 0 color-mix(in srgb, var(--live-chat-accent) 45%, transparent);
    }

    70% {
        box-shadow: 0 10px 28px color-mix(in srgb, var(--live-chat-accent) 36%, transparent),
            0 0 0 10px transparent;
    }

    100% {
        box-shadow: 0 10px 28px color-mix(in srgb, var(--live-chat-accent) 36%, transparent),
            0 0 0 0 transparent;
    }
}

.live-chat--nudge .live-chat__launcher {
    animation: live-chat-nudge .7s ease-in-out 2, live-chat-ring 1.4s ease-out 1;
}

.live-chat--unread .live-chat__launcher {
    animation: live-chat-ring 2.2s ease-out infinite;
}

.live-chat--unread.live-chat--nudge .live-chat__launcher {
    animation: live-chat-nudge .7s ease-in-out 2, live-chat-ring 2.2s ease-out infinite;
}

@media (max-width: 640px) {
    .live-chat {
        inset-inline-start: max(.75rem, env(safe-area-inset-left));
        inset-inline-end: max(.75rem, env(safe-area-inset-right));
        inset-block-end: max(.75rem, env(safe-area-inset-bottom));
    }

    .live-chat--end {
        inset-inline-start: max(.75rem, env(safe-area-inset-left));
        inset-inline-end: max(.75rem, env(safe-area-inset-right));
    }

    .live-chat__launcher-label {
        display: none;
    }

    .live-chat.is-open {
        inset: 0;
        inset-inline-start: 0;
        inset-inline-end: 0;
        inset-block-start: 0;
        inset-block-end: 0;
        pointer-events: none;
    }

    .live-chat.is-open .live-chat__backdrop,
    .live-chat.is-open .live-chat__panel {
        pointer-events: auto;
    }

    .live-chat.is-open .live-chat__launcher {
        opacity: 0;
        pointer-events: none;
        transform: scale(.92);
    }

    .live-chat.is-open .live-chat__panel {
        position: fixed;
        inset-inline: 0;
        inset-block-end: 0;
        inset-block-start: auto;
        width: 100%;
        max-height: min(88dvh, calc(100dvh - env(safe-area-inset-top) - .5rem));
        border-end-start-radius: 0;
        border-end-end-radius: 0;
        transform-origin: bottom center;
    }

    .live-chat__panel {
        width: min(calc(100vw - 1.5rem), 22rem);
        max-height: min(78dvh, calc(100dvh - 5.5rem));
    }

    .live-chat__messages {
        min-height: 6rem;
    }

    .live-chat__starters {
        max-height: 5.25rem;
    }

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

@media (prefers-reduced-motion: reduce) {
    .live-chat__panel {
        animation: none;
    }

    .live-chat--nudge .live-chat__launcher {
        animation: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--live-chat-accent) 35%, transparent);
    }

    .live-chat--unread .live-chat__launcher {
        animation: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--live-chat-accent) 35%, transparent);
    }
}
