/* A small, movable control. Only its own touch target consumes a drag. */
.back-to-top {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  position: fixed;
  z-index: 20;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 52px;
  height: 56px;
  padding: 5px;
  border: 1px solid #748da7;
  border-radius: 18px;
  color: #e0edf9;
  background: #17273af2;
  box-shadow: 0 5px 18px #0005;
  font: 11px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top[hidden] { display: none; }
.back-to-top svg, .back-to-top span { pointer-events: none; }
.back-to-top[data-dragging] { cursor: grabbing; border-color: #b2e6dc; }
.back-to-top:focus-visible { outline: 3px solid #b2e6dc; outline-offset: 3px; }
@media (hover: hover) { .back-to-top:hover { color: white; background: #263c55; } }
@media print { .back-to-top { display: none !important; } }
