.main_popup[hidden], .main_popup [hidden] { display: none !important; }

.main_popup .main_popup_layer {
    width: min(500px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.main_popup_stage { height: min(60vh, 500px); height: min(60dvh, 500px); flex: 0 1 auto; min-height: 0; overflow: hidden; }
.main_popup_heading { padding: 14px 16px; border-bottom: 1px solid #ddd; flex: none; max-height: 6em; overflow: auto; }
.main_popup_heading h2 { margin: 0; font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.main_popup_slides { margin: 0; padding: 0; list-style: none; height: 100%; }
.main_popup_slide { margin: 0; padding: 0; height: 100%; }
.main_popup_image_area,
.main_popup_notice {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.main_popup_image_area {
    display: flex;
    align-items: center;
    justify-content: center;
}
.main_popup_image_area img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    flex: none;
    margin: auto;
}
.main_popup_notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    text-align: center;
    overflow-wrap: anywhere;
}
.main_popup_notice_label { font-weight: 700; }
.main_popup_notice p { margin: 0; font-size: 1.2rem; }
.main_popup_notice a { text-decoration: underline; }
.main_popup_nav,
.main_popup_actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    flex: none;
}
.main_popup_nav { justify-content: center; gap: 8px; border-top: 1px solid #ddd; }
.main_popup_prev, .main_popup_next { min-width: 32px; min-height: 36px; flex: none; }
.main_popup_dots { display: flex; gap: 4px; }
.main_popup_dots button { width: 24px; height: 36px; padding: 0; border: 0; background: transparent; }
.main_popup_dots button::before { content: ''; display: inline-block; width: 12px; height: 12px; border: 1px solid #555; border-radius: 50%; background: #fff; }
.main_popup_dots button[aria-current="true"]::before { background: #333; }
.main_popup_count { min-width: 3em; text-align: center; }
.main_popup_actions { border-top: 1px solid #ddd; }
.main_popup_actions label { display: inline-flex; align-items: center; gap: 6px; }
.main_popup_actions button { padding: 8px 16px; border: 1px solid #333; background: #fff; }
