/* Shared by the update notice and lazy-asset recovery, including admin. */
.sw-update-toast {
  position: fixed; bottom: 24px; right: 24px; max-width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--surface-card); color: var(--text-ink);
  padding: 12px 14px 12px 18px; border-radius: var(--r-card);
  font-family: var(--font-sans); font-size: var(--text-sm); line-height: 1.5;
  box-shadow: var(--shadow-raise); border: 1px solid var(--border-default);
  z-index: var(--z-toast); opacity: 0; transform: translateY(12px);
  transition: opacity var(--duration-normal) var(--ease-out-soft), transform var(--duration-normal) var(--ease-out-soft);
  pointer-events: none;
}
.sw-update-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sw-update-msg { flex: 1 1 240px; overflow-wrap: anywhere; }
.sw-update-btn, .sw-update-close { cursor: pointer; font: inherit; min-width: 44px; min-height: 44px; border-radius: var(--r-control); }
.sw-update-btn { padding: 6px 14px; border: 1px solid var(--learner-action-primary); background: var(--learner-action-primary); color: var(--learner-on-action); font-weight: 700; }
.sw-update-btn:hover { background: var(--learner-action-hover); }
.sw-update-btn:disabled { cursor: wait; }
.sw-update-close { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }
.sw-update-btn:focus-visible, .sw-update-close:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-ring-offset); }
@media (max-width: 480px) { .sw-update-toast { right: 12px; left: 12px; bottom: 12px; } }
/* Keep both independent notices actionable; dialog-hosted recovery keeps its placement.
   A round keeps its submit at the bottom of the screen, and this notice says to save
   before refreshing, so it never sits on the control that saves. */
body:has(> #membershipAccessNotice:not([hidden])) > .sw-update-toast,
body:has(#examFabSubmit[style*="flex"]) > .sw-update-toast,
#quizModal > .sw-update-toast {
  top: max(var(--space-6), env(safe-area-inset-top));
  bottom: auto;
}
@media (prefers-reduced-motion: reduce) { .sw-update-toast { transition: none; transform: none; } }
