/* Centered popup with square corners and space around the dialog. */
#toPopup {
    position: fixed;
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    max-width: 90vw;
    height: auto;
    max-height: 88vh;
    max-height: 88dvh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}
#toPopup .popup-scroll {
    width: 100%;
    height:auto;max-height:calc(88vh - 64px - env(safe-area-inset-bottom,0px));max-height:calc(88dvh - 64px - env(safe-area-inset-bottom,0px));
    max-width: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
#toPopup .popup-scroll p { margin: 0; }
#toPopup .popup-scroll img {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(88vh - 100px);
    max-height: calc(88dvh - 100px);
    object-fit: contain;
    border-radius: 0 !important;
    margin: 0 auto;
}
#toPopup .popup-scroll iframe,
#toPopup .popup-scroll table { max-width: 100%; }
#toPopup #close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 0;
    background: #262626;
    color: #fff;
    font: 28px/34px Arial,sans-serif;
    cursor: pointer;
}
#toPopup #bottomNav {
    position: static;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    border-top: 1px solid #ddd;
    background: #fff;
    text-align: center;
}
#toPopup .popup-close { border: 0; border-radius: 0; min-height: 42px; padding: 8px 26px; background: #333; color: #fff; cursor: pointer; font: inherit; }
#toPopup button:focus-visible { outline: 3px solid #1976d2; outline-offset: 2px; }

/* Announcement image touches the dialog edges; text keeps reading space. */
#toPopup .popup-image { margin: 0; padding: 0; }
#toPopup .popup-image img {
    width: 100% !important;
    height: auto !important;
    max-height: none;
    margin: 0;
}
#toPopup .popup-detail {
    padding: 14px 20px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
