/* 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: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(251, 247, 242, 0.96));
  box-shadow: none;
  padding: 14px;
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .category-sidebar-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(49, 56, 67, 0.9));
}

.category-sidebar-panel h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-strong, var(--muted));
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.category-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 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: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.category-row.is-active {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: none;
}

.category-row:focus-visible {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  outline: none;
  box-shadow: none;
}

html[data-theme="dark"] .category-row:hover,
html[data-theme="dark"] .category-row.is-active,
html[data-theme="dark"] .category-row:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

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

.category-row.is-active .category-row-indicator {
  background: var(--accent, #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-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;
  line-height: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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