Define explicit and implicit awareness during general anaesthesia. What may increase the likelihood of awareness? List the techniques used to assess the depth of anaesthesia and comment on their value in MD Anaesthesia

Reading File
Finding Sources
Finding Sources
Searching PubMed

awareness during anaesthesia depth monitoring

Finding Sources
Finding Sources
Searching PubMed

intraoperative awareness anesthesia

Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Now I have enough comprehensive content from the textbooks. Let me compose the full answer:

Awareness During General Anaesthesia

Definitions

Explicit Awareness

Explicit (or conscious) awareness is the conscious, post-operative recall of intraoperative events. The patient is able to voluntarily recollect what occurred during the procedure — conversations, sounds, pain, or the sensation of paralysis. It requires both failure of hypnosis and failure of amnesia. Patients may range from recall of fragments of conversation to full recall of pain and physical sensation, with consequences spanning mild anxiety to frank post-traumatic stress disorder (sleep disturbances, nightmares, social difficulties).
Most clinical trials and the Modified Brice Interview screen specifically for explicit recall (Box 36.3, Miller's):
  1. What is the last thing you remembered before going to sleep?
  2. What is the first thing you remembered when you woke up?
  3. Can you remember anything between these two periods?
  4. Did you dream during your operation?
  5. What was the worst thing about your operation?
The incidence is approximately 0.1–0.2% in general surgical practice, though it is higher in specific high-risk scenarios (see below).

Implicit Awareness

Implicit awareness (also called connected consciousness or covert consciousness) refers to intraoperative consciousness without subsequent explicit recall. The patient is conscious at the time but has no post-operative memory of it — because most anaesthetic agents produce amnesia even at sub-hypnotic doses. It can be detected in real time using the Isolated Forearm Technique (IFT), where a tourniquet prevents neuromuscular blockade in one arm, allowing the patient to respond purposefully to verbal commands during anaesthesia. IFT-detectable consciousness occurs approximately two orders of magnitude more frequently than explicit awareness with recall, making it a much more common phenomenon than traditionally appreciated. — Miller's Anesthesia, 10e, block15

Factors That Increase the Likelihood of Awareness

Risk factors are usefully divided into three groups (Fuster & Hurst's The Heart, 15e; Barash Clinical Anesthesia, 9e):

Patient-Related

FactorMechanism
Prior history of intraoperative awarenessStrongest single predictor
Morbid obesityAltered pharmacokinetics; under-dosing relative to lean body mass
Substance abuse / chronic opioid useTolerance increases anaesthetic requirements
Chronic pain patients on opioidsCross-tolerance to anaesthetic agents
ASA physical status III–IV / haemodynamic instabilityReduced tolerable anaesthetic dose
Female sexEpidemiological association (more claims in women without volatile agent)
Difficult airway / prolonged laryngoscopyDelay in establishing adequate agent delivery

Surgery-Related

ProcedureApproximate Awareness Rate
Major trauma surgeryUp to 43% (early studies)
Cardiac surgery~1.5%
Caesarean section under GA~0.4%
Emergency/trauma laparotomyElevated (haemodynamic constraints limit anaesthetic dose)
Obstetric GAElevated (concern for foetal drug depression historically limited depth)

Anaesthetic Technique-Related

  • Total intravenous anaesthesia (TIVA) — no end-tidal agent concentration available to confirm delivery; reliance entirely on infusion pump integrity
  • Vaporiser malfunction or disconnection — unrecognised interruption of volatile delivery
  • Low-dose techniques — in compromised patients where haemodynamic tolerance is limited
  • Neuromuscular blockade — abolishes movement as a clinical sign of light anaesthesia; false reassurance
  • Medication errors — administering neuromuscular blocker before induction agent (syringe swap); approximately 20% of ASA closed claims for awareness involved awake paralysis
  • Nitrous oxide-only "anaesthesia" — insufficient hypnotic component
(Morgan & Mikhail's Clinical Anesthesiology, 7e, p.2347–2348; Fuster & Hurst's The Heart, 15e, p.2115)

Techniques Used to Assess Depth of Anaesthesia

1. Clinical Signs

The traditional markers: haemodynamic responses (tachycardia, hypertension), sweating, lacrimation, pupillary dilation, movement, and return of breathing (in spontaneously ventilating patients). These are simple and universally available, but neuromuscular blockade abolishes movement, and autonomic signs are blunted by opioids, beta-blockers, and direct haemodynamic compromise — making them unreliable in isolation.

2. End-Tidal Anaesthetic Agent Concentration

Monitoring the expired concentration of a volatile agent as a surrogate for brain-effect-site concentration. Maintaining at least 0.7 MAC age-adjusted is a common threshold for amnesia. This is the most widely validated technique for volatile-based anaesthesia, and randomised trials have shown it performs equivalently to, or better than, processed EEG monitoring in preventing awareness when correctly applied. Its critical limitation is that it is inapplicable to TIVA.

3. Processed Electroencephalography (EEG) Monitors

These devices apply proprietary algorithms to the frontal EEG to generate a dimensionless index:
MonitorOutputKey Feature
BIS (Bispectral Index)0–100 (target 40–60 for GA)Most widely studied; incorporates power spectral analysis, coherence, burst suppression
Entropy (SE/RE)State Entropy / Response EntropyTwo values; gap between SE and RE suggests EMG/frontal muscle activity (arousal signal)
NarcotrendA–F scaleLess widely validated
SedLine / PSiPatient State IndexFrontal asymmetry + spectral edge
Principle: Under GABAergic anaesthesia (propofol, sevoflurane, isoflurane) the EEG characteristically shows a high-amplitude, slow alpha-delta pattern; deeper anaesthesia produces burst suppression and ultimately isoelectricity. Processed indices attempt to quantify this transition.
Strengths:
  • Provides real-time feedback on CNS drug effect, especially valuable in TIVA where there is no end-tidal gas to measure
  • Useful in haemodynamically compromised patients (emergency surgery, caesarean section under GA, trauma) where clinical tolerance limits titration
  • May help avoid anaesthetic overdose and reduce postoperative cognitive complications
  • Can guide sedation when neuromuscular blockade precludes clinical assessment in the ICU
Limitations and pitfalls (Miller's Anesthesia 10e; Barash 9e):
  • Algorithms trained on young, healthy volunteers — performance degrades in heterogeneous populations; a BIS of 50 in one patient does not equal BIS 50 in another; different individuals become aware at BIS values ranging 40–90
  • Ketamine causes cortical excitation, falsely elevating the index (suggesting lighter anaesthesia is being given than is actually the case)
  • Opioids have minimal EEG effect; the index primarily reflects the hypnotic component
  • EMG artefact — electromyographic activity from facial/frontal muscles falsely elevates BIS
  • Neuromuscular blockade paradox — loss of EMG after suxamethonium can drop BIS into the target range in an awake, paralysed patient; this is a critical false-negative scenario
  • Randomised trials (including the B-Unaware and BAG-RECALL trials) have failed to demonstrate superiority of BIS over end-tidal agent concentration monitoring in preventing awareness when volatile agents are used
  • Specificity/sensitivity in IFT studies typically only 40–85%; predictive value ~0.7
  • The alpha-delta EEG pattern itself does not preclude IFT-detectable consciousness

4. Raw EEG / Spectrogram (Electroencephalography)

Direct visual interpretation of the raw EEG or its time-frequency spectrogram is arguably the most informative window into anaesthetic depth. The spectrogram immediately reveals drug-specific patterns (e.g., propofol's sustained frontal alpha oscillations, burst suppression, ketamine's beta/gamma bursts). Crucially, visual inspection of raw EEG can detect wakefulness (absence of alpha-delta) that a processed index may miss due to algorithmic or EMG artefact. Its limitation is that it requires EEG expertise that most anaesthetists lack.

5. Isolated Forearm Technique (IFT)

A tourniquet inflated above systolic pressure before neuromuscular blockade preserves voluntary motor responses in one forearm. The patient can then respond to intraoperative commands. It is considered the gold standard for detecting covert consciousness in real time but has near-zero uptake in routine practice due to impracticality.

6. Mid-Latency Auditory Evoked Potentials (MLAEPs)

Cortical evoked responses to auditory stimuli change predictably with anaesthetic depth. They were among the earliest proposed objective depth monitors. Clinical use is limited by technical complexity, susceptibility to noise, and the availability of processed EEG as a simpler alternative.

7. Cerebral Oximetry (NIRS)

Near-infrared spectroscopy measures regional cerebral oxygenation (rSO₂) primarily from frontal cortex. It is not a consciousness monitor per se, but reflects cerebral perfusion and oxygen delivery. Relevant to depth monitoring in that profound reductions in cerebral perfusion (as in cardiac surgery or haemodynamic collapse) increase awareness risk; targeted therapy to maintain rSO₂ has been associated with reduced delirium post-cardiac surgery. (Fuster & Hurst's The Heart, 15e, p.2115–2116)

Summary: Value in MD (Medical Doctor / Clinical) Anaesthesia Practice

TechniqueClinical ValueKey Caveat
Clinical signsBaseline; always assessedUnreliable with NMB or opioids
End-tidal agentBest-validated for volatile GA; simple, continuousInapplicable to TIVA
BIS/EntropyEssential for TIVA; useful in high-risk casesNo superiority over end-tidal gas for volatile GA; multiple confounders
Raw EEG/spectrogramHighest information contentRequires training
IFTResearch gold standardImpractical clinically
NIRSCerebral perfusion monitoringNot a consciousness-specific monitor
The ASA currently does not mandate routine brain function monitoring for all general anaesthetics. Processed EEG monitoring is most defensible when: (1) TIVA is used, (2) the patient has haemodynamic constraints that limit conventional dosing, (3) there is a prior history of awareness, or (4) the patient has known cognitive vulnerability. In all cases, no single monitor is sufficient in isolation — optimal practice combines end-tidal gas monitoring (when applicable), processed EEG, vigilance for clinical signs, avoidance of syringe errors, and structured post-operative questioning for awareness.

Sources: Miller's Anesthesia, 10e (block15); Morgan & Mikhail's Clinical Anesthesiology, 7e (block9, pp.2347–2348); Barash Clinical Anesthesia, 9e (block9, pp.2151–2155); Fuster & Hurst's The Heart, 15e (block20, pp.2115–2116). Recent review: Laferrière-Langlois et al., Anesth Analg 2024 [PMID 38215709]; Sadiq & Bauerle, Mo Med 2023 [PMID 38144931].

Make a ppt

Reading File
Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Running Command

mkdir -p /home/daytona/workspace/awareness-anaesthesia-ppt

Writing File

~/awareness-anaesthesia-ppt/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Awareness During General Anaesthesia";
pres.author = "MD Anaesthesia";

// ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
// Deep navy dominant, teal accent, warm amber highlight, white text
const C = {
  navy:      "0D1F3C",   // dominant bg
  navyMid:   "12284F",   // card bg
  navyLight: "1A3566",   // lighter panel
  teal:      "00B4D8",   // accent / headings
  amber:     "F4A261",   // highlight / call-outs
  white:     "FFFFFF",
  offwhite:  "E8EDF5",
  muted:     "A8B8D0",
  red:       "E63946",
};

// ─── HELPER: slide title bar ──────────────────────────────────────────────────
function titleBar(slide, title, subtitle) {
  // Full-width top bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 1.1,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  slide.addText(title, {
    x: 0.35, y: 0, w: 9.3, h: 1.1,
    fontSize: 26, bold: true, color: C.navy,
    fontFace: "Calibri", valign: "middle", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 1.15, w: 9.3, h: 0.35,
      fontSize: 12, color: C.muted, italic: true, fontFace: "Calibri", margin: 0
    });
  }
}

// ─── HELPER: footer ───────────────────────────────────────────────────────────
function footer(slide, txt) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.4, w: 10, h: 0.225,
    fill: { color: C.navyLight }, line: { color: C.navyLight }
  });
  slide.addText(txt || "MD Anaesthesia  |  Awareness During General Anaesthesia", {
    x: 0.3, y: 5.4, w: 9.4, h: 0.225,
    fontSize: 8, color: C.muted, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ─── HELPER: info card ───────────────────────────────────────────────────────
function card(slide, x, y, w, h, label, labelColor, bullets) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: C.navyMid },
    line: { color: labelColor || C.teal, pt: 1.5 },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.18 }
  });
  // top accent stripe
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h: 0.07,
    fill: { color: labelColor || C.teal }, line: { color: labelColor || C.teal }
  });
  if (label) {
    slide.addText(label, {
      x: x + 0.12, y: y + 0.08, w: w - 0.24, h: 0.32,
      fontSize: 11, bold: true, color: labelColor || C.teal,
      fontFace: "Calibri", margin: 0
    });
  }
  if (bullets && bullets.length) {
    const items = bullets.map((b, i) => ({
      text: b,
      options: { bullet: { code: "2022" }, fontSize: 9.5, color: C.offwhite,
                 fontFace: "Calibri", breakLine: i < bullets.length - 1 }
    }));
    slide.addText(items, {
      x: x + 0.14, y: y + 0.42, w: w - 0.28, h: h - 0.52,
      valign: "top", margin: 0
    });
  }
}

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

  // Large decorative circle top-right
  s.addShape(pres.shapes.ELLIPSE, {
    x: 7.8, y: -1.2, w: 3.5, h: 3.5,
    fill: { color: C.teal, transparency: 85 }, line: { color: C.teal, transparency: 70, pt: 1 }
  });
  s.addShape(pres.shapes.ELLIPSE, {
    x: 8.3, y: -0.7, w: 2.5, h: 2.5,
    fill: { color: C.teal, transparency: 75 }, line: { color: C.teal, transparency: 60, pt: 1 }
  });

  // Bottom amber stripe
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 4.9, w: 10, h: 0.73,
    fill: { color: C.amber }, line: { color: C.amber }
  });
  s.addText("MD Anaesthesia", {
    x: 0.5, y: 4.9, w: 9, h: 0.73,
    fontSize: 13, bold: true, color: C.navy,
    fontFace: "Calibri", valign: "middle", margin: 0
  });

  // Left vertical accent line
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.55, y: 1.2, w: 0.07, h: 2.8,
    fill: { color: C.teal }, line: { color: C.teal }
  });

  s.addText("AWARENESS DURING", {
    x: 0.75, y: 1.15, w: 8.5, h: 0.7,
    fontSize: 36, bold: true, color: C.white,
    fontFace: "Calibri", charSpacing: 3, margin: 0
  });
  s.addText("GENERAL ANAESTHESIA", {
    x: 0.75, y: 1.82, w: 8.5, h: 0.7,
    fontSize: 36, bold: true, color: C.teal,
    fontFace: "Calibri", charSpacing: 3, margin: 0
  });
  s.addText("Definitions  ·  Risk Factors  ·  Depth of Anaesthesia Monitoring", {
    x: 0.75, y: 2.65, w: 8, h: 0.45,
    fontSize: 14, color: C.muted, fontFace: "Calibri", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW / INCIDENCE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Intraoperative Awareness — Overview");
  footer(s);

  // 3 stat boxes
  const stats = [
    { val: "0.1–0.2%", label: "Overall incidence\nin general surgical practice", col: C.teal },
    { val: "1.5%", label: "Cardiac surgery\nawareness rate", col: C.amber },
    { val: "~43%", label: "Major trauma\n(early series)", col: C.red },
  ];
  stats.forEach((st, i) => {
    const x = 0.4 + i * 3.1;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 1.6, w: 2.8, h: 1.55,
      fill: { color: C.navyMid }, line: { color: st.col, pt: 2 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 1.6, w: 2.8, h: 0.07,
      fill: { color: st.col }, line: { color: st.col }
    });
    s.addText(st.val, {
      x: x + 0.1, y: 1.67, w: 2.6, h: 0.75,
      fontSize: 30, bold: true, color: st.col,
      fontFace: "Calibri", align: "center", valign: "middle", margin: 0
    });
    s.addText(st.label, {
      x: x + 0.1, y: 2.42, w: 2.6, h: 0.65,
      fontSize: 10, color: C.offwhite, fontFace: "Calibri",
      align: "center", valign: "top", margin: 0
    });
  });

  // Key definition paragraph
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 3.3, w: 9.2, h: 1.7,
    fill: { color: C.navyLight }, line: { color: C.navyLight }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 3.3, w: 0.07, h: 1.7,
    fill: { color: C.amber }, line: { color: C.amber }
  });
  s.addText([
    { text: "Awareness = ", options: { bold: true, color: C.amber } },
    { text: "conscious experience during intended general anaesthesia. ", options: { color: C.white } },
    { text: "Requires failure of both hypnosis AND amnesia for explicit recall. ", options: { color: C.offwhite } },
    { text: "\nConsequences range from mild anxiety to post-traumatic stress disorder — sleep disturbances, nightmares, social difficulties.", options: { color: C.muted } }
  ], {
    x: 0.6, y: 3.35, w: 8.9, h: 1.55,
    fontSize: 11, fontFace: "Calibri", valign: "top", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — EXPLICIT AWARENESS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Explicit Awareness", "Conscious recall of intraoperative events");
  footer(s);

  // Definition box
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 1.55, w: 9.2, h: 0.95,
    fill: { color: C.navyMid }, line: { color: C.teal, pt: 1.5 }
  });
  s.addText([
    { text: "Definition: ", options: { bold: true, color: C.teal } },
    { text: "Post-operative conscious, voluntary recall of intraoperative events — sounds, conversations, pain, or paralysis sensation.", options: { color: C.white } }
  ], { x: 0.55, y: 1.6, w: 8.9, h: 0.85, fontSize: 11.5, fontFace: "Calibri", valign: "middle", margin: 0 });

  // Pre-reqs box
  s.addText("Requires both:", {
    x: 0.4, y: 2.6, w: 3, h: 0.3,
    fontSize: 11, bold: true, color: C.amber, fontFace: "Calibri", margin: 0
  });
  const prereqs = [
    { label: "Failure of HYPNOSIS", desc: "Patient becomes conscious intraoperatively" },
    { label: "Failure of AMNESIA", desc: "Memory consolidation is not blocked" },
  ];
  prereqs.forEach((p, i) => {
    const x = 0.4 + i * 4.65;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.95, w: 4.35, h: 1.05,
      fill: { color: C.navyMid }, line: { color: C.amber, pt: 1.5 }
    });
    s.addText(p.label, {
      x: x + 0.15, y: 2.98, w: 4.1, h: 0.38,
      fontSize: 11.5, bold: true, color: C.amber, fontFace: "Calibri", margin: 0
    });
    s.addText(p.desc, {
      x: x + 0.15, y: 3.36, w: 4.1, h: 0.55,
      fontSize: 10, color: C.offwhite, fontFace: "Calibri", margin: 0
    });
  });

  // Brice interview
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 4.1, w: 9.2, h: 1.0,
    fill: { color: C.navyLight }, line: { color: C.navyLight }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 4.1, w: 0.07, h: 1.0,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  s.addText([
    { text: "Modified Brice Interview  ", options: { bold: true, color: C.teal } },
    { text: "(post-operative screening) — 5 questions: last memory before sleep · first memory on waking · anything between · dreams · worst thing about operation", options: { color: C.offwhite } }
  ], { x: 0.6, y: 4.12, w: 8.85, h: 0.95, fontSize: 10.5, fontFace: "Calibri", valign: "middle", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — IMPLICIT AWARENESS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Implicit Awareness", "Covert consciousness without explicit recall");
  footer(s);

  // Definition
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 1.55, w: 9.2, h: 1.0,
    fill: { color: C.navyMid }, line: { color: C.amber, pt: 1.5 }
  });
  s.addText([
    { text: "Definition: ", options: { bold: true, color: C.amber } },
    { text: "Intraoperative consciousness WITHOUT subsequent explicit recall. The patient is conscious at the time but has no post-operative memory — because anaesthetic agents produce amnesia even at sub-hypnotic doses.", options: { color: C.white } }
  ], { x: 0.55, y: 1.6, w: 8.9, h: 0.9, fontSize: 11.5, fontFace: "Calibri", valign: "middle", margin: 0 });

  // Key insight large stat
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 2.75, w: 4.3, h: 1.8,
    fill: { color: C.navyMid }, line: { color: C.red, pt: 2 }
  });
  s.addText("~100×", {
    x: 0.5, y: 2.82, w: 4.1, h: 0.85,
    fontSize: 48, bold: true, color: C.red, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("more frequent than explicit recall\n(Lennmarken & Sandin; Miller's Anaesthesia)", {
    x: 0.5, y: 3.68, w: 4.1, h: 0.8,
    fontSize: 9.5, color: C.offwhite, fontFace: "Calibri",
    align: "center", margin: 0
  });

  // IFT box
  s.addShape(pres.shapes.RECTANGLE, {
    x: 4.9, y: 2.75, w: 4.7, h: 1.8,
    fill: { color: C.navyMid }, line: { color: C.teal, pt: 1.5 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 4.9, y: 2.75, w: 4.7, h: 0.07,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  s.addText("Isolated Forearm Technique (IFT)", {
    x: 5.05, y: 2.82, w: 4.4, h: 0.32,
    fontSize: 11, bold: true, color: C.teal, fontFace: "Calibri", margin: 0
  });
  s.addText([
    { text: "• Tourniquet inflated before NMB — preserves voluntary motor response in one forearm\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Allows real-time detection of conscious response to commands despite paralysis\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Considered the gold standard for detecting covert consciousness\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Rarely used in routine practice due to impracticality", options: { color: C.muted } }
  ], {
    x: 5.05, y: 3.18, w: 4.4, h: 1.28,
    fontSize: 9.5, fontFace: "Calibri", valign: "top", margin: 0
  });

  // Key distinction
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 4.7, w: 9.2, h: 0.55,
    fill: { color: C.navyLight }, line: { color: C.navyLight }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 4.7, w: 0.07, h: 0.55,
    fill: { color: C.amber }, line: { color: C.amber }
  });
  s.addText("Key distinction: Implicit awareness has NO post-operative recall — yet the patient may still suffer psychological sequelae and the experience is ethically significant.", {
    x: 0.6, y: 4.72, w: 8.9, h: 0.5,
    fontSize: 10, color: C.offwhite, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — RISK FACTORS (patient + surgical)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Factors Increasing Likelihood of Awareness");
  footer(s);

  // Patient column
  card(s, 0.35, 1.55, 4.5, 3.65, "PATIENT-RELATED", C.teal, [
    "Prior history of intraoperative awareness (strongest predictor)",
    "Morbid obesity — altered pharmacokinetics, under-dosing",
    "Chronic substance abuse / long-term opioid use",
    "Chronic pain patients with opioid tolerance",
    "ASA III–IV / haemodynamic instability — limits tolerable dose",
    "Female sex (epidemiological association)",
    "Difficult airway — prolonged laryngoscopy delays delivery",
  ]);

  // Surgery column
  card(s, 5.15, 1.55, 4.5, 3.65, "SURGERY-RELATED", C.amber, [
    "Major trauma surgery (up to 43% in early series)",
    "Cardiac surgery (~1.5%)",
    "Caesarean section under GA (~0.4%)",
    "Emergency / trauma laparotomy",
    "Obstetric GA (historically limited depth for foetal concern)",
    "Prolonged, complex procedures with haemodynamic demands",
  ]);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — RISK FACTORS (anaesthetic technique)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Anaesthetic Technique-Related Risk Factors");
  footer(s);

  const items = [
    { icon: "TIVA", text: "Total intravenous anaesthesia — no end-tidal agent to confirm delivery; dependent on pump integrity", col: C.red },
    { icon: "NMB", text: "Neuromuscular blockade — abolishes movement as a clinical sign of light anaesthesia; false reassurance", col: C.amber },
    { icon: "EQUIP", text: "Vaporiser malfunction or disconnection — unrecognised volatile delivery failure", col: C.teal },
    { icon: "ERROR", text: "Medication errors / syringe swap — NMB administered before induction agent; ~20% ASA closed claims", col: C.red },
    { icon: "N₂O", text: "N₂O-only / low-dose techniques in haemodynamically compromised patients", col: C.amber },
    { icon: "LOW", text: "Failure to anticipate increased requirements — substance abuse, tolerance, chronic pain patients", col: C.teal },
  ];

  items.forEach((it, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.15;
    const row = Math.floor(i / 2);
    const y = 1.5 + row * 1.3;
    s.addShape(pres.shapes.RECTANGLE, {
      x: col, y, w: 4.5, h: 1.1,
      fill: { color: C.navyMid }, line: { color: it.col, pt: 1.5 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x: col, y, w: 0.07, h: 1.1,
      fill: { color: it.col }, line: { color: it.col }
    });
    s.addText(it.icon, {
      x: col + 0.15, y: y + 0.04, w: 4.2, h: 0.3,
      fontSize: 10, bold: true, color: it.col, fontFace: "Calibri", margin: 0
    });
    s.addText(it.text, {
      x: col + 0.15, y: y + 0.36, w: 4.2, h: 0.65,
      fontSize: 9.5, color: C.offwhite, fontFace: "Calibri", valign: "top", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — DEPTH OF ANAESTHESIA MONITORING: OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Techniques: Assessing Depth of Anaesthesia");
  footer(s);

  const techniques = [
    { num: "01", label: "Clinical Signs", col: C.muted },
    { num: "02", label: "End-Tidal Agent Concentration", col: C.teal },
    { num: "03", label: "Processed EEG  (BIS / Entropy / PSi)", col: C.amber },
    { num: "04", label: "Raw EEG / Spectrogram", col: C.teal },
    { num: "05", label: "Isolated Forearm Technique (IFT)", col: C.muted },
    { num: "06", label: "Mid-Latency Auditory Evoked Potentials", col: C.muted },
    { num: "07", label: "Cerebral Oximetry (NIRS)", col: C.teal },
  ];

  techniques.forEach((t, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.15;
    const row = Math.floor(i / 2);
    const y = 1.45 + row * 1.0;
    if (i === 6) {
      // Centre last item
      s.addShape(pres.shapes.RECTANGLE, {
        x: 2.75, y, w: 4.5, h: 0.8,
        fill: { color: C.navyMid }, line: { color: t.col, pt: 1.5 }
      });
      s.addText(`${t.num}`, {
        x: 2.95, y: y + 0.07, w: 0.5, h: 0.65,
        fontSize: 20, bold: true, color: t.col, fontFace: "Calibri", valign: "middle", margin: 0
      });
      s.addText(t.label, {
        x: 3.5, y: y + 0.07, w: 3.6, h: 0.65,
        fontSize: 12, color: C.offwhite, fontFace: "Calibri", valign: "middle", margin: 0
      });
      return;
    }
    s.addShape(pres.shapes.RECTANGLE, {
      x: col, y, w: 4.5, h: 0.8,
      fill: { color: C.navyMid }, line: { color: t.col, pt: 1.5 }
    });
    s.addText(`${t.num}`, {
      x: col + 0.2, y: y + 0.07, w: 0.5, h: 0.65,
      fontSize: 20, bold: true, color: t.col, fontFace: "Calibri", valign: "middle", margin: 0
    });
    s.addText(t.label, {
      x: col + 0.82, y: y + 0.07, w: 3.55, h: 0.65,
      fontSize: 12, color: C.offwhite, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — CLINICAL SIGNS + END-TIDAL AGENT
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Clinical Signs & End-Tidal Agent Concentration");
  footer(s);

  card(s, 0.35, 1.5, 4.5, 3.7, "CLINICAL SIGNS", C.muted, [
    "Haemodynamic: tachycardia, hypertension",
    "Diaphoresis, lacrimation, pupillary dilation",
    "Movement, return of spontaneous breathing",
    "Simple and universally available",
    "LIMITATION: NMB abolishes movement — completely unreliable without adjunct monitoring",
    "Autonomic signs blunted by opioids, beta-blockers, haemodynamic compromise",
  ]);

  card(s, 5.15, 1.5, 4.5, 3.7, "END-TIDAL AGENT CONCENTRATION", C.teal, [
    "Expired concentration of volatile agent = surrogate for brain effect-site concentration",
    "Target ≥0.7 MAC (age-adjusted) for amnesia",
    "Most widely validated technique for volatile-based GA",
    "RCTs: equivalent or superior to BIS in preventing awareness",
    "LIMITATION: Entirely inapplicable to TIVA",
    "Does not account for individual pharmacodynamic variation",
  ]);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — PROCESSED EEG (BIS / Entropy)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Processed EEG Monitors — BIS, Entropy, PSi");
  footer(s);

  // Principle
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.5, w: 9.3, h: 0.75,
    fill: { color: C.navyMid }, line: { color: C.amber, pt: 1.5 }
  });
  s.addText([
    { text: "Principle: ", options: { bold: true, color: C.amber } },
    { text: "Proprietary algorithms process frontal EEG → dimensionless index. Under GABAergic anaesthesia: high-amplitude slow alpha-delta pattern; deeper depth → burst suppression → isoelectricity.", options: { color: C.white } }
  ], { x: 0.5, y: 1.54, w: 9.1, h: 0.65, fontSize: 10.5, fontFace: "Calibri", valign: "middle", margin: 0 });

  // 3 device cards
  const devices = [
    { name: "BIS", range: "0–100 (target 40–60 for GA)", detail: "Power spectrum + coherence + burst suppression; most studied device" },
    { name: "Entropy (SE/RE)", range: "Two values: State & Response Entropy", detail: "Gap SE–RE signals frontal EMG/arousal; RE>SE = potential awakening" },
    { name: "SedLine / PSi", range: "Patient State Index", detail: "4-channel EEG, frontal asymmetry + spectral edge frequency" },
  ];
  devices.forEach((d, i) => {
    const x = 0.35 + i * 3.12;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.38, w: 2.95, h: 1.35,
      fill: { color: C.navyMid }, line: { color: C.teal, pt: 1.5 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.38, w: 2.95, h: 0.07,
      fill: { color: C.teal }, line: { color: C.teal }
    });
    s.addText(d.name, {
      x: x + 0.12, y: 2.43, w: 2.7, h: 0.32,
      fontSize: 12, bold: true, color: C.teal, fontFace: "Calibri", margin: 0
    });
    s.addText(d.range, {
      x: x + 0.12, y: 2.76, w: 2.7, h: 0.3,
      fontSize: 9, color: C.amber, fontFace: "Calibri", italic: true, margin: 0
    });
    s.addText(d.detail, {
      x: x + 0.12, y: 3.08, w: 2.7, h: 0.58,
      fontSize: 9, color: C.offwhite, fontFace: "Calibri", margin: 0
    });
  });

  // Strengths
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 3.85, w: 4.5, h: 1.3,
    fill: { color: C.navyLight }, line: { color: C.teal, pt: 1 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 3.85, w: 0.07, h: 1.3,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  s.addText("STRENGTHS", {
    x: 0.5, y: 3.88, w: 4.2, h: 0.28,
    fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri", margin: 0
  });
  s.addText([
    { text: "• Essential for TIVA — no end-tidal gas to guide\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Haemodynamically compromised patients\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Prior awareness history, ICU NMB patients\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• May reduce overdose & post-op cognitive effects", options: { color: C.muted } },
  ], { x: 0.5, y: 4.18, w: 4.2, h: 0.95, fontSize: 9.5, fontFace: "Calibri", valign: "top", margin: 0 });

  // Limitations
  s.addShape(pres.shapes.RECTANGLE, {
    x: 5.15, y: 3.85, w: 4.5, h: 1.3,
    fill: { color: C.navyLight }, line: { color: C.red, pt: 1 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 5.15, y: 3.85, w: 0.07, h: 1.3,
    fill: { color: C.red }, line: { color: C.red }
  });
  s.addText("KEY LIMITATIONS", {
    x: 5.3, y: 3.88, w: 4.2, h: 0.28,
    fontSize: 10, bold: true, color: C.red, fontFace: "Calibri", margin: 0
  });
  s.addText([
    { text: "• No proven superiority over end-tidal gas for volatile GA\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Ketamine → cortical excitation → falsely elevated index\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• NMB: loss of EMG drops BIS into target range in awake patient\n", options: { color: C.offwhite, breakLine: false } },
    { text: "• Algorithms trained on young healthy volunteers; BIS 50 ≠ BIS 50 between patients", options: { color: C.muted } },
  ], { x: 5.3, y: 4.18, w: 4.2, h: 0.95, fontSize: 9.5, fontFace: "Calibri", valign: "top", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — RAW EEG / IFT / NIRS / MLAEPs
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Other Depth Monitoring Techniques");
  footer(s);

  const cards4 = [
    {
      title: "Raw EEG / Spectrogram",
      col: C.teal,
      bullets: [
        "Direct visual interpretation of frontal EEG time-frequency spectrogram",
        "Most information-rich window into anaesthetic depth",
        "Drug-specific patterns: propofol — sustained frontal alpha; burst suppression; ketamine — beta/gamma bursts",
        "Can detect wakefulness missed by processed index (e.g. when NMB drops BIS falsely)",
        "LIMITATION: requires EEG expertise; not routine in most ORs",
      ]
    },
    {
      title: "Mid-Latency Auditory Evoked Potentials (MLAEPs)",
      col: C.muted,
      bullets: [
        "Cortical responses to auditory stimuli — change predictably with anaesthetic depth",
        "Among earliest proposed objective depth monitors",
        "LIMITATION: technical complexity, susceptibility to noise, largely superseded by processed EEG",
      ]
    },
    {
      title: "Isolated Forearm Technique (IFT)",
      col: C.amber,
      bullets: [
        "Tourniquet pre-NMB → preserves voluntary motor response in one forearm",
        "Detects conscious response to verbal commands in real time",
        "Gold standard for research detection of covert consciousness",
        "Implicit awareness ~100× more frequent than explicit recall by IFT",
        "LIMITATION: impractical for routine clinical use",
      ]
    },
    {
      title: "Cerebral Oximetry (NIRS)",
      col: C.teal,
      bullets: [
        "Near-infrared spectroscopy → regional cerebral O₂ saturation (rSO₂)",
        "Reflects cerebral perfusion — not a direct consciousness monitor",
        "Useful in cardiac surgery: targeted rSO₂ therapy reduces post-op delirium (Kunst et al.)",
        "Trend vs baseline monitoring recommended; lower threshold guidance",
        "LIMITATION: not awareness-specific; reflects perfusion not sedation depth",
      ]
    },
  ];

  cards4.forEach((c, i) => {
    const x = i % 2 === 0 ? 0.35 : 5.15;
    const y = i < 2 ? 1.45 : 3.1;
    card(s, x, y, 4.5, 1.5, c.title, c.col, c.bullets);
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SUMMARY TABLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  titleBar(s, "Summary: Clinical Value in MD Anaesthesia Practice");
  footer(s);

  // Table header
  const hY = 1.5;
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: hY, w: 9.3, h: 0.4,
    fill: { color: C.navyLight }, line: { color: C.navyLight }
  });
  ["Technique", "Main Value", "Key Limitation / Caveat"].forEach((h, i) => {
    const xArr = [0.45, 3.3, 6.6];
    const wArr = [2.7, 3.2, 3.0];
    s.addText(h, {
      x: xArr[i], y: hY + 0.04, w: wArr[i], h: 0.32,
      fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri", margin: 0
    });
  });

  const rows = [
    ["Clinical Signs", "Universal baseline; always assessed", "Unreliable with NMB or opioids"],
    ["End-Tidal Agent", "Best-validated for volatile GA; simple, continuous", "Inapplicable to TIVA"],
    ["BIS / Entropy", "Essential for TIVA; high-risk patients, prior awareness", "No proven superiority for volatile GA; multiple confounders"],
    ["Raw EEG / Spectrogram", "Highest information content; drug-specific patterns", "Requires specialist EEG expertise"],
    ["IFT", "Research gold standard for covert consciousness", "Impractical for routine clinical use"],
    ["MLAEPs", "Historical depth monitor; cortical evoked responses", "Complex; largely superseded"],
    ["NIRS (cerebral oximetry)", "Cerebral perfusion; cardiac surgery delirium reduction", "Not awareness-specific"],
  ];

  const rowH = 0.52;
  rows.forEach((r, i) => {
    const y = hY + 0.4 + i * rowH;
    const bg = i % 2 === 0 ? C.navyMid : C.navy;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 9.3, h: rowH,
      fill: { color: bg }, line: { color: bg }
    });
    const xArr = [0.45, 3.3, 6.6];
    const wArr = [2.7, 3.2, 3.0];
    const colors = [C.amber, C.offwhite, C.muted];
    r.forEach((cell, j) => {
      s.addText(cell, {
        x: xArr[j], y: y + 0.04, w: wArr[j], h: rowH - 0.08,
        fontSize: 9, color: colors[j], fontFace: "Calibri", valign: "middle", margin: 0
      });
    });
  });

  // ASA note
  s.addText("ASA does not mandate routine brain monitoring for all GAs. Processed EEG most defensible for: TIVA · haemodynamic compromise · prior awareness · cognitive vulnerability.", {
    x: 0.35, y: 5.15, w: 9.3, h: 0.3,
    fontSize: 8.5, color: C.muted, fontFace: "Calibri", italic: true, margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — KEY TAKEAWAYS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };

  // Top accent
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.07,
    fill: { color: C.amber }, line: { color: C.amber }
  });
  // Bottom accent
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.555, w: 10, h: 0.07,
    fill: { color: C.teal }, line: { color: C.teal }
  });

  s.addText("KEY TAKEAWAYS", {
    x: 0.5, y: 0.22, w: 9, h: 0.55,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 3, margin: 0
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 0.82, w: 9, h: 0.04,
    fill: { color: C.teal }, line: { color: C.teal }
  });

  const takeaways = [
    { icon: "01", text: "Explicit awareness = conscious recall; implicit awareness = intraoperative consciousness without recall — both are clinically important.", col: C.teal },
    { icon: "02", text: "High-risk patients: prior awareness, morbid obesity, opioid tolerance, TIVA, haemodynamic compromise, NMB without monitoring.", col: C.amber },
    { icon: "03", text: "End-tidal gas monitoring is the gold standard for volatile GA; processed EEG (BIS/Entropy) is essential for TIVA.", col: C.teal },
    { icon: "04", text: "No single monitor is sufficient in isolation — optimal practice combines multiple modalities, clinical vigilance and structured post-op screening.", col: C.amber },
    { icon: "05", text: "BIS has critical limitations: ketamine falsely elevates it; NMB causes false-negative readings; algorithms poorly generalise across populations.", col: C.red },
  ];

  takeaways.forEach((t, i) => {
    const y = 1.0 + i * 0.87;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.5, y, w: 9, h: 0.77,
      fill: { color: C.navyMid }, line: { color: t.col, pt: 1 }
    });
    s.addText(t.icon, {
      x: 0.62, y: y + 0.07, w: 0.55, h: 0.6,
      fontSize: 16, bold: true, color: t.col, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    s.addText(t.text, {
      x: 1.28, y: y + 0.07, w: 8.1, h: 0.62,
      fontSize: 10.5, color: C.offwhite, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });

  // Source note
  s.addText("Sources: Miller's Anaesthesia 10e · Morgan & Mikhail's Clinical Anaesthesiology 7e · Barash Clinical Anaesthesia 9e · Fuster & Hurst's The Heart 15e", {
    x: 0.5, y: 5.35, w: 9, h: 0.22,
    fontSize: 7.5, color: C.muted, fontFace: "Calibri", italic: true, margin: 0
  });
}

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

cd /home/daytona/workspace/awareness-anaesthesia-ppt && node build.js 2>&1

Running Command

node -e "const p = require('pptxgenjs'); const pres = new p(); console.log(Object.keys(pres.shapes).join('\n'))" 2>&1 | head -40

Running Command

node -e "const p = require('pptxgenjs'); const pres = new p(); console.log(Object.keys(pres.shapes).filter(k => k.includes('RECT') || k.includes('ELLIPSE') || k.includes('OVAL')).join('\n'))"

Editing File

~/awareness-anaesthesia-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/awareness-anaesthesia-ppt/build.js'
Running Command

cd /home/daytona/workspace/awareness-anaesthesia-ppt && node build.js 2>&1

Your presentation is ready:

Awareness During General Anaesthesia

Presentation · PPTX


12 slides on a deep navy / teal / amber colour scheme:
#Slide
1Title slide
2Overview & Incidence (stat cards)
3Explicit Awareness — definition, pre-requisites, Brice Interview
4Implicit Awareness — IFT, 100× frequency stat
5Risk Factors — Patient & Surgical (side-by-side cards)
6Risk Factors — Anaesthetic Technique (TIVA, NMB, syringe swap, etc.)
7Depth Monitoring — all 7 techniques overview
8Clinical Signs & End-Tidal Agent Concentration
9Processed EEG — BIS, Entropy, PSi (strengths + limitations)
10Raw EEG / IFT / MLAEPs / NIRS
11Summary comparison table (all techniques vs value vs caveats)
12Key Takeaways

Guidelines stages of anesthesia in MD anesthesia

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
I now have comprehensive content from the textbooks. Let me compile the full answer:

Stages of Anaesthesia — Guidelines for MD Anaesthesia

There are two distinct classification systems used in anaesthesia, and both are examinable at MD level:
  1. The ASA Continuum of Depth of Sedation — the clinically current, guideline-defined framework
  2. Guedel's Four Stages — the classical, historically foundational staging system

Part 1: The ASA Continuum of Depth of Sedation/Anaesthesia

(ASA Practice Guidelines, last amended 2021; endorsed by TJC and CMS)
This is the operative standard in modern anaesthesia practice. It describes a continuum — patients may drift from one level to the next unpredictably, so providers must always be prepared to manage the unanticipated next level.
LevelMentationAirwayVentilationCardiovascular
Minimal Sedation (anxiolysis)Responds normally to verbal stimuliUnaffectedUnaffectedUnaffected
Moderate Sedation (conscious sedation)Responds purposefully to verbal or tactile stimuliAdequateAdequateUsually maintained
Deep SedationResponds purposefully to repeated verbal or painful stimuliIntervention may be requiredMay be inadequateUsually maintained
General AnaesthesiaUnarousable to painful stimuliIntervention usually requiredFrequently inadequateMay be impaired
Key ASA guideline points:
  • Sedation is a continuum, not a series of discrete steps — the line between levels is subtle and often crossed unexpectedly
  • Deep sedation requires an independent provider dedicated solely to patient monitoring (separate from the proceduralist)
  • For deep sedation: ACLS-trained personnel must be physically present; for moderate sedation: ACLS must be immediately available (1–5 minutes)
  • Monitoring requirements increase with depth: continuous pulse oximetry, capnography (mandatory for deep sedation/GA), haemodynamic monitoring, and response to commands
  • Recognised high-risk groups requiring anaesthesiologist consultation: morbid obesity, OSA, severe cardiopulmonary disease, extremes of age, pregnancy, substance use disorders
  • Appropriate reversal agents (naloxone, flumazenil) and resuscitation equipment must be immediately accessible at all levels
(Barash Clinical Anesthesia 9e, p.2540; Morgan & Mikhail 7e, block7; Lippincott Pharmacology 7e, p.665)

Part 2: Guedel's Four Classical Stages of Anaesthesia

(Derived from observations of diethyl ether inhalation; Katzung Basic & Clinical Pharmacology 16e, p.701)
These describe the progressive CNS depression produced by increasing anaesthetic concentration. Though derived from ether, the conceptual framework remains important for understanding anaesthetic depth and remains part of MD curricula.

Stage I — Analgesia

  • Begins with onset of the anaesthetic; consciousness retained
  • Initially: analgesia without amnesia — patient feels pain but less intensely; oriented and responsive
  • Later in Stage I: analgesia with amnesia — pain sensation blunted, short-term memory impaired
  • Respiration: normal and regular
  • Reflexes: fully intact
  • Clinical correlate: equivalent to light sedation/anxiolysis in modern terms

Stage II — Excitement (Delirium)

  • Loss of consciousness; patient appears delirious, may vocalize, struggle, hold breath, vomit
  • Complete amnesia for this stage
  • Physiological features:
    • Respiration: irregular, rapid, can include breath-holding
    • Heart rate and blood pressure: elevated (sympathetic activation)
    • All reflexes are exaggerated — laryngospasm, bronchospasm, vomiting can occur
    • Pupils: dilated
  • Most dangerous stage — risk of airway compromise, laryngospasm, aspiration
  • Goal: pass through Stage II as rapidly as possible by quickly increasing agent concentration
  • Modern induction with IV agents (propofol) virtually eliminates this stage by bypassing it

Stage III — Surgical Anaesthesia

The clinically targeted zone. Divided into four planes based on ocular signs, reflex activity, and respiratory pattern:
PlaneOcular MovementPupilReflexesRespirationClinical Relevance
Plane 1Roving eye movementsNormal / slightly dilatedLid, conjunctival reflexes presentRegular, slightly deepLight surgical plane
Plane 2Eyes fixed centrallySlightly dilatedCorneal reflex lost; pharyngeal reflex reducedRegular, costal > diaphragmaticSuitable for most superficial surgery
Plane 3Eyes fixedDilatedLoss of laryngeal and peritoneal reflexesDiaphragmatic predominant; intercostal progressively paralysedAbdominal surgery; NMB usually used
Plane 4Eyes fixedMaximally dilatedAll reflexes abolishedIntercostal paralysis complete; diaphragm only, then apnoeaDangerously deep — approaching Stage IV
The corneal reflex loss (Plane 2) and pupillary dilation are classically used clinical markers of anaesthetic depth. Onset of diaphragmatic-only breathing in Plane 3 signals imminent overdose.

Stage IV — Medullary Depression

  • Life-threatening stage — severe CNS depression reaching the medulla
  • Vasomotor centre in the medulla: depressed → cardiovascular collapse, profound hypotension
  • Respiratory centre in the brainstem: depressed → apnoea
  • Without immediate circulatory and respiratory support, death ensues rapidly
  • In clinical practice this is an overdose state — reached by inadvertent overdose, equipment failure, or failure to recognise deepening anaesthesia

Part 3: The Modern 3-Stage Procedural Framework

In routine clinical anaesthesia, the perioperative period is divided into three practical stages:

1. Induction

  • Time from drug administration to establishment of unconsciousness
  • Adults: IV propofol (30–40 seconds to unconsciousness); IV NMB (rocuronium/succinylcholine) for intubation
  • Paediatrics without IV access: inhalational induction with sevoflurane (non-pungent)
  • Rate of induction depends on speed of effective anaesthetic concentration reaching the brain (influenced by cardiac output, blood-gas partition coefficient, alveolar ventilation)

2. Maintenance

  • Sustained period of surgical anaesthesia, carefully titrated to the stimulus
  • Volatile agents (sevoflurane, isoflurane, desflurane) — end-tidal concentration monitoring
  • TIVA with propofol ± remifentanil infusion — requires processed EEG monitoring
  • Balance between hypnosis, analgesia, and muscle relaxation (the anaesthetic triad)
  • Opioids provide analgesia (volatile agents alter consciousness but do not reliably abolish pain perception)

3. Emergence (Recovery)

  • Begins with discontinuation of the maintenance agent; ends with return of consciousness and all protective reflexes
  • Mechanism: primarily redistribution from CNS (not metabolism) for most agents
  • Neuromuscular blockade reversed pharmacologically (neostigmine/sugammadex) unless spontaneously metabolised
  • Confirm: spontaneous ventilation, intact airway reflexes, adequate haemodynamics, return of response to commands
  • Emergence is essentially the reverse of induction — washout of agent from the brain
(Lippincott Pharmacology 7e, pp.665–666; Katzung 16e, pp.700–701)

Summary: Guedel's Stages at a Glance

INCREASING DEPTH OF ANAESTHESIA →

Stage I          Stage II          Stage III (4 Planes)          Stage IV
Analgesia    →  Excitement    →   Surgical Anaesthesia      →   Medullary Depression
                (DANGER ZONE)   (TARGET OPERATING ZONE)        (OVERDOSE/DEATH)
Modern relevance of Guedel's stages:
  • Stage I: describes light sedation / anxiolysis on the ASA continuum
  • Stage II: bypassed by IV induction; guides management of difficult/slow inhalational inductions
  • Stage III: the clinical target; the four planes guide titration and identify when depth is appropriate vs excessive
  • Stage IV: mandates immediate recognition and resuscitation

Sources: Katzung's Basic & Clinical Pharmacology, 16e, pp.700–701; Lippincott Illustrated Reviews Pharmacology, 7e, pp.665–666; Barash Clinical Anaesthesia, 9e, pp.2539–2541; Morgan & Mikhail's Clinical Anaesthesiology, 7e, block7

Make a ppt on Guedels stage of Anaesthesia

Reading File
Running Command

mkdir -p /home/daytona/workspace/guedel-stages-ppt

Writing File

~/guedel-stages-ppt/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Guedel's Stages of Anaesthesia";
pres.author = "MD Anaesthesia";

// ─── COLOUR PALETTE ────────────────────────────────────────────────────────────
// Deep charcoal dominant, deep emerald accent, gold highlight, soft white text
// Each stage will also have its own identity colour
const C = {
  bg:        "0E1B14",   // very deep dark green-charcoal
  bgMid:     "142B1E",   // card bg
  bgLight:   "1C3828",   // lighter panel
  green:     "2DC58C",   // main accent (emerald)
  gold:      "F6C443",   // highlight
  white:     "FFFFFF",
  offwhite:  "DFF0EA",
  muted:     "8FBAAA",
  danger:    "E05C5C",   // Stage II danger
  // Stage colours
  s1:        "5BC4F5",   // Stage I  – sky blue
  s2:        "E05C5C",   // Stage II – red (danger)
  s3:        "2DC58C",   // Stage III – green (target)
  s4:        "9B5DE5",   // Stage IV – purple (death)
};

// ─── HELPER: titleBar ──────────────────────────────────────────────────────────
function titleBar(slide, title, sub, accentColor) {
  const col = accentColor || C.green;
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 1.05,
    fill: { color: col }, line: { color: col }
  });
  slide.addText(title, {
    x: 0.35, y: 0, w: 9.3, h: sub ? 0.68 : 1.05,
    fontSize: 24, bold: true, color: C.bg,
    fontFace: "Calibri", valign: "middle", margin: 0
  });
  if (sub) {
    slide.addText(sub, {
      x: 0.35, y: 0.68, w: 9.3, h: 0.37,
      fontSize: 11, color: C.bg, fontFace: "Calibri",
      valign: "top", margin: 0, italic: true
    });
  }
}

// ─── HELPER: footer ────────────────────────────────────────────────────────────
function footer(slide, txt) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.42, w: 10, h: 0.205,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  slide.addText(txt || "MD Anaesthesia  ·  Guedel's Stages of Anaesthesia  ·  Katzung 16e / Lippincott Pharmacology 7e", {
    x: 0.3, y: 5.42, w: 9.4, h: 0.205,
    fontSize: 7.5, color: C.muted, fontFace: "Calibri", valign: "middle", margin: 0
  });
}

// ─── HELPER: card ──────────────────────────────────────────────────────────────
function card(slide, x, y, w, h, label, col, bullets) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: C.bgMid }, line: { color: col, pt: 1.5 },
    shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.2 }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h: 0.065,
    fill: { color: col }, line: { color: col }
  });
  if (label) {
    slide.addText(label, {
      x: x + 0.13, y: y + 0.08, w: w - 0.26, h: 0.3,
      fontSize: 10.5, bold: true, color: col,
      fontFace: "Calibri", margin: 0
    });
  }
  if (bullets && bullets.length) {
    const items = bullets.map((b, i) => ({
      text: b,
      options: {
        bullet: { code: "2022" }, fontSize: 9.5, color: C.offwhite,
        fontFace: "Calibri", breakLine: i < bullets.length - 1
      }
    }));
    slide.addText(items, {
      x: x + 0.14, y: y + 0.42, w: w - 0.28, h: h - 0.52,
      valign: "top", margin: 0
    });
  }
}

// ─── HELPER: stage badge ───────────────────────────────────────────────────────
function stageBadge(slide, x, y, stageLabel, stageNum, col) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w: 2.0, h: 0.75,
    fill: { color: col }, line: { color: col }
  });
  slide.addText(stageNum, {
    x: x + 0.08, y: y + 0.03, w: 2.0, h: 0.3,
    fontSize: 11, bold: true, color: C.bg, fontFace: "Calibri",
    align: "center", margin: 0
  });
  slide.addText(stageLabel, {
    x: x + 0.08, y: y + 0.34, w: 1.84, h: 0.35,
    fontSize: 12, bold: true, color: C.bg, fontFace: "Calibri",
    align: "center", valign: "top", margin: 0
  });
}

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

  // Left thick accent strip
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.25, h: 5.625,
    fill: { color: C.green }, line: { color: C.green }
  });

  // Decorative depth-gradient bars (visual metaphor for deepening anaesthesia)
  const stageColors = [C.s1, C.s2, C.s3, C.s4];
  stageColors.forEach((col, i) => {
    s.addShape(pres.shapes.RECTANGLE, {
      x: 7.5 + i * 0.62, y: 0, w: 0.58, h: 5.625,
      fill: { color: col, transparency: 80 }, line: { color: col, transparency: 70, pt: 0 }
    });
  });

  s.addText("GUEDEL'S STAGES OF", {
    x: 0.55, y: 0.8, w: 7.1, h: 0.75,
    fontSize: 38, bold: true, color: C.white,
    fontFace: "Calibri", charSpacing: 2, margin: 0
  });
  s.addText("ANAESTHESIA", {
    x: 0.55, y: 1.52, w: 7.1, h: 0.75,
    fontSize: 38, bold: true, color: C.green,
    fontFace: "Calibri", charSpacing: 2, margin: 0
  });

  // Horizontal divider
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.55, y: 2.38, w: 6.6, h: 0.055,
    fill: { color: C.gold }, line: { color: C.gold }
  });

  s.addText("Classical Staging of CNS Depression by Increasing Anaesthetic Depth", {
    x: 0.55, y: 2.52, w: 6.6, h: 0.45,
    fontSize: 14, color: C.muted, fontFace: "Calibri", margin: 0
  });

  s.addText("Based on diethyl ether · Described by Arthur Ernest Guedel (1920s)", {
    x: 0.55, y: 3.05, w: 6.6, h: 0.35,
    fontSize: 11, color: C.muted, fontFace: "Calibri", italic: true, margin: 0
  });

  // Stage labels at bottom
  const stageData = [
    { label: "Stage I", name: "Analgesia", col: C.s1 },
    { label: "Stage II", name: "Excitement", col: C.s2 },
    { label: "Stage III", name: "Surgical", col: C.s3 },
    { label: "Stage IV", name: "Medullary", col: C.s4 },
  ];
  stageData.forEach((sd, i) => {
    const x = 0.55 + i * 1.7;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 3.65, w: 1.55, h: 1.4,
      fill: { color: sd.col, transparency: 82 },
      line: { color: sd.col, pt: 1.5 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 3.65, w: 1.55, h: 0.06,
      fill: { color: sd.col }, line: { color: sd.col }
    });
    s.addText(sd.label, {
      x: x + 0.07, y: 3.72, w: 1.41, h: 0.38,
      fontSize: 12, bold: true, color: sd.col, fontFace: "Calibri",
      align: "center", margin: 0
    });
    s.addText(sd.name, {
      x: x + 0.07, y: 4.12, w: 1.41, h: 0.82,
      fontSize: 11, color: C.offwhite, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
  });

  s.addText("MD Anaesthesia", {
    x: 0.55, y: 5.2, w: 4, h: 0.3,
    fontSize: 9, color: C.muted, fontFace: "Calibri", italic: true, margin: 0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – HISTORICAL CONTEXT + OVERVIEW
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Historical Context & Overview", "Arthur Ernest Guedel, 1920s — diethyl ether observations");
  footer(s);

  // Historical box
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.2, w: 9.3, h: 1.15,
    fill: { color: C.bgMid }, line: { color: C.gold, pt: 1.5 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.2, w: 0.065, h: 1.15,
    fill: { color: C.gold }, line: { color: C.gold }
  });
  s.addText([
    { text: "Guedel's classification ", options: { bold: true, color: C.gold } },
    { text: "describes four stages of progressively deepening CNS depression produced by inhalational anaesthetics. Originally derived from observations of ", options: { color: C.white } },
    { text: "diethyl ether", options: { bold: true, italic: true, color: C.offwhite } },
    { text: ", the framework remains foundational for understanding anaesthetic depth, guiding titration, and detecting overdose. Modern IV induction agents bypass Stage II almost entirely.", options: { color: C.white } }
  ], { x: 0.55, y: 1.25, w: 9.0, h: 1.05, fontSize: 11, fontFace: "Calibri", valign: "middle", margin: 0 });

  // 4 stage summary mini-cards
  const stages = [
    { num: "I", name: "ANALGESIA", desc: "Conscious · Analgesia ± Amnesia · Reflexes intact", col: C.s1 },
    { num: "II", name: "EXCITEMENT", desc: "Unconscious · Delirium · Irregular breathing · DANGER ZONE", col: C.s2 },
    { num: "III", name: "SURGICAL ANAESTHESIA", desc: "Target zone · 4 planes · Reflexes progressively lost", col: C.s3 },
    { num: "IV", name: "MEDULLARY DEPRESSION", desc: "Overdose · Apnoea · CV collapse · Death", col: C.s4 },
  ];
  stages.forEach((st, i) => {
    const x = 0.35 + i * 2.35;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.55, w: 2.2, h: 2.6,
      fill: { color: st.col, transparency: 88 },
      line: { color: st.col, pt: 1.8 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.55, w: 2.2, h: 0.065,
      fill: { color: st.col }, line: { color: st.col }
    });
    s.addText(`STAGE ${st.num}`, {
      x: x + 0.1, y: 2.62, w: 2.0, h: 0.3,
      fontSize: 10, bold: true, color: st.col, fontFace: "Calibri",
      align: "center", margin: 0
    });
    s.addText(st.name, {
      x: x + 0.1, y: 2.94, w: 2.0, h: 0.55,
      fontSize: 12, bold: true, color: C.white, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x: x + 0.15, y: 3.52, w: 1.9, h: 0.03,
      fill: { color: st.col, transparency: 60 }, line: { color: st.col, transparency: 60 }
    });
    s.addText(st.desc, {
      x: x + 0.1, y: 3.6, w: 2.0, h: 1.4,
      fontSize: 9.5, color: C.offwhite, fontFace: "Calibri",
      align: "center", valign: "top", margin: 0
    });
  });

  // Arrow showing increasing depth
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 5.15, w: 9.0, h: 0.18,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  s.addText("◄  LIGHTER  ──────────── INCREASING DEPTH OF ANAESTHESIA ──────────────  DEEPER ►", {
    x: 0.35, y: 5.15, w: 9.0, h: 0.18,
    fontSize: 8, color: C.muted, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – STAGE I: ANALGESIA
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Stage I — Analgesia", null, C.s1);
  footer(s);

  // Stage badge left column
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.2, w: 2.3, h: 3.95,
    fill: { color: C.s1, transparency: 88 }, line: { color: C.s1, pt: 1.5 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.2, w: 0.065, h: 3.95,
    fill: { color: C.s1 }, line: { color: C.s1 }
  });
  s.addText("STAGE", {
    x: 0.42, y: 1.35, w: 2.16, h: 0.4,
    fontSize: 14, bold: true, color: C.s1, fontFace: "Calibri",
    align: "center", charSpacing: 4, margin: 0
  });
  s.addText("I", {
    x: 0.42, y: 1.75, w: 2.16, h: 1.2,
    fontSize: 72, bold: true, color: C.s1, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("ANALGESIA", {
    x: 0.42, y: 2.98, w: 2.16, h: 0.45,
    fontSize: 13, bold: true, color: C.white, fontFace: "Calibri",
    align: "center", charSpacing: 2, margin: 0
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.6, y: 3.5, w: 1.8, h: 0.035,
    fill: { color: C.s1, transparency: 50 }, line: { color: C.s1, transparency: 50 }
  });
  s.addText("Conscious\nReactive\nProtective\nReflexes Intact", {
    x: 0.42, y: 3.6, w: 2.16, h: 1.4,
    fontSize: 9.5, color: C.muted, fontFace: "Calibri",
    align: "center", valign: "top", margin: 0
  });

  // Right: feature cards
  const features = [
    {
      title: "Phase A — Analgesia without Amnesia",
      col: C.s1,
      items: [
        "Patient conscious and oriented",
        "Pain sensation reduced but not abolished",
        "Memory intact — patient can recall events",
        "Protective reflexes fully active",
      ]
    },
    {
      title: "Phase B — Analgesia with Amnesia",
      col: C.gold,
      items: [
        "Deeper within Stage I",
        "Analgesia more complete",
        "Short-term memory now impaired (amnesia begins)",
        "Still responds to verbal commands",
        "Equivalent to modern anxiolysis / minimal sedation",
      ]
    },
  ];
  features.forEach((f, i) => {
    const y = 1.2 + i * 2.0;
    card(s, 2.85, y, 6.8, 1.82, f.title, f.col, f.items);
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – STAGE II: EXCITEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Stage II — Excitement (Delirium)", null, C.s2);
  footer(s);

  // WARNING banner
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.12, w: 9.3, h: 0.42,
    fill: { color: C.s2, transparency: 82 }, line: { color: C.s2, pt: 1.5 }
  });
  s.addText("⚠  DANGER ZONE  —  Pass through as rapidly as possible  —  Risk of laryngospasm, bronchospasm, vomiting, aspiration", {
    x: 0.45, y: 1.15, w: 9.1, h: 0.36,
    fontSize: 10, bold: true, color: C.s2, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  // Stage badge
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.65, w: 2.3, h: 3.5,
    fill: { color: C.s2, transparency: 88 }, line: { color: C.s2, pt: 1.5 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.65, w: 0.065, h: 3.5,
    fill: { color: C.s2 }, line: { color: C.s2 }
  });
  s.addText("STAGE", {
    x: 0.42, y: 1.8, w: 2.16, h: 0.4,
    fontSize: 14, bold: true, color: C.s2, fontFace: "Calibri",
    align: "center", charSpacing: 4, margin: 0
  });
  s.addText("II", {
    x: 0.42, y: 2.2, w: 2.16, h: 1.1,
    fontSize: 72, bold: true, color: C.s2, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("EXCITEMENT", {
    x: 0.42, y: 3.35, w: 2.16, h: 0.45,
    fontSize: 12, bold: true, color: C.white, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("DELIRIUM", {
    x: 0.42, y: 3.82, w: 2.16, h: 0.35,
    fontSize: 12, bold: true, color: C.s2, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("Unconscious\nAmnesic\nUnpredictable", {
    x: 0.42, y: 4.25, w: 2.16, h: 0.75,
    fontSize: 9.5, color: C.muted, fontFace: "Calibri",
    align: "center", valign: "top", margin: 0
  });

  // Right panels
  card(s, 2.85, 1.65, 6.8, 1.65, "Clinical Features", C.s2, [
    "Patient unconscious but appears delirious — may vocalise, struggle, hold breath",
    "Complete amnesia — patient has NO recall of this stage",
    "Respiration: rapid and IRREGULAR; breath-holding common",
    "Heart rate and blood pressure: ELEVATED (sympathetic activation)",
    "All reflexes exaggerated — hypersalivation, retching",
  ]);

  card(s, 2.85, 3.42, 6.8, 1.65, "Hazards & Management", C.gold, [
    "Laryngospasm — most dangerous complication; can cause hypoxia",
    "Bronchospasm — airway hyper-reactivity at this light plane",
    "Vomiting → aspiration pneumonitis risk (Mendelson syndrome)",
    "Management: increase anaesthetic concentration RAPIDLY to move into Stage III",
    "Modern practice: IV propofol induction bypasses Stage II almost completely",
  ]);
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – STAGE III OVERVIEW: THE 4 PLANES
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Stage III — Surgical Anaesthesia: The Four Planes", null, C.s3);
  footer(s);

  // Intro
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.13, w: 9.3, h: 0.65,
    fill: { color: C.bgMid }, line: { color: C.s3, pt: 1.5 }
  });
  s.addText([
    { text: "The clinical target zone. ", options: { bold: true, color: C.gold } },
    { text: "Divided into 4 planes of increasing depth, characterised by changes in ", options: { color: C.white } },
    { text: "ocular movements, eye reflexes, pupil size, and respiratory pattern.", options: { bold: true, color: C.offwhite } }
  ], { x: 0.5, y: 1.17, w: 9.1, h: 0.57, fontSize: 11, fontFace: "Calibri", valign: "middle", margin: 0 });

  // 4 plane cards in 2×2 grid
  const planes = [
    {
      num: "Plane 1", sub: "Light Plane",
      col: "#5FDC9E",  // lighter green
      items: [
        "Eyes: roving movements present",
        "Pupils: normal / mildly dilated",
        "Reflexes: lid and conjunctival reflexes present",
        "Respiration: regular, slightly deepened",
        "Use: light superficial procedures only",
      ]
    },
    {
      num: "Plane 2", sub: "Moderate Plane",
      col: C.s3,
      items: [
        "Eyes: fixed centrally, no movement",
        "Pupils: mildly dilated",
        "CORNEAL REFLEX LOST — key landmark",
        "Pharyngeal reflex reduced",
        "Respiration: regular, costal > diaphragmatic",
        "Use: most superficial surgeries",
      ]
    },
    {
      num: "Plane 3", sub: "Deep Surgical Plane",
      col: C.gold,
      items: [
        "Eyes: fixed, divergent",
        "Pupils: dilated",
        "Laryngeal & peritoneal reflexes LOST",
        "Respiration: diaphragmatic predominant; intercostal paralysis begins",
        "Use: abdominal surgery; NMB usually added",
        "CAUTION: approaching dangerous depth",
      ]
    },
    {
      num: "Plane 4", sub: "Very Deep — Danger",
      col: C.s2,
      items: [
        "Eyes: fixed, pupils MAXIMALLY dilated",
        "All reflexes abolished",
        "Intercostal muscles completely paralysed",
        "Ventilation: diaphragm only → then apnoea",
        "DANGER: imminent medullary depression",
        "Reduce concentration immediately",
      ]
    },
  ];
  planes.forEach((pl, i) => {
    const x = i % 2 === 0 ? 0.35 : 5.2;
    const y = i < 2 ? 1.9 : 3.65;
    const col = pl.col;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 4.6, h: 1.6,
      fill: { color: C.bgMid }, line: { color: col, pt: 1.5 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 4.6, h: 0.065,
      fill: { color: col }, line: { color: col }
    });
    s.addText(pl.num, {
      x: x + 0.12, y: y + 0.07, w: 2.2, h: 0.28,
      fontSize: 11, bold: true, color: col, fontFace: "Calibri", margin: 0
    });
    s.addText(pl.sub, {
      x: x + 2.35, y: y + 0.08, w: 2.1, h: 0.25,
      fontSize: 9, color: C.muted, italic: true, fontFace: "Calibri",
      align: "right", margin: 0
    });
    const items = pl.items.map((b, j) => ({
      text: b,
      options: {
        bullet: { code: "2022" }, fontSize: 8.8, color: C.offwhite,
        fontFace: "Calibri", breakLine: j < pl.items.length - 1
      }
    }));
    s.addText(items, {
      x: x + 0.14, y: y + 0.4, w: 4.32, h: 1.1,
      valign: "top", margin: 0
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – STAGE III: DETAILED PLANE COMPARISON TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Stage III — Detailed Comparison: The Four Planes", null, C.s3);
  footer(s);

  // Table header
  const hdrs = ["Parameter", "Plane 1", "Plane 2", "Plane 3", "Plane 4"];
  const colW = [2.2, 1.75, 1.75, 1.75, 1.75];
  const colX = [0.35, 2.55, 4.3, 6.05, 7.8];
  const colClrs = [C.green, "#5FDC9E", C.s3, C.gold, C.s2];
  const hY = 1.12;

  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: hY, w: 9.3, h: 0.38,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  hdrs.forEach((h, i) => {
    s.addText(h, {
      x: colX[i] + 0.07, y: hY + 0.05, w: colW[i] - 0.14, h: 0.28,
      fontSize: 9.5, bold: true, color: colClrs[i], fontFace: "Calibri", margin: 0
    });
  });

  const rows = [
    ["Eye movement",    "Roving",          "Fixed central",   "Fixed divergent", "Fixed"],
    ["Pupil size",      "Normal",          "Mildly dilated",  "Dilated",         "Max dilated"],
    ["Eyelid reflex",   "Present",         "Present",         "Lost",            "Lost"],
    ["Conjunctival reflex","Present",      "Present",         "Lost",            "Lost"],
    ["Corneal reflex",  "Present",         "LOST ✓",          "Lost",            "Lost"],
    ["Laryngeal reflex","Present",         "Present",         "LOST ✓",          "Lost"],
    ["Peritoneal reflex","Present",        "Present",         "LOST ✓",          "Lost"],
    ["Respiration",     "Regular, deep",   "Costal > diaphr.", "Diaphr. only",   "Apnoea →"],
    ["Clinical use",    "Light procedures","Superficial surg.","Abdominal surg.", "DANGER"],
  ];

  const rowH = 0.39;
  rows.forEach((row, ri) => {
    const y = hY + 0.38 + ri * rowH;
    const bg = ri % 2 === 0 ? C.bgMid : C.bg;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 9.3, h: rowH,
      fill: { color: bg }, line: { color: bg }
    });
    row.forEach((cell, ci) => {
      const isHeader = ci === 0;
      const isKey = cell.includes("LOST ✓") || cell.includes("DANGER") || cell.includes("Apnoea");
      const textCol = isKey ? C.s2 : isHeader ? C.offwhite : C.muted;
      const isBold = isKey || isHeader;
      s.addText(cell, {
        x: colX[ci] + 0.07, y: y + 0.04, w: colW[ci] - 0.14, h: rowH - 0.08,
        fontSize: 9, bold: isBold, color: textCol, fontFace: "Calibri",
        valign: "middle", margin: 0
      });
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – STAGE IV: MEDULLARY DEPRESSION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Stage IV — Medullary Depression", null, C.s4);
  footer(s);

  // Large dramatic warning zone
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.12, w: 9.3, h: 0.5,
    fill: { color: C.s4, transparency: 82 }, line: { color: C.s4, pt: 1.5 }
  });
  s.addText("OVERDOSE STATE  —  IMMEDIATE INTERVENTION REQUIRED  —  Without support, death ensues rapidly", {
    x: 0.45, y: 1.16, w: 9.1, h: 0.42,
    fontSize: 10.5, bold: true, color: C.s4, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  // Badge
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.72, w: 2.3, h: 3.4,
    fill: { color: C.s4, transparency: 88 }, line: { color: C.s4, pt: 1.5 }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.72, w: 0.065, h: 3.4,
    fill: { color: C.s4 }, line: { color: C.s4 }
  });
  s.addText("STAGE", {
    x: 0.42, y: 1.87, w: 2.16, h: 0.4,
    fontSize: 14, bold: true, color: C.s4, fontFace: "Calibri",
    align: "center", charSpacing: 4, margin: 0
  });
  s.addText("IV", {
    x: 0.42, y: 2.27, w: 2.16, h: 1.1,
    fontSize: 72, bold: true, color: C.s4, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("MEDULLARY\nDEPRESSION", {
    x: 0.42, y: 3.4, w: 2.16, h: 0.65,
    fontSize: 11, bold: true, color: C.white, fontFace: "Calibri",
    align: "center", margin: 0
  });
  s.addText("Overdose\nApnoea\nCollapse", {
    x: 0.42, y: 4.12, w: 2.16, h: 0.85,
    fontSize: 9.5, color: C.muted, fontFace: "Calibri",
    align: "center", valign: "top", margin: 0
  });

  // Right panels
  card(s, 2.85, 1.72, 6.8, 1.6, "Clinical Features", C.s4, [
    "Severe depression of ALL CNS centres including the medulla",
    "Vasomotor centre depressed → profound hypotension, cardiovascular collapse",
    "Respiratory centre in brainstem depressed → APNOEA",
    "Pupils: MAXIMALLY and bilaterally dilated, unresponsive to light",
    "All reflexes abolished — patient completely unresponsive",
  ]);

  card(s, 2.85, 3.42, 6.8, 1.6, "Management & Modern Relevance", C.gold, [
    "Immediately REDUCE or CEASE anaesthetic agent delivery",
    "Provide circulatory support: vasopressors, IV fluids, CPR if arrest",
    "Provide ventilatory support: manual/mechanical ventilation with 100% O₂",
    "Modern cause: inadvertent overdose, vaporiser malfunction, syringe error",
    "Prevention: continuous end-tidal agent monitoring; processed EEG (BIS/Entropy)",
  ]);
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – GUEDEL'S SIGNS: RESPIRATORY PROGRESSION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Guedel's Signs — Respiratory Pattern Across Stages", null, C.green);
  footer(s);

  const respData = [
    { stage: "Stage I", col: C.s1, pattern: "Regular, normal rate and depth", note: "Fully intact respiratory drive" },
    { stage: "Stage II", col: C.s2, pattern: "Rapid, irregular; breath-holding common", note: "Sympathetic activation; unpredictable" },
    { stage: "Stage III Plane 1", col: "#5FDC9E", pattern: "Regular, slightly deepened", note: "Costal + diaphragmatic" },
    { stage: "Stage III Plane 2", col: C.s3, pattern: "Regular; costal predominant", note: "Diaphragmatic component present" },
    { stage: "Stage III Plane 3", col: C.gold, pattern: "Diaphragmatic only; intercostals begin to fail", note: "WATCH CAREFULLY — sign of excessive depth" },
    { stage: "Stage III Plane 4", col: C.s2, pattern: "Diaphragm only → approaching apnoea", note: "DANGER — reduce agent immediately" },
    { stage: "Stage IV", col: C.s4, pattern: "APNOEA — complete cessation", note: "Medullary respiratory centre depressed" },
  ];

  const rowH = 0.59;
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.12, w: 9.3, h: 0.34,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  ["Stage / Plane", "Respiratory Pattern", "Clinical Note"].forEach((h, i) => {
    const xs = [0.45, 3.05, 6.65];
    const ws = [2.5, 3.5, 2.85];
    s.addText(h, {
      x: xs[i], y: 1.15, w: ws[i], h: 0.28,
      fontSize: 9.5, bold: true, color: C.green, fontFace: "Calibri", margin: 0
    });
  });

  respData.forEach((r, i) => {
    const y = 1.46 + i * rowH;
    const bg = i % 2 === 0 ? C.bgMid : C.bg;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 9.3, h: rowH,
      fill: { color: bg }, line: { color: bg }
    });
    // Stage label
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 0.065, h: rowH,
      fill: { color: r.col }, line: { color: r.col }
    });
    s.addText(r.stage, {
      x: 0.48, y: y + 0.08, w: 2.42, h: rowH - 0.16,
      fontSize: 9.5, bold: true, color: r.col, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    const isDanger = r.pattern.includes("APNOEA") || r.pattern.includes("DANGER");
    s.addText(r.pattern, {
      x: 3.05, y: y + 0.08, w: 3.45, h: rowH - 0.16,
      fontSize: 9.5, color: isDanger ? C.s2 : C.offwhite, bold: isDanger,
      fontFace: "Calibri", valign: "middle", margin: 0
    });
    s.addText(r.note, {
      x: 6.65, y: y + 0.08, w: 2.85, h: rowH - 0.16,
      fontSize: 9, color: C.muted, italic: true,
      fontFace: "Calibri", valign: "middle", margin: 0
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – PUPILLARY & REFLEX CHANGES
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Guedel's Signs — Pupillary & Reflex Changes", null, C.green);
  footer(s);

  // Pupil size visualisation
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.12, w: 9.3, h: 0.3,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  s.addText("PUPIL SIZE — increases with depth of anaesthesia (and with Stage II excitement)", {
    x: 0.45, y: 1.14, w: 9.1, h: 0.26,
    fontSize: 9.5, bold: true, color: C.green, fontFace: "Calibri", valign: "middle", margin: 0
  });

  // Pupil circles (visual representation)
  const pupils = [
    { label: "Stage I", d: 0.22, col: C.s1 },
    { label: "Stage II", d: 0.35, col: C.s2 },
    { label: "Plane 1", d: 0.22, col: "#5FDC9E" },
    { label: "Plane 2", d: 0.28, col: C.s3 },
    { label: "Plane 3", d: 0.38, col: C.gold },
    { label: "Plane 4", d: 0.48, col: C.s2 },
    { label: "Stage IV", d: 0.55, col: C.s4 },
  ];
  const pupilStartX = 0.6;
  const pupilSpacing = 1.3;
  pupils.forEach((p, i) => {
    const cx = pupilStartX + i * pupilSpacing;
    const cy = 1.85;
    const r = p.d;
    s.addShape(pres.shapes.OVAL, {
      x: cx - r / 2, y: cy - r / 2, w: r, h: r,
      fill: { color: "000000" }, line: { color: p.col, pt: 2 }
    });
    s.addText(p.label, {
      x: cx - 0.55, y: cy + r / 2 + 0.08, w: 1.1, h: 0.3,
      fontSize: 8.5, color: p.col, fontFace: "Calibri",
      align: "center", margin: 0
    });
  });

  // Reflex summary table
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 2.62, w: 9.3, h: 0.32,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  s.addText("KEY REFLEXES — order of loss with increasing depth", {
    x: 0.45, y: 2.65, w: 9.1, h: 0.26,
    fontSize: 9.5, bold: true, color: C.green, fontFace: "Calibri", valign: "middle", margin: 0
  });

  const reflexes = [
    { reflex: "Lid / Blink Reflex", lostAt: "Stage III Plane 3", importance: "Loss = deeper than needed for superficial procedures" },
    { reflex: "Conjunctival Reflex", lostAt: "Stage III Plane 3", importance: "Parallels lid reflex" },
    { reflex: "Corneal Reflex", lostAt: "Stage III Plane 2", importance: "KEY LANDMARK — confirms adequate surgical depth" },
    { reflex: "Pharyngeal / Gag Reflex", lostAt: "Stage III Plane 2–3", importance: "Risk of aspiration when lost without airway protection" },
    { reflex: "Laryngeal Reflex", lostAt: "Stage III Plane 3", importance: "Required for endotracheal intubation without NMB" },
    { reflex: "Peritoneal / Somatic Reflex", lostAt: "Stage III Plane 3", importance: "Needed for abdominal surgery without NMB" },
    { reflex: "All reflexes", lostAt: "Stage IV", importance: "Medullary overdose — death without support" },
  ];

  const rH = 0.365;
  reflexes.forEach((r, i) => {
    const y = 2.94 + i * rH;
    const bg = i % 2 === 0 ? C.bgMid : C.bg;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 9.3, h: rH,
      fill: { color: bg }, line: { color: bg }
    });
    const isKey = r.reflex.includes("Corneal") || r.reflex.includes("All");
    s.addText(r.reflex, {
      x: 0.45, y: y + 0.04, w: 2.8, h: rH - 0.08,
      fontSize: 9, bold: isKey, color: isKey ? C.gold : C.offwhite,
      fontFace: "Calibri", valign: "middle", margin: 0
    });
    s.addText(r.lostAt, {
      x: 3.35, y: y + 0.04, w: 2.4, h: rH - 0.08,
      fontSize: 9, color: C.s2, fontFace: "Calibri", valign: "middle", margin: 0
    });
    s.addText(r.importance, {
      x: 5.85, y: y + 0.04, w: 3.7, h: rH - 0.08,
      fontSize: 8.5, color: C.muted, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – MODERN RELEVANCE + COMPARISON WITH ASA CONTINUUM
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  titleBar(s, "Guedel's Stages — Modern Relevance & ASA Continuum", null, C.green);
  footer(s);

  // Correlation table
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.12, w: 9.3, h: 0.32,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  ["Guedel's Stage", "Modern ASA Level", "Key Clinical Correlate"].forEach((h, i) => {
    const xs = [0.45, 3.3, 6.2];
    s.addText(h, {
      x: xs[i], y: 1.14, w: 2.7, h: 0.26,
      fontSize: 9.5, bold: true, color: C.green, fontFace: "Calibri", margin: 0
    });
  });

  const corrRows = [
    ["Stage I (analgesia without amnesia)", "Minimal Sedation (Anxiolysis)", "Verbal response intact; N₂O analgesia"],
    ["Stage I (analgesia with amnesia)", "Moderate Sedation", "Purposeful response; amnesia present"],
    ["Stage II (excitement)", "(Transition — not targeted)", "Bypassed by IV propofol induction"],
    ["Stage III Planes 1–2", "Deep Sedation → General Anaesthesia", "Surgical target; most elective procedures"],
    ["Stage III Planes 3–4", "Deep General Anaesthesia", "Major abdominal/thoracic; NMB used"],
    ["Stage IV", "Overdose / Resuscitation", "Medullary failure — ACLS required"],
  ];

  const rowH = 0.55;
  corrRows.forEach((r, i) => {
    const y = 1.44 + i * rowH;
    const bg = i % 2 === 0 ? C.bgMid : C.bg;
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 9.3, h: rowH,
      fill: { color: bg }, line: { color: bg }
    });
    const stageColors2 = [C.s1, C.s1, C.s2, C.s3, C.gold, C.s4];
    s.addText(r[0], {
      x: 0.45, y: y + 0.06, w: 2.7, h: rowH - 0.12,
      fontSize: 9, bold: true, color: stageColors2[i], fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(r[1], {
      x: 3.3, y: y + 0.06, w: 2.75, h: rowH - 0.12,
      fontSize: 9, color: C.offwhite, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(r[2], {
      x: 6.2, y: y + 0.06, w: 3.35, h: rowH - 0.12,
      fontSize: 9, color: C.muted, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
  });

  // Bottom insight panels
  card(s, 0.35, 4.76, 4.5, 0.54, null, C.gold, null);
  s.addText([
    { text: "IV propofol induction:", options: { bold: true, color: C.gold } },
    { text: " eliminates Stage II entirely; unconsciousness in 30–40 sec", options: { color: C.offwhite } }
  ], { x: 0.5, y: 4.8, w: 4.2, h: 0.44, fontSize: 9.5, fontFace: "Calibri", valign: "middle", margin: 0 });

  card(s, 5.15, 4.76, 4.5, 0.54, null, C.s3, null);
  s.addText([
    { text: "NMB in modern practice:", options: { bold: true, color: C.s3 } },
    { text: " allows Stage III Plane 3 procedures at lighter hypnotic depth (muscle relaxation externalised)", options: { color: C.offwhite } }
  ], { x: 5.3, y: 4.8, w: 4.2, h: 0.44, fontSize: 9.5, fontFace: "Calibri", valign: "middle", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – SUMMARY: STAGE-BY-STAGE AT A GLANCE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };

  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.08,
    fill: { color: C.green }, line: { color: C.green }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.545, w: 10, h: 0.08,
    fill: { color: C.gold }, line: { color: C.gold }
  });

  s.addText("GUEDEL'S STAGES — SUMMARY", {
    x: 0.4, y: 0.12, w: 9.2, h: 0.52,
    fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 3, margin: 0
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 0.68, w: 9.2, h: 0.04,
    fill: { color: C.green }, line: { color: C.green }
  });

  const summaryCards = [
    {
      stage: "STAGE I", name: "Analgesia",
      col: C.s1,
      lines: ["Conscious; pain reduced", "Phase A: no amnesia", "Phase B: + amnesia", "Reflexes intact"]
    },
    {
      stage: "STAGE II", name: "Excitement",
      col: C.s2,
      lines: ["Unconscious; delirious", "Complete amnesia", "Irregular breathing", "DANGER: laryngospasm"]
    },
    {
      stage: "STAGE III", name: "Surgical Anaesthesia",
      col: C.s3,
      lines: ["4 Planes of depth", "Corneal reflex: lost Plane 2", "Peritoneal: lost Plane 3", "TARGET ZONE for surgery"]
    },
    {
      stage: "STAGE IV", name: "Medullary Depression",
      col: C.s4,
      lines: ["Apnoea", "CV collapse", "All reflexes gone", "Death without support"]
    },
  ];

  summaryCards.forEach((sc, i) => {
    const x = 0.35 + i * 2.35;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 0.82, w: 2.2, h: 4.5,
      fill: { color: sc.col, transparency: 88 },
      line: { color: sc.col, pt: 2 }
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 0.82, w: 2.2, h: 0.07,
      fill: { color: sc.col }, line: { color: sc.col }
    });
    s.addText(sc.stage, {
      x: x + 0.1, y: 0.9, w: 2.0, h: 0.3,
      fontSize: 10, bold: true, color: sc.col, fontFace: "Calibri",
      align: "center", charSpacing: 2, margin: 0
    });
    s.addText(sc.name, {
      x: x + 0.1, y: 1.22, w: 2.0, h: 0.8,
      fontSize: 14, bold: true, color: C.white, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x: x + 0.2, y: 2.08, w: 1.8, h: 0.04,
      fill: { color: sc.col, transparency: 60 }, line: { color: sc.col, transparency: 60 }
    });
    const items = sc.lines.map((b, j) => ({
      text: b,
      options: {
        bullet: { code: "2022" }, fontSize: 10, color: C.offwhite,
        fontFace: "Calibri", breakLine: j < sc.lines.length - 1
      }
    }));
    s.addText(items, {
      x: x + 0.14, y: 2.18, w: 1.92, h: 2.95,
      valign: "top", margin: 0
    });
  });

  // Depth arrow
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 5.37, w: 9.3, h: 0.16,
    fill: { color: C.bgLight }, line: { color: C.bgLight }
  });
  s.addText("◄  LIGHTER  ────────────────── INCREASING DEPTH OF ANAESTHESIA ──────────────────  DEEPER ►", {
    x: 0.35, y: 5.37, w: 9.3, h: 0.16,
    fontSize: 7.5, color: C.muted, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/guedel-stages-ppt/Guedels_Stages_of_Anaesthesia.pptx" })
  .then(() => console.log("Done"))
  .catch(e => { console.error(e); process.exit(1); });
Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.