:host {
  display: block;
}

.hb-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--hb-font-size-base);
  color: var(--hb-color-text);
  background-color: var(--hb-color-bg-container);
  box-sizing: border-box;
}

.hb-tree__children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hb-tree__node {
  list-style: none;
  white-space: nowrap;
}

.hb-tree__node-content {
  display: flex;
  align-items: center;
  gap: var(--hb-spacing-xxs);
  height: 28px;
  padding-right: var(--hb-spacing-xs);
  border-radius: var(--hb-border-radius-sm);
  cursor: pointer;
  transition: background-color var(--hb-transition-duration, 0.2s) var(--hb-transition-function, ease);
  box-sizing: border-box;
}

.hb-tree__node-content:hover {
  background-color: var(--hb-color-fill-tertiary);
}

.hb-tree__node-content--selected {
  background-color: var(--hb-color-primary-bg);
}

.hb-tree__node--disabled > .hb-tree__node-content {
  cursor: not-allowed;
  opacity: 0.5;
}

.hb-tree__node--disabled > .hb-tree__node-content:hover {
  background-color: transparent;
}

.hb-tree__switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--hb-color-text-tertiary);
}

.hb-tree__arrow {
  font-size: 10px;
  display: inline-block;
  transition: transform var(--hb-transition-duration, 0.2s);
}

.hb-tree__arrow--expanded {
  transform: rotate(90deg);
}

.hb-tree--show-line .hb-tree__switcher {
  color: var(--hb-color-border);
}

.hb-tree__line-dot {
  width: 6px;
  height: 6px;
  border-left: 1px solid var(--hb-color-border);
  border-bottom: 1px solid var(--hb-color-border);
  border-bottom-left-radius: var(--hb-border-radius-sm);
}

.hb-tree__checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--hb-color-border);
  border-radius: var(--hb-border-radius-xs, 2px);
  background-color: var(--hb-color-bg-container);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  transition: all var(--hb-transition-duration, 0.2s);
}

.hb-tree__checkbox:hover:not(.hb-tree__checkbox--disabled) {
  border-color: var(--hb-color-primary);
}

.hb-tree__checkbox--checked {
  background-color: var(--hb-color-primary);
  border-color: var(--hb-color-primary);
}

.hb-tree__checkbox--indeterminate {
  background-color: var(--hb-color-primary);
  border-color: var(--hb-color-primary);
}

.hb-tree__checkbox--disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hb-tree__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.hb-tree__node-content--selected .hb-tree__title {
  color: var(--hb-color-primary);
  font-weight: 500;
}
