.gin-sticky-form-actions {
  display: flex;
  gap: var(--gin-spacing-xs);

  > * {
    margin: 0 !important;
  }

  // Hide if no items are present.
  [data-drupal-selector="edit-status"]:empty {
    display: none;
  }
}

// Hide actions if we preprocessed them.
.gin-sticky-form-actions--preprocessed ~ .layout-container form.gin--has-sticky-form-actions .gin-sticky-form-actions {
  @include visually-hidden;
  position: fixed !important;
  inset-block-start: 0;
}

// Gutenberg alignment.
.edit-post-header .gin-sticky-form-actions {
  margin-block-start: 0;
}

@keyframes gin-pseudo-throbber {
  0% {
    background-size: 8px 8px;
    background-position: 16px 18px;
  }
  50% {
    background-size: 32px 32px;
    background-position: 4px 14px;
  }
  100% {
    background-size: 8px 8px;
    background-position: 16px 18px;
  }
}

[data-drupal-selector="gin-sticky-edit-save"],
[data-drupal-selector="gin-sticky-edit-preview"],
[data-drupal-selector="gin-sticky-edit-delete"] {
  background-repeat: no-repeat;
  background-position: var(--gin-spacing-xs) center;
}

body:has([data-drupal-selector="edit-save"] + .ajax-progress) :where([data-drupal-selector="gin-sticky-edit-save"]),
body:has([data-drupal-selector="edit-preview"] + .ajax-progress) :where([data-drupal-selector="gin-sticky-edit-preview"]),
body:has([data-drupal-selector="edit-delete"] + .ajax-progress) :where([data-drupal-selector="gin-sticky-edit-delete"]) {
  padding-left: var(--gin-spacing-xl);
  background-image: icon('loader');
  animation: gin-pseudo-throbber 1s linear infinite;
}
