.hystmodal__opened,
.hystmodal__shadow {
    position: fixed;
    right: 0;
    left: 0;
    overflow: hidden;
}

.hystmodal__shadow {
    border: none;
    display: block;
    width: 100%;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 98;
    opacity: 0;
    transition: opacity .15s ease;
    background-color: #000;
}

.hystmodal__shadow--show {
    pointer-events: auto;
    opacity: .6;
}

.hystmodal {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    pointer-events: none;
    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-start;
    z-index: 99;
    visibility: hidden;
}

.hystmodal--active {
    opacity: 1;
}

.hystmodal--active,
.hystmodal--moved {
    pointer-events: auto;
    visibility: visible;
}

.hystmodal__wrap {
    flex-shrink: 0;
    flex-grow: 0;
    width: 100%;
    min-height: 100%;
    margin: auto;
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
}

.hystmodal__window {
    margin: 50px 0;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
    max-width: 100%;
    overflow: visible;
    transition: transform .2s ease 0s, opacity .2s ease 0s;
    transform: scale(.9);
    opacity: 0;
}

.hystmodal--active .hystmodal__window {
    transform: scale(1);
    opacity: 1;
}

.hystmodal__close {
    position: absolute;
    z-index: 10;
    top: -12px;
    right: -12px;
    cursor: pointer;
    outline: none;
}

.hystmodal__close:focus {
    outline: 2px dotted #afb3b9;
    outline-offset: 2px
}

@media (max-width:767px) {
    .hystmodal__close {
        top: -12px;
        right: -12px;
    }
    .hystmodal__window {
        margin: 0;
    }
}