/* Shared AnnoLink hierarchy tree styling.
 * Mirrors the compact AnnoRevision left tree while preserving AnnoLink colors.
 */
.annolink-tree {
  padding: 8px 6px;
  overflow: auto;
  overscroll-behavior: contain;
}
.annolink-tree-row {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  padding-top: 0;
  padding-right: 6px;
  padding-bottom: 0;
  background: transparent;
  color: var(--text, #dbe2ee);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.annolink-tree-row:hover { background: rgba(255,255,255,.055); }
.annolink-tree-row.selected,
.annolink-tree-row.active { background: var(--cyan-dim, rgba(0,229,204,.12)); color: var(--cyan, #00e5cc); }
.annolink-tree-toggle {
  width: 24px; min-width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted, #8a98a8); font-size: 17px; font-weight: 800; line-height: 1; flex: 0 0 24px;
}
.annolink-tree-folder-icon, .annolink-tree-file-icon {
  width: 18px; min-width: 18px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; flex: 0 0 18px;
}
.annolink-tree-folder-icon { color: #e6a321; font-size: 16px; }
.annolink-tree-file-icon { color: #c8d0da; font-size: 14px; }
.annolink-tree-label {
  min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
.annolink-tree-expand-collapse {
  flex: 0 0 auto; padding: 3px 8px; border: 1px solid var(--border, #617080); border-radius: 6px;
  background: transparent; color: var(--text, #dbe2ee); font: inherit; font-size: 11px; font-weight: 700; line-height: 1.4; cursor: pointer;
}
.annolink-tree-expand-collapse:hover, .annolink-tree-expand-collapse:focus-visible {
  border-color: var(--cyan, #00e5cc); color: var(--cyan, #00e5cc); background: var(--cyan-dim, rgba(0,229,204,.12)); outline: none;
}
.annolink-tree-row.tree-dragging, .annolink-tree-row.v09-tree-dragging {
  cursor: grabbing; opacity: .45; outline: 1px solid rgba(44,230,214,.55); outline-offset: -1px;
}
.annolink-tree-row.tree-drop-target, .annolink-tree-row.v09-tree-drop-target {
  color: var(--cyan, #00e5cc); background: var(--cyan-dim, rgba(0,229,204,.12)); outline: 1px solid rgba(44,230,214,.72); outline-offset: -1px;
}
.annolink-tree-row.tree-drop-pending, .annolink-tree-row.v09-tree-drop-pending {
  color: var(--cyan, #00e5cc); background: rgba(44,230,214,.08); cursor: progress;
}
.annolink-tree-drag-preview {
  position: fixed; z-index: 10050; pointer-events: none; max-width: min(360px, 75vw); padding: 7px 11px;
  border: 1px solid rgba(168,180,199,.65); border-radius: 6px; background: #252a33; color: #dbe2ee;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.annolink-tree-drag-preview.ready { border-color: var(--cyan, #00e5cc); color: var(--cyan, #00e5cc); }

/* Editor-specific behavior uses the same hierarchy primitives. */
body.v09-integration .v09-tree-actions { display:flex; align-items:center; gap:6px; }
body.v09-integration #v09-folder-tree.annolink-tree { padding:8px 6px; }
body.v09-integration .v09-tree-row { color:var(--text); }
body.v09-integration .v09-tree-row.current { color:var(--cyan); font-weight:700; }
body.v09-integration .v09-tree-row.current:not(.selected) { background:rgba(0,229,204,.07); }
body.v09-integration .v09-tree-row[data-kind="file"] { cursor:grab; touch-action:none; }
body.v09-integration .v09-tree-row[data-kind="file"].v09-tree-dragging { cursor:grabbing; }
body.v09-integration .v09-tree-empty { color:var(--text); opacity:.72; font-size:12px; padding:14px 10px; line-height:1.6; }
html.v09-tree-pointer-dragging,
html.v09-tree-pointer-dragging * { cursor:grabbing !important; }
