:root {
    --main-color: #E20613;
    --main-font-color: #000;
    --white-color: #FFF;
    --border-color: #707070;

    font-family: Montserrat, sans-serif;
    color: var(--main-font-color);
    font-weight: 400;
    line-height: 1;
}

#page {
    display: grid;
    grid-template-areas: "header"
        "main"
        "footer";
}


/* Header and menu */
#header {
    grid-area: header;
    display: flex;

    background: var(--white-color);
    margin: 35px 140px;

    gap: 10px;

    justify-content: center;
}

#logo-header {
    min-width: max-content;

    cursor: pointer;
}

#menu {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
}

#menu-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-grow: 1;
    flex-shrink: 0;
    gap: 4%;
}

.menu-item {
    text-align: center;
    cursor: pointer;
    color: var(--main-font-color);
    text-decoration: none;
}

.menu-item:hover {
    color: var(--main-color);
}

.menu-item:has(img) {
    min-width: max-content;
}

.language-arrow {
    display: inline-block;
    font-size: 18px;
}

.language-div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 2;
}

.language-div>hr {
    width: 90%;
    margin-bottom: 10px;
}

.languages-div {
    display: flex;
    gap: 50px;
}

@media only screen and (max-width: 520px) {
    #header {
        display: none;
    }

    #header-mobile {
        grid-area: header;
        display: flex;

        background: var(--white-color);
        margin-inline: 36px;
        margin-block: 25px;

        gap: 10px;

        justify-content: space-between;
    }

    .sandwich-container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
    }

    .sandwich-bar1,
    .sandwich-bar2,
    .sandwich-bar3 {
        width: 58px;
        height: 3px;
        background-color: #000;
    }

    #menu-items-mobile {
        grid-area: main;
        padding-inline: 36px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 60px;

    }

    .menu-item-mobile {
        cursor: pointer;
        color: var(--main-font-color);
        text-decoration: none;
    }

    .menu-item-mobile:hover {
        color: var(--main-color);
    }

    .menu-item-mobile:has(img) {
        min-width: max-content;
    }

    .languages-div {
        flex-direction: column;
        justify-content: center;
    }
}

@media only screen and (min-width: 521px) {
    #header {
        display: flex;
    }

    #header-mobile {
        display: none;
    }
}


/* Footer */
#footer {
    grid-area: footer;

    background: var(--white-color);
    margin: 83px 140px 105px 140px;
}

#logo-footer {
    display: flex;
    align-items: center;

    cursor: pointer;
    margin-bottom: 36px;
}

#footer-columns {
    display: flex;
    flex-wrap: wrap;
    margin-top: 49px;
    gap: 10px;
}

.footer-column {
    flex: 1;
    min-width: max-content;
    margin-bottom: 45px;
}

#sm-icons {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#footer-intercad-logo-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

#footer-intercad-img {
    max-width: 100%;
    height: 100px;
    width: auto;
    object-fit: contain;
    object-position: left;
    margin-left: -20px;
    margin-top: -20px;
}

#footer-company-subtitle {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: -10px;
}

.footer-contact-hr {
    background-color: var(--border-color);
    height: 1px;
    border: 0;
    width: 17rem;
    margin-bottom: 25px;
}

#footer-contact-grid {
    display: grid;
    grid-template-columns: max-content auto;
    gap: 15px 25px;
    line-height: 1.5;
}

.footer-contact-label {
    text-transform: uppercase;
    font-weight: 600;
}

.footer-contact-value {
    line-height: 1.5;
}

.footer-button {
    margin-bottom: 20px;
}


/* Main content */
#main {
    /* display: grid;
    place-items: center; */

    grid-area: main;

    padding: 82px 140px;
    background: transparent url('../img/myaxisvm_hatter_v3.jpg') 0% 0% repeat padding-box;
    background-size: cover;
}

#main-without-bg {
    grid-area: main;
    padding: 82px 140px;
}

#greeting {
    color: var(--white-color);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 35px;
}

#content {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

#content-404 {
    display: grid;
    justify-content: center;
}

.content-container-form {
    height: min-content;

    background-color: var(--white-color);
    padding: 101px 138px 109px 138px;
}

.content-column {
    flex: 1;
    display: grid;
    gap: 15px;
    max-width: 1000px;
    min-width: min-content;
    height: min-content;
}

.company-page {
    gap: 20px;
}

.company-page .content-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.company-page h1 {
    margin-bottom: 20px;
}

.company-page h3,
.company-page p {
    margin-bottom: 0;
}

.company-page form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.company-page .input-container,
.company-page .error-message {
    margin-bottom: 0;
}

.content-column-center {
    max-width: max-content;
}

.content-container {
    height: min-content;

    background-color: var(--white-color);
    padding: 55px 50px 40px 55px;
}

.content-container-center {
    width: 676px;
}

.content-container-bottom-padding {
    height: min-content;

    background-color: var(--white-color);
    padding: 55px 50px 90px 55px;
}

.logo-on-top {
    margin-bottom: 35px;
}

.logo-in-content {
    margin-block: 35px;
}

.button-container-right {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    margin-top: 44px;
    gap: 25px;
}

.button-container-grid {
    display: grid;
    grid-template-columns: min-content;
    grid-template-rows: min-content;
    grid-template-areas: "button-top-left button-top-right"
        "button-bottom-left button-bottom-right";
    margin-top: 20px;
    gap: 15px;
}

.button-small-container {
    padding-top: 10px;
}

.button,
.button-small {
    display: grid;
    place-items: center;

    border: 1px solid var(--border-color);
    color: var(--main-font-color);
    background-color: var(--white-color);
    text-decoration: none;

    cursor: pointer;
}

.button {
    width: fit-content;
    min-width: 255px;
    height: 45px;
    font-size: 16px;
    padding-inline: 16px;
}

.button-small {
    width: 105px;
    height: 30px;
    font-size: 9px;
}

.button:hover,
.button-small:hover {
    color: var(--white-color);
    background-color: var(--main-color);
}


.button-top-left {
    grid-area: button-top-left;
}

.button-top-right {
    grid-area: button-top-right;
}

.button-bottom-left {
    grid-area: button-bottom-left;
}

.button-bottom-right {
    grid-area: button-bottom-right;
}

p {
    font-size: 18px;
}

ul {
    font-size: 18px;
    margin-top: 15px;
}

h1 {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 40px;
}

h2 {
    font-size: 35px;
    line-height: 43px;
    font-weight: 600;
    margin-bottom: 30px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
}


h4 {
    font-size: 25px;
    font-weight: 600;
    margin-bottom: 18px;
}

h5 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 44px;
}

h6 {
    color: var(--main-color);
    font-size: 25px;
    font-weight: 600;
    margin-bottom: 35px;
}

h6.in-content {
    margin-top: 35px;
}

.arrow-down-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.arrow-down {
    font-size: 18px;
    width: min-content;
    cursor: pointer;
}

hr {
    background-color: var(--border-color);
    height: 1px;
    border: 0;
    width: 100%;
}

.computer-container {
    display: grid;
    grid-template-columns: 145px auto;
    grid-template-rows: min-content;
    grid-template-areas: "computer-label-1 computer-info-1"
        "computer-label-2 computer-info-2"
        "computer-label-3 computer-info-3";
    margin-top: 14px;
    gap: 20px 10px;
}

.computer-label-1 {
    grid-area: computer-label-1;
    justify-self: end;
}

.computer-info-1 {
    grid-area: computer-info-1;
}

.computer-label-2 {
    grid-area: computer-label-2;
    justify-self: end;
}

.computer-info-2 {
    grid-area: computer-info-2;
}

.computer-label-3 {
    grid-area: computer-label-3;
    justify-self: end;
}

.computer-info-3 {
    grid-area: computer-info-3;
}

#student-div,
#trial-div,
#light-div,
#viewer-div {
    display: none;
}

.data-change {
    display: grid;
    grid-template-areas: "data-change-label"
        "data-change-value"
        "data-change-button-container";
    margin-bottom: 20px;
    gap: 4px;
}

.data-change-label {
    grid-area: data-change-label;
}

.data-change-value {
    grid-area: data-change-value;
}

.data-change-value>input,
.data-change-value>select {
    margin-top: 0px;
}

.data-change-button-container {
    grid-area: data-change-button-container;
}

.input-container {
    margin-bottom: 36px;
}

.contact-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px 20px;

    border: 1px solid var(--border-color);
    padding: 25px 30px;
    margin-top: 20px;
}

.contact-row {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px 20px;
}

.contact-row .input-container {
    flex: 1 1 200px;
    min-width: 0;
    margin-bottom: 0;
}

.contact-row .input-container>label {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.contact-row .input-container>input {
    width: 100%;
    margin-top: 6px;
}

.contact-row>.button,
.contact-delete>.button {
    min-width: 130px;
}

.contact-delete {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 100%;
    margin-top: 5px;
}

.add-contact-heading {
    margin-top: 40px;
}

input,
select {
    border: 1px solid var(--border-color);
    width: 400px;
    height: 45px;
    margin-top: 13px;
    padding-inline: 15px;
    font-size: 16px;
}

input[type=checkbox] {
    width: 20px;
    height: 20px;
    accent-color: var(--main-font-color);
    margin-top: 0px;
}

.checkbox-container {
    display: grid;
    grid-template-columns: 20px 1fr;
}

.checkbox-container>label {
    margin-left: 16px;
}

#request-steps {
    display: grid;
    grid-template-columns: 1fr 4.5fr;
    gap: 30px;
}

.request-step-number {
    font-size: 30px;
    font-weight: 600;
    justify-self: end;
}

.request-step-description {
    padding-top: 15px;
}

#forgotpass {
    font-size: 16px;
    margin-top: 32px;
}

#forgotpass>a {
    color: var(--main-font-color);
}

dialog {
    margin: auto;
    border: 0;
    border-bottom: 11px solid var(--main-color);
    padding-inline: 52px;
    padding-block: 62px;
    max-width: 812px;
}

dialog::backdrop {
    background-color: #000;
    opacity: 0.7;
}

input[type="file"] {
    display: none;
}

.upload-button {
    display: inline-block;
}

.upload-container {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: start;
    gap: 25px;
}

.upload-title {
    font-weight: 600;
}

.upload-details {
    font-weight: 400;
    display: block;
}

.red-star {
    color: var(--main-color);
}

.error-message {
    color: var(--main-color);
    display: block;
    margin-bottom: 30px;
    font-weight: 500;
    font-size: 18px;
}

.deny-message {
    margin-bottom: 5px;
}

.title-404 {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 15px;
}

.title-404-red {
    color: var(--main-color);
    margin-bottom: 0px;
}



.cookies-eu-banner {
    background: #444;
    color: #fff;
    padding: 6px;
    font-size: 13px;
    text-align: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.cookies-eu-banner button {
    text-decoration: none;
    background: #222;
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    padding: 4px 7px;
    margin: 2px 0;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.07s, color 0.07s, border-color 0.07s;
}

.cookies-eu-banner button:hover {
    background: #fff;
    color: #222;
}

.hidden {
    display: none !important;
}

#limit {
    font-size: 12px;
}

/* TA Page & Container Styles matching MYAXISVM site design */
.ta-wrapper {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.ta-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.ta-header-row h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--main-font-color);
}

.site-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white-color);
    color: var(--main-font-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 14px;
    font-family: Montserrat, sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-toggle-btn:hover {
    background: var(--main-color);
    color: var(--white-color);
    border-color: var(--main-color);
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* Filters Section */
#filterDiv {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 24px;
    margin-bottom: 30px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--main-font-color);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom Multiselect */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.multiselect-box:hover,
.multiselect-box:focus {
    border-color: var(--main-color);
}

.multiselect-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
}

.multiselect-text.has-selection {
    color: var(--main-font-color);
    font-weight: 600;
}

.multiselect-chevron {
    font-size: 10px;
    color: #777;
    margin-left: 8px;
}

.multiselect-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 260px;
    box-sizing: border-box;
}

.multiselect-dropdown.open {
    display: block;
}

.multiselect-actions {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
}

.btn-clear-filter {
    background: none;
    border: none;
    font-size: 11px;
    font-family: Montserrat, sans-serif;
    color: var(--main-color);
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
}

.btn-clear-filter:hover {
    text-decoration: underline;
}

.multiselect-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 6px 0;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.multiselect-option:hover {
    background-color: #fce8e8;
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--main-color);
    cursor: pointer;
}

.multiselect-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text search & checkboxes row */
.text-filter-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.text-input-col {
    flex: 1 1 320px;
}

.site-input {
    width: 100%;
    max-width: 100%;
    height: 42px;
    margin-top: 0;
    border: 1px solid var(--border-color);
    padding: 0 12px;
    font-size: 14px;
    font-family: Montserrat, sans-serif;
    box-sizing: border-box;
}

.site-input:focus {
    outline: none;
    border-color: var(--main-color);
}

.text-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    height: 42px;
}

.site-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    color: var(--main-font-color);
}

.site-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--main-color);
    cursor: pointer;
}

/* Table styling */
.table-container-outer {
    width: 100%;
    overflow-x: auto;
    background: var(--white-color);
}

#taTable {
    width: 100% !important;
    border-collapse: collapse;
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    color: var(--main-font-color);
}

#taTable thead th {
    background-color: #f7f7f7;
    color: var(--main-font-color);
    font-weight: 600;
    font-size: 13px;
    padding: 12px 10px;
    border-bottom: 2px solid var(--main-color);
    text-align: left;
    white-space: nowrap;
}

#taTable tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #eaeaea;
    vertical-align: middle;
    line-height: 1.4;
}

#taTable tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#taTable tbody tr:hover {
    background-color: #fef4f4;
}

/* DataTables controls styling */
.dt-container {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
}

.dt-layout-row {
    margin: 15px 0;
}

.dt-paging {
    margin-top: 15px;
}

.dt-paging .dt-paging-button {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid var(--border-color);
    background: var(--white-color);
    color: var(--main-font-color);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.dt-paging .dt-paging-button.current,
.dt-paging .dt-paging-button.current:hover {
    background: var(--main-color) !important;
    color: var(--white-color) !important;
    border-color: var(--main-color) !important;
}

.dt-paging .dt-paging-button:hover:not(.current) {
    background: #f0f0f0;
}

.dt-info {
    font-size: 13px;
    color: #666;
    padding-top: 10px;
}

@media only screen and (max-width: 520px) {

    #page {
        width: 100%;
    }

    #header {
        margin-inline: 36px;
    }

    #footer {
        margin-inline: 36px;
        margin-top: 0px;
    }

    #logo-footer {
        margin-top: 36px;
    }

    #main {
        padding-inline: 36px;
        padding-block: 40px;
    }

    #main-without-bg {
        padding-inline: 36px;
    }

    .content-column-center {
        max-width: 100%;
    }

    .content-container-center {
        width: 100%;
    }

    .content-container-form {
        padding-inline: 25px;
        padding-top: 36px;
        padding-bottom: 67px;
    }

    input,
    select {
        max-width: 400px;
    }
}

/* Chatbot portal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}

.modal-overlay.open {
    display: flex;
}

.modal-window {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 45px;
    background-color: var(--white-color);
}

.modal-window h1 {
    margin-bottom: 15px;
}

.modal-error {
    margin-top: 15px;
    font-weight: 600;
    color: var(--main-color);
}

.license-list {
    display: grid;
    gap: 10px;
    margin-top: 25px;
}

.license-item {
    display: grid;
    gap: 6px;
    text-align: left;
    padding: 14px 16px;
    font-family: inherit;
    border: 1px solid var(--border-color);
    color: var(--main-font-color);
    background-color: var(--white-color);
    cursor: pointer;
}

.license-item:hover:not(:disabled) {
    color: var(--white-color);
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.license-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.license-name {
    font-size: 16px;
    font-weight: 600;
}

.license-meta {
    font-size: 13px;
}

.chatbot-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0;
    width: 100%;
    max-width: none;
    height: 78vh;
    min-height: 480px;
    padding: 0;
    overflow: hidden;
    background: var(--white-color);
    border: 1px solid var(--border-color);
}

.content-column:has(.chatbot-container) {
    max-width: 1500px;
    width: 100%;
}

.chatbot-container[hidden] {
    display: none;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.chatbot-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--border-color);
}

.chatbot-online::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.chatbot-avatar {
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    color: var(--white-color);
    background: var(--main-color);
}

.chatbot-avatar-large {
    border-radius: 50%;
    width: 64px;
    height: 64px;
}

.chatbot-license-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.chatbot-license-info #chatbot-license-label {
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    background: var(--white-color);
}

.chatbot-license-info a {
    color: var(--main-color);
    font-weight: 600;
}

.chatbot-body {
    position: relative;
    min-height: 0;
    background: #fafafa;
}

.chatbot-welcome {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    pointer-events: none;
}

.chatbot-welcome h2 {
    margin: 12px 0 0;
    font-size: 22px;
}

.chatbot-welcome p {
    margin: 0;
    color: var(--border-color);
}

.chatbot-container:has(.chat-message) .chatbot-welcome {
    display: none;
}

.chatbot-messages {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 78%;
    padding: 12px 18px;
    line-height: 1.55;
    animation: chat-in .2s ease-out;
}

@keyframes chat-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

.chat-user {
    align-self: flex-end;
    color: var(--white-color);
    background-color: var(--main-color);
    border-bottom-right-radius: 4px;
}

.chat-bot {
    align-self: flex-start;
    border: 1px solid var(--border-color);
    background-color: var(--white-color);
    border-bottom-left-radius: 4px;
}

.chat-error .chat-text {
    font-weight: 600;
    color: var(--main-color);
}

.chat-author {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .7;
}

.chat-text {
    font-size: 16px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.chat-text p,
.chat-text ul,
.chat-text ol {
    font-size: inherit;
    margin-top: 8px;
}

.chat-text > :first-child {
    margin-top: 0;
}

.chat-text ul,
.chat-text ol {
    padding-left: 22px;
}

.chat-text ul {
    list-style: disc;
}

.chat-text ol {
    list-style: decimal;
}

.chat-text li + li {
    margin-top: 4px;
}

.chat-text pre {
    margin: 10px 0;
    padding: 12px 14px;
    overflow-x: auto;
    color: #e5e7eb;
    background: #1f2937;
    font-size: 13px;
    line-height: 1.5;
}

.chat-text pre code {
    padding: 0;
    background: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}

.chat-text .chat-math {
    margin: 10px 0;
    padding: 10px 14px;
    overflow-x: auto;
    background: #f5f5f5;
    text-align: center;
}

.chat-text .chat-math .katex-display {
    margin: 0;
}

.chat-text h4 {
    margin-top: 14px;
    font-size: 17px;
    font-weight: 600;
}

.chat-text hr {
    margin-block: 12px;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.chat-text code {
    padding: 2px 6px;
    background: #f0f0f0;
}

.chat-status {
    font-size: 13px;
    font-style: italic;
    color: var(--border-color);
}

.chat-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    height: 1.5em;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    background: var(--border-color);
    animation: chat-typing 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chat-typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.chat-user .chat-text {
    font-weight: 600;
    white-space: pre-wrap;
}

.chat-cite {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    margin: 0 2px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    vertical-align: super;
    line-height: 1.3;
    border: 0;
    color: var(--white-color);
    background-color: var(--main-color);
}

button.chat-cite,
.chat-cite[data-url] {
    cursor: pointer;
}

button.chat-cite:hover,
button.chat-cite.is-open {
    background-color: var(--main-font-color);
}

.chat-text em {
    font-style: italic;
}

.chat-popover {
    position: fixed;
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: grid;
    gap: 4px;
    max-width: 280px;
    padding: 12px 14px;
    background: var(--white-color);
    font-size: 13px;
    animation: chat-in .12s ease-out;
}

.chat-popover-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.chat-popover-meta {
    color: var(--border-color);
}

.chat-popover-link {
    margin-top: 6px;
    color: var(--main-color);
    font-weight: 600;
}

.chat-sources {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}

.chat-source {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chat-source .chat-cite {
    vertical-align: baseline;
    margin-left: 0;
}

.chat-source img {
    display: block;
    max-width: 160px;
    max-height: 100px;
    border: 1px solid var(--border-color);
}

.chatbot-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin: 16px 20px 20px;
    padding: 8px 8px 8px 18px;
    border: 1px solid var(--border-color);
    background: var(--white-color);
}

.chatbot-form:focus-within {
    border-color: var(--main-color);
}

.chatbot-form textarea {
    flex: 1;
    max-height: 160px;
    padding: 9px 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    field-sizing: content;
}

.chatbot-send {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    color: var(--main-font-color);
    background: var(--white-color);
    cursor: pointer;
}

.chatbot-send:hover:not(:disabled) {
    color: var(--white-color);
    background: var(--main-color);
    border-color: var(--main-color);
}

.chatbot-send:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@media only screen and (max-width: 520px) {
    .modal-window {
        padding: 25px;
    }

    .chatbot-container {
        height: 82vh;
    }

    .chatbot-header,
    .chatbot-messages {
        padding: 14px;
    }

    .chatbot-form {
        margin: 10px;
    }

    .chat-message {
        max-width: 92%;
    }
}
