// Specs strip — economic scope (top row) + cited clinical-issue evidence (lower rows)

const SPECS_TOP = [
  { num: "300K", unit: "/ year", label: "U.S. cardiac surgeries on bypass", refIdx: 1,
    note: "Stable annual volume reported by the Society of Thoracic Surgeons Adult Cardiac Surgery Database, which captures over 95% of U.S. adult cardiac surgery." },
  { num: "20\u201330", unit: "%", label: "develop acute kidney injury", refIdx: 2,
    note: "Cardiac-surgery-associated AKI occurs in 20\u201330% of patients and is independently associated with substantial increases in long-term mortality." },
  { num: "$1B+", unit: "/ year", label: "U.S. incremental cost of CSA-AKI", refIdx: 3,
    note: "Estimated $1.01 billion in additional annual U.S. hospitalization cost. A 10% reduction in incidence would yield approximately $100M in annual savings." },
  { num: "Fluid", unit: "overload", label: "predicts mortality after AKI", refIdx: 4,
    note: "In critically ill patients with AKI, cumulative positive fluid balance was independently associated with mortality and impaired recovery of kidney function." }
];

const SPECS_MID = [
  { num: "\u226516", unit: "%", label: "fluid overload, post-op day 3", refIdx: 5,
    note: "In a 435-neonate cohort, fluid overload \u226516% on POD 3 was an independent predictor of death, RRT, or ECLS, and was tied to cardiac arrest, prolonged ICU stay, and chest reexploration." },
  { num: "K\u207a", unit: "rises", label: "from cardioplegia, PRBCs, hemolysis", refIdx: 6,
    note: "Cardioplegia, transfused PRBCs, hemolysis, tissue damage, and acidosis all push systemic potassium upward during CPB. \u201cThis solution eventually mixes in with the systemic circulation, contributing to elevated systemic potassium levels.\u201d" },
  { num: "0.9", unit: "% NaCl", label: "is neither normal nor physiological", refIdx: 7,
    note: "Saline-based priming and infusion are linked to hyperchloremic acidosis, hyperkalemia, intestinal edema, impaired inotropic response, and acute kidney injury." },
  { num: "100", unit: "%", label: "arrhythmia rate weaning under hyperkalemia", refIdx: 8,
    note: "In a porcine hypothermic CPB model, induced hyperkalemia (K\u207a 6.5 \u00b1 1.0) before separation produced universal arrhythmias and a significant venous pH decline during weaning. \u201cHyperkalemia resulted in the generation of severe arrhythmias in all animals.\u201d" }
];

const SPECS_BOT = [
  { num: "4.6\u00d7", unit: "OR", label: "long mechanical ventilation when fluid balance >3000 mL", refIdx: 9,
    note: "In 130 on-pump CABG adults, cumulative fluid balance >3000 mL predicted long mechanical ventilation (OR 4.6, 95% CI 1.9\u201311.5), ICU stay >3 days (OR 3.2), and prolonged hospital stay (OR 5.2). \u201cFluid balance > 3000 mL was the predictor of long mechanical ventilation.\u201d" },
  { num: "CPB", unit: "time", label: "predicts adverse outcomes in cardiac surgery", refIdx: 10,
    note: "Longer cardiopulmonary bypass time is an independent predictor of mortality, renal failure, prolonged ventilation, and length of stay across cardiac procedures." },
  { num: "+", unit: "balance", label: "associated with mortality in acute lung injury", refIdx: 11,
    note: "Cumulative positive fluid balance is independently associated with worse outcomes and increased mortality in patients with acute lung injury." },
  { num: "3–8×", unit: "mortality", label: "associated with cardiac-surgery AKI", refIdx: 12,
    note: "Cardiac-surgery\u2013associated AKI is independently associated with a three- to eight-fold increase in mortality, with risk persisting long after the index hospitalization." }
];

const REFS = [
  { n: 1, cite: "STS Adult Cardiac Surgery Database, 2024 Update",
    id: "Society of Thoracic Surgeons",
    url: "https://www.sts.org/registries/sts-national-database/adult-cardiac-surgery-database" },
  { n: 2, cite: "Thakar CV, et al. Acute kidney injury after cardiac surgery: incidence, risk factors, and outcomes. CJASN, 2005. \u00b7 Hobson CE, et al. Acute kidney injury is associated with increased long-term mortality after cardiothoracic surgery. Circulation, 2009.",
    id: "PubMed",
    url: "https://pubmed.ncbi.nlm.nih.gov/?term=Hobson+acute+kidney+injury+long-term+mortality+cardiothoracic+surgery+2009" },
  { n: 3, cite: "Hobson C, Ruchi R, Bihorac A, et al. Financial impact of acute kidney injury after cardiac operations in the United States. Ann Thorac Surg 2018;105(2):408\u2013414.",
    id: "PMID 28760467",
    url: "https://pubmed.ncbi.nlm.nih.gov/28760467/" },
  { n: 4, cite: "Bouchard J, et al. Fluid accumulation, survival and recovery of kidney function in critically ill patients with AKI. Kidney International, 2009.",
    id: "PMID 19129826",
    url: "https://pubmed.ncbi.nlm.nih.gov/19129826/" },
  { n: 5, cite: "Wilder NS, et al. Pediatr Crit Care Med 2016",
    id: "PMID 27028790",
    url: "https://pubmed.ncbi.nlm.nih.gov/27028790/" },
  { n: 6, cite: "Heath M, et al. J Extra Corpor Technol 2014",
    id: "PMID 26357794",
    url: "https://pubmed.ncbi.nlm.nih.gov/26357794/" },
  { n: 7, cite: "Li H, et al. 0.9% saline is neither normal nor physiological. J Zhejiang Univ Sci B 2016",
    id: "PMID 26984838",
    url: "https://pubmed.ncbi.nlm.nih.gov/26984838/" },
  { n: 8, cite: "Stammers AH, et al. J Extra Corpor Technol 2003",
    id: "PMID 14979424",
    url: "https://pubmed.ncbi.nlm.nih.gov/14979424/" },
  { n: 9, cite: "Shahidi Delshad E, et al. Iran J Kidney Dis 2020",
    id: "PMID 32156840",
    url: "https://pubmed.ncbi.nlm.nih.gov/32156840/" },
  { n: 10, cite: "Stamou SC, et al. Cardiopulmonary bypass time as a predictor of outcomes in cardiac surgery. Ann Thorac Surg, 2011.",
    id: "PubMed",
    url: "https://pubmed.ncbi.nlm.nih.gov/?term=Stamou+cardiopulmonary+bypass+time+predictor+outcomes" },
  { n: 11, cite: "Rosenberg AL, et al. Association of cumulative fluid balance on outcome in acute lung injury. Crit Care Med, 2009.",
    id: "PubMed",
    url: "https://pubmed.ncbi.nlm.nih.gov/?term=Rosenberg+cumulative+fluid+balance+acute+lung+injury+2009" },
  { n: 12, cite: "Rosner MH, Okusa MD. Acute kidney injury associated with cardiac surgery. CJASN, 2006. \u00b7 Hobson CE, et al. Circulation 2009. \u00b7 Thakar CV, et al. CJASN 2005.",
    id: "" }
];

function SpecCard({ s }) {
  return (
    <div className="spec">
      <div className="spec__num">
        {s.num}<span className="unit">{s.unit}</span>
        {s.refIdx && <sup className="spec__ref">{s.refIdx}</sup>}
      </div>
      <div className="spec__label">{s.label}</div>
      <div className="spec__note">{s.note}</div>
    </div>
  );
}

function Specs() {
  return (
    <section className="section section--tight">
      <div className="wrap">
        <div className="section-head" style={{ marginBottom: 32 }}>
          <div className="section-head__label">
            <span className="eyebrow">
              <span className="dot" aria-hidden="true"></span>
              <span className="num">04</span>
              <span>By the numbers</span>
            </span>
          </div>
          <div>
            <h2 className="h2 section-head__title">
              The clinical and economic burden of dilution-based management is <em>substantial.</em>
            </h2>
          </div>
        </div>

        <div className="specs">
          {SPECS_TOP.map((s, i) => <SpecCard key={i} s={s}/>)}
        </div>

        <div className="specs-divider" aria-hidden="true">
          <span>From the literature</span>
        </div>

        <div className="specs">
          {SPECS_MID.map((s, i) => <SpecCard key={i} s={s}/>)}
        </div>

        <div className="specs" style={{ marginTop: 16 }}>
          {SPECS_BOT.map((s, i) => <SpecCard key={i} s={s}/>)}
        </div>

        <ol className="specs-refs">
          {REFS.map(r => (
            <li key={r.n}>
              <span className="specs-refs__n">{r.n}</span>
              <span className="specs-refs__cite">{r.cite}</span>
              {r.id && <span className="specs-refs__id">{r.id}</span>}
            </li>
          ))}
        </ol>
      </div>
    </section>
  );
}

window.Specs = Specs;
