.tag {
  padding: 5px;
  font-size: 80%;
  background-color: var(--theme-bg-color);
  color: var(--theme-fg-color);
  line-height: var(--tag-line-height);
  border: var(--tag-border-width) solid var(--theme-fg-color);
  /* Tags read as chips, never links — kill the underline on the cases rendered
     as <a> (e.g. the genre-index status filters). Harmless on button/span tags. */
  text-decoration: none;

  &.active {
    background-color: var(--theme-accent-color);
    border-color: var(--theme-accent-color);
    color: var(--theme-bg-color);
  }
}

button.tag {
  cursor: pointer;
  border-color: var(--theme-bg-muted);
  background-color: var(--theme-bg-muted);
  color: var(--theme-fg-color);
}

.filter .tag {
  font-size: 75%;
  line-height: 1;
}

/* Selectable chip (favorite styles): the chip itself shows selection, so hide
   the native checkbox and fill the chip with accent when checked. */
label.tag {
  cursor: pointer;
}

label.tag input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

label.tag:has(input:checked) {
  background-color: var(--theme-accent-color);
  border-color: var(--theme-accent-color);
  color: var(--theme-bg-color);
}
