
/* 메인화면 팝업 공지 /s/ */
.layer-popup {
    position: fixed;
    min-width: 360px;
    /*width: 360px;*/
    /*width: 600px;*/
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    border: 1px solid #eee;
    z-index: 1000;
    overflow: hidden;
    user-select: none; /* 드래그 중 텍스트 선택 방지 */
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #76b82d;
    color: white;
    cursor: move; /* 드래그 가능한 영역 표시 */
}

.popup-header strong { font-size: 15px; }

.popup-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
}

.popup-body {
    padding: 14px;
    font-size: 14px;
    color: #222;
    line-height: 1.5;
    user-select: text; /* 본문은 선택 가능 */
}

.popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-top: 1px solid #eee;
    font-size: 13px;
}

.today-hide {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
}

/* 팝업 기본 크기/최대높이 */
.layer-popup {
    /*width: 600px;          !* 기존 유지 *!*/
    max-height: 70vh;      /* 화면 높이의 70%까지만 커지게 */
    display: flex;
    flex-direction: column;
}

/* 헤더/푸터는 고정, 본문만 늘어나도록 */
.popup-header,
.popup-footer {
    flex: 0 0 auto;
}

/* 내용이 넘치면 본문에 스크롤 생성 */
.popup-body {
    flex: 1 1 auto;        /* 남는 높이를 본문이 차지 */
    overflow-y: auto;      /* 세로 스크롤 */
    overflow-x: hidden;    /* 가로는 숨김(필요시 auto로) */
    max-height: 100%;      /* popup max-height 안에서만 */
}


/* 태블릿 이하 */
@media (max-width: 1024px) {
    .layer-popup {
        width: 320px;
    }
}

/* 모바일 */
@media (max-width: 768px) {
    .layer-popup {
        width: calc(100vw - 24px);   /* 좌우 여백 12px */
        max-width: 420px;
        left: 12px !important;      /* inline left 무시하고 강제 */
        right: 12px;
        top: auto !important;
        bottom: calc(12px + env(safe-area-inset-bottom)); /* 아이폰 하단 safe-area */
        border-radius: 16px;
    }

    .popup-header {
        padding: 14px 16px;
        font-size: 16px;
        cursor: grab;           /* 모바일에서도 잡는 느낌 */
        touch-action: none;     /* 드래그 시 스크롤 충돌 방지(드래그 JS와 궁합) */
    }
    .popup-header:active {
        cursor: grabbing;
    }

    .popup-body {
        padding: 14px 16px;
        font-size: 15px;
        max-height: 55vh;       /* 화면 절반 좀 넘게 */
        overflow-y: auto;       /* 내용 길면 내부 스크롤 */
        -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    }

    .popup-footer {
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }

    .popup-close {
        font-size: 20px;
    }

    /* 여러 개 뜰 때 겹치면 살짝 띄우는 느낌(선택) */
    .layer-popup + .layer-popup {
        margin-bottom: 10px;
    }
}

/* 아주 작은 모바일 (아이폰 SE급) */
@media (max-width: 360px) {
    .layer-popup {
        width: calc(100vw - 16px);
        left: 8px !important;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .popup-body {
        max-height: 50vh;
        font-size: 14px;
    }
}

/* 메인화면 팝업 공지 /e/ */
