.folder-tree { font-size: 0.875rem; }
.folder-tree ul { list-style: none; padding-left: 1.25rem; margin: 0; position: relative; }
.folder-tree > ul { padding-left: 0; }
.folder-tree li { padding: 1px 0; position: relative; }

/* Tree connector lines */
.folder-tree ul ul > li::before {
  content: '';
  position: absolute;
  left: -0.85rem;
  top: 0;
  bottom: 50%;
  width: 0;
  border-left: 1px solid #ccc;
}
.folder-tree ul ul > li::after {
  content: '';
  position: absolute;
  left: -0.85rem;
  top: 50%;
  width: 0.6rem;
  height: 0;
  border-top: 1px solid #ccc;
}
/* Vertical line connecting siblings */
.folder-tree ul ul > li:not(:last-child)::before {
  bottom: 0;
}

.ft-node { display: flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.25rem; border-radius: 0.25rem; cursor: pointer; user-select: none; }
.ft-node:hover { background: rgba(0,0,0,0.04); }

.ft-toggle { width: 1rem; text-align: center; font-size: 0.7rem; color: #666; flex-shrink: 0; cursor: pointer; }
.ft-toggle.leaf { visibility: hidden; }

.ft-icon { flex-shrink: 0; font-size: 0.85rem; }

.ft-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ft-state { width: 1.3rem; height: 1.3rem; border-radius: 0.25rem; border: 1.5px solid #ccc; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.7rem; font-weight: bold; line-height: 1; transition: all 0.1s; }
.ft-state[data-state="neutral"] { background: #f5f5f5; border-color: #ccc; color: #999; }
.ft-state[data-state="include"] { background: #d4edda; border-color: #28a745; color: #155724; }
.ft-state[data-state="exclude"] { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.ft-state[data-state="mixed"] { background: #fff3cd; border-color: #ffc107; color: #856404; }

.ft-children.collapsed { display: none; }

.ft-summary { font-size: 0.8rem; color: #666; margin-top: 0.25rem; padding: 0.2rem 0.4rem; background: #f8f9fa; border-radius: 0.25rem; }
.ft-summary .badge { font-size: 0.75rem; margin-right: 0.25rem; }

/* Keyboard focus — outline the row, not the whole li (which includes children) */
.folder-tree li[role="treeitem"]:focus { outline: none; }
.folder-tree li[role="treeitem"]:focus > .ft-node { outline: 2px solid var(--bs-primary, #1a1a2e); outline-offset: -1px; }
