@layer payload-default {
  .psi-collapsible-audit {
    &__content {
      display: grid;
      grid-template-rows: 0fr;
      overflow-y: hidden;
      transition: grid-template-rows 200ms;
    }

    &__collapsible {
      min-height: 0;
      transition: visibility 200ms;
      visibility: hidden;
      width: 100%;
    }

    &__inner-content {
      padding-bottom: calc(var(--base) / 2);
      padding-left: calc(var(--base) / 2);
    }

    &__header, &__title {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    &__header {
      padding-left: calc(var(--base) / 2);
      cursor: pointer;

      &:hover {
        color: var(--theme-elevation-1000);
        background-color: var(--theme-elevation-50);
      }
    }

    &__title {
      justify-content: none;
      gap: calc(var(--base) / 4);
    }

    &__toggler {
      margin-block: calc(var(--base) / 2);
    }

    &__description {
      position: relative;
      min-width: 0;
      color: var(--theme-elevation-800);
      margin-bottom: var(--base);
      white-space: normal;
      word-break: break-word;
    }

    &--expanded {
      & .psi-collapsible-audit__content {
        grid-template-rows: 1fr;
      }

      & .psi-collapsible-audit__collapsible {
        visibility: visible;
      }

      & .psi-collapsible-audit__toggler {
        transform: rotateZ(180deg);
      }
    }

    &--hide-toggle &__header {
      padding-block: calc(var(--base) / 2);
      cursor: default;

      &:hover {
        color: inherit;
        background-color: inherit;
      }
    }
  }
}
