.scroll-step-button {
  position: fixed;
  right: max(16px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 60;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #1789f6, #635bdf);
  box-shadow: 0 14px 34px rgba(18, 74, 154, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

body.scroll-step-has-chat .scroll-step-button {
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 88px));
}

.scroll-step-button.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-step-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 38px rgba(18, 74, 154, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.scroll-step-button:active { transform: scale(0.95); }

.scroll-step-button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.38);
  outline-offset: 3px;
}

.scroll-step-arrow {
  font: 800 25px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transform: translateY(-1px);
}

.scroll-step-marker {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #173156;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
  font: 900 10px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 680px) {
  .scroll-step-button {
    right: max(13px, calc(env(safe-area-inset-right) + 10px));
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  body.scroll-step-has-chat .scroll-step-button {
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 82px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-step-button { transition: none; }
}
