
.toast-host {
    position: fixed;
    z-index: 99999;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.06);
    color: #0f172a;
    animation: toast-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
    position: relative;
}

.toast::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #64748b;
}

.toast.is-leaving {
    animation: toast-out 0.35s ease forwards;
}

.toast__ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 15px;
    background: #f1f5f9;
    color: #475569;
}

.toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast__text {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.55;
}

.toast__close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.toast__close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(148, 163, 184, 0.35);
    transform-origin: right center;
    animation: toast-bar linear forwards;
}

.toast--success::before { background: #22c55e; }
.toast--success .toast__ico { background: #ecfdf5; color: #16a34a; }
.toast--success .toast__bar { background: #22c55e; }

.toast--error::before { background: #ef4444; }
.toast--error .toast__ico { background: #fef2f2; color: #dc2626; }
.toast--error .toast__bar { background: #ef4444; }

.toast--warning::before { background: #f59e0b; }
.toast--warning .toast__ico { background: #fffbeb; color: #d97706; }
.toast--warning .toast__bar { background: #f59e0b; }

.toast--info::before { background: #3b82f6; }
.toast--info .toast__ico { background: #eff6ff; color: #2563eb; }
.toast--info .toast__bar { background: #3b82f6; }

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.94);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
        filter: blur(2px);
    }
}

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

body.theme-dark .toast {
    background: rgba(24, 24, 27, 0.92);
    border-color: rgba(63, 63, 70, 0.9);
    color: #f4f4f5;
}

body.theme-dark .toast__close:hover {
    background: #27272a;
    color: #e4e4e7;
}
