.gs-chat-conversation {
    --gs-chat-gap: 24px;
    --gs-chat-reveal-duration: 550ms;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
    background: #f3f3f3;
    overflow: hidden;
    box-sizing: border-box;
}

.gs-chat-conversation,
.gs-chat-conversation * {
    box-sizing: border-box;
}

.gs-chat-conversation__message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--gs-chat-gap);
    opacity: 0;
    transition: opacity var(--gs-chat-reveal-duration) ease, transform var(--gs-chat-reveal-duration) ease;
}

.gs-chat-conversation__message:last-child {
    margin-bottom: 0;
}

.gs-chat-conversation__message--left {
    align-items: flex-start;
    transform: translate3d(-28px, 0, 0);
}

.gs-chat-conversation__message--right {
    align-items: flex-end;
    transform: translate3d(28px, 0, 0);
}

.gs-chat-conversation__message.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.gs-chat-conversation__bubble,
.gs-chat-conversation__typing {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 48%;
    border-radius: 28px;
    padding: 18px 24px;
    line-height: 1.3;
    font-size: 18px;
    color: #222;
    background: #e7e7e7;
    min-height: 52px;
}

.gs-chat-conversation__message--left .gs-chat-conversation__bubble,
.gs-chat-conversation__typing--left {
    background: #e0e3e7;
}

.gs-chat-conversation__message--right .gs-chat-conversation__bubble,
.gs-chat-conversation__typing--right {
    background: #e7e7e7;
}

.gs-chat-conversation__bubble::after,
.gs-chat-conversation__typing::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 18px;
    height: 18px;
    background: inherit;
    border-radius: 0 0 16px 0;
}

.gs-chat-conversation__message--left .gs-chat-conversation__bubble::after,
.gs-chat-conversation__typing--left::after {
    left: -6px;
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.gs-chat-conversation__message--right .gs-chat-conversation__bubble::after,
.gs-chat-conversation__typing--right::after {
    right: -6px;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.gs-chat-conversation__typing {
    display: none;
    gap: 6px;
    width: 82px;
    justify-content: center;
}

.gs-chat-conversation__message.is-typing .gs-chat-conversation__typing {
    display: inline-flex;
}

.gs-chat-conversation__message.is-typing .gs-chat-conversation__bubble {
    display: none;
}

.gs-chat-conversation__typing span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(34, 34, 34, 0.55);
    animation: gs-chat-dot 1s infinite ease-in-out;
}

.gs-chat-conversation__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.gs-chat-conversation__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes gs-chat-dot {
    0%, 80%, 100% {
        transform: scale(0.65);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .gs-chat-conversation__bubble,
    .gs-chat-conversation__typing {
        max-width: 62%;
        font-size: 17px;
        padding: 16px 20px;
    }
}

@media (max-width: 767px) {
    .gs-chat-conversation {
        padding: 18px 14px;
    }

    .gs-chat-conversation__message {
        margin-bottom: 16px;
    }

    .gs-chat-conversation__bubble,
    .gs-chat-conversation__typing {
        max-width: 82%;
        font-size: 16px;
        min-height: 46px;
        border-radius: 24px;
        padding: 14px 18px;
    }

    .gs-chat-conversation__bubble::after,
    .gs-chat-conversation__typing::after {
        width: 14px;
        height: 14px;
        bottom: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gs-chat-conversation__message,
    .gs-chat-conversation__typing span {
        transition: none !important;
        animation: none !important;
    }
}
