.ak-modal-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ak-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.ak-modal-box {
    position: relative;
    padding: 15px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .5);
    border-radius: 15px;
    width: fit-content;
    max-width: 760px;
    max-height: 90vh;
    overflow: hidden; /* только обрезает то, что вылезло из .ak-modal-scroll */
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.ak-modal-overlay.is-open .ak-modal-box {
    transform: scale(1);
}

.ak-modal-scroll {
    max-height: calc(90vh - 30px); /* минус вертикальные padding .ak-modal-box (15px*2) */
    width: 100%;
    overflow: hidden scroll;
    padding-right: 1px;
    margin-right: -8px;

    /* Firefox */
    scrollbar-color: #94979A #fff;
    scrollbar-width: thin;
}

.ak-modal-scroll::-webkit-scrollbar {
    width: 4px;
    -webkit-appearance: none;
}

.ak-modal-scroll::-webkit-scrollbar-track {
    background: #fff;
    border-radius: 4px;
}

.ak-modal-scroll::-webkit-scrollbar-thumb {
    background: #94979A;
    border-radius: 4px;
    min-height: 30px;
}

.ak-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #94979A;
}

.ak-modal-scroll::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

.ak-modal-close {
    position: sticky;
    float: right;
    top: 0;
    margin-left: 10px;
    width: 28px;
    height: 28px;
    border: 2px solid #7e1c7e;
    box-sizing: border-box;
    border-radius: 100px;
    background: #fff url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L9 9M1 9L9 1' stroke='%237E1C7E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E%0A") 7px 7px no-repeat;
    cursor: pointer;
    z-index: 1;
}

@media screen and (max-width: 979px) {
    .ak-modal-overlay {
        padding: 10px;
    }
    .ak-modal-box {
        width: 100%;
        max-width: 343px;
        max-height: calc(100vh - 20px);
        border-radius: 15px;
    }
    .ak-modal-scroll {
        max-height: calc(100vh - 20px - 30px);
    }
    .ak-modal-content {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .ak-modal-content img,
    .ak-modal-content table {
        max-width: 100%;
        height: auto;
    }

    .ak-modal-content table {
        display: block;
        overflow-x: auto;
    }
    .ak-modal-content .news-detail {
        width: 100%;
    }
}