.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 6px;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--color-ambient-grey-light);
  color: var(--color-font-primary);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.pill--compact {
  min-height: 34px;
  padding-block: 6px;
}

.pill--comfortable {
  min-height: 44px;
}

/* Sentence filters inherit the surrounding type size, with a slimmer visible fill. */
.pill--inline {
  min-height: 44px;
  padding: 0 13px;
  border-width: 2px 0;
  background-clip: padding-box;
  font: inherit;
  font-style: italic;
}

.pill:hover {
  color: var(--color-font-primary);
  text-decoration: none;
}

@media (hover: hover) {
  .pill:hover {
    background-color: color-mix(in srgb, var(--color-ambient-grey-light) 92%, var(--color-font-primary));
  }
}

.pill.pill--selected,
.pill[aria-current="page"],
.pill[aria-pressed="true"] {
  background-color: var(--color-ambient-mint-light);
}

.pill:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--color-ambient-mint-dark);
  outline-offset: -2px;
}

.pill__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill > .pill__icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.pill > .pill__arrow {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  transform: rotate(90deg);
}

.pill__remove {
  display: none;
  flex-shrink: 0;
}

.pill[aria-current="page"] > .pill__remove {
  display: inline-flex;
}

.pill__remove .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 649px), (any-pointer: coarse) {
  .pill {
    min-height: 44px;
  }
}
