/* Shared back-to-top control: fixed reading size and touch target. */
.back-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 88px;
  min-width: 88px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #30475f;
  border-radius: 4px;
  background: #061e3b;
  color: #fff;
  box-shadow: 0 3px 12px #061e3b1a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  transition: background-color .18s ease, border-color .18s ease;
}
.back-top[hidden] { display: none !important; }
.back-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (hover: hover) {
  .back-top:hover { background: #193752; border-color: #ae8957; }
}
.back-top:active { background: #25435e; }
@media (max-width: 640px) {
  .back-top {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-top { transition: none; }
}
