.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.modal-container.hide {
    display: none;
}

.modal {
    background: #FFF;
    width: 50vw;
    min-width: 50vw;
    max-width: 100vw;
    box-shadow: 0px 1px 3px 0px rgba(65, 65, 65, 0.2);
    min-height: 80vh;
    max-height: 100vh;
    position: relative;
    margin: 0 auto;
    left: calc(50vw - 50%);
    top: 10vh;
    z-index: 1100;
    border-radius: 6px;
}

    .modal .title {
        position: relative;
        height: 4.5rem;
        width: 100%;
        border-bottom: 1px solid #EFF1F3;
        display: grid;
        grid-template-columns: auto 1fr auto;
    }

        .modal .close {
            content: '';
            display: block;
            left: 0;
            top: 0;
            height: 100%;
            width: 4rem;
            mask-image: url('/img/icons/cross.svg');
            -webkit-mask-image: url('/img/icons/cross.svg');
            mask-position: center center;
            -webkit-mask-position: center center;
            mask-repeat: no-repeat;
            -webkit-mask-repeat: no-repeat;
            mask-size: 13px 13px;
            -webkit-mask-size: 13px 13px;
            background: #000;
            cursor: pointer;
        }

        .modal .title > div:nth-child(1) {
            height: 100%;
            position: absolute;
            font-size: 1rem;
            display: block;
            line-height: 4.5rem;
            text-align: center;
            grid-column: 1/-1;
        }

        .modal .title > div:nth-child(2) {
            height: 100%;
            font-size: 1rem;
            line-height: 4.5rem;
            text-align: center;

            padding:0 2.5rem;
            grid-column: 1/-1;
            width: auto;
            display: grid;
            grid-template-columns: 1fr auto;
        }

        .modal .title .legend {
            font-size:1rem;
        }

        .modal .title .legend > div::before {
            top:calc(50% - 4px);
        }

.modal .content {
    width: 100%;
    height: calc(80vh - (4.5rem + 5.5rem));
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 1rem 1.5rem;
}

.modal .region_name {
    display: block;
    border-bottom: 1px solid #EFF1F3;
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal .region_name label {
    float: right;
    color: #000;
    font-weight: 400;
    font-size: calc( (13/16) * 1rem );
    line-height: 1.2rem;
}

.modal .region_name [type="checkbox"]:checked + label::before,
.modal .region_name [type="checkbox"]:not(:checked) + label::before {
    position: absolute;
    right: 0;
}

.modal .content .region_name [type="checkbox"]:checked + label::after,
.modal .content .region_name [type="checkbox"]:not(:checked) + label::after {
    right: 5px;
    left: initial;
}

.modal .footer {
    display: grid;
    grid-template-columns: 1fr auto;
    position: relative;
    bottom: 0;
    left: 0;
    height: 3.25rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #EFF1F3;
}

.modal .clearAll {
    display: flex;
    align-items: center;
}

.modal .clearAll a {
    font-weight: 400;
    font-size: 1rem;
    color: #000;
}

.modal .clearAll a:link, .modal .clearAll a:visited {
    color: #000;
}

.modal .submit {
    box-shadow: 0px 1px 3px 0px rgba(65, 65, 65, 0.2);
    border-radius: 4px;
    padding: 1rem 2rem;
    font-weight: 700;
    cursor: pointer;
}

.blackout {
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #20202080;
}

.modal .content .region_group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    row-gap: 0.5rem;
    padding: 0.5rem 0;
}

.modal .content .region_group > div[data-layer_key] {
    display: grid;
    grid-template-columns: 1fr auto;
    padding-right:1rem;
}

.modal .layer_selector {
    padding:1rem;
    margin-top:-1rem;
}

.modal .content .layers > div label {
    padding: 0;
    grid-template-columns: auto auto 1fr;
}

.modal .content .layers .layer_name {
    margin-top: 0.2rem;
}

.modal .content [type="checkbox"]:checked + label::after, .modal .content [type="checkbox"]:not(:checked) + label::after {
    top: 5px;
    left: 5px;
}

.modal .group-title {
    width: 100%;
}

.modal .group-title {
    width: 100%;
    grid-column: 1/3;
}

.modal .group-title {
    display: none;
}

.modal .group-title.visible {
    display: block;
}