.tree {
    flex: 1 1 auto;
    width: 100%;
    overflow: auto;
    white-space: pre;
    line-height: 20px;
    font-size: 14px;

    user-select: none;

    &:focus {
        outline: none;
    }

    table {
        border-spacing: 0;
    }

    &__cell {
        padding-left: 0;
        padding-right: 0;
    }

    &__row {
        color: white;
        width: 100%;
        display: table;

        &:hover {
            background-color: $color-bg-3;
        }

        &--selected {
            background-color: $color-bg-5;
            cursor: pointer;

            &:hover {
                background-color: $color-bg-5;
            }
        }

        &--active {
            color: white;
            width: 100%;
            display: table;
            background-color: #1c7cd6 !important;
        }
    }

    &__row-alert {
        display: block;
        padding: 0.25rem 0;
        margin: 0;
    }

    &__row-icon {
        color: white !important; // override link color
        // stylelint-disable-next-line declaration-property-unit-whitelist
        width: 1.1em;
    }

    &__row-contents {
        display: flex;
        color: white;
        align-items: center;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        cursor: pointer;

        &-new {
            justify-content: space-between;
        }

        &-text {
            display: flex;
            align-items: center;
        }
    }

    &__row-label {
        margin-left: 0.25rem;
        color: white !important; // override link color
    }
}

.theme-light {
    .tree {
        &__row {
            color: inherit;

            &:hover {
                background-color: $color-light-bg-4;
                color: inherit;
            }

            &--selected {
                background-color: $color-light-bg-3;
                color: inherit;

                &:hover {
                    background-color: $color-light-bg-3;
                }
            }

            &--active {
                background-color: $primary;
                color: $color-light-text-4 !important;
            }
        }

        &__row-icon {
            color: inherit !important; // override link color
        }

        &__row-label {
            color: inherit !important; // override link color
        }

        &__row-contents {
            color: inherit; // override link color

            &:hover {
                color: inherit;
            }
        }

        a {
            color: inherit !important; // override link color
        }
    }
}

.tree-layer {
    width: 100%;

    // Remove user-agent focus ring.
    outline: none;
}

.tree-row {
    width: 100%;
}
