.category-editor {
  --bs-modal-width: 700px;
}
.category-editor__header { align-items: center; gap: 14px; }
.category-editor__header .modal-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 21px; line-height: 1.3; }
.category-editor__active { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; font-size: 13px; white-space: nowrap; cursor: pointer; }
.category-editor__active .form-check-input { float: none; margin: 0; }
.category-editor__body { display: grid; align-content: start; gap: 12px; padding: 16px 20px; background: var(--bg); scrollbar-gutter: stable; overscroll-behavior: contain; }
.category-editor__panel { display: grid; align-content: start; gap: 14px; min-width: 0; padding: 16px; border: 1px solid var(--card-border); border-radius: var(--radius-xl); background: var(--card-bg); }
.category-editor__panel h3 { margin: 0; color: var(--text-primary); font-size: 16px; line-height: 1.4; font-weight: var(--admin-weight-semibold); }
.category-editor__panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.category-editor__panel .form-label, .category-editor__panel legend {
  display: block; float: none; width: auto; margin: 0 0 5px;
  color: var(--text-secondary); font-size: 13px; line-height: 1.4; font-weight: var(--admin-weight-medium);
}
.category-editor__intro, .category-editor__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.category-editor__intro { grid-template-columns: minmax(0, 1fr) 156px; gap: 16px; }
.category-editor__fields { display: grid; gap: 12px; }
.category-editor__hint { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.category-editor__upload {
  display: grid; align-content: center; justify-items: center; gap: 5px; width: 100%; height: 118px;
  padding: 8px; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-secondary); background: var(--control-bg); font-size: 13px;
}
.category-editor__upload:hover { background: var(--surface-soft); color: var(--text-primary); }
.category-editor__upload img { display: block; max-width: 100%; height: 70px; object-fit: contain; }
.category-editor__upload i { font-size: 20px; }
.category-editor__choices, .category-editor__checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.category-editor__checks { flex-direction: column; align-items: flex-start; }
.category-editor__choices label, .category-editor__checks label {
  display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0;
  color: var(--text-primary); font-size: 14px; cursor: pointer;
}
.category-editor__choices input, .category-editor__checks input { flex: none; align-self: flex-start; }
.category-editor__choices .form-check-input[type="radio"]:checked { background-color: var(--platform-orange); border-color: var(--platform-orange); }
.category-editor__inset { margin-top: 12px; }
.category-editor__chips { display: flex; flex-direction: column; gap: 4px; }
.category-editor__chips--inline { flex-flow: row wrap; gap: 6px; }
.category-editor__chips:not(:empty) { margin-bottom: 8px; }
.category-editor__results { max-height: 180px; margin-top: 5px; overflow-y: auto; overscroll-behavior-y: contain; }
.category-editor__results .list-group-item { gap: 8px; min-height: 36px; font-size: 13px; }
.category-editor__results small { flex: none; }
.category-editor__period { padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius); background: var(--control-bg); }
.category-editor__period-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.category-editor__period-times input[type=time] { max-width: 110px; }
.category-editor__period-times .category-editor__remove { margin-inline-start: auto; }
.category-editor__days { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 6px; }
.category-editor__days label { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; font-size: 13px; cursor: pointer; }
.category-editor__days input { margin: 0; }
.category-editor__item {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 3px 6px 3px 9px;
  border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--control-bg); font-size: 13px;
}
.category-editor__item[draggable=true] { cursor: grab; }
.category-editor__item-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.category-editor__item small, .category-editor__handle { flex: none; color: var(--text-secondary); }
.category-editor__remove {
  display: inline-grid; place-items: center; flex: none; min-width: 30px; min-height: 30px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 12px;
}
.category-editor__remove:hover { color: var(--danger); background: var(--danger-bg); }
.category-editor__footer { justify-content: space-between; gap: 10px; }
.category-editor__footer > .btn { margin: 0; }
.category-editor :is(.category-editor__upload, .category-editor__remove):focus-visible {
  outline: 1px solid var(--admin-field-focus); outline-offset: 2px;
}
@media (max-width: 575px) {
  .category-editor__intro { grid-template-columns: minmax(0, 1fr) 98px; gap: 10px; }
  .category-editor__body { padding: 10px; }
  .category-editor__panel { gap: 12px; padding: 12px; }
  .category-editor__header, .category-editor__footer { padding: 12px; }
  .category-editor__header { gap: 8px; }
  .category-editor__header .modal-title { font-size: 18px; }
  .category-editor__columns { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
