/* TDP Toast — same look as the TeacherDadaPlus app. */
.tdp-toast-stack {
  position: fixed;
  z-index: 2147483000;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  width: min(400px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.tdp-toast {
  --tdp-accent: #257766;
  --tdp-tint: #eaf8f2;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px 16px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
  font-family: inherit;
  color: #0f172a;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  touch-action: pan-y;
}
.tdp-toast.is-visible { opacity: 1; transform: none; }
.tdp-toast.is-leaving { opacity: 0; transform: translateX(24px) scale(0.98); transition-duration: 0.2s; }

.tdp-toast--success { --tdp-accent: #257766; --tdp-tint: #eaf8f2; }
.tdp-toast--error   { --tdp-accent: #d14343; --tdp-tint: #fdecec; }
.tdp-toast--warning { --tdp-accent: #b7791f; --tdp-tint: #fdf3e1; }
.tdp-toast--info    { --tdp-accent: #2563eb; --tdp-tint: #e8f0fe; }

.tdp-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tdp-accent);
}

.tdp-toast__icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tdp-tint);
  color: var(--tdp-accent);
}
.tdp-toast__icon svg { width: 18px; height: 18px; }

.tdp-toast__body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.tdp-toast__title,
.tdp-toast__message {
  margin: 0;
  overflow-wrap: anywhere;
}
.tdp-toast__title { font-size: 14.5px; line-height: 1.4; font-weight: 700; color: #0f172a; }
.tdp-toast__message { margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: #475569; }

.tdp-toast__close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: -4px -2px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tdp-toast__close svg { width: 16px; height: 16px; }
.tdp-toast__close:hover { background: #f1f5f9; color: #0f172a; }
.tdp-toast__close:focus-visible { outline: 2px solid var(--tdp-accent); outline-offset: 1px; }

.tdp-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
}
.tdp-toast__progress > span {
  display: block;
  height: 100%;
  background: var(--tdp-accent);
  opacity: 0.55;
  transform-origin: left center;
  transform: scaleX(1);
}

/* Phones: full width at the top, slides down. */
@media (max-width: 767.98px) {
  .tdp-toast-stack { left: 12px; right: 12px; width: auto; top: max(12px, env(safe-area-inset-top)); }
  .tdp-toast { transform: translateY(-16px); }
  .tdp-toast.is-leaving { transform: translateY(-16px) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
  .tdp-toast, .tdp-toast.is-leaving { transition: opacity 0.15s linear; transform: none; }
  .tdp-toast__progress > span { transition: none !important; }
}

/* Old alertify / toastr containers never show (their calls use TDP Toast). */
.ajs-message, .alertify-notifier, #toast-container { display: none !important; }
