:root {
  --nv-toast-surface: color-mix(in srgb, #2a2a2d 96%, transparent);
  --nv-toast-text: #f0f0f2;
  --nv-toast-message: #b7b7bc;
  --nv-toast-icon: #d0d0d4;
  --nv-toast-close: #a3a3aa;
  --nv-toast-close-hover: rgb(255 255 255 / 0.08);
  --nv-toast-progress: #b9b9be;
  --nv-toast-shadow: 0 18px 44px rgb(0 0 0 / 0.34);
  --nv-toast-blur: blur(16px) saturate(1.04);
}

html.light-theme,
html.light,
html.dash-landing-preview.light-theme,
html.dash-landing-preview.light {
  --nv-toast-surface: #f2f2f3;
  --nv-toast-text: #202022;
  --nv-toast-message: #5f5f64;
  --nv-toast-icon: #444448;
  --nv-toast-close: #6a6a70;
  --nv-toast-close-hover: rgb(7 7 7 / 0.06);
  --nv-toast-progress: #56565b;
  --nv-toast-shadow: 0 1px 2px rgb(7 7 7 / 0.06), 0 14px 32px rgb(7 7 7 / 0.1);
  --nv-toast-blur: none;
}

.nv-toast-stack {
  position: fixed;
  top: auto;
  right: 24px;
  bottom: 24px;
  left: auto;
  z-index: 900;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
  pointer-events: none;
}

.nv-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--nv-toast-surface);
  box-shadow: var(--nv-toast-shadow);
  color: var(--nv-toast-text);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(10px);
  -webkit-backdrop-filter: var(--nv-toast-blur);
  backdrop-filter: var(--nv-toast-blur);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.nv-toast.is-entered { opacity: 1; transform: translateY(0); }
.nv-toast.is-exiting { opacity: 0; transform: translateX(12px); }

.nv-toast--success,
.nv-toast--error,
.nv-toast--warning,
.nv-toast--info { color: var(--nv-toast-icon); }

.nv-toast__icon { display: grid; width: 18px; height: 18px; flex: none; place-items: center; }
.nv-toast__icon svg,
.nv-toast__close svg { width: 16px; height: 16px; }
.nv-toast__body { min-width: 0; flex: 1; }
.nv-toast__title,
.nv-toast__message { margin: 0; }
.nv-toast__title { color: var(--nv-toast-text); font-size: 14px; font-weight: 600; line-height: 20px; }
.nv-toast__message { color: var(--nv-toast-message); font-size: 12px; line-height: 16px; }
.nv-toast__title + .nv-toast__message { margin-top: 2px; }

.nv-toast__close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--nv-toast-close);
  cursor: pointer;
}

.nv-toast__close:hover { background: var(--nv-toast-close-hover); color: var(--nv-toast-text); }
.nv-toast__close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.nv-toast__progress {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: var(--nv-toast-progress);
  opacity: 0.42;
  transform-origin: left;
  animation: nv-toast-progress var(--nv-toast-duration) linear forwards;
}

@keyframes nv-toast-progress { to { transform: scaleX(0); } }

/* Legacy page notifications inherit the same neutral, theme-aware surface. */
.inv-toast,
.tx-toast,
.acct-toast,
.aiw-toast,
.prof-toast,
.bill-toast,
.settings-toast,
.team-toast,
.int-toast,
.sec-toast,
.ntf-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: var(--nv-toast-surface);
  box-shadow: var(--nv-toast-shadow);
  color: var(--nv-toast-text);
  -webkit-backdrop-filter: var(--nv-toast-blur);
  backdrop-filter: var(--nv-toast-blur);
}

.inv-toast::before,
.tx-toast::before,
.acct-toast::before,
.aiw-toast::before,
.prof-toast::before,
.bill-toast::before,
.settings-toast::before,
.team-toast::before,
.int-toast::before,
.sec-toast::before,
.ntf-toast::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--nv-toast-icon);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.toast { display: flex; align-items: flex-start; gap: 10px; border: 0; }
.toast-icon { display: grid; width: 18px; height: 18px; flex: none; margin-top: 2px; place-items: center; }
.toast-icon svg { width: 16px; height: 16px; }
.toast-success .toast-icon,
.toast-error .toast-icon,
.toast-warning .toast-icon,
.toast-info .toast-icon { color: var(--nv-toast-icon); }

@media (max-width: 640px) {
  .nv-toast-stack { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .nv-toast,
  .nv-toast.is-exiting { transform: none; transition: opacity 120ms ease-out; }
  .nv-toast__progress { animation: none; }
}

@media (forced-colors: active) {
  .nv-toast { border: 1px solid CanvasText; forced-color-adjust: auto; }
}
