.terms-modal-dim {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(17, 24, 39, .48);
    z-index: 5000;
}

.terms-modal-dim.is-open {
    display: block;
}

.terms-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    display: none;
    flex-direction: column;
    width: min(720px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 40px));
    transform: translate(-50%, -50%);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
    z-index: 5010;
    overflow: hidden;
    color: #1f2937;
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.terms-modal.is-open {
    display: flex;
}

.terms-modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.terms-modal__title {
    margin: 0;
    color: #111827;
    font-size: clamp(17px, 2.8vw, 20px);
    font-weight: 800;
    line-height: 1.35;
}

.terms-modal__close {
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.terms-modal__close:hover {
    background: #e5e7eb;
    color: #111827;
}

.terms-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
    color: #374151;
    font-size: clamp(13px, 2.5vw, 15px);
    line-height: 1.85;
}

.terms-modal__body h1,
.terms-modal__body h2,
.terms-modal__body h3 {
    color: #111827;
    line-height: 1.45;
}

.terms-modal__body img {
    max-width: 100%;
    height: auto;
}

.terms-modal__empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    color: #9ca3af;
    font-size: 14px;
}

.terms-modal__foot {
    display: flex;
    justify-content: flex-end;
    padding: 14px 20px 18px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.terms-modal__btn {
    min-width: 84px;
    height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.terms-modal__btn:hover {
    background: #374151;
}

@media (max-width: 420px) {
    .terms-modal {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 24px);
    }

    .terms-modal__head,
    .terms-modal__foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .terms-modal__body {
        padding: 18px 16px;
    }
}
