// ═══════════════════════════════════════════════════════════════════
// INTELLIGENCE REPORT · GENERALIZED EXECUTIVE SHELL
// One report shell across all securities & tokenizable asset classes.
//
// Canonical section slots (always the same seven):
//   thesis · subject · instrument · underwriting · diligence · readiness · sources
//
//   • UNIVERSAL sections — thesis, diligence, readiness, sources — render
//     the same analytical shapes for every asset class.
//   • CLASS-SPECIFIC sections — subject, instrument, underwriting — are
//     relabeled and re-templated per asset class by PROFILES, keyed by the
//     canonical ontology class ids (real estate · company equity · debt &
//     credit · fund · commodity · infrastructure · art & collectibles).
//
// The header carries two selectors:
//   • ASSET CLASS — drives section labels + the headline metric set.
//   • SECTION     — pill nav across the seven slots.
//
// Lionsgate is the populated Real-Estate instance. Other classes show how
// the same shell reframes for that class; body data is generated from each
// project's Knowledge Base, so sourced facts stay in the KB, not re-tabled.
// ═══════════════════════════════════════════════════════════════════
(function () {
  const { useState } = React;
  const L = window.LIONSGATE;

  const lrMono = (s, extra) => <span style={{ fontFamily: "var(--mono)", fontSize: "8.5px", letterSpacing: "0.1em", textTransform: "uppercase", color: "var(--ink-4)", ...extra }}>{s}</span>;
  const card = (extra) => ({ border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", background: "var(--bg)", padding: "15px 17px", ...extra });
  const ClassBadge = ({ cls, short }) => { const m = L.CLASS[cls] || {}; return <window.Pill tone={m.tone || "neutral"} title={m.note}>{short ? cls : m.label || cls}</window.Pill>; };
  const sevTone = (s) => ({ high: "err", med: "warn", low: "neutral" }[String(s).toLowerCase()] || "neutral");
  const SEV_COLOR = { high: "var(--err)", med: "var(--warn)", low: "var(--ink-4)" };
  const PRI_TONE = { P0: "err", P1: "warn", P2: "info" };
  const classCounts = () => { const c = {}; L.KB.forEach((f) => { c[f.cls] = (c[f.cls] || 0) + 1; }); return c; };

  function Grid({ cols, headers, children, mb }) {
    return (
      <div style={{ border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", marginBottom: mb == null ? 0 : mb }}>
        <div style={{ display: "grid", gridTemplateColumns: cols, gap: 1, background: "var(--rule)" }}>
          {headers.map((h, i) => <div key={i} style={{ background: "var(--bg-2)", padding: "8px 12px" }}><window.MonoLabel>{h}</window.MonoLabel></div>)}
          {children}
        </div>
      </div>
    );
  }
  const cell = (c, extra) => ({ background: "var(--bg)", padding: "9px 12px", fontSize: "var(--fs-xs)", color: c || "var(--ink-2)", lineHeight: 1.55, ...extra });

  // One canonical number pallet — reused for every label/value/sub stat row so
  // cells share identical padding + typography and never jump between tabs.
  function MetricPallet({ items, cols, mb }) {
    return (
      <div style={{ display: "grid", gridTemplateColumns: "repeat(" + (cols || items.length) + ", 1fr)", gap: 1, background: "var(--rule)", border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", marginBottom: mb == null ? "var(--s-5)" : mb }}>
        {items.map(([l, v, s]) => (
          <div key={l} style={{ background: "var(--bg)", padding: "12px 14px" }}>
            {lrMono(l, { display: "block", marginBottom: 5 })}
            <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: "19px", lineHeight: 1, color: v === "—" ? "var(--ink-4)" : "var(--ink)", whiteSpace: "nowrap" }}>{v}</div>
            <div style={{ marginTop: 4, fontSize: "var(--fs-xs)", color: "var(--ink-4)", lineHeight: 1.45 }}>{s}</div>
          </div>
        ))}
      </div>
    );
  }

  // ── SECTION MODEL — canonical slots in reading order ───────────────
  const SLOTS = ["thesis", "subject", "instrument", "underwriting", "diligence", "readiness", "sources"];

  // labels shared by every asset class (the universal analytical layer)
  const UNIVERSAL = {
    thesis:    { label: "Thesis & Verdict", sub: "the case · verdict · findings · strengths · risks" },
    diligence: { label: "Diligence",        sub: "verification & contradictions · evidence gaps" },
    readiness: { label: "Readiness",        sub: "go / no-go gates · ranked actions" },
    sources:   { label: "Sources",          sub: "provenance — every fact cites exactly one source" },
  };

  // ── PROFILE REGISTRY — per asset class, the class-specific framing ─
  // each profile supplies: the three class-specific section labels, the
  // headline metric set, and the expected inputs the shell prompts for.
  const PROFILES = {
    realEstate: {
      name: "Real Estate & Land", glyph: "▦",
      sections: {
        subject:      { label: "The Asset",     sub: "site · program · brand · demand" },
        instrument:   { label: "The Deal",       sub: "capital stack · sources-and-uses · structure" },
        underwriting: { label: "Underwriting",   sub: "returns · scenarios · valuation spread" },
      },
      metrics: [["raise", "$850M", "up to · whole stack"], ["equity tranche", "~$299M", "tokenizable · 40%"], ["dev cost (model)", "$747.5M", "benchmark $551.5M"], ["levered IRR (base)", "34.7%", "unlevered 21.7%"], ["opening", "2029", "construction 2027"], ["source confidence", "46/100", "Tier-3 sponsor doc"]],
    },
    equity: {
      name: "Company Equity", glyph: "❖",
      sections: {
        subject:      { label: "The Business",     sub: "product · market · team · traction" },
        instrument:   { label: "The Offering",     sub: "instrument · cap table · terms" },
        underwriting: { label: "Financial Model",  sub: "revenue · margins · burn · projections" },
      },
      metrics: [["round size", "—", "from KB"], ["pre-money", "—", "from KB"], ["ARR", "—", "from KB"], ["gross margin", "—", "from KB"], ["runway", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
    credit: {
      name: "Debt & Credit", glyph: "☲",
      sections: {
        subject:      { label: "The Borrower",   sub: "sponsor · collateral · use of proceeds" },
        instrument:   { label: "The Facility",    sub: "structure · security · covenants" },
        underwriting: { label: "Credit Analysis", sub: "coverage · LTV · stress · recovery" },
      },
      metrics: [["facility size", "—", "from KB"], ["LTV", "—", "from KB"], ["coupon", "—", "from KB"], ["DSCR", "—", "from KB"], ["tenor", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
    fund: {
      name: "Fund / Portfolio", glyph: "⬡",
      sections: {
        subject:      { label: "The Strategy",   sub: "thesis · sourcing · portfolio construction" },
        instrument:   { label: "The Terms",       sub: "structure · fees · waterfall · GP commit" },
        underwriting: { label: "Track Record",    sub: "realized & unrealized · attribution · benchmarks" },
      },
      metrics: [["target size", "—", "from KB"], ["GP commit", "—", "from KB"], ["net IRR (tgt)", "—", "from KB"], ["DPI", "—", "from KB"], ["vintage", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
    commodity: {
      name: "Commodities & Natural Resources", glyph: "⬗",
      sections: {
        subject:      { label: "The Asset",        sub: "resource · capacity · operations · offtake" },
        instrument:   { label: "The Structure",     sub: "capital stack · rights · rails" },
        underwriting: { label: "Throughput Model",  sub: "cost & capacity · price × volume · returns" },
      },
      metrics: [["raise", "—", "from KB"], ["capacity", "—", "from KB"], ["offtake", "—", "from KB"], ["IRR (base)", "—", "from KB"], ["first output", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
    infrastructure: {
      name: "Infrastructure", glyph: "▥",
      sections: {
        subject:      { label: "The Asset",        sub: "facility · capacity · contracts · regulation" },
        instrument:   { label: "The Structure",     sub: "capital stack · rights · rails" },
        underwriting: { label: "Throughput Model",  sub: "cost & commissioning · output × tariff · returns" },
      },
      metrics: [["raise", "—", "from KB"], ["capacity", "—", "from KB"], ["contracted", "—", "from KB"], ["DSCR", "—", "from KB"], ["COD", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
    collectible: {
      name: "Art, Collectibles & IP", glyph: "◈",
      sections: {
        subject:      { label: "The Work",         sub: "object · provenance · condition · custody" },
        instrument:   { label: "The Structure",     sub: "ownership split · rights · rails" },
        underwriting: { label: "Valuation Model",   sub: "appraisal · comparables · liquidity" },
      },
      metrics: [["raise", "—", "from KB"], ["appraised value", "—", "from KB"], ["units", "—", "from KB"], ["est. yield", "—", "from KB"], ["holding period", "—", "from KB"], ["source confidence", "—", "from KB"]],
    },
  };

  const sectionFor = (lens, slot) => UNIVERSAL[slot] || PROFILES[lens].sections[slot];

  // ── Lionsgate (Real-Estate instance) payload ───────────────────────
  const LD = {
    thesis: {
      headline: "A marquee, brandable RWA — a Lionsgate theme park on I-Drive is a category-defining Compass reference deal.",
      pillars: [
        { t: "the asset", d: "Lionsgate park + hotel on a 13-acre assembled I-Drive site — the named, narratable asset tokenization has lacked." },
        { t: "the market", d: "Orlando demand is real and cited: 75.3M visitors in 2024 (+1.8% YoY), the #1 US destination; Epic Universe (May 2025) proves the corridor." },
        { t: "the family", d: "SAXCAP is the named sponsor; the Friedman development family has built since 1960; Anderson Kill provides senior counsel." },
        { t: "the wrapper", d: "Reg D 506(c) + Reg S around a ~$299M tokenizable equity tranche — the correct exemption framework, with the rails still unnamed." },
      ],
      counterweight: "Counterweight: the two load-bearing dependencies — land control and Orlando IP rights — are unverified; everything downstream inherits their risk.",
    },
    verdict: { headline: "Conditional — not cleared to issue.", body: "Land control (Skyplex cancelled 17 Oct 2024, land for sale — cited) and the Lionsgate Orlando license are not evidenced. Engage diligence-first; scope any token to the ~$299M equity tranche, milestone-tranched.", confidence: 46 },
    findings: [
      { cls: "Q", text: "Land control — Skyplex was officially cancelled 17 Oct 2024 and the 13-acre site is listed for sale; the JV “to develop” is not evidenced." },
      { cls: "U", text: "Lionsgate Orlando IP — LEWO operates in Hengqin, China; the deck claims a Skyplex–Lionsgate agreement but no document is provided." },
      { cls: "Q", text: "$850M raise vs $747.5M dev cost — no sources-and-uses; ~$102.5M unaccounted, and a $299M equity-only tranche vs an $850M whole stack are inconsistent scopes." },
      { cls: "Q", text: "Per-cap inputs $84 / $46 run ~70% above the deck's own cited benchmark $43.61 / $36.46 (United Parks FY24)." },
      { cls: "V", text: "The demand floor is real — Orlando's 75.3M visitors (2024) and United Parks' 40.6% adj. EBITDA margin are URL-verified against primary releases." },
    ],
    strengths: [
      "Verified Orlando demand: 75.3M visitors in 2024, +1.8% YoY — cited, and matching the deck exactly.",
      "Epic Universe adjacency proves the I-Drive corridor — opened May 2025, cited.",
      "Credible development family (Friedman, RE since 1960) and senior counsel (Anderson Kill P.C.).",
      "Correct exemption framework — Reg D 506(c) + Reg S around a scoped equity tranche.",
    ],
    subject: {
      pillars: [
        { t: "the site", d: "13.0 acres, six assembled parcels at I-Drive & Sand Lake Rd — the cancelled Skyplex assembly, now listed for sale (G-01)." },
        { t: "the program", d: "Theme park + 450-key hotel + a ~500–530 ft “world's tallest” coaster; the notes reference a 350-room approval (X-04) and the coaster builder is in Ch.11 (G-03)." },
        { t: "the brand", d: "Lionsgate / LEWO — one operating park exists (Hengqin, China, 2019); the Orlando rights are the unverified half of the premise (G-02)." },
        { t: "the demand", d: "75.3M Orlando visitors in 2024 (+1.8% YoY) — URL-verified, #1 US destination; Epic Universe (May 2025) proves the corridor." },
      ],
      note: "Pre-development — a plan, not an asset: no executed land contract, entitlement refresh or operator agreement cited. Sourced facts live in the Knowledge Base.",
    },
    risks: [
      { id: "R-01", title: "Land control", cat: "existential", sev: "high", desc: "Skyplex cancelled and the site listed for sale; without an executed contract / option there is no asset.", mitig: "Demand the control stack before any further engagement (Action 1)." },
      { id: "R-02", title: "IP license", cat: "legal", sev: "high", desc: "Lionsgate Orlando rights unconfirmed — only 2020 press reports of Lionsgate interest exist in public record.", mitig: "Current signed license — or the brand premium comes out of the model (Action 1)." },
      { id: "R-03", title: "Sources-and-uses", cat: "credibility", sev: "high", desc: "~$102.5M between $747.5M cost and $850M raise unaccounted; equity-tranche vs whole-stack scopes inconsistent.", mitig: "Publish one reconciled sources-and-uses before token economics (Action 2)." },
      { id: "R-04", title: "Model levers", cat: "underwriting", sev: "med", desc: "Per-caps ~70% above the cited benchmark and a 12.0x exit multiple flatter the 34.7% levered IRR.", mitig: "Stress-test at $43.61 / $36.46 and publish the conservative case (Action 4)." },
      { id: "R-05", title: "Program drift", cat: "program", sev: "med", desc: "450 hotel keys modeled vs a 350-room approval in the notes; the coaster builder is in Ch.11.", mitig: "Lock the key count; confirm the ride-IP path post-bankruptcy." },
      { id: "R-06", title: "Unnamed rails", cat: "compliance", sev: "med", desc: "Continuous liquidity is asserted with no broker-dealer, transfer agent, ATS — or issuer SPV — named.", mitig: "Name the rails and disclose the SPV before launch (Action 5)." },
    ],
  };

  const STACK = [
    { holder: "Senior construction debt", role: "lender TBD · 7.2% all-in", pct: "60%", amt: "$448.4M" },
    { holder: "Tokenized equity tranche", role: "issuer SPV — undisclosed (G-04)", pct: "40%", amt: "$299.1M" },
  ];
  const RECON = [
    ["$551.5M", "cost benchmark = $497.5M non-land + $54M land parcel", "P"],
    ["$747.5M", "development estimate = $497.5M non-land + $250M carried land basis", "P"],
    ["$850M", "headline raise — no sources-and-uses bridges it to cost (X-09)", "Q"],
    ["$865M", "“presumed total project cost” (slide 6) — $15M above the $850M raise, unexplained (GAP)", "Q"],
  ];
  const RETURNS = [
    ["unlevered IRR", "21.7%", "NPV $609.0M"], ["levered IRR", "34.7%", "NPV $754.4M @ 12%"], ["yield on cost", "22.6%", "stabilized · Yr3 2031"], ["DSCR (Yr3)", "3.1x", "60% LTC · 7.2% all-in"], ["terminal EV", "$2.31B", "2038 · 12.0x exit EBITDA"],
  ];
  const SCEN = [
    ["Attendance multiplier", "85%", "100%", "115%"],
    ["Stabilized attendance", "1.96M", "2.30M", "2.65M"],
    ["Stabilized revenue", "$307.6M", "$381.0M", "$460.0M"],
    ["Stabilized EBITDA", "$78.1M", "$124.6M", "$167.6M"],
    ["Yield on cost", "12.9%", "22.6%", "32.0%"],
  ];
  const VAL = [
    ["~$0.94B", "Slide 8 comp build: park $675M + land $260M"],
    ["$609–754M", "DCF NPV range (unlevered → levered @ 12%)"],
    ["~$1.5B", "Narrative text: 5-yr stabilized value at a 5% cap"],
  ];
  const VERIFY_MIX = [["V", 3, "verified vs primary source"], ["P", 4, "self-reported · uncorroborated"], ["Q", 4, "questionable · conflicts or unsupported"], ["U", 1, "unknown · no public evidence"]];
  // claim-by-claim cross-check ledger (G5.b) — sums to VERIFY_MIX (V3 · P4 · Q4 · U1)
  const VERIFY = [
    { claim: "Orlando 75.3M visitors (2024) · #1 US city", finding: "URL-verified vs Visit Orlando release (8 May 2025) — 75,333,800.", cls: "V" },
    { claim: "United Parks FY24 — 40.6% adj. EBITDA margin; per-caps $43.61 / $36.46", finding: "Verified vs United Parks Q4/FY2024 release (26 Feb 2025).", cls: "V" },
    { claim: "Universal Epic Universe on I-Drive", finding: "Verified — opened May 2025 (public record); proves the corridor. Not in the deck.", cls: "V" },
    { claim: "13-acre site assembled; JV 'to develop'", finding: "Skyplex cancelled 17 Oct 2024; land listed for sale (OBJ / ConnectCRE). JV not evidenced (G-01).", cls: "Q" },
    { claim: "$850M raise vs $747.5M dev cost", finding: "~$102.5M unaccounted; $299M equity vs $850M stack are inconsistent scopes (X-09 · G-06).", cls: "Q" },
    { claim: "Per-cap admission $84 / in-park $46", finding: "~70% above the deck's own cited benchmark $43.61 / $36.46 (X-08).", cls: "Q" },
    { claim: "450-key hotel (model)", finding: "Notes cite a 350-room approval — 28% program gap (X-04).", cls: "Q" },
    { claim: "PD zoning 'fully in place'", finding: "Sponsor-stated; revival may need re-entitlement — not independently confirmed.", cls: "P" },
    { claim: "Friedman developer · Anderson Kill counsel", finding: "Sponsor-stated; counsel named, development history uncorroborated (G-07).", cls: "P" },
    { claim: "Citywide occupancy 84.4% / ADR $287.40 (2024)", finding: "Deck cites visitorlando.org; figures not independently captured (G-07).", cls: "P" },
    { claim: "$497.5M non-land construction budget", finding: "Sponsor model; shared by both cost methods, uncorroborated.", cls: "P" },
    { claim: "Skyplex–Lionsgate Orlando agreement", finding: "LEWO operates in Hengqin, China (2019); no Orlando license document provided (G-02).", cls: "U" },
  ];
  // regulatory filing & rails pipeline (G6) — the gate sequence to issuance
  const FILINGS = [
    { name: "Issuer SPV formation", statusTone: "warn", statusLabel: "due", detail: "SPV / series structure for the ~$299M equity tranche — not yet disclosed (G-04)." },
    { name: "Transfer agent / ATS engagement", statusTone: "warn", statusLabel: "due", detail: "No broker-dealer, transfer agent or ATS named for the asserted secondary market (G-05)." },
    { name: "Form D (Reg D 506(c))", statusTone: "neutral", statusLabel: "future", detail: "Within 15 days after first sale (Rule 503) — domestic accredited tranche." },
    { name: "Reg S compliance", statusTone: "neutral", statusLabel: "future", detail: "Offshore tranche — no SEC filing; 40-day distribution-compliance period." },
    { name: "Blue-sky notices", statusTone: "neutral", statusLabel: "future", detail: "State notice filings per state of first sale." },
  ];
  const CONTRA = [
    ["X-09", "Raise: up to $850M", "Dev cost $747.5M · equity $299M", "No sources-and-uses; ~$102.5M unaccounted; inconsistent scopes", "High", "Publish one reconciled sources-and-uses"],
    ["X-02", "Quick Facts: 2.0M / $148M / $74M (Yr1)", "DCF: 1.8M / $278M / $89M (Yr1)", "Two different Year-1 operating models stitched together", "High", "Retire the legacy Quick-Facts block"],
    ["X-06", "Narrative: 5-yr value ~$1.5B (5% cap)", "Slide 8: park $675M / land $260M; NPV $609–754M", "Valuation outputs span $0.7B–$1.5B", "High", "Reconcile cap-rate vs DCF vs comp value"],
    ["X-04", "Model: 450 hotel keys", "Notes: “approved … 350-room hotel”", "Hotel program differs 28%", "Med", "Lock key count; affects hotel EBITDA"],
    ["X-08", "Per-cap $84 / $46", "Cited benchmark $43.61 / $36.46", "Model inputs ~70% above their own source", "Med", "Justify premium or revert to benchmark"],
    ["X-03", "Invested to date $96M", "Text $81M; notes “>$54M”", "Sunk-cost / land credit inconsistent", "Med", "Confirm verified land basis & equity credit"],
  ];
  const GAPS = [
    { id: "G-01", gap: "Land control stack", sev: "high", today: "Skyplex cancelled 17 Oct 2024; the 13-acre site is listed for sale", closes: "Executed land contract / option + Skyplex JV agreement", due: "before any further engagement" },
    { id: "G-02", gap: "Lionsgate license", sev: "high", today: "LEWO operates in Hengqin; deck claims an agreement — no document provided", closes: "Current, signed Lionsgate Orlando IP license", due: "before marketing" },
    { id: "G-06", gap: "Sources-and-uses bridge", sev: "high", today: "~$102.5M between $747.5M cost and $850M raise unaccounted", closes: "One reconciled S&U (construction interest · issuance · reserves)", due: "before token economics" },
    { id: "G-04", gap: "Issuer SPV", sev: "med", today: "No SPV / series structure disclosed for the token", closes: "SPV formation documents + series structure", due: "before Form D" },
    { id: "G-05", gap: "Regulated rails", sev: "med", today: "No broker-dealer, transfer agent or ATS named", closes: "Executed engagements with named rails", due: "before launch" },
    { id: "G-03", gap: "Coaster IP", sev: "med", today: "Builder US Thrill Rides filed for bankruptcy Dec 2022", closes: "IP assignment — or a new ride vendor under contract", due: "design freeze" },
    { id: "G-07", gap: "Primary citations", sev: "med", today: "Occ / ADR / I-Drive figures and issuer bios lack captured primary citations", closes: "Primary citations captured and re-verified", due: "next cycle" },
  ];
  const ACTIONS = [
    ["1", "Demand the control stack", "Executed land contract / option, Skyplex JV agreement, Lionsgate license, Hyatt LOI — the two red graph edges.", "P0"],
    ["2", "Publish one reconciled sources-and-uses", "Bridge $747.5M dev cost → $850M raise (~$102.5M financing / issuance / reserves) before any token economics.", "P0"],
    ["3", "Scope the token as equity, milestone-tranched", "~$299M under Reg D 506(c) + Reg S via an SPV — not the full $850M in one round.", "P1"],
    ["4", "Stress-test per-caps to the cited benchmark", "Re-run returns at $43.61 / $36.46 (United Parks FY24); publish a conservative case.", "P1"],
    ["5", "Name the regulated rails", "Broker-dealer of record, transfer agent, ATS — the deck asserts liquidity without naming a venue.", "P1"],
    ["6", "Position as Compass flagship", "If control evidence clears, a category-defining branded-RWA reference deal worth a case study.", "P2"],
  ];
  const PATHS = [
    { path: "Diligence Engagement", verdict: "cleared to engage", ok: true, note: "Engagement may proceed diligence-first — the analysis layer is complete; the evidence layer is not.", items: [
      { ok: true, what: "Deck extracted & every datapoint classified", note: L.KB.length + " facts" },
      { ok: true, what: "Material claims cross-checked against public sources", note: "12 claims" },
      { ok: true, what: "Contradiction register populated & severities rated", note: "6 open" },
      { ok: true, what: "Deal architecture graphed — load-bearing edges flagged", note: "2 red edges" },
      { ok: false, what: "Primary citations captured for attributed figures", note: "G-07" },
    ] },
    { path: "Token Issuance", verdict: "not cleared to issue", ok: false, note: "Issuance is gated. If evidence lands, scope the token to the ~$299M equity tranche, milestone-tranched — re-run the pipeline and this verdict recomputes.", items: [
      { ok: true, what: "Exemption framework correct — Reg D 506(c) + Reg S", note: "scoped" },
      { ok: false, what: "Land control evidenced — contract / option + JV", note: "G-01" },
      { ok: false, what: "Lionsgate Orlando license executed", note: "G-02" },
      { ok: false, what: "Sources-and-uses reconciled — $747.5M → $850M", note: "G-06" },
      { ok: false, what: "SPV formed & rails named — BD · TA · ATS", note: "G-04 · G-05" },
      { ok: false, what: "Returns stress-tested at the cited per-cap benchmark", note: "X-08" },
    ] },
  ];

  // ── section bodies ─────────────────────────────────────────────────
  function ThesisSection() {
    return (
      <div>
        <div style={{ ...card({ borderColor: "var(--warn)", borderLeftWidth: 3, background: "var(--bg-2)", padding: "18px 20px" }), display: "grid", gridTemplateColumns: "1fr 240px", gap: 22, alignItems: "center", marginBottom: "var(--s-5)" }}>
          <div>
            {lrMono("platform verdict · generated from " + L.KB.length + " sourced facts", { display: "block", marginBottom: 8 })}
            <p style={{ margin: "0 0 7px", fontFamily: "var(--ui-display)", fontWeight: 700, fontSize: "var(--fs-lg)", color: "var(--ink)", lineHeight: 1.25 }}>{LD.verdict.headline}</p>
            <p style={{ margin: 0, fontSize: "var(--fs-sm)", color: "var(--ink-2)", lineHeight: 1.6 }}>{LD.verdict.body}</p>
          </div>
          <div>
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 5 }}>
              {lrMono("confidence as staged")}
              <span style={{ fontFamily: "var(--mono)", fontSize: "13px", fontWeight: 700, color: "var(--warn)" }}>{LD.verdict.confidence}<span style={{ fontSize: "9px", color: "var(--ink-4)" }}> / 100</span></span>
            </div>
            <div style={{ height: 8, background: "var(--bg-3)", borderRadius: 4, overflow: "hidden" }}>
              <div style={{ width: LD.verdict.confidence + "%", height: "100%", background: "var(--warn)", borderRadius: 4 }}></div>
            </div>
            <div style={{ display: "flex", gap: 5, flexWrap: "wrap", marginTop: 10 }}>
              {[["facts", String(L.KB.length)], ["url-verified", String(L.verifiedCount)], ["contradictions", "6"], ["gaps", "7"]].map(([k, vv]) => (
                <span key={k} style={{ display: "inline-flex", alignItems: "baseline", gap: 5, border: "1px solid var(--rule-hard)", borderRadius: "var(--r-1)", padding: "2px 7px", background: "var(--bg)" }}>
                  {lrMono(k)}<span style={{ fontFamily: "var(--mono)", fontSize: "10px", fontWeight: 600, color: "var(--ink)" }}>{vv}</span>
                </span>
              ))}
            </div>
          </div>
        </div>

        <window.SectionHead sub="the case for the deal — and the counterweight">Investment Thesis</window.SectionHead>
        <div style={card()}>
          <p style={{ margin: "0 0 12px", fontSize: "var(--fs-md)", fontWeight: 600, color: "var(--ink)", lineHeight: 1.45 }}>{LD.thesis.headline}</p>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0 28px" }}>
            {LD.thesis.pillars.map((p, i) => (
              <div key={p.t} style={{ display: "grid", gridTemplateColumns: "104px 1fr", gap: 10, borderTop: i < 2 ? "none" : "1px solid var(--rule-soft)", padding: "9px 0" }}>
                <span style={{ fontFamily: "var(--mono)", fontSize: "9px", fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: "var(--accent-lo)" }}>{p.t}</span>
                <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.55 }}>{p.d}</span>
              </div>
            ))}
          </div>
          <p style={{ margin: "12px 0 0", paddingTop: 12, borderTop: "1px solid var(--rule-soft)", fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.55, fontStyle: "italic" }}>{LD.thesis.counterweight}</p>
        </div>

        <window.SectionHead sub="material findings · classified — the full fact ledger lives in the Knowledge Base">What We Found</window.SectionHead>
        <div style={card()}>
          <div style={{ display: "flex", flexDirection: "column" }}>
            {LD.findings.map((f, i) => (
              <div key={i} style={{ display: "grid", gridTemplateColumns: "auto 1fr", gap: 10, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "8px 0" }}>
                <ClassBadge cls={f.cls} />
                <span style={{ fontSize: "var(--fs-sm)", color: "var(--ink-2)", lineHeight: 1.55 }}>{f.text}</span>
              </div>
            ))}
          </div>
          <div style={{ borderTop: "1px solid var(--rule-soft)", marginTop: 8, paddingTop: 10, display: "flex", gap: 8, flexWrap: "wrap", alignItems: "center" }}>
            {lrMono("fact ledger")}
            {Object.entries(classCounts()).map(([k, n]) => n > 0 && (
              <span key={k} style={{ display: "inline-flex", alignItems: "center", gap: 4 }}>
                <ClassBadge cls={k} short /><span style={{ fontFamily: "var(--mono)", fontSize: "10px", fontWeight: 600, color: "var(--ink-2)" }}>{n}</span>
              </span>
            ))}
          </div>
        </div>

        <window.SectionHead sub="what genuinely works in the package">Strengths</window.SectionHead>
        <div style={card()}>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0 28px" }}>
            {LD.strengths.map((s, i) => (
              <div key={i} style={{ display: "grid", gridTemplateColumns: "10px 1fr", gap: 8, borderTop: i < 2 ? "none" : "1px solid var(--rule-soft)", padding: "8px 0" }}>
                <span style={{ color: "var(--ok)", fontSize: 10, lineHeight: 1.8 }}>▪</span>
                <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.55 }}>{s}</span>
              </div>
            ))}
          </div>
        </div>

        <window.SectionHead sub="the downside, rated — six open items">Risk Register</window.SectionHead>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 12 }}>
          {LD.risks.map((r) => (
            <div key={r.id} style={{ border: "1px solid var(--rule-soft)", borderRadius: "var(--r-2)", padding: "11px 13px", borderLeft: "3px solid " + SEV_COLOR[r.sev], background: "var(--bg)" }}>
              <div style={{ display: "flex", alignItems: "baseline", gap: 8, flexWrap: "wrap", marginBottom: 5 }}>
                <span style={{ fontFamily: "var(--mono)", fontSize: "8.5px", color: "var(--ink-4)" }}>{r.id}</span>
                <span style={{ fontFamily: "var(--ui-display)", fontWeight: 600, fontSize: "var(--fs-sm)", color: "var(--ink)" }}>{r.title}</span>
                <span style={{ marginLeft: "auto", display: "inline-flex", gap: 6, alignItems: "center" }}>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "8px", letterSpacing: "0.08em", textTransform: "uppercase", color: "var(--ink-4)", border: "1px solid var(--rule-hard)", borderRadius: "999px", padding: "1px 7px" }}>{r.cat}</span>
                  <window.Pill tone={sevTone(r.sev)}>{r.sev}</window.Pill>
                </span>
              </div>
              <p style={{ margin: "0 0 6px", fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{r.desc}</p>
              <div style={{ display: "grid", gridTemplateColumns: "auto 1fr", gap: 8, alignItems: "baseline" }}>
                {lrMono("mitigation")}<span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.5 }}>{r.mitig}</span>
              </div>
            </div>
          ))}
        </div>
      </div>
    );
  }

  // framing-banner helper shared by the class sections
  const LB = (tone, label, text) => (
    <div style={{ ...card({ padding: "10px 14px", borderColor: tone === "warn" ? "var(--warn)" : "var(--rule-hard)", background: "var(--bg-2)", borderLeftWidth: 3 }), display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap", marginBottom: 14 }}>
      <window.Pill tone={tone}>{label}</window.Pill>
      <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5, flex: 1, minWidth: 240 }}>{text}</span>
    </div>
  );
  const LPillars = (pillars) => (
    <div style={card()}>
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0 28px" }}>
        {pillars.map((p, i) => (
          <div key={p.t} style={{ display: "grid", gridTemplateColumns: "92px 1fr", gap: 10, borderTop: i < 2 ? "none" : "1px solid var(--rule-soft)", padding: "9px 0" }}>
            <span style={{ fontFamily: "var(--mono)", fontSize: "9px", fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: "var(--accent-lo)" }}>{p.t}</span>
            <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.55 }}>{p.d}</span>
          </div>
        ))}
      </div>
    </div>
  );

  function SubjectSection() {
    const proof = [
      ["2024", "Orlando 75.3M visitors (+1.8% YoY) — #1 US destination", "V"],
      ["May 2025", "Universal Epic Universe opened on I-Drive — corridor proven", "V"],
      ["FY2024", "United Parks 40.6% adj. EBITDA margin — peer benchmark", "V"],
      ["2019", "Lionsgate park operating in Hengqin, China; Orlando rights unverified", "U"],
    ];
    const scope = [
      ["Theme park", "core attraction — coaster ‘topping 500 ft’ (builder in Ch.11 · G-03)"],
      ["450-key hotel", "notes cite a 350-room approval — 28% gap (X-04)"],
      ["13-acre site", "six assembled parcels — Skyplex assembly, listed for sale (G-01)"],
    ];
    return (
      <div>
        <window.SectionHead sub="site · program · the build scope funded by the raise">Site &amp; Program</window.SectionHead>
        {LB("warn", "pre-development", "Site assembled, nothing built — the program is a plan. Land control and the coaster vendor are open (G-01 · G-03).")}
        {LPillars(LD.subject.pillars.slice(0, 2))}
        <div style={{ ...card(), marginTop: 14 }}>
          {lrMono("build scope funded by the raise", { display: "block", marginBottom: 8 })}
          {scope.map(([k, v], i) => (
            <div key={k} style={{ display: "grid", gridTemplateColumns: "130px 1fr", gap: 10, borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "7px 0" }}>
              <span style={{ fontSize: "var(--fs-sm)", color: "var(--ink)", fontWeight: 500 }}>{k}</span>
              <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.5 }}>{v}</span>
            </div>
          ))}
          <p style={{ margin: "8px 0 0", fontFamily: "var(--mono)", fontSize: "9px", letterSpacing: "0.06em", color: "var(--ink-4)" }}>→ Cost build-up &amp; phasing live under Underwriting · Cost &amp; Phasing.</p>
        </div>
        <div style={{ marginTop: 24 }}>
          <window.SectionHead sub="brand × demand — the revenue premise, and what is verified vs unverified">Brand &amp; Demand</window.SectionHead>
          {LB("warn", "demand verified · brand unverified", "Orlando demand is URL-verified; the Lionsgate Orlando license is not evidenced (G-02).")}
          {LPillars(LD.subject.pillars.slice(2, 4))}
          <div style={{ ...card(), marginTop: 14 }}>
            {lrMono("proof milestones · dated events that make the premise real", { display: "block", marginBottom: 8 })}
            {proof.map(([when, what, c], i) => (
              <div key={when} style={{ display: "grid", gridTemplateColumns: "68px 1fr auto", gap: 10, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "7px 0" }}>
                <span style={{ fontFamily: "var(--mono)", fontSize: "9px", fontWeight: 600, color: "var(--accent-lo)" }}>{when}</span>
                <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{what}</span>
                <ClassBadge cls={c} short />
              </div>
            ))}
          </div>
        </div>
      </div>
    );
  }

  function InstrumentSection() {
    const TERMS = [
      ["headline raise", "$850M", "staging recommended"],
      ["equity tranche", "~$299M", "tokenized · 40%"],
      ["senior debt", "$448.4M", "60% LTC · 7.2% all-in"],
      ["development cost", "$747.5M", "$497.5M + $250M land"],
      ["cost-vs-raise gap", "~$102.5M", "unbridged (X-09 · G-06)"],
      ["issuer SPV", "undisclosed", "series structure TBD (G-04)"],
    ];
    const exemptions = [
      { id: "EX-506c", reg: "Reg D · Rule 506(c)", offering: "US accredited tranche", rows: [["audience", "US accredited only"], ["solicitation", "general solicitation permitted"], ["verification", "‘strict KYC/AML’ — no provider named"], ["filing", "Form D ≤15 days after first sale"]] },
      { id: "EX-regS", reg: "Reg S", offering: "Offshore tranche", rows: [["audience", "non-US, non-resident"], ["solicitation", "offshore — no directed US selling"], ["compliance", "40-day distribution-compliance period"], ["filing", "no SEC filing (offshore)"]] },
    ];
    const instrument = [
      ["Form", "Tokenized equity — issuer SPV (undisclosed · G-04)"],
      ["Lockups", "US 12-mo / Reg S 40-day — unspecified in deck"],
      ["Transfer", "Smart-contract enforced"],
      ["Secondary", "‘Continuous’ asserted — no ATS / venue named (Q)"],
      ["Counsel", "Anderson Kill P.C. (Hon. Louis L. Nock, Ret.)"],
    ];
    const lifecycle = [
      ["T0", "Form issuer SPV", "series structure for the ~$299M tranche (G-04)"],
      ["T1", "KYC / accreditation", "506(c) verification + Reg S eligibility before any sale"],
      ["T2", "Issue", "Reg D + Reg S tranches on one instrument"],
      ["T3", "Secondary", "gated on a named ATS / transfer agent (G-05)"],
    ];
    return (
      <div>
        <window.SectionHead sub="the raise as proposed — capital stack, terms and the open credibility item">Capital Stack &amp; Terms</window.SectionHead>
        {LB("neutral", "the raise as proposed", "$850M headline; the tokenized equity tranche is ~$299M (40%) of a $747.5M development stack.")}
        <div style={{ display: "grid", gridTemplateColumns: "repeat(6, 1fr)", gap: 1, background: "var(--rule)", border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", marginBottom: 14 }}>
          {TERMS.map(([k, v, sub]) => (
            <div key={k} style={{ background: "var(--bg)", padding: "11px 13px" }}>
              {lrMono(k, { display: "block", marginBottom: 4 })}
              <div style={{ fontFamily: "var(--ui-display)", fontWeight: 700, fontSize: "17px", letterSpacing: "-0.01em", color: "var(--ink)" }}>{v}</div>
              <div style={{ fontSize: "10px", color: "var(--ink-4)", marginTop: 3, lineHeight: 1.35 }}>{sub}</div>
            </div>
          ))}
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
          <div style={card()}>
            {lrMono("capital stack · as proposed", { display: "block", marginBottom: 8 })}
            {STACK.map((h, i) => (
              <div key={h.holder} style={{ display: "grid", gridTemplateColumns: "1fr 48px 72px", gap: 10, alignItems: "center", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "8px 0" }}>
                <div>
                  <div style={{ fontSize: "var(--fs-xs)", color: "var(--ink)", fontWeight: 500 }}>{h.holder}</div>
                  <div style={{ fontSize: "10px", color: "var(--ink-4)" }}>{h.role}</div>
                </div>
                <span style={{ fontFamily: "var(--mono)", fontSize: "9px", color: "var(--ink-3)", textAlign: "center", border: "1px solid var(--rule-hard)", borderRadius: "var(--r-1)", padding: "1px 0" }}>{h.pct}</span>
                <span style={{ fontFamily: "var(--mono)", fontSize: "11px", fontWeight: 600, color: "var(--accent-lo)", textAlign: "right" }}>{h.amt}</span>
              </div>
            ))}
          </div>
          <div style={card({ borderColor: "var(--warn)", borderLeftWidth: 3 })}>
            {lrMono("sources-and-uses · the open credibility item (X-09)", { display: "block", marginBottom: 8, color: "var(--warn)" })}
            {RECON.map(([amt, what, c], i) => (
              <div key={amt} style={{ display: "grid", gridTemplateColumns: "64px 1fr auto", gap: 10, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "7px 0" }}>
                <span style={{ fontFamily: "var(--mono)", fontSize: "10.5px", fontWeight: 700, color: "var(--ink)" }}>{amt}</span>
                <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{what}</span>
                <ClassBadge cls={c} short />
              </div>
            ))}
            <p style={{ margin: "8px 0 0", fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.55 }}>Cost methods reconcile internally; the missing bridge from cost to raise is ~$102.5M of interest, issuance and reserves (G-06).</p>
          </div>
        </div>
        <div style={{ marginTop: 24 }}>
          <window.SectionHead sub="one instrument under two exemptions — and the rails still unnamed">Structure &amp; Rails</window.SectionHead>
          {LB("neutral", "one instrument · two exemptions", "Reg D 506(c) (US accredited) + Reg S (offshore) around the ~$299M tokenized equity tranche.")}
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14, marginBottom: 14 }}>
            {exemptions.map((e) => (
              <div key={e.id} style={{ border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", background: "var(--bg)" }}>
                <div style={{ background: "var(--bg-dark)", color: "#fff", padding: "11px 15px", display: "flex", alignItems: "baseline", gap: 10, flexWrap: "wrap" }}>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "9px", letterSpacing: "0.1em", color: "var(--accent-hi)" }}>{e.id}</span>
                  <span style={{ fontFamily: "var(--ui-display)", fontWeight: 600, fontSize: "var(--fs-sm)" }}>{e.reg}</span>
                  <span style={{ marginLeft: "auto", fontFamily: "var(--mono)", fontSize: "8.5px", letterSpacing: "0.1em", textTransform: "uppercase", color: "#aab4d4" }}>{e.offering}</span>
                </div>
                <div style={{ padding: "4px 15px 10px" }}>
                  {e.rows.map(([k, v]) => (
                    <div key={k} style={{ display: "grid", gridTemplateColumns: "96px 1fr", gap: 10, borderTop: "1px solid var(--rule-soft)", padding: "7px 0" }}>
                      {lrMono(k)}<span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{v}</span>
                    </div>
                  ))}
                </div>
              </div>
            ))}
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
            <div style={card()}>
              {lrMono("the instrument · tokenized equity", { display: "block", marginBottom: 6 })}
              {instrument.map(([k, v], i) => (
                <div key={k} style={{ display: "grid", gridTemplateColumns: "92px 1fr", gap: 10, borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "7px 0" }}>
                  {lrMono(k)}<span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{v}</span>
                </div>
              ))}
            </div>
            <div style={card({ borderLeft: "3px solid var(--warn)" })}>
              {lrMono("liquidity discipline", { display: "block", marginBottom: 5, color: "var(--warn)" })}
              <p style={{ margin: "0 0 10px", fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.6 }}>A ‘continuous secondary market’ is asserted with no broker-dealer, transfer agent or ATS named (G-05). No venue, no claim.</p>
              {lrMono("issuance lifecycle · each gated", { display: "block", marginBottom: 4 })}
              {lifecycle.map(([n, t, b], i) => (
                <div key={n} style={{ display: "grid", gridTemplateColumns: "26px 1fr", gap: 8, borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "6px 0" }}>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "9px", fontWeight: 700, color: "var(--accent-lo)" }}>{n}</span>
                  <div>
                    <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink)", fontWeight: 500 }}>{t}</span>
                    <div style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.45 }}>{b}</div>
                  </div>
                </div>
              ))}
            </div>
          </div>
        </div>
      </div>
    );
  }

  function UnderwritingSection() {
    const costBuild = [
      ["$747.5M", "development estimate = $497.5M non-land + $250M carried land", "P"],
      ["$551.5M", "cost benchmark = $497.5M non-land + $54M land parcel", "P"],
      ["$497.5M", "non-land construction budget — shared by both methods", "P"],
    ];
    const uses = [["Non-land construction", 67, "$497.5M"], ["Carried land basis", 33, "$250M"]];
    const funnel = [["Orlando metro", "75.3M", "2024 visitors — #1 US destination", 100], ["I-Drive corridor", "16.0M", "district visitors (2024)", 38], ["LWR stabilized", "2.30M", "base-case attendance (Yr3 2031)", 12]];
    const stabilized = [["attendance", "2.30M", "base · Yr3 2031"], ["revenue", "$381.0M", "stabilized"], ["EBITDA", "$124.6M", "32.7% margin"], ["yield on cost", "22.6%", "stabilized"]];
    return (
      <div>
        <window.SectionHead sub="cost build-up · use of proceeds · method reconciliation">Cost &amp; Phasing</window.SectionHead>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
          <div style={card()}>
            {lrMono("cost build-up · by method", { display: "block", marginBottom: 8 })}
            {costBuild.map(([amt, what, c], i) => (
              <div key={amt} style={{ display: "grid", gridTemplateColumns: "72px 1fr auto", gap: 10, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "7px 0" }}>
                <span style={{ fontFamily: "var(--mono)", fontSize: "10.5px", fontWeight: 700, color: "var(--ink)" }}>{amt}</span>
                <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{what}</span>
                <ClassBadge cls={c} short />
              </div>
            ))}
            <p style={{ margin: "8px 0 0", fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.5 }}>Method spread ($551.5M / $594.9M / $747.5M) reflects different bases — not a contradiction; the cost→raise bridge is (X-09).</p>
          </div>
          <div style={card()}>
            {lrMono("use of proceeds · to the $747.5M estimate", { display: "block", marginBottom: 10 })}
            {uses.map(([k, w, amt]) => (
              <div key={k} style={{ padding: "6px 0" }}>
                <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", gap: 8 }}>
                  <span style={{ fontSize: "var(--fs-sm)", color: "var(--ink)", fontWeight: 500 }}>{k}</span>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "10.5px", fontWeight: 600, color: "var(--accent-lo)" }}>{w}% · {amt}</span>
                </div>
                <div style={{ height: 6, background: "var(--bg-3)", borderRadius: 3, overflow: "hidden", marginTop: 5 }}><div style={{ width: w + "%", height: "100%", background: "var(--accent)", borderRadius: 3 }}></div></div>
              </div>
            ))}
          </div>
        </div>
        <div style={{ marginTop: 24 }}>
          <window.SectionHead sub="attendance × per-cap — the revenue line, against the cited benchmark">Revenue Drivers</window.SectionHead>
          {LB("neutral", "hypothesis · model targets", "Attendance × per-cap is the revenue line; model per-caps run ~70% above the deck’s own cited benchmark (X-08).")}
          <div style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 14 }}>
            <div style={card()}>
              {lrMono("demand funnel · metro → corridor → park", { display: "block", marginBottom: 10 })}
              {funnel.map(([k, v, note, w], i) => (
                <div key={k} style={{ borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "9px 0" }}>
                  <div style={{ display: "flex", alignItems: "baseline", gap: 8, marginBottom: 5 }}>
                    <span style={{ fontFamily: "var(--ui-display)", fontWeight: 600, fontSize: "var(--fs-sm)", color: "var(--ink)" }}>{k}</span>
                    <span style={{ marginLeft: "auto", fontFamily: "var(--mono)", fontSize: "12px", fontWeight: 700, color: "var(--accent-lo)" }}>{v}</span>
                  </div>
                  <div style={{ height: 8, background: "var(--bg-3)", borderRadius: 4, overflow: "hidden" }}><div style={{ width: w + "%", height: "100%", background: "var(--accent)", opacity: 0.4 + i * 0.25, borderRadius: 4 }}></div></div>
                  <div style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)", marginTop: 4 }}>{note}</div>
                </div>
              ))}
            </div>
            <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
              <div style={card({ borderLeft: "3px solid var(--warn)" })}>
                {lrMono("per-caps vs cited benchmark (X-08)", { display: "block", marginBottom: 8, color: "var(--warn)" })}
                {[["Model", "$84 / $46", "admission / in-park"], ["Benchmark", "$43.61 / $36.46", "United Parks FY24"], ["Premium", "~70%", "flagged — justify or revert"]].map(([k, v, n], i) => (
                  <div key={k} style={{ display: "grid", gridTemplateColumns: "84px 110px 1fr", gap: 8, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "6px 0" }}>
                    <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink)", fontWeight: 500 }}>{k}</span>
                    <span style={{ fontFamily: "var(--mono)", fontSize: "10.5px", fontWeight: 600, color: "var(--ink-2)" }}>{v}</span>
                    <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)" }}>{n}</span>
                  </div>
                ))}
              </div>
              <div style={card()}>
                {lrMono("stabilized targets · base · Yr3 2031", { display: "block", marginBottom: 8 })}
                {stabilized.map(([k, v, n], i) => (
                  <div key={k} style={{ display: "grid", gridTemplateColumns: "96px 84px 1fr", gap: 8, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "6px 0" }}>
                    {lrMono(k)}<span style={{ fontFamily: "var(--mono)", fontSize: "10.5px", fontWeight: 600, color: "var(--accent-lo)" }}>{v}</span>
                    <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)" }}>{n}</span>
                  </div>
                ))}
              </div>
            </div>
          </div>
        </div>
        <div style={{ marginTop: 24 }}>
          <window.SectionHead sub="the economics that drive the decision — base case and the band around it">Returns &amp; Scenarios</window.SectionHead>
          {LB("neutral", "hypothesis · sponsor projections", "The 34.7% levered IRR rests on the per-cap premium (X-08) and a 12.0x exit multiple (X-06).")}
          <MetricPallet items={RETURNS} cols={5} mb={14} />
          <div style={{ ...card({ borderLeft: "3px solid var(--warn)" }), marginBottom: 14 }}>
            {lrMono("valuation spread · unreconciled (X-06)", { display: "block", marginBottom: 8, color: "var(--warn)" })}
            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: "0 22px" }}>
              {VAL.map(([amt, what]) => (
                <div key={amt} style={{ display: "flex", flexDirection: "column", gap: 3 }}>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "12px", fontWeight: 700, color: "var(--ink)" }}>{amt}</span>
                  <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{what}</span>
                </div>
              ))}
            </div>
            <p style={{ margin: "10px 0 0", paddingTop: 10, borderTop: "1px solid var(--rule-soft)", fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>Outputs span $0.7B–$1.5B by method; normalizing per-caps or the exit multiple compresses the IRR materially.</p>
          </div>
          <Grid cols="1.4fr 1fr 1fr 1fr" headers={["Scenario band · ±15% attendance", "Downside", "Base", "Upside"]} mb={0}>
            {SCEN.map(([a, d, b, u]) => (
              <React.Fragment key={a}>
                <div style={cell("var(--ink)", { fontWeight: 500, fontSize: "var(--fs-sm)" })}>{a}</div>
                <div style={cell("var(--err)", { fontFamily: "var(--mono)", fontSize: "10px" })}>{d}</div>
                <div style={cell("var(--ink)", { fontFamily: "var(--mono)", fontSize: "10px", fontWeight: 600 })}>{b}</div>
                <div style={cell("var(--ok)", { fontFamily: "var(--mono)", fontSize: "10px" })}>{u}</div>
              </React.Fragment>
            ))}
          </Grid>
        </div>
      </div>
    );
  }

  function DiligenceSection() {
    return (
      <div>
        <window.SectionHead sub="12 material claims cross-checked against public sources (Jun 2026) — and where statements disagree">Verification &amp; Contradictions</window.SectionHead>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 1, background: "var(--rule)", border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", marginBottom: 14 }}>
          {VERIFY_MIX.map(([cls, n, note]) => (
            <div key={cls} style={{ background: "var(--bg)", padding: "12px 14px" }}>
              <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: 6 }}>
                <ClassBadge cls={cls} /><span style={{ fontFamily: "var(--ui-display)", fontWeight: 700, fontSize: "18px", color: "var(--ink)" }}>{n}</span>
              </div>
              <div style={{ fontSize: "10px", color: "var(--ink-4)", marginTop: 5, lineHeight: 1.45 }}>{note}</div>
            </div>
          ))}
        </div>
        <Grid cols="52px 1fr 1fr 1.1fr 64px 1fr" headers={["ID", "Source A", "Source B", "Conflict", "Sev", "Resolution"]} mb={18}>
          {CONTRA.map(([id, a, b, conflict, sev, fix]) => (
            <React.Fragment key={id}>
              <div style={cell("var(--ink-4)", { fontFamily: "var(--mono)", fontSize: "9px" })}>{id}</div>
              <div style={cell()}>{a}</div>
              <div style={cell()}>{b}</div>
              <div style={cell("var(--ink)", { fontWeight: 500 })}>{conflict}</div>
              <div style={{ background: "var(--bg)", padding: "9px 12px" }}><window.Pill tone={sevTone(sev)}>{sev}</window.Pill></div>
              <div style={cell("var(--ink-3)")}>{fix}</div>
            </React.Fragment>
          ))}
        </Grid>

        <window.SectionHead sub="what must be evidenced — every gap names the document that closes it, and by when">Open Evidence Gaps</window.SectionHead>
        <Grid cols="56px 1.1fr 60px 1.4fr 1.4fr 1fr" headers={["ID", "Gap", "Sev", "Where it stands today", "What closes it", "Due"]} mb={0}>
          {GAPS.map((g) => (
            <React.Fragment key={g.id}>
              <div style={cell("var(--ink-4)", { fontFamily: "var(--mono)", fontSize: "9px" })}>{g.id}</div>
              <div style={cell("var(--ink)", { fontWeight: 500, fontSize: "var(--fs-sm)" })}>{g.gap}</div>
              <div style={{ background: "var(--bg)", padding: "9px 12px" }}><window.Pill tone={sevTone(g.sev)}>{g.sev}</window.Pill></div>
              <div style={cell("var(--ink-3)")}>{g.today}</div>
              <div style={cell()}>{g.closes}</div>
              <div style={cell("var(--ink-3)", { fontFamily: "var(--mono)", fontSize: "9px" })}>{g.due}</div>
            </React.Fragment>
          ))}
        </Grid>
      </div>
    );
  }

  function ReadinessSection() {
    return (
      <div>
        <window.SectionHead sub="two paths · go / no-go — gates recompute as evidence lands">Readiness</window.SectionHead>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 14 }}>
          {PATHS.map((p) => {
            const done = p.items.filter((i) => i.ok).length;
            return (
              <div key={p.path} style={{ border: "1px solid var(--rule-hard)", borderRadius: "var(--r-3)", overflow: "hidden", background: "var(--bg)" }}>
                <div style={{ background: "var(--bg-dark)", color: "#fff", padding: "11px 15px", display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" }}>
                  <span style={{ fontFamily: "var(--ui-display)", fontWeight: 600, fontSize: "var(--fs-sm)" }}>{p.path}</span>
                  <span style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: 8 }}>
                    <span style={{ fontFamily: "var(--mono)", fontSize: "10px", color: "var(--accent-hi)" }}>{done}/{p.items.length} gates</span>
                    <window.Pill tone={p.ok ? "ok" : "warn"}>{p.verdict}</window.Pill>
                  </span>
                </div>
                <div style={{ padding: "10px 15px" }}>
                  <div style={{ display: "flex", gap: 3, marginBottom: 10 }}>
                    {p.items.map((it, i) => (<div key={i} title={it.what} style={{ flex: 1, height: 6, borderRadius: 3, background: it.ok ? "var(--ok)" : "var(--bg-3)" }}></div>))}
                  </div>
                  {p.items.map((it, i) => (
                    <div key={i} style={{ display: "grid", gridTemplateColumns: "16px 1fr auto", gap: 8, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "6px 0" }}>
                      <span style={{ color: it.ok ? "var(--ok)" : "var(--ink-5)", fontSize: "11px" }}>{it.ok ? "●" : "○"}</span>
                      <span style={{ fontSize: "var(--fs-xs)", color: it.ok ? "var(--ink-2)" : "var(--ink)", fontWeight: it.ok ? 400 : 500 }}>{it.what}</span>
                      <span style={{ fontFamily: "var(--mono)", fontSize: "8.5px", color: "var(--ink-4)", whiteSpace: "nowrap" }}>{it.note}</span>
                    </div>
                  ))}
                  <p style={{ margin: "8px 0 0", fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.5 }}>{p.note}</p>
                </div>
              </div>
            );
          })}
        </div>

        <window.SectionHead sub="ranked · every action gated on the evidence above">Recommended Actions</window.SectionHead>
        <Grid cols="36px 1.1fr 1.5fr 64px" headers={["#", "Recommended action", "Rationale (evidence)", "Priority"]} mb={0}>
          {ACTIONS.map(([n, action, rationale, pri]) => (
            <React.Fragment key={n}>
              <div style={cell("var(--ink-4)", { fontFamily: "var(--mono)", fontWeight: 600 })}>{n}</div>
              <div style={cell("var(--ink)", { fontWeight: 500, fontSize: "var(--fs-sm)" })}>{action}</div>
              <div style={cell("var(--ink-3)")}>{rationale}</div>
              <div style={{ background: "var(--bg)", padding: "9px 12px" }}><window.Pill tone={PRI_TONE[pri]}>{pri}</window.Pill></div>
            </React.Fragment>
          ))}
        </Grid>
      </div>
    );
  }

  function SourcesSection({ go, standalone }) {
    const SRC = L.SRC;
    const srcIds = Object.keys(SRC);
    const KIND_TONE = { web: "ok", doc: "neutral" };
    const KIND_LABEL = { web: "research", doc: "document" };
    const verified = L.KB.filter((f) => f.cls === "V");
    // how many distinct facts trace to each source
    const usage = {}; L.KB.forEach((f) => { usage[f.source] = (usage[f.source] || 0) + 1; });
    return (
      <div>
        <window.SectionHead sub="provenance — every fact cites exactly one source; web sources are external research citations">Sources</window.SectionHead>
        <p style={{ margin: "0 0 var(--s-5)", fontSize: "var(--fs-sm)", color: "var(--ink-2)", lineHeight: 1.6 }}>
          This brief is generated from {L.KB.length} classified facts across {srcIds.length} sources, each fact citing exactly one source. {verified.length} facts are cross-checked against the external research citations below; the rest trace to the SAXCAP pitch deck and embedded financial model.
        </p>

        <window.SectionHead sub={srcIds.length + " sources · " + srcIds.filter((id) => SRC[id].kind === "web").length + " external research citations"}>Citation registry</window.SectionHead>
        <Grid cols="48px 1.6fr 76px 1.5fr 44px" headers={["ref", "Source", "Type", "Citation", "Facts"]} mb={"var(--s-5)"}>
          {srcIds.map((id) => {
            const s = SRC[id];
            return (
              <React.Fragment key={id}>
                <div style={cell("var(--ink-4)", { fontFamily: "var(--mono)", fontWeight: 600 })}>{id}</div>
                <div style={cell("var(--ink)", { fontWeight: 500, fontSize: "var(--fs-sm)" })}>{s.name}</div>
                <div style={{ background: "var(--bg)", padding: "9px 12px" }}><window.Pill tone={KIND_TONE[s.kind] || "neutral"}>{KIND_LABEL[s.kind] || s.kind}</window.Pill></div>
                <div style={cell("var(--ink-3)", { fontFamily: "var(--mono)", fontSize: "9px", wordBreak: "break-word" })}>
                  {s.url ? <a href={s.url} target="_blank" rel="noopener noreferrer" style={{ color: "var(--accent-lo)", textDecoration: "none" }}>{s.file} ↗</a> : s.file}
                </div>
                <div style={cell("var(--ink-4)", { fontFamily: "var(--mono)", fontWeight: 600, textAlign: "center" })}>{usage[id] || 0}</div>
              </React.Fragment>
            );
          })}
        </Grid>

        {!standalone && go && (
          <div style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap", marginTop: "var(--s-4)", ...card({ background: "var(--bg-2)", padding: "11px 14px" }) }}>
            {lrMono("open the full evidence layer")}
            {[["knowledge base", "kb"], ["knowledge graph", "graph"], ["entity registry", "entity"], ["workflow", "workflow"]].map(([label, route]) => (
              <button key={route} onClick={() => go(route)} style={{ border: "1px solid var(--accent-bd)", background: "var(--accent-bg)", color: "var(--accent-lo)", borderRadius: "var(--r-1)", padding: "4px 10px", cursor: "pointer", fontFamily: "var(--mono)", fontSize: "8.5px", letterSpacing: "0.06em", textTransform: "uppercase", whiteSpace: "nowrap" }}>{label} ↗</button>
            ))}
          </div>
        )}
        <p style={{ margin: "var(--s-4) 0 0", fontFamily: "var(--mono)", fontSize: "9px", letterSpacing: "0.06em", color: "var(--ink-4)", lineHeight: 1.7 }}>
          Classifications: V verified · P self-reported · A assumption · H hypothesis · Q questionable · U unknown.
        </p>
      </div>
    );
  }

  // class-specific section under a non-native asset class → the real
  // instantiated structure (sub-sections + card archetypes) from the
  // Report Schema, each card bound to the workflow step that fills it.
  const STEP_SHORT = { parse: "parse", extract: "extract", kb: "KB", kg: "graph", background: "background", crosscheck: "cross-check", market: "market", gaps: "gaps", compose: "compose", review: "review", publish: "publish" };
  function LensTemplate({ lens, slot }) {
    const prof = PROFILES[lens];
    const meta = prof.sections[slot];
    const SCHEMA = window.REPORT_SCHEMA;
    const cls = ((SCHEMA && SCHEMA.ASSET_CLASSES) || []).find((c) => c.id === lens);
    const sec = cls && cls.sections[slot];
    return (
      <div>
        <window.SectionHead sub={meta.sub}>{meta.label}</window.SectionHead>
        <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 14, ...card({ borderStyle: "dashed", background: "var(--bg-2)", padding: "11px 14px" }) }}>
          <window.Pill tone="neutral">{prof.glyph} {prof.name} class</window.Pill>
          <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-3)", lineHeight: 1.5, flex: 1 }}>The {prof.name}-class sections — the subject, instrument and model for this asset class, each fact sourced from the Knowledge Base.</span>
        </div>
        {sec ? sec.subs.map((sub) => (
          <div key={sub.id} style={{ ...card(), marginBottom: 12 }}>
            <div style={{ display: "flex", alignItems: "baseline", gap: 8, marginBottom: 8 }}>
              <span style={{ fontFamily: "var(--mono)", fontSize: "9px", fontWeight: 600, color: "var(--ink-4)" }}>{sub.id}</span>
              <span style={{ fontFamily: "var(--ui-display)", fontWeight: 600, fontSize: "var(--fs-sm)", color: "var(--ink)" }}>{sub.label}</span>
            </div>
            <div style={{ display: "flex", flexDirection: "column" }}>
              {sub.cards.map(([type, def, step], i) => (
                <div key={i} style={{ display: "grid", gridTemplateColumns: "84px 1fr 104px", gap: 10, alignItems: "baseline", borderTop: i ? "1px solid var(--rule-soft)" : "none", padding: "6px 0" }}>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "8.5px", letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--accent-lo)", border: "1px solid var(--accent-bd)", background: "var(--accent-bg)", borderRadius: "var(--r-1)", padding: "1px 6px", textAlign: "center" }}>{type}</span>
                  <span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-2)", lineHeight: 1.5 }}>{def}</span>
                  <span style={{ fontFamily: "var(--mono)", fontSize: "8.5px", color: "var(--ink-4)", whiteSpace: "nowrap" }}>← {STEP_SHORT[step] || step}</span>
                </div>
              ))}
            </div>
          </div>
        )) : <div style={card({ borderStyle: "dashed", background: "var(--bg-2)" })}><span style={{ fontSize: "var(--fs-xs)", color: "var(--ink-4)" }}>Report Schema not loaded.</span></div>}
      </div>
    );
  }

  // ── shell ──────────────────────────────────────────────────────────
  function LionsgateReport({ proj, tenant, go, standalone }) {
    // asset class is a fixed PROJECT property (set by window.AssetClass), not a
    // free toggle — the report frames itself to the project's class, period.
    const lens = window.AssetClass ? window.AssetClass.of(proj) : "realEstate";
    const [section, setSection] = useState("thesis");
    const prof = PROFILES[lens];
    const isNative = lens === "realEstate"; // Lionsgate is the populated RE instance
    const classSlot = (s) => s === "subject" || s === "instrument" || s === "underwriting";

    let body;
    if (section === "thesis") body = <ThesisSection />;
    else if (section === "diligence") body = <DiligenceSection />;
    else if (section === "readiness") body = <ReadinessSection />;
    else if (section === "sources") body = <SourcesSection go={go} standalone={standalone} />;
    else if (!isNative && classSlot(section)) body = <LensTemplate lens={lens} slot={section} />;
    else if (section === "subject") body = <SubjectSection />;
    else if (section === "instrument") body = <InstrumentSection />;
    else if (section === "underwriting") body = <UnderwritingSection />;

    return (
      <div>
        <window.PageHead eyebrow={tenant.name + " · " + proj.name + " · v1"} title="Lionsgate World Resort — Intelligence Layer"
          sub="One executive shell across every security & tokenizable asset class. The asset class sets the class-specific framing; the section selector moves across the seven canonical slots.">
        </window.PageHead>

        {/* ── header selectors ───────────────────────────────────────── */}
        <div style={{ position: "sticky", top: 0, zIndex: 6, background: "var(--bg-2)", borderBottom: "1px solid var(--rule)", margin: "0 0 var(--s-5)", paddingBottom: 12 }}>
          {/* section selector */}
          <div style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }}>
            {lrMono("section", { flex: "0 0 auto" })}
            <div style={{ display: "flex", gap: 6, flexWrap: "wrap" }}>
              {SLOTS.map((slot) => {
                const meta = sectionFor(lens, slot);
                const on = section === slot;
                const universal = !!UNIVERSAL[slot];
                return (
                  <button key={slot} onClick={() => setSection(slot)} title={meta.sub} style={{ display: "inline-flex", alignItems: "center", gap: 7, border: "1px solid " + (on ? "var(--accent-bd)" : "var(--rule-hard)"), background: on ? "var(--accent-bg)" : "var(--bg)", color: on ? "var(--accent-lo)" : "var(--ink-3)", borderRadius: "999px", padding: "5px 13px", cursor: "pointer", fontFamily: "var(--ui)", fontSize: "12px", fontWeight: 500 }}>
                    <span style={{ width: 5, height: 5, borderRadius: 999, background: universal ? "var(--ink-4)" : "var(--accent)", flex: "0 0 auto" }}></span>
                    {meta.label}
                  </button>
                );
              })}
            </div>
          </div>
          <div style={{ display: "flex", gap: 16, flexWrap: "wrap", marginTop: 9 }}>
            {[["var(--accent)", "class-specific — relabeled per asset class"], ["var(--ink-4)", "universal — identical across classes"]].map(([c, lbl]) => (
              <span key={lbl} style={{ display: "inline-flex", alignItems: "center", gap: 6, fontFamily: "var(--mono)", fontSize: "8.5px", letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--ink-4)" }}>
                <span style={{ width: 6, height: 6, borderRadius: 999, background: c }}></span>{lbl}
              </span>
            ))}
          </div>
        </div>

        {/* ── headline metrics (lens-driven) ─────────────────────────── */}
        <MetricPallet items={prof.metrics} cols={6} />

        {/* ── active section ─────────────────────────────────────────── */}
        {body}
      </div>
    );
  }

  window.LionsgateReport = LionsgateReport;

  // ── citation registry (G7) from L.SRC — facts cited + metadata ─────
  const lgUsage = {}; L.KB.forEach((f) => { lgUsage[f.source] = (lgUsage[f.source] || 0) + 1; });
  const lgRegistry = Object.entries(L.SRC).map(([id, sd]) => ({
    id, kind: sd.kind, name: sd.name, facts: lgUsage[id] || 0, origin: sd.file, url: sd.url,
    rel: sd.rel, tier: sd.tier, version: sd.version, author: sd.author, dept: sd.dept, loc: sd.loc, related: sd.related,
    uploaded: sd.uploaded, parsed: sd.parsed,
  }));

  // ── register Lionsgate's payload with the universal shell ──────────
  window.INTEL_REPORTS = window.INTEL_REPORTS || {};
  window.INTEL_REPORTS["lionsgate"] = {
    classId: "realEstate",
    version: "v2.1",
    asOf: "18 Jun 2026",
    digest: {
      prev: "v2", asOf: "18 Jun 2026", since: "deck uploaded 9 Jun 2026 · deep research 11 Jun 2026",
      items: [
        { status: "new", where: "Diligence",        ref: "G-01", text: "The Skyplex site the deck builds on was cancelled 17 Oct 2024 and the 13-acre parcel listed for sale — the land is not under control. (OBJ / ConnectCRE, 11 Jun)" },
        { status: "new", where: "Product Passport", ref: "G-02", text: "No evidence of a Lionsgate Orlando license — LEWO operates one park, in Hengqin, China; the U.S. brand premise is unverified. (public record, 11 Jun)" },
        { status: "new", where: "Underwriting",     ref: "X-08", text: "Per-cap revenue inputs ($84 / $46) run ~70% above the deck's own cited benchmark — the model's top line is overstated. (deck model vs Visit Orlando, 11 Jun)" },
      ],
    },
    graphInsights: {
      stat: [["objects", "8"], ["relationships", "8"], ["edges at risk", "2"]],
      note: "Two inbound control edges terminate at the asset (Lionsgate IP, Skyplex land) and both are unverified; the token value path downstream inherits their risk.",
      relations: [
        { from: "Lionsgate (brand/IP)", rel: "IP rights →", to: "LWR (asset)", status: "at-risk", note: "Orlando license unevidenced — LEWO operates in Hengqin only (G-02)." },
        { from: "Skyplex Owner", rel: "owns land →", to: "LWR (asset)", status: "at-risk", note: "Site cancelled 17 Oct 2024, listed for sale; JV not evidenced (G-01)." },
        { from: "SAXCAP", rel: "sponsors / issues →", to: "LWR (asset)", status: "firm", note: "Named sponsor; development family credible (Friedman, since 1960)." },
        { from: "LWR", rel: "equity 40% →", to: "Equity SPV", status: "flow", note: "~$299M tokenizable tranche — issuer SPV undisclosed (G-04)." },
        { from: "Equity SPV", rel: "issues token →", to: "Token Holders", status: "flow", note: "Reg D 506(c) + Reg S — regulated rails unnamed (G-05)." },
      ],
      chains: [
        { label: "Control", path: "Lionsgate IP + Skyplex land → LWR", status: "at-risk", note: "Both inbound edges unverified — the single point of failure." },
        { label: "Value", path: "LWR → Equity SPV → Token Holders", status: "flow", note: "The token value path — intact in form, gated on the control edges above." },
        { label: "Capital", path: "LWR → Senior Debt 60% + Equity SPV 40%", status: "firm", note: "Stack covers the $747.5M estimate; the $850M raise is unbridged (G-06)." },
      ],
      insight: "Two of eight relationships are load-bearing and unverified — the Lionsgate IP edge and the Skyplex land edge both terminate at the asset node. Until both are evidenced, the value path (SPV → holders) and the entire underwriting inherit their risk; this is why issuance is gated.",
    },
    opportunities: [
      { id: "OPP-01", title: "Category-defining branded RWA", cat: "growth",      impact: "high", conf: 50, desc: "If land control and the Lionsgate license clear, a named, narratable theme-park tokenization is a flagship Compass reference deal.", evidence: "Verified Orlando demand (75.3M visitors, V); brand premise unverified (G-02)." },
      { id: "OPP-02", title: "Epic Universe corridor tailwind", cat: "market",     impact: "med",  conf: 72, new: true, desc: "Universal's Epic Universe (opened May 2025) is independently lifting I-Drive footfall — a demand tailwind the deck doesn't even claim.", evidence: "OBJ / Attractions Mag, public record (V)." },
      { id: "OPP-03", title: "Milestone-tranched equity token", cat: "product",    impact: "med",  conf: 58, desc: "Scoping the raise to the ~$299M equity tranche, released in milestone tranches, de-risks issuance and fits the Reg D 506(c) + Reg S wrapper.", evidence: "Capital stack + exemption framework (P)." },
      { id: "OPP-04", title: "Hyatt-flagged hotel offtake",    cat: "partnership", impact: "low",  conf: 40, desc: "A branded hotel operator (Hyatt LOI referenced) could anchor cash flows and lend the program credibility if the LOI converts.", evidence: "Hyatt LOI referenced in deck; not executed (gap)." },
    ],
    pageHead: {
      title: "Lionsgate World Resort — Intelligence Layer",
      sub: "Continuous intelligence on the Lionsgate World Resort tokenization.",
    },
    metrics: PROFILES.realEstate.metrics,
    CLASS: L.CLASS,
    kbLen: L.KB.length,
    thesis: LD.thesis,
    verdict: { ...LD.verdict, pills: [["facts", String(L.KB.length)], ["url-verified", String(L.verifiedCount)], ["contradictions", String(CONTRA.length)], ["gaps", String(GAPS.length)]] },
    findings: LD.findings,
    classCounts: classCounts(),
    strengths: LD.strengths,
    asks: [
      "Executed land control — a contract or option on the 13-acre site plus the Skyplex JV agreement (G-01).",
      "A current, signed Lionsgate Orlando IP license — or the brand premium comes out of the model (G-02).",
      "One reconciled sources-and-uses bridging the $747.5M cost to the $850M raise (G-06).",
      "Token scoped to the ~$299M equity tranche via a disclosed issuer SPV, milestone-tranched (G-04).",
      "Named regulated rails — broker-dealer of record, transfer agent and ATS (G-05).",
    ],
    risks: LD.risks,
    diligence: {
      framing: { tag: "pre-development", text: "Nothing is built — the 13-acre site is listed for sale and the Skyplex JV was cancelled (Oct 2024). Brand, demand and cost figures are extracted from the deck and classified; the build itself is unverified." },
      verifyMix: VERIFY_MIX,
      verification: VERIFY,
      verifyNote: "12 material claims cross-checked against public sources (Jun 2026)",
      contradictions: CONTRA.map(([id, a, b, conflict, sev, fix]) => ({ id, a, b, conflict, sev, fix })),
      filings: FILINGS,
      gaps: GAPS,
    },
    readiness: { paths: PATHS, actions: ACTIONS },
    sources: {
      note: "This brief is generated from " + L.KB.length + " classified facts across " + Object.keys(L.SRC).length + " sources, each fact citing one source with a source-reliability score, version, a page/section locator and an upload · parse timestamp. " + L.verifiedCount + " facts are cross-checked against the external research citations below; the rest trace to the SAXCAP pitch deck and embedded financial model.",
      registry: lgRegistry,
      links: [["knowledge base", "kb"], ["knowledge graph", "graph"], ["entity registry", "entity"], ["workflow", "workflow"]],
    },
    classSections: {
      subject: () => <SubjectSection />,
      instrument: () => <InstrumentSection />,
      underwriting: () => <UnderwritingSection />,
    },
    footer: "Generated from the SAXCAP Knowledge Base. Classifications: V verified · P self-reported · A assumption · H hypothesis · Q questionable · U unknown.",
  };
})();
