html.modal_scroll_lock {
    overflow: hidden;
}

html.modal_scroll_lock body.modal_scroll_lock {
    overflow: hidden;
    overscroll-behavior: none;
}

.template_materials {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    box-sizing: border-box;
    z-index: 102;
    padding: 50px;
    background: var(--base-offwhite);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    overscroll-behavior: contain;
    display: flex;
    align-items: safe center;
    justify-content: safe center;
}
.template_materials .overlay {
    position: absolute;
    height: 100vh;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
.template_materials.is-active {
    opacity: 1;
    visibility: visible;
}
.template_materials_container {
    border-radius: 50px;
    background: #fff;
    padding: 50px;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-green) transparent;
}
.template_materials_container::-webkit-scrollbar {
    width: 6px;
}
.template_materials_container::-webkit-scrollbar-track {
    background: transparent;
}
.template_materials_container::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 3px;
}
.template_materials .modal_close {
    width: 32px;
    aspect-ratio: 1;
    object-fit: contain;
    position: absolute;
    top: 80px;
    right: 80px;
    cursor: pointer;
    z-index: 1;
}


.materials_table_container {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
table {
    border-collapse: separate;
    border-spacing: 0;
}
td {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 2px;
    border: 1px solid var(--gray);
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}
.materials_table_header {
	background: var(--light-gray);
}
tr:first-child td:first-child {
    border-top-left-radius: 20px;
    border-top: 2px solid var(--gray);
    border-left: 2px solid var(--gray);
}
tr:first-child td:last-child {
    border-top-right-radius: 20px;
    border-top: 2px solid var(--gray);
    border-right: 2px solid var(--gray);
}
tr:last-child td:first-child {
    border-bottom-left-radius: 20px;
    border-bottom: 2px solid var(--gray);
    border-left: 2px solid var(--gray);
}
tr:last-child td:last-child {
    border-bottom-right-radius: 20px;
    border-bottom: 2px solid var(--gray);
    border-right: 2px solid var(--gray);
}
tr td:first-child {
    border-left: 2px solid var(--gray);
}
tr td:last-child {
    border-right: 2px solid var(--gray);
}
tr:first-child td:nth-child(2) {
    border-top: 2px solid var(--gray);
}
tr:last-child td {
    border-bottom: 2px solid var(--gray);
}
tr:last-child td:first-child {
    border-right: 1px solid var(--gray);
}
tr:nth-child(2) td:nth-child(1) {
    border-left: 1px solid var(--gray);
}
tr:nth-child(2) td:nth-child(4) {
    border-right: 1px solid var(--gray);
}

tr td:first-child {
    width: 180px;
}
tr:nth-child(2) td:nth-child(1),
tr:nth-child(2) td {
    width: 120px;
}
tr:nth-child(1) td:nth-child(3) {
    width: 120px;
}

td .materials_table_cell {
    width: 20px;
    margin: 0 auto;
}

.materials_table_note {
    font-size: clamp(12px, calc((100vw / 767) * 14), 14px);
    font-weight: 500;
    line-height: 1.3;
}

@media screen and (max-width: 1024px) {
    td {
        font-size: 14px;
    }

    tr td:first-child {
        width: 160px;
    }
    tr:nth-child(2) td:nth-child(1),
    tr:nth-child(2) td {
        width: 100px;
    }
    tr:nth-child(1) td:nth-child(3) {
        width: 100px;
    }

    td .materials_table_cell {
        width: 16px;
        margin: 0 auto;
    }
}

@media screen and (max-width: 959px) {
    .template_materials_container {
        border-radius: 20px;
    }
}

@media screen and (max-width: 767px) {
    .template_materials {
        padding: 50px 30px;
    }
    .template_materials_container {
        padding: 50px 20px;
    }
    .template_materials .modal_close {
        width: 20px;
        top: 70px;
        right: 50px;
    }

    td {
        font-size: 10px;
    }

    tr td:first-child {
        width: 70px;
    }
    tr:nth-child(2) td:nth-child(1),
    tr:nth-child(2) td {
        width: 44px;
    }
    tr:nth-child(1) td:nth-child(3) {
        width: 44px;
    }

    td .materials_table_cell {
        width: 12px;
    }
}