.mys-back-to-top {
  position: fixed;
  z-index: 80;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  color: #fff;
  background: #061a3b;
  box-shadow: 0 10px 26px rgba(6, 26, 59, .24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background-color .2s ease;
}

.mys-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mys-back-to-top:hover { background: #f2293a; }
.mys-back-to-top:focus-visible {
  outline: 3px solid rgba(242, 41, 58, .36);
  outline-offset: 4px;
}

.mys-back-to-top svg {
  width: 23px;
  height: 23px;
  pointer-events: none;
}

@media (max-width: 600px) {
  .mys-back-to-top {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
  }

  .mys-back-to-top svg { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .mys-back-to-top { transition: none; }
}
