/* Site-wide back-to-top control. Namespaced to avoid gallery/layout conflicts. */
#ns-back-to-top.ns-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  background: rgba(22,29,36,.93);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .18s, transform .18s;
}
#ns-back-to-top.ns-back-to-top[hidden] { display: none !important; }
#ns-back-to-top.ns-back-to-top:focus-visible { outline: 3px solid #76bbff; outline-offset: 3px; }
@media (hover:hover) { #ns-back-to-top.ns-back-to-top:hover { background: #33485b; transform: translateY(-2px); } }
@media (max-width:600px) {
  #ns-back-to-top.ns-back-to-top { right: 14px; bottom: 14px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion:reduce) { #ns-back-to-top.ns-back-to-top { transition:none; } }
