@layer global {
  html {
    /* Stops double-tap zoom everywhere but keeps pinch zoom */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--color-page);
    background-image: radial-gradient(var(--color-page-dot) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    background-attachment: fixed;
  }

  body {
    display: grid;
    grid-template-rows: auto 1fr;
    font-family: var(--font-base);
    font-size: var(--step-0);
    color: var(--color-text);
    overscroll-behavior: none;
  }

  :where(h1, h2, h3) {
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  h1 {
    font-size: var(--step-3);
  }

  h2 {
    font-size: var(--step-2);
  }

  h3 {
    font-size: var(--step-1);
  }

  :where(a) {
    color: currentColor;
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.2em;
  }

  :where(strong, b, label) {
    font-weight: var(--font-weight-bold);
  }

  :where(input:not([type="submit"], [type="checkbox"], [type="radio"])) {
    inline-size: 100%;
    /* Inputs have a built-in width of about 20 characters and won't shrink below it otherwise */
    min-inline-size: 0;
    /* At least 16px, or iOS zooms in on focus */
    font-size: max(1rem, var(--step-0));
    padding: 0.5em 0.75em;
    color: var(--color-text);
    background: var(--color-surface);
    border: var(--stroke) solid var(--color-edge);
    border-radius: var(--radius-m);
  }

  :where(:focus-visible) {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
  }

  ::selection {
    background: var(--color-close);
    color: var(--color-ink);
  }
}
