.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: min(440px, calc(100vw - 3rem));
}

.toast {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px 18px;
    min-width: 280px;
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--card-bg-deep) 100%);
    border: 1px solid var(--primary);
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.4),
        0 16px 32px -4px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    animation: toast-slide-in 0.35s cubic-bezier(0.42, 0, 1, 1) forwards;
    transform-origin: bottom right;
    overflow: hidden;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(191, 212, 255, 0.15);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-top: 1px;
}

.toast--error {
    border-color: #f87171;
}

.toast--error .toast-icon {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.toast.is-exiting {
    animation: toast-slide-out 0.35s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform-origin: left;
    animation: toast-progress-shrink linear forwards;
}

.toast--error .toast-progress {
    background: linear-gradient(90deg, #f87171 0%, rgba(248, 113, 113, 0.5) 100%);
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(100%) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-slide-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(100%) scale(0.98); }
}

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

@media (max-width: 768px) {
    .toast-container { left: 12px; right: 12px; bottom: 12px; max-width: none; width: auto; }
    .toast { min-width: 0; width: 100%; padding: 12px 14px 16px; font-size: 13px; }
}
