.toasts {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: var(--z-toast);
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 12px 14px 16px;
  border: 1px solid var(--color-light-gray);
  border-left: 4px solid var(--toast-accent);
  border-radius: 12px;
  background-color: var(--color-white);
  box-shadow: 0 12px 32px rgb(24 44 72 / 16%);
  color: var(--color-dark);
  font-family: var(--font-family-text);
  animation: toast-in .25s ease-out;
  transition: opacity .2s, transform .2s;
}

.toast--notice {
  --toast-accent: var(--match-color);
}

.toast--alert {
  --toast-accent: var(--color-red);
}

.toast--leaving {
  opacity: 0;
  transform: translateY(-8px);
}

span.toast__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--toast-accent);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
}

.toast p.toast__message {
  flex: 1;
  min-width: 0;
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.toast__close {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -2px 0 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: #6b6b76;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;

  &:hover, &:focus-visible {
    background-color: #f1f1f6;
    color: var(--color-dark);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 767px) {
  .toasts {
    top: 72px;
    right: 16px;
  }
}

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