.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0;
    padding: 2px 3px;
    border-radius: var(--r-sm);
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.grade-badge.grade-aplus {
    background: rgba(240, 185, 11, 0.18);
    color: var(--brand);
    border: 1px solid rgba(240, 185, 11, 0.45);
}
.grade-badge.grade-a {
    background: rgba(14, 203, 129, 0.15);
    color: var(--positive);
    border: 1px solid rgba(14, 203, 129, 0.4);
}
.grade-badge.grade-b {
    background: rgba(45, 127, 249, 0.15);
    color: var(--brand-secondary);
    border: 1px solid rgba(45, 127, 249, 0.4);
}
.grade-badge.grade-watch {
    background: rgba(132, 142, 156, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(132, 142, 156, 0.35);
}
html.light .grade-badge.grade-aplus {
    background: rgba(201, 148, 0, 0.16);
    color: #9e7000;
    border-color: rgba(201, 148, 0, 0.45);
}
html.light .grade-badge.grade-a {
    background: rgba(3, 166, 109, 0.13);
    color: #03a66d;
    border-color: rgba(3, 166, 109, 0.4);
}
html.light .grade-badge.grade-b {
    background: rgba(30, 111, 235, 0.12);
    color: #1e6feb;
    border-color: rgba(30, 111, 235, 0.4);
}
html.light .grade-badge.grade-watch {
    background: rgba(71, 77, 87, 0.1);
    color: #474d57;
    border-color: rgba(71, 77, 87, 0.3);
}

.qscore-row-ticker {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
    overflow: hidden;
}
.qscore-row-ticker .mono {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Trigger star — yellow + glow when active (matches prototype) */
.trigger-star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 14px;
    color: var(--brand);
    font-size: 11px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(240, 185, 11, 0.55);
}
.trigger-star.empty {
    color: var(--text-disabled);
    text-shadow: none;
    opacity: 0.3;
}

/* Trigger pill — Base Breakout / Volume Surge */
.trigger-pill {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: var(--r-sm);
    letter-spacing: 0.04em;
    line-height: 1;
}
.trigger-pill.trig-bb {
    background: rgba(14, 203, 129, 0.18);
    color: var(--positive);
}
.trigger-pill.trig-vs {
    background: rgba(240, 185, 11, 0.18);
    color: var(--brand);
}
html.light .trigger-pill.trig-bb {
    background: rgba(3, 166, 109, 0.14);
    color: #03a66d;
}
html.light .trigger-pill.trig-vs {
    background: rgba(201, 148, 0, 0.16);
    color: #9e7000;
}

/* Focus Newest — divider + locked rows */
.focus-fresh-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: var(--sp-3) 0 var(--sp-2) 0;
    padding: 0 var(--sp-2);
    font-size: var(--text-xs);
    color: var(--negative);
    font-weight: 600;
}
.focus-fresh-divider::before,
.focus-fresh-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--negative-rgb), 0.25),
        transparent
    );
}
.focus-fresh-divider strong {
    color: var(--negative);
    font-weight: 700;
}
.focus-fresh-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--negative);
    box-shadow: 0 0 0 0 rgba(var(--negative-rgb), 0.5);
    animation: focus-fresh-pulse 1.6s infinite;
    flex-shrink: 0;
}
@keyframes focus-fresh-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--negative-rgb), 0.6);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(var(--negative-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--negative-rgb), 0);
    }
}
.focus-fresh-lock {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--brand-dim);
    border: 1px solid rgba(var(--brand-rgb), 0.25);
    border-radius: var(--r-pill);
    font-size: 9px;
    color: var(--brand);
    font-weight: 700;
}

/* Rank micro-label — compact "#N" format under ticker, no horizontal collision */
.rank-mini {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-disabled);
    font-weight: 600;
    line-height: 1;
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    letter-spacing: 0;
}
.grade-badge.grade-aplus {
    background: rgba(240, 185, 11, 0.18);
    color: var(--brand);
    border: 1px solid rgba(240, 185, 11, 0.45);
}

.grade-badge.grade-a {
    background: rgba(14, 203, 129, 0.15);
    color: var(--positive);
    border: 1px solid rgba(14, 203, 129, 0.4);
}

.grade-badge.grade-b {
    background: rgba(45, 127, 249, 0.15);
    color: var(--brand-secondary);
    border: 1px solid rgba(45, 127, 249, 0.4);
}

.grade-badge.grade-watch {
    background: rgba(132, 142, 156, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(132, 142, 156, 0.35);
}

html.light .grade-badge.grade-aplus {
    background: rgba(201, 148, 0, 0.16);
    color: #9e7000;
    border-color: rgba(201, 148, 0, 0.45);
}
html.light .grade-badge.grade-a {
    background: rgba(3, 166, 109, 0.13);
    color: #03a66d;
    border-color: rgba(3, 166, 109, 0.4);
}
html.light .grade-badge.grade-b {
    background: rgba(30, 111, 235, 0.12);
    color: #1e6feb;
    border-color: rgba(30, 111, 235, 0.4);
}
html.light .grade-badge.grade-watch {
    background: rgba(71, 77, 87, 0.1);
    color: #474d57;
    border-color: rgba(71, 77, 87, 0.3);
}

/* Header strip — single row, no wrap */
.fc3 {
    cursor: pointer;
}
.fc3-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: 6px;
    min-width: 0;
}
.fc3-head-left {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    flex: 1;
}

/* Trigger + rank meta line — sits beneath header */
.fc3-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-disabled);
    margin-bottom: var(--sp-3);
    letter-spacing: 0.02em;
    gap: var(--sp-2);
}
.fc3-meta-line > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.fc3-meta-line .trigger-pill {
    flex-shrink: 0;
}

/* Metrics strip — 3 inline, separated by subtle dividers */
.fc3-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-2);
    padding: var(--sp-2) 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--sp-3);
}
.fc3-metric {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}
.fc3-metric-label {
    font-size: 9px;
    color: var(--text-disabled);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 3px;
    white-space: nowrap;
}
.fc3-metric-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc3-metric-value.ok {
    color: var(--positive);
}
.fc3-metric-value.bad {
    color: var(--negative);
}

/* Slim chart */
.fc3-chart {
    margin-bottom: var(--sp-3);
    opacity: 0.9;
}
.fc3-chart svg {
    height: 32px;
    width: 100%;
}

/* Tags area — flowing single block, no separate Positive/Risk/Negative labels.
   Color of each chip identifies its category — this is the professional approach
   used by most quant research products. Section header is just "Signal tags". */
.fc3-tags-head {
    font-size: 9px;
    color: var(--text-disabled);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.fc3-tags-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--sp-3);
}
.fc3-tags-flow .spec-tag {
    font-size: 9px;
    padding: 2px 7px;
}
.fc3-tags-empty {
    font-size: 10px;
    color: var(--text-disabled);
    font-style: italic;
}

/* Spec tag chips — positive_tags / risk_tags / negative_tags per spec §18.4-6.
   Positive = green tint, risk = gold tint, negative = red tint. */
.spec-tag {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    font-family: var(--font-display);
}
.spec-tag.pos {
    background: rgba(14, 203, 129, 0.13);
    color: var(--positive);
    border: 1px solid rgba(14, 203, 129, 0.28);
}
.spec-tag.risk {
    background: rgba(240, 185, 11, 0.13);
    color: var(--brand);
    border: 1px solid rgba(240, 185, 11, 0.28);
}
.spec-tag.neg {
    background: rgba(246, 70, 93, 0.13);
    color: var(--negative);
    border: 1px solid rgba(246, 70, 93, 0.28);
}

/* Color legend strip — explains what tag colors mean, super tiny */
.fc3-legend {
    display: flex;
    gap: 12px;
    font-size: 9px;
    color: var(--text-disabled);
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border-subtle);
}
.fc3-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fc3-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.fc3-legend-dot.pos {
    background: var(--positive);
}
.fc3-legend-dot.risk {
    background: var(--brand);
}
.fc3-legend-dot.neg {
    background: var(--negative);
}

/* Cooldown chip — inline within metrics column */
.fc3-cooldown {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 9px;
}
.fc3-cooldown.ok {
    color: var(--positive);
}
.fc3-cooldown.bad {
    color: var(--negative);
}
html.light .fc3-cooldown.ok {
    color: #03a66d;
}
html.light .fc3-cooldown.bad {
    color: #cf304a;
}

/* Disclaimer footer */
.fc3-disclaimer {
    font-size: 9px;
    color: var(--text-disabled);
    font-style: italic;
    line-height: 1.4;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border-subtle);
}

html.light .spec-tag.pos {
    background: rgba(3, 166, 109, 0.1);
    color: #03a66d;
    border-color: rgba(3, 166, 109, 0.28);
}
html.light .spec-tag.risk {
    background: rgba(201, 148, 0, 0.12);
    color: #9e7000;
    border-color: rgba(201, 148, 0, 0.3);
}
html.light .spec-tag.neg {
    background: rgba(207, 48, 74, 0.1);
    color: #cf304a;
    border-color: rgba(207, 48, 74, 0.28);
}
