/* ===========================
   Global Toast — top-right, toastr style
   =========================== */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 320px;
    max-width: calc(100vw - 40px);
}

.toast {
    pointer-events: all;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 28px 9px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    overflow: hidden;
    animation: toast-in .25s ease forwards;
}

.toast.toast-hiding {
    animation: toast-out .2s ease forwards;
    pointer-events: none;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ── Variants ── */
.toast-success { --tc: #22c55e; }
.toast-error   { --tc: #ef4444; }
.toast-warning { --tc: #f59e0b; }
.toast-info    { --tc: #3b82f6; }
.toast-neutral { --tc: #6b7280; }

/* ── Icon ── */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ── Body ── */
.toast-body { flex: 1; min-width: 0; }

.toast-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0;
}

.toast-message {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    margin: 2px 0 0;
}

/* ── Close ── */
.toast-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
    transition: color .15s;
}

.toast-close:hover { color: #374151; }

/* ── Progress bar at bottom ── */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--tc);
    opacity: 0.7;
    transform-origin: left;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 480px) {
    #toast-container { top: 12px; right: 12px; left: 12px; width: auto; }
}
