/* American Butler · shared progressive-enhancement back-to-top control */
.ab-page-top-anchor {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ab-back-to-top {
  --ab-back-to-top-size: 3rem;
  position: fixed;
  z-index: 80;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  width: var(--ab-back-to-top-size);
  height: var(--ab-back-to-top-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ab-color-rule-strong, rgba(7, 20, 29, .2));
  border-radius: var(--ab-radius-sm, 1rem);
  background: var(--ab-color-glass, rgba(255, 252, 248, .92));
  color: var(--ab-color-ink, #07141d);
  box-shadow: var(--ab-shadow-float, 0 12px 32px rgba(7, 20, 29, .14));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    inset-block-end 240ms cubic-bezier(.22, 1, .36, 1),
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s linear 0s;
}

.ab-back-to-top.is-enhanced:not(.is-visible) {
  opacity: 0;
  visibility: hidden;
  transform: translateY(.5rem);
  pointer-events: none;
  transition-delay: 0s, 0s, 0s, 0s, 0s, 0s, 180ms;
}

.ab-back-to-top.is-raised {
  inset-block-end: calc(max(.75rem, env(safe-area-inset-bottom)) + 4.75rem);
}

.ab-back-to-top__icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ab-back-to-top__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ab-back-to-top:focus-visible {
  outline: 3px solid var(--ab-color-focus, #ff831e);
  outline-offset: 4px;
}

.ab-back-to-top:active {
  transform: translateY(1px);
}

/* The shared control replaces only the duplicated legacy "up" actions. */
.menu-actions__item_up,
.footer__plain {
  display: none !important;
}

.menu-actions {
  width: 240px;
}

@media (hover: hover) and (pointer: fine) {
  .ab-back-to-top:hover {
    border-color: var(--ab-color-accent, #ff831e);
    background: var(--ab-color-accent, #ff831e);
    color: var(--ab-color-on-dark, #fff);
    transform: translateY(-2px);
  }
}

@media (min-width: 48rem) {
  .ab-back-to-top {
    --ab-back-to-top-size: 3.5rem;
    inset-inline-end: max(1.5rem, env(safe-area-inset-right));
    inset-block-end: max(1.5rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 47.99rem) {
  .menu-actions .menu-actions__item {
    width: 33.333%;
  }
}

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

@media print {
  .ab-back-to-top {
    display: none !important;
  }
}
