.toast {
  --toast-accent: #167c80;
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: auto;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(420px, calc(100vw - 48px));
  min-height: 54px;
  padding: 11px 13px 13px 12px;
  border: 1px solid #b8d9d6;
  border-left: 4px solid var(--toast-accent);
  border-radius: 4px;
  background: #f1fbfa;
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(23, 32, 38, .18);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(18px, -6px, 0);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
  overflow: hidden;
}

.toast.show {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.toast[data-type="success"] {
  --toast-accent: #2f8f62;
  border-color: #c8e4b5;
  background: #f3faef;
}

.toast[data-type="warning"] {
  --toast-accent: #b97816;
  border-color: #f0d99c;
  background: #fff9e8;
}

.toast[data-type="error"] {
  --toast-accent: #b34e20;
  border-color: #efc7b8;
  background: #fff3ef;
}

.toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--toast-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.toast-message {
  flex: 1;
  min-width: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.toast-close {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--toast-accent);
  font-size: 21px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(23, 32, 38, .07);
}

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--toast-accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.toast.show .toast-progress {
  animation: toast-progress var(--toast-duration, 3200ms) linear forwards;
}

@keyframes toast-progress {
  to { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .toast {
    top: 16px;
    right: 16px;
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
  .toast.show .toast-progress { animation: none; transform: scaleX(1); }
}
