Cytokines health and disease ppt for pathology resident doctor

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Loading Image
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/cytokines-ppt && ls /home/daytona/workspace/

Writing File

~/cytokines-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "Cytokines: Health and Disease";
pres.author = "Pathology Resident Education";

// ============================================================
// COLOR PALETTE
// ============================================================
const C = {
  deepNavy:   "0D1B2A",  // dominant dark bg
  navy:       "1A2F4B",
  midBlue:    "1E4D8C",
  accent:     "00B4D8",  // cyan-teal accent
  accentGold: "F4A261",  // warm gold
  accentRed:  "E63946",  // alert red
  accentGreen:"2D9D78",  // healthy green
  white:      "FFFFFF",
  lightGrey:  "D6E4F0",
  textLight:  "B8D4EA",
  textDark:   "0D1B2A",
};

// ============================================================
// HELPERS
// ============================================================
function addTitle(slide, text, subtitle) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
  // Horizontal accent bar
  slide.addShape(pres.ShapeType.rect, { x:0, y:2.6, w:"100%", h:0.06, fill:{color:C.accent} });
  // Big title
  slide.addText(text, {
    x:0.7, y:0.9, w:11.9, h:1.4,
    fontSize:42, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle"
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x:0.7, y:2.8, w:11.9, h:0.8,
      fontSize:20, color:C.accent, fontFace:"Calibri",
      align:"center", valign:"middle", italic:true
    });
  }
}

function sectionHeader(slide, title, color) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:"100%", fill:{color:color||C.accent} });
  slide.addText(title, {
    x:0.5, y:2.2, w:12.3, h:1.4,
    fontSize:36, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle"
  });
}

function contentSlide(slide, title, bullets, opts={}) {
  const bgColor = opts.bg || C.navy;
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:bgColor} });
  // Top bar
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
  slide.addText(title, {
    x:0.3, y:0, w:12.7, h:0.7,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
    valign:"middle", margin:0
  });
  // Accent line
  slide.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

  // Bullets
  const items = bullets.map((b, i) => {
    const parts = [];
    if (b.heading) {
      parts.push({ text: b.heading + "  ", options:{ bold:true, color:C.accentGold, breakLine:false } });
    }
    parts.push({ text: b.text, options:{ color:C.lightGrey, breakLine: i < bullets.length-1 } });
    return parts;
  }).flat();

  slide.addText(items, {
    x:0.5, y:0.85, w:opts.w||12.3, h:opts.h||5.5,
    fontSize:opts.fs||17, fontFace:"Calibri",
    valign:"top", bullet:false, paraSpaceBefore:4, paraSpaceAfter:4, lineSpacingMultiple:1.2
  });
}

function twoCol(slide, title, leftItems, rightItems, leftLabel, rightLabel, lColor, rColor) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
  slide.addText(title, { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
  slide.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

  // Left column header
  slide.addShape(pres.ShapeType.rect, { x:0.3, y:0.85, w:5.9, h:0.45, fill:{color:lColor||C.midBlue}, line:{color:"000000",pt:0} });
  slide.addText(leftLabel, { x:0.3, y:0.85, w:5.9, h:0.45, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });
  // Right column header
  slide.addShape(pres.ShapeType.rect, { x:6.8, y:0.85, w:5.9, h:0.45, fill:{color:rColor||C.accentRed}, line:{color:"000000",pt:0} });
  slide.addText(rightLabel, { x:6.8, y:0.85, w:5.9, h:0.45, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });

  // Divider
  slide.addShape(pres.ShapeType.line, { x:6.65, y:0.85, w:0, h:5.6, line:{color:C.accent, pt:1.5} });

  const makeItems = (arr) => arr.map((b,i)=>[
    { text: (b.heading ? b.heading+"  " : ""), options:{bold:true,color:C.accentGold,breakLine:false} },
    { text: b.text, options:{color:C.lightGrey, breakLine: i<arr.length-1} }
  ]).flat();

  slide.addText(makeItems(leftItems),  { x:0.3, y:1.4, w:5.9, h:4.8, fontSize:15, fontFace:"Calibri", valign:"top", paraSpaceBefore:3, paraSpaceAfter:3 });
  slide.addText(makeItems(rightItems), { x:6.8, y:1.4, w:5.9, h:4.8, fontSize:15, fontFace:"Calibri", valign:"top", paraSpaceBefore:3, paraSpaceAfter:3 });
}

// ============================================================
// SLIDE 1: TITLE
// ============================================================
let s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.18, fill:{color:C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:7.32, w:"100%", h:0.18, fill:{color:C.accentGold} });
// decorative circles
s.addShape(pres.ShapeType.ellipse, { x:10.5, y:0.3, w:3, h:3, fill:{color:C.midBlue, transparency:75}, line:{color:"000000",pt:0} });
s.addShape(pres.ShapeType.ellipse, { x:-0.8, y:4.5, w:2.5, h:2.5, fill:{color:C.accentGold, transparency:80}, line:{color:"000000",pt:0} });
s.addText("CYTOKINES", {
  x:0.5, y:0.9, w:12.3, h:1.3,
  fontSize:54, bold:true, color:C.white, fontFace:"Calibri",
  align:"center", charSpacing:6
});
s.addText("Health and Disease", {
  x:0.5, y:2.1, w:12.3, h:0.75,
  fontSize:30, color:C.accent, fontFace:"Calibri",
  align:"center", italic:true
});
s.addShape(pres.ShapeType.rect, { x:3, y:3.0, w:7.3, h:0.05, fill:{color:C.accent} });
s.addText("A Comprehensive Overview for Pathology Residents", {
  x:0.5, y:3.2, w:12.3, h:0.55,
  fontSize:16, color:C.textLight, fontFace:"Calibri", align:"center"
});
s.addText([
  { text: "Sources: ", options:{bold:true, color:C.accentGold} },
  { text: "Henry's Clinical Diagnosis & Management  |  Cellular & Molecular Immunology  |  Schwartz's Surgery  |  Robbins Pathology", options:{color:C.textLight} }
], {
  x:0.5, y:6.7, w:12.3, h:0.4,
  fontSize:11, fontFace:"Calibri", align:"center"
});

// ============================================================
// SLIDE 2: OVERVIEW / AGENDA
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Lecture Outline", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const agenda = [
  ["01", "What Are Cytokines?", "Definition, history, key properties"],
  ["02", "Classification & Families", "Structural and functional groupings"],
  ["03", "Cytokine Receptors", "Five receptor superfamilies"],
  ["04", "JAK-STAT Signaling", "Central pathway and SOCS regulation"],
  ["05", "Cytokines in Innate Immunity", "Pro-inflammatory cascade"],
  ["06", "Cytokines in Adaptive Immunity", "Th1 / Th2 / Th17 / Treg balance"],
  ["07", "Cytokines in Disease", "Autoimmunity, cancer, sepsis"],
  ["08", "Cytokine Therapeutics", "Biologics, JAK inhibitors, clinical use"],
  ["09", "Cytokine Assays in the Lab", "ELISA, multiplex, clinical relevance"],
  ["10", "Key Takeaways", "High-yield review for pathology practice"],
];

const col1 = agenda.slice(0,5);
const col2 = agenda.slice(5);

col1.forEach((a, i) => {
  const yy = 0.95 + i*0.92;
  s.addShape(pres.ShapeType.rect, { x:0.3, y:yy, w:0.48, h:0.48, fill:{color:C.accent}, line:{color:"000000",pt:0} });
  s.addText(a[0], { x:0.3, y:yy, w:0.48, h:0.48, fontSize:13, bold:true, color:C.deepNavy, align:"center", valign:"middle" });
  s.addText(a[1], { x:0.9, y:yy-0.04, w:5.3, h:0.35, fontSize:15, bold:true, color:C.white, fontFace:"Calibri", valign:"bottom" });
  s.addText(a[2], { x:0.9, y:yy+0.28, w:5.3, h:0.3, fontSize:12, color:C.textLight, fontFace:"Calibri", valign:"top" });
});
col2.forEach((a, i) => {
  const yy = 0.95 + i*0.92;
  s.addShape(pres.ShapeType.rect, { x:6.8, y:yy, w:0.48, h:0.48, fill:{color:C.accentGold}, line:{color:"000000",pt:0} });
  s.addText(a[0], { x:6.8, y:yy, w:0.48, h:0.48, fontSize:13, bold:true, color:C.deepNavy, align:"center", valign:"middle" });
  s.addText(a[1], { x:7.4, y:yy-0.04, w:5.3, h:0.35, fontSize:15, bold:true, color:C.white, fontFace:"Calibri", valign:"bottom" });
  s.addText(a[2], { x:7.4, y:yy+0.28, w:5.3, h:0.3, fontSize:12, color:C.textLight, fontFace:"Calibri", valign:"top" });
});

// ============================================================
// SLIDE 3: WHAT ARE CYTOKINES?
// ============================================================
s = pres.addSlide();
contentSlide(s, "What Are Cytokines?", [
  { heading:"Definition:", text:"Small secreted proteins (8–80 kDa) that regulate cell-to-cell communication, immune activation, inflammation, hematopoiesis, and tissue repair" },
  { heading:"Term coined:", text:"Stanley Cohen, 1975 - to describe activities released by epithelial cells. Before this, lymphokines (from T cells) and monokines (from monocytes) were described separately" },
  { heading:"Key properties:", text:"Pleiotropism (one cytokine, multiple effects) | Redundancy (multiple cytokines, same effect) | Synergy & Antagonism | Active at pico- to femtomolar concentrations" },
  { heading:"Modes of action:", text:"Autocrine (acts on secreting cell) | Paracrine (acts on adjacent cells) | Endocrine (rare - systemic action)" },
  { heading:"Producer cells:", text:"T helper cells, macrophages, dendritic cells, NK cells, mast cells, epithelial cells, fibroblasts, vascular endothelium" },
  { heading:"Scope:", text:"Over 100 known members coordinating development, immunity, inflammation, metabolism, aging, and disease pathogenesis" },
]);

// ============================================================
// SLIDE 4: CLASSIFICATION
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Classification of Cytokines", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// 3x2 grid of boxes
const classBoxes = [
  { label:"Interleukins (ILs)", color:C.midBlue, note:"IL-1 to IL-38+\nMediate leukocyte-to-leukocyte signals\nSubfamilies: IL-1, IL-2, IL-6, IL-10, IL-12, IL-17 families" },
  { label:"Interferons (IFNs)", color:"295E8A", note:"Type I (IFN-α/β): antiviral, ISG induction\nType II (IFN-γ): macrophage activation, Th1\nType III (IFN-λ): mucosal antiviral" },
  { label:"TNF Family", color:"5C4A8A", note:"TNF-α, RANKL, FasL, TRAIL\nSurvival, differentiation, apoptosis, bone remodeling\nKey in inflammation and cancer" },
  { label:"Chemokines", color:"1A6B4A", note:"CXC (IL-8/CXCL8), CC (MCP-1), CX3C, XC\nDirected cell migration, leukocyte trafficking\n~50 members; bind to GPCR receptors" },
  { label:"Colony-Stimulating Factors", color:"6B4A1A", note:"G-CSF, GM-CSF, M-CSF, IL-3\nHematopoiesis, myeloid differentiation\nClinical use: post-chemotherapy neutrophilia" },
  { label:"Growth Factors & Others", color:"5A1A1A", note:"TGF-β, VEGF, FGF, EGF, PDGF\nAngiogenesis, fibrosis, tissue repair\nAdipokines: leptin, adiponectin (metabolic link)" },
];

classBoxes.forEach((b, i) => {
  const col = i % 3;
  const row = Math.floor(i / 3);
  const x = 0.25 + col * 4.35;
  const y = 0.9 + row * 3.05;
  s.addShape(pres.ShapeType.rect, { x, y, w:4.1, h:2.75, fill:{color:b.color}, line:{color:C.accent,pt:1} });
  s.addText(b.label, { x, y:y+0.08, w:4.1, h:0.5, fontSize:14, bold:true, color:C.accent, align:"center", fontFace:"Calibri" });
  s.addShape(pres.ShapeType.line, { x:x+0.2, y:y+0.58, w:3.7, h:0, line:{color:C.accent,pt:0.5} });
  s.addText(b.note, { x:x+0.1, y:y+0.65, w:3.9, h:1.9, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"top" });
});

// ============================================================
// SLIDE 5: CYTOKINE RECEPTORS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Receptors – Five Superfamilies", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const receptors = [
  { n:"1", name:"IL-1 / TIR Family", detail:"3 Ig-like domains; IL-1, IL-18, IL-33, IL-36 receptors; signals via MyD88 → NF-κB", color:C.accentRed },
  { n:"2", name:"TNF Receptor (TNFR) Superfamily", detail:"Cysteine-rich extracellular domain; 27 members; mediates apoptosis, survival, bone remodeling via TRAF adaptors", color:"E07B00" },
  { n:"3", name:"Class I (Haematopoietin) Receptors", detail:"WSXWS motif; share gp130, γc, or βc subunits; bind IL-2,4,6,7,12, EPO, G-CSF; signal via JAK-STAT", color:C.midBlue },
  { n:"4", name:"Class II (Interferon) Receptors", detail:"Bind IFN-α/β/γ and IL-10 family; signal via JAK1/TYK2-STAT1; induce ISG transcription", color:C.accentGreen },
  { n:"5", name:"Tyrosine Kinase Receptors (RTKs)", detail:"Intrinsic kinase domain; VEGFR, FGFR, PDGFR, SCF receptor; link to Ras-MAPK and PI3K pathways; mutated in cancers", color:"7B2D8B" },
];

receptors.forEach((r, i) => {
  const y = 0.9 + i*1.12;
  s.addShape(pres.ShapeType.rect, { x:0.2, y:y, w:0.5, h:0.55, fill:{color:r.color}, line:{color:"000000",pt:0} });
  s.addText(r.n, { x:0.2, y:y, w:0.5, h:0.55, fontSize:16, bold:true, color:C.white, align:"center", valign:"middle" });
  s.addText(r.name, { x:0.85, y:y, w:3.8, h:0.55, fontSize:14.5, bold:true, color:C.accentGold, fontFace:"Calibri", valign:"middle" });
  s.addText(r.detail, { x:4.8, y:y, w:8.3, h:0.55, fontSize:13, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  if (i<4) s.addShape(pres.ShapeType.line, { x:0.2, y:y+0.75, w:12.9, h:0, line:{color:C.accent,pt:0.4,transparency:60} });
});

s.addText("Note: Receptor structural homology drives functional redundancy — a key reason cytokine blockade requires targeting specific nodes", {
  x:0.3, y:6.6, w:12.7, h:0.55,
  fontSize:12, italic:true, color:C.accent, fontFace:"Calibri", align:"center"
});

// ============================================================
// SLIDE 6: JAK-STAT (with embedded diagram description)
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("JAK-STAT Signaling – The Central Hub", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Left: diagram placeholder (we'll embed via URL)
const jakStatUrl = "https://cdn.orris.care/cdss_images/1a301f9a0ebd75a75a4a0256c85d98f78560ec431b643d756180223ef43ef181.png";
const jakImages = JSON.parse(require("child_process").execSync(
  `node /home/daytona/skills/shared/scripts/fetch_images.js "${jakStatUrl}"`
).toString());
if (jakImages[0] && jakImages[0].base64) {
  s.addImage({ data: jakImages[0].base64, x:0.3, y:0.85, w:5.0, h:5.7 });
}

// Right: text
const jakPoints = [
  { heading:"Step 1:", text:"Cytokine binds receptor monomers → receptor dimerization" },
  { heading:"Step 2:", text:"JAK1/2/3 or TYK2 (pre-bound) transphosphorylate each other (P = phosphate activation)" },
  { heading:"Step 3:", text:"Phosphorylated receptor recruits STAT1/2/3/4/5/6 proteins via SH2 domains" },
  { heading:"Step 4:", text:"JAK phosphorylates STATs → STAT dimerization" },
  { heading:"Step 5:", text:"STAT dimers translocate to nucleus → gene transcription (proliferation, differentiation, survival)" },
  { heading:"SOCS proteins:", text:"Negative feedback - SOCS1-7 & CIS terminate JAK/STAT signaling (inhibitory loop)" },
  { heading:"Clinical relevance:", text:"JAK2 mutations → myeloproliferative neoplasms | JAK3 loss → SCID | JAK inhibitors (jakinibs): ruxolitinib, tofacitinib, baricitinib" },
];
const jakItems = jakPoints.map((b,i)=>[
  { text:b.heading+"  ", options:{bold:true,color:C.accentGold,breakLine:false} },
  { text:b.text, options:{color:C.lightGrey, breakLine:i<jakPoints.length-1} }
]).flat();
s.addText(jakItems, { x:5.6, y:0.85, w:7.1, h:5.7, fontSize:14.5, fontFace:"Calibri", valign:"top", paraSpaceBefore:4, paraSpaceAfter:4 });

// ============================================================
// SLIDE 7: INNATE IMMUNITY
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Innate Immunity", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Flow boxes
const innateFlow = [
  { t:"Pathogen / DAMP", c:C.accentRed },
  { t:"TLR / PRR\nActivation", c:"7A1A1A" },
  { t:"Macrophage /\nDendritic Cell", c:C.midBlue },
  { t:"IL-1β, IL-6\nTNF-α, IL-12", c:"5C4A8A" },
  { t:"Systemic\nEffects", c:C.accentGreen },
];
innateFlow.forEach((f, i) => {
  const x = 0.5 + i*2.6;
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:2.3, h:1.1, fill:{color:f.c}, line:{color:C.accent,pt:1} });
  s.addText(f.t, { x, y:0.85, w:2.3, h:1.1, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" });
  if (i<4) s.addShape(pres.ShapeType.line, { x:x+2.3, y:1.4, w:0.3, h:0, line:{color:C.accentGold,pt:2} });
});

// Key cytokines table
const innateRows = [
  ["IL-1β", "Macrophages, DCs", "Fever, acute phase, T-cell activation", "IL-1RA, Anakinra"],
  ["TNF-α", "Macrophages, T cells", "Inflammation, apoptosis, cachexia, NF-κB", "Infliximab, Adalimumab"],
  ["IL-6", "Macrophages, fibroblasts", "Acute phase (CRP, fibrinogen), B-cell differentiation, fever", "Tocilizumab"],
  ["IL-12", "DCs, macrophages", "NK and T-cell IFN-γ production, Th1 polarisation", "Ustekinumab (IL-12/23)"],
  ["IFN-α/β", "Plasmacytoid DCs", "Antiviral ISGs, NK cell activation, Class I MHC upregulation", "IFN-α therapy (HCV, melanoma)"],
  ["IL-18", "Macrophages", "IFN-γ synergy with IL-12, Th1, NK activation", "Tadekinig alfa (recombinant IL-18BP)"],
];

// Header
const headers = ["Cytokine","Source","Key Actions","Clinical Application"];
const colW = [1.9, 2.7, 5.0, 3.1];
const colX = [0.25, 2.15, 4.85, 9.85];
headers.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:colX[i], y:2.1, w:colW[i], h:0.42, fill:{color:C.midBlue}, line:{color:"000000",pt:0} });
  s.addText(h, { x:colX[i], y:2.1, w:colW[i], h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});
innateRows.forEach((r,ri) => {
  const rowY = 2.52 + ri*0.76;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  r.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:colX[ci], y:rowY, w:colW[ci], h:0.73, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:colX[ci]+0.05, y:rowY, w:colW[ci]-0.1, h:0.73, fontSize:11, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  });
});

// ============================================================
// SLIDE 8: ADAPTIVE IMMUNITY / Th BALANCE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Adaptive Immunity – Th Cell Balance", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const thCells = [
  { name:"Th1", driver:"IL-12, IL-18, IFN-γ", tf:"T-bet, STAT4", produces:"IFN-γ, TNF-α, IL-2", protects:"Intracellular pathogens, tumors", disease:"Autoimmune: RA, MS, T1DM, IBD", color:"2D5FAF" },
  { name:"Th2", driver:"IL-4, IL-33, TSLP", tf:"GATA3, STAT6", produces:"IL-4, IL-5, IL-13", protects:"Helminths, extracellular parasites", disease:"Allergy: asthma, atopic dermatitis, eosinophilia", color:"B87D1A" },
  { name:"Th17", driver:"TGF-β + IL-6, IL-23", tf:"RORγt, STAT3", produces:"IL-17A/F, IL-22, TNF", protects:"Extracellular bacteria, fungi", disease:"Psoriasis, RA, IBD, MS, ankylosing spondylitis", color:"7B2D8B" },
  { name:"Treg", driver:"TGF-β, IL-2", tf:"FoxP3, STAT5", produces:"TGF-β, IL-10, IL-35", protects:"Self-tolerance, immune homeostasis", disease:"Loss of Treg → autoimmunity; excess → cancer immune evasion", color:C.accentGreen },
];

thCells.forEach((t,i) => {
  const x = 0.2 + i*3.3;
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:3.05, h:5.9, fill:{color:t.color+"22"}, line:{color:t.color,pt:1.5} });
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:3.05, h:0.58, fill:{color:t.color}, line:{color:"000000",pt:0} });
  s.addText(t.name, { x, y:0.85, w:3.05, h:0.58, fontSize:20, bold:true, color:C.white, align:"center", valign:"middle" });

  const fields = [
    ["Driven by", t.driver],
    ["TF / STAT", t.tf],
    ["Produces", t.produces],
    ["Protects vs", t.protects],
    ["Disease link", t.disease],
  ];
  fields.forEach(([label,val],fi) => {
    const fy = 1.55 + fi*0.97;
    s.addText(label, { x:x+0.1, y:fy, w:2.85, h:0.3, fontSize:10, bold:true, color:t.color==="2D5FAF"?C.accent:C.accentGold, fontFace:"Calibri", italic:true });
    s.addText(val, { x:x+0.1, y:fy+0.3, w:2.85, h:0.58, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"top" });
  });
});

// ============================================================
// SLIDE 9: ANTI-INFLAMMATORY CYTOKINES
// ============================================================
s = pres.addSlide();
contentSlide(s, "Anti-Inflammatory Cytokines – Restoring Balance", [
  { heading:"IL-10:", text:"Master anti-inflammatory cytokine; produced by Tregs, macrophages, DCs; suppresses TNF, IL-1β, IL-6, IL-12; critical in IBD and infection tolerance; IL-10 deficiency → colitis" },
  { heading:"TGF-β:", text:"Promotes Treg differentiation; suppresses T-cell proliferation; drives fibrosis in chronic inflammation; TGF-β excess → tissue fibrosis (lung, liver, kidney)" },
  { heading:"IL-1RA (IL-1 receptor antagonist):", text:"Blocks IL-1α/β signaling; naturally produced during inflammation; recombinant form = Anakinra, used in RA, MAS, Still disease" },
  { heading:"IL-35:", text:"Produced by Tregs; suppresses Th1 and Th17; promotes Treg expansion; potential therapeutic target" },
  { heading:"IFN-α/β:", text:"Anti-inflammatory in context of autoimmunity; downregulate cytokine-mediated lethality; used therapeutically in MS, viral hepatitis" },
  { heading:"Balance concept:", text:"In health: pro- and anti-inflammatory cytokines maintain equilibrium. In disease: persistent pro-inflammatory drive overcomes anti-inflammatory counter-regulation → chronic damage" },
]);

// ============================================================
// SLIDE 10: CYTOKINES IN AUTOIMMUNE DISEASE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Autoimmune Disease", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const autoimmuneData = [
  { disease:"Rheumatoid Arthritis", cytokines:"TNF-α, IL-1β, IL-6, IL-17A", mechanism:"Synovial inflammation, pannus, cartilage destruction; RANKL-driven bone erosion", therapy:"Anti-TNF (infliximab), anti-IL-6R (tocilizumab), anti-IL-17 (secukinumab)" },
  { disease:"Psoriasis", cytokines:"TNF-α, IL-17A/F, IL-23, IL-22", mechanism:"Keratinocyte hyperproliferation, neutrophil recruitment, dysregulated IL-23/IL-17 axis", therapy:"Anti-IL-17 (secukinumab, ixekizumab), anti-IL-23 (guselkumab), anti-TNF" },
  { disease:"SLE", cytokines:"IFN-α/β, IL-6, IL-10, BLyS/BAFF", mechanism:"IFN signature drives TLR7/9 activation, auto-Ab production, complement activation", therapy:"Anifrolumab (anti-IFN-αR), belimumab (anti-BLyS)" },
  { disease:"IBD (Crohn/UC)", cytokines:"TNF-α, IL-6, IL-12, IL-23, IL-17", mechanism:"Mucosal barrier disruption, macrophage activation, Th1/Th17 dysregulation", therapy:"Anti-TNF (infliximab), anti-IL-12/23 (ustekinumab), anti-IL-23 (risankizumab)" },
  { disease:"Multiple Sclerosis", cytokines:"IFN-γ, IL-17, TNF-α, IL-12", mechanism:"Th1/Th17 myelin attack; IL-17 disrupts blood-brain barrier integrity", therapy:"IFN-β (modulatory), natalizumab, anti-IL-12/23 (usteki...)" },
];

const adCols = ["Disease","Key Cytokines","Pathomechanism","Targeted Therapy"];
const adW = [2.1, 2.4, 4.5, 3.8];
const adX = [0.2, 2.3, 4.7, 9.2];
adCols.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:adX[i], y:0.85, w:adW[i], h:0.42, fill:{color:"2D478A"}, line:{color:"000000",pt:0} });
  s.addText(h, { x:adX[i], y:0.85, w:adW[i], h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});
autoimmuneData.forEach((r,ri) => {
  const rowY = 1.27 + ri*1.06;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  const cells = [r.disease, r.cytokines, r.mechanism, r.therapy];
  cells.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:adX[ci], y:rowY, w:adW[ci], h:1.03, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:adX[ci]+0.05, y:rowY, w:adW[ci]-0.1, h:1.03, fontSize:ci===0?12.5:10.5, bold:ci===0, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  });
});

// ============================================================
// SLIDE 11: CYTOKINE STORM
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.accentRed} });
s.addText("Cytokine Storm – Pathological Hypercytokinemia", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accentGold} });

const stormPoints = [
  { heading:"Definition:", text:"Life-threatening dysregulated systemic inflammatory response with massive uncontrolled cytokine release" },
  { heading:"Triggers:", text:"Infections (sepsis, COVID-19, influenza H5N1), hemophagocytic lymphohistiocytosis (HLH/MAS), CAR-T therapy, checkpoint inhibitor therapy" },
  { heading:"Key cytokines:", text:"IL-6, IL-1β, TNF-α, IFN-γ, IL-18, GM-CSF, M-CSF, MCP-1/CCL2 — positive feedback loops amplify response" },
  { heading:"COVID-19 specific:", text:"SARS-CoV-2 triggers plasmacytoid DC and macrophage activation → IL-6 storm → capillary leak syndrome, ARDS, multi-organ failure" },
  { heading:"Sepsis cytokine dysregulation:", text:"Early hyperinflammation (IL-6, IL-8, IL-10 surge) → immunoparalysis phase; disrupted IL-6/IL-8/IL-10 network = poor prognosis" },
  { heading:"HLH/MAS:", text:"Extremely high ferritin, IL-18, IFN-γ; activated macrophages engulf blood cells; triggers: EBV, SLE flare, malignancy" },
  { heading:"Management:", text:"IL-6R blockade (tocilizumab) — approved for COVID-19, CAR-T CRS; anakinra (IL-1RA) for HLH/MAS; dexamethasone (broad suppression); ruxolitinib (JAK1/2 inhibitor)" },
];
const stormItems = stormPoints.map((b,i)=>[
  { text:b.heading+"  ", options:{bold:true,color:C.accentGold,breakLine:false} },
  { text:b.text, options:{color:C.lightGrey, breakLine:i<stormPoints.length-1} }
]).flat();
s.addText(stormItems, { x:0.4, y:0.85, w:12.3, h:5.8, fontSize:14.5, fontFace:"Calibri", valign:"top", paraSpaceBefore:3, paraSpaceAfter:3, lineSpacingMultiple:1.2 });

// ============================================================
// SLIDE 12: CYTOKINES IN CANCER
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Cancer – Friend or Foe?", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Two columns: Tumor-promoting vs Anti-tumor
const proTumor = [
  { heading:"IL-6:", text:"STAT3 activation → survival, proliferation, angiogenesis; elevated in many cancers; drives cancer cachexia" },
  { heading:"TGF-β:", text:"Immunosuppressive TME; suppresses CTL and NK cells; promotes EMT and metastasis" },
  { heading:"VEGF:", text:"Angiogenesis; therapeutic target (bevacizumab); induced by IL-6, TNF, hypoxia" },
  { heading:"IL-10:", text:"Immunosuppression in TME; promotes tumor evasion of CTL killing" },
  { heading:"TNF-α:", text:"Paradoxically: promotes angiogenesis and NF-κB survival signals in established tumors" },
  { heading:"Adipokines:", text:"Leptin promotes tumor proliferation; resistin drives proinflammatory cancer risk" },
];
const antiTumor = [
  { heading:"IFN-γ:", text:"Activates macrophages, upregulates MHC-I on tumors → CTL killing; impaired in immunosuppressed TME" },
  { heading:"TNF-α:", text:"At high dose: direct tumor cell apoptosis; basis of isolated limb perfusion therapy" },
  { heading:"IL-2:", text:"Approved for metastatic melanoma & RCC (10% response); promotes CTL/NK expansion; limited by vascular leak" },
  { heading:"IFN-α:", text:"Approved for melanoma, hairy cell leukemia, Kaposi sarcoma; inhibits tumor proliferation, upregulates MHC-I" },
  { heading:"GM-CSF/G-CSF:", text:"Post-chemotherapy neutropenia management; stimulates DC differentiation in tumor vaccines" },
  { heading:"IL-12:", text:"Potent anti-tumor in animal models; activates NK and CTL; used in oncolytic virus and CAR-T combinations" },
];
twoCol(s, "", proTumor, antiTumor, "Tumor-Promoting Cytokines", "Anti-Tumor Cytokines", "7A1A1A", C.accentGreen);

// ============================================================
// SLIDE 13: CYTOKINES IN HEMATOPOIESIS
// ============================================================
s = pres.addSlide();
contentSlide(s, "Cytokines in Hematopoiesis & Haematological Disease", [
  { heading:"Colony-Stimulating Factors (CSFs):", text:"G-CSF (IL-3 family) → neutrophil production; M-CSF → monocyte/macrophage; GM-CSF → myeloid DCs; EPO → erythropoiesis; TPO → megakaryocytes/platelets" },
  { heading:"IL-3:", text:"Multi-CSF; promotes expansion of all myeloid and some lymphoid progenitors from HSCs; synergises with SCF and Flt3L" },
  { heading:"IL-7:", text:"Non-redundant for T and B lymphopoiesis; IL-7Rα mutations → SCID; elevated in lymphopenia" },
  { heading:"JAK2 V617F mutation:", text:"Gain-of-function mutation in ~95% of polycythaemia vera, ~50% of ET and MF; constitutive JAK-STAT5 activation → excessive proliferation of myeloid lineage" },
  { heading:"γc chain (CD132) deficiency:", text:"X-linked SCID: affects signaling of IL-2, IL-4, IL-7, IL-9, IL-15, IL-21; absent T and NK cells, non-functional B cells" },
  { heading:"Haematological malignancy cytokines:", text:"IL-6 → myeloma cell survival (via STAT3); IL-2 → CTCL and T-cell leukemia (basis of IL-2 therapy); CXCL12 → marrow homing of leukaemic blasts" },
  { heading:"Therapeutic CSFs:", text:"Filgrastim (G-CSF), pegfilgrastim: post-chemotherapy; sargramostim (GM-CSF): mobilisation of HSCs for transplant" },
]);

// ============================================================
// SLIDE 14: CYTOKINE BIOLOGICS TABLE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Therapeutics – Biologics & JAK Inhibitors", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const drugs = [
  ["Infliximab / Adalimumab","Anti-TNF-α mAb","RA, IBD, psoriasis, AS, PsA","Risk: TB reactivation, fungal infections"],
  ["Tocilizumab / Sarilumab","Anti-IL-6R mAb","RA, COVID-19, cytokine storm, GCA","LFT monitoring; IL-6 level rises (receptor blocked)"],
  ["Anakinra / Canakinumab","IL-1 blocker","RA, gout, CAPS, HLH/MAS, AOSD","Injection site reactions; renal monitoring"],
  ["Secukinumab / Ixekizumab","Anti-IL-17A mAb","Psoriasis, PsA, AS","IBD risk (caution); candidasis"],
  ["Ustekinumab","Anti-IL-12/23 (p40) mAb","Psoriasis, IBD, PsA","Generally well tolerated"],
  ["Dupilumab","Anti-IL-4Rα (blocks IL-4 & IL-13)","Atopic dermatitis, asthma, CRSwNP","Conjunctivitis; well tolerated"],
  ["Ruxolitinib / Tofacitinib","JAK1/2 or JAK1/3 inhibitor","MPN, RA, COVID-19, alopecia areata","VTE, infection, lipid changes; avoid in high CV risk"],
  ["Baricitinib","JAK1/2 inhibitor","RA, COVID-19, alopecia areata","Thrombosis risk; dosing adjustment in renal impairment"],
];

const drugCols = ["Agent","Target/Class","Approved Indications","Key Adverse Effects / Notes"];
const dW = [2.6, 2.6, 3.7, 3.9];
const dX = [0.15, 2.75, 5.35, 9.05];
drugCols.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:dX[i], y:0.85, w:dW[i], h:0.4, fill:{color:"2D478A"}, line:{color:"000000",pt:0} });
  s.addText(h, { x:dX[i], y:0.85, w:dW[i], h:0.4, fontSize:11.5, bold:true, color:C.white, align:"center", valign:"middle" });
});
drugs.forEach((r,ri) => {
  const rowY = 1.25 + ri*0.77;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  r.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:dX[ci], y:rowY, w:dW[ci], h:0.74, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:dX[ci]+0.05, y:rowY, w:dW[ci]-0.1, h:0.74, fontSize:10.5, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle", bold:ci===0 });
  });
});

// ============================================================
// SLIDE 15: CYTOKINE ASSAYS
// ============================================================
s = pres.addSlide();
contentSlide(s, "Cytokine Assays in the Clinical Laboratory", [
  { heading:"Bioassays (gold standard):", text:"Measure biological activity (e.g., T-cell proliferation assay for IL-2); time-consuming, labour-intensive; mainly research use" },
  { heading:"ELISA (Enzyme-Linked ImmunoSorbent Assay):", text:"Widely available kits for IL-1α/β, IL-4, IL-5, IL-6, IL-10, IFN-γ, TNF-α; single-plex; clinical laboratory standard; sensitivity varies by manufacturer" },
  { heading:"Multiplex / Luminex assays:", text:"Simultaneously measure 20-100+ cytokines from small sample volumes; bead-based immunoassay; high sensitivity; platforms vary (Luminex xMAP, electrochemiluminescence [MSD]); inter-platform variability is a known limitation" },
  { heading:"Flow cytometry intracellular staining:", text:"Cell-level cytokine production analysis; requires brefeldin A blocking; important in research, HLA typing, transplant assessment" },
  { heading:"Clinical applications:", text:"Sepsis monitoring (IL-6, IL-10); CAR-T CRS grading (IL-6, IFN-γ, ferritin); COVID-19 severity (IL-6, IL-8); HLH diagnosis (soluble CD25/IL-2Rα, IFN-γ, IL-18, ferritin)" },
  { heading:"Pathology lab relevance:", text:"Rising serum IL-6 correlates with CRP/acute phase; CSF cytokine panels in CNS inflammation; tumour microenvironment cytokine profiling (research/companion Dx)" },
]);

// ============================================================
// SLIDE 16: ANTI-CYTOKINE COMPLICATIONS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:"7A1A1A"} });
s.addText("Complications of Cytokine Deficiency & Immunopathology", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accentRed} });

const deficiencies = [
  { defect:"IL-12 / IL-12R deficiency", consequence:"Inability to produce IFN-γ → susceptibility to mycobacterial and Salmonella infections (Mendelian susceptibility to mycobacterial disease)" },
  { defect:"IFN-γR deficiency", consequence:"Fatal disseminated mycobacterial infection even with BCG vaccination" },
  { defect:"IL-10 / IL-10R deficiency", consequence:"Very early onset IBD; uncontrolled intestinal inflammation; refractory to conventional therapy" },
  { defect:"γc (CD132) chain deficiency", consequence:"X-linked SCID: absent T and NK cells; profound lymphopenia; fatal without HSCT or gene therapy" },
  { defect:"JAK3 deficiency", consequence:"Autosomal recessive SCID; phenotype identical to X-SCID (shares γc signaling)" },
  { defect:"JAK2 V617F gain-of-function", consequence:"Myeloproliferative neoplasms (PV, ET, MF); constitutive erythropoiesis/megakaryopoiesis" },
  { defect:"STAT1 gain-of-function", consequence:"Chronic mucocutaneous candidiasis with hyperresponsive IFN signaling; impaired Th17" },
  { defect:"TNF hypersecretion", consequence:"Cachexia, systemic inflammation; TNFR1 mutations → TRAPS (periodic fever syndrome)" },
];

deficiencies.forEach((d,i) => {
  const y = 0.88 + i*0.77;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.73, fill:{color:bg}, line:{color:C.accentRed,pt:0.3,transparency:60} });
  s.addText(d.defect, { x:0.3, y, w:3.6, h:0.73, fontSize:12, bold:true, color:C.accentRed, fontFace:"Calibri", valign:"middle" });
  s.addShape(pres.ShapeType.line, { x:3.9, y:y+0.1, w:0, h:0.53, line:{color:C.accentRed,pt:0.7,transparency:40} });
  s.addText(d.consequence, { x:4.0, y, w:9.0, h:0.73, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 17: CYTOKINE NETWORK DIAGRAM (Schematic text-based)
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Network – Systems View", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Central hub
s.addShape(pres.ShapeType.ellipse, { x:5.4, y:2.4, w:2.5, h:1.6, fill:{color:C.midBlue}, line:{color:C.accent,pt:2} });
s.addText("CYTOKINE\nNETWORK", { x:5.4, y:2.4, w:2.5, h:1.6, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });

// Satellite nodes
const nodes = [
  { label:"Innate\nImmunity", x:0.2, y:0.9, color:C.accentRed },
  { label:"Adaptive\nImmunity", x:10.8, y:0.9, color:C.midBlue },
  { label:"Hematopoiesis", x:0.2, y:4.2, color:C.accentGreen },
  { label:"Autoimmune\nDisease", x:10.8, y:4.2, color:"7B2D8B" },
  { label:"Cancer /\nTME", x:5.4, y:5.8, color:C.accentGold },
  { label:"Cytokine\nStorm", x:2.8, y:0.85, color:"8A1A1A" },
  { label:"Therapeutic\nTargets", x:8.3, y:5.5, color:"1A6B4A" },
];
nodes.forEach(n => {
  s.addShape(pres.ShapeType.roundRect, { x:n.x, y:n.y, w:2.2, h:1.0, fill:{color:n.color}, line:{color:C.white,pt:0.8}, rectRadius:0.15 });
  s.addText(n.label, { x:n.x, y:n.y, w:2.2, h:1.0, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});

// Connector lines (simplified)
const cx = 6.65, cy = 3.2;
const connectors = [
  {x1:2.2, y1:1.4, x2:5.5, y2:2.8},
  {x1:11.0, y1:1.4, x2:7.9, y2:2.8},
  {x1:2.2, y1:4.7, x2:5.5, y2:3.8},
  {x1:11.0, y1:4.7, x2:7.9, y2:3.8},
  {x1:6.5, y1:6.3, x2:6.5, y2:4.0},
  {x1:4.0, y1:1.35, x2:5.8, y2:2.5},
  {x1:9.4, y1:5.95, x2:7.9, y2:3.8},
];
connectors.forEach(c => {
  s.addShape(pres.ShapeType.line, { x:c.x1, y:c.y1, w:c.x2-c.x1, h:c.y2-c.y1, line:{color:C.accent,pt:1,dashType:"dash"} });
});

s.addText("Cytokines operate within a highly interconnected signaling web — alterations in one node propagate throughout the network, driving disease states or restoring homeostasis", {
  x:0.3, y:6.8, w:12.7, h:0.5, fontSize:11, italic:true, color:C.textLight, fontFace:"Calibri", align:"center"
});

// ============================================================
// SLIDE 18: KEY TAKEAWAYS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.06, fill:{color:C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:7.44, w:"100%", h:0.06, fill:{color:C.accentGold} });
s.addText("Key Takeaways", { x:0.5, y:0.15, w:12.3, h:0.65, fontSize:26, bold:true, color:C.white, align:"center", fontFace:"Calibri" });
s.addShape(pres.ShapeType.rect, { x:2.5, y:0.78, w:8.3, h:0.05, fill:{color:C.accent} });

const takeaways = [
  { n:"1", t:"Pleiotropic & Redundant", d:"No single cytokine = single disease; networks overlap — targeting requires understanding the full system" },
  { n:"2", t:"Families & Receptors", d:"Structural receptor homology explains functional redundancy; receptor mutations = immunodeficiency or malignancy" },
  { n:"3", t:"JAK-STAT is the hub", d:"~60 cytokines signal via JAK-STAT; SOCS proteins self-limit; JAK2 V617F = MPNs; JAK inhibitors are major drugs" },
  { n:"4", t:"Th1/Th2/Th17/Treg balance", d:"Deviation from balance drives autoimmunity (Th1/Th17 excess), allergy (Th2 excess), or cancer immune evasion (Treg excess)" },
  { n:"5", t:"Cytokine Storm = Emergency", d:"IL-6 + IFN-γ + TNF positive feedback → ARDS, MOF; anti-IL-6R (tocilizumab) is first-line for COVID-19 CRS" },
  { n:"6", t:"Biologics have transformed medicine", d:"Anti-TNF, anti-IL-6R, anti-IL-17, anti-IL-12/23 have revolutionised RA, IBD, psoriasis treatment" },
  { n:"7", t:"Cytokine deficiency = immunopathology", d:"IL-12R/IFN-γR defects → mycobacterial disease; γc/JAK3 defects → SCID; IL-10 defects → early IBD" },
];

takeaways.forEach((t, i) => {
  const col = i < 4 ? 0 : 1;
  const row = i < 4 ? i : i-4;
  const x = col === 0 ? 0.3 : 6.8;
  const y = 0.9 + row * 1.6;
  s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:1.45, fill:{color:"1A2F4B"}, line:{color:C.accent,pt:1} });
  s.addShape(pres.ShapeType.rect, { x, y, w:0.6, h:1.45, fill:{color:C.accent+"33"}, line:{color:"000000",pt:0} });
  s.addText(t.n, { x, y, w:0.6, h:1.45, fontSize:20, bold:true, color:C.accent, align:"center", valign:"middle" });
  s.addText(t.t, { x:x+0.7, y:y+0.1, w:5.3, h:0.45, fontSize:14, bold:true, color:C.accentGold, fontFace:"Calibri" });
  s.addText(t.d, { x:x+0.7, y:y+0.52, w:5.3, h:0.85, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri" });
});

// ============================================================
// SAVE
// ============================================================
pres.writeFile({ fileName: "/home/daytona/workspace/cytokines-ppt/Cytokines_Health_Disease.pptx" })
  .then(() => console.log("DONE: /home/daytona/workspace/cytokines-ppt/Cytokines_Health_Disease.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Reading File
Running Command

rm /home/daytona/workspace/cytokines-ppt/build.js

Writing File

~/cytokines-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "Cytokines: Health and Disease";
pres.author = "Pathology Resident Education";

// ============================================================
// COLOR PALETTE
// ============================================================
const C = {
  deepNavy:   "0D1B2A",
  navy:       "1A2F4B",
  midBlue:    "1E4D8C",
  accent:     "00B4D8",
  accentGold: "F4A261",
  accentRed:  "E63946",
  accentGreen:"2D9D78",
  white:      "FFFFFF",
  lightGrey:  "D6E4F0",
  textLight:  "B8D4EA",
  textDark:   "0D1B2A",
};

// ============================================================
// SLIDE 1: TITLE
// ============================================================
let s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.18, fill:{color:C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:7.32, w:"100%", h:0.18, fill:{color:C.accentGold} });
s.addShape(pres.ShapeType.ellipse, { x:10.5, y:0.3, w:3, h:3, fill:{color:C.midBlue, transparency:75}, line:{color:"000000",pt:0} });
s.addShape(pres.ShapeType.ellipse, { x:-0.8, y:4.5, w:2.5, h:2.5, fill:{color:C.accentGold, transparency:80}, line:{color:"000000",pt:0} });
s.addText("CYTOKINES", {
  x:0.5, y:0.9, w:12.3, h:1.3,
  fontSize:54, bold:true, color:C.white, fontFace:"Calibri",
  align:"center", charSpacing:6
});
s.addText("Health and Disease", {
  x:0.5, y:2.1, w:12.3, h:0.75,
  fontSize:30, color:C.accent, fontFace:"Calibri",
  align:"center", italic:true
});
s.addShape(pres.ShapeType.rect, { x:3, y:3.0, w:7.3, h:0.05, fill:{color:C.accent} });
s.addText("A Comprehensive Overview for Pathology Residents", {
  x:0.5, y:3.2, w:12.3, h:0.55,
  fontSize:16, color:C.textLight, fontFace:"Calibri", align:"center"
});
s.addText([
  { text: "Sources: ", options:{bold:true, color:C.accentGold} },
  { text: "Henry's Clinical Diagnosis & Management  |  Cellular & Molecular Immunology  |  Schwartz's Surgery  |  Robbins Pathology  |  Fitzpatrick's Dermatology", options:{color:C.textLight} }
], {
  x:0.5, y:6.7, w:12.3, h:0.4,
  fontSize:11, fontFace:"Calibri", align:"center"
});

// ============================================================
// SLIDE 2: OUTLINE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Lecture Outline", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const agenda = [
  ["01", "What Are Cytokines?", "Definition, history, key properties"],
  ["02", "Classification & Families", "Structural and functional groupings"],
  ["03", "Cytokine Receptors", "Five receptor superfamilies"],
  ["04", "JAK-STAT Signaling", "Central pathway and SOCS regulation"],
  ["05", "Cytokines in Innate Immunity", "Pro-inflammatory cascade"],
  ["06", "Th Cell Balance", "Th1/Th2/Th17/Treg regulation"],
  ["07", "Anti-Inflammatory Cytokines", "Restoring homeostasis"],
  ["08", "Cytokines in Autoimmunity", "RA, SLE, IBD, psoriasis, MS"],
  ["09", "Cytokine Storm", "Sepsis, COVID-19, HLH/MAS"],
  ["10", "Cytokines in Cancer", "TME, anti-tumor, pro-tumor"],
];

const col1 = agenda.slice(0,5);
const col2 = agenda.slice(5);

col1.forEach((a, i) => {
  const yy = 0.95 + i*1.1;
  s.addShape(pres.ShapeType.rect, { x:0.3, y:yy, w:0.5, h:0.5, fill:{color:C.accent}, line:{color:"000000",pt:0} });
  s.addText(a[0], { x:0.3, y:yy, w:0.5, h:0.5, fontSize:13, bold:true, color:C.deepNavy, align:"center", valign:"middle" });
  s.addText(a[1], { x:0.95, y:yy, w:5.4, h:0.28, fontSize:15, bold:true, color:C.white, fontFace:"Calibri", valign:"bottom" });
  s.addText(a[2], { x:0.95, y:yy+0.3, w:5.4, h:0.28, fontSize:12, color:C.textLight, fontFace:"Calibri", valign:"top" });
});
col2.forEach((a, i) => {
  const yy = 0.95 + i*1.1;
  s.addShape(pres.ShapeType.rect, { x:6.9, y:yy, w:0.5, h:0.5, fill:{color:C.accentGold}, line:{color:"000000",pt:0} });
  s.addText(a[0], { x:6.9, y:yy, w:0.5, h:0.5, fontSize:13, bold:true, color:C.deepNavy, align:"center", valign:"middle" });
  s.addText(a[1], { x:7.55, y:yy, w:5.4, h:0.28, fontSize:15, bold:true, color:C.white, fontFace:"Calibri", valign:"bottom" });
  s.addText(a[2], { x:7.55, y:yy+0.3, w:5.4, h:0.28, fontSize:12, color:C.textLight, fontFace:"Calibri", valign:"top" });
});

// Add last items
const last2 = [
  ["11", "Hematopoiesis & Immunodeficiency"],
  ["12", "Cytokine Biologics & JAK Inhibitors"],
  ["13", "Cytokine Assays in the Lab"],
  ["14", "Key Takeaways"],
];
s.addText("... and more:", { x:0.3, y:6.55, w:13, h:0.3, fontSize:11, color:C.textLight, italic:true, fontFace:"Calibri" });

// ============================================================
// SLIDE 3: WHAT ARE CYTOKINES?
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("What Are Cytokines?", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const defPoints = [
  ["Definition", "Small secreted proteins (8-80 kDa) that mediate cell-to-cell communication in the immune system, inflammation, hematopoiesis, embryonic development, and tissue repair"],
  ["History", "Term coined by Cohen (1975) for activities released by epithelial cells. Previously called lymphokines (from T cells) or monokines (from monocytes). Keratinocyte cytokines discovered 1981"],
  ["Pleiotropism", "One cytokine elicits multiple different effects in different target cell types"],
  ["Redundancy", "Multiple distinct cytokines share overlapping biological roles in any given bioassay - loss of one is often compensated by others"],
  ["Synergy / Antagonism", "Cytokines act in complex combinations - synergistic pairs amplify responses (IL-12 + IL-18 for IFN-g); antagonistic pairs limit each other (IL-10 vs TNF-a)"],
  ["Concentration range", "Active at pico- to femtomolar concentrations; secreted in small quantities; receptor density and cell activation state determine cellular response"],
  ["Modes of action", "Autocrine (self-signaling) | Paracrine (adjacent cells) | Endocrine (systemic, rare)"],
  ["Producer cells", "T helper cells, macrophages, DCs, NK cells, mast cells, epithelial cells, fibroblasts, adipocytes, vascular endothelium, many more"],
];

defPoints.forEach((p, i) => {
  const y = 0.85 + i*0.82;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.77, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:2.4, h:0.77, fill:{color:C.midBlue+"88"}, line:{color:"000000",pt:0} });
  s.addText(p[0], { x:0.25, y, w:2.35, h:0.77, fontSize:12.5, bold:true, color:C.accent, fontFace:"Calibri", valign:"middle" });
  s.addText(p[1], { x:2.75, y, w:10.2, h:0.77, fontSize:12, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 4: CLASSIFICATION
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Classification of Cytokines", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const classBoxes = [
  { label:"Interleukins (ILs)", color:"1E4D8C", note:"IL-1 to IL-38+\nMediate leukocyte-leukocyte signals\nSubfamilies: IL-1, IL-2, IL-6, IL-10, IL-12, IL-17 families" },
  { label:"Interferons (IFNs)", color:"295E8A", note:"Type I (IFN-a/b): antiviral, ISG induction\nType II (IFN-g): macrophage activation, Th1\nType III (IFN-l): mucosal antiviral" },
  { label:"TNF Superfamily", color:"5C4A8A", note:"TNF-a, RANKL, FasL, TRAIL, BAFF\nSurvival, differentiation, apoptosis\nBone remodeling; 27 members" },
  { label:"Chemokines", color:"1A6B4A", note:"CXC (IL-8/CXCL8), CC (MCP-1), CX3C\nDirected cell migration, leukocyte trafficking\n~50 members; bind GPCR receptors" },
  { label:"Colony-Stimulating Factors", color:"6B4A1A", note:"G-CSF, GM-CSF, M-CSF, IL-3, EPO, TPO\nHematopoiesis, myeloid differentiation\nClinical: post-chemotherapy neutrophilia" },
  { label:"Growth Factors & Adipokines", color:"5A2A2A", note:"TGF-b, VEGF, FGF, EGF, PDGF\nAngiogenesis, fibrosis, tissue repair\nAdiponectin, leptin: metabolic-immune link" },
];

classBoxes.forEach((b, i) => {
  const col = i % 3;
  const row = Math.floor(i / 3);
  const x = 0.25 + col * 4.35;
  const y = 0.9 + row * 3.35;
  s.addShape(pres.ShapeType.rect, { x, y, w:4.1, h:3.1, fill:{color:b.color}, line:{color:C.accent,pt:1} });
  s.addText(b.label, { x, y:y+0.1, w:4.1, h:0.5, fontSize:14, bold:true, color:C.accent, align:"center", fontFace:"Calibri" });
  s.addShape(pres.ShapeType.line, { x:x+0.2, y:y+0.62, w:3.7, h:0, line:{color:C.accent,pt:0.5} });
  s.addText(b.note, { x:x+0.1, y:y+0.72, w:3.9, h:2.2, fontSize:12, color:C.lightGrey, fontFace:"Calibri", valign:"top" });
});

// ============================================================
// SLIDE 5: CYTOKINE RECEPTORS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Receptors - Five Superfamilies", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const receptors = [
  { n:"1", name:"IL-1 / TIR Family", detail:"3 Ig-like extracellular domains; IL-1R, IL-18R, IL-33R, IL-36R; cytosolic TIR domain signals via MyD88 -> NF-kB; IL-1RA is natural antagonist", color:C.accentRed },
  { n:"2", name:"TNF Receptor (TNFR) Superfamily", detail:"Cysteine-rich extracellular domain; 27 members (TNFR1/2, FasR, RANK, DR4/5); mediates apoptosis (FADD/caspase-8) and survival (TRAF adaptor -> NF-kB)", color:"E07B00" },
  { n:"3", name:"Class I (Haematopoietin) Receptors", detail:"WSXWS motif; share gp130 (IL-6 family), gc chain (IL-2,4,7,9,15,21), or bc chain (IL-3,5,GM-CSF); JAK1/2/3 -> STAT3/5 signaling", color:C.midBlue },
  { n:"4", name:"Class II (Interferon) Receptors", detail:"Bind IFN-a/b, IFN-g and IL-10 family; heterodimeric; signal via JAK1/TYK2 -> STAT1/STAT2; ISGF3 complex activates antiviral ISGs", color:C.accentGreen },
  { n:"5", name:"Tyrosine Kinase Receptors (RTKs)", detail:"Intrinsic kinase domain; VEGFR, FGFR, PDGFR, c-Kit (SCF receptor), Flt3; Ras-MAPK and PI3K-Akt pathways; mutation/overexpression common in cancers", color:"7B2D8B" },
];

receptors.forEach((r, i) => {
  const y = 0.88 + i*1.28;
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:0.55, h:0.6, fill:{color:r.color}, line:{color:"000000",pt:0} });
  s.addText(r.n, { x:0.2, y, w:0.55, h:0.6, fontSize:18, bold:true, color:C.white, align:"center", valign:"middle" });
  s.addText(r.name, { x:0.88, y, w:3.9, h:0.6, fontSize:14.5, bold:true, color:C.accentGold, fontFace:"Calibri", valign:"middle" });
  s.addText(r.detail, { x:4.9, y, w:8.2, h:0.6, fontSize:12.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  if (i<4) s.addShape(pres.ShapeType.line, { x:0.2, y:y+0.8, w:12.9, h:0, line:{color:C.accent,pt:0.4,transparency:60} });
});

s.addText("Clinical note: Receptor structural homology drives functional redundancy - targeting single cytokines often has limited efficacy; blockade of shared receptor subunits (gp130, gc) is more broadly effective", {
  x:0.3, y:7.2, w:12.7, h:0.38,
  fontSize:11, italic:true, color:C.accent, fontFace:"Calibri", align:"center"
});

// ============================================================
// SLIDE 6: JAK-STAT (with embedded image)
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("JAK-STAT Signaling - The Central Cytokine Hub", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const jakStatUrl = "https://cdn.orris.care/cdss_images/1a301f9a0ebd75a75a4a0256c85d98f78560ec431b643d756180223ef43ef181.png";
try {
  const jakImages = JSON.parse(require("child_process").execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js "${jakStatUrl}"`,
    {timeout: 20000}
  ).toString());
  if (jakImages[0] && jakImages[0].base64) {
    s.addImage({ data: jakImages[0].base64, x:0.3, y:0.85, w:4.8, h:5.6 });
  }
} catch(e) {
  s.addShape(pres.ShapeType.rect, { x:0.3, y:0.85, w:4.8, h:5.6, fill:{color:C.deepNavy}, line:{color:C.accent,pt:1} });
  s.addText("JAK-STAT Diagram\n(Schwartz's Surgery, Fig. 2-7)", { x:0.3, y:0.85, w:4.8, h:5.6, fontSize:14, color:C.textLight, align:"center", valign:"middle" });
}

const jakPoints = [
  ["Step 1", "Cytokine binds receptor monomers -> receptor dimerization"],
  ["Step 2", "Constitutively associated JAK1/2/3 or TYK2 transphosphorylate each other (P activation)"],
  ["Step 3", "Phosphorylated receptor recruits STAT1/2/3/4/5/6 via SH2 domains"],
  ["Step 4", "JAK phosphorylates STATs -> STAT dimerization"],
  ["Step 5", "STAT dimers translocate to nucleus -> gene transcription (proliferation, differentiation, survival, apoptosis)"],
  ["SOCS", "Negative feedback: SOCS1-7 & CIS terminate JAK/STAT signaling; induced by JAK-STAT itself (inhibitory loop)"],
  ["JAK inhibitors", "Ruxolitinib (JAK1/2), Tofacitinib (JAK1/3), Baricitinib (JAK1/2) - approved for RA, MPNs, COVID-19, alopecia"],
  ["Mutations", "JAK2 V617F -> MPNs (PV, ET, MF) | JAK3/gc loss -> X-SCID | STAT1 GOF -> chronic mucocutaneous candidiasis"],
];

jakPoints.forEach((p, i) => {
  const y = 0.9 + i*0.75;
  s.addText(p[0] + ":  ", { x:5.35, y, w:1.5, h:0.7, fontSize:12.5, bold:true, color:C.accentGold, fontFace:"Calibri", valign:"middle" });
  s.addText(p[1], { x:6.8, y, w:6.3, h:0.7, fontSize:12.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  if(i<7) s.addShape(pres.ShapeType.line, { x:5.3, y:y+0.72, w:7.8, h:0, line:{color:C.accent,pt:0.3,transparency:70} });
});

// ============================================================
// SLIDE 7: INNATE IMMUNITY
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Innate Immunity", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Flow arrows row
const innateFlow = [
  { t:"Pathogen\n/ DAMP", c:C.accentRed },
  { t:"TLR/PRR\nActivation", c:"8A1A1A" },
  { t:"Macrophage /\nDendritic Cell", c:C.midBlue },
  { t:"IL-1b, IL-6\nTNF-a, IL-12", c:"5C4A8A" },
  { t:"Systemic\nEffects", c:C.accentGreen },
];
innateFlow.forEach((f, i) => {
  const x = 0.5 + i*2.65;
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:2.35, h:1.1, fill:{color:f.c}, line:{color:C.accent,pt:1} });
  s.addText(f.t, { x, y:0.85, w:2.35, h:1.1, fontSize:12.5, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" });
  if (i<4) {
    s.addShape(pres.ShapeType.line, { x:x+2.35, y:1.4, w:0.3, h:0, line:{color:C.accentGold,pt:2} });
  }
});

// Table
const innateRows = [
  ["IL-1b", "Macrophages, DCs, inflammasome", "Fever, acute phase response, T-cell co-activation, IL-6 induction", "Anakinra (IL-1RA), Canakinumab"],
  ["TNF-a", "Macrophages, T cells, mast cells", "NF-kB activation, inflammation, cachexia, endothelial activation, apoptosis", "Infliximab, Adalimumab, Etanercept"],
  ["IL-6", "Macrophages, fibroblasts, endothelium", "Acute phase (CRP, fibrinogen, hepcidin), B-cell differentiation, fever, STAT3 activation", "Tocilizumab, Sarilumab"],
  ["IL-12", "DCs, macrophages", "NK and Th1 cell IFN-g induction; critical for intracellular pathogen defense", "Ustekinumab (anti-p40, IL-12/23)"],
  ["IFN-a/b", "Plasmacytoid DCs (pDCs)", "Antiviral ISG induction, NK activation, MHC-I upregulation, STAT1/2 activation", "Pegylated IFN-a therapy (HCV, melanoma)"],
  ["IL-18", "Macrophages, epithelium", "Synergises with IL-12 to amplify IFN-g; NK and Th1 activation; elevated in HLH", "Tadekinig alfa (recombinant IL-18BP)"],
];

const iH = ["Cytokine","Source","Key Actions","Clinical Application"];
const iW = [1.6, 2.6, 5.3, 3.3];
const iX = [0.2, 1.8, 4.4, 9.7];
iH.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:iX[i], y:2.1, w:iW[i], h:0.42, fill:{color:"2D478A"}, line:{color:"000000",pt:0} });
  s.addText(h, { x:iX[i], y:2.1, w:iW[i], h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});
innateRows.forEach((r,ri) => {
  const rowY = 2.52 + ri*0.8;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  r.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:iX[ci], y:rowY, w:iW[ci], h:0.77, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:iX[ci]+0.05, y:rowY, w:iW[ci]-0.1, h:0.77, fontSize:10.5, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle", bold:ci===0 });
  });
});

// ============================================================
// SLIDE 8: TH CELL BALANCE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Adaptive Immunity - Th Cell Balance", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const thCells = [
  { name:"Th1", driver:"IL-12, IL-18, IFN-g", tf:"T-bet / STAT4", produces:"IFN-g, TNF-a, IL-2", protects:"Intracellular pathogens, tumors", disease:"RA, MS, T1DM, IBD", color:"2D5FAF" },
  { name:"Th2", driver:"IL-4, IL-33, TSLP", tf:"GATA3 / STAT6", produces:"IL-4, IL-5, IL-13", protects:"Helminths, extracellular parasites", disease:"Asthma, atopic dermatitis, eosinophilia", color:"B87D1A" },
  { name:"Th17", driver:"TGF-b + IL-6, IL-23", tf:"RORgt / STAT3", produces:"IL-17A/F, IL-22, TNF", protects:"Extracellular bacteria, fungi", disease:"Psoriasis, RA, IBD, AS, MS", color:"7B2D8B" },
  { name:"Treg", driver:"TGF-b, IL-2", tf:"FoxP3 / STAT5", produces:"TGF-b, IL-10, IL-35", protects:"Self-tolerance, homeostasis", disease:"Treg loss -> autoimmunity; excess -> cancer immune evasion", color:C.accentGreen },
];

thCells.forEach((t,i) => {
  const x = 0.2 + i*3.3;
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:3.1, h:6.45, fill:{color:t.color+"20"}, line:{color:t.color,pt:1.5} });
  s.addShape(pres.ShapeType.rect, { x, y:0.85, w:3.1, h:0.62, fill:{color:t.color}, line:{color:"000000",pt:0} });
  s.addText(t.name, { x, y:0.85, w:3.1, h:0.62, fontSize:22, bold:true, color:C.white, align:"center", valign:"middle" });

  const fields = [
    ["Driven by", t.driver],
    ["TF / STAT", t.tf],
    ["Produces", t.produces],
    ["Protects vs", t.protects],
    ["Disease link", t.disease],
  ];
  fields.forEach(([label,val],fi) => {
    const fy = 1.58 + fi*1.09;
    s.addText(label, { x:x+0.1, y:fy, w:2.9, h:0.32, fontSize:10.5, bold:true, color:C.accentGold, fontFace:"Calibri", italic:true });
    s.addText(val, { x:x+0.1, y:fy+0.33, w:2.9, h:0.65, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"top" });
  });
});

// ============================================================
// SLIDE 9: ANTI-INFLAMMATORY CYTOKINES
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Anti-Inflammatory Cytokines - Restoring Balance", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const antiInfl = [
  ["IL-10", "Master anti-inflammatory; produced by Tregs, macrophages, DCs; suppresses TNF, IL-1b, IL-6, IL-12 production; critical in IBD tolerance (IL-10 deficiency causes early-onset colitis in mice and humans)"],
  ["TGF-b", "Promotes Treg (FoxP3+) differentiation and peripheral tolerance; suppresses T-cell and B-cell proliferation; drives fibrosis in chronic states (lung, liver, kidney fibrosis)"],
  ["IL-1RA", "Natural antagonist of IL-1a and IL-1b; binds IL-1 receptor without signaling; recombinant = Anakinra; approved for RA, MAS, Still disease, CAPS; naturally elevated in obesity"],
  ["IL-35", "Produced by Tregs and Bregs; suppresses Th1 and Th17; promotes Treg expansion; impaired in inflammatory disease; potential biologic target"],
  ["IFN-a/b (Type I)", "Anti-inflammatory in some contexts; downregulate cytokine-mediated lethality; upregulate IL-1RA; IFN-b used therapeutically in multiple sclerosis to reduce relapse rate"],
  ["IL-13", "From Th2 cells; anti-inflammatory at low levels (inhibits macrophage activation); pro-fibrotic at high levels; target in asthma (dupilumab blocks IL-4/IL-13 signaling via IL-4Ra)"],
  ["Balance principle", "Homeostasis = balance between pro- (IL-1b, TNF-a, IL-6, IL-17) and anti-inflammatory (IL-10, TGF-b, IL-1RA) cytokines. Chronic pro-inflammatory shift leads to tissue damage in autoimmune, metabolic and infectious disease"],
];

antiInfl.forEach((p, i) => {
  const y = 0.85 + i*0.97;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.92, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:1.8, h:0.92, fill:{color:C.accentGreen+"55"}, line:{color:"000000",pt:0} });
  s.addText(p[0], { x:0.25, y, w:1.75, h:0.92, fontSize:13, bold:true, color:C.accentGreen, fontFace:"Calibri", valign:"middle", align:"center" });
  s.addText(p[1], { x:2.1, y, w:10.85, h:0.92, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 10: AUTOIMMUNE DISEASE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Autoimmune Disease", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const autoimmuneData = [
  { disease:"Rheumatoid Arthritis", cytokines:"TNF-a, IL-1b, IL-6, IL-17A, IL-18", mechanism:"Synovial inflammation, pannus formation, cartilage/bone destruction; RANKL-driven osteoclastogenesis; IL-6->STAT3->acute phase", therapy:"Anti-TNF (infliximab), anti-IL-6R (tocilizumab), anti-IL-17 (secukinumab), JAK inhibitors (baricitinib)" },
  { disease:"Psoriasis", cytokines:"TNF-a, IL-17A/F, IL-23, IL-22", mechanism:"Dysregulated IL-23/IL-17 axis; keratinocyte hyperproliferation; neutrophil recruitment; impaired skin barrier", therapy:"Anti-IL-17 (secukinumab, ixekizumab), anti-IL-23 (guselkumab, risankizumab), anti-TNF, anti-IL-12/23 (ustekinumab)" },
  { disease:"SLE", cytokines:"IFN-a/b, IL-6, IL-10, BLyS/BAFF, IL-17", mechanism:"pDC-derived IFN-a signature; TLR7/9 activation by immune complexes; auto-Ab (anti-dsDNA) production; complement activation", therapy:"Anifrolumab (anti-IFNAR1), belimumab (anti-BLyS), hydroxychloroquine" },
  { disease:"IBD (Crohn/UC)", cytokines:"TNF-a, IL-6, IL-12, IL-23, IL-17, IL-1b", mechanism:"Mucosal barrier disruption; aberrant Th1/Th17 macrophage activation; dysbiosis-triggered cytokine cascade; IL-10 insufficiency", therapy:"Anti-TNF, anti-IL-12/23 (ustekinumab), anti-IL-23 (risankizumab), vedolizumab, JAK inhibitors" },
  { disease:"Multiple Sclerosis", cytokines:"IFN-g, IL-17, TNF-a, IL-12, lymphotoxin", mechanism:"Th1 and Th17 attack on myelin; IL-17 disrupts blood-brain barrier; activated macrophages drive axonal injury", therapy:"IFN-b1a/b (immune modulation), natalizumab, anti-IL-12/23" },
];

const adCols = ["Disease","Key Cytokines","Pathomechanism","Targeted Therapy"];
const adW = [2.0, 2.5, 4.5, 3.9];
const adX = [0.2, 2.2, 4.7, 9.2];
adCols.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:adX[i], y:0.85, w:adW[i], h:0.42, fill:{color:"2D478A"}, line:{color:"000000",pt:0} });
  s.addText(h, { x:adX[i], y:0.85, w:adW[i], h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});
autoimmuneData.forEach((r,ri) => {
  const rowY = 1.27 + ri*1.28;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  const cells = [r.disease, r.cytokines, r.mechanism, r.therapy];
  cells.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:adX[ci], y:rowY, w:adW[ci], h:1.25, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:adX[ci]+0.05, y:rowY, w:adW[ci]-0.1, h:1.25, fontSize:ci===0?12:10.5, bold:ci===0, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle" });
  });
});

// ============================================================
// SLIDE 11: CYTOKINE STORM
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.accentRed} });
s.addText("Cytokine Storm - Pathological Hypercytokinemia", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accentGold} });

const stormPoints = [
  ["Definition", "Life-threatening dysregulated systemic inflammatory response with massive uncontrolled cytokine release, leading to multi-organ failure"],
  ["Triggers", "Infections (sepsis, COVID-19, H5N1 influenza) | Hemophagocytic lymphohistiocytosis (HLH) / Macrophage Activation Syndrome (MAS) | CAR-T cell therapy (CRS) | Immune checkpoint inhibitors | SCT engraftment"],
  ["Key cytokines", "IL-6, IL-1b, TNF-a, IFN-g, IL-18, GM-CSF, M-CSF, MCP-1/CCL2 - positive feedback loops amplify and sustain the response"],
  ["COVID-19", "SARS-CoV-2 -> pDC/macrophage activation -> IL-6 surge -> capillary leak, ARDS, hypercoagulability, MOF; CysLTs co-amplify response; CRP/ferritin/D-dimer markers of severity"],
  ["Sepsis", "Early phase: IL-6, IL-8, TNF-a surge; concurrent anti-inflammatory IL-10 rise; second phase: immunoparalysis; IL-6 alone is strong independent predictor of mortality"],
  ["HLH / MAS", "Massively elevated ferritin (>10,000 ug/L), IL-18, IFN-g; activated macrophages engulf red cells and leukocytes; triggers: EBV, SLE flare, malignancy; sHScore for diagnosis"],
  ["Management", "Tocilizumab (anti-IL-6R): approved for COVID-19 ARDS and CAR-T CRS | Anakinra (IL-1RA): HLH/MAS | Dexamethasone: broad suppression | Ruxolitinib (JAK1/2): salvage in HLH | Emapalumab (anti-IFN-g): primary HLH"],
];

stormPoints.forEach((p, i) => {
  const y = 0.85 + i*0.92;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.87, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:2.0, h:0.87, fill:{color:C.accentRed+"55"}, line:{color:"000000",pt:0} });
  s.addText(p[0], { x:0.25, y, w:1.95, h:0.87, fontSize:12.5, bold:true, color:C.accentRed, fontFace:"Calibri", valign:"middle", align:"center" });
  s.addText(p[1], { x:2.3, y, w:10.65, h:0.87, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 12: CYTOKINES IN CANCER
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Cancer - Friend or Foe?", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

// Left header
s.addShape(pres.ShapeType.rect, { x:0.3, y:0.85, w:6.0, h:0.45, fill:{color:"7A1A1A"}, line:{color:"000000",pt:0} });
s.addText("Tumor-Promoting Cytokines", { x:0.3, y:0.85, w:6.0, h:0.45, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });
// Right header
s.addShape(pres.ShapeType.rect, { x:7.0, y:0.85, w:6.0, h:0.45, fill:{color:C.accentGreen}, line:{color:"000000",pt:0} });
s.addText("Anti-Tumor Cytokines", { x:7.0, y:0.85, w:6.0, h:0.45, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });
s.addShape(pres.ShapeType.line, { x:6.65, y:0.85, w:0, h:6.6, line:{color:C.accent,pt:1.5} });

const proTumor = [
  ["IL-6", "STAT3 activation -> survival, proliferation, angiogenesis; elevated in breast, lung, colon, myeloma; drives cachexia"],
  ["TGF-b", "Immunosuppressive TME; suppresses CTL and NK; promotes EMT, invasion, and metastasis"],
  ["VEGF", "Angiogenesis; bevacizumab target; induced by IL-6, TNF, and hypoxia"],
  ["IL-10", "Immunosuppression in TME; promotes tumor evasion of cytotoxic T cells and NK cells"],
  ["IL-17A", "Promotes angiogenesis and VEGF production; recruits neutrophils to TME"],
  ["Adipokines", "Leptin -> promotes tumor proliferation; obesity -> chronic low-grade cytokine inflammation"],
];
const antiTumor = [
  ["IFN-g", "Activates macrophages; upregulates MHC-I on tumors for CTL killing; PDL-1 induction (checkpoint)"],
  ["TNF-a", "High-dose: direct tumor apoptosis; basis of isolated limb perfusion therapy for melanoma"],
  ["IL-2", "Approved: metastatic melanoma and RCC; promotes CTL/NK expansion; limited by vascular leak syndrome"],
  ["IFN-a", "Approved: hairy cell leukemia, melanoma, Kaposi sarcoma; inhibits tumor proliferation, MHC-I upregulation"],
  ["GM-CSF / G-CSF", "Post-chemo neutropenia (filgrastim, pegfilgrastim); DC differentiation in vaccines"],
  ["IL-12", "Potent antitumor in animal models; activates NK and CTL; used in oncolytic virus and CAR-T combinations"],
];

proTumor.forEach((p,i) => {
  const y = 1.42 + i*1.0;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.3, y, w:6.0, h:0.95, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addText(p[0]+"  ", { x:0.35, y, w:1.2, h:0.95, fontSize:12.5, bold:true, color:C.accentGold, fontFace:"Calibri", valign:"middle" });
  s.addText(p[1], { x:1.55, y, w:4.6, h:0.95, fontSize:11, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});
antiTumor.forEach((p,i) => {
  const y = 1.42 + i*1.0;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:7.0, y, w:6.0, h:0.95, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addText(p[0]+"  ", { x:7.05, y, w:1.4, h:0.95, fontSize:12.5, bold:true, color:C.accentGreen, fontFace:"Calibri", valign:"middle" });
  s.addText(p[1], { x:8.45, y, w:4.4, h:0.95, fontSize:11, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 13: HEMATOPOIESIS & IMMUNODEFICIENCY
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokines in Hematopoiesis & Immunodeficiency", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const haemoPoints = [
  ["CSFs", "G-CSF (IL-3 family) -> neutrophils; M-CSF -> monocytes/macrophages; GM-CSF -> myeloid DCs; EPO -> erythropoiesis; TPO -> megakaryocytes/platelets; IL-3 = pan-hemopoietic stimulus"],
  ["IL-7", "Non-redundant for T and B lymphopoiesis; IL-7Ra mutations -> T-B+NK- SCID; elevated IL-7 in lymphopenia drives homeostatic proliferation of T cells"],
  ["JAK2 V617F", "Gain-of-function mutation: ~95% polycythaemia vera, ~50% ET and MF; constitutive JAK-STAT5 activation -> uncontrolled erythropoiesis; therapeutic target for ruxolitinib"],
  ["gc (CD132) deficiency", "X-linked SCID: loss of common gamma chain shared by IL-2, IL-4, IL-7, IL-9, IL-15, IL-21 receptors -> absent T and NK cells; profound lymphopenia; curative: HSCT or gene therapy"],
  ["JAK3 deficiency", "Autosomal recessive SCID; JAK3 is the intracellular partner of gc chain; phenotype identical to X-SCID; JAK3 inhibitors (tofacitinib) recapitulate SCID in high doses"],
  ["Myeloma and IL-6", "IL-6 via STAT3 -> myeloma cell survival, anti-apoptosis; IL-6 level correlates with disease activity; tocilizumab investigational in myeloma"],
  ["Clinical CSF use", "Filgrastim (G-CSF): post-chemotherapy or autologous HSCT mobilisation; sargramostim (GM-CSF): PBSC mobilisation; EPO analogs: anemia of CKD and cancer; eltrombopag (TPO-Ra) for ITP"],
];

haemoPoints.forEach((p, i) => {
  const y = 0.85 + i*0.97;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.92, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:2.0, h:0.92, fill:{color:C.midBlue+"88"}, line:{color:"000000",pt:0} });
  s.addText(p[0], { x:0.25, y, w:1.95, h:0.92, fontSize:12.5, bold:true, color:C.accent, fontFace:"Calibri", valign:"middle", align:"center" });
  s.addText(p[1], { x:2.3, y, w:10.65, h:0.92, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 14: BIOLOGICS TABLE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Therapeutics - Biologics & JAK Inhibitors", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const drugs = [
  ["Infliximab / Adalimumab / Etanercept", "Anti-TNF-a (mAb / fusion protein)", "RA, IBD, psoriasis, AS, PsA, JIA", "TB / fungal reactivation; demyelination; CHF exacerbation"],
  ["Tocilizumab / Sarilumab", "Anti-IL-6 receptor mAb", "RA, COVID-19 ARDS, CRS, GCA", "IL-6 level rises (receptor blocked); LFT monitoring; bowel perforation (rare)"],
  ["Anakinra / Canakinumab / Rilonacept", "IL-1 antagonists (recombinant IL-1RA; anti-IL-1b mAb)", "RA, gout, CAPS, HLH/MAS, AOSD, cardiovascular inflammation", "Injection site reactions; neutropenia risk; renal dosing adjustment"],
  ["Secukinumab / Ixekizumab", "Anti-IL-17A mAb", "Psoriasis, PsA, ankylosing spondylitis", "IBD flare risk (avoid in IBD patients); Candida infection"],
  ["Ustekinumab", "Anti-IL-12/23 (anti-p40 subunit)", "Psoriasis, PsA, Crohn disease, UC", "Generally well tolerated; PRES (rare); infections"],
  ["Dupilumab", "Anti-IL-4Ra (blocks IL-4 and IL-13)", "Atopic dermatitis, asthma, CRSwNP, EoE", "Conjunctivitis; injection site reactions; well tolerated overall"],
  ["Ruxolitinib / Fedratinib", "JAK1/2 inhibitor (oral)", "Myelofibrosis, PV, COVID-19, HLH, aGVHD", "Anemia, thrombocytopenia; VTE; herpes zoster reactivation"],
  ["Tofacitinib / Baricitinib / Upadacitinib", "JAK inhibitors (JAK1/3; JAK1/2; JAK1)", "RA, UC, PsA, alopecia areata, COVID-19", "VTE risk; lipid changes; serious infection; avoid in high CV risk; MACE warning"],
];

const drugCols = ["Agent", "Target / Class", "Approved Indications", "Key Adverse Effects"];
const dW = [2.9, 2.5, 3.5, 3.9];
const dX = [0.15, 3.05, 5.55, 9.05];
drugCols.forEach((h,i) => {
  s.addShape(pres.ShapeType.rect, { x:dX[i], y:0.85, w:dW[i], h:0.42, fill:{color:"2D478A"}, line:{color:"000000",pt:0} });
  s.addText(h, { x:dX[i], y:0.85, w:dW[i], h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
});
drugs.forEach((r,ri) => {
  const rowY = 1.27 + ri*0.81;
  const bg = ri%2===0 ? "1A2F4B" : "162640";
  r.forEach((cell,ci) => {
    s.addShape(pres.ShapeType.rect, { x:dX[ci], y:rowY, w:dW[ci], h:0.78, fill:{color:bg}, line:{color:C.accent,pt:0.3,transparency:60} });
    s.addText(cell, { x:dX[ci]+0.05, y:rowY, w:dW[ci]-0.1, h:0.78, fontSize:ci===0?11:10, color:ci===0?C.accentGold:C.lightGrey, fontFace:"Calibri", valign:"middle", bold:ci===0 });
  });
});

// ============================================================
// SLIDE 15: CYTOKINE ASSAYS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("Cytokine Assays in the Clinical Laboratory", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const assayPoints = [
  ["Bioassays", "Gold standard; measure biological activity (e.g., T-cell proliferation for IL-2, antiviral assays for IFN); time-consuming, labour-intensive, not practical for routine clinical labs; mainly research/validation use"],
  ["ELISA", "Widely available commercial kits for IL-1a/b, IL-4, IL-5, IL-6, IL-10, IFN-g, TNF-a; single-plex; quantitative; sensitivity: 1-10 pg/mL; Gold standard for individual cytokine measurement in serum, plasma, or BAL"],
  ["Multiplex / Luminex", "Bead-based immunoassay: simultaneously measures 20-100+ cytokines from <100 uL sample; platforms: Luminex xMAP, Meso Scale Discovery (electrochemiluminescence); high sensitivity; inter-platform variability is a known limitation (cross-site standardisation difficult)"],
  ["Flow cytometry ICS", "Intracellular cytokine staining with Brefeldin A/monensin block; cell-level cytokine analysis; identifies cytokine-producing T cells (IFN-g+ CD8+ = antigen-specific); used in transplant, vaccine response, GVHD monitoring"],
  ["CRS / CAR-T grading", "IL-6, IFN-g, ferritin, CRP measured serially; ASTCT CRS grading uses fever + hypotension + hypoxia; IL-6 rise precedes clinical CRS; guides tocilizumab timing"],
  ["Sepsis & COVID-19", "IL-6 strongest predictor of COVID-19 ICU admission; IL-8 correlates with ARDS severity; IL-10 rise indicates immunosuppressive phase; soluble CD163 (macrophage activation marker) elevated in HLH"],
  ["Pathology relevance", "CSF cytokine profiling (IL-6, IL-8, TNF-a) in CNS vasculitis / autoimmune encephalitis; Tumour microenvironment IHC (IL-6, PD-L1/IFN-g axis); HLH diagnosis: soluble CD25 (sIL-2Ra), ferritin, IL-18"],
];

assayPoints.forEach((p, i) => {
  const y = 0.85 + i*0.93;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.88, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:2.0, h:0.88, fill:{color:C.accent+"44"}, line:{color:"000000",pt:0} });
  s.addText(p[0], { x:0.25, y, w:1.95, h:0.88, fontSize:12.5, bold:true, color:C.accent, fontFace:"Calibri", valign:"middle", align:"center" });
  s.addText(p[1], { x:2.3, y, w:10.65, h:0.88, fontSize:11, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 16: DEFICIENCY AND IMMUNOPATHOLOGY
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:"7A1A1A"} });
s.addText("Cytokine Pathway Defects - Clinical Immunopathology", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accentRed} });

const deficiencies = [
  { defect:"IL-12 / IL-12Rb1 deficiency", consequence:"Fail to produce IFN-g -> susceptibility to mycobacteria and Salmonella; Mendelian susceptibility to mycobacterial disease (MSMD); BCG vaccine danger" },
  { defect:"IFN-gR1/R2 deficiency", consequence:"Fatal disseminated mycobacterial infection even with BCG vaccination; recurrent non-typeable Salmonella; diagnostic: absent IFN-g binding on flow" },
  { defect:"IL-10 / IL-10R deficiency", consequence:"Very early onset IBD (<2 years); uncontrolled intestinal inflammation; refractory to standard therapy; curative: allogeneic HSCT" },
  { defect:"gc (CD132) / JAK3 deficiency", consequence:"X-linked SCID (gc) or AR SCID (JAK3): absent T and NK cells; B cells present but non-functional; profound lymphopenia; fatal without HSCT or gene therapy" },
  { defect:"JAK2 V617F gain-of-function", consequence:"Myeloproliferative neoplasms: PV (95%), ET (50%), MF (50%); constitutive STAT5 activation; erythrocytosis, thrombocytosis; target: ruxolitinib" },
  { defect:"STAT1 gain-of-function", consequence:"Chronic mucocutaneous candidiasis; hyperresponsive IFN signaling; impaired Th17 responses; brain aneurysms; treated with JAK inhibitors" },
  { defect:"STAT3 gain-of-function", consequence:"Multi-organ autoimmunity; lymphoproliferation; early-onset IBD, cytopenias, diabetes; loss-of-function STAT3 = Job syndrome (Hyper-IgE)" },
  { defect:"TNFR1 mutations (TRAPS)", consequence:"TNF receptor-associated periodic syndrome; periodic fever, serositis, rash; excessive TNF signaling; treated with anakinra or canakinumab" },
];

deficiencies.forEach((d,i) => {
  const y = 0.85 + i*0.83;
  const bg = i%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x:0.2, y, w:12.9, h:0.78, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addText(d.defect, { x:0.3, y, w:3.7, h:0.78, fontSize:12, bold:true, color:C.accentRed, fontFace:"Calibri", valign:"middle" });
  s.addShape(pres.ShapeType.line, { x:4.05, y:y+0.1, w:0, h:0.58, line:{color:C.accentRed,pt:0.7,transparency:40} });
  s.addText(d.consequence, { x:4.15, y, w:8.8, h:0.78, fontSize:11.5, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 17: KEY CYTOKINES QUICK REFERENCE
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color:C.midBlue} });
s.addText("High-Yield Cytokine Quick Reference", { x:0.3, y:0, w:12.7, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.04, fill:{color:C.accent} });

const quickRef = [
  ["IL-1b","Fever, acute phase, NLRP3 inflammasome product; Anakinra target; drives RA and gout flares"],
  ["IL-2","T-cell growth factor; CTL/NK expansion; high-dose: melanoma/RCC therapy; vascular leak syndrome"],
  ["IL-4","Th2 master; IgE class switching; inhibits macrophage activation; dupilumab target"],
  ["IL-5","Eosinophil differentiation and survival; mepolizumab target in eosinophilic asthma"],
  ["IL-6","Acute phase response, B-cell differentiation, STAT3 cancer survival; tocilizumab target"],
  ["IL-8 (CXCL8)","Neutrophil chemoattractant; angiogenesis; elevated in ARDS, sepsis, COVID-19"],
  ["IL-10","Anti-inflammatory master; Treg, macrophage; IL-10 deficiency = early onset IBD"],
  ["IL-12","Th1 polarisation; NK activation; intracellular pathogen defense; ustekinumab (p40) target"],
  ["IL-17A","Extracellular defense; psoriasis, RA, IBD; secukinumab, ixekizumab targets"],
  ["IL-23","Th17 maintenance; p19 subunit unique; risankizumab, guselkumab targets in psoriasis/IBD"],
  ["TNF-a","NF-kB; inflammation, apoptosis, cachexia; infliximab/adalimumab targets; TB reactivation risk"],
  ["IFN-g","Macrophage activation; MHC-I/II upregulation; elevated in HLH; emapalumab target"],
  ["TGF-b","Treg induction; fibrosis; immunosuppression in TME; EMT in cancer metastasis"],
  ["IFN-a/b","Antiviral ISGs; pDC-derived; type I IFN signature in SLE; anifrolumab target"],
];

const qW1 = 2.0, qW2 = 8.8;
const qPerCol = 7;
quickRef.forEach((r,i) => {
  const col = i < qPerCol ? 0 : 1;
  const row = i < qPerCol ? i : i-qPerCol;
  const x = col===0 ? 0.2 : 6.75;
  const y = 0.85 + row*0.88;
  const bg = row%2===0 ? "1A2F4B" : "162640";
  s.addShape(pres.ShapeType.rect, { x, y, w:6.3, h:0.83, fill:{color:bg}, line:{color:"000000",pt:0} });
  s.addShape(pres.ShapeType.rect, { x, y, w:1.3, h:0.83, fill:{color:C.midBlue+"88"}, line:{color:"000000",pt:0} });
  s.addText(r[0], { x:x+0.05, y, w:1.25, h:0.83, fontSize:13, bold:true, color:C.accent, fontFace:"Calibri", valign:"middle", align:"center" });
  s.addText(r[1], { x:x+1.4, y, w:4.8, h:0.83, fontSize:11, color:C.lightGrey, fontFace:"Calibri", valign:"middle" });
});

// ============================================================
// SLIDE 18: KEY TAKEAWAYS
// ============================================================
s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepNavy} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.06, fill:{color:C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:7.44, w:"100%", h:0.06, fill:{color:C.accentGold} });
s.addText("Key Takeaways", { x:0.5, y:0.1, w:12.3, h:0.68, fontSize:28, bold:true, color:C.white, align:"center", fontFace:"Calibri" });
s.addShape(pres.ShapeType.rect, { x:2.5, y:0.76, w:8.3, h:0.05, fill:{color:C.accent} });

const takeaways = [
  { n:"1", t:"Pleiotropic & Redundant", d:"No single cytokine = single disease; networks overlap - targeting requires understanding the full system" },
  { n:"2", t:"Five Receptor Families", d:"Structural homology drives redundancy; receptor mutations cause immunodeficiency (gc, JAK3) or malignancy (JAK2 V617F)" },
  { n:"3", t:"JAK-STAT is the hub", d:"~60 cytokines signal via JAK-STAT; SOCS proteins provide negative feedback; JAK inhibitors are major immunomodulatory drugs" },
  { n:"4", t:"Th1/Th2/Th17/Treg balance", d:"Th1/Th17 excess -> autoimmunity | Th2 excess -> allergy | Treg excess -> cancer immune evasion" },
  { n:"5", t:"Cytokine Storm = Emergency", d:"IL-6 + IFN-g + TNF positive feedback -> ARDS, MOF; tocilizumab first-line for COVID-19 CRS; anakinra for HLH/MAS" },
  { n:"6", t:"Biologics changed medicine", d:"Anti-TNF, anti-IL-6R, anti-IL-17, anti-IL-23 transformed RA, IBD, psoriasis; adverse effects inform mechanism (TB, IBD, demyelination)" },
  { n:"7", t:"Deficiency = immunopathology", d:"IL-12R/IFN-gR -> MSMD; gc/JAK3 -> SCID; IL-10R -> early IBD; STAT mutations cause gain- or loss-of-function syndromes" },
];

takeaways.forEach((t, i) => {
  const col = i < 4 ? 0 : 1;
  const row = i < 4 ? i : i-4;
  const x = col === 0 ? 0.3 : 6.9;
  const y = 0.88 + row * 1.63;
  s.addShape(pres.ShapeType.rect, { x, y, w:6.3, h:1.55, fill:{color:"1A2F4B"}, line:{color:C.accent,pt:1} });
  s.addShape(pres.ShapeType.rect, { x, y, w:0.65, h:1.55, fill:{color:C.accent+"44"}, line:{color:"000000",pt:0} });
  s.addText(t.n, { x, y, w:0.65, h:1.55, fontSize:22, bold:true, color:C.accent, align:"center", valign:"middle" });
  s.addText(t.t, { x:x+0.75, y:y+0.1, w:5.45, h:0.45, fontSize:14.5, bold:true, color:C.accentGold, fontFace:"Calibri" });
  s.addText(t.d, { x:x+0.75, y:y+0.55, w:5.45, h:0.9, fontSize:12, color:C.lightGrey, fontFace:"Calibri" });
});

// ============================================================
// SAVE
// ============================================================
pres.writeFile({ fileName: "/home/daytona/workspace/cytokines-ppt/Cytokines_Health_Disease.pptx" })
  .then(() => console.log("DONE: /home/daytona/workspace/cytokines-ppt/Cytokines_Health_Disease.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/cytokines-ppt && node build.js 2>&1

Running Command

cd /home/daytona/workspace/cytokines-ppt && sed -i 's/color:C\.accent+"44"/color:"005F6B"/g; s/color:C\.accent+"33"/color:"004F60"/g; s/color:C\.midBlue+"88"/color:"1A4570"/g; s/color:C\.midBlue+"55"/color:"1E4D8C"/g; s/color:C\.accentGreen+"55"/color:"217053"/g; s/color:C\.accentRed+"55"/color:"8C1F22"/g; s/color:t\.color+"20"/color:C.deepNavy/g; s/color:C\.accentGold+"33"/color:"5A3A0A"/g; s/color:C\.accentGold+"44"/color:"6A4A1A"/g; s/+"44"/""/g; s/+"33"/""/g; s/+"88"/""/g; s/+"55"/""/g; s/+"20"/""/g' build.js && node build.js 2>&1 | tail -5

Running Command

ls -lh /home/daytona/workspace/cytokines-ppt/Cytokines_Health_Disease.pptx

This is a shared conversation. Sign in to Orris to start your own chat.