     /* =========================================================
        기본 페이지 스타일
        ========================================================= */
 body{
     margin:20px;
     font-family:Arial, sans-serif;
     background:#f3f5f7;
     color:#111;
 }

button{
    cursor:pointer;
}


/* =========================================================
   팝업 오버레이
   ========================================================= */
.popup-overlay{
    position:fixed;
    inset:0;
    background:rgba(239,239,239,0.12);
    display:none;
    z-index:9998;
}

/* =========================================================
   팝업 모달
   - width는 CSS에서 제어
   - 높이는 JS 계산값 사용
   ========================================================= */
.popup-modal{
    position:fixed;
    left:50%;
    top:55%;
    transform:translate(-50%, -50%);
    /* width:min(1500px, 94vw); */
    height:var(--popup-modal-h, 80vh);
    max-height:90vh;
    /* background:#ffffff; */
    color:#fff;
    border-radius:14px;
    overflow:hidden;
    display:none;
    z-index:9999;
    flex-direction:column;
    box-shadow:0 10px 35px rgba(0,0,0,0.35);
    outline:none;
}

/* =========================================================
   상단 영역
   ========================================================= */
.popup-head{
    flex:0 0 54px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 16px;
    background:#d7d7d7;
    border-bottom:1px solid rgba(255,255,255,0.08);
    color:#1a1a1a;
}

.popup-title-wrap{
    display:flex;
    gap:12px;
    align-items:center;
    min-width:0;
}

.popup-title{
    font-size:16px;
    font-weight:bold;
    margin:0;
}

.popup-status{
    font-size:13px;
    color:#1a1a1a;
    white-space:nowrap;
}

.popup-close-btn{
    border:0;
    background:transparent;
    color:#1a1a1a;
    font-size:18px;
    width:38px;
    height:38px;
    border-radius:8px;
}

.popup-close-btn:focus,
.popup-action-btn:focus,
.nav:focus,
.dot:focus{
    outline:2px solid #fff;
    outline-offset:2px;
}

/* =========================================================
   본문 영역
   ========================================================= */
.popup-body{
    flex:1 1 auto;
    padding:12px;
    position:relative;
    background:#ffffff00;
    overflow:hidden;
}

/* =========================================================
   그리드
   - 열 개수는 JS에서 동적으로 지정
   ========================================================= */
.popup-grid{
    display:grid;
    gap:12px;
    height:100%;
}

/* =========================================================
   카드
   ========================================================= */
.popup-card{
    display:flex;
    justify-content:center;
    align-items:center;
    background:#ffffff00;
    border-radius:12px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,0.08);
    padding:10px;
    box-shadow:0 10px 35px rgba(0,0,0,0.35);
}

/* =========================================================
   기존 popup content wrapper
   - 관리자 등록 width/height 존중
   - 모달 내부 범위에서 스크롤 허용
   ========================================================= */
.popBody{
    max-width:100%;
    max-height:var(--popup-content-h, 500px);
    overflow:hidden;
    background:#fff;
    color:#111;
}

/* =========================================================
   content 내부 요소 기본 보정
   ========================================================= */
.popBody img{
    max-width:100%;
    height:auto;
}

.popBody a{
    word-break:break-word;
}

/* =========================================================
   이전/다음 버튼
   ========================================================= */
.nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:42px;
    height:42px;
    border:0;
    border-radius:50%;
    background:rgba(40,40,40,0.92);
    color:#fff;
    font-size:28px;
    z-index:2;
}

.prev{
    left:10px;
}

.next{
    right:10px;
}

.nav:disabled{
    opacity:0.35;
    cursor:not-allowed;
}

/* =========================================================
   페이지 도트 영역
   ========================================================= */
.popup-dots{
    flex:0 0 40px;
    display:flex;
    justify-content:center;
    align-items:center;
    background:#fff;
    border-top:1px solid rgba(255,255,255,0.08);
}

.dot{
    width:10px;
    height:10px;
    border:0;
    border-radius:50%;
    background:#9f9f9f;
    margin:4px;
}

.dot.active{
    background:#000;
}

/* =========================================================
   하단 영역
   ========================================================= */
.popup-foot{
    flex:0 0 54px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 16px;
    background:#d7d7d7;
    border-top:1px solid rgba(255,255,255,0.08);
    gap:16px;
	color:#000;
}

.popup-foot-left{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.popup-foot-right{
    display:flex;
    align-items:center;
    gap:8px;
}

.popup-help{
    font-size:12px;
    color:#000;
}

.popup-action-btn{
    height:36px;
    padding:0 14px;
    border:0;
    border-radius:8px;
    background:#f0f0f0;
    color:#111;
    font-size:14px;
}

/* =========================================================
   작은 화면 대응
   ========================================================= */
@media (max-width:860px){
    .popup-foot{
        flex-direction:column;
        align-items:flex-start;
        justify-content:center;
        padding:8px 12px;
        height:auto;
        min-height:72px;
    }

    .popup-help{
        display:none;
    }

    .popup-status{
        display:none;
    }
}
