* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Source Sans 3", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}

ul,
li {
    list-style: none;
}

:root {
    --white: #FFFFFF;
    --maincolor: #242E47;
    --padding: 23px;
    --grey: #DEE4EC;
    --grey2: #899DAF;
    --green: #7EB900;
    --blue: #324167;
}

.gigachat__container {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 9999;
    display: grid;
    gap: 19px;
    padding: 0;
}

.gigachat__container.active .gigachat {
    max-height: 1000px;
    opacity: 1;
    overflow: visible;
}

.gigachat {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0px 23.333px 46.667px 0px rgba(37, 46, 71, 0.14);
    position: relative;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out;
    background: white;
}



.gigachat__header {
    padding: var(--padding);
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background-size: cover;
}

.gigachat__header h3,
.gigachat__header small {
    position: relative;
    z-index: 1;
    color: var(--white);
}

small {
    font-size: 12.444px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}

.gigachat__header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(19px);
    z-index: 0;
}

.gigachat__header-avatar {
    position: relative;
    width: 46.667px;
    height: 46.667px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    margin-bottom: 15px;
    background-color: rgb(36, 38, 43);
    border: 5px solid rgb(36, 38, 43);
}

.gigachat__close {
    width: 31.111px;
    height: 31.111px;
    position: absolute;
    top: 23px;
    right: 23px;
    z-index: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.gigachat__close i {
    width: 18.667px;
    height: 18.667px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gigachat__body {
    font-family: "Wix Madefor Display";
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}

.gigachat__body small {
    color: var(--grey2);
}

.gigachat__messages-list {
    display: grid;
    gap: 27px;
    max-height: 375px;
    overflow-y: auto;
    padding: var(--padding);
    background: white;
}

.hero-message {
    justify-self: flex-end;
    width: fit-content;
}

.hero-message p {
    color: var(--white);
    background-color: var(--maincolor);
    padding: 8px 11.5px;
    border-radius: 8px 0px 8px 8px;
    margin-bottom: 3px;
    font-size: 14px;
}

.other-message {
    justify-self: flex-start;
    width: auto;
    display: flex;
}

.other-message.loading p, 
.other-message.loading small {
    display: none;
}

.other-message__avatar {
    width: 31.111px;
    height: 31.111px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-right: 7px;
    background-color: rgb(36, 38, 43);
    border: 5px solid rgb(36, 38, 43);
}

.other-message__body small {
    margin-left: auto;
}

.other-message__body p {
    border-radius: 0px 8px 8px 8px;
    background: var(--grey);
    padding: 8px 11.5px;
    font-weight: 400;
    line-height: 150%;
    font-size: 14px;
}

.other-message__name {
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    color: var(--maincolor);
    margin-bottom: 3px;
}

.gigachat__loader {
    border-radius: 0px 8px 8px 8px;
    background: var(--grey);
    padding: 8px 11.5px;
    line-height: 12px;
    display: none;
}

.loading .gigachat__loader {
    display: block;
}

.gigachat__loader span {
    width: 11.667px;
    height: 11.667px;
    border-radius: 50%;
    background-color: var(--white);
    display: inline-block;
    animation: loader 1.5s infinite ease-in-out;
    margin-bottom: 0;
}

.gigachat__loader span:nth-of-type(2) {
    animation-delay: 0.5s;
}
.gigachat__loader span:nth-of-type(3) {
    animation-delay: 1s;
}


.gigachat__loader span + span {
    margin-left: 6px;
}

.gigachat__input-wrapper {
    padding: 15.5px var(--padding);
    display: flex;
    gap: 11px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--grey);
}

.gigachat__file {
    position: relative;
    display: block;
    width: 18.667px;
    height: 18.667px;
    cursor: pointer;
}

.gigachat__file i {
    pointer-events: none;
}

.gigachat__file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
}

.gigachat__smile {
    width: 18.667px;
    height: 18.667px;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.gigachat__input {
    width: auto;
    border: none;
    background-color: var(--white);
    border-radius: 8px;
    padding: 8px 11.5px;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    color: var(--maincolor);
    flex: 1 1 auto;
}

.gigachat__input:focus-visible {
    outline: none;
}

.gigachat__send {
    display: flex;
    width: 31.111px;
    height: 31.111px;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--green);
    border: none;
    cursor: pointer;
}

.gigachat__send i {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gigachat__arrow {
    width: 15px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='11' viewBox='0 0 15 11' fill='none'%3E%3Cpath d='M7.5 11L0 0H15L7.5 11Z' fill='white'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: absolute;
    top: 100%;
    right: 18px;
    z-index: 3;
}

.gigachat__open {
    display: flex;
    width: 50px;
    height: 50px;
    justify-content: center;
    align-items: center;
    background-color: var(--blue);
    justify-self: flex-end;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    border: none;
}

.gigachat__open.active::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--green);
    border-radius: 50%;
    bottom: 38px;
    left: 38px;
}

@keyframes loader {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}