@layer components {
  #flash {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 70 !important;
  }

  .flash {
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-inline-size: 15rem;
    padding: 1rem 1.25rem;
  }

  .flash__message {
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .flash__message--notice {
    color: var(--color-emerald-700);
  }

  .flash__message--alert {
    color: var(--color-rose-700);
  }

  .alert {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.6rem 0.8rem;
  }

  .alert--danger {
    background: var(--color-rose-50);
    border-color: var(--color-rose-100);
    color: var(--color-rose-700);
  }

  .alert--success {
    background: var(--color-emerald-50);
    border-color: var(--color-emerald-100);
    color: var(--color-emerald-700);
  }

  .toast-stack {
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    position: fixed;
    right: 1rem;
    z-index: 60;
  }

  .toast {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    min-width: 15rem;
    opacity: 0;
    padding: 1rem 1.25rem;
    pointer-events: auto;
    transform: translateY(0.5rem);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .toast.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .toast--info {
    border-color: var(--color-emerald-200);
    color: var(--color-slate-800);
  }

  .toast--error {
    background: var(--color-rose-50);
    border-color: var(--color-rose-200);
    color: var(--color-rose-700);
  }
}
