﻿.tree-canvas {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.02),
    rgba(0,0,0,0.02) 10px,
    rgba(0,0,0,0.03) 10px,
    rgba(0,0,0,0.03) 20px
  );
}
.tree-viewport {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  padding: 20px 30px 40px 20px;
}
.tree-root, .tree-root ul {
  list-style: none;
  margin: 0;
  padding-left: 20px;
}
.tree-root > li {
  padding-left: 0;
}
.tree-root > li::before,
.tree-root > li::after {
  display: none;
}
li {
  position: relative;
  padding-left: 14px;
  margin: 6px 0;
}
li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
  bottom: -6px;
  border-left: 1px solid var(--line);
}
li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  border-top: 1px solid var(--line);
}
li:last-child::before {
  bottom: calc(100% - var(--row-center, 18px));
}
.tree-root li.hover::before,
.tree-root li.hover::after {
  border-color: var(--accent);
}
.node-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  background: var(--node-bg, #fff);
  color: var(--node-text, var(--text));
  border: 1px solid var(--node-border, transparent);
  padding: 2px 6px 2px 4px;
  border-radius: 6px;
  cursor: default;
  user-select: none;
}
.node-row.selected {
  background: #fff;
  color: #111;
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
}
.node-row.search-hit {
  border-color: #f0c36d;
  box-shadow: 0 0 0 2px rgba(240,195,109,0.2);
}
.node-row.search-active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
}
.caret {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  border: 1px solid transparent;
  border-radius: 4px;
}
.caret:hover { border-color: var(--line); }
.caret.empty { visibility: hidden; }
.node-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.node-title {
  white-space: nowrap;
  font-weight: var(--title-weight, 600);
  font-style: var(--title-style, normal);
  font-family: var(--title-font, inherit);
  color: var(--title-color, inherit);
}
.node-desc {
  font-size: 11px;
  color: var(--muted);
}
.node-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.node-field {
  font-size: 11px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  width: fit-content;
}
.note-badge {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0 4px;
  border-radius: 4px;
}
.drop-indicator {
  position: absolute;
  height: 2px;
  background: var(--accent);
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
}
.node-row.drop-inside {
  background: #e8f0fb;
  border-color: #b9d3f0;
}
