#category-manager {
  min-width: 0;
  scroll-margin-top: 1rem;
}

#category-manager [hidden] {
  display: none !important;
}

#category-manager :is(input, select, textarea, button, summary):focus-visible {
  outline: 2px solid #08727d;
  outline-offset: 2px;
}

.cm-heading,
.cm-column-head,
.cm-actions,
.cm-save-row,
.cm-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .8rem;
  flex-wrap: wrap;
}

.cm-heading h3,
.cm-column h4 {
  margin: 0;
}

.cm-heading h3 {
  font-size: 1.35rem;
}

.cm-heading p {
  margin: .3rem 0 0;
}

.cm-actions {
  justify-content: start;
}

#category-manager button,
#category-manager input:not([type="checkbox"]),
#category-manager select {
  min-height: 44px;
}

.cm-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr);
  align-items: end;
  gap: .7rem;
  margin: 1rem 0;
  padding: .9rem;
  background: #f3f7f9;
  border-radius: .75rem;
}

.cm-check {
  display: flex;
  align-items: start;
  gap: .5rem;
  font-weight: 500;
  line-height: 1.35;
}

.cm-check input {
  width: 18px;
  height: 18px;
  margin: .1rem 0 0;
  flex-shrink: 0;
  accent-color: var(--teal);
}

.cm-home-empty {
  align-self: center;
}

.cm-toolbar > button {
  justify-self: start;
}

.cm-layout {
  display: grid;
  grid-template-columns: minmax(12rem, .85fr) minmax(13rem, 1fr) minmax(19rem, 1.35fr);
  border: 1px solid var(--line);
  border-radius: .85rem;
  overflow: hidden;
}

.cm-column {
  min-width: 0;
  padding: .85rem;
}

.cm-column + .cm-column {
  border-inline-start: 1px solid var(--line);
}

.cm-tree-column {
  background: #f8fafb;
}

.cm-column-head {
  align-items: start;
  margin-bottom: .8rem;
}

.cm-column-head h4 {
  font-size: .95rem;
}

.cm-column-head p,
.cm-column-head > span {
  font-size: .8rem;
  margin: .25rem 0 0;
}

.cm-tree,
.cm-list {
  display: grid;
  align-content: start;
  gap: .4rem;
  max-height: 40rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: .1rem .1rem .25rem;
}

.cm-tree-branch {
  min-width: 0;
  display: grid;
  gap: .3rem;
}

.cm-tree-branch > .cm-tree-branch {
  padding-inline-start: .45rem;
  border-inline-start: 2px solid #dce7ed;
}

.cm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #e0e8ec;
  border-radius: .65rem;
  background: #fff;
}

.cm-row:hover {
  border-color: #a4cbce;
}

.cm-row[draggable="true"] {
  cursor: grab;
}

.cm-row.cm-selected {
  background: #eaf5f4;
  border-color: #16838b;
}

.cm-select {
  display: flex;
  align-items: start;
  gap: .45rem;
  width: 100%;
  padding: .65rem .5rem;
  border: 0;
  border-radius: .6rem;
  background: transparent;
  color: var(--navy);
  text-align: start;
  min-width: 0;
}

.cm-symbol {
  flex-shrink: 0;
  color: #13747d;
  font-size: 1.05rem;
}

.cm-row-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .84rem;
  line-height: 1.35;
}

.cm-row-title small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .74rem;
}

.cm-order {
  display: grid;
  gap: 1px;
  padding-inline-end: .15rem;
}

#category-manager .cm-order-button {
  min-width: 26px;
  min-height: 26px;
  padding: 0 .25rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: #126c77;
}

.cm-order-button:hover {
  background: #dcefed;
}

#category-manager button:disabled {
  cursor: default;
  opacity: .48;
  transform: none;
}

.cm-editor {
  display: grid;
  gap: .85rem;
}

.cm-editor .field,
.cm-toolbar .field {
  min-width: 0;
  font-size: .83rem;
  font-weight: 700;
}

.cm-editor-title {
  align-items: start;
}

.cm-editor-title h4 {
  font-size: 1rem;
}

.cm-editor-title a {
  font-size: .79rem;
  color: #116c77;
}

.cm-editor :is(input:not([type="checkbox"]), textarea, select) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: .86rem;
  font-weight: 400;
}

.cm-inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.cm-editor > .cm-check {
  font-size: .85rem;
  font-weight: 600;
}

.cm-image-field {
  display: grid;
  justify-items: start;
  gap: .5rem;
}

.cm-image-field img {
  width: 100%;
  max-width: 24rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: .55rem;
}

.cm-image-field .field {
  max-width: 100%;
}

.cm-image-field small {
  font-size: .77rem;
}

.cm-message,
.cm-image-status {
  font-size: .86rem;
  line-height: 1.4;
  color: #176041;
}

.cm-message:empty,
.cm-image-status:empty {
  display: none;
}

.cm-error {
  color: #9b2a1c;
}

.cm-details {
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}

.cm-details summary,
.cm-details details > summary {
  cursor: pointer;
  padding: .35rem 0;
  font-size: .85rem;
  font-weight: 700;
}

.cm-details summary span {
  margin-inline-start: .3rem;
  color: var(--muted);
  font-weight: 400;
}

.cm-details > p {
  font-size: .8rem;
}

.cm-details details {
  margin: .45rem 0 0;
}

.cm-countries {
  display: grid;
  gap: .35rem;
  max-height: 14rem;
  margin-top: .6rem;
  padding: .3rem;
  overflow: auto;
}

.cm-countries .cm-check {
  padding: .4rem;
  font-size: .83rem;
}

.cm-translation {
  display: grid;
  gap: .7rem;
  padding-block: .55rem;
}

.cm-save-row {
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: .85rem;
}

.cm-save-status {
  color: var(--muted);
  font-size: .8rem;
}

.cm-merge {
  color: #80531d;
}

.cm-merge > button {
  margin-top: .75rem;
}

.cm-empty {
  color: var(--muted);
  margin: 0;
  padding: .8rem .3rem;
  line-height: 1.5;
  font-size: .84rem;
}

.cm-fields-list {
  display: grid;
  gap: .5rem;
}

.cm-custom-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: #f8fafb;
}

.cm-custom-field > summary {
  padding: .65rem;
}

.cm-custom-field summary small {
  display: block;
  color: var(--muted);
  margin-top: .2rem;
  font-weight: 400;
}

.cm-custom-field-body {
  display: grid;
  gap: .65rem;
  padding: .65rem;
  border-top: 1px solid var(--line);
}

.cm-field-flags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}

.cm-inherited {
  padding: .6rem;
  background: #eef5f5;
  border-radius: .5rem;
  font-size: .8rem;
  line-height: 1.45;
}

.cm-inherited b {
  display: block;
  margin-bottom: .2rem;
}

.cm-field-actions {
  margin-top: .7rem;
}

.cm-field-message {
  font-size: .8rem;
  margin: .55rem 0;
}

.cm-field-message:empty {
  display: none;
}

@media (max-width: 1190px) {
  .cm-layout {
    grid-template-columns: minmax(12rem, 1fr) minmax(17rem, 1.3fr);
  }

  .cm-tree-column {
    grid-column: 1 / -1;
  }

  .cm-tree-column + .cm-column {
    border-inline-start: 0;
  }

  .cm-tree-column {
    border-bottom: 1px solid var(--line);
  }

  .cm-tree {
    max-height: 16rem;
  }
}

@media (max-width: 760px) {
  .cm-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cm-column + .cm-column {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .cm-tree-column {
    border-bottom: 0;
  }

  .cm-tree,
  .cm-list {
    max-height: 17rem;
  }

  .cm-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .cm-editor-column {
    padding-top: 1rem;
  }

  #category-manager .cm-order-button {
    min-width: 44px;
    min-height: 44px;
  }
}
