/*
 * DisCanVis dashboard tokens — the one visual language of the AI Chat Evidence pane and
 * of every page it embeds (docs/aichat/VISUAL_REVIEW.md).
 *
 * Loaded by the chat and, in their chat-frame mode, by the Summary overview / table
 * embeds, the VI embed and the Browse PPI page. A page in that mode puts `dcv-frame` on
 * <html>: it then drops its own outer padding and card frames (the pane provides them)
 * and draws its tables in the shared table style.
 *
 * Colour rule: the brand red is for navigation and the active state only. What a
 * finding *means* — pathogenic, benign, uncertain, context, nothing — has its own
 * semantic colour, the Variant Interpretation ledger's.
 */
:root {
    /* the type, spacing and radius scale moved to discanvis-theme.css (page shell, 2026-11-16) */
    --dcv-border: var(--bs-border-color);
    --dcv-surface: var(--bs-body-bg);
    --dcv-surface-muted: var(--bs-tertiary-bg);
    --dcv-ink: var(--bs-emphasis-color);
    --dcv-ink-muted: var(--bs-secondary-color);
    --dcv-brand: var(--bs-primary);
    /* counts are information, not alerts */
    --dcv-count-bg: var(--dcv-chart-ink);
    --dcv-count-fg: var(--bs-body-bg);
    /* meaning: the VI evidence ledger's signal fills (variant_interpretation.html
       .vi-ledger-signal--damaging / --benign / --uncertain), which are Summary's
       ClinVar colours — pathogenic red, benign light blue, uncertain grey. */
    --dcv-pathogenic: #fff;              --dcv-pathogenic-bg: color-mix(in srgb, var(--dcv-type-sig-pathogenic) 72%, transparent);
    --dcv-benign: #0f172a;               --dcv-benign-bg: color-mix(in srgb, var(--dcv-type-sig-benign) 95%, transparent);
    --dcv-uncertain: var(--bs-body-color); --dcv-uncertain-bg: var(--bs-secondary-bg);
    --dcv-context: var(--dcv-badge-pdb);             --dcv-context-bg: var(--bs-tertiary-bg);
}
/* the count pill is the chart ink on the page surface, so it inverts with the theme on its own */

/* ---------------------------------------------------------------- primitives */
.dcv-label { font-size: var(--dcv-fs-label); font-weight: var(--dcv-fw-label); color: var(--dcv-ink-muted); text-transform: none; letter-spacing: 0; }
.dcv-card { border: 1px solid var(--dcv-border); border-radius: var(--dcv-radius); background: var(--dcv-surface); padding: var(--dcv-s3) var(--dcv-s4); }
.dcv-pill { display: inline-flex; align-items: center; gap: var(--dcv-s1); height: 1.375rem; padding: 0 var(--dcv-s2);
    border-radius: var(--dcv-radius-pill); font-size: var(--dcv-fs-label); font-weight: 600; line-height: 1;
    background: var(--dcv-surface-muted); color: var(--dcv-ink); border: 1px solid var(--dcv-border); }
.dcv-count { background: var(--dcv-count-bg) !important; color: var(--dcv-count-fg) !important; }

/* The page type (.dcv-title, .dcv-kicker) moved to discanvis-theme.css with the page shell. */

/* ---------------------------------------------------------------- frame mode */
html.dcv-frame, html.dcv-frame body { background: var(--dcv-surface); }
/* An embedded page is as tall as its content, never as tall as its frame. Pages laid
   out to fill the window (`h-100`, a `flex-grow-1` main) otherwise grow with every
   resize the embedder makes — the frame grows, the page fills it, the frame grows. */
html.dcv-frame, html.dcv-frame body, html.dcv-frame.h-100, html.dcv-frame body.h-100 {
    height: auto !important; min-height: 0 !important;
}
html.dcv-frame body > main { flex-grow: 0 !important; }
html.dcv-frame body { font-size: var(--dcv-fs-body); }

/* One table language: the shared Tables section of discanvis-theme.css (`html.dcv-frame` and `.dcv-tables`
   are its two scopes; the VI ledger is a `dcv-rtable` reading table). */

/* Embedded pages drop their own outer frame; the pane already draws one. */
html.dcv-frame .vi-report-card,
html.dcv-frame .ppi-card { box-shadow: none !important; border-radius: var(--dcv-radius) !important; }
html.dcv-frame .ppi-insight-card { border-radius: var(--dcv-radius); padding: var(--dcv-s3) var(--dcv-s4); }
html.dcv-frame .ppi-insight-label { font-size: var(--dcv-fs-label); text-transform: none; letter-spacing: 0; }
html.dcv-frame .ppi-insight-value { color: var(--dcv-ink); font-size: var(--dcv-fs-headline); }
html.dcv-frame .vi-report-section-header h2 { font-size: var(--dcv-fs-value); }
/* Wide reading tables scroll inside their own box instead of being clipped. */
html.dcv-frame #vi-analysis-header-card { min-width: 0; overflow-x: auto; }
html.dcv-frame #vi-evidence-ledger-root { max-width: 100%; }

/* Thin scrollbars inside embedded pages too. */
html.dcv-frame, html.dcv-frame * { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
html.dcv-frame ::-webkit-scrollbar { width: 6px; height: 6px; }
html.dcv-frame ::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); border-radius: 999px; }
