make a ppt using this videos topic and content https://youtu.be/nDklf0bYqeQ?si=rJnUUXXv-v9OWfSw

Reading Web Page

https://youtu.be/nDklf0bYqeQ?si=rJnUUXXv-v9OWfSw

Searching the Web

youtube nDklf0bYqeQ video topic content

Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/acute-gn-ppt && ls /home/daytona/workspace/acut…

Writing File

~/acute-gn-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Acute Glomerulonephritis (PSGN) & Nephritic Syndrome";
pres.author = "Nursing NCLEX Review";

// ─── COLOR PALETTE ────────────────────────────────────────────────────────────
const DARK_NAVY   = "0D1F3C";   // dominant dark bg
const MID_BLUE    = "1B4F8A";   // section headers / accent bars
const TEAL        = "1E8FA3";   // highlight / icon color
const LIGHT_TEAL  = "D0EEF3";   // soft card bg
const WHITE       = "FFFFFF";
const LIGHT_GRAY  = "F0F4F8";
const AMBER       = "F5A623";   // key-point accent
const RED_WARN    = "C0392B";   // warning / danger items
const DARK_TEXT   = "1A1A2E";
const MUTED_TEXT  = "4A6A8A";

// ─── HELPER: full dark bg overlay ────────────────────────────────────────────
function darkBg(slide) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: DARK_NAVY }, line: { color: DARK_NAVY } });
}

function lightBg(slide) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY } });
}

function accentBar(slide, color = MID_BLUE) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: color }, line: { color: color } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color: color }, line: { color: color } });
}

function sectionHeader(slide, title, subtitle = "") {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: MID_BLUE }, line: { color: MID_BLUE } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 2.4, w: 10, h: 0.06, fill: { color: TEAL }, line: { color: TEAL } });
  slide.addText(title, { x: 0.5, y: 1.5, w: 9, h: 1.2, fontSize: 36, bold: true, color: WHITE, align: "center", fontFace: "Calibri" });
  if (subtitle) {
    slide.addText(subtitle, { x: 0.5, y: 2.8, w: 9, h: 0.8, fontSize: 20, color: LIGHT_TEAL, align: "center", fontFace: "Calibri", italic: true });
  }
}

function slideTitle(slide, title, color = MID_BLUE) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: color }, line: { color: color } });
  slide.addText(title, { x: 0.3, y: 0, w: 9.4, h: 0.75, fontSize: 22, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
}

function footerNote(slide, text = "Nursing NCLEX Review | Acute Glomerulonephritis") {
  slide.addText(text, { x: 0.2, y: 5.38, w: 9.6, h: 0.22, fontSize: 9, color: MUTED_TEXT, align: "right", fontFace: "Calibri", italic: true });
}

// ─── CARD helper ─────────────────────────────────────────────────────────────
function card(slide, x, y, w, h, headerText, headerColor, bodyItems) {
  // card bg
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: WHITE }, line: { color: headerColor, pt: 1.5 }, rectRadius: 0.08 });
  // header strip
  slide.addShape(pres.ShapeType.rect, { x, y, w, h: 0.32, fill: { color: headerColor }, line: { color: headerColor } });
  slide.addText(headerText, { x: x + 0.08, y, w: w - 0.16, h: 0.32, fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
  // body bullets
  const items = bodyItems.map((t, i) => ({
    text: t,
    options: { bullet: { code: "25CF", color: headerColor }, fontSize: 11, color: DARK_TEXT, breakLine: i < bodyItems.length - 1, fontFace: "Calibri", paraSpaceAfter: 2 }
  }));
  slide.addText(items, { x: x + 0.1, y: y + 0.36, w: w - 0.2, h: h - 0.42, valign: "top", fontFace: "Calibri" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  // Kidney icon band
  s.addShape(pres.ShapeType.rect, { x: 0, y: 1.4, w: 0.28, h: 2.8, fill: { color: TEAL }, line: { color: TEAL } });
  s.addShape(pres.ShapeType.rect, { x: 9.72, y: 1.4, w: 0.28, h: 2.8, fill: { color: TEAL }, line: { color: TEAL } });

  s.addText("ACUTE GLOMERULONEPHRITIS", {
    x: 0.5, y: 1.1, w: 9, h: 0.9,
    fontSize: 34, bold: true, color: WHITE, align: "center", fontFace: "Calibri", charSpacing: 2
  });
  s.addText("Poststreptococcal (PSGN) • Nephritic Syndrome", {
    x: 0.5, y: 2.05, w: 9, h: 0.55,
    fontSize: 20, color: TEAL, align: "center", fontFace: "Calibri", italic: true
  });
  s.addShape(pres.ShapeType.rect, { x: 2.5, y: 2.7, w: 5, h: 0.05, fill: { color: AMBER }, line: { color: AMBER } });
  s.addText("NCLEX NURSING REVIEW", {
    x: 0.5, y: 2.85, w: 9, h: 0.45,
    fontSize: 16, color: AMBER, align: "center", fontFace: "Calibri", bold: true, charSpacing: 4
  });
  s.addText("Pathophysiology • Clinical Presentation • Diagnosis • Nursing Management", {
    x: 0.5, y: 3.5, w: 9, h: 0.4,
    fontSize: 13, color: LIGHT_TEAL, align: "center", fontFace: "Calibri"
  });
  s.addText("Sources: Robbins Pathology • Comprehensive Clinical Nephrology • Tintinalli's Emergency Medicine", {
    x: 0.5, y: 5.22, w: 9, h: 0.3,
    fontSize: 9, color: MUTED_TEXT, align: "center", fontFace: "Calibri", italic: true
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW & DEFINITION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, TEAL);
  slideTitle(s, "What is Acute Glomerulonephritis?", MID_BLUE);
  footerNote(s);

  // Definition box
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.9, w: 9.3, h: 0.85, fill: { color: MID_BLUE }, line: { color: MID_BLUE }, rectRadius: 0.05 });
  s.addText([
    { text: "Acute Glomerulonephritis (AGN)", options: { bold: true, color: AMBER } },
    { text: " is inflammation of the glomeruli leading to abrupt onset of hematuria, proteinuria, hypertension, and edema — collectively called the ", options: { color: WHITE } },
    { text: "Nephritic Syndrome.", options: { bold: true, color: TEAL } }
  ], { x: 0.55, y: 0.93, w: 8.9, h: 0.78, fontSize: 12.5, valign: "middle", fontFace: "Calibri" });

  // Two columns
  card(s, 0.35, 1.9, 4.4, 2.95, "KEY FACTS", MID_BLUE, [
    "Most common cause: Group A β-hemolytic Streptococcus",
    "Poststreptococcal GN (PSGN) — most studied form",
    "Affects children 6–10 yrs most frequently",
    "Latency: 7–15 days after pharyngitis; 3–5 weeks after impetigo",
    "PSGN decreasing in USA due to early antibiotic treatment",
    "Remains common worldwide"
  ]);

  card(s, 4.95, 1.9, 4.7, 2.95, "NEPHRITIC vs. NEPHROTIC", TEAL, [
    "Onset: Abrupt (nephritic) vs Insidious (nephrotic)",
    "Hematuria + RBC casts: Hallmark of nephritic",
    "Proteinuria: Mild <1g/day (nephritic) vs >3.5g (nephrotic)",
    "Edema: Mild-moderate (nephritic) vs Massive (nephrotic)",
    "BP: RAISED (nephritic) vs Normal (nephrotic)",
    "Serum albumin: Normal/slightly low vs Very low"
  ]);
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — PATHOPHYSIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, MID_BLUE);
  slideTitle(s, "Pathophysiology of PSGN", MID_BLUE);
  footerNote(s);

  // Step-by-step flow
  const steps = [
    { num: "1", title: "Streptococcal Infection", body: "Nephritogenic strains of Group A β-hemolytic Streptococcus infect pharynx or skin (impetigo). Types 1, 4, 12 (M protein typing) responsible for >90% of cases.", color: TEAL },
    { num: "2", title: "Antigen Planting", body: "Streptococcal pyogenic exotoxin B (SpeB) — the principal antigen — is deposited in subendothelial locations within glomerular capillary walls.", color: MID_BLUE },
    { num: "3", title: "Immune Complex Formation", body: "Specific antibodies bind the planted antigens, forming immune complexes in situ. Complexes then migrate across GBM to subepithelial locations (\"humps\").", color: TEAL },
    { num: "4", title: "Complement Activation", body: "C3 and complement cascade activated → low serum C3. Neutrophils & monocytes infiltrate glomeruli. Proliferation of endothelial and mesangial cells.", color: MID_BLUE },
    { num: "5", title: "Reduced GFR & Syndrome", body: "Capillary lumen obliterated → reduced GFR → oliguria, fluid retention, azotemia. Renin release from ischemic kidney → hypertension.", color: TEAL }
  ];

  steps.forEach((step, i) => {
    const col = i < 3 ? 0 : 3;
    const row = i < 3 ? i : i - 3;
    const x = 0.3 + col * 3.25;
    const y = 0.95 + row * 1.5;
    const w = 3.1;
    const h = 1.35;

    if (i < 3) {
      s.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: WHITE }, line: { color: step.color, pt: 1.5 } });
      s.addShape(pres.ShapeType.rect, { x, y, w, h: 0.3, fill: { color: step.color }, line: { color: step.color } });
      s.addText(`${step.num}. ${step.title}`, { x: x + 0.08, y, w: w - 0.16, h: 0.3, fontSize: 11, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
      s.addText(step.body, { x: x + 0.1, y: y + 0.33, w: w - 0.2, h: h - 0.38, fontSize: 9.5, color: DARK_TEXT, fontFace: "Calibri", valign: "top" });
    } else {
      const x2 = 0.3 + (i - 3) * 3.25 + 3.25; 
      const y2 = 0.95 + 0 * 1.5 + (i - 3) * 1.5;
      // Only 2 items in right col, skip re-layout, handled below
    }
  });

  // Right-column overrides for steps 4 and 5
  [[3, 3.55, 0.95], [4, 3.55, 2.45]].forEach(([i, x, y]) => {
    const step = steps[i];
    const w = 3.1;
    const h = 1.35;
    s.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: WHITE }, line: { color: step.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w, h: 0.3, fill: { color: step.color }, line: { color: step.color } });
    s.addText(`${step.num}. ${step.title}`, { x: x + 0.08, y, w: w - 0.16, h: 0.3, fontSize: 11, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(step.body, { x: x + 0.1, y: y + 0.33, w: w - 0.2, h: h - 0.38, fontSize: 9.5, color: DARK_TEXT, fontFace: "Calibri", valign: "top" });
  });

  // Summary box right
  s.addShape(pres.ShapeType.rect, { x: 6.8, y: 0.95, w: 2.85, h: 4.3, fill: { color: DARK_NAVY }, line: { color: TEAL, pt: 1.5 } });
  s.addText("MORPHOLOGY\nSummary", { x: 6.9, y: 1.05, w: 2.65, h: 0.55, fontSize: 12, bold: true, color: TEAL, align: "center", fontFace: "Calibri" });
  const morphItems = [
    { text: "Enlarged, hypercellular glomeruli", options: { bullet: true, fontSize: 9.5, color: WHITE, breakLine: true, fontFace: "Calibri" } },
    { text: "Neutrophil & monocyte infiltration", options: { bullet: true, fontSize: 9.5, color: WHITE, breakLine: true, fontFace: "Calibri" } },
    { text: "Endothelial & mesangial proliferation", options: { bullet: true, fontSize: 9.5, color: WHITE, breakLine: true, fontFace: "Calibri" } },
    { text: "Subepithelial 'humps' (EM)", options: { bullet: true, fontSize: 9.5, color: AMBER, breakLine: true, fontFace: "Calibri", bold: true } },
    { text: "Granular IgG + C3 deposits (immunofluorescence)", options: { bullet: true, fontSize: 9.5, color: WHITE, breakLine: true, fontFace: "Calibri" } },
    { text: "RBC casts in tubules", options: { bullet: true, fontSize: 9.5, color: WHITE, breakLine: false, fontFace: "Calibri" } },
  ];
  s.addText(morphItems, { x: 6.9, y: 1.65, w: 2.65, h: 3.4, valign: "top", fontFace: "Calibri" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — CLINICAL PRESENTATION (Signs & Symptoms)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, TEAL);
  slideTitle(s, "Clinical Presentation & Signs/Symptoms", MID_BLUE);
  footerNote(s);

  // Large symptom cards in a grid
  const symptoms = [
    { icon: "💧", title: "Hematuria", body: "Smoky, tea, or cola-colored urine\nDysmorphic RBCs + RBC casts\nDark color = hallmark sign", color: RED_WARN },
    { icon: "🫧", title: "Proteinuria", body: "Usually <1 g/day (subnephrotic)\nFoamy urine possible\nSerum albumin normal or near-normal", color: TEAL },
    { icon: "📈", title: "Hypertension", body: "Fluid retention + renin release\nMay develop rapidly\nCan cause hypertensive encephalopathy", color: MID_BLUE },
    { icon: "🫧", title: "Edema", body: "Periorbital edema common in children\nGeneralized fluid retention\nWeight gain", color: TEAL },
    { icon: "🔽", title: "Oliguria", body: "Decreased urine output\nAzotemia (elevated BUN & creatinine)\nFluid overload risk", color: RED_WARN },
    { icon: "🤒", title: "Systemic Sx", body: "Malaise, fever, nausea\nHistory of recent sore throat or skin infection\nOccurs 1–2 wks after pharyngitis", color: MID_BLUE }
  ];

  symptoms.forEach((sym, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.22 + col * 3.22;
    const y = 0.95 + row * 2.1;
    const w = 3.0;
    const h = 1.95;
    s.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: WHITE }, line: { color: sym.color, pt: 1.8 }, rectRadius: 0.1 });
    s.addShape(pres.ShapeType.rect, { x, y, w, h: 0.38, fill: { color: sym.color }, line: { color: sym.color } });
    s.addText(`${sym.icon}  ${sym.title}`, { x: x + 0.1, y, w: w - 0.2, h: 0.38, fontSize: 12.5, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(sym.body, { x: x + 0.12, y: y + 0.42, w: w - 0.24, h: h - 0.5, fontSize: 10, color: DARK_TEXT, fontFace: "Calibri", valign: "top" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — LAB FINDINGS & DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, MID_BLUE);
  slideTitle(s, "Laboratory Findings & Diagnosis", MID_BLUE);
  footerNote(s);

  // Left side: table-style lab values
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 5.5, h: 0.38, fill: { color: MID_BLUE }, line: { color: MID_BLUE } });
  s.addText("LAB TEST", { x: 0.4, y: 0.9, w: 2.4, h: 0.38, fontSize: 11, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
  s.addText("EXPECTED FINDING", { x: 2.8, y: 0.9, w: 3.0, h: 0.38, fontSize: 11, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });

  const labs = [
    ["Urinalysis", "Hematuria, RBC casts, proteinuria, granular casts"],
    ["ASO Titer / Anti-DNase B", "ELEVATED (streptococcal antibodies)"],
    ["Streptozyme Test", "ELEVATED (combined streptococcal test)"],
    ["Serum C3 (complement)", "DECREASED — key finding"],
    ["BUN & Creatinine", "ELEVATED (azotemia)"],
    ["Serum Albumin", "Normal or slightly reduced"],
    ["Throat/Skin Culture", "May identify Group A Streptococcus"],
    ["CBC", "May show leukocytosis"],
    ["Renal Biopsy", "Usually NOT needed; done if atypical features"],
  ];

  labs.forEach((row, i) => {
    const y = 1.33 + i * 0.41;
    const bg = i % 2 === 0 ? WHITE : LIGHT_GRAY;
    s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 5.5, h: 0.41, fill: { color: bg }, line: { color: LIGHT_GRAY } });
    s.addText(row[0], { x: 0.4, y, w: 2.35, h: 0.41, fontSize: 10, color: DARK_TEXT, valign: "middle", fontFace: "Calibri", bold: i === 3, margin: 0 });
    const isKey = row[1].includes("ELEVATED") || row[1].includes("DECREASED");
    s.addText(row[1], { x: 2.8, y, w: 2.95, h: 0.41, fontSize: 10, color: isKey ? (row[1].includes("DEC") ? RED_WARN : MID_BLUE) : DARK_TEXT, valign: "middle", fontFace: "Calibri", bold: isKey, margin: 0 });
  });

  // Right side: diagnostic criteria highlight
  s.addShape(pres.ShapeType.rect, { x: 6.05, y: 0.9, w: 3.65, h: 4.35, fill: { color: DARK_NAVY }, line: { color: TEAL, pt: 1.5 } });
  s.addText("DIAGNOSTIC\nCRITERIA", { x: 6.15, y: 0.98, w: 3.45, h: 0.65, fontSize: 14, bold: true, color: TEAL, align: "center", fontFace: "Calibri" });

  const criteria = [
    ["Recent strep infection", AMBER],
    ["Hematuria + RBC casts", WHITE],
    ["Low serum C3", WHITE],
    ["Elevated ASO/Anti-DNase B", WHITE],
    ["Hypertension + edema", WHITE],
    ["Periorbital edema (children)", WHITE],
  ];
  criteria.forEach(([text, color], i) => {
    s.addShape(pres.ShapeType.rect, { x: 6.15, y: 1.75 + i * 0.5, w: 0.28, h: 0.28, fill: { color: TEAL }, line: { color: TEAL } });
    s.addText("✓", { x: 6.15, y: 1.75 + i * 0.5, w: 0.28, h: 0.28, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(text, { x: 6.5, y: 1.75 + i * 0.5, w: 3.1, h: 0.3, fontSize: 10.5, color, valign: "middle", fontFace: "Calibri" });
  });

  s.addText("Biopsy NOT routinely needed\nunless atypical presentation", {
    x: 6.15, y: 4.8, w: 3.45, h: 0.4, fontSize: 9.5, color: AMBER, align: "center", fontFace: "Calibri", italic: true
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — NURSING ASSESSMENT (NCLEX Focus)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, TEAL);
  slideTitle(s, "Nursing Assessment — NCLEX Priority", MID_BLUE);
  footerNote(s);

  card(s, 0.25, 0.9, 4.55, 3.0, "SUBJECTIVE DATA (History)", MID_BLUE, [
    "Recent sore throat or skin infection (impetigo)?",
    "When did it occur? (latency 1–5 weeks)",
    "Decreased urine output noticed?",
    "Swelling of face / eyes (periorbital edema)?",
    "Headache (hypertensive encephalopathy risk?)",
    "Family history of kidney disease",
    "Current medications / antibiotics taken?"
  ]);

  card(s, 5.05, 0.9, 4.55, 3.0, "OBJECTIVE DATA (Assessment)", TEAL, [
    "Vital signs: BP elevated? HR and RR?",
    "Weight: daily weights for fluid monitoring",
    "Urine: color (tea/cola), amount, odor",
    "Edema: periorbital, peripheral, pitting?",
    "Auscultate lungs: crackles = fluid overload",
    "Skin: pallor, turgor",
    "Neuro: LOC, headache, visual changes"
  ]);

  // Priority nursing concerns
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 4.02, w: 9.5, h: 0.38, fill: { color: AMBER }, line: { color: AMBER } });
  s.addText("⚠  NCLEX PRIORITY: Monitor BP closely — hypertensive crisis can lead to seizures and encephalopathy!", {
    x: 0.35, y: 4.02, w: 9.3, h: 0.38, fontSize: 11.5, bold: true, color: DARK_NAVY, valign: "middle", fontFace: "Calibri", margin: 0
  });

  s.addText([
    { text: "Priority Nursing Diagnoses: ", options: { bold: true, color: MID_BLUE } },
    { text: "Fluid Volume Excess  •  Risk for Impaired Kidney Function  •  Activity Intolerance  •  Anxiety", options: { color: DARK_TEXT } }
  ], { x: 0.25, y: 4.48, w: 9.5, h: 0.45, fontSize: 11, valign: "middle", fontFace: "Calibri" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — NURSING INTERVENTIONS & MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, MID_BLUE);
  slideTitle(s, "Nursing Interventions & Medical Management", MID_BLUE);
  footerNote(s);

  card(s, 0.25, 0.9, 3.0, 4.22, "FLUID MANAGEMENT", TEAL, [
    "Strict I&O monitoring",
    "Daily weights (same time, same scale)",
    "Fluid restriction if ordered",
    "Monitor for pulmonary edema",
    "Diuretics (furosemide) as ordered",
    "Sodium restriction diet",
    "Elevate HOB for dyspnea"
  ]);

  card(s, 3.45, 0.9, 3.0, 4.22, "BLOOD PRESSURE CONTROL", MID_BLUE, [
    "Monitor BP every 4 hrs or more",
    "Antihypertensives as ordered",
    "Calcium channel blockers / ACE inhibitors",
    "Limit activity during acute phase",
    "Bed rest as needed",
    "Avoid stimulants / stress",
    "BP usually resolves in 1–2 weeks"
  ]);

  card(s, 6.65, 0.9, 3.1, 4.22, "ANTIBIOTICS & INFECTION", RED_WARN, [
    "Penicillin or amoxicillin if strep still active",
    "Antibiotics do NOT alter course of GN",
    "Prevent spread of strep to contacts",
    "Throat or skin cultures if not done",
    "Educate about completing full course",
    "Monitor for medication side effects",
    "No vaccines needed specifically for GN"
  ]);
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — DIET, PATIENT EDUCATION, DISCHARGE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, TEAL);
  slideTitle(s, "Diet Restrictions, Education & Discharge Planning", MID_BLUE);
  footerNote(s);

  // Diet table
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.9, w: 4.5, h: 0.35, fill: { color: MID_BLUE }, line: { color: MID_BLUE } });
  s.addText("DIETARY CONSIDERATIONS", { x: 0.35, y: 0.9, w: 4.3, h: 0.35, fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });

  const dietRows = [
    ["Sodium", "RESTRICT — reduces fluid retention & BP"],
    ["Potassium", "RESTRICT if hyperkalemia present"],
    ["Protein", "May be restricted if azotemia present"],
    ["Fluid intake", "RESTRICT — prevent fluid overload"],
    ["Calories", "Adequate to prevent catabolism"],
  ];
  dietRows.forEach(([item, detail], i) => {
    const y = 1.28 + i * 0.42;
    s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 4.5, h: 0.42, fill: { color: i % 2 === 0 ? WHITE : LIGHT_GRAY }, line: { color: LIGHT_GRAY } });
    s.addText(item, { x: 0.35, y, w: 1.5, h: 0.42, fontSize: 10.5, bold: true, color: TEAL, valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(detail, { x: 1.9, y, w: 2.75, h: 0.42, fontSize: 10, color: DARK_TEXT, valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  card(s, 0.25, 3.4, 4.5, 1.7, "DISCHARGE CRITERIA", MID_BLUE, [
    "Stable BP, no antihypertensives or managed at home",
    "Urine output improved / normalizing",
    "Labs improving (C3 recovering, creatinine stable)",
    "Nephrologist follow-up arranged"
  ]);

  // Patient education
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.9, w: 4.75, h: 0.35, fill: { color: TEAL }, line: { color: TEAL } });
  s.addText("PATIENT & FAMILY EDUCATION", { x: 5.1, y: 0.9, w: 4.55, h: 0.35, fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });

  const eduItems = [
    { text: "Recognize recurrent strep symptoms early (sore throat, fever)", color: DARK_TEXT },
    { text: "Seek immediate medical care with any strep-like illness", color: DARK_TEXT },
    { text: "Take antibiotics as prescribed — complete the full course", color: DARK_TEXT },
    { text: "Monitor urine daily for color changes at home", color: DARK_TEXT },
    { text: "Monitor blood pressure at home if equipment available", color: DARK_TEXT },
    { text: "Low-sodium diet instructions given and understood", color: DARK_TEXT },
    { text: "Activity restrictions: avoid strenuous exercise until resolved", color: DARK_TEXT },
    { text: "Report headaches, visual changes, or reduced urination STAT", color: RED_WARN },
    { text: "Follow-up labs: repeat urinalysis, BMP, complement levels", color: DARK_TEXT },
  ];
  eduItems.forEach((item, i) => {
    s.addText([
      { text: "• ", options: { bold: true, color: TEAL } },
      { text: item.text, options: { color: item.color } }
    ], { x: 5.1, y: 1.3 + i * 0.41, w: 4.55, h: 0.38, fontSize: 10, valign: "middle", fontFace: "Calibri" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — COMPLICATIONS & PROGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  accentBar(s, RED_WARN);
  slideTitle(s, "Complications & Prognosis", RED_WARN);
  footerNote(s);

  const complications = [
    { title: "Hypertensive Encephalopathy", detail: "Severe HTN → cerebral edema → headache, visual changes, seizures, altered LOC. EMERGENCY.", color: RED_WARN },
    { title: "Acute Kidney Injury (AKI)", detail: "Rapid GFR decline → oliguria/anuria → fluid overload, electrolyte imbalances.", color: RED_WARN },
    { title: "Pulmonary Edema / CHF", detail: "Fluid retention overloads cardiovascular system → respiratory distress. Elevate HOB, O2, diuretics.", color: RED_WARN },
    { title: "Rapidly Progressive GN (RPGN)", detail: "Occurs in <1% of children; crescentic GN pattern. Kidney function deteriorates over days/weeks.", color: MID_BLUE },
    { title: "Chronic GN / CKD", detail: "Adults at higher risk of not fully recovering. Persistent proteinuria + hematuria = poor prognosis.", color: MID_BLUE },
    { title: "Hyperkalemia", detail: "Transient hyporeninemic hypoaldosteronism can cause dangerous hyperkalemia → cardiac arrhythmias.", color: TEAL },
  ];

  complications.forEach((comp, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.25 + col * 4.9;
    const y = 0.9 + row * 1.55;
    const w = 4.6;
    const h = 1.42;
    s.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: WHITE }, line: { color: comp.color, pt: 2 }, rectRadius: 0.08 });
    s.addShape(pres.ShapeType.rect, { x, y, w, h: 0.32, fill: { color: comp.color }, line: { color: comp.color } });
    s.addText(comp.title, { x: x + 0.1, y, w: w - 0.2, h: 0.32, fontSize: 11.5, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(comp.detail, { x: x + 0.12, y: y + 0.36, w: w - 0.24, h: h - 0.44, fontSize: 10, color: DARK_TEXT, fontFace: "Calibri", valign: "top" });
  });

  // Prognosis bar
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.27, w: 9.5, h: 0.32, fill: { color: DARK_NAVY }, line: { color: DARK_NAVY } });
  s.addText("PROGNOSIS: >95% of children recover fully with conservative therapy | Adults: ~60% recover promptly | Persistent proteinuria = poor prognosis", {
    x: 0.35, y: 5.27, w: 9.3, h: 0.32, fontSize: 9.5, color: AMBER, valign: "middle", fontFace: "Calibri", align: "center", margin: 0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — NCLEX-STYLE REVIEW QUESTIONS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.65, fill: { color: TEAL }, line: { color: TEAL } });
  s.addText("NCLEX-STYLE PRACTICE QUESTIONS", {
    x: 0.3, y: 0, w: 9.4, h: 0.65, fontSize: 20, bold: true, color: WHITE, valign: "middle", align: "center", fontFace: "Calibri", margin: 0
  });
  footerNote(s);

  const questions = [
    {
      q: "1. A child presents with tea-colored urine, periorbital edema, and a history of a sore throat 10 days ago. Which lab finding do you MOST expect?",
      a: "Answer: Low serum C3 (complement) + elevated ASO titer — classic for poststreptococcal GN"
    },
    {
      q: "2. What is the PRIORITY nursing assessment for a patient admitted with acute glomerulonephritis?",
      a: "Answer: Blood pressure monitoring — hypertension is the priority due to risk of hypertensive encephalopathy"
    },
    {
      q: "3. A patient with PSGN has a potassium level of 6.2 mEq/L. What is the nurse's FIRST action?",
      a: "Answer: Notify the physician immediately — severe hyperkalemia (>6.0) risks fatal cardiac arrhythmia"
    },
    {
      q: "4. Which dietary instruction is MOST important for the nurse to give a patient with PSGN?",
      a: "Answer: Restrict sodium and fluid intake to reduce edema and hypertension"
    },
  ];

  questions.forEach((item, i) => {
    const y = 0.75 + i * 1.17;
    s.addShape(pres.ShapeType.roundRect, { x: 0.25, y, w: 9.5, h: 1.1, fill: { color: "122040" }, line: { color: TEAL, pt: 1 }, rectRadius: 0.06 });
    s.addText(item.q, { x: 0.45, y: y + 0.05, w: 9.1, h: 0.48, fontSize: 10.5, color: WHITE, fontFace: "Calibri", valign: "top" });
    s.addShape(pres.ShapeType.rect, { x: 0.45, y: y + 0.56, w: 9.1, h: 0.02, fill: { color: TEAL }, line: { color: TEAL } });
    s.addText(item.a, { x: 0.45, y: y + 0.61, w: 9.1, h: 0.42, fontSize: 10.5, color: AMBER, fontFace: "Calibri", valign: "top", bold: true });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SUMMARY / WRAP-UP
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.7, fill: { color: TEAL }, line: { color: TEAL } });
  s.addText("KEY TAKEAWAYS — NCLEX MEMORY POINTS", {
    x: 0.3, y: 0, w: 9.4, h: 0.7, fontSize: 18, bold: true, color: WHITE, valign: "middle", align: "center", fontFace: "Calibri", margin: 0
  });
  footerNote(s);

  const points = [
    ["Cause", "Group A β-hemolytic Streptococcus — nephritogenic strains"],
    ["Latency", "7–15 days after pharyngitis; 3–5 weeks after impetigo"],
    ["Classic Triad", "Hematuria (tea-colored) + Edema + Hypertension"],
    ["Key Lab", "Low C3 + Elevated ASO titer + RBC casts in urine"],
    ["Treatment", "Supportive: antihypertensives, diuretics, fluid/sodium restriction"],
    ["Antibiotics", "Penicillin to eradicate strep — does NOT change GN course"],
    ["Prognosis", ">95% children recover; adults have higher risk of progression"],
    ["Nursing Priority", "Monitor BP + Daily weights + Strict I&O + Urine color"],
    ["Danger Signs", "Headache + Visual changes + Oliguria → notify provider STAT"],
  ];

  points.forEach(([label, detail], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i < 5 ? i : i - 5;
    const x = 0.25 + col * 5.05;
    const y = 0.85 + row * 0.88;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.8, h: 0.78, fill: { color: "122040" }, line: { color: TEAL, pt: 0.75 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 1.35, h: 0.78, fill: { color: MID_BLUE }, line: { color: MID_BLUE } });
    s.addText(label, { x: x + 0.08, y, w: 1.22, h: 0.78, fontSize: 11, bold: true, color: AMBER, valign: "middle", fontFace: "Calibri", align: "center", margin: 0 });
    s.addText(detail, { x: x + 1.42, y: y + 0.05, w: 3.3, h: 0.68, fontSize: 10, color: WHITE, valign: "middle", fontFace: "Calibri" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/acute-gn-ppt/Acute_Glomerulonephritis_NCLEX.pptx" })
  .then(() => console.log("✅ Saved: Acute_Glomerulonephritis_NCLEX.pptx"))
  .catch(err => { console.error("Error:", err); process.exit(1); });
Running Command

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

Running Command

ls -lh /home/daytona/workspace/acute-gn-ppt/Acute_Glomerulonephritis_NCLEX.pptx

Your presentation is ready! Download it here:

Acute Glomerulonephritis NCLEX

Presentation · PPTX


Here's what's inside the 11-slide deck (dark navy + teal + amber color scheme, styled for a professional nursing review):
SlideContent
1Title slide — Acute GN / PSGN / Nephritic Syndrome NCLEX Review
2Overview & Definition — What is AGN, Nephritic vs Nephrotic comparison table
3Pathophysiology — 5-step mechanism (strep infection → immune complex → complement → GFR drop) + Morphology summary (humps, RBC casts, IgG/C3 deposits)
4Clinical Presentation — 6 symptom cards: hematuria, proteinuria, hypertension, edema, oliguria, systemic symptoms
5Lab Findings & Diagnosis — Full lab table (ASO, C3, urinalysis, BUN/Cr, biopsy) + diagnostic criteria checklist
6Nursing Assessment (NCLEX priority) — Subjective + Objective data, priority nursing diagnoses, hypertensive crisis alert
7Nursing Interventions — Fluid management, BP control, antibiotics
8Diet, Education & Discharge — Sodium/potassium/protein/fluid restrictions, patient teaching, discharge criteria
9Complications & Prognosis — 6 complication cards (encephalopathy, AKI, pulmonary edema, RPGN, CKD, hyperkalemia) + prognosis stats
10NCLEX Practice Questions — 4 Q&A in exam format
11Key Takeaways — 9-point memory card for last-minute review
Content sourced from Robbins Pathology, Comprehensive Clinical Nephrology, and Tintinalli's Emergency Medicine.

make a ppt on glomerulonephritis, Detailed definition, mechanism, Causes of glomerulonephritis and how each cause actually leads to glomerulonephritis, Risk factors, Clinical signs and symptoms, Diagnosis;physical, laboratory test to do and what will actually be noticed in those lab tests, imaging tests to do and why, Step by step treatment plan for glomerulonephritis

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Writing File

~/acute-gn-ppt/build_detailed_gn.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Glomerulonephritis — Comprehensive Medical Review";

// ═══════════════════════════════════════
// PALETTE
// ═══════════════════════════════════════
const NAVY      = "0B1E3D";
const DEEP_BLUE = "1A3A6B";
const MID_BLUE  = "1E5FA8";
const TEAL      = "0E9AA7";
const TEAL_LT   = "D5F0F3";
const WHITE     = "FFFFFF";
const LT_GRAY   = "F2F5F9";
const AMBER     = "F5A623";
const RED       = "C0392B";
const GREEN     = "1A7A3E";
const DARK_TXT  = "1A1A2E";
const MUTED     = "5A6A80";

// ═══════════════════════════════════════
// HELPERS
// ═══════════════════════════════════════
function bg(slide, color) {
  slide.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:5.625, fill:{color}, line:{color} });
}
function topBar(slide, color=MID_BLUE) {
  slide.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:0.72, fill:{color}, line:{color} });
}
function titleText(slide, title, sub="") {
  topBar(slide);
  slide.addText(title, { x:0.3,y:0,w:9.4,h:0.72, fontSize:21, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
  if (sub) {
    slide.addShape(pres.ShapeType.rect, { x:0,y:0.72,w:10,h:0.06, fill:{color:TEAL}, line:{color:TEAL} });
    slide.addText(sub, { x:0.3,y:0.8,w:9.4,h:0.28, fontSize:11, color:MUTED, fontFace:"Calibri", italic:true });
  }
}
function footer(slide, txt="Glomerulonephritis — Comprehensive Medical Review") {
  slide.addText(txt, { x:0.2,y:5.42,w:9.6,h:0.18, fontSize:8, color:MUTED, align:"right", fontFace:"Calibri", italic:true });
}
function sectionSlide(slide, title, subtitle="") {
  bg(slide, NAVY);
  slide.addShape(pres.ShapeType.rect, { x:0,y:2.2,w:10,h:0.07, fill:{color:TEAL}, line:{color:TEAL} });
  slide.addShape(pres.ShapeType.rect, { x:0,y:0,w:0.18,h:5.625, fill:{color:TEAL}, line:{color:TEAL} });
  slide.addText(title, { x:0.4,y:1.3,w:9.2,h:1.1, fontSize:38, bold:true, color:WHITE, align:"center", fontFace:"Calibri" });
  if (subtitle) slide.addText(subtitle, { x:0.4,y:2.5,w:9.2,h:0.7, fontSize:17, color:TEAL, align:"center", fontFace:"Calibri", italic:true });
}

// card with header strip + body bullets
function card(slide, x, y, w, h, hdrTxt, hdrColor, bullets, fontSize=10) {
  slide.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:WHITE}, line:{color:hdrColor, pt:1.5}, rectRadius:0.07 });
  slide.addShape(pres.ShapeType.rect,      { x,y,w,h:0.3, fill:{color:hdrColor}, line:{color:hdrColor} });
  slide.addText(hdrTxt, { x:x+0.08,y,w:w-0.16,h:0.3, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
  const items = bullets.map((t,i)=>({ text:t, options:{ bullet:{code:"25CF",color:hdrColor}, fontSize, color:DARK_TXT, breakLine:i<bullets.length-1, fontFace:"Calibri", paraSpaceAfter:2 } }));
  slide.addText(items, { x:x+0.1,y:y+0.34,w:w-0.2,h:h-0.4, valign:"top", fontFace:"Calibri" });
}

// numbered step box
function stepBox(slide, x, y, w, h, num, title, body, color) {
  slide.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:WHITE}, line:{color, pt:1.5}, rectRadius:0.07 });
  slide.addShape(pres.ShapeType.rect,      { x,y,w,h:0.32, fill:{color}, line:{color} });
  slide.addText(`${num}. ${title}`, { x:x+0.08,y,w:w-0.16,h:0.32, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
  slide.addText(body, { x:x+0.1,y:y+0.35,w:w-0.2,h:h-0.42, fontSize:9.5, color:DARK_TXT, fontFace:"Calibri", valign:"top" });
}

// row in a table (alternating shading)
function tblRow(slide, x, y, w, h, cells, bg_color, col_widths) {
  let cx = x;
  slide.addShape(pres.ShapeType.rect, { x,y,w,h, fill:{color:bg_color}, line:{color:"D0D8E4"} });
  cells.forEach((cell,i)=>{
    slide.addText(cell.text, { x:cx+0.05,y,w:col_widths[i]-0.1,h, fontSize:cell.size||10, bold:cell.bold||false, color:cell.color||DARK_TXT, valign:"middle", fontFace:"Calibri", margin:0 });
    cx += col_widths[i];
  });
}


// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 1 — TITLE
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, NAVY);
  s.addShape(pres.ShapeType.rect, { x:0,y:0,w:0.22,h:5.625, fill:{color:TEAL}, line:{color:TEAL} });
  s.addShape(pres.ShapeType.rect, { x:9.78,y:0,w:0.22,h:5.625, fill:{color:TEAL}, line:{color:TEAL} });
  s.addText("GLOMERULONEPHRITIS", { x:0.4,y:0.9,w:9.2,h:1.1, fontSize:42, bold:true, color:WHITE, align:"center", fontFace:"Calibri", charSpacing:3 });
  s.addShape(pres.ShapeType.rect, { x:1.8,y:2.1,w:6.4,h:0.06, fill:{color:AMBER}, line:{color:AMBER} });
  s.addText("A Comprehensive Medical Review", { x:0.4,y:2.22,w:9.2,h:0.55, fontSize:20, color:AMBER, align:"center", fontFace:"Calibri" });
  s.addText("Definition  •  Mechanisms  •  Causes  •  Risk Factors\nSigns & Symptoms  •  Diagnosis  •  Treatment Plan", {
    x:0.4,y:2.95,w:9.2,h:0.85, fontSize:14, color:TEAL, align:"center", fontFace:"Calibri", italic:true
  });
  s.addShape(pres.ShapeType.rect, { x:0.4,y:4.0,w:9.2,h:0.06, fill:{color:DEEP_BLUE}, line:{color:DEEP_BLUE} });
  s.addText("Sources: Robbins & Cotran Pathology  •  Comprehensive Clinical Nephrology, 7e  •  Goldman-Cecil Medicine  •  Brenner & Rector's The Kidney", {
    x:0.4,y:4.12,w:9.2,h:0.3, fontSize:9, color:MUTED, align:"center", fontFace:"Calibri", italic:true
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 2 — DETAILED DEFINITION & OVERVIEW
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Detailed Definition & Overview", "Understanding the glomerular unit and what goes wrong in glomerulonephritis");
  footer(s);

  // Definition box
  s.addShape(pres.ShapeType.rect, { x:0.3,y:1.15,w:9.4,h:0.98, fill:{color:DEEP_BLUE}, line:{color:DEEP_BLUE}, rectRadius:0.07 });
  s.addText([
    { text:"Glomerulonephritis (GN)  ", options:{ bold:true, color:AMBER, fontSize:13 } },
    { text:"is a group of kidney disorders characterized by ", options:{ color:WHITE, fontSize:12 } },
    { text:"inflammation of the glomeruli", options:{ bold:true, color:TEAL, fontSize:12 } },
    { text:" — the tiny filtration units of the kidney. This inflammation damages the glomerular filtration barrier, leading to leakage of red blood cells and protein into the urine, impaired waste clearance, fluid retention, and elevated blood pressure. GN may be ", options:{ color:WHITE, fontSize:12 } },
    { text:"primary (intrinsic to kidney) or secondary (systemic disease)", options:{ bold:true, color:AMBER, fontSize:12 } },
    { text:", and may present acutely, subacutely, or chronically.", options:{ color:WHITE, fontSize:12 } },
  ], { x:0.45,y:1.18,w:9.1,h:0.92, valign:"middle", fontFace:"Calibri" });

  // 3 anatomy concept cards
  card(s, 0.3, 2.27, 3.0, 3.05, "THE GLOMERULUS", MID_BLUE, [
    "Tuft of capillaries in Bowman's capsule",
    "~1 million glomeruli per kidney",
    "3-layer filtration barrier:",
    "  → Fenestrated endothelium",
    "  → Glomerular basement membrane (GBM)",
    "  → Podocyte foot processes + slit diaphragm",
    "Normally retains cells & large proteins",
    "Filters ~180 L of plasma daily",
  ], 9.5);

  card(s, 3.5, 2.27, 3.0, 3.05, "WHAT IS DAMAGED IN GN", TEAL, [
    "Endothelial cells → increased permeability",
    "GBM → structural disruption",
    "Podocytes → proteinuria (foot process effacement)",
    "Mesangial cells → proliferate & inflame",
    "Bowman capsule → crescent formation (severe)",
    "Tubules → impaired resorption",
    "GFR falls → oliguria, azotemia",
  ], 9.5);

  card(s, 6.7, 2.27, 3.0, 3.05, "KEY SYNDROMES IN GN", DEEP_BLUE, [
    "Nephritic Syndrome — hematuria + HTN + edema",
    "Nephrotic Syndrome — massive proteinuria + edema",
    "Rapidly Progressive GN (RPGN) — crescentic",
    "Asymptomatic urinary abnormalities",
    "Chronic GN → CKD → ESRD",
    "Acute Kidney Injury (AKI) — sudden GFR drop",
    "Overlap syndromes common in MPGN, lupus",
  ], 9.5);
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SECTION DIVIDER — MECHANISM
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  sectionSlide(s, "MECHANISM", "How immune injury destroys the glomerular filtration barrier");
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 4 — MECHANISM PT 1: Immune Pathways
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Mechanisms of Glomerular Injury — Immune Pathways", "Immune mechanisms underlie most forms of primary and many secondary GN");
  footer(s);

  const steps = [
    { n:"1", t:"In Situ Immune Complex Formation", b:"Antibodies react directly within the glomerulus to fixed (intrinsic) glomerular antigens (e.g., anti-GBM antibodies targeting type IV collagen NC1 domain) or planted exogenous antigens (e.g., streptococcal antigens). Triggers immediate complement + leukocyte response.", c:TEAL },
    { n:"2", t:"Circulating Immune Complex Deposition", b:"Pre-formed antigen-antibody complexes from the systemic circulation (e.g., SLE, infections) deposit in glomerular capillary walls. Granular 'lumpy-bumpy' deposits seen on immunofluorescence. C3 activated → complement cascade.", c:MID_BLUE },
    { n:"3", t:"Complement Activation", b:"Both classical pathway (via IgG/IgM) and alternative pathway (C3 nephritic factor in MPGN) are activated. Membrane attack complex (MAC, C5b-9) directly injures GBM. C3a, C5a recruit neutrophils and monocytes.", c:TEAL },
    { n:"4", t:"Leukocyte Infiltration & Cell Proliferation", b:"Neutrophils and monocytes infiltrate the glomerulus. Mesangial and endothelial cells proliferate. Oxidants, proteases, cytokines (IL-1, TNF-α, TGF-β) released — further destroying GBM and podocyte foot processes.", c:MID_BLUE },
    { n:"5", t:"Crescent Formation (Severe GN)", b:"Severe immune injury ruptures the GBM. Plasma proteins (including fibrin) leak into Bowman's space → fibrin scaffold. Parietal epithelial cells + macrophages proliferate → 'crescent' shape. GFR collapses → RPGN.", c:RED },
    { n:"6", t:"T-Cell Mediated Injury", b:"CD4+ and CD8+ T cells also contribute, particularly in ANCA-associated vasculitis (GPA, MPA) and some forms of lupus nephritis. T cells activate macrophages → more cytokines → persistent inflammation even without antibody deposits.", c:DEEP_BLUE },
  ];

  steps.forEach((st, i)=>{
    const col = i % 3;
    const row = Math.floor(i / 3);
    stepBox(s, 0.28 + col*3.26, 1.12 + row*2.12, 3.1, 1.97, st.n, st.t, st.b, st.c);
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 5 — MECHANISM PT 2: Downstream Effects
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Mechanism — Downstream Consequences of Glomerular Injury");
  footer(s);

  // Flow diagram using boxes + arrows
  const flowItems = [
    { t:"Glomerular Inflammation\n& Immune Complex Deposition", c:DEEP_BLUE, x:0.25, y:1.05, w:2.5, h:0.85 },
    { t:"↓ GBM Integrity\nEndothelial + Podocyte Injury", c:MID_BLUE, x:3.3, y:1.05, w:2.5, h:0.85 },
    { t:"Reduced Glomerular\nFiltration Rate (GFR)", c:TEAL, x:6.35, y:1.05, w:3.0, h:0.85 },
  ];
  flowItems.forEach(f=>{
    s.addShape(pres.ShapeType.roundRect, { x:f.x,y:f.y,w:f.w,h:f.h, fill:{color:f.c}, line:{color:f.c}, rectRadius:0.08 });
    s.addText(f.t, { x:f.x+0.08,y:f.y,w:f.w-0.16,h:f.h, fontSize:10.5, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri" });
  });
  // arrows
  [[2.75,1.47],[5.8,1.47]].forEach(([x,y])=>{
    s.addShape(pres.ShapeType.rect,  { x,y:y-0.04,w:0.55,h:0.08, fill:{color:AMBER}, line:{color:AMBER} });
    s.addText("▶", { x:x+0.45,y:y-0.14,w:0.2,h:0.28, fontSize:11, color:AMBER, fontFace:"Calibri" });
  });

  // consequence cards - row 2
  const cards = [
    { t:"Hematuria", d:"RBCs pass through damaged GBM into tubular filtrate → brown/tea-colored urine. Dysmorphic RBCs (acanthocytes) and RBC casts are pathognomonic of glomerular origin.", c:RED },
    { t:"Proteinuria", d:"Podocyte injury + GBM disruption → albumin and other proteins leak. Usually subnephrotic (<3.5g/day) in GN. Nephrotic-range if podocyte injury severe.", c:MID_BLUE },
    { t:"Oliguria / Azotemia", d:"GFR drops → less filtrate → less urine output. Nitrogenous waste (BUN, creatinine) accumulates → azotemia. Severe: uremia, AKI, need dialysis.", c:TEAL },
    { t:"Hypertension", d:"Sodium + water retention (reduced GFR + renin release from ischemic JGA cells) → volume expansion → hypertension. Risk of hypertensive encephalopathy.", c:DEEP_BLUE },
    { t:"Edema", d:"Sodium/fluid retention + (in nephrotic component) hypoalbuminemia → fluid shifts to interstitium. Periorbital edema typical in children; ankle edema in adults.", c:GREEN },
    { t:"Chronic Progression", d:"Persistent inflammation → glomerulosclerosis, tubular atrophy, interstitial fibrosis → CKD. Hypertension and proteinuria accelerate this progression.", c:RED },
  ];
  cards.forEach((c,i)=>{
    const col = i%3, row = Math.floor(i/3);
    card(s, 0.28+col*3.26, 2.08+row*1.7, 3.1, 1.6, c.t, c.c, [c.d], 9.5);
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SECTION DIVIDER — CAUSES
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  sectionSlide(s, "CAUSES", "Each cause — and exactly how it leads to glomerulonephritis");
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 7 — CAUSES: Infectious + Post-Infectious
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Causes of GN — Infectious & Post-Infectious", "How infections trigger immune-mediated glomerular damage");
  footer(s);

  const causes = [
    {
      t:"Post-Streptococcal GN (PSGN)",
      c:RED,
      mech:"Group A β-hemolytic Streptococcus (nephritogenic M types 1, 4, 12) infects pharynx or skin. Streptococcal pyogenic exotoxin B (SpeB) is planted in subendothelial locations. Host produces antibodies → immune complexes form in situ and in circulation → complement activation (C3 consumed) → neutrophil infiltration → hypercellular glomeruli. Latency: 7-15 days (pharyngitis) or 3-5 weeks (impetigo).",
    },
    {
      t:"Infective Endocarditis",
      c:MID_BLUE,
      mech:"Staphylococcus aureus or Streptococcus viridans bacteremia seeds cardiac valves. Bacterial antigens continuously shed into bloodstream → circulating immune complexes → deposit in glomerular capillaries → Type III hypersensitivity. Also directly embolic. IgG/IgM/C3 granular deposits. Prolonged bacteremia → more complex deposition → worse GN.",
    },
    {
      t:"Hepatitis B & C Virus",
      c:TEAL,
      mech:"HBV antigens (HBsAg, HBeAg) form immune complexes with anti-HBs antibodies → deposit in glomeruli → MPGN or membranous nephropathy pattern. HCV triggers mixed cryoglobulinemia (type II) — polyclonal IgG + monoclonal IgM form cryoglobulins that deposit in glomeruli activating complement → MPGN pattern. Low C3/C4.",
    },
    {
      t:"HIV-Associated Nephropathy",
      c:DEEP_BLUE,
      mech:"HIV-1 directly infects podocytes and tubular epithelial cells (even with viral suppression). Viral proteins Nef, Vpr cause direct podocyte injury → foot process effacement → collapsing FSGS (not classical GN but often grouped with it). Also triggers immune complex deposition → mesangial proliferative GN.",
    },
    {
      t:"Other Infections",
      c:GREEN,
      mech:"Malaria (Plasmodium malariae): quartan malaria nephropathy — immune complex deposition → MPGN. Schistosomiasis: gut antigens + liver fibrosis → impaired clearance of complexes → mesangial/MPGN pattern. Syphilis, leprosy: treponema/M. leprae antigens → membranous nephropathy. Pneumococcal pneumonia: polysaccharide antigens → IgG deposits.",
    },
  ];

  causes.forEach((cause, i)=>{
    const y = 1.1 + i * 0.88;
    s.addShape(pres.ShapeType.roundRect, { x:0.25,y,w:9.5,h:0.82, fill:{color:WHITE}, line:{color:cause.c, pt:1.5}, rectRadius:0.06 });
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:2.2,h:0.82, fill:{color:cause.c}, line:{color:cause.c} });
    s.addText(cause.t, { x:0.32,y,w:2.08,h:0.82, fontSize:10.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", align:"center" });
    s.addText(cause.mech, { x:2.55,y:y+0.05,w:7.1,h:0.72, fontSize:9.5, color:DARK_TXT, fontFace:"Calibri", valign:"top" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 8 — CAUSES: Autoimmune & Systemic Disease
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Causes of GN — Autoimmune & Systemic Diseases", "Aberrant immune responses attacking glomerular components");
  footer(s);

  const causes = [
    {
      t:"Systemic Lupus Erythematosus\n(Lupus Nephritis)",
      c:RED,
      mech:"Anti-dsDNA and anti-Smith antibodies form immune complexes that deposit in all glomerular compartments (mesangium, subendothelial, subepithelial). WHO Class III-IV (proliferative lupus nephritis) is most severe: full-house immunofluorescence (IgG, IgM, IgA, C3, C1q). Wire-loop lesions on LM. Low C3/C4/CH50.",
    },
    {
      t:"ANCA-Associated Vasculitis\n(GPA, MPA, EGPA)",
      c:MID_BLUE,
      mech:"Anti-neutrophil cytoplasmic antibodies (PR3-ANCA or MPO-ANCA) activate primed neutrophils, causing them to degranulate on vessel walls and in glomerular capillaries. Pauci-immune crescentic GN (no immune deposits on IF!). Rapidly destroys glomeruli. Presents as RPGN. Causes: GPA (PR3-ANCA), MPA/EGPA (MPO-ANCA).",
    },
    {
      t:"Anti-GBM Disease\n(Goodpasture Syndrome)",
      c:TEAL,
      mech:"Autoantibodies target the NC1 domain of α3 chain of type IV collagen in GBM. Linear IgG deposits on immunofluorescence (pathognomonic). Activates complement + T cells → crescentic GN. Same antibodies attack alveolar basement membrane → pulmonary hemorrhage. Trigger: hydrocarbon exposure, viral URI, smoking.",
    },
    {
      t:"IgA Nephropathy\n(Berger's Disease)",
      c:DEEP_BLUE,
      mech:"Galactose-deficient IgA1 (Gd-IgA1) is recognized as foreign → IgG/IgA autoantibodies formed against it → immune complexes deposit in mesangium. C3 activated via alternative or lectin pathway. Mesangial proliferation, hypercellularity. Triggered by mucosal infections. Most common primary GN worldwide.",
    },
    {
      t:"Henoch-Schönlein Purpura\n(IgA Vasculitis)",
      c:GREEN,
      mech:"Same Gd-IgA1 mechanism as IgA nephropathy but systemic small-vessel vasculitis: IgA deposits in skin (palpable purpura), gut (abdominal pain, bleeding), joints (arthralgia), and glomeruli. Complement activation → diffuse mesangial proliferative GN. Common in children after URTI.",
    },
  ];

  causes.forEach((cause,i)=>{
    const y = 1.1 + i * 0.88;
    s.addShape(pres.ShapeType.roundRect, { x:0.25,y,w:9.5,h:0.82, fill:{color:WHITE}, line:{color:cause.c, pt:1.5}, rectRadius:0.06 });
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:2.3,h:0.82, fill:{color:cause.c}, line:{color:cause.c} });
    s.addText(cause.t, { x:0.32,y,w:2.16,h:0.82, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", align:"center" });
    s.addText(cause.mech, { x:2.65,y:y+0.05,w:7.0,h:0.72, fontSize:9.5, color:DARK_TXT, fontFace:"Calibri", valign:"top" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 9 — CAUSES: Primary GN Types
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Causes of GN — Primary Glomerular Diseases", "Intrinsic glomerular disorders without systemic cause");
  footer(s);

  const causes = [
    {
      t:"Membranoproliferative GN\n(MPGN)",
      c:TEAL,
      mech:"Type I: circulating immune complex deposition (HCV, autoimmune) → subendothelial + mesangial deposits → complement consumption → low C3/C4. Type II (Dense Deposit Disease): C3 nephritic factor (C3NeF) IgG autoantibody stabilizes C3 convertase → uncontrolled alternative pathway activation → low C3, normal C4. 'Tram-track' appearance on light microscopy (GBM duplication).",
    },
    {
      t:"Membranous Nephropathy",
      c:MID_BLUE,
      mech:"Autoantibodies against PLA2R (phospholipase A2 receptor on podocytes) or other antigens (THSD7A, NELL1). In situ subepithelial immune complex formation → complement activation → podocyte injury → massive proteinuria. 'Spike and dome' pattern on EM. GBM thickening. Anti-PLA2R positive in ~70% of primary cases.",
    },
    {
      t:"Minimal Change Disease\n& FSGS",
      c:DEEP_BLUE,
      mech:"T-cell-mediated release of circulating permeability factors (podocin-disrupting cytokines) → podocyte foot process effacement → massive proteinuria (nephrotic) without hematuria. MCD: diffuse foot process effacement but no deposits. FSGS: some glomeruli show segmental scarring — more progressive toward CKD. Often idiopathic.",
    },
    {
      t:"Fibrillary GN &\nImmunotactoid Glomerulopathy",
      c:RED,
      mech:"Rare primary GN characterized by organized fibrillar deposits (20 nm fibrils in Fibrillary GN; larger microtubular deposits in Immunotactoid) in the mesangium and GBM. Associated with hematologic malignancies (MGUS, lymphoma). DNAJB9 is a biomarker for Fibrillary GN. Mechanism not fully understood; deposits trigger inflammation and GBM disruption.",
    },
  ];

  causes.forEach((cause,i)=>{
    const y = 1.1 + i * 1.08;
    s.addShape(pres.ShapeType.roundRect, { x:0.25,y,w:9.5,h:1.02, fill:{color:WHITE}, line:{color:cause.c, pt:1.5}, rectRadius:0.06 });
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:2.35,h:1.02, fill:{color:cause.c}, line:{color:cause.c} });
    s.addText(cause.t, { x:0.32,y,w:2.2,h:1.02, fontSize:10.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", align:"center" });
    s.addText(cause.mech, { x:2.7,y:y+0.06,w:6.95,h:0.9, fontSize:9.5, color:DARK_TXT, fontFace:"Calibri", valign:"top" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 10 — RISK FACTORS
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Risk Factors for Glomerulonephritis");
  footer(s);

  card(s, 0.25, 1.0, 2.95, 4.22, "DEMOGRAPHIC", MID_BLUE, [
    "Age: children (PSGN, IgA, MCD) vs adults (MPGN, MN)",
    "Male sex: IgA nephropathy (2:1 M:F)",
    "Race: African-Americans → FSGS, HIV nephropathy",
    "Asian populations: higher IgA nephropathy prevalence",
    "Family history of glomerular disease (Alport syndrome)",
    "Genetic predisposition (HLA-DR antigens in PSGN)",
  ]);
  card(s, 3.38, 1.0, 2.95, 4.22, "INFECTIONS & EXPOSURE", TEAL, [
    "Untreated Group A streptococcal throat/skin infection",
    "Chronic viral infections (HBV, HCV, HIV)",
    "Infective endocarditis (IV drug use risk factor)",
    "Malaria in endemic regions",
    "Hydrocarbon / solvent exposure (anti-GBM disease)",
    "Cigarette smoking (worsens pulmonary hemorrhage in Goodpasture)",
    "Poor living conditions / overcrowding → recurrent strep",
  ]);
  card(s, 6.51, 1.0, 3.24, 4.22, "SYSTEMIC CONDITIONS & DRUGS", RED, [
    "Systemic Lupus Erythematosus (SLE)",
    "Vasculitis (GPA, MPA, EGPA) — ANCA-associated",
    "Diabetes mellitus → diabetic nephropathy",
    "Hypertension (accelerates progression)",
    "Malignancy: MGUS, lymphoma → fibrillary GN",
    "NSAIDs, gold, penicillamine, captopril → membranous",
    "Heroin use → FSGS",
    "Obesity → secondary FSGS",
  ]);
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SECTION DIVIDER — CLINICAL PRESENTATION
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  sectionSlide(s, "CLINICAL PRESENTATION", "Signs & Symptoms — from subtle to life-threatening");
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 12 — SIGNS & SYMPTOMS
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Clinical Signs & Symptoms of Glomerulonephritis");
  footer(s);

  const items = [
    { sym:"Hematuria", detail:"Gross (visible): cola, tea, or smoky brown urine — RBCs from disrupted GBM. Microscopic: dysmorphic RBCs + RBC casts (acanthocytes) on urine microscopy. RBC casts are PATHOGNOMONIC of glomerular origin.", color:RED },
    { sym:"Proteinuria", detail:"Subnephrotic (<3.5g/day) in typical GN. Foamy urine. If podocyte-dominant injury, nephrotic-range proteinuria (>3.5g/day), hypoalbuminemia, hyperlipidemia.", color:MID_BLUE },
    { sym:"Hypertension", detail:"Sodium and water retention → volume overload → hypertension. Renin release from ischemic juxtaglomerular apparatus also contributes. Can be severe → hypertensive encephalopathy (headache, altered LOC, seizures).", color:DEEP_BLUE },
    { sym:"Edema", detail:"Periorbital edema (especially in children — first morning sign). Peripheral pitting edema (ankles, legs). Ascites and pulmonary edema in severe cases. Caused by sodium/water retention ± hypoalbuminemia.", color:TEAL },
    { sym:"Oliguria / Anuria", detail:"Reduced GFR → decreased urine output. Oliguria: <400 mL/day. Anuria in severe RPGN. Accompanied by rising creatinine and BUN (azotemia) and electrolyte disturbances (hyperkalemia, metabolic acidosis).", color:RED },
    { sym:"Systemic Symptoms", detail:"Malaise, fatigue, anorexia, nausea, low-grade fever. Preceding sore throat or skin infection (PSGN). Arthralgia, rash, hemoptysis (vasculitis, Goodpasture). Flank/loin pain (acute capsular swelling).", color:GREEN },
  ];

  items.forEach((item,i)=>{
    const col = i%2, row = Math.floor(i/2);
    const x = 0.25 + col * 4.88;
    const y = 1.05 + row * 1.46;
    s.addShape(pres.ShapeType.roundRect, { x,y,w:4.68,h:1.37, fill:{color:WHITE}, line:{color:item.color, pt:1.8}, rectRadius:0.08 });
    s.addShape(pres.ShapeType.rect, { x,y,w:4.68,h:0.3, fill:{color:item.color}, line:{color:item.color} });
    s.addText(item.sym, { x:x+0.1,y,w:4.5,h:0.3, fontSize:12.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(item.detail, { x:x+0.1,y:y+0.33,w:4.5,h:1.0, fontSize:9.5, color:DARK_TXT, fontFace:"Calibri", valign:"top" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SECTION DIVIDER — DIAGNOSIS
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  sectionSlide(s, "DIAGNOSIS", "Physical examination • Laboratory tests • Imaging • Biopsy");
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 14 — PHYSICAL EXAMINATION
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Diagnosis — Physical Examination Findings");
  footer(s);

  card(s, 0.25, 1.0, 4.55, 4.25, "GENERAL & VITAL SIGNS", MID_BLUE, [
    "BP: Elevated (hypertension) — often significantly above normal",
    "HR: May be elevated if fluid overloaded or in distress",
    "Temperature: Low-grade fever (infection-related GN)",
    "Weight: Increased from fluid retention",
    "Respiratory rate: Elevated if pulmonary edema or uremic lung",
    "Pallor: Anemia from chronic inflammation or blood loss",
    "General: Ill appearance, malaise, puffy face",
  ], 10);

  card(s, 5.05, 1.0, 4.7, 2.0, "HEAD / EYES / FACE", TEAL, [
    "Periorbital edema: puffy eyes, worse in the morning",
    "Conjunctival pallor (anemia)",
    "Fundoscopy: hypertensive retinopathy (AV nicking, papilledema in severe cases)",
    "Facial plethora",
  ], 10);

  card(s, 5.05, 3.17, 4.7, 2.07, "ABDOMEN & EXTREMITIES", DEEP_BLUE, [
    "Flank tenderness: kidney capsule swelling / palpable kidneys",
    "Ascites: dullness on percussion (severe fluid overload)",
    "Lower limb pitting edema (press ankle for 5s → pit)",
    "Purpuric rash on legs/buttocks (HSP/IgA vasculitis)",
    "Splinter hemorrhages + new murmur = endocarditis GN",
  ], 10);

  // key findings highlight
  s.addShape(pres.ShapeType.rect, { x:0.25,y:5.3,w:9.5,h:0.28, fill:{color:AMBER}, line:{color:AMBER} });
  s.addText("KEY PHYSICAL TRIAD: Hypertension + Periorbital Edema + Hematuria (dark urine) = Suspect Glomerulonephritis until proven otherwise", {
    x:0.35,y:5.3,w:9.3,h:0.28, fontSize:10, bold:true, color:NAVY, valign:"middle", fontFace:"Calibri", margin:0
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 15 — LABORATORY TESTS
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Diagnosis — Laboratory Tests & Expected Findings");
  footer(s);

  // Table header
  const colW = [2.8, 3.2, 3.5];
  tblRow(s, 0.25, 1.05, 9.5, 0.35, [
    {text:"TEST", bold:true, color:WHITE, size:11},
    {text:"WHAT IS DONE", bold:true, color:WHITE, size:11},
    {text:"FINDING IN GN", bold:true, color:WHITE, size:11},
  ], MID_BLUE, colW);

  const rows = [
    ["Urinalysis (UA)", "Dipstick + microscopy of urine sample", "Hematuria (2+/3+), proteinuria; RBC casts, granular casts, dysmorphic RBCs (acanthocytes) — confirm glomerular origin"],
    ["24-hr Urine Protein / ACR", "Collect 24-hr urine or spot albumin:creatinine ratio", "<1g/day (GN); >3.5g/day if nephrotic. ACR >300mg/g = significant proteinuria"],
    ["Serum Creatinine & BUN", "Blood sample — kidney filtration markers", "ELEVATED in active GN. Rising creatinine = decreasing GFR. BUN:Cr ratio >20 suggests prerenal component"],
    ["Serum C3/C4 Complement", "Blood — measure complement proteins", "C3 LOW: PSGN, SLE, MPGN, endocarditis. C4 LOW: SLE, cryoglobulinemia. Both normal: IgA nephropathy, ANCA-GN"],
    ["ASO Titer / Anti-DNase B\n/ Streptozyme", "Streptococcal antibody titers in blood", "ELEVATED in PSGN (>95% pharyngitis, >85% impetigo). Confirms recent strep infection"],
    ["ANA, Anti-dsDNA, Anti-Smith", "Blood — lupus autoantibodies", "ANA positive + anti-dsDNA high = lupus. Anti-Smith = specific for SLE. Low complement confirms active nephritis"],
    ["ANCA (PR3-ANCA, MPO-ANCA)", "Blood — vasculitis antibodies", "PR3-ANCA (c-ANCA): GPA. MPO-ANCA (p-ANCA): MPA, EGPA, idiopathic crescentic GN. Pauci-immune pattern"],
    ["Anti-GBM Antibody", "Blood — Goodpasture antibody", "POSITIVE = anti-GBM disease. Linear IgG on IF. Also check HLA-DRB1*1501 predisposition"],
    ["Anti-PLA2R Antibody", "Blood — membranous nephropathy marker", "Positive in ~70% primary membranous nephropathy. Negative = secondary membranous (HBV, lupus, malignancy)"],
    ["CBC, ESR, CRP", "Full blood count + inflammation markers", "Anemia (normocytic), leukocytosis (infection GN). High ESR/CRP = active inflammation. Thrombocytopenia in SLE/TMA"],
    ["Serum Electrolytes & ABG", "Blood — sodium, potassium, bicarbonate, pH", "Hyperkalemia risk in severe AKI. Metabolic acidosis (non-anion gap or anion gap in uremia). Hyponatremia from dilution"],
    ["Serum Albumin", "Blood — protein level", "Low in nephrotic range proteinuria. Normal/slightly low in pure nephritic GN. Very low = poor prognosis"],
    ["HBsAg, HCV RNA/Ab, HIV", "Blood — viral serology", "Positive = secondary GN. HBV → membranous nephropathy. HCV → cryoglobulinemic MPGN. HIV → collapsing FSGS"],
    ["Serum Immunoglobulins /\nSPEP / Cryoglobulins", "Blood — protein electrophoresis", "Polyclonal or monoclonal gammopathy (fibrillary GN, amyloid). Cryoglobulins positive → HCV-related MPGN"],
  ];

  rows.forEach((row,i)=>{
    const y = 1.4 + i * 0.295;
    const bg_c = i%2===0 ? WHITE : LT_GRAY;
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:9.5,h:0.295, fill:{color:bg_c}, line:{color:"D0D8E4"} });
    const isKey = row[2].includes("ELEVATED") || row[2].includes("LOW") || row[2].includes("POSITIVE") || row[2].includes("positive");
    const keyColor = row[2].includes("LOW") ? RED : (row[2].includes("ELEVATED") ? MID_BLUE : TEAL);
    s.addText(row[0], { x:0.3,y,w:2.72,h:0.295, fontSize:9, bold:true, color:DEEP_BLUE, valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(row[1], { x:3.12,y,w:3.12,h:0.295, fontSize:8.5, color:MUTED, valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(row[2], { x:6.3,y,w:3.38,h:0.295, fontSize:8.5, color:isKey ? keyColor : DARK_TXT, valign:"middle", fontFace:"Calibri", margin:0 });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 16 — IMAGING & BIOPSY
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Diagnosis — Imaging Studies & Kidney Biopsy");
  footer(s);

  const imgs = [
    {
      t:"Renal Ultrasound",
      c:TEAL,
      why:"FIRST-LINE imaging. Done in ALL patients with suspected GN.",
      finds:[
        "Kidney size: Normal or enlarged (acute GN); Small/echogenic (chronic GN/CKD)",
        "Echogenicity: Increased echogenicity = parenchymal disease (fibrosis, inflammation)",
        "Cortical thinning: Suggests chronicity and CKD",
        "Hydronephrosis: Rules out obstructive uropathy as cause of AKI",
        "Doppler: Assess renal artery/vein flow; reduced in severe disease",
        "No radiation; safe in all patients including pregnant",
      ]
    },
    {
      t:"Chest X-Ray / CT Chest",
      c:MID_BLUE,
      why:"Ordered when pulmonary-renal syndrome suspected (Goodpasture, ANCA vasculitis).",
      finds:[
        "CXR: Diffuse bilateral alveolar infiltrates = pulmonary hemorrhage (Goodpasture, ANCA)",
        "Cardiomegaly + pulmonary edema = fluid overload from GN",
        "CT Chest: More sensitive for pulmonary hemorrhage, nodules (GPA)", 
        "Pleural effusions: Common in nephrotic/volume-overloaded patients",
        "High-resolution CT: Helps distinguish infection from vasculitis-related lung disease",
      ]
    },
    {
      t:"CT Abdomen/Pelvis\n(with/without contrast)",
      c:DEEP_BLUE,
      why:"Ordered to rule out structural causes, mass, or complications.",
      finds:[
        "Assess kidney morphology, perinephric fluid, abscesses",
        "Detect renal vein thrombosis (thrombogenic in nephrotic syndrome)",
        "Rule out urological causes of hematuria (stones, mass, tumor)",
        "Caution: contrast nephrotoxic in impaired GFR — use with care",
        "MRA preferred over CTA when creatinine is elevated",
      ]
    },
    {
      t:"Kidney Biopsy\n(Gold Standard)",
      c:RED,
      why:"Definitive diagnosis when cause unclear or atypical features present.",
      finds:[
        "Light Microscopy (H&E/PAS/Silver): Hypercellularity, crescents, GBM changes",
        "Immunofluorescence (IF): Deposit pattern — granular (immune complex) vs linear (anti-GBM) vs no deposits (pauci-immune)",
        "Electron Microscopy (EM): Subepithelial humps (PSGN), subendothelial deposits (lupus), foot process effacement (nephrotic), fibrils (fibrillary GN)",
        "NOT routinely needed for classic PSGN in children",
        "Always biopsy: RPGN, unclear diagnosis, atypical course, adults with new-onset GN",
      ]
    },
  ];

  imgs.forEach((img,i)=>{
    const col = i%2, row = Math.floor(i/2);
    const x = 0.25 + col*4.9;
    const y = 1.05 + row*2.16;
    const w = 4.65, h = 2.05;
    s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:WHITE}, line:{color:img.c, pt:1.5}, rectRadius:0.08 });
    s.addShape(pres.ShapeType.rect, { x,y,w,h:0.3, fill:{color:img.c}, line:{color:img.c} });
    s.addText(img.t, { x:x+0.1,y,w:w*0.65,h:0.3, fontSize:11.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
    s.addShape(pres.ShapeType.rect, { x:x+w*0.65,y,w:w*0.35,h:0.3, fill:{color:AMBER}, line:{color:AMBER} });
    s.addText(img.why, { x:x+w*0.65+0.05,y,w:w*0.35-0.1,h:0.3, fontSize:8.5, color:NAVY, valign:"middle", fontFace:"Calibri", bold:true, align:"center", margin:0 });
    const buls = img.finds.map((t,bi)=>({ text:t, options:{ bullet:{code:"25CF",color:img.c}, fontSize:8.8, color:DARK_TXT, breakLine:bi<img.finds.length-1, fontFace:"Calibri", paraSpaceAfter:1 } }));
    s.addText(buls, { x:x+0.1,y:y+0.33,w:w-0.2,h:h-0.4, valign:"top", fontFace:"Calibri" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SECTION DIVIDER — TREATMENT
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  sectionSlide(s, "TREATMENT PLAN", "Step-by-step management of glomerulonephritis");
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 18 — TREATMENT STEP 1 & 2: Stabilization & Supportive
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Treatment — Steps 1 & 2: Initial Stabilization & Supportive Care");
  footer(s);

  // Step 1
  s.addShape(pres.ShapeType.rect, { x:0.25,y:1.05,w:9.5,h:0.35, fill:{color:RED}, line:{color:RED} });
  s.addText("STEP 1 — Emergency Assessment & Stabilization (First Hours)", {
    x:0.35,y:1.05,w:9.3,h:0.35, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0
  });
  const step1Items = [
    "Assess ABCs: airway, breathing, circulation. Secure IV access x2",
    "Check BP: if severely hypertensive → IV labetalol or hydralazine. Target <140/90",
    "Check electrolytes STAT: hyperkalemia (K+ >6.0) requires immediate treatment (calcium gluconate IV, insulin+dextrose, salbutamol nebulization, sodium bicarbonate)",
    "Catheterize if oliguria/anuria to measure strict I&O",
    "Oxygen if respiratory distress or pulmonary hemorrhage",
    "Identify if RPGN (rapidly progressive) — if so, urgent nephrology consult and proceed to biopsy within 24 hours",
  ];
  step1Items.forEach((item,i)=>{
    s.addText([
      { text:`${i+1}. `, options:{ bold:true, color:RED } },
      { text:item, options:{ color:DARK_TXT } }
    ], { x:0.35,y:1.47+i*0.295,w:9.3,h:0.285, fontSize:10, valign:"middle", fontFace:"Calibri" });
  });

  // Step 2
  s.addShape(pres.ShapeType.rect, { x:0.25,y:3.27,w:9.5,h:0.35, fill:{color:MID_BLUE}, line:{color:MID_BLUE} });
  s.addText("STEP 2 — Supportive Care (Ongoing)", {
    x:0.35,y:3.27,w:9.3,h:0.35, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0
  });

  card(s, 0.25, 3.67, 3.02, 1.68, "FLUID & DIET MANAGEMENT", TEAL, [
    "Sodium restriction: <2g/day to limit fluid retention",
    "Fluid restriction: if oliguric/fluid overloaded",
    "Protein restriction: 0.6-0.8g/kg/day if azotemic",
    "Potassium restriction: if hyperkalemia present",
    "Daily weights at same time with same scale",
    "Strict I&O — target fluid balance",
  ], 9);
  card(s, 3.45, 3.67, 3.02, 1.68, "DIURETIC THERAPY", GREEN, [
    "Furosemide (loop diuretic) = first choice for fluid removal",
    "IV if severe edema/pulmonary: 40-80 mg IV",
    "Oral for mild-moderate: 20-80 mg/day",
    "Monitor BMP: avoid hypokalemia, hyponatremia",
    "Metolazone: add for diuretic resistance",
    "Hold if patient becomes dehydrated or creatinine worsens",
  ], 9);
  card(s, 6.65, 3.67, 3.1, 1.68, "BLOOD PRESSURE CONTROL", RED, [
    "ACE inhibitors or ARBs: first choice (also reduce proteinuria)",
    "Calcium channel blockers: amlodipine if ACE/ARB intolerant",
    "Target BP: <130/80 mmHg in GN with proteinuria",
    "Avoid NSAIDs — worsen renal function",
    "Beta-blockers: add for persistent hypertension",
    "IV antihypertensives if hypertensive emergency",
  ], 9);
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 19 — TREATMENT STEP 3: Targeted/Immunosuppressive Therapy
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Treatment — Step 3: Targeted & Immunosuppressive Therapy", "Tailored to specific GN type and cause");
  footer(s);

  const regimens = [
    {
      t:"PSGN / Post-Infectious GN",
      c:GREEN,
      rx:[
        "Supportive only — disease is self-limiting in most cases",
        "Penicillin V (or amoxicillin): eradicate residual strep infection",
        "Erythromycin if penicillin-allergic",
        "Antibiotics do NOT alter GN course but prevent spread",
        "Antihypertensives + diuretics for symptom control",
        ">95% children recover fully; prognosis worse in adults",
      ]
    },
    {
      t:"Lupus Nephritis (Class III/IV)",
      c:RED,
      rx:[
        "Induction: IV methylprednisolone 500-1000mg x3 days",
        "Then oral prednisone 0.5-1mg/kg/day (max 60mg)",
        "Mycophenolate mofetil (MMF) 2-3g/day (preferred) OR",
        "Cyclophosphamide IV pulses (NIH regimen or Eurolupus)",
        "Hydroxychloroquine 200-400mg/day (all lupus patients)",
        "Maintenance: MMF 1-2g/day + low-dose prednisone for ≥3 yrs",
      ]
    },
    {
      t:"ANCA-Associated Vasculitis (GPA/MPA)",
      c:MID_BLUE,
      rx:[
        "Induction: IV methylprednisolone + oral prednisone 1mg/kg/day",
        "Rituximab 375mg/m² weekly x4 (preferred for GPA, relapse)",
        "OR Cyclophosphamide IV 15mg/kg q2-3wks (severe/renal)",
        "Plasma exchange (PLEX): if dialysis-dependent or pulmonary hemorrhage",
        "Maintenance: Rituximab 500mg q6mo OR azathioprine 2mg/kg/day",
        "Taper steroids over 12-18 months",
      ]
    },
    {
      t:"Anti-GBM Disease (Goodpasture)",
      c:TEAL,
      rx:[
        "URGENT — damage is irreversible; treat within 24-48 hrs",
        "Plasmapheresis: daily x14 days (remove anti-GBM antibodies)",
        "IV methylprednisolone 500-1000mg x3 days → oral prednisone 1mg/kg/day",
        "Cyclophosphamide 2-3mg/kg/day oral x3 months",
        "Target: anti-GBM antibody negative on serial testing",
        "Dialysis if presenting creatinine >5.6 mg/dL without pulmonary hemorrhage",
      ]
    },
    {
      t:"IgA Nephropathy",
      c:DEEP_BLUE,
      rx:[
        "Optimized supportive: ACE-I/ARB at max dose if proteinuria >0.5g/day",
        "Corticosteroids: prednisone 1mg/kg/day x2m → taper over 6m (if proteinuria persists >0.75-1g/day after 90d of ACE-I/ARB)",
        "Targeted-release budesonide 16mg/day (Nefecon) — reduces proteinuria",
        "Dapagliflozin (SGLT2 inhibitor) 10mg/day — slows CKD progression",
        "Fish oils: not of proven benefit — not recommended",
        "Tonsillectomy: controversial, not routinely recommended",
      ]
    },
    {
      t:"MPGN & Membranous Nephropathy",
      c:RED,
      rx:[
        "MPGN: treat underlying cause (HCV → antivirals; SLE → immunosuppression)",
        "Membranous: ACE-I/ARB first. Wait 6-12m — 30% spontaneous remission",
        "Rituximab: emerging first-line for primary MN (anti-PLA2R+)",
        "Cyclophosphamide alternating with steroids (Ponticelli regimen)",
        "Tacrolimus or cyclosporine: nephrotoxic alternatives",
        "Anticoagulation: if albumin <20g/L (high thrombosis risk)",
      ]
    },
  ];

  regimens.forEach((reg,i)=>{
    const col = i%3, row = Math.floor(i/3);
    const x = 0.25 + col*3.26;
    const y = 1.07 + row*2.15;
    const w = 3.1, h = 2.0;
    s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:WHITE}, line:{color:reg.c, pt:1.5}, rectRadius:0.07 });
    s.addShape(pres.ShapeType.rect, { x,y,w,h:0.3, fill:{color:reg.c}, line:{color:reg.c} });
    s.addText(reg.t, { x:x+0.08,y,w:w-0.16,h:0.3, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
    const buls = reg.rx.map((t,bi)=>({ text:t, options:{ bullet:{code:"25CF",color:reg.c}, fontSize:8.8, color:DARK_TXT, breakLine:bi<reg.rx.length-1, fontFace:"Calibri", paraSpaceAfter:1 } }));
    s.addText(buls, { x:x+0.1,y:y+0.33,w:w-0.2,h:h-0.4, valign:"top", fontFace:"Calibri" });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 20 — TREATMENT STEP 4 & 5: RPGN + Renal Replacement
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Treatment — Steps 4 & 5: RPGN Protocol & Renal Replacement Therapy");
  footer(s);

  s.addShape(pres.ShapeType.rect, { x:0.25,y:1.05,w:9.5,h:0.35, fill:{color:RED}, line:{color:RED} });
  s.addText("STEP 4 — Rapidly Progressive GN (RPGN) — EMERGENCY PROTOCOL", {
    x:0.35,y:1.05,w:9.3,h:0.35, fontSize:12.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0
  });

  card(s, 0.25, 1.48, 3.05, 2.7, "IMMEDIATE ACTIONS", RED, [
    "Kidney biopsy within 24-48 hrs (crescentic GN)",
    "IV pulse steroids: methylprednisolone 500-1000mg/day x3",
    "Start immunosuppression based on biopsy type",
    "Daily plasmapheresis if anti-GBM or ANCA + hemorrhage",
    "Nephrology consult STAT",
    "Avoid nephrotoxins: NSAIDs, IV contrast, aminoglycosides",
    "Monitor creatinine twice daily",
  ], 9.5);
  card(s, 3.48, 1.48, 3.05, 2.7, "SPECIFIC RPGN REGIMENS", MID_BLUE, [
    "Type I (anti-GBM): steroids + cyclophosphamide + PLEX",
    "Type II (immune complex): steroids ± cyclophosphamide per cause",
    "Type III (pauci-immune / ANCA): steroids + rituximab or CYC",
    "Monitor response: serial creatinine + urine output",
    "If no recovery at 2 weeks: reassess biopsy, dialysis planning",
    "Long-term: maintenance immunosuppression after remission",
  ], 9.5);
  card(s, 6.71, 1.48, 3.04, 2.7, "WHEN BIOPSY SHOWS POOR PROGNOSIS", DEEP_BLUE, [
    ">50% global glomerulosclerosis → limited treatment benefit",
    "100% crescents without pulmonary hemorrhage → dialysis-first",
    "Creatinine >5.6 mg/dL at presentation (anti-GBM) → dialysis",
    "Advanced fibrosis / tubular atrophy → no benefit from immunosuppression",
    "Discuss realistic prognosis with patient + family",
    "Refer early for renal replacement planning",
  ], 9.5);

  s.addShape(pres.ShapeType.rect, { x:0.25,y:4.3,w:9.5,h:0.35, fill:{color:TEAL}, line:{color:TEAL} });
  s.addText("STEP 5 — Renal Replacement Therapy (RRT) for End-Stage or Acute Severe GN", {
    x:0.35,y:4.3,w:9.3,h:0.35, fontSize:12.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0
  });

  card(s, 0.25, 4.72, 3.05, 0.82, "INDICATIONS FOR DIALYSIS", TEAL, [
    "Severe uremia, refractory hyperkalemia, fluid overload, severe acidosis, anuria",
  ], 9.5);
  card(s, 3.48, 4.72, 3.05, 0.82, "MODALITIES", GREEN, [
    "CRRT (ICU) → Hemodialysis (outpatient) → Peritoneal dialysis → Transplant",
  ], 9.5);
  card(s, 6.71, 4.72, 3.04, 0.82, "TRANSPLANT TIMING", MID_BLUE, [
    "Anti-GBM: wait until antibodies undetectable (≥6-12mo). ANCA: wait for remission",
  ], 9.5);
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 21 — STEP 6: MONITORING & LONG-TERM MANAGEMENT
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Treatment — Step 6: Monitoring & Long-Term Management");
  footer(s);

  card(s, 0.25, 1.0, 3.0, 4.22, "MONITORING PARAMETERS", MID_BLUE, [
    "BP: target <130/80 mmHg (check every visit)",
    "Urine dipstick: protein, blood (every 2-4 weeks acutely)",
    "24-hr urine protein / ACR monthly initially",
    "Serum creatinine & eGFR: track GFR trajectory",
    "BMP: electrolytes, BUN, creatinine",
    "Complement C3/C4: recovery = disease remission",
    "ANCA or anti-GBM titers to track immunosuppression response",
    "CBC: immunosuppression-related cytopenias",
    "Glucose/lipids/bone density: steroid side effects",
    "Ophthalmology: hydroxychloroquine retinopathy screening",
  ]);

  card(s, 3.43, 1.0, 3.0, 4.22, "LONG-TERM MEDICATION MANAGEMENT", TEAL, [
    "ACE-I/ARB: long-term renoproduction for all with proteinuria",
    "Statin: cardiovascular protection (high CVD risk in CKD)",
    "SGLT2 inhibitor: dapagliflozin/empagliflozin — CKD progression slowing",
    "Slow taper of steroids: avoid adrenal insufficiency",
    "PPI: gastroprotection during steroid therapy",
    "Calcium + Vitamin D: during steroids to prevent osteoporosis",
    "Pneumococcal + Influenza vaccines: before immunosuppression",
    "Avoid live vaccines while on immunosuppression",
    "Monthly CBC while on cyclophosphamide/rituximab",
    "TMP-SMX prophylaxis: if on cyclophosphamide (Pneumocystis)",
  ]);

  card(s, 6.61, 1.0, 3.14, 4.22, "PATIENT EDUCATION & LIFESTYLE", DEEP_BLUE, [
    "Low-sodium diet (<2g/day): permanent for CKD",
    "Fluid intake: restrict if persistent oliguria/edema",
    "Avoid NSAIDs / nephrotoxic drugs / contrast when possible",
    "Regular BP self-monitoring at home",
    "Daily weight monitoring: report >2 kg/day gain",
    "Report dark urine, reduced urination, leg swelling",
    "Avoid smoking: worsens HTN and pulmonary hemorrhage",
    "Limit protein: 0.6-0.8g/kg/day if eGFR falling",
    "Exercise: gentle as tolerated — avoid overexertion",
    "Follow-up schedule: monthly x6mo, then every 3 months",
  ]);
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 22 — TREATMENT SUMMARY TABLE
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, LT_GRAY);
  titleText(s, "Treatment Step-by-Step Summary");
  footer(s);

  const steps = [
    { n:"STEP 1", t:"Immediate Stabilization", d:"IV access, BP control, hyperkalemia management, oxygenation, catheterize, RPGN triage", c:RED },
    { n:"STEP 2", t:"Supportive Care", d:"Fluid restriction, sodium restriction, diuretics (furosemide), ACE-I/ARB, daily weights, strict I&O", c:MID_BLUE },
    { n:"STEP 3", t:"Establish Diagnosis", d:"Urinalysis, BMP, C3/C4, ANCA, ANA, anti-GBM, anti-PLA2R, renal US. Biopsy if atypical or RPGN", c:TEAL },
    { n:"STEP 4", t:"Targeted Immunosuppression", d:"Based on biopsy/diagnosis: steroids ± cyclophosphamide ± rituximab ± plasmapheresis (cause-specific)", c:DEEP_BLUE },
    { n:"STEP 5", t:"Manage Complications", d:"Pulmonary edema (diuretics, NIPPV), uremia (dialysis), infections (antibiotics), thrombosis (anticoagulation)", c:GREEN },
    { n:"STEP 6", t:"Renal Replacement Therapy", d:"If AKI refractory or ESRD: CRRT → HD → PD → Kidney transplant (when disease in remission)", c:TEAL },
    { n:"STEP 7", t:"Long-Term Maintenance", d:"ACE-I/ARB + statin + SGLT2i, slow steroid taper, maintenance immunosuppression (MMF/azathioprine), vaccination", c:MID_BLUE },
    { n:"STEP 8", t:"Monitoring & Follow-Up", d:"Monthly BP/urine/creatinine → quarterly → annual. Serial antibody titers. Screen for steroid side effects and malignancy", c:DEEP_BLUE },
  ];

  steps.forEach((st,i)=>{
    const y = 1.1 + i * 0.565;
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:9.5,h:0.555, fill:{color:i%2===0?WHITE:LT_GRAY}, line:{color:"D0D8E4"} });
    s.addShape(pres.ShapeType.rect, { x:0.25,y,w:1.2,h:0.555, fill:{color:st.c}, line:{color:st.c} });
    s.addText(st.n, { x:0.25,y,w:1.2,h:0.555, fontSize:11, bold:true, color:WHITE, valign:"middle", align:"center", fontFace:"Calibri", margin:0 });
    s.addText(st.t, { x:1.52,y,w:2.1,h:0.555, fontSize:10.5, bold:true, color:st.c, valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(st.d, { x:3.68,y,w:6.0,h:0.555, fontSize:9.5, color:DARK_TXT, valign:"middle", fontFace:"Calibri", margin:0 });
  });
}

// ╔══════════════════════════════════════════════════════════════════════════╗
// SLIDE 23 — FINAL SUMMARY / KEY TAKEAWAYS
// ╚══════════════════════════════════════════════════════════════════════════╝
{
  const s = pres.addSlide();
  bg(s, NAVY);
  s.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:0.72, fill:{color:TEAL}, line:{color:TEAL} });
  s.addText("KEY TAKEAWAYS — GLOMERULONEPHRITIS", {
    x:0.3,y:0,w:9.4,h:0.72, fontSize:20, bold:true, color:WHITE, valign:"middle", align:"center", fontFace:"Calibri", margin:0
  });

  const pts = [
    ["Definition", "Immune-mediated inflammation of glomeruli → hematuria, proteinuria, HTN, edema, ↓GFR"],
    ["Core Mechanism", "Immune complexes / anti-GBM antibodies / ANCA → complement activation → cell infiltration → GBM damage"],
    ["Top 5 Causes", "PSGN (strep) • SLE • ANCA vasculitis • IgA nephropathy • Anti-GBM disease"],
    ["Hallmark Lab", "RBC casts in urine = pathognomonic of GN. Low C3 = complement-consuming GN"],
    ["Must-Order Tests", "UA + microscopy, BMP, C3/C4, ANCA, ANA, ASO, anti-GBM, anti-PLA2R, renal US"],
    ["Biopsy", "Gold standard for diagnosis — always do in RPGN, adults, atypical presentation"],
    ["Imaging", "Renal US first. Chest XR/CT if pulmonary-renal syndrome (Goodpasture, ANCA)"],
    ["Step 1 Treatment", "Stabilize: BP control, treat hyperkalemia, strict I&O, fluid/Na restriction, diuretics"],
    ["Immunosuppression", "Cause-specific: steroids ± cyclophosphamide/rituximab/plasmapheresis/MMF"],
    ["RPGN = Emergency", "Biopsy within 24h + IV steroids + cause-specific immunosuppression + PLEX if needed"],
    ["Prognosis", "PSGN: >95% children recover. Adults and other types: 30-60% may progress to CKD/ESRD"],
  ];

  pts.forEach(([label, detail], i) => {
    const col = i < 6 ? 0 : 1;
    const row = i < 6 ? i : i - 6;
    const x = 0.22 + col * 5.05;
    const y = 0.85 + row * 0.78;
    s.addShape(pres.ShapeType.rect, { x,y,w:4.8,h:0.72, fill:{color:"122040"}, line:{color:TEAL, pt:0.75} });
    s.addShape(pres.ShapeType.rect, { x,y,w:1.5,h:0.72, fill:{color:DEEP_BLUE}, line:{color:DEEP_BLUE} });
    s.addText(label, { x:x+0.06,y,w:1.42,h:0.72, fontSize:10.5, bold:true, color:AMBER, valign:"middle", fontFace:"Calibri", align:"center", margin:0 });
    s.addText(detail, { x:x+1.56,y:y+0.05,w:3.17,h:0.62, fontSize:9.5, color:WHITE, valign:"middle", fontFace:"Calibri" });
  });

  footer(s, "Sources: Robbins & Cotran Pathology • Comprehensive Clinical Nephrology 7e • Goldman-Cecil Medicine • Brenner & Rector's The Kidney");
}

// ═══════════════════════════════════════
// WRITE FILE
// ═══════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/acute-gn-ppt/Glomerulonephritis_Comprehensive.pptx" })
  .then(() => console.log("✅ Done: Glomerulonephritis_Comprehensive.pptx"))
  .catch(err => { console.error("Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/acute-gn-ppt && node build_detailed_gn.js 2>&1

Running Command

ls -lh /home/daytona/workspace/acute-gn-ppt/Glomerulonephritis_Comprehensive.ppt…

Your detailed presentation is ready:

Glomerulonephritis Comprehensive

Presentation · PPTX


Here's a full breakdown of all 23 slides across the dark navy + teal + amber color scheme:
#SlideWhat's Inside
1TitleFull topic overview + sources
2Detailed DefinitionWhat GN is, the glomerular anatomy, what gets damaged, key syndromes (nephritic/nephrotic/RPGN/chronic)
3Section dividerMechanism
4Mechanism Pt. 1 — Immune Pathways6 pathways: in situ complex formation, circulating complex deposition, complement activation, leukocyte infiltration, crescent formation, T-cell mediated injury
5Mechanism Pt. 2 — Downstream EffectsHow injury leads to hematuria, proteinuria, oliguria/azotemia, hypertension, edema, chronic progression
6Section dividerCauses
7Causes — InfectiousPSGN, infective endocarditis, Hep B/C, HIV, malaria/schistosomiasis — with exact mechanism for each
8Causes — Autoimmune/SystemicSLE, ANCA vasculitis (GPA/MPA), Anti-GBM/Goodpasture, IgA nephropathy, Henoch-Schönlein — with exact mechanism for each
9Causes — Primary GN TypesMPGN (Type I & II), Membranous nephropathy, MCD/FSGS, Fibrillary GN — with exact mechanism for each
10Risk FactorsDemographic, infections/exposures, systemic conditions and drugs
11Section dividerClinical Presentation
12Signs & SymptomsHematuria, proteinuria, hypertension, edema, oliguria/azotemia, systemic symptoms — each with full explanation
13Section dividerDiagnosis
14Physical ExaminationVitals, head/eyes, abdomen/extremities + KEY PHYSICAL TRIAD banner
15Laboratory Tests14-row table: test name, what it does, exact expected finding in GN (color-coded ELEVATED/LOW/POSITIVE)
16Imaging & BiopsyRenal US, Chest XR/CT, CT Abdomen, Kidney Biopsy — what to order, why, and what you'll find
17Section dividerTreatment
18Treatment Steps 1 & 2Emergency stabilization (hyperkalemia, BP crisis) + supportive care (fluids, diuretics, antihypertensives)
19Treatment Step 3Targeted immunosuppression by cause: PSGN, lupus, ANCA, Goodpasture, IgA, MPGN/MN
20Treatment Steps 4 & 5RPGN emergency protocol + renal replacement therapy (CRRT → HD → PD → transplant)
21Treatment Step 6Long-term monitoring, medication management, patient education
22Treatment Summary Table8-step treatment roadmap in one table
23Key Takeaways11-point summary card for quick review
Sources used: Robbins & Cotran Pathologic Basis of Disease, Comprehensive Clinical Nephrology 7th ed., Goldman-Cecil Medicine, and Brenner & Rector's The Kidney.
This is a shared conversation. Sign in to Orris to start your own chat.