/* Back to top V3: separate from pagination and media viewers. */
.aps-back-to-top-button {
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center;
    width: 48px !important; height: 48px !important;
    min-width: 48px !important; min-height: 48px !important;
    max-width: 48px !important;
    padding: 0 !important; margin: 0 !important;
    border: 0 !important; border-radius: 50% !important;
    background: rgba(255,255,255,.52) !important;
    -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
    color: #F26071 !important;
    box-shadow: 0 7px 21px rgba(37,37,37,.19), 0 2px 6px rgba(37,37,37,.07) !important;
    cursor: pointer; line-height: 1 !important;
    transition: box-shadow .22s ease, transform .22s ease;
    -webkit-tap-highlight-color: transparent;
    animation: aps-back-top-in .22s ease both;
}
.aps-back-to-top-button[hidden] { display: none !important; }
.aps-back-to-top-button svg { width: 25px; height: 25px; display: block; pointer-events: none; transition: transform .22s ease; }
.aps-back-to-top-button:hover { box-shadow: 0 9px 24px rgba(37,37,37,.23), 0 2px 6px rgba(37,37,37,.08) !important; }
.aps-back-to-top-button:hover svg { transform: translateY(-2px); }
.aps-back-to-top-button:focus-visible { outline: 2px solid #F26071 !important; outline-offset: 4px; }
#apsaidal-back-to-top {
    position: fixed !important; z-index: 110;
    right: 24px; bottom: 72px;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
/* The dialog is in the top layer; scroll its own grid rather than the page. */
.aps-back-top-dialog-dock { position: sticky; bottom: 48px; height: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: flex-end; pointer-events: none; }
.aps-back-top-dialog-dock .aps-back-to-top-button { pointer-events: auto; }
body:has([data-gallery-modal]:not([hidden])) #apsaidal-back-to-top,
body:has(dialog[open]) #apsaidal-back-to-top,
body.aps-search-overlay-open #apsaidal-back-to-top { display: none !important; }
@keyframes aps-back-top-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width:767px) {
    .aps-back-to-top-button { width:44px !important; height:44px !important; min-width:44px !important; min-height:44px !important; max-width:44px !important; }
    .aps-back-to-top-button svg { width:23px; height:23px; }
    #apsaidal-back-to-top { right:14px; bottom:64px; right:calc(14px + env(safe-area-inset-right,0px)); bottom:calc(64px + env(safe-area-inset-bottom,0px)); }
}
@media (prefers-reduced-motion:reduce) { .aps-back-to-top-button, .aps-back-to-top-button svg { transition:none; animation:none; } }
