.categories-view{max-width:1100px}
.categories-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto auto;
  gap:10px;
  align-items:end;
  padding:13px;
  margin-bottom:12px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--card);
}
.categories-toolbar label{margin:0;font-size:12px}
.categories-toolbar input,
.categories-toolbar select,
.categories-toolbar button{min-height:42px}
.categories-toolbar button{padding:0 14px;white-space:nowrap}
.categories-note{
  margin:0 0 14px;
  color:var(--muted);
  font-size:13px;
}
.category-section{margin:0 0 22px}
.category-section>h2{
  margin:0 0 4px;
  font:800 13px Manrope;
  letter-spacing:.08em;
  color:var(--muted);
}
.category-group{margin:0 0 8px}
.category-group-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding:18px 2px 8px;
  margin:8px 0 10px;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  cursor:default;
  pointer-events:none;
}
.category-group-heading .category-actions{pointer-events:auto}
.category-group-heading h3{
  margin:0;
  font:800 12px Manrope;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
}
.category-group-leaves{padding:0 0 2px 16px}
.category-leaf-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  padding:11px 14px;
  margin:0 0 8px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  color:var(--ink);
  text-align:left;
}
.category-leaf-row strong{margin:0;font:800 14px Manrope}
.category-leaf-row.category-leaf-empty{color:var(--muted);font-size:13px;background:transparent}
.category-group.is-collapsed{margin:0 0 8px}
.category-group.is-collapsed .category-leaf-row{margin-bottom:0}
.category-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:3px;
}
.category-chip{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:color-mix(in srgb,var(--line) 55%,transparent);
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}
.category-chip.system{background:color-mix(in srgb,var(--green) 12%,transparent);color:var(--ink)}
.category-chip.protected{background:color-mix(in srgb,#315ee6 14%,transparent)}
.category-actions{display:flex;flex-wrap:wrap;gap:6px}
.category-actions button{
  min-height:34px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:transparent;
  color:var(--ink);
  font-weight:700;
  cursor:pointer;
}
.category-actions-secondary button{
  min-height:28px;
  padding:0 8px;
  border-color:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.category-dot-swatch{
  width:12px;
  height:12px;
  border-radius:50%;
  box-shadow:0 0 0 4px color-mix(in srgb,var(--green) 10%,transparent);
}
.categories-empty{
  padding:28px 16px;
  border:1px dashed var(--line);
  border-radius:14px;
  color:var(--muted);
  text-align:center;
}
.category-editor-dialog{
  width:min(520px,calc(100vw - 24px));
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--card);
  color:var(--ink);
  padding:0;
}
.category-editor-dialog::backdrop{background:rgba(8,16,14,.55)}
.category-editor-dialog form{
  display:grid;
  gap:12px;
  padding:18px;
}
.category-editor-dialog h2{margin:0;font:800 20px Manrope}
.category-editor-help{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.category-editor-dialog label{margin:0;font-size:12px}
.category-editor-dialog input,
.category-editor-dialog select{min-height:42px}
.category-editor-dialog .dialog-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:4px;
}
@media(max-width:720px){
  .categories-toolbar{grid-template-columns:1fr}
  .category-group-heading,
  .category-leaf-row{align-items:flex-start;flex-direction:column}
  .category-group-leaves{padding-left:10px}
}
