[data-back-to-top] {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 35;
  isolation: isolate;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(#1688b9 var(--back-to-top-progress, 0%), #d4e8f1 0);
  color: #087eae;
  cursor: pointer;
}

[data-back-to-top]::before {
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: inherit;
  background: #fff;
  content: '';
}

[data-back-to-top][hidden] { display: none; }
[data-back-to-top]:hover::before { background: #e8f6fc; }
[data-back-to-top]:focus-visible { outline: 2px solid #1688b9; outline-offset: 3px; }
body:has(dialog[open], [aria-modal=true]:not([hidden])) [data-back-to-top] { visibility: hidden; }

@media (width > 768px) {
  body:has(.ck-bar:not([hidden])) [data-back-to-top] { bottom: 140px; }
}

@media (max-width: 768px) {
  [data-back-to-top] {
    right: 16px;
    bottom: max(calc(var(--back-to-top-mobile-bottom, 88px) + env(safe-area-inset-bottom)), var(--back-to-top-cookie-offset, 0px));
  }
  :is([data-theme-page=package-detail], [data-theme-page=day-trip]) [data-back-to-top] { --back-to-top-mobile-bottom: 146px; }
}

@media (forced-colors: active) {
  [data-back-to-top] { border: 2px solid ButtonText; }
}
