Convert this ppt into more realistic and major details woth illustrated diagrams and easily explainable

Reading File
Reading File
Running Command

cd /home/daytona/workspace/attachments/0a9fe4c7-6d75-4522-aeca-7d260e3cd941 && p…

Running Command

cd /home/daytona/workspace/attachments/0a9fe4c7-6d75-4522-aeca-7d260e3cd941 && p…

Reading File
Running Command

pip install python-pptx --quiet 2>&1 | tail -3

Running Command

python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/wor…

Reading File
Running Command

mkdir -p /home/daytona/workspace/tongue-anatomy-ppt && ls /home/daytona/workspac…

Writing File

~/tongue-anatomy-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anatomy and Physiology of the Tongue";

// ─── COLOR PALETTE ───────────────────────────────────────────────
const C = {
  navy:    "0B1F3A",  // dominant background dark
  teal:    "0E7C86",  // accent 1
  rose:    "C0392B",  // accent 2 (anatomical red)
  amber:   "E67E22",  // accent 3
  cream:   "FDF6EC",  // light background
  white:   "FFFFFF",
  silver:  "D6E4F0",
  midgrey: "5A6A7A",
  gold:    "F0C040",
};

// ─── HELPER: Add slide header band ───────────────────────────────
function addHeader(slide, title, subtitle) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 10, h: 1.05,
    fill: { color: C.navy },
    line: { color: C.navy }
  });
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 1.0, w: 10, h: 0.06,
    fill: { color: C.teal },
    line: { color: C.teal }
  });
  slide.addText(title, {
    x: 0.35, y: 0.1, w: 9.3, h: 0.65,
    fontSize: 24, bold: true, color: C.white, fontFace: "Calibri",
    valign: "middle", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.68, w: 9.3, h: 0.32,
      fontSize: 12, color: C.gold, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
  }
}

// ─── HELPER: Add footer ──────────────────────────────────────────
function addFooter(slide, text) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.45, w: 10, h: 0.18,
    fill: { color: C.navy },
    line: { color: C.navy }
  });
  slide.addText(text || "Anatomy & Physiology of Tongue | Presented by: Kashif Pathan", {
    x: 0.3, y: 5.45, w: 9.4, h: 0.18,
    fontSize: 8, color: C.silver, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ─── HELPER: Info card (colored box with title + bullets) ────────
function addCard(slide, x, y, w, h, headerText, bullets, headerColor) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h,
    fill: { color: C.cream },
    line: { color: headerColor || C.teal, pt: 1.5 },
    shadow: { type: "outer", blur: 4, offset: 2, angle: 45, color: "AAAAAA", opacity: 0.3 }
  });
  slide.addShape(pres.ShapeType.rect, {
    x, y, w: w, h: 0.35,
    fill: { color: headerColor || C.teal },
    line: { color: headerColor || C.teal }
  });
  slide.addText(headerText, {
    x: x + 0.08, y: y + 0.02, w: w - 0.16, h: 0.31,
    fontSize: 11, bold: true, color: C.white, fontFace: "Calibri",
    valign: "middle", margin: 0
  });
  const items = bullets.map((b, i) => ({
    text: b,
    options: { bullet: { code: "2022" }, breakLine: i < bullets.length - 1, fontSize: 10.5, color: C.navy, fontFace: "Calibri" }
  }));
  slide.addText(items, {
    x: x + 0.1, y: y + 0.38, w: w - 0.2, h: h - 0.44,
    valign: "top", margin: 0
  });
}

// ─── HELPER: Labeled circle node ─────────────────────────────────
function addNode(slide, x, y, r, label, fillColor) {
  slide.addShape(pres.ShapeType.ellipse, {
    x: x - r, y: y - r, w: r * 2, h: r * 2,
    fill: { color: fillColor || C.teal },
    line: { color: C.white, pt: 2 }
  });
  slide.addText(label, {
    x: x - r, y: y - r, w: r * 2, h: r * 2,
    fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle",
    fontFace: "Calibri", margin: 0
  });
}

// ─── HELPER: Connector line ──────────────────────────────────────
function addLine(slide, x1, y1, x2, y2, color) {
  slide.addShape(pres.ShapeType.line, {
    x: Math.min(x1, x2), y: Math.min(y1, y2),
    w: Math.abs(x2 - x1) || 0.01, h: Math.abs(y2 - y1) || 0.01,
    line: { color: color || C.teal, pt: 1.5, dashType: "solid" },
    flipH: x1 > x2, flipV: y1 > y2
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // Full background
  s.background = { color: C.navy };

  // Decorative gradient band
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.2, w: 10, h: 1.4, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.1, w: 10, h: 0.12, fill: { color: C.gold }, line: { color: C.gold } });

  // Title
  s.addText("Anatomy & Physiology", {
    x: 0.6, y: 0.7, w: 8.8, h: 1.0,
    fontSize: 42, bold: true, color: C.white, fontFace: "Calibri",
    align: "center", valign: "middle", charSpacing: 2, margin: 0
  });
  s.addText("of the Tongue", {
    x: 0.6, y: 1.65, w: 8.8, h: 0.85,
    fontSize: 36, bold: false, color: C.gold, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  // Divider
  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 2.58, w: 3, h: 0.04, fill: { color: C.silver }, line: { color: C.silver } });

  // Subtitle
  s.addText("A comprehensive illustrated overview for medical students", {
    x: 0.6, y: 2.72, w: 8.8, h: 0.45,
    fontSize: 14, italic: true, color: C.silver, fontFace: "Calibri",
    align: "center", margin: 0
  });

  // Presenter
  s.addText("Presented by: Kashif Pathan", {
    x: 0.6, y: 4.25, w: 8.8, h: 0.45,
    fontSize: 16, bold: true, color: C.white, fontFace: "Calibri",
    align: "center", margin: 0
  });

  // Key topics row
  const topics = ["Structure", "Parts", "Papillae", "Muscles", "Nerve Supply", "Physiology"];
  topics.forEach((t, i) => {
    const x = 0.55 + i * 1.55;
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 4.85, w: 1.4, h: 0.55,
      fill: { color: C.navy }, line: { color: C.gold, pt: 1.5 },
      rectRadius: 0.1
    });
    s.addText(t, { x, y: 4.85, w: 1.4, h: 0.55, fontSize: 10, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
  });

  addFooter(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 2 — INTRODUCTION & OVERVIEW
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Introduction to the Tongue", "Overview of structure, composition and key functions");
  addFooter(s);

  // Key fact banner
  s.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 1.25, w: 9.4, h: 0.55,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  s.addText("The tongue is a highly specialized muscular organ situated on the floor of the oral cavity, composed of voluntary skeletal muscle covered by mucous membrane.", {
    x: 0.4, y: 1.25, w: 9.2, h: 0.55,
    fontSize: 11, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0, italic: true
  });

  // Three columns
  addCard(s, 0.3, 1.92, 2.9, 3.3, "Composition", [
    "Voluntary skeletal muscle",
    "Mucous membrane cover",
    "Intrinsic + Extrinsic muscles",
    "Rich vascular supply",
    "Dense sensory innervation",
    "Taste receptor cells"
  ], C.teal);

  addCard(s, 3.4, 1.92, 2.9, 3.3, "Key Functions", [
    "Gustation (taste perception)",
    "Mastication (chewing aid)",
    "Deglutition (swallowing)",
    "Articulation (speech)",
    "Oral cleansing",
    "Salivation stimulus"
  ], C.rose);

  addCard(s, 6.5, 1.92, 3.2, 3.3, "Clinical Significance", [
    "Macroglossia: enlarged tongue",
    "Ankyloglossia: tongue-tie",
    "Glossitis: tongue inflammation",
    "Leukoplakia: white patches",
    "Geographic tongue",
    "Hypoglossal nerve palsy"
  ], C.amber);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 3 — PARTS OF THE TONGUE (Diagram)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Parts of the Tongue", "Anatomical divisions and surface features");
  addFooter(s);

  // Schematic tongue shape (dorsal view diagram using shapes)
  // Outer tongue body
  s.addShape(pres.ShapeType.ellipse, {
    x: 2.2, y: 1.25, w: 3.6, h: 4.0,
    fill: { color: "FFB3A7" }, line: { color: C.rose, pt: 2 }
  });

  // Sulcus terminalis (V-line) — simulate with two lines
  // Left arm
  s.addShape(pres.ShapeType.line, { x: 3.1, y: 2.85, w: 0.9, h: 0.55, line: { color: C.navy, pt: 2, dashType: "dash" }, flipV: false });
  // Right arm
  s.addShape(pres.ShapeType.line, { x: 4.0, y: 2.85, w: 0.9, h: 0.55, line: { color: C.navy, pt: 2, dashType: "dash" }, flipV: false, flipH: true });

  // Foramen cecum dot
  s.addShape(pres.ShapeType.ellipse, { x: 3.93, y: 3.35, w: 0.14, h: 0.14, fill: { color: C.rose }, line: { color: C.rose } });

  // Median sulcus (centre line)
  s.addShape(pres.ShapeType.line, { x: 4.0, y: 1.3, w: 0.01, h: 1.55, line: { color: C.navy, pt: 1.5, dashType: "dot" } });

  // Pharyngeal part shading
  s.addShape(pres.ShapeType.ellipse, {
    x: 2.3, y: 3.45, w: 3.4, h: 1.7,
    fill: { color: "FFD6CC", transparency: 30 }, line: { color: C.rose, pt: 1 }
  });

  // Labels
  const labels = [
    { text: "TIP / APEX", x: 6.05, y: 1.2 },
    { text: "Median Sulcus", x: 6.05, y: 2.0 },
    { text: "ORAL PART (Ant. ⅔)", x: 6.05, y: 2.6 },
    { text: "Sulcus Terminalis\n(V-shaped groove)", x: 6.05, y: 3.1 },
    { text: "Foramen Cecum", x: 6.05, y: 3.55 },
    { text: "PHARYNGEAL PART\n(Post. ⅓)", x: 6.05, y: 4.05 },
    { text: "ROOT", x: 6.05, y: 4.75 },
  ];

  const arrowTargetX = [4.05, 4.01, 3.5, 4.0, 4.07, 3.5, 3.5];
  const arrowTargetY = [1.35, 1.9, 2.5, 2.95, 3.42, 4.15, 5.1];

  labels.forEach((lbl, i) => {
    s.addText(lbl.text, {
      x: lbl.x, y: lbl.y - 0.12, w: 3.6, h: 0.45,
      fontSize: 9.5, bold: true, color: C.navy, fontFace: "Calibri", margin: 0
    });
    // pointer line
    s.addShape(pres.ShapeType.line, {
      x: arrowTargetX[i], y: arrowTargetY[i],
      w: lbl.x - arrowTargetX[i] - 0.05, h: 0,
      line: { color: C.midgrey, pt: 1, dashType: "dash" }
    });
  });

  // Legend box
  s.addShape(pres.ShapeType.rect, { x: 0.15, y: 4.55, w: 1.75, h: 0.75, fill: { color: C.navy }, line: { color: C.gold } });
  s.addText([
    { text: "■ ", options: { color: "FFB3A7", bold: true } },
    { text: "Oral Part  ", options: { color: C.white, fontSize: 8 } },
    { text: "■ ", options: { color: "FFD6CC", bold: true } },
    { text: "Pharyngeal Part", options: { color: C.white, fontSize: 8 } }
  ], { x: 0.2, y: 4.6, w: 1.65, h: 0.65, valign: "middle", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 4 — ORAL PART DETAILS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Oral Part of the Tongue", "Anterior two-thirds — the papillary / presulcal part");
  addFooter(s);

  // Key definition box
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 1.18, w: 9.4, h: 0.62,
    fill: { color: C.teal }, line: { color: C.teal }, rectRadius: 0.1
  });
  s.addText("The oral (presulcal) part lies in front of the palatoglossal arch and is separated from the pharyngeal part by the sulcus terminalis and the V-shaped row of circumvallate papillae.", {
    x: 0.5, y: 1.18, w: 9.1, h: 0.62,
    fontSize: 10.5, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
  });

  // Four feature cards
  const cards = [
    {
      hdr: "Dorsal Surface", color: C.teal,
      pts: [
        "Covered with numerous papillae",
        "Median sulcus divides it into two symmetric halves",
        "8-12 large circumvallate papillae form V at posterior border",
        "Filiform papillae give the rough texture"
      ]
    },
    {
      hdr: "Inferior Surface", color: C.rose,
      pts: [
        "Smooth mucous membrane",
        "Median fold = Frenulum linguae",
        "Plica fimbriata: fringe-like fold lateral to frenulum",
        "Deep lingual veins visible through thin mucosa"
      ]
    },
    {
      hdr: "Lateral Margin", color: C.amber,
      pts: [
        "4-5 vertical folds = Foliate papillae",
        "Visible just inside the palatoglossal arch",
        "Contain taste buds (especially in children)",
        "Homologous to well-developed papillae in animals"
      ]
    },
    {
      hdr: "Sulcus Terminalis", color: C.midgrey,
      pts: [
        "V-shaped groove separating oral from pharyngeal",
        "Apex directed posteriorly → Foramen Cecum",
        "Foramen Cecum = vestige of thyroglossal duct",
        "Thyroid gland descends from this point during development"
      ]
    }
  ];

  cards.forEach((c, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    addCard(s, 0.3 + col * 4.85, 1.95 + row * 1.82, 4.6, 1.72, c.hdr, c.pts, c.color);
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 5 — PHARYNGEAL PART + POSTERIOR MOST PART
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Pharyngeal & Posterior Parts of the Tongue", "Post. ⅓ | Base of tongue | Epiglottic connections");
  addFooter(s);

  // Pharyngeal part
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.18, w: 4.6, h: 4.1, fill: { color: "EBF5FB" }, line: { color: C.teal, pt: 2 }, rectRadius: 0.15 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.18, w: 4.6, h: 0.42, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("PHARYNGEAL PART (Posterior ⅓)", { x: 0.4, y: 1.18, w: 4.4, h: 0.42, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });

  const ph = [
    "Also called: Lymphoid part / Base of tongue",
    "Lies beyond palatoglossal arch & sulcus terminalis",
    "Forms anterior wall of oropharynx",
    "Mucosa has numerous small nodular elevations",
    "These nodules = lymphoid follicles (lingual tonsil)",
    "Lingual tonsil is part of Waldeyer's lymphatic ring",
    "No papillae present on pharyngeal part",
    "Sensory supply: Glossopharyngeal nerve (CN IX)"
  ];
  ph.forEach((p, i) => {
    s.addText([{ text: "▸  " + p, options: {} }], {
      x: 0.5, y: 1.72 + i * 0.42, w: 4.2, h: 0.38,
      fontSize: 10, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });

  // Posterior most part
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.18, w: 4.6, h: 4.1, fill: { color: "FEF9E7" }, line: { color: C.amber, pt: 2 }, rectRadius: 0.15 });
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.18, w: 4.6, h: 0.42, fill: { color: C.amber }, line: { color: C.amber } });
  s.addText("POSTERIOR-MOST PART (Epiglottic Region)", { x: 5.2, y: 1.18, w: 4.4, h: 0.42, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });

  const pm = [
    "Connected to epiglottis by 3 folds of mucous membrane:",
    "  1. Median glossoepiglottic fold (1 fold centrally)",
    "  2. Lateral glossoepiglottic folds (2 folds, one each side)",
    "Depressions on either side of median fold = Valleculae",
    "Valleculae: common site where foreign bodies lodge",
    "Sensory: Superior laryngeal branch of Vagus (CN X)",
    "The epiglottis acts as a lid during swallowing",
    "Clinically: mirror laryngoscopy visualizes this region"
  ];
  pm.forEach((p, i) => {
    s.addText([{ text: (i === 0 ? "★  " : "▸  ") + p, options: {} }], {
      x: 5.25, y: 1.72 + i * 0.42, w: 4.35, h: 0.38,
      fontSize: 10, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 6 — PAPILLAE OF THE TONGUE (with visual diagram)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Papillae of the Tongue", "4 types of mucosal projections — structure, location, and taste bud content");
  addFooter(s);

  // ─── Mini tongue map (schematic dorsal view) ─────────────────
  // tongue outline
  s.addShape(pres.ShapeType.ellipse, { x: 0.2, y: 1.22, w: 2.1, h: 3.5, fill: { color: "FFB3A7" }, line: { color: C.rose, pt: 1.5 } });
  // sulcus terminalis
  s.addShape(pres.ShapeType.line, { x: 0.65, y: 2.9, w: 0.6, h: 0.4, line: { color: C.navy, pt: 1.5, dashType: "dash" } });
  s.addShape(pres.ShapeType.line, { x: 1.25, y: 2.9, w: 0.6, h: 0.4, line: { color: C.navy, pt: 1.5, dashType: "dash" }, flipH: true });

  // Circumvallate dots on sulcus line
  [[0.67, 3.3],[0.82, 3.12],[1.0, 3.05],[1.18, 3.05],[1.35, 3.12],[1.5, 3.3]].forEach(([cx, cy]) => {
    s.addShape(pres.ShapeType.ellipse, { x: cx - 0.07, y: cy - 0.07, w: 0.14, h: 0.14, fill: { color: C.rose }, line: { color: C.navy, pt: 1 } });
  });

  // Fungiform dots scattered in ant 2/3
  [[0.85, 1.5],[1.2, 1.45],[0.65, 1.9],[1.5, 1.85],[0.78, 2.3],[1.35, 2.25],[1.05, 2.6]].forEach(([cx, cy]) => {
    s.addShape(pres.ShapeType.ellipse, { x: cx - 0.055, y: cy - 0.055, w: 0.11, h: 0.11, fill: { color: C.amber }, line: { color: C.amber } });
  });

  // Label
  s.addText("Dorsal View\n(Schematic)", { x: 0.2, y: 4.82, w: 2.1, h: 0.45, fontSize: 8, color: C.midgrey, align: "center", fontFace: "Calibri", margin: 0 });

  // 4 papilla detail cards
  const paps = [
    {
      name: "Filiform Papillae", color: C.midgrey, x: 2.5, y: 1.2,
      pts: [
        "Most numerous type on tongue",
        "Conical / thread-like projections",
        "NO taste buds present",
        "Mechanical function: grip & friction",
        "Give tongue its rough texture",
        "Present over entire dorsal surface",
        "Stained by food / tobacco (coating)"
      ]
    },
    {
      name: "Fungiform Papillae", color: C.amber, x: 5.15, y: 1.2,
      pts: [
        "Mushroom-shaped (broader top)",
        "Scattered among filiform papillae",
        "Concentrated at TIP & SIDES",
        "Contain taste buds (Sweet, Salty)",
        "Supplied by Chorda tympani (VII)",
        "Appear as red dots on tongue surface",
        "Approx. 200–400 on each tongue"
      ]
    },
    {
      name: "Circumvallate / Vallate", color: C.rose, x: 2.5, y: 3.32,
      pts: [
        "8-12 large papillae in V-shape row",
        "Just anterior to sulcus terminalis",
        "Each surrounded by a deep groove (moat)",
        "Serous (von Ebner's) glands open into moat",
        "Richest in taste buds (~100 per papilla)",
        "Detect BITTER taste (protective reflex)",
        "Supplied by glossopharyngeal nerve (IX)"
      ]
    },
    {
      name: "Foliate Papillae", color: C.teal, x: 5.15, y: 3.32,
      pts: [
        "4-5 vertical folds on lateral margins",
        "Posterior edge, near palatoglossal arch",
        "Contain taste buds (mainly in children)",
        "Rudimentary in adults",
        "Detect SOUR & SALTY tastes",
        "May enlarge → mistaken for ulcer",
        "Supplied by chorda tympani (VII)"
      ]
    }
  ];

  paps.forEach(p => {
    addCard(s, p.x, p.y, 2.55, 2.05, p.name, p.pts, p.color);
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 7 — MUSCLES OF THE TONGUE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Muscles of the Tongue", "4 Intrinsic + 4 Extrinsic muscles per half = 16 total");
  addFooter(s);

  // Central concept node
  s.addShape(pres.ShapeType.ellipse, { x: 3.9, y: 2.35, w: 2.2, h: 1.0, fill: { color: C.navy }, line: { color: C.gold, pt: 2 } });
  s.addText("TONGUE\nMUSCLES", { x: 3.9, y: 2.35, w: 2.2, h: 1.0, fontSize: 13, bold: true, color: C.gold, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });

  // Intrinsic muscles box
  s.addShape(pres.ShapeType.roundRect, { x: 0.2, y: 1.18, w: 3.55, h: 3.6, fill: { color: "EBF5FB" }, line: { color: C.teal, pt: 2 }, rectRadius: 0.12 });
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.18, w: 3.55, h: 0.42, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("INTRINSIC MUSCLES (4)", { x: 0.3, y: 1.18, w: 3.35, h: 0.42, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
  s.addText("Occupy the UPPER part of tongue\nAlter the SHAPE of tongue\nAll supplied by Hypoglossal Nerve (CN XII)", {
    x: 0.3, y: 1.64, w: 3.35, h: 0.55,
    fontSize: 9.5, italic: true, color: C.teal, fontFace: "Calibri", valign: "top", margin: 0
  });

  const intrinsic = [
    ["Superior Longitudinal", "Shortens tongue; curls apex up"],
    ["Inferior Longitudinal", "Shortens tongue; curls apex down"],
    ["Transverse", "Narrows & elongates tongue"],
    ["Vertical", "Flattens & broadens tongue"],
  ];
  intrinsic.forEach(([name, action], i) => {
    s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 2.25 + i * 0.6, w: 3.3, h: 0.55, fill: { color: C.white }, line: { color: C.teal, pt: 1 }, rectRadius: 0.07 });
    s.addText(name, { x: 0.38, y: 2.28 + i * 0.6, w: 1.6, h: 0.48, fontSize: 10, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(action, { x: 2.02, y: 2.28 + i * 0.6, w: 1.55, h: 0.48, fontSize: 9, color: C.midgrey, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  // Extrinsic muscles box
  s.addShape(pres.ShapeType.roundRect, { x: 6.25, y: 1.18, w: 3.55, h: 3.6, fill: { color: "FEF9E7" }, line: { color: C.amber, pt: 2 }, rectRadius: 0.12 });
  s.addShape(pres.ShapeType.rect, { x: 6.25, y: 1.18, w: 3.55, h: 0.42, fill: { color: C.amber }, line: { color: C.amber } });
  s.addText("EXTRINSIC MUSCLES (4)", { x: 6.35, y: 1.18, w: 3.35, h: 0.42, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
  s.addText("Attach tongue to BONES / Structures\nMove tongue as a whole\nAll by CN XII except Palatoglossus (CN X)", {
    x: 6.35, y: 1.64, w: 3.35, h: 0.55,
    fontSize: 9.5, italic: true, color: C.amber, fontFace: "Calibri", valign: "top", margin: 0
  });

  const extrinsic = [
    ["Genioglossus", "Protrudes tongue (most important)"],
    ["Hyoglossus", "Depresses & retracts tongue"],
    ["Styloglossus", "Retracts & elevates tongue"],
    ["Palatoglossus", "Elevates tongue base; narrows fauces"],
  ];
  extrinsic.forEach(([name, action], i) => {
    s.addShape(pres.ShapeType.roundRect, { x: 6.35, y: 2.25 + i * 0.6, w: 3.3, h: 0.55, fill: { color: C.white }, line: { color: C.amber, pt: 1 }, rectRadius: 0.07 });
    s.addText(name, { x: 6.43, y: 2.28 + i * 0.6, w: 1.55, h: 0.48, fontSize: 10, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(action, { x: 8.02, y: 2.28 + i * 0.6, w: 1.6, h: 0.48, fontSize: 9, color: C.midgrey, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  // Connector lines from centre ellipse to boxes
  s.addShape(pres.ShapeType.line, { x: 3.75, y: 2.85, w: 0.15, h: 0.01, line: { color: C.midgrey, pt: 1.5 } });
  s.addShape(pres.ShapeType.line, { x: 6.1, y: 2.85, w: 0.15, h: 0.01, line: { color: C.midgrey, pt: 1.5 } });

  // Memory tip
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 4.9, w: 9.6, h: 0.38, fill: { color: C.navy }, line: { color: C.gold } });
  s.addText("Memory Aid — All tongue muscles supplied by CN XII (Hypoglossal) EXCEPT Palatoglossus → supplied by Vagus via Pharyngeal Plexus (CN X)", {
    x: 0.35, y: 4.9, w: 9.3, h: 0.38,
    fontSize: 10, bold: true, color: C.gold, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 8 — BLOOD SUPPLY & VENOUS DRAINAGE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Arterial Supply & Venous Drainage", "Lingual artery and deep lingual vein");
  addFooter(s);

  // Arterial supply (left)
  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 1.18, w: 4.6, h: 4.1, fill: { color: "FDEDEC" }, line: { color: C.rose, pt: 2 }, rectRadius: 0.15 });
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.18, w: 4.6, h: 0.45, fill: { color: C.rose }, line: { color: C.rose } });
  s.addText("▲  ARTERIAL SUPPLY", { x: 0.35, y: 1.18, w: 4.4, h: 0.45, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });

  const art = [
    ["Main Artery", "Lingual Artery (branch of External Carotid)"],
    ["Origin", "2nd branch of External Carotid Artery"],
    ["Entry Point", "Between Hyoglossus & Genioglossus muscles"],
    ["Branches", "Dorsal lingual + Deep lingual + Sublingual arteries"],
    ["Dorsal Lingual A.", "Supplies posterior ⅓ and tonsils"],
    ["Deep Lingual A.", "Runs to apex; main supply of tongue body"],
    ["Sublingual A.", "Supplies floor of mouth and sublingual gland"],
    ["Anastomosis", "Minimal across midline → unilateral ligation possible"],
  ];
  art.forEach(([key, val], i) => {
    s.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.72 + i * 0.44, w: 1.5, h: 0.4, fill: { color: C.rose }, line: { color: C.rose } });
    s.addText(key, { x: 0.38, y: 1.72 + i * 0.44, w: 1.44, h: 0.4, fontSize: 9, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: 1.85, y: 1.72 + i * 0.44, w: 2.9, h: 0.4, fill: { color: C.white }, line: { color: "FADBD8" } });
    s.addText(val, { x: 1.9, y: 1.72 + i * 0.44, w: 2.8, h: 0.4, fontSize: 9, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  // Venous drainage (right)
  s.addShape(pres.ShapeType.roundRect, { x: 5.15, y: 1.18, w: 4.6, h: 4.1, fill: { color: "EAF2FF" }, line: { color: C.teal, pt: 2 }, rectRadius: 0.15 });
  s.addShape(pres.ShapeType.rect, { x: 5.15, y: 1.18, w: 4.6, h: 0.45, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("▼  VENOUS DRAINAGE + LYMPHATICS", { x: 5.25, y: 1.18, w: 4.4, h: 0.45, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });

  const ven = [
    ["Main Vein", "Deep Lingual Vein"],
    ["Route", "Visible through mucosa on underside"],
    ["Drains to", "Joins Internal Jugular Vein"],
    ["Clinical Note", "Sublingual drug absorption via these veins"],
    ["Lymph — Tip", "→ Submental nodes"],
    ["Lymph — Lat.", "→ Submandibular nodes"],
    ["Lymph — Post.", "→ Jugulodigastric (deep cervical) nodes"],
    ["Cancer spread", "Tongue CA spreads to jugulodigastric 1st"],
  ];
  ven.forEach(([key, val], i) => {
    s.addShape(pres.ShapeType.rect, { x: 5.25, y: 1.72 + i * 0.44, w: 1.45, h: 0.4, fill: { color: C.teal }, line: { color: C.teal } });
    s.addText(key, { x: 5.28, y: 1.72 + i * 0.44, w: 1.39, h: 0.4, fontSize: 9, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: 6.7, y: 1.72 + i * 0.44, w: 2.95, h: 0.4, fill: { color: C.white }, line: { color: "D6EAF8" } });
    s.addText(val, { x: 6.74, y: 1.72 + i * 0.44, w: 2.87, h: 0.4, fontSize: 9, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 9 — NERVE SUPPLY
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Nerve Supply of the Tongue", "Motor, Sensory (General) & Sensory (Special — Taste)");
  addFooter(s);

  // Motor box
  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 1.18, w: 9.5, h: 0.92, fill: { color: "1A5276" }, line: { color: C.gold, pt: 2 }, rectRadius: 0.12 });
  s.addText("MOTOR SUPPLY", { x: 0.4, y: 1.2, w: 2.2, h: 0.35, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
  s.addText("All muscles of tongue → Hypoglossal Nerve (CN XII)   |   EXCEPT Palatoglossus → Vagus (CN X) via Pharyngeal Plexus", {
    x: 0.4, y: 1.5, w: 9.2, h: 0.56,
    fontSize: 10.5, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
  });

  // 3 columns for sensory
  const cols = [
    {
      title: "Ant. ⅔ — General Sensation", color: C.teal, x: 0.25, pts: [
        "Nerve: Lingual Nerve",
        "Branch of: Mandibular N. (V3)",
        "Carries: Touch, pain, temperature",
        "Chorda tympani joins lingual nerve",
        "Chorda tympani from CN VII",
        "Carries taste fibres for ant. ⅔",
        "Lesion → loss of taste on ant. tongue"
      ]
    },
    {
      title: "Post. ⅓ + Vallate — Sensation & Taste", color: C.rose, x: 3.45, pts: [
        "Nerve: Glossopharyngeal (CN IX)",
        "Both general AND taste sensation",
        "Supplies pharyngeal part + vallate papillae",
        "Taste fibers for BITTER detection",
        "Reflex: Gagging stimulus mediated here",
        "Lesion → loss of taste on post. tongue",
        "Glossopharyngeal neuralgia: severe pain"
      ]
    },
    {
      title: "Posterior-most / Epiglottic", color: C.amber, x: 6.65, pts: [
        "Nerve: Superior Laryngeal N.",
        "Branch of: Vagus (CN X)",
        "General sensation only (no taste)",
        "Covers area near epiglottis",
        "Also: Lingual branch of Glossopharyngeal",
        "Region of valleculae and folds",
        "Lesion: risk of silent aspiration"
      ]
    }
  ];

  cols.forEach(c => {
    addCard(s, c.x, 2.22, 3.1, 3.06, c.title, c.pts, c.color);
  });

  // Summary table
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.2, w: 9.5, h: 0.2, fill: { color: C.navy }, line: { color: C.navy } });
  s.addText("Quick Recap: Lingual N (ant ⅔ touch) | Chorda Tympani (ant ⅔ taste) | Glossopharyngeal CN IX (post ⅓) | Vagus CN X (epiglottic region) | Hypoglossal CN XII (motor)", {
    x: 0.3, y: 5.2, w: 9.4, h: 0.2, fontSize: 8.5, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 10 — PHYSIOLOGY: TASTE (GUSTATION)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Physiology: Taste (Gustation)", "Taste buds, transduction, and the 5 basic tastes");
  addFooter(s);

  // 5 tastes horizontal icons row
  const tastes = [
    { name: "SWEET", color: "F1948A", note: "Sugar, carbs\n→ Fungiform papillae\n→ Tip & sides" },
    { name: "SALTY", color: "5DADE2", note: "Ions (Na+, Cl-)\n→ Fungiform papillae\n→ Sides" },
    { name: "SOUR", color: "58D68D", note: "Acids (H+ ions)\n→ Foliate papillae\n→ Lateral borders" },
    { name: "BITTER", color: "A569BD", note: "Alkaloids\n→ Circumvallate papillae\n→ Posterior" },
    { name: "UMAMI", color: "E59866", note: "Glutamate\n→ Distributed\n→ All regions" },
  ];

  tastes.forEach((t, i) => {
    const x = 0.25 + i * 1.92;
    s.addShape(pres.ShapeType.ellipse, { x: x, y: 1.2, w: 1.75, h: 0.75, fill: { color: t.color }, line: { color: C.white, pt: 2 } });
    s.addText(t.name, { x: x, y: 1.2, w: 1.75, h: 0.75, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    s.addText(t.note, { x: x, y: 2.0, w: 1.75, h: 0.85, fontSize: 8.5, color: C.navy, fontFace: "Calibri", align: "center", valign: "top", margin: 0 });
  });

  // Taste Bud Structure
  addCard(s, 0.25, 2.95, 3.1, 2.3, "Taste Bud Structure", [
    "Barrel-shaped epithelial structures",
    "~10,000 taste buds in mouth",
    "Located mainly on papillae + soft palate",
    "Each bud: 50–100 receptor cells",
    "Taste pore opens to oral surface",
    "Microvilli (taste hairs) project through pore",
    "Replaced every 10-14 days"
  ], C.teal);

  // Transduction pathway
  addCard(s, 3.55, 2.95, 3.1, 2.3, "Taste Transduction Pathway", [
    "Tastant dissolves in saliva",
    "Binds to receptor on microvilli",
    "Receptor activation → ion channel opens",
    "Ca2+ influx → neurotransmitter release",
    "Signal → chorda tympani / CN IX",
    "Relay at nucleus of solitary tract (NTS)",
    "Thalamus (VPM) → Primary Gustatory Cortex"
  ], C.rose);

  // Clinical notes
  addCard(s, 6.85, 2.95, 2.9, 2.3, "Clinical Notes", [
    "Ageusia: complete loss of taste",
    "Hypogeusia: reduced taste",
    "Dysgeusia: distorted taste",
    "Bell's palsy → loss of taste ant. ⅔",
    "COVID-19: ageusia common symptom",
    "Zinc deficiency → taste loss",
    "Taste buds decrease with age"
  ], C.amber);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 11 — PHYSIOLOGY: MASTICATION, DEGLUTITION, SPEECH
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Physiology: Mastication, Deglutition & Speech", "Mechanical and functional roles of the tongue");
  addFooter(s);

  addCard(s, 0.25, 1.18, 3.1, 2.2, "Mastication (Chewing)", [
    "Tongue mixes food with saliva",
    "Forms a soft cohesive food bolus",
    "Positions food between molars for grinding",
    "Keeps food on occlusal surfaces",
    "Constantly repositions tongue during chewing",
    "Intrinsic muscles reshape tongue for this"
  ], C.teal);

  addCard(s, 3.45, 1.18, 3.1, 2.2, "Deglutition (Swallowing)", [
    "3 Phases: Oral → Pharyngeal → Esophageal",
    "Oral phase is VOLUNTARY",
    "Tongue tip rises to hard palate",
    "Posterior tongue propels bolus backward",
    "Triggers pharyngeal swallowing reflex",
    "Soft palate rises; larynx elevates"
  ], C.rose);

  addCard(s, 6.65, 1.18, 3.1, 2.2, "Speech & Articulation", [
    "Tongue is the primary organ of articulation",
    "Dental sounds: T, D, N (tongue + teeth)",
    "Alveolar: S, Z (tongue + alveolar ridge)",
    "Palatal: SH, CH (tongue + hard palate)",
    "Velar: K, G (tongue + soft palate)",
    "Tongue paralysis → dysarthria"
  ], C.amber);

  addCard(s, 0.25, 3.5, 3.1, 1.8, "Oral Cleansing", [
    "Removes food debris from oral cavity",
    "Spreads saliva over mucosal surfaces",
    "Assists in maintaining oral hygiene",
    "Helps sense foreign objects in mouth",
    "Works synergistically with saliva"
  ], C.midgrey);

  addCard(s, 3.45, 3.5, 3.1, 1.8, "Salivation Reflex", [
    "Tongue movement stimulates salivary glands",
    "Promotes parotid, submandibular secretion",
    "Saliva lubricates → aids bolus formation",
    "Salivary amylase begins starch digestion",
    "Lingual lipase secreted at tongue base"
  ], C.teal);

  addCard(s, 6.65, 3.5, 3.1, 1.8, "Proprioception", [
    "Tongue knows its own position at all times",
    "Muscle spindles + Meissner corpuscles",
    "Critical for precise articulation",
    "Assists during nocturnal breathing",
    "Impaired in hypoglossal nerve palsy"
  ], C.rose);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 12 — TASTE RECEPTORS (DETAILED PAPILLAE PHYSIOLOGY)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Taste Receptors — Papillae Summary", "Distribution, taste bud content and clinical correlations");
  addFooter(s);

  const rows = [
    ["Papilla Type", "Location", "Taste Buds?", "Special Feature", "Nerve Supply"],
    ["Filiform", "Entire dorsal surface", "NONE", "Most numerous; conical; give roughness", "Trigeminal (touch only)"],
    ["Fungiform", "Tip & lateral sides", "YES (~5/papilla)", "Mushroom-shaped; reddish; 200-400 total", "Chorda tympani (CN VII)"],
    ["Circumvallate", "V-row at sulcus terminalis", "YES (~100/papilla)", "8-12 large; surrounded by deep groove; von Ebner glands", "Glossopharyngeal (CN IX)"],
    ["Foliate", "Posterior lateral margin", "YES (children)", "4-5 vertical folds; rudimentary in adults", "Chorda tympani (VII) + CN IX"],
  ];

  const colW = [1.8, 1.8, 1.5, 3.2, 1.95];
  const colX = [0.2, 2.0, 3.8, 5.3, 8.5];
  const rowColors = [C.navy, "FDFEFE", "EBF5FB", "FDEDEC", "FEF9E7"];
  const textColors = [C.white, C.navy, C.navy, C.navy, C.navy];

  rows.forEach((row, ri) => {
    const y = 1.25 + ri * 0.72;
    row.forEach((cell, ci) => {
      s.addShape(pres.ShapeType.rect, {
        x: colX[ci], y, w: colW[ci], h: 0.68,
        fill: { color: ri === 0 ? C.navy : rowColors[ri] },
        line: { color: "D5D8DC", pt: 0.5 }
      });
      s.addText(cell, {
        x: colX[ci] + 0.05, y: y + 0.02, w: colW[ci] - 0.1, h: 0.64,
        fontSize: ri === 0 ? 10 : 9.5,
        bold: ri === 0 ? true : (ci === 0 ? true : false),
        color: ri === 0 ? C.white : C.navy,
        fontFace: "Calibri", valign: "middle", margin: 0,
        wrap: true
      });
    });
  });

  // Clinical note
  s.addShape(pres.ShapeType.roundRect, { x: 0.2, y: 5.0, w: 9.6, h: 0.48, fill: { color: C.teal }, line: { color: C.teal }, rectRadius: 0.08 });
  s.addText("Clinical Pearl: Enlarged foliate papillae are often mistaken for lateral tongue ulcers or early carcinoma. Circumvallate papillae detect bitter compounds — this triggers the gag/vomiting reflex as a protective mechanism against toxins.", {
    x: 0.35, y: 5.0, w: 9.3, h: 0.48, fontSize: 9.5, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 13 — CLINICAL CORRELATIONS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  addHeader(s, "Clinical Correlations", "Tongue pathology, nerve palsies and applied anatomy");
  addFooter(s);

  const cases = [
    { title: "Hypoglossal Nerve Palsy (CN XII)", color: C.rose, pts: [
      "Tongue deviates TOWARDS the side of lesion",
      "Genioglossus contralateral side is unopposed",
      "Ipsilateral wasting and fasciculations of tongue",
      "Causes: ALS, skull base tumors, trauma"
    ]},
    { title: "Tongue Carcinoma", color: C.navy, pts: [
      "Most common site: Lateral border (middle ⅓)",
      "Spreads to jugulodigastric lymph nodes",
      "Tip lesions → bilateral node spread",
      "Risk factors: tobacco, alcohol, HPV-16"
    ]},
    { title: "Ankyloglossia (Tongue-tie)", color: C.teal, pts: [
      "Short/tight frenulum linguae",
      "Restricts tongue movement",
      "Causes feeding, speech difficulties",
      "Tx: Frenotomy (surgical release)"
    ]},
    { title: "Geographic Tongue (Benign Migratory Glossitis)", color: C.amber, pts: [
      "Irregular smooth red patches on dorsum",
      "Depapillated areas with white borders",
      "Migrates over days — hence 'geographic'",
      "Benign; no treatment needed"
    ]},
    { title: "Glossitis (Atrophic)", color: C.midgrey, pts: [
      "Smooth, beefy-red tongue",
      "Loss of papillae (bald tongue)",
      "Causes: B12, Iron, folate deficiency",
      "Also: Plummer-Vinson syndrome"
    ]},
    { title: "Macroglossia", color: "8E44AD", pts: [
      "Abnormally enlarged tongue",
      "True: Amyloidosis, acromegaly, hypothyroidism",
      "Relative: Cretinism, Down syndrome",
      "Causes obstructive sleep apnea"
    ]},
  ];

  cases.forEach((c, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.25 + col * 3.2;
    const y = 1.18 + row * 2.2;

    s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.1, h: 2.1, fill: { color: C.white }, line: { color: c.color, pt: 2 }, rectRadius: 0.12 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.4, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.title, { x: x + 0.08, y: y + 0.03, w: 2.94, h: 0.34, fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    const items = c.pts.map((p, i2) => ({ text: p, options: { bullet: { code: "2022" }, breakLine: i2 < c.pts.length - 1, fontSize: 9.5, color: C.navy, fontFace: "Calibri" } }));
    s.addText(items, { x: x + 0.1, y: y + 0.44, w: 2.9, h: 1.58, valign: "top", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 14 — THANK YOU / SUMMARY
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };

  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.08, fill: { color: C.teal }, line: { color: C.teal } });

  s.addText("Thank You!", {
    x: 0.5, y: 0.55, w: 9, h: 1.1,
    fontSize: 52, bold: true, color: C.gold, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  s.addShape(pres.ShapeType.rect, { x: 2, y: 1.72, w: 6, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });

  // Summary recall grid
  const items = [
    ["Location", "Floor of oral cavity; muscular organ"],
    ["Parts", "Root, Tip, Body (oral ⅔ + pharyngeal ⅓)"],
    ["Papillae", "Filiform, Fungiform, Circumvallate, Foliate"],
    ["Intrinsic Mm.", "Sup/Inf Longitudinal, Transverse, Vertical"],
    ["Extrinsic Mm.", "Genioglossus, Hyoglossus, Styloglossus, Palatoglossus"],
    ["Artery", "Lingual A. (branch of External Carotid)"],
    ["Motor nerve", "CN XII Hypoglossal (except Palatoglossus → CN X)"],
    ["Taste Ant ⅔", "Chorda tympani (VII) via Lingual N."],
    ["Taste Post ⅓", "Glossopharyngeal (CN IX)"],
  ];

  items.forEach(([key, val], i) => {
    const col = i % 2 === 0 ? 0 : 1;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.4 : 5.2;
    const y = 1.88 + row * 0.62;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.6, h: 0.55, fill: { color: "0E2A4A" }, line: { color: C.teal, pt: 1 }, rectRadius: 0.07 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 1.45, h: 0.55, fill: { color: C.teal }, line: { color: C.teal } });
    s.addText(key, { x: x + 0.05, y, w: 1.35, h: 0.55, fontSize: 9.5, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(val, { x: x + 1.5, y, w: 3.05, h: 0.55, fontSize: 9.5, color: C.silver, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  s.addText("Presented by: Kashif Pathan  |  Anatomy & Physiology of the Tongue", {
    x: 0.5, y: 5.32, w: 9, h: 0.28,
    fontSize: 9, color: C.silver, align: "center", fontFace: "Calibri", margin: 0
  });
}

// ─── WRITE FILE ──────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/tongue-anatomy-ppt/Anatomy_Physiology_Tongue_Enhanced.pptx" })
  .then(() => console.log("DONE: /home/daytona/workspace/tongue-anatomy-ppt/Anatomy_Physiology_Tongue_Enhanced.pptx"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

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

Your enhanced presentation is ready! Here's what was built:

Anatomy Physiology Tongue Enhanced

Presentation · PPTX


What's inside the upgraded deck (14 slides)

SlideTopicWhat's new vs. original
1Title SlideBold dark navy design, topic pills row (Structure, Papillae, Muscles, etc.)
2Introduction & Overview3-column cards: Composition, Key Functions, Clinical Significance
3Parts of the TongueSchematic dorsal-view tongue diagram with color zones, labeled pointers for Root, Tip, Oral ⅔, Pharyngeal ⅓, Sulcus Terminalis, Foramen Cecum
4Oral Part (Ant. ⅔)4 cards: Dorsal surface, Inferior surface (frenulum, plica fimbriata), Lateral margin, Sulcus terminalis + embryological note
5Pharyngeal & Posterior PartsSide-by-side columns: lymphoid follicles / lingual tonsil detail; epiglottic folds and valleculae
6Papillae of the TongueMini tongue map with papilla positions marked + 4 detailed cards (type, location, taste buds, nerve)
7MusclesVisual split: 4 Intrinsic (shape) vs 4 Extrinsic (movement) with origin/action; memory-aid banner at bottom
8Blood Supply & LymphaticsTable-style cards: lingual artery branches + deep lingual vein + lymph drainage routes + cancer spread
9Nerve SupplyMotor banner + 3 sensory columns (Lingual N., Glossopharyngeal, Vagus) with lesion consequences
10Taste Physiology5 taste bubbles (Sweet/Salty/Sour/Bitter/Umami) + transduction pathway + ageusia/COVID notes
11Mastication, Deglutition, Speech6 mini cards covering all physiological roles including oral cleansing, lingual lipase, proprioception
12Papillae Comparison TableFull comparison table: type, location, taste buds, special feature, nerve supply
13Clinical Correlations6 cases: CN XII palsy, tongue carcinoma, ankyloglossia, geographic tongue, glossitis, macroglossia
14Thank You / SummaryRapid-recall grid of all key facts organized by category

Add more diagrams for detailed explanation

Writing File

~/tongue-anatomy-ppt/build_v2.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anatomy and Physiology of the Tongue – Enhanced with Diagrams";

// ─── PALETTE ─────────────────────────────────────────────────────
const C = {
  navy:    "0B1F3A",
  teal:    "0E7C86",
  rose:    "C0392B",
  amber:   "E67E22",
  cream:   "FDF6EC",
  white:   "FFFFFF",
  silver:  "D6E4F0",
  midgrey: "5A6A7A",
  gold:    "F0C040",
  pink:    "FFB3A7",
  ltblue:  "D6EAF8",
  ltgreen: "D5F5E3",
  ltyell:  "FEF9E7",
  ltteal:  "D1F2EB",
  purple:  "8E44AD",
  green:   "1E8449",
};

// ─── HELPERS ──────────────────────────────────────────────────────
function hdr(s, title, sub) {
  s.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:1.05, fill:{color:C.navy}, line:{color:C.navy} });
  s.addShape(pres.ShapeType.rect, { x:0,y:1.0,w:10,h:0.06, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText(title, { x:0.35,y:0.08,w:9.3,h:0.62, fontSize:23, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
  if(sub) s.addText(sub, { x:0.35,y:0.68,w:9.3,h:0.3, fontSize:11, color:C.gold, fontFace:"Calibri", valign:"middle", margin:0 });
}
function ftr(s, t) {
  s.addShape(pres.ShapeType.rect, { x:0,y:5.45,w:10,h:0.18, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText(t||"Anatomy & Physiology of Tongue  |  Kashif Pathan", { x:0.3,y:5.45,w:9.4,h:0.18, fontSize:8, color:C.silver, fontFace:"Calibri", valign:"middle", margin:0 });
}
function card(s,x,y,w,h,hdrTxt,bullets,hdrCol) {
  s.addShape(pres.ShapeType.rect, { x,y,w,h, fill:{color:C.cream}, line:{color:hdrCol||C.teal,pt:1.5}, shadow:{type:"outer",blur:4,offset:2,angle:45,color:"AAAAAA",opacity:0.3} });
  s.addShape(pres.ShapeType.rect, { x,y,w,h:0.34, fill:{color:hdrCol||C.teal}, line:{color:hdrCol||C.teal} });
  s.addText(hdrTxt, { x:x+0.07,y:y+0.02,w:w-0.14,h:0.3, fontSize:10.5, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
  const items = bullets.map((b,i)=>({ text:b, options:{bullet:{code:"2022"}, breakLine:i<bullets.length-1, fontSize:10, color:C.navy, fontFace:"Calibri"} }));
  s.addText(items, { x:x+0.1,y:y+0.37,w:w-0.2,h:h-0.42, valign:"top", margin:0 });
}
function label(s,text,x,y,w,h,col,sz,bold) {
  s.addText(text, { x,y,w,h, fontSize:sz||9, bold:bold||false, color:col||C.navy, fontFace:"Calibri", valign:"middle", align:"center", margin:0 });
}
function arrow(s,x1,y1,x2,y2,col) {
  s.addShape(pres.ShapeType.line,{
    x:Math.min(x1,x2), y:Math.min(y1,y2),
    w:Math.abs(x2-x1)||0.01, h:Math.abs(y2-y1)||0.01,
    line:{color:col||C.midgrey,pt:1.5}, flipH:x1>x2, flipV:y1>y2
  });
}
function dot(s,cx,cy,r,fill,stroke) {
  s.addShape(pres.ShapeType.ellipse,{x:cx-r,y:cy-r,w:r*2,h:r*2, fill:{color:fill||C.teal}, line:{color:stroke||C.white,pt:1.5}});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.ShapeType.rect,{x:0,y:4.2,w:10,h:1.4,fill:{color:C.teal},line:{color:C.teal}});
  s.addShape(pres.ShapeType.rect,{x:0,y:4.1,w:10,h:0.12,fill:{color:C.gold},line:{color:C.gold}});
  s.addText("Anatomy & Physiology",{x:0.6,y:0.65,w:8.8,h:1.0,fontSize:42,bold:true,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",charSpacing:2,margin:0});
  s.addText("of the Tongue",{x:0.6,y:1.6,w:8.8,h:0.85,fontSize:36,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
  s.addShape(pres.ShapeType.rect,{x:3.5,y:2.55,w:3,h:0.04,fill:{color:C.silver},line:{color:C.silver}});
  s.addText("A comprehensive illustrated overview for medical students",{x:0.6,y:2.68,w:8.8,h:0.45,fontSize:14,italic:true,color:C.silver,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Presented by: Kashif Pathan",{x:0.6,y:4.22,w:8.8,h:0.45,fontSize:16,bold:true,color:C.white,fontFace:"Calibri",align:"center",margin:0});
  ["Structure","Parts","Papillae","Muscles","Nerve Supply","Physiology"].forEach((t,i)=>{
    const x=0.55+i*1.55;
    s.addShape(pres.ShapeType.roundRect,{x,y:4.82,w:1.4,h:0.52,fill:{color:C.navy},line:{color:C.gold,pt:1.5},rectRadius:0.1});
    s.addText(t,{x,y:4.82,w:1.4,h:0.52,fontSize:10,bold:true,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
  });
  ftr(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW (with mind-map style diagram)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Introduction to the Tongue","Overview of structure, composition and key functions");
  ftr(s);

  // Central node
  s.addShape(pres.ShapeType.ellipse,{x:3.8,y:1.9,w:2.4,h:1.1,fill:{color:C.navy},line:{color:C.gold,pt:2.5}});
  s.addText("TONGUE",{x:3.8,y:1.9,w:2.4,h:1.1,fontSize:18,bold:true,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // 6 radial branches
  const nodes=[
    {t:"Skeletal\nMuscle",x:0.3,y:1.35,col:C.teal},
    {t:"Mucous\nMembrane",x:0.3,y:2.75,col:C.teal},
    {t:"Taste\nBuds",x:1.9,y:0.8,col:C.rose},
    {t:"Papillae",x:6.5,y:0.8,col:C.rose},
    {t:"Nerve\nSupply",x:7.9,y:1.35,col:C.amber},
    {t:"Blood\nSupply",x:7.9,y:2.75,col:C.amber},
    {t:"Speech /\nSwallowing",x:6.5,y:3.8,col:C.purple},
    {t:"Clinical\nApplied",x:1.9,y:3.8,col:C.purple},
  ];
  const cx=5.0, cy=2.45;
  nodes.forEach(n=>{
    const bx=n.x, by=n.y;
    const bcx=bx+0.8, bcy=by+0.4;
    arrow(s,cx,cy,bcx,bcy,n.col);
    s.addShape(pres.ShapeType.roundRect,{x:bx,y:by,w:1.6,h:0.8,fill:{color:n.col},line:{color:C.white,pt:1.5},rectRadius:0.12});
    s.addText(n.t,{x:bx,y:by,w:1.6,h:0.8,fontSize:9.5,bold:true,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
  });

  // Quick facts banner
  s.addShape(pres.ShapeType.rect,{x:0.2,y:4.85,w:9.6,h:0.52,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("Key Facts:  Voluntary skeletal muscle  |  Floor of oral cavity  |  Covered by mucous membrane  |  ~10,000 taste buds  |  16 muscles total  |  Rich 5-nerve supply",{
    x:0.35,y:4.85,w:9.3,h:0.52, fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 3 — PARTS OF TONGUE (dorsal + lateral schematic)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Parts of the Tongue — Dorsal & Lateral Views","Root, Tip, Body (Oral ⅔ + Pharyngeal ⅓ + Posterior-most)");
  ftr(s);

  // ── DORSAL VIEW (left) ──────────────────────────────────────────
  s.addText("DORSAL VIEW",{x:0.2,y:1.12,w:4.6,h:0.28,fontSize:10,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});

  // tongue body – tapers posteriorly
  s.addShape(pres.ShapeType.ellipse,{x:0.55,y:1.42,w:3.4,h:3.9,fill:{color:C.pink},line:{color:C.rose,pt:2}});
  // pharyngeal zone overlay
  s.addShape(pres.ShapeType.ellipse,{x:0.65,y:3.55,w:3.2,h:1.6,fill:{color:"FFD6CC",transparency:15},line:{color:C.rose,pt:1.5}});
  // posterior-most zone
  s.addShape(pres.ShapeType.ellipse,{x:0.8,y:4.68,w:2.9,h:0.72,fill:{color:"FADBD8",transparency:10},line:{color:C.rose,pt:1}});

  // Median sulcus (dashed vertical centre line)
  const tx=2.25;
  for(let y=1.5;y<5.0;y+=0.18){
    s.addShape(pres.ShapeType.rect,{x:tx-0.01,y,w:0.03,h:0.1,fill:{color:C.navy},line:{color:C.navy}});
  }

  // Sulcus terminalis V arms
  s.addShape(pres.ShapeType.line,{x:1.1,y:3.55,w:1.15,h:0.52,line:{color:C.navy,pt:2,dashType:"dash"}});
  s.addShape(pres.ShapeType.line,{x:2.25,y:3.55,w:1.15,h:0.52,line:{color:C.navy,pt:2,dashType:"dash"},flipH:true});
  // Foramen cecum
  dot(s,2.25,4.1,0.1,C.rose,C.navy);

  // Circumvallate papillae dots
  [[1.2,3.58],[1.5,3.42],[1.85,3.36],[2.25,3.34],[2.62,3.36],[2.97,3.42],[3.27,3.58]].forEach(([cx,cy])=>{
    s.addShape(pres.ShapeType.ellipse,{x:cx-0.1,y:cy-0.1,w:0.2,h:0.2,fill:{color:C.rose},line:{color:C.navy,pt:1}});
  });
  // Fungiform dots
  [[1.4,1.7],[2.0,1.65],[2.7,1.7],[1.2,2.1],[2.25,2.05],[3.1,2.1],[1.5,2.5],[2.6,2.52],[1.85,2.9],[2.75,2.85]].forEach(([cx,cy])=>{
    dot(s,cx,cy,0.07,C.amber,C.amber);
  });

  // labels left side
  const lbl=[
    ["TIP / APEX",0.2,1.48],
    ["Median Sulcus",0.2,1.95],
    ["ORAL PART\n(Ant. ⅔)",0.2,2.5],
    ["Sulcus\nTerminalis",0.2,3.42],
    ["Foramen Cecum",0.2,4.05],
    ["PHARYNGEAL\n(Post. ⅓)",0.2,4.45],
  ];
  lbl.forEach(([t,lx,ly])=>{
    s.addText(t,{x:lx,y:ly,w:0.9,h:0.5,fontSize:7.5,bold:true,color:C.navy,fontFace:"Calibri",align:"right",valign:"middle",margin:0});
    arrow(s,lx+0.88,ly+0.25,tx-0.04,ly+0.25,C.midgrey);
  });

  // ── LATERAL SCHEMATIC (right) ────────────────────────────────────
  s.addText("LATERAL CROSS-SECTION",{x:4.9,y:1.12,w:4.9,h:0.28,fontSize:10,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});

  // Mandible arc (bottom jaw)
  s.addShape(pres.ShapeType.arc,{x:4.9,y:3.2,w:4.8,h:2.4,fill:{color:"E8DAEF"},line:{color:C.purple,pt:2}});
  // floor of mouth
  s.addShape(pres.ShapeType.rect,{x:4.9,y:3.55,w:4.8,h:0.3,fill:{color:"D6EAF8"},line:{color:C.teal,pt:1}});
  // tongue body (side silhouette)
  s.addShape(pres.ShapeType.ellipse,{x:5.3,y:1.48,w:4.0,h:2.9,fill:{color:C.pink},line:{color:C.rose,pt:2}});

  // palate above
  s.addShape(pres.ShapeType.rect,{x:4.9,y:1.12,w:4.8,h:0.35,fill:{color:"FAD7A0"},line:{color:C.amber,pt:1}});
  s.addText("Hard & Soft Palate",{x:4.95,y:1.12,w:4.7,h:0.35,fontSize:8.5,bold:true,color:C.amber,fontFace:"Calibri",valign:"middle",margin:0});

  // epiglottis
  s.addShape(pres.ShapeType.ellipse,{x:8.8,y:2.5,w:0.5,h:1.1,fill:{color:"A9DFBF"},line:{color:C.green,pt:2}});
  s.addText("Epiglottis",{x:8.65,y:1.88,w:1.1,h:0.45,fontSize:7.5,bold:true,color:C.green,fontFace:"Calibri",align:"center",margin:0});
  arrow(s,9.15,2.3,9.05,2.5,C.green);

  // Labels on lateral diagram
  const latLbl=[
    ["Tip",5.25,1.6],
    ["Body (oral ⅔)",6.05,1.45],
    ["Base / Pharyngeal ⅓",7.35,2.9],
    ["Genioglossus M.",5.9,3.1],
    ["Hyoid bone",6.8,4.0],
    ["Floor of Mouth",5.0,3.65],
    ["Mandible",5.1,4.55],
  ];
  latLbl.forEach(([t,lx,ly])=>{
    s.addText(t,{x:lx,y:ly,w:1.9,h:0.38,fontSize:8,bold:false,color:C.navy,fontFace:"Calibri",valign:"middle",margin:0,
      fill:{color:"FFFFFFCC"},background:{color:"FFFFFF",transparency:40}});
  });

  // Legend
  s.addShape(pres.ShapeType.rect,{x:4.92,y:4.8,w:4.75,h:0.55,fill:{color:C.navy},line:{color:C.gold}});
  s.addText([
    {text:"● Circumvallate  ",options:{color:C.rose,bold:true,fontSize:8.5}},
    {text:"● Fungiform  ",options:{color:C.amber,bold:true,fontSize:8.5}},
    {text:"--- Sulcus Terminalis  ",options:{color:C.navy,fontSize:8.5}},
    {text:"■ Pharyngeal zone",options:{color:"FFD6CC",bold:true,fontSize:8.5}},
  ],{x:5.0,y:4.8,w:4.6,h:0.55,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 4 — PAPILLAE CROSS-SECTION DIAGRAMS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Papillae — Cross-Section Diagrams","Filiform, Fungiform, Circumvallate, Foliate — structure at microscopic level");
  ftr(s);

  // Helper to draw a labeled papilla cross-section
  function filiform(ox, oy) {
    // epithelial base
    s.addShape(pres.ShapeType.rect,{x:ox,y:oy+1.0,w:1.6,h:0.28,fill:{color:"FFE5CC"},line:{color:C.amber,pt:1}});
    // filiform projections (3 spikes)
    for(let i=0;i<5;i++){
      const bx=ox+0.15+i*0.28;
      s.addShape(pres.ShapeType.triangle,{x:bx,y:oy+0.45,w:0.22,h:0.56,fill:{color:"FADADD"},line:{color:C.rose,pt:1}});
    }
    s.addText("Filiform",{x:ox,y:oy+1.3,w:1.6,h:0.3,fontSize:9.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
    s.addText("No taste buds\nFriction only",{x:ox,y:oy+1.62,w:1.6,h:0.42,fontSize:8,color:C.midgrey,fontFace:"Calibri",align:"center",margin:0});
    s.addShape(pres.ShapeType.rect,{x:ox,y:oy+0.38,w:1.6,h:0.08,fill:{color:C.midgrey},line:{color:C.midgrey}}); // base line
  }

  function fungiform(ox, oy) {
    // base
    s.addShape(pres.ShapeType.rect,{x:ox+0.2,y:oy+0.95,w:1.1,h:0.28,fill:{color:"FFE5CC"},line:{color:C.amber,pt:1}});
    // stalk
    s.addShape(pres.ShapeType.rect,{x:ox+0.58,y:oy+0.55,w:0.35,h:0.42,fill:{color:C.pink},line:{color:C.rose,pt:1}});
    // head (mushroom cap)
    s.addShape(pres.ShapeType.ellipse,{x:ox+0.2,y:oy+0.2,w:1.1,h:0.5,fill:{color:C.rose},line:{color:C.navy,pt:1}});
    // taste buds inside cap
    for(let i=0;i<3;i++){
      s.addShape(pres.ShapeType.ellipse,{x:ox+0.32+i*0.3,y:oy+0.25,w:0.22,h:0.32,fill:{color:C.gold},line:{color:C.amber,pt:0.5}});
    }
    s.addText("Taste Buds",{x:ox+0.05,y:oy+0.06,w:1.4,h:0.2,fontSize:7,color:C.amber,bold:true,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Fungiform",{x:ox,y:oy+1.25,w:1.5,h:0.28,fontSize:9.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Taste buds ✓\nTip & sides",{x:ox,y:oy+1.55,w:1.5,h:0.42,fontSize:8,color:C.midgrey,fontFace:"Calibri",align:"center",margin:0});
  }

  function circumvallate(ox, oy) {
    // Moat / trench
    s.addShape(pres.ShapeType.rect,{x:ox,y:oy+0.22,w:0.28,h:0.86,fill:{color:"D6EAF8"},line:{color:C.teal,pt:1}});
    s.addShape(pres.ShapeType.rect,{x:ox+1.22,y:oy+0.22,w:0.28,h:0.86,fill:{color:"D6EAF8"},line:{color:C.teal,pt:1}});
    // central papilla body
    s.addShape(pres.ShapeType.roundRect,{x:ox+0.28,y:oy+0.1,w:0.94,h:0.98,fill:{color:C.pink},line:{color:C.rose,pt:2},rectRadius:0.12});
    // taste buds in moat walls
    for(let i=0;i<4;i++){
      s.addShape(pres.ShapeType.ellipse,{x:ox+0.03,y:oy+0.28+i*0.16,w:0.2,h:0.12,fill:{color:C.gold},line:{color:C.amber,pt:0.5}});
      s.addShape(pres.ShapeType.ellipse,{x:ox+1.27,y:oy+0.28+i*0.16,w:0.2,h:0.12,fill:{color:C.gold},line:{color:C.amber,pt:0.5}});
    }
    // von Ebner gland
    s.addShape(pres.ShapeType.ellipse,{x:ox+0.38,y:oy+1.1,w:0.74,h:0.28,fill:{color:"A9DFBF"},line:{color:C.green,pt:1}});
    s.addText("von Ebner\ngland",{x:ox+0.25,y:oy+1.1,w:1.0,h:0.3,fontSize:6.5,color:C.green,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Moat",{x:ox-0.02,y:oy+0.12,w:0.32,h:0.14,fontSize:6,color:C.teal,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Circumvallate",{x:ox-0.08,y:oy+1.42,w:1.65,h:0.28,fontSize:9.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Richest taste buds\n~100 each",{x:ox-0.08,y:oy+1.72,w:1.65,h:0.38,fontSize:8,color:C.midgrey,fontFace:"Calibri",align:"center",margin:0});
  }

  function foliate(ox, oy) {
    // 3 vertical folds
    for(let i=0;i<3;i++){
      s.addShape(pres.ShapeType.roundRect,{x:ox+0.08+i*0.46,y:oy+0.1,w:0.32,h:0.98,fill:{color:C.pink},line:{color:C.rose,pt:1},rectRadius:0.08});
      // taste buds in the crypts (between folds)
      if(i<2){
        for(let j=0;j<3;j++){
          s.addShape(pres.ShapeType.ellipse,{x:ox+0.38+i*0.46,y:oy+0.22+j*0.26,w:0.12,h:0.16,fill:{color:C.gold},line:{color:C.amber,pt:0.5}});
        }
      }
    }
    s.addShape(pres.ShapeType.rect,{x:ox,y:oy+1.08,w:1.5,h:0.22,fill:{color:"FFE5CC"},line:{color:C.amber,pt:1}});
    s.addText("Crypts with\ntaste buds",{x:ox+0.35,y:oy+0.12,w:0.8,h:0.35,fontSize:6,color:C.amber,bold:true,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Foliate",{x:ox,y:oy+1.32,w:1.5,h:0.28,fontSize:9.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
    s.addText("Lateral borders\nRudimentary adults",{x:ox,y:oy+1.6,w:1.5,h:0.38,fontSize:8,color:C.midgrey,fontFace:"Calibri",align:"center",margin:0});
  }

  // Draw all 4
  filiform(0.4, 1.8);
  fungiform(2.6, 1.8);
  circumvallate(4.8, 1.8);
  foliate(7.2, 1.8);

  // Section header
  s.addShape(pres.ShapeType.rect,{x:0.2,y:1.1,w:9.6,h:0.55,fill:{color:"EBF5FB"},line:{color:C.teal,pt:1}});
  s.addText("Cross-section diagrams (not to scale) — Yellow = Taste Buds | Pink = Epithelium | Blue = Trench/Moat | Green = von Ebner's Glands",{
    x:0.3,y:1.1,w:9.4,h:0.55, fontSize:9.5, italic:true, color:C.teal, fontFace:"Calibri", valign:"middle", margin:0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 5 — TASTE BUD STRUCTURE (microscopic diagram)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Taste Bud — Microscopic Structure & Transduction","Barrel-shaped receptor unit embedded in papillary epithelium");
  ftr(s);

  const ox=0.5, oy=1.15;

  // Surrounding epithelium walls
  s.addShape(pres.ShapeType.rect,{x:ox,y:oy,w:0.5,h:3.5,fill:{color:"FFE5CC"},line:{color:C.amber,pt:1}});
  s.addShape(pres.ShapeType.rect,{x:ox+3.3,y:oy,w:0.5,h:3.5,fill:{color:"FFE5CC"},line:{color:C.amber,pt:1}});

  // Taste bud barrel
  s.addShape(pres.ShapeType.roundRect,{x:ox+0.5,y:oy+0.25,w:2.8,h:3.0,fill:{color:"EBF5FB"},line:{color:C.teal,pt:2.5},rectRadius:0.18});

  // Taste pore
  s.addShape(pres.ShapeType.rect,{x:ox+1.4,y:oy,w:1.0,h:0.35,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("Taste Pore",{x:ox+1.0,y:oy-0.28,w:1.8,h:0.3,fontSize:9,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});
  arrow(s,ox+1.9,oy-0.04,ox+1.9,oy,C.teal);

  // Microvilli (taste hairs) – thin lines projecting up from cells
  for(let i=0;i<7;i++){
    const mx=ox+0.72+i*0.36;
    s.addShape(pres.ShapeType.line,{x:mx,y:oy+0.28,w:0.01,h:0.3,line:{color:C.navy,pt:1.5}});
  }
  s.addText("Microvilli\n(taste hairs)",{x:ox+0.6,y:oy+0.02,w:1.7,h:0.34,fontSize:7.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});

  // 3 receptor cells (tall spindle)
  const cellCols=["FFB3A7","FF8C69","FADADD"];
  for(let i=0;i<3;i++){
    s.addShape(pres.ShapeType.roundRect,{x:ox+0.62+i*0.82,y:oy+0.6,w:0.65,h:1.6,fill:{color:cellCols[i]},line:{color:C.rose,pt:1},rectRadius:0.14});
    // nucleus
    s.addShape(pres.ShapeType.ellipse,{x:ox+0.72+i*0.82,y:oy+1.4,w:0.42,h:0.4,fill:{color:C.rose},line:{color:C.navy,pt:1}});
  }
  s.addText("Type I\n(support)",{x:ox+0.56,y:oy+2.25,w:0.78,h:0.45,fontSize:7.5,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Type II\n(taste)",{x:ox+1.38,y:oy+2.25,w:0.78,h:0.45,fontSize:7.5,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Type III\n(presynaptic)",{x:ox+2.2,y:oy+2.25,w:0.82,h:0.45,fontSize:7.5,color:C.navy,fontFace:"Calibri",align:"center",margin:0});

  // Nerve fibres at base
  s.addShape(pres.ShapeType.rect,{x:ox+0.5,y:oy+3.1,w:2.8,h:0.25,fill:{color:"D5F5E3"},line:{color:C.green,pt:1}});
  for(let i=0;i<6;i++){
    s.addShape(pres.ShapeType.line,{x:ox+0.65+i*0.42,y:oy+3.22,w:0.01,h:0.32,line:{color:C.green,pt:1.5}});
  }
  s.addText("Afferent Nerve Fibres (CN VII / IX)",{x:ox+0.35,y:oy+3.45,w:3.1,h:0.3,fontSize:8,bold:true,color:C.green,fontFace:"Calibri",align:"center",margin:0});

  // Taste bud label
  s.addText("Taste Bud\n(barrel-shaped)",{x:ox+3.88,y:oy+1.2,w:1.5,h:0.55,fontSize:9,bold:true,color:C.teal,fontFace:"Calibri",margin:0});
  arrow(s,ox+4.0,oy+1.55,ox+3.32,oy+1.8,C.teal);

  // Right-side transduction pathway (flow diagram)
  const px=5.5;
  s.addText("TASTE TRANSDUCTION PATHWAY",{x:px,y:1.12,w:4.3,h:0.34,fontSize:12,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});

  const steps=[
    {t:"Tastant dissolves in saliva",col:C.teal},
    {t:"Binds to receptor on microvilli",col:C.teal},
    {t:"G-protein / ion channel activated",col:C.rose},
    {t:"Ca²⁺ influx → depolarisation",col:C.rose},
    {t:"Neurotransmitter release at synapse",col:C.amber},
    {t:"Signal travels via CN VII / IX / X",col:C.amber},
    {t:"Nucleus of Solitary Tract (NTS)",col:C.midgrey},
    {t:"Thalamus (VPM nucleus)",col:C.midgrey},
    {t:"Primary Gustatory Cortex (insula)",col:C.purple},
  ];
  steps.forEach((st,i)=>{
    const sy=1.52+i*0.44;
    s.addShape(pres.ShapeType.roundRect,{x:px,y:sy,w:4.25,h:0.38,fill:{color:st.col},line:{color:C.white,pt:0},rectRadius:0.08});
    s.addText((i+1)+".  "+st.t,{x:px+0.1,y:sy,w:4.05,h:0.38,fontSize:10,color:C.white,bold:i<2||i===8,fontFace:"Calibri",valign:"middle",margin:0});
    if(i<steps.length-1) arrow(s,px+2.12,sy+0.38,px+2.12,sy+0.44,C.midgrey);
  });

  s.addShape(pres.ShapeType.roundRect,{x:px,y:5.48,w:4.25,h:-0.0,fill:{color:C.navy},line:{color:C.gold,pt:1.5}});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 6 — 5 TASTES MAP (tongue heat-map style)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"5 Basic Tastes — Regional Distribution on Tongue","Sweet, Salty, Sour, Bitter, Umami — receptors and papillae locations");
  ftr(s);

  // LARGE tongue schematic (centre)
  const tx=3.2, ty=1.12, tw=3.6, th=4.15;
  // Base tongue shape
  s.addShape(pres.ShapeType.ellipse,{x:tx,y:ty,w:tw,h:th,fill:{color:"FDEBD0"},line:{color:C.rose,pt:2.5}});

  // Tip zone (sweet/salty)
  s.addShape(pres.ShapeType.ellipse,{x:tx+0.6,y:ty+0.05,w:2.4,h:0.95,fill:{color:"FADBD8",transparency:20},line:{color:C.rose,pt:1.5}});
  s.addText("Sweet &\nSalty",{x:tx+1.0,y:ty+0.12,w:1.6,h:0.72,fontSize:8.5,bold:true,color:C.rose,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Lateral zones (sour)
  s.addShape(pres.ShapeType.ellipse,{x:tx-0.05,y:ty+0.85,w:0.9,h:2.0,fill:{color:"D5F5E3",transparency:20},line:{color:C.green,pt:1.5}});
  s.addShape(pres.ShapeType.ellipse,{x:tx+2.75,y:ty+0.85,w:0.9,h:2.0,fill:{color:"D5F5E3",transparency:20},line:{color:C.green,pt:1.5}});
  s.addText("Sour",{x:tx-0.2,y:ty+1.5,w:1.1,h:0.4,fontSize:8.5,bold:true,color:C.green,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Sour",{x:tx+2.7,y:ty+1.5,w:1.1,h:0.4,fontSize:8.5,bold:true,color:C.green,fontFace:"Calibri",align:"center",margin:0});

  // Umami (body)
  s.addShape(pres.ShapeType.ellipse,{x:tx+0.8,y:ty+1.1,w:2.0,h:1.5,fill:{color:"EBD5FA",transparency:30},line:{color:C.purple,pt:1}});
  s.addText("Umami",{x:tx+1.0,y:ty+1.6,w:1.6,h:0.45,fontSize:9,bold:true,color:C.purple,fontFace:"Calibri",align:"center",margin:0});

  // Bitter (posterior V row)
  s.addShape(pres.ShapeType.ellipse,{x:tx+0.4,y:ty+3.0,w:2.8,h:0.9,fill:{color:"D6EAF8",transparency:15},line:{color:C.teal,pt:1.5}});
  s.addText("BITTER",{x:tx+0.9,y:ty+3.1,w:1.8,h:0.52,fontSize:10,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});

  // Circumvallate V dots
  [[tx+0.55,ty+3.18],[tx+0.95,ty+3.02],[tx+1.4,ty+2.97],[tx+1.8,ty+2.95],[tx+2.2,ty+2.97],[tx+2.65,ty+3.02],[tx+3.05,ty+3.18]].forEach(([cx,cy])=>{
    s.addShape(pres.ShapeType.ellipse,{x:cx-0.12,y:cy-0.12,w:0.24,h:0.24,fill:{color:C.teal},line:{color:C.navy,pt:1}});
  });

  // Pharyngeal label
  s.addShape(pres.ShapeType.ellipse,{x:tx+0.55,y:ty+3.5,w:2.5,h:0.6,fill:{color:"FFD6CC",transparency:20},line:{color:C.rose,pt:1}});
  s.addText("Pharyngeal (no papillae)",{x:tx+0.55,y:ty+3.5,w:2.5,h:0.6,fontSize:8,color:C.rose,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Median sulcus
  for(let y=ty+0.1;y<ty+3.8;y+=0.2){
    s.addShape(pres.ShapeType.rect,{x:tx+1.78,y,w:0.04,h:0.1,fill:{color:C.navy},line:{color:C.navy}});
  }

  // 5 taste detail cards on sides
  // Left side
  card(s,0.15,1.12,2.85,1.65,"SWEET — Tip & Sides",[
    "Receptor: T1R2 + T1R3 heterodimer (GPCR)",
    "Papillae: Fungiform (tip & anterior sides)",
    "Triggers: Sugars, artificial sweeteners, amino acids",
    "Nerve: Chorda tympani (VII)",
  ],C.rose);

  card(s,0.15,2.85,2.85,1.65,"SALTY — Tip & Sides",[
    "Receptor: ENaC (epithelial Na+ channels)",
    "Mechanism: Na+ ions flow through channels",
    "Papillae: Fungiform (anterior sides)",
    "Nerve: Chorda tympani (VII)",
  ],"5DADE2");

  card(s,0.15,4.58,2.85,0.78,"SOUR — Lateral Borders",[
    "Receptor: PKD2L1 channels (H+ ions)",
    "Papillae: Foliate (lateral edges)",
  ],C.green);

  // Right side
  card(s,7.0,1.12,2.85,1.65,"BITTER — Posterior",[
    "Receptor: T2R family (~25 subtypes)",
    "Papillae: Circumvallate (V-shaped row)",
    "Protective: triggers gag / vomiting reflex",
    "Nerve: Glossopharyngeal (CN IX)",
  ],C.teal);

  card(s,7.0,2.85,2.85,1.65,"UMAMI — Distributed",[
    "Receptor: T1R1 + T1R3 dimer",
    "Trigger: Glutamate, inosinate, guanylate",
    "Distributed across tongue body",
    "Found in meat, mushrooms, aged cheese",
  ],C.purple);

  card(s,7.0,4.58,2.85,0.78,"Saliva — Crucial Role",[
    "Tastants must dissolve in saliva first",
    "Dry mouth (xerostomia) → impaired taste",
  ],C.amber);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 7 — MUSCLE DIAGRAM (origin-action visual)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Muscles of the Tongue — Origin, Insertion & Action","4 Intrinsic (shape) + 4 Extrinsic (movement) muscles");
  ftr(s);

  // ── INTRINSIC MUSCLE DIAGRAM (left side) ───────────────────────
  s.addText("INTRINSIC MUSCLES",{x:0.2,y:1.1,w:4.5,h:0.32,fontSize:11,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});

  // tongue outline
  s.addShape(pres.ShapeType.ellipse,{x:0.4,y:1.48,w:4.1,h:2.6,fill:{color:"FDEBD0"},line:{color:C.rose,pt:2}});

  // Superior longitudinal (top arc band)
  s.addShape(pres.ShapeType.ellipse,{x:0.52,y:1.52,w:3.85,h:0.55,fill:{color:"AED6F1"},line:{color:C.teal,pt:1.5}});
  s.addText("Sup. Longitudinal",{x:0.6,y:1.55,w:3.7,h:0.48,fontSize:8.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Inferior longitudinal (bottom arc band)
  s.addShape(pres.ShapeType.ellipse,{x:0.52,y:3.52,w:3.85,h:0.52,fill:{color:"A9DFBF"},line:{color:C.green,pt:1.5}});
  s.addText("Inf. Longitudinal",{x:0.6,y:3.54,w:3.7,h:0.48,fontSize:8.5,bold:true,color:C.navy,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Transverse fibres (horizontal lines across middle)
  for(let i=0;i<5;i++){
    s.addShape(pres.ShapeType.line,{x:0.55,y:2.15+i*0.28,w:3.8,h:0.01,line:{color:C.amber,pt:2}});
  }
  s.addText("Transverse fibres",{x:2.0,y:2.18,w:1.7,h:0.26,fontSize:7.5,bold:true,color:C.amber,fontFace:"Calibri",align:"center",margin:0,
    fill:{color:"FFFFFF"}});

  // Vertical fibres (short vertical lines)
  for(let i=0;i<7;i++){
    s.addShape(pres.ShapeType.line,{x:0.85+i*0.48,y:2.15,w:0.01,h:1.28,line:{color:C.rose,pt:1.5,dashType:"dash"}});
  }
  s.addText("Vertical\nfibres",{x:3.35,y:2.38,w:0.95,h:0.48,fontSize:7.5,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});

  // Action summary below
  const intrActs=[
    {m:"Sup. Longitudinal",a:"Shortens tongue; curls tip UP",col:"AED6F1"},
    {m:"Inf. Longitudinal", a:"Shortens tongue; curls tip DOWN",col:"A9DFBF"},
    {m:"Transverse",        a:"Narrows & elongates tongue",col:"FAD7A0"},
    {m:"Vertical",          a:"Flattens & broadens tongue",col:"FADBD8"},
  ];
  intrActs.forEach((ia,i)=>{
    s.addShape(pres.ShapeType.roundRect,{x:0.2,y:4.18+i*0.0,w:4.5,h:0.0,fill:{color:ia.col},line:{color:ia.col}});
  });
  // mini table instead
  const tbl1=[
    [{text:"Muscle",options:{bold:true,color:C.white,fill:{color:C.navy}}},{text:"Action",options:{bold:true,color:C.white,fill:{color:C.navy}}}],
    ...intrActs.map(ia=>[ia.m,ia.a])
  ];
  s.addTable(tbl1,{x:0.2,y:4.2,w:4.5,h:1.15,fontSize:8.5,fontFace:"Calibri",border:{pt:0.5,color:"CCCCCC"},fill:{color:C.white}});

  // ── EXTRINSIC MUSCLE DIAGRAM (right side) ──────────────────────
  s.addText("EXTRINSIC MUSCLES",{x:5.2,y:1.1,w:4.5,h:0.32,fontSize:11,bold:true,color:C.amber,fontFace:"Calibri",align:"center",margin:0});

  // Bony structure labels (schematic)
  // Mandible
  s.addShape(pres.ShapeType.roundRect,{x:5.4,y:3.4,w:1.1,h:0.55,fill:{color:"E8DAEF"},line:{color:C.purple,pt:2},rectRadius:0.1});
  s.addText("Mandible\n(Genio-)",{x:5.4,y:3.4,w:1.1,h:0.55,fontSize:7.5,bold:true,color:C.purple,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Hyoid
  s.addShape(pres.ShapeType.roundRect,{x:6.0,y:4.55,w:1.0,h:0.45,fill:{color:"D6EAF8"},line:{color:C.teal,pt:2},rectRadius:0.1});
  s.addText("Hyoid\nBone",{x:6.0,y:4.55,w:1.0,h:0.45,fontSize:7.5,bold:true,color:C.teal,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Styloid
  s.addShape(pres.ShapeType.roundRect,{x:8.8,y:1.55,w:0.95,h:0.45,fill:{color:"FDEBD0"},line:{color:C.amber,pt:2},rectRadius:0.1});
  s.addText("Styloid\nProcess",{x:8.8,y:1.55,w:0.95,h:0.45,fontSize:7.5,bold:true,color:C.amber,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Palate
  s.addShape(pres.ShapeType.roundRect,{x:7.6,y:1.15,w:1.0,h:0.42,fill:{color:"FAD7A0"},line:{color:C.amber,pt:2},rectRadius:0.1});
  s.addText("Soft\nPalate",{x:7.6,y:1.15,w:1.0,h:0.42,fontSize:7.5,bold:true,color:C.amber,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Tongue body
  s.addShape(pres.ShapeType.ellipse,{x:5.8,y:1.72,w:3.0,h:1.85,fill:{color:C.pink},line:{color:C.rose,pt:2}});
  s.addText("TONGUE",{x:6.3,y:2.35,w:2.0,h:0.5,fontSize:13,bold:true,color:C.navy,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Arrows from bones to tongue with muscle names
  // Genioglossus: Mandible → tongue (protrudes)
  s.addShape(pres.ShapeType.line,{x:5.95,y:3.4,w:1.05,h:0.6,line:{color:C.purple,pt:2},flipV:true});
  s.addText("Genioglossus\n(protruder)",{x:5.2,y:3.6,w:1.5,h:0.5,fontSize:7.5,color:C.purple,bold:true,fontFace:"Calibri",align:"center",margin:0});

  // Hyoglossus: hyoid → tongue
  s.addShape(pres.ShapeType.line,{x:6.35,y:3.58,w:0.5,h:0.97,line:{color:C.teal,pt:2},flipV:true});
  s.addText("Hyoglossus\n(depressor)",{x:6.55,y:4.25,w:1.5,h:0.5,fontSize:7.5,color:C.teal,bold:true,fontFace:"Calibri",align:"center",margin:0});

  // Styloglossus: styloid → tongue
  s.addShape(pres.ShapeType.line,{x:8.3,y:1.9,w:1.5,h:0.7,line:{color:C.amber,pt:2},flipH:true});
  s.addText("Styloglossus\n(retractor)",{x:8.15,y:2.15,w:1.55,h:0.5,fontSize:7.5,color:C.amber,bold:true,fontFace:"Calibri",align:"center",margin:0});

  // Palatoglossus: palate → tongue
  s.addShape(pres.ShapeType.line,{x:7.85,y:1.57,w:0.65,h:0.5,line:{color:C.rose,pt:2}});
  s.addText("Palatoglossus\n(→ CN X!)",{x:7.3,y:1.62,w:1.5,h:0.5,fontSize:7.5,color:C.rose,bold:true,fontFace:"Calibri",align:"center",margin:0});

  // CN XII badge
  s.addShape(pres.ShapeType.ellipse,{x:6.7,y:2.0,w:1.0,h:0.48,fill:{color:C.navy},line:{color:C.gold,pt:2}});
  s.addText("CN XII",{x:6.7,y:2.0,w:1.0,h:0.48,fontSize:11,bold:true,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Memory tip
  s.addShape(pres.ShapeType.rect,{x:5.2,y:4.18,w:4.5,h:1.17,fill:{color:C.navy},line:{color:C.gold,pt:1.5}});
  s.addText([
    {text:"MEMORY: ",options:{bold:true,color:C.gold,fontSize:10}},
    {text:"All tongue muscles = CN XII  |  EXCEPT Palatoglossus = CN X\n",options:{color:C.white,fontSize:10}},
    {text:"Genioglossus ",options:{bold:true,color:"AED6F1",fontSize:9.5}},
    {text:"is the largest & most important — protrudes tongue\n",options:{color:C.silver,fontSize:9.5}},
    {text:"In CN XII palsy: tongue deviates TOWARDS lesion side (paralysed side)",options:{color:"FADBD8",fontSize:9.5,italic:true}},
  ],{x:5.3,y:4.2,w:4.3,h:1.12,valign:"middle",margin:0});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 8 — NERVE SUPPLY MAP (visual nerve tree)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Nerve Supply — Visual Nerve Map","Motor + Sensory (General + Special Taste) by region");
  ftr(s);

  // Tongue outline (large, centre)
  s.addShape(pres.ShapeType.ellipse,{x:3.15,y:1.12,w:3.7,h:4.2,fill:{color:"FDEBD0"},line:{color:C.rose,pt:2}});

  // Ant 2/3 zone
  s.addShape(pres.ShapeType.ellipse,{x:3.28,y:1.18,w:3.44,h:2.65,fill:{color:"D6EAF8",transparency:25},line:{color:C.teal,pt:1.5}});
  s.addText("Ant. ⅔",{x:4.0,y:2.22,w:2.0,h:0.45,fontSize:10,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});

  // Post 1/3 zone
  s.addShape(pres.ShapeType.ellipse,{x:3.32,y:3.65,w:3.36,h:1.2,fill:{color:"FADBD8",transparency:25},line:{color:C.rose,pt:1.5}});
  s.addText("Post. ⅓",{x:4.0,y:3.92,w:2.0,h:0.42,fontSize:10,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});

  // Epiglottic zone
  s.addShape(pres.ShapeType.ellipse,{x:3.5,y:4.68,w:3.0,h:0.62,fill:{color:"D5F5E3",transparency:20},line:{color:C.green,pt:1.5}});
  s.addText("Epiglottic region",{x:3.6,y:4.7,w:2.8,h:0.52,fontSize:9,bold:true,color:C.green,fontFace:"Calibri",align:"center",margin:0});

  // Sulcus terminalis V
  s.addShape(pres.ShapeType.line,{x:3.5,y:3.72,w:1.5,h:0.55,line:{color:C.navy,pt:2,dashType:"dash"}});
  s.addShape(pres.ShapeType.line,{x:5.0,y:3.72,w:1.5,h:0.55,line:{color:C.navy,pt:2,dashType:"dash"},flipH:true});

  // ── LEFT SIDE: General sensory ────────────────────────────────
  // Lingual Nerve box
  s.addShape(pres.ShapeType.roundRect,{x:0.15,y:1.28,w:2.8,h:1.8,fill:{color:"EBF5FB"},line:{color:C.teal,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:0.15,y:1.28,w:2.8,h:0.38,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("Lingual Nerve (V3)",{x:0.22,y:1.28,w:2.66,h:0.38,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
  const lingPts=["General sensation ant. ⅔","Touch, pain, temperature","Branch of Mandibular N. (V3)","Runs with Chorda Tympani"];
  lingPts.forEach((p,i)=>{ s.addText("▸ "+p,{x:0.25,y:1.7+i*0.34,w:2.6,h:0.3,fontSize:9,color:C.navy,fontFace:"Calibri",margin:0}); });
  arrow(s,2.95,2.18,3.15,2.18,C.teal);

  // Chorda Tympani box
  s.addShape(pres.ShapeType.roundRect,{x:0.15,y:3.18,w:2.8,h:1.62,fill:{color:"FEF9E7"},line:{color:C.amber,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:0.15,y:3.18,w:2.8,h:0.38,fill:{color:C.amber},line:{color:C.amber}});
  s.addText("Chorda Tympani (VII)",{x:0.22,y:3.18,w:2.66,h:0.38,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
  ["Taste ant. ⅔","Joins lingual nerve in ITF","From facial nerve (CN VII)","Ageusia if cut in ear surgery"].forEach((p,i)=>{
    s.addText("▸ "+p,{x:0.25,y:3.6+i*0.34,w:2.6,h:0.3,fontSize:9,color:C.navy,fontFace:"Calibri",margin:0});
  });
  arrow(s,2.95,3.98,3.15,2.6,C.amber);

  // ── RIGHT SIDE: CN IX and X ────────────────────────────────────
  s.addShape(pres.ShapeType.roundRect,{x:7.05,y:1.65,w:2.8,h:1.9,fill:{color:"FDEDEC"},line:{color:C.rose,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:7.05,y:1.65,w:2.8,h:0.38,fill:{color:C.rose},line:{color:C.rose}});
  s.addText("Glossopharyngeal (IX)",{x:7.12,y:1.65,w:2.66,h:0.38,fontSize:10,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
  ["Post. ⅓ general + taste","Vallate papillae taste","Gag reflex afferent arm","Bitter detection (reflex)","Glossopharyngeal neuralgia"].forEach((p,i)=>{
    s.addText("▸ "+p,{x:7.15,y:2.07+i*0.3,w:2.62,h:0.28,fontSize:9,color:C.navy,fontFace:"Calibri",margin:0});
  });
  arrow(s,7.05,3.56,6.85,4.0,C.rose);

  s.addShape(pres.ShapeType.roundRect,{x:7.05,y:3.72,w:2.8,h:1.6,fill:{color:"D5F5E3"},line:{color:C.green,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:7.05,y:3.72,w:2.8,h:0.38,fill:{color:C.green},line:{color:C.green}});
  s.addText("Superior Laryngeal (X)",{x:7.12,y:3.72,w:2.66,h:0.38,fontSize:10,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
  ["Epiglottic / posterior-most","General sensation only","Branch of Vagus (CN X)","Silent aspiration if damaged"].forEach((p,i)=>{
    s.addText("▸ "+p,{x:7.15,y:4.14+i*0.3,w:2.62,h:0.28,fontSize:9,color:C.navy,fontFace:"Calibri",margin:0});
  });
  arrow(s,7.05,4.9,6.85,4.88,C.green);

  // Motor badge
  s.addShape(pres.ShapeType.roundRect,{x:3.6,y:2.55,w:2.8,h:0.62,fill:{color:C.navy},line:{color:C.gold,pt:2},rectRadius:0.12});
  s.addText("MOTOR: CN XII (Hypoglossal)\n(Palatoglossus = CN X Pharyngeal plexus)",{x:3.65,y:2.55,w:2.7,h:0.62,fontSize:8.5,bold:true,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 9 — ARTERIAL SUPPLY DIAGRAM (vessel tree)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Arterial Supply — Lingual Artery Tree","External Carotid → Lingual Artery → 3 branches");
  ftr(s);

  // Vessel tree diagram (left side)
  // ECA trunk
  s.addShape(pres.ShapeType.rect,{x:0.3,y:0.95,w:0.55,h:4.2,fill:{color:C.rose},line:{color:C.rose}});
  s.addText("External\nCarotid A.",{x:0.15,y:2.5,w:0.85,h:0.8,fontSize:8,bold:true,color:C.rose,fontFace:"Calibri",align:"center",valign:"middle",margin:0,rotate:90});

  // Lingual artery branch off ECA
  s.addShape(pres.ShapeType.line,{x:0.85,y:2.55,w:1.1,h:0.01,line:{color:C.rose,pt:3}});
  s.addShape(pres.ShapeType.roundRect,{x:1.95,y:2.28,w:1.7,h:0.58,fill:{color:C.rose},line:{color:C.navy,pt:1.5},rectRadius:0.1});
  s.addText("Lingual Artery",{x:1.95,y:2.28,w:1.7,h:0.58,fontSize:10,bold:true,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // 3 sub-branches
  const branches=[
    {y:1.4, col:"E74C3C", name:"Dorsal Lingual\nArtery", desc:"Supplies posterior ⅓ + tonsil + epiglottis"},
    {y:2.58, col:C.rose, name:"Deep Lingual\nArtery", desc:"Main supply — runs to tip; supplies tongue body"},
    {y:3.72, col:"A93226", name:"Sublingual\nArtery", desc:"Floor of mouth + sublingual salivary gland"},
  ];
  branches.forEach(b=>{
    s.addShape(pres.ShapeType.line,{x:3.65,y:2.57,w:0.35,h:Math.abs(2.57-b.y)||0.01,line:{color:b.col,pt:2},flipV:b.y>2.57});
    s.addShape(pres.ShapeType.line,{x:4.0,y:b.y+0.22,w:0.55,h:0.01,line:{color:b.col,pt:2}});
    s.addShape(pres.ShapeType.roundRect,{x:4.55,y:b.y,w:2.0,h:0.45,fill:{color:b.col},line:{color:C.navy,pt:1},rectRadius:0.08});
    s.addText(b.name,{x:4.55,y:b.y,w:2.0,h:0.45,fontSize:9,bold:true,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
    s.addShape(pres.ShapeType.roundRect,{x:6.65,y:b.y,w:3.1,h:0.45,fill:{color:"FDEDEC"},line:{color:b.col,pt:1},rectRadius:0.08});
    s.addText(b.desc,{x:6.75,y:b.y,w:2.9,h:0.45,fontSize:9,color:C.navy,fontFace:"Calibri",valign:"middle",margin:0});
  });

  // Tongue schematic with artery zones
  s.addText("ARTERIAL ZONES",{x:0.2,y:4.38,w:3.4,h:0.3,fontSize:10,bold:true,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
  // small tongue
  s.addShape(pres.ShapeType.ellipse,{x:0.3,y:4.7,w:3.0,h:0.65,fill:{color:C.pink},line:{color:C.rose,pt:1.5}});
  // zones
  s.addShape(pres.ShapeType.ellipse,{x:0.35,y:4.72,w:0.65,h:0.6,fill:{color:"FADBD8"},line:{color:"E74C3C",pt:1}});
  s.addShape(pres.ShapeType.ellipse,{x:1.0,y:4.72,w:1.7,h:0.6,fill:{color:C.rose,transparency:30},line:{color:C.rose,pt:1}});
  s.addShape(pres.ShapeType.ellipse,{x:2.7,y:4.72,w:0.6,h:0.6,fill:{color:"A93226",transparency:30},line:{color:"A93226",pt:1}});
  s.addText("Post.",""+{x:0.32,y:4.75,w:0.7,h:0.55,fontSize:7,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Body",{x:0.32,y:4.75,w:0.7,h:0.55,fontSize:7,color:C.navy,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Body / Deep lingual",{x:1.0,y:4.75,w:1.7,h:0.55,fontSize:7,color:C.white,bold:true,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
  s.addText("Sub-\nlingual",{x:2.68,y:4.75,w:0.64,h:0.55,fontSize:7,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Venous / lymph summary box
  s.addShape(pres.ShapeType.roundRect,{x:0.2,y:1.18,w:4.2,h:1.05,fill:{color:"EBF5FB"},line:{color:C.teal,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:0.2,y:1.18,w:4.2,h:0.35,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("Venous Drainage + Lymphatics",{x:0.28,y:1.18,w:4.04,h:0.35,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
  s.addText("Vein: Deep lingual vein → Internal Jugular Vein\nLymph: Tip → Submental | Sides → Submandibular | Post → Deep Cervical (Jugulodigastric)\nCancer: Tongue SCC spreads first to jugulodigastric node",{
    x:0.28,y:1.55,w:4.04,h:0.65, fontSize:9, color:C.navy, fontFace:"Calibri", valign:"top", margin:0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 10 — DEGLUTITION PHASES DIAGRAM
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Deglutition (Swallowing) — 3 Phases","Tongue's role in Oral → Pharyngeal → Esophageal phases");
  ftr(s);

  // Flow arrow banner connecting 3 phases
  s.addShape(pres.ShapeType.rect,{x:0.2,y:4.65,w:9.6,h:0.08,fill:{color:C.midgrey},line:{color:C.midgrey}});
  // arrowheads
  [[3.35,4.54],[6.55,4.54]].forEach(([ax,ay])=>{
    s.addShape(pres.ShapeType.triangle,{x:ax,y:ay,w:0.3,h:0.28,fill:{color:C.midgrey},line:{color:C.midgrey}});
  });

  // PHASE 1: Oral (VOLUNTARY)
  s.addShape(pres.ShapeType.roundRect,{x:0.2,y:1.12,w:3.15,h:3.6,fill:{color:"EBF5FB"},line:{color:C.teal,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:0.2,y:1.12,w:3.15,h:0.48,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("PHASE 1 — ORAL (Voluntary)",{x:0.28,y:1.12,w:2.99,h:0.48,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});

  // mini sagittal head schematic — phase 1
  s.addShape(pres.ShapeType.ellipse,{x:0.55,y:1.7,w:2.5,h:2.0,fill:{color:"FDEBD0"},line:{color:C.amber,pt:1.5}});
  // mouth floor
  s.addShape(pres.ShapeType.rect,{x:0.68,y:3.08,w:2.24,h:0.2,fill:{color:"D5D8DC"},line:{color:C.midgrey,pt:1}});
  // tongue body
  s.addShape(pres.ShapeType.ellipse,{x:0.78,y:2.28,w:1.9,h:0.88,fill:{color:C.pink},line:{color:C.rose,pt:1.5}});
  // palate arc
  s.addShape(pres.ShapeType.arc,{x:0.58,y:1.72,w:2.44,h:0.65,fill:{color:"FAD7A0"},line:{color:C.amber,pt:1.5}});
  // food bolus arrow → posteriorly
  dot(s,1.45,2.68,0.14,"FAD7A0","F0B27A");
  s.addShape(pres.ShapeType.line,{x:1.45,y:2.68,w:0.55,h:0.01,line:{color:C.amber,pt:2}});
  s.addShape(pres.ShapeType.triangle,{x:1.98,y:2.6,w:0.18,h:0.18,fill:{color:C.amber},line:{color:C.amber}});
  s.addText("Bolus →",{x:1.45,y:2.5,w:0.8,h:0.22,fontSize:7.5,bold:true,color:C.amber,fontFace:"Calibri",align:"center",margin:0});

  s.addText([
    {text:"▸ Tongue tip rises to hard palate\n",options:{fontSize:8.5}},
    {text:"▸ Intrinsic muscles form bolus\n",options:{fontSize:8.5}},
    {text:"▸ Tongue propels bolus POSTERIORLY\n",options:{fontSize:8.5}},
    {text:"▸ Soft palate rises (closes nasopharynx)\n",options:{fontSize:8.5}},
    {text:"▸ VOLUNTARY control ends here",options:{fontSize:8.5,bold:true}},
  ],{x:0.28,y:3.33,w:2.98,h:1.35,color:C.navy,fontFace:"Calibri",valign:"top",margin:0});

  // PHASE 2: Pharyngeal (INVOLUNTARY)
  s.addShape(pres.ShapeType.roundRect,{x:3.43,y:1.12,w:3.15,h:3.6,fill:{color:"FEF9E7"},line:{color:C.amber,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:3.43,y:1.12,w:3.15,h:0.48,fill:{color:C.amber},line:{color:C.amber}});
  s.addText("PHASE 2 — PHARYNGEAL (Reflex)",{x:3.5,y:1.12,w:3.01,h:0.48,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});

  s.addShape(pres.ShapeType.ellipse,{x:3.75,y:1.7,w:2.5,h:2.0,fill:{color:"FDEBD0"},line:{color:C.amber,pt:1.5}});
  s.addShape(pres.ShapeType.rect,{x:3.88,y:3.08,w:2.24,h:0.2,fill:{color:"D5D8DC"},line:{color:C.midgrey,pt:1}});
  // tongue elevated/retracted
  s.addShape(pres.ShapeType.ellipse,{x:4.12,y:1.88,w:1.55,h:0.65,fill:{color:C.pink},line:{color:C.rose,pt:1.5}});
  // epiglottis folding
  s.addShape(pres.ShapeType.ellipse,{x:5.55,y:2.28,w:0.42,h:0.88,fill:{color:"A9DFBF"},line:{color:C.green,pt:1.5}});
  s.addText("Epiglottis\ncloses",{x:5.52,y:3.1,w:0.68,h:0.42,fontSize:6.5,color:C.green,bold:true,fontFace:"Calibri",align:"center",margin:0});
  // bolus in pharynx
  dot(s,5.1,2.62,0.18,"FAD7A0","F0B27A");

  s.addText([
    {text:"▸ Triggered by bolus touching fauces\n",options:{fontSize:8.5}},
    {text:"▸ Soft palate closes off nose\n",options:{fontSize:8.5}},
    {text:"▸ Larynx elevates + Epiglottis folds\n",options:{fontSize:8.5}},
    {text:"▸ Vocal cords adduct (airway protection)\n",options:{fontSize:8.5}},
    {text:"▸ INVOLUNTARY; ~1 second",options:{fontSize:8.5,bold:true}},
  ],{x:3.5,y:3.33,w:2.98,h:1.35,color:C.navy,fontFace:"Calibri",valign:"top",margin:0});

  // PHASE 3: Esophageal
  s.addShape(pres.ShapeType.roundRect,{x:6.65,y:1.12,w:3.15,h:3.6,fill:{color:"FDEDEC"},line:{color:C.rose,pt:2},rectRadius:0.12});
  s.addShape(pres.ShapeType.rect,{x:6.65,y:1.12,w:3.15,h:0.48,fill:{color:C.rose},line:{color:C.rose}});
  s.addText("PHASE 3 — ESOPHAGEAL",{x:6.72,y:1.12,w:3.01,h:0.48,fontSize:10.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});

  // esophageal tube
  s.addShape(pres.ShapeType.rect,{x:7.55,y:1.68,w:0.7,h:3.0,fill:{color:"FDEBD0"},line:{color:C.amber,pt:1.5}});
  // peristaltic waves
  for(let i=0;i<4;i++){
    s.addShape(pres.ShapeType.ellipse,{x:7.45,y:1.8+i*0.62,w:0.9,h:0.3,fill:{color:C.pink,transparency:30},line:{color:C.rose,pt:1}});
  }
  // bolus descending
  dot(s,7.9,2.05,0.2,"FAD7A0","F0B27A");
  s.addShape(pres.ShapeType.triangle,{x:7.8,y:2.38,w:0.2,h:0.22,fill:{color:C.rose},line:{color:C.rose}});
  s.addText("Bolus\n↓",{x:7.5,y:2.62,w:0.8,h:0.42,fontSize:8,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});
  s.addText("Peristalsis\nwaves",{x:8.3,y:2.28,w:1.2,h:0.55,fontSize:8,color:C.midgrey,fontFace:"Calibri",align:"center",margin:0});

  s.addText([
    {text:"▸ Tongue plays no further role\n",options:{fontSize:8.5}},
    {text:"▸ Peristaltic waves propel bolus\n",options:{fontSize:8.5}},
    {text:"▸ LES (lower sphincter) relaxes\n",options:{fontSize:8.5}},
    {text:"▸ Gravity + peristalsis (~10 sec)\n",options:{fontSize:8.5}},
    {text:"▸ Entirely involuntary",options:{fontSize:8.5,bold:true}},
  ],{x:6.72,y:3.33,w:3.0,h:1.35,color:C.navy,fontFace:"Calibri",valign:"top",margin:0});

  // Phase labels at bottom
  s.addText("VOLUNTARY",{x:0.2,y:4.76,w:3.15,h:0.38,fontSize:10,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});
  s.addText("INVOLUNTARY (REFLEX)",{x:3.43,y:4.76,w:3.15,h:0.38,fontSize:10,bold:true,color:C.amber,fontFace:"Calibri",align:"center",margin:0});
  s.addText("INVOLUNTARY",{x:6.65,y:4.76,w:3.15,h:0.38,fontSize:10,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 11 — SPEECH ARTICULATION DIAGRAM
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Tongue in Speech & Articulation","How tongue position creates different sounds — place of articulation");
  ftr(s);

  // Sagittal head outline
  s.addShape(pres.ShapeType.ellipse,{x:0.3,y:1.12,w:4.2,h:4.2,fill:{color:"FDEBD0"},line:{color:C.amber,pt:2}});
  // Oral cavity highlight
  s.addShape(pres.ShapeType.arc,{x:0.85,y:2.2,w:3.1,h:1.4,fill:{color:"D6EAF8"},line:{color:C.teal,pt:1}});
  // palate / roof
  s.addShape(pres.ShapeType.rect,{x:0.9,y:1.38,w:3.1,h:0.28,fill:{color:"FAD7A0"},line:{color:C.amber,pt:1}});
  // Hard palate label
  s.addText("Hard Palate",{x:1.0,y:1.1,w:1.8,h:0.3,fontSize:8,bold:true,color:C.amber,fontFace:"Calibri",margin:0});
  // Soft palate
  s.addShape(pres.ShapeType.ellipse,{x:3.5,y:1.36,w:0.7,h:0.45,fill:{color:"FLADBD8"},line:{color:C.rose,pt:1}});
  s.addText("Soft\nPalate",{x:3.4,y:1.12,w:0.9,h:0.42,fontSize:7.5,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});

  // tongue in neutral
  s.addShape(pres.ShapeType.ellipse,{x:1.0,y:2.48,w:2.8,h:1.1,fill:{color:C.pink},line:{color:C.rose,pt:2}});
  s.addText("TONGUE",{x:1.5,y:2.7,w:1.8,h:0.5,fontSize:12,bold:true,color:C.navy,fontFace:"Calibri",align:"center",valign:"middle",margin:0});

  // Alveolar ridge dot
  dot(s,1.5,1.68,0.1,C.teal,"FFFFFF");
  s.addText("Alveolar\nRidge",{x:0.28,y:1.38,w:1.15,h:0.42,fontSize:7.5,bold:true,color:C.teal,fontFace:"Calibri",align:"center",margin:0});
  arrow(s,1.0,1.58,1.4,1.68,C.teal);

  // Teeth
  s.addShape(pres.ShapeType.rect,{x:0.88,y:2.3,w:0.28,h:0.32,fill:{color:C.white},line:{color:C.midgrey,pt:1}});
  s.addShape(pres.ShapeType.rect,{x:1.18,y:2.3,w:0.28,h:0.32,fill:{color:C.white},line:{color:C.midgrey,pt:1}});
  s.addText("Teeth",{x:0.35,y:2.28,w:0.6,h:0.3,fontSize:7.5,color:C.midgrey,fontFace:"Calibri",align:"right",margin:0});

  // Pharynx / throat
  s.addShape(pres.ShapeType.rect,{x:3.55,y:2.6,w:0.6,h:2.5,fill:{color:"E8DAEF"},line:{color:C.purple,pt:1.5}});
  s.addText("Pharynx",{x:3.45,y:4.0,w:0.8,h:0.4,fontSize:7.5,color:C.purple,fontFace:"Calibri",align:"center",margin:0});

  // 6 sound boxes
  const sounds=[
    {name:"DENTAL\nT, D, N, L",col:C.teal,desc:"Tongue tip touches\nupper teeth / alveolar ridge",x:4.75,y:1.12},
    {name:"ALVEOLAR\nS, Z, R",col:C.green,desc:"Tongue tip raised\ntoward alveolar ridge",x:7.3,y:1.12},
    {name:"PALATAL\nSH, CH, J",col:C.amber,desc:"Tongue body raised\ntoward hard palate",x:4.75,y:2.35},
    {name:"VELAR\nK, G, NG",col:C.rose,desc:"Tongue back raised\ntoward soft palate",x:7.3,y:2.35},
    {name:"LABIO-\nDENTAL F, V",col:C.purple,desc:"Lower lip + upper\nteeth (tongue assists)",x:4.75,y:3.58},
    {name:"BILABIAL\nP, B, M",col:C.midgrey,desc:"Lips together,\ntongue is passive",x:7.3,y:3.58},
  ];
  sounds.forEach(snd=>{
    s.addShape(pres.ShapeType.roundRect,{x:snd.x,y:snd.y,w:2.35,h:1.12,fill:{color:snd.col},line:{color:C.white,pt:1.5},rectRadius:0.14});
    s.addText(snd.name,{x:snd.x+0.08,y:snd.y+0.05,w:2.19,h:0.55,fontSize:11,bold:true,color:C.white,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
    s.addText(snd.desc,{x:snd.x+0.08,y:snd.y+0.58,w:2.19,h:0.5,fontSize:8.5,color:C.white,fontFace:"Calibri",align:"center",valign:"top",margin:0});
  });

  s.addShape(pres.ShapeType.rect,{x:4.75,y:4.82,w:5.0,h:0.55,fill:{color:C.navy},line:{color:C.gold,pt:1.5}});
  s.addText("Dysarthria (slurred speech) results from tongue muscle weakness (e.g. CN XII palsy, ALS, stroke)",{
    x:4.85,y:4.82,w:4.8,h:0.55, fontSize:9.5, color:C.gold, fontFace:"Calibri", valign:"middle", margin:0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 12 — CLINICAL CORRELATIONS (visual icons + details)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Clinical Correlations","Tongue pathology, nerve palsies and applied anatomy");
  ftr(s);

  const cases=[
    {title:"Hypoglossal Palsy\n(CN XII)",col:C.rose,x:0.2,y:1.12,pts:["Tongue deviates TOWARDS lesion","Ipsilateral wasting + fasciculations","Genioglossus of opposite side is unopposed","Causes: ALS, skull base tumor, trauma"]},
    {title:"Tongue Carcinoma\n(SCC)",col:C.navy,x:3.38,y:1.12,pts:["Most common: lateral border (middle ⅓)","Spreads to jugulodigastric nodes FIRST","Tip lesions → bilateral node spread","Risk: Tobacco, alcohol, HPV-16"]},
    {title:"Ankyloglossia\n(Tongue-tie)",col:C.teal,x:6.55,y:1.12,pts:["Short / tight frenulum linguae","Restricts tongue protrusion","Speech + feeding difficulties","Tx: Frenotomy (surgical)"]},
    {title:"Geographic Tongue\n(Benign Migr. Glossitis)",col:C.amber,x:0.2,y:3.42,pts:["Irregular smooth red patches on dorsum","Depapillated areas with white borders","Pattern migrates over days","Benign — no treatment needed"]},
    {title:"Atrophic Glossitis\n(Bald Tongue)",col:C.midgrey,x:3.38,y:3.42,pts:["Smooth, beefy-red / pale tongue","Loss of all papillae","Causes: B12, Folate, Iron deficiency","Also: Plummer-Vinson syndrome"]},
    {title:"Macroglossia",col:C.purple,x:6.55,y:3.42,pts:["Enlarged tongue","True: Amyloidosis, Acromegaly","Relative: Down syndrome, Cretinism","Risk of obstructive sleep apnea"]},
  ];
  cases.forEach(c=>{
    s.addShape(pres.ShapeType.roundRect,{x:c.x,y:c.y,w:3.0,h:2.18,fill:{color:C.white},line:{color:c.col,pt:2},rectRadius:0.14});
    s.addShape(pres.ShapeType.rect,{x:c.x,y:c.y,w:3.0,h:0.46,fill:{color:c.col},line:{color:c.col}});
    s.addText(c.title,{x:c.x+0.08,y:c.y+0.02,w:2.84,h:0.42,fontSize:10,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
    const items=c.pts.map((p,i)=>({text:p,options:{bullet:{code:"2022"},breakLine:i<c.pts.length-1,fontSize:9.5,color:C.navy,fontFace:"Calibri"}}));
    s.addText(items,{x:c.x+0.1,y:c.y+0.5,w:2.8,h:1.62,valign:"top",margin:0});
  });

  // CN XII palsy diagram
  s.addShape(pres.ShapeType.ellipse,{x:0.25,y:1.65,w:2.88,h:1.4,fill:{color:C.pink,transparency:60},line:{color:C.rose,pt:0.5}});
  // deviation arrow
  s.addShape(pres.ShapeType.line,{x:1.68,y:2.1,w:0.55,h:0.01,line:{color:C.rose,pt:2.5}});
  s.addShape(pres.ShapeType.triangle,{x:0.9,y:2.02,w:0.2,h:0.2,fill:{color:C.rose},line:{color:C.rose}});
  s.addText("← deviation",{x:0.85,y:2.22,w:1.1,h:0.26,fontSize:7.5,bold:true,color:C.rose,fontFace:"Calibri",align:"center",margin:0});
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 13 — SUMMARY TABLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.cream };
  hdr(s,"Papillae Comparison — Full Reference Table","Type, Location, Taste Buds, Nerve, Special Features");
  ftr(s);

  const rows=[
    ["Papilla","Location","Taste Buds","Nerve","Special Feature"],
    ["Filiform","Entire dorsal surface","NONE","Trigeminal (touch)","Most numerous; rough friction; no taste"],
    ["Fungiform","Tip & lateral sides","~5 per papilla\n(200–400 total)","Chorda tympani\n(CN VII)","Mushroom-shaped; reddish dots"],
    ["Circumvallate","V-row, sulcus terminalis","~100 per papilla\n(8-12 papillae)","Glossopharyngeal\n(CN IX)","Moat + von Ebner glands; detect BITTER"],
    ["Foliate","Posterior lateral margin","Yes (in children)\nRudimentary adults","Chorda tympani (VII)\n+ CN IX","4-5 vertical folds; may mimic ulcer"],
  ];
  const colW=[1.65,1.9,1.75,1.85,2.6];
  const colX=[0.2,1.85,3.75,5.5,7.35];
  const rowH=[0.42,0.88,0.88,0.88,0.88];
  const rowFill=[C.navy,"FDFEFE","EBF5FB","FDEDEC","FEF9E7"];
  let cumY=1.12;
  rows.forEach((row,ri)=>{
    row.forEach((cell,ci)=>{
      s.addShape(pres.ShapeType.rect,{x:colX[ci],y:cumY,w:colW[ci],h:rowH[ri],fill:{color:rowFill[ri]},line:{color:"D5D8DC",pt:0.5}});
      s.addText(cell,{x:colX[ci]+0.06,y:cumY+0.04,w:colW[ci]-0.12,h:rowH[ri]-0.08,
        fontSize:ri===0?10:9, bold:ri===0||ci===0, color:ri===0?C.white:C.navy,
        fontFace:"Calibri",valign:"middle",margin:0,wrap:true});
    });
    cumY+=rowH[ri];
  });

  s.addShape(pres.ShapeType.roundRect,{x:0.2,y:5.02,w:9.6,h:0.42,fill:{color:C.teal},line:{color:C.teal},rectRadius:0.08});
  s.addText("Clinical Pearl: Enlarged foliate papillae are often mistaken for lateral tongue ulcers or SCC. Circumvallate papillae trigger gag reflex by detecting bitter — a protective reflex against ingested toxins.",{
    x:0.35,y:5.02,w:9.3,h:0.42, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 14 — THANK YOU / KEY POINTS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.ShapeType.rect,{x:0,y:0,w:10,h:0.08,fill:{color:C.teal},line:{color:C.teal}});
  s.addShape(pres.ShapeType.rect,{x:0,y:5.55,w:10,h:0.08,fill:{color:C.teal},line:{color:C.teal}});
  s.addText("Thank You!",{x:0.5,y:0.5,w:9,h:1.0,fontSize:50,bold:true,color:C.gold,fontFace:"Calibri",align:"center",valign:"middle",margin:0});
  s.addShape(pres.ShapeType.rect,{x:2,y:1.62,w:6,h:0.04,fill:{color:C.teal},line:{color:C.teal}});

  const items=[
    ["Location","Floor of oral cavity; voluntary skeletal muscle"],
    ["Parts","Root, Tip, Body (Oral ⅔ + Pharyngeal ⅓)"],
    ["Papillae","Filiform, Fungiform, Circumvallate, Foliate"],
    ["Intrinsic Mm.","Sup/Inf Longitudinal, Transverse, Vertical"],
    ["Extrinsic Mm.","Genioglossus, Hyoglossus, Styloglossus, Palatoglossus"],
    ["Artery","Lingual A. (2nd branch External Carotid)"],
    ["Motor Nerve","CN XII — ALL except Palatoglossus (CN X)"],
    ["Taste Ant ⅔","Chorda Tympani (VII) via Lingual N."],
    ["Taste Post ⅓","Glossopharyngeal (CN IX)"],
    ["Functions","Taste, Chewing, Swallowing, Speech, Cleansing"],
  ];
  items.forEach(([key,val],i)=>{
    const col=i%2===0?0:1;
    const row=Math.floor(i/2);
    const x=col===0?0.4:5.2;
    const y=1.78+row*0.62;
    s.addShape(pres.ShapeType.roundRect,{x,y,w:4.6,h:0.55,fill:{color:"0E2A4A"},line:{color:C.teal,pt:1},rectRadius:0.07});
    s.addShape(pres.ShapeType.rect,{x,y,w:1.45,h:0.55,fill:{color:C.teal},line:{color:C.teal}});
    s.addText(key,{x:x+0.05,y,w:1.35,h:0.55,fontSize:9.5,bold:true,color:C.white,fontFace:"Calibri",valign:"middle",margin:0});
    s.addText(val,{x:x+1.5,y,w:3.05,h:0.55,fontSize:9.5,color:C.silver,fontFace:"Calibri",valign:"middle",margin:0});
  });
  s.addText("Presented by: Kashif Pathan  |  Anatomy & Physiology of the Tongue",{
    x:0.5,y:5.35,w:9,h:0.28, fontSize:9, color:C.silver, align:"center", fontFace:"Calibri", margin:0
  });
}

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

cd /home/daytona/workspace/tongue-anatomy-ppt && node build_v2.js 2>&1

Reading File
Editing File

~/tongue-anatomy-ppt/build_v2.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/tongue-anatomy-ppt/build_v2.js'
Running Command

cd /home/daytona/workspace/tongue-anatomy-ppt && node build_v2.js 2>&1

Running Command

grep -n "FFFFFFCC\|FLADBD8" /home/daytona/workspace/tongue-anatomy-ppt/build_v2.…

Running Command

sed -i 's/"FFFFFFCC"/"FFFFFF"/g; s/"FLADBD8"/"FADBD8"/g' /home/daytona/workspace…

Editing File

~/tongue-anatomy-ppt/build_v2.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/tongue-anatomy-ppt/build_v2.js'
Editing File

~/tongue-anatomy-ppt/build_v2.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/tongue-anatomy-ppt/build_v2.js'
Running Command

node /home/daytona/workspace/tongue-anatomy-ppt/build_v2.js 2>&1

Your upgraded presentation with detailed diagrams is ready:

Anatomy Physiology Tongue v2 Diagrams

Presentation · PPTX


New Diagrams Added (14 slides)

SlideDiagram TypeWhat It Shows
2Mind-Map / Radial8-node radial map around TONGUE hub: Muscle, Membrane, Taste Buds, Papillae, Nerve, Blood, Function, Clinical
3Dual-View SchematicSide-by-side DORSAL view (colour-zoned oral/pharyngeal, fungiform dots, circumvallate V-row, median sulcus, foramen cecum) + LATERAL cross-section (tongue body, mandible, hyoid, epiglottis, floor of mouth)
44× Cross-Section DiagramsMicroscopic cut-through of each papilla type - Filiform spikes, Fungiform mushroom cap with taste buds, Circumvallate with moat + von Ebner glands, Foliate vertical folds with crypts
5Taste Bud Barrel DiagramDetailed structure: Taste pore, microvilli, Type I/II/III cells with nuclei, afferent nerve fibres at base - PLUS 9-step transduction flow chart right side
6Tongue Taste Heat-MapLarge tongue with coloured regional zones: Sweet/Salty (tip), Sour (lateral), Umami (body), Bitter (posterior V) with circumvallate dots placed on V-line
7Muscle Origin-Insertion DiagramLeft: intrinsic muscle layer schematic (coloured bands for sup/inf longitudinal, transverse fibres, vertical fibres) + Right: bony attachment diagram with Mandible, Hyoid, Styloid, Palate nodes connected by labelled arrows to tongue body
8Nerve Supply MapLarge tongue divided into nerve territory zones (teal = ant ⅔, red = post ⅓, green = epiglottic) with nerve detail boxes on each side (Lingual N., Chorda Tympani, CN IX, CN X) with pointers
9Lingual Artery TreeVessel-tree diagram: ECA trunk → Lingual A. → 3 branches (Dorsal, Deep, Sublingual) with colour-coded zones on mini tongue + Venous/Lymph summary box
103-Phase Deglutition DiagramSide-by-side sagittal head silhouettes for Phase 1 (bolus formation, voluntary), Phase 2 (epiglottis folding, reflex), Phase 3 (esophageal peristalsis) with labelled anatomical structures
11Articulation / Speech MapSagittal head diagram with palate, alveolar ridge, teeth, tongue, pharynx labelled + 6 colour-coded sound-type boxes (Dental T/D/N, Alveolar S/Z, Palatal SH/CH, Velar K/G, Labiodental, Bilabial)
12Clinical Correlation Cards6 pathology panels including CN XII palsy deviation arrow diagram on tongue
13Comparison TableFull papillae reference table with all 5 columns
14Summary Recall GridKey-value rapid review cards
This is a shared conversation. Sign in to Orris to start your own chat.