Give me class ppt for 1bhms students topic Deep cervical fascia

Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Loading Image
Running Command

mkdir -p /home/daytona/workspace/deep-cervical-fascia-ppt && ls /home/daytona/wo…

Writing File

~/deep-cervical-fascia-ppt/build.js

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

// Fetch images as base64
const imageUrls = [
  "https://cdn.orris.care/cdss_images/1658b844e467872164dd0b460001610cf8cf024526c01d1289963a72d8bbba6c.png",
  "https://cdn.orris.care/cdss_images/3ebad59d7f34c1fdc66ef59228e40deb3fd753c3ae1ac8a417e8c0ad7d35469e.png",
  "https://cdn.orris.care/cdss_images/e94c9f99b5b4bb3d2980f79290b23131ca226b83a0111804014d4f0f6197085f.png"
];

const images = JSON.parse(
  execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`
  ).toString()
);

const img_fascia_layers = images[0].base64;   // Axial cross-section of neck fascial layers
const img_axial_parapharyngeal = images[1].base64; // Axial showing parapharyngeal space
const img_sagittal_spaces = images[2].base64; // Sagittal showing danger space

// ============================================================
// COLOR PALETTE  — deep blue-navy theme (medical/professional)
// ============================================================
const C = {
  navy:    "0D2B55",
  blue:    "1A5276",
  teal:    "0E6B8E",
  accent:  "F0C040",   // golden accent
  white:   "FFFFFF",
  light:   "E8F1F8",
  text:    "1A1A2E",
  subtext: "4A5568",
  slide_bg:"0D2B55",
  content_bg: "EEF4FA",
  red:     "C0392B",
  green:   "1A7A4A",
  orange:  "D35400",
};

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Deep Cervical Fascia";
pres.author = "Anatomy Department – 1st BHMS";

// ============================================================
// Helper: background rect (full slide)
// ============================================================
function bgRect(slide, color) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color },
    line: { type: "none" }
  });
}

function topBar(slide, color = C.teal) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.0,
    fill: { color },
    line: { type: "none" }
  });
}

function accentLine(slide, y = 1.0) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y, w: "100%", h: 0.06,
    fill: { color: C.accent },
    line: { type: "none" }
  });
}

function sectionLabel(slide, text, x, y, w = 3.5, color = C.navy) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h: 0.38,
    fill: { color },
    line: { type: "none" },
    rectRadius: 0.05
  });
  slide.addText(text, {
    x, y, w, h: 0.38,
    fontSize: 13, bold: true, color: C.accent,
    align: "center", valign: "middle", margin: 0
  });
}

// ============================================================
// SLIDE 1 — Title slide
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.navy);

  // Decorative accent blocks
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.5, w: "100%", h: 1.125, fill: { color: C.teal }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.5, w: "100%", h: 0.1, fill: { color: C.accent }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 7.5, y: 0, w: 0.12, h: "100%", fill: { color: C.accent }, line: { type: "none" } });

  slide.addText("DEEP CERVICAL FASCIA", {
    x: 0.5, y: 0.7, w: 6.8, h: 1.1,
    fontSize: 40, bold: true, color: C.white,
    align: "left", fontFace: "Calibri Light", charSpacing: 4
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.78, w: 4.5, h: 0.07, fill: { color: C.accent }, line: { type: "none" } });

  slide.addText("Anatomy of Cervical Fascial Layers, Spaces & Clinical Significance", {
    x: 0.5, y: 1.95, w: 6.8, h: 0.6,
    fontSize: 17, italic: true, color: "BDD9F0",
    align: "left", fontFace: "Calibri"
  });

  slide.addText([
    { text: "Subject: ", options: { bold: true, color: C.accent } },
    { text: "Anatomy  |  ", options: { color: C.white } },
    { text: "Year: ", options: { bold: true, color: C.accent } },
    { text: "1st BHMS  |  ", options: { color: C.white } },
    { text: "Topic: ", options: { bold: true, color: C.accent } },
    { text: "Head & Neck Anatomy", options: { color: C.white } }
  ], {
    x: 0.5, y: 2.65, w: 9, h: 0.4, fontSize: 14, valign: "middle"
  });

  slide.addText("Department of Anatomy", {
    x: 0, y: 4.6, w: "100%", h: 0.45,
    fontSize: 14, bold: true, color: C.white,
    align: "center", valign: "middle"
  });
  slide.addText("Source: Scott-Brown's Otorhinolaryngology | KJ Lee's Essential Otolaryngology", {
    x: 0, y: 5.1, w: "100%", h: 0.35,
    fontSize: 10, italic: true, color: "BDD9F0",
    align: "center", valign: "middle"
  });
}

// ============================================================
// SLIDE 2 — Learning Objectives
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.navy);
  accentLine(slide, 1.0);

  slide.addText("Learning Objectives", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  const objectives = [
    { num: "01", text: "Define deep cervical fascia and distinguish it from superficial cervical fascia" },
    { num: "02", text: "Describe the three layers of deep cervical fascia with their attachments" },
    { num: "03", text: "Explain the carotid sheath — contents and clinical importance" },
    { num: "04", text: "Describe the alar fascia and the 'danger space'" },
    { num: "05", text: "Identify the deep neck spaces formed by fascial boundaries" },
    { num: "06", text: "Understand the clinical relevance — infection spread, neck dissection" },
  ];

  objectives.forEach((obj, i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.25 + row * 1.2;

    slide.addShape(pres.ShapeType.rect, {
      x, y, w: 4.5, h: 1.0,
      fill: { color: col === 0 ? C.navy : C.teal },
      line: { type: "none" }, shadow: { type: "outer", blur: 4, offset: 2, angle: 45, color: "AAAAAA", opacity: 0.3 }
    });
    slide.addText(obj.num, {
      x: x + 0.1, y: y + 0.05, w: 0.55, h: 0.45,
      fontSize: 22, bold: true, color: C.accent, align: "center", valign: "middle", margin: 0
    });
    slide.addText(obj.text, {
      x: x + 0.7, y: y + 0.08, w: 3.6, h: 0.82,
      fontSize: 12.5, color: C.white, align: "left", valign: "middle"
    });
  });
}

// ============================================================
// SLIDE 3 — Overview: What is Deep Cervical Fascia?
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.blue);
  accentLine(slide, 1.0);

  slide.addText("What is Deep Cervical Fascia?", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  // Left text column
  const points = [
    { h: "Definition", t: "Dense connective tissue deep to the platysma and superficial cervical fascia, forming a fascial cylinder that contains most structures of the neck, including all nodal stations." },
    { h: "Layers (3)", t: "1. Investing (Superficial) Layer\n2. Pretracheal (Middle/Visceral) Layer\n3. Prevertebral (Deep) Layer\n+ Carotid Sheath (derived from investing layer)" },
    { h: "Origin", t: "Arises from the ligamentum nuchae and spinous processes of cervical vertebrae posteriorly; invests the entire neck." },
    { h: "Key Fact", t: "Fascial planes act as dissection tunnels in surgery and as corridors for spread of infection or neoplasia between neck spaces." },
  ];

  let yp = 1.15;
  points.forEach(p => {
    slide.addText(p.h, {
      x: 0.4, y: yp, w: 2.0, h: 0.35,
      fontSize: 13, bold: true, color: C.accent,
      fill: { color: C.navy }, align: "center", valign: "middle", margin: 4
    });
    slide.addText(p.t, {
      x: 0.4, y: yp + 0.35, w: 5.5, h: 0.72,
      fontSize: 12, color: C.text, align: "left", valign: "top"
    });
    yp += 1.15;
  });

  // Right image
  if (img_fascia_layers) {
    slide.addImage({ data: img_fascia_layers, x: 6.1, y: 1.1, w: 3.7, h: 4.2 });
    slide.addText("Fig: Axial cross-section showing fascial layers of the neck", {
      x: 6.1, y: 5.28, w: 3.7, h: 0.3,
      fontSize: 9, italic: true, color: C.subtext, align: "center"
    });
  }
}

// ============================================================
// SLIDE 4 — Layer 1: Investing (Superficial) Layer
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.navy);
  accentLine(slide);

  slide.addText("Layer 1: Investing (Superficial) Layer", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 24, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });
  sectionLabel(slide, "Also called: Superficial Layer of DCF", 0.3, 1.1, 5.5, C.teal);

  const rows = [
    ["Encloses (Muscles)", "SCM, Trapezius, Omohyoid, Infrahyoid muscles"],
    ["Encloses (Glands)", "Parotid gland (as parotid fascia) & Submandibular gland"],
    ["Superior Attachment", "Superior nuchal line, Mastoid process, Zygomatic arch, Inferior border of mandible, Hyoid bone"],
    ["Inferior Attachment", "Manubrium sterni, Clavicle, Acromion & Spine of scapula"],
    ["Posterior Attachment", "Spinous processes of cervical vertebrae, Ligamentum nuchae"],
    ["Forms", "Roof of anterior & posterior triangles | Parotid capsule | Stylomandibular ligament"],
    ["Splits to form", "Suprasternal space of Burns (anteroinferiorly)"],
    ["Key Clinical Point", "Encases ALL cervical lymph node stations; acts as barrier — abscesses track DEEP to this layer"],
  ];

  rows.forEach(([label, val], i) => {
    const y = 1.6 + i * 0.5;
    const bgColor = i % 2 === 0 ? "DDEAF7" : C.white;
    slide.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.4, h: 0.48, fill: { color: bgColor }, line: { color: "B0C8E0", w: 0.5 } });
    slide.addText(label, { x: 0.35, y: y + 0.02, w: 2.6, h: 0.44, fontSize: 11.5, bold: true, color: C.navy, valign: "middle" });
    slide.addText(val, { x: 3.0, y: y + 0.02, w: 6.6, h: 0.44, fontSize: 11.5, color: C.text, valign: "middle" });
  });
}

// ============================================================
// SLIDE 5 — Layer 2: Pretracheal (Middle/Visceral) Layer
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.teal);
  accentLine(slide);

  slide.addText("Layer 2: Pretracheal (Middle / Visceral) Layer", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 24, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });
  sectionLabel(slide, "Derived from the investing layer", 0.3, 1.1, 4.5, C.blue);

  // Two-column cards
  const leftCards = [
    { title: "Muscular Division", body: "Invests the strap (infrahyoid) muscles:\n• Sternohyoid\n• Sternothyroid\n• Thyrohyoid\n• Omohyoid" },
    { title: "Superior Attachment", body: "Hyoid bone (and base of skull for visceral part)" },
    { title: "Inferior Extension", body: "Descends into the superior mediastinum; blends with the fibrous pericardium" },
  ];
  const rightCards = [
    { title: "Visceral Division", body: "Invests viscera:\n• Pharynx / Larynx\n• Trachea & Oesophagus\n• Thyroid & Parathyroid glands\n• Buccinator & Pharyngeal constrictors" },
    { title: "Special Component", body: "Buccopharyngeal fascia — overlies pharyngeal wall; forms anterior border of retropharyngeal space" },
    { title: "Clinical Relevance", body: "Bounds a deep space extending neck → mediastinum; connects laterally to carotid sheath via loose areolar tissue" },
  ];

  leftCards.forEach((card, i) => {
    const y = 1.6 + i * 1.3;
    slide.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 4.5, h: 1.2, fill: { color: C.navy }, line: { type: "none" } });
    slide.addText(card.title, { x: 0.4, y: y + 0.05, w: 4.2, h: 0.3, fontSize: 12.5, bold: true, color: C.accent });
    slide.addText(card.body, { x: 0.4, y: y + 0.35, w: 4.2, h: 0.8, fontSize: 11.5, color: C.white, valign: "top" });
  });
  rightCards.forEach((card, i) => {
    const y = 1.6 + i * 1.3;
    slide.addShape(pres.ShapeType.rect, { x: 5.1, y, w: 4.7, h: 1.2, fill: { color: C.blue }, line: { type: "none" } });
    slide.addText(card.title, { x: 5.2, y: y + 0.05, w: 4.4, h: 0.3, fontSize: 12.5, bold: true, color: C.accent });
    slide.addText(card.body, { x: 5.2, y: y + 0.35, w: 4.4, h: 0.8, fontSize: 11.5, color: C.white, valign: "top" });
  });
}

// ============================================================
// SLIDE 6 — Layer 3: Prevertebral (Deep) Layer + Alar Fascia
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.navy);
  accentLine(slide);

  slide.addText("Layer 3: Prevertebral (Deep) Layer & Alar Fascia", {
    x: 0.3, y: 0.1, w: 9.2, h: 0.8,
    fontSize: 23, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  // Left column - prevertebral layer
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.1, w: 4.5, h: 2.05, fill: { color: C.navy }, line: { type: "none" } });
  slide.addText("Prevertebral Fascia", { x: 0.4, y: 1.15, w: 4.2, h: 0.35, fontSize: 14, bold: true, color: C.accent });
  slide.addText([
    { text: "Encloses: ", options: { bold: true, color: C.accent } },
    { text: "Paraspinous muscles, scalene muscles, cervical vertebrae\n", options: { color: C.white } },
    { text: "Superior: ", options: { bold: true, color: C.accent } },
    { text: "Base of skull\n", options: { color: C.white } },
    { text: "Inferior: ", options: { bold: true, color: C.accent } },
    { text: "Fuses with anterior longitudinal ligament at T3\n", options: { color: C.white } },
    { text: "Lateral: ", options: { bold: true, color: C.accent } },
    { text: "Extends as the axillary sheath\n", options: { color: C.white } },
    { text: "Function: ", options: { bold: true, color: C.accent } },
    { text: "Floor of posterior triangle; deep margin of neck dissection (protects phrenic nerve & brachial plexus)", options: { color: C.white } },
  ], { x: 0.4, y: 1.52, w: 4.2, h: 1.55, fontSize: 11, valign: "top" });

  // Right column - alar fascia
  slide.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.1, w: 4.7, h: 2.05, fill: { color: C.teal }, line: { type: "none" } });
  slide.addText("Alar Fascia", { x: 5.2, y: 1.15, w: 4.4, h: 0.35, fontSize: 14, bold: true, color: C.accent });
  slide.addText([
    { text: "Position: ", options: { bold: true, color: C.accent } },
    { text: "Between deep and middle layers of DCF\n", options: { color: C.white } },
    { text: "Superior: ", options: { bold: true, color: C.accent } },
    { text: "Base of skull\n", options: { color: C.white } },
    { text: "Inferior: ", options: { bold: true, color: C.accent } },
    { text: "Posterior mediastinum (~T2 vertebra)\n", options: { color: C.white } },
    { text: "Covers: ", options: { bold: true, color: C.accent } },
    { text: "Cervical sympathetic trunk\n", options: { color: C.white } },
    { text: "Significance: ", options: { bold: true, color: C.accent } },
    { text: "Forms posterior wall of retropharyngeal space & anterior wall of 'danger space'", options: { color: C.white } },
  ], { x: 5.2, y: 1.52, w: 4.4, h: 1.55, fontSize: 11, valign: "top" });

  // Danger space box
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.28, w: 9.5, h: 1.0, fill: { color: C.red }, line: { type: "none" } });
  slide.addText("⚠  DANGER SPACE", { x: 0.4, y: 3.3, w: 3, h: 0.4, fontSize: 14, bold: true, color: C.white });
  slide.addText("Potential space between alar fascia (anteriorly) and prevertebral fascia (posteriorly). Extends from the skull base to the DIAPHRAGM — infection here can descend into the chest rapidly. Clinically life-threatening!", {
    x: 0.4, y: 3.7, w: 9.2, h: 0.5, fontSize: 11.5, color: C.white, valign: "top"
  });

  // Sagittal image
  if (img_sagittal_spaces) {
    slide.addImage({ data: img_sagittal_spaces, x: 0.3, y: 4.38, w: 2.8, h: 1.1 });
    slide.addText("Fig: Sagittal view — Danger space & alar fascia", {
      x: 3.2, y: 4.5, w: 6.5, h: 0.4, fontSize: 10, italic: true, color: C.subtext
    });
  }
}

// ============================================================
// SLIDE 7 — Carotid Sheath
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.blue);
  accentLine(slide);

  slide.addText("Carotid Sheath", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  // Left info
  const carotidFacts = [
    { k: "Derivation", v: "From the investing layer of deep cervical fascia (medial to SCM)" },
    { k: "Contents", v: "Common Carotid Artery (CCA)\nInternal & External Carotid Arteries (post-bifurcation)\nInternal Jugular Vein (IJV)\nVagus Nerve (CN X)" },
    { k: "Wall thickness", v: "Thicker around arteries; loose/thin around IJV (allows expansion in high venous flow states)" },
    { k: "Connections", v: "Connected to all three layers of DCF by loose areolar tissue" },
    { k: "Other structures", v: "Contains: Glossopharyngeal nerve, Hypoglossal nerve, Sympathetic chain, Associated lymph nodes (post-styloid compartment)" },
    { k: "Clinical pearl", v: "Carotid sheath involvement in deep neck infection = vascular complications (carotid artery erosion, IJV thrombophlebitis — Lemierre's syndrome)" },
  ];

  carotidFacts.forEach(({ k, v }, i) => {
    const y = 1.18 + i * 0.73;
    slide.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 5.6, h: 0.68, fill: { color: i % 2 === 0 ? "DDEAF7" : C.white }, line: { color: "B0C8E0", w: 0.5 } });
    slide.addText(k, { x: 0.35, y: y + 0.04, w: 1.8, h: 0.6, fontSize: 11, bold: true, color: C.navy, valign: "middle" });
    slide.addText(v, { x: 2.2, y: y + 0.04, w: 3.6, h: 0.6, fontSize: 11, color: C.text, valign: "middle" });
  });

  // Right image
  if (img_axial_parapharyngeal) {
    slide.addImage({ data: img_axial_parapharyngeal, x: 6.2, y: 1.1, w: 3.6, h: 3.8 });
    slide.addText("Fig: Axial section — carotid sheath, parapharyngeal space & great vessels", {
      x: 6.2, y: 4.92, w: 3.6, h: 0.4, fontSize: 9, italic: true, color: C.subtext, align: "center"
    });
  }
}

// ============================================================
// SLIDE 8 — Deep Neck Spaces
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.navy);
  accentLine(slide);

  slide.addText("Deep Neck Spaces", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  const spaces = [
    {
      name: "Submental Space",
      color: C.navy,
      body: "Borders: Submental triangle boundaries\nDeep limit: Mylohyoid & Geniohyoid\nContains: Level Ia lymph nodes"
    },
    {
      name: "Submandibular Space",
      color: C.teal,
      body: "Clinical: Route for spread between neck & floor of mouth (Ludwig's angina)\nBorders: Investing DCF from mandible to hyoid\nBellies of Digastric form anterior/posterior limits"
    },
    {
      name: "Parapharyngeal Space",
      color: C.blue,
      body: "Shape: Inverted cone (base = petrous temporal; apex = hyoid)\nDivided by styloid process → Pre-styloid & Post-styloid compartments\nPost-styloid = carotid sheath, CN IX, CN XII, sympathetic chain"
    },
    {
      name: "Retropharyngeal Space",
      color: "5B2C6F",
      body: "Between: Middle DCF (ant.) and Alar fascia (post.)\nCraniocaudal extent: Skull base → Tracheal bifurcation\nContains: Retropharyngeal lymph nodes (important in children)"
    },
    {
      name: "Danger Space",
      color: C.red,
      body: "Between: Alar fascia (ant.) and Prevertebral fascia (post.)\nExtent: Skull base → DIAPHRAGM\nClinical: Rapid spread of infection into posterior mediastinum"
    },
    {
      name: "Prevertebral Space",
      color: "1A5276",
      body: "Anterior to prevertebral fascia / vertebral bodies\nExtent: Skull base → Coccyx\nClinical: Pott's abscess (TB spine) can track along this space"
    },
  ];

  spaces.forEach((sp, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.12 + row * 1.52;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 4.55, h: 1.42, fill: { color: sp.color }, line: { type: "none" } });
    slide.addText(sp.name, { x: x + 0.1, y: y + 0.06, w: 4.2, h: 0.32, fontSize: 13, bold: true, color: C.accent });
    slide.addText(sp.body, { x: x + 0.1, y: y + 0.4, w: 4.3, h: 0.95, fontSize: 10.5, color: C.white, valign: "top" });
  });
}

// ============================================================
// SLIDE 9 — Clinical Significance
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.teal);
  accentLine(slide);

  slide.addText("Clinical Significance", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  const clinics = [
    {
      title: "Deep Neck Space Infections",
      icon: "🦠",
      color: "C0392B",
      body: "Fascial compartments guide spread of odontogenic, tonsillar, or salivary infections. Ludwig's angina (submandibular space) can cause airway compromise. Retropharyngeal abscess is most common in children < 6 years."
    },
    {
      title: "Mediastinitis via Danger Space",
      icon: "⚠️",
      color: "E67E22",
      body: "Infections tracking through the danger space can reach the posterior mediastinum and diaphragm — a life-threatening surgical emergency requiring mediastinal drainage."
    },
    {
      title: "Neck Dissection Surgery",
      icon: "🔪",
      color: "1A5276",
      body: "Prevertebral fascia = deep limit of radical neck dissection. Fascial planes act as dissection tunnels. Investing fascia encases all nodal stations (levels I–V) targeted in dissection."
    },
    {
      title: "Carotid Sheath Pathology",
      icon: "💉",
      color: "6C3483",
      body: "Lemierre's syndrome: IJV thrombophlebitis with septic emboli. Carotid blow-out: erosion of carotid artery by infection or tumour. Horner's syndrome: sympathetic chain involvement."
    },
    {
      title: "Airway Compromise",
      icon: "🫁",
      color: "1A7A4A",
      body: "Investing fascia barrier may cause accumulating abscess to compress the airway even before pointing externally. Always assess airway in deep neck infections."
    },
    {
      title: "Pott's Disease (TB Spine)",
      icon: "🦴",
      color: "784212",
      body: "Cold abscess from vertebral TB can descend along the prevertebral space (skull base to coccyx) and present as a fluctuant swelling in the neck or groin."
    },
  ];

  clinics.forEach((c, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.15 + row * 1.48;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 4.55, h: 1.38, fill: { color: c.color }, line: { type: "none" } });
    slide.addText(`${c.icon}  ${c.title}`, { x: x + 0.1, y: y + 0.06, w: 4.3, h: 0.32, fontSize: 13, bold: true, color: C.accent });
    slide.addText(c.body, { x: x + 0.1, y: y + 0.4, w: 4.3, h: 0.9, fontSize: 10.5, color: C.white, valign: "top" });
  });
}

// ============================================================
// SLIDE 10 — Comparison Table: All Layers
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.content_bg);
  topBar(slide, C.navy);
  accentLine(slide);

  slide.addText("Summary Comparison: Layers of Deep Cervical Fascia", {
    x: 0.3, y: 0.1, w: 9.2, h: 0.8,
    fontSize: 22, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  const headers = ["Layer", "Also Known As", "Encloses", "Superior", "Inferior", "Significance"];
  const rows2 = [
    ["Investing (Superficial)", "Superficial DCF", "SCM, Trapezius, Omohyoid, Parotid, Submandibular", "Nuchal line, Mastoid, Zygoma, Mandible, Hyoid", "Manubrium, Clavicle, Acromion", "Encloses all nodes; barrier to spread"],
    ["Pretracheal (Middle)", "Visceral / Muscular fascia", "Strap muscles, Thyroid, Trachea, Pharynx, Oesophagus", "Hyoid / Skull base", "Superior mediastinum / Fibrous pericardium", "Bounds pretracheal & retropharyngeal spaces"],
    ["Prevertebral (Deep)", "Prevertebral fascia", "Paraspinous & scalene muscles, Vertebral column", "Skull base", "T3 / Anterior longitudinal ligament", "Floor of posterior triangle; limit of neck dissection"],
    ["Alar Fascia", "Component of deep layer", "Cervical sympathetic trunk", "Skull base", "T2 – Posterior mediastinum", "Posterior wall of retropharyngeal space"],
    ["Carotid Sheath", "Derived from investing layer", "CCA, ICA, ECA, IJV, CN X", "Skull base", "Superior mediastinum", "Vascular corridor; Lemierre's, carotid blow-out"],
  ];

  const colW = [1.9, 1.7, 2.2, 1.6, 1.6, 1.8];
  const colX = [0.15, 2.05, 3.75, 5.95, 7.55, 9.15];  // cumulative

  // Draw header
  let xpos = 0.15;
  headers.forEach((h, i) => {
    slide.addShape(pres.ShapeType.rect, { x: xpos, y: 1.1, w: colW[i], h: 0.42, fill: { color: C.navy }, line: { color: "8BAAC8", w: 0.5 } });
    slide.addText(h, { x: xpos, y: 1.1, w: colW[i], h: 0.42, fontSize: 11, bold: true, color: C.accent, align: "center", valign: "middle", margin: 2 });
    xpos += colW[i];
  });

  rows2.forEach((row, ri) => {
    let xr = 0.15;
    row.forEach((cell, ci) => {
      const bg = ri % 2 === 0 ? "DDEAF7" : C.white;
      slide.addShape(pres.ShapeType.rect, { x: xr, y: 1.52 + ri * 0.8, w: colW[ci], h: 0.76, fill: { color: bg }, line: { color: "B0C8E0", w: 0.5 } });
      slide.addText(cell, { x: xr + 0.03, y: 1.54 + ri * 0.8, w: colW[ci] - 0.06, h: 0.72, fontSize: 9.5, color: C.text, valign: "middle", align: ci === 0 ? "center" : "left" });
      xr += colW[ci];
    });
  });
}

// ============================================================
// SLIDE 11 — Mnemonics & Quick Recall
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.navy);
  topBar(slide, C.teal);
  accentLine(slide);

  slide.addText("Mnemonics & Quick Recall", {
    x: 0.3, y: 0.1, w: 9, h: 0.8,
    fontSize: 26, bold: true, color: C.white, align: "left", valign: "middle", margin: 0
  });

  // Mnemonic 1 box
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.15, w: 9.4, h: 1.1, fill: { color: C.teal }, line: { type: "none" } });
  slide.addText("Layers of DCF — \"I Prefer Depth\"", { x: 0.5, y: 1.18, w: 9, h: 0.38, fontSize: 16, bold: true, color: C.accent });
  slide.addText("I = Investing (Superficial) Layer    |    P = Pretracheal (Middle) Layer    |    D = Prevertebral (Deep) Layer", {
    x: 0.5, y: 1.56, w: 9, h: 0.62, fontSize: 13, color: C.white, align: "center", valign: "middle"
  });

  // Carotid sheath contents
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 2.4, w: 4.5, h: 1.6, fill: { color: "1A3C5E" }, line: { type: "none" } });
  slide.addText("Carotid Sheath Contents", { x: 0.4, y: 2.45, w: 4.2, h: 0.35, fontSize: 14, bold: true, color: C.accent });
  slide.addText('"VAN" — inside → outside\n• V = Vagus nerve (medially)\n• A = Artery (Common/Internal Carotid)\n• N = (Internal Jugular) veiN (laterally)', {
    x: 0.4, y: 2.8, w: 4.2, h: 1.1, fontSize: 12.5, color: C.white, valign: "top"
  });

  // Spaces box
  slide.addShape(pres.ShapeType.rect, { x: 5.1, y: 2.4, w: 4.7, h: 1.6, fill: { color: "1A3C5E" }, line: { type: "none" } });
  slide.addText("Deep Neck Spaces — \"SAD RDP\"", { x: 5.2, y: 2.45, w: 4.4, h: 0.35, fontSize: 14, bold: true, color: C.accent });
  slide.addText("S = Submental\nA = Submandibular (sAliva!)\nD = Danger space\nR = Retropharyngeal\nD = Parapharyngeal (pharynx)\nP = Prevertebral", {
    x: 5.2, y: 2.8, w: 4.4, h: 1.1, fontSize: 12, color: C.white, valign: "top"
  });

  // Key exam points
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.1, w: 9.4, h: 1.4, fill: { color: "0B3D2E" }, line: { color: C.accent, w: 1.2 } });
  slide.addText("★  High-Yield Exam Points", { x: 0.5, y: 4.14, w: 9, h: 0.35, fontSize: 14, bold: true, color: C.accent });
  slide.addText([
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Danger space extends skull base → DIAPHRAGM (not just mediastinum)    ", options: { color: C.white } },
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Retropharyngeal space → tracheal bifurcation    ", options: { color: C.white } },
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Prevertebral space → coccyx\n", options: { color: C.white } },
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Investing layer = ALL cervical nodal stations    ", options: { color: C.white } },
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Pretracheal fascia → fibrous pericardium (Hamman's sign in chest)    ", options: { color: C.white } },
    { text: "• ", options: { bold: true, color: C.accent } },
    { text: "Stylomandibular ligament from investing fascia separates parapharyngeal & submandibular spaces", options: { color: C.white } },
  ], { x: 0.5, y: 4.5, w: 9, h: 0.9, fontSize: 11, valign: "top" });
}

// ============================================================
// SLIDE 12 — Thank You
// ============================================================
{
  const slide = pres.addSlide();
  bgRect(slide, C.navy);
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: "100%", h: 1.825, fill: { color: C.teal }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: "100%", h: 0.1, fill: { color: C.accent }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 4.9, y: 0, w: 0.12, h: "100%", fill: { color: C.accent }, line: { type: "none" } });

  slide.addText("Thank You!", {
    x: 0.5, y: 0.8, w: 9, h: 1.2,
    fontSize: 52, bold: true, color: C.white, align: "center", fontFace: "Calibri Light"
  });
  slide.addText("Questions & Discussion", {
    x: 0.5, y: 2.1, w: 9, h: 0.6,
    fontSize: 22, italic: true, color: "BDD9F0", align: "center"
  });
  slide.addShape(pres.ShapeType.rect, { x: 3, y: 2.78, w: 4, h: 0.07, fill: { color: C.accent }, line: { type: "none" } });

  slide.addText("Deep Cervical Fascia — 1st BHMS Anatomy", {
    x: 0, y: 3.9, w: "100%", h: 0.5,
    fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle"
  });
  slide.addText("Source: Scott-Brown's Otorhinolaryngology Head & Neck Surgery  |  KJ Lee's Essential Otolaryngology  |  Fischer's Mastery of Surgery", {
    x: 0, y: 4.45, w: "100%", h: 0.4,
    fontSize: 10, italic: true, color: "BDD9F0", align: "center", valign: "middle"
  });
  slide.addText("\"The fascial planes of the neck form dissection tunnels which can be followed to surgically unlock the neck.\"", {
    x: 0.5, y: 5.0, w: 9, h: 0.45,
    fontSize: 11, italic: true, color: "BDD9F0", align: "center"
  });
}

// ============================================================
// WRITE FILE
// ============================================================
const outPath = "/home/daytona/workspace/deep-cervical-fascia-ppt/Deep_Cervical_Fascia_1BHMS.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("PPT created:", outPath);
}).catch(err => {
  console.error("Error:", err);
  process.exit(1);
});
!

Failed to create session: bad request: failed to resolve container IP after 3 attempts: no IP address found. Is the Sandbox started?

We encountered an error while processing your request. Please try again or reach out to us for help.

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