@layer components {

  /* Notices and alerts after a redirect (layouts/_flash): a toast at the top, gone after a few seconds
     without any script. */
  .flash {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    z-index: 50;
    max-width: min(480px, calc(100vw - 32px));
    padding: 8px 14px;
    font-size: 13px;
    color: var(--color-ink);
    background: var(--color-surface);
    border: 1px solid var(--color-edge);
    border-left: 3px solid var(--color-success);
    border-radius: 6px;
    box-shadow: 0 8px 24px color-mix(in oklch, var(--black) 40%, transparent);
    transform: translateX(-50%);
    animation: flash-out 0.4s ease-in 5s forwards;
    pointer-events: none;
  }

  .flash--alert {
    border-left-color: var(--color-danger);
  }

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