:root, [data-gin-accent] {
  --wp-admin-theme-color: var(--gin-color-primary) !important;
  --wp-admin-theme-color--rgb: var(--gin-color-primary-rgb) !important;
  --wp-admin-theme-color-darker-10: color-mix(in srgb, var(--wp-admin-theme-color) 90%, black) !important;
  --wp-admin-theme-color-darker-20: color-mix(in srgb, var(--wp-admin-theme-color) 80%, black) !important;
  --wp-admin-border-width-focus: 2px;
  --wp-components-color-accent: var(--wp-admin-theme-color) !important;
  --wp-components-color-accent-inverted: #fff !important;
  --wp-components-color-accent-darker-10: var(--wp-admin-theme-color-darker-10) !important;
}

:where(*) .gin-sticky-form-actions>.drupal-form-actions__menu,
:is(#extra-specificity-hack, [data-drupal-admin-styles]) .gin-sticky-form-actions>.drupal-form-actions__menu {
  margin-inline-start: var(--gin-spacing-xs) !important;
  display: block !important;
}

@media (min-width: 782px) {
  .interface-interface-skeleton {
    left: var(--sidebar-width) !important;
    top: 0px !important;
  }
}

.edit-post-header {
  .components-button {
    height: 40px !important;
    line-height: 1rem !important;

    &.has-icon {
      min-width: 40px !important;
    }
  }

  .form-actions {
    margin-block: 0;
  }
}

.edit-post-layout {
  fieldset:not(.fieldgroup) {
    padding: 0;
    border: 0;
    background: none;

    &>legend {
      position: initial;

      &.components-visually-hidden {
        position: absolute;
      }

    }
  }

  &__metaboxes {
    .accordion__item.more-settings {
      width: 100%;
    }
  }
}

.edit-post-fullscreen-mode-close {
  &.has-icon {
    height: 61px !important;
  }
}

.page-wrapper :focus {
  box-shadow: none !important;
}

// Sidebar width is now set globally in _sidebar.scss (380px).

// Neutralize Gin form styles within Gutenberg sidebar panels.
.drupal-sidebar-panel .drupal-panel__content {
  .form-element {
    border: 1px solid #949494;
    border-radius: 2px;
    background-color: #fff;
    color: #1e1e1e;
    min-height: 0;
    padding: 8px;
    font-size: 13px;

    &:focus {
      border-color: var(--wp-admin-theme-color);
      box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
      outline: none;
    }

    &--type-select {
      padding-right: 24px;
    }
  }

  .form-item {
    margin-top: 0;
    margin-bottom: 16px;
  }

  .form-item__label {
    font-size: 11px;
    font-weight: 500;
  }

  // Override Gin dark mode within sidebar panels.
  .gin--dark-mode & {
    color: #1e1e1e;

    .form-element {
      background-color: #fff;
      color: #1e1e1e;
      border-color: #949494;
    }
  }

  .claro-details,
  details.claro-details {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: inherit;
  }

  .claro-details__summary,
  .claro-details > .claro-details__summary {
    display: none !important;
  }

  .claro-details__wrapper,
  .claro-details > .claro-details__wrapper,
  .details-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  .form-boolean--type-toggle {
    width: 36px;
    height: 18px;
    min-width: 36px;
    background-color: #949494;
    border: none;
    border-radius: 9px;

    &::before {
      top: 3px;
      left: 3px;
      width: 12px;
      height: 12px;
      background: #fff;
      border-radius: 50%;
      box-shadow: none;
    }

    &::after {
      display: none;
    }

    &:checked {
      background-color: var(--wp-admin-theme-color);

      &::before {
        transform: translateX(18px);
      }
    }
  }
}