#toast {
  visibility: hidden;
  position: fixed;
  top: 775px;
  right: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s;
  max-width: 90vw; /* largeur max à 90% de l'écran */
  box-sizing: border-box;
}

#toast.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Remplacer la largeur fixe par une max-width responsive */
#toast > div {
  width: 100%;           /* Prend toute la largeur dispo */
  max-width: 500px;      /* max 500px sur grand écran */
  margin: 0;             /* plus besoin de mx-auto */
}

/* Responsive mobile */
@media screen and (max-width: 480px) {
  #toast {
    top: 700px;
    right: 10px;
    max-width: 95vw;
  }
  
  #toast > div {
    max-width: 100%; /* occupe toute la largeur dispo */
    border-radius: 0.75rem; /* arrondi un peu moins grand */
  }

  /* Ajuster le padding si besoin */
  #toast > div > div {
    padding: 0.5rem 1rem; /* padding plus petit */
  }
}