.files-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.files-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.files-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(4px);
}

.files-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(1080px, 100%);
    border-radius: 22px;
    padding: 24px 26px 22px;
    background: linear-gradient(180deg, rgba(44,40,35,0.96) 0%, rgba(28,26,24,0.98) 100%);
    border: 1px solid rgba(199, 171, 116, 0.14);
    box-shadow:
        0 24px 60px rgba(0,0,0,0.42),
        inset 0 1px 0 rgba(255,255,255,0.04);
    color: #ddd3c2;
    overflow: hidden;
}

.files-modal__dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top right, rgba(199,171,116,0.08), transparent 30%);
    pointer-events: none;
}

.files-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

.files-modal__close span {
    position: absolute;
    top: 18px;
    left: 9px;
    width: 20px;
    height: 2px;
    background: #e4d1a0;
    border-radius: 999px;
    transition: background .2s ease;
}

.files-modal__close span:first-child {
    transform: rotate(45deg);
}

.files-modal__close span:last-child {
    transform: rotate(-45deg);
}

.files-modal__close:hover span {
    background: #fff0c8;
}

.files-modal__header {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 22px;
    align-items: start;
    padding-right: 42px;
    margin-bottom: 20px;
}

.files-modal__header-left {
    position: relative;
}

.files-modal__header-left::after {
    content: "";
    position: absolute;
    top: 2px;
    right: -11px;
    width: 1px;
    height: calc(100% - 4px);
    background: linear-gradient(180deg, rgba(172,67,59,0.9), rgba(172,67,59,0.15));
}

.files-modal__title {
    margin: 0;
    color: #f7f2e8;
    font-family: Philosopher, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.files-modal__subtitle {
    margin-top: 8px;
    color: #d4ac61;
    font-family: Philosopher, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.files-modal__header-right {
    padding-top: 2px;
    color: #ddd7cc;
    font-size: 14px;
    line-height: 1.4;
}

.files-modal__header-right p {
    margin: 0 0 5px;
}

.files-modal__header-right a {
    color: #d9ad58;
    text-decoration: none;
}

.files-modal__header-right a:hover {
    color: #f0ca84;
}

.files-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.files-modal__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 22px 22px 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15,15,17,0.98) 0%, rgba(10,10,12,0.98) 100%);
    border: 1px solid rgba(199,171,116,0.18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 12px 28px rgba(0,0,0,0.20);
}

.files-modal__card-title {
    margin: 0;
    color: #fff0c8;
    font-family: Philosopher, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
}

.files-modal__card-desc {
    margin-top: 6px;
    color: #9f9a90;
    font-size: 14px;
    line-height: 1.4;
}

.files-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
}

.files-modal__btn {
    position: relative;
    min-height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    font-family: Philosopher, "Times New Roman", serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    color: #f4eee3;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 8px 18px rgba(0,0,0,0.18);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.files-modal__btn::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.07);
    pointer-events: none;
}

.files-modal__btn:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 10px 22px rgba(0,0,0,0.22);
    filter: brightness(1.05);
}

.files-modal__btn--red {
    background: linear-gradient(180deg, rgba(91,35,34,0.95) 0%, rgba(58,21,20,0.98) 100%);
}

.files-modal__btn--green {
    background: linear-gradient(180deg, rgba(33,82,53,0.95) 0%, rgba(18,51,31,0.98) 100%);
}

.files-modal__btn--dark {
    background: linear-gradient(180deg, rgba(46,46,48,0.95) 0%, rgba(23,23,25,0.98) 100%);
}

.files-modal__btn--gold {
    background: linear-gradient(180deg, rgba(117,81,32,0.96) 0%, rgba(74,49,17,0.99) 100%);
}

body.files-modal-open {
    overflow: hidden;
}

@media (max-width: 1199px) {
    .files-modal__dialog {
        width: min(980px, 100%);
        padding: 22px 22px 20px;
    }

    .files-modal__header {
        grid-template-columns: 300px 1fr;
        gap: 18px;
    }

    .files-modal__title {
        font-size: 34px;
    }

    .files-modal__subtitle {
        font-size: 18px;
    }

    .files-modal__card {
        min-height: 220px;
        padding: 20px 18px 18px;
    }
}

@media (max-width: 991px) {
    .files-modal {
        padding: 14px;
        align-items: flex-start;
    }

    .files-modal__dialog {
        width: min(760px, 100%);
        max-height: calc(100dvh - 28px);
        overflow-y: auto;
        border-radius: 20px;
        padding: 20px 18px 18px;
    }

    .files-modal__header {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-right: 34px;
        margin-bottom: 16px;
    }

    .files-modal__header-left::after {
        display: none;
    }

    .files-modal__title {
        font-size: 30px;
    }

    .files-modal__subtitle {
        font-size: 16px;
    }

    .files-modal__header-right {
        font-size: 13px;
    }

    .files-modal__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .files-modal__card {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .files-modal {
        padding: 10px;
    }

    .files-modal__dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 16px 14px 14px;
        border-radius: 16px;
    }

    .files-modal__close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
    }

    .files-modal__close span {
        top: 14px;
        left: 7px;
        width: 16px;
    }

    .files-modal__header {
        padding-right: 24px;
        margin-bottom: 14px;
        gap: 10px;
    }

    .files-modal__title {
        font-size: 22px;
    }

    .files-modal__subtitle {
        margin-top: 6px;
        font-size: 13px;
    }

    .files-modal__header-right {
        font-size: 12px;
        line-height: 1.35;
    }

    .files-modal__header-right p {
        margin: 0 0 4px;
    }

    .files-modal__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .files-modal__card {
        padding: 16px 14px 16px;
        border-radius: 16px;
    }

    .files-modal__card-title {
        font-size: 16px;
    }

    .files-modal__card-desc {
        margin-top: 4px;
        font-size: 12px;
        line-height: 1.35;
    }

    .files-modal__actions {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 16px;
        padding-top: 0;
    }

    .files-modal__btn {
        min-height: 42px;
        font-size: 12px;
        border-radius: 13px;
        padding: 0 10px;
    }

    .files-modal__btn::before {
        inset: 2px;
        border-radius: 10px;
    }
}

@media (max-width: 420px) {
    .files-modal__title {
        font-size: 20px;
    }

    .files-modal__subtitle {
        font-size: 12px;
    }

    .files-modal__header-right {
        font-size: 11px;
    }

    .files-modal__card-title {
        font-size: 15px;
    }

    .files-modal__btn {
        font-size: 11px;
        min-height: 40px;
        padding: 0 10px;
    }
}