.vks-flash {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    pointer-events: none;
    scrollbar-width: thin;
}

.vks-flash__item {
    --vks-flash-accent: #6546d6;
    --vks-flash-accent-bg: #eee9ff;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 16px 14px;
    border: 1px solid #e5e3f2;
    border-left: 4px solid var(--vks-flash-accent);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(22, 20, 57, 0.16);
    color: #191b39;
    font: 400 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
    pointer-events: auto;
    animation: vks-flash-enter 0.24s ease-out both;
}

.vks-flash__item--success {
    --vks-flash-accent: #238a55;
    --vks-flash-accent-bg: #e4f7ec;
}

.vks-flash__item--error {
    --vks-flash-accent: #d73f55;
    --vks-flash-accent-bg: #ffebef;
}

.vks-flash__item--warning {
    --vks-flash-accent: #bb801d;
    --vks-flash-accent-bg: #fff3d9;
}

.vks-flash__item--info {
    --vks-flash-accent: #6043ce;
    --vks-flash-accent-bg: #eee9ff;
}

.vks-flash__icon {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--vks-flash-accent-bg);
    color: var(--vks-flash-accent);
    font-size: 20px;
    font-weight: 800;
}

.vks-flash__body {
    flex: 1;
    min-width: 0;
}

.vks-flash__title {
    display: block;
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.vks-flash__message {
    color: #505572;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    max-height: 40vh;
    overflow-y: auto;
}

.vks-flash__close {
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #686b83;
    font: 24px/1 system-ui, sans-serif;
    cursor: pointer;
}

.vks-flash__close:hover,
.vks-flash__close:focus-visible {
    background: #f1effa;
    color: #202348;
}

.vks-flash__item.is-closing {
    animation: vks-flash-exit 0.2s ease-in both;
}

@keyframes vks-flash-enter {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes vks-flash-exit {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@media (max-width: 575px) {
    .vks-flash {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px;
        left: 10px;
        width: auto;
    }

    .vks-flash__item {
        padding: 13px 11px;
        gap: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vks-flash__item,
    .vks-flash__item.is-closing {
        animation-duration: 0.01ms;
    }
}
