/* QFI Terminal -- FORECAST module (the REVENUE forecast chart of Alt+4 »
   RESEARCH » EARNINGS), for the landing's RESEARCH STORY.
   Ported from terminal/assets/css/components.css:
     - .rsx .afc-head / .afc-head h4 / .afc-head-f (~L51588-51593)
     - .rsx .tag (RSX DESIGN SYSTEM, ~L44224)
     - .rsx svg .afd / svg.go .afd (~L44739) -- the per-node fade with --d delay
     - .rsx-tip (~L44956) -- the shared tooltip
   Colours resolved from theme.css (--accent-primary #FF9900, --text-*) and the
   rx palette in ResearchComponent.js _rxC(). All selectors under .qm-forecast
   (the tooltip lives on body, so it carries its own prefixed class). */

.qm-forecast {
    --rx-txt: #e2e6ec;
    --rx-mut: #8b96a5;
    --rx-mut2: #b8c0cc;
    --flat-h: #e88a2d;
    --flat-fill: rgba(255, 255, 255, .05);
    --flat-hair: rgba(255, 255, 255, .075);
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 2px;
    font-family: 'Lato', 'Inter', system-ui, sans-serif;
    color: var(--rx-txt);
    background: transparent;
    display: flex;
    flex-direction: column;
}
.qm-forecast *, .qm-forecast *::before, .qm-forecast *::after { box-sizing: border-box; }

.qm-forecast .afc-head {
    display: flex;
    flex: 0 0 64px;
    height: 64px;
    min-height: 64px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px;
    margin: 0 0 4px;
    line-height: 1;
}
.qm-forecast .afc-head h4 {
    margin: 0;
    font-size: 15.5px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--flat-h);
}
.qm-forecast .afc-head-f {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14.5px;
    line-height: 1;
    color: var(--rx-mut2);
}
.qm-forecast .afc-head-f i { font-style: normal; color: var(--rx-mut); padding: 0 2px; }
.qm-forecast .afc-head .tag {
    margin-left: auto;
    padding: 0 0 0 14px;
    border: 0;
    border-left: 1px solid var(--flat-hair);
    border-radius: 0;
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--rx-mut2);
    text-transform: uppercase;
    white-space: nowrap;
}
.qm-forecast .afc-chart { width: 100%; flex: 1 1 0; min-height: 0; }
.qm-forecast .afc-chart svg { width: 100%; height: 100%; display: block; overflow: visible; font-family: 'JetBrains Mono', monospace; }
.qm-forecast .afc-note {
    flex: 0 0 16px;
    height: 16px;
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 16px;
    color: var(--rx-mut);
    white-space: nowrap;
}

/* the entrance: every node marked .afd fades in after its own --d, once the
   svg is given .go; idle() replays it by taking .go off and putting it back */
.qm-forecast svg .afd { opacity: 0; transition: opacity .55s ease var(--d, 0ms); }
.qm-forecast svg.go .afd { opacity: 1; }
.qm-forecast svg .bar { cursor: crosshair; transition: opacity .55s ease var(--d, 0ms), filter .15s ease; }
.qm-forecast svg.go .bar:hover { filter: brightness(1.28); }

@media (prefers-reduced-motion: reduce) {
    .qm-forecast svg .afd, .qm-forecast svg .bar { transition: none; opacity: 1; }
}

/* the tooltip (from .rsx-tip) */
.qm-forecast-tip {
    position: fixed;
    z-index: 9999;
    display: none;
    pointer-events: none;
    max-width: 280px;
    padding: 8px 10px;
    border: 1px solid #2d3644;
    border-radius: 4px;
    background: #161c25;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
    font-family: 'Lato', 'Inter', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.45;
    color: #cdd5e0;
}
.qm-forecast-tip .t-h { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #8b96a5; margin-bottom: 3px; }
.qm-forecast-tip b { color: #e2e6ec; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.qm-forecast-tip .t-m { color: #8b96a5; }
