.namesel-container {
  align-items: flex-start !important;

  .input-section {
    padding-bottom: 1rem;

    .input-wrapper {
      position: relative;

      /* mimic design of other input fields */
      input {
        border: 1px solid #ccc;
        border-width: 0 0 1px 0;
        border-radius: 0;
        border-color: #AEBFC9 !important;
        margin: 0.75em 0 0;
        padding: 0 0 0.5rem;
      }
    }
  }

  .suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 110%;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 0.4rem 0.4rem;
    box-shadow: 0 2px 7px 0 rgba(0,0,0,0.07);
    z-index: 100;
    max-height: 220px;
    overflow: auto;

    &.hidden {
      display: none;
    }

    .highlighted {
      background: #dcf7ff;
    }

    .suggestion-name {
      font-weight: bold;

      .match {
        background-color: rgba(255, 218, 18, 0.52);
        padding-inline: 0.2rem;
        border-radius: 2px;
      }
    }

    div {
      padding: 0.2rem 0.5rem;
      cursor: pointer;
      border-bottom: 1px solid #f5f5f5;

      &:last-child {
        border-bottom: none;
      }
    }
  }

  .selected-names-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    .selected-names-list {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      min-height: 2.2rem;
    }

    .selected-item {
      background: #e8e8e8;
      border-radius: 0.5rem;
      padding: 0.4em 1em 0.4em 0.9em;
      display: flex;
      align-items: center;
      gap: 0.5em;

      button {
        background: none;
        border: none;
        font-size: 1.2rem;
        font-weight: bold;
        color: #c0152f;
        cursor: pointer;
      }
    }
  }

  .empty-state {
    color: #a7a9a9;
    font-size: 1em;
    margin: 0;
    padding: 0.5rem 0;
  }
}

/* drag-n-drop */
fieldset:not([disabled]) .namesel-container .selected-names-section .selected-item {
  cursor: move;
  transition: all 0.2s ease;
  -webkit-user-drag: element; /* Für Safari */
  -moz-user-select: none; /* Für Firefox */
  -ms-user-select: none;
  user-select: none;

  &.dragging {
    opacity: 0.5;
    background: #d4d4d4;
  }

  &.drag-over-left {
    border-left: 2px green solid;
  }

  &.drag-over-right {
    border-right: 2px green solid;
  }
}
