.tree {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow: auto;
  font-size: 14px;
}

.tree-search {
  width: calc(100% - 16px);
  height: 30px;
  margin: 8px 8px 4px;
  padding: 7px 9px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: inherit;
  font: inherit;
}

.tree-search:focus {
  outline: 1px solid var(--accent);
  outline-offset: 0;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 16px;
}

.tree > ul {
  padding-left: 0;
}

.tree li {
  margin: 2px 0;
}

.tree button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 4px 6px;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.tree button span {
  white-space: nowrap;
}

.tree button:hover {
  background: var(--tree-hover);
}

.tree button.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.tree-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-btn span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-btn.tree-file .tree-caret {
  width: 8px;
  flex: 0 0 8px;
}

.tree-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
}

.tree-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tree-caret {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  color: var(--muted);
  transition: transform 120ms ease;
}

.tree-caret.collapsed {
  transform: rotate(-90deg);
}
