::view-transition-group(toast-container),
::view-transition-image-pair(toast-container),
::view-transition-old(toast-container),
::view-transition-new(toast-container) {
  animation: none;
}

::view-transition-image-pair(toast-container) {
  isolation: isolate;
}

::view-transition-old(toast-container) {
  opacity: 0;
  mix-blend-mode: normal;
}

::view-transition-new(toast-container) {
  mix-blend-mode: normal;
}

#toast-container {
  view-transition-name: toast-container;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 356px;
  max-width: 100vw;
  padding: 0;
  margin: 0;
  list-style: none;
  pointer-events: none;
  outline: none;
}

.toast {
  --toast-color: var(--color-foreground);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: 8px;
  pointer-events: auto;
  z-index: var(--toast-z-index, 0);
  opacity: 0;
  transform: translateY(var(--toast-offset)) scale(var(--toast-scale, 1));
  transition:
    transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast[data-mounted] {
  opacity: 1;
}

.toast[data-removed],
.toast:not([data-visible]) {
  opacity: 0;
  pointer-events: none;
}

.toast[data-type='success'] {
  --toast-color: var(--color-secondary);
}

.toast[data-type='error'] {
  --toast-color: var(--color-danger);
}

.toast[data-type='warning'] {
  --toast-color: var(--color-warning);
}

.toast[data-type='info'] {
  --toast-color: var(--color-accent);
}

.toast[data-type='loading'] {
  --toast-color: var(--color-muted-foreground);
}

.toast-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  padding-inline-end: 36px;
  background: var(--color-input);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast:not([data-mounted]) .toast-inner,
.toast[data-removed] .toast-inner {
  transform: translateY(-12px);
}

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--toast-color);
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-foreground);
  line-height: 1.4;
}

.toast-description {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-muted-foreground);
  line-height: 1.4;
  margin-top: 2px;
}

.toast-close {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-muted-foreground);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition:
    opacity 200ms,
    color 150ms,
    background 150ms,
    border-color 150ms;
}

.toast:hover .toast-close {
  opacity: 1;
}

.toast-close:focus-visible,
.toast:focus-within .toast-close {
  opacity: 1;
}

.toast-close:hover {
  color: var(--color-foreground);
  background: var(--color-muted);
  border-color: rgba(0, 0, 0, 0.08);
}

.toast-close svg {
  width: 12px;
  height: 12px;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 2px;
  opacity: 0.5;
  background: var(--toast-color);
  transform: scaleX(1);
}

[dir='rtl'] .toast-progress-bar {
  transform-origin: right;
}

[dir='ltr'] .toast-progress-bar {
  transform-origin: left;
}

@media (hover: none), (pointer: coarse) {
  .toast-close {
    opacity: 1;
  }
}
