.elementor .elementor-element.elementor-widget-d12_back_to_top {
  --d12-back-to-top-edge: var(--d12-back-to-top-offset-x, 24px);
  --d12-back-to-top-safe-left: max(env(safe-area-inset-left, 0px), var(--d12-back-to-top-edge));
  --d12-back-to-top-safe-right: max(env(safe-area-inset-right, 0px), var(--d12-back-to-top-edge));
  position: fixed;
  top: auto;
  left: var(--d12-back-to-top-left, auto);
  right: var(--d12-back-to-top-right, var(--d12-back-to-top-safe-right));
  bottom: max(env(safe-area-inset-bottom, 0px), var(--d12-back-to-top-offset-y, 24px));
  width: max-content;
  max-width: 100%;
  margin: 0;
  z-index: 100;
}

.d12-back-to-top__button.d12-button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}

/* Make the widget selectable in its own container while editing its document. */
body.elementor-editor-active .elementor-edit-area-active
  .elementor-element.elementor-widget-d12_back_to_top:not([inert] *) {
  /* Reuse the responsive side values as flex margins at the container edge. */
  --d12-back-to-top-safe-left: 0px;
  --d12-back-to-top-safe-right: 0px;
  position: relative;
  inset: auto;
  margin-left: var(--d12-back-to-top-left, auto);
  margin-right: var(--d12-back-to-top-right, 0px);
  z-index: auto;
}

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

/* Newly inserted widgets can render before the frontend visibility script runs. */
body.elementor-editor-active .elementor-edit-area-active
  .d12-back-to-top__button[hidden]:not([inert] *) {
  display: grid !important;
}

.d12-back-to-top-destination {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
