.ml-toast-wrapper {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

ml-toast {
  --toast-accent: transparent;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  box-shadow: inset 0 0 0 2px var(--toast-accent);
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  text-align: center;
  opacity: 0;
  transition: opacity .2s ease;
}

ml-toast[open] { opacity: 1; pointer-events: auto; }

ml-toast[type="success"] { --toast-accent: hsl(145 55% 45%); }
ml-toast[type="warning"] { --toast-accent: hsl(40 90% 55%); }
ml-toast[type="error"]   { --toast-accent: hsl(0 70% 60%); }

ml-toast button {
  all: unset;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 .2rem;
  border-radius: 4px;
}
ml-toast button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  ml-toast { transition: none; }
}
