/* Adopted B only; comparison-page resets and controls are intentionally absent. */
.hamuya-backtop {
  --person-height: 96px;
  position: fixed; z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom) + var(--hamuya-backtop-lift, 0px));
  box-sizing: border-box; display: grid; place-items: center;
  width: 76px; min-height: 100px; padding: 8px 4px;
  background: none; color: #34312D; border: 0; border-radius: 2px;
  box-shadow: none; text-decoration: none; -webkit-tap-highlight-color: transparent;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(8px, 8px);
  transition: opacity 180ms ease, transform 220ms ease, visibility 220ms;
}
.hamuya-backtop[hidden] { display: none; }
.hamuya-backtop svg { display: block; height: var(--person-height); width: auto; pointer-events: none; overflow: visible; }
.hamuya-backtop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, 0); }
.hamuya-backtop:focus-visible { outline: 2px solid #C8392A; outline-offset: 0; }
.hamuya-backtop:active { opacity: .72; }
.hamuya-backtop .ptp-arm-up { transform-box: view-box; transform-origin: 79px 50px; }
.hamuya-backtop.is-posing .ptp-arm-up { animation: hamuya-backtop-point-up 720ms 100ms cubic-bezier(.22,.65,.28,1) 1 both; }
@keyframes hamuya-backtop-point-up { 0% { transform: rotate(85deg); } 76% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
/* Only the verified standard top button, never its fixed-controls wrapper. */
html.hamuya-backtop-ready:has(#body_wrap.hamuya-trial-page) #pagetop { display: none !important; }
@media (max-width: 700px) {
  .hamuya-backtop { --person-height: 80px; width: 64px; min-height: 96px; right: max(10px, env(safe-area-inset-right)); }
}
@media (hover: hover) and (pointer: fine) {
  .hamuya-backtop svg { transition: transform 200ms ease; }
  .hamuya-backtop::before, .hamuya-backtop::after {
    content: ""; position: absolute; top: 42%; pointer-events: none;
    background: #F2EBDF; opacity: 0; visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms;
  }
  .hamuya-backtop::before {
    content: "BACK TO TOP"; right: calc(100% + 2px); transform: translateY(-50%);
    padding: 8px 10px; border-radius: 2px; color: #C8392A;
    font-family: "Zen Maru Gothic", "Yu Gothic", Meiryo, sans-serif;
    font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: .06em; white-space: nowrap;
  }
  .hamuya-backtop::after { right: calc(100% - 1px); width: 6px; height: 6px; transform: translateY(-50%) rotate(45deg); }
  .hamuya-backtop:is(:hover, :focus-visible)::before, .hamuya-backtop:is(:hover, :focus-visible)::after { opacity: 1; visibility: visible; }
  .hamuya-backtop:is(:hover, :focus-visible) svg { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .hamuya-backtop.is-posing .ptp-arm-up { animation: none; transform: none; }
  .hamuya-backtop { transition: none; transform: none; }
  .hamuya-backtop::before, .hamuya-backtop::after { transition: none; }
  .hamuya-backtop svg, .hamuya-backtop:is(:hover, :focus-visible) svg { transition: none; transform: none; }
}
