@layer controls {

  button,
  .button {
    display: inline-block;
    font: inherit;
    font-size: 12px;
    color: var(--color-ink);
    text-decoration: none;
    background: color-mix(in oklch, var(--color-surface), var(--color-ink) 12%);
    /* A hairline edge like the fields' (_init.css), its padding taking back what the thinner border gave. */
    border: var(--hairline) solid var(--color-edge);
    border-radius: 4px;
    padding: calc(4px + var(--hairline-gap)) calc(8px + var(--hairline-gap));
    white-space: nowrap; /* its icon and words on one line, however little room the row leaves it */
    cursor: pointer;

    &:hover {
      background: color-mix(in oklch, var(--color-surface), var(--color-ink) 20%);
    }

    &[aria-pressed="true"],
    &.button--primary {
      background: var(--color-primary);
      color: var(--color-on-primary);
    }

    &.button--primary:hover {
      background: color-mix(in oklch, var(--color-primary), var(--white) 12%);
    }

    &.button--danger {
      background: var(--color-danger);
      color: var(--white);
    }

    &.button--danger:hover {
      background: color-mix(in oklch, var(--color-danger), var(--white) 12%);
    }

    &:disabled {
      opacity: 0.4;
      cursor: default;
    }

    /* An icon for its label (ApplicationHelper#icon): as tall as a text button, square. */
    &.button--icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: calc(4px + var(--hairline-gap));

      & .button__icon {
        margin-inline-end: 0;
      }
    }
  }

  /* Beside a label it stands on the text's line, a gap before the words. */
  .button__icon {
    vertical-align: top;
    margin-inline-end: 4px;
    width: 1lh; /* the line a text button's label fills, so both stand as tall */
    height: 1lh;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* button_to wraps its button in a form; keep it inline with neighbours. */
  .button_to {
    display: inline;
  }
}
