/*
 * toast.css — bottom-right notification stack.
 *
 * Uses the unified premium-feel tokens from steps 2-4:
 *   --ps-elev-2 (lifted overlay shadow)
 *   --ps-ease   (Superhuman ease-out-expo)
 *   --mint family for success state
 *   --amber for warning, --red for error (shell.css status tokens, untouched
 *   by accent.css which only redirected blue+purple → mint).
 */

.ps-toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.ps-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 12px;
  width: min(380px, calc(100vw - 40px));
  padding: 12px 14px;
  background: var(--card-elevated, #122038);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--mint, #2ed8a8);
  border-radius: 10px;
  box-shadow: var(--ps-elev-2, 0 16px 40px rgba(0, 0, 0, 0.28));
  color: var(--t1, #EAF0FC);
  font-family: var(--fb, inherit);
  transform: translateX(110%);
  opacity: 0;
  transition:
    transform 240ms var(--ps-ease, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity 200ms var(--ps-ease, cubic-bezier(0.16, 1, 0.3, 1));
  will-change: transform, opacity;
}

html[data-theme="light"] .ps-toast {
  background: var(--card-elevated, #ffffff);
  border-color: rgba(26, 39, 64, 0.10);
}

.ps-toast.is-shown {
  transform: translateX(0);
  opacity: 1;
}

.ps-toast.is-leaving {
  transform: translateX(110%);
  opacity: 0;
}

/* — Type-coloured left rail + icon — */
.ps-toast--success { border-left-color: var(--mint, #2ed8a8); }
.ps-toast--warning { border-left-color: var(--amber, #f3a847); }
.ps-toast--error   { border-left-color: var(--red, #e25757); }
.ps-toast--info    { border-left-color: var(--t3, #6A8BA8); }

.ps-toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #0E1A2E;
}

.ps-toast--success .ps-toast-icon { background: var(--mint, #2ed8a8); }
.ps-toast--warning .ps-toast-icon { background: var(--amber, #f3a847); }
.ps-toast--error   .ps-toast-icon { background: var(--red, #e25757); color: #fff; }
.ps-toast--info    .ps-toast-icon {
  background: var(--mint-a20, rgba(46, 216, 168, 0.20));
  color: var(--mint, #2ed8a8);
  font-style: italic;
}

.ps-toast-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ps-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1, #EAF0FC);
  line-height: 1.3;
}

.ps-toast-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--t2, #8BAAC8);
  line-height: 1.4;
  word-break: break-word;
}

html[data-theme="light"] .ps-toast-text {
  color: var(--t2, #3C5268);
}

.ps-toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--t3, #6A8BA8);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 90ms var(--ps-ease, cubic-bezier(0.16, 1, 0.3, 1)), color 90ms var(--ps-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.ps-toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--t1, #EAF0FC);
}

html[data-theme="light"] .ps-toast-close:hover {
  background: rgba(26, 39, 64, 0.06);
  color: var(--t1, #1E2428);
}

@media (max-width: 480px) {
  .ps-toast-stack {
    left: 20px;
    right: 20px;
    bottom: 16px;
  }
  .ps-toast { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ps-toast {
    transition: opacity 120ms linear;
    transform: translateX(0);
  }
  .ps-toast:not(.is-shown), .ps-toast.is-leaving { transform: translateX(0); }
}
