/* Shared, consent-aware back-to-top control. Existing banners remain in charge. */
.back-to-top {
  position: fixed;
  inset-inline-end: 24px;
  bottom: calc(var(--back-to-top-offset, 20px) + var(--safe-b, 0px));
  z-index: calc(var(--z-bar, 90) - 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border: 1px solid #ffffff4d;
  border-radius: var(--r-control, 10px);
  background: var(--p-teal-700, #12645d);
  color: var(--p-white, #fff);
  box-shadow: 0 4px 16px #0b1f2c26;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, box-shadow .18s ease;
}

.back-to-top[hidden] {
  display: none !important;
}

.back-to-top svg {
  flex: 0 0 auto;
}

.back-to-top:focus-visible {
  outline: 3px solid var(--p-ink, #0b1f2c);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--p-white, #fff);
}

@media (hover: hover) {
  .back-to-top:hover {
    background: var(--p-ink, #0b1f2c);
    box-shadow: 0 6px 20px #0b1f2c33;
  }
}

@media (max-width: 1023px) {
  .back-to-top {
    inset-inline-end: 16px;
  }
}

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

@media (forced-colors: active) {
  .back-to-top {
    border: 1px solid ButtonText;
    color: ButtonText;
    background: ButtonFace;
  }
}

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