:root {
  --toast-bg: #fff;
  --toast-border: #e2e8f0;
  --toast-text: #2d3748;
  --toast-success: #38a169;
  --toast-warning: #d69e2e;
  --toast-info: #319795;
  --toast-error: #e53e3e;
  --toast-max-width: 1280px;
  --toast-header-offset: 104px;
  --toast-admin-offset: 104px;
}

[data-theme="dark"] {
  --toast-bg: #1a2332;
  --toast-border: #2d3748;
  --toast-text: #e2e8f0;
}

.toast-wrap {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(360px, calc(100vw - 48px));
  pointer-events: none;
}

.toast-wrap--panel {
  top: calc(var(--toast-header-offset) + 16px);
  right: max(24px, calc((100vw - var(--toast-max-width)) / 2 + 24px));
  z-index: 100000;
}

.toast-wrap--admin {
  top: calc(var(--toast-admin-offset) + 16px);
  right: 24px;
}

.toast {
  padding: 12px 18px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  line-height: 1.45;
  color: var(--toast-text);
  width: 100%;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}

[data-theme="dark"] .toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast.success { border-right: 3px solid var(--toast-success); }
.toast.warning { border-right: 3px solid var(--toast-warning); }
.toast.info { border-right: 3px solid var(--toast-info); }
.toast.error { border-right: 3px solid var(--toast-error); }

.toast.toast--out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-8px); opacity: 0; }
}
