/* ── Global toast notifications ──────────────────── */
.app-toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1090;
  width: min(calc(100vw - 2rem), 22rem);
  border-radius: 0.75rem;
  background: var(--card-color);
  box-shadow: 0 0.65rem 1.75rem rgb(25 26 28 / 16%);
  overflow: hidden;
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.app-toast-error {
  border: 1px solid rgb(220 53 69 / 28%);
}

.app-toast-warning {
  border: 1px solid rgb(255 193 7 / 35%);
}

.app-toast-info {
  border: 1px solid rgb(13 110 253 / 28%);
}

.app-toast-success {
  border: 1px solid rgb(40 170 110 / 28%);
}

.app-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.app-toast.is-hiding {
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
}

.app-toast-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 0.85rem 0.85rem 1rem;
}

.app-toast-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1.15rem;
}

.app-toast-error .app-toast-icon {
  color: #dc3545;
}

.app-toast-warning .app-toast-icon {
  color: #cc9a06;
}

.app-toast-info .app-toast-icon {
  color: #0d6efd;
}

.app-toast-success .app-toast-icon {
  color: #28aa6e;
}

.app-toast-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.app-toast-content span {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-600);
}

.app-toast-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--color-600);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-toast-close:hover {
  background: rgb(25 26 28 / 6%);
  color: var(--color-900);
}

.app-toast-timer {
  height: 3px;
}

.app-toast-error .app-toast-timer {
  background: rgb(220 53 69 / 18%);
}

.app-toast-warning .app-toast-timer {
  background: rgb(255 193 7 / 22%);
}

.app-toast-info .app-toast-timer {
  background: rgb(13 110 253 / 18%);
}

.app-toast-success .app-toast-timer {
  background: rgb(40 170 110 / 18%);
}

.app-toast-timer-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  animation: app-toast-countdown 5s linear forwards;
}

.app-toast-error .app-toast-timer-bar {
  background: #dc3545;
}

.app-toast-warning .app-toast-timer-bar {
  background: #cc9a06;
}

.app-toast-info .app-toast-timer-bar {
  background: #0d6efd;
}

.app-toast-success .app-toast-timer-bar {
  background: #28aa6e;
}

@keyframes app-toast-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

[data-theme="dark"] [data-luno="theme-blue"] .app-toast {
  box-shadow: 0 0.65rem 1.75rem rgb(0 0 0 / 42%);
}

@media (max-width: 575.98px) {
  .app-toast {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    transform: translateY(calc(100% + 1.5rem));
  }

  .app-toast.is-visible {
    transform: translateY(0);
  }

  .app-toast.is-hiding {
    transform: translateY(calc(100% + 1.5rem));
  }
}
