/* Shared category tree UI - same structure, markers, and behavior across all pages */

.category-sidebar-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.category-sidebar-panel {
  position: static;
  align-self: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft, var(--shadow-lg, 0 10px 30px rgba(27, 41, 62, 0.08)));
  padding: 14px;
  display: grid;
  gap: 10px;
}

.category-sidebar-panel h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.category-tabs,
.category-sidebar-nav,
.category-sidebar-content {
  display: grid;
  gap: 2px;
}

.category-tree {
  display: grid;
  gap: 2px;
}

.category-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
  border-radius: 10px;
  text-align: left;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.category-row.level-1 {
  padding-left: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.category-row.level-2 {
  padding-left: 20px;
  font-size: 12px;
}

.category-row.level-3 {
  padding-left: 36px;
  font-size: 12px;
}

.category-row:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.category-row.is-active {
  background: var(--surface-soft);
  color: var(--ink);
}

.category-row-indicator {
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: transparent;
  flex-shrink: 0;
}

.category-row.is-active .category-row-indicator {
  background: #111827;
  opacity: 0.92;
}

html[data-theme="dark"] .category-row.is-active .category-row-indicator {
  background: #e5e7eb;
}

.category-marker {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  width: 1em;
  text-align: center;
}

.category-row:hover .category-marker,
.category-row.is-expanded .category-marker {
  color: var(--ink);
}

.category-group {
  display: grid;
  gap: 0;
}

.category-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 250ms ease-in-out;
}

.category-children.is-expanded {
  max-height: 999px;
}

.category-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .category-sidebar-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar-panel {
    position: static;
  }
}
