#myModal {
    font-family: 'Phetsarath OT', sans-serif;
    color: #253649;
}

#myModal .modal-dialog {
    width: 680px;
    max-width: calc(100% - 24px);
    margin: 24px auto;
}

#myModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
}

#myModal .modal-header {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    background: #f3faf7;
}

#myModal .modal-header::before,
#myModal .modal-header::after {
    display: none;
}

#myModal .modal-title {
    color: #155e4d;
    line-height: 1.6;
}

#myModal .close {
    flex-shrink: 0;
    padding: 6px;
    opacity: .65;
}

#myModal .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b5d5ca #f7faf9;
}

#myModal .registration-attendance-rules > h3 {
    color: #155e4d;
    line-height: 1.7;
    font-weight: 600;
}

#myModal .rules-introduction {
    color: #627181;
    font-size: 14px;
    line-height: 1.85;
    margin: 0 0 16px;
}

#myModal .rules-section {
    margin: 0 0 12px;
    padding: 14px 16px;
    background: #f7faf9;
    border: 1px solid #e5eeea;
    border-radius: 10px;
}

#myModal .rules-section h2 {
    margin: 0 0 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
    color: #155e4d;
}

#myModal .rules-section p,
#myModal .rules-note {
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

#myModal .rules-section p {
    margin: 0 0 8px;
}

#myModal .rules-section p:last-child {
    margin-bottom: 0;
}

#myModal .rules-threshold {
    background: #fffaf0;
    border-color: #f0dfba;
    border-left: 3px solid #d6a041;
}

#myModal .rules-threshold h2 {
    color: #855b16;
}

#myModal .rules-note {
    padding: 14px 16px;
    border-radius: 10px;
    background: #edf7f2;
    color: #275a49;
}

#myModal .modal-footer {
    flex: 0 0 auto;
    background: #fff;
}

#myModal .modal-footer .btn {
    border-radius: 8px;
    padding: 9px 22px;
    font-family: inherit;
}

#myModal #btnAgree {
    background: #0f6e56;
    border-color: #0f6e56;
}

#myModal #btnAgree:hover,
#myModal #btnAgree:focus {
    background: #0b5845;
    border-color: #0b5845;
}

@media (max-width: 480px) {
    #myModal .modal-dialog {
        margin: 12px auto;
    }

    #myModal .modal-content {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    #myModal .rules-section {
        padding: 12px;
    }

    #myModal .rules-section h2 {
        font-size: 15px;
    }
}
