.chat {
    padding: 32px 0;
    background: #fff;
}

.chat__badge {
    display: inline-block;
    border: 0.5px solid #a9a9a9;
    border-radius: 45px;
    padding: 8px 6px 10px 6px;
    width: 154px;
    height: 31px;
    font-size: 14px;
    line-height: 1;
    color: #b2b2b2;
    text-align: center;
}

.chat__title {
    font-size: 35px;
    font-weight: 800;
    color: #000;
    margin: 24px 0 32px;
}

/* Chat box */
.chat-box {
    border-radius: 20px;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.25);
    background: #fff;
}

/* Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
    padding: 30px 36px;
}

.chat-msg {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.chat-msg--user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.chat-msg__avatar {
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
}

.chat-msg__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-msg__bubble {
    border-radius: 20px;
    background: #f8f8f8;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.4;
    color: #000;
    padding: 31px 26px;
    max-width: 1263px;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.25);
}

.chat-msg--user .chat-msg__bubble {
    background: #e63946;
    color: #fff;
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    padding: 10px 36px;
}

.chat-suggestion {
    border-radius: 45px;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.25);
    background: #fff;
    padding: 15px 24px;
    font-size: 16px;
    color: #000;
    transition: opacity 0.2s;
}

.chat-suggestion:hover {
    opacity: 0.7;
}

/* Divider */
.chat-divider {
    width: 100%;
    height: 2px;
    background: #d8d8d8;
    margin: 28px 0;
}

/* Form */
.chat-form {
    position: relative;
    display: flex;
    padding: 0px 36px 30px;
}

.chat-form__input {
    border-radius: 20px;
    padding: 20px 29px 15px 32px;
    width: 100%;
    height: 84px;
    background: #f8f8f8;
    font-size: 16px;
    line-height: 1.4;
    color: #000;
    resize: none;
    border: none;
    outline: none;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.chat-form__input::placeholder {
    color: #999;
}

.chat-form__btn {
    position: absolute;
    right: 60px;
    bottom: 50px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.25);
}

.chat-form__btn:hover {
    opacity: 0.8;
}

.chat-form__btn img,
.chat-form__btn svg {
    width: 18px;
    height: 18px;
}

/* Typing indicator */
.chat-msg__bubble--typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 20px 26px;
    min-height: 60px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #989fb8;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error */
.chat-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 20px;
    border-radius: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 15px;
}

.chat-error__retry {
    padding: 8px 20px;
    border-radius: 45px;
    background: #ed3953;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.chat-error__retry:hover {
    opacity: 0.9;
}

/* Disabled state */
.chat-form__input:disabled,
.chat-form__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 900px) {
    .chat {
        padding: 40px 0;
    }

    .chat__title {
        font-size: 15px;
        text-align: center;
    }

    .chat-box {
        padding: 8px;
    }

    .chat-msg__bubble {
        font-size: 12px;
        padding: 20px 18px;
    }

    .chat-suggestions {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
        margin-top: 28px;
        padding: 10px 5px;
    }

    .chat-messages {
        display: flex;
        flex-direction: column;
        gap: 14px;
        max-height: 500px;
        overflow-y: auto;
        padding-right: 8px;
        padding: 10px 10px;
    }

    .chat-msg__avatar {
        width: 36px;
        height: 36px;
    }

    .chat-divider {
        display: none;
    }

    .chat-suggestion {
        padding: 5px 6px;
        font-size: 10px;
    }

    .chat-form {
        position: relative;
        display: flex;
        padding: 0px 6px 10px;
    }

    .chat-form__input {
        padding: 16px 40px 6px 11px;
        height: 62px;
        font-size: 11px;
    }

    .chat__badge {
        margin: 0 auto;
        display: flex;
        justify-content: center;
        font-size: 11px;
        height: auto;
        padding: 8px 6px 8px 6px;
    }

    .chat-form__btn {
        right: 12px;
        bottom: 33px;
        width: 30px;
        height: 30px;
    }
}