/* Reusable toast — positioning / motion / variants / resets.
   The card look (bg, border, radius, padding, type, icon size) lives in
   Tailwind utilities on the template (includes/toast/render.php). */

#ineko-toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100010;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: 100%;
  pointer-events: none;
}
#ineko-toast-region .ineko-toast {
  pointer-events: auto;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 4px 16px rgba(5, 18, 85, .12);
}

/* clear the (bottom-positioned) WP admin bar for logged-in users */
.admin-bar #ineko-toast-region { bottom: calc(24px + 32px); }

/* enter / exit */
#ineko-toast-region .ineko-toast {
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
#ineko-toast-region .ineko-toast.is-visible { transform: translateX(0); opacity: 1; }
#ineko-toast-region .ineko-toast.is-leaving { transform: translateX(120%); opacity: 0; }

/* inner resets so legacy global button/p rules cannot leak in */
#ineko-toast-region .ineko-toast p { margin: 0; padding: 0; }
#ineko-toast-region .ineko-toast__close {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: pointer; line-height: 0; color: inherit;
}
#ineko-toast-region .ineko-toast__close:hover { color: #051255; }

/* per-type accent + icon chip */
#ineko-toast-region .ineko-toast--success { --toast-accent: #1eaa46; }
#ineko-toast-region .ineko-toast--success .ineko-toast__icon { background: #e7f4ec; color: #1eaa46; }
#ineko-toast-region .ineko-toast--error { --toast-accent: #ff533d; }
#ineko-toast-region .ineko-toast--error .ineko-toast__icon { background: #ffece9; color: #ff533d; }
#ineko-toast-region .ineko-toast--warning { --toast-accent: #febc3c; }
#ineko-toast-region .ineko-toast--warning .ineko-toast__icon { background: #fff4e0; color: #b87400; }
#ineko-toast-region .ineko-toast--info { --toast-accent: #1c3fef; }
#ineko-toast-region .ineko-toast--info .ineko-toast__icon { background: #e8ebfd; color: #1c3fef; }

/* progress bar (success/info/warning auto-dismiss) */
#ineko-toast-region .ineko-toast__progress { background: #f2f3f6; }
#ineko-toast-region .ineko-toast__progress-bar {
  background: var(--toast-accent, #1eaa46);
  transform-origin: left center;
  animation: ineko-toast-progress var(--toast-duration, 4000ms) linear forwards;
}
#ineko-toast-region .ineko-toast:hover .ineko-toast__progress-bar,
#ineko-toast-region .ineko-toast:focus-within .ineko-toast__progress-bar {
  animation-play-state: paused;
}
@keyframes ineko-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  #ineko-toast-region .ineko-toast { transform: none; transition: opacity .2s ease; }
  #ineko-toast-region .ineko-toast.is-leaving { transform: none; }
  #ineko-toast-region .ineko-toast__progress-bar { animation: none; }
}

@media (max-width: 640px) {
  #ineko-toast-region { right: 16px; left: 16px; bottom: 16px; align-items: stretch; }
  .admin-bar #ineko-toast-region { bottom: calc(16px + 46px); }
  #ineko-toast-region .ineko-toast { width: auto; max-width: none; }
}
