.back-to-top {
  position: fixed;
  right: 40px;
  bottom: calc(var(--back-to-top-offset, 32px) + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: none;
  pointer-events: none;
}

.back-to-top.is-visible {
  display: block;
}

.back-to-top__button {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: transform 0.18s ease;
}

.back-to-top__button:hover,
.back-to-top__button:focus-visible {
  transform: translateY(-1px);
}

.back-to-top__button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.back-to-top__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

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

.back-to-top__label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 16px 16px;
  border-radius: 12px;
  background: #4b5055;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.back-to-top__label::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #4b5055;
}

.back-to-top__button:hover .back-to-top__label,
.back-to-top__button:focus-visible .back-to-top__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 576px) {
  .back-to-top {
    display: none !important;
  }
}
