:root {
    --toast-bg: #121212;
    --toast-fg: #eaeaea;
    --toast-ok: #22c55e;
    --toast-info: #60a5fa;
    --toast-warn: #f59e0b;
    --toast-err: #ef4444;
    --toast-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 165, 0, .06);
    --toast-radius: 18px;
}

.toast-host {
    position: fixed;
    inset: auto auto 24px 24px;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-host.tr {
    inset: 24px 24px auto auto;
    align-items: flex-end;
}

.toast-host.tl {
    inset: 24px auto auto 24px;
}

.toast-host.br {
    inset: auto 24px 24px auto;
    align-items: flex-end;
}

.toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns:auto 1fr auto;
    grid-template-rows:auto auto;
    column-gap: 12px;
    row-gap: 6px;
    width: clamp(260px, 32vw, 420px);
    background: linear-gradient(180deg, rgba(255, 165, 0, .06), transparent 40%), var(--toast-bg);
    color: var(--toast-fg);
    border: 1px solid rgba(255, 165, 0, .25);
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    filter: drop-shadow(0 0 12px rgba(255,122,0,0.35)); /* мягкое внешнее свечение */
    padding: 12px 12px 8px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.toast::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 32px rgba(255, 165, 0, .2) inset, 0 0 0 1px rgba(255, 165, 0, .08) inset;
    pointer-events: none;
}

.toast .ico {
    grid-row: 1/span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 2px;
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(255, 165, 0, .25);
}

.toast .ico img, .toast .ico svg {
    width: 18px;
    height: 18px;
    display: block;
}

.toast .title {
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.25;
    margin-top: 2px;
}

.toast .msg {
    opacity: .9;
    line-height: 1.35;
    font-size: .95rem;
}

.toast .actions {
    grid-column: 2/4;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.toast button {
    all: unset;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 165, 0, .35);
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
    user-select: none;
}

.toast button:hover {
    transform: translateY(-1px);
    background: rgba(255, 165, 0, .12);
}

.toast button:focus-visible {
    outline: 2px solid rgba(255, 165, 0, .55);
    outline-offset: 2px;
}

.toast .close {
    grid-row: 1;
    grid-column: 3;
    align-self: start;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    opacity: .8;
}

.toast .close:hover {
    opacity: 1;
}

.toast .bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), rgba(255, 165, 0, .4));
    transform-origin: left center;
    transform: scaleX(1);
}

.toast.success .ico {
    background: rgba(34, 197, 94, .15);
    border: 1px solid rgba(34, 197, 94, .5)
}

.toast.info .ico {
    background: rgba(96, 165, 250, .15);
    border: 1px solid rgba(96, 165, 250, .5)
}

.toast.warning .ico {
    background: rgba(245, 158, 11, .15);
    border: 1px solid rgba(245, 158, 11, .5)
}

.toast.error .ico {
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .5)
}

.toast.success {
    border-color: rgba(34, 197, 94, .35)
}

.toast.info {
    border-color: rgba(96, 165, 250, .35)
}

.toast.warning {
    border-color: rgba(245, 158, 11, .35)
}

.toast.error {
    border-color: rgba(239, 68, 68, .35)
}

@media (prefers-reduced-motion: no-preference) {
    .toast {
        animation: toast-in .18s ease-out both
    }

    @keyframes toast-in {
        from {
            transform: translateY(4px);
            opacity: 0
        }
        to {
            transform: translateY(0);
            opacity: 1
        }
    }
}