.tree-section[data-group="pinned"] {
  color: var(--pinned);
}

.tree-section[data-group="pinned"] .section-header,
.tree-section[data-group="pinned"] .section-header > span,
.tree-section[data-group="pinned"] .tree-label,
.tree-section[data-group="pinned"] .node-name,
.tree-section[data-group="pinned"] .tree-row svg,
.tree-section[data-group="pinned"] .tree-actions button,
.tree-section[data-group="pinned"] .tree-drag-handle {
  color: var(--pinned);
}

.tree-section[data-group="pinned"] .tree-row:hover,
.tree-section[data-group="pinned"] .tree-row.active,
.tree-section[data-group="pinned"] .tree-row.selected {
  background: var(--pinned-soft);
}

.tree-section[data-group="pinned"] .tree-children {
  border-color: var(--pinned-soft);
}

.tree-row {
  position: relative;
  min-width: 0;
}

.tree-row > .tree-label {
  flex: 1;
  min-width: 0;
}

.tree-row > .tree-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 28px;
  padding: 2px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: var(--transparent);
  color: var(--muted);
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.tree-row > .tree-drag-handle svg {
  width: 12px;
  height: 12px;
}

.tree-row:hover > .tree-drag-handle,
.tree-row:focus-within > .tree-drag-handle {
  opacity: 1;
}

.tree-row > .tree-drag-handle:hover {
  background: var(--hover);
  color: var(--white);
}

.tree-row > .tree-drag-handle:active {
  cursor: grabbing;
}

.tree-row.tree-dragging {
  opacity: 0.4;
}

.tree-row.tree-drop-before::before,
.tree-row.tree-drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  border-radius: 2px;
  background: var(--brand);
  pointer-events: none;
}

.tree-row.tree-drop-before::before {
  top: -2px;
}

.tree-row.tree-drop-after::after {
  bottom: -2px;
}

.tree-row.tree-drop-inside {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.tree-section[data-group="pinned"] .tree-row.tree-drop-before::before,
.tree-section[data-group="pinned"] .tree-row.tree-drop-after::after {
  background: var(--pinned);
}

.tree-drag-active,
.tree-drag-active .tree-label,
.tree-drag-active .tree-drag-handle {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.tree-drag-active .tree-actions {
  pointer-events: none;
}

@media (max-width: 768px) {
  .tree-row > .tree-drag-handle {
    display: none;
  }

  .tree-row {
    touch-action: pan-y;
    -webkit-touch-callout: none;
  }

  .tree-row.tree-dragging {
    opacity: 0.4;
  }
}