.app-toast-root {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(145deg, rgba(28, 36, 50, 0.97), rgba(16, 22, 32, 0.98));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
  backdrop-filter: blur(12px);
  transform: translateX(1.25rem);
  opacity: 0;
  animation: app-toast-in 0.28s ease forwards;
}

.app-toast--out {
  animation: app-toast-out 0.22s ease forwards;
}

.app-toast__icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  border-radius: 50%;
}

.app-toast__body {
  flex: 1;
  min-width: 0;
}

.app-toast__close {
  flex-shrink: 0;
  margin: -0.15rem -0.2rem 0 0;
  padding: 0.15rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.app-toast__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.app-toast--success {
  border-color: rgba(34, 197, 94, 0.4);
}

.app-toast--success .app-toast__icon {
  background: rgba(34, 197, 94, 0.25);
  box-shadow: inset 0 0 0 2px #86efac;
}

.app-toast--error {
  border-color: rgba(239, 68, 68, 0.45);
}

.app-toast--error .app-toast__icon {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: inset 0 0 0 2px #fca5a5;
}

.app-toast--info {
  border-color: rgba(96, 165, 250, 0.4);
}

.app-toast--info .app-toast__icon {
  background: rgba(96, 165, 250, 0.25);
  box-shadow: inset 0 0 0 2px #93c5fd;
}

.app-toast--warning {
  border-color: rgba(251, 191, 36, 0.45);
}

.app-toast--warning .app-toast__icon {
  background: rgba(251, 191, 36, 0.25);
  box-shadow: inset 0 0 0 2px #fcd34d;
}

@keyframes app-toast-in {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes app-toast-out {
  to {
    transform: translateX(1rem);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast {
    animation: none;
    transform: none;
    opacity: 1;
  }
  .app-toast--out {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 520px) {
  .app-toast-root {
    left: 1rem;
    right: 1rem;
    align-items: stretch;
    max-width: none;
  }
}
