/* company-compare.css — the shared stylesheet for the company-compare chart
   family (scripts/build-company-compare.mjs). One light card per figure; the
   dark override flips ONLY the Embed Contract canvas behind the card, the card
   and everything in it keep the one light design (2026-08 law). Bump the
   ?v= on every include when this file changes (/charts/* is cached 62 days). */
:root {
  --mv-bg: #F1F4F8;
  --mv-card: #FFFFFF;
  --mv-card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.04);
  --mv-text: #0F172A;
  --mv-text-sec: #475569;
  --mv-text-faint: #94A3B8;
  --mv-grid: rgba(15,23,42,0.07);
  --mv-track: rgba(15,23,42,0.05);
  --mv-footer-border: rgba(0,0,0,0.08);
  --mv-pill: rgba(15,23,42,0.05);
}
[data-theme="dark"] { --mv-bg: #001234; } /* theme-guardrail-allow: Embed Contract canvas pair, /charts/ embeds only */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-display, 'Source Sans 3', system-ui, sans-serif);
  background: var(--mv-bg);
  color: var(--mv-text);
  -webkit-font-smoothing: antialiased;
}
.outer { padding: 24px; display: flex; justify-content: center; }
.card {
  background: var(--mv-card);
  box-shadow: var(--mv-card-shadow);
  border-radius: 18px;
  padding: 28px 30px 18px;
  width: 100%;
  max-width: 1000px;
  min-width: 0; /* a flex item: lets a wide timeline scroll inside .dl-scroll instead of stretching the card past a phone screen */
}
.subtitle { font-size: 14px; color: var(--mv-text-sec); font-weight: 500; line-height: 1.4; }
.subtitle + .graphic, .subtitle + .chart-wrap { margin-top: 18px; }
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--mv-footer-border);
}
.source { font-size: 12px; color: var(--mv-text-faint); font-weight: 500; }
.logos { display: flex; align-items: center; gap: 16px; }
.dr-logo { display: block; height: 26px; width: auto; }
.dr-logo.is-dark { display: none; }

/* Company header strip: name (and Dealroom logo) in the company colour on
   either side, the left company always on the left. */
.cc-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.cc-co { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.cc-co.left { color: var(--left); }
.cc-co.right { color: var(--right); justify-content: flex-end; }
.cc-co img { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--mv-grid); background: #fff; }
.cc-vs { font-size: 12px; font-weight: 700; color: var(--mv-text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Scorecard butterfly ─────────────────────────────────────────── */
.bf-section {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mv-text-faint); text-align: center; margin: 18px 0 8px;
}
.bf-row { display: grid; grid-template-columns: 1fr 190px 1fr; align-items: center; gap: 0 12px; margin: 5px 0; }
.bf-l, .bf-r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bf-l { justify-content: flex-end; }
.bf-val { font-size: 14px; font-weight: 700; color: var(--mv-text); white-space: nowrap; min-width: 56px; }
.bf-l .bf-val { text-align: right; }
.bf-track { flex: 1; height: 22px; background: var(--mv-track); border-radius: 5px; display: flex; overflow: hidden; }
.bf-l .bf-track { justify-content: flex-end; }
.bf-bar { height: 100%; border-radius: 5px; }
.bf-l .bf-bar { background: var(--left); }
.bf-r .bf-bar { background: var(--right); }
.bf-l .bf-bar.neg { background: rgba(var(--left-rgb), 0.22); box-shadow: inset 0 0 0 1.5px var(--left); }
.bf-r .bf-bar.neg { background: rgba(var(--right-rgb), 0.22); box-shadow: inset 0 0 0 1.5px var(--right); }
.bf-label { font-size: 13px; color: var(--mv-text-sec); text-align: center; line-height: 1.25; }
.bf-label small { display: block; font-size: 11px; color: var(--mv-text-faint); margin-top: 1px; }

/* ── Pipeline ladder ─────────────────────────────────────────────── */
.pl { position: relative; }
.pl-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.pl-cols span { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mv-text-faint); line-height: 1.3; }
.pl-cols span small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--mv-text-faint); }
.pl-co { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--co); }
.pl-co.left { --co: var(--left); --rgb: var(--left-rgb); }
.pl-co.right { --co: var(--right); --rgb: var(--right-rgb); }
.pl-co-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pl-co-head img { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--mv-grid); background: #fff; }
.pl-co-head b { font-size: 17px; font-weight: 800; color: var(--co); }
.pl-co-head span { font-size: 13px; color: var(--mv-text-sec); }
.pl-r { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pl-r.pl-counts { padding: 2px 0 6px; }
.pl-count { font-size: 22px; font-weight: 800; color: var(--co); line-height: 1; }
.pl-count small { font-size: 11px; font-weight: 600; color: var(--mv-text-faint); margin-left: 4px; }
/* One therapeutic area = a label line above its row of pills, so the four
   phase columns run the full card width. */
.pl-area { padding: 8px 0 9px; border-top: 1px solid var(--mv-grid); }
.pl-area-name { font-size: 12px; font-weight: 700; color: var(--mv-text-sec); line-height: 1.3; margin-bottom: 6px; }
.pl-cell { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; min-width: 0; }
.pill:focus-visible { outline: 2px solid var(--co); outline-offset: 1px; }
/* Dark hover tooltip naming the programme and what it does (script in the chart). */
.pl-tip {
  position: absolute; z-index: 5; max-width: 280px; padding: 8px 10px; border-radius: 8px;
  background: #0F172A; color: #FFFFFF; font-size: 12px; line-height: 1.35; pointer-events: none;
  box-shadow: 0 6px 20px rgba(15,23,42,0.25);
}
.pl-tip b { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.pl-tip span { display: block; }
.pl-tip small { display: block; font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 3px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: 11.5px; font-weight: 600; line-height: 1.2; padding: 3px 8px; border-radius: 6px;
  background: rgba(var(--rgb), 0.10); color: var(--co); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill.is-approved { background: var(--co); color: #fff; }
.pill i { font-style: normal; font-size: 10px; font-weight: 700; opacity: 0.75; white-space: nowrap; }

/* ── Deal timelines (SVG) ─────────────────────────────────────────── */
.dl-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.dl-kpi { font-size: 13px; color: var(--mv-text-sec); }
.dl-kpi b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.dl-kpi.left b { color: var(--left); }
.dl-kpi.right { text-align: right; }
.dl-kpi.right b { color: var(--right); }
/* The timeline is drawn at 1000px; on a phone it scrolls sideways instead of
   shrinking its labels below legibility (same pattern as the Miro bubbles). */
.dl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dl-svg { width: 100%; height: auto; display: block; }
.dl-scroll-hint { display: none; font-size: 11.5px; color: var(--mv-text-faint); margin-top: 4px; }
.dl-svg text { font-family: var(--font-display, 'Source Sans 3', system-ui, sans-serif); }

/* ── Leadership ──────────────────────────────────────────────────── */
.ld { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.ld-col.left { --co: var(--left); --rgb: var(--left-rgb); }
.ld-col.right { --co: var(--right); --rgb: var(--right-rgb); }
.ld-co { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--co); }
.ld-co img { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--mv-grid); background: #fff; }
.ld-co b { font-size: 17px; font-weight: 800; color: var(--co); }
.ld-group-name {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mv-text-faint);
  margin: 16px 0 8px;
}
.ld-group-name span { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.ld ul { list-style: none; }
.ld li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.ld-photo {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--rgb), 0.12); color: var(--co); font-size: 12px; font-weight: 700;
}
.ld-photo img { width: 100%; height: 100%; display: block; }
.ld-text { min-width: 0; line-height: 1.25; }
.ld-text b { display: block; font-size: 14px; font-weight: 700; color: var(--mv-text); }
.ld-text small { display: block; font-size: 12px; color: var(--mv-text-sec); }

/* ── Funding rounds ──────────────────────────────────────────────── */
.fd { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.fd-col.left { --co: var(--left); --rgb: var(--left-rgb); }
.fd-col.right { --co: var(--right); --rgb: var(--right-rgb); }
.fd-co { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--co); }
.fd-co img { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--mv-grid); background: #fff; }
.fd-co b { font-size: 17px; font-weight: 800; color: var(--co); }
.fd-total { font-size: 13px; color: var(--mv-text-sec); margin: 10px 0 4px; }
.fd-total b { color: var(--mv-text); }
.fd ul { list-style: none; }
.fd li { padding: 7px 0; border-top: 1px solid var(--mv-grid); }
.fd-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.fd-meta b { font-weight: 700; color: var(--mv-text); }
.fd-meta span { color: var(--mv-text-faint); white-space: nowrap; }
.fd-track { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.fd-track .bar { height: 14px; border-radius: 4px; background: var(--co); min-width: 2px; }
.fd li.post .fd-track .bar { background: rgba(var(--rgb), 0.35); }
.fd-amt { font-size: 13px; font-weight: 700; white-space: nowrap; }
.fd-inv { display: block; font-size: 11.5px; color: var(--mv-text-sec); margin-top: 3px; line-height: 1.3; }
.fd li.ipo { background: rgba(var(--rgb), 0.06); border-radius: 8px; padding: 8px 10px; margin: 6px -10px; border-top: none; }
.fd li.ipo .fd-meta b { color: var(--co); }
.fd-divider { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mv-text-faint); margin: 12px 0 4px; }

@media (max-width: 720px) {
  .outer { padding: 12px; }
  .card { padding: 20px 16px 14px; }
  .cc-co { font-size: 15px; }
  .bf-row { grid-template-columns: 1fr 110px 1fr; gap: 0 8px; }
  .bf-val { font-size: 12.5px; min-width: 44px; }
  .bf-label { font-size: 11.5px; }
  .pl-cols, .pl-r { gap: 5px; }
  .pl-area-name { font-size: 11.5px; }
  .pill { font-size: 10.5px; padding: 2px 6px; white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .ld, .fd { grid-template-columns: 1fr; gap: 18px; }
  .dl-kpi b { font-size: 18px; }
  .dl-svg { min-width: 760px; }
  .dl-scroll-hint { display: block; }
}
