.sortedm2m-container {
  width: 570px;
  margin-right: 10px;

}

@media (max-width: 960px) {
  .sortedm2m-container {
    width: auto;
  }
}

.sortedm2m-container * {
  box-sizing: border-box;
}

.sortedm2m-container p.selector-filter {
  padding: 0;
  margin: 0;

  border-top: 1px solid #cbcbcb;
  border-right: 1px solid #cbcbcb;
  border-left: 1px solid #cbcbcb;
  border-top-right-radius: 4px;
  border-top-left-radius: 4px;
}

.sortedm2m-container p.selector-filter img {
  display: none;
}

.sortedm2m-container p.selector-filter input {
  width: 100%;

  border: 0;
}

ul.sortedm2m,
.module ul.sortedm2m {
  display: block;
  width: 100%;
  max-height: 250px;
  margin: 0;
  padding: 0;

  overflow-x: hidden;
  overflow-y: auto;

  text-align: left;

  border: 1px solid #cbcbcb;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
}

ul.sortedm2m li {
  align-items: center;

  display: flex;
  width: 100%;
  padding: 10px;

  list-style-type: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
  border-bottom: 1px solid #cbcbcb;
  background-color: #fff;
}

ul.sortedm2m li.ui-sortable-helper {
  border-top: 1px solid #cbcbcb;
  opacity: 0.8;
}

ul.sortedm2m li::before {
  content: '☰';

  margin-right: 10px;
}

ul.sortedm2m li.ui-sortable-placeholder + li {
  border-top: 1px solid #cbcbcb;
}

ul.sortedm2m li label {
  align-items: center;

  display: flex;
  width: auto !important;
  padding: 0;

  font-weight: 500;
  cursor: move;
}

ul.sortedm2m li label input {
  margin: 0;
  margin-right: 5px;
}

ul.sortedm2m li .edit-link {
  display: flex;
  margin-left: auto;

  cursor: pointer;
}

ul.sortedm2m li .icon-edit {
  width: 14px;
  height: 14px;
}

/* required to work properly in django admin */
body.change-form .sortedm2m-container {
  float: left;
}

.hide {
  display: none;
}
