.back-to-top {
  position: fixed;
  z-index: 15;
  right: max(26px, calc(env(safe-area-inset-right) + 14px));
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 18px #16384c1f;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.back-to-top[hidden] { display: none; }
.back-to-top svg { display: block; width: 23px; height: 23px; }
.back-to-top:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.back-to-top:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
@media (max-width: 700px) {
  .back-to-top {
    right: max(18px, calc(env(safe-area-inset-right) + 10px));
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    width: 46px;
    height: 46px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .back-to-top:not([hidden]) { animation: back-to-top-appear .22s ease-out both; }
  .back-to-top:not([hidden]) svg { animation: back-to-top-arrow 2.6s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}
@keyframes back-to-top-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes back-to-top-arrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
