.nova-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    pointer-events: none;
}

.nova-modal.is-open {
    display: block;
}

.nova-modal__window {
    --modal-width: 720px;
    --modal-height: 480px;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    width: var(--modal-width);
    height: var(--modal-height);
    min-width: min(320px, calc(100vw - 24px));
    min-height: 220px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);

    overflow: hidden;
    resize: both;
    pointer-events: auto;

    background: #fff;
    border: 1px solid #dce3ee;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(22, 34, 58, .25);
    color: #24324a;
    font-family: system-ui, sans-serif;
}

.nova-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    flex-shrink: 0;

    background: linear-gradient(120deg, #172b4d, #305e9c);
    color: #fff;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.nova-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.4;
}

.nova-modal__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;

    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.nova-modal__close:hover {
    background: rgba(255, 255, 255, .25);
}

.nova-modal__body {
    flex: 1;
    min-height: 0;
    padding: 22px;
    overflow: auto;
    overscroll-behavior: contain;
}

.nova-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 14px 22px 20px;
    border-top: 1px solid #edf0f5;
    background: #fafbfd;
}

.nova-modal__button {
    padding: 10px 18px;
    border: 1px solid #dce3ee;
    border-radius: 10px;
    background: #fff;
    color: #34435b;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.nova-modal__button--primary {
    border-color: #285baa;
    background: #285baa;
    color: #fff;
}

.nova-modal__button:hover {
    filter: brightness(.95);
}

.nova-modal :focus-visible {
    outline: 3px solid #85b8ff;
    outline-offset: 3px;
}

@media (max-width: 576px) {
    .nova-modal__header {
        padding: 14px 16px;
    }

    .nova-modal__body {
        padding: 16px;
    }

    .nova-modal__footer {
        padding: 12px 16px 20px;
    }
}

