/* IVD Scanner — cash-intelligence visuals.
   Built on design-tokens.css. Aim: scannable density, semantic colour, no gradient noise. */

/* Glyph primer in the symbol cell — only renders when a signal fires.
   Inspired by Bloomberg ticker prefixes + Linear status badges. */
.ivd-glyphs {
    display: inline-flex;
    gap: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.ivd-glyph {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.4;
    font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
}

.ivd-glyph-rdd { /* red-day delivery */
    color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.ivd-glyph-smp { /* sticky-money pre-IVD */
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.ivd-glyph-hft { /* HFT cluster trap */
    color: #ea580c;
    background: rgba(234, 88, 12, 0.12);
    border: 1px solid rgba(234, 88, 12, 0.25);
}

.ivd-glyph-bcv { /* BC honoured by VWAP */
    color: #65a30d;
    background: rgba(101, 163, 13, 0.12);
    border: 1px solid rgba(101, 163, 13, 0.25);
}

/* Edge score pill — the master sort key */
.ivd-edge-pill {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 3px 10px;
    border-radius: 999px;
    min-width: 36px;
    text-align: center;
    letter-spacing: -0.2px;
}

/* Delivery percent pill */
.ivd-dv-pill {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 2px 7px;
    border-radius: 4px;
    min-width: 32px;
    text-align: right;
}

/* Counterparty mini-icon column */
.ivd-cp-icon {
    font-size: 14px;
    line-height: 1;
    cursor: help;
}

.ivd-cp-sticky { filter: drop-shadow(0 0 1px rgba(37, 99, 235, 0.3)); }
.ivd-cp-hft    { filter: grayscale(0.1); }
.ivd-cp-mixed  { filter: drop-shadow(0 0 1px rgba(245, 158, 11, 0.4)); }

/* Inline sparkline — 5-session DV% trend.
   Right-anchored, baseline-aligned, fixed 24px height. */
.ivd-spark {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    padding: 0 2px;
    cursor: help;
}

.ivd-spark-bar {
    display: inline-block;
    width: 4px;
    min-height: 2px;
    border-radius: 1px 1px 0 0;
    transition: height 0.15s ease-out;
}

/* Sticky-money pre-IVD card (above the table) */
.ivd-sticky-card {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.02) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-left: 3px solid #2563eb;
    border-radius: var(--radius-md, 8px);
}

.ivd-sticky-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.ivd-sticky-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ivd-sticky-card-explainer {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 4px 0 0 1.5rem;
}

.ivd-sticky-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ivd-sticky-tile {
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm, 4px);
    font-size: var(--text-xs);
}

.ivd-sticky-tile a {
    font-weight: 600;
    color: var(--accent-primary, #3b82f6);
    text-decoration: none;
}

.ivd-sticky-tile-meta {
    display: block;
    color: var(--text-muted);
    margin-top: 2px;
    font-size: 11px;
}

/* Sticky-money chronology badges — three states, distinct hues so the trader can scan the
   whole grid and instantly see the mix of leading vs confirming flows. */
.ivd-sticky-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.3px;
    cursor: help;
}

/* No IVD yet — pure leading indicator. Bright green to signal opportunity. */
.ivd-sticky-lead {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.14);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

/* Pre-IVD lead, IVD subsequently confirmed — mid green, "→ IVD". */
.ivd-sticky-confirmed {
    color: #15803d;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Post-IVD add — MF chasing into a confirmed setup. Blue, "+ IVD". */
.ivd-sticky-postadd {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

/* Mobile breakpoint — collapse to symbol/edge/DV%/status only */
@media (max-width: 720px) {
    .ivd-spark { display: none; }
    .ivd-glyphs { display: none; }
}
