@layer components {
  .flash {
    display: flex;
    inset-block-end: calc(var(--space-4) + env(safe-area-inset-bottom));
    inset-inline-start: 50%;
    justify-content: center;
    max-inline-size: 100%;
    position: fixed;
    transform: translateX(-50%);
    z-index: var(--z-flash);
  }

  .flash__inner {
    animation: appear-then-fade 3s 300ms both;
    background-color: var(--flash-background, var(--color-ink));
    border-radius: var(--radius-pill);
    color: var(--flash-color, var(--color-ink-inverted));
    display: inline-flex;
    font-size: var(--text-small);
    inline-size: max-content;
    margin: 0 auto;
    max-inline-size: min(90vw, 48rem);
    padding: var(--space-2) var(--space-4);
  }

  .flash--notice {
    --flash-background: var(--color-ink);
    --flash-color: var(--color-ink-inverted);
  }

  .flash--alert {
    --flash-background: var(--color-negative);
    --flash-color: var(--color-ink-inverted);
  }
}
