/* QFI Terminal -- EQ_CHECKS module (Alt+4 RESEARCH > FUNDAMENTALS, "Research
   quality check" panels), shown here as ONE stage slide with two card bands:
   VALUATION / PAST PERFORMANCE / FINANCIAL HEALTH / FUTURE GROWTH / DIVIDENDS
   on top, and CAPITAL ALLOCATION / EARNINGS QUALITY / SOLVENCY SCORE /
   ALTMAN Z-SCORE / PIOTROSKI F-SCORE below.
   Ported from terminal/assets/css/components.css:
     - RSX "flat" skin tokens (~65190-65290) -- amber uppercase section
       headers (--flat-h), no-box cards
     - .sws-checks / .sws-check / .sws-card-score (~28120-28200) -- the
       green/amber/red score badge (kept as .score-badge / .score-great/ok/poor)
     - .fx-chip / .fx-hist (~50335-50356) -- zone chip + the shared 15-year
       history strip, here used as a small sparkline
     - .rsx-tip (~44839-44869) -- the floating hover tooltip
   All selectors scoped under .qm-eqchecks. Background transparent. */

.qm-eqchecks {
    --flat-h: #e88a2d;
    --rx-txt: #e2e6ec;
    --rx-mut: #808c9b;
    --rx-mut2: #aab4c1;
    --rx-red: #e05252;
    --rx-green: #2ebd59;
    --rx-amber: #f59e0b;
    --rx-chip: rgba(255, 255, 255, 0.055);
    --rx-hair: rgba(255, 255, 255, 0.09);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: var(--rx-txt);
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.qm-eqchecks .mono { font-family: 'JetBrains Mono', 'Consolas', monospace; }
.qm-eqchecks h3, .qm-eqchecks h4 {
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--flat-h);
    margin: 0;
}

/* Score pill -- a tinted capsule: subtle fill in the status colour, a thin
   1px border in a slightly stronger tint of the same hue, and a hairline
   inner highlight (no glow, no heavy shadow). Colours are the terminal's
   own tokens (theme.css --green:#00FF00 / --red:#FF3333 / --orange:#FF9900),
   used at full strength only on the numerator, the dots/bar and the zone
   word. JetBrains Mono, tabular numerals throughout. A tiny progress track
   sits under the number: dots for a /6 or /9 score, a thin fill bar for
   the /100 Solvency Score, or (Altman only) a small-caps zone word instead
   of segments. It counts up and fills in step (see countUpIn/paintTrack in
   module.js); html.still jumps straight to the end state. */
.qm-eqchecks .score-pill {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 3px 9px; border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    flex: none; box-sizing: border-box;
}
.qm-eqchecks .pill-num { white-space: nowrap; line-height: 1; }
.qm-eqchecks .pill-num .eqs-cu {
    font-family: 'JetBrains Mono', monospace; font-size: 15.5px; font-weight: 800;
    letter-spacing: 0.2px; font-variant-numeric: tabular-nums; color: var(--tint-fg);
}
.qm-eqchecks .pill-num small {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    font-variant-numeric: tabular-nums; color: var(--rx-mut2); opacity: 0.62; margin-left: 1px;
}
.qm-eqchecks .pill-pfx {
    font-family: 'JetBrains Mono', monospace; font-style: normal; font-size: 11px; font-weight: 700;
    color: var(--tint-fg); opacity: 0.8; margin-right: 3px;
}
/* dots (/6, /9) and the /100 fill bar are decorative, not text -- kept small;
   the zone word (Altman) IS text, so it gets its own row height at the 11px
   legibility floor instead of the 5px dot/bar track height */
.qm-eqchecks .pill-track { display: flex; align-items: center; justify-content: center; gap: 2.5px; height: 5px; }
.qm-eqchecks .pill-dots .pd { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.14); flex: none; transition: background .18s ease; }
.qm-eqchecks .pill-dots .pd.on { background: var(--tint-fg); }
.qm-eqchecks .pill-bar { width: 34px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.qm-eqchecks .pill-bar-fill { display: block; height: 100%; width: 0%; background: var(--tint-fg); border-radius: 2px; }
.qm-eqchecks .pill-track.pill-zone { height: auto; }
.qm-eqchecks .pill-zone { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--tint-fg); opacity: 0.92; line-height: 1; }
/* the zone-word pill (Altman) trims its padding/gap to offset the taller
   11px text row, keeping it close to the other pills' overall height */
.qm-eqchecks .pill-z { padding-top: 2px; padding-bottom: 2px; gap: 1px; }

/* status tones -- terminal green/red/amber, tinted down for fill+border,
   full strength on the numerator, dots/bar and zone word */
.qm-eqchecks .pill-green { --tint-fg: #00FF00; background: rgba(0,255,0,0.10); border: 1px solid rgba(0,255,0,0.32); }
.qm-eqchecks .pill-amber { --tint-fg: #FF9900; background: rgba(255,153,0,0.13); border: 1px solid rgba(255,153,0,0.38); }
.qm-eqchecks .pill-red   { --tint-fg: #FF3333; background: rgba(255,51,51,0.12); border: 1px solid rgba(255,51,51,0.38); }
.qm-eqchecks .pill-grey  { --tint-fg: var(--rx-mut2); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); }

/* entrance / idle animation primitive */
.qm-eqchecks .arev { opacity: 0; transform: translateY(10px); transition: opacity .65s ease var(--d,0ms), transform .75s cubic-bezier(.16,1,.3,1) var(--d,0ms); }
.qm-eqchecks .arev.go { opacity: 1; transform: none; }

/* compact check row: check/cross + short title (ellipsis) + optional mono value.
   The full title and its explanation only appear in the hover tooltip. */
.qm-eqchecks .eqs-chks { display: flex; flex-direction: column; gap: 1px; }
.qm-eqchecks .eqs-chk {
    position: relative; isolation: isolate;
    display: flex; align-items: center; gap: 8px; padding: 0; border-radius: 5px;
    line-height: 1.18; cursor: default;
    opacity: 0; transform: translateX(-7px);
    transition: opacity .55s ease, transform .72s cubic-bezier(.16,1,.3,1);
    transition-delay: calc(100ms + var(--row-i, 0) * 70ms);
}
.qm-eqchecks .eqs-card.go .eqs-chk { opacity: 1; transform: none; }
.qm-eqchecks .eqs-chk > * { position: relative; z-index: 1; }
.qm-eqchecks .eqs-chk.fail::before {
    content: ""; position: absolute; z-index: 0;
    inset: -2px -7px; border-radius: 5px;
    border-left: 2px solid rgba(255, 67, 67, .9);
    background: linear-gradient(90deg, rgba(224,82,82,.24), rgba(224,82,82,.10) 72%, rgba(224,82,82,.025));
    opacity: 0; transform: scaleX(0); transform-origin: left center;
    transition: transform .8s cubic-bezier(.16,1,.3,1), opacity .6s ease;
    transition-delay: calc(var(--fail-i, 0) * 125ms);
}
.qm-eqchecks .eqs-chk .i { width: 14px; flex: none; text-align: center; font-weight: 900; font-size: 13.5px; }
.qm-eqchecks .eqs-chk.pass .i { color: var(--rx-green); }
.qm-eqchecks .eqs-chk.fail .i { color: var(--rx-red); }
.qm-eqchecks .eqs-chk .lb { min-width: 0; flex: 1 1 auto; font-size: 14.25px; font-weight: 600; letter-spacing: -0.015em; color: var(--rx-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-eqchecks .eqs-chk .vv { flex: none; margin-left: auto; padding-left: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 700; color: var(--rx-mut2); }

/* zone chip (Altman / Piotroski reading) -- reuses the terminal's fx-chip look */
.qm-eqchecks .fx-chip { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: 0.3px; padding: 3px 8px; border-radius: 5px; background: var(--rx-chip); color: var(--rx-mut2); text-transform: uppercase; margin-bottom: 8px; }
.qm-eqchecks .fx-chip.green { background: rgba(46,189,89,0.16); color: #6fd693; }
.qm-eqchecks .fx-chip.amber { background: rgba(245,158,11,0.16); color: #f3b45c; }
.qm-eqchecks .fx-chip.red   { background: rgba(224,82,82,0.16); color: #ec8c8c; }

/* shared 15-year history strip, used here as a small sparkline */
.qm-eqchecks .fx-hist svg { width: 100%; display: block; cursor: default; }
.qm-eqchecks .fx-hist rect { transition: opacity .15s; }
.qm-eqchecks .fx-hist rect:hover { opacity: 0.72; }

/* floating hover tooltip (ported .rsx-tip) */
.qm-eqchecks-tip {
    position: fixed; z-index: 9999;
    background: #10151c; border: 1px solid #2d3644; color: #e8edf3;
    font-family: 'Lato', 'Segoe UI', system-ui, sans-serif; font-size: 12px;
    padding: 7px 10px; border-radius: 8px; pointer-events: none;
    display: none; max-width: 260px; line-height: 1.45;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.qm-eqchecks-tip .t-h { font-weight: 800; margin-bottom: 2px; }

/* =========================================================================
   Stage slide: two bands, five equal cards each, vertically centred in
   whatever height the slide's box gives the module (see scenes.js "eq-checks-a").
   ========================================================================= */
.rs-stage[data-el="eq_checks.stage"] { background: transparent; box-shadow: none; border-radius: 0; }
.qm-eqchecks-stage .eqs-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, 165px); align-content: center; height: 100%; gap: 14px; }
.qm-eqchecks-stage .eqs-row { display: contents; }

.qm-eqchecks-stage .eqs-card {
    min-width: 0; min-height: 0; display: flex; flex-direction: column;
    padding: 9px 14px; border-radius: 8px;
    background: rgba(148,163,184,0.05);
    box-shadow: inset 0 0 0 1px var(--rx-hair);
}
.qm-eqchecks-stage .eqs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.qm-eqchecks-stage .eqs-card-head h4 { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.qm-eqchecks-stage .eqs-note { font-size: 10px; color: var(--rx-mut); line-height: 1.42; margin: 0 0 8px; }
.qm-eqchecks-stage .eqs-spark { margin-top: auto; }

/* step 2: highlight the failing checks -- dim passes and safe/strong zone
   cards, let the fails (and grey/distress or weak zones) keep full contrast */
.qm-eqchecks-stage.eqs-fails .eqs-chk.pass { opacity: 0.3; transition-delay: 0ms; }
.qm-eqchecks-stage.eqs-fails .eqs-chk.fail::before { opacity: 1; transform: scaleX(1); }
.qm-eqchecks-stage.eqs-fails .eqs-zonecard.tone-green { opacity: 0.35; }
