@layer components {
  /* Messages : petits toasts en bas à droite, qui montent puis s'effacent. */
  .toasts {
    position: fixed; inset-block-end: var(--space-4); inset-inline-end: var(--space-4); z-index: 50;
    display: grid; gap: var(--space-2); justify-items: end; pointer-events: none;
  }
  .toasts:empty { display: none; }
  .flash {
    display: flex; align-items: center; gap: var(--space-2);
    max-width: 26rem; padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: var(--shadow-pop);
    font-size: var(--text-sm); font-weight: 500; pointer-events: auto;
    animation: toast-in var(--duration-slow) var(--ease-out);
  }
  .flash::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink-faint); flex: none; }
  .flash--alert::before { background: var(--accent); }
  .flash.is-leaving { animation: toast-out var(--duration) var(--ease-in) forwards; }

  /* Dans le panneau d'édition, le message reste en place. */
  .panel .flash { max-width: none; margin: var(--space-4) var(--space-6) 0; box-shadow: none; border: var(--hairline); }

  @keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(4px) scale(0.98); } }

  /* Bandeau d'alerte (compte à reconnecter, échec, à publier) */
  .banner {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 2.25rem; padding: var(--space-1) var(--space-3);
    border-radius: var(--radius); background: var(--accent-soft);
    font-size: var(--text-sm);
  }
  .banner--quiet { background: var(--paper); }
  .banner--alert { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
}
