.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 998;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #004080;
  border-radius: 50%;
  background: #fff;
  color: #004080;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.back-to-top:hover {
  background: #eaf3fa;
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: scale(0.96);
}

.back-to-top:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

@media print {
  .back-to-top {
    display: none !important;
  }
}
