/*
 * Flash messages as toasts: they overlay the page in the bottom-right corner,
 * small and rounded, and fade out on their own after a few seconds -- pure
 * CSS, no JavaScript (DESIGN.md §5).
 */
@layer components {
  .toasts {
    position: fixed;
    inset-block-end: var(--space-6);
    inset-inline-end: var(--space-6);
    z-index: 10;
    display: grid;
    gap: var(--space-2);
    inline-size: 30vw;
    pointer-events: none;
  }

  [data-flash] {
    max-inline-size: none;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-m);
    background: var(--color-text);
    color: var(--color-surface);
    font: var(--text-caption);
    box-shadow: var(--shadow-overlay);
    animation: toast-out 0.4s ease-in 5s forwards;
  }

  [data-flash="alert"] {
    background: var(--color-negative);
    color: var(--color-paper);
  }

  @keyframes toast-out {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }
}
