@layer components {
  /* Outlined in ink by default, filled in ink as the primary action */
  .btn {
    --btn-background: transparent;
    --btn-hover-background: var(--color-well);
    --btn-color: var(--color-ink);
    --btn-border: var(--color-line-strong);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 2px solid var(--btn-border);
    border-radius: 14px;
    background: var(--btn-background);
    color: var(--btn-color);
    font-size: var(--text-control);
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.04em;
    white-space: nowrap;
    transition: background-color 160ms ease, scale 160ms var(--ease-out-expo);

    .icon {
      width: 18px;
      height: 18px;
      stroke-width: 2.2;
    }

    @media (hover: hover) and (pointer: fine) {
      &:hover {
        background: var(--btn-hover-background);
      }
    }

    /* Gives a little under the finger, so a tap feels heard */
    &:active:not(:disabled) {
      background: var(--btn-hover-background);
      scale: 0.97;
    }

    @media (prefers-reduced-motion: reduce) {
      &:active:not(:disabled) {
        scale: none;
      }
    }

    &:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
  }

  .btn--primary {
    --btn-background: var(--color-button);
    --btn-hover-background: var(--color-button-hover);
    --btn-color: var(--color-button-ink);
    --btn-border: var(--color-button);
  }

  /* The keep page's actions and the list's Show More */
  .btn--large {
    min-height: 56px;
    padding: 0 20px;
    border-radius: var(--radius-button);
    font-size: var(--text-button);

    .icon {
      width: 20px;
      height: 20px;
    }
  }

  .btn--icon {
    width: 44px;
    padding: 0;

    &.btn--large {
      width: 56px;
    }
  }

  .btn--quiet {
    --btn-border: transparent;
    --btn-color: var(--color-ink-secondary);

    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0;
  }
}
