.to-top {
  position: fixed;
  right: 28px;
  bottom: 36px;
  z-index: 100;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #e5365c;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.94);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
}

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

.to-top img {
  display: block;
  width: 100%;
  height: 100%;
}

@media (hover: hover) {
  .to-top--visible:hover {
    border-color: transparent;
    background: #e5365c;
    filter: brightness(1.08);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46);
    transform: translateY(-3px) scale(1);
  }
}

.to-top--visible:active {
  transform: translateY(0) scale(0.96);
}

.to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .to-top {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .to-top img {
    width: 40px;
    height: 40px;
  }
}

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