Give me a PowerPoint presentation on retroperitoneal Tumors from surgical pov in about 20 slides make them compact and addsome relevant images to it

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Searching the Web

retroperitoneal tumor surgery anatomy classification imaging CT scan medical illustration

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

mkdir -p /home/daytona/workspace/retroperitoneal-pptx && ls /home/daytona/workspace/retroperitoneal-pptx/

Writing File

~/retroperitoneal-pptx/build.js

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

// ── colour palette ──────────────────────────────────────────────────────────
const C = {
  navy:    "0D1B2A",  // dominant dark background
  teal:    "1A6B72",  // section headers / accents
  tealLt:  "2AABB5",  // bullet accent / lines
  gold:    "D4A843",  // highlight / callout
  offWht:  "F0F4F8",  // body text on dark
  white:   "FFFFFF",
  slate:   "1E2D3D",  // dark content background
  slateL:  "2C3E50",  // card backgrounds
  red:     "C0392B",
  green:   "27AE60",
  grey:    "7F8C8D",
};

// ── image URLs to prefetch ──────────────────────────────────────────────────
const IMG_URLS = [
  // retroperitoneal anatomy diagram
  "https://www.researchgate.net/publication/344317555/figure/fig1/AS:941404612218880@1601459758428/Schematic-diagram-of-retroperitoneal-anatomy-with-CT-correlation-The-anterior-pararenal.jpg",
  // liposarcoma CT
  "https://www.mdpi.com/cancers/cancers-15-02985/article_deploy/html/images/cancers-15-02985-g001.png",
  // CT/MRI imaging guide
  "https://www.mdpi.com/cancers/cancers-15-02985/article_deploy/html/images/cancers-15-02985-g008.png",
  // STS taxonomy radial diagram (from Sabiston)
  "https://cdn.orris.care/cdss_images/4d1e36ff6839679a18eac5891a5067a903add49223979e96a242a908c196196e.png",
  // CT showing dediff liposarcoma / post-RT (Sabiston fig 64.5)
  "https://cdn.orris.care/cdss_images/92bdfeaa67fa336f3366d2da3f2d9a4eaef255a4600d2cef2449eb2a0a4b1bb7.png",
  // Schwartz fig 36-9: large right dediff liposarcoma CT
  "https://cdn.orris.care/cdss_images/b0882ce14eb6ea764a29b62680f86aabbab1f4959907589f6c302fd8fdae703d.png",
];

console.log("Fetching images...");
let imgs;
try {
  const raw = execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${IMG_URLS.map(u => `"${u}"`).join(" ")}`,
    { maxBuffer: 50 * 1024 * 1024 }
  ).toString();
  imgs = JSON.parse(raw);
} catch (e) {
  console.error("Image fetch failed:", e.message);
  imgs = IMG_URLS.map(() => ({ base64: null, error: "fetch failed" }));
}

// Helper: get base64 or null
function imgData(idx) {
  if (imgs[idx] && !imgs[idx].error && imgs[idx].base64) return imgs[idx].base64;
  return null;
}

// ── pptx setup ──────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Retroperitoneal Tumors – Surgical Perspective";
pres.author = "Orris Medical Education";

// ── helper functions ─────────────────────────────────────────────────────────
function addSlide() { return pres.addSlide(); }

function darkBg(slide, accent) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color: C.navy}, line:{color: C.navy} });
  if (accent !== false) {
    slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.06, h:5.625, fill:{color: C.tealLt}, line:{color: C.tealLt} });
  }
}

function slateBg(slide) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color: C.slate}, line:{color: C.slate} });
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.06, h:5.625, fill:{color: C.gold}, line:{color: C.gold} });
}

function header(slide, text, y=0.18, color=C.tealLt) {
  slide.addText(text.toUpperCase(), {
    x:0.2, y, w:9.6, h:0.5, fontSize:11, bold:true, charSpacing:3,
    color, fontFace:"Calibri", align:"left", margin:0
  });
}

function sectionBar(slide, text, y=0.72) {
  slide.addShape(pres.ShapeType.rect, { x:0.2, y, w:9.6, h:0.05, fill:{color: C.tealLt}, line:{color: C.tealLt} });
  slide.addText(text, {
    x:0.2, y: y+0.08, w:9.6, h:0.5, fontSize:20, bold:true, color: C.white, fontFace:"Calibri", align:"left", margin:0
  });
}

function bullets(slide, items, x, y, w, h, opts={}) {
  const baseOpts = { fontSize:13, color: C.offWht, fontFace:"Calibri", ...opts };
  slide.addText(
    items.map((item, i) => ({
      text: item,
      options: { bullet:{type:"bullet", characterCode:"25CF", color: C.tealLt}, breakLine: i < items.length-1, ...baseOpts }
    })),
    { x, y, w, h, valign:"top", margin:0 }
  );
}

function card(slide, x, y, w, h, color=C.slateL) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h,
    fill:{color}, line:{color: C.tealLt, width:1}, rectRadius:0.08 });
}

function badge(slide, text, x, y, w=2.2, h=0.38, bg=C.teal) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill:{color:bg}, line:{color:bg}, rectRadius:0.1 });
  slide.addText(text, { x, y, w, h, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 1 – TITLE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  // full dark background with gradient feel via shapes
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.navy}, line:{color:C.navy} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:1.8, fill:{color:C.teal}, line:{color:C.teal} });
  s.addShape(pres.ShapeType.rect, { x:0, y:1.8, w:10, h:0.06, fill:{color:C.gold}, line:{color:C.gold} });

  s.addText("RETROPERITONEAL TUMORS", {
    x:0.4, y:0.25, w:9.2, h:0.8, fontSize:32, bold:true, charSpacing:4,
    color:C.white, fontFace:"Calibri", align:"center", margin:0
  });
  s.addText("A Surgical Perspective", {
    x:0.4, y:1.1, w:9.2, h:0.55, fontSize:18, italic:true,
    color:C.offWht, fontFace:"Calibri", align:"center", margin:0
  });

  // key stats row
  const stats = [
    ["~1,000", "New US Cases/Year"],
    ["10-15%", "of All Adult Sarcomas"],
    ["70%", ">10 cm at Diagnosis"],
    ["33-39%", "5-Year Survival"],
  ];
  stats.forEach(([val, lbl], i) => {
    const xp = 0.5 + i*2.35;
    card(s, xp, 2.1, 2.1, 1.3, C.slateL);
    s.addText(val, { x:xp, y:2.15, w:2.1, h:0.6, fontSize:22, bold:true, color:C.gold, fontFace:"Calibri", align:"center", margin:0 });
    s.addText(lbl, { x:xp, y:2.75, w:2.1, h:0.55, fontSize:10, color:C.offWht, fontFace:"Calibri", align:"center", margin:0 });
  });

  s.addText("Sources: Schwartz's Principles of Surgery (11th ed.) | Sabiston Textbook of Surgery | Bailey & Love's (28th ed.)", {
    x:0.2, y:4.8, w:9.6, h:0.4, fontSize:8, color:C.grey, fontFace:"Calibri", align:"center", margin:0
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 2 – ANATOMY OF THE RETROPERITONEUM
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Anatomy of the Retroperitoneum");
  sectionBar(s, "Anatomical Compartments", 0.72);

  const compartments = [
    ["Anterior Pararenal Space", "Between posterior parietal peritoneum & anterior renal fascia\nContains: pancreas, duodenum, ascending & descending colon"],
    ["Perirenal Space", "Between anterior & posterior layers of renal (Gerota's) fascia\nContains: kidneys, adrenals, proximal ureters, perinephric fat"],
    ["Posterior Pararenal Space", "Between posterior renal fascia & transversalis fascia\nContains: fat only (potential space for spread)"],
  ];
  compartments.forEach(([title, body], i) => {
    const yp = 1.4 + i*1.32;
    card(s, 0.2, yp, 5.5, 1.18, C.slateL);
    s.addText(title, { x:0.35, y:yp+0.05, w:5.2, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", align:"left", margin:0 });
    s.addText(body, { x:0.35, y:yp+0.42, w:5.2, h:0.68, fontSize:11, color:C.offWht, fontFace:"Calibri", align:"left", margin:0 });
  });

  // anatomy image
  const anat = imgData(0);
  if (anat) {
    s.addImage({ data: anat, x:5.85, y:1.3, w:3.9, h:3.8 });
    s.addText("Retroperitoneal anatomy with CT correlation", {
      x:5.85, y:5.1, w:3.9, h:0.35, fontSize:8, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0
    });
  }
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 3 – CLASSIFICATION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Classification of Retroperitoneal Tumors", 0.18, C.gold);
  sectionBar(s, "Tissue of Origin", 0.72);

  const groups = [
    { label:"Mesenchymal", color:C.teal, items:["Liposarcoma (most common)", "Leiomyosarcoma", "Undifferentiated Pleomorphic Sarcoma", "Fibrosarcoma, Angiosarcoma"] },
    { label:"Neurogenic", color:"5B4F8E", items:["Ganglioneuroma", "Neuroblastoma", "Paraganglioma", "Schwannoma"] },
    { label:"Germ Cell", color:"8E4F6B", items:["Teratoma", "Seminoma", "Non-seminomatous GCT"] },
    { label:"Lymphoid", color:"2E7D6B", items:["Lymphoma (Hodgkin/NHL)", "Castleman's disease"] },
    { label:"Cystic / Benign", color:"5E6B2E", items:["Bronchogenic cyst", "Lymphangioma", "Mature teratoma", "Lipoma"] },
  ];

  groups.forEach((g, i) => {
    const col = i < 3 ? 0 : 1;
    const row = i < 3 ? i : i-3;
    const xp = col === 0 ? 0.2 : 5.15;
    const yp = 1.38 + row * 1.35;
    const w = 4.75;
    card(s, xp, yp, w, 1.22, C.navy);
    badge(s, g.label, xp+0.1, yp+0.05, w-0.2, 0.32, g.color);
    s.addText(
      g.items.map((item, j) => ({ text: item, options: { bullet:{type:"bullet", characterCode:"2022", color:C.tealLt}, breakLine: j<g.items.length-1, fontSize:11, color:C.offWht, fontFace:"Calibri" } })),
      { x:xp+0.15, y:yp+0.42, w:w-0.25, h:0.72, valign:"top", margin:0 }
    );
  });

  // STS taxonomy image
  const tax = imgData(3);
  if (tax) {
    s.addImage({ data: tax, x:5.15, y:2.7, w:4.75, h:2.6 });
    s.addText("WHO STS taxonomy – Sabiston Textbook of Surgery", {
      x:5.15, y:5.28, w:4.75, h:0.28, fontSize:7.5, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0
    });
  }
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 4 – EPIDEMIOLOGY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Epidemiology");
  sectionBar(s, "Who Gets Retroperitoneal Tumors?", 0.72);

  const facts = [
    ["Incidence", "~1,000 new RPS cases per year in the USA\n1–2% of all solid malignancies; 10–15% of adult STS"],
    ["Peak Age", "Fifth decade of life (average 54 years)\nEqual male-to-female distribution"],
    ["Malignant Rate", "Most retroperitoneal masses are malignant\n~1/3 are soft tissue sarcomas"],
    ["Histology", "Liposarcoma + Leiomyosarcoma = majority\n~2/3 are high grade (Grade 2 or 3)"],
    ["Size at Presentation", "Average tumour size: 15 cm\n70% are >10 cm at diagnosis"],
    ["Metastases at Dx", "~12% present with synchronous metastases\n(predominantly pulmonary or hepatic)"],
  ];

  facts.forEach(([title, body], i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const xp = 0.2 + col*3.25;
    const yp = 1.42 + row*1.85;
    card(s, xp, yp, 3.1, 1.7, C.slateL);
    s.addText(title, { x:xp+0.12, y:yp+0.08, w:2.86, h:0.38, fontSize:12, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
    s.addText(body, { x:xp+0.12, y:yp+0.48, w:2.86, h:1.1, fontSize:11, color:C.offWht, fontFace:"Calibri", margin:0 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 5 – CLINICAL PRESENTATION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Clinical Presentation", 0.18, C.gold);
  sectionBar(s, "Signs & Symptoms", 0.72);

  // left col
  card(s, 0.2, 1.38, 4.6, 3.8, C.navy);
  s.addText("Symptoms (non-specific, late presentation)", { x:0.35, y:1.48, w:4.3, h:0.38, fontSize:12, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Abdominal pain or fullness",
    "Back or flank pain",
    "Paresthesias / lower limb weakness",
    "Early satiety, nausea, vomiting",
    "Obstructive GI / urinary symptoms",
    "Weight loss",
    "Often asymptomatic – incidental finding",
  ], 0.35, 1.9, 4.3, 3.1, { fontSize:12 });

  // right col
  card(s, 5.0, 1.38, 4.8, 1.8, C.navy);
  s.addText("Red-Flag Features Suggesting Alternative Dx", { x:5.15, y:1.48, w:4.5, h:0.38, fontSize:12, bold:true, color:C.red, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Fever + night sweats → Lymphoma",
    "Elevated LDH → Lymphoma",
    "Elevated β-hCG / AFP → Germ Cell Tumor",
    "Testicular mass (check in all men)",
  ], 5.15, 1.9, 4.5, 1.2, { fontSize:11 });

  card(s, 5.0, 3.35, 4.8, 1.88, C.navy);
  s.addText("Why Do Patients Present Late?", { x:5.15, y:3.45, w:4.5, h:0.38, fontSize:12, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  s.addText("The retroperitoneum is a large potential space – tumours can grow to enormous size before displacing viscera enough to cause symptoms. Symptoms are often non-specific and easily dismissed.", {
    x:5.15, y:3.87, w:4.5, h:1.2, fontSize:11, color:C.offWht, fontFace:"Calibri", margin:0
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 6 – DIFFERENTIAL DIAGNOSIS
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Differential Diagnosis");
  sectionBar(s, "Retroperitoneal Mass – Key Differentials", 0.72);

  const ddx = [
    { title:"Primary Retroperitoneal Sarcoma", pts:["Liposarcoma (most common)", "Leiomyosarcoma", "UPS, Fibrosarcoma"], color:C.teal },
    { title:"Lymphoma", pts:["Hodgkin / Non-Hodgkin", "Elevated LDH, B-symptoms", "Multiple nodal stations"], color:"5B4F8E" },
    { title:"Germ Cell Tumor", pts:["Primary retroperitoneal GCT", "Metastatic testicular cancer", "Elevated β-hCG / AFP"], color:"8E4F6B" },
    { title:"Secondary / Metastatic", pts:["Nodal metastases from GI, GU, GYN", "Direct invasion from adjacent organs"], color:"7D3C98" },
    { title:"Benign Retroperitoneal Masses", pts:["Lipoma, Ganglioneuroma", "Paraganglioma, Schwannoma", "Lymphangioma, Cysts"], color:C.green },
    { title:"Retroperitoneal Fibrosis", pts:["Inflammatory / idiopathic", "Associated with IgG4 disease", "Periaortic soft tissue"], color:"A04000" },
  ];

  ddx.forEach((d, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const xp = 0.2 + col*3.25;
    const yp = 1.42 + row*1.9;
    card(s, xp, yp, 3.1, 1.78, C.slateL);
    badge(s, "", xp, yp, 3.1, 0.35, d.color);
    s.addText(d.title, { x:xp+0.1, y:yp+0.03, w:2.9, h:0.3, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"left", margin:0 });
    bullets(s, d.pts, xp+0.1, yp+0.42, 2.9, 1.25, { fontSize:10.5 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 7 – INVESTIGATIONS / IMAGING
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Investigations", 0.18, C.gold);
  sectionBar(s, "Workup of a Retroperitoneal Mass", 0.72);

  // imaging column
  card(s, 0.2, 1.38, 5.5, 3.92, C.navy);
  s.addText("Imaging", { x:0.35, y:1.48, w:5.2, h:0.4, fontSize:14, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "CT Abdomen/Pelvis (contrast) – FIRST LINE\n  → Extent, relationship to vessels, staging liver/peritoneum",
    "CT Chest – evaluate for lung metastases (11% synchronous)\n  → Standard in all RPS work-up",
    "MRI – superior soft-tissue contrast; assess vascular invasion\n  → Complements CT in complex cases",
    "Angiography / MR Arteriography – if major vessel involvement suspected\n  → Plan vascular reconstruction",
    "PET-CT – limited routine role; useful for high-grade or recurrence",
  ], 0.35, 1.95, 5.1, 3.25, { fontSize:11 });

  // right panel
  card(s, 5.85, 1.38, 3.9, 1.78, C.navy);
  s.addText("Laboratory", { x:6.0, y:1.48, w:3.6, h:0.35, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, ["LDH (↑ → lymphoma)", "β-hCG, AFP (→ GCT)", "FBC, metabolic panel", "Renal function (pre-op)"], 6.0, 1.88, 3.6, 1.2, { fontSize:11.5 });

  card(s, 5.85, 3.28, 3.9, 2.02, C.navy);
  s.addText("Biopsy", { x:6.0, y:3.38, w:3.6, h:0.35, fontSize:13, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "CT-guided core needle biopsy – recommended",
    "Needle-tract seeding risk: LOW",
    "Well-diff liposarcoma: CT diagnosis alone may suffice",
    "Negative biopsy ≠ delay surgery if imaging is diagnostic",
  ], 6.0, 3.78, 3.6, 1.42, { fontSize:10.5 });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 8 – IMAGING: CT / MRI FEATURES
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Imaging Features");
  sectionBar(s, "CT & MRI Characteristics by Subtype", 0.72);

  // CT liposarcoma image
  const ctImg = imgData(1);
  if (ctImg) {
    s.addImage({ data: ctImg, x:0.2, y:1.38, w:4.5, h:3.6 });
    s.addText("Fig: Retroperitoneal liposarcoma – axial & sagittal CT (MDPI Cancers 2023)", {
      x:0.2, y:4.98, w:4.5, h:0.35, fontSize:7.5, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0
    });
  } else {
    card(s, 0.2, 1.38, 4.5, 3.6, C.slateL);
    s.addText("[CT Image: Retroperitoneal Liposarcoma]", { x:0.2, y:3.0, w:4.5, h:0.5, fontSize:12, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0 });
  }

  // Table on right
  s.addText("Imaging Characteristics", { x:4.9, y:1.38, w:4.9, h:0.4, fontSize:14, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });

  const rows = [
    ["Well-diff Liposarcoma", ">75% fat density; thick septa >2mm; non-adip areas"],
    ["Dediff Liposarcoma", "Fatty mass + non-fatty nodule; calcification possible"],
    ["Leiomyosarcoma", "IVC or renal vein origin; heterogeneous; necrosis"],
    ["GIST", "Smooth, hypervascular; arise from bowel wall"],
    ["Lymphoma", "Multiple enlarged nodes; homogeneous; LAD chains"],
    ["Paraganglioma", "Highly vascular; near aorta/IVC or adrenal"],
  ];

  const tableY = 1.88;
  s.addText("Subtype", { x:4.9, y:tableY, w:2.0, h:0.36, fontSize:11, bold:true, color:C.gold, fontFace:"Calibri", margin:4 });
  s.addText("CT/MRI Findings", { x:6.9, y:tableY, w:3.8, h:0.36, fontSize:11, bold:true, color:C.gold, fontFace:"Calibri", margin:4 });
  s.addShape(pres.ShapeType.rect, { x:4.9, y:tableY+0.38, w:9.2-4.9, h:0.03, fill:{color:C.tealLt}, line:{color:C.tealLt} });

  rows.forEach((row, i) => {
    const bg = i % 2 === 0 ? C.slateL : C.navy;
    const yRow = tableY + 0.45 + i*0.54;
    s.addShape(pres.ShapeType.rect, { x:4.9, y:yRow, w:9.2-4.9, h:0.52, fill:{color:bg}, line:{color:bg} });
    s.addText(row[0], { x:4.95, y:yRow+0.04, w:1.9, h:0.44, fontSize:10, bold:true, color:C.tealLt, fontFace:"Calibri", valign:"middle", margin:2 });
    s.addText(row[1], { x:6.88, y:yRow+0.04, w:3.7, h:0.44, fontSize:10, color:C.offWht, fontFace:"Calibri", valign:"middle", margin:2 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 9 – STAGING
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Staging", 0.18, C.gold);
  sectionBar(s, "AJCC 8th Edition – Retroperitoneum", 0.72);

  // T stage
  card(s, 0.2, 1.38, 4.7, 2.4, C.navy);
  s.addText("T – Primary Tumor Size", { x:0.35, y:1.48, w:4.4, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  const tStages = [["T1","≤5 cm"],["T2",">5 to ≤10 cm"],["T3",">10 to ≤15 cm"],["T4",">15 cm"]];
  tStages.forEach(([t, desc], i) => {
    const yp = 1.93 + i*0.43;
    badge(s, t, 0.35, yp, 0.6, 0.34, C.teal);
    s.addText(desc, { x:1.05, y:yp, w:3.6, h:0.34, fontSize:12, color:C.offWht, fontFace:"Calibri", valign:"middle", margin:0 });
  });

  // N/M/Grade
  card(s, 5.1, 1.38, 4.7, 2.4, C.navy);
  s.addText("N / M / Grade", { x:5.25, y:1.48, w:4.4, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "N0: No regional nodes  |  N1: Regional nodal involvement",
    "M0: No distant mets  |  M1: Distant metastases",
    "Grade (G1–G3) is a major prognostic determinant",
    "Nodal mets (2–10%) – angiosarcoma, RMS, UPS highest risk",
    "N1 = Stage IV (same prognosis as M1 disease)",
  ], 5.25, 1.93, 4.4, 1.78, { fontSize:11.5 });

  // Histologic prognostic groups
  card(s, 0.2, 3.92, 9.6, 1.4, C.navy);
  s.addText("Histologic Prognostic Groups (Anaya classification)", { x:0.35, y:4.0, w:9.3, h:0.38, fontSize:12, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  const hgs = [["Favourable","Well-differentiated liposarcoma\n(may be cured by resection)"],["Intermediate","Dediff / Pleomorphic liposarcoma"],["Poor","All other RPS histologic types\n(LMS, UPS, etc.)"]];
  hgs.forEach(([g, d], i) => {
    const clrs = [C.green, C.gold, C.red];
    const xp = 0.35 + i*3.15;
    badge(s, g, xp, 4.45, 1.5, 0.3, clrs[i]);
    s.addText(d, { x:xp+1.6, y:4.45, w:1.45, h:0.6, fontSize:9.5, color:C.offWht, fontFace:"Calibri", margin:0 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 10 – SURGICAL PRINCIPLES
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Surgical Management – Principles");
  sectionBar(s, "Complete Surgical Resection: Gold Standard", 0.72);

  card(s, 0.2, 1.38, 9.6, 1.18, C.slateL);
  s.addText("Goal: Complete gross resection (R0/R1) – the ONLY potentially curative treatment for RPS.\nSurgery at high-volume specialist centres improves outcomes.", {
    x:0.4, y:1.48, w:9.2, h:0.95, fontSize:13, color:C.white, fontFace:"Calibri", margin:0
  });

  const pts = [
    ["Compartmental Resection", "En bloc removal of tumour with surrounding organs; avoid tumour rupture/fragmentation"],
    ["Multivisceral Resection", "≥75% cases require resection of ≥1 adjacent organ (kidney, colon, spleen, pancreas, small bowel)"],
    ["Vascular Resection", "IVC, aorta, renal vessels may require resection/reconstruction; patency >88% at 19 months"],
    ["Margin Status", "R0 microscopically clear; R1 microscopically involved; R2 macroscopic residual → worst outcomes"],
    ["Intraoperative Decisions", "Cannot reliably predict histologic invasion intra-op; err toward en bloc resection"],
    ["Palliative Resection", "Justified for atypical lipomatous tumours; NOT for high-grade dediff LPS or other high-grade RPS"],
  ];

  pts.forEach(([title, body], i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const xp = 0.2 + col*4.9;
    const yp = 2.68 + row*0.95;
    card(s, xp, yp, 4.75, 0.88, C.slateL);
    s.addText(title, { x:xp+0.12, y:yp+0.06, w:4.5, h:0.3, fontSize:11, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
    s.addText(body, { x:xp+0.12, y:yp+0.4, w:4.5, h:0.42, fontSize:10.5, color:C.offWht, fontFace:"Calibri", margin:0 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 11 – SURGICAL TECHNIQUE & APPROACH
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Surgical Technique", 0.18, C.gold);
  sectionBar(s, "Operative Approach & Considerations", 0.72);

  const left = [
    "Midline laparotomy – standard approach for most RPS",
    "Thoracoabdominal incision for large suprarenal tumours",
    "Medial visceral rotation (Mattox/Cattel-Braasch) to expose great vessels",
    "Early vessel control – identify and secure major vascular pedicles first",
    "Avoid tumour violation/spillage (capsule breach = worse local recurrence)",
    "Intraoperative frozen sections guide margins",
    "Left RPS: often involves left kidney, descending colon, tail of pancreas",
    "Right RPS: often involves right kidney, ascending colon, duodenum",
  ];
  card(s, 0.2, 1.38, 5.5, 3.95, C.navy);
  s.addText("Operative Steps & Tips", { x:0.35, y:1.48, w:5.2, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, left, 0.35, 1.92, 5.1, 3.35, { fontSize:11.5 });

  const right = [
    ["Nephrectomy", "Most common organ sacrificed; performed prophylactically in contiguous LPS even without histologic invasion"],
    ["Colectomy", "Left/right hemicolectomy if bowel involved or at risk"],
    ["IVC Resection", "Feasible; may require reconstruction; ligation tolerated if collaterals adequate"],
    ["Pancreatic Resection", "Distal pancreatectomy for left-sided tumours; Whipple for proximal right-sided"],
  ];
  card(s, 5.9, 1.38, 3.9, 3.95, C.navy);
  s.addText("Organ Resections", { x:6.05, y:1.48, w:3.6, h:0.38, fontSize:13, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  right.forEach(([org, desc], i) => {
    const yp = 1.95 + i*0.92;
    badge(s, org, 6.05, yp, 1.4, 0.3, C.teal);
    s.addText(desc, { x:6.05, y:yp+0.35, w:3.6, h:0.5, fontSize:10.5, color:C.offWht, fontFace:"Calibri", margin:0 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 12 – LIPOSARCOMA (most common)
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Common Subtypes – Liposarcoma");
  sectionBar(s, "Most Common Retroperitoneal Sarcoma", 0.72);

  // CT image
  const ctRt = imgData(5);
  if (ctRt) {
    s.addImage({ data: ctRt, x:0.2, y:1.38, w:4.6, h:3.6 });
    s.addText("Fig: Right-sided dedifferentiated liposarcoma – CT (Schwartz Fig 36-9)", {
      x:0.2, y:4.98, w:4.6, h:0.3, fontSize:7.5, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0
    });
  } else {
    card(s, 0.2, 1.38, 4.6, 3.6, C.slateL);
    s.addText("[CT: Dediff Liposarcoma]", { x:0.2, y:3.0, w:4.6, h:0.5, fontSize:12, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0 });
  }

  const types = [
    { name:"Well-Differentiated (WDLPS)", color:C.green, pts:[
      "Low grade, rarely metastasises",
      ">75% fat; may be 'diagnosed' on CT",
      "Surgery often curative",
      "MDM2 amplification (12q13-15)",
    ]},
    { name:"Dedifferentiated (DDLPS)", color:C.red, pts:[
      "High grade; metastatic potential 15–20%",
      "Fatty mass + solid non-fatty nodule",
      "Calcification common",
      "Local recurrence dominant failure mode",
    ]},
    { name:"Myxoid / Round Cell", color:"8E44AD", pts:[
      "Intermediate–high grade",
      "t(12;16) DDIT3-FUS fusion",
      "Responds to trabectedin",
    ]},
  ];
  types.forEach((t, i) => {
    const yp = 1.38 + i*1.35;
    card(s, 5.0, yp, 4.8, 1.22, C.slateL);
    badge(s, t.name, 5.1, yp+0.06, 4.6, 0.3, t.color);
    bullets(s, t.pts, 5.1, yp+0.42, 4.6, 0.72, { fontSize:10.5 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 13 – LEIOMYOSARCOMA & OTHER SUBTYPES
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Common Subtypes – Leiomyosarcoma & Others", 0.18, C.gold);
  sectionBar(s, "Key Histologic Subtypes", 0.72);

  const subtypes = [
    { name:"Leiomyosarcoma (LMS)", pts:[
      "Arise from IVC, renal vein, or retroperitoneal SM",
      "IVC-LMS: intraluminal growth → obstructive symptoms",
      "High local recurrence + hepatic/pulmonary metastases",
      "3-year overall survival ~50%",
    ], color:C.teal },
    { name:"Undifferentiated Pleomorphic Sarcoma", pts:[
      "Formerly MFH – a diagnosis of exclusion",
      "Highly aggressive; poor prognosis",
      "May respond to pembrolizumab (PD-1 inhibitor)",
    ], color:"7D3C98" },
    { name:"GIST (Gastrointestinal Stromal)", pts:[
      "Arise from interstitial cells of Cajal (ICCs)",
      "KIT (CD117) or PDGFRA mutation",
      "Imatinib: neoadjuvant to downstage prior to surgery",
      "Surgery ± adjuvant imatinib (3 years for high-risk)",
    ], color:"1A5276" },
    { name:"Paraganglioma", pts:[
      "Chromaffin + non-chromaffin varieties",
      "Functional: hypertension, headache, palpitations",
      "Pre-op alpha-blockade MANDATORY",
      "Resection is definitive; high cure rate",
    ], color:"784212" },
    { name:"Primary Retroperitoneal GCT", pts:[
      "Rare; AFP/β-hCG elevation",
      "Treat as metastatic testicular GCT (BEP chemo)",
      "Surgery for residual mass post-chemo",
    ], color:"1A6B72" },
    { name:"Lymphoma", pts:[
      "Non-surgical management (chemo/RT)",
      "Surgery role: diagnostic biopsy only",
      "Differentiating from sarcoma is critical",
    ], color:"2C3E50" },
  ];

  subtypes.forEach((st, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const xp = 0.2 + col*3.25;
    const yp = 1.42 + row*1.9;
    card(s, xp, yp, 3.1, 1.78, C.navy);
    badge(s, st.name, xp+0.05, yp+0.05, 3.0, 0.3, st.color);
    bullets(s, st.pts, xp+0.1, yp+0.42, 2.9, 1.28, { fontSize:10.5 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 14 – NEOADJUVANT THERAPY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Neoadjuvant & Adjuvant Therapy");
  sectionBar(s, "Multimodality Treatment", 0.72);

  // Pre-op RT image
  const rtImg = imgData(4);
  if (rtImg) {
    s.addImage({ data: rtImg, x:0.2, y:1.38, w:4.5, h:3.1 });
    s.addText("Fig: RPS before (A) & after (B) 60-Gy pre-op RT – tumour liquefaction\n(Sabiston Textbook of Surgery, Fig 64.5)", {
      x:0.2, y:4.5, w:4.5, h:0.6, fontSize:8, italic:true, color:C.grey, fontFace:"Calibri", align:"center", margin:0
    });
  }

  card(s, 4.9, 1.38, 4.9, 1.55, C.slateL);
  s.addText("Neoadjuvant Radiation Therapy", { x:5.05, y:1.48, w:4.6, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Pre-op RT: tumour displaces bowel anteriorly – higher safe dose posteriorly",
    "45–50 Gy pre-op; tumour debulking aids dosing",
    "STRASS trial (EORTC): no OS/RFS benefit overall; subgroup signal in liposarcoma",
    "Recommended for large high-grade tumours at specialist centres",
  ], 5.05, 1.93, 4.6, 0.92, { fontSize:11 });

  card(s, 4.9, 3.05, 4.9, 1.45, C.slateL);
  s.addText("Adjuvant Chemotherapy", { x:5.05, y:3.15, w:4.6, h:0.38, fontSize:13, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Most studies: NO survival benefit from adjuvant chemo",
    "Metastatic disease: anthracycline-based 1st line",
    "2nd line: gemcitabine + docetaxel",
    "Emerging: trabectedin, MDM2 antagonists, CDK4 inhibitors",
    "Pembrolizumab: promising in UPS / dediff LPS",
  ], 5.05, 3.6, 4.6, 0.82, { fontSize:11 });

  card(s, 4.9, 4.6, 4.9, 0.75, C.slateL);
  s.addText("Post-op RT: generally discouraged unless tumour bed is away from radiosensitive structures", {
    x:5.05, y:4.65, w:4.6, h:0.62, fontSize:11, color:C.offWht, fontFace:"Calibri", margin:0
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 15 – SURGICAL OUTCOMES & SURVIVAL
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Surgical Outcomes", 0.18, C.gold);
  sectionBar(s, "Results of Resection", 0.72);

  // Key outcome stats
  const stats = [
    { val:"103 mo", lbl:"Median Survival\nComplete Resection", color:C.green },
    { val:"18 mo",  lbl:"Median Survival\nIncomplete/Observation", color:C.red },
    { val:"80%",    lbl:"R0/R1 Achieved\n(primary resection)", color:C.teal },
    { val:">70%",   lbl:"Relapse rate even\nafter optimal resection", color:"E67E22" },
  ];
  stats.forEach((st, i) => {
    card(s, 0.2+i*2.38, 1.38, 2.2, 1.8, C.navy);
    s.addText(st.val, { x:0.2+i*2.38, y:1.5, w:2.2, h:0.75, fontSize:28, bold:true, color:st.color, fontFace:"Calibri", align:"center", margin:0 });
    s.addText(st.lbl, { x:0.2+i*2.38, y:2.25, w:2.2, h:0.85, fontSize:11, color:C.offWht, fontFace:"Calibri", align:"center", margin:0 });
  });

  // Recurrence patterns
  card(s, 0.2, 3.3, 4.6, 2.0, C.navy);
  s.addText("Recurrence After Resection", { x:0.35, y:3.4, w:4.3, h:0.38, fontSize:13, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Local recurrence: predominant failure pattern (tumour bed)",
    "LMS: also spreads to liver + lungs (haematogenous)",
    "Peritoneal sarcomatosis: diffuse peritoneal recurrence",
    "Complete gross resection at recurrence: 57% (1st), 33% (2nd), 14% (3rd)",
    "High-grade tumours: aggressive systemic biology limits re-resection benefit",
  ], 0.35, 3.85, 4.3, 1.38, { fontSize:11 });

  // Morbidity / Mortality
  card(s, 5.0, 3.3, 4.8, 2.0, C.navy);
  s.addText("Perioperative Outcomes", { x:5.15, y:3.4, w:4.5, h:0.38, fontSize:13, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Morbidity after vascular resection: ~36%",
    "Mortality after vascular resection: ~4%",
    "Major post-op complications do NOT reduce long-term survival",
    "Extended procedures (IVC, Whipple) feasible at high-volume centres",
    "Pancreaticoduodenectomy / major vascular resection → higher morbidity",
  ], 5.15, 3.85, 4.5, 1.38, { fontSize:11 });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 16 – RECURRENT RPS
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Recurrent Retroperitoneal Sarcoma");
  sectionBar(s, "Management of Recurrence", 0.72);

  card(s, 0.2, 1.38, 9.6, 0.95, C.slateL);
  s.addText("RPS recurs more often than extremity/trunk STS. Management depends on histologic subtype, resectability, disease-free interval, and performance status.", {
    x:0.4, y:1.48, w:9.2, h:0.78, fontSize:12, color:C.white, fontFace:"Calibri", margin:0
  });

  const recs = [
    { title:"Re-resection Criteria", pts:[
      "Radiographic evidence of potential complete resection required",
      "Longer disease-free interval (>12 months) = better outcome",
      "Histologic subtype guides decision: LPS favours re-resection",
      "High-grade tumours: high systemic risk – multidisciplinary decision",
    ], color:C.teal },
    { title:"Atypical Lipomatous Tumour (ALT)", pts:[
      "Aggressive surgery (even incomplete) justified",
      "May provide symptom palliation and survival benefit",
      "Low metastatic risk – local disease dominates",
    ], color:C.green },
    { title:"Dediff LPS / Other High-Grade", pts:[
      "Palliative resection NOT generally justified",
      "High rates of distant metastasis limit benefit",
      "Systemic chemotherapy preferred approach",
      "Clinical trial enrollment encouraged",
    ], color:C.red },
    { title:"Sarcomatosis (Peritoneal Spread)", pts:[
      "Diffuse peritoneal recurrence – very poor prognosis",
      "HIPEC: investigational in selected centres",
      "Palliative systemic therapy standard",
    ], color:"8E4F6B" },
  ];

  recs.forEach((r, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const xp = 0.2 + col*4.9;
    const yp = 2.45 + row*1.5;
    card(s, xp, yp, 4.75, 1.38, C.slateL);
    badge(s, r.title, xp+0.08, yp+0.06, 4.58, 0.3, r.color);
    bullets(s, r.pts, xp+0.12, yp+0.44, 4.42, 0.88, { fontSize:10.5 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 17 – SPECIAL TOPICS: VASCULAR INVOLVEMENT
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Vascular Involvement", 0.18, C.gold);
  sectionBar(s, "IVC & Major Vessel Resection", 0.72);

  card(s, 0.2, 1.38, 9.6, 1.05, C.navy);
  s.addText("Vascular resection is the treatment of choice when sarcoma involves major retroperitoneal vessels. Patency rate >88% at median 19-month follow-up with acceptable morbidity/mortality.", {
    x:0.35, y:1.48, w:9.3, h:0.88, fontSize:12, color:C.white, fontFace:"Calibri", margin:0
  });

  const vascular = [
    { title:"IVC Involvement", pts:[
      "Most common major vessel involved",
      "Segment I (infrahepatic) – ligation may be tolerated",
      "Segment II (juxtarenal) – reconstruction often needed",
      "Segment III (suprarenal/suprahepatic) – most challenging",
      "PTFE graft or panel graft reconstruction",
    ], color:C.teal },
    { title:"Aortic Involvement", pts:[
      "Less common; en bloc resection with graft",
      "Pre-op planning with CT angiography",
      "Vascular surgery collaboration essential",
      "Supracoeliac clamping if needed",
    ], color:"A04000" },
    { title:"Renal Vessel Involvement", pts:[
      "Bilateral renal vessel involvement = contraindication to resection",
      "Proximal SMA involvement: relative contraindication",
      "Ipsilateral nephrectomy commonly required",
      "Preserve contralateral renal function",
    ], color:"7D3C98" },
    { title:"Contraindications to Resection", pts:[
      "Bilateral renal vascular involvement",
      "Proximal SMA / SMV encasement",
      "Unresectable peritoneal disease (sarcomatosis)",
      "Poor performance status / prohibitive surgical risk",
    ], color:C.red },
  ];

  vascular.forEach((v, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const xp = 0.2 + col*4.9;
    const yp = 2.58 + row*1.55;
    card(s, xp, yp, 4.75, 1.42, C.navy);
    badge(s, v.title, xp+0.08, yp+0.06, 4.58, 0.3, v.color);
    bullets(s, v.pts, xp+0.12, yp+0.44, 4.42, 0.9, { fontSize:10.5 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 18 – PREOPERATIVE PLANNING & MDT
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  darkBg(s);
  header(s, "Pre-operative Planning & Multidisciplinary Team");
  sectionBar(s, "MDT Approach at High-Volume Centres", 0.72);

  const mdt = [
    { role:"Surgical Oncologist", icon:"🔪", pts:["Leads resection planning","Determines organ/vessel sacrifice","En bloc strategy"] },
    { role:"Radiologist", icon:"🖥", pts:["Multiplanar CT/MRI review","Vascular mapping","Guides biopsy"] },
    { role:"Vascular Surgeon", icon:"🫀", pts:["IVC / aortic reconstruction","Endovascular pre-op embolisation"] },
    { role:"Radiation Oncologist", icon:"☢", pts:["Pre-op RT planning (IMRT)","IORT where available"] },
    { role:"Medical Oncologist", icon:"💊", pts:["Neoadjuvant chemo protocols","Systemic therapy for metastases"] },
    { role:"Pathologist", icon:"🔬", pts:["Core biopsy interpretation","Intraoperative frozen section","Final margin assessment"] },
  ];

  mdt.forEach((m, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const xp = 0.2 + col*3.25;
    const yp = 1.42 + row*1.95;
    card(s, xp, yp, 3.1, 1.82, C.slateL);
    s.addText(m.role, { x:xp+0.12, y:yp+0.08, w:2.86, h:0.38, fontSize:12, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
    bullets(s, m.pts, xp+0.12, yp+0.5, 2.86, 1.24, { fontSize:11 });
  });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 19 – FOLLOW-UP & SURVEILLANCE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  slateBg(s);
  header(s, "Follow-Up & Surveillance", 0.18, C.gold);
  sectionBar(s, "Post-Resection Monitoring", 0.72);

  card(s, 0.2, 1.38, 5.5, 3.95, C.navy);
  s.addText("Surveillance Schedule", { x:0.35, y:1.48, w:5.2, h:0.38, fontSize:14, bold:true, color:C.tealLt, fontFace:"Calibri", margin:0 });

  const sched = [
    ["Year 1–2", "CT abdomen/pelvis + CT chest q3–4 months"],
    ["Year 3–5", "CT q6 months"],
    ["Year 5+", "Annual CT; MRI if recurrence suspected"],
    ["High-Grade", "More frequent imaging; consider PET-CT at recurrence"],
  ];
  sched.forEach(([period, detail], i) => {
    const yp = 1.95 + i*0.9;
    badge(s, period, 0.35, yp, 1.5, 0.32, C.teal);
    s.addText(detail, { x:1.95, y:yp, w:3.6, h:0.32, fontSize:11.5, color:C.offWht, fontFace:"Calibri", valign:"middle", margin:0 });
  });

  card(s, 0.2, 5.05, 5.5, 0.28, C.teal);
  s.addText("No randomised data on optimal surveillance intervals – institutional protocols vary", {
    x:0.35, y:5.07, w:5.2, h:0.22, fontSize:10, italic:true, color:C.white, fontFace:"Calibri", margin:0
  });

  card(s, 5.9, 1.38, 3.9, 3.95, C.navy);
  s.addText("What to Look For", { x:6.05, y:1.48, w:3.6, h:0.38, fontSize:14, bold:true, color:C.gold, fontFace:"Calibri", margin:0 });
  bullets(s, [
    "Local tumour bed recurrence",
    "Contralateral retroperitoneal recurrence",
    "Peritoneal implants / sarcomatosis",
    "Pulmonary metastases (LMS, UPS)",
    "Hepatic metastases (LMS)",
    "Anastomotic or reconstruction integrity",
    "New contralateral adrenal or renal lesion",
  ], 6.05, 1.95, 3.6, 3.3, { fontSize:12 });
}

// ════════════════════════════════════════════════════════════════════════════
//  SLIDE 20 – KEY TAKEAWAYS / SUMMARY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = addSlide();
  // Full dark background with gold accent
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.navy}, line:{color:C.navy} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:1.0, fill:{color:C.teal}, line:{color:C.teal} });
  s.addShape(pres.ShapeType.rect, { x:0, y:1.0, w:10, h:0.06, fill:{color:C.gold}, line:{color:C.gold} });

  s.addText("KEY SURGICAL TAKEAWAYS", {
    x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, charSpacing:4,
    color:C.white, fontFace:"Calibri", align:"center", margin:0
  });

  const keys = [
    ["1", "Most retroperitoneal masses are malignant; ~1/3 are soft tissue sarcomas"],
    ["2", "Liposarcoma + Leiomyosarcoma account for the majority of RPS"],
    ["3", "Complete surgical resection is the ONLY curative treatment – R0/R1 at high-volume centres"],
    ["4", "En bloc multivisceral resection in ≥75% of cases – kidney, colon, adrenal most common"],
    ["5", "Preoperative CT-guided biopsy guides neoadjuvant strategies and surgical planning"],
    ["6", "Neoadjuvant RT (45–50 Gy) considered for large high-grade tumours; no proven OS benefit"],
    ["7", "Local recurrence is the dominant failure pattern; re-resection selected cases"],
    ["8", "Adjuvant chemo has limited evidence; emerging role for immunotherapy (UPS, DDLPS)"],
    ["9", "MDT approach + referral to high-volume sarcoma centre is mandatory for optimal outcomes"],
  ];

  keys.forEach(([num, text], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i < 5 ? i : i-5;
    const xp = col === 0 ? 0.2 : 5.15;
    const yp = 1.18 + row*0.86;
    card(s, xp, yp, 4.75, 0.78, C.slateL);
    badge(s, num, xp+0.1, yp+0.22, 0.4, 0.34, C.teal);
    s.addText(text, { x:xp+0.62, y:yp+0.1, w:4.0, h:0.58, fontSize:11, color:C.offWht, fontFace:"Calibri", valign:"middle", margin:0 });
  });

  s.addText("Sources: Schwartz's Principles of Surgery 11e | Sabiston Textbook of Surgery | Bailey & Love's 28e | Fischer's Mastery of Surgery 8e", {
    x:0.2, y:5.28, w:9.6, h:0.32, fontSize:8, color:C.grey, fontFace:"Calibri", align:"center", margin:0
  });
}

// ── write file ───────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/retroperitoneal-pptx/Retroperitoneal_Tumors_Surgical.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("DONE:", outPath))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/retroperitoneal-pptx && node build.js 2>&1

You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.