.back-to-top {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  height: 56px;
  padding: 8px;
  border: 1px solid var(--blue);
  border-radius: 0;
  background: var(--ink-2);
  color: var(--white);
  box-shadow: 0 6px 22px #0003;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.back-to-top[hidden] { display: none; }
.back-to-top-arrow { font: 500 24px/1 var(--font-body); color: var(--blue); }
.back-to-top-label { font: 600 9px/1 var(--font-body); letter-spacing: .12em; }
.back-to-top:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.back-to-top:active { background: var(--blue-dark); transform: translateY(0); }
.back-to-top:active .back-to-top-arrow { color: var(--white); }
@media (hover: hover) {
  .back-to-top:hover { background: var(--blue); transform: translateY(-3px); }
  .back-to-top:hover .back-to-top-arrow { color: var(--white); }
}
@media (max-width: 620px) {
  .back-to-top {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    gap: 3px;
  }
  .back-to-top-arrow { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
  .back-to-top:hover { transform: none; }
}
