/* Tessera Tree-List — LHS group/category list widget.
 *
 * Two-level: top-level "groups" (always visible) with optional
 * children rendered when the group is expanded. Pair with
 * tree-list.js's render(container, opts). The host owns the
 * surrounding panel chrome (heading, padding); this stylesheet
 * styles only the list itself. */

.group-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.group-list li { margin: 0; }

/* Top-level group row. */
.group-list .grp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 4px;
  border-radius: 4px;
  color: var(--ink, #1f2a1c);
  text-decoration: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
}
.group-list .grp-row:hover { background: #ecf0e6; }
.group-list .grp-row.active {
  background: #ecf0e6;
  border-left-color: var(--accent, #355e2a);
}
.group-list .grp-row .chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  font-size: 10px;
  color: var(--ink-soft, #4d574a);
  transition: transform 120ms ease;
  flex-shrink: 0;
}
.group-list .grp-row.expanded .chevron { transform: rotate(90deg); }
.group-list .grp-row .grp-main {
  flex: 1;
  min-width: 0;
}
.group-list .grp-row .grp-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
}
.group-list .grp-row.active .grp-label { color: var(--accent, #355e2a); }
.group-list .grp-row .grp-meta {
  display: block;
  font-size: 11px;
  color: var(--ink-soft, #4d574a);
  margin-top: 1px;
}
.group-list .grp-row .grp-tally {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft, #4d574a);
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Child concept list (visible when group is expanded). */
.group-list .child-list {
  list-style: none;
  padding: 4px 0 4px 26px;
  margin: 0;
  border-left: 1px dashed var(--rule, #ddd6c5);
  margin-left: 12px;
}
.group-list .child-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 4px;
  margin: 1px 0;
  border-radius: 3px;
  color: var(--ink, #1f2a1c);
  text-decoration: none;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.35;
}
.group-list .child-row:hover { background: #ecf0e6; }
.group-list .child-row.active {
  background: var(--accent, #355e2a);
  color: #fff;
  font-weight: 500;
}
.group-list .child-row .state-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 9px;
  flex-shrink: 0;
  border: 1px solid var(--rule, #ddd6c5);
  background: transparent;
  color: var(--ink-soft, #4d574a);
}
.group-list .child-row .state-pip.learning { background: #fde68a; border-color: #b45309; color: #7a4a05; }
.group-list .child-row .state-pip.mastered { background: #4ade80; border-color: #166534; color: #fff; }
.group-list .child-row .state-pip.stuck    { background: #fca5a5; border-color: #b91c1c; color: #7c1d12; }
.group-list .child-row.active .state-pip { border-color: rgba(255,255,255,0.5); }
.group-list .child-row .child-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Featured star — small amber glyph at the right of the row.
 * Set by the regime; doesn't change visibility, just emphasis. */
.group-list .child-row .featured-star {
  font-size: 11px;
  color: #b78240;
  flex-shrink: 0;
  line-height: 1;
}
.group-list .child-row.active .featured-star { color: #fde68a; }

/* Advanced (difficulty=3) gets a subtle right border accent so
 * scanners can spot deeper material at a glance. Difficulty 1 and 2
 * stay unmarked here — the explicit badge lives in the detail
 * panel where the host owns rendering. */
.group-list .child-row[data-difficulty="3"] {
  box-shadow: inset -3px 0 0 rgba(176, 58, 42, 0.35);
}

/* Search box at the top of the LHS panel. */
.tree-search {
  width: 100%;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--rule, #ddd6c5);
  border-radius: 4px;
  background: var(--surface, white);
  color: var(--ink, #1f2a1c);
  margin-bottom: 8px;
}
.tree-search:focus {
  outline: none;
  border-color: var(--accent, #355e2a);
}
