/**
 * Vision Smart — toast notifications (server flash + client messages).
 * Brand: #00ADEF / #0F172A
 */
.vs-toast-host {
  position: fixed;
  top: calc(0.85rem + env(safe-area-inset-top, 0px));
  right: 0.85rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(380px, calc(100vw - 1.5rem));
  pointer-events: none;
}

.vs-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  padding: 0.9rem 0.85rem 1rem 0.95rem;
  overflow: hidden;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.vs-toast.is-in {
  opacity: 1;
  transform: translateX(0);
}

.vs-toast.is-leaving {
  opacity: 0;
  transform: translateX(16px);
}

.vs-toast__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.vs-toast.is-success .vs-toast__icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.vs-toast.is-error .vs-toast__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.vs-toast.is-warning .vs-toast__icon {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}

.vs-toast.is-info .vs-toast__icon {
  background: rgba(0, 173, 239, 0.12);
  color: #0090C8;
}

.vs-toast__body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 0.1rem;
}

.vs-toast__title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.vs-toast__msg {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #475569;
  word-wrap: break-word;
}

.vs-toast__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #94A3B8;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
  cursor: pointer;
}

.vs-toast__close:hover {
  background: #F1F5F9;
  color: #334155;
}

.vs-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: vs-toast-progress linear forwards;
}

.vs-toast.is-success .vs-toast__progress { background: #10B981; }
.vs-toast.is-error .vs-toast__progress { background: #EF4444; }
.vs-toast.is-warning .vs-toast__progress { background: #F59E0B; }
.vs-toast.is-info .vs-toast__progress { background: #00ADEF; }

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

body.vs-app.has-bottom-nav .vs-toast-host {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

@media (max-width: 767px) {
  .vs-toast-host {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }

  .vs-toast {
    transform: translateY(-10px);
    border-radius: 16px;
    padding: 1rem 0.9rem 1.05rem 1rem;
  }

  .vs-toast.is-in {
    transform: translateY(0);
  }

  .vs-toast.is-leaving {
    transform: translateY(-10px);
  }

  .vs-toast__msg {
    font-size: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vs-toast,
  .vs-toast.is-in,
  .vs-toast.is-leaving {
    transition: none;
    transform: none;
  }

  .vs-toast__progress {
    animation: none;
    display: none;
  }
}
