c8y-asset-property-list {
  .cdk-tree {
    background: inherit;
    max-width: 100%;
    display: block;
    overflow: hidden;

    &:has(.drag-handle-wrapper) {
      padding-left: 8px;
    }
  }

  .tree-container:has(.drag-handle-wrapper) {
    .select-all-container {
      > .separator-bottom,
      > .overflow-hidden {
        padding-left: 8px;
      }
    }
  }

  .cdk-tree-node {
    height: 40px;
    background: inherit;

    .drag-handle-wrapper {
      z-index: 5;
      display: flex;
      align-items: center;
      position: absolute;
      height: 100%;
      font-size: 0.7em;
      opacity: 0;
      transition: opacity 0.15s linear;
    }

    &:hover {
      .drag-handle-wrapper {
        opacity: 1;
      }
    }
  }

  .cdk-tree-node > .d-flex::before {
    position: absolute;
    content: '';
    top: 0;
    left: -6px;
    width: 20px;
    bottom: 0;
    display: block;
    border-left: 1px solid
      var(
        --c8y-component-icon-dark-color-light,
        var(--c8y-root-component-icon-dark-color-light, var(--brand-light, var(--c8y-brand-light)))
      );
    z-index: 1;
  }

  .cdk-tree-node:last-of-type > .d-flex::before {
    bottom: 50%;
  }

  .cdk-tree-node:not([aria-level='1']) {
    > .d-flex::after {
      content: '';
      top: 50%;
      left: -6px;
      width: 20px;
      /* bottom: 0; */
      display: block;
      border-bottom: 1px solid
        var(
          --c8y-component-icon-dark-color-light,
          var(
            --c8y-root-component-icon-dark-color-light,
            var(--brand-light, var(--c8y-brand-light))
          )
        );
      z-index: 1;
      position: absolute;
      pointer-events: none;
    }

    &.nonSelectable {
      > .d-flex::after {
        width: 40px;
      }
    }

    .drag-handle-wrapper {
      left: -24px;
    }
  }

  .cdk-tree-node[aria-level]:not([aria-level='1']):not([aria-level='2']) {
    position: relative;

    &::after {
      position: absolute;
      content: '';
      top: 0;
      left: 18px;
      width: 20px;
      bottom: 0;
      display: block;
      border-left: 1px solid
        var(
          --c8y-component-icon-dark-color-light,
          var(
            --c8y-root-component-icon-dark-color-light,
            var(--brand-light, var(--c8y-brand-light))
          )
        );
      z-index: 1;
    }

    &[aria-level='4'] {
      &::before {
        position: absolute;
        content: '';
        top: 0;
        left: 42px;
        width: 20px;
        bottom: 0;
        display: block;
        border-left: 1px solid
          var(
            --c8y-component-icon-dark-color-light,
            var(
              --c8y-root-component-icon-dark-color-light,
              var(--brand-light, var(--c8y-brand-light))
            )
          );
        z-index: 1;
      }
    }
  }

  .cdk-tree-node.nonCollapsible:not([aria-level='1']) {
    > .d-flex::before {
      left: -5px;
    }

    > .d-flex::after {
      width: 14px;
      left: -5px;
    }

    &.nonSelectable {
      > .d-flex::before {
        left: 0;
      }

      > .d-flex::after {
        width: 10px;
        left: 0;
      }
    }
  }

  .cdk-tree-node[aria-level='1'] > .d-flex::before {
    display: none;
  }

  .cdk-tree-node[aria-level='1'] {
    overflow: visible;
  }

  .cdk-tree-node {
    .c8y-list__item__check,
    .c8y-list__item__radio {
      z-index: 4;
    }

    &[aria-level='1'],
    &[aria-level='2'],
    &[aria-level='3'] {
      &:before {
        content: '';
        background: inherit;
        width: 44px;
        height: 100%;
        position: absolute;
        left: 0;
        bottom: calc(50% - 1px);
        z-index: 3;
        pointer-events: none;
      }

      &.nonCollapsible {
        &::before {
          width: 18px;
          bottom: calc(100% - 1px);
          height: 50%;
        }

        + .cdk-tree-node[aria-level='1'] {
          &::before {
            background: transparent;
          }
        }
      }
    }

    &[aria-level='2'] {
      &::before {
        left: 24px;
        z-index: 1;
      }

      &.nonCollapsible {
        + .cdk-tree-node[aria-level='2'] {
          &::before {
            background: transparent;
          }
        }
      }
    }

    &[aria-level='3'] {
      &::before {
        left: 48px;
        z-index: 1;
      }

      &.nonCollapsible {
        + .cdk-tree-node[aria-level='3'] {
          &::before {
            background: transparent;
          }
        }
      }
    }
  }

  .cdk-tree-node .collapse-btn {
    background-color: inherit;
    position: relative;
    z-index: 4;
  }

  .cdk-tree-node .c8y-list__item__radio {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    max-height: 40px !important;
    min-height: unset !important;
  }

  .cdk-tree-node .c8y-list__item__icon {
    padding-top: 7px;
    padding-bottom: 7px;
    z-index: 2;
  }

  c8y-asset-property-list:has(.asset-property-list__actions.has-computed) {
    .asset-property-list__actions {
      min-width: 96px;
    }
  }
}

.c8y-list__item--dense.cdk-drag-preview {
  background-color: @component-background-default;
  &::before,
  .drag-handle-wrapper {
    display: none;
  }
}
