/*
 * reports.css — State of Bitcoin Core MBR slides (1200 x 800, obsidian theme).
 * Brand colours come ONLY from palette.generated.css (SSOT: shared/media/palettes.py).
 * Chart series slots below are data-viz tokens (CVD-validated dark categorical steps).
 *
 * Everything is scoped to .report-theme / .report-slide so this file can be loaded on a
 * site page (reports.html) without restyling the Bitcoin Data Labs shell around it.
 */

.report-theme {
    /* Brand tokens (--bg-color, --accent-color, ...) come from palette.generated.css. */

    /* Categorical series (fixed order, never cycled); slot 9 = Other */
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    /* Upkeep areas (Tests & QA, Build & CI, Maintenance): muted slate steps */
    --series-upkeep-1: #6b7486;
    --series-upkeep-2: #545c6c;
    --series-upkeep-3: #434a57;
    --series-other: #30343d;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --radius: 10px;
}

.report-slide, .report-slide * { box-sizing: border-box; margin: 0; padding: 0; }

/* On reports.html the site's style.css also defines .card / .kpi-value / .kpi-label (uppercase,
   shadows, hover lift). Neutralise the properties the slide rules below don't set themselves, so
   the page matches the posted PNGs. (Only non-inherited props on `*`: resetting text-transform or
   letter-spacing there would break inheritance into child spans.) */
.report-slide * { box-shadow: none; transition: none; }
.report-slide .card:hover { box-shadow: none; }
.report-slide .kpi-label { text-transform: none; }

/* Text hierarchy: --text-strong for headlines & hero numbers, --text-color for body
   (fallback keeps older palettes without text_strong working). */
.report-theme {
    --text-strong-resolved: var(--text-strong, var(--text-color));
    /* The BDL shell forces `[data-theme="dark"] h1 { color: var(--text-primary) !important }`;
       re-pointing the token (instead of fighting !important) keeps report headings on our scale. */
    --text-primary: var(--text-strong-resolved);
}

/* Headless capture canvas (report-card.html) */
body.reports-body {
    margin: 0;
    background: var(--bg-color);
}

.report-slide {
    color: var(--text-color);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

.slides-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 32px 16px;
}

/* ---------- Slide frame ---------- */
.report-slide {
    position: relative;
    width: 1200px;
    height: 800px;
    flex: none;
    overflow: hidden;
    background:
        radial-gradient(900px 420px at 100% 0%, color-mix(in srgb, var(--accent-color) 7%, transparent), transparent 70%),
        var(--bg-color);
    border: 1px solid var(--card-border);
    padding: 34px 44px 0;
    display: flex;
    flex-direction: column;
}

.slide-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-text);
}
.slide-head .brand { color: var(--accent-color); }
.slide-head .month { color: var(--text-color); letter-spacing: 0.08em; }

.slide-title {
    margin-top: 10px;
    font-size: 27px;
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-strong-resolved);
    max-width: 1080px;
}
.slide-title.small { font-size: 23px; }
.slide-sub {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--muted-text);
}

.slide-body { flex: 1; min-height: 0; margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.slide-foot {
    height: 40px;
    flex: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    font-size: 11px;
    color: var(--dim-text);
    letter-spacing: 0.04em;
}
.slide-foot b { color: var(--muted-text); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    min-width: 0;
}
.card-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.card-label .meta { color: var(--dim-text); letter-spacing: 0.06em; font-weight: 600; }

.grid { display: grid; gap: 14px; min-height: 0; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.split-55-45 { grid-template-columns: 1.15fr 1fr; }
.fill { flex: 1; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted-text); }
.dim { color: var(--dim-text); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }

.chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--badge-bg);
    border: 1px solid var(--card-border);
    color: var(--muted-text);
    white-space: nowrap;
}
.chip.accent { color: var(--accent-color); border-color: color-mix(in srgb, var(--accent-color) 40%, transparent); }
.chip.delving { color: var(--series-1); }
.chip.ml { color: var(--series-4); }

/* ---------- Slide 1 ---------- */
.takeaway .card-label { margin-bottom: 6px; }
.takeaway p { font-size: 14px; line-height: 1.45; color: var(--text-color); }

.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted-text); letter-spacing: 0.02em; min-height: 28px; }
.kpi-value { font-family: var(--font-mono); font-size: 40px; font-weight: 700; line-height: 1; color: var(--text-strong-resolved); }
.kpi-value .unit { font-size: 20px; color: var(--muted-text); margin-left: 2px; }
.kpi-delta { font-size: 12.5px; font-weight: 700; font-family: var(--font-mono); }
.kpi-delta .dim { font-family: var(--font-sans); font-weight: 500; }
.kpi-sub { font-size: 11.5px; color: var(--muted-text); line-height: 1.35; }
.kpi svg { margin-top: auto; width: 100%; height: auto; }
.kpi-bench { font-size: 10.5px; color: var(--dim-text); }

/* ---------- Sparklines ---------- */
.spark-band { fill: var(--grid-color); }
.spark-line { fill: none; stroke: var(--accent-color); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--accent-color); stroke: var(--card-bg); stroke-width: 2; }
.spark-median { stroke: var(--dim-text); stroke-width: 1; stroke-dasharray: 2 3; }

/* ---------- Slide 2: scorecard ---------- */
.scorecard { width: 100%; border-collapse: collapse; font-size: 13px; }
.scorecard th {
    text-align: right;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim-text);
    padding: 0 10px 9px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
.scorecard th.l, .scorecard td.l { text-align: left; }
.scorecard td {
    text-align: right;
    padding: 11px 10px;
    border-bottom: 1px solid var(--grid-color);
    white-space: nowrap;
    vertical-align: middle;
}
.scorecard td.group { color: var(--accent-color); font-weight: 700; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.scorecard tr.group-start td { border-top: 1px solid var(--card-border); }
.scorecard td.metric { color: var(--text-color); font-weight: 500; }
.scorecard td.val { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text-color); }
.scorecard td.num { font-family: var(--font-mono); color: var(--muted-text); }
.scorecard td.num.pos { color: var(--positive); }
.scorecard td.num.neg { color: var(--negative); }
.scorecard td.spark { padding-top: 3px; padding-bottom: 3px; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim-text); }
.status.good { color: var(--positive); } .status.good::before { background: var(--positive); }
.status.bad { color: var(--negative); } .status.bad::before { background: var(--negative); }
.status.neutral { color: var(--muted-text); }
.status.watch { color: var(--accent-color); } .status.watch::before { background: var(--accent-color); }

/* ---------- Slide 3 ---------- */
.domain + .domain { margin-top: 12px; }
.domain-name { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-text); margin-bottom: 6px; }
.merge { padding: 9px 0; border-top: 1px solid var(--grid-color); }
.merge-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.merge-title .pr { font-family: var(--font-mono); color: var(--accent-color); font-weight: 700; margin-right: 6px; }
.merge-sum { font-size: 12.5px; color: var(--muted-text); line-height: 1.4; margin-top: 3px; }
.merge-meta { font-size: 11px; color: var(--dim-text); margin-top: 4px; }
.merge-meta b { color: var(--muted-text); font-weight: 600; }
.merge-meta .chip.impact { margin-right: 8px; font-size: 9.5px; padding: 1px 6px; vertical-align: 1px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--muted-text); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend b { color: var(--text-color); font-family: var(--font-mono); font-weight: 600; margin-left: 3px; }
.axis-label { fill: var(--dim-text); font-size: 10.5px; font-family: var(--font-sans); }
.axis-line { stroke: var(--card-border); }

/* ---------- Slide 4 ---------- */
.init { padding: 10px 0; border-top: 1px solid var(--grid-color); }
.init:first-of-type { border-top: 0; padding-top: 2px; }
.init-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.init-name { font-size: 15px; font-weight: 700; }
.init-name .dim { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; margin-left: 6px; }
.init-pct { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.init-meta { font-size: 11.5px; color: var(--muted-text); margin-top: 5px; }
.bar { height: 6px; border-radius: 3px; background: var(--grid-color); margin-top: 7px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent-color); }
.bar.done > span { background: color-mix(in srgb, var(--accent-color) 45%, var(--card-border)); }

.release-version { font-family: var(--font-mono); font-size: 46px; font-weight: 700; line-height: 1; color: var(--text-strong-resolved); }
.release-status { font-size: 15px; font-weight: 700; color: var(--accent-color); margin-top: 8px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-top: 1px solid var(--grid-color); }
.kv span:last-child { font-family: var(--font-mono); font-weight: 700; }
.list { list-style: none; }
.list li { font-size: 12.5px; line-height: 1.4; padding: 6px 0; border-top: 1px solid var(--grid-color); color: var(--text-color); }
.list li .pr { font-family: var(--font-mono); color: var(--accent-color); font-weight: 700; margin-right: 6px; }
.list li .dim { font-size: 11.5px; }
.sublabel { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-text); margin: 12px 0 2px; }

/* ---------- Slide 5 ---------- */
.hbar-row { display: grid; grid-template-columns: 210px 1fr 74px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.hbar-row .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row .who small { color: var(--dim-text); font-size: 11px; margin-left: 4px; }
.hbar { height: 10px; background: var(--grid-color); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar > span { display: block; height: 100%; background: var(--accent-color); border-radius: 0 4px 4px 0; }
.hbar-row .n { font-family: var(--font-mono); text-align: right; font-weight: 700; }
.hbar-row .n small { color: var(--dim-text); font-weight: 500; }
.note { font-size: 12px; line-height: 1.45; color: var(--muted-text); margin-top: 10px; }
.note b { color: var(--text-color); }

.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.funnel .stat { background: var(--badge-bg); border-radius: 8px; padding: 10px 12px; }
.funnel .stat .v { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--text-strong-resolved); }
.funnel .stat .k { font-size: 11px; color: var(--muted-text); margin-top: 2px; }
.names { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.names span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--badge-bg); color: var(--text-color); border: 1px solid var(--card-border); }

/* ---------- Slide 6 ---------- */
.heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.heat th { font-weight: 600; color: var(--dim-text); font-size: 10px; padding-bottom: 2px; }
.heat td.topic { color: var(--text-color); font-weight: 600; white-space: nowrap; padding-right: 8px; font-size: 12px; }
.heat td.cell { height: 21px; border-radius: 3px; text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--text-color); }
.heat td.cell.dark { color: var(--bg-color); font-weight: 700; }
.heat td.total { font-family: var(--font-mono); color: var(--muted-text); text-align: right; padding-left: 6px; }

.thread { padding: 8px 0; border-top: 1px solid var(--grid-color); }
.thread:first-of-type { border-top: 0; padding-top: 0; }
.thread-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-top: 4px; }
.thread-meta { font-size: 11px; color: var(--dim-text); margin-top: 3px; }
