Anatomy of brachial plexus , subarachanoid space and epidural space . Make a ppt of 30 slides for anaesthesia PG students .

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Searching Images

brachial plexus anatomy diagram roots trunks divisions cords

Reading File
Finding Sources
Searching Images

subarachnoid space epidural space spinal cord cross section anatomy

Reading File
Finding Sources
Searching Images

regional anesthesia brachial plexus nerve block interscalene axillary

Running Command

ls /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/anae…

Writing File

~/anaesthesia-anatomy-ppt/build_ppt.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// ─── Colour palette ────────────────────────────────────────────────────────
const C = {
  navy:    "0D2137",   // dominant background
  darkBg:  "091929",   // alternate darker
  teal:    "00B8D9",   // accent headings
  amber:   "FFB347",   // highlight / bullets
  white:   "F0F4F8",
  light:   "B0C4D8",
  green:   "4CAF82",
  red:     "E05A5A",
  midBg:   "122840",   // card backgrounds
};

// ─── Image URLs ─────────────────────────────────────────────────────────────
const IMG = {
  bpDiagram:   "https://cdn.orris.care/cdss_images/HARRISON_1763034978151_dcfec64f-4894-46b6-94bd-ba17fd6a8314.png",
  bpMRI:       "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_84a54033dbc8ecad8a5f6bc966a49c2e9eb53fa9ac67b2835fa0f5cdb82d3651.jpg",
  bpCadaver:   "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9f3cd2a0d555feaacb1f044acbbe90c4b722b0701b0110de7144f429a6b62ab8.jpg",
  bpUltrasound:"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_edc5d6a45712e894ff7082d361cf0781ce12e4e76f0600bba7d9580ec4dcf326.jpg",
  bpInfraclav: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_1b3f4a0ae6311464eaa0a5f60d83c36ae8ddadfb6b7ab79e4f4f6c2b7891a306.jpg",
  bpSupraclav: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ea2191a916822debc57a4c8c357dff69201329ca63ba3b7155402ec7fd8a980d.jpg",
  spinalMRI:   "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_b976a62c5ccd49c7f0defd8b3e72c0bb630789f5ab6efb976849718fbb984eaf.jpg",
  spinalMRI2:  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e721b23638e92195e7534d9cc8c6db83410e32ec47c3c60a9c5cce3875a38b96.jpg",
  epiduralFig: "https://cdn.orris.care/cdss_images/16b155e915375ee13a1ca44ba4cb83217d78f06b48fc25dbd4d561bf2cde5743.png",
  ligFlavum:   "https://cdn.orris.care/cdss_images/21d0b52019b115ac8896f2660fc2a3b660dfb86f0be44e9e547bbc63d08ba535.png",
  meningesFig: "https://cdn.orris.care/cdss_images/309b849fc80e813a21de7330fe1b70450e2dc5eb3e084f54f5c6ee18cd844761.png",
};

// Pre-fetch all images as base64
console.log("Fetching images...");
let imageData = {};
const urls = Object.values(IMG);
try {
  const result = execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
    { maxBuffer: 50 * 1024 * 1024, timeout: 60000 }
  ).toString();
  const arr = JSON.parse(result);
  arr.forEach((item, i) => {
    const key = Object.keys(IMG)[i];
    if (!item.error) imageData[key] = item.base64;
    else console.log(`Image failed: ${key} - ${item.error}`);
  });
} catch(e) {
  console.log("Image fetch error:", e.message);
}
console.log(`Loaded ${Object.keys(imageData).length} images`);

// ─── Helper functions ───────────────────────────────────────────────────────
function makePres() {
  const pres = new pptxgen();
  pres.layout = "LAYOUT_16x9";
  pres.title = "Anatomy for Anaesthesia – Brachial Plexus, Subarachnoid & Epidural Space";
  pres.author = "Anaesthesia PG Department";
  return pres;
}

function addBg(slide, color) {
  slide.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: color || C.navy } });
}

function addTitle(slide, text, opts = {}) {
  slide.addText(text, {
    x: 0.4, y: 0.2, w: 9.2, h: 0.65,
    fontSize: opts.size || 24, bold: true,
    color: opts.color || C.teal, fontFace: "Calibri",
    align: "left", margin: 0, ...opts
  });
}

function addDivider(slide, y) {
  slide.addShape("line", { x: 0.4, y: y || 0.95, w: 9.2, h: 0, line: { color: C.teal, width: 1.5 } });
}

function addSubtitle(slide, text, y) {
  slide.addText(text, {
    x: 0.4, y: y || 1.0, w: 9.2, h: 0.35,
    fontSize: 13, bold: true, color: C.amber, fontFace: "Calibri", margin: 0
  });
}

function addBullets(slide, items, opts = {}) {
  const textArr = items.map((item, i) => ({
    text: item,
    options: {
      bullet: opts.noBullet ? false : { indent: 10 },
      breakLine: i < items.length - 1,
      color: opts.color || C.white,
      fontSize: opts.size || 15,
      fontFace: "Calibri",
    }
  }));
  slide.addText(textArr, {
    x: opts.x || 0.4, y: opts.y || 1.45,
    w: opts.w || 9.2, h: opts.h || 3.7,
    valign: "top", margin: [2, 0, 2, 8],
    lineSpacingMultiple: 1.15,
  });
}

function addCard(slide, x, y, w, h, title, items, titleColor) {
  slide.addShape("rect", { x, y, w, h, fill: { color: C.midBg }, line: { color: C.teal, width: 1 } });
  slide.addText(title, { x: x + 0.1, y: y + 0.05, w: w - 0.2, h: 0.3, fontSize: 11, bold: true, color: titleColor || C.amber, fontFace: "Calibri", margin: 0 });
  const textArr = items.map((item, i) => ({
    text: item,
    options: { bullet: { indent: 8 }, breakLine: i < items.length - 1, color: C.white, fontSize: 11, fontFace: "Calibri" }
  }));
  slide.addText(textArr, { x: x + 0.1, y: y + 0.38, w: w - 0.2, h: h - 0.45, valign: "top", margin: [1, 0, 1, 5], lineSpacingMultiple: 1.1 });
}

function sectionBanner(slide, label, subtitle) {
  // Full-slide section divider with big centered text
  slide.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  slide.addShape("rect", { x: 0, y: 2.0, w: 10, h: 1.625, fill: { color: C.midBg } });
  slide.addShape("line", { x: 1, y: 2.0, w: 8, h: 0, line: { color: C.teal, width: 2 } });
  slide.addShape("line", { x: 1, y: 3.625, w: 8, h: 0, line: { color: C.teal, width: 2 } });
  slide.addText(label, { x: 0.5, y: 2.1, w: 9, h: 1.1, fontSize: 36, bold: true, color: C.teal, fontFace: "Calibri", align: "center", valign: "middle" });
  if (subtitle) slide.addText(subtitle, { x: 0.5, y: 3.7, w: 9, h: 0.6, fontSize: 16, color: C.light, fontFace: "Calibri", align: "center", italic: true });
  slide.addText("ANATOMY FOR ANAESTHESIA", { x: 0.5, y: 0.5, w: 9, h: 0.4, fontSize: 12, color: C.light, fontFace: "Calibri", align: "center", charSpacing: 4 });
  slide.addText("For PG Anaesthesia Students", { x: 0.5, y: 5.0, w: 9, h: 0.35, fontSize: 11, color: C.amber, fontFace: "Calibri", align: "center" });
}

// ─── BUILD PRESENTATION ─────────────────────────────────────────────────────
const pres = makePres();

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 1 – TITLE
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, C.darkBg);
  s.addShape("rect", { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.teal } });
  s.addShape("rect", { x: 0, y: 4.8, w: 10, h: 0.825, fill: { color: C.midBg } });
  s.addText("ANATOMY FOR ANAESTHESIA", { x: 0.5, y: 0.55, w: 9.2, h: 0.5, fontSize: 14, color: C.teal, fontFace: "Calibri", charSpacing: 5, bold: false, align: "left" });
  s.addText([
    { text: "Brachial Plexus", options: { breakLine: true, color: C.white, fontSize: 30, bold: true } },
    { text: "Subarachnoid Space", options: { breakLine: true, color: C.white, fontSize: 30, bold: true } },
    { text: "Epidural Space", options: { breakLine: false, color: C.amber, fontSize: 30, bold: true } },
  ], { x: 0.5, y: 1.2, w: 9.2, h: 2.4, fontFace: "Calibri", valign: "top" });
  s.addShape("line", { x: 0.5, y: 3.75, w: 5, h: 0, line: { color: C.teal, width: 2 } });
  s.addText("Regional & Neuraxial Anatomy for Anaesthesia PG Students", { x: 0.5, y: 3.85, w: 9, h: 0.4, fontSize: 14, color: C.light, fontFace: "Calibri", italic: true });
  s.addText("Department of Anaesthesiology  |  Postgraduate Teaching Series", { x: 0.5, y: 4.9, w: 9, h: 0.35, fontSize: 11, color: C.light, fontFace: "Calibri", align: "center" });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 2 – CONTENTS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Table of Contents");
  addDivider(s);
  const sections = [
    ["PART 1", "Brachial Plexus", "Slides 3 – 12"],
    ["PART 2", "Subarachnoid Space", "Slides 13 – 21"],
    ["PART 3", "Epidural Space", "Slides 22 – 28"],
    ["PART 4", "Clinical Correlations & Summary", "Slides 29 – 30"],
  ];
  sections.forEach(([part, title, pages], i) => {
    const y = 1.15 + i * 1.0;
    s.addShape("rect", { x: 0.4, y, w: 9.2, h: 0.82, fill: { color: C.midBg }, line: { color: C.teal, width: 0.75 } });
    s.addText(part, { x: 0.55, y: y + 0.08, w: 1.1, h: 0.3, fontSize: 10, bold: true, color: C.amber, fontFace: "Calibri", margin: 0 });
    s.addText(title, { x: 1.7, y: y + 0.08, w: 5.5, h: 0.3, fontSize: 16, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    s.addText(pages, { x: 7.4, y: y + 0.08, w: 2.0, h: 0.3, fontSize: 11, color: C.teal, fontFace: "Calibri", align: "right", margin: 0 });
    s.addShape("line", { x: 0.55, y: y + 0.42, w: 9.0, h: 0, line: { color: C.teal, width: 0.5, dash: "dash" } });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 3 – BRACHIAL PLEXUS SECTION BANNER
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  sectionBanner(s, "BRACHIAL PLEXUS", "Formation, Anatomy & Anaesthetic Relevance");
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 4 – OVERVIEW OF BRACHIAL PLEXUS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Brachial Plexus: Overview");
  addDivider(s);
  addBullets(s, [
    "Formed from anterior primary rami of C5, C6, C7, C8, T1 nerve roots",
    "Organisation: 5 Roots → 3 Trunks → 6 Divisions → 3 Cords → 5 Terminal Nerves",
    "Enclosed within fibrous fascial sheaths (interscalene fascial sheath proximally; axillary sheath distally)",
    "Clinically important landmark: emerges between anterior and middle scalene muscles",
    "Lies posterior to vertebral artery and above 2nd part of subclavian artery",
    "Provides complete motor and sensory innervation to the upper limb",
  ], { y: 1.1, size: 15, h: 3.5 });
  if (imageData.bpMRI) {
    s.addImage({ data: imageData.bpMRI, x: 6.8, y: 1.1, w: 3.0, h: 4.1 });
    s.addText("MRI anatomy — Brachial Plexus roots, trunks, cords", {
      x: 6.8, y: 5.15, w: 3.0, h: 0.3, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 5 – ROOTS AND TRUNKS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Roots & Trunks of the Brachial Plexus");
  addDivider(s);
  addCard(s, 0.3, 1.05, 4.5, 4.2, "ROOTS (5 roots: C5–T1)", [
    "C5–T1 emerge from intervertebral foramina",
    "Travel in grooves between anterior & posterior tubercles of transverse processes",
    "Emerge between scalene muscles above subclavian artery",
    "Pre-fixed plexus: C4–C8; Post-fixed: C6–T2",
    "Phrenic nerve (C3,4,5): anterior to scalenus anterior muscle",
  ], C.teal);
  addCard(s, 5.0, 1.05, 4.5, 4.2, "TRUNKS (3 trunks)", [
    "UPPER (Superior): C5 + C6 unite",
    "MIDDLE: C7 alone continues",
    "LOWER (Inferior): C8 + T1 converge",
    "Cross base of posterior triangle of neck",
    "Upper & middle trunks pass above subclavian artery",
    "Lower trunk: behind or below the artery",
    "Branch from upper trunk: Suprascapular nerve, nerve to subclavius",
  ], C.amber);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 6 – DIVISIONS AND CORDS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Divisions & Cords of the Brachial Plexus");
  addDivider(s);
  addSubtitle(s, "Divisions: at lateral border of 1st rib, each trunk divides into Anterior and Posterior");
  addCard(s, 0.3, 1.55, 9.4, 1.4, "THREE CORDS — formed ~level of pectoralis minor muscle", [
    "LATERAL cord: Anterior divisions of Upper + Middle trunks (C5–C7)  |  MEDIAL cord: Anterior division of Lower trunk (C8, T1)  |  POSTERIOR cord: Posterior divisions of all 3 trunks (C5–T1)",
  ], C.teal);
  s.addText("Cord positions relative to axillary artery (2nd part):", { x: 0.3, y: 3.05, w: 9.4, h: 0.3, fontSize: 12, bold: true, color: C.amber, fontFace: "Calibri" });
  const positions = [["LATERAL cord", "Superior / Lateral to artery", C.teal], ["POSTERIOR cord", "Posterior to artery", C.light], ["MEDIAL cord", "Inferior / Medial to artery", C.amber]];
  positions.forEach(([name, pos, col], i) => {
    const x = 0.3 + i * 3.2;
    s.addShape("rect", { x, y: 3.4, w: 3.0, h: 1.8, fill: { color: C.midBg }, line: { color: col, width: 1.5 } });
    s.addText(name, { x: x + 0.1, y: 3.45, w: 2.8, h: 0.35, fontSize: 12, bold: true, color: col, fontFace: "Calibri", align: "center", margin: 0 });
    s.addText(pos, { x: x + 0.1, y: 3.85, w: 2.8, h: 0.9, fontSize: 12, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 7 – TERMINAL BRANCHES
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Terminal Branches of the Brachial Plexus");
  addDivider(s);
  if (imageData.bpDiagram) {
    s.addImage({ data: imageData.bpDiagram, x: 5.8, y: 0.95, w: 3.9, h: 4.4 });
  }
  const branches = [
    ["Musculocutaneous N.", "C5, C6, C7", "Lateral cord", "Biceps, brachialis, coracobrachialis"],
    ["Median N.", "C5–T1", "Lateral + Medial cords", "Forearm flexors, thenar muscles"],
    ["Ulnar N.", "C8, T1", "Medial cord", "Intrinsics, hypothenar, flexor carpi ulnaris"],
    ["Radial N.", "C5–T1", "Posterior cord", "Extensors of arm and forearm"],
    ["Axillary N.", "C5, C6", "Posterior cord", "Deltoid, teres minor"],
  ];
  s.addText(["Nerve", "Root", "From", "Motor function"].join("     "), {
    x: 0.3, y: 1.1, w: 5.3, h: 0.3, fontSize: 10, bold: true, color: C.amber, fontFace: "Calibri", margin: 0
  });
  branches.forEach(([nerve, root, cord, motor], i) => {
    const y = 1.45 + i * 0.75;
    const bg = i % 2 === 0 ? C.midBg : C.navy;
    s.addShape("rect", { x: 0.3, y, w: 5.3, h: 0.68, fill: { color: bg } });
    s.addText([
      { text: nerve, options: { bold: true, color: C.teal, breakLine: true, fontSize: 11 } },
      { text: `Root: ${root} | From: ${cord}`, options: { color: C.light, fontSize: 9 } },
    ], { x: 0.35, y: y + 0.04, w: 5.2, h: 0.6, fontFace: "Calibri", margin: 0 });
  });
  s.addText("Schematic diagram of the brachial plexus\n(from Harrison's, showing roots → terminal nerves)", {
    x: 5.8, y: 5.25, w: 3.9, h: 0.35, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 8 – BRACHIAL PLEXUS DIAGRAM WITH CADAVER
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Brachial Plexus: Cadaveric & Schematic Anatomy");
  addDivider(s);
  if (imageData.bpCadaver) {
    s.addImage({ data: imageData.bpCadaver, x: 0.3, y: 1.05, w: 9.4, h: 4.3 });
  }
  s.addText("Cadaveric dissection & schematic: C5–T1 roots → trunks → divisions → cords → terminal branches. AS = Anterior scalene, MS = Middle scalene, SCA = Subclavian artery, IJV = Internal jugular vein", {
    x: 0.3, y: 5.3, w: 9.4, h: 0.25, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 9 – FASCIAL SHEATHS & ANAESTHETIC SPACES
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Fascial Sheaths — Key Concept for Nerve Blocks");
  addDivider(s);
  addBullets(s, [
    "Brachial plexus is ensheathed in a continuous fascial tunnel (prevertebral fascia derivative)",
    "INTERSCALENE SHEATH: surrounds roots/trunks between scalene muscles — target for interscalene block",
    "AXILLARY SHEATH: envelops cords and terminal nerves in the axilla — target for axillary block",
    "Volume of LA injected spreads within this sheath → determines extent of block",
    "Gaps in the sheath mean musculocutaneous nerve (exits sheath early) may need separate injection",
    "Relationship to phrenic nerve: lies anterior to anterior scalene; interscalene blocks cause ~100% ipsilateral phrenic palsy",
    "C8/T1 roots (lower trunk) may escape interscalene injection — inadequate ulnar coverage",
  ], { size: 14, y: 1.1, h: 4.0 });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 10 – BRACHIAL PLEXUS BLOCK APPROACHES
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Approaches to Brachial Plexus Block");
  addDivider(s);
  const blocks = [
    ["INTERSCALENE", "C5–C7 (upper trunk)", "Shoulder & upper arm surgery; inadequate for hand", "Phrenic palsy, vertebral artery, epidural/intrathecal"],
    ["SUPRACLAVICULAR", "C5–T1", "'Spinal of arm'; upper extremity distal to shoulder", "Pneumothorax, phrenic palsy"],
    ["INFRACLAVICULAR", "C5–T1 (cords)", "Elbow, forearm, hand", "Less risk of pneumothorax"],
    ["AXILLARY", "Terminal branches", "Elbow to hand, forearm surgery", "Musculocutaneous needs separate injection"],
  ];
  const headers = ["Approach", "Root coverage", "Indications", "Key complications"];
  headers.forEach((h, i) => {
    const widths = [2.0, 1.8, 3.0, 2.8];
    const xs = [0.3, 2.35, 4.2, 7.25];
    s.addText(h, { x: xs[i], y: 1.05, w: widths[i], h: 0.3, fontSize: 10, bold: true, color: C.amber, fontFace: "Calibri", margin: 0 });
  });
  blocks.forEach(([name, roots, ind, comp], i) => {
    const y = 1.4 + i * 0.95;
    const bg = i % 2 === 0 ? C.midBg : C.navy;
    s.addShape("rect", { x: 0.3, y, w: 9.4, h: 0.88, fill: { color: bg } });
    s.addText(name, { x: 0.35, y: y + 0.05, w: 1.9, h: 0.75, fontSize: 12, bold: true, color: C.teal, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(roots, { x: 2.35, y: y + 0.05, w: 1.75, h: 0.75, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(ind, { x: 4.2, y: y + 0.05, w: 2.95, h: 0.75, fontSize: 11, color: C.light, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(comp, { x: 7.25, y: y + 0.05, w: 2.4, h: 0.75, fontSize: 11, color: C.red, fontFace: "Calibri", valign: "middle", margin: 0 });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 11 – ULTRASOUND OF BRACHIAL PLEXUS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Ultrasound Anatomy of the Brachial Plexus");
  addDivider(s);
  if (imageData.bpUltrasound) {
    s.addImage({ data: imageData.bpUltrasound, x: 0.2, y: 1.05, w: 5.7, h: 4.3 });
  }
  s.addText("US-guided blocks: Interscalene & Serratus Plane", { x: 0.2, y: 5.3, w: 5.7, h: 0.25, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true });
  addCard(s, 6.2, 1.05, 3.6, 2.0, "INTERSCALENE SONOANATOMY", [
    "Hypoechoic oval structures (roots) between ASM and MSM",
    "Probe: transverse on lateral neck at C6 level",
    "In-plane needle: lateral-to-medial trajectory",
    "C5, C6, C7 roots visualised as 'traffic light' sign",
  ], C.teal);
  addCard(s, 6.2, 3.2, 3.6, 2.1, "SUPRACLAVICULAR SONOANATOMY", [
    "Trunks: honeycomb cluster lateral to subclavian artery",
    "Probe: coronal oblique above clavicle",
    "Target: 'corner pocket' (junction of 1st rib & SCA)",
    "Pleura lies deep — monitor for pneumothorax",
  ], C.amber);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 12 – INFRACLAVICULAR BLOCK ULTRASOUND
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Infraclavicular Block — Cords & Ultrasound");
  addDivider(s);
  if (imageData.bpInfraclav) {
    s.addImage({ data: imageData.bpInfraclav, x: 0.2, y: 1.05, w: 5.5, h: 4.2 });
    s.addText("Infraclavicular block: axillary artery (AA), lateral (LC), medial (MC), posterior (PC) cords", {
      x: 0.2, y: 5.25, w: 5.5, h: 0.3, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addCard(s, 5.9, 1.05, 3.9, 4.2, "INFRACLAVICULAR ANATOMY", [
    "Target: 3 cords around 2nd part of axillary artery",
    "Lateral cord: superior/lateral to AA",
    "Medial cord: medial/inferior to AA",
    "Posterior cord: posterior to AA",
    "ADVANTAGES: catheter well-secured; no arm movement needed; less phrenic involvement",
    "Probe: sagittal below clavicle near coracoid",
    "Covers elbow, forearm, wrist, hand",
    "Avoid: pneumothorax if probe too medial",
  ], C.teal);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 13 – SUBARACHNOID SPACE SECTION BANNER
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  sectionBanner(s, "SUBARACHNOID SPACE", "Anatomy, CSF Physiology & Clinical Significance");
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 14 – SPINAL MENINGES OVERVIEW
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Spinal Meninges: The Three Layers");
  addDivider(s);
  if (imageData.meningesFig) {
    s.addImage({ data: imageData.meningesFig, x: 6.8, y: 1.0, w: 2.9, h: 4.4 });
    s.addText("Spinal meninges: DM=dura, AM=arachnoid, SS=subarachnoid space, PM=pia\n(Barash's Clinical Anesthesia)", {
      x: 6.8, y: 5.3, w: 2.9, h: 0.28, fontSize: 7.5, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addCard(s, 0.3, 1.05, 6.3, 1.35, "DURA MATER (outer)", [
    "Thickest layer: 270–280 μm; ~80 lamellar collagen layers",
    "Extends from foramen magnum → S2 (fuses with filum terminale)",
    "Potential subdural space: between dura and arachnoid",
  ], C.amber);
  addCard(s, 0.3, 2.5, 6.3, 1.35, "ARACHNOID MATER (middle)", [
    "True permeability barrier (NOT dura): tight junctions between cells",
    "Trabecular web-like portion extends to pia mater",
    "Arachnoid granulations: CSF exits CNS here via herniations through dura",
  ], C.teal);
  addCard(s, 0.3, 3.95, 6.3, 1.35, "PIA MATER (inner)", [
    "Innermost layer: flat overlapping cells coat the spinal cord",
    "Contains fenestrations (esp. lumbar cord & nerve roots)",
    "Spaces of Virchow–Robin: pial extensions into cord parenchyma",
  ], C.green);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 15 – SUBARACHNOID SPACE ANATOMY
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Subarachnoid Space (SAS): Anatomical Boundaries");
  addDivider(s);
  addBullets(s, [
    "Located BETWEEN the arachnoid mater (outer) and pia mater (inner)",
    "Extends from foramen magnum → S2 (dural sac terminus); laterally follows nerve roots to intervertebral foramina",
    "Contains cerebrospinal fluid (CSF), blood vessels, trabeculae, and nerve roots",
    "Widest at the lumbar cistern (L1/L2 to S2): contains the cauda equina — site of lumbar puncture",
    "Communicates cranially with the cranial subarachnoid space (basal cisterns)",
    "Spaces of Virchow–Robin: extensions of SAS along penetrating vessels into cord substance",
    "Clinical key: Lumbar puncture is performed below L1 in adults (below L3 in children) to avoid cord injury",
  ], { size: 14.5, y: 1.05, h: 4.2 });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 16 – SPINAL CORD ANATOMY
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Spinal Cord: Level, Segments & Conus");
  addDivider(s);
  if (imageData.spinalMRI) {
    s.addImage({ data: imageData.spinalMRI, x: 6.5, y: 1.0, w: 3.3, h: 4.4 });
    s.addText("T2 MRI sagittal & axial: SC, DM, ES, NR — cervical, thoracic, lumbar regions", {
      x: 6.5, y: 5.3, w: 3.3, h: 0.28, fontSize: 7.5, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addBullets(s, [
    "Fetus: spinal cord reaches sacrum",
    "Neonate: cord ends at L3",
    "Adults: conus medullaris at ~L1 (range: T12 – L3 in 10% adults)",
    "31 pairs of spinal nerves: anterior (motor) + posterior (sensory) roots",
    "Nerve roots named for foramina of exit — cervical: named for lower vertebra; below cervical: upper vertebra",
    "Cauda equina: lumbar and sacral roots below conus, surrounded only by pia mater — safety of LP here",
    "Lumbar cistern (thecal sac): L1/L2 → S2; ideal LP target: L3–L4 or L4–L5 interspace",
  ], { size: 14, y: 1.05, w: 6.2, h: 4.2 });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 17 – CSF: PHYSIOLOGY & PROPERTIES
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Cerebrospinal Fluid: Properties & Physiology");
  addDivider(s);
  addCard(s, 0.3, 1.05, 4.5, 4.3, "CSF PROPERTIES", [
    "Volume: 100–160 mL total (adult)",
    "Spinal volume: ~25–35 mL",
    "99% water; contains protein, glucose, electrolytes, neurotransmitters",
    "Normal pressure (lateral decubitus): 10–20 cmH₂O",
    "Density (baricity reference): 1.003–1.008 g/mL at 37°C",
    "pH: 7.33; Protein: 15–45 mg/dL",
    "Glucose: 2.5–4.5 mmol/L (60–70% plasma glucose)",
  ], C.teal);
  addCard(s, 5.0, 1.05, 4.5, 4.3, "CSF DYNAMICS (updated view)", [
    "NOT solely produced by choroid plexus — parenchymal capillaries of brain & cord also contribute",
    "NOT solely absorbed by arachnoid granulations — lymphatic system absorbs significant amount",
    "Flow: non-unidirectional; cardiac oscillations produce local mixing",
    "Slow diffusion of solutes; reabsorption across capillary membranes",
    "Relevance: determines spread of intrathecal drugs",
    "Baricity of LA vs. CSF determines hyperbaric/hypobaric/isobaric spread",
  ], C.amber);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 18 – SPINAL ANESTHESIA: DRUG SPREAD IN SAS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Drug Spread in the Subarachnoid Space");
  addDivider(s);
  addBullets(s, [
    "Nerves in the SAS are easily anesthetised — highly accessible; small doses sufficient",
    "LA diffuses through pia mater → Virchow–Robin spaces → spinal cord & dorsal root ganglia",
    "Differential block order (most sensitive → least): B fibres > C fibres > Aδ fibres > Aβ fibres > Aα fibres",
    "Differential block heights: sympathetic (cold) > pinprick > touch (each ~ 1–2 segments higher)",
    "Baricity governs rostral/caudal spread: hyperbaric → dependent position; hypobaric → non-dependent",
    "Factors: baricity, patient position, dose, volume, speed of injection, lumbosacral curvature",
  ], { size: 14.5, y: 1.05, h: 3.4 });
  s.addText("Nerve Fibre Sensitivity to Local Anaesthetics", { x: 0.3, y: 4.55, w: 9.4, h: 0.3, fontSize: 12, bold: true, color: C.amber, fontFace: "Calibri", margin: 0 });
  const fibres = [["B fibres", "1–3 μm", "Pre-ganglionic sympathetic", "MOST sensitive"], ["C fibres", "0.3–1 μm", "Cold / pain (unmyelinated)", "2nd"], ["Aδ fibres", "1–4 μm", "Pinprick / cold (myelinated)", "3rd"], ["Aβ fibres", "5–12 μm", "Touch / pressure", "4th"], ["Aα fibres", "12–20 μm", "Motor", "LEAST sensitive"]];
  fibres.forEach(([name, size, fn, sens], i) => {
    const x = 0.3 + i * 1.88;
    const col = i === 0 ? C.teal : i === 4 ? C.red : C.light;
    s.addShape("rect", { x, y: 4.9, w: 1.78, h: 0.65, fill: { color: C.midBg }, line: { color: col, width: 1 } });
    s.addText([{ text: name, options: { bold: true, color: col, breakLine: true, fontSize: 10 } }, { text: size, options: { color: C.light, breakLine: true, fontSize: 9 } }, { text: sens, options: { color: C.amber, fontSize: 9 } }], { x: x + 0.05, y: 4.9, w: 1.7, h: 0.65, fontFace: "Calibri", valign: "middle", align: "center", margin: 0 });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 19 – MRI ANATOMY OF SAS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "MRI Anatomy: Subarachnoid Space & Spinal Canal");
  addDivider(s);
  if (imageData.spinalMRI2) {
    s.addImage({ data: imageData.spinalMRI2, x: 0.3, y: 1.05, w: 5.8, h: 4.3 });
    s.addText("MRI axial T2 & sagittal T1: intramedullary (green), intradural/SAS (yellow), dorsal epidural (purple); PLL = posterior longitudinal lig., LF = ligamentum flavum", {
      x: 0.3, y: 5.3, w: 5.8, h: 0.28, fontSize: 7.5, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addCard(s, 6.3, 1.05, 3.5, 4.3, "KEY MRI LANDMARKS", [
    "T2 MRI: CSF appears bright (high signal) — excellent for demarcating SAS",
    "Spinal cord: intermediate signal intensity",
    "Epidural fat: bright on T1",
    "Ligamentum flavum: posterior boundary of epidural space",
    "Dura mater: dark linear boundary on T2",
    "Cauda equina roots: fine linear structures within SAS on lumbar MRI",
    "Conus level: visible on sagittal T2 — critical before LP",
  ], C.teal);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 20 – LUMBAR PUNCTURE ANATOMY
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Lumbar Puncture — Anatomical Pathway");
  addDivider(s);
  addSubtitle(s, "Structures traversed by spinal needle (midline approach, L3–L4 or L4–L5)", 1.02);
  const layers = [
    ["1", "Skin & subcutaneous tissue", C.light, "Variable depth"],
    ["2", "Supraspinous ligament", C.amber, "Connects spinous process tips"],
    ["3", "Interspinous ligament", C.amber, "Soft; between spinous processes"],
    ["4", "Ligamentum flavum", C.teal, "Dense elastic; 'give' felt on entry"],
    ["5", "Epidural space", C.green, "Contains fat, veins — 'first pop'"],
    ["6", "Dura mater", C.amber, "Thin fibrous layer — 'second pop'"],
    ["7", "Subdural space", C.light, "Potential space (usually not entered)"],
    ["8", "Arachnoid mater", C.teal, "True barrier; penetrated next"],
    ["9", "Subarachnoid space", C.teal, "CSF flows → confirm correct placement"],
  ];
  layers.forEach(([num, name, col, note], i) => {
    const x = i < 5 ? 0.3 : 5.15;
    const y = i < 5 ? 1.4 + i * 0.77 : 1.4 + (i - 5) * 0.77;
    s.addShape("rect", { x, y, w: 4.7, h: 0.7, fill: { color: C.midBg }, line: { color: col, width: 1.5 } });
    s.addText(num, { x: x + 0.05, y: y + 0.05, w: 0.3, h: 0.6, fontSize: 14, bold: true, color: col, fontFace: "Calibri", valign: "middle", align: "center", margin: 0 });
    s.addText([{ text: name, options: { bold: true, color: C.white, breakLine: true, fontSize: 12 } }, { text: note, options: { color: C.light, fontSize: 10 } }], { x: x + 0.4, y: y + 0.04, w: 4.2, h: 0.62, fontFace: "Calibri", valign: "middle", margin: 0 });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 21 – SPINAL ANAESTHESIA CLINICAL POINTS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Spinal (Subarachnoid) Anaesthesia — Clinical Keys");
  addDivider(s);
  addCard(s, 0.3, 1.05, 4.6, 2.05, "ADVANTAGES", [
    "Dense block with small drug dose",
    "Rapid onset; defined dermatomal level",
    "Avoids systemic LA toxicity",
    "CSF confirmation of correct placement",
    "Useful: LSCS, lower limb, urological surgery",
  ], C.green);
  addCard(s, 5.1, 1.05, 4.6, 2.05, "COMPLICATIONS", [
    "Hypotension (sympathetic block)",
    "PDPH (post-dural puncture headache)",
    "High / total spinal",
    "Urinary retention; backache",
    "Cauda equina syndrome (rare, neurotoxicity)",
  ], C.red);
  addCard(s, 0.3, 3.2, 9.4, 2.1, "DETERMINANTS OF BLOCK LEVEL", [
    "Baricity of LA: hyperbaric (bupivacaine + dextrose) → gravitational spread; hypobaric → ascends",
    "Patient position: sitting vs. lateral vs. supine after injection",
    "Drug dose & volume; speed of injection; lumbosacral anatomy; patient height/weight (limited role)",
    "Addition of opioids (fentanyl, morphine) extends duration; clonidine/dexmedetomidine as adjuvants",
  ], C.teal);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 22 – EPIDURAL SPACE SECTION BANNER
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  sectionBanner(s, "EPIDURAL SPACE", "Anatomy, Contents & Anaesthetic Implications");
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 23 – EPIDURAL SPACE BOUNDARIES
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Epidural Space: Boundaries & Extent");
  addDivider(s);
  if (imageData.epiduralFig) {
    s.addImage({ data: imageData.epiduralFig, x: 6.5, y: 1.0, w: 3.3, h: 4.4 });
    s.addText("Schematic: compartments of epidural space (grey) showing discontinuous fat pockets\n(Barash's Clinical Anesthesia / Hogan 1991)", {
      x: 6.5, y: 5.3, w: 3.3, h: 0.28, fontSize: 7.5, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addBullets(s, [
    "Location: within vertebral canal but OUTSIDE the dural sac",
    "Extent: Foramen magnum (superior) → S2 (inferior, end of dural sac)",
    "Anterior boundary: Posterior longitudinal ligament (PLL)",
    "Posterior boundary: Laminae + Ligamentum flavum",
    "Lateral boundaries: Pedicles — communicates with paravertebral space via intervertebral foramina",
    "The epidural space is NOT a continuous open space — dura intermittently abuts bony/ligamentous structures",
    "CERVICAL level: essentially no epidural fat",
    "LUMBAR level: fat in anterior & posterior aspects forms discrete metameric pockets",
  ], { size: 14.5, y: 1.05, w: 6.2, h: 4.3 });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 24 – CONTENTS OF EPIDURAL SPACE
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Contents of the Epidural Space");
  addDivider(s);
  const items = [
    ["EPIDURAL FAT", "Mostly posterior & lateral; absent in cervical; important pharmacokinetic reservoir for lipophilic drugs (e.g., fentanyl)", C.amber],
    ["EPIDURAL VEINS (Batson's plexus)", "Predominantly in ANTERIOR epidural space; valveless — connect to vertebral & pelvic veins; engorge in pregnancy → venous cannulation risk", C.red],
    ["SPINAL NERVE ROOTS", "Travel through epidural space in dural sleeves before exiting via foramina; covered only by thin dura here", C.teal],
    ["SPINAL ARTERIES", "Small radicular arteries run with nerve roots; artery of Adamkiewicz (T9–T12 left) — relevant to spinal cord ischaemia risk", C.green],
    ["LYMPHATICS", "Drain CSF and epidural space contents", C.light],
  ];
  items.forEach(([title, desc, col], i) => {
    const y = 1.1 + i * 0.87;
    s.addShape("rect", { x: 0.3, y, w: 9.4, h: 0.8, fill: { color: C.midBg }, line: { color: col, width: 1.5 } });
    s.addText(title, { x: 0.4, y: y + 0.06, w: 3.0, h: 0.65, fontSize: 11, bold: true, color: col, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addShape("line", { x: 3.5, y: y + 0.1, w: 0, h: 0.6, line: { color: col, width: 0.75 } });
    s.addText(desc, { x: 3.6, y: y + 0.06, w: 6.0, h: 0.68, fontSize: 12, color: C.light, fontFace: "Calibri", valign: "middle", margin: 0 });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 25 – LIGAMENTUM FLAVUM
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Ligamentum Flavum — The Gateway to Epidural Space");
  addDivider(s);
  if (imageData.ligFlavum) {
    s.addImage({ data: imageData.ligFlavum, x: 0.3, y: 1.05, w: 4.5, h: 4.2 });
    s.addText("3D reconstruction of lumbar ligamentum flavum showing posterior-lateral (A) and posterior (B) views; note midline gap (arrow)\n(Reina et al., Anesth Analg 2016)", {
      x: 0.3, y: 5.3, w: 4.5, h: 0.28, fontSize: 7.5, color: C.light, fontFace: "Calibri", align: "center", italic: true
    });
  }
  addCard(s, 5.1, 1.05, 4.6, 4.2, "LIGAMENTUM FLAVUM — ANATOMY", [
    "Paired ligaments: 2 halves, one from each side",
    "Midline gap (esp. at thoracic level) — important: loss of resistance may be felt unevenly",
    "Composed mainly of elastin fibres (80%) → gives 'yellow' colour and elasticity",
    "THICKNESS: Cervical 1.5–3 mm; Thoracic 3–5 mm; Lumbar 5–6 mm (thickest)",
    "Loss of resistance (LOR) technique relies on recognising LF resistance",
    "Combined with needle 'give' → confirms epidural entry",
    "Thickens with age and degeneration — denser LOR in elderly",
    "Cervical LF may be absent in midline (Lirk et al.)",
  ], C.teal);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 26 – MECHANISMS OF EPIDURAL ANESTHESIA
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Mechanisms of Epidural Drug Action");
  addDivider(s);
  addBullets(s, [
    "Primary targets: spinal nerve roots in epidural space (extradural) AND subarachnoid nerve roots",
    "Nerve roots in epidural space: covered by thin dura → relatively accessible to LA",
    "Spinal cord: direct diffusion through dura/arachnoid; Virchow-Robin spaces; vasculature",
    "Dorsal root ganglia: considered most important site; DRG lies in epidural space near foramina",
    "S1 and L5 posterior roots are LARGEST and most resistant to epidural block",
    "Differential block: same fibre sensitivity order as spinal — sympathetic blocked highest",
    "Regression order: motor function returns first, then touch, pinprick, cold sensation last",
  ], { size: 14.5, y: 1.05, h: 3.4 });
  s.addText("Drug spread within epidural space is NON-UNIFORM (Hogan's cadaveric cryomicrotome studies) — explains clinical unpredictability", {
    x: 0.3, y: 4.55, w: 9.4, h: 0.5, fontSize: 13, color: C.amber, fontFace: "Calibri", bold: true,
    fill: { color: C.midBg }, margin: [6, 6, 6, 10], shape: "rect"
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 27 – EPIDURAL APPROACH AND LOSS OF RESISTANCE
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Epidural Techniques — Approach & Loss of Resistance");
  addDivider(s);
  addCard(s, 0.3, 1.05, 4.5, 4.3, "MIDLINE vs. PARAMEDIAN", [
    "MIDLINE: supraspinous lig. → interspinous lig. → LF → epidural space",
    "PARAMEDIAN: bypasses supraspinous + interspinous ligaments → pierces LF",
    "Paramedian preferred: thoracic (steep spinous process angle), elderly, obese, limited flexion",
    "LOSS OF RESISTANCE (LOR): to saline (preferred) or air",
    "Hanging drop technique: negative epidural pressure draws drop into needle",
    "Depth: lumbar ~4–6 cm from skin; thoracic ~4–5 cm; cervical ~3–4 cm",
  ], C.teal);
  addCard(s, 5.0, 1.05, 4.7, 4.3, "NEEDLE CHARACTERISTICS", [
    "Tuohy needle (16–18G most common): curved Huber tip to guide catheter",
    "Sprotte / Whitacre: pencil-point (spinal) — NOT used for epidural",
    "Epidural catheter: advanced 3–5 cm beyond needle tip",
    "Epidural test dose: 3 mL 1.5% lidocaine + epinephrine 1:200,000 (15 mcg)",
    "HR increase >20 bpm → intravascular; high block → intrathecal",
    "Top-up doses titrated; continuous infusion technique possible",
    "Combined Spinal-Epidural (CSE): spinal for onset + epidural for duration",
  ], C.amber);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 28 – FACTORS AFFECTING EPIDURAL SPREAD
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Factors Affecting Epidural Drug Spread");
  addDivider(s);
  addSubtitle(s, "Unlike spinal, baricity does not govern spread — anatomy and volume are primary determinants");
  const factors = [
    ["Volume of Injectate", "Most important: larger volume → wider spread", C.teal],
    ["Age", "Elderly: reduced epidural fat & narrower foramina → easier spread; dose reduction needed", C.amber],
    ["Pregnancy", "Engorgement of epidural veins (increased intra-abdominal pressure) → reduced volume, faster spread", C.red],
    ["Obesity", "Increased intra-abdominal pressure → engorged veins → reduced epidural volume", C.red],
    ["Level of injection", "Lumbar: more predictable than thoracic or cervical", C.teal],
    ["Speed of injection", "Faster injection → slightly wider spread (controversial)", C.light],
    ["Drug concentration", "Affects quality/density of block more than spread", C.amber],
    ["Patient position", "Less impact than spinal; some evidence for sitting: dependent spread", C.light],
  ];
  factors.forEach(([factor, desc, col], i) => {
    const col2 = i < 4 ? 0.3 : 5.1;
    const y = i < 4 ? 1.45 + i * 0.95 : 1.45 + (i - 4) * 0.95;
    s.addShape("rect", { x: col2, y, w: 4.5, h: 0.88, fill: { color: C.midBg }, line: { color: col, width: 1 } });
    s.addText(factor, { x: col2 + 0.1, y: y + 0.05, w: 4.3, h: 0.3, fontSize: 11, bold: true, color: col, fontFace: "Calibri", margin: 0 });
    s.addText(desc, { x: col2 + 0.1, y: y + 0.36, w: 4.3, h: 0.46, fontSize: 11, color: C.light, fontFace: "Calibri", margin: 0 });
  });
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 29 – CLINICAL CORRELATIONS SUMMARY
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  addTitle(s, "Clinical Correlations — Putting It All Together");
  addDivider(s);
  addCard(s, 0.3, 1.05, 3.0, 4.3, "BRACHIAL PLEXUS", [
    "Interscalene: shoulder (C5–C7) — 100% phrenic palsy",
    "Supraclavicular: 'spinal of arm' — pneumothorax risk",
    "Infraclavicular: cords — safe; catheter friendly",
    "Axillary: terminal branches — forearm/hand; no pneumo",
    "US guidance: reduces complications; confirms spread",
    "LAST: local anesthetic systemic toxicity — treat with lipid emulsion",
  ], C.teal);
  addCard(s, 3.55, 1.05, 3.0, 4.3, "SUBARACHNOID SPACE", [
    "LP level: L3–L4 / L4–L5 in adults",
    "Hyperbaric bupivacaine: most common intrathecal LA",
    "CSF baricity (1.003–1.008) governs spread",
    "PDPH: due to CSF leak through dural hole — atraumatic needle reduces risk",
    "Cauda equina syndrome: neurotoxic LA in high concentration / microcatheters",
    "Total spinal: emergency — airway + vasopressors",
  ], C.amber);
  addCard(s, 6.8, 1.05, 2.9, 4.3, "EPIDURAL SPACE", [
    "Catheter placed 3–5 cm beyond needle tip",
    "Test dose: excludes intravascular/intrathecal",
    "Segmental block — most predictable at lumbar level",
    "Epidural veins engorged in pregnancy",
    "Epidural haematoma: stop anticoagulants per ASRA guidelines",
    "Epidural abscess: rare; back pain + fever + neuro deficit",
    "CSE: combines benefits of both techniques",
  ], C.green);
}

// ────────────────────────────────────────────────────────────────────────────
// SLIDE 30 – SUMMARY & KEY TAKEAWAYS
// ────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, C.darkBg);
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 0.5, fill: { color: C.teal } });
  s.addText("SUMMARY", { x: 0.4, y: 0.07, w: 9.2, h: 0.38, fontSize: 16, bold: true, color: C.navy, fontFace: "Calibri", charSpacing: 4 });
  const summItems = [
    ["BRACHIAL PLEXUS", "C5–T1 → Roots → Trunks (upper/middle/lower) → Divisions → Cords (lateral/posterior/medial) → 5 terminal nerves. Fascial sheath is the anatomical basis for nerve blocks. Block approach dictates coverage and complication profile.", C.teal],
    ["SUBARACHNOID SPACE", "Between arachnoid and pia mater; contains CSF + cauda equina. Lumbar cistern (L1–S2) is the LP target. Drug spread governed by baricity + position. Differential block follows fibre size sensitivity.", C.amber],
    ["EPIDURAL SPACE", "Outside dural sac; foramen magnum to S2. Not a continuous cavity — discontinuous fat pockets. Boundaries: PLL (anterior), LF (posterior). Contents: fat, Batson's veins, nerve roots. LOR technique identifies it. Volume and age drive spread.", C.green],
  ];
  summItems.forEach(([title, text, col], i) => {
    const y = 0.6 + i * 1.6;
    s.addShape("rect", { x: 0.3, y, w: 9.4, h: 1.5, fill: { color: C.midBg }, line: { color: col, width: 2 } });
    s.addShape("rect", { x: 0.3, y, w: 0.18, h: 1.5, fill: { color: col } });
    s.addText(title, { x: 0.6, y: y + 0.08, w: 8.8, h: 0.35, fontSize: 13, bold: true, color: col, fontFace: "Calibri", margin: 0 });
    s.addText(text, { x: 0.6, y: y + 0.46, w: 8.8, h: 0.96, fontSize: 12.5, color: C.white, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.15 });
  });
  s.addText("Source: Barash's Clinical Anesthesia 9e | Miller's Anesthesia 10e | Gray's Anatomy for Students | Harrison's Principles 22e", {
    x: 0.3, y: 5.35, w: 9.4, h: 0.26, fontSize: 8, color: C.light, fontFace: "Calibri", align: "center", italic: true
  });
}

// ─── WRITE FILE ──────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/anaesthesia-anatomy-ppt/Anaesthesia_PG_Anatomy_Brachial_Subarachnoid_Epidural.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("PPT saved to: " + outPath);
}).catch(e => {
  console.error("Error saving PPT:", e);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/anaesthesia-anatomy-ppt && node build_ppt.js 2>&1

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.

Retry

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.