/* MyoMed toasts (Rescue). Toast section copied from nexgen-mastery/web/css/notifications.css. */

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast-region { display: flex; flex-direction: column; gap: 0.5rem; }
.toast-region:empty { display: none; }

.toast {
  --toast-bar: #2563eb;
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--card, #fff);
  color: var(--ink, #1a2a33);
  border: 1px solid var(--line, #d8e1e5);
  border-left: 4px solid var(--toast-bar);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 30, 40, 0.18), 0 2px 6px rgba(15, 30, 40, 0.08);
  font-size: var(--text-sm, 0.9rem);
  line-height: 1.4;
  touch-action: pan-y;
  animation: toast-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast-success { --toast-bar: #16a34a; }
.toast-info    { --toast-bar: #2563eb; }
.toast-warning { --toast-bar: #d97706; }
.toast-error   { --toast-bar: #dc2626; }
.toast-xp      { --toast-bar: #d4a017; }

.toast-icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: var(--font-bold, 700);
  color: #fff;
  background: var(--toast-bar);
  font-size: 0.85rem;
}
.toast-xp .toast-icon { background: transparent; color: #d4a017; font-size: 1.15rem; }
.toast-body { flex: 1; min-width: 0; }
.toast-msg { margin: 0; overflow-wrap: anywhere; }
.toast-xp .toast-msg { color: #b8860b; font-weight: var(--font-bold, 700); font-size: var(--text-base, 1rem); }
.toast-action {
  display: inline-block;
  margin-top: 0.3rem;
  font-weight: var(--font-semibold, 600);
  color: var(--toast-bar);
  text-decoration: underline;
}
.toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted, #5b6b73);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
  border-radius: 4px;
}
.toast-close:hover { color: var(--ink, #1a2a33); }
.toast-close:focus-visible, .toast-action:focus-visible { outline: 2px solid var(--toast-bar); outline-offset: 2px; }

.toast-out { animation: toast-out 200ms ease-in both; }
.toast-swipe-right.toast-out { animation-name: toast-out-right; }
.toast-swipe-left.toast-out { animation-name: toast-out-left; }
.toast-dragging { transition: none; animation: none; }

@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { transform: translateX(110%); opacity: 0; } }
@keyframes toast-out-right { to { transform: translateX(120%); opacity: 0; } }
@keyframes toast-out-left { to { transform: translateX(-120%); opacity: 0; } }

[data-theme="dark"] .toast-xp .toast-msg { color: #f2c94c; }

@media (max-width: 480px) {
  .toast-stack { left: 0.75rem; right: 0.75rem; top: 0.75rem; width: auto; max-width: none; }
}

/* ── Reduced motion: instant show / hide ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast-out { animation: none !important; transition: none !important; }
}
.toast-static { animation: none; }
