@layer base {
  body {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: none;
    background: var(--color-surface);
    color: var(--color-text);
    interpolate-size: allow-keywords;
    line-height: 1.375;
    max-inline-size: 100vw;
    scroll-behavior: auto;
    text-rendering: optimizeLegibility;
    text-size-adjust: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  :where(main) {
    flex: 1;
    display: flex;
  }

  :where(ul, ol) {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  :where(button, [type=submit], .btn) {
    border: none;
    padding: var(--block-space-half) var(--inline-space);

    &:where(:focus-visible) {
      outline: 2px solid oklch(10% 0 0);
      outline-offset: 2px;
    }
  }

  :where(p) {
    margin: 0;
  }

  a {
    color: inherit;
    text-decoration: none;

    &:not([class]) {
      color: var(--color-link);
      text-decoration: underline;
      text-decoration-skip-ink: auto;
    }
  }

  hr {
    color: var(--color-text-softest);
    height: 1px;
    width: 100%;
    margin: 0;
    opacity: 0.5;
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  h4 { font-size: var(--text-base); }
  h5 { font-size: var(--text-base); }
  h6 { font-size: var(--text-base); }

  .flash {
    padding: var(--block-space-half) var(--inline-space);
    margin-block-end: var(--block-space);

    &.flash--notice {
      background-color: color-mix(in srgb, var(--color-link) 25%, transparent);;
    }

    &.flash--alert {
      background-color: color-mix(in srgb, var(--color-error) 25%, transparent);;
    }
  }

  .field_with_errors {
    display: contents;
    color: var(--color-error);
  }

  #error_explanation {
     color: var(--color-error);
  }

  .--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
  }

  .--loading::before {
    content: "";
    width: 1em;
    height: 1em;
    margin-inline-end: 0.5rem;

    display: inline-block;
    vertical-align: baseline;

    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 9999px;

    animation: spinner 0.6s linear infinite;
  }

  @keyframes spinner {
    to {
      transform: rotate(360deg);
    }
  }
}