.action-toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1080;
    width: min(360px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.action-toast-host .action-toast {
    pointer-events: auto;
}

.action-toast {
    text-align: left;
    width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    column-gap: 0.65rem;
    border-radius: 14px;
    padding: 11px 13px;
    cursor: pointer;
    font: inherit;
    line-height: 1.35;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
    overflow: hidden;
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    will-change: transform, opacity;
}

.action-toast--enter {
    animation: action-toast-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.action-toast--exit {
    animation: action-toast-exit 0.24s cubic-bezier(0.4, 0, 0.8, 1) forwards;
    pointer-events: none;
}

@keyframes action-toast-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes action-toast-exit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .action-toast--enter,
    .action-toast--exit {
        animation: none;
    }
}

.action-toast:not(.action-toast--exit):hover {
    transform: translateY(-1px);
}

.action-toast:focus-visible {
    outline: 2px solid rgba(20, 130, 250, 0.6);
    outline-offset: 2px;
}

.action-toast__title {
    display: block;
    color: inherit;
    font-size: 0.93rem;
}

.action-toast__meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    opacity: 0.85;
}

.action-toast__icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    line-height: 1;
    margin-top: 0.05rem;
    flex-shrink: 0;
}

.action-toast__content {
    min-width: 0;
}

.action-toast__close {
    color: inherit;
    opacity: 0.65;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 6px;
    padding: 0 0.25rem;
    margin-top: -0.12rem;
}

.action-toast__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.45);
}

.action-toast__timer {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 0;
    height: 5px;
    border-radius: 999px;
    transform-origin: left center;
    animation: action-toast-timer linear forwards;
    animation-duration: var(--action-toast-hide-ms, 10000ms);
}

.action-toast:hover .action-toast__timer,
.action-toast:focus-visible .action-toast__timer,
.action-toast:focus-within .action-toast__timer {
    animation-play-state: paused;
}

@keyframes action-toast-timer {
    from {
        transform: scaleX(1);
        opacity: 0.9;
    }
    to {
        transform: scaleX(0);
        opacity: 0.45;
    }
}

/* Информационный */
.action-toast--info {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(
        135deg,
        rgba(241, 245, 249, 0.82) 0%,
        rgba(226, 232, 240, 0.88) 100%
    );
    color: #1e293b;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.action-toast--info:hover {
    box-shadow:
        0 14px 34px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.action-toast--info .action-toast__icon {
    color: #475569;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(100, 116, 139, 0.25);
}

.action-toast--info .action-toast__timer {
    background: rgba(51, 65, 85, 0.45);
}

/* Предупреждение */
.action-toast--warning {
    border: 1px solid rgba(217, 119, 6, 0.4);
    background: linear-gradient(
        135deg,
        rgba(254, 243, 199, 0.9) 0%,
        rgba(253, 230, 138, 0.92) 100%
    );
    color: #78350f;
    box-shadow:
        0 10px 30px rgba(180, 83, 9, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.action-toast--warning:hover {
    box-shadow:
        0 14px 34px rgba(180, 83, 9, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.action-toast--warning .action-toast__icon {
    color: #b45309;
    background: rgba(255, 251, 235, 0.85);
    border: 1px solid rgba(217, 119, 6, 0.35);
}

.action-toast--warning .action-toast__timer {
    background: rgba(180, 83, 9, 0.55);
}

/* Критическое */
.action-toast--critical {
    border: 1px solid rgba(220, 38, 38, 0.42);
    background: linear-gradient(
        135deg,
        rgba(254, 226, 226, 0.92) 0%,
        rgba(252, 165, 165, 0.9) 100%
    );
    color: #7f1d1d;
    box-shadow:
        0 10px 30px rgba(185, 28, 28, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.action-toast--critical:hover {
    box-shadow:
        0 14px 34px rgba(185, 28, 28, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.action-toast--critical .action-toast__icon {
    color: #b91c1c;
    background: rgba(255, 241, 242, 0.9);
    border: 1px solid rgba(220, 38, 38, 0.35);
}

.action-toast--critical .action-toast__timer {
    background: rgba(185, 28, 28, 0.6);
}
