.ui-tree-list,
.ui-tree-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ui-tree-list {
  padding: 4px 0;
  color: var(--ui-text, #d6d6d6);
  user-select: none;
}

.ui-tree-list__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px 10px 4px calc(10px + var(--depth, 0) * 12px);
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--ui-text-dim, #8a8a8a);
  background: none;
  border: 0;
  cursor: pointer;
}

/* Arrow icon: an SVG mask, so it takes the text color of the theme. */
.ui-tree-list__arrow {
  flex: none;
  width: 10px;
  height: 10px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3h8L5 8z'/%3E%3C/svg%3E") center / 10px 10px no-repeat;
}

.ui-tree-list__group.is-collapsed > .ui-tree-list__toggle .ui-tree-list__arrow {
  transform: rotate(-90deg);
}

/* A group without items has no arrow; the label stays in line with the other groups. */
.ui-tree-list__group.is-empty > .ui-tree-list__toggle .ui-tree-list__arrow {
  visibility: hidden;
}

.ui-tree-list__group.is-collapsed > ul {
  display: none;
}

.ui-tree-list__item {
  padding-left: 34px;
}

.ui-tree-list__item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 10px 3px calc(24px + var(--depth, 0) * 12px);
  cursor: pointer;
}

.ui-tree-list__item:hover {
  background: var(--ui-panel-2, #2e2e2e);
}

.ui-tree-list__item.is-selected,
.ui-tree-list__toggle.is-selected {
  background: var(--ui-tree-list-selected, #3a3a3a);
}

.ui-tree-list__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-tree-list__meta {
  flex: none;
  font-size: 10px;
  color: var(--ui-text-dim, #8a8a8a);
}

/* Keyboard focus: a line inside the row, the list stays in place. */
.ui-tree-list__item:focus,
.ui-tree-list__toggle:focus {
  outline: none;
}

.ui-tree-list__item:focus-visible,
.ui-tree-list__toggle:focus-visible {
  outline: 1px solid var(--ui-focus, #3d7fd9);
  outline-offset: -1px;
}

.ui-tree-list__group-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
