/* ── Side-sliding Toast System ── */
#toast-container {
  position: fixed;
  top: calc(16px + var(--safe-top));
  right: 16px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 320px;
  width: calc(100vw - 32px);
}

@media (min-width: 600px) {
  #toast-container {
    right: calc(50% - 430px/2 + 16px);
    max-width: 300px;
  }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  border-left: 3px solid var(--teal);
  animation: toastSlideIn var(--dur-lg) var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .toast {
  background: var(--surface-3);
}

.toast.removing {
  animation: toastSlideOut var(--dur) var(--ease) both;
}

.toast-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.toast-msg   { font-size: 12px; opacity: .85; }

.toast-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 14px; cursor: pointer; padding: 0; flex-shrink: 0;
  line-height: 1; transition: color var(--dur) var(--ease);
  pointer-events: all;
}
.toast-close:hover { color: #fff; }

/* Toast type borders */
.toast.success { border-left-color: var(--teal); }
.toast.success .toast-icon { color: var(--teal); }
.toast.error   { border-left-color: var(--danger); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warn    { border-left-color: var(--warn); }
.toast.warn    .toast-icon { color: var(--warn); }
.toast.info    { border-left-color: var(--info); }
.toast.info    .toast-icon { color: var(--info); }

/* Progress bar for auto-dismiss */
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: currentColor;
  opacity: .4;
  border-radius: 0 2px 2px 0;
  animation: toastProgress linear forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); max-height: 100px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(110%); max-height: 0; margin-bottom: -8px; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}
