/* FinoFundHelp toast alerts — fixed upper-right, all viewports */
.ffh-toast-stack {
    position: fixed;
    top: 16px;
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 20000;
    width: min(400px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    font-family: "Montserrat", "Segoe UI", sans-serif;
}

.ffh-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 38px 16px 14px;
    overflow: hidden;
    color: #e7f3ff;
    background: linear-gradient(180deg, rgba(12, 32, 68, 0.96), rgba(7, 20, 46, 0.96));
    border: 1px solid rgba(120, 180, 255, 0.28);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: ffh-toast-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ffh-toast.ffh-toast-leave {
    animation: ffh-toast-out 0.22s ease forwards;
}

.ffh-toast-rail {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--ffh-accent, #38bdf8);
}

.ffh-toast-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin-top: 1px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--ffh-accent, #38bdf8);
    background: var(--ffh-accent-soft, rgba(56, 189, 248, 0.16));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ffh-toast-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ffh-toast-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.ffh-toast-title {
    margin: 0 0 2px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ffh-accent, #7dd3fc);
}

.ffh-toast-text {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.45;
    font-weight: 500;
    color: #f4f8ff;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.ffh-toast-stack .ffh-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9eb6d8;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.ffh-toast-close:hover,
.ffh-toast-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.ffh-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    transform-origin: left center;
    transform: scaleX(1);
    background: var(--ffh-accent, #38bdf8);
    opacity: 0.9;
}

.ffh-toast-success {
    --ffh-accent: #4ade80;
    --ffh-accent-soft: rgba(74, 222, 128, 0.16);
}

.ffh-toast-error {
    --ffh-accent: #fb7185;
    --ffh-accent-soft: rgba(251, 113, 133, 0.16);
}

.ffh-toast-warning {
    --ffh-accent: #fbbf24;
    --ffh-accent-soft: rgba(251, 191, 36, 0.16);
}

.ffh-toast-info {
    --ffh-accent: #38bdf8;
    --ffh-accent-soft: rgba(56, 189, 248, 0.16);
}

@keyframes ffh-toast-in {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes ffh-toast-out {
    to { opacity: 0; transform: translateX(18px); }
}

@media (max-width: 576px) {
    .ffh-toast-stack {
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        width: auto;
    }

    .ffh-toast {
        padding: 12px 36px 15px 12px;
        border-radius: 14px;
    }

    .ffh-toast-text {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ffh-toast,
    .ffh-toast.ffh-toast-leave {
        animation: none;
    }
}
