.toast-stack {
    position: fixed;
    z-index: 10000;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 48px);
}

.toast {
    pointer-events: auto;
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 380px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
    border-left: 4px solid #6b7280;
    position: relative;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast.is-leaving {
    transform: translateY(20px);
    opacity: 0;
}

/* Tinted backgrounds + colored left border per type so the meaning is conveyed
   by background colour AND border AND icon AND text prefix (color-blind safe). */
.toast--success {
    background: #14532d;
    border-left-color: #16a34a;
}
.toast--error {
    background: #7f1d1d;
    border-left-color: #dc2626;
}
.toast--info {
    background: #1e3a8a;
    border-left-color: #2563eb;
}
.toast--warning {
    background: #78350f;
    border-left-color: #d97706;
}

.toast__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.toast__icon svg {
    display: block;
    width: 14px;
    height: 14px;
}

.toast--success .toast__icon { background: #16a34a; }
.toast--error   .toast__icon { background: #dc2626; }
.toast--info    .toast__icon { background: #2563eb; }
.toast--warning .toast__icon { background: #d97706; }

.toast__body {
    flex: 1 1 auto;
    min-width: 0;
}

.toast__prefix {
    font-weight: 700;
    margin-right: 4px;
}

.toast__close {
    margin-left: 6px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
}
.toast__close:hover { color: #fff; }

.toast__badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

@keyframes toast-pulse {
    0%   { transform: translateY(0) scale(1); }
    40%  { transform: translateY(0) scale(1.03); }
    100% { transform: translateY(0) scale(1); }
}
.toast--pulse {
    animation: toast-pulse 320ms ease;
}

@media (max-width: 600px) {
    .toast-stack {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
    .toast { min-width: 0; width: 100%; max-width: none; }
}
