/* --- v1: скрипты в дереве проекта подсвечены по смыслу (роль и функции) --- */

/* цветные точки: одинаковые в дереве и в легенде */
.kdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex: 0 0 auto; background: var(--muted);
}
.kdot.k-entry  { background: #4ade80; }
.kdot.k-script { background: #2dd4bf; }
.kdot.k-mixed  { background: #22d3ee; }
.kdot.k-lib    { background: #a78bfa; }
.kdot.k-module { background: #60a5fa; }
.kdot.k-test   { background: #fbbf24; }
.kdot.k-data   { background: #94a3b8; }
.kdot.k-empty  { background: #6b7280; }

/* имена файлов подкрашены по роли */
.tree-item .kname { overflow: hidden; text-overflow: ellipsis; }
.tree-item.k-entry  .kname { color: #86efac; }
.tree-item.k-script .kname { color: #5eead4; }
.tree-item.k-mixed  .kname { color: #67e8f9; }
.tree-item.k-lib    .kname { color: #c4b5fd; }
.tree-item.k-module .kname { color: #93c5fd; }
.tree-item.k-test   .kname { color: #fcd34d; }
.tree-item.k-data   .kname { color: #cbd5e1; }
.tree-item.k-empty  .kname { color: var(--muted); }

/* счётчик функций и стрелки связей */
.tree-item .fnb {
  margin-left: auto; font-size: 10px; line-height: 14px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; flex: 0 0 auto;
}
.tree-item .badge { margin-left: 4px; flex: 0 0 auto; }

/* цветные метки у заголовков групп */
.tree-group-head .gdot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: var(--muted); opacity: .85;
}
.gdot.g-entry { background: #4ade80; }
.gdot.g-libraries { background: #a78bfa; }
.gdot.g-checks { background: #fbbf24; }
.gdot.g-fixes { background: #fb923c; }
.gdot.g-data { background: #94a3b8; }
.gdot.g-other { background: #6b7280; }

/* легенда под деревом */
.tree-legend {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  padding: 6px 8px 2px; margin-top: 4px;
  border-top: 1px dashed var(--border);
  font-size: 10px; color: var(--muted);
}
.tree-legend .lg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* светлая тема: те же роли, но контрастнее */
html[data-theme="light"] .tree-item.k-entry  .kname { color: #15803d !important; }
html[data-theme="light"] .tree-item.k-script .kname { color: #0f766e !important; }
html[data-theme="light"] .tree-item.k-mixed  .kname { color: #0e7490 !important; }
html[data-theme="light"] .tree-item.k-lib    .kname { color: #6d28d9 !important; }
html[data-theme="light"] .tree-item.k-module .kname { color: #1d4ed8 !important; }
html[data-theme="light"] .tree-item.k-test   .kname { color: #a16207 !important; }
html[data-theme="light"] .tree-item.k-data   .kname { color: #475569 !important; }
html[data-theme="light"] .kdot.k-entry  { background: #16a34a !important; }
html[data-theme="light"] .kdot.k-script { background: #0d9488 !important; }
html[data-theme="light"] .kdot.k-mixed  { background: #0891b2 !important; }
html[data-theme="light"] .kdot.k-lib    { background: #7c3aed !important; }
html[data-theme="light"] .kdot.k-module { background: #2563eb !important; }
html[data-theme="light"] .kdot.k-test   { background: #ca8a04 !important; }
html[data-theme="light"] .kdot.k-data   { background: #64748b !important; }
