Diffrence between chikitsa sutra and siddhanta

Searching the Web

difference between Chikitsa Sutra and Siddhanta in Ayurveda

Finding Sources
Reading Web Page

https://jaims.in/jaims/article/view/2131/2658

Here is a thorough comparison of Chikitsa Sutra and Siddhanta in Ayurveda:

Chikitsa Sutra vs. Siddhanta

1. Meaning and Definition

AspectChikitsa SutraSiddhanta
Literal meaning"Therapeutic aphorisms / rules of treatment""Established doctrine / proven principle"
NaturePractical, appliedTheoretical, foundational
ScopeClinical decision-making and treatment protocolsCore doctrinal framework of Ayurvedic science

2. Siddhanta - Foundational Doctrine

Siddhanta (from siddha = proven, anta = conclusion) refers to established, tested principles that form the theoretical backbone of Ayurveda. These are universal, time-tested truths from which all practice flows.
Examples of Siddhanta:
  • Tridosha Siddhanta - the doctrine of three doshas (Vata, Pitta, Kapha)
  • Panchamahabhuta Siddhanta - all matter is made of five elements
  • Saptadhatu Siddhanta - the seven bodily tissues
  • Loka Purusha Samya Siddhanta - the microcosm (body) mirrors the macrocosm (universe)
  • Samanya Vishesha Siddhanta - like increases like; opposites reduce each other
Key characteristics:
  • Universal and non-negotiable
  • Derived from Darshana (philosophical inquiry) and Shastra (scripture)
  • Not context-specific; applies across all patients and conditions
  • The "why" behind Ayurvedic medicine

3. Chikitsa Sutra - Therapeutic Aphorisms

Chikitsa Sutra (from chikitsa = treatment, sutra = thread/aphorism) are concise, practical rules guiding a Vaidya (practitioner) in clinical treatment decisions.
Examples of Chikitsa Sutra:
  • "Nidana Parivarjanam Chikitsa" - removal of causative factors is itself treatment (Charaka Samhita)
  • "Vipareeta Chikitsa" - treat with opposites (counter the dominant dosha)
  • "Santarpana and Apatarpana" - nourishing vs. depleting therapies
  • "Shodhana and Shamana" - purification (Panchakarma) vs. palliation
  • "Swabhavoparam Vada" - nature heals itself; support natural healing
Key characteristics:
  • Applied and context-dependent
  • Guides the Vaidya's clinical judgment (Prajna)
  • Can vary between classical texts (Charaka vs. Sushruta may differ in emphasis)
  • The "how" of Ayurvedic treatment

4. Core Differences at a Glance

FeatureSiddhantaChikitsa Sutra
PurposeExplains the nature of life, disease, and healthGuides the treatment and management of disease
LevelMacro/philosophicalMicro/clinical
FlexibilityFixed, universalAdaptable to patient (Prakriti, Vikriti)
SourcePhilosophical texts, Samhitas (Sutra Sthana)Chikitsa Sthana of Samhitas (Charaka, Sushruta, Ashtanga Hridayam)
ApplicationConceptual understandingDay-to-day patient care
AnalogyLike the laws of physicsLike engineering design rules

5. Relationship Between the Two

They are not in opposition - they are hierarchically related:
Siddhanta → Chikitsa Sutra → Treatment Plan
  • Siddhanta provides the why (e.g., "Vata dosha governs movement and the nervous system")
  • Chikitsa Sutra provides the how (e.g., "For Vata disorders, use Snehana-Swedana before Basti")
  • The actual treatment plan applies both to the individual patient
As noted in a recent IJFMR review (2024), Chikitsa Sutra embodies Ayurveda's personalized medicine approach - it is the operational bridge that translates abstract Siddhantas into patient-centered treatment protocols, empowering the Vaidya with Prajna (clinical wisdom) rather than rigid prescriptions.

In summary: Siddhanta is the theoretical foundation - the established doctrines that define Ayurvedic science. Chikitsa Sutra is the practical derivative - the aphoristic treatment rules that the practitioner applies at the bedside, always rooted in Siddhanta but flexible to the individual patient's condition.

Chikitsa sutra of akshepka

Reading File
Searching the Web

Akshepaka chikitsa sutra Ayurveda treatment principles Vatavyadhi

Reading Web Page

https://www.easyayurveda.com/charaka-vatavyadhi-chikitsa-28

Searching the Web

Akshepaka specific chikitsa sutra treatment Charaka Samhita Chikitsa Sthana 28 Vatavyadhi snehana basti nasya

Here is a complete account of the Chikitsa Sutra of Akshepaka as described in Ayurvedic classical texts, primarily Charaka Samhita Chikitsa Sthana, Chapter 28:

Akshepaka - Brief Overview

Akshepaka (आक्षेपक) is a Vatavyadhi (Vata-dominant neurological disorder) characterised by episodic convulsions with constriction of the hands, feet, vessels (Siras), ligaments (Snayu), and tendons (Kandara). It correlates with convulsive/seizure disorders in modern medicine.
  • It is a Vegavana (episodic) disorder - it has two phases: Vega (attack phase) and Vegantara (symptom-free interval)
  • The Vegantara phase is the appropriate time for medication and Panchakarma

Chikitsa Sutra of Akshepaka

The treatment of Akshepaka follows a two-tier framework: Samanya Chikitsa Sutra (general Vatavyadhi treatment principles) applied to Akshepaka, plus specific therapeutic measures.

1. Samanya (General) Vataroga Chikitsa Sutra

(Applicable to Akshepaka as a Vatavyadhi)
From Charaka Samhita Chikitsa Sthana 28/104-106:
"Ghrita, Taila, Vasa, Majja - Sneha; Swedana; Abhyanga; Basti; residence in windless place; blankets; Mamsarasa (meat soup); various kinds of milk; sweet, sour, and salt-dominant food - these are beneficial in Vata disorders."
SutraTreatment PrincipleRationale
SnehanaOleation (Ghrita, Taila, Vasa, Majja)Counters Ruksha guna of Vata; nourishes Dhatukshaya
SwedanaFomentation therapyRelieves Stambha, Graha, Aayama, Toda, contractures
AbhyangaMedicated oil massagePacifies Vata in Siras, Snayu, Kandara
BastiMedicated enema (Ardha Chikitsa of Vata)Considered half the treatment for all Vata disorders
BruhanaNourishing/anabolic therapyCorrects Dhatukshaya (tissue depletion)

2. Specific Chikitsa Sutra for Akshepaka

a) Vegantara Kala (Symptom-free period) - Treat during this phase:
  • This is the cardinal rule: "Vegavana disorders should be treated during Vegantara"
  • During the attack (Vega), symptomatic management only
b) Nasya (Nasal therapy):
  • Nasya with medicated oils (e.g., Anu Taila, Shadbindu Taila) is specifically indicated
  • Targets Urdhva Jatrugata Vata affecting the nervous system of the head and neck
c) Murdha Taila (Oil application to head):
  • Shirodhara, Shirobasti, Shiro Abhyanga with Vatahara oils
  • Directly pacifies Prana Vayu and Vyana Vayu - the primary subtypes involved in Akshepaka
d) Snehapana (Internal oleation):
  • Particularly Mahayogaraja Guggulu, Vatari Guggulu, Dhanvantari Ghrita
  • Ghrita preparations are preferred for Vata-dominant neurological disorders
e) Basti (the most important Karma):
  • Anuvasana Basti (oil enema) - especially with Sesame oil, Dashamula Taila
  • Niruha Basti (decoction enema) - during Vegantara phase
  • Basti pacifies Apana Vata which, when obstructed, affects upward-moving Vata and triggers convulsions
f) Dosha-specific modification:
  • If Vata only (Nirupastambha/Kevala) - primarily Snehana, Basti
  • If Pitta-Avarita Vata (Vata obstructed by Pitta) - first treat Pitta with Virechana (purgation), then treat Vata
  • If Kapha-Avarita Vata (Vata obstructed by Kapha) - first use Vamana (emesis)/Kapha-hara measures, then Vatahara therapy
  • This "Avarana Chikitsa" principle is key: treat the obstructing dosha first, then address Vata
g) Pathya (Dietary rules):
  • Mamsarasa (meat soup of Gramya, Ambuja, Anupa animals)
  • Milk (various preparations - Ksheera Basti, Ksheera Paka)
  • Sweet, sour, and saline food (Madhura, Amla, Lavana dominant)
  • Avoid dry, rough, cold, and light foods (which aggravate Vata)
h) Vihara (Lifestyle):
  • Reside in a windless, warm place
  • Cover the body with blankets (Avagunthana)
  • Avoid Vata-provoking activities - excessive exertion, cold exposure, fasting, suppression of urges

3. Summary of Chikitsa Sutra as Aphorisms

SutraMeaning
Snehana prathamamOleation is the primary measure
Basti Ardha ChikitsaBasti is half the treatment of Vata disorders
Vegantare aushadha sevanaMedicines during symptom-free interval
Avaranasya aadou Avaranam chikitsitaIn Avarana type, treat the obstructing dosha first
Nidana ParivarjanamRemove causative factors always
Bruhana for DhatukshayaNourishing therapies when tissue depletion is the cause

In essence: The Chikitsa Sutra of Akshepaka centres on Snehana + Swedana + Basti as the triad of core therapies, always administered during Vegantara (remission phase), with treatment modified based on whether the Vata is independent (Kevala) or obstructed (Avarita) by other doshas - as described in Charaka Samhita Chikitsa Sthana 28.

Shlok reference only

Searching the Web

Akshepaka chikitsa shloka Charaka Samhita Chikitsa Sthana 28 Sanskrit verse

Searching the Web

Akshepaka treatment shloka "chikitsa sthana" "28" Sanskrit text reference

Reading Web Page

https://www.carakasamhitaonline.com/index.php/Vatavyadhi_Chi…

Here are the Shloka references for Akshepaka Chikitsa from classical texts:

Akshepaka - Shloka References


1. Lakshana Shloka (Definition/Symptom)

Charaka Samhita, Chikitsa Sthana 28/50-51
मुहुराक्षिपति क्रुद्धो गात्राण्याक्षेपकोऽनिलः ||५०|| पाणिपादं च संशोष्य सिराः सस्नायुकण्डराः |५१|
muhurākṣipati kruddho gātrāṇyākṣepako'nilaḥ ||50|| pāṇipādaṃ ca saṃśoṣya sirāḥ sasnāyukaṇḍarāḥ |51|
Meaning: The provoked Vata repeatedly convulses the body parts, dries up the Siras (vessels), Snayu (ligaments), and Kandara (tendons) of hands and feet - this is Akshepaka.

2. Vegavana / Vegantara Shloka

Charaka Samhita, Chikitsa Sthana 28/52
स्वस्थः स्यादर्दितादीनां मुहुर्वेगे गतेऽगते ||५२||
svasthaḥ syādardita ādīnāṃ muhur vege gate'gate ||52||
Meaning: In Ardita and similar (Vegavana) disorders including Akshepaka, the patient becomes symptom-free between attacks (Vegantara). This Vegantara is the right time for treatment.

3. Samanya Vatavyadhi Chikitsa Sutra

Charaka Samhita, Chikitsa Sthana 28/104½-106
सर्पिस्तैलं वसा मज्जा स्वेदो भ्यङ्गस्तथा बस्तिः | वातानिलहराहारा विहाराश्चेति सङ्ग्रहः ||
(Ca. Chi. 28/104½-106)
Meaning: Ghrita (ghee), Taila (oil), Vasa (muscle fat), Majja (marrow), Swedana, Abhyanga, Basti - and food/lifestyle that pacifies Vata - these are the general treatment measures for Vata disorders (including Akshepaka).

4. Snehana as Primary Measure

Charaka Samhita, Chikitsa Sthana 28/57
निरुपस्तम्भमेवादौ स्नेहेनोपचरेद्भिषक् |
nirupastambham evādau snehena upacared bhiṣak |
Meaning: In Kevala (unobstructed) Vata, the physician should first treat with Snehana (oleation).

5. Basti as Ardha Chikitsa

Charaka Samhita, Siddhi Sthana 1/39
बस्तिरेव अर्धं चिकित्सायां वातव्याधिषु गण्यते |
bastir eva ardhaṃ cikitsāyāṃ vātavyādhiṣu gaṇyate |
Meaning: Basti alone is considered half the treatment in Vata disorders (including Akshepaka).

6. Avarana Chikitsa Sutra (for obstructed Vata type)

Charaka Samhita, Chikitsa Sthana 28/59
आवृते तु यथादोषं कर्म कुर्याद्विशेषतः |
āvṛte tu yathādoṣaṃ karma kuryād viśeṣataḥ |
Meaning: When Vata is in Avarana (obstructed by another dosha), treat according to the obstructing dosha specifically first.

7. Sushruta Reference - Akshepaka Chikitsa

Sushruta Samhita, Chikitsa Sthana 5/19
"...ततः प्राग् स्नेहितमुपन्न मृदुना शोधनेन शोध्यानुवासनास्यापि च यथाकालमाक्षेपकविधानेनोपचरेत्"
(Su. Chi. 5/19)
Meaning: After oleation, mild purification (Shodhana), followed by Anuvasana Basti and Asthapana Basti - then apply the treatment protocol of Akshepaka at the appropriate time. Mastishkya Shirobasti, Abhyanga with Anu Taila, Salvana Upanaha, and Bala Taila Anuvasana are the specific measures.

Summary of Key Shloka Numbers

Shloka ReferenceContent
Ca. Chi. 28/50-51Lakshana of Akshepaka
Ca. Chi. 28/52Vegantara = time for treatment
Ca. Chi. 28/57Snehana as first measure
Ca. Chi. 28/59Avarana Chikitsa principle
Ca. Chi. 28/104½-106Samanya Vataroga Chikitsa Sutra
Ca. Si. 1/39Basti = Ardha Chikitsa
Su. Chi. 5/19Specific Akshepaka treatment protocol

Pakshghata chikitsa sutra shlok with reference

Searching the Web

Pakshaghata chikitsa sutra shloka Sanskrit verse Charaka Samhita Chikitsa Sthana 28 reference

Searching the Web

Pakshaghata treatment shloka "Ca. Chi. 28" Sanskrit text snehana basti virechana

Reading Web Page

https://ayushdhara.in/index.php/ayushdhara/article/download/…

Here are all the Pakshaghata Chikitsa Sutra Shlokas with complete references from all major Acharyas:

पक्षाघात चिकित्सा सूत्र - Shloka References


1. Lakshana Shloka - Definition of Pakshaghata

Charaka Samhita, Chikitsa Sthana 28/53-54
हत्वैकं मारुतः पक्षं दक्षिणं वामम् एव वा ||५३|| कुर्याच्चेष्टानिवृत्तिं हि रुजं वाक्स्तम्भम् एव च | गृहीत्वाऽर्धं शरीरस्य सिराः स्नायूर्विशोष्य च ||५४||
hatvaikaṃ mārutaḥ pakṣaṃ dakṣiṇaṃ vāmam eva vā ||53|| kuryāc ceṣṭā nivṛttiṃ hi rujaṃ vākstambham eva ca | gṛhītvā'rdhaṃ śarīrasya sirāḥ snāyūr viśoṣya ca ||54||
Meaning: Vata, having afflicted either the right or left half of the body, drying up the Siras and Snayu, causes loss of movement, pain, and speech obstruction - this is Pakshaghata.

2. Chikitsa Sutra - Charaka (Primary Reference)

Charaka Samhita, Chikitsa Sthana 28/100
स्वेदनं स्नेहसंयुक्तं पक्षाघाते विरेचनम् |
Swedanaṃ snehasaṃyuktaṃ pakṣāghāte virechanam |
(Ch. Chi. 28/100)
Meaning: In Pakshaghata, Swedana (fomentation) combined with Snehana (oleation), and Virechana (purgation with unctuous substance) is the treatment.
Commentator views:
  • Jejjata - Snehayukta Sweda and Snehayukta Virechana
  • Gangadhara - Same as Jejjata
  • Chakrapani - No specific commentary on this verse

3. Chikitsa Sutra - Ashtanga Hridayam (Vagbhata)

Ashtanga Hridayam, Chikitsa Sthana 21/44
स्नेहनं स्नेहसंयुक्तं पक्षाघाते विरेचनम् |
Snehanaṃ snehasaṃyuktaṃ pakṣāghāte virechanam |
(A.H. Chi. 21/44)
Meaning: In Pakshaghata, Snehana and Snehayukta Virechana (purgation combined with unctuous drugs) are indicated. (Vagbhata's view is similar to Charaka - both emphasize Snehana + Virechana)

4. Chikitsa Sutra - Sushruta Samhita

Sushruta Samhita, Chikitsa Sthana 5/19
"प्रागेव स्नेहितमुपन्नं मृदुना शोधनेन शोध्यानुवासनास्यापि च यथाकालमाक्षेपकविधानेनोपचरेत्"
(Su. Chi. 5/19)
Meaning: First Snehana, then Mridu Vamana (mild emesis), followed by Mridu Virechana (mild purgation), then Anuvasana Basti and Asthapana Basti; then treat as per Akshepaka protocol. Mastishkya Shirobasti, Abhyanga with Anu Taila, Salvana Upanaha, and Bala Taila Anuvasana are the specific measures.

5. Ashtanga Sangraha Reference

Ashtanga Sangraha, Chikitsa Sthana 23/27
स्नेहनं स्नेहसंयुक्तं पक्षाघाते विरेचनम् |
(A.S. Chi. 23/27)
(Closely mirrors Charaka and Vagbhata - Snehana + Snehayukta Virechana)

6. Mridu Shodhana in Margavarana

Charaka Samhita, Chikitsa Sthana 9/23
कुर्यादावृतमार्गे तु स्नेहं मृदु शोधनम् ||२३||
kuryād āvṛta mārge tu snehaṃ mṛdu śodhanam ||23||
(Ca. Chi. 9/23)
Meaning: When there is Margavarana (obstruction of channels - as in Pakshaghata), Snehana and Mridu Shodhana (mild purification) should be done.

7. Basti as Treatment (Samanya Vatavyadhi)

Charaka Samhita, Siddhi Sthana 1/39
बस्तिरेव अर्धं चिकित्सायां वातव्याधिषु गण्यते |
bastir eva ardhaṃ cikitsāyāṃ vātavyādhiṣu gaṇyate |
(Ca. Si. 1/39)
Meaning: Basti is considered half the treatment of all Vata disorders. (Applicable to Pakshaghata as Vatavyadhi)

8. Pathya - Diet Reference

Charaka Samhita, Chikitsa Sthana 28/184
Jivaniya Ghrita, Yapana Basti, Kshira Basti, flesh of Jangala animals, Yava, Shali
(Ca. Chi. 28/184)

9. Why Virechana Over Basti in Pakshaghata

(Charaka's rationale as explained by commentators)
Pakshaghata is compared to Urdhwaga Raktapitta concealed within - the treatment principle is Adho-Shodhana (downward purification). Virechana is preferred here because it clears the obstructed Vata through the Pakwashaya (colon), the seat of Vata. Basti remains a complementary measure, not primary.

Summary Table

ShlokaText & ReferenceContent
Ca. Chi. 28/53-54Charaka SamhitaLakshana of Pakshaghata
Ca. Chi. 28/100Charaka SamhitaMain Chikitsa Sutra - Sweda + Snehana + Virechana
A.H. Chi. 21/44Ashtanga HridayamSnehana + Snehayukta Virechana
Su. Chi. 5/19Sushruta SamhitaSnehana → Mridu Vamana → Virechana → Basti
A.S. Chi. 23/27Ashtanga SangrahaSame as Charaka
Ca. Chi. 9/23Charaka SamhitaMridu Shodhana in Margavarana
Ca. Si. 1/39Charaka SamhitaBasti = Ardha Chikitsa (Vatavyadhi general)
Ca. Chi. 28/184Charaka SamhitaPathya - diet and formulations

Placenta formation ppt colourful

Reading File
Reading File
Running Command

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

Writing File

~/placenta-ppt/placenta.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Placenta Formation";
pres.author = "Embryology";

// ── Color palette ──────────────────────────────────────────────
const C = {
  deepPlum:   "2D1B4E",   // dominant dark
  magenta:    "C2185B",   // accent
  coral:      "F06292",   // soft accent
  peach:      "FFAB91",   // highlight
  gold:       "FFD54F",   // accent
  teal:       "00897B",   // info accent
  lightTeal:  "B2DFDB",   // background light
  mint:       "E8F5E9",   // very light bg
  white:      "FFFFFF",
  nearWhite:  "F3E5F5",
  darkText:   "1A0033",
  midGray:    "5E4D6B",
};

// ═══════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();

  // Deep plum background
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.deepPlum} });

  // Decorative gradient strip top
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.55, fill:{color:C.magenta} });

  // Decorative gradient strip bottom
  s.addShape(pres.ShapeType.rect, { x:0, y:5.1, w:10, h:0.525, fill:{color:C.teal} });

  // Circular decorative element
  s.addShape(pres.ShapeType.ellipse, { x:7.8, y:0.3, w:2.8, h:2.8,
    fill:{color:C.magenta}, line:{color:C.coral, width:3}, transparency:60 });
  s.addShape(pres.ShapeType.ellipse, { x:8.1, y:0.5, w:2.2, h:2.2,
    fill:{color:C.coral}, line:{color:C.peach, width:2}, transparency:50 });

  // Left accent line
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.4, w:0.08, h:2.4, fill:{color:C.gold} });

  // Title
  s.addText("PLACENTA", {
    x:0.55, y:1.3, w:8, h:1.1,
    fontSize:54, bold:true, color:C.white, fontFace:"Calibri",
    charSpacing:10,
  });
  s.addText("FORMATION", {
    x:0.55, y:2.3, w:8, h:1.0,
    fontSize:44, bold:true, color:C.gold, fontFace:"Calibri",
    charSpacing:8,
  });

  // Subtitle
  s.addText("Development • Structure • Function • Clinical Significance", {
    x:0.55, y:3.45, w:8.5, h:0.55,
    fontSize:15, color:C.lightTeal, fontFace:"Calibri", italic:true,
  });

  // Bottom tag
  s.addText("Embryology | Obstetrics", {
    x:0.35, y:5.15, w:4, h:0.38,
    fontSize:11, color:C.white, fontFace:"Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 2 — Overview / Contents
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.nearWhite} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.75, fill:{color:C.magenta} });
  s.addShape(pres.ShapeType.rect, { x:0, y:5.27, w:10, h:0.355, fill:{color:C.deepPlum} });

  s.addText("OVERVIEW", {
    x:0.3, y:0.1, w:9, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  const topics = [
    { num:"01", title:"Implantation",         sub:"Days 6–10 post-fertilisation" },
    { num:"02", title:"Trophoblast Invasion",  sub:"Cytotrophoblast & Syncytiotrophoblast" },
    { num:"03", title:"Decidua Formation",     sub:"Maternal endometrial changes" },
    { num:"04", title:"Chorionic Villi",        sub:"Primary, Secondary, Tertiary villi" },
    { num:"05", title:"Placental Circulation", sub:"Uteroplacental & Fetoplacental" },
    { num:"06", title:"Mature Placenta",        sub:"Structure, zones, membrane" },
    { num:"07", title:"Functions",              sub:"Respiratory, Nutritive, Endocrine" },
    { num:"08", title:"Clinical Significance", sub:"Placenta praevia, abruption, preeclampsia" },
  ];

  const cols = 2, rows = 4;
  const bw = 4.4, bh = 0.95, gx = 0.25, gy = 0.2;
  const startX = 0.2, startY = 0.88;
  const boxColors = [C.magenta, C.teal, C.deepPlum, C.coral,
                     C.teal, C.magenta, C.deepPlum, C.coral];

  topics.forEach((t, i) => {
    const col = i % cols;
    const row = Math.floor(i / cols);
    const bx = startX + col * (bw + gx);
    const by = startY + row * (bh + gy);

    s.addShape(pres.ShapeType.roundRect, {
      x:bx, y:by, w:bw, h:bh,
      fill:{color:boxColors[i]}, rectRadius:0.12,
      line:{color:C.white, width:1.5},
    });

    // Number badge
    s.addShape(pres.ShapeType.ellipse, {
      x:bx+0.12, y:by+0.22, w:0.45, h:0.45,
      fill:{color:C.white},
    });
    s.addText(t.num, {
      x:bx+0.12, y:by+0.22, w:0.45, h:0.45,
      fontSize:11, bold:true, color:boxColors[i],
      align:"center", valign:"middle", fontFace:"Calibri",
    });

    s.addText(t.title, {
      x:bx+0.65, y:by+0.07, w:bw-0.75, h:0.42,
      fontSize:14, bold:true, color:C.white, fontFace:"Calibri",
    });
    s.addText(t.sub, {
      x:bx+0.65, y:by+0.48, w:bw-0.75, h:0.38,
      fontSize:10.5, color:C.white, fontFace:"Calibri", italic:true,
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 3 — Implantation
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"FFF8F0"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.teal} });
  s.addShape(pres.ShapeType.rect, { x:0, y:5.27, w:10, h:0.355, fill:{color:C.deepPlum} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0.72, w:0.07, h:4.55, fill:{color:C.gold} });

  s.addText("1. IMPLANTATION", {
    x:0.3, y:0.1, w:9, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Timeline boxes
  const stages = [
    { day:"Day 0",    label:"Fertilisation",       detail:"Sperm + Ovum → Zygote in ampulla of fallopian tube", color:C.magenta },
    { day:"Day 1–3",  label:"Cleavage",            detail:"Mitotic divisions → 2,4,8,16 cell morula", color:C.teal },
    { day:"Day 4",    label:"Morula → Blastocyst", detail:"Fluid accumulates → blastocyst cavity (blastocoele)", color:C.deepPlum },
    { day:"Day 5–6",  label:"Hatching",            detail:"Zona pellucida dissolves; blastocyst freed", color:C.coral },
    { day:"Day 6–7",  label:"Apposition",          detail:"Blastocyst orients to endometrium (pole facing)", color:"E65100" },
    { day:"Day 8–10", label:"Implantation",        detail:"Trophoblast invades decidua; interstitial implantation complete", color:C.midGray },
  ];

  stages.forEach((st, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const bx = 0.22 + col * 3.25;
    const by = 0.88 + row * 2.08;

    s.addShape(pres.ShapeType.roundRect, {
      x:bx, y:by, w:3.1, h:1.85,
      fill:{color:st.color}, rectRadius:0.15,
    });

    // Day badge
    s.addShape(pres.ShapeType.roundRect, {
      x:bx+0.08, y:by+0.08, w:1.2, h:0.35,
      fill:{color:C.white}, rectRadius:0.08,
    });
    s.addText(st.day, {
      x:bx+0.08, y:by+0.08, w:1.2, h:0.35,
      fontSize:10, bold:true, color:st.color,
      align:"center", valign:"middle", fontFace:"Calibri",
    });

    s.addText(st.label, {
      x:bx+0.1, y:by+0.5, w:2.9, h:0.42,
      fontSize:13, bold:true, color:C.white, fontFace:"Calibri",
    });
    s.addText(st.detail, {
      x:bx+0.1, y:by+0.95, w:2.9, h:0.78,
      fontSize:10, color:C.white, fontFace:"Calibri",
      wrap:true,
    });
  });

  s.addText("Normal implantation site: posterior wall of upper uterine body", {
    x:0.2, y:5.28, w:9.5, h:0.32,
    fontSize:10, color:C.white, italic:true, fontFace:"Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 4 — Trophoblast Differentiation
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.deepPlum} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.magenta} });

  s.addText("2. TROPHOBLAST DIFFERENTIATION", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:21, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Central label
  s.addShape(pres.ShapeType.ellipse, { x:3.8, y:1.6, w:2.4, h:1.5,
    fill:{color:C.gold}, line:{color:C.white, width:2} });
  s.addText("TROPHOBLAST\n(Day 6)", {
    x:3.8, y:1.6, w:2.4, h:1.5,
    fontSize:12, bold:true, color:C.deepPlum,
    align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Left branch - Cytotrophoblast
  s.addShape(pres.ShapeType.roundRect, { x:0.15, y:0.9, w:3.4, h:1.9,
    fill:{color:C.teal}, rectRadius:0.15 });
  s.addText("CYTOTROPHOBLAST\n(Langhans Layer)", {
    x:0.2, y:0.95, w:3.3, h:0.65,
    fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center",
  });
  s.addText([
    { text: "• Inner mononuclear layer\n", options:{breakLine:true} },
    { text: "• Mitotically active cells\n", options:{breakLine:true} },
    { text: "• Fuses to form syncytium\n", options:{breakLine:true} },
    { text: "• Present until 20 wks\n", options:{breakLine:true} },
    { text: "• Source: regenerates syncytiotrophoblast" },
  ], {
    x:0.25, y:1.62, w:3.2, h:1.15,
    fontSize:10, color:C.white, fontFace:"Calibri",
  });

  // Right branch - Syncytiotrophoblast
  s.addShape(pres.ShapeType.roundRect, { x:6.45, y:0.9, w:3.4, h:1.9,
    fill:{color:C.coral}, rectRadius:0.15 });
  s.addText("SYNCYTIOTROPHOBLAST", {
    x:6.5, y:0.95, w:3.3, h:0.42,
    fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center",
  });
  s.addText([
    { text: "• Outer multinucleated layer\n", options:{breakLine:true} },
    { text: "• No cell boundaries\n", options:{breakLine:true} },
    { text: "• Invades decidua directly\n", options:{breakLine:true} },
    { text: "• Erodes spiral arteries\n", options:{breakLine:true} },
    { text: "• Secretes hCG, progesterone" },
  ], {
    x:6.55, y:1.42, w:3.25, h:1.32,
    fontSize:10, color:C.white, fontFace:"Calibri",
  });

  // Connecting arrows (lines)
  s.addShape(pres.ShapeType.line, { x:3.55, y:2.3, w:0.25, h:0, line:{color:C.gold, width:2} });
  s.addShape(pres.ShapeType.line, { x:6.2, y:2.3, w:0.25, h:0, line:{color:C.gold, width:2} });

  // Bottom section - Extravillous Trophoblast
  s.addShape(pres.ShapeType.roundRect, { x:0.5, y:3.1, w:4.2, h:2.0,
    fill:{color:"1A237E"}, rectRadius:0.15 });
  s.addText("EXTRAVILLOUS TROPHOBLAST (EVT)", {
    x:0.6, y:3.15, w:4.0, h:0.45,
    fontSize:12, bold:true, color:C.gold, fontFace:"Calibri",
  });
  s.addText([
    { text: "Interstitial EVT: ", options:{bold:true, breakLine:false} },
    { text: "Invades decidua & myometrium\n", options:{breakLine:true} },
    { text: "Endovascular EVT: ", options:{bold:true, breakLine:false} },
    { text: "Remodels spiral arteries\n", options:{breakLine:true} },
    { text: "→ Low resistance, high-flow uteroplacental circulation" },
  ], {
    x:0.6, y:3.65, w:4.0, h:1.35,
    fontSize:10, color:C.white, fontFace:"Calibri",
  });

  // Bottom section - Villous Trophoblast
  s.addShape(pres.ShapeType.roundRect, { x:5.3, y:3.1, w:4.2, h:2.0,
    fill:{color:"4A0030"}, rectRadius:0.15 });
  s.addText("VILLOUS TROPHOBLAST", {
    x:5.4, y:3.15, w:4.0, h:0.45,
    fontSize:12, bold:true, color:C.gold, fontFace:"Calibri",
  });
  s.addText([
    { text: "Covers surface of chorionic villi\n", options:{breakLine:true} },
    { text: "Outer layer: Syncytiotrophoblast\n", options:{breakLine:true} },
    { text: "Inner layer: Cytotrophoblast\n", options:{breakLine:true} },
    { text: "Forms the placental barrier (haemochorial)" },
  ], {
    x:5.4, y:3.65, w:4.0, h:1.35,
    fontSize:10, color:C.white, fontFace:"Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 5 — Decidua Formation
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"FFF3E0"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:"E65100"} });

  s.addText("3. DECIDUA FORMATION", {
    x:0.3, y:0.1, w:9, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Uterus diagram - simplified shapes
  // Uterine wall
  s.addShape(pres.ShapeType.roundRect, { x:0.4, y:0.9, w:3.8, h:4.35,
    fill:{color:"FFCCBC"}, line:{color:"BF360C", width:2}, rectRadius:0.3 });
  s.addText("UTERINE WALL", {
    x:0.45, y:0.92, w:3.7, h:0.38,
    fontSize:10, bold:true, color:"BF360C", align:"center", fontFace:"Calibri",
  });

  // Decidua basalis
  s.addShape(pres.ShapeType.rect, { x:0.5, y:1.38, w:3.6, h:0.85,
    fill:{color:C.magenta} });
  s.addText("DECIDUA BASALIS", {
    x:0.55, y:1.44, w:3.5, h:0.32,
    fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri",
  });
  s.addText("Deep to embryo • Forms maternal part of placenta", {
    x:0.55, y:1.76, w:3.5, h:0.4,
    fontSize:8.5, color:C.white, align:"center", fontFace:"Calibri",
  });

  // Decidua capsularis
  s.addShape(pres.ShapeType.rect, { x:0.5, y:2.3, w:3.6, h:0.85,
    fill:{color:C.teal} });
  s.addText("DECIDUA CAPSULARIS", {
    x:0.55, y:2.36, w:3.5, h:0.32,
    fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri",
  });
  s.addText("Covers embryo superficially • Disappears by 20 wks", {
    x:0.55, y:2.68, w:3.5, h:0.4,
    fontSize:8.5, color:C.white, align:"center", fontFace:"Calibri",
  });

  // Decidua parietalis
  s.addShape(pres.ShapeType.rect, { x:0.5, y:3.22, w:3.6, h:0.85,
    fill:{color:C.deepPlum} });
  s.addText("DECIDUA PARIETALIS", {
    x:0.55, y:3.28, w:3.5, h:0.32,
    fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri",
  });
  s.addText("Lines rest of uterine cavity • Merges with capsularis", {
    x:0.55, y:3.6, w:3.5, h:0.4,
    fontSize:8.5, color:C.white, align:"center", fontFace:"Calibri",
  });

  // Embryo placeholder
  s.addShape(pres.ShapeType.ellipse, { x:1.2, y:4.2, w:2.2, h:0.78,
    fill:{color:C.gold}, line:{color:"BF360C", width:1.5} });
  s.addText("EMBRYO", {
    x:1.2, y:4.2, w:2.2, h:0.78,
    fontSize:11, bold:true, color:C.deepPlum, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Right panel - details
  const details = [
    { title:"Decidual Reaction", body:"Endometrial stromal cells enlarge → Decidual cells. Rich in glycogen & lipids. Provides nutrition to embryo.", color:C.magenta },
    { title:"Spiral Artery Remodelling", body:"EVT replaces vessel wall. High-resistance → low-resistance flow. Begins week 8, complete by 20 wks.", color:C.teal },
    { title:"Immune Tolerance", body:"Decidua creates immunological sanctuary. NK cells, Tregs protect semi-allograft fetus from rejection.", color:C.deepPlum },
    { title:"Decidua = Endometrium in Pregnancy", body:"Progesterone-driven transformation. Fails → miscarriage. Excessive → accreta spectrum.", color:"E65100" },
  ];

  details.forEach((d, i) => {
    const by = 0.88 + i * 1.18;
    s.addShape(pres.ShapeType.roundRect, {
      x:4.5, y:by, w:5.3, h:1.05,
      fill:{color:d.color}, rectRadius:0.12,
    });
    s.addText(d.title, {
      x:4.62, y:by+0.06, w:5.1, h:0.38,
      fontSize:12, bold:true, color:C.white, fontFace:"Calibri",
    });
    s.addText(d.body, {
      x:4.62, y:by+0.44, w:5.1, h:0.52,
      fontSize:9.5, color:C.white, fontFace:"Calibri",
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 6 — Chorionic Villi Development
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"E8EAF6"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:"1A237E"} });

  s.addText("4. CHORIONIC VILLI DEVELOPMENT", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:21, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Three stages
  const villus = [
    {
      stage:"PRIMARY VILLI", week:"Week 2",
      desc:"Cytotrophoblast core covered by syncytiotrophoblast. Solid trophoblast projections into decidua. No blood vessels yet.",
      color:C.magenta, x:0.2
    },
    {
      stage:"SECONDARY VILLI", week:"Week 3",
      desc:"Extraembryonic mesoderm grows into core. Villi have mesenchymal core. Cytotrophoblast + Syncytio + Mesoderm = 3 layers.",
      color:C.teal, x:3.55
    },
    {
      stage:"TERTIARY VILLI", week:"Week 3–4",
      desc:"Fetal blood vessels differentiate in mesenchymal core. Allantois vessels connect to fetal circulation. Villi become vascular.",
      color:"E65100", x:6.9
    },
  ];

  villus.forEach((v) => {
    s.addShape(pres.ShapeType.roundRect, {
      x:v.x, y:0.82, w:3.2, h:4.6,
      fill:{color:v.color}, rectRadius:0.18,
    });

    // Stage badge
    s.addShape(pres.ShapeType.roundRect, {
      x:v.x+0.12, y:0.9, w:2.96, h:0.5,
      fill:{color:C.white}, rectRadius:0.08,
    });
    s.addText(v.stage, {
      x:v.x+0.12, y:0.9, w:2.96, h:0.5,
      fontSize:12, bold:true, color:v.color,
      align:"center", valign:"middle", fontFace:"Calibri",
    });

    s.addText(v.week, {
      x:v.x+0.12, y:1.48, w:2.96, h:0.38,
      fontSize:11, bold:true, color:C.gold,
      align:"center", fontFace:"Calibri",
    });

    // Diagram circle (simplified cross-section)
    s.addShape(pres.ShapeType.ellipse, {
      x:v.x+0.6, y:1.9, w:2.0, h:1.4,
      fill:{color:C.white}, line:{color:C.gold, width:2},
    });

    if (v.stage === "PRIMARY VILLI") {
      // Syncytio ring
      s.addShape(pres.ShapeType.ellipse, { x:v.x+0.65, y:1.95, w:1.9, h:1.3, fill:{color:C.coral}, line:{color:C.white, width:1} });
      // Cyto core
      s.addShape(pres.ShapeType.ellipse, { x:v.x+1.0, y:2.2, w:1.2, h:0.8, fill:{color:C.peach} });
      s.addText("Cyto", { x:v.x+1.0, y:2.2, w:1.2, h:0.8, fontSize:8, bold:true, color:C.deepPlum, align:"center", valign:"middle" });
      s.addText("Syncytio", { x:v.x+0.65, y:1.95, w:0.9, h:0.35, fontSize:7, color:C.white, align:"center" });
    } else if (v.stage === "SECONDARY VILLI") {
      s.addShape(pres.ShapeType.ellipse, { x:v.x+0.65, y:1.95, w:1.9, h:1.3, fill:{ color:C.coral }, line:{color:C.white, width:1} });
      s.addShape(pres.ShapeType.ellipse, { x:v.x+0.9, y:2.1, w:1.4, h:1.0, fill:{color:C.peach} });
      s.addShape(pres.ShapeType.ellipse, { x:v.x+1.1, y:2.25, w:1.0, h:0.7, fill:{color:"A5D6A7"} });
      s.addText("Meso", { x:v.x+1.1, y:2.25, w:1.0, h:0.7, fontSize:7, bold:true, color:C.deepPlum, align:"center", valign:"middle" });
    } else {
      s.addShape(pres.ShapeType.ellipse, { x:v.x+0.65, y:1.95, w:1.9, h:1.3, fill:{color:C.coral}, line:{color:C.white, width:1} });
      s.addShape(pres.ShapeType.ellipse, { x:v.x+0.9, y:2.1, w:1.4, h:1.0, fill:{color:C.peach} });
      s.addShape(pres.ShapeType.ellipse, { x:v.x+1.1, y:2.25, w:0.7, h:0.5, fill:{color:"EF5350"} });
      s.addShape(pres.ShapeType.ellipse, { x:v.x+1.25, y:2.32, w:0.4, h:0.35, fill:{color:C.white} });
      s.addText("BV", { x:v.x+1.25, y:2.32, w:0.4, h:0.35, fontSize:6, bold:true, color:"EF5350", align:"center", valign:"middle" });
    }

    s.addText(v.desc, {
      x:v.x+0.15, y:3.45, w:2.9, h:1.85,
      fontSize:9.5, color:C.white, fontFace:"Calibri", wrap:true,
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 7 — Mature Placenta Structure
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"E0F2F1"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.teal} });

  s.addText("5 & 6. MATURE PLACENTA – STRUCTURE", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:21, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Key facts boxes
  const facts = [
    { label:"Weight",       val:"500 g (term)",         color:C.magenta },
    { label:"Diameter",     val:"15–20 cm",              color:C.teal },
    { label:"Thickness",    val:"2.5–3 cm",              color:"E65100" },
    { label:"Cotyledons",   val:"15–30 (maternal side)", color:C.deepPlum },
  ];
  facts.forEach((f, i) => {
    const fx = 0.2 + i * 2.42;
    s.addShape(pres.ShapeType.roundRect, { x:fx, y:0.82, w:2.25, h:0.95,
      fill:{color:f.color}, rectRadius:0.1 });
    s.addText(f.label, { x:fx+0.08, y:0.86, w:2.1, h:0.35,
      fontSize:10, bold:true, color:C.white, fontFace:"Calibri" });
    s.addText(f.val, { x:fx+0.08, y:1.22, w:2.1, h:0.45,
      fontSize:11, color:C.gold, bold:true, fontFace:"Calibri" });
  });

  // Layers from fetal to maternal
  const layers = [
    { name:"Amniotic Epithelium",       detail:"Inner-most • Lines amniotic cavity", color:"B3E5FC" },
    { name:"Chorionic Plate (Fetal)",   detail:"Connective tissue • Umbilical vessels travel here", color:"81D4FA" },
    { name:"Intervillous Space",        detail:"Maternal blood bathes villi • Site of exchange", color:C.coral },
    { name:"Cytotrophoblast Shell",     detail:"Anchoring villi merge here", color:C.peach },
    { name:"Decidua Basalis (Maternal)",detail:"Maternal septa divide into cotyledons • Nitabuch layer", color:C.magenta },
    { name:"Myometrium",                detail:"Uterine muscle", color:"CE93D8" },
  ];
  layers.forEach((l, i) => {
    const by = 1.9 + i * 0.57;
    s.addShape(pres.ShapeType.rect, { x:0.2, y:by, w:9.6, h:0.55, fill:{color:l.color} });
    s.addText(l.name, { x:0.3, y:by+0.05, w:3.5, h:0.42,
      fontSize:11, bold:true, color:C.deepPlum, fontFace:"Calibri" });
    s.addText(l.detail, { x:3.9, y:by+0.07, w:5.8, h:0.38,
      fontSize:10, color:C.darkText, fontFace:"Calibri" });
  });

  // Arrow labels
  s.addShape(pres.ShapeType.rect, { x:0, y:1.9, w:0.18, h:3.42, fill:{color:C.teal} });
  s.addText("FETAL", { x:0.02, y:1.9, w:0.18, h:1.71,
    fontSize:8, bold:true, color:C.white, align:"center", valign:"middle",
    rotate:270 });
  s.addText("MATERNAL", { x:0.02, y:3.61, w:0.18, h:1.71,
    fontSize:8, bold:true, color:C.white, align:"center", valign:"middle",
    rotate:270 });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 8 — Placental Circulation
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.deepPlum} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.coral} });

  s.addText("PLACENTAL CIRCULATION", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Fetal circulation
  s.addShape(pres.ShapeType.roundRect, { x:0.2, y:0.85, w:4.5, h:4.5,
    fill:{color:"1A237E"}, rectRadius:0.2 });
  s.addText("FETAL CIRCULATION", {
    x:0.35, y:0.9, w:4.2, h:0.45,
    fontSize:14, bold:true, color:C.gold, fontFace:"Calibri", align:"center",
  });

  const fetalItems = [
    { t:"Umbilical Arteries (×2)", d:"Deoxygenated blood from fetus → placenta\nArises from internal iliac arteries" },
    { t:"Chorionic Plate Arteries", d:"Branch into stem villi arteries" },
    { t:"Capillary Network", d:"In terminal villi → gas/nutrient exchange" },
    { t:"Umbilical Vein (×1)",     d:"Oxygenated blood → fetus via ductus venosus\nHighest O₂ saturation in fetal body" },
  ];
  fetalItems.forEach((fi, i) => {
    s.addShape(pres.ShapeType.roundRect, { x:0.32, y:1.42+i*0.82, w:4.25, h:0.75,
      fill:{color:i%2===0?C.teal:"1A5276"}, rectRadius:0.08 });
    s.addText(fi.t, { x:0.42, y:1.46+i*0.82, w:4.05, h:0.28,
      fontSize:11, bold:true, color:C.gold, fontFace:"Calibri" });
    s.addText(fi.d, { x:0.42, y:1.74+i*0.82, w:4.05, h:0.38,
      fontSize:9, color:C.white, fontFace:"Calibri" });
  });

  // Maternal circulation
  s.addShape(pres.ShapeType.roundRect, { x:5.3, y:0.85, w:4.5, h:4.5,
    fill:{color:"4A0030"}, rectRadius:0.2 });
  s.addText("MATERNAL CIRCULATION", {
    x:5.45, y:0.9, w:4.2, h:0.45,
    fontSize:14, bold:true, color:C.gold, fontFace:"Calibri", align:"center",
  });

  const maternalItems = [
    { t:"Spiral Arteries (Remodelled)", d:"Low-resistance arteries after EVT invasion\n↑ Blood flow to intervillous space" },
    { t:"Intervillous Space", d:"~150 mL blood at term\nExchanges O₂, CO₂, glucose, waste" },
    { t:"Uterine Veins / Venous Lakes", d:"Deoxygenated blood drains out of IVS" },
    { t:"Nitabuch Layer", d:"Fibrinoid zone at decidua-trophoblast junction\nPrevents excessive invasion" },
  ];
  maternalItems.forEach((mi, i) => {
    s.addShape(pres.ShapeType.roundRect, { x:5.42, y:1.42+i*0.82, w:4.25, h:0.75,
      fill:{color:i%2===0?C.magenta:"7B1F2A"}, rectRadius:0.08 });
    s.addText(mi.t, { x:5.52, y:1.46+i*0.82, w:4.05, h:0.28,
      fontSize:11, bold:true, color:C.gold, fontFace:"Calibri" });
    s.addText(mi.d, { x:5.52, y:1.74+i*0.82, w:4.05, h:0.38,
      fontSize:9, color:C.white, fontFace:"Calibri" });
  });

  // Exchange label in middle
  s.addShape(pres.ShapeType.ellipse, { x:4.22, y:2.4, w:1.56, h:1.56,
    fill:{color:C.gold}, line:{color:C.white, width:2} });
  s.addText("EXCHANGE\nZONE\nIVS", {
    x:4.22, y:2.4, w:1.56, h:1.56,
    fontSize:9, bold:true, color:C.deepPlum,
    align:"center", valign:"middle", fontFace:"Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 9 — Functions of Placenta
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"FFFDE7"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.gold} });

  s.addText("7. FUNCTIONS OF PLACENTA", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:22, bold:true, color:C.deepPlum, fontFace:"Calibri",
  });

  const funcs = [
    {
      icon:"🫁", title:"Respiratory",
      points:["O₂: maternal→fetal via diffusion","CO₂: fetal→maternal via diffusion","Bohr effect facilitates O₂ transfer","HbF has higher O₂ affinity than HbA"],
      color:C.teal,
    },
    {
      icon:"🍎", title:"Nutritive",
      points:["Glucose: facilitated diffusion (GLUT1/3)","Amino acids: active transport","Fatty acids: diffusion","Iron, Ca²⁺: active transport"],
      color:"E65100",
    },
    {
      icon:"🚫", title:"Excretory",
      points:["CO₂ → maternal blood","Urea, uric acid → maternal circulation","Bilirubin cleared via IVS","Water by osmosis"],
      color:C.magenta,
    },
    {
      icon:"🛡️", title:"Immunological",
      points:["IgG actively transported (FcRn receptor)","Passive immunity to fetus","NK cell tolerance at decidua","Barrier to most organisms (not all)"],
      color:"1A237E",
    },
    {
      icon:"⚗️", title:"Endocrine",
      points:["hCG: maintains corpus luteum","Progesterone: maintains pregnancy","Oestrogen: uterine growth","hPL: diabetogenic; fetal nutrition"],
      color:C.deepPlum,
    },
    {
      icon:"🧱", title:"Barrier Function",
      points:["Placental membrane = 4 layers (early)","Thins to 2 layers at term","Crosses: drugs, alcohol, some viruses","Prevents: bacteria, most pathogens"],
      color:C.coral,
    },
  ];

  funcs.forEach((f, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const bx = 0.2 + col * 3.25;
    const by = 0.88 + row * 2.32;

    s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:3.1, h:2.18,
      fill:{color:f.color}, rectRadius:0.15 });

    s.addText(f.icon+" "+f.title, {
      x:bx+0.1, y:by+0.08, w:2.9, h:0.42,
      fontSize:13, bold:true, color:C.white, fontFace:"Segoe UI Emoji",
    });

    f.points.forEach((pt, pi) => {
      s.addText("• "+pt, {
        x:bx+0.12, y:by+0.52+pi*0.38, w:2.86, h:0.36,
        fontSize:9.5, color:C.white, fontFace:"Calibri",
      });
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 10 — Placental Barrier
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"FCE4EC"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.magenta} });

  s.addText("PLACENTAL BARRIER (HAEMOCHORIAL)", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:21, bold:true, color:C.white, fontFace:"Calibri",
  });

  // Early (4 layers) vs Late (2 layers)
  const phases = [
    {
      label:"EARLY PREGNANCY (4 Layers)", col:C.teal,
      layers:["1. Syncytiotrophoblast","2. Cytotrophoblast (Langhans)","3. Villous Stroma / Mesenchyme","4. Fetal Capillary Endothelium"],
    },
    {
      label:"LATE PREGNANCY (2 Layers)", col:C.magenta,
      layers:["1. Syncytiotrophoblast","(Cytotrophoblast disappears)","(Stroma thins out)","2. Fetal Capillary Endothelium"],
    },
  ];

  phases.forEach((ph, pi) => {
    const bx = 0.3 + pi * 4.8;
    s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.85, w:4.5, h:4.55,
      fill:{color:ph.col}, rectRadius:0.18 });
    s.addShape(pres.ShapeType.roundRect, { x:bx+0.08, y:0.92, w:4.34, h:0.5,
      fill:{color:C.white}, rectRadius:0.08 });
    s.addText(ph.label, { x:bx+0.08, y:0.92, w:4.34, h:0.5,
      fontSize:11, bold:true, color:ph.col, align:"center", valign:"middle", fontFace:"Calibri" });

    ph.layers.forEach((layer, li) => {
      const layerColors = ["FFCDD2","F8BBD0","E1F5FE","B3E5FC"];
      s.addShape(pres.ShapeType.rect, { x:bx+0.12, y:1.52+li*0.72, w:4.26, h:0.65,
        fill:{color:layerColors[li]} });
      s.addText(layer, { x:bx+0.2, y:1.55+li*0.72, w:4.1, h:0.58,
        fontSize:12, bold:true, color:C.deepPlum, valign:"middle", fontFace:"Calibri" });
    });

    s.addText(pi===0 ? "Thicker barrier • Less permeable" : "Thinner barrier • ↑ Exchange efficiency", {
      x:bx+0.1, y:4.52, w:4.3, h:0.72,
      fontSize:11, italic:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri",
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 11 — Clinical Significance
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:"EDE7F6"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.deepPlum} });

  s.addText("8. CLINICAL SIGNIFICANCE", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  const clinicals = [
    {
      condition:"Placenta Praevia",
      def:"Placenta implants over or near internal os",
      features:["Painless antepartum bleeding (PV)","Type I–IV (marginal to complete)","USG diagnosis","LSCS if type III/IV"],
      color:C.magenta,
    },
    {
      condition:"Placental Abruption",
      def:"Premature separation of normally sited placenta",
      features:["Painful bleeding (revealed/concealed)","Couvelaire uterus (severe)","DIC risk","Fetal distress → emergency LSCS"],
      color:"B71C1C",
    },
    {
      condition:"Placenta Accreta Spectrum",
      def:"Abnormal invasion of trophoblast into myometrium",
      features:["Accreta: adheres (no invasion)","Increta: myometrium invasion","Percreta: through to serosa/bladder","Major cause of PPH"],
      color:"E65100",
    },
    {
      condition:"Pre-eclampsia",
      def:"Failure of spiral artery remodelling → ischaemia",
      features:["Shallow EVT invasion (1st trimester)","↑ sFlt-1, ↓ PlGF","HTN + Proteinuria after 20 wks","Systemic endothelial dysfunction"],
      color:C.teal,
    },
    {
      condition:"Placental Insufficiency / IUGR",
      def:"Impaired uteroplacental blood flow → fetal growth restriction",
      features:["Doppler: absent/reversed EDF","Brain-sparing effect","Asymmetric growth restriction","Risk: stillbirth, neurodevelopment"],
      color:"1A237E",
    },
    {
      condition:"Molar Pregnancy (GTD)",
      def:"Abnormal trophoblast proliferation",
      features:["Complete mole: 46XX, no fetal parts","Partial mole: triploid","↑↑ hCG","Risk: choriocarcinoma"],
      color:"4A148C",
    },
  ];

  clinicals.forEach((c, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const bx = 0.15 + col * 3.25;
    const by = 0.82 + row * 2.35;

    s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:3.1, h:2.22,
      fill:{color:c.color}, rectRadius:0.15 });

    s.addText(c.condition, {
      x:bx+0.1, y:by+0.07, w:2.9, h:0.4,
      fontSize:12, bold:true, color:C.gold, fontFace:"Calibri",
    });
    s.addText(c.def, {
      x:bx+0.1, y:by+0.48, w:2.9, h:0.42,
      fontSize:9, italic:true, color:C.white, fontFace:"Calibri", wrap:true,
    });

    c.features.forEach((feat, fi) => {
      s.addText("▸ "+feat, {
        x:bx+0.1, y:by+0.92+fi*0.3, w:2.9, h:0.28,
        fontSize:8.5, color:C.white, fontFace:"Calibri",
      });
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 12 — Summary / Thank You
// ═══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.deepPlum} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color:C.teal} });
  s.addShape(pres.ShapeType.rect, { x:0, y:5.27, w:10, h:0.355, fill:{color:C.magenta} });

  s.addText("SUMMARY", {
    x:0.3, y:0.1, w:9.5, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri",
  });

  const summaryPoints = [
    "Fertilisation → Zygote → Morula → Blastocyst → Implantation (Day 6–10)",
    "Trophoblast → Cytotrophoblast + Syncytiotrophoblast → EVT remodels spiral arteries",
    "Decidua (Basalis, Capsularis, Parietalis) provides nutrition & immune tolerance",
    "Villi: Primary (Week 2) → Secondary (Week 3) → Tertiary vascular villi (Week 3–4)",
    "Mature placenta: ~500g, haemochorial type, 15–30 cotyledons, intervillous exchange",
    "Functions: Respiratory, Nutritive, Excretory, Immunological (IgG), Endocrine (hCG, hPL)",
    "Barrier: 4 layers (early) → 2 layers (term); Type: Haemochorial in humans",
    "Clinical: Praevia, Abruption, Accreta, Pre-eclampsia, IUGR, Molar pregnancy",
  ];

  summaryPoints.forEach((pt, i) => {
    const by = 0.88 + i * 0.56;
    const bg = i % 2 === 0 ? "2D1B60" : "1E1040";
    s.addShape(pres.ShapeType.roundRect, { x:0.2, y:by, w:9.6, h:0.5,
      fill:{color:bg}, rectRadius:0.06 });
    s.addShape(pres.ShapeType.ellipse, { x:0.28, y:by+0.12, w:0.26, h:0.26,
      fill:{color:C.gold} });
    s.addText(String(i+1), { x:0.28, y:by+0.12, w:0.26, h:0.26,
      fontSize:8, bold:true, color:C.deepPlum, align:"center", valign:"middle" });
    s.addText(pt, { x:0.62, y:by+0.04, w:8.9, h:0.42,
      fontSize:10.5, color:C.white, fontFace:"Calibri", valign:"middle" });
  });

  s.addText("Thank You", {
    x:3, y:5.27, w:4, h:0.34,
    fontSize:13, bold:true, color:C.white, align:"center", fontFace:"Calibri",
  });
}

// ── Write file ─────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/placenta-ppt/Placenta_Formation.pptx" })
  .then(() => console.log("✅ Done: Placenta_Formation.pptx"))
  .catch(e => console.error("❌", e));
Running Command

cd /home/daytona/workspace/placenta-ppt && node placenta.js 2>&1

Your colourful PPT is ready! Download it here:

Placenta Formation

Presentation · PPTX


What's inside (12 slides):

SlideContent
1Title - Deep plum + magenta + gold design
2Overview - 8 colour-coded topic boxes
3Implantation - Day 0 to Day 10 timeline (6 stages)
4Trophoblast Differentiation - Cytotrophoblast, Syncytiotrophoblast, EVT
5Decidua Formation - Basalis, Capsularis, Parietalis with diagram
6Chorionic Villi - Primary / Secondary / Tertiary with cross-section diagrams
7Mature Placenta Structure - layered diagram (fetal → maternal)
8Placental Circulation - Fetal vs Maternal side, IVS exchange
9Functions - 6 colour boxes (Respiratory, Nutritive, Excretory, Immune, Endocrine, Barrier)
10Placental Barrier - 4 layers (early) vs 2 layers (term)
11Clinical Significance - 6 conditions (Praevia, Abruption, Accreta, Pre-eclampsia, IUGR, GTD)
12Summary + Thank You - all key points in one slide
Color palette used: Deep plum, magenta, teal, coral, gold, peach - vibrant and distinct throughout.

Create a PDF version of this presentation

Reading File
Running Command

libreoffice --headless --convert-to pdf /home/daytona/workspace/placenta-ppt/Pla…

Running Command

mkdir -p /home/daytona/workspace/placenta-ppt/out && libreoffice --headless --co…

Running Command

ls -la /home/daytona/workspace/placenta-ppt/Placenta_Formation.pptx && cp /home/…

Running Command

cp /tmp/Placenta_Formation.pdf /home/daytona/workspace/placenta-ppt/Placenta_For…

Your PDF is ready! Download it here:

Placenta Formation

PDF Document · PDF

  • Size: 170 KB
  • Pages: 12 (one per slide)
  • Converted from the PPTX using LibreOffice with full colour and layout preserved

Download the pdf

The PDF is already available for download — just click the link below:

Placenta Formation

PDF Document · PDF

Simply click the link and your browser will download the file directly. No additional steps needed.

Create the entire content in this pdf into 10 charts form

Reading File
Running Command

cd /home/daytona/workspace/placenta-ppt && python3 -c " import pdfplumber with p…

Writing File

~/placenta-ppt/charts.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
from reportlab.platypus import Table, TableStyle
import math

W, H = A4  # 595 x 842 pt

# ── Palette ──────────────────────────────────────────────────────
PLUM    = HexColor("#2D1B4E")
MAGENTA = HexColor("#C2185B")
CORAL   = HexColor("#F06292")
PEACH   = HexColor("#FFAB91")
GOLD    = HexColor("#FFD54F")
TEAL    = HexColor("#00897B")
LTEAL   = HexColor("#B2DFDB")
NAVY    = HexColor("#1A237E")
ORANGE  = HexColor("#E65100")
PURPLE  = HexColor("#4A148C")
WHITE   = colors.white
DARK    = HexColor("#1A0033")
LGRAY   = HexColor("#F3E5F5")
MINT    = HexColor("#E8F5E9")

def header(c, title, bg, num, total=10):
    """Draw coloured header band with title and page indicator."""
    c.setFillColor(bg)
    c.rect(0, H - 52, W, 52, fill=1, stroke=0)
    c.setFillColor(WHITE)
    c.setFont("Helvetica-Bold", 18)
    c.drawString(16, H - 36, title)
    c.setFont("Helvetica", 10)
    c.drawRightString(W - 14, H - 22, f"Chart {num} of {total}")
    # thin gold accent line
    c.setFillColor(GOLD)
    c.rect(0, H - 56, W, 4, fill=1, stroke=0)

def footer(c, note=""):
    c.setFillColor(PLUM)
    c.rect(0, 0, W, 22, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.setFont("Helvetica-Oblique", 8)
    c.drawString(14, 7, "Placenta Formation | Embryology & Obstetrics")
    if note:
        c.drawRightString(W - 14, 7, note)

def rounded_rect(c, x, y, w, h, r, fill_color, stroke_color=None, stroke_w=1):
    """Draw a filled rounded rectangle."""
    c.setFillColor(fill_color)
    if stroke_color:
        c.setStrokeColor(stroke_color)
        c.setLineWidth(stroke_w)
    c.roundRect(x, y, w, h, r, fill=1, stroke=1 if stroke_color else 0)

def badge(c, x, y, w, h, text, bg, fg=None, fontsize=9, bold=False):
    fg = fg or WHITE
    rounded_rect(c, x, y, w, h, 4, bg)
    c.setFillColor(fg)
    fn = "Helvetica-Bold" if bold else "Helvetica"
    c.setFont(fn, fontsize)
    c.drawCentredString(x + w/2, y + h/2 - fontsize*0.35, text)

def wrap_text(c, text, x, y, max_width, font, size, color=WHITE, line_height=None):
    lh = line_height or size * 1.4
    c.setFont(font, size)
    c.setFillColor(color)
    words = text.split()
    line = ""
    cur_y = y
    for word in words:
        test = (line + " " + word).strip()
        if c.stringWidth(test, font, size) <= max_width:
            line = test
        else:
            if line:
                c.drawString(x, cur_y, line)
                cur_y -= lh
            line = word
    if line:
        c.drawString(x, cur_y, line)
    return cur_y - lh


# ════════════════════════════════════════════════════════════════
# CHART 1 — Implantation Timeline (Flow Chart)
# ════════════════════════════════════════════════════════════════
def chart1(c):
    header(c, "CHART 1 · Implantation Timeline (Day 0 → Day 10)", TEAL, 1)
    footer(c, "Days 0–10 post-fertilisation")

    stages = [
        ("Day 0",    "Fertilisation",       "Sperm + Ovum → Zygote\nin fallopian ampulla",    MAGENTA),
        ("Day 1–3",  "Cleavage",            "2 → 4 → 8 → 16 cell\nMorula forms",              TEAL),
        ("Day 4",    "Blastocyst",          "Fluid fills blastocoele\nInner cell mass forms",  NAVY),
        ("Day 5–6",  "Hatching",            "Zona pellucida dissolves\nBlastocyst freed",      ORANGE),
        ("Day 6–7",  "Apposition",          "Blastocyst adheres to\nposterior uterine wall",   PURPLE),
        ("Day 8–10", "Implantation",        "Trophoblast invades\ndecidua; complete",          HexColor("#B71C1C")),
    ]

    bw, bh = 135, 88
    gap = 20
    start_x = (W - (3 * bw + 2 * gap)) / 2
    row_y = [H - 210, H - 370]

    for i, (day, title, detail, col) in enumerate(stages):
        col_i = i % 3
        row_i = i // 3
        bx = start_x + col_i * (bw + gap)
        by = row_y[row_i]

        # Box
        rounded_rect(c, bx, by, bw, bh, 8, col, WHITE, 1)

        # Day badge
        badge(c, bx + 6, by + bh - 24, 70, 18, day, WHITE, col, 8, True)

        # Title
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 12)
        c.drawString(bx + 8, by + bh - 46, title)

        # Detail
        c.setFillColor(WHITE)
        c.setFont("Helvetica", 9)
        for j, line in enumerate(detail.split("\n")):
            c.drawString(bx + 8, by + bh - 62 - j * 13, line)

        # Arrow between boxes in same row
        if col_i < 2:
            ax = bx + bw + 4
            ay = by + bh // 2
            c.setStrokeColor(GOLD)
            c.setLineWidth(2)
            c.line(ax, ay, ax + gap - 8, ay)
            # arrowhead
            c.setFillColor(GOLD)
            c.polygon([ax + gap - 8, ay, ax + gap - 16, ay + 5, ax + gap - 16, ay - 5], fill=1)

        # Down arrow from row 0 col 2 to row 1 col 2 (right-most)
        if i == 2:
            dx = bx + bw // 2
            c.setStrokeColor(GOLD)
            c.setLineWidth(2)
            c.line(dx, by, dx, row_y[1] + bh)
            c.setFillColor(GOLD)
            c.polygon([dx, row_y[1] + bh, dx - 5, row_y[1] + bh + 10, dx + 5, row_y[1] + bh + 10], fill=1)

    # Key note box
    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 50, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 10)
    c.drawString(42, 62, "Key Fact:")
    c.setFont("Helvetica", 10)
    c.drawString(42, 48, "Normal implantation site = Posterior wall, upper uterine body (fundus)")
    c.drawString(42, 36, "Type = Interstitial (decidua basalis). Ectopic implantation → tubal pregnancy (ampulla most common)")


# ════════════════════════════════════════════════════════════════
# CHART 2 — Trophoblast Differentiation (Branching Diagram)
# ════════════════════════════════════════════════════════════════
def chart2(c):
    header(c, "CHART 2 · Trophoblast Differentiation", MAGENTA, 2)
    footer(c, "Day 6 onwards")

    # Central node
    cx, cy = W / 2, H - 160
    badge(c, cx - 70, cy - 22, 140, 44, "TROPHOBLAST (Day 6)", GOLD, PLUM, 12, True)

    # Left branch: Cytotrophoblast
    lx, ly = 60, H - 340
    c.setStrokeColor(TEAL)
    c.setLineWidth(2)
    c.line(cx, cy - 22, lx + 125, ly + 110)

    rounded_rect(c, lx, ly - 20, 250, 130, 8, TEAL)
    c.setFillColor(GOLD)
    c.setFont("Helvetica-Bold", 12)
    c.drawString(lx + 8, ly + 92, "CYTOTROPHOBLAST")
    c.setFillColor(WHITE)
    c.setFont("Helvetica", 9)
    c.drawString(lx + 8, ly + 78, "(Langhans Layer)")
    points_l = ["• Inner mononuclear layer", "• Mitotically active", "• Fuses → syncytium",
                "• Present until 20 wks", "• Regenerates syncytiotrophoblast"]
    for j, pt in enumerate(points_l):
        c.drawString(lx + 8, ly + 60 - j * 14, pt)

    # Right branch: Syncytiotrophoblast
    rx, ry = W - 60 - 250, H - 340
    c.setStrokeColor(CORAL)
    c.setLineWidth(2)
    c.line(cx, cy - 22, rx + 125, ry + 110)

    rounded_rect(c, rx, ry - 20, 250, 130, 8, MAGENTA)
    c.setFillColor(GOLD)
    c.setFont("Helvetica-Bold", 12)
    c.drawString(rx + 8, ry + 92, "SYNCYTIOTROPHOBLAST")
    c.setFillColor(WHITE)
    c.setFont("Helvetica", 9)
    points_r = ["• Outer multinucleated layer", "• No cell boundaries", "• Invades decidua directly",
                "• Erodes spiral arteries", "• Secretes hCG & progesterone"]
    for j, pt in enumerate(points_r):
        c.drawString(rx + 8, ry + 78 - j * 14, pt)

    # Bottom two boxes: EVT and Villous
    evx, evy = 30, H - 570
    rounded_rect(c, evx, evy, 245, 115, 8, NAVY)
    c.setFillColor(GOLD)
    c.setFont("Helvetica-Bold", 11)
    c.drawString(evx + 8, evy + 96, "EXTRAVILLOUS TROPHOBLAST (EVT)")
    c.setFillColor(WHITE)
    c.setFont("Helvetica", 9)
    evtpts = ["Interstitial EVT: invades decidua & myometrium",
              "Endovascular EVT: remodels spiral arteries",
              "→ Low-resistance uteroplacental circulation",
              "Key in pre-eclampsia pathology"]
    for j, pt in enumerate(evtpts):
        c.drawString(evx + 8, evy + 78 - j * 14, pt)

    vx, vy = W - 30 - 245, H - 570
    rounded_rect(c, vx, vy, 245, 115, 8, ORANGE)
    c.setFillColor(GOLD)
    c.setFont("Helvetica-Bold", 11)
    c.drawString(vx + 8, vy + 96, "VILLOUS TROPHOBLAST")
    c.setFillColor(WHITE)
    c.setFont("Helvetica", 9)
    vpts = ["Covers surface of chorionic villi",
            "Outer: Syncytiotrophoblast",
            "Inner: Cytotrophoblast",
            "Forms the placental BARRIER (haemochorial)"]
    for j, pt in enumerate(vpts):
        c.drawString(vx + 8, vy + 78 - j * 14, pt)

    # Connector lines to bottom boxes
    c.setStrokeColor(GOLD)
    c.setLineWidth(1.5)
    c.line(lx + 125, ly - 20, evx + 122, evy + 115)
    c.line(rx + 125, ry - 20, vx + 122, vy + 115)

    # Bottom note
    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 38, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(42, 52, "Remember:")
    c.setFont("Helvetica", 9)
    c.drawString(42, 38, "Cytotrophoblast = stem cells | Syncytiotrophoblast = functional (hormone secretion + invasion)")


# ════════════════════════════════════════════════════════════════
# CHART 3 — Decidua Formation (Labelled Diagram)
# ════════════════════════════════════════════════════════════════
def chart3(c):
    header(c, "CHART 3 · Decidua Formation", ORANGE, 3)
    footer(c, "Maternal endometrial transformation")

    # Uterine wall layers - stacked rectangles
    layers = [
        ("DECIDUA BASALIS",    "Deep to embryo • Forms maternal part of placenta",                       MAGENTA),
        ("DECIDUA CAPSULARIS", "Covers embryo superficially • Disappears by 20 weeks",                  TEAL),
        ("DECIDUA PARIETALIS", "Lines rest of uterine cavity • Fuses with capsularis by 20 wks",        NAVY),
        ("MYOMETRIUM",         "Uterine muscle layer • Invaded by EVT in accreta spectrum",              HexColor("#5D4037")),
    ]
    lx, lw, lh = 40, 240, 58
    start_ly = H - 490
    c.setFillColor(HexColor("#FFF3E0"))
    c.roundRect(30, start_ly - 20, 260, 4 * lh + 60, 8, fill=1, stroke=0)
    c.setFillColor(ORANGE)
    c.setFont("Helvetica-Bold", 10)
    c.drawCentredString(160, start_ly + 4 * lh + 30, "UTERINE WALL")

    for i, (name, desc, col) in enumerate(layers):
        ly = start_ly + (3 - i) * lh
        rounded_rect(c, lx, ly, lw, lh - 4, 4, col)
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Bold", 9)
        c.drawString(lx + 8, ly + lh - 20, name)
        c.setFont("Helvetica", 8)
        for j, line in enumerate(desc.split("•")):
            c.drawString(lx + 8, ly + lh - 34 - j * 12, ("• " + line.strip()) if j > 0 else line.strip())

    # Embryo oval
    c.setFillColor(GOLD)
    c.ellipse(60, start_ly - 60, 220, start_ly - 10, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 12)
    c.drawCentredString(140, start_ly - 40, "EMBRYO / FETUS")

    # Right panel: key processes
    panels = [
        ("Decidual Reaction",         "Stromal cells → Decidual cells\nRich in glycogen & lipids\nNutrition to embryo",   MAGENTA),
        ("Spiral Artery Remodelling", "EVT replaces vessel wall\nHigh→Low resistance flow\nComplete by 20 wks",           TEAL),
        ("Immune Tolerance",          "NK cells + Tregs\nProtect semi-allograft fetus\nImmunological sanctuary",          NAVY),
        ("Clinical Significance",     "Fails → miscarriage\nExcessive → Accreta spectrum\nProgesterone driven",           ORANGE),
    ]
    px, pw, ph = 310, 245, 102
    for i, (title, body, col) in enumerate(panels):
        py = H - 200 - i * (ph + 10)
        rounded_rect(c, px, py, pw, ph, 6, col)
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 10)
        c.drawString(px + 8, py + ph - 18, title)
        c.setFillColor(WHITE)
        c.setFont("Helvetica", 9)
        for j, line in enumerate(body.split("\n")):
            c.drawString(px + 8, py + ph - 34 - j * 14, line)

    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 38, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica", 9)
    c.drawString(42, 52, "Decidua = Endometrium of pregnancy (progesterone-driven transformation from secretory endometrium)")
    c.drawString(42, 38, "Three zones: Basalis (placental) | Capsularis (covers) | Parietalis (lining)")


# ════════════════════════════════════════════════════════════════
# CHART 4 — Chorionic Villi Development (3-Stage Progression)
# ════════════════════════════════════════════════════════════════
def chart4(c):
    header(c, "CHART 4 · Chorionic Villi Development", NAVY, 4)
    footer(c, "Week 2 → Week 3–4")

    stages = [
        ("PRIMARY VILLI",   "Week 2",   MAGENTA,
         ["Cytotrophoblast core", "Covered by syncytiotrophoblast",
          "Solid trophoblast projections", "No blood vessels yet", "2 layers only"]),
        ("SECONDARY VILLI",  "Week 3",  TEAL,
         ["Mesenchymal core added", "Cytotrophoblast + Syncytio", "+ Extraembryonic mesoderm",
          "3 layers present", "Still avascular"]),
        ("TERTIARY VILLI",   "Week 3–4", ORANGE,
         ["Fetal blood vessels form", "Allantois vessels connect", "Villi become VASCULAR",
          "Full exchange capacity", "Functional placenta"]),
    ]

    bx_start = 35
    bw, bh = 160, 380
    gap = 12

    for i, (title, week, col, points) in enumerate(stages):
        bx = bx_start + i * (bw + gap)
        by = H - 720

        # Main card
        rounded_rect(c, bx, by, bw, bh, 10, col, WHITE, 1)

        # Stage title
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Bold", 12)
        c.drawCentredString(bx + bw / 2, by + bh - 24, title)

        # Week badge
        badge(c, bx + bw//2 - 35, by + bh - 48, 70, 20, week, WHITE, col, 9, True)

        # Cross-section diagram (concentric circles representing layers)
        cx2, cy2 = bx + bw // 2, by + bh - 120
        radii_colors = {
            0: [(38, CORAL), (28, PEACH), (15, HexColor("#A5D6A7"))],
            1: [(38, CORAL), (28, PEACH), (16, HexColor("#A5D6A7")), (8, TEAL)],
            2: [(38, CORAL), (28, PEACH), (16, HexColor("#A5D6A7")), (8, HexColor("#EF5350"))],
        }
        for r, fc in radii_colors[i]:
            c.setFillColor(fc)
            c.circle(cx2, cy2, r, fill=1, stroke=0)

        # Labels on diagram
        labels = {
            0: [("Syncytio", cx2 - 36, cy2 + 28, 7)],
            1: [("Syncytio", cx2 - 36, cy2 + 28, 7), ("Meso", cx2 - 8, cy2 + 5, 7)],
            2: [("Syncytio", cx2 - 36, cy2 + 28, 7), ("BV", cx2 - 5, cy2 - 3, 7)],
        }
        c.setFillColor(PLUM)
        for lbl, lx2, ly2, fs in labels[i]:
            c.setFont("Helvetica-Bold", fs)
            c.drawString(lx2, ly2, lbl)

        # Points
        c.setFillColor(WHITE)
        c.setFont("Helvetica", 9)
        for j, pt in enumerate(points):
            c.drawString(bx + 10, by + bh - 180 - j * 26, "▸  " + pt)

        # Arrow between stages
        if i < 2:
            ax = bx + bw + 2
            ay = by + bh // 2
            c.setStrokeColor(GOLD)
            c.setLineWidth(2.5)
            c.line(ax, ay, ax + gap - 4, ay)
            c.setFillColor(GOLD)
            c.polygon([ax + gap - 4, ay, ax + gap - 12, ay + 6, ax + gap - 12, ay - 6], fill=1)

    # Legend
    legend_items = [
        (CORAL, "Syncytiotrophoblast"),
        (PEACH, "Cytotrophoblast"),
        (HexColor("#A5D6A7"), "Mesenchyme"),
        (HexColor("#EF5350"), "Blood Vessels"),
    ]
    lx_leg = W - 160
    c.setFillColor(LGRAY)
    c.roundRect(lx_leg - 10, H - 720, 155, 110, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(lx_leg, H - 735, "LEGEND (Cross-Section)")
    for j, (col2, lbl) in enumerate(legend_items):
        c.setFillColor(col2)
        c.circle(lx_leg + 6, H - 750 - j * 18, 5, fill=1, stroke=0)
        c.setFillColor(PLUM)
        c.setFont("Helvetica", 8)
        c.drawString(lx_leg + 16, H - 754 - j * 18, lbl)

    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 50, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(42, 65, "Key Concept:")
    c.setFont("Helvetica", 9)
    c.drawString(42, 51, "Primary → Secondary → Tertiary = Progressive vascularisation of villi")
    c.drawString(42, 37, "Tertiary villi = functional exchange units connecting fetal & maternal circulations")


# ════════════════════════════════════════════════════════════════
# CHART 5 — Mature Placenta Structure (Layered Diagram)
# ════════════════════════════════════════════════════════════════
def chart5(c):
    header(c, "CHART 5 · Mature Placenta – Structure & Dimensions", TEAL, 5)
    footer(c, "Term placenta (38–40 weeks)")

    # Stats row
    stats = [("Weight", "500 g", MAGENTA), ("Diameter", "15–20 cm", TEAL),
             ("Thickness", "2.5–3 cm", ORANGE), ("Cotyledons", "15–30", NAVY)]
    sw = (W - 40) / 4
    for i, (lbl, val, col) in enumerate(stats):
        sx = 20 + i * sw
        sy = H - 200
        rounded_rect(c, sx + 4, sy, sw - 8, 80, 6, col)
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Bold", 9)
        c.drawCentredString(sx + sw/2, sy + 60, lbl)
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 16)
        c.drawCentredString(sx + sw/2, sy + 30, val)

    # Fetal→Maternal layers
    layer_data = [
        ("AMNIOTIC EPITHELIUM",        "Inner-most layer • Lines amniotic cavity • Single columnar cells",                 HexColor("#B3E5FC"), PLUM),
        ("CHORIONIC PLATE (Fetal)",    "Connective tissue • Umbilical vessels branch here • Covered by amnion",            HexColor("#81D4FA"), PLUM),
        ("INTERVILLOUS SPACE (IVS)",   "Maternal blood (150 mL) bathes villi • Site of gas/nutrient/waste exchange",       CORAL,              WHITE),
        ("CYTOTROPHOBLAST SHELL",      "Anchoring villi merge here • Separates IVS from decidua",                          PEACH,              PLUM),
        ("DECIDUA BASALIS (Maternal)", "Septa divide placenta into 15–30 cotyledons • Nitabuch fibrinoid layer at base",   MAGENTA,            WHITE),
        ("MYOMETRIUM",                 "Uterine muscle • Invaded in accreta spectrum disorders",                            HexColor("#CE93D8"), PLUM),
    ]

    total_h = 340
    lh_each = total_h / len(layer_data)
    base_y = 100
    lx2, lw2 = 20, W - 40

    # Fetal / Maternal label bar
    c.setFillColor(TEAL)
    c.rect(0, base_y + total_h * 0.5, 14, total_h * 0.5, fill=1, stroke=0)
    c.setFillColor(MAGENTA)
    c.rect(0, base_y, 14, total_h * 0.5, fill=1, stroke=0)
    c.setFillColor(WHITE)
    c.setFont("Helvetica-Bold", 7)
    c.saveState()
    c.translate(7, base_y + total_h * 0.75)
    c.rotate(90)
    c.drawCentredString(0, 0, "FETAL")
    c.restoreState()
    c.saveState()
    c.translate(7, base_y + total_h * 0.25)
    c.rotate(90)
    c.drawCentredString(0, 0, "MATERNAL")
    c.restoreState()

    for i, (name, desc, bg, fg) in enumerate(layer_data):
        ly2 = base_y + total_h - (i + 1) * lh_each
        c.setFillColor(bg)
        c.rect(lx2 + 14, ly2, lw2 - 14, lh_each - 2, fill=1, stroke=0)
        c.setFillColor(fg)
        c.setFont("Helvetica-Bold", 9)
        c.drawString(lx2 + 20, ly2 + lh_each - 18, name)
        c.setFont("Helvetica", 8)
        c.drawString(lx2 + 20, ly2 + lh_each - 32, desc)
        # separator line
        c.setStrokeColor(WHITE)
        c.setLineWidth(1)
        c.line(lx2 + 14, ly2 + lh_each - 2, lx2 + lw2, ly2 + lh_each - 2)


# ════════════════════════════════════════════════════════════════
# CHART 6 — Placental Circulation (Dual-column Flow)
# ════════════════════════════════════════════════════════════════
def chart6(c):
    header(c, "CHART 6 · Placental Circulation", HexColor("#B71C1C"), 6)
    footer(c, "Uteroplacental & Fetoplacental")

    # Two columns
    for side, col_bg, title, items, sx in [
        ("FETAL", NAVY, "FETAL CIRCULATION",
         [("Umbilical Arteries ×2",    "Deoxygenated blood fetus → placenta\nFrom internal iliac arteries"),
          ("Chorionic Plate Arteries", "Branch into stem villous arteries\nTree-like distribution"),
          ("Capillary Network",        "In terminal villi\nGas / nutrient exchange zone"),
          ("Umbilical Vein ×1",        "Oxygenated blood → fetus\nVia ductus venosus → IVC")],
         20),
        ("MATERNAL", HexColor("#880E4F"), "MATERNAL CIRCULATION",
         [("Spiral Arteries",          "Remodelled by EVT\nLow-resistance, high-volume flow"),
          ("Intervillous Space",       "~150 mL maternal blood\nExchanges O₂, CO₂, glucose, waste"),
          ("Uterine Venous Sinuses",   "Drain deoxygenated blood from IVS\nBack to uterine veins"),
          ("Nitabuch Layer",           "Fibrinoid zone at decidua junction\nPrevents excessive invasion")],
         W//2 + 10),
    ]:
        cw = W//2 - 30
        # Header
        rounded_rect(c, sx, H - 180, cw, 44, 6, col_bg)
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 13)
        c.drawCentredString(sx + cw/2, H - 152, title)

        for j, (item_title, item_desc) in enumerate(items):
            iy = H - 300 - j * 118
            rounded_rect(c, sx, iy, cw, 108, 6, col_bg)
            badge(c, sx + 6, iy + 80, 20, 20, str(j+1), GOLD, PLUM, 9, True)
            c.setFillColor(GOLD)
            c.setFont("Helvetica-Bold", 11)
            c.drawString(sx + 32, iy + 88, item_title)
            c.setFillColor(WHITE)
            c.setFont("Helvetica", 9)
            for k, line in enumerate(item_desc.split("\n")):
                c.drawString(sx + 14, iy + 68 - k * 15, line)

    # Exchange zone in centre bottom
    ex = W//2 - 50
    ey = H - 730
    c.setFillColor(GOLD)
    c.circle(W//2, ey + 36, 46, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 10)
    c.drawCentredString(W//2, ey + 48, "IVS")
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(W//2, ey + 35, "EXCHANGE")
    c.drawCentredString(W//2, ey + 22, "ZONE")

    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 50, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(42, 65, "Type: Haemochorial placenta")
    c.setFont("Helvetica", 9)
    c.drawString(42, 51, "Maternal blood is in DIRECT contact with trophoblast (no capillary wall between them)")
    c.drawString(42, 37, "Counter-current flow in IVS maximises exchange efficiency")


# ════════════════════════════════════════════════════════════════
# CHART 7 — Functions of Placenta (Hexagonal Grid)
# ════════════════════════════════════════════════════════════════
def chart7(c):
    header(c, "CHART 7 · Functions of Placenta", TEAL, 7)
    footer(c, "6 major functional categories")

    funcs = [
        ("RESPIRATORY",    MAGENTA, ["O₂: maternal→fetal (diffusion)", "CO₂: fetal→maternal (diffusion)",
                                      "Bohr effect facilitates O₂ transfer", "HbF > HbA O₂ affinity"]),
        ("NUTRITIVE",      TEAL,    ["Glucose: GLUT1/3 (facilitated diff.)", "Amino acids: active transport",
                                      "Fatty acids: diffusion", "Fe, Ca²⁺: active transport"]),
        ("EXCRETORY",      ORANGE,  ["CO₂ → maternal blood", "Urea, uric acid → maternal",
                                      "Bilirubin cleared via IVS", "Water by osmosis"]),
        ("IMMUNOLOGICAL",  NAVY,    ["IgG actively transported (FcRn)", "Passive immunity to fetus",
                                      "NK cell tolerance at decidua", "Barrier to most pathogens"]),
        ("ENDOCRINE",      PURPLE,  ["hCG: maintains corpus luteum", "Progesterone: maintains pregnancy",
                                      "Oestrogen: uterine growth", "hPL: diabetogenic + fetal nutrition"]),
        ("BARRIER",        HexColor("#BF360C"), ["4 layers early → 2 at term", "Crosses: drugs, alcohol, viruses",
                                                  "Blocks: bacteria, most pathogens", "Type: Haemochorial"]),
    ]

    bw2, bh2 = 170, 165
    gx2, gy2 = 10, 10
    cols2 = 3
    start_x2 = (W - cols2 * bw2 - (cols2-1) * gx2) / 2
    start_y2 = H - 730

    for i, (title, col, pts) in enumerate(funcs):
        col_i = i % cols2
        row_i = i // cols2
        bx2 = start_x2 + col_i * (bw2 + gx2)
        by2 = start_y2 + (1 - row_i) * (bh2 + gy2)

        rounded_rect(c, bx2, by2, bw2, bh2, 10, col, WHITE, 1)

        # Title band
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Bold", 11)
        c.drawCentredString(bx2 + bw2/2, by2 + bh2 - 22, title)

        # Divider
        c.setStrokeColor(GOLD)
        c.setLineWidth(1)
        c.line(bx2 + 10, by2 + bh2 - 30, bx2 + bw2 - 10, by2 + bh2 - 30)

        c.setFillColor(WHITE)
        c.setFont("Helvetica", 9)
        for j, pt in enumerate(pts):
            c.drawString(bx2 + 10, by2 + bh2 - 52 - j * 26, "• " + pt)

    c.setFillColor(LGRAY)
    c.roundRect(30, 28, W - 60, 38, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(42, 52, "Mnemonic:")
    c.setFont("Helvetica", 9)
    c.drawString(42, 38, "R-N-E-I-E-B = Respiratory, Nutritive, Excretory, Immunological, Endocrine, Barrier")


# ════════════════════════════════════════════════════════════════
# CHART 8 — Placental Barrier: Early vs Term (Comparison Chart)
# ════════════════════════════════════════════════════════════════
def chart8(c):
    header(c, "CHART 8 · Placental Barrier – Early vs Term", MAGENTA, 8)
    footer(c, "Haemochorial placenta — layer changes with gestation")

    phases = [
        ("EARLY PREGNANCY", "4 Layers", NAVY,
         [("1. Syncytiotrophoblast",      CORAL,              "Outer; no cell boundaries; secretory"),
          ("2. Cytotrophoblast (Langhans)","#81D4FA",         "Mononuclear; mitotically active"),
          ("3. Villous Stroma/Mesenchyme", "#A5D6A7",          "Connective tissue core of villi"),
          ("4. Fetal Capillary Endothelium","#FFCDD2",         "Inner wall of fetal vessels")],
         "Thicker barrier  |  Less permeable  |  Lower exchange rate",
         False),
        ("TERM PREGNANCY",  "2 Layers", MAGENTA,
         [("1. Syncytiotrophoblast (persists)", CORAL,          "Thins significantly; ↑ surface area"),
          ("(Cytotrophoblast disappears)",       "#E0E0E0",      "Absent by term — thinner barrier"),
          ("(Stroma greatly reduced)",           "#E0E0E0",      "Vasculosyncytial membranes form"),
          ("2. Fetal Capillary Endothelium",     "#FFCDD2",      "Directly adjacent to syncytiotrophoblast")],
         "Thinner barrier  |  ↑ Exchange efficiency  |  ~3.5 µm thickness",
         True),
    ]

    for pi, (phase_name, sublabel, hdr_col, llayers, note, is_term) in enumerate(phases):
        px2 = 25 + pi * (W//2 + 5)
        pw2 = W//2 - 35

        # Phase header
        rounded_rect(c, px2, H - 195, pw2, 52, 6, hdr_col)
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Bold", 13)
        c.drawCentredString(px2 + pw2/2, H - 162, phase_name)
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 10)
        c.drawCentredString(px2 + pw2/2, H - 178, sublabel)

        # Layers stack
        ly_start = H - 210
        lh3 = 100
        for j, (lname, lbg_hex, ldesc) in enumerate(llayers):
            lbg = HexColor(lbg_hex) if lbg_hex.startswith("#") else HexColor(lbg_hex)
            ly3 = ly_start - j * (lh3 + 6)
            c.setFillColor(lbg)
            c.roundRect(px2, ly3 - lh3, pw2, lh3, 5, fill=1, stroke=0)
            # Strikethrough for absent layers
            if is_term and j in [1, 2]:
                c.setFillColor(HexColor("#BDBDBD"))
                c.setFont("Helvetica-Oblique", 8)
                c.drawString(px2 + 8, ly3 - lh3 + 60, lname)
                c.setFont("Helvetica", 8)
                c.drawString(px2 + 8, ly3 - lh3 + 44, ldesc)
                c.setStrokeColor(HexColor("#757575"))
                c.setLineWidth(1.5)
                c.line(px2 + 4, ly3 - lh3 + 52, px2 + pw2 - 4, ly3 - lh3 + 52)
            else:
                c.setFillColor(PLUM if lbg_hex in ["#FFCDD2", "#A5D6A7", "#81D4FA", "#E0E0E0"] else WHITE)
                c.setFont("Helvetica-Bold", 9)
                c.drawString(px2 + 8, ly3 - lh3 + 70, lname)
                c.setFont("Helvetica", 8)
                c.drawString(px2 + 8, ly3 - lh3 + 54, ldesc)

        # Note badge
        rounded_rect(c, px2, H - 670, pw2, 36, 4, hdr_col)
        c.setFillColor(WHITE)
        c.setFont("Helvetica", 8)
        c.drawCentredString(px2 + pw2/2, H - 647, note)

    # Bottom comparison table
    c.setFillColor(LGRAY)
    c.roundRect(20, 28, W - 40, 110, 6, fill=1, stroke=0)
    headers_t = ["Property", "Early Pregnancy", "Term Pregnancy"]
    rows_t = [
        ["No. of layers", "4", "2"],
        ["Barrier thickness", "~25 µm", "~3.5 µm"],
        ["Cytotrophoblast", "Present (Langhans)", "Absent"],
        ["Exchange rate", "Lower", "Much higher"],
    ]
    col_widths = [160, 170, 170]
    tx, ty = 30, 125
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    offset = 0
    for i, h2 in enumerate(headers_t):
        c.drawString(tx + offset + 4, ty, h2)
        offset += col_widths[i]
    c.setStrokeColor(PLUM)
    c.line(tx, ty - 4, tx + sum(col_widths), ty - 4)
    for ri, row in enumerate(rows_t):
        ry = ty - 18 - ri * 16
        if ri % 2 == 0:
            c.setFillColor(HexColor("#EDE7F6"))
            c.rect(tx, ry - 4, sum(col_widths), 14, fill=1, stroke=0)
        c.setFillColor(DARK)
        c.setFont("Helvetica", 8)
        offset = 0
        for ci, cell in enumerate(row):
            fn = "Helvetica-Bold" if ci == 0 else "Helvetica"
            c.setFont(fn, 8)
            c.drawString(tx + offset + 4, ry, cell)
            offset += col_widths[ci]


# ════════════════════════════════════════════════════════════════
# CHART 9 — Clinical Significance (6-Box Grid)
# ════════════════════════════════════════════════════════════════
def chart9(c):
    header(c, "CHART 9 · Clinical Significance of Placenta", PURPLE, 9)
    footer(c, "6 major clinical conditions")

    conditions = [
        ("PLACENTA PRAEVIA", MAGENTA,
         "Placenta over/near internal os",
         ["Painless APH (antepartum bleed)", "Type I–IV (marginal→complete)",
          "Diagnosed by USG", "LSCS if type III/IV"]),
        ("PLACENTAL ABRUPTION", HexColor("#B71C1C"),
         "Premature separation of normally sited placenta",
         ["Painful (revealed/concealed bleed)", "Couvelaire uterus (severe)",
          "DIC risk", "Emergency LSCS"]),
        ("ACCRETA SPECTRUM", ORANGE,
         "Abnormal trophoblast invasion of myometrium",
         ["Accreta: adheres (no invasion)", "Increta: myometrium invasion",
          "Percreta: through serosa/bladder", "Major PPH cause"]),
        ("PRE-ECLAMPSIA", TEAL,
         "Failure of spiral artery remodelling → ischaemia",
         ["Shallow EVT invasion (1st trim.)", "↑ sFlt-1, ↓ PlGF",
          "HTN + Proteinuria after 20 wks", "Systemic endothelial dysfunction"]),
        ("PLACENTAL INSUFFICIENCY / IUGR", NAVY,
         "Impaired uteroplacental flow → growth restriction",
         ["Doppler: absent/reversed EDF", "Brain-sparing effect",
          "Asymmetric IUGR", "Risk: stillbirth, neurodevelopment"]),
        ("MOLAR PREGNANCY (GTD)", PURPLE,
         "Abnormal trophoblast proliferation",
         ["Complete mole: 46XX, no fetal parts", "Partial mole: triploid",
          "↑↑ hCG levels", "Risk: choriocarcinoma"]),
    ]

    bw3, bh3 = 175, 190
    gx3, gy3 = 8, 8
    cols3 = 3
    total_w = cols3 * bw3 + (cols3-1) * gx3
    sx3 = (W - total_w) / 2
    sy3_start = H - 730

    for i, (cond, col, defn, feats) in enumerate(conditions):
        ci = i % cols3
        ri = i // cols3
        bx3 = sx3 + ci * (bw3 + gx3)
        by3 = sy3_start + (1 - ri) * (bh3 + gy3)

        rounded_rect(c, bx3, by3, bw3, bh3, 8, col, WHITE, 1)

        # Condition title
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 9)
        # Wrap long titles
        title_words = cond.split()
        title_line = ""
        title_lines = []
        for w in title_words:
            test = (title_line + " " + w).strip()
            if c.stringWidth(test, "Helvetica-Bold", 9) < bw3 - 14:
                title_line = test
            else:
                title_lines.append(title_line)
                title_line = w
        title_lines.append(title_line)
        for tli, tl in enumerate(title_lines):
            c.drawString(bx3 + 8, by3 + bh3 - 18 - tli * 12, tl)

        top_offset = len(title_lines) * 12

        # Definition
        c.setFillColor(WHITE)
        c.setFont("Helvetica-Oblique", 8)
        defn_y = by3 + bh3 - 22 - top_offset
        for dw_i, dw_chunk in enumerate(defn.split("→")):
            c.drawString(bx3 + 8, defn_y - dw_i * 10, dw_chunk.strip() + (" →" if dw_i < len(defn.split("→"))-1 else ""))

        # Divider
        c.setStrokeColor(GOLD)
        c.setLineWidth(0.8)
        divider_y = by3 + bh3 - 44 - top_offset
        c.line(bx3 + 8, divider_y, bx3 + bw3 - 8, divider_y)

        # Features
        c.setFont("Helvetica", 8)
        c.setFillColor(WHITE)
        for j, feat in enumerate(feats):
            c.drawString(bx3 + 8, divider_y - 16 - j * 24, "▸ " + feat)

    # Bottom key
    c.setFillColor(LGRAY)
    c.roundRect(20, 28, W - 40, 38, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 9)
    c.drawString(30, 53, "Key:")
    c.setFont("Helvetica", 8)
    c.drawString(30, 39, "APH = Antepartum Haemorrhage | DIC = Disseminated Intravascular Coagulation | PPH = Postpartum Haemorrhage | EVT = Extravillous Trophoblast | EDF = End Diastolic Flow")


# ════════════════════════════════════════════════════════════════
# CHART 10 — Master Summary (All-in-One Reference)
# ════════════════════════════════════════════════════════════════
def chart10(c):
    header(c, "CHART 10 · Master Summary – Placenta Formation", PLUM, 10)
    footer(c, "Quick reference — all topics")

    summary_blocks = [
        ("IMPLANTATION", TEAL,
         ["Day 0: Fertilisation | Day 1–3: Cleavage/Morula",
          "Day 4: Blastocyst | Day 5–6: Hatching",
          "Day 6–7: Apposition | Day 8–10: Interstitial implantation",
          "Site: Posterior upper uterine body"]),
        ("TROPHOBLAST", MAGENTA,
         ["Cytotrophoblast (Langhans) → inner, mitotic, stem cells",
          "Syncytiotrophoblast → outer, invasive, secretes hCG/Prog",
          "EVT → remodels spiral arteries (low resistance)",
          "Villous T. → forms placental barrier"]),
        ("DECIDUA", ORANGE,
         ["Basalis: deep to embryo, maternal placenta",
          "Capsularis: covers embryo, disappears 20 wks",
          "Parietalis: lines rest of cavity",
          "Progesterone-driven; failure → miscarriage"]),
        ("VILLI", NAVY,
         ["Primary (Wk 2): Cyto + Syncytio, avascular",
          "Secondary (Wk 3): + Mesenchymal core",
          "Tertiary (Wk 3–4): + Blood vessels, functional",
          "Terminal villi = site of gas/nutrient exchange"]),
        ("MATURE PLACENTA", PURPLE,
         ["Weight: 500g | Diameter: 15–20 cm | Thickness: 2.5–3 cm",
          "15–30 cotyledons | IVS: 150 mL maternal blood",
          "Type: Haemochorial (maternal blood ↔ trophoblast)",
          "Layers: Amniotic epi, Chorionic plate, IVS, Decidua basalis"]),
        ("CIRCULATION", HexColor("#B71C1C"),
         ["Fetal: Umbilical aa (×2) → capillaries → umbilical v (×1)",
          "Maternal: spiral arteries → IVS → uterine veins",
          "Exchange in IVS (counter-current)",
          "Ductus venosus: umbilical v → IVC (bypass liver)"]),
        ("FUNCTIONS", TEAL,
         ["Respiratory: O₂/CO₂ by diffusion (Bohr effect)",
          "Nutritive: Glucose (GLUT1/3), AA (active), Fatty acids",
          "Endocrine: hCG, Progesterone, Oestrogen, hPL",
          "Immunological: IgG (FcRn), immune tolerance"]),
        ("BARRIER", MAGENTA,
         ["Early: 4 layers (~25 µm) | Term: 2 layers (~3.5 µm)",
          "Crosses: drugs, alcohol, IgG, some viruses",
          "Blocks: bacteria, most pathogens",
          "Vasculosyncytial membranes at term"]),
        ("CLINICAL", ORANGE,
         ["Praevia: over OS, painless bleed | Abruption: painful, DIC",
          "Accreta spectrum: abnormal invasion, PPH",
          "Pre-eclampsia: failed EVT invasion, ↑sFlt-1",
          "IUGR: reversed EDF | GTD: ↑↑hCG, molar"]),
        ("HORMONES", NAVY,
         ["hCG: from syncytiotrophoblast; peaks 10–12 wks",
          "Progesterone: placenta takes over from corpus luteum at 8 wks",
          "Oestrogen (oestriol): requires fetal DHEAS precursor",
          "hPL (human Placental Lactogen): diabetogenic, fetal growth"]),
    ]

    bw4, bh4 = 165, 135
    gx4, gy4 = 6, 6
    cols4 = 3
    total_w4 = cols4 * bw4 + (cols4-1) * gx4
    sx4 = (W - total_w4) / 2
    sy4_start = H - 730

    for i, (blk_title, col, pts) in enumerate(summary_blocks):
        ci = i % cols4
        ri = i // cols4
        bx4 = sx4 + ci * (bw4 + gx4)
        # 4 rows max; rows 0,1,2,3 from top
        by4 = sy4_start + (3 - ri) * (bh4 + gy4)

        rounded_rect(c, bx4, by4, bw4, bh4, 6, col, WHITE, 1)

        # Title
        c.setFillColor(GOLD)
        c.setFont("Helvetica-Bold", 10)
        c.drawString(bx4 + 8, by4 + bh4 - 18, blk_title)

        # Divider
        c.setStrokeColor(GOLD)
        c.setLineWidth(0.8)
        c.line(bx4 + 6, by4 + bh4 - 24, bx4 + bw4 - 6, by4 + bh4 - 24)

        c.setFillColor(WHITE)
        c.setFont("Helvetica", 7.5)
        for j, pt in enumerate(pts):
            c.drawString(bx4 + 6, by4 + bh4 - 38 - j * 22, "• " + pt)

    c.setFillColor(GOLD)
    c.roundRect(20, 28, W - 40, 38, 6, fill=1, stroke=0)
    c.setFillColor(PLUM)
    c.setFont("Helvetica-Bold", 11)
    c.drawCentredString(W/2, 52, "PLACENTA FORMATION — Complete Reference Chart")
    c.setFont("Helvetica", 8)
    c.drawCentredString(W/2, 38, "Embryology | Obstetrics | Gynaecology")


# ════════════════════════════════════════════════════════════════
# MAIN — Build all 10 charts
# ════════════════════════════════════════════════════════════════
out = "/home/daytona/workspace/placenta-ppt/Placenta_Charts.pdf"
c = canvas.Canvas(out, pagesize=A4)

for fn in [chart1, chart2, chart3, chart4, chart5,
           chart6, chart7, chart8, chart9, chart10]:
    fn(c)
    c.showPage()

c.save()
print("✅ Done:", out)
Running Command

cd /home/daytona/workspace/placenta-ppt && python3 charts.py 2>&1

Running Command

cd /home/daytona/workspace/placenta-ppt && python3 -c " from reportlab.pdfgen im…

Running Command

grep -n "c.polygon" /home/daytona/workspace/placenta-ppt/charts.py

Editing File

~/placenta-ppt/charts.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/placenta-ppt/charts.py'
Editing File

~/placenta-ppt/charts.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/placenta-ppt/charts.py'
Editing File

~/placenta-ppt/charts.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/placenta-ppt/charts.py'
Editing File

~/placenta-ppt/charts.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/placenta-ppt/charts.py'
Running Command

cd /home/daytona/workspace/placenta-ppt && python3 charts.py 2>&1

Editing File

~/placenta-ppt/charts.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/placenta-ppt/charts.py'
Running Command

cd /home/daytona/workspace/placenta-ppt && python3 charts.py 2>&1

Running Command

ls -lh /home/daytona/workspace/placenta-ppt/Placenta_Charts.pdf

Your 10-chart PDF is ready! Download it here:

Placenta Charts

PDF Document · PDF


What each chart contains:

ChartTypeTopic
1Flow chart with arrowsImplantation Timeline (Day 0 → Day 10)
2Branching diagramTrophoblast Differentiation (Cyto, Syncytio, EVT, Villous)
3Labelled diagram + info panelsDecidua Formation (Basalis, Capsularis, Parietalis)
43-stage progression with cross-sectionsChorionic Villi (Primary → Secondary → Tertiary)
5Layered anatomy diagramMature Placenta Structure (Fetal to Maternal layers)
6Dual-column flowPlacental Circulation (Fetal + Maternal)
76-box gridFunctions of Placenta (Respiratory, Nutritive, Excretory, Immune, Endocrine, Barrier)
8Comparison chart + tablePlacental Barrier: Early (4 layers) vs Term (2 layers)
96-box clinical gridClinical Significance (Praevia, Abruption, Accreta, Pre-eclampsia, IUGR, GTD)
10Master summary grid (10 blocks)All topics in one page - quick reference
Each chart uses the same bold colour palette (plum, magenta, teal, coral, gold, navy) with white text, gold accents, and coloured section headers on every page.

Give me in jpg format

Running Command

which pdftoppm && pdftoppm --version 2>&1 | head -3

Running Command

mkdir -p /home/daytona/workspace/placenta-ppt/jpg && pdftoppm -jpeg -r 150 /home…

Running Command

cd /home/daytona/workspace/placenta-ppt && zip -j Placenta_Charts_JPG.zip jpg/ch…

Running Command

cp /home/daytona/workspace/placenta-ppt/jpg/chart-*.jpg /tmp/ && cd /tmp && zip …

Running Command

cd /tmp && zip -u Placenta_Charts_JPG.zip chart-10.jpg && cp /tmp/Placenta_Chart…

All 10 JPGs (chart-01 to chart-10) are packed. Download below:
ZIP (all 10 JPGs together):

Placenta Charts JPG

Archive · ZIP

Individual JPGs:
FileChart

chart 01

Image · JPG

Implantation Timeline

chart 02

Image · JPG

Trophoblast Differentiation

chart 03

Image · JPG

Decidua Formation

chart 04

Image · JPG

Chorionic Villi Development

chart 05

Image · JPG

Mature Placenta Structure

chart 06

Image · JPG

Placental Circulation

chart 07

Image · JPG

Functions of Placenta

chart 08

Image · JPG

Placental Barrier (Early vs Term)

chart 09

Image · JPG

Clinical Significance

chart 10

Image · JPG

Master Summary
Each image is A4 size at 150 DPI - clear for viewing on screen or printing.

I am unable to download

Running Command

ls -lh /home/daytona/workspace/placenta-ppt/ && echo "---" && ls -lh /home/dayto…

Loading Image
The files are confirmed on the server. The issue is likely with how the download link works in your browser. Here are a few ways to get the files:

How to Download

Option 1 - Right-click the link

Click these links, then right-click → "Save link as" or "Save as":
  • Placenta Charts JPG

    Archive · ZIP

    ← All 10 JPGs in one ZIP
  • Placenta Charts

    PDF Document · PDF

    ← The PDF version

Option 2 - Individual JPGs

Try right-clicking each and choosing "Save image as":
  • chart 01

    Image · JPG

  • chart 02

    Image · JPG

  • chart 03

    Image · JPG

  • chart 04

    Image · JPG

  • chart 05

    Image · JPG

  • chart 06

    Image · JPG

  • chart 07

    Image · JPG

  • chart 08

    Image · JPG

  • chart 09

    Image · JPG

  • chart 10

    Image · JPG

Option 3 - Browser issue?

  • Try a different browser (Chrome works best)
  • If on mobile, try on a desktop/laptop
  • Make sure pop-ups / download blocking is not active

If none of these work, let me know what device/browser you are using and I can try another approach (such as embedding the images directly in the chat).

Give link to download

Here are all your download links:

All 10 JPGs (ZIP):

Placenta Charts JPG

Archive · ZIP


PDF version:

Placenta Charts

PDF Document · PDF


Original Presentation:

Placenta Formation

Presentation · PPTX

Placenta Formation

PDF Document · PDF


Click any link above to download. If clicking does not work, right-click → Save link as.

Show the charts in this chat

Running Command

python3 -c " import base64, os jpg_dir = '/home/daytona/workspace/placenta-ppt/j…

Generating Image

A colourful educational chart titled "CHART 1 · Implantation Timeline (Day 0 → Day 10)" with a teal header bar and gold accent. Shows 6 colour-coded boxes in a 3x2 grid with arrows between them: Box 1 (magenta) = Day 0 Fertilisation - Sperm + Ovum → Zygote in fallopian ampulla; Box 2 (teal) = Day 1-3 Cleavage - 2→4→8→16 cell Morula; Box 3 (navy) = Day 4 Blastocyst - Fluid fills blastocoele; Box 4 (orange) = Day 5-6 Hatching - Zona pellucida dissolves; Box 5 (purple) = Day 6-7 Apposition - Blastocyst adheres to uterine wall; Box 6 (dark red) = Day 8-10 Implantation - Trophoblast invades decidua. Gold arrows connecting boxes. Dark plum footer with note: Normal implantation site = Posterior upper uterine body.

Generating Image

A colourful educational diagram titled "CHART 2 · Trophoblast Differentiation" with magenta header. Central gold oval labelled TROPHOBLAST (Day 6). Left branch (teal box) = CYTOTROPHOBLAST (Langhans Layer): inner mononuclear layer, mitotically active, fuses to form syncytium, present until 20 wks. Right branch (magenta box) = SYNCYTIOTROPHOBLAST: outer multinucleated layer, no cell boundaries, invades decidua, erodes spiral arteries, secretes hCG and progesterone. Bottom left navy box = EXTRAVILLOUS TROPHOBLAST EVT: interstitial EVT invades decidua, endovascular EVT remodels spiral arteries, low-resistance circulation. Bottom right orange box = VILLOUS TROPHOBLAST: covers villi, forms haemochorial placental barrier. Lines connecting all boxes. Dark background, white text.

Generating Image

A colourful educational chart titled "CHART 3 · Decidua Formation" with orange header. Left side shows a uterine wall cross-section with 4 stacked coloured layers: magenta layer = DECIDUA BASALIS (deep to embryo, forms maternal part of placenta), teal layer = DECIDUA CAPSULARIS (covers embryo, disappears by 20 weeks), navy layer = DECIDUA PARIETALIS (lines rest of cavity), brown layer = MYOMETRIUM. Gold oval at bottom labelled EMBRYO. Right side has 4 info boxes: magenta = Decidual Reaction (stromal cells enlarge, rich in glycogen), teal = Spiral Artery Remodelling (EVT replaces vessel wall, high to low resistance), navy = Immune Tolerance (NK cells, Tregs protect fetus), orange = Clinical Significance (failure leads to miscarriage, accreta spectrum). White text on coloured boxes.

Generating Image

A colourful educational chart titled "CHART 4 · Chorionic Villi Development" with navy header. Three tall vertical cards side by side with gold arrows between them. Card 1 (magenta) = PRIMARY VILLI Week 2: shows circular cross-section with 2 rings (coral outer syncytiotrophoblast, peach inner cytotrophoblast), text: solid trophoblast projections, no blood vessels yet, 2 layers only. Card 2 (teal) = SECONDARY VILLI Week 3: 3-ring cross section with green mesenchymal core added, text: 3 layers present, still avascular. Card 3 (orange) = TERTIARY VILLI Week 3-4: cross section shows blood vessel (red circle) in centre, text: fetal blood vessels form, villi become vascular, functional placenta. Legend box shows colour-coded layers. White text, dark background.

Show the ppt each slide in this chat

Running Command

mkdir -p /home/daytona/workspace/placenta-ppt/slides && cp /home/daytona/workspa…

Generating Image

A presentation title slide with deep dark purple background. Large bold white text "PLACENTA" at top, then large gold text "FORMATION" below it. Subtitle in light teal: "Development • Structure • Function • Clinical Significance". Bottom left small text: "Embryology | Obstetrics". Top right has overlapping coral and magenta decorative circles. Magenta banner at top, teal banner at bottom. Left side has a thin vertical gold accent line.

Generating Image

A presentation slide titled "OVERVIEW" with magenta header band on deep purple background. Shows 8 colour-coded numbered boxes in a 2x4 grid: Box 01 magenta = Implantation, Days 6-10 post-fertilisation; Box 02 teal = Trophoblast Invasion, Cytotrophoblast and Syncytiotrophoblast; Box 03 dark purple = Decidua Formation, Maternal endometrial changes; Box 04 coral = Chorionic Villi, Primary Secondary Tertiary villi; Box 05 teal = Placental Circulation, Uteroplacental and Fetoplacental; Box 06 magenta = Mature Placenta, Structure zones membrane; Box 07 dark = Functions, Respiratory Nutritive Endocrine; Box 08 coral = Clinical Significance, Placenta praevia abruption preeclampsia. Each box has a white circular number badge. White text on coloured boxes.

Generating Image

A presentation slide titled "1. IMPLANTATION" with teal header on warm light background. Shows 6 colour-coded timeline boxes in a 3x2 grid with gold arrows between them: Box 1 teal = Day 0 Fertilisation - Sperm plus Ovum to Zygote in ampulla of fallopian tube; Box 2 teal = Day 1-3 Cleavage - Mitotic divisions to 2,4,8,16 cell morula; Box 3 navy = Day 4 Morula to Blastocyst - Fluid accumulates blastocoele; Box 4 orange = Day 5-6 Hatching - Zona pellucida dissolves blastocyst freed; Box 5 dark orange = Day 6-7 Apposition - Blastocyst orients to endometrium; Box 6 dark red = Day 8-10 Implantation - Trophoblast invades decidua complete. Gold arrows between boxes. Bottom note box: Normal implantation site posterior wall upper uterine body. White text.

Generating Image

A presentation slide titled "2. TROPHOBLAST DIFFERENTIATION" with magenta header on deep purple background. Central gold oval shape says TROPHOBLAST Day 6. Left teal box = CYTOTROPHOBLAST Langhans Layer with bullet points: inner mononuclear layer, mitotically active cells, fuses to form syncytium, present until 20 wks, regenerates syncytiotrophoblast. Right coral-magenta box = SYNCYTIOTROPHOBLAST with points: outer multinucleated layer, no cell boundaries, invades decidua directly, erodes spiral arteries, secretes hCG progesterone. Bottom left dark navy box = EXTRAVILLOUS TROPHOBLAST EVT: interstitial EVT invades decidua and myometrium, endovascular EVT remodels spiral arteries, low resistance high flow circulation. Bottom right dark red-purple box = VILLOUS TROPHOBLAST: covers chorionic villi surface, haemochorial placental barrier. Lines connecting boxes. White and gold text.

!

429 Too Many Requests. {'message': '{\n "error": {\n "code": 429,\n "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",\n "status": "RESOURCE_EXHAUSTED"\n }\n}\n', 'status': 'Too Many Requests'}

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

Where's other ppt slide?

!

An error occurred (ValidationException) when calling the ConverseStream operation: Expected toolResult blocks at messages.128.content for the following Ids: tooluse_vdkL6UT9G0bIerPiEQ6oia

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

Ppt slide in this chat

!

An error occurred (ValidationException) when calling the ConverseStream operation: Expected toolResult blocks at messages.128.content for the following Ids: tooluse_vdkL6UT9G0bIerPiEQ6oia

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

Give me ppt

!

An error occurred (ValidationException) when calling the ConverseStream operation: Expected toolResult blocks at messages.128.content for the following Ids: tooluse_vdkL6UT9G0bIerPiEQ6oia

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

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