.hd_popup_carousel { display: none; }
@media (max-width: 1024px) {
    #hd_pop { width: 100%; min-width: 0; }
    /* Keep registered coordinates from overflowing the page before JS is ready. */
    #hd_pop > .hd_pops { top: 78px !important; left: 50% !important; transform: translateX(-50%); width: 96%; max-width: 100%; }
    #hd_pop .hd_pops_con { width: 100% !important; height: auto !important; }
    #hd_pop .hd_pops_con img { max-width: 100% !important; height: auto !important; }
    #hd_pop .hd_popup_carousel { display: block; position: fixed; top: var(--popup-top, 78px); left: 50%; transform: translateX(-50%); width: 96%; max-width: var(--popup-width); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 4px 24px #0003; }
    #hd_pop .hd_popup_carousel[hidden], #hd_pop .hd_popup_nav[hidden] { display: none; }
    .hd_popup_nav { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 6px 10px 6px 16px; background: #222; color: #fff; font-size: 16px; }
    .hd_popup_nav button { width: 36px; height: 36px; margin-left: 5px; border: 0; border-radius: 5px; background: #444; color: #fff; font-size: 28px; line-height: 1; }
    .hd_popup_viewport { overflow: hidden; touch-action: pan-y; }
    .hd_popup_track { display: flex; align-items: flex-start; transition: transform .25s ease; }
    #hd_pop .hd_popup_track > .hd_pops { position: relative; top: auto !important; left: auto !important; flex: 0 0 100%; width: 100%; min-width: 0; border: 0; box-sizing: border-box; }
    #hd_pop .hd_popup_track .hd_pops_con { max-height: calc(100dvh - var(--popup-top, 78px) - var(--popup-controls, 48px) - 64px); overflow: auto !important; overflow-wrap: anywhere; overscroll-behavior: contain; }
    #hd_pop .hd_pops_con > * { max-width: 100%; }
    #hd_pop .hd_pops_con p { margin: 0; }
    #hd_pop .hd_pops_con img { vertical-align: middle; }
    #hd_pop .hd_pops_footer { display: flex; padding: 0; }
    #hd_pop .hd_pops_footer:after { display: none; }
    #hd_pop .hd_pops_footer button { padding: 12px 8px; font-size: 12px; line-height: 1.5; min-width: 0; }
    #hd_pop .hd_pops_footer .hd_pops_reject { flex: 1; text-align: center; word-break: keep-all; }
    #hd_pop .hd_pops_footer .hd_pops_close { position: static; flex: 0 0 62px; }
}
@media (prefers-reduced-motion: reduce) {
    .hd_popup_track { transition: none; }
}
