[data-scope="toast"][data-part="root"] {
  background: white;
  padding: 16px;
  min-height: 48px;
  display: flex;
  align-items: center;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  line-height: 2;
  width: 360px;
  overflow-wrap: anywhere;
  translate: var(--x) var(--y);
  scale: var(--scale);
  z-index: var(--z-index);
  height: var(--height);
  opacity: var(--opacity);

  will-change: translate, opacity, scale;
  transition:
    translate 400ms,
    scale 400ms,
    opacity 400ms,
    height 400ms,
    box-shadow 200ms;
  transition-timing-function: cubic-bezier(0.21, 1.02, 0.73, 1);

  &[data-state="closed"] {
    transition:
      translate 400ms,
      scale 400ms,
      opacity 200ms;
    transition-timing-function: cubic-bezier(0.06, 0.71, 0.55, 1);
  }

  &[data-type="error"] {
    background: red;
    color: white;
  }

  &[data-type="info"] {
    background: blue;
    color: white;
  }

  &[data-type="warning"] {
    background: orange;
  }

  &[data-type="success"] {
    background: green;
    color: white;
  }
}

[data-scope="toast"][data-part="close-trigger"] {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  padding: 0;

  & svg {
    width: 1em;
    height: 1em;
  }
}

[data-scope="toast"][data-part="title"] {
  display: flex;
  align-items: center;
  gap: 12px;
}

[data-scope="toast"] .spinner {
  animation: spin 1s linear infinite;
}

[data-scope="toast"][data-part="progressbar"] {
  height: 4px;
  background: rgb(116, 116, 116);
  width: 100%;
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  animation-name: shrinkX;
  animation-duration: var(--duration);
  animation-fill-mode: forwards;
  animation-play-state: running;
  transform-origin: left;

  [data-type="loading"] & {
    animation-name: none;
  }

  [data-paused] & {
    animation-play-state: paused;
  }

  [dir="rtl"] & {
    transform-origin: right;
  }
}

[data-scope="toast"][data-part="progressbar"][data-type="loading"] {
  animation-name: none;
}

@media (max-width: 640px) {
  [data-scope="toast"][data-part="group"] {
    width: 100%;
  }

  [data-scope="toast"][data-part="root"] {
    inset-inline: 0;
    width: calc(100% - var(--gap) * 2);
  }
}
