
#pivenor-toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

@media (max-width: 1023px) {
  #pivenor-toast-container {
    bottom: calc(var(--bottom-nav-height) + var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 400px);
    align-items: center;
  }
}

@media (min-width: 1024px) {
  #pivenor-toast-container {
    bottom: var(--space-8);
    right: var(--space-8);
    width: 360px;
    align-items: flex-end;
  }
}

.pivenor-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  
  animation: pivenor-toast-in var(--duration-normal) var(--ease-out) forwards;
}

.pivenor-toast.is-exiting {
  animation: pivenor-toast-out var(--duration-fast) var(--ease-in-out) forwards;
}

@keyframes pivenor-toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pivenor-toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

.pivenor-toast--success {
  border-left: 4px solid var(--color-success);
}

.pivenor-toast--error {
  border-left: 4px solid var(--color-error);
}

.pivenor-toast--info {
  border-left: 4px solid var(--color-info);
}

.pivenor-toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.pivenor-toast--success .pivenor-toast__icon {
  color: var(--color-success);
}

.pivenor-toast--error .pivenor-toast__icon {
  color: var(--color-error);
}

.pivenor-toast--info .pivenor-toast__icon {
  color: var(--color-info);
}

.pivenor-toast__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
}

.pivenor-toast__title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
}

.pivenor-toast__message {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
}

.pivenor-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  margin: 1px 0 0 0;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-xl);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.pivenor-toast__close:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
}

.pivenor-toast__close svg {
  width: 16px;
  height: 16px;
}

.pivenor-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 var(--radius-3xl);
  background: var(--color-border);
  width: 100%;
}

.pivenor-toast__progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: pivenor-toast-progress linear forwards;
}

.pivenor-toast--success .pivenor-toast__progress::after {
  background: var(--color-success);
}

.pivenor-toast--error .pivenor-toast__progress::after {
  background: var(--color-error);
}

.pivenor-toast--info .pivenor-toast__progress::after {
  background: var(--color-info);
}

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

.pivenor-toast:hover .pivenor-toast__progress::after {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .pivenor-toast {
    animation: none;
    opacity: 1;
  }
  .pivenor-toast.is-exiting {
    animation: none;
    opacity: 0;
  }
  .pivenor-toast__progress::after {
    animation: none;
    transform: scaleX(0);
  }
}
