:root {
    interpolate-size: allow-keywords;
}
.chat-container {
    position: fixed;
    right: 40px;
    bottom: 40px;
    /* width: 720px; */
    width: 170px;
    height: 52px;
    display: flex;
    flex-direction: column-reverse;
    align-items: end;
    max-height: 100%;
    overflow: hidden;
    z-index: 1000;
    transition: all .5s, box-shadow .2s;
    border-radius: 8px;
    box-shadow: 0px 4px 39.4px 0px rgba(64, 123, 249, 0.6);
    animation: box-shadow-fade 3s infinite;
}
@keyframes box-shadow-fade {
    0%, 30% {
        box-shadow: 0px 4px 39.4px 0px rgba(64, 123, 249, 0.6); /* Fully visible */
    }
    50% {
        box-shadow: 0px 4px 39.4px 0px rgba(64, 123, 249, 0); /* Fully transparent */
    }
    80%, 100% {
        box-shadow: 0px 4px 39.4px 0px rgba(64, 123, 249, 0.6); /* Fully visible */
    }
}
.chat-container.open{
    height: 640px;
    width: 684px;
    border: 1px solid var(--light-blue-color);
    animation: none;
    box-shadow: none;

}
.chat-button {
    background: rgba(64, 123, 249, 1);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s;
    
}
.chat-button>div{
    display: flex;
    color: #fff;
    gap: 10px;
    align-items: center;
    font-size: 18px;
    font-weight: 400;
    line-height: 25.2px;
}
.chat-button svg{
    width: 28px;
    height: 20.63px;
}
.message-date {
    padding: 10px 0 0;
    color: var(--gray-color);
    font-size: 12px;
    text-align: right;
}

.message-ai .message-date {
    padding: 0;
    margin-top: -15px;
    margin-left: 50%;
    width: 50%;
}
.chat-button svg:last-child path {
    stroke: #fff;
}

.chat-container.open .chat-button{
    opacity: 0;
}
.chat-container.open .chat-button svg {
    transform: rotateZ(0deg);
}
.chat-body{
    background: #fff;
    border-radius: 8px;
    display: block;
    width: 720px;
    max-height: 800px;
    position: relative;
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: all 0.2s;
}
.chat-container.open .chat-body{
    display: block;
    height: 100%;
    width: 100%;
    opacity: 1;

}
.chat-popup{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    z-index: 100;
}

.chat-hint{
    width:410px;
    height: 192px;
    background: #F2F2F2;
    box-shadow: 0px 8px 18px 0px #0000001A,
    0px 33px 33px 0px #00000017,
    0px 74px 45px 0px #0000000D,
    0px 132px 53px 0px #00000003,
    0px 207px 58px 0px #00000000;
    padding: 20px;
    border-radius: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 1s ease;
}
.chat-hint::after{
    content: '';
    width: 24px;
    height: 24px;
    background: #F2F2F2;
    position: absolute;
    bottom: -12px;
    left: var(--left);
    transform:translateX(-50%) rotate(45deg);
    transition: all 1s ease;
}
.chat-hint .hint-header{
    display: flex;
    justify-content: space-between;
    align-items: start;
}
.chat-hint .hint-header #hideHint{
    cursor: pointer;
}
.chat-hint .hint-text{
    color: var(--second-gray-color);
}
.chat-hint .hint-text span{
    font-weight: 700;
}
.chat-hint .hint-footer{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-hint .dots{
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-hint .dots div{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--new-third-gray-color);
    transition: all 0.3s ease;

}
.chat-hint .dots .active{
    background: var(--new-third-gray-color);
    border: none;
}
.chat-hint .arrows{
    display: flex;
    align-items: center;
    cursor: pointer;
}
.chat-flex-container{
    display: flex;
    justify-content: end;
    width: 100%;
}
.chat-history{
    width: 33%;
    padding: 12px;
    transition: all 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
.history-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.history-title{
    font-family: Roboto Flex;
    font-size: 16px;
    font-weight: 700;
    line-height: 16px;
    color: var(--main-gray-color);
    padding: 8px 12px;
    margin: 0;
}
.history-list{
    overflow-y: scroll;
    height: 100%;
    max-height: 720px;
    padding-bottom: 150px;
}
.history-list::-webkit-scrollbar {
    width: 0px; /*Ширина скроллбара*/
}
.history-list .date{
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    color: var(--main-gray-color);
    padding: 4px 12px;
}
.history-list .date:not(:first-child){
    margin-top: 12px;

}
.history-list .thread{
    width: 100%;
    line-height: 24px;
    color: var(--main-gray-color);
    padding: 10px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.history-list .thread span{
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.history-list .thread .history-delete{
    height: 24px;
    width: 24px;
    display: none;
    cursor: pointer;
}
.history-list .thread.active{
    background: #F2F2F2;
}
.history-list .thread:hover{
    background: #F2F2F2;
}
.history-list .thread:hover .history-delete{
    display: block;
}
/* .history-list .thread.active:hover .history-delete{
    display: none;

} */
.chat-window {
    width: 67%;
    position: relative;
    background: #fff;
    border-color:var(--light-blue-color);
    border-style: solid;
    border-width: 0px;
    border-left-width: 1px;
    overflow: hidden;
    z-index: 10;
    transition: all 0.35s ease;
}
.chat-window.hide::after{
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 999;
}
.chat-window.full{
    width: 100%;
    border-left-width: 0px;
}
.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--light-blue-color);
    display: flex;
    align-items: center;
    width: 100%;
}
.chat-header .chat-logo{
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-balance{
    flex: 1 1 auto;
    padding: 0 12px;
}

.balance-container {
    display: flex;
    /* justify-content: center; */
    align-items: center;
}

.balance-circle {
    position: relative;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: conic-gradient(var(--main-blue-color) calc(var(--balance) * 1%), #e0e0e0 0%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.balance-circle::before {
    content: '';
    position: absolute;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
}

#balance-value {
    font-size: 9px;
    line-height: 8px;
    font-weight: bold;
    position: absolute;
}
.chat-actions{
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 4px;
}
.chat-action{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}
.chat-action:hover{
    background: #F2F2F2;
    
}
.chat-action:hover path,.chat-action:hover span{
    stroke: black;
    color: black;
}
.chat-action span{
    color:var(--forth-gray-color)

}
.chat-panel{
    height: 583px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.chat-messages {
    height: 720px;
    /* min-width: 720px; */
    overflow-y: scroll;
    padding: 20px 20px 150px 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    align-items: end;
    transition: opacity 0.2s ease;
}
.chat-load {
    width: 100%;
    height: 100%;
    display: none;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.chat-load-spinner {
    width: 50px;
    height: 50px;
}

.chat-load-spinner svg {
    width: 100%;
    height: 100%;
}

.chat-load-text {
    font-size: 18px;
    font-weight: 500;
}
.message-load .chat-load-text {
    font-size: 14px;
}

.message-load .chat-load-spinner {
    width: 30px;
    height: 30px;
}

.message.message-ai {
    color: var(--main-gray-color);
    padding-left: 36px;
    padding-top: 3px;
    background: url('../images/noncom_black.svg') left top no-repeat;
    width: 90%;
    margin-right: 10%;
    flex: 0 0 30px;
    line-height: 18.48px;

}

.message.message-ai.message-error {
    background: #5c2f0b66;
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
}

.message.message-my {
    background: rgba(235, 241, 255, 1);
    padding: 12px 20px;
    border-radius: 12px;
    max-width: 90%;
    color: var(--main-gray-color);

}

.chat-input {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    display: none;
    align-items: end;
    background: rgb(255, 255, 255);
    border-top: 1px solid var(--light-blue-color);
    padding: 13px 18px;
    /* z-index: 1000; */
    gap:15px;
}
.chat-preparations{
    display: flex;
    width: 135px;
    position: relative;
    transition: all 1s ease;
    width: max-content;
}
.chat-preparations-button{
    padding: 12.2px;
    border: 1px solid var(--light-blue-color);
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
    height: 26px;
    box-sizing: content-box;

}
.chat-preparations-button:hover{
    border: 1px solid rgba(213, 220, 233, 1);

}
.chat-preparations-button svg{
    transform: rotate(45deg);
    width: 26px;
    height: 26px;
}
.chat-input.open .chat-preparations-button{
    background: var(--light-blue-color);
    border: 1px solid rgba(213, 220, 233, 1);

}
.chat-preparations-container{
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 10px;
    position: absolute;
    left: 0px;
    bottom: 70px;
    transition: all 0.3s;
    z-index: 1;
    pointer-events: none;
}
.chat-input.open .chat-preparations-container{
    pointer-events: all;
    height: 105px;
    width: 205px;
    background: rgb(255,255,255);
    background: radial-gradient(circle, rgba(255,255,255,0.8715861344537815) 94%, rgba(255,255,255,0.6643032212885154) 100%);
    -webkit-box-shadow: 0px -5px 25px 18px rgba(255, 255, 255, 1);
    -moz-box-shadow: 0px -5px 25px 18px rgba(255, 255, 255, 1);
    box-shadow: 0px -5px 25px 18px rgba(255, 255, 255, 1);
}
.chat-input.open .chat-preparations-container .chat-preparation{
    opacity: 1;
}
.chat-input.open .chat-preparations-container .chat-preparation:nth-child(1){
    bottom: 55px;
}
.chat-input.open .chat-preparations-container .chat-preparation:nth-child(2){
    bottom: 0px;
}
.chat-preparation{
    position: absolute;
    bottom: 0;
    width: max-content;
    left: 0;
    padding: 10px;
    background-color: white;
    opacity: 0;
    min-height:  45px;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all .3s ease;
    border-radius: 4px;
    border: 1px solid rgba(213, 220, 233, 1);

}
.chat-preparation:last-child{
    z-index: 9999;
}
.chat-preparation svg{
    position: fixed;
}
.chat-preparation span{
    padding-left: 30px;
}
.chat-preparation:hover{
    background: var(--light-blue-color);
}
.chat-message-entry{
    margin-bottom: -3px;
    position: relative;
    height: auto;
    flex: 1 1 auto;
    /* transition: all 1s ease; */
}
.chat-message-entry svg {
    position: absolute;
    top: 50%;
    right: 35px;
    cursor: pointer;
    transform: translateY(-50%);

}
textarea.chat-input-textarea {
    font-size: 16px;
    line-height: 19.2px;    
    padding: 16.5px 114px 16.5px 14px;
    max-height: 100px;
    height: 52px;
    border-radius: 8px;
    border: 1px solid var(--light-blue-color);
}
textarea.chat-input-textarea:hover{
    border: 1px solid rgba(213, 220, 233, 1);
}
textarea.chat-input-textarea::-webkit-scrollbar {
    width: 0px; 
}
textarea.chat-input-textarea::placeholder{
    color: rgba(111, 122, 146, 1);

}
span.chat-input-button {
    position: absolute;
    right: 70px;
    top: 20px;
    font-size: 12px;
    font-weight: 300;
    line-height: 14.4px;
    color: var(--second-gray-color)

}
.chat-messages::-webkit-scrollbar {
    width: 0px; /*Ширина скроллбара*/
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgb(115, 156, 245); /*Цвет ползунка скроллбара*/
}

.chat-messages::-webkit-scrollbar-track {
    background-color: rgba(64, 123, 249, 1); /*Цвет фона скроллбара*/
}
.chat-window table td, .chat-window table th {
    font-size: 12px;
    padding: 5px;
    border: 1px solid var(--blue15-color);
}

.chat-window table {
    margin-left: -40px;
    border-collapse: collapse;
    margin-top: 15px;
}
.chat-button svg:first-child path {
    fill: #fff;
}
.message-actions{
    display: flex;
    margin-top: 8px;
    gap: 8px;
    opacity: 0;
    transition: all 0.5s;
    height: 16px;

}
.message-ai:hover .message-actions{
    opacity: 1;
}
.message-actions .message-copy{
    position: relative;
}
.message-actions .message-copy::after{
    content: "Скопировано";
    position: absolute;
    top: 17px;
    left: 0;
    font-size: 12px;
    line-height: 12px;
    padding: 5px;
    border-radius: 4px;
    background-color: #586173;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
}
.message-actions .message-copy:active::after{
    opacity: 1;
}
.message-actions .message-copy:active svg{
    fill: #586173;
}
.message-actions .message-rewrite{
    transform-origin: center;
    transition: all 0.4s;
}
.message-actions .message-rewrite:active{
    transform: rotate(360deg);
}
@media  screen and (max-width: 768px) {
    .chat-container {
        right: 20px;
        bottom: 20px;
    }
    .chat-container.open{
        height: 100%;
        width: 100%;
        right: 0px;
        bottom: 0px;
    }
    .chat-body{
        width: 100%;
        height: 100%;
        max-height: none;
        transition: all 0.5s;

    }
    /* .chat-window{
        width: 0%;
    } */
    .chat-history{
        width: 100%;
        height: 100%;
        padding: 6px;
        transition: all 0.4s ease;
        left: -100%;
        z-index: 10;
        background: #fff;
    }
    /* .chat-history::after{
        content: '';
        width: 43%;
        height: 100%;
        position: absolute;
        left: 100%;
        top: 0;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: all .1s;
        z-index: -1;
    } */
    .chat-history.open{
        left: 0;
    }
    /* .chat-history.open::after{
        transition: all 0.5s;
        transition-delay: 0.7s;
        opacity: 1;

    } */
    .chat-window {
        /* margin-top: 400px; */
        width: 40%;
        opacity: 0.1;
        z-index: 2;
        transition: all 0.4s ease;

    }
    .chat-window.full{
        margin-top: 0px;

        opacity: 1;
    }
    .chat-flex-container{
        height: 100%;
    }
    .chat-header{
        padding: 12px 20px;
    }
    
    .chat-header .chat-logo svg:nth-child(2){
        display: none;        
    }
    .chat-actions svg{
        width: 20px;
        height: 20px;
    }
    .chat-panel{
        height: 100%;
    }
    .chat-messages {
        height: 86vh;
        padding: 10px 10px 130px 10px;
    }
    .chat-input{
        padding: 10px;
    }
    .chat-load {
        width: 100%;
        height: 86vh;
        gap: 10px;
    }
    .chat-load .chat-load-text{
        font-size: 16px;
    }
    .chat-load-spinner svg {
        width: 80%;
        height: 90%;
    }
    .chat-hint {
        width: 296px;
        height:226px;
        padding: 20px;
        gap: 16px;
        border-radius: 8px;


    }
    .chat-message-entry svg{
        right: 20px;
    }
    textarea.chat-input-textarea{
        padding: 16.5px 50px 16.5px 14px;
    }

}