Create a clean, minimal educational that explains the topic in the simplest way possible for students. Use a pure white background, modern typography, and a handwritten classroom notes aesthetic. Keep slides visually uncluttered with short bullet points, simple diagrams, highlighted keywords, flowcharts, and easy-to-understand explanations. Each slide should focus on one core concept only. Use color sparingly for emphasis (like blue, black, and soft yellow highlights). Add quick summaries, memory tricks, and real-world examples wherever helpful. Maintain a premium Apple-style minimal design while making the information feel like organized study notes rather than a corporate presentation. The goal is to help students quickly grasp and remember the topic without feeling overwhelmed.

Reading File
Reading File
Reading File
Running Command

cd /home/daytona/workspace && python3 -c " import pdfplumber with pdfplumber.open('/home/daytona/workspace/attachments/1279b2e0-5690-4c49-861d-0d5ed70a7e1b/Major 2 Pharmaco Highlighted.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:5]): print(f'--- PAGE {i+1} ---') text = page.extract_text() if text: print(text[:2000]) print() "

Running Command

cd /home/daytona/workspace && python3 -c " import pdfplumber with pdfplumber.open('/home/daytona/workspace/attachments/1279b2e0-5690-4c49-861d-0d5ed70a7e1b/Major 2 Pharmaco Highlighted.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[5:]): print(f'--- PAGE {i+6} ---') text = page.extract_text() if text: print(text[:2500]) print() " 2>&1 | head -500

Running Command

cd /home/daytona/workspace && python3 -c " import pdfplumber with pdfplumber.open('/home/daytona/workspace/attachments/1279b2e0-5690-4c49-861d-0d5ed70a7e1b/Major 2 Pharmaco Highlighted.pdf') as pdf: for i, page in enumerate(pdf.pages[20:]): print(f'--- PAGE {i+21} ---') text = page.extract_text() if text: print(text[:2500]) print() " 2>&1 | head -500

Running Command

ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/pharmaco-slides

Writing File

~/pharmaco-slides/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Pharmacology Major 2 – Study Notes";
pres.author = "Study Notes";

// ─── DESIGN TOKENS ──────────────────────────────────────────────────────────
const C = {
  white:   "FFFFFF",
  black:   "1A1A1A",
  blue:    "1D6FA4",
  lightBlue: "E8F4FB",
  yellow:  "FFF3CD",
  yellowBorder: "F5C842",
  gray:    "6B7280",
  lightGray: "F5F5F5",
  divider: "D1D5DB",
  accent:  "2563EB",
  greenTip:"E6F4EA",
  greenBorder: "34A853",
  redAlert:"FEE2E2",
  redBorder: "DC2626",
};

const FONT = "Arial";

// ─── HELPER FUNCTIONS ────────────────────────────────────────────────────────

function addTitle(slide, mainTitle, subtitle = "", topicNum = "") {
  // Light top bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  
  if (topicNum) {
    slide.addText(topicNum, { x: 0.35, y: 0.08, w: 0.6, h: 0.38,
      fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle",
      fill: { color: C.blue }, rectRadius: 0.05 });
  }

  slide.addText(mainTitle, {
    x: topicNum ? 1.05 : 0.35, y: 0.06, w: topicNum ? 8.6 : 9.3, h: 0.42,
    fontSize: 15, bold: true, color: C.black, fontFace: FONT,
    valign: "middle"
  });

  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.55, w: 9.3, h: 0.28,
      fontSize: 9.5, color: C.gray, fontFace: FONT, italic: true, valign: "middle"
    });
  }

  // Thin accent line under header
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.55, w: 10, h: 0.03, fill: { color: C.blue }, line: { color: C.blue } });
}

function pill(slide, label, x, y, w = 1.8, h = 0.32, bg = C.lightBlue, textColor = C.blue) {
  slide.addText(label, { x, y, w, h, fontSize: 8.5, bold: true, color: textColor,
    fill: { color: bg }, align: "center", valign: "middle",
    line: { color: bg }, rectRadius: 0.15 });
}

function sectionBox(slide, title, items, x, y, w, h, bg = C.lightGray, titleColor = C.blue) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h,
    fill: { color: bg }, line: { color: C.divider, pt: 1 } });
  slide.addText(title, { x: x + 0.12, y: y + 0.07, w: w - 0.24, h: 0.28,
    fontSize: 9.5, bold: true, color: titleColor, fontFace: FONT });
  const bulletItems = items.map((t, i) => ({
    text: t,
    options: { bullet: { code: "2022" }, breakLine: i < items.length - 1,
      fontSize: 8.5, color: C.black }
  }));
  slide.addText(bulletItems, { x: x + 0.12, y: y + 0.38, w: w - 0.24, h: h - 0.48,
    fontFace: FONT, valign: "top" });
}

function highlight(slide, text, x, y, w, h, bg = C.yellow) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h,
    fill: { color: bg }, line: { color: C.yellowBorder, pt: 1 } });
  slide.addText(text, { x: x + 0.1, y, w: w - 0.2, h,
    fontSize: 8.5, color: C.black, fontFace: FONT, valign: "middle", italic: true });
}

function tipBox(slide, text, x, y, w = 9.3, h = 0.4) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h,
    fill: { color: C.greenTip }, line: { color: C.greenBorder, pt: 1 } });
  slide.addText("πŸ’‘  " + text, { x: x + 0.12, y, w: w - 0.24, h,
    fontSize: 8.5, color: "1A5C2A", fontFace: FONT, valign: "middle" });
}

function warnBox(slide, text, x, y, w = 9.3, h = 0.4) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h,
    fill: { color: C.redAlert }, line: { color: C.redBorder, pt: 1 } });
  slide.addText("⚠️  " + text, { x: x + 0.12, y, w: w - 0.24, h,
    fontSize: 8.5, color: "7F1D1D", fontFace: FONT, valign: "middle" });
}

function addSlideBase() {
  const s = pres.addSlide();
  s.background = { color: C.white };
  return s;
}

function bulletList(slide, items, x, y, w, h, opts = {}) {
  const rows = items.map((t, i) => ({
    text: t,
    options: { bullet: { code: "2022" }, breakLine: i < items.length - 1,
      fontSize: opts.fontSize || 9, color: opts.color || C.black, bold: opts.bold || false }
  }));
  slide.addText(rows, { x, y, w, h, fontFace: FONT, valign: "top", ...opts });
}

function keyword(text) {
  return [{ text: text, options: { bold: true, color: C.blue } }];
}

// ─── SLIDE 0: COVER ──────────────────────────────────────────────────────────
{
  const s = addSlideBase();
  // Deep blue top block
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 2.6,
    fill: { color: "0F3460" }, line: { color: "0F3460" } });

  s.addText("Pharmacology", { x: 0.5, y: 0.35, w: 9, h: 0.7,
    fontSize: 38, bold: true, color: C.white, fontFace: FONT, align: "center" });
  s.addText("Major 2 β€” Complete Study Notes", { x: 0.5, y: 1.1, w: 9, h: 0.4,
    fontSize: 16, color: "B0C4DE", fontFace: FONT, align: "center", italic: true });
  s.addText("Cardiovascular Β· Respiratory Β· GI Β· Blood", { x: 0.5, y: 1.55, w: 9, h: 0.3,
    fontSize: 11, color: "7FB3D3", fontFace: FONT, align: "center" });

  // Topics pills row
  const topics = ["CHF", "Diuretics", "Ξ²-Blockers", "Nitrates", "CCBs", "Antiarrhythmics",
                  "Antihypertensives", "RAS", "Asthma", "GI", "Anticoagulants", "Platelets", "Anemia"];
  topics.forEach((t, i) => {
    const col = i % 7;
    const row = Math.floor(i / 7);
    s.addText(t, { x: 0.35 + col * 1.34, y: 2.85 + row * 0.42, w: 1.25, h: 0.32,
      fontSize: 7.5, bold: true, color: C.blue, align: "center", valign: "middle",
      fill: { color: C.lightBlue }, line: { color: C.blue, pt: 0.5 }, rectRadius: 0.12 });
  });

  s.addText("25 Topics Β· Mechanisms Β· Side Effects Β· Clinical Uses Β· Memory Tricks",
    { x: 0.5, y: 5.1, w: 9, h: 0.3, fontSize: 8.5, color: C.gray, align: "center", fontFace: FONT });
}

// ─── SLIDE 1: CHF DRUG CLASSIFICATION ────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "CHF Drug Classification", "Congestive Heart Failure – Drug Groups at a Glance", "1");

  const groups = [
    { label: "Diuretics", color: C.blue, bg: C.lightBlue, items: ["Furosemide", "Hydrochlorothiazide", "Spironolactone"] },
    { label: "Vasodilators", color: "6B21A8", bg: "F3E8FF", items: ["Hydralazine", "Nitroglycerin", "ACEIs, CCBs", "Sodium nitroprusside"] },
    { label: "+ve Inotropes", color: "065F46", bg: C.greenTip, items: ["Digitalis: Digoxin, Digitoxin", "Ξ²-agonists: Dobutamine, Dopamine", "PDE inhibitors: Amrinone, Milrinone", "Newer: Istaroxime, Levosimendan"] },
    { label: "Ξ²-Blockers", color: "92400E", bg: "FEF3C7", items: ["Metoprolol", "Carvedilol", "Bisoprolol"] },
  ];

  groups.forEach((g, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.7;
    const y = 1.05 + row * 2.2;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 2.05,
      fill: { color: g.bg }, line: { color: g.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.35,
      fill: { color: g.color }, line: { color: g.color } });
    s.addText(g.label, { x: x + 0.1, y: y + 0.03, w: 4.3, h: 0.3,
      fontSize: 10, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.15, y: y + 0.42, w: 4.2, h: 1.55, fontFace: FONT, valign: "top" });
  });

  tipBox(s, "Memory: 'D-VIP-B' = Diuretics, Vasodilators, Inotropes (positive), Positive beta-blockers", 0.35, 5.1, 9.3, 0.35);
}

// ─── SLIDE 2: CARDIAC GLYCOSIDES – MECHANISM ─────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Cardiac Glycosides – How They Work", "Mechanism of action of Digoxin / Digitoxin", "2");

  // Chain of events
  const steps = [
    "Inhibits Na⁺/K⁺-ATPase",
    "↑ Intracellular Na⁺",
    "↑ Na⁺–Ca²⁺ exchange",
    "↑ Intracellular Ca²⁺",
    "Ca²⁺ binds Troponin β†’ Tropomyosin moves",
    "↑ Actin–Myosin interaction",
    "↑ Contractile Force (Positive Inotrope)",
  ];

  steps.forEach((step, i) => {
    const y = 0.98 + i * 0.57;
    const isLast = i === steps.length - 1;
    s.addShape(pres.ShapeType.rect, {
      x: 0.5, y, w: 5.5, h: 0.42,
      fill: { color: isLast ? "0F3460" : C.lightBlue },
      line: { color: isLast ? "0F3460" : C.blue, pt: 1 }
    });
    s.addText(`${i + 1}. ${step}`, { x: 0.6, y: y + 0.02, w: 5.3, h: 0.38,
      fontSize: 9, bold: isLast, color: isLast ? C.white : C.black, fontFace: FONT, valign: "middle" });
    if (!isLast) {
      s.addText("↓", { x: 2.8, y: y + 0.41, w: 0.5, h: 0.18,
        fontSize: 10, color: C.blue, align: "center", fontFace: FONT });
    }
  });

  // Effects box right
  sectionBox(s, "Pharmacological Effects on Heart", [
    "Positive inotropic (↑ force)",
    "↓ Heart rate (↑ vagal tone)",
    "↑ Coronary circulation",
    "↓ Action potential duration",
    "↑ Resting tension in myocardium"
  ], 6.3, 0.95, 3.35, 2.8, C.lightBlue, C.blue);

  sectionBox(s, "Clinical Uses", [
    "Congestive Cardiac Failure (CCF)",
    "Atrial fibrillation",
    "Atrial flutter",
    "Paroxysmal SVT"
  ], 6.3, 3.85, 3.35, 1.55, "FEF9E7", "B7950B");

  tipBox(s, "Memory: Na pump OFF β†’ Na up β†’ Ca up β†’ Squeeze harder!", 0.35, 5.1, 5.6, 0.35);
}

// ─── SLIDE 3: DIGOXIN PHARMACOKINETICS & SIDE EFFECTS ────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Digoxin – Pharmacokinetics & Toxicity", "Know the differences: Digitoxin vs Digoxin vs Ouabain", "3");

  // PK comparison table
  const headers = ["Property", "Digitoxin", "Digoxin", "Ouabain"];
  const rows2 = [
    ["Solubility", "Most lipid-soluble", "Relatively polar", "Most polar"],
    ["Metabolism", "Liver (primary)", "Minimal", "β€”"],
    ["Excretion", "Hepatic", "Kidney (GFR)", "β€”"],
    ["Enterohepatic circulation", "Yes", "Some", "No"],
  ];

  const colW = [2.2, 2.3, 2.3, 2.3];
  const startX = 0.35;
  let ty = 0.95;
  // header row
  headers.forEach((h, c) => {
    let cx = startX + colW.slice(0, c).reduce((a, b) => a + b, 0);
    s.addShape(pres.ShapeType.rect, { x: cx, y: ty, w: colW[c], h: 0.35,
      fill: { color: "0F3460" }, line: { color: C.white, pt: 0.5 } });
    s.addText(h, { x: cx + 0.05, y: ty, w: colW[c] - 0.1, h: 0.35,
      fontSize: 8.5, bold: true, color: C.white, fontFace: FONT, valign: "middle" });
  });
  rows2.forEach((row, r) => {
    const bg = r % 2 === 0 ? C.white : C.lightGray;
    row.forEach((cell, c) => {
      let cx = startX + colW.slice(0, c).reduce((a, b) => a + b, 0);
      s.addShape(pres.ShapeType.rect, { x: cx, y: ty + 0.35 + r * 0.38, w: colW[c], h: 0.38,
        fill: { color: bg }, line: { color: C.divider, pt: 0.5 } });
      s.addText(cell, { x: cx + 0.07, y: ty + 0.35 + r * 0.38, w: colW[c] - 0.1, h: 0.38,
        fontSize: 8, color: c === 0 ? C.blue : C.black, bold: c === 0, fontFace: FONT, valign: "middle" });
    });
  });

  // Side effects & intoxication
  sectionBox(s, "Digitalis Toxicity – Symptoms", [
    "CVS: Arrhythmias, ↑ oedema, dyspnoea",
    "GIT: Nausea, vomiting, abdominal pain, anorexia",
    "CNS: Headache, confusion, delirium, hallucinations",
    "Vision: Yellow-green tinge (classic!)"
  ], 0.35, 2.55, 4.6, 1.85, C.redAlert, C.redBorder);

  sectionBox(s, "Treatment of Digitalis Toxicity", [
    "Stop digoxin & diuretic",
    "Atropine β†’ AV block / bradycardia",
    "K⁺ IV/oral β†’ stable ventricular ectopics",
    "Propranolol β†’ supraventricular arrhythmias",
    "Phenytoin / Lidocaine β†’ ventricular arrhythmias",
    "Digibind (anti-digoxin Ig) β†’ reverse effects"
  ], 5.1, 2.55, 4.55, 1.85, C.greenTip, C.greenBorder);

  warnBox(s, "Contraindications: Hypokalemia, MI, Thyrotoxicosis, VT, Partial AV block, WPW, Elderly, Renal/Hepatic disease", 0.35, 4.5, 9.3, 0.45);
  tipBox(s, "Yellow-green vision + slow pulse = Digitalis toxicity. Give Digibind.", 0.35, 5.04, 9.3, 0.35);
}

// ─── SLIDE 4: BETA-1 AGONISTS & PDE INHIBITORS IN CHF ────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Positive Inotropes – β₁ Agonists & PDE Inhibitors", "Second-line agents for acute / severe CHF", "4");

  sectionBox(s, "β₁-Adrenergic Agonists", [
    "Drugs: Dobutamine, Dopamine",
    "Dobutamine β†’ acute heart failure (cardiac surgery, MI)",
    "Dopamine β†’ CHF with renal impairment (↑ renal perfusion + ↑ CO)"
  ], 0.35, 0.95, 4.5, 1.7, C.lightBlue, C.blue);

  sectionBox(s, "PDE (Phosphodiesterase) Inhibitors", [
    "Drugs: Milrinone, Inamrinone (Amrinone), Vesnarinone",
    "Mechanism: Inhibit PDE-III β†’ ↑ cAMP β†’ ↑ Ca²⁺ influx",
    "Use: IV infusion in severe CHF (short-term only)",
    "⚠ Milrinone decreases survival long-term"
  ], 5.0, 0.95, 4.65, 1.7, "FEF3C7", "92400E");

  // Acute LVF treatment box
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.8, w: 9.3, h: 2.35,
    fill: { color: C.lightGray }, line: { color: C.divider, pt: 1 } });
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.8, w: 9.3, h: 0.35,
    fill: { color: "0F3460" }, line: { color: "0F3460" } });
  s.addText("Treatment of Acute Left Ventricular Failure (Pulmonary Oedema)", {
    x: 0.5, y: 2.81, w: 9, h: 0.33,
    fontSize: 10, bold: true, color: C.white, fontFace: FONT, valign: "middle"
  });

  const steps = [
    { n: "1", t: "Oβ‚‚ via mask" },
    { n: "2", t: "Morphine IV" },
    { n: "3", t: "Furosemide 40–80 mg IV" },
    { n: "4", t: "Aminophylline IV" },
    { n: "5", t: "Vasodilators (if BP very low β†’ Dopamine)" },
    { n: "6", t: "Inotropes Β· Diuretics Β· Nitrates Β· Nitroprusside" },
  ];

  steps.forEach((st, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.5 + col * 3.1;
    const y = 3.22 + row * 0.85;
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.3, h: 0.3,
      fill: { color: C.blue }, line: { color: C.blue }, rectRadius: 0.15 });
    s.addText(st.n, { x, y, w: 0.3, h: 0.3, fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle" });
    s.addText(st.t, { x: x + 0.38, y: y + 0.02, w: 2.55, h: 0.28, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "middle" });
  });

  tipBox(s, "Dobutamine = surgery/MI. Dopamine = renal failure. PDE inhibitors = last resort IV only.", 0.35, 5.1, 9.3, 0.35);
}

// ─── SLIDE 5: VASODILATORS ────────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Vasodilators in CHF", "Classification, Indications, Side Effects & Contraindications", "5");

  // 3-column classification
  const cols3 = [
    { title: "Arterial Dilators", items: ["Hydralazine", "Minoxidil", "CCBs (Nifedipine)"], color: "1D6FA4", bg: C.lightBlue },
    { title: "Venodilators", items: ["Nitroglycerin (GTN)", "Isosorbide dinitrate"], color: "6B21A8", bg: "F3E8FF" },
    { title: "Mixed Dilators", items: ["ACEIs", "AT-1 blockers (Losartan)", "Prazosin", "Nitroprusside"], color: "065F46", bg: C.greenTip },
  ];
  cols3.forEach((col, i) => {
    const x = 0.35 + i * 3.15;
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 1.75, fill: { color: col.bg }, line: { color: col.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 0.33, fill: { color: col.color }, line: { color: col.color } });
    s.addText(col.title, { x: x + 0.1, y: 0.96, w: 2.8, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
    const bItems = col.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < col.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: 1.3, w: 2.8, h: 1.32, fontFace: FONT, valign: "top" });
  });

  // Action primarily lowers afterload note
  highlight(s, "Arterial vasodilators primarily lower AFTERLOAD β†’ reduce cardiac workload", 0.35, 2.78, 9.3, 0.38, C.yellow);

  sectionBox(s, "Indications", [
    "Acute severe CHF", "Myocardial infarction", "Cardiogenic shock",
    "Oral long-term chronic CHF", "Anti-CHF measures"
  ], 0.35, 3.25, 3.0, 1.75, C.lightBlue, C.blue);

  sectionBox(s, "Side Effects", [
    "Hypotension, Dizziness, Palpitations",
    "Persistent dry cough (ACEIs)",
    "Hyperkalemia, Angioedema",
    "Skin rashes, Teratogenicity"
  ], 3.5, 3.25, 3.0, 1.75, C.redAlert, C.redBorder);

  sectionBox(s, "Contraindications", [
    "Intolerance to nitrates",
    "Low ventricular filling pressure"
  ], 6.65, 3.25, 3.0, 1.75, "FEF3C7", "92400E");

  tipBox(s, "Arterial = reduce afterload. Venous = reduce preload. Mixed = both!", 0.35, 5.1, 9.3, 0.35);
}

// ─── SLIDE 6: DIURETICS OVERVIEW ─────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Diuretics – Full Classification", "Know your diuretic groups by efficacy", "6");

  const groups2 = [
    { label: "HIGH Efficacy", color: "DC2626", bg: C.redAlert, items: ["Loop diuretics: Furosemide, Bumetanide, Ethacrynic acid, Torsemide"] },
    { label: "MODERATE Efficacy", color: "D97706", bg: "FEF3C7", items: ["Thiazides: Hydrochlorothiazide, Chlorothiazide, Polythiazide", "Thiazide-like: Chlorthalidone, Metolazone, Indapamide"] },
    { label: "LOW Efficacy", color: "059669", bg: C.greenTip, items: [
      "K⁺-sparing: Spironolactone (aldosterone antagonist), Triamterene, Amiloride",
      "Carbonic anhydrase inhibitors: Acetazolamide",
      "Osmotic: Mannitol, Urea, Glycerol",
      "Methylxanthines: Theophylline"
    ]},
    { label: "Newer Agents", color: "6B21A8", bg: "F3E8FF", items: [
      "Vasopressin antagonists: Conivaptan, Tolvaptan",
      "Adenosine A1 antagonist: Rolophylline"
    ]},
  ];

  groups2.forEach((g, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.7;
    const y = 0.98 + row * 2.15;
    const h = i === 2 ? 2.05 : 2.0;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h, fill: { color: g.bg }, line: { color: g.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.32, fill: { color: g.color }, line: { color: g.color } });
    s.addText(g.label, { x: x + 0.1, y: y + 0.02, w: 4.3, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: y + 0.38, w: 4.3, h: h - 0.48, fontFace: FONT, valign: "top" });
  });

  highlight(s, "General mechanism: Reduce tubular reabsorption of electrolytes β†’ ↑ electrolyte + water excretion", 0.35, 5.06, 9.3, 0.38, C.yellow);
}

// ─── SLIDE 7: LOOP DIURETICS ─────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Loop Diuretics", "Furosemide Β· Ethacrynic acid Β· Torsemide Β· Bumetanide", "7");

  // MOA diagram
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.95, w: 5.5, h: 1.5, fill: { color: C.lightBlue }, line: { color: C.blue, pt: 1 } });
  s.addText("Mechanism of Action", { x: 0.45, y: 0.97, w: 5.3, h: 0.3, fontSize: 9.5, bold: true, color: C.blue, fontFace: FONT });
  s.addText("Act on luminal membrane of thick ascending Loop of Henle\nInhibit Na⁺–K⁺–2Cl⁻ cotransporter\nβ†’ Prevent NaCl reabsorption β†’ ↑↑ water & electrolyte excretion", {
    x: 0.45, y: 1.28, w: 5.3, h: 1.12,
    fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top"
  });

  sectionBox(s, "Therapeutic Uses", [
    "Acute pulmonary oedema",
    "Oedema in CCF, renal failure, hepatic cirrhosis",
    "Diabetic nephropathy",
    "Hypercalcaemia",
    "Hypertension",
    "Acute renal failure",
    "↑ Intracranial pressure"
  ], 6.0, 0.95, 3.65, 2.9, C.greenTip, C.greenBorder);

  sectionBox(s, "Adverse Effects", [
    "Hypokalemia (most important!)",
    "Hyperuricaemia, Hyperglycaemia",
    "Hypocalcaemia",
    "Transient / permanent deafness (ototoxicity)",
    "Electrolyte disturbances β†’ weakness, fatigue",
    "Orthostatic hypotension",
    "Nephrotoxicity"
  ], 0.35, 2.55, 5.5, 2.4, C.redAlert, C.redBorder);

  highlight(s, "Electrolyte fix: ↑ dietary K⁺ Β· KCl supplements Β· Add K⁺-sparing diuretic (spironolactone)", 0.35, 5.04, 9.3, 0.38, C.yellow);
}

// ─── SLIDE 8: THIAZIDE DIURETICS ─────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Thiazide Diuretics", "By duration: Short / Intermediate / Long-acting", "8");

  // Duration classification
  const durations = [
    { t: "Short-acting (≀12 hrs)", drugs: "Hydrochlorothiazide, Chlorothiazide", color: "059669" },
    { t: "Intermediate (12–24 hrs)", drugs: "Hydroflumethiazide, Benzthiazide, Metolazone, Clopamide", color: "D97706" },
    { t: "Long-acting (>24 hrs)", drugs: "Methyclothiazide, Polythiazide, Indapamide, Chlorthalidone, Xipamide", color: "DC2626" },
  ];
  durations.forEach((d, i) => {
    s.addShape(pres.ShapeType.rect, { x: 0.35 + i * 3.15, y: 0.95, w: 3.0, h: 0.32, fill: { color: d.color }, line: { color: d.color } });
    s.addText(d.t, { x: 0.45 + i * 3.15, y: 0.96, w: 2.8, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    s.addShape(pres.ShapeType.rect, { x: 0.35 + i * 3.15, y: 1.27, w: 3.0, h: 0.65, fill: { color: C.lightGray }, line: { color: d.color, pt: 1 } });
    s.addText(d.drugs, { x: 0.45 + i * 3.15, y: 1.29, w: 2.8, h: 0.6, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top" });
  });

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.02, w: 9.3, h: 0.6, fill: { color: C.lightBlue }, line: { color: C.blue, pt: 1 } });
  s.addText("Mechanism: Inhibit NaCl reabsorption in early distal tubule (Na⁺–Cl⁻ symporter) β†’ ↑ Na⁺ load β†’ ↑ K⁺ & H⁺ excretion β†’ Hypokalemia + Metabolic alkalosis", {
    x: 0.45, y: 2.03, w: 9.1, h: 0.56, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "middle"
  });

  sectionBox(s, "Clinical Uses", [
    "Oedema: mild-moderate CHF, hepatic/renal disease",
    "Mild-moderate Hypertension",
    "Nephrogenic Diabetes Insipidus (paradoxical effect)",
    "Hypercalciuria, Osteoporosis",
    "Bromide intoxication"
  ], 0.35, 2.72, 4.5, 2.1, C.greenTip, C.greenBorder);

  sectionBox(s, "Side Effects", [
    "↓ K⁺, Na⁺, Cl⁻, Mg²⁺, PO₄³⁻",
    "↑ Uric acid, Glucose, Lipids, Ca²⁺",
    "Hypotension",
    "May precipitate hepatic coma in cirrhosis",
    "Impotence, ↓ libido"
  ], 5.0, 2.72, 4.65, 2.1, C.redAlert, C.redBorder);

  tipBox(s, "Memory: Thiazides RAISE: Glucose, Lipids, Uric acid, Ca²⁺. And LOWER: K⁺, Na⁺, Mg²⁺.", 0.35, 4.92, 9.3, 0.38);
}

// ─── SLIDE 9: BETA-BLOCKERS ───────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Ξ²-Adrenergic Blockers", "Classification Β· Mechanism Β· Uses Β· Side Effects", "9");

  const classes = [
    { t: "Non-selective β₁β₂", color: C.blue, bg: C.lightBlue,
      items: ["Without ISA: Propranolol, Timolol, Nadolol, Sotalol", "With ISA: Oxprenolol, Pindolol, Penbutolol", "With vasodilation: Carvedilol"] },
    { t: "Cardioselective β₁", color: "065F46", bg: C.greenTip,
      items: ["Acebutolol, Atenolol, Bisoprolol", "Betaxolol, Esmolol, Metoprolol, Nebivolol"] },
    { t: "Ξ± + Ξ² Blockers", color: "6B21A8", bg: "F3E8FF",
      items: ["Labetalol"] },
  ];
  classes.forEach((c, i) => {
    const x = 0.35 + i * 3.15;
    const h = i === 2 ? 1.35 : 1.62;
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h, fill: { color: c.bg }, line: { color: c.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 0.32, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.t, { x: x + 0.1, y: 0.94, w: 2.8, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = c.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < c.items.length - 1, fontSize: 8, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: 1.28, w: 2.8, h: h - 0.42, fontFace: FONT, valign: "top" });
  });

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.65, w: 9.3, h: 0.38, fill: { color: C.lightBlue }, line: { color: C.blue } });
  s.addText("Mechanism: Block Ξ²-adrenergic receptors β†’ ↓ HR, ↓ force of contraction, ↓ CO β†’ ↓ BP", {
    x: 0.45, y: 2.65, w: 9.1, h: 0.38, fontSize: 9, bold: true, color: C.black, fontFace: FONT, valign: "middle"
  });

  sectionBox(s, "Therapeutic Uses", [
    "Hypertension, Angina pectoris",
    "Myocardial infarction (↓ infarct size)",
    "CHF: Metoprolol, Bisoprolol, Carvedilol",
    "Obstructive cardiomyopathy",
    "↓ Intraocular pressure (glaucoma)"
  ], 0.35, 3.12, 4.5, 1.9, C.greenTip, C.greenBorder);

  sectionBox(s, "Side Effects & Contraindications", [
    "Bradycardia, Cold extremities",
    "Bronchospasm (Propranolol, Labetalol)",
    "Fatigue, Dizziness",
    "↑ Triglycerides, ↑ LDL, ↓ HDL",
    "Rebound HTN if stopped abruptly",
    "CI: Bradycardia, Heart block, BA/COPD, Diabetes"
  ], 5.0, 3.12, 4.65, 1.9, C.redAlert, C.redBorder);

  tipBox(s, "ISA = partial agonist β†’ less bradycardia. Cardioselective = β₁ only β†’ safer in asthma (but not fully safe!)", 0.35, 5.1, 9.3, 0.35);
}

// ─── SLIDE 10: ORGANIC NITRATES ──────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Organic Nitrates – Antianginal Drugs", "GTN Β· Isosorbide dinitrate Β· Isosorbide mononitrate", "10");

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.93, w: 9.3, h: 0.6, fill: { color: C.lightBlue }, line: { color: C.blue } });
  s.addText("Mechanism: Nitric oxide (NO) β†’ ↑ cGMP β†’ Smooth muscle relaxation β†’ Vasodilation", {
    x: 0.45, y: 0.95, w: 9.1, h: 0.56, fontSize: 9.5, bold: true, color: C.black, fontFace: FONT, valign: "middle"
  });

  sectionBox(s, "Pharmacological Effects", [
    "↑ Venous capacitance β†’ ↓ preload β†’ ↓ CO",
    "Arterial dilation β†’ ↓ afterload β†’ ↓ Oβ‚‚ demand",
    "↓ LVEDP β†’ ↑ coronary flow to subendocardium",
    "Dilates large epicardial & collateral coronaries",
    "Cerebral vasodilation β†’ ↑ ICP β†’ Headache",
    "Cutaneous vasodilation β†’ Flushing",
    "↓ Pulmonary artery pressure"
  ], 0.35, 1.63, 4.5, 2.4, C.lightBlue, C.blue);

  sectionBox(s, "Uses, Side Effects & CI", [
    "Uses: Angina, CHF (acute & chronic LVF), Acute MI",
    "β€”",
    "Side effects: Headache, Giddiness, Postural ↓BP",
    "Cold sweats, Nausea, Methemoglobinaemia",
    "Reflex tachycardia (prevent with Ξ²-blockers)",
    "β€”",
    "CI: Hypotension, Glaucoma, High ICP, Sildenafil co-use"
  ], 5.0, 1.63, 4.65, 2.4, "FEF9E7", "B7950B");

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 4.13, w: 9.3, h: 0.75, fill: { color: "FFF3CD" }, line: { color: C.yellowBorder } });
  s.addText("Tolerance: GTN needs SH-groups to form NO. Long-acting use depletes SH-groups β†’ loss of efficacy.", {
    x: 0.45, y: 4.14, w: 9.1, h: 0.35, fontSize: 8.5, color: C.black, fontFace: FONT
  });
  s.addText("Prevention: Nitrate-free interval (8–12 hrs daily)", {
    x: 0.45, y: 4.47, w: 9.1, h: 0.3, fontSize: 8.5, color: C.blue, bold: true, fontFace: FONT
  });

  tipBox(s, "Nitrates + Sildenafil (Viagra) = Dangerous hypotension β†’ may cause sudden death. NEVER combine!", 0.35, 4.98, 9.3, 0.38);
}

// ─── SLIDE 11: CALCIUM CHANNEL BLOCKERS ──────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Calcium Channel Blockers (CCBs)", "Classification Β· MOA Β· Uses Β· Side Effects", "11");

  // Classification visual
  const ccbCols = [
    { t: "Dihydropyridines (DHP)", color: C.blue, bg: C.lightBlue,
      items: ["Short: Nifedipine, Nicardipine, Nimodipine", "Intermediate: Isradipine, Lacidipine, Nisoldipine", "Long: Amlodipine, Felodipine, Lercanidipine"] },
    { t: "Phenylalkylamines", color: "065F46", bg: C.greenTip, items: ["Verapamil", "(acts on heart > vessels)"] },
    { t: "Benzothiazepines", color: "6B21A8", bg: "F3E8FF", items: ["Diltiazem", "(balanced heart & vessel)"] },
  ];
  ccbCols.forEach((c, i) => {
    const x = 0.35 + i * 3.15;
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 1.95, fill: { color: c.bg }, line: { color: c.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 0.32, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.t, { x: x + 0.1, y: 0.94, w: 2.8, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = c.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < c.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: 1.29, w: 2.8, h: 1.52, fontFace: FONT, valign: "top" });
  });

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.98, w: 9.3, h: 0.5, fill: { color: C.lightBlue }, line: { color: C.blue } });
  s.addText("Mechanism: Block L-type Ca²⁺ channels β†’ prevent Ca²⁺ influx β†’ ↓ contractility + Vasodilation", {
    x: 0.45, y: 2.98, w: 9.1, h: 0.48, fontSize: 9, bold: true, color: C.black, fontFace: FONT, valign: "middle"
  });

  sectionBox(s, "Pharmacological Effects", [
    "↑ Coronary blood flow (dilate coronaries)",
    "↓ Myocardial Oβ‚‚ demand (↓ BP, HR, contractility)"
  ], 0.35, 3.56, 3.0, 1.08, C.lightBlue, C.blue);

  sectionBox(s, "Clinical Uses", [
    "Supraventricular tachyarrhythmias (Verapamil)",
    "Hypertension",
    "Angina pectoris"
  ], 3.5, 3.56, 2.95, 1.08, C.greenTip, C.greenBorder);

  sectionBox(s, "Side Effects & CI", [
    "Verapamil/Diltiazem: Constipation, Bradycardia, Heart block, Hypotension",
    "Nifedipine: Headache, Flushing, Reflex tachycardia, Oedema",
    "CI: CHF, Heart block"
  ], 6.6, 3.56, 3.05, 1.08, C.redAlert, C.redBorder);

  tipBox(s, "DHP (Nifedipine/Amlodipine) = mainly vessels. Verapamil/Diltiazem = heart + vessels. For arrhythmias β†’ Verapamil.", 0.35, 4.74, 9.3, 0.38);
}

// ─── SLIDE 12: ANTIARRHYTHMICS CLASS I ───────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antiarrhythmic Drugs – Class I (Na⁺ Blockers)", "Vaughan-Williams Classification – Na⁺ Channel Blockers", "12");

  const classes1 = [
    {
      label: "IA – Prolong Repolarization",
      drugs: "Quinidine, Procainamide, Disopyramide, Moricizine",
      moa: "Depress phase 0, prolong ERP, slow conduction velocity, suppress automaticity",
      color: C.blue, bg: C.lightBlue
    },
    {
      label: "IB – Shorten Repolarization",
      drugs: "Lidocaine, Phenytoin, Mexiletine",
      moa: "Minimal phase 0 depression, shorten repolarization, ↓ APD. Lidocaine: blocks Na⁺ channels, raises AP threshold, suppresses ectopic foci",
      color: "059669", bg: C.greenTip
    },
    {
      label: "IC – Little Effect on Repolarization",
      drugs: "Propafenone, Flecainide, Encainide, Indecainide",
      moa: "Marked phase 0 depression, slow conduction. Little effect on repolarization",
      color: "6B21A8", bg: "F3E8FF"
    }
  ];
  classes1.forEach((c, i) => {
    const y = 0.95 + i * 1.4;
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 1.28, fill: { color: c.bg }, line: { color: c.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 0.3, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.label, { x: 0.45, y: y + 0.01, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
    s.addText(`Drugs: ${c.drugs}`, { x: 0.45, y: y + 0.35, w: 9.1, h: 0.3, fontSize: 8.5, color: C.black, fontFace: FONT });
    s.addText(`MOA: ${c.moa}`, { x: 0.45, y: y + 0.65, w: 9.1, h: 0.55, fontSize: 8, color: C.gray, fontFace: FONT, valign: "top" });
  });

  // Quinidine side effects
  warnBox(s, "Quinidine: Arrhythmias, ↑QT β†’ Torsades de Pointes, Heart failure, Cinchonism (tinnitus, blurred vision, GI upset), Allergic reactions", 0.35, 5.12, 9.3, 0.38);
}

// ─── SLIDE 13: ANTIARRHYTHMICS CLASS II–IV ────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antiarrhythmics – Class II, III, IV & Unclassified", "Ξ²-Blockers Β· K⁺ Channel Blockers Β· Ca²⁺ Blockers", "13");

  const c2 = [
    { label: "Class II – Ξ²-Blockers", drugs: "Propranolol, Atenolol, Metoprolol, Nadolol, Acebutolol, Pindolol",
      moa: "Decrease arrhythmogenic effects of catecholamines", ind: "SVT, Torsades de Pointes, WPW", color: C.blue, bg: C.lightBlue },
    { label: "Class III – K⁺ Channel Blockers", drugs: "Amiodarone, Sotalol, Bretylium, Ibutilide, Dofetilide",
      moa: "Prolong APD & ERP, delay repolarization by blocking K⁺ channels", ind: "Atrial flutter/fib, Ventricular tachycardia/fib, WPW", color: "6B21A8", bg: "F3E8FF" },
    { label: "Class IV – Ca²⁺ Channel Blockers", drugs: "Verapamil, Diltiazem",
      moa: "Block L-type Ca²⁺ channels β†’ ↓ SA/AV node conduction, ↓ automaticity", ind: "Paroxysmal SVT", color: "059669", bg: C.greenTip },
  ];
  c2.forEach((c, i) => {
    const y = 0.93 + i * 1.3;
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 1.18, fill: { color: c.bg }, line: { color: c.color, pt: 1 } });
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 0.28, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.label, { x: 0.45, y: y + 0.01, w: 9.1, h: 0.26, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    s.addText(`Drugs: ${c.drugs}`, { x: 0.45, y: y + 0.32, w: 9.1, h: 0.25, fontSize: 8, color: C.black, fontFace: FONT });
    s.addText(`MOA: ${c.moa}`, { x: 0.45, y: y + 0.57, w: 9.1, h: 0.3, fontSize: 8, color: C.gray, fontFace: FONT });
    s.addText(`Indications: ${c.ind}`, { x: 0.45, y: y + 0.86, w: 9.1, h: 0.25, fontSize: 8, color: c.color, bold: true, fontFace: FONT });
  });

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 4.83, w: 9.3, h: 0.72, fill: { color: "FEF3C7" }, line: { color: C.yellowBorder } });
  s.addText("Unclassified: Atropine (sinus bradycardia) Β· Adrenaline (cardiac arrest) Β· Isoprenaline (heart block) Β· Digoxin (rapid AF) Β· Adenosine (SVT) Β· CaClβ‚‚ (VT from hyperkalemia) Β· MgSOβ‚„ (VF)", {
    x: 0.45, y: 4.85, w: 9.1, h: 0.68, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "middle"
  });
}

// ─── SLIDE 14: ANTIHYPERTENSIVES ─────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antihypertensive Drugs – Overview", "First-line Β· Second-line Β· Classes", "14");

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.93, w: 9.3, h: 0.42, fill: { color: "0F3460" }, line: { color: "0F3460" } });
  s.addText("First-Line (Monotherapy): Thiazide Β· CCB Β· ACEI Β· AT-II Antagonist Β· Ξ²-Blocker", {
    x: 0.45, y: 0.93, w: 9.1, h: 0.42, fontSize: 10, bold: true, color: C.white, fontFace: FONT, valign: "middle"
  });
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.38, w: 9.3, h: 0.35, fill: { color: C.lightGray }, line: { color: C.divider } });
  s.addText("Second-Line: Diuretic + Ξ²-Blocker Β· Diuretic + ACEI Β· (add long-acting Ξ±-blocker e.g. Doxazosin if needed)", {
    x: 0.45, y: 1.38, w: 9.1, h: 0.35, fontSize: 8.5, color: C.gray, fontFace: FONT, valign: "middle"
  });

  const groups3 = [
    { t: "Diuretics", d: "Thiazides: HCTZ, Chlorthalidone\nLoop: Furosemide\nK⁺-sparing: Spironolactone", c: C.blue },
    { t: "RAS Drugs", d: "ACEIs: Captopril, Lisinopril\nAT-II blockers: Losartan\nRenin inhibitor: Aliskiren", c: "6B21A8" },
    { t: "CCBs", d: "Nifedipine, Amlodipine\nVerapamil, Diltiazem", c: "065F46" },
    { t: "Ξ²-Blockers", d: "Propranolol, Metoprolol", c: "92400E" },
    { t: "Ξ±-Blockers", d: "Prazosin", c: "1A5C2A" },
    { t: "Vasodilators", d: "Arterial: Hydralazine, Minoxidil\nMixed: Nitroprusside", c: "DC2626" },
  ];
  groups3.forEach((g, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.35 + col * 3.15;
    const y = 1.82 + row * 1.55;
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 1.45, fill: { color: C.lightGray }, line: { color: g.c, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 0.3, fill: { color: g.c }, line: { color: g.c } });
    s.addText(g.t, { x: x + 0.1, y: y + 0.01, w: 2.8, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    s.addText(g.d, { x: x + 0.1, y: y + 0.35, w: 2.8, h: 1.05, fontSize: 8, color: C.black, fontFace: FONT, valign: "top" });
  });

  highlight(s, "Safe in Pregnancy: Methyldopa Β· Hydralazine (IV) Β· Atenolol Β· Nifedipine Β· Prazosin Β· Clonidine", 0.35, 5.0, 9.3, 0.42, C.yellow);
}

// ─── SLIDE 15: ACE INHIBITORS ─────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "ACE Inhibitors (ACEIs)", "Mechanism Β· Uses Β· Side Effects Β· Generations", "15");

  // Generations
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.95, w: 4.5, h: 1.25, fill: { color: C.lightBlue }, line: { color: C.blue, pt: 1.5 } });
  s.addText("1st Generation", { x: 0.45, y: 0.97, w: 4.3, h: 0.28, fontSize: 9, bold: true, color: C.blue, fontFace: FONT });
  s.addText("Captopril Β· Enalapril Β· Lisinopril", { x: 0.45, y: 1.28, w: 4.3, h: 0.28, fontSize: 8.5, color: C.black, fontFace: FONT });
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.25, w: 4.5, h: 1.05, fill: { color: C.lightGray }, line: { color: C.blue, pt: 1 } });
  s.addText("2nd Generation", { x: 0.45, y: 2.27, w: 4.3, h: 0.28, fontSize: 9, bold: true, color: C.blue, fontFace: FONT });
  s.addText("Fosinopril Β· Perindopril Β· Quinapril Β· Ramipril\nTrandolapril Β· Cilazapril Β· Benazepril", {
    x: 0.45, y: 2.57, w: 4.3, h: 0.65, fontSize: 8, color: C.black, fontFace: FONT, valign: "top"
  });

  // MOA diagram
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.95, w: 4.65, h: 1.8, fill: { color: "FEF9E7" }, line: { color: "B7950B", pt: 1.5 } });
  s.addText("Mechanism", { x: 5.1, y: 0.97, w: 4.45, h: 0.28, fontSize: 9, bold: true, color: "92400E", fontFace: FONT });
  s.addText("Block ACE β†’ no Angiotensin II formed\n↓ Aldosterone β†’ ↓ fluid retention\nInhibit bradykinin breakdown β†’ ↑ vasodilation\nβ†’ ↓ Preload, ↓ Afterload, ↓ BP", {
    x: 5.1, y: 1.28, w: 4.45, h: 1.4, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top"
  });

  sectionBox(s, "Clinical Uses", [
    "Hypertension", "Congestive cardiac failure",
    "Post-MI (↓ remodeling)", "Scleroderma crisis"
  ], 5.0, 2.85, 4.65, 1.45, C.greenTip, C.greenBorder);

  sectionBox(s, "Side Effects ⚠", [
    "Persistent dry cough (bradykinin ↑)",
    "Steep ↓BP with diuretics",
    "Hyperkalemia (with K⁺-sparing diuretics)",
    "Renal insufficiency (bilateral renal artery stenosis)",
    "Angioedema, Rash, Taste loss",
    "Foetal damage (teratogenic) – avoid in pregnancy!",
    "Neutropenia, Proteinuria"
  ], 0.35, 3.38, 4.5, 1.95, C.redAlert, C.redBorder);

  tipBox(s, "Dry cough β†’ switch to AT-II blocker (no bradykinin effect). Memory: 'Captopril Ends Liver disease' (captopril, enalapril, lisinopril = 1st gen)", 0.35, 5.04, 9.3, 0.38);
}

// ─── SLIDE 16: AT-II BLOCKERS, CLONIDINE, HYPERTENSIVE CRISIS ────────────────
{
  const s = addSlideBase();
  addTitle(s, "AT-II Blockers, Central Agents & HTN Crisis", "ARBs Β· Clonidine Β· Vasodilators Β· Emergency Drugs", "16");

  sectionBox(s, "AT-II Receptor Antagonists (ARBs)", [
    "Drugs: Losartan, Valsartan, Candesartan, Eprosartan, Irbesartan, Olmesartan",
    "MOA: Block AT1 receptors β†’ block effects of Ang II but do NOT affect bradykinin",
    "Side effects: Hypotension, Hyperkalemia, ↓ Renal function, Angioedema"
  ], 0.35, 0.93, 9.3, 1.42, C.lightBlue, C.blue);

  sectionBox(s, "Vasodilators", [
    "Arterial: Hydralazine, Minoxidil, Diazoxide",
    "Arterial + Venous: Prazosin"
  ], 0.35, 2.43, 4.5, 0.98, "FEF3C7", "92400E");

  sectionBox(s, "Centrally Acting – Clonidine", [
    "Stimulates Ξ±β‚‚ receptors in brainstem",
    "β†’ ↓ sympathetic outflow from CNS β†’ ↓ BP"
  ], 5.0, 2.43, 4.65, 0.98, "F3E8FF", "6B21A8");

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 3.5, w: 9.3, h: 1.6, fill: { color: C.redAlert }, line: { color: C.redBorder, pt: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 3.5, w: 9.3, h: 0.3, fill: { color: C.redBorder }, line: { color: C.redBorder } });
  s.addText("Treatment of Hypertensive Crisis", { x: 0.45, y: 3.51, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
  const hcDrugs = ["Sodium nitroprusside", "Nifedipine", "Nitroglycerin", "Fenoldopam", "Hydralazine", "Esmolol", "Labetalol"];
  hcDrugs.forEach((d, i) => {
    const col = i % 4;
    const row = Math.floor(i / 4);
    s.addText(d, { x: 0.45 + col * 2.3, y: 3.86 + row * 0.36, w: 2.2, h: 0.3,
      fontSize: 8.5, color: C.black, bold: false, fontFace: FONT });
  });

  tipBox(s, "ARBs = ACEIs without cough. Both block RAS but at different points. ARBs preferred if ACEI causes dry cough.", 0.35, 5.18, 9.3, 0.35);
}

// ─── SLIDE 17: ASTHMA DRUGS ───────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Pharmacological Control of Asthma", "Prophylaxis vs Treatment Β· Classification", "17");

  const asthmaGroups = [
    { t: "Prophylaxis", color: "059669", bg: C.greenTip, items: [
      "Mast cell stabilizers: Cromoglycate sodium, Nedocromil, Ketotifen",
      "Corticosteroids (inhaled): Beclomethasone, Budesonide, Fluticasone",
      "Corticosteroids (systemic): Hydrocortisone, Prednisolone",
      "LT antagonists: Zafirlukast, Montelukast, Pranlukast",
      "LT inhibitors: Zileuton",
      "Anti-IgE: Omalizumab"
    ]},
    { t: "Treatment (Bronchodilators)", color: C.blue, bg: C.lightBlue, items: [
      "Selective Ξ²β‚‚ agonists: Short (Salbutamol, Terbutaline), Long (Salmeterol, Formoterol)",
      "Non-selective adrenergic: Isoprenaline, Adrenaline, Ephedrine",
      "Methylxanthines: Theophylline, Aminophylline",
      "Antimuscarinic: Ipratropium bromide"
    ]},
  ];
  asthmaGroups.forEach((g, i) => {
    const x = 0.35 + i * 4.8;
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 4.6, h: 2.65, fill: { color: g.bg }, line: { color: g.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 4.6, h: 0.32, fill: { color: g.color }, line: { color: g.color } });
    s.addText(g.t, { x: x + 0.1, y: 0.94, w: 4.4, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: 1.29, w: 4.4, h: 2.25, fontFace: FONT, valign: "top" });
  });

  // MOA
  sectionBox(s, "Mechanisms", [
    "Ξ²β‚‚ agonists: stimulate Ξ²β‚‚ β†’ ↑ cAMP β†’ bronchodilation",
    "Methylxanthines: inhibit PDE β†’ ↑ cAMP; also antagonise adenosine",
    "Antimuscarinic: block muscarinic receptors β†’ bronchodilation",
    "Cromolyn: inhibit mast cell degranulation β†’ block mediator release"
  ], 0.35, 3.66, 9.3, 1.35, "FEF9E7", "B7950B");

  tipBox(s, "Status Asthmaticus = Medical Emergency: Nebulised Ξ²β‚‚ + Ipratropium every 30 min + IV Hydrocortisone + Oβ‚‚ + IV fluids", 0.35, 5.1, 9.3, 0.35);
}

// ─── SLIDE 18: ANTITUSSIVES ───────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antitussive Drugs", "Classification Β· Mechanism Β· Adverse Effects", "18");

  const groups5 = [
    { t: "Pharyngeal Demulcents", color: C.blue, bg: C.lightBlue, items: ["Lozenges, cough drops, linctuses", "Soothe throat β†’ relief of dry cough from throat"] },
    { t: "Expectorants (Mucokinetics)", color: "065F46", bg: C.greenTip, items: [
      "Bronchial secretion enhancers: Terpin hydrate, Guaiphenesin, NHβ‚„Cl",
      "Mucolytics: Bromhexine, Ambroxol, Acetylcysteine, Carbocysteine"
    ]},
    { t: "Central Cough Suppressants", color: "6B21A8", bg: "F3E8FF", items: [
      "Opioids: Codeine, Pholcodeine",
      "Non-opioids: Noscapine, Dextromethorphan",
      "Antihistamines: Diphenhydramine, Promethazine"
    ]},
  ];
  groups5.forEach((g, i) => {
    const col = i % 3;
    const x = 0.35 + col * 3.15;
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 2.05, fill: { color: g.bg }, line: { color: g.color, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y: 0.93, w: 3.0, h: 0.3, fill: { color: g.color }, line: { color: g.color } });
    s.addText(g.t, { x: x + 0.1, y: 0.94, w: 2.8, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: 1.28, w: 2.8, h: 1.65, fontFace: FONT, valign: "top" });
  });

  sectionBox(s, "Mechanism Summary", [
    "Expectorants: ↑ bronchial secretion or ↓ viscosity β†’ easier cough",
    "Bromhexine: depolymerises mucopolysaccharides in mucus",
    "Codeine: suppresses mucociliary function of airway mucosa",
    "Noscapine: releases histamine β†’ useful in spasmodic cough"
  ], 0.35, 3.07, 9.3, 1.35, "FEF9E7", "B7950B");

  sectionBox(s, "Adverse Effects", [
    "Carbocysteine: GI irritation",
    "Bromhexine: Rhinorrhoea, Lacrimation",
    "Opioids: dependence, reduce cough reflex"
  ], 0.35, 4.5, 9.3, 0.88, C.redAlert, C.redBorder);
}

// ─── SLIDE 19: PEPTIC ULCER DRUGS ────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Drugs for Peptic Ulcer", "Classification Β· MOA Β· Drug Interactions Β· Adverse Effects", "19");

  const pu = [
    { t: "Antacids (Neutralise acid)", c: C.blue, bg: C.lightBlue, items: ["Systemic: Sodium bicarbonate", "Non-systemic: CaCO₃, Mg(OH)β‚‚, Al(OH)₃"] },
    { t: "Hβ‚‚ Receptor Antagonists", c: "065F46", bg: C.greenTip, items: ["Cimetidine, Ranitidine, Famotidine, Nizatidine", "Block Hβ‚‚ on parietal cells β†’ ↓ acid secretion"] },
    { t: "Proton Pump Inhibitors (PPIs)", c: "6B21A8", bg: "F3E8FF", items: ["Omeprazole, Lansoprazole, Pantoprazole", "Inhibit H⁺/K⁺-ATPase β†’ stop acid secretion at source"] },
    { t: "Mucosal Protectives", c: "92400E", bg: "FEF3C7", items: ["Sucralfate: gel clings to ulcer base + ↑ PG synthesis", "Bismuth: coat mucosa + inhibit H. pylori", "Misoprostol (PGE analogue): ↑ mucosal defense"] },
  ];
  pu.forEach((g, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.7;
    const y = 0.93 + row * 1.75;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 1.62, fill: { color: g.bg }, line: { color: g.c, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.3, fill: { color: g.c }, line: { color: g.c } });
    s.addText(g.t, { x: x + 0.1, y: y + 0.01, w: 4.3, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: y + 0.35, w: 4.3, h: 1.22, fontFace: FONT, valign: "top" });
  });

  warnBox(s, "Drug Interactions: Antacids form complexes with iron, tetracyclines, digoxin, fluoroquinolones β†’ give antacids 2 hrs before/after. Sucralfate needs acidic pH β†’ avoid simultaneous antacids.", 0.35, 4.5, 9.3, 0.55);
  tipBox(s, "Cimetidine inhibits CYP450 β†’ many drug interactions. Ranitidine = safer. PPIs = strongest acid suppression.", 0.35, 5.13, 9.3, 0.35);
}

// ─── SLIDE 20: ANTIEMETICS & PROKINETICS ─────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antiemetics, Emetics & Prokinetics", "Classification Β· MOA Β· Uses Β· Side Effects", "20");

  const ae = [
    { t: "Dopamine Antagonists (Prokinetics)", c: C.blue, bg: C.lightBlue, d: "Metoclopramide, Domperidone" },
    { t: "5-HT₃ Antagonists", c: "059669", bg: C.greenTip, d: "Ondansetron" },
    { t: "Anticholinergics", c: "6B21A8", bg: "F3E8FF", d: "Scopolamine, Promethazine, Diphenhydramine" },
    { t: "Neuroleptics", c: "92400E", bg: "FEF3C7", d: "Chlorpromazine, Haloperidol" },
    { t: "NK₁ Antagonists", c: "DC2626", bg: C.redAlert, d: "Aprepitant" },
    { t: "Others", c: "374151", bg: C.lightGray, d: "Cisapride, Corticosteroids, Cannabinoids (Nabilone)" },
  ];
  ae.forEach((g, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.35 + col * 3.15;
    const y = 0.93 + row * 1.12;
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 1.0, fill: { color: g.bg }, line: { color: g.c, pt: 1 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 0.28, fill: { color: g.c }, line: { color: g.c } });
    s.addText(g.t, { x: x + 0.08, y: y + 0.01, w: 2.84, h: 0.26, fontSize: 7.5, bold: true, color: C.white, fontFace: FONT });
    s.addText(g.d, { x: x + 0.08, y: y + 0.32, w: 2.84, h: 0.62, fontSize: 8, color: C.black, fontFace: FONT, valign: "top" });
  });

  sectionBox(s, "Prokinetic Drug Effects", [
    "↑ Lower esophageal sphincter tone",
    "↑ Gastroduodenal peristalsis & gastric emptying",
    "Prevents gastroesophageal reflux",
    "Antiemetic action (no effect on gastric secretion)"
  ], 0.35, 3.23, 4.5, 1.55, C.lightBlue, C.blue);

  sectionBox(s, "Clinical Uses & Adverse Effects", [
    "Uses: Cancer chemo, Motion sickness, Pregnancy vomiting, Post-op, GORD",
    "Prokinetics uses: antiemetic, dyspepsia, peptic ulcer, GORD",
    "β€”",
    "Side effects: Dry mouth, Constipation, Vestibular disorders",
    "Prokinetics: Sedation, Diarrhoea, Muscle dystonias"
  ], 5.0, 3.23, 4.65, 1.55, "FEF9E7", "B7950B");

  tipBox(s, "Ondansetron (5-HT₃ blocker) = gold standard for chemo-induced nausea. Domperidone = safer than metoclopramide (less CNS effects).", 0.35, 4.87, 9.3, 0.38);
}

// ─── SLIDE 21: LAXATIVES & ANTIDIARRHEALS ────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Laxatives & Antidiarrheals", "GI Water Flux & Motility Drugs", "21");

  const lax = [
    { t: "Bulk Laxatives", c: C.blue, items: ["Indigestible vegetable fibre, Hydrophilic colloids", "Add bulk β†’ form solid stools"] },
    { t: "Osmotic Purgatives", c: "6B21A8", items: ["Lactulose, Sorbitol, Mg salts, Na salts", "↑ Peristalsis β†’ evacuate fluid stool"] },
    { t: "Faecal Softeners", c: "059669", items: ["Docusate sodium, Liquid paraffin", "↓ Surface tension β†’ water retained in feces"] },
    { t: "Stimulant Purgatives", c: "DC2626", items: ["Bisacodyl, Castor oil, Senna, Cascara", "↑ Intestinal motility + ↑ water/electrolyte secretion"] },
  ];
  lax.forEach((g, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.7;
    const y = 0.93 + row * 1.45;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 1.32, fill: { color: C.lightGray }, line: { color: g.c, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.28, fill: { color: g.c }, line: { color: g.c } });
    s.addText(g.t, { x: x + 0.1, y: y + 0.01, w: 4.3, h: 0.26, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: y + 0.33, w: 4.3, h: 0.94, fontFace: FONT, valign: "top" });
  });

  sectionBox(s, "Antidiarrheal Drugs", [
    "Adsorbents: Kaolin, Pectin, Activated Charcoal β†’ adsorb toxins",
    "Antisecretory: Atropine, Octreotide, Racecadotril",
    "Antimotility (opioids): Loperamide, Diphenoxylate + Atropine (Lomotil)"
  ], 0.35, 3.91, 9.3, 1.0, C.lightBlue, C.blue);

  highlight(s, "Principles of Diarrhoea Tx: Rehydration (ORS) β†’ Treat cause β†’ Antidiarrheals last", 0.35, 4.99, 9.3, 0.38, C.yellow);
}

// ─── SLIDE 22: ANTICOAGULANTS – HEPARIN ──────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Parenteral Anticoagulants – Heparin", "Classification Β· MOA Β· Uses Β· Reversal", "22");

  sectionBox(s, "Classification of Direct-Acting Parenteral Anticoagulants", [
    "Heparin (unfractionated)",
    "LMWH: Enoxaparin, Dalteparin, Reviparin, Tinzaparin",
    "Heparinoids: Heparan sulfate, Danaparoid",
    "Direct thrombin inhibitors – Parenteral: Hirudin, Lepirudin, Bivalirudin, Argatroban | Oral: Dabigatran",
    "Factor Xa inhibitor: Rivaroxaban"
  ], 0.35, 0.93, 9.3, 1.75, C.lightBlue, C.blue);

  // Heparin MOA
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.76, w: 9.3, h: 0.95, fill: { color: "FEF9E7" }, line: { color: "B7950B", pt: 1 } });
  s.addText("Heparin Mechanism", { x: 0.45, y: 2.78, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: "92400E", fontFace: FONT });
  s.addText("Indirect-acting β†’ activates plasma Antithrombin III β†’ inactivates activated coagulation factors (Xa, IIa)", {
    x: 0.45, y: 3.08, w: 9.1, h: 0.55, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top"
  });

  sectionBox(s, "Side Effects", [
    "Bleeding (main risk)",
    "Heparin-Induced Thrombocytopenia (HIT)",
    "Osteoporosis (prolonged therapy)",
    "Transient alopecia",
    "Hyperkalemia",
    "Allergic: Urticaria, Asthma, Rhinitis, Fever"
  ], 0.35, 3.79, 4.5, 1.65, C.redAlert, C.redBorder);

  sectionBox(s, "Key Details", [
    "Indication: Venous thrombosis",
    "Lab control: aPTT monitoring",
    "Reversal: IV Protamine sulfate",
    "LMWH advantage: Predictable dosing, less HIT, no aPTT monitoring needed"
  ], 5.0, 3.79, 4.65, 1.65, C.greenTip, C.greenBorder);

  tipBox(s, "Heparin = indirect (needs Antithrombin III). Hirudin = direct (no cofactor needed). Reversal = Protamine. Monitor aPTT.", 0.35, 5.52, 9.3, 0.35);
}

// ─── SLIDE 23: ORAL ANTICOAGULANTS – WARFARIN ────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Oral Anticoagulants – Warfarin", "Mechanism Β· Uses Β· Adverse Effects Β· Reversal", "23");

  sectionBox(s, "Drug Names", [
    "Coumarin derivatives: Warfarin, Acenocoumarin, Bishydroxycoumarin, Nicoumalone",
    "Indandione derivatives: Phenindione, Diphenadione"
  ], 0.35, 0.93, 9.3, 1.05, C.lightBlue, C.blue);

  // MOA comparison table
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.05, w: 9.3, h: 0.88, fill: { color: "FEF9E7" }, line: { color: "B7950B" } });
  s.addText("Mechanism", { x: 0.45, y: 2.07, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: "92400E", fontFace: FONT });
  s.addText("Indirect acting – competitive antagonist of Vitamin K β†’ interfere with synthesis of Vitamin K–dependent clotting factors in liver (II, VII, IX, X)", {
    x: 0.45, y: 2.37, w: 9.1, h: 0.5, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top"
  });

  sectionBox(s, "Therapeutic Uses", [
    "Venous thrombosis & pulmonary embolism",
    "Post-operative, post-stroke, bedridden patients",
    "Rheumatic valvular disease, Unstable angina",
    "Vascular surgery, Artificial heart valves, Haemodialysis"
  ], 0.35, 3.0, 4.5, 1.6, C.greenTip, C.greenBorder);

  sectionBox(s, "Adverse Effects & Reversal", [
    "Haemorrhage: haematuria, epistaxis, bleeding gums, hemoptysis",
    "Purple toe syndrome, Alopecia, Urticaria, GIT symptoms",
    "Teratogenic β†’ fatal haemorrhage in foetus",
    "β€”",
    "Lab control: INR / Prothrombin time",
    "Reversal: Withdraw warfarin + Fresh frozen plasma / fresh blood",
    "Antidote: Vitamin K₁ (Phytonadione)"
  ], 5.0, 3.0, 4.65, 2.35, C.redAlert, C.redBorder);

  highlight(s, "Heparin = acute use, hospital, aPTT monitoring. Warfarin = chronic use, oral, INR monitoring. Reversal: Protamine (Heparin) vs Vitamin K (Warfarin)", 0.35, 5.4, 9.3, 0.38, C.yellow);
}

// ─── SLIDE 24: THROMBOLYTICS & ANTIFIBRINOLYTICS ─────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Thrombolytics & Antifibrinolytics", "Fibrinolytic drugs Β· MOA Β· Uses Β· Reversal", "24");

  sectionBox(s, "Thrombolytic (Fibrinolytic) Drugs", [
    "Streptokinase, Urokinase, r-tPA (Alteplase), APSA",
    "MOA: Activate natural fibrinolytic system (convert plasminogen β†’ plasmin)",
    "Uses: Acute MI (within 12 hrs), Pulmonary embolism, DVT, Peripheral arterial occlusion, Ischemic stroke (alteplase)",
    "Side effects: Bleeding, Allergic reactions (streptokinase), Hypotension"
  ], 0.35, 0.93, 9.3, 2.0, C.lightBlue, C.blue);

  sectionBox(s, "Antifibrinolytic Drugs", [
    "Drugs: EACA (Epsilon aminocaproic acid), Tranexamic acid",
    "EACA MOA: Blocks lysine binding sites on plasminogen/plasmin β†’ inhibits plasminogen activation",
    "Tranexamic acid: Competitive antagonist of plasminogen β†’ inhibits fibrinolysis",
    "Uses: Antidote for thrombolytic overdose, Dental surgery in haemophiliacs, Trauma/surgical bleeding, Menorrhagia, Post-partum haemorrhage",
    "Side effects: GI discomfort, Nausea, Dyspepsia, Intravascular thrombosis (rare)"
  ], 0.35, 3.02, 9.3, 2.2, C.greenTip, C.greenBorder);

  warnBox(s, "Reversal of thrombolytics: Give EACA or Tranexamic acid (AMCA). Streptokinase is allergenic – check for prior use.", 0.35, 5.3, 9.3, 0.38);
}

// ─── SLIDE 25: ANTIPLATELET DRUGS ────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Antiplatelet Drugs", "Classification Β· MOA Β· Uses Β· Side Effects", "25");

  const ap = [
    { t: "PG Synthesis Inhibitors", c: C.blue, bg: C.lightBlue, items: ["Aspirin: irreversibly acetylates COX β†’ ↓ TXAβ‚‚", "Dazoxiben: blocks TXAβ‚‚", "Ridogrel"] },
    { t: "PDE Inhibitors", c: "059669", bg: C.greenTip, items: ["Dipyridamole: blocks platelet PDE β†’ ↑ cAMP β†’ ↓ aggregation", "Cilostazol"] },
    { t: "ADP Antagonists", c: "6B21A8", bg: "F3E8FF", items: ["Ticlopidine, Clopidogrel, Prasugrel", "Inhibit ADP-induced platelet aggregation"] },
    { t: "GP IIb/IIIa Inhibitors", c: "DC2626", bg: C.redAlert, items: ["Abciximab: binds GP IIb/IIIa β†’ ↓ aggregation", "Tirofiban, Eptifibatide"] },
  ];
  ap.forEach((g, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.7;
    const y = 0.93 + row * 1.82;
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 1.7, fill: { color: g.bg }, line: { color: g.c, pt: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.3, fill: { color: g.c }, line: { color: g.c } });
    s.addText(g.t, { x: x + 0.1, y: y + 0.01, w: 4.3, h: 0.28, fontSize: 8.5, bold: true, color: C.white, fontFace: FONT });
    const bItems = g.items.map((t, idx) => ({
      text: t, options: { bullet: { code: "2022" }, breakLine: idx < g.items.length - 1, fontSize: 8.5, color: C.black }
    }));
    s.addText(bItems, { x: x + 0.1, y: y + 0.35, w: 4.3, h: 1.3, fontFace: FONT, valign: "top" });
  });

  sectionBox(s, "Therapeutic Uses", [
    "Ischemic heart disease (MI, angina) – Aspirin",
    "Cardiac procedures (angioplasty, CABG, stenting)",
    "Atrial fibrillation, Prosthetic heart valves",
    "Cerebrovascular disease, PVD, Haemodialysis",
    "Pulmonary HTN – Epoprostenol"
  ], 0.35, 4.65, 9.3, 0.85, C.lightGray, C.blue);

  tipBox(s, "Aspirin = irreversible COX inhibitor (lasts platelet lifetime ~7–10 days). Clopidogrel = ADP blocker. Combined = stronger antiplatelet effect.", 0.35, 5.57, 9.3, 0.35);
}

// ─── SLIDE 26: ANEMIA DRUGS ───────────────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Drugs for Anaemia", "Iron Β· Vitamin B12 Β· Folic Acid Β· Erythropoietin", "26");

  sectionBox(s, "Iron Preparations", [
    "Oral: Ferrous sulfate, Ferrous fumarate, Ferrous gluconate",
    "Parenteral: Iron dextran (IM/IV), Iron sorbitol–citric acid complex (IM only)",
    "PK: Absorbed in duodenum/proximal jejunum; must be ferrous (Fe²⁺); transported on transferrin",
    "SE (oral): Nausea, constipation, metallic taste, dark stools",
    "SE (parenteral): Fever, joint pain, urticaria, anaphylaxis"
  ], 0.35, 0.93, 4.5, 2.25, C.lightBlue, C.blue);

  sectionBox(s, "B12, Folic Acid & Erythropoietin", [
    "Vitamin B12 (Cyanocobalamin): Route = parenteral; Uses = B12 deficiency, tobacco amblyopia",
    "Folic acid: Uses = megaloblastic anaemia, pregnancy, malabsorption, drug-induced (methotrexate, phenytoin)",
    "Erythropoietin: Uses = end-stage renal failure, AIDS (zidovudine), cancer anaemia, aplastic anaemia, premature babies"
  ], 5.0, 0.93, 4.65, 2.25, C.greenTip, C.greenBorder);

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 3.26, w: 9.3, h: 1.22, fill: { color: C.redAlert }, line: { color: C.redBorder, pt: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 3.26, w: 9.3, h: 0.3, fill: { color: C.redBorder }, line: { color: C.redBorder } });
  s.addText("Treatment of Acute Iron Intoxication", { x: 0.45, y: 3.27, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });
  s.addText("1. Prevent absorption: Syrup ipecac (induce vomiting) or gastric lavage with NaHCO₃ Β· Give egg yolk & milk to complex iron\n2. Desferrioxamine (specific antidote) – binds & removes absorbed iron\n3. Supportive: IV fluids, maintain BP, Diazepam for convulsions", {
    x: 0.45, y: 3.6, w: 9.1, h: 0.82, fontSize: 8.5, color: C.black, fontFace: FONT, valign: "top"
  });

  tipBox(s, "Memory: Fe = ferrous (Fe²⁺) for absorption. Iron overload antidote = DeferOXamine. B12 deficiency = give IM (oral absorption requires intrinsic factor).", 0.35, 4.56, 9.3, 0.38);
}

// ─── SLIDE 27: EXAM QUICK REFERENCE ──────────────────────────────────────────
{
  const s = addSlideBase();
  addTitle(s, "Exam Quick Reference", "Most Commonly Tested Topics – from Variants Page", "β˜…");

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 0.93, w: 9.3, h: 0.32, fill: { color: "0F3460" }, line: { color: "0F3460" } });
  s.addText("Always Asked in Exam", { x: 0.45, y: 0.94, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });

  const alwaysAsked = [
    "CHF Classification", "Antiplatelet Classification", "Peptic Ulcer Classification",
    "Nitrates Classification", "Asthma/Bronchodilator Classification", "Antihypertensives Classification",
    "Antianginal Classification", "Antiarrhythmic Classification", "Antiemetic Classification",
    "Anticoagulants (Parenteral)", "Anticoagulants (Oral)"
  ];
  alwaysAsked.forEach((t, i) => {
    const col = i % 4;
    const row = Math.floor(i / 4);
    s.addText(t, {
      x: 0.45 + col * 2.3, y: 1.32 + row * 0.4, w: 2.15, h: 0.32,
      fontSize: 8, bold: true, color: C.blue, align: "center", valign: "middle",
      fill: { color: C.lightBlue }, line: { color: C.blue, pt: 0.5 }, rectRadius: 0.1
    });
  });

  s.addShape(pres.ShapeType.rect, { x: 0.35, y: 2.6, w: 9.3, h: 0.32, fill: { color: "374151" }, line: { color: "374151" } });
  s.addText("Key Mechanisms – Know These Cold", { x: 0.45, y: 2.61, w: 9.1, h: 0.28, fontSize: 9, bold: true, color: C.white, fontFace: FONT });

  const mechs = [
    ["Digitoxin/Digoxin", "Inhibit Na⁺/K⁺-ATPase β†’ ↑ Ca²⁺ β†’ ↑ contraction"],
    ["Bromhexine", "Depolymerises mucopolysaccharides β†’ ↓ mucus viscosity"],
    ["Prokinetics (Metoclopramide)", "↑ Lower esophageal tone + ↑ GI motility"],
    ["Lidocaine (Class IB)", "Blocks Na⁺ channels, ↑ AP threshold, suppresses ectopic foci"],
    ["Cromolyn sodium", "Inhibit mast cell degranulation β†’ block inflammatory mediators"],
  ];
  mechs.forEach((m, i) => {
    const y = 3.0 + i * 0.38;
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 0.34, fill: { color: i % 2 === 0 ? C.lightGray : C.white }, line: { color: C.divider, pt: 0.5 } });
    s.addText(m[0], { x: 0.45, y: y + 0.02, w: 2.5, h: 0.3, fontSize: 8, bold: true, color: C.blue, fontFace: FONT });
    s.addText(m[1], { x: 2.95, y: y + 0.02, w: 6.55, h: 0.3, fontSize: 8, color: C.black, fontFace: FONT });
  });

  highlight(s, "High-yield side effects: Quinidine (Cinchonism), Cimetidine (gynaecomastia), HCTZ (glucose/lipids↑, K⁺↓), Nitrates (headache), Al(OH)₃ (constipation), CaCO₃ (hypercalcaemia)", 0.35, 4.93, 9.3, 0.42, C.yellow);
}

// ─── SLIDE 28: CLOSING / SUMMARY ─────────────────────────────────────────────
{
  const s = addSlideBase();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0F3460" }, line: { color: "0F3460" } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.6, w: 10, h: 1.025, fill: { color: "0A2647" }, line: { color: "0A2647" } });

  s.addText("You've Got This.", { x: 0.5, y: 0.8, w: 9, h: 0.8,
    fontSize: 42, bold: true, color: C.white, fontFace: FONT, align: "center" });
  s.addText("26 Topics Β· Reviewed", { x: 0.5, y: 1.68, w: 9, h: 0.4,
    fontSize: 18, color: "7FB3D3", fontFace: FONT, align: "center", italic: true });

  const summary = [
    "CHF + Cardiac Glycosides", "Diuretics (Loop, Thiazide, K⁺-sparing)",
    "Ξ²-Blockers + CCBs", "Nitrates + Antianginals",
    "Antiarrhythmics I–IV", "Antihypertensives + RAS",
    "Asthma drugs", "GI drugs (PU, Antiemetics, Laxatives)",
    "Anticoagulants (Heparin + Warfarin)", "Thrombolytics + Antifibrinolytics",
    "Antiplatelet drugs", "Anaemia drugs"
  ];
  summary.forEach((t, i) => {
    const col = i % 4;
    const row = Math.floor(i / 4);
    s.addText("βœ“ " + t, { x: 0.4 + col * 2.4, y: 2.25 + row * 0.42, w: 2.3, h: 0.35,
      fontSize: 7.5, color: "B0C4DE", fontFace: FONT });
  });

  s.addText("Good luck on your exam!", {
    x: 0.5, y: 4.65, w: 9, h: 0.38,
    fontSize: 12, color: "7FB3D3", fontFace: FONT, align: "center", italic: true
  });
}

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/pharmaco-slides/Pharmacology_Major2_StudyNotes.pptx" })
  .then(() => console.log("βœ… PPTX created successfully!"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/pharmaco-slides && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/pharmaco-slides/

Your presentation is ready! πŸŽ‰

Pharmacology Major2 StudyNotes

Presentation Β· PPTX


Here's what's inside the 28-slide deck (734 KB):
SlideContent
CoverTopic pills overview, clean dark navy header
1CHF Drug Classification - color-coded 4-group layout
2Cardiac Glycosides MOA - step-by-step chain of events flowchart
3Digoxin PK comparison table + toxicity symptoms + treatment
4β₁ Agonists & PDE Inhibitors + Acute LVF treatment protocol
5Vasodilators - Arterial / Venous / Mixed with uses & CIs
6Diuretics full classification by efficacy
7Loop Diuretics - MOA, uses, adverse effects
8Thiazide Diuretics - by duration + side effects memory trick
9Ξ²-Blockers - selectivity table, mechanism, uses, CIs
10Organic Nitrates - MOA, tolerance mechanism, Sildenafil warning
11CCBs - DHP vs Verapamil vs Diltiazem comparison
12Antiarrhythmics Class I (IA/IB/IC) - Quinidine cinchonism
13Antiarrhythmics Class II-IV + unclassified drugs
14Antihypertensives overview + pregnancy-safe drugs
15ACEIs - generations, MOA, dry cough, side effects
16ARBs, Clonidine, Hypertensive Crisis emergency drugs
17Asthma drugs - Prophylaxis vs Treatment + Status Asthmaticus protocol
18Antitussives - expectorants, mucolytics, central suppressants
19Peptic Ulcer drugs - all 4 groups + drug interactions warning
20Antiemetics & Prokinetics - 6-class grid + uses
21Laxatives & Antidiarrheals
22Heparin - classification, MOA, HIT, reversal with protamine
23Warfarin - mechanism, INR monitoring, Vitamin K reversal
24Thrombolytics & Antifibrinolytics
25Antiplatelet drugs - Aspirin, Clopidogrel, GP IIb/IIIa inhibitors
26Anaemia drugs - Iron, B12, Folic acid, Erythropoietin, iron toxicity Tx
27Exam Quick Reference - always-asked topics + high-yield mechanisms
28Closing summary slide
Design features: Pure white backgrounds, blue/yellow/green color hierarchy, boxed sections with color-coded headers, memory tricks in green tip boxes, warnings in red boxes, and highlighted yellow key-concept banners throughout.
This is a shared conversation. Sign in to Orris to start your own chat.