.treeControl {
    display: block;
}

.treeNodeChildren {
    display: block;
    margin-left: 21px;
}

.treeNodeElement img {
    display: block;
    flex: none;
}

.treeNodeElement,
.treeNodeElementBody,
.treeNodeExpander,
.treeNodeLoading {
    display: flex;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    flex: none;
    min-height: 24px;
}

.treeNodeElementBody {
    min-width: calc(100% - 26px);
    cursor: default;
}

.treeNodeElement.current .treeNodeElementBody {
    background: #dde7f3;
}

.treeNodeElementBody.disabled > * {
    opacity: 0.5;
}

.treeNodeExpander,
.treeNodeLoadingIcon,
.nodeCheckbox {
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.treeNodeExpander {
    cursor: pointer;
}

.treeNodeExpander > * {
    display: inline-block;
}

/* Attempt to have tree nodes spacing scale with font-size. */
.treeNodeElementBody {
    & .nodeIcon {
        margin: 0.25rem;
    }

    & :is(.label, .nodeCount) {
        margin: 0.45rem 0.25rem;
    }
}

.treeNodeElementBody .nodeCount {
    color: var(--anno-symbol);

    .current & {
        color: var(--anno-symbol-current); /* For WCAG compliance on darker "current" background. */
    }
}

.treeNodeLoading {
    opacity: 0;
    font-style: italic;
    color: #757575;
    margin-left: 16px;
}

.treeNodeChildren .treeNodeLoading {
    margin-left: 42px;
}

.treeNodeLoading.hidden {
    height: 0;
    opacity: 0;
}

.treeNodeLoading.visible {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.treeNodeLoadingIcon {
    position: relative;
}

.treeNodeLoadingIcon .circle1,
.treeNodeLoadingIcon .circle2 {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border-radius: 50%;
    background-color: #757575;
    opacity: 0.25;
    position: absolute;
    top: 3px;
    left: 3px;
    animation: pulse 2s infinite ease-in-out;
}

.treeNodeLoadingIcon .circle2 {
    animation-delay: -1s;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(0);
    }
    50% {
        transform: scale(1);
    }
}

/*
 * Schema Tree
 */
.treeNodeElementBody.inTable {
}

.treeNodeElementBody .inTable {
    font-weight: bold;
    font-style: italic;
}

.stackedIcons {
    position: relative;
}

.stackedIcons > * + * {
    position: absolute;
    top: 0;
    left: 0;
}

.levelSelectButton {
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
}

.levelSelectListOuter {
    position: relative;
    display: flex;
    margin: 0;
}

.levelSelectList {
    position: absolute;
    z-index: 1;
    top: -5px;
    left: 100%;
    margin-left: 2px;
    font-size: var(--fs-body);
}

.tableOnlyMarker {
    color: var(--tree-table-only-marker);
    font-weight: bold;
}

.treeNodeElementBody .btn-primary,
.treeNodeElementBody .btn-disabled {
    padding-top: 1px;
    padding-bottom: 1px;
    margin-left: 1rem;
}

/*
 * Schema Tree - Summations
 */
.treeNodeElementBody .summations,
.treeNodeElementBody .summations .weight {
    display: flex;
    flex-direction: column;
}

.treeNodeElementBody .summations {
    border-left: 2px solid #66a249;
    border-radius: 0.4rem;
    padding-left: 0.5rem;
    margin: 4px 0;

    .current & {
        border-left-color: #5b9041; /* For WCAG compliance on darker "current" background. */
    }
}

.treeNodeElementBody .statFns,
.treeNodeElementBody .statFns > label,
.treeNodeElementBody .summations > .header {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.treeNodeElementBody .statFns > label > span {
    margin: 2px;
}

.treeNodeElementBody .statFns > label + label {
    margin-left: 0.8rem;
}

.treeNodeElementBody .statFns .nodeIcon {
    margin-left: -10px;
}

/*
 * Schema Tree - Drag n Drop
 */

.schemaDragPreview,
.schemaDropPanel {
    border: 1px #cdcdcd solid;
    box-shadow: 0.2rem 0.2rem 0.5rem -0.2rem #000;
}

/*
 * Schema Tree - Drag Preview
 */

.schemaDragPreview {
    position: fixed;
    z-index: 4;
    display: flex;
    align-items: center;
    padding: 0.2rem 0.4rem 0.2rem 0.2rem;
    background: white;
}

.schemaDragPreview > * {
    margin: 0.2rem;
}

/*
 * Schema Tree - Drop targets (Drop Panel + Concat)
 */

.schemaDropPanel {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 4;
    padding: 0.4rem;

    border-radius: 0.3rem;
    background: #f7f7f7;
}
.schemaDropPanelItem,
.schemaDropPanelItem > * {
    display: flex;
}

.schemaDropPanelItem {
    margin: 0.2rem;
    background: #ffffff;
}

.schemaDropPanelItem > * {
    flex: auto;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 5rem;
    border: 1px #cdcdcd solid;
    border-bottom-width: 0;
    transition: background 0.1s ease-in;
}

.schemaDropPanelItem:last-child {
    border-bottom-width: 1px;
}

.concatDropTarget {
    display: none;
}

.concatDropTarget.dragging,
.concatDropTarget.cannotDrop,
.concatDropTarget.canDrop {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

.schemaDropPanelItem,
.concatDropTarget.dragging {
    outline: 0.1rem rgba(0, 128, 0, 0.5) dashed;
    outline-offset: -0.1rem;
    box-shadow: inset 0 0 0.2rem 0.2rem rgba(0, 128, 0, 0.25);
}

.concatDropTarget.cannotDrop {
    display: none;
}

.dndTarget,
.schemaDropPanelItem.over,
.concatDropTarget.canDrop {
    outline: 0.2rem green solid;
    outline-offset: -0.2rem;
    background: rgba(0, 128, 0, 0.25);
}
