// NEXUS PLATFORM — Master Data Layer
// Exposed as window.NEXUS_DATA
// Scale: 60+ entities, 90+ links, 10 threads, patterns, hypotheses

const NEXUS_DATA = {
  kpis: {
    totalEntities: 18_420,       // pulled from the 18.4M corpus + indexed entities
    linkedDocuments: 142_000,
    entitiesIndexed: 4_820,       // canonical entity records
    linksActive: 8_640,
    threadsSaved: 34,
    patternsDetected: 12,
    hypothesesTracked: 7,
    lastSyncMins: 3,
  },

  // ── ENTITIES ── (showing a curated subset for UI; pretends full index is 4,820)
  // Each entity: id, type, name, summary, matter, linkCount, aliases, dateRange
  entities: [
    // PEOPLE
    { id: 'E-P-001', type: 'person', name: 'Helen Bishop', summary: 'Former CEO, Redstone Capital (2019-2023)', matter: 'Redstone v. Meridian', linkCount: 48, aliases: ['H. Bishop', 'Bishop'], dateRange: '2019—2023', priority: 'key' },
    { id: 'E-P-002', type: 'person', name: 'Karen Osei', summary: 'Former CFO, Redstone Capital — now Singapore', matter: 'Redstone v. Meridian', linkCount: 34, aliases: ['K. Osei', 'Osei'], dateRange: '2020—2023', priority: 'key' },
    { id: 'E-P-003', type: 'person', name: 'Marcus Pryor', summary: 'General Counsel, Redstone Capital', matter: 'Redstone v. Meridian', linkCount: 41, aliases: ['M. Pryor', 'GC'], dateRange: '2018—present', priority: 'key' },
    { id: 'E-P-004', type: 'person', name: 'James Harrington', summary: 'CEO Meridian Holdings; sole director Apex Ventures', matter: 'Redstone v. Meridian', linkCount: 62, aliases: ['J. Harrington', 'Harrington'], dateRange: '2018—present', priority: 'key' },
    { id: 'E-P-005', type: 'person', name: 'Julia Matsumoto', summary: 'Head of M&A, Redstone Capital', matter: 'Redstone v. Meridian', linkCount: 18, aliases: ['J. Matsumoto'], dateRange: '2019—present', priority: 'high' },
    { id: 'E-P-006', type: 'person', name: 'Felix Wong', summary: 'Dir. of Operations, Pacific Shipping', matter: 'Pacific Shipping Antitrust', linkCount: 28, aliases: ['F. Wong'], dateRange: '2020—present', priority: 'high' },
    { id: 'E-P-007', type: 'person', name: 'Priya Raman', summary: 'VP Pricing, Pacific Shipping', matter: 'Pacific Shipping Antitrust', linkCount: 22, aliases: ['P. Raman'], dateRange: '2020—present', priority: 'key' },
    { id: 'E-P-008', type: 'person', name: 'Thomas Blackwell', summary: 'Chief Engineer, named inventor (Blackwell IP)', matter: 'Blackwell IP', linkCount: 19, aliases: ['T. Blackwell'], dateRange: '2018—present', priority: 'key' },
    { id: 'E-P-009', type: 'person', name: 'Arnav Iyer', summary: 'Regional Head APAC, Sterling Pharma', matter: 'Sterling Pharma FCPA', linkCount: 36, aliases: ['A. Iyer'], dateRange: '2019—present', priority: 'key' },
    { id: 'E-P-010', type: 'person', name: 'Dr. Elaine Mitchell', summary: 'Damages expert witness (our)', matter: 'Redstone v. Meridian', linkCount: 14, aliases: ['Dr. Mitchell'], dateRange: '2025—present', priority: 'medium' },
    { id: 'E-P-011', type: 'person', name: 'Dr. Alan Harlan', summary: 'Defense damages expert', matter: 'Redstone v. Meridian', linkCount: 12, aliases: ['Dr. Harlan', 'Harlan'], dateRange: '2025—present', priority: 'medium' },
    { id: 'E-P-012', type: 'person', name: 'Elena Vasquez', summary: 'VP Compliance (Environmental), Greenfield Corp.', matter: 'Greenfield Environmental', linkCount: 24, aliases: ['E. Vasquez'], dateRange: '2019—present', priority: 'high' },

    // ORGANIZATIONS
    { id: 'E-O-001', type: 'org', name: 'Redstone Capital LLC', summary: 'Plaintiff — private-equity fund manager', matter: 'Redstone v. Meridian', linkCount: 88, aliases: ['Redstone', 'Plaintiff'], dateRange: '2005—present', priority: 'key' },
    { id: 'E-O-002', type: 'org', name: 'Meridian Holdings', summary: 'Defendant — target of LBO transaction', matter: 'Redstone v. Meridian', linkCount: 72, aliases: ['Meridian', 'Defendant'], dateRange: '2012—present', priority: 'key' },
    { id: 'E-O-003', type: 'org', name: 'Apex Ventures LLC', summary: 'Shell entity — sole director Harrington', matter: 'Redstone v. Meridian', linkCount: 34, aliases: ['Apex', 'Apex Ventures'], dateRange: '2022—present', priority: 'key' },
    { id: 'E-O-004', type: 'org', name: 'Pacific Shipping Co.', summary: 'Plaintiff — shipping carrier', matter: 'Pacific Shipping Antitrust', linkCount: 94, aliases: ['Pacific Shipping', 'PSC'], dateRange: '2008—present', priority: 'key' },
    { id: 'E-O-005', type: 'org', name: 'Sterling Pharmaceuticals', summary: 'Client — global pharma under DOJ/SEC investigation', matter: 'Sterling Pharma FCPA', linkCount: 68, aliases: ['Sterling', 'Sterling Pharma'], dateRange: '1998—present', priority: 'key' },
    { id: 'E-O-006', type: 'org', name: 'Blackwell Industries', summary: 'Plaintiff — patent holder', matter: 'Blackwell IP', linkCount: 42, aliases: ['Blackwell'], dateRange: '2015—present', priority: 'high' },
    { id: 'E-O-007', type: 'org', name: 'Verge Electronics', summary: 'Defendant in Blackwell IP', matter: 'Blackwell IP', linkCount: 28, aliases: ['Verge'], dateRange: '2020—present', priority: 'high' },
    { id: 'E-O-008', type: 'org', name: 'Atlas Financial Group', summary: 'Defendant — brokerage / advisory', matter: 'Chen v. Atlas Financial', linkCount: 34, aliases: ['Atlas'], dateRange: '2010—present', priority: 'key' },
    { id: 'E-O-009', type: 'org', name: 'Greenfield Corp.', summary: 'Defendant — environmental class action', matter: 'Greenfield Environmental', linkCount: 46, aliases: ['Greenfield'], dateRange: '2001—present', priority: 'key' },

    // DOCUMENTS
    { id: 'E-D-001', type: 'document', name: 'LBO Term Sheet — Jun 2022', summary: 'Original signed term sheet; $420M valuation', matter: 'Redstone v. Meridian', linkCount: 42, aliases: ['Term Sheet'], dateRange: '2022-06-14', priority: 'key' },
    { id: 'E-D-002', type: 'document', name: 'Board Meeting Minutes — Oct 2023', summary: 'Executive session re Apex transaction approval', matter: 'Redstone v. Meridian', linkCount: 38, aliases: ['Oct 2023 minutes'], dateRange: '2023-10-18', priority: 'key' },
    { id: 'E-D-003', type: 'document', name: 'Q3 2022 Financial Records', summary: 'GAP — records missing / spoliation claim', matter: 'Redstone v. Meridian', linkCount: 28, aliases: ['Q3 records'], dateRange: '2022-07—09', priority: 'key' },
    { id: 'E-D-004', type: 'document', name: 'Apex Wire Transfer Ledger', summary: '$14.2M cumulative transfers 2022—2023', matter: 'Redstone v. Meridian', linkCount: 34, aliases: ['Wire ledger'], dateRange: '2022—2023', priority: 'key' },
    { id: 'E-D-005', type: 'document', name: 'Bishop-Harrington email chain (Sep 2022)', summary: 'Privileged? 12-thread discussion re Apex formation', matter: 'Redstone v. Meridian', linkCount: 24, aliases: ['BH emails'], dateRange: '2022-09', priority: 'high' },
    { id: 'E-D-006', type: 'document', name: 'Patent \'842 Specification', summary: 'Distributed processing architecture', matter: 'Blackwell IP', linkCount: 28, aliases: ['\'842 patent'], dateRange: '2017-03-22', priority: 'key' },
    { id: 'E-D-007', type: 'document', name: 'Verge engineering notebook — 2019', summary: 'Discovered via subpoena; contains prior-art discussion', matter: 'Blackwell IP', linkCount: 14, aliases: ['Verge notebook'], dateRange: '2019', priority: 'high' },
    { id: 'E-D-008', type: 'document', name: 'Pricing Meeting Minutes — May 2021', summary: 'Alleged coordination meeting; 4 carriers present', matter: 'Pacific Shipping Antitrust', linkCount: 32, aliases: ['May 2021 meeting'], dateRange: '2021-05-14', priority: 'key' },
    { id: 'E-D-009', type: 'document', name: 'APAC Consultant Agreements (7)', summary: 'Seven consultant contracts — FCPA scrutiny', matter: 'Sterling Pharma FCPA', linkCount: 26, aliases: ['APAC consultants'], dateRange: '2019—2022', priority: 'key' },
    { id: 'E-D-010', type: 'document', name: 'Emissions Testing Reports 2012—2014', summary: 'Pre-class-period records; internal memos flag anomalies', matter: 'Greenfield Environmental', linkCount: 22, aliases: ['Emissions 2012-14'], dateRange: '2012—2014', priority: 'high' },

    // EVENTS
    { id: 'E-E-001', type: 'event', name: 'Jun 2022 LBO Closing', summary: 'Transaction closed; $420M; Harrington signed both sides', matter: 'Redstone v. Meridian', linkCount: 22, aliases: ['LBO closing'], dateRange: '2022-06-14', priority: 'key' },
    { id: 'E-E-002', type: 'event', name: 'Oct 2023 Board Meeting', summary: 'Executive session re Apex; minutes contested', matter: 'Redstone v. Meridian', linkCount: 18, aliases: ['Oct board'], dateRange: '2023-10-18', priority: 'key' },
    { id: 'E-E-003', type: 'event', name: 'Dec 2023 Apex Formation', summary: 'Apex Ventures LLC incorporated in Delaware', matter: 'Redstone v. Meridian', linkCount: 14, aliases: ['Apex formation'], dateRange: '2023-12-08', priority: 'high' },
    { id: 'E-E-004', type: 'event', name: 'CFO Osei Departure', summary: 'Resigned abruptly, relocated to Singapore', matter: 'Redstone v. Meridian', linkCount: 10, aliases: ['Osei departure'], dateRange: '2024-02-04', priority: 'high' },
    { id: 'E-E-005', type: 'event', name: 'May 2021 Pricing Summit', summary: 'Four-carrier pricing coordination meeting', matter: 'Pacific Shipping Antitrust', linkCount: 16, aliases: ['Pricing summit'], dateRange: '2021-05-14', priority: 'key' },
    { id: 'E-E-006', type: 'event', name: 'Patent \'842 Issuance', summary: 'USPTO grant date', matter: 'Blackwell IP', linkCount: 8, aliases: ['\'842 issued'], dateRange: '2017-03-22', priority: 'medium' },
    { id: 'E-E-007', type: 'event', name: 'Verge Product Launch', summary: 'Accused product shipped', matter: 'Blackwell IP', linkCount: 12, aliases: ['Verge launch'], dateRange: '2020-09-10', priority: 'high' },
    { id: 'E-E-008', type: 'event', name: 'SEC Wells Notice — Sterling', summary: 'Wells notice issued to Sterling', matter: 'Sterling Pharma FCPA', linkCount: 20, aliases: ['Wells notice'], dateRange: '2026-02-15', priority: 'key' },

    // ISSUES (legal claims / theories)
    { id: 'E-I-001', type: 'issue', name: 'Count I — Breach of Fiduciary Duty', summary: 'Harrington breach; self-dealing through Apex', matter: 'Redstone v. Meridian', linkCount: 34, aliases: ['Count I'], dateRange: null, priority: 'key' },
    { id: 'E-I-002', type: 'issue', name: 'Count II — Fraud', summary: 'Material misstatements re Meridian valuation', matter: 'Redstone v. Meridian', linkCount: 28, aliases: ['Count II'], dateRange: null, priority: 'key' },
    { id: 'E-I-003', type: 'issue', name: 'Count III — Unjust Enrichment', summary: 'Harrington / Apex ill-gotten gains', matter: 'Redstone v. Meridian', linkCount: 22, aliases: ['Count III'], dateRange: null, priority: 'key' },
    { id: 'E-I-004', type: 'issue', name: 'Count IV — Civil Conspiracy', summary: 'SOL defense raised; tolling argued', matter: 'Redstone v. Meridian', linkCount: 16, aliases: ['Count IV'], dateRange: null, priority: 'high' },
    { id: 'E-I-005', type: 'issue', name: 'Sherman Act §1 Violation', summary: 'Horizontal price-fixing conspiracy', matter: 'Pacific Shipping Antitrust', linkCount: 40, aliases: ['Sherman §1'], dateRange: null, priority: 'key' },
    { id: 'E-I-006', type: 'issue', name: '§112(f) Means-Plus-Function Infringement', summary: 'Claim 7 construction dispute', matter: 'Blackwell IP', linkCount: 18, aliases: ['112(f)'], dateRange: null, priority: 'key' },
    { id: 'E-I-007', type: 'issue', name: 'FCPA §78dd-1 Liability', summary: 'Corrupt payments to foreign officials', matter: 'Sterling Pharma FCPA', linkCount: 32, aliases: ['FCPA'], dateRange: null, priority: 'key' },

    // ARTIFACTS (physical evidence, exhibits, amounts)
    { id: 'E-A-001', type: 'artifact', name: '$14.2M wire total', summary: 'Cumulative wire transfers through Apex', matter: 'Redstone v. Meridian', linkCount: 18, aliases: ['$14.2M'], dateRange: '2022—2023', priority: 'key' },
    { id: 'E-A-002', type: 'artifact', name: 'TRX-0412 / TRX-0718 (wires)', summary: 'Two largest single transfers — $4.1M each', matter: 'Redstone v. Meridian', linkCount: 12, aliases: ['TRX-0412'], dateRange: '2022-08-15 / 2023-01-22', priority: 'high' },
    { id: 'E-A-003', type: 'artifact', name: 'Source Code Repository (Verge)', summary: 'Git log entries showing 2019 timeline', matter: 'Blackwell IP', linkCount: 14, aliases: ['Verge repo'], dateRange: '2018—2024', priority: 'high' },
    { id: 'E-A-004', type: 'artifact', name: 'Mobile phone imaging — Harrington', summary: 'iPhone text threads w/ Osei + Pryor', matter: 'Redstone v. Meridian', linkCount: 16, aliases: ['Harrington phone'], dateRange: '2020—2024', priority: 'key' },
    { id: 'E-A-005', type: 'artifact', name: 'Singapore bank statements', summary: 'Osei personal accts w/ inbound transfers', matter: 'Redstone v. Meridian', linkCount: 10, aliases: ['SG statements'], dateRange: '2023—2024', priority: 'key' },
  ],

  // ── LINKS ── (directed edges)
  // Each link: id, from, to, type, weight (1-3), matter, note, createdBy, createdDate
  links: [
    // Redstone core links (hub-and-spoke around Harrington)
    { id: 'L-001', from: 'E-P-004', to: 'E-O-002', type: 'owns', weight: 3, matter: 'Redstone v. Meridian', note: 'CEO of Meridian (target company)', createdBy: 'M. Kirkland', createdDate: '2025-08-14' },
    { id: 'L-002', from: 'E-P-004', to: 'E-O-003', type: 'owns', weight: 3, matter: 'Redstone v. Meridian', note: 'Sole director of Apex (shell entity)', createdBy: 'M. Kirkland', createdDate: '2025-08-14' },
    { id: 'L-003', from: 'E-O-003', to: 'E-A-001', type: 'owns', weight: 3, matter: 'Redstone v. Meridian', note: 'Apex is vehicle for $14.2M total', createdBy: 'L. Torres', createdDate: '2025-09-02' },
    { id: 'L-004', from: 'E-P-004', to: 'E-E-001', type: 'authored', weight: 3, matter: 'Redstone v. Meridian', note: 'Signed LBO on both sides', createdBy: 'L. Torres', createdDate: '2025-09-05' },
    { id: 'L-005', from: 'E-E-001', to: 'E-E-003', type: 'occurred-before', weight: 2, matter: 'Redstone v. Meridian', note: 'LBO closed Jun 2022, Apex formed Dec 2023 (18-mo gap)', createdBy: 'L. Torres', createdDate: '2025-09-05' },
    { id: 'L-006', from: 'E-D-001', to: 'E-E-001', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'Term sheet memorializes LBO closing', createdBy: 'L. Torres', createdDate: '2025-09-10' },
    { id: 'L-007', from: 'E-D-002', to: 'E-E-002', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'Minutes of Oct 2023 board meeting', createdBy: 'L. Torres', createdDate: '2025-09-10' },
    { id: 'L-008', from: 'E-D-005', to: 'E-P-001', type: 'authored', weight: 2, matter: 'Redstone v. Meridian', note: 'Bishop wrote 8 of 12 emails', createdBy: 'J. Park', createdDate: '2025-10-01' },
    { id: 'L-009', from: 'E-D-005', to: 'E-P-004', type: 'sent-to', weight: 3, matter: 'Redstone v. Meridian', note: 'Bishop-Harrington email chain', createdBy: 'J. Park', createdDate: '2025-10-01' },
    { id: 'L-010', from: 'E-D-004', to: 'E-A-001', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'Wire ledger totals to $14.2M', createdBy: 'L. Torres', createdDate: '2025-11-12' },
    { id: 'L-011', from: 'E-D-004', to: 'E-O-003', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'Ledger flows through Apex', createdBy: 'L. Torres', createdDate: '2025-11-12' },
    { id: 'L-012', from: 'E-P-004', to: 'E-I-001', type: 'supports', weight: 3, matter: 'Redstone v. Meridian', note: 'Harrington conduct → fiduciary breach claim', createdBy: 'M. Kirkland', createdDate: '2025-12-04' },
    { id: 'L-013', from: 'E-P-004', to: 'E-I-002', type: 'supports', weight: 3, matter: 'Redstone v. Meridian', note: 'Valuation misstatements → fraud claim', createdBy: 'M. Kirkland', createdDate: '2025-12-04' },
    { id: 'L-014', from: 'E-O-003', to: 'E-I-003', type: 'supports', weight: 3, matter: 'Redstone v. Meridian', note: 'Apex gains → unjust enrichment', createdBy: 'M. Kirkland', createdDate: '2025-12-04' },
    { id: 'L-015', from: 'E-P-002', to: 'E-E-004', type: 'authored', weight: 2, matter: 'Redstone v. Meridian', note: 'Osei resigned, relocated', createdBy: 'J. Park', createdDate: '2026-01-08' },
    { id: 'L-016', from: 'E-D-003', to: 'E-E-001', type: 'corroborates', weight: 2, matter: 'Redstone v. Meridian', note: 'Would corroborate if records existed — spoliation claim', createdBy: 'L. Torres', createdDate: '2026-01-22' },
    { id: 'L-017', from: 'E-D-003', to: 'E-P-002', type: 'contradicts', weight: 2, matter: 'Redstone v. Meridian', note: 'Osei claim she produced full records contradicted by gap', createdBy: 'L. Torres', createdDate: '2026-01-22' },
    { id: 'L-018', from: 'E-A-004', to: 'E-P-004', type: 'authored', weight: 3, matter: 'Redstone v. Meridian', note: 'iPhone imaging shows texts from Harrington', createdBy: 'J. Park', createdDate: '2026-02-14' },
    { id: 'L-019', from: 'E-A-004', to: 'E-P-002', type: 'sent-to', weight: 3, matter: 'Redstone v. Meridian', note: 'Texts to Osei mostly 2023 Q3', createdBy: 'J. Park', createdDate: '2026-02-14' },
    { id: 'L-020', from: 'E-A-004', to: 'E-P-003', type: 'sent-to', weight: 2, matter: 'Redstone v. Meridian', note: 'Texts to GC Pryor less frequent', createdBy: 'J. Park', createdDate: '2026-02-14' },
    { id: 'L-021', from: 'E-A-005', to: 'E-A-002', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'SG bank statements show inbound matching TRX-0412/0718', createdBy: 'L. Torres', createdDate: '2026-02-28' },
    { id: 'L-022', from: 'E-A-005', to: 'E-P-002', type: 'identified-as', weight: 3, matter: 'Redstone v. Meridian', note: 'Osei personal account', createdBy: 'L. Torres', createdDate: '2026-02-28' },
    { id: 'L-023', from: 'E-P-001', to: 'E-P-004', type: 'corroborates', weight: 2, matter: 'Redstone v. Meridian', note: 'Bishop testimony about Harrington conduct', createdBy: 'M. Kirkland', createdDate: '2026-03-10' },
    { id: 'L-024', from: 'E-P-003', to: 'E-D-005', type: 'references', weight: 2, matter: 'Redstone v. Meridian', note: 'Pryor privilege discussion', createdBy: 'L. Torres', createdDate: '2026-03-12' },
    { id: 'L-025', from: 'E-E-003', to: 'E-A-001', type: 'caused', weight: 3, matter: 'Redstone v. Meridian', note: 'Apex formation preceded transfers', createdBy: 'M. Kirkland', createdDate: '2026-03-14' },

    // Pacific Shipping antitrust
    { id: 'L-030', from: 'E-P-007', to: 'E-E-005', type: 'authored', weight: 3, matter: 'Pacific Shipping Antitrust', note: 'Raman present at pricing summit', createdBy: 'S. Chen', createdDate: '2026-02-20' },
    { id: 'L-031', from: 'E-D-008', to: 'E-E-005', type: 'references', weight: 3, matter: 'Pacific Shipping Antitrust', note: 'Minutes document the meeting', createdBy: 'S. Chen', createdDate: '2026-02-20' },
    { id: 'L-032', from: 'E-P-007', to: 'E-O-004', type: 'owns', weight: 2, matter: 'Pacific Shipping Antitrust', note: 'Raman was VP at Pacific Shipping', createdBy: 'S. Chen', createdDate: '2026-02-20' },
    { id: 'L-033', from: 'E-P-006', to: 'E-O-004', type: 'owns', weight: 2, matter: 'Pacific Shipping Antitrust', note: 'Wong at Pacific Shipping', createdBy: 'S. Chen', createdDate: '2026-02-20' },
    { id: 'L-034', from: 'E-E-005', to: 'E-I-005', type: 'supports', weight: 3, matter: 'Pacific Shipping Antitrust', note: 'Pricing summit → Sherman §1 claim', createdBy: 'M. Kirkland', createdDate: '2026-02-22' },
    { id: 'L-035', from: 'E-D-008', to: 'E-I-005', type: 'supports', weight: 3, matter: 'Pacific Shipping Antitrust', note: 'Meeting minutes evidence conspiracy', createdBy: 'M. Kirkland', createdDate: '2026-02-22' },

    // Blackwell IP
    { id: 'L-040', from: 'E-D-006', to: 'E-E-006', type: 'references', weight: 3, matter: 'Blackwell IP', note: '\'842 patent specification from issuance date', createdBy: 'A. Petrov', createdDate: '2025-11-04' },
    { id: 'L-041', from: 'E-P-008', to: 'E-D-006', type: 'authored', weight: 3, matter: 'Blackwell IP', note: 'Blackwell named inventor', createdBy: 'A. Petrov', createdDate: '2025-11-04' },
    { id: 'L-042', from: 'E-D-007', to: 'E-O-007', type: 'owns', weight: 2, matter: 'Blackwell IP', note: 'Verge engineering notebook', createdBy: 'A. Petrov', createdDate: '2026-01-18' },
    { id: 'L-043', from: 'E-D-007', to: 'E-D-006', type: 'contradicts', weight: 2, matter: 'Blackwell IP', note: 'Verge notebook suggests prior art — contradicts \'842 novelty', createdBy: 'A. Petrov', createdDate: '2026-01-20' },
    { id: 'L-044', from: 'E-A-003', to: 'E-O-007', type: 'owns', weight: 3, matter: 'Blackwell IP', note: 'Verge source code repo', createdBy: 'A. Petrov', createdDate: '2026-03-10' },
    { id: 'L-045', from: 'E-E-007', to: 'E-D-006', type: 'references', weight: 3, matter: 'Blackwell IP', note: 'Verge product allegedly infringes \'842', createdBy: 'A. Petrov', createdDate: '2026-03-10' },
    { id: 'L-046', from: 'E-D-006', to: 'E-I-006', type: 'supports', weight: 3, matter: 'Blackwell IP', note: 'Patent specification → §112(f) construction', createdBy: 'M. Kirkland', createdDate: '2026-03-12' },

    // Sterling Pharma FCPA
    { id: 'L-050', from: 'E-P-009', to: 'E-O-005', type: 'owns', weight: 2, matter: 'Sterling Pharma FCPA', note: 'Iyer regional lead', createdBy: 'M. Kirkland', createdDate: '2025-12-14' },
    { id: 'L-051', from: 'E-P-009', to: 'E-D-009', type: 'authored', weight: 3, matter: 'Sterling Pharma FCPA', note: 'Iyer signed 5 of 7 consultant agreements', createdBy: 'M. Kirkland', createdDate: '2025-12-14' },
    { id: 'L-052', from: 'E-D-009', to: 'E-I-007', type: 'supports', weight: 3, matter: 'Sterling Pharma FCPA', note: 'Consultant agreements → FCPA claim', createdBy: 'M. Kirkland', createdDate: '2025-12-18' },
    { id: 'L-053', from: 'E-E-008', to: 'E-O-005', type: 'sent-to', weight: 3, matter: 'Sterling Pharma FCPA', note: 'SEC Wells notice to Sterling', createdBy: 'M. Kirkland', createdDate: '2026-02-16' },

    // Greenfield Environmental
    { id: 'L-060', from: 'E-P-012', to: 'E-O-009', type: 'owns', weight: 2, matter: 'Greenfield Environmental', note: 'Vasquez at Greenfield', createdBy: 'J. Park', createdDate: '2025-10-22' },
    { id: 'L-061', from: 'E-D-010', to: 'E-O-009', type: 'owns', weight: 3, matter: 'Greenfield Environmental', note: 'Emissions reports are Greenfield records', createdBy: 'J. Park', createdDate: '2025-10-22' },

    // Cross-matter linkages (interesting patterns)
    { id: 'L-070', from: 'E-P-010', to: 'E-P-011', type: 'contradicts', weight: 3, matter: 'Redstone v. Meridian', note: 'Mitchell (ours) vs Harlan (def) — competing expert opinions', createdBy: 'R. Vasquez', createdDate: '2026-03-22' },
    { id: 'L-071', from: 'E-P-010', to: 'E-D-004', type: 'references', weight: 3, matter: 'Redstone v. Meridian', note: 'Mitchell report relies on wire ledger', createdBy: 'R. Vasquez', createdDate: '2026-03-22' },
    { id: 'L-072', from: 'E-P-011', to: 'E-D-004', type: 'contradicts', weight: 2, matter: 'Redstone v. Meridian', note: 'Harlan challenges wire ledger methodology', createdBy: 'R. Vasquez', createdDate: '2026-03-24' },
  ],

  // ── THREADS (saved narrative bundles) ──
  threads: [
    { id: 'TH-01', name: 'Harrington Hub — Fraud Narrative', matter: 'Redstone v. Meridian', owner: 'M. Kirkland', entityIds: ['E-P-004','E-O-002','E-O-003','E-A-001','E-A-002','E-E-001','E-E-003','E-D-002','E-D-004','E-A-005'], linkIds: ['L-001','L-002','L-003','L-004','L-005','L-010','L-011','L-021','L-022','L-025'], note: 'Single-actor fraud theory — Harrington at center of LBO, Apex formation, and $14.2M diversion.', savedFor: 'Trial opening · MSJ Opp.', lastEdited: '2h ago', docCount: 214 },
    { id: 'TH-02', name: 'Osei Spoliation Chain', matter: 'Redstone v. Meridian', owner: 'L. Torres', entityIds: ['E-P-002','E-D-003','E-E-004','E-A-005'], linkIds: ['L-015','L-016','L-017','L-022'], note: 'Q3 2022 record gap coincident with Osei departure; Singapore bank statements tie Osei to Apex transfers.', savedFor: 'Rule 37(e) motion', lastEdited: '5h ago', docCount: 68 },
    { id: 'TH-03', name: 'Price-Fixing Meeting Thread', matter: 'Pacific Shipping Antitrust', owner: 'S. Chen', entityIds: ['E-E-005','E-P-007','E-P-006','E-D-008','E-O-004','E-I-005'], linkIds: ['L-030','L-031','L-032','L-033','L-034','L-035'], note: 'May 2021 Pricing Summit as core fact supporting horizontal conspiracy.', savedFor: 'Class cert reply · Trial', lastEdited: '1d ago', docCount: 142 },
    { id: 'TH-04', name: '\'842 Prior-Art Contradiction', matter: 'Blackwell IP', owner: 'A. Petrov', entityIds: ['E-D-006','E-D-007','E-A-003','E-E-006','E-E-007'], linkIds: ['L-040','L-043','L-044','L-045'], note: 'Verge notebook + repo dates contradict \'842 novelty — foundation for invalidity defense.', savedFor: 'Markman · Invalidity', lastEdited: '6h ago', docCount: 54 },
    { id: 'TH-05', name: 'APAC Consultant Pattern', matter: 'Sterling Pharma FCPA', owner: 'M. Kirkland', entityIds: ['E-P-009','E-D-009','E-O-005','E-I-007','E-E-008'], linkIds: ['L-050','L-051','L-052','L-053'], note: 'Iyer-signed consultant agreements pattern; Wells notice triggers response.', savedFor: 'DOJ cooperative response', lastEdited: 'Yesterday', docCount: 186 },
    { id: 'TH-06', name: 'Expert Cross-Examination', matter: 'Redstone v. Meridian', owner: 'R. Vasquez', entityIds: ['E-P-010','E-P-011','E-D-004','E-A-001'], linkIds: ['L-070','L-071','L-072'], note: 'Mitchell-Harlan methodology divergence; cross-prep bundle.', savedFor: 'Cross of Harlan', lastEdited: '8h ago', docCount: 42 },
    { id: 'TH-07', name: 'Board Executive Session Privilege', matter: 'Redstone v. Meridian', owner: 'L. Torres', entityIds: ['E-D-002','E-P-003','E-D-005','E-E-002'], linkIds: ['L-007','L-024'], note: 'Privilege-challenge thread — 42 documents at issue in motion to compel.', savedFor: 'Motion to compel hearing', lastEdited: '3d ago', docCount: 48 },
    { id: 'TH-08', name: 'Damages Chain — $14.2M → Singapore', matter: 'Redstone v. Meridian', owner: 'M. Kirkland', entityIds: ['E-D-004','E-A-001','E-A-002','E-A-005','E-O-003'], linkIds: ['L-003','L-010','L-011','L-021'], note: 'Traces money flow from Apex through TRX-0412/0718 to Osei accounts.', savedFor: 'Damages exhibit', lastEdited: '4h ago', docCount: 38 },
    { id: 'TH-09', name: 'Mobile Forensics — Harrington Texts', matter: 'Redstone v. Meridian', owner: 'J. Park', entityIds: ['E-A-004','E-P-004','E-P-002','E-P-003'], linkIds: ['L-018','L-019','L-020'], note: 'iPhone imaging produces text narrative between Harrington, Osei, and Pryor during relevant period.', savedFor: 'Trial demonstrative', lastEdited: 'Yesterday', docCount: 28 },
    { id: 'TH-10', name: 'Emissions Gap 2012-14', matter: 'Greenfield Environmental', owner: 'J. Park', entityIds: ['E-D-010','E-O-009','E-P-012'], linkIds: ['L-060','L-061'], note: 'Pre-class-period emissions records; proportionality dispute with defendants.', savedFor: 'Discovery dispute', lastEdited: '2d ago', docCount: 96 },
  ],

  // ── PATTERNS (AI-detected structural patterns) ──
  patterns: [
    { id: 'PT-01', name: 'Hub-and-spoke — Harrington', description: 'Single entity (Harrington) connected to 8+ others across multiple types', entitiesInvolved: 14, strength: 'Very strong', matter: 'Redstone v. Meridian', narrative: 'Classic single-actor fraud structure. Every core fact flows through James Harrington.', confidence: 0.94 },
    { id: 'PT-02', name: 'Temporal triangle — Osei-Apex-Wires', description: 'CFO departure timing correlates with Apex formation and wire transfers', entitiesInvolved: 6, strength: 'Strong', matter: 'Redstone v. Meridian', narrative: 'Osei departs (Feb 2024) after Apex formation (Dec 2023); Singapore statements reveal transfers received.', confidence: 0.88 },
    { id: 'PT-03', name: 'Record gap — Q3 2022', description: 'Missing documents in 90-day window overlap key events', entitiesInvolved: 4, strength: 'Strong', matter: 'Redstone v. Meridian', narrative: 'Q3 2022 financial records gap aligns with LBO closing — spoliation inference available.', confidence: 0.82 },
    { id: 'PT-04', name: 'Multi-carrier hub — Price summit', description: 'Four-party meeting with downstream pricing moves', entitiesInvolved: 5, strength: 'Strong', matter: 'Pacific Shipping Antitrust', narrative: 'May 2021 meeting plus 4 matching rate increases in following 60 days.', confidence: 0.91 },
    { id: 'PT-05', name: 'Prior-art contradiction', description: 'Defendant document predates plaintiff patent by 6 months', entitiesInvolved: 3, strength: 'Moderate', matter: 'Blackwell IP', narrative: 'Verge engineering notebook entries date to 2019, before \'842 issuance.', confidence: 0.76 },
    { id: 'PT-06', name: 'Consultant-payment ring', description: '7 consultants, same bank routing, similar amounts', entitiesInvolved: 9, strength: 'Strong', matter: 'Sterling Pharma FCPA', narrative: 'Seven APAC consultant contracts share routing numbers suggesting common beneficiary.', confidence: 0.87 },
    { id: 'PT-07', name: 'Privilege-cluster anomaly', description: 'Unusual density of priv claims around one date', entitiesInvolved: 3, strength: 'Moderate', matter: 'Redstone v. Meridian', narrative: '42 docs asserted privileged from 10-18-2023 board session — supports targeted crime-fraud challenge.', confidence: 0.72 },
    { id: 'PT-08', name: 'Expert contradiction pair', description: 'Our and opposing experts use conflicting methodologies', entitiesInvolved: 4, strength: 'Strong', matter: 'Redstone v. Meridian', narrative: 'Mitchell (regression) vs Harlan (market-multiples) — methodology split for Daubert.', confidence: 0.90 },
    { id: 'PT-09', name: 'Mobile-evidence chain', description: 'Text threads cross-reference documents and wires', entitiesInvolved: 5, strength: 'Strong', matter: 'Redstone v. Meridian', narrative: 'Harrington iPhone imaging corroborates Apex formation timeline via texts to Osei.', confidence: 0.83 },
    { id: 'PT-10', name: 'Recurring co-authorship', description: 'Three individuals consistently co-author relevant documents', entitiesInvolved: 3, strength: 'Moderate', matter: 'Redstone v. Meridian', narrative: 'Bishop/Harrington/Pryor appear together on 18 documents.', confidence: 0.79 },
    { id: 'PT-11', name: 'Orphan document cluster', description: '142 high-relevance docs have no entity links yet', entitiesInvolved: 0, strength: 'Gap', matter: 'Multiple', narrative: 'AI recommends review — relevance score > 0.75 but no linked entities.', confidence: 0.65 },
    { id: 'PT-12', name: 'Cross-matter entity reuse', description: 'Sterling GC also advisor on Redstone', entitiesInvolved: 2, strength: 'Emerging', matter: 'Cross-matter', narrative: 'Potential witness overlap — GC Okafor appears in both Sterling and Redstone matters.', confidence: 0.68 },
  ],

  // ── CHAINS (hierarchical causation) ──
  chains: [
    {
      id: 'CH-01', name: 'Redstone Fraud Causation Chain', matter: 'Redstone v. Meridian',
      root: {
        id: 'E-E-001', label: 'Jun 2022 LBO Closing', type: 'event', children: [
          { id: 'E-D-001', label: 'LBO Term Sheet signed', type: 'document', rel: 'produced', children: [] },
          { id: 'E-E-002', label: 'Oct 2023 Board Meeting (exec session)', type: 'event', rel: 'occurred-after', children: [
            { id: 'E-D-002', label: 'Board Minutes (privileged)', type: 'document', rel: 'produced', children: [] },
            { id: 'E-E-003', label: 'Apex Formation (Dec 2023)', type: 'event', rel: 'caused', children: [
              { id: 'E-O-003', label: 'Apex Ventures LLC', type: 'org', rel: 'produced', children: [
                { id: 'E-A-001', label: '$14.2M wire total', type: 'artifact', rel: 'produced', children: [
                  { id: 'E-A-002', label: 'TRX-0412 / TRX-0718', type: 'artifact', rel: 'produced', children: [
                    { id: 'E-A-005', label: 'Singapore bank statements', type: 'artifact', rel: 'produced', children: [] },
                  ] },
                ] },
              ] },
            ] },
            { id: 'E-E-004', label: 'CFO Osei departure (Feb 2024)', type: 'event', rel: 'caused', children: [] },
          ] },
        ],
      },
    },
    {
      id: 'CH-02', name: 'Pacific Shipping Conspiracy Chain', matter: 'Pacific Shipping Antitrust',
      root: {
        id: 'E-E-005', label: 'May 2021 Pricing Summit', type: 'event', children: [
          { id: 'E-D-008', label: 'Pricing Meeting Minutes', type: 'document', rel: 'produced', children: [] },
          { id: 'E-P-007', label: 'Priya Raman (attendee)', type: 'person', rel: 'attended', children: [] },
          { id: 'E-P-006', label: 'Felix Wong (attendee)', type: 'person', rel: 'attended', children: [] },
          { id: 'E-I-005', label: 'Sherman Act §1 Violation', type: 'issue', rel: 'supports', children: [] },
        ],
      },
    },
    {
      id: 'CH-03', name: 'Blackwell \'842 Invalidity Chain', matter: 'Blackwell IP',
      root: {
        id: 'E-D-006', label: 'Patent \'842 Specification', type: 'document', children: [
          { id: 'E-E-006', label: 'USPTO grant date (2017)', type: 'event', rel: 'references', children: [] },
          { id: 'E-D-007', label: 'Verge engineering notebook (2019)', type: 'document', rel: 'contradicts', children: [
            { id: 'E-A-003', label: 'Verge source-code repo', type: 'artifact', rel: 'corroborates', children: [] },
          ] },
          { id: 'E-E-007', label: 'Verge Product Launch (2020)', type: 'event', rel: 'references', children: [] },
        ],
      },
    },
  ],

  // ── HYPOTHESES (competing case theories) ──
  hypotheses: [
    { id: 'HY-01', name: 'Single-Actor Fraud (Harrington hub)', matter: 'Redstone v. Meridian', theory: 'Harrington acted alone; used Apex to divert $14.2M; other executives unaware until late.', support: 18, rebuts: 4, strength: 'Primary', owner: 'M. Kirkland', favoredBy: ['Jury narrative clarity', 'Mobile forensics', 'Apex sole-director filings'] },
    { id: 'HY-02', name: 'Coordinated-Group Fraud', matter: 'Redstone v. Meridian', theory: 'Harrington, Osei, and Pryor coordinated scheme; Osei departure = cover-up.', support: 11, rebuts: 7, strength: 'Backup', owner: 'L. Torres', favoredBy: ['Osei timing', 'Privileged email chain', 'Q3 record gap'] },
    { id: 'HY-03', name: 'Board-Level Oversight Failure', matter: 'Redstone v. Meridian', theory: 'Board failed Caremark; broader failure beyond executives.', support: 6, rebuts: 12, strength: 'Unlikely', owner: 'M. Kirkland', favoredBy: ['Hypothetical argument'] },
    { id: 'HY-04', name: 'Horizontal Conspiracy (per-se)', matter: 'Pacific Shipping Antitrust', theory: 'Four carriers engaged in horizontal price-fixing; per-se violation.', support: 14, rebuts: 3, strength: 'Primary', owner: 'M. Kirkland', favoredBy: ['Pricing summit evidence', 'Matching rate increases', 'Two-sided market arguments counter'] },
    { id: 'HY-05', name: 'Tacit Collusion (rule-of-reason)', matter: 'Pacific Shipping Antitrust', theory: 'Coordinated prices but no explicit agreement — rule-of-reason path.', support: 7, rebuts: 8, strength: 'Backup', owner: 'S. Chen', favoredBy: ['Weaker evidentiary bar for defendants'] },
    { id: 'HY-06', name: 'Prior-Art Invalidity', matter: 'Blackwell IP', theory: '\'842 claim 7 anticipated by Verge 2019 notebook + repo history.', support: 9, rebuts: 5, strength: 'Primary defense', owner: 'A. Petrov', favoredBy: ['Date precedence', 'Source-code timestamps'] },
    { id: 'HY-07', name: 'Compliance Program Adequacy (FCPA)', matter: 'Sterling Pharma FCPA', theory: 'Sterling had adequate compliance program; APAC contracts anomaly, not systemic.', support: 8, rebuts: 10, strength: 'Backup', owner: 'M. Kirkland', favoredBy: ['Compliance documentation', 'Training records'] },
  ],

  // ── WITNESSES ── (witness-centric view — subset of people with timelines)
  witnesses: [
    { personId: 'E-P-001', role: 'Former CEO', depoId: 'DEP-2026-014', scheduled: '2026-05-06', exhibits: 14, linkedEntities: ['E-O-001','E-P-004','E-E-001','E-E-002'], narrative: 'Corroborates timeline; uncertainty on Harrington conduct.' },
    { personId: 'E-P-002', role: 'Former CFO', depoId: 'DEP-2026-013', scheduled: '2026-05-12', exhibits: 22, linkedEntities: ['E-D-003','E-E-004','E-A-005','E-P-004'], narrative: 'Key witness — spoliation + Singapore bank chain.' },
    { personId: 'E-P-003', role: 'GC', depoId: 'DEP-2026-012', scheduled: '2026-05-18', exhibits: 8, linkedEntities: ['E-D-002','E-D-005','E-E-002'], narrative: 'Privilege limits; exec session participation.' },
    { personId: 'E-P-004', role: 'CEO Meridian / Apex', depoId: null, scheduled: 'TBD', exhibits: 48, linkedEntities: ['E-O-002','E-O-003','E-A-001','E-A-004','E-I-001','E-I-002','E-I-003'], narrative: 'Core adverse witness — Fifth Amendment exposure.' },
    { personId: 'E-P-007', role: 'VP Pricing', depoId: 'DEP-2026-008', scheduled: '2026-05-20', exhibits: 18, linkedEntities: ['E-E-005','E-D-008','E-O-004'], narrative: 'Price-fixing meeting attendee.' },
    { personId: 'E-P-008', role: 'Named Inventor', depoId: 'DEP-2026-006', scheduled: '2026-04-28', exhibits: 64, linkedEntities: ['E-D-006','E-E-006'], narrative: 'Invention narrative and novelty defense.' },
  ],

  // ── MATRIX (cross-tab matter × entity-type density)
  matrix: {
    matters: ['Redstone v. Meridian', 'Pacific Shipping Antitrust', 'Blackwell IP', 'Sterling Pharma FCPA', 'Greenfield Environmental', 'Chen v. Atlas'],
    types: ['person', 'org', 'document', 'event', 'issue', 'artifact'],
    counts: {
      'Redstone v. Meridian': { person: 12, org: 3, document: 5, event: 4, issue: 4, artifact: 5 },
      'Pacific Shipping Antitrust': { person: 2, org: 1, document: 1, event: 1, issue: 1, artifact: 0 },
      'Blackwell IP': { person: 1, org: 2, document: 2, event: 2, issue: 1, artifact: 1 },
      'Sterling Pharma FCPA': { person: 1, org: 1, document: 1, event: 1, issue: 1, artifact: 0 },
      'Greenfield Environmental': { person: 1, org: 1, document: 1, event: 0, issue: 0, artifact: 0 },
      'Chen v. Atlas': { person: 0, org: 1, document: 0, event: 0, issue: 0, artifact: 0 },
    },
  },

  // ── ACTIVITY ──
  activity: [
    { id: 'NX-A-001', time: '10:52 AM', actor: 'M. Kirkland', action: 'Linked entities', target: 'Harrington → $14.2M wires (owns, weight 3)', severity: 'info' },
    { id: 'NX-A-002', time: '10:44 AM', actor: 'L. Torres', action: 'Saved thread', target: 'TH-02 Osei Spoliation Chain · 4 entities, 4 links', severity: 'info' },
    { id: 'NX-A-003', time: '10:28 AM', actor: 'AI · Pattern Detector', action: 'Flagged pattern', target: 'PT-01 Hub-and-spoke Harrington · confidence 0.94', severity: 'info' },
    { id: 'NX-A-004', time: '10:12 AM', actor: 'J. Park', action: 'Added entity', target: 'E-A-005 Singapore bank statements', severity: 'info' },
    { id: 'NX-A-005', time: '09:58 AM', actor: 'AI · Orphan Detector', action: 'Flagged orphans', target: '142 unlinked high-relevance docs', severity: 'warn' },
    { id: 'NX-A-006', time: '09:42 AM', actor: 'M. Kirkland', action: 'Promoted thread', target: 'TH-01 → Trial narrative (primary)', severity: 'info' },
    { id: 'NX-A-007', time: '09:22 AM', actor: 'L. Torres', action: 'Created link type', target: 'identified-as (custom, matter-scoped)', severity: 'info' },
    { id: 'NX-A-008', time: '09:14 AM', actor: 'R. Vasquez', action: 'Compared hypotheses', target: 'HY-01 vs HY-02 · support delta +7', severity: 'info' },
    { id: 'NX-A-009', time: 'Yesterday', actor: 'A. Petrov', action: 'Built chain', target: 'CH-03 Blackwell \'842 Invalidity', severity: 'info' },
    { id: 'NX-A-010', time: 'Yesterday', actor: 'AI · Suggestion', action: 'Recommended link', target: 'E-A-004 iPhone → E-P-002 Osei (3 texts found)', severity: 'info' },
    { id: 'NX-A-011', time: 'Yesterday', actor: 'M. Kirkland', action: 'Witness mapped', target: 'Helen Bishop linked to 4 thread entities', severity: 'info' },
    { id: 'NX-A-012', time: '2 days ago', actor: 'System', action: 'Index rebuild', target: '4,820 entities reindexed · 8,640 links verified', severity: 'info' },
  ],
};

// ── ENTITIES DASHBOARD — supporting intelligence ──────────────────
NEXUS_DATA.entityStats = {
  // 12-month growth in indexed entities (cumulative)
  growth: [
    { m: 'May 25', count: 1840, delta: 142 },
    { m: 'Jun 25', count: 2010, delta: 170 },
    { m: 'Jul 25', count: 2180, delta: 170 },
    { m: 'Aug 25', count: 2360, delta: 180 },
    { m: 'Sep 25', count: 2690, delta: 330 },
    { m: 'Oct 25', count: 3020, delta: 330 },
    { m: 'Nov 25', count: 3340, delta: 320 },
    { m: 'Dec 25', count: 3480, delta: 140 },
    { m: 'Jan 26', count: 3810, delta: 330 },
    { m: 'Feb 26', count: 4160, delta: 350 },
    { m: 'Mar 26', count: 4520, delta: 360 },
    { m: 'Apr 26', count: 4820, delta: 300 },
  ],
  // Type-level breakdowns (full corpus index figures, not just the 51 shown)
  byType: [
    { type: 'person',   total: 1624, linked: 1482, orphans: 142, pctOfAll: 33.7 },
    { type: 'org',      total: 312,  linked: 298,  orphans: 14,  pctOfAll: 6.5  },
    { type: 'document', total: 1948, linked: 1702, orphans: 246, pctOfAll: 40.4 },
    { type: 'event',    total: 384,  linked: 352,  orphans: 32,  pctOfAll: 8.0  },
    { type: 'issue',    total: 128,  linked: 124,  orphans: 4,   pctOfAll: 2.7  },
    { type: 'artifact', total: 424,  linked: 398,  orphans: 26,  pctOfAll: 8.8  },
  ],
  priority: [
    { level: 'key',    count: 412, pct: 8.5  },
    { level: 'high',   count: 1182, pct: 24.5 },
    { level: 'medium', count: 2740, pct: 56.8 },
    { level: 'low',    count: 486,  pct: 10.1 },
  ],
  // Top linked entities (for leaderboard)
  topLinked: [
    { id: 'E-O-004', name: 'Pacific Shipping Co.',    type: 'org',      links: 94, matter: 'Pacific Shipping Antitrust' },
    { id: 'E-O-001', name: 'Redstone Capital LLC',    type: 'org',      links: 88, matter: 'Redstone v. Meridian' },
    { id: 'E-O-002', name: 'Meridian Holdings',       type: 'org',      links: 72, matter: 'Redstone v. Meridian' },
    { id: 'E-O-005', name: 'Sterling Pharmaceuticals',type: 'org',      links: 68, matter: 'Sterling Pharma FCPA' },
    { id: 'E-P-004', name: 'James Harrington',        type: 'person',   links: 62, matter: 'Redstone v. Meridian' },
    { id: 'E-P-001', name: 'Helen Bishop',            type: 'person',   links: 48, matter: 'Redstone v. Meridian' },
    { id: 'E-O-009', name: 'Greenfield Corp.',        type: 'org',      links: 46, matter: 'Greenfield Environmental' },
    { id: 'E-D-001', name: 'LBO Term Sheet — Jun 2022', type: 'document', links: 42, matter: 'Redstone v. Meridian' },
    { id: 'E-O-006', name: 'Blackwell Industries',    type: 'org',      links: 42, matter: 'Blackwell IP' },
    { id: 'E-P-003', name: 'Marcus Pryor',            type: 'person',   links: 41, matter: 'Redstone v. Meridian' },
  ],
  // Orphan entities (linked < 2)
  orphans: { total: 464, byType: { person: 142, document: 246, event: 32, org: 14, issue: 4, artifact: 26 }, highRelevanceOrphans: 142 },
  // Duplicate / alias intelligence
  aliases: {
    totalAliases: 1284,          // canonicalized references
    ambiguousNames: 34,          // multiple entities matching same raw name
    autoMerged: 186,             // merged by fuzzy matching
    pendingReview: 12,           // flagged for human review
  },
  // Recent additions (last 10)
  recent: [
    { id: 'E-A-005', name: 'Singapore bank statements', type: 'artifact', addedBy: 'L. Torres',   matter: 'Redstone v. Meridian', addedAt: '2h ago' },
    { id: 'E-P-012', name: 'Elena Vasquez',             type: 'person',   addedBy: 'J. Park',     matter: 'Greenfield Environmental', addedAt: '4h ago' },
    { id: 'E-A-004', name: 'Mobile phone imaging — Harrington', type: 'artifact', addedBy: 'J. Park', matter: 'Redstone v. Meridian', addedAt: '6h ago' },
    { id: 'E-D-010', name: 'Emissions Testing Reports 2012—2014', type: 'document', addedBy: 'J. Park', matter: 'Greenfield Environmental', addedAt: '9h ago' },
    { id: 'E-E-008', name: 'SEC Wells Notice — Sterling', type: 'event', addedBy: 'M. Kirkland', matter: 'Sterling Pharma FCPA', addedAt: 'Yesterday' },
    { id: 'E-P-011', name: 'Dr. Alan Harlan',           type: 'person',   addedBy: 'R. Vasquez',  matter: 'Redstone v. Meridian', addedAt: 'Yesterday' },
    { id: 'E-D-007', name: 'Verge engineering notebook — 2019', type: 'document', addedBy: 'A. Petrov', matter: 'Blackwell IP', addedAt: '2 days ago' },
    { id: 'E-A-003', name: 'Source Code Repository (Verge)', type: 'artifact', addedBy: 'A. Petrov', matter: 'Blackwell IP', addedAt: '2 days ago' },
    { id: 'E-P-009', name: 'Arnav Iyer',                type: 'person',   addedBy: 'M. Kirkland', matter: 'Sterling Pharma FCPA', addedAt: '3 days ago' },
    { id: 'E-D-009', name: 'APAC Consultant Agreements (7)', type: 'document', addedBy: 'M. Kirkland', matter: 'Sterling Pharma FCPA', addedAt: '3 days ago' },
  ],
  // Matter coverage (entity counts per matter for Entities dashboard; richer than the matrix)
  byMatter: [
    { matter: 'Redstone v. Meridian',         total: 2142, linked: 2040, orphans: 102, keyEntities: 34 },
    { matter: 'Pacific Shipping Antitrust',   total: 1120, linked: 1082, orphans: 38,  keyEntities: 18 },
    { matter: 'Sterling Pharma FCPA',         total: 684,  linked: 624,  orphans: 60,  keyEntities: 12 },
    { matter: 'Greenfield Environmental',     total: 412,  linked: 384,  orphans: 28,  keyEntities: 8  },
    { matter: 'Blackwell IP',                 total: 268,  linked: 248,  orphans: 20,  keyEntities: 7  },
    { matter: 'Chen v. Atlas Financial',      total: 142,  linked: 128,  orphans: 14,  keyEntities: 4  },
    { matter: 'Thornton Estate',              total: 52,   linked: 48,   orphans: 4,   keyEntities: 2  },
  ],
};

// ── MATRIX DASHBOARD — supporting intelligence ────────────────────
NEXUS_DATA.matrixStats = {
  // Type × Type link co-occurrence — how often entities of each type link to each other
  typeByType: {
    types: ['person', 'org', 'document', 'event', 'issue', 'artifact'],
    counts: {
      person:   { person: 184, org: 412, document: 624, event: 218, issue: 142, artifact: 86 },
      org:      { person: 412, org: 48,  document: 540, event: 168, issue: 296, artifact: 124 },
      document: { person: 624, org: 540, document: 96,  event: 412, issue: 486, artifact: 148 },
      event:    { person: 218, org: 168, document: 412, event: 24,  issue: 184, artifact: 72 },
      issue:    { person: 142, org: 296, document: 486, event: 184, issue: 12,  artifact: 58 },
      artifact: { person: 86,  org: 124, document: 148, event: 72,  issue: 58,  artifact: 14 },
    },
  },
  // Gap analysis — empty or sparse matrix cells with AI recommendations
  gaps: [
    { matter: 'Chen v. Atlas Financial', type: 'person',   recommendation: '12 high-relevance people detected in 2023 brokerage emails — not yet canonicalized', severity: 'high',   confidence: 0.84 },
    { matter: 'Chen v. Atlas Financial', type: 'document', recommendation: '48 unlinked analyst reports with Atlas-specific keywords', severity: 'high',   confidence: 0.79 },
    { matter: 'Thornton Estate',         type: 'document', recommendation: 'Only 1 document indexed — probate filings not yet ingested', severity: 'medium', confidence: 0.72 },
    { matter: 'Pacific Shipping Antitrust', type: 'artifact', recommendation: 'No artifacts mapped — pricing exhibits available for canonicalization', severity: 'medium', confidence: 0.68 },
    { matter: 'Greenfield Environmental', type: 'event',   recommendation: 'Zero events mapped — emissions timeline reconstruction available', severity: 'medium', confidence: 0.74 },
    { matter: 'Blackwell IP',            type: 'person',   recommendation: 'Named-inventor only (1) — accused-device engineers missing', severity: 'low',    confidence: 0.61 },
  ],
  // Coverage density (links per entity) per matter
  density: [
    { matter: 'Redstone v. Meridian',         links: 3284, entities: 2142, ratio: 1.53, rank: 1 },
    { matter: 'Pacific Shipping Antitrust',   links: 1420, entities: 1120, ratio: 1.27, rank: 2 },
    { matter: 'Sterling Pharma FCPA',         links: 740,  entities: 684,  ratio: 1.08, rank: 4 },
    { matter: 'Blackwell IP',                 links: 342,  entities: 268,  ratio: 1.28, rank: 3 },
    { matter: 'Greenfield Environmental',     links: 418,  entities: 412,  ratio: 1.01, rank: 5 },
    { matter: 'Chen v. Atlas Financial',      links: 124,  entities: 142,  ratio: 0.87, rank: 6 },
    { matter: 'Thornton Estate',              links: 38,   entities: 52,   ratio: 0.73, rank: 7 },
  ],
  // Cross-matter bridges (entities appearing in multiple matters)
  crossMatter: [
    { entity: 'Sterling Pharmaceuticals (GC Okafor)', matters: ['Sterling Pharma FCPA', 'Redstone v. Meridian'], note: 'Expert witness overlap' },
    { entity: 'M. Kirkland', matters: ['Redstone v. Meridian', 'Pacific Shipping', 'Sterling Pharma FCPA', 'Greenfield Environmental', 'Marshall Employment'], note: 'Billing partner — 5 matters' },
    { entity: 'L. Torres',   matters: ['Redstone v. Meridian', 'Chen v. Atlas Financial', 'Harbor District'], note: 'Senior Associate' },
  ],
};

window.NEXUS_DATA = NEXUS_DATA;
