.toast-root {
    position: fixed;
    top: 1.25rem;
    right: 1rem;
    z-index: 110;
    width: min(92vw, 24rem);
    display: grid;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    --toast-accent: #2563eb;
    --toast-bg: #ffffff;
    --toast-text: #0f172a;
    --toast-duration: 5200ms;
    position: relative;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-left: 4px solid var(--toast-accent);
    border-radius: 1rem;
    background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
    color: var(--toast-text);
    box-shadow: 0 16px 38px -24px rgba(15, 23, 42, 0.42);
    padding: 0.9rem 0.9rem 1.1rem;
    overflow: hidden;
    transform: translateY(-10px) scale(0.98);
    opacity: 0;
    animation: toast-enter 280ms ease forwards;
}

.toast-success {
    --toast-accent: #059669;
}

.toast-error {
    --toast-accent: #dc2626;
}

.toast-warning {
    --toast-accent: #d97706;
}

.toast-info {
    --toast-accent: #2563eb;
}

.toast-icon {
    margin-top: 0.1rem;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--toast-accent) 14%, white);
    color: var(--toast-accent);
    font-size: 0.84rem;
}

.toast-content {
    min-width: 0;
}

.toast-title {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 800;
    color: #000000;
}

.toast-message {
    margin: 0.22rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    color: #000000;
}

.toast-close {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.toast-close:hover,
.toast-close:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: color-mix(in srgb, var(--toast-accent) 72%, #ffffff);
    transform-origin: left center;
    animation: toast-progress var(--toast-duration) linear forwards;
}

.toast.is-paused .toast-progress {
    animation-play-state: paused;
}

.toast.is-leaving {
    animation: toast-leave 220ms ease forwards;
}

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

@keyframes toast-leave {
    to {
        opacity: 0;
        transform: translateX(18px) scale(0.98);
    }
}

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

@media (max-width: 640px) {
    .toast-root {
        top: 0.9rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}