html { scroll-behavior: smooth; }

.yd-back-to-top {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(220, 232, 244, .45);
  border-radius: 50%;
  background: rgba(27, 39, 52, .68);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  font-size: 25px;
  line-height: 1;
  text-decoration: none;
}

.yd-back-to-top:hover,
.yd-back-to-top:focus-visible {
  background: rgba(48, 64, 82, .9);
  border-color: #e9f0f7;
  color: #fff !important;
}

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

@media (max-width: 639px) {
  .yd-back-to-top {
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
