[data-drupal-messages] {
  display: none !important;
}

.justlift-toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2.5rem));
  max-height: calc(100vh - 2.5rem);
  pointer-events: none;
}

.justlift-toast {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem 1fr 1.25rem;
  align-items: start;
  gap: 0.625rem;
  padding: 0.875rem 0.875rem 1.125rem;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  background: #ffffff;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.18),
    0 4px 10px -4px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  overflow: hidden;
  animation: justlift-toast-in 0.28s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}

.justlift-toast--leaving {
  animation: justlift-toast-out 0.3s ease-in forwards;
}

@keyframes justlift-toast-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes justlift-toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
    max-height: 240px;
    margin-top: 0;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
    max-height: 0;
    margin-top: -0.75rem;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.justlift-toast--status {
  border-color: #bbf7d0;
  background: #f0fdf4;
  --toast-accent: #16a34a;
}

.justlift-toast--warning {
  border-color: #fde68a;
  background: #fffbeb;
  --toast-accent: #d97706;
}

.justlift-toast--error {
  border-color: #fecaca;
  background: #fef2f2;
  --toast-accent: #dc2626;
}

.justlift-toast__icon-col {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
}

.justlift-toast__icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--toast-accent);
}

.justlift-toast__content {
  min-width: 0;
  align-self: center;
}

.justlift-toast__message {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #1f2937;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.justlift-toast__message a {
  color: var(--toast-accent);
  text-decoration: underline;
  font-weight: 600;
}

.justlift-toast__message a:hover {
  text-decoration: none;
}

.justlift-toast__close {
  align-self: flex-start;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.justlift-toast__close:hover,
.justlift-toast__close:focus-visible {
  background-color: rgba(0, 0, 0, 0.06);
  color: #111827;
  outline: 2px solid var(--toast-accent);
  outline-offset: 1px;
}

.justlift-toast__close svg {
  width: 0.85rem;
  height: 0.85rem;
}

.justlift-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--toast-accent);
  opacity: 0.65;
  transform-origin: left center;
  transform: scaleX(1);
  animation: justlift-toast-progress linear forwards;
  animation-duration: var(--toast-duration, 5s);
  animation-play-state: running;
}

.justlift-toast__progress.is-running {
  animation-play-state: running;
}

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

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

  .justlift-toast {
    animation-name: justlift-toast-in-mobile;
  }

  .justlift-toast--leaving {
    animation-name: justlift-toast-out-mobile;
  }

  @keyframes justlift-toast-in-mobile {
    from {
      transform: translateY(120%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes justlift-toast-out-mobile {
    from {
      transform: translateY(0);
      opacity: 1;
      max-height: 240px;
    }
    to {
      transform: translateY(120%);
      opacity: 0;
      max-height: 0;
      margin-top: -0.75rem;
      padding-top: 0;
      padding-bottom: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .justlift-toast,
  .justlift-toast--leaving {
    animation-duration: 0.001s !important;
  }

  .justlift-toast__progress {
    animation: none !important;
    display: none;
  }
}