/* Momentum Portfolio stays visually aligned with Sahaba Field but owns no Field styles or behavior. */
.momentum-portfolio-card {
    border-color: rgba(168, 85, 247, 0.34);
}

.momentum-portfolio-card:hover {
    border-color: rgba(192, 132, 252, 0.72);
    box-shadow: 0 12px 32px rgba(126, 34, 206, 0.15);
}

.momentum-freshness-note {
    line-height: 1.55;
}

.momentum-quarter-opacity {
    opacity: calc(1 / 4);
}

.momentum-quarter-border {
    --tw-border-opacity: calc(1 / 4) !important;
}

.momentum-quarter-background {
    --tw-bg-opacity: calc(1 / 4) !important;
}

.momentum-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.momentum-table-scroll table {
    min-width: 640px;
}

.momentum-history-svg {
    display: block;
    width: 100%;
    height: 150px;
}

.momentum-simulation h4 svg {
    color: rgb(251 191 36);
}

.momentum-tooltip-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.momentum-tooltip-trigger {
    width: 21px;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(196, 181, 253, 0.42);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: rgba(221, 214, 254, 0.92);
    cursor: help;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.momentum-portfolio-card > .momentum-tooltip-shell {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 6;
}

.momentum-tooltip-trigger:hover,
.momentum-tooltip-trigger:focus-visible,
.momentum-tooltip-trigger[aria-expanded="true"] {
    border-color: rgba(221, 214, 254, 0.88);
    background: rgba(139, 92, 246, 0.28);
    color: #ffffff;
    outline: none;
}

.momentum-tooltip-panel {
    display: none;
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.55rem);
    right: 0;
    width: min(20rem, calc(100vw - 2rem));
    max-height: min(21rem, calc(100vh - 2rem));
    overflow-y: auto;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(196, 181, 253, 0.38);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.46);
    color: #cbd5e1;
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.momentum-tooltip-panel.momentum-tooltip-above {
    top: auto;
    bottom: calc(100% + 0.55rem);
    transform: translateY(4px);
}

.momentum-tooltip-shell.momentum-tooltip-open .momentum-tooltip-panel {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.momentum-tooltip-title,
.momentum-tooltip-description {
    display: block;
}

.momentum-tooltip-title {
    margin-bottom: 0.35rem;
    color: #ddd6fe;
    font-size: 0.8rem;
    font-weight: 700;
}

.momentum-tooltip-description {
    color: #cbd5e1;
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .momentum-drawer-panel {
        max-width: none;
    }

    .momentum-tooltip-panel {
        width: min(19rem, calc(100vw - 2rem));
    }

    .momentum-simulation .momentum-tooltip-shell {
        display: contents;
    }

    .momentum-simulation .momentum-tooltip-panel {
        display: none;
        position: static;
        flex: 0 0 100%;
        width: 100%;
        max-height: none;
        margin-top: 0.25rem;
    }

    .momentum-simulation .momentum-tooltip-shell.momentum-tooltip-open .momentum-tooltip-panel {
        display: block;
    }
}