.app-flash-toast {
    width: min(680px, calc(100% - 32px));
    margin: 16px auto;
    padding: 13px 15px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.24);
}
.app-flash-toast.success {
    border-left-color: #22c55e;
}
.app-flash-toast.error,
.app-flash-toast.danger {
    border-left-color: #ef4444;
}
.app-flash-toast.warning {
    border-left-color: #f59e0b;
}
body.light-theme .app-flash-toast {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.app-toast-stack {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 100000;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    pointer-events: none;
}
.app-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left-width: 4px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.36);
    backdrop-filter: blur(18px);
    animation: appToastIn 0.28s ease both;
}
.app-toast::before {
    content: "i";
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}
.app-toast.success {
    border-left-color: #22c55e;
}
.app-toast.success::before {
    content: "OK";
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}
.app-toast.error {
    border-left-color: #ef4444;
}
.app-toast.error::before {
    content: "!";
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    font-size: 20px;
}
.app-toast.warning {
    border-left-color: #f59e0b;
}
.app-toast.warning::before {
    content: "!";
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    font-size: 20px;
}
.app-toast-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.app-toast-title {
    margin: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
}
.app-toast-text {
    margin: 0;
    color: rgba(226, 232, 240, 0.86);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.app-toast-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}
.app-toast-close:hover,
.app-toast-close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
    outline: none;
}
.app-toast.is-hiding {
    animation: appToastOut 0.22s ease both;
}
.app-toast-source-hidden {
    display: none !important;
}
body.light-theme .app-toast {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
}
body.light-theme .app-toast-text {
    color: #475569;
}
body.light-theme .app-toast-close {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}
body.light-theme .app-toast-close:hover,
body.light-theme .app-toast-close:focus-visible {
    background: rgba(15, 23, 42, 0.12);
}
@keyframes appToastIn {
    from {
        opacity: 0;
        transform: translate3d(16px, -8px, 0) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
@keyframes appToastOut {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(16px, -8px, 0) scale(0.98);
    }
}
@media (max-width: 560px) {
    .app-toast-stack {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
        left: 12px;
        width: auto;
    }
    .app-toast {
        grid-template-columns: 34px minmax(0, 1fr) 30px;
        gap: 10px;
        min-height: 64px;
        padding: 12px;
        border-radius: 12px;
    }
    .app-toast::before {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
}