.back-to-top {
    position: fixed;
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid white;
    border-radius: 50%;
    background: #294461;
    color: white;
    box-shadow: 0 2px 7px #0004;
    cursor: pointer;
    touch-action: manipulation;
}
/* Keep the lower corner available to the existing Talk-Me launcher. */
html:has(script[src*="talk-me.ru/support/"], script[src*="site-chat.me/support/"]) .back-to-top {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.back-to-top::before {
    content: "";
    position: absolute;
    inset: 19px auto auto 16px;
    width: 12px;
    height: 12px;
    box-sizing: content-box;
    border: solid currentColor;
    border-width: 3px 0 0 3px;
    transform: rotate(45deg);
}
.back-to-top:hover { background: #365e85; }
.back-to-top:focus-visible { outline: 3px solid #ffcc29; outline-offset: 2px; }
.back-to-top[hidden], .show-nav .back-to-top,
body:has(.page-sidebar.toggled, :modal, .fancybox-opened, .arcticmodal-container, .modal.in) .back-to-top,
.fancybox-lock .back-to-top { display: none; }
@media print { .back-to-top { display: none !important; } }
