/* Document right panel: local graph and v2 TOC visual authority. */
.doc-toc {
  padding: 14px 10px;
}

.local-graph-section {
  position: relative;
  margin-bottom: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .local-graph-section {
  background: rgba(255, 255, 255, 0.02);
}

.local-graph-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.local-graph-section:hover .local-graph-actions {
  opacity: 1;
}

.local-graph-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s, color 0.2s;
}

[data-theme="light"] .local-graph-btn {
  background: rgba(255, 255, 255, 0.6);
  color: rgba(0, 0, 0, 0.5);
}

.local-graph-btn:hover {
  background: rgba(99, 102, 241, 0.6);
  color: #fff;
}

#doc-local-graph-canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: grab;
}

.toc-v2-header {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.toc-v2-tree,
.toc-v2-tree ul {
  list-style: none;
}

.toc-v2-tree {
  margin: 0;
  padding: 0;
}

.toc-v2-tree ul {
  margin: 1px 0 1px 6px;
  padding-left: 14px;
  border-left: 1px solid var(--glass-border);
}

.toc-v2-tree li {
  margin: 0;
}

.toc-v2-link {
  display: block;
  padding: 3px 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.toc-v2-link:hover {
  background: var(--theme-light, rgba(99, 102, 241, 0.05));
  color: var(--text-primary);
}

.toc-v2-link.active {
  border-color: transparent;
  background: rgba(120, 120, 140, 0.16);
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="dark"] .toc-v2-link.active {
  background: rgba(255, 255, 255, 0.1);
}

.toc-v2-link.level-1 {
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
}

.toc-v2-link.level-2 {
  font-size: 12px;
}

.toc-v2-link.level-3 {
  font-size: 11.5px;
}

.toc-v2-link.level-4 {
  font-size: 11px;
  opacity: 0.8;
}

html.perf-mode .local-graph-btn,
body.perf-mode .local-graph-btn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
