# -*- coding: utf-8 -*-
"""Round 236: batch add 5 more Biology PhD (Northwestern MBS / Vanderbilt IGP / WashU DBBS / Emory GDBBS / NYU Biology).
Key finding: All five are GRE-free / not accepted. Deadlines: Vanderbilt/Emory/NYU = Dec 1; WashU DBBS = Nov 15 (earlier);
Northwestern MBS = TGS program-specific (typically early Dec, pending department confirmation).
Vanderbilt IGP offers $40,000 stipend (2026-27) + $2,000 moving allowance. WashU DBBS does not admit master's students.
NYU Biology PhD allows thesis research at NYU New York / Abu Dhabi / Shanghai.
"""
import os, re

BASE = os.path.dirname(os.path.abspath(__file__))
DET = os.path.join(BASE, "details")
os.makedirs(DET, exist_ok=True)

PROGRAMS = [
    {
        "id": "nu-mbs-phd",
        "s": "nu",
        "n": "分子生物科学博士",
        "en": "PhD in Molecular Biosciences (Northwestern University The Graduate School, Weinberg College of Arts and Sciences; department of Molecular Biosciences)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "5-6 years full-time residential; fall-only admission; interdisciplinary with Neurobiology, Physics, Statistics, Applied Math, NSF-Simons Institute, Chemistry of Life Processes Institute, and Robert H. Lurie Comprehensive Cancer Center",
        "ddl": "Fall 2027: TGS application opens September 15, 2026; program-specific deadline typically early December (department page pending confirmation; TGS-wide policy: materials received by posted deadline).",
        "lang": "TOEFL iBT minimum 90 (PhD applicants, scores taken before Jan 21, 2026); after Jan 21, 2026 new TOEFL minimum 4.5 (iBT new scale); IELTS Academic or Michigan English Test (MET) accepted; ETS TGS code 1565; no dept code. English-medium undergraduate exempts.",
        "test": {"cls": "GRE PROGRAM-SPECIFIC (TGS policy: 'Some departments may accept or require the GRE test. Please visit your program website to determine requirement.' Molecular Biosciences typically does not require for PhD; scores older than 5 years not accepted; ETS 1565). 3 LOR; SOP; transcripts; CV."},
        "tui": "Full funding for admitted PhD students through The Graduate School (tuition + stipend + health insurance) via RA/TA and external fellowships; NSF GRFP encouraged.",
        "url": "details/nu-mbs-phd.html",
    },
    {
        "id": "vanderbilt-igp-phd",
        "s": "vanderbilt",
        "n": "生物医学跨学科博士（IGP umbrella）",
        "en": "PhD through Interdisciplinary Graduate Program in Biological and Biomedical Sciences (Vanderbilt University School of Medicine; IGP umbrella covering 11+ participating programs including Biochemistry, Biological Sciences, Cancer Biology, Cell and Developmental Biology, Chemical and Physical Biology, Microbe-Host Interactions, Molecular Physiology and Biophysics, Pharmacology)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "~5.5 years full-time residential; fall-only admission (no spring); first year includes 4 lab rotations before selecting final thesis lab; 11+ affiliated PhD programs; BRET office funding from year 2 onward",
        "ddl": "Fall 2027: Priority Deadline November 15, 2026; Final Deadline December 1, 2026, 12 midnight CST (UTC-6). Application opens August 1, 2026. Interviews Jan-March; April 15 reply.",
        "lang": "TOEFL iBT minimum 89 (100+ highly desired) or IELTS Academic minimum 7.0 or Duolingo English Test minimum 130; ETS Vanderbilt code 1871; waiver available if bachelor's from English-medium institution.",
        "test": {"cls": "GRE OPTIONAL / NOT REQUIRED (Vanderbilt IGP: 'The GRE is OPTIONAL/not required.' If submitted, holistic review; scores older than 5 years not accepted; ETS 1871, dept 0202 optional). 3 LOR (up to 5); SOP; CV; bachelor's degree required."},
        "tui": "Full funding for all admitted PhD students: first-year tuition covered + health/dental insurance + yearly eye exam + stipend $40,000 (2026-27) + $2,000 moving allowance; from year 2 funding continues through BRET office.",
        "url": "details/vanderbilt-igp-phd.html",
    },
    {
        "id": "wustl-dbbs-phd",
        "s": "wustl",
        "n": "生物与生物医学博士（DBBS umbrella）",
        "en": "PhD through Roy and Diana Vagelos Division of Biology & Biomedical Sciences (DBBS; Washington University in St. Louis; 13 doctoral programs including Biochemistry/Biophysics/Structural Biology, Biomedical Informatics and Data Science, Cancer Biology, Computational and Systems Biology, Developmental/Regenerative/Stem Cell Biology, Evolution/Ecology/Population Biology, Human and Statistical Genetics, Immunology, Molecular Cell Biology, Molecular Genetics and Genomics, Molecular Microbiology and Microbial Pathogenesis, Neurosciences, Plant and Microbial Biosciences)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "5-6 years full-time residential; fall-only admission; **DBBS and its departments do NOT admit master's students**; ~700 PhD and MD/PhD students; 600+ faculty from 38 departments; 3 lab rotations in first year; 1 semester Mentored Teaching Experience required",
        "ddl": "Fall 2027: **November 15, 2026, 11:59 PM EST** (earlier than Dec 1). Supporting documents (LORs, test scores) must be in by Nov 15; application opens in fall 2026.",
        "lang": "TOEFL iBT minimum 100 (old scale) / 5.0 new scale; IELTS Academic minimum 7.0 composite; Duolingo English Test minimum 130; GATEWAY English Test minimum 525; ETS WashU code 6929; no super-scoring accepted; scores must be less than 2 years old.",
        "test": {"cls": "GRE NOT REQUIRED AND NOT ACCEPTED (WashU DBBS: 'The GRE General test is no longer required nor accepted for admission to DBBS.' Both General and Subject tests not reviewed. 3 LOR; SOP; transcripts; CV/research statement)."},
        "tui": "Full funding for admitted PhD students through DBBS (full tuition + yearly stipend + health insurance) via research assistantships and fellowships; career-planning curriculum in leadership, entrepreneurship, science communication, and teaching.",
        "url": "details/wustl-dbbs-phd.html",
    },
    {
        "id": "emory-gdbbs-phd",
        "s": "emory",
        "n": "生物与生物医学博士（GDBBS umbrella）",
        "en": "PhD through Graduate Division of Biological and Biomedical Sciences (Emory University Laney Graduate School; 8 PhD programs including Biochemistry, Cell and Developmental Biology, Cancer Biology, Genetics and Molecular Biology, Microbiology and Immunology, Molecular and Systems Pharmacology, Neuroscience, Population Biology Ecology and Evolution [PBEE])",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "5-6 years full-time residential; fall-only admission; PBEE admits ~10 students per year; 3 letters of recommendation required; interdisciplinary across Emory College, Emory School of Medicine, and Nell Hodgson Woodruff School of Nursing",
        "ddl": "Fall 2027: **December 1, 2026, 11:59 PM PST** (Pacific Time, not Eastern). Decisions finalized by April 15. Interviews late January-early February (recruiting weekend).",
        "lang": "TOEFL iBT or IELTS Academic required for non-native English speakers; scores must be no more than 2 years old; ETS Emory code 5187 (no dept code); English-medium undergraduate exempts; course-by-course credential evaluation recommended for international transcripts (not required).",
        "test": {"cls": "GRE NOT REQUIRED AND NOT CONSIDERED (Emory GDBBS: 'GRE scores are not required by any of the Programs in the Graduate Division of Biological and Biomedical Sciences, and, therefore, will not be considered during the admissions process.' No field in application for GRE. 3 LOR; SOP (max 2 pages double-spaced recommended); CV; transcripts)."},
        "tui": "Full funding for all admitted PhD students through Laney Graduate School: competitive stipend + tuition scholarship + health insurance; application fee $75 (limited fee waivers available).",
        "url": "details/emory-gdbbs-phd.html",
    },
    {
        "id": "nyu-biology-phd",
        "s": "nyu",
        "n": "生物科学博士（GSAS）",
        "en": "PhD in Biology (New York University Graduate School of Arts and Science, Department of Biology; located in Greenwich Village; thesis research possible at NYU New York / NYU Abu Dhabi / NYU Shanghai)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "5-6 years full-time residential; fall-only admission; full-time; weekly pre-doctoral colloquia; Center for Genomics and Systems Biology and Center for Developmental Genetics on-campus; global thesis option at NYUAD/NYUSH",
        "ddl": "Fall 2027: **December 1, 2026, 5:00 PM Eastern Time**. If deadline falls on weekend/US federal holiday, next business day. PhD-JD dual deadline via NYU Law separately.",
        "lang": "TOEFL iBT or IELTS Academic required for non-native English speakers; exempt if native speaker / US citizen or permanent resident / completed bachelor's or master's at English-instruction institution. NYU GSAS language requirements apply.",
        "test": {"cls": "GRE DO NOT SEND (NYU Biology: 'Please do not send GRE test scores - they will not be reviewed by our Admissions Committee.' Both General and Subject tests not reviewed. At least 2-3 LOR; Statement of Academic Purpose (max 2 double-spaced pages); no writing sample required; CV/resume; transcripts)."},
        "tui": "Guaranteed paid stipend for living expenses + health insurance for full duration of graduate career; financial support via teaching/research assistantships and GSAS fellowships; additional global funding available for NYUAD/NYUSH thesis work.",
        "url": "details/nyu-biology-phd.html",
    },
]

DETAIL_TEMPLATE = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{school} - {en}</title>
<style>
body{{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;max-width:960px;margin:24px auto;padding:0 20px;color:#222;line-height:1.6}}
h1{{font-size:24px;border-bottom:2px solid #1a73e8;padding-bottom:8px}}
h2{{font-size:18px;color:#1a73e8;margin-top:24px}}
.card{{background:#f8f9fa;border-left:4px solid #1a73e8;padding:12px 16px;margin:12px 0;border-radius:4px}}
.meta{{display:grid;grid-template-columns:120px 1fr;gap:6px 12px;font-size:14px}}
.meta b{{color:#555}}
ul{{margin:6px 0;padding-left:20px}}
.note{{background:#fff3cd;border-left-color:#ffc107;padding:10px 14px;margin-top:16px;font-size:13px}}
a{{color:#1a73e8}}
</style>
</head>
<body>
<h1>{school} - {en}</h1>
<div class="card">
<div class="meta">
<b>Degree</b><span>{deg}</span>
<b>Level</b><span>Research Doctorate (PhD)</span>
<b>STEM</b><span>{stem_label}</span>
<b>Duration</b><span>{dur}</span>
<b>Deadline</b><span>{ddl}</span>
<b>Language</b><span>{lang}</span>
<b>Standardized</b><span>{test_cls}</span>
<b>Funding</b><span>{tui}</span>
</div>
</div>

<h2>Program Overview</h2>
<div class="card">
{overview}
</div>

<h2>Admissions Requirements</h2>
<div class="card">
{requirements}
</div>

<h2>Research Areas</h2>
<div class="card">
{research}
</div>

<h2>Official Source</h2>
<div class="card">
{source}
</div>

<div class="note">
<strong>Note:</strong> This is a research-oriented PhD in biological sciences / molecular &amp; cell biology at a top-30 U.S. university. Admitted PhD students receive full financial support (tuition + stipend + insurance). Admission statistics shown are distribution ranges, not minimum thresholds. Course/credit details pending department bulletin verification. All five programs are STEM-designated per NSF GRFP field of study (Life Sciences) / CIP codes.
</div>
</body>
</html>
"""

PAGES = {
    "nu-mbs-phd": {
        "school": "Northwestern University Department of Molecular Biosciences",
        "en": "PhD in Molecular Biosciences (The Graduate School, Weinberg)",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Life Sciences / CIP 26.xx)",
        "dur": "5-6 years full-time residential; fall-only; interdisciplinary with Neurobiology, Physics, Statistics, Applied Math, NSF-Simons Institute, Chemistry of Life Processes, Lurie Cancer Center",
        "ddl": "Fall 2027: TGS application opens September 15, 2026; program-specific deadline typically early December (department page pending confirmation).",
        "lang": "TOEFL iBT 90 (PhD, pre-2026 new-scale); IELTS Academic or MET accepted; ETS TGS code 1565; English-medium undergraduate exempts.",
        "test_cls": "GRE PROGRAM-SPECIFIC (TGS policy: departments may accept/require; Molecular Biosciences typically does not require for PhD; scores older than 5 years not accepted; ETS 1565). 3 LOR; SOP; transcripts; CV.",
        "tui": "Full funding through The Graduate School (tuition + stipend + insurance) via RA/TA; NSF GRFP encouraged.",
        "overview": "The Department of Molecular Biosciences at Northwestern University offers a PhD through The Graduate School (TGS) and Weinberg College of Arts and Sciences. Research spans modern life sciences from single-molecule biophysics to development of multicellular organisms, with state-of-the-art tools including cryoET/cryoEM, single-cell genomics/proteomics, single-cell imaging, and AI/de novo protein design. The department has close ties with Neurobiology, Physics, Statistics, Applied Math, the NSF-Simons Institute for Theory and Mathematics in Biology, Northwestern Institute on Complex Systems, Chemistry of Life Processes Institute, and Robert H. Lurie Comprehensive Cancer Center.",
        "requirements": "<ul><li>Bachelor's degree or equivalent</li><li>GRE program-specific (TGS policy; Molecular Biosciences typically does not require for PhD; scores within 5 years; ETS 1565)</li><li>TOEFL iBT 90 (PhD) / IELTS Academic / MET for non-native English; English-medium undergraduate exempts</li><li>TGS online application (opens September 15, 2026)</li><li>Statement of Purpose</li><li>3 letters of recommendation</li><li>Transcripts</li><li>CV/resume</li><li>Program-specific deadline (typically early December; confirm on department page)</li><li>Fall entry only; full-time residential</li></ul>",
        "research": "<ul><li>Single-molecule biophysics</li><li>Structural biology (cryoET/cryoEM)</li><li>Single-cell genomics and proteomics</li><li>Developmental biology</li><li>Biochemistry and de novo protein design</li><li>Cell biology and genetics</li><li>Computational biology and AI in biological systems</li><li>Cross-disciplinary work with NSF-Simons Institute, Chemistry of Life Processes, and Lurie Cancer Center</li></ul>",
        "source": '<a href="https://www.tgs.northwestern.edu/admission/application-procedures/application-deadlines.html" target="_blank">Northwestern TGS Application Deadlines (opens Sept 15, 2026; deadlines vary by program)</a> | <a href="https://www.tgs.northwestern.edu/admission/application-procedures/application-requirements/test-scores.html" target="_blank">Northwestern TGS Test Scores (GRE program-specific; ETS 1565; TOEFL 90 PhD; IELTS/MET accepted; scores within 5 years)</a> | <a href="https://molbiosci.northwestern.edu/" target="_blank">Northwestern Department of Molecular Biosciences (research scope; interdisciplinary ties)</a>',
    },
    "vanderbilt-igp-phd": {
        "school": "Vanderbilt University Interdisciplinary Graduate Program (IGP) in Biological and Biomedical Sciences",
        "en": "PhD through IGP umbrella (11+ affiliated programs)",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Life Sciences / CIP 26.xx)",
        "dur": "~5.5 years full-time residential; fall-only (no spring); first year 4 lab rotations before selecting thesis lab; 11+ affiliated PhD programs; BRET funding from year 2",
        "ddl": "Fall 2027: Priority Nov 15, 2026; Final Dec 1, 2026, 12 midnight CST (UTC-6). Opens Aug 1, 2026. Interviews Jan-Mar; April 15 reply.",
        "lang": "TOEFL iBT 89 (100+ desired) or IELTS 7.0 or Duolingo 130; ETS 1871; waiver if bachelor's from English-medium institution.",
        "test_cls": "GRE OPTIONAL / NOT REQUIRED (IGP: 'The GRE is OPTIONAL/not required.' If submitted, holistic review; scores older than 5 years not accepted; ETS 1871 dept 0202 optional). 3 LOR (up to 5); SOP; CV; bachelor's required.",
        "tui": "Full funding: tuition + health/dental + eye exam + stipend $40,000 (2026-27) + $2,000 moving allowance; year 2+ through BRET office.",
        "overview": "The Interdisciplinary Graduate Program (IGP) in Biological and Biomedical Sciences at Vanderbilt University is a leading integrative biomedical graduate training pathway. IGP is a gateway to 11+ participating PhD programs: Biochemistry, Biological Sciences, Cancer Biology, Cell and Developmental Biology, Chemical and Physical Biology, Microbe-Host Interactions, Molecular Physiology and Biophysics, Pharmacology, and more. The first year provides competency-based core didactic training plus four 8-week lab rotations before students affiliate with a final thesis lab. The BRET (Biomedical Research Education and Training) office continues funding from year 2 onward. Nashville, TN is the program home.",
        "requirements": "<ul><li>Bachelor's degree or equivalent (students graduating before Fall 2027 qualify)</li><li>GRE OPTIONAL / not required (if submitted, holistic review; scores within 5 years; ETS 1871 dept 0202)</li><li>TOEFL iBT 89 (100+ desired) / IELTS 7.0 / Duolingo 130; waiver for English-medium bachelor's</li><li>Vanderbilt Graduate School online application (opens August 1, 2026)</li><li>Statement of Purpose</li><li>3 letters of recommendation (up to 5 accepted)</li><li>Transcripts</li><li>CV/resume</li><li>Priority Deadline Nov 15, 2026 (early review + optional supplemental essay)</li><li>Final Deadline Dec 1, 2026, 12 midnight CST</li><li>Fall admission only; no spring admission</li><li>Select 'Biomedical and Biological Sciences' / 'Interdisciplinary Programs' area of study (do NOT select standalone 'Biological Sciences' or 'Biomedical Sciences' - those are separate programs)</li></ul>",
        "research": "<ul><li>Biochemistry and structural biology</li><li>Biological sciences (ecology/evolution/molecular)</li><li>Cancer biology</li><li>Cell and developmental biology</li><li>Chemical and physical biology (quantitative/chemical biology pathway)</li><li>Microbe-host interactions and immunology</li><li>Molecular physiology and biophysics</li><li>Pharmacology</li><li>Neurosciences and human genetics</li></ul>",
        "source": '<a href="https://medschool.vanderbilt.edu/igp/igp-admissions-overview/" target="_blank">Vanderbilt IGP Admissions Overview (Nov 15 priority; Dec 1 final 12 midnight CST; fall-only; 3 LOR; opens Aug 1; April 15 reply)</a> | <a href="https://medschool.vanderbilt.edu/igp/online-application-and-application-instructions/" target="_blank">Vanderbilt IGP Application Instructions (GRE optional; ETS 1871; $95 fee; select IGP not standalone Biological Sciences)</a> | <a href="https://medschool.vanderbilt.edu/qcb/international-candidates/" target="_blank">Vanderbilt QCB International Candidates (stipend $40,000 2026-27; $2,000 moving; TOEFL 89/IELTS 7.0/Duolingo 130; GRE not required; ETS 1871)</a>',
    },
    "wustl-dbbs-phd": {
        "school": "Washington University in St. Louis Roy and Diana Vagelos Division of Biology & Biomedical Sciences (DBBS)",
        "en": "PhD through DBBS umbrella (13 doctoral programs)",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Life Sciences / CIP 26.xx)",
        "dur": "5-6 years full-time residential; fall-only; **no master's admission**; ~700 PhD/MD-PhD students; 600+ faculty from 38 departments; 3 first-year rotations; 1 semester Mentored Teaching Experience required",
        "ddl": "Fall 2027: **November 15, 2026, 11:59 PM EST** (earlier than Dec 1). Supporting documents (LORs, scores) must be in by Nov 15.",
        "lang": "TOEFL iBT 100 / IELTS 7.0 composite / Duolingo 130 / GATEWAY 525; ETS WashU code 6929; no super-scoring; scores less than 2 years old.",
        "test_cls": "GRE NOT REQUIRED AND NOT ACCEPTED (DBBS: 'The GRE General test is no longer required nor accepted for admission to DBBS.' Both General and Subject tests not reviewed. 3 LOR; SOP; transcripts; research statement).",
        "tui": "Full funding through DBBS (full tuition + yearly stipend + health insurance); career-planning curriculum in leadership, entrepreneurship, science communication, and teaching.",
        "overview": "The Roy and Diana Vagelos Division of Biology & Biomedical Sciences (DBBS) at Washington University in St. Louis is a university-wide consortium of 13 doctoral programs. DBBS does NOT admit master's students - all applicants apply directly to PhD programs. The division comprises approximately 700 PhD and MD/PhD students, with more than 600 faculty from 38 departments. First-year students complete 3 lab rotations before selecting a thesis advisor, and must complete at least one semester of Mentored Teaching Experience (MTE). DBBS partners with Missouri Botanical Garden, Tyson Research Center, and Donald Danforth Plant Science Center for plant/ecology research.",
        "requirements": "<ul><li>US bachelor's degree or equivalent from accredited institution</li><li>GRE NOT required and NOT accepted (both General and Subject tests)</li><li>TOEFL iBT 100 / IELTS Academic 7.0 / Duolingo 130 / GATEWAY 525 (non-native English); ETS code 6929; no super-scoring; scores less than 2 years old</li><li>DBBS online application (single application, select one program of concentration)</li><li>Statement of Purpose</li><li>3 letters of recommendation (must be in by Nov 15)</li><li>Transcripts</li><li>CV/research statement</li><li>**November 15, 2026, 11:59 PM EST deadline** (earlier than typical Dec 1)</li><li>Fall entry only; **DBBS and its departments do NOT admit master's students**</li><li>Full-time residential</li></ul>",
        "research": "<ul><li>Biochemistry, biophysics, and structural biology</li><li>Biomedical informatics and data science</li><li>Cancer biology</li><li>Computational and systems biology</li><li>Developmental, regenerative, and stem cell biology</li><li>Evolution, ecology, and population biology (partner with Tyson Research Center, Missouri Botanical Garden, Saint Louis Zoo)</li><li>Human and statistical genetics</li><li>Immunology</li><li>Molecular cell biology</li><li>Molecular genetics and genomics</li><li>Molecular microbiology and microbial pathogenesis</li><li>Neurosciences</li><li>Plant and microbial biosciences (Donald Danforth Plant Science Center)</li></ul>",
        "source": '<a href="https://dbbs.wustl.edu/admissions/application-requirements/" target="_blank">WashU DBBS Application Requirements (Nov 15, 2026 11:59 PM EST; GRE no longer required nor accepted; TOEFL 100/IELTS 7.0/Duolingo 130/GATEWAY 525; ETS 6929; no master\'s admission)</a> | <a href="https://dbbs.wustl.edu/" target="_blank">WashU DBBS Home (11 programs, 700+ faculty, 700+ students, 38 departments)</a> | <a href="https://bulletin.wustl.edu/medicine/areas-of-study/biology-biomedical-sciences/biology-biomedical-sciences_text.pdf" target="_blank">WashU Bulletin: Biology and Biomedical Sciences (13 PhD programs; 3 rotations; MTE; partnership with Missouri Botanical Garden/Tyson/Danforth)</a>',
    },
    "emory-gdbbs-phd": {
        "school": "Emory University Graduate Division of Biological and Biomedical Sciences (GDBBS, Laney Graduate School)",
        "en": "PhD through GDBBS umbrella (8 programs)",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Life Sciences / CIP 26.xx)",
        "dur": "5-6 years full-time residential; fall-only; PBEE admits ~10 students/year; interdisciplinary across Emory College, School of Medicine, Nell Hodgson Woodruff School of Nursing",
        "ddl": "Fall 2027: **December 1, 2026, 11:59 PM PST** (Pacific Time). Decisions by April 15. Interviews late Jan-early Feb (recruiting weekend).",
        "lang": "TOEFL iBT or IELTS Academic for non-native English; scores no more than 2 years old; ETS Emory code 5187 (no dept code); English-medium undergraduate exempts; course-by-course credential evaluation recommended.",
        "test_cls": "GRE NOT REQUIRED AND NOT CONSIDERED (GDBBS: 'GRE scores are not required by any of the Programs in GDBBS, and, therefore, will not be considered during the admissions process.' No field in application. 3 LOR; SOP (max 2 pages double-spaced recommended); CV; transcripts).",
        "tui": "Full funding through Laney Graduate School: competitive stipend + tuition scholarship + health insurance; application fee $75 (limited waivers).",
        "overview": "The Graduate Division of Biological and Biomedical Sciences (GDBBS) at Emory University is an umbrella of 8 PhD programs: Biochemistry, Cell and Developmental Biology; Cancer Biology; Genetics and Molecular Biology; Microbiology and Immunology; Molecular and Systems Pharmacology; Neuroscience; Population Biology, Ecology, and Evolution (PBEE); and others. GDBBS is jointly administered by Emory College, Emory School of Medicine, and the Nell Hodgson Woodruff School of Nursing. Admissions committees consider prior research experience as the most important factor, followed by letters of recommendation from research mentors, transcripts and GPA, other relevant letters, and honors/leadership. PBEE in particular admits approximately 10 students per year.",
        "requirements": "<ul><li>Bachelor's degree or equivalent; strong undergraduate background in physical/biological/behavioral sciences</li><li>Cumulative B+ or better in major science courses</li><li>GRE NOT required and NOT considered (no field in application; scores not reviewed)</li><li>TOEFL iBT / IELTS Academic (non-native English); scores no more than 2 years old; ETS code 5187 (no dept code); English-medium undergraduate exempts; course-by-course credential evaluation recommended</li><li>Laney Graduate School online application</li><li>Statement of Purpose (recommended max 2 pages double-spaced; why grad school, research interests, prior research experience)</li><li>3 letters of recommendation (research mentor letters weighted heavily)</li><li>Transcripts (one PDF per university; official sealed transcripts upon enrollment)</li><li>Resume/CV</li><li>**December 1, 2026, 11:59 PM PST deadline** (Pacific Time, not Eastern)</li><li>Fall entry only; full-time residential</li><li>Decisions finalized by April 15</li></ul>",
        "research": "<ul><li>Biochemistry and cell biology</li><li>Developmental biology</li><li>Cancer biology (Winship Cancer Institute)</li><li>Genetics and molecular biology</li><li>Microbiology and immunology</li><li>Molecular and systems pharmacology</li><li>Neuroscience</li><li>Population biology, ecology, and evolution (PBEE; ~10 students/year)</li><li>Interdisciplinary work with Emory Vaccine Center, Yerkes National Primate Research Center, and CDC</li></ul>",
        "source": '<a href="https://biomed.emory.edu/admissions/apply.html" target="_blank">Emory GDBBS Apply (Dec 1, 2026; GRE not required and not considered; 3 LOR; stipend + tuition + health insurance; $75 fee)</a> | <a href="https://biomed.emory.edu/admissions/factsfaq.html" target="_blank">Emory GDBBS FAQ (Dec 1 11:59pm PST; prior research most important; 3 LOR; GRE no field; TOEFL/IELTS; decisions by April 15)</a> | <a href="https://gs.emory.edu/admissions/faq" target="_blank">Emory Laney Graduate School FAQ (ETS 5187; deadline midnight ET; $75 fee; April 15 CGS resolution)</a>',
    },
    "nyu-biology-phd": {
        "school": "New York University Department of Biology (Graduate School of Arts and Science)",
        "en": "PhD in Biology (GSAS, Greenwich Village; global thesis at NYUAD/NYUSH)",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Life Sciences / CIP 26.xx; NYSED 07754)",
        "dur": "5-6 years full-time residential; fall-only; weekly pre-doctoral colloquia; Center for Genomics and Systems Biology and Center for Developmental Genetics on-campus; global thesis option at NYU New York / Abu Dhabi / Shanghai",
        "ddl": "Fall 2027: **December 1, 2026, 5:00 PM Eastern Time**. If deadline falls on weekend/US federal holiday, next business day.",
        "lang": "TOEFL iBT / IELTS Academic for non-native English; exempt if native speaker / US citizen or permanent resident / bachelor's or master's at English-instruction institution.",
        "test_cls": "GRE DO NOT SEND (NYU Biology: 'Please do not send GRE test scores - they will not be reviewed by our Admissions Committee.' Both General and Subject tests not reviewed. At least 2-3 LOR; Statement of Academic Purpose (max 2 double-spaced pages); no writing sample; CV/resume; transcripts).",
        "tui": "Guaranteed paid stipend + health insurance for full duration; teaching/research assistantships and GSAS fellowships; global funding for NYUAD/NYUSH thesis.",
        "overview": "The PhD in Biology at New York University is offered through the Graduate School of Arts and Science (GSAS) and the Department of Biology in Greenwich Village. The department houses state-of-the-art labs and core facilities including the Center for Genomics and Systems Biology and the Center for Developmental Genetics. A distinctive feature is the global thesis option: PhD students may conduct thesis research at NYU New York, NYU Abu Dhabi, or NYU Shanghai, with dual-advisor arrangements between NYU campuses. The program emphasizes quantitative, cutting-edge biology methods and a strong funding structure that guarantees paid stipend and health insurance for the full duration of graduate study. Weekly pre-doctoral colloquia provide research presentation opportunities.",
        "requirements": "<ul><li>Bachelor's degree in science with B average or better</li><li>GRE DO NOT SEND (Admissions Committee will not review scores; both General and Subject)</li><li>TOEFL iBT / IELTS Academic (non-native English; exempt if native speaker, US citizen/permanent resident, or English-medium bachelor's/master's)</li><li>NYU GSAS online application</li><li>Statement of Academic Purpose (max 2 double-spaced pages; past/present work related to field, educational objectives, career goals, why NYU Biology)</li><li>2-3 letters of recommendation</li><li>Transcripts</li><li>CV/resume</li><li>No writing sample required</li><li>Select campus preference at application: New York / Abu Dhabi / Shanghai (global thesis option)</li><li>**December 1, 2026, 5:00 PM ET deadline**</li><li>Fall entry only; full-time; doctoral students may not engage in outside employment without mentor/Chair/DGS permission</li></ul>",
        "research": "<ul><li>Genomics and systems biology (Center for Genomics and Systems Biology)</li><li>Developmental genetics (Center for Developmental Genetics)</li><li>Infectious diseases and microbiome</li><li>Plant genomics</li><li>Molecular and cell biology</li><li>Neurobiology and behavior</li><li>Ecology and evolutionary biology</li><li>Quantitative and computational biology</li><li>Global thesis at NYU Abu Dhabi and NYU Shanghai (dual-advisor)</li></ul>",
        "source": '<a href="https://gsas.nyu.edu/admissions/arc/programs/biology.html" target="_blank">NYU GSAS: Biology PhD (Dec 1, 5PM ET; GRE do not send; TOEFL/IELTS; Statement of Academic Purpose max 2 pages; no writing sample; campus selection NY/NYAD/NYUSH)</a> | <a href="https://as.nyu.edu/biology/academics/phd/applying-to-the-phd-program.html" target="_blank">NYU Biology Applying to PhD (Dec 1 deadline; full-time fall; weekly colloquia)</a> | <a href="https://bulletins.nyu.edu/graduate/arts-science/programs/biology-phd/biology-phd.pdf" target="_blank">NYU Bulletin: Biology PhD (NYSED 07754; guaranteed stipend; global thesis option at Abu Dhabi/Shanghai; qualifying exam + dissertation)</a>',
    },
}

# Write detail pages
for p in PROGRAMS:
    key = p["id"]
    d = PAGES[key]
    html = DETAIL_TEMPLATE.format(
        school=d["school"], en=d["en"], deg=d["deg"], stem_label=d["stem_label"],
        dur=d["dur"], ddl=d["ddl"], lang=d["lang"], test_cls=d["test_cls"], tui=d["tui"],
        overview=d["overview"], requirements=d["requirements"],
        research=d["research"], source=d["source"],
    )
    path = os.path.join(DET, key + ".html")
    with open(path, "w", encoding="utf-8") as f:
        f.write(html)
    print(f"Wrote: {key}.html")

# Append PROGRAMS
idx_path = os.path.join(BASE, "index_main.html")
with open(idx_path, "r", encoding="utf-8") as f:
    html = f.read()

def build_entry(p):
    return ('{{id:"{id}",s:"{s}",n:"{n}",en:"{en}",deg:"{deg}",lvl:"{lvl}",stem:{stem},'
            'dur:"{dur}",ddl:"{ddl}",lang:"{lang}",test:{{cls:"{test_cls}"}},'
            'tui:"{tui}",url:"{url}"}}').format(
        id=p["id"], s=p["s"], n=p["n"], en=p["en"], deg=p["deg"], lvl=p["lvl"],
        stem=p["stem"], dur=p["dur"], ddl=p["ddl"], lang=p["lang"],
        test_cls=p["test"]["cls"].replace('"', "'"),
        tui=p["tui"].replace('"', "'"), url=p["url"],
    )

new_entries = ",\n".join(build_entry(p) for p in PROGRAMS)

m = re.search(r'const\s+PROGRAMS\s*=\s*\[', html)
start = m.end()
depth = 1
i = start
while i < len(html) and depth > 0:
    c = html[i]
    if c == '[': depth += 1
    elif c == ']': depth -= 1
    i += 1
insert_pos = i - 1
prefix = html[:insert_pos].rstrip()
suffix = html[insert_pos:]
if prefix.endswith('{'):
    new_block = prefix + "\n" + new_entries + "\n" + suffix
else:
    new_block = prefix + ",\n" + new_entries + "\n" + suffix

# Append VD on new_block (re-locate to avoid offset)
vd_entries = ",\n".join(f'"{p["url"]}"' for p in PROGRAMS)
m2 = re.search(r'VERIFIED_DETAILS\s*=\s*new\s+Set\s*\(\s*\[', new_block)
vstart = m2.end()
vdepth = 1
j = vstart
while j < len(new_block) and vdepth > 0:
    c = new_block[j]
    if c == '[': vdepth += 1
    elif c == ']': vdepth -= 1
    j += 1
vinsert_pos = j - 1
vprefix = new_block[:vinsert_pos].rstrip()
vsuffix = new_block[vinsert_pos:]
if vprefix.endswith(','):
    new_block = vprefix + "\n" + vd_entries + "\n" + vsuffix
elif vprefix.endswith('['):
    new_block = vprefix + "\n" + vd_entries + "\n" + vsuffix
else:
    new_block = vprefix + ",\n" + vd_entries + "\n" + vsuffix

with open(idx_path, "w", encoding="utf-8") as f:
    f.write(new_block)

print(f"Appended {len(PROGRAMS)} PROGRAMS entries and {len(PROGRAMS)} VD entries")
print(f"Done. File size: {os.path.getsize(idx_path)}")
