:root {
    --toast-radius: 12px;
    --toast-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
    --toast-padding: 12px 14px;
    --toast-gap: 10px;
}

#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

@media (max-width: 640px) {
    #toast-container {
        top: auto;
        bottom: 16px;
        right: 0;
        left: 0;
        align-items: center;
        padding: 0 12px;
    }
}

.toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--toast-gap);
    min-width: 280px;
    max-width: 420px;
    padding: var(--toast-padding);
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    color: #e2e8f0;
    pointer-events: auto;
    animation: toast-enter 200ms ease-out;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--toast-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
    .toast {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

.toast-icon i {
    font-size: 1.2rem;
}

.toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.95rem;
    color: #cbd5e1;
}

.toast-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 120ms ease;
}

.toast-close:hover,
.toast-close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.toast-success { background: rgba(15, 81, 50, 0.28); color: #e2f7e8; }
.toast-success .toast-message { color: #c4f3d6; }
.toast-error { background: rgba(127, 29, 29, 0.30); color: #fee2e2; }
.toast-error .toast-message { color: #fecdd3; }
.toast-info { background: rgba(30, 41, 59, 0.32); color: #e2e8f0; }
.toast-info .toast-message { color: #cbd5e1; }
.toast-warning { background: rgba(120, 53, 15, 0.30); color: #ffedd5; }
.toast-warning .toast-message { color: #fed7aa; }

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-leave {
    animation: toast-exit 200ms ease-in forwards;
}

@keyframes toast-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
    .toast-leave { animation: none; opacity: 0; }
}
