@layer components {
  /* A field that chooses from a known set: the chosen as pills, then a bare field, and under it, once something is
     typed, the down arrow pressed or the field clicked, the rest, with the one Enter takes in blue. */
  .picker .site-chips__add {
    flex: 1 1 8em;
  }

  /* One choice: the pill stands in for the field until it is taken away. */
  .picker--single:has(.site-chip:not([hidden])) .site-chips__add {
    display: none;
  }

  .picker .suggestions__list {
    --avatar-size: calc(var(--text-note) * 1.5);         /* 24px */
    --btn-background: transparent;
    --btn-border-size: 0;
    --popup-item-padding-inline: 0.5em;

    font-size: var(--text-note);

    .popup__list {
      row-gap: 0;
    }

    .popup__btn {
      --btn-border-radius: 0;

      min-block-size: 1.9em;                             /* 30px */
    }

    .avatar {
      font-size: var(--text-xx-small);
    }

    .site-chips__add:has([aria-expanded="false"]) &,
    &:not(:has(.popup__item:not([hidden], [aria-checked="true"]))) {
      display: none;
    }
  }

  /* The one Enter takes fills the line edge to edge in a brighter blue than a link's, under the pointer too, since the
     pointer is what chooses it. */
  .picker .popup__item {
    border-radius: 0;

    &[aria-checked="true"] {
      display: none;
    }

    &[aria-selected] {
      --btn-color: var(--color-canvas);

      background-color: var(--color-selected-strong);

      @media (any-hover: hover) {
        &:hover {
          background-color: var(--color-selected-strong);
        }
      }
    }
  }

  /* What tells two of a name apart, such as a plate, an ID number or a person's firms: quieter than the name, cut
     short before the name is on a narrow line, and the name's colour on the one Enter takes. */
  .picker__detail {
    color: var(--color-meta);
    flex: 1 1 0;
    min-inline-size: 0;
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;

    [aria-selected] & {
      color: inherit;
    }
  }
}
