.lbaic-settings-blockeditable {
  --lbaic-settings-ai-textarea-right: 0;
  --lbaic-settings-ai-copilot-right: 0;

  width: 100%;
  min-height: 42px;
  border: 1px solid var(--lbaic-settings-blockeditable-border);
  border-radius: 6px;
  transition: border-color 200ms ease-in-out;

  &:not(.lbaic-settings-blockeditable-has-custom-box-shadow) {
    transition: box-shadow 200ms ease-in-out, border-color 200ms ease-in-out;
  }

  &:focus-within {
    border: 1px solid rgba(var(--lbaic-settings-primary-rgb), 0.3);
    box-shadow: 0 0 0 3px rgba(var(--lbaic-settings-primary-rgb), 0.2);
  }

  &-header {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    padding-inline: 10px;

    &-actions {
      display: flex;
      flex: 0 0 auto;
      transform: var(--lbaic-settings-blockeditable-actions-transform, translate3d(30px, 0, 0));
      transition: transform 360ms ease-in-out var(--lbaic-settings-blockeditable-actions-delay, 360ms);
      z-index: 1;

      &-in {
        position: relative;
        width: 24px;
        height: 24px;

        &:not(:first-child) {
          margin-inline-start: 6px;
        }

        &.active {
          --lbaic-settings-blockeditable-color: var(--lbaic-settings-primary);
          --lbaic-settings-blockeditable-ai-input-transform: translate3d(0, 4px, 0);
          --lbaic-settings-blockeditable-ai-input-opacity: 1;
          --lbaic-settings-blockeditable-ai-input-events: all;
        }
      }

      &-item {
        width: 28px;
        height: 28px;
      }

      &-i {
        width: 18px;
        height: auto;
        flex: 0 0 18px;
        margin: auto;
        display: block;
        fill: var(--lbaic-settings-blockeditable-color);
      }

      &-arrow {
        opacity: var(--lbaic-settings-blockeditable-arrow-opacity, 0);
        transition: opacity 360ms ease-in-out var(--lbaic-settings-blockeditable-arrow-delay, 0ms);
      }
    }
  }

  &-title {
    min-width: 0;
    flex: 1 0 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-block: 8px;
    font-size: var(--lbaic-settings-fs-13);
    color: var(--lbaic-settings-blockeditable-title-color);

    &-in {
      display: inline-block;
      flex: 0 0 auto;
      padding-inline-end: 16px;
      margin-block-end: 5px;
      font-size: var(--lbaic-settings-fs-14);
      font-weight: var(--lbaic-settings-fw-500);
      line-height: var(--lbaic-settings-lh-18);
      cursor: pointer;
    }
  }

  &-preview {
    flex: 1 0 0;
    display: block;
    font-size: var(--lbaic-settings-fs-13);
    font-weight: var(--lbaic-settings-fw-400);
    line-height: var(--lbaic-settings-lh-20);
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: var(--lbaic-settings-blockeditable-preview-opacity, 1);
    transition: opacity 180ms ease-in-out;
    overflow: hidden;
  }

  &-ai-input {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    border-radius: 6px;
    box-shadow: 0 4px 16px 0 rgba(var(--lbaic-settings-black-rgb), 0.06);
    transform: var(--lbaic-settings-blockeditable-ai-input-transform, translate3d(0, 8px, 0));
    opacity: var(--lbaic-settings-blockeditable-ai-input-opacity, 0);
    transition: transform 180ms ease-in-out, opacity 180ms ease-in-out;
    pointer-events: var(--lbaic-settings-blockeditable-ai-input-events, none);
    z-index: 40;

    @include min-width($lbaic-settings-wp-xl-breakpoint) {
      width: 384px;
    }

    &-action {
      --lbaic-settings-button-fs: var(--lbaic-settings-fs-12);

      position: absolute;
      right: 12px;
      bottom: 12px;
      z-index: 1;
    }
  }

  &-body {
    position: relative;
    max-height: var(--lbaic-settings-blockeditable-height, 0);
    transition: max-height 360ms ease-in-out;
    overflow: hidden;

    &-in {
      width: 100%;
      height: 100%;
      min-height: 48px;
      padding-block: 12px;
      padding-inline: 12px;
      background-color: transparent;
      font-size: var(--lbaic-settings-fs-13);
      font-weight: var(--lbaic-settings-fw-400);
      color: var(--lbaic-settings-blockeditable-color);
      line-height: var(--lbaic-settings-lh-24);
      word-break: break-word;
      white-space: pre-wrap;

      & * {
        font-size: inherit;
        font-weight: inherit;
        color: inherit;
        line-height: inherit;
        word-break: inherit;
        white-space: inherit;
      }

      b, strong {
        font-weight: 700;
      }

      span {
        background-color: transparent !important;
      }

      a {
        pointer-events: auto;
        cursor: pointer;
      }

      &.empty {
        &:before {
          content: attr(data-placeholder);
          position: absolute;
          top: 12px;
          left: 12px;
          font-size: inherit;
          color: var(--lbaic-settings-blockeditable-placeholder-color);
          pointer-events: none;
        }
      }

      & ol, ul {
        list-style-position: outside;
        margin-inline-start: 16px;
        padding-inline-start: 16px;
      }
    }
  }

  &-error {
    --lbaic-settings-blockeditable-border: var(--lbaic-settings-input-error);
    --lbaic-settings-blockeditable-title-color: var(--lbaic-settings-input-error);

    /*.lbaic-settings-input-holder-in {
      &:focus-within {
        --lbaic-settings-input-border: var(--lbaic-settings-input-error);
        --lbaic-settings-input-placeholder-color: var(--lbaic-settings-input-error);
      }
    }*/

    &-message {
      padding-block-start: 4px;

      &-in {
        font-size: var(--lbaic-settings-fs-12);
        font-weight: var(--lbaic-settings-fw-500);
        color: var(--lbaic-settings-input-error);
        line-height: var(--lbaic-settings-lh-16);
      }
    }
  }

  &.opened {
    --lbaic-settings-blockeditable-height: var(--lbaic-settings-blockeditable-content-height);
    --lbaic-settings-blockeditable-preview-opacity: 0;
    --lbaic-settings-blockeditable-actions-transform: translate3d(0, 0, 0);
    --lbaic-settings-blockeditable-actions-delay: 0ms;
    --lbaic-settings-blockeditable-arrow-opacity: 1;
    --lbaic-settings-blockeditable-arrow-delay: 360ms;

    & .lbaic-settings-blockeditable-header-actions-i {
      transform: scaleY(-1);
    }
  }

  &-disabled {
    opacity: 0.4;
    pointer-events: none;
  }

  &-white {
    background-color: var(--lbaic-settings-white);
  }
}