/* BlueChipGarage — insights components (assets/insights.js).
 *
 * Builds on style.css's tokens and never redefines them; every var() carries
 * a fallback so this file renders even if the token names move.
 *
 * Chart colour rules (see insights.js header):
 *  - one series = the brand accent; reference lines are muted grey;
 *  - the Good Buy Range is a diverging scale, green (cheap) → amber (dear).
 *    Great/good and fair/over sit close together under protanopia (validator
 *    ΔE 6.2 — the legal floor only WITH secondary encoding), so every band is
 *    also named on the bar, in the legend and in the verdict chip;
 *  - text never wears a series colour.
 */

.ins {
    --ins-accent: var(--accent, #66a9fc);
    --ins-ink: var(--ink, #eef3fb);
    --ins-ink-2: var(--ink-2, #b9c4d6);
    --ins-muted: var(--muted, #8595ad);
    --ins-surface: var(--surface-1, #0f1622);
    --ins-surface-2: var(--surface-2, #17202f);
    --ins-grid: var(--line-soft, #1b2536);
    --ins-line: var(--line, #263450);
    --ins-great: #4ade80;
    --ins-good: #2a8f5c;
    --ins-fair: #a8742a;
    --ins-over: #f59e0b;
    display: grid; gap: var(--s-5, 24px); margin-bottom: var(--s-5, 24px);
}
.ins .card + .card { margin-top: 0; }   /* the grid gap spaces them */

.ins-cards {
    display: grid; gap: var(--s-5, 24px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.ins-card { min-width: 0; }
.ins-head { margin-bottom: var(--s-4, 16px); }
.ins-eyebrow { margin: 0 0 8px; display: inline-flex; align-items: center; gap: 6px; }
/* Section titles speak in the site's display voice: Archivo pushed wide. */
.ins-title { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 750;
             font-stretch: 118%; letter-spacing: -.024em; line-height: 1.1; text-wrap: balance; }
.ins-sub { margin: 6px 0 0; max-width: 70ch; }
.ins-subhead { margin: 22px 0 4px; font-size: 1rem; }
.ins-method { margin: 14px 0 0; max-width: 90ch; line-height: 1.5; }
.ins-method strong { color: var(--ins-ink-2); }
.ins-block { display: block; margin-top: 4px; }
.ins-refusal { margin: 0; }

/* ------------------------------------------------------------------ stats */

/* The same ruled figure strip as style.css's .figure-row: cells ruled by
 * their own left/top borders, clipped at the edge, figures in the mono. */
.ins-stats {
    display: grid; margin-bottom: var(--s-4, 16px);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--ins-line); border-radius: var(--radius, 14px); overflow: hidden;
    background: var(--ins-surface-2);
}
.ins-stat {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 16px; min-width: 0;
    border-left: 1px solid var(--ins-line); border-top: 1px solid var(--ins-line);
    margin: -1px 0 0 -1px;
    container-type: inline-size;
}
.ins-stat-label {
    font-family: var(--mono, monospace); font-size: .66rem; letter-spacing: .12em;
    text-transform: uppercase; color: var(--ins-muted); font-weight: 500;
}
.ins-stat-value { font-family: var(--mono, monospace); font-weight: 600; letter-spacing: -.02em;
                  font-size: min(1.35rem, 14cqi); line-height: 1.15; color: var(--ins-ink);
                  font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-stat-sub { font-size: .78rem; color: var(--ins-muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chart */

.ins-plot { position: relative; width: 100%; margin: 4px 0 6px; }
.ins-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ins-svg text { font-family: var(--mono, monospace); }
.ins-axis { fill: var(--ins-muted); font-size: 11px; }
.ins-label { fill: var(--ins-ink-2); font-size: 11.5px; }
.ins-strong { fill: var(--ins-ink); font-weight: 600; }
.ins-faint { font-size: 10px; opacity: .8; }

line.ins-grid { stroke: var(--ins-grid); stroke-width: 1; }
.ins-zero { stroke: var(--ins-line); stroke-width: 1; }
.ins-col { fill: var(--ins-accent); }
.ins-col-partial { fill-opacity: .4; }
.ins-col-strong { fill: var(--ins-ink-2); }
.ins-line { fill: none; stroke: var(--ins-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ins-area { fill: var(--ins-accent); fill-opacity: .12; }
.ins-dot { fill: var(--ins-accent); stroke: var(--ins-surface); stroke-width: 1; }
.ins-median-dot { fill: var(--ins-ink-2); stroke: var(--ins-surface); stroke-width: 2; }
.ins-whisker { stroke: var(--ins-ink-2); stroke-width: 1.5; }
.ins-ref { stroke: var(--ins-muted); stroke-width: 1; }
.ins-ref-line { fill: none; stroke: var(--ins-muted); stroke-width: 1.5; stroke-opacity: .7; }
.ins-hair { stroke: var(--ins-muted); stroke-width: 1; }
.ins-focus { fill: none; stroke: var(--ins-ink); stroke-width: 2; }
.ins-pin { stroke: var(--ins-ink); stroke-width: 2; }
.ins-pin-dot { fill: var(--ins-ink); stroke: var(--ins-surface); stroke-width: 2; }
.ins-pin-ring { fill: none; stroke: var(--ins-ink); stroke-width: 2; }
.ins-ceiling { stroke: var(--ins-great); stroke-width: 2; }
.ins-hit { fill: transparent; cursor: crosshair; outline: none; }
.ins-hit:focus-visible { stroke: var(--ins-accent); stroke-width: 1; }
.ins-range-outer { stroke: var(--ins-accent); stroke-opacity: .45; stroke-width: 2; stroke-linecap: round; }
.ins-range-inner { stroke: var(--ins-accent); stroke-width: 6; stroke-linecap: round; }

.ins-tip {
    position: absolute; z-index: 5; pointer-events: none;
    min-width: 120px; max-width: 220px; padding: 7px 10px;
    background: var(--ins-surface-2); border: 1px solid var(--ins-line);
    border-radius: var(--radius-sm, 10px); box-shadow: 0 10px 28px rgba(2, 5, 12, .5);
    font-size: .78rem; transform: translateY(-100%);
}
.ins-tip-row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.ins-tip-row strong { font-family: var(--mono, monospace); color: var(--ins-ink); white-space: nowrap; }
.ins-tip-row span { color: var(--ins-muted); text-align: right; }

.ins-table { margin-top: 10px; font-size: .85rem; }
.ins-table summary, .comps-more summary {
    cursor: pointer; color: var(--ins-accent); font-size: .82rem; width: fit-content;
    font-family: var(--mono, monospace); letter-spacing: .02em;
}
.ins-table summary:hover, .comps-more summary:hover { text-decoration: underline; }
.ins-table table { margin-top: 8px; }

/* -------------------------------------------------------- Good Buy Range */

.ins-band { stroke: none; }
.ins-band-great { fill: var(--ins-great); background: var(--ins-great); }
.ins-band-good  { fill: var(--ins-good);  background: var(--ins-good); }
.ins-band-fair  { fill: var(--ins-fair);  background: var(--ins-fair); }
.ins-band-over  { fill: var(--ins-over);  background: var(--ins-over); }
.ins-range-legend {
    display: grid; gap: 6px 14px; margin: 6px 0 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.ins-range-key { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.ins-range-key .mono { margin-left: auto; font-size: .8rem; }
.ins-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
/* The verdict chip follows the status-pill grammar: a near-opaque chip, a
 * mark, and the band named in its own colour — never a filled slab. */
.ins-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px;
    border-radius: 999px; border: 1px solid currentColor;
    font-family: var(--mono, monospace); font-size: .74rem; font-weight: 600;
    background: rgba(10, 15, 25, .86) !important; vertical-align: 1px;
}
.ins-chip::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.ins-chip.ins-band-great { color: #4ade80; }
.ins-chip.ins-band-good  { color: #7fd6a4; }
.ins-chip.ins-band-fair  { color: #e2b56b; }
.ins-chip.ins-band-over  { color: #fbbf24; }
.ins-verdict { margin: 4px 0 10px; color: var(--ins-ink-2); }
.ins-ceiling-line { margin: 10px 0 6px; padding-left: 10px; border-left: 2px solid var(--ins-great); }
.ins-mileage { gap: 8px; align-items: center; margin-bottom: 8px; }
.ins-teaser-shape { opacity: .55; }

/* ----------------------------------------------------- sell-through split */

.ins-split {
    display: flex; gap: 2px; height: 14px; margin: 4px 0 6px;
    border-radius: 4px; overflow: hidden;
}
.ins-split-sold { background: var(--ins-accent); fill: var(--ins-accent); }
.ins-split-unsold { background: var(--ins-line); fill: var(--ins-line); flex: 1; }
span.ins-split-sold { display: block; }
.ins-split-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ins-muted); margin-bottom: 6px; }
.ins-split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ins-split-legend .ins-swatch { width: 10px; height: 10px; }
.ins-key-line, .ins-key-thin, .ins-key-thick {
    display: inline-block; width: 16px; height: 2px; background: var(--ins-accent); border-radius: 2px;
}
.ins-key-thick { height: 6px; }
.ins-key-thin { opacity: .45; }
.ins-key-area { background: var(--ins-accent); opacity: .3; }
.ins-key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ins-ink-2); }
.ins-key-pin { background: var(--ins-ink); }

/* --------------------------------------------------------- BlueChip Score */

.ins-score { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ins-score > div { flex: 1 1 260px; }
.ins-gauge { width: 132px; height: 132px; flex: none; }
.ins-gauge-track { fill: none; stroke: var(--ins-surface-2); stroke-width: 12; }
.ins-gauge-fill { fill: none; stroke: var(--ins-accent); stroke-width: 12; stroke-linecap: round; }
.ins-score-bluechip, .ins-score-strong { stroke: var(--good, #4ade80); }
.ins-score-fair { stroke: var(--ins-accent); }
.ins-score-weak { stroke: var(--warn, #fbbf24); }
.ins-score-poor { stroke: var(--crit, #fb7185); }
.ins-gauge-num { fill: var(--ins-ink); font-size: 34px; font-weight: 600; font-family: var(--mono, monospace); }
.ins-score-band { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 760; font-stretch: 118%;
                  letter-spacing: -.025em; line-height: 1.05; margin: 0 0 8px; color: var(--ins-ink); }
.ins-parts { display: grid; gap: 12px 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ins-part { display: flex; flex-direction: column; gap: 4px; }
.ins-part-head { display: flex; gap: 8px; align-items: baseline; }
.ins-part-head > :first-child { margin-right: auto; }
.ins-meter { height: 8px; border-radius: 4px; background: var(--ins-surface-2); overflow: hidden; }
.ins-meter span { display: block; height: 100%; border-radius: 4px; background: var(--ins-accent); }

/* ------------------------------------------------------------- comp set */

.ins-comps td:first-child { min-width: 240px; }
.ins-steps { margin: 0; padding-left: 20px; line-height: 1.6; color: var(--ins-ink-2); }
.ins-steps li + li { margin-top: 6px; }

/* --------------------------------------------------------------- index */

.ins-multiples {
    display: grid; gap: 14px; margin-top: 8px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.ins-multiple {
    padding: 14px; border: 1px solid var(--ins-grid); border-radius: var(--radius-sm, 10px);
    background: var(--ins-surface-2); min-width: 0;
}
.ins-locked-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; color: var(--ins-ink-2); }

/* -------------------------------------------------------------- teaser */

/* The locked research desk. It has to read as a product worth paying for:
 * a lit panel, a big plain promise, and each perk drawn as the shape of the
 * chart a member gets (generic shapes, labelled illustrative — no numbers). */
.ins-teaser {
    position: relative; overflow: hidden;
    padding: clamp(22px, 3.2vw, 34px);
    border-color: rgba(102, 169, 252, .3); border-radius: var(--radius-lg, 20px);
    background:
        radial-gradient(70% 55% at 0% 0%, rgba(102, 169, 252, .14), transparent 65%),
        radial-gradient(60% 50% at 100% 100%, rgba(74, 222, 128, .06), transparent 60%),
        var(--surface-1, #0f1622);
    box-shadow: var(--edge), 0 18px 48px rgba(2, 5, 12, .45);
}
.ins-teaser .ins-head { max-width: 62ch; margin-bottom: var(--s-5, 24px); }
.ins-teaser .ins-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.05; }
.ins-teaser .ins-sub { font-size: .98rem; color: var(--ins-ink-2); }
.ins-teaser .ins-eyebrow { color: var(--ins-accent); }
.ins-lock { display: inline-flex; color: var(--ins-accent); }
.ins-perks {
    display: grid; gap: 12px; margin-bottom: var(--s-4, 16px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.ins-perk {
    display: flex; flex-direction: column; gap: 6px;
    padding: 14px 16px 16px; border-radius: var(--radius, 14px);
    background: linear-gradient(180deg, rgba(196, 216, 245, .04), rgba(196, 216, 245, 0)), rgba(23, 32, 47, .72);
    border: 1px solid var(--ins-line);
}
.ins-perk strong { font-size: 1rem; font-weight: 680; color: var(--ins-ink); }
.ins-perk .small { line-height: 1.5; }
.ins-silhouette { width: 100%; height: 52px; margin-bottom: 6px; opacity: .7; }
.ins-teaser .btn-primary { padding: 12px 22px; font-size: 1rem; }

@media (max-width: 620px) {
    .ins-stat-value { font-size: 1.12rem; }
    .ins-score { justify-content: center; }
}
@media (forced-colors: active) {
    .ins-band, .ins-col, .ins-dot { forced-color-adjust: none; }
}
