.bharat-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
  font-family: var(--bharat-font-family);
}

.bharat-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.875rem 0.875rem 0.75rem 0.875rem;
  border-radius: 0.875rem;
  background: #fff;
  border: 1px solid rgb(15 23 42 / 0.08);
  box-shadow:
    0 18px 40px rgb(15 23 42 / 0.12),
    0 4px 12px rgb(15 23 42 / 0.06);
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(1.25rem) scale(0.98);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  font-family: var(--bharat-font-family);
}

.bharat-toast.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.bharat-toast.is-leaving {
  opacity: 0;
  transform: translateX(1rem) scale(0.98);
}

.bharat-toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.bharat-toast__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.bharat-toast__body {
  min-width: 0;
  padding-top: 0.125rem;
}

.bharat-toast__title {
  margin: 0 0 0.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.bharat-toast__message {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #334155;
  word-break: break-word;
}

.bharat-toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.125rem -0.125rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.bharat-toast__close:hover {
  background: rgb(15 23 42 / 0.06);
  color: #0f172a;
}

.bharat-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation-name: bharat-toast-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

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

.bharat-toast--success .bharat-toast__icon {
  background: #ecfdf3;
  color: #15803d;
}

.bharat-toast--success .bharat-toast__progress {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.bharat-toast--error .bharat-toast__icon {
  background: #fef2f2;
  color: #dc2626;
}

.bharat-toast--error .bharat-toast__progress {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.bharat-toast--warning .bharat-toast__icon {
  background: var(--bharat-primary-light, #fff0e8);
  color: var(--bharat-primary, #ff6821);
}

.bharat-toast--warning .bharat-toast__progress {
  background: linear-gradient(90deg, #ffb07a, var(--bharat-primary, #ff6821));
}

.bharat-toast--info .bharat-toast__icon {
  background: #eff6ff;
  color: #2563eb;
}

.bharat-toast--info .bharat-toast__progress {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

@media (max-width: 640px) {
  .bharat-toast-stack {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .bharat-toast {
    border-radius: 0.75rem;
  }
}
