/* Global toast stack — top center, works with any page layout */
#sbk-toast-stack {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}

#sbk-toast-stack .sbk-toast {
  pointer-events: auto;
  width: 100%;
  border-radius: 8px;
  padding: 10px 12px 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  animation: sbk-toast-in 180ms ease forwards;
}

@keyframes sbk-toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#sbk-toast-stack .sbk-toast.sbk-toast--out {
  animation: sbk-toast-out 160ms ease forwards;
}

@keyframes sbk-toast-out {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

#sbk-toast-stack .sbk-toast__icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

#sbk-toast-stack .sbk-toast__body {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

#sbk-toast-stack .sbk-toast__close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  margin: -2px 0 0 0;
}

#sbk-toast-stack .sbk-toast__close:hover {
  opacity: 1;
}

#sbk-toast-stack .sbk-toast--success {
  background: #0d2818;
  color: #e8fff0;
  border-color: rgba(46, 204, 113, 0.45);
}
#sbk-toast-stack .sbk-toast--success .sbk-toast__icon {
  background: rgba(46, 204, 113, 0.25);
  color: #7bed9f;
}

#sbk-toast-stack .sbk-toast--error {
  background: #2a1212;
  color: #ffecec;
  border-color: rgba(231, 76, 60, 0.45);
}
#sbk-toast-stack .sbk-toast--error .sbk-toast__icon {
  background: rgba(231, 76, 60, 0.22);
  color: #ff8a80;
}

#sbk-toast-stack .sbk-toast--warning {
  background: #2a2210;
  color: #fff8e6;
  border-color: rgba(241, 196, 15, 0.45);
}
#sbk-toast-stack .sbk-toast--warning .sbk-toast__icon {
  background: rgba(241, 196, 15, 0.2);
  color: #f7dc6f;
}

#sbk-toast-stack .sbk-toast--info {
  background: #121c2a;
  color: #e8f2ff;
  border-color: rgba(52, 152, 219, 0.45);
}
#sbk-toast-stack .sbk-toast--info .sbk-toast__icon {
  background: rgba(52, 152, 219, 0.22);
  color: #85c1e9;
}

html[data-theme='light'] #sbk-toast-stack .sbk-toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme='light'] #sbk-toast-stack .sbk-toast--success {
  background: #e8f8ee;
  color: #0f3018;
  border-color: rgba(39, 174, 96, 0.35);
}
html[data-theme='light'] #sbk-toast-stack .sbk-toast--error {
  background: #fdecea;
  color: #4a0f0f;
  border-color: rgba(192, 57, 43, 0.35);
}
html[data-theme='light'] #sbk-toast-stack .sbk-toast--warning {
  background: #fff8e6;
  color: #3d3200;
  border-color: rgba(211, 172, 0, 0.35);
}
html[data-theme='light'] #sbk-toast-stack .sbk-toast--info {
  background: #eaf2fb;
  color: #0f243d;
  border-color: rgba(41, 128, 185, 0.35);
}
