Generate an interactive supply chain dashboard for the company named in the user's request. If no ticker or company is provided, ask for one before proceeding.
Before starting, read ../data-access.md for data access methods and ../design-system.md for formatting conventions. Follow the data access detection logic and design system throughout this skill.
This skill maps the upstream (supplier) and downstream (customer) relationships for a target company, quantifying financial interdependencies in both directions. The output enables an analyst to understand: Who are the critical suppliers and customers? Where is concentration risk on both sides? Which suppliers depend heavily on this company for revenue? Which customers depend on this company's products as critical inputs? How does a shock propagate both upstream (demand shock to suppliers) and downstream (supply disruption to customers)?
Output Format
The final deliverable is a single self-contained HTML file with:
- Embedded CSS and JavaScript (no external dependencies)
- Tier-grouped Canvas network visualization — columns: Tier 3 → Tier 2 → Tier 1 → Target → Customers, with connection lines. Clickable nodes open detail overlays.
- Inventory Health Overview table — for all suppliers: RM%, WIP%, FG% of total inventory shown as stacked colored bars, plus latest total inventory value
- Supplier cards grouped by tier — Tier 1 (Critical/Sole-source), Tier 2 (Major Component), Tier 3 (Specialty) with click-to-expand detail overlays
- Detail overlays for each supplier containing:
- 10-quarter financial table (Revenue, Gross Profit, Net Income, Gross Margin %)
- 10-quarter inventory breakdown table (Raw Materials, WIP, Finished Goods, Total, RM%, WIP%, FG%)
- Canvas chart: stacked bar chart of inventory composition with Gross Margin % line overlay
- Business description and relationship to target company
- Customer cards grouped by category — Channel Partners, Enterprise/B2B, End-Market Exposure — with click-to-expand detail overlays matching supplier depth
- Detail overlays for each customer containing:
- 10-quarter financial table (Revenue, Gross Profit, Net Income, Gross Margin %)
- 10-quarter inventory breakdown table (Raw Materials, WIP, Finished Goods, Total, RM%, WIP%, FG%)
- Canvas chart: stacked bar chart of inventory composition with Gross Margin % line overlay
- Business description and relationship to target company
- Upstream Shock Analysis section — narrative analysis of how a demand/supply shock to the target company ripples upstream through the supplier chain, with an impact matrix table (Revenue Impact, Margin Impact, Overall Risk per supplier)
- Downstream Shock Analysis section — narrative analysis of how a supply disruption at the target company ripples downstream through the customer chain, with an impact matrix table (Input Criticality, Switching Cost, Revenue at Risk, Overall Disruption Risk per customer)
- All financial figures hyperlinked to Daloopa source citations
- A "Download as PDF" button (uses
window.print())
DOM Safety: All JavaScript MUST use createElement() + textContent + appendChild() for DOM construction. NEVER use innerHTML, outerHTML, or any HTML-string injection methods. Use helper functions like ce(tag), ca(el, attrs), cA(parent, children) to keep code compact.
Save to reports/{TICKER}_supply-chain.html and open it with open.
RESEARCH WORKFLOW
This is a multi-phase research process. Each phase builds on the previous one. Maximize parallelism across independent API calls.
Phase 1: Target Company Identification
- Use
discover_companies with the ticker symbol to get the company_id, latest_calendar_quarter, and latest_fiscal_quarter. Note the firm name for report attribution (default: "Daloopa") — see ../data-access.md Section 4.5.
- Pull key financials for the target company:
- Use
discover_company_series with keywords: ["revenue", "cost of goods", "gross profit", "operating income", "net income", "total cost"]
- Calculate 4 quarters backward from
latest_calendar_quarter. Use get_company_fundamentals for those periods to get TTM figures.
- Note the target company's total COGS / cost of revenue (TTM) — this is the denominator for supplier % calculations.
Phase 2: Supplier Identification
Run these concurrently to build a comprehensive supplier list:
2a. Daloopa Document Search:
- Search keywords: ["supplier", "vendor", "purchase", "procurement"] across last 2-4 quarters
- Search keywords: ["supply agreement", "supply chain", "manufacturing"] across last 2-4 quarters
- Search keywords: ["sole source", "single source", "key supplier"] across last 2-4 quarters
- Search keywords: ["concentration", "significant supplier"] across last 2-4 quarters
- Search the company's 10-K specifically for supplier disclosures
2b. Web Research:
"[TICKER] [company name] key suppliers list 2025 2026" — supplier identification
"[TICKER] supply chain analysis suppliers" — analyst/industry reports
"[TICKER] 10-K supplier disclosure" — SEC filing analysis
"[company name] supply chain map" — industry supply chain maps
"[company name] supplier concentration risk" — risk analysis
"[company name] who manufactures for [company]" — manufacturing partners
"[company name] component suppliers" — component-level supply chain
2c. Industry-Specific Supplier Research:
For each industry, search for the known critical supply chain relationships:
- Tech/Hardware: semiconductor foundries (TSMC, Samsung), display (Samsung, LG, BOE), memory (Samsung, SK Hynix, Micron), sensors/cameras (Sony), glass (Corning), connectors (Amphenol), batteries (CATL, LG Energy), PCB/assembly (Foxconn/Hon Hai, Pegatron, Luxshare)
- Automotive: battery (CATL, Panasonic, LG Energy), semiconductors (Infineon, NXP, ON Semi, TI), steel (Nippon, POSCO), tires (Michelin, Bridgestone), glass (AGC, Saint-Gobain)
- Pharma: CDMOs (Lonza, Samsung Biologics, Catalent), API suppliers, packaging, distribution
- Retail: brand suppliers, logistics (FedEx, UPS), packaging
- Energy: equipment (Baker Hughes, Schlumberger), pipe (Tenaris), chemicals
Phase 3: Supplier Financial Analysis
For each identified supplier (aim for 8-15 key suppliers):
- Discover the supplier using
discover_companies with their ticker
- Pull key financials from Daloopa:
discover_company_series with keywords: ["revenue", "net income", "gross margin", "operating margin"]
get_company_fundamentals for the same 4 calendar quarters as the target company
- Determine revenue concentration:
- Search Daloopa documents for the supplier: keywords ["[target company name]", "customer", "concentration"]
- Web search:
"[supplier name] [target company] revenue percentage customer"
- Web search:
"[supplier name] 10-K customer concentration"
- Many suppliers disclose their top customers in 10-K filings — look for "customers that accounted for 10% or more of revenue"
- Determine COGS attribution (what % of target's costs is this supplier):
- This is often estimated. Use logic like:
- If Apple's COGS is ~$200B TTM and TSMC's revenue from Apple is ~$70B, then TSMC = ~35% of COGS
- Cite the source of each estimate (analyst report, 10-K disclosure, industry research)
- Flag when this is an estimate vs. a disclosed figure
- Business & product description: What does this supplier provide? Be specific (e.g., "5nm/3nm chip fabrication for A-series and M-series SoCs" not just "semiconductors")
Phase 3b: Inventory & 10-Quarter Financial Data
For the target company AND each identified supplier (8-15 companies), pull 10 quarters of data:
- Discover inventory series using
discover_company_series with keywords: ["raw material", "work in process", "finished good", "inventory", "inventories"]
- Look for separate RM, WIP, FG series, plus a total inventory series
- Some companies report "carrying amount" breakdowns — use those for RM/WIP/FG splits
- Discover financial series using
discover_company_series with keywords: ["revenue", "gross profit", "net income", "gross margin"]
- Pull 10 quarters using
get_company_fundamentals. Calculate 10 quarters backward from latest_calendar_quarter.
- Example: if latest is Q4'25, pull ["2023Q3", "2023Q4", "2024Q1", "2024Q2", "2024Q3", "2024Q4", "2025Q1", "2025Q2", "2025Q3", "2025Q4"]
- Compute inventory composition: For each quarter, calculate RM%, WIP%, FG% of total inventory
- High WIP% can signal production bottlenecks
- Rising FG% can signal demand weakness
- Rising RM% can signal supply hoarding or procurement buildup
- Handle missing data gracefully: Some suppliers may not report full inventory breakdowns — show what's available and note gaps
- Multi-currency handling: Note the reporting currency for each company (USD, NTD, KRW, EUR, etc.) and display with appropriate units (e.g., "NTD B" for TSMC, "KRW T" for Samsung)
Run inventory and financial series pulls in parallel across all companies.
Phase 4: Customer / Downstream Identification
The downstream side requires the same research rigor as the upstream side. Run these concurrently to build a comprehensive customer list:
4a. Daloopa Document Search (target company filings):
- Search keywords: ["customer", "contract", "agreement", "channel"] across last 2-4 quarters
- Search keywords: ["customer concentration", "significant customer", "major customer"] across last 2-4 quarters — many companies disclose customers >10% of revenue
- Search keywords: ["distribution", "retail partner", "reseller", "licensee"] across last 2-4 quarters
- Search keywords: ["accounts receivable", "contract asset", "deferred revenue"] — concentration in A/R often reveals customer dependency even when not explicitly named
- Search the company's 10-K specifically for customer disclosures and segment end-market breakdowns
4b. Web Research:
"[TICKER] [company name] major customers list" — direct customer identification
"[TICKER] customer concentration revenue breakdown" — analyst/industry reports
"[TICKER] 10-K customer disclosure" — SEC filing analysis
"[company name] who buys from [company name]" — downstream identification
"[company name] channel partners distributors" — channel analysis
"[company name] end market exposure" — end-market breakdown
4c. Industry-Specific Customer Research:
For each industry, search for the known critical downstream relationships:
- Semiconductors: Which OEMs depend on these chips? (e.g., NVDA → hyperscalers MSFT/AMZN/GOOG, QCOM → smartphone OEMs AAPL/Samsung, AVGO → networking OEMs Cisco/Arista)
- Components/Materials: Which assemblers or product companies use these inputs? (e.g., Corning → AAPL/Samsung for glass, TSMC → fabless semis NVDA/AMD/AAPL)
- Software/Platform: Who builds on this platform? (e.g., MSFT Azure → ISVs, AAPL App Store → developers, Salesforce → SI partners)
- Consumer products: Channel partners (carriers, retailers, e-commerce) and enterprise customers
- Industrial/B2B: End-market verticals (auto, aerospace, medical, telecom)
- Pharma/Biotech: Distributors (McKesson, AmerisourceBergen), PBMs, hospital systems
4d. Customer Financial Analysis:
For each identified customer (aim for 6-10 key customers):
- Discover the customer using
discover_companies with their ticker
- Pull key financials from Daloopa:
discover_company_series with keywords: ["revenue", "net income", "gross margin", "cost of goods", "operating income"]
get_company_fundamentals for the same 4 calendar quarters as the target company
- Determine revenue attribution (what % of target's revenue comes from this customer):
- Search Daloopa documents for the target company: keywords ["[customer name]", "customer", "concentration", "accounts receivable"]
- Web search:
"[target company] [customer name] revenue percentage"
- Web search:
"[target company] 10-K customer concentration"
- Many companies disclose customers that account for >10% of revenue in their 10-K
- Determine input criticality (what % of customer's COGS comes from target):
- This is the inverse of the supplier analysis: if the target sells $X to a customer with $Y in COGS, then input share = X/Y
- Search for:
"[customer name] [target company] supplier dependence" or "[customer name] key inputs components"
- Flag whether the target's product is a critical, hard-to-substitute input vs. a commodity with alternatives
- Assess switching costs: Can the customer easily replace the target company's product?
- High switching cost: Custom/proprietary integration, long qualification cycles, regulatory requirements (e.g., TSMC's process node — customers can't easily switch foundries mid-design)
- Medium switching cost: Some integration required but alternatives exist with 6-12 month transition
- Low switching cost: Commodity input, multiple qualified alternatives, short switching timeline
- Business & product description: What does the target supply to this customer? Be specific (e.g., "A17 Pro and M4 SoCs fabricated on TSMC's 3nm process" not just "chips")
Phase 4e: Customer Inventory & 10-Quarter Financial Data
Mirror Phase 3b for the customer side. For each identified customer (6-10 companies), pull 10 quarters of data:
- Discover inventory series using
discover_company_series with keywords: ["raw material", "work in process", "finished good", "inventory", "inventories"]
- Look for separate RM, WIP, FG series, plus a total inventory series
- Discover financial series using
discover_company_series with keywords: ["revenue", "gross profit", "net income", "gross margin"]
- Pull 10 quarters using
get_company_fundamentals with the same 10 calendar quarters as the target company and suppliers (calculated from latest_calendar_quarter)
- Compute inventory composition: RM%, WIP%, FG% of total inventory
- For customers, inventory signals have different meaning:
- Rising RM% at a customer → they're stocking up on target company's inputs (bullish for target's near-term revenue, but may mean future destocking)
- Falling RM% → customer is drawing down inventory, may signal reduced orders ahead
- Rising FG% at a customer → demand for the customer's end product is softening, which will flow back upstream to the target
- Handle missing data gracefully: Some customers may not report inventory breakdowns — show what's available
- Multi-currency handling: Same as suppliers — note reporting currency
Run customer inventory and financial series pulls in parallel, and in parallel with supplier pulls where possible.
Phase 5: Tier 2 Supplier Research
For the top 3-5 most important Tier 1 suppliers, repeat a lighter version of Phase 2-3:
- Identify their key suppliers (Tier 2 to the original target)
- Pull basic financials
- Determine what they supply and rough revenue/cost relationships
- This enables the "drill deeper" functionality in the dashboard
Phase 6: Data Assembly & Synthesis
Before writing HTML, organize all data into this structure:
TARGET COMPANY:
- Name, ticker, description
- TTM Revenue, COGS, Gross Profit, Net Income, Gross Margin, Op Margin
- Market cap, stock price (from web)
TIER 1 SUPPLIERS (sorted by estimated % of target COGS, descending):
For each:
- Name, ticker, description
- What they supply (specific products/components)
- Estimated % of target company COGS (with source/logic)
- % of supplier revenue from target company (with source)
- TTM Revenue, Net Income, Gross Margin
- Market cap
- Relationship summary (sole source? multi-source? critical?)
- Their key suppliers (Tier 2) if researched
- 10-quarter financials: Revenue, Gross Profit, Net Income, GM% (with Daloopa citation IDs)
- 10-quarter inventory: RM, WIP, FG, Total, RM%, WIP%, FG% (with Daloopa citation IDs)
- Reporting currency and unit (e.g., USD $M, NTD B, KRW T)
TIER 1 CUSTOMERS (sorted by estimated % of target revenue, descending):
For each:
- Name, ticker, description
- What target company supplies to them (specific products/services)
- Estimated % of target revenue from this customer (with source/logic)
- Estimated % of customer COGS from target (input criticality, with source)
- Switching cost assessment (High/Medium/Low with reasoning)
- TTM Revenue, COGS, Net Income, Gross Margin
- Market cap
- Relationship summary (exclusive? multi-source? long-term contract? spot?)
- 10-quarter financials: Revenue, Gross Profit, Net Income, GM% (with Daloopa citation IDs)
- 10-quarter inventory: RM, WIP, FG, Total, RM%, WIP%, FG% (with Daloopa citation IDs)
- Reporting currency and unit (e.g., USD $M, EUR M, JPY B)
TIER 2 CUSTOMERS (for top 3-5 Tier 1 customers — who do THEY sell to?):
For each Tier 1 customer, their key customers with basic data
This traces the value chain forward: Target → Customer → End Market
TIER 2 SUPPLIERS (for top 3-5 Tier 1 suppliers):
For each Tier 1 supplier, their key suppliers with basic data
Phase 6b: Upstream Shock Analysis (Demand Shock → Suppliers)
Prepare a narrative analysis of how a demand shock at the target company would ripple upstream through the supplier chain:
Classify each supplier by dependency level:
- High dependency: Target company is >20% of supplier's revenue → severe impact from demand shock
- Moderate dependency: Target is 10-20% of revenue → meaningful but manageable impact
- Low dependency: Target is <10% of revenue → diversified, minimal direct impact
Assess shock propagation for each supplier:
- Revenue Impact (High/Medium/Low): Based on % of revenue from target
- Margin Impact (High/Medium/Low): Based on operating leverage, fixed costs, ability to find replacement demand
- Inventory Risk: Suppliers with high FG% are more exposed to demand shocks; those with high RM% face supply-side risk
- Substitutability: Can the target switch to alternatives? Can the supplier find other customers?
Build an impact matrix table with columns: Supplier, Tier, Revenue Dependency, Revenue Impact, Margin Impact, Overall Risk
Write narrative sections:
- "Most Exposed Suppliers" — 2-3 paragraphs on suppliers facing highest risk
- "Resilient Suppliers" — suppliers with diversified revenue bases
- "Second-Order Effects" — how Tier 2 suppliers would be indirectly affected
- "Key Monitoring Metrics" — what an analyst should watch (inventory days, order backlog, etc.)
Phase 6c: Downstream Shock Analysis (Supply Disruption → Customers)
Prepare a narrative analysis of how a supply disruption at the target company (production halt, quality issue, capacity constraint, export ban) would ripple downstream through the customer chain:
Classify each customer by input criticality:
- Critical input: Target's product is a key component with no drop-in replacement; disruption halts customer production (e.g., TSMC to Apple — no alternative foundry for A-series chips)
- Important input: Target is a significant but not sole supplier; customer can partially substitute with 3-6 month lead time
- Supplementary input: Target provides a non-critical input; customer has multiple qualified alternatives
Assess downstream disruption for each customer:
- Input Criticality (High/Medium/Low): How essential is the target's product to the customer's operations?
- Switching Cost (High/Medium/Low): How long and expensive to qualify an alternative? Are there contractual lock-ins?
- Revenue at Risk: What portion of the customer's revenue depends on products that use the target's inputs?
- Inventory Buffer: Does the customer hold significant RM inventory of the target's product? How many weeks/months of supply?
- Alternative Sources: Who else could supply this? What's the capacity gap?
Build a downstream impact matrix table with columns: Customer, Category, Input Criticality, Switching Cost, Revenue at Risk, Inventory Buffer, Overall Disruption Risk
Write narrative sections:
- "Most Vulnerable Customers" — customers who would face production disruption or revenue loss
- "Customers with Alternatives" — those who can substitute away from the target
- "Pricing Power Implications" — if the target faces a supply constraint, which customers have the leverage to secure allocation vs. which get cut first?
- "Channel Inventory Signals" — what customer inventory levels (especially RM%) tell you about near-term order patterns for the target company
- "Second-Order Downstream Effects" — how end consumers or Tier 2 customers would be affected
HTML TEMPLATE & DESIGN SYSTEM
Start from the HTML Report Template in ../design-system.md (copy the full <style> block). Then add the following additional CSS for interactive dashboard components. Use the design system's color palette throughout.
Design Principles
- Follow
../design-system.md for color palette, typography, and table conventions
- Information density: Show data compactly but with clear hierarchy
- Interactive but not flashy: Smooth transitions, click-to-expand, no animations for animation's sake
Core CSS
Start with the full CSS from ../design-system.md, then append these dashboard-specific styles:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[TICKER] Supply Chain Dashboard</title>
<style>
/* === PASTE FULL CSS FROM design-system.md HTML Report Template HERE === */
/* === DASHBOARD-SPECIFIC EXTENSIONS BELOW === */
@media print {
.no-print { display: none !important; }
.interactive { pointer-events: none; }
@page { margin: 0.5in; size: landscape; }
}
:root {
/* Extended palette for dashboard components — supplements design-system.md vars */
--bg: var(--light-gray);
--surface: #ffffff;
--border: var(--mid-gray);
--border-light: var(--light-gray);
--text-primary: var(--near-black);
--text-secondary: var(--dark-gray);
--text-tertiary: #8a8a85;
--accent: var(--steel-blue);
--green-bg: #f0f9f2;
--red-bg: #fef2f2;
--amber: #92600a;
--amber-bg: #fefce8;
--blue-bg: #eff6ff;
--node-supplier: var(--mid-gray);
--node-customer: #dde8f0;
--node-target: var(--navy);
--sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
--mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}
/* Layout */
.page-header {
background: var(--surface);
border-bottom: 3px solid var(--navy);
padding: 24px 40px 16px;
}
.page-header h1 {
font-size: 28px;
font-weight: 700;
color: var(--navy);
letter-spacing: -0.5px;
line-height: 1.2;
}
.page-header .subtitle {
font-size: 14px;
color: var(--text-secondary);
margin-top: 4px;
}
.page-header .dateline {
font-size: 12px;
color: var(--text-tertiary);
margin-top: 8px;
font-family: var(--mono);
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 24px 40px;
}
/* Section Headers */
h2 {
font-family: var(--sans);
font-size: 20px;
font-weight: 700;
margin: 32px 0 16px;
padding-bottom: 6px;
border-bottom: 1px solid var(--mid-gray);
letter-spacing: -0.3px;
color: var(--navy);
}
h3 {
font-family: var(--sans);
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.8px;
color: var(--steel-blue);
margin: 20px 0 10px;
}
/* KPI Bar */
.kpi-bar {
display: flex;
gap: 0;
border: 1px solid var(--border);
border-radius: 6px;
overflow: hidden;
background: var(--surface);
margin: 16px 0;
}
.kpi-item {
flex: 1;
padding: 12px 16px;
border-right: 1px solid var(--border-light);
text-align: center;
}
.kpi-item:last-child { border-right: none; }
.kpi-label {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
font-weight: 600;
}
.kpi-value {
font-size: 18px;
font-weight: 700;
margin-top: 2px;
font-variant-numeric: tabular-nums;
}
.kpi-sub {
font-size: 11px;
color: var(--text-tertiary);
margin-top: 1px;
}
/* Supply Chain Visualization */
.chain-view {
display: flex;
gap: 24px;
align-items: flex-start;
margin: 20px 0;
overflow-x: auto;
padding-bottom: 16px;
}
.chain-column {
min-width: 280px;
flex-shrink: 0;
}
.chain-column-header {
font-family: var(--sans);
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-tertiary);
margin-bottom: 12px;
padding-bottom: 6px;
border-bottom: 1px solid var(--border);
text-align: center;
}
.chain-arrow {
display: flex;
align-items: center;
justify-content: center;
color: var(--text-tertiary);
font-size: 24px;
min-width: 40px;
padding-top: 40px;
flex-shrink: 0;
}
/* Company Cards */
.company-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
padding: 14px 16px;
margin-bottom: 10px;
cursor: pointer;
transition: border-color 0.15s, box-shadow 0.15s;
}
.company-card:hover {
border-color: var(--text-secondary);
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.company-card.target-card {
background: var(--navy);
color: white;
border-color: var(--navy);
}
.company-card.target-card .card-ticker { color: rgba(255,255,255,0.7); }
.company-card.target-card .card-metric-label { color: rgba(255,255,255,0.5); }
.company-card.target-card .card-metric-value { color: white; }
.company-card.target-card .card-desc { color: rgba(255,255,255,0.7); }
.company-card.expanded { border-color: var(--steel-blue); box-shadow: 0 2px 12px rgba(74,111,165,0.15); }
.company-card.supplier-card { border-left: 3px solid var(--node-supplier); }
.company-card.customer-card { border-left: 3px solid var(--node-customer); }
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.card-name {
font-family: var(--sans);
font-size: 16px;
font-weight: 700;
line-height: 1.2;
}
.card-ticker {
font-family: var(--mono);
font-size: 11px;
color: var(--text-tertiary);
margin-top: 2px;
}
.card-badge {
font-size: 10px;
font-weight: 700;
padding: 2px 8px;
border-radius: 3px;
white-space: nowrap;
}
.badge-pct-high { background: var(--red-bg); color: var(--red); }
.badge-pct-med { background: var(--amber-bg); color: var(--amber); }
.badge-pct-low { background: var(--green-bg); color: var(--green); }
.card-supplies {
font-size: 12px;
color: var(--text-secondary);
margin-top: 6px;
line-height: 1.4;
}
.card-metrics {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid var(--border-light);
}
.card-metric-label {
font-size: 9px;
text-transform: uppercase;
letter-spacing: 0.3px;
color: var(--text-tertiary);
}
.card-metric-value {
font-size: 13px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.card-desc {
font-size: 12px;
color: var(--text-secondary);
margin-top: 8px;
line-height: 1.45;
}
/* Expanded Detail Panel */
.detail-panel {
display: none;
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--border-light);
}
.company-card.expanded .detail-panel { display: block; }
.detail-section {
margin-bottom: 14px;
}
.detail-section h4 {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
margin-bottom: 6px;
}
.relationship-bar {
height: 8px;
background: var(--border-light);
border-radius: 4px;
overflow: hidden;
margin: 4px 0;
}
.relationship-fill {
height: 100%;
border-radius: 4px;
transition: width 0.3s;
}
.fill-red { background: var(--red); }
.fill-amber { background: var(--amber); }
.fill-green { background: var(--green); }
.fill-blue { background: var(--accent); }
/* Drill-down button */
.drill-btn {
display: inline-block;
font-size: 11px;
font-weight: 600;
color: var(--accent);
cursor: pointer;
padding: 4px 0;
border: none;
background: none;
font-family: var(--sans);
}
.drill-btn:hover { text-decoration: underline; }
/* Concentration Table */
.conc-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
margin: 12px 0;
}
.conc-table th {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
font-weight: 600;
text-align: left;
padding: 6px 10px;
border-bottom: 2px solid var(--border);
background: var(--bg);
}
.conc-table th:not(:first-child) { text-align: right; }
.conc-table td {
padding: 8px 10px;
border-bottom: 1px solid var(--border-light);
font-variant-numeric: tabular-nums;
}
.conc-table td:not(:first-child) { text-align: right; }
.conc-table tr:hover { background: var(--blue-bg); }
.conc-table .row-total {
font-weight: 700;
border-top: 2px solid var(--border);
background: var(--bg);
}
/* Risk indicator */
.risk-tag {
display: inline-block;
font-size: 10px;
font-weight: 700;
padding: 1px 6px;
border-radius: 3px;
}
.risk-high { background: var(--red-bg); color: var(--red); }
.risk-med { background: var(--amber-bg); color: var(--amber); }
.risk-low { background: var(--green-bg); color: var(--green); }
/* Tabs for switching views */
.tab-bar {
display: flex;
gap: 0;
border-bottom: 2px solid var(--border);
margin-bottom: 20px;
}
.tab {
padding: 10px 20px;
font-size: 13px;
font-weight: 600;
color: var(--text-tertiary);
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
transition: color 0.15s, border-color 0.15s;
font-family: var(--sans);
background: none;
border-top: none;
border-left: none;
border-right: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
color: var(--text-primary);
border-bottom-color: var(--text-primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
/* Methodology / Source Notes */
.methodology-box {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 6px;
padding: 16px 20px;
margin: 16px 0;
font-size: 12px;
color: var(--text-secondary);
line-height: 1.5;
}
.methodology-box h4 {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
margin-bottom: 8px;
}
/* Links & References */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.source-tag {
font-size: 9px;
color: var(--text-tertiary);
font-style: italic;
}
/* Footer */
.page-footer {
margin-top: 40px;
padding: 16px 0;
border-top: 3px solid var(--navy);
font-size: 11px;
color: var(--text-tertiary);
text-align: center;
}
/* Print button */
.dl-btn {
display: inline-block;
padding: 10px 24px;
background: var(--navy);
color: white;
border: none;
border-radius: 5px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
font-family: var(--sans);
}
.dl-btn:hover { background: var(--steel-blue); }
/* Two-column layout */
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
@media (max-width: 800px) {
.two-col { grid-template-columns: 1fr; }
.chain-view { flex-direction: column; }
.chain-arrow { transform: rotate(90deg); padding-top: 0; }
}
</style>
</head>
Core JavaScript Pattern
The dashboard uses vanilla JavaScript for interactivity. Include these functions in a <script> tag at the end of the body:
<script>
// Tab switching
function switchTab(tabId) {
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
document.querySelector(`[data-tab="${tabId}"]`).classList.add('active');
document.getElementById(tabId).classList.add('active');
}
// Card expand/collapse
function toggleCard(cardId) {
const card = document.getElementById(cardId);
card.classList.toggle('expanded');
}
// Navigate to tier 2 view for a specific supplier
function drillDown(companyTicker) {
// Switch to the tier-2 tab and scroll to the relevant section
switchTab('tier2');
const section = document.getElementById('tier2-' + companyTicker);
if (section) {
section.scrollIntoView({ behavior: 'smooth', block: 'start' });
section.style.outline = '2px solid var(--accent)';
setTimeout(() => { section.style.outline = 'none'; }, 2000);
}
}
// Initialize
document.addEventListener('DOMContentLoaded', () => {
// Set first tab active
const firstTab = document.querySelector('.tab');
if (firstTab) firstTab.click();
});
</script>
DOCUMENT STRUCTURE
The HTML document has these sections. Every section is mandatory.
Section 1: Print Button Bar
<div class="no-print" style="text-align:center; padding:16px; background:var(--surface); border-bottom:1px solid var(--border);">
<button class="dl-btn" as PDF</button>
<span style="font-size:12px; color:var(--text-tertiary); margin-left:12px;">or Cmd+P → Save as PDF</span>
</div>
Section 2: Page Header
<div class="page-header">
<h1>[TICKER] — Supply Chain Map</h1>
<div class="subtitle">[Full Company Name] · Interactive Supply Chain Analysis</div>
<div class="dateline">Prepared [Date] · Data sourced from <a href="https://daloopa.com">Daloopa</a> · TTM through [Latest Quarter]</div>
</div>
Section 3: Target Company KPI Bar
Show 6 KPIs for the target company:
<div class="container">
<div class="kpi-bar">
<div class="kpi-item"><div class="kpi-label">TTM Revenue</div><div class="kpi-value">$XXB</div></div>
<div class="kpi-item"><div class="kpi-label">TTM COGS</div><div class="kpi-value">$XXB</div></div>
<div class="kpi-item"><div class="kpi-label">Gross Margin</div><div class="kpi-value">XX.X%</div></div>
<div class="kpi-item"><div class="kpi-label">Suppliers Mapped</div><div class="kpi-value">XX</div></div>
<div class="kpi-item"><div class="kpi-label">Top 5 = % of COGS</div><div class="kpi-value">~XX%</div></div>
<div class="kpi-item"><div class="kpi-label">Key Customers</div><div class="kpi-value">XX</div></div>
</div>
Section 4: Page Layout
The dashboard uses a single scrollable page (no tabs) with the following vertical order:
- KPI bar (target company overview)
- Canvas network visualization (full chain: Tier 3 → Tier 2 → Tier 1 → Target → Customers → Tier 2 Customers)
- Inventory Health Overview table (suppliers AND customers)
- Supplier cards grouped by tier
- Customer cards grouped by category
- Upstream Shock Analysis (demand shock → suppliers, narrative + impact matrix)
- Downstream Shock Analysis (supply disruption → customers, narrative + impact matrix)
- Concentration Analysis summary (both upstream and downstream)
- Footer
Each supplier and customer card is clickable — opening a full-screen detail overlay with 10-quarter financials, inventory tables, and Canvas charts. The overlay is dismissed with × or backdrop click.
Section 5: Canvas Network Visualization
Replace the HTML card-based chain view with a Canvas-based tier-grouped network:
- Use a
<canvas> element spanning the full container width, ~420px height
- Column layout: Tier 3 (left) → Tier 2 → Tier 1 → Target (center) → Customers (right)
- Draw each company as a rounded rectangle node with ticker label
- Draw connection lines (bezier curves or straight lines) between related nodes
- Color-code by tier: Target = navy (#1B2A4A), Tier 1 = steel blue (#4A6FA5), Tier 2 = gold (#C5A55A), Tier 3 = dark gray (#6C757D), Customers = mid gray (#E9ECEF)
- Clickable nodes: Track click coordinates with a
click event listener on the canvas, determine which node was clicked via hit-testing, then open the detail overlay for that company
- Column headers ("TIER 1", "TIER 2", "TARGET", etc.) drawn as text above each column
- Responsive: redraw on
window.resize
// Example network drawing function pattern:
function drawNetwork() {
const cv = document.getElementById('networkCanvas');
const ctx = cv.getContext('2d');
cv.width = cv.parentElement.clientWidth;
cv.height = 420;
ctx.clearRect(0, 0, cv.width, cv.height);
// Define columns: x positions for each tier
const cols = {
tier3: cv.width * 0.08,
tier2: cv.width * 0.28,
tier1: cv.width * 0.48,
target: cv.width * 0.68,
customers: cv.width * 0.88
};
// Draw column headers, nodes, and connection lines
// Store node positions for hit-testing on click
}
Section 5b: Inventory Health Overview
Below the network, add an Inventory Health Overview table showing all suppliers AND customers:
| Company | Ticker | Role | Total Inventory | RM% | WIP% | FG% | Composition Bar |
- The "Role" column shows "Supplier T1", "Supplier T2", "Customer", or "Target"
- The "Composition Bar" column renders a stacked horizontal bar (RM = blue, WIP = amber, FG = green) using inline CSS
background: linear-gradient(...)
- Sort by total inventory descending or by FG% descending (highest FG% = most demand-shock exposure)
- Include the target company at the top of the table, then suppliers, then customers
- Each inventory value must link to its Daloopa citation
- Analytical note: For suppliers, rising FG% signals demand weakness from the target. For customers, rising RM% signals stockpiling of the target's inputs (bullish near-term, potential destocking risk later). Falling RM% at customers signals reduced orders ahead.
Section 5c: Supplier Cards by Tier
Below the inventory overview, render supplier cards grouped under tier headings:
── TIER 1 · Critical / Sole-Source ──────
[Card: TSMC] [Card: Samsung] [Card: Broadcom] ...
── TIER 2 · Major Component ─────────────
[Card: Qualcomm] [Card: Skyworks] [Card: TXN] ...
── TIER 3 · Specialty ───────────────────
[Card: Corning] [Card: Cirrus Logic] ...
Each card shows: Company name, ticker, what they supply, TTM revenue, gross margin, estimated % of target COGS, a colored dot for tier. Clicking a card opens the detail overlay.
Section 5d: Customer Cards by Category
Below the supplier cards, render customer cards grouped under category headings:
── CHANNEL PARTNERS · Distribution & Retail ──────
[Card: Best Buy] [Card: AT&T] [Card: Verizon] ...
── ENTERPRISE / B2B · Direct Customers ───────────
[Card: Enterprise customer 1] [Card: Enterprise customer 2] ...
── END-MARKET EXPOSURE · Indirect Demand ─────────
[Card: End-market exposure 1] ...
Categories should be adapted to the target company's business model:
- B2B/Components companies: Group by end-market vertical (Auto, Aeros
…(truncated)
1---2name: supply-chain3description: Interactive supply chain dashboard mapping suppliers, customers, and financial interdependencies4---56Generate an interactive supply chain dashboard for the company named in the user's request. If no ticker or company is provided, ask for one before proceeding.78**Before starting, read `../data-access.md` for data access methods and `../design-system.md` for formatting conventions.** Follow the data access detection logic and design system throughout this skill.910This skill maps the upstream (supplier) and downstream (customer) relationships for a target company, quantifying financial interdependencies in both directions. The output enables an analyst to understand: Who are the critical suppliers and customers? Where is concentration risk on both sides? Which suppliers depend heavily on this company for revenue? Which customers depend on this company's products as critical inputs? How does a shock propagate both upstream (demand shock to suppliers) and downstream (supply disruption to customers)?1112## Output Format1314The final deliverable is a **single self-contained HTML file** with:15- Embedded CSS and JavaScript (no external dependencies)16- **Tier-grouped Canvas network visualization** — columns: Tier 3 → Tier 2 → Tier 1 → Target → Customers, with connection lines. Clickable nodes open detail overlays.17- **Inventory Health Overview table** — for all suppliers: RM%, WIP%, FG% of total inventory shown as stacked colored bars, plus latest total inventory value18- **Supplier cards grouped by tier** — Tier 1 (Critical/Sole-source), Tier 2 (Major Component), Tier 3 (Specialty) with click-to-expand detail overlays19- **Detail overlays** for each supplier containing:20 - 10-quarter financial table (Revenue, Gross Profit, Net Income, Gross Margin %)21 - 10-quarter inventory breakdown table (Raw Materials, WIP, Finished Goods, Total, RM%, WIP%, FG%)22 - Canvas chart: stacked bar chart of inventory composition with Gross Margin % line overlay23 - Business description and relationship to target company24- **Customer cards grouped by category** — Channel Partners, Enterprise/B2B, End-Market Exposure — with click-to-expand detail overlays matching supplier depth25- **Detail overlays** for each customer containing:26 - 10-quarter financial table (Revenue, Gross Profit, Net Income, Gross Margin %)27 - 10-quarter inventory breakdown table (Raw Materials, WIP, Finished Goods, Total, RM%, WIP%, FG%)28 - Canvas chart: stacked bar chart of inventory composition with Gross Margin % line overlay29 - Business description and relationship to target company30- **Upstream Shock Analysis** section — narrative analysis of how a demand/supply shock to the target company ripples upstream through the supplier chain, with an impact matrix table (Revenue Impact, Margin Impact, Overall Risk per supplier)31- **Downstream Shock Analysis** section — narrative analysis of how a supply disruption at the target company ripples downstream through the customer chain, with an impact matrix table (Input Criticality, Switching Cost, Revenue at Risk, Overall Disruption Risk per customer)32- All financial figures hyperlinked to Daloopa source citations33- A "Download as PDF" button (uses `window.print()`)3435**DOM Safety**: All JavaScript MUST use `createElement()` + `textContent` + `appendChild()` for DOM construction. NEVER use `innerHTML`, `outerHTML`, or any HTML-string injection methods. Use helper functions like `ce(tag)`, `ca(el, attrs)`, `cA(parent, children)` to keep code compact.3637Save to `reports/{TICKER}_supply-chain.html` and open it with `open`.3839---4041## RESEARCH WORKFLOW4243This is a multi-phase research process. Each phase builds on the previous one. Maximize parallelism across independent API calls.4445### Phase 1: Target Company Identification46471. Use `discover_companies` with the ticker symbol to get the `company_id`, `latest_calendar_quarter`, and `latest_fiscal_quarter`. Note the firm name for report attribution (default: "Daloopa") — see `../data-access.md` Section 4.5.482. Pull key financials for the target company:49 - Use `discover_company_series` with keywords: ["revenue", "cost of goods", "gross profit", "operating income", "net income", "total cost"]50 - Calculate 4 quarters backward from `latest_calendar_quarter`. Use `get_company_fundamentals` for those periods to get TTM figures.513. Note the target company's total COGS / cost of revenue (TTM) — this is the denominator for supplier % calculations.5253### Phase 2: Supplier Identification5455Run these concurrently to build a comprehensive supplier list:5657**2a. Daloopa Document Search:**58- Search keywords: ["supplier", "vendor", "purchase", "procurement"] across last 2-4 quarters59- Search keywords: ["supply agreement", "supply chain", "manufacturing"] across last 2-4 quarters60- Search keywords: ["sole source", "single source", "key supplier"] across last 2-4 quarters61- Search keywords: ["concentration", "significant supplier"] across last 2-4 quarters62- Search the company's 10-K specifically for supplier disclosures6364**2b. Web Research:**65- `"[TICKER] [company name] key suppliers list 2025 2026"` — supplier identification66- `"[TICKER] supply chain analysis suppliers"` — analyst/industry reports67- `"[TICKER] 10-K supplier disclosure"` — SEC filing analysis68- `"[company name] supply chain map"` — industry supply chain maps69- `"[company name] supplier concentration risk"` — risk analysis70- `"[company name] who manufactures for [company]"` — manufacturing partners71- `"[company name] component suppliers"` — component-level supply chain7273**2c. Industry-Specific Supplier Research:**74For each industry, search for the known critical supply chain relationships:75- **Tech/Hardware**: semiconductor foundries (TSMC, Samsung), display (Samsung, LG, BOE), memory (Samsung, SK Hynix, Micron), sensors/cameras (Sony), glass (Corning), connectors (Amphenol), batteries (CATL, LG Energy), PCB/assembly (Foxconn/Hon Hai, Pegatron, Luxshare)76- **Automotive**: battery (CATL, Panasonic, LG Energy), semiconductors (Infineon, NXP, ON Semi, TI), steel (Nippon, POSCO), tires (Michelin, Bridgestone), glass (AGC, Saint-Gobain)77- **Pharma**: CDMOs (Lonza, Samsung Biologics, Catalent), API suppliers, packaging, distribution78- **Retail**: brand suppliers, logistics (FedEx, UPS), packaging79- **Energy**: equipment (Baker Hughes, Schlumberger), pipe (Tenaris), chemicals8081### Phase 3: Supplier Financial Analysis8283For each identified supplier (aim for 8-15 key suppliers):84851. **Discover the supplier** using `discover_companies` with their ticker862. **Pull key financials** from Daloopa:87 - `discover_company_series` with keywords: ["revenue", "net income", "gross margin", "operating margin"]88 - `get_company_fundamentals` for the same 4 calendar quarters as the target company893. **Determine revenue concentration**:90 - Search Daloopa documents for the supplier: keywords ["[target company name]", "customer", "concentration"]91 - Web search: `"[supplier name] [target company] revenue percentage customer"`92 - Web search: `"[supplier name] 10-K customer concentration"`93 - Many suppliers disclose their top customers in 10-K filings — look for "customers that accounted for 10% or more of revenue"944. **Determine COGS attribution** (what % of target's costs is this supplier):95 - This is often estimated. Use logic like:96 - If Apple's COGS is ~$200B TTM and TSMC's revenue from Apple is ~$70B, then TSMC = ~35% of COGS97 - Cite the source of each estimate (analyst report, 10-K disclosure, industry research)98 - Flag when this is an estimate vs. a disclosed figure995. **Business & product description**: What does this supplier provide? Be specific (e.g., "5nm/3nm chip fabrication for A-series and M-series SoCs" not just "semiconductors")100101### Phase 3b: Inventory & 10-Quarter Financial Data102103For the target company AND each identified supplier (8-15 companies), pull **10 quarters** of data:1041051. **Discover inventory series** using `discover_company_series` with keywords: ["raw material", "work in process", "finished good", "inventory", "inventories"]106 - Look for separate RM, WIP, FG series, plus a total inventory series107 - Some companies report "carrying amount" breakdowns — use those for RM/WIP/FG splits1082. **Discover financial series** using `discover_company_series` with keywords: ["revenue", "gross profit", "net income", "gross margin"]1093. **Pull 10 quarters** using `get_company_fundamentals`. Calculate 10 quarters backward from `latest_calendar_quarter`.110 - Example: if latest is Q4'25, pull ["2023Q3", "2023Q4", "2024Q1", "2024Q2", "2024Q3", "2024Q4", "2025Q1", "2025Q2", "2025Q3", "2025Q4"]1114. **Compute inventory composition**: For each quarter, calculate RM%, WIP%, FG% of total inventory112 - High WIP% can signal production bottlenecks113 - Rising FG% can signal demand weakness114 - Rising RM% can signal supply hoarding or procurement buildup1155. **Handle missing data gracefully**: Some suppliers may not report full inventory breakdowns — show what's available and note gaps1166. **Multi-currency handling**: Note the reporting currency for each company (USD, NTD, KRW, EUR, etc.) and display with appropriate units (e.g., "NTD B" for TSMC, "KRW T" for Samsung)117118Run inventory and financial series pulls in parallel across all companies.119120### Phase 4: Customer / Downstream Identification121122The downstream side requires the same research rigor as the upstream side. Run these concurrently to build a comprehensive customer list:123124**4a. Daloopa Document Search (target company filings):**125- Search keywords: ["customer", "contract", "agreement", "channel"] across last 2-4 quarters126- Search keywords: ["customer concentration", "significant customer", "major customer"] across last 2-4 quarters — many companies disclose customers >10% of revenue127- Search keywords: ["distribution", "retail partner", "reseller", "licensee"] across last 2-4 quarters128- Search keywords: ["accounts receivable", "contract asset", "deferred revenue"] — concentration in A/R often reveals customer dependency even when not explicitly named129- Search the company's 10-K specifically for customer disclosures and segment end-market breakdowns130131**4b. Web Research:**132- `"[TICKER] [company name] major customers list"` — direct customer identification133- `"[TICKER] customer concentration revenue breakdown"` — analyst/industry reports134- `"[TICKER] 10-K customer disclosure"` — SEC filing analysis135- `"[company name] who buys from [company name]"` — downstream identification136- `"[company name] channel partners distributors"` — channel analysis137- `"[company name] end market exposure"` — end-market breakdown138139**4c. Industry-Specific Customer Research:**140For each industry, search for the known critical downstream relationships:141- **Semiconductors**: Which OEMs depend on these chips? (e.g., NVDA → hyperscalers MSFT/AMZN/GOOG, QCOM → smartphone OEMs AAPL/Samsung, AVGO → networking OEMs Cisco/Arista)142- **Components/Materials**: Which assemblers or product companies use these inputs? (e.g., Corning → AAPL/Samsung for glass, TSMC → fabless semis NVDA/AMD/AAPL)143- **Software/Platform**: Who builds on this platform? (e.g., MSFT Azure → ISVs, AAPL App Store → developers, Salesforce → SI partners)144- **Consumer products**: Channel partners (carriers, retailers, e-commerce) and enterprise customers145- **Industrial/B2B**: End-market verticals (auto, aerospace, medical, telecom)146- **Pharma/Biotech**: Distributors (McKesson, AmerisourceBergen), PBMs, hospital systems147148**4d. Customer Financial Analysis:**149150For each identified customer (aim for 6-10 key customers):1511521. **Discover the customer** using `discover_companies` with their ticker1532. **Pull key financials** from Daloopa:154 - `discover_company_series` with keywords: ["revenue", "net income", "gross margin", "cost of goods", "operating income"]155 - `get_company_fundamentals` for the same 4 calendar quarters as the target company1563. **Determine revenue attribution** (what % of target's revenue comes from this customer):157 - Search Daloopa documents for the target company: keywords ["[customer name]", "customer", "concentration", "accounts receivable"]158 - Web search: `"[target company] [customer name] revenue percentage"`159 - Web search: `"[target company] 10-K customer concentration"`160 - Many companies disclose customers that account for >10% of revenue in their 10-K1614. **Determine input criticality** (what % of customer's COGS comes from target):162 - This is the inverse of the supplier analysis: if the target sells $X to a customer with $Y in COGS, then input share = X/Y163 - Search for: `"[customer name] [target company] supplier dependence"` or `"[customer name] key inputs components"`164 - Flag whether the target's product is a critical, hard-to-substitute input vs. a commodity with alternatives1655. **Assess switching costs**: Can the customer easily replace the target company's product?166 - **High switching cost**: Custom/proprietary integration, long qualification cycles, regulatory requirements (e.g., TSMC's process node — customers can't easily switch foundries mid-design)167 - **Medium switching cost**: Some integration required but alternatives exist with 6-12 month transition168 - **Low switching cost**: Commodity input, multiple qualified alternatives, short switching timeline1696. **Business & product description**: What does the target supply to this customer? Be specific (e.g., "A17 Pro and M4 SoCs fabricated on TSMC's 3nm process" not just "chips")170171### Phase 4e: Customer Inventory & 10-Quarter Financial Data172173Mirror Phase 3b for the customer side. For each identified customer (6-10 companies), pull **10 quarters** of data:1741751. **Discover inventory series** using `discover_company_series` with keywords: ["raw material", "work in process", "finished good", "inventory", "inventories"]176 - Look for separate RM, WIP, FG series, plus a total inventory series1772. **Discover financial series** using `discover_company_series` with keywords: ["revenue", "gross profit", "net income", "gross margin"]1783. **Pull 10 quarters** using `get_company_fundamentals` with the same 10 calendar quarters as the target company and suppliers (calculated from `latest_calendar_quarter`)1794. **Compute inventory composition**: RM%, WIP%, FG% of total inventory180 - For customers, inventory signals have different meaning:181 - Rising RM% at a customer → they're stocking up on target company's inputs (bullish for target's near-term revenue, but may mean future destocking)182 - Falling RM% → customer is drawing down inventory, may signal reduced orders ahead183 - Rising FG% at a customer → demand for the customer's end product is softening, which will flow back upstream to the target1845. **Handle missing data gracefully**: Some customers may not report inventory breakdowns — show what's available1856. **Multi-currency handling**: Same as suppliers — note reporting currency186187Run customer inventory and financial series pulls in parallel, and in parallel with supplier pulls where possible.188189### Phase 5: Tier 2 Supplier Research190191For the top 3-5 most important Tier 1 suppliers, repeat a lighter version of Phase 2-3:1921931. Identify their key suppliers (Tier 2 to the original target)1942. Pull basic financials1953. Determine what they supply and rough revenue/cost relationships1964. This enables the "drill deeper" functionality in the dashboard197198### Phase 6: Data Assembly & Synthesis199200Before writing HTML, organize all data into this structure:201202```203TARGET COMPANY:204 - Name, ticker, description205 - TTM Revenue, COGS, Gross Profit, Net Income, Gross Margin, Op Margin206 - Market cap, stock price (from web)207208TIER 1 SUPPLIERS (sorted by estimated % of target COGS, descending):209 For each:210 - Name, ticker, description211 - What they supply (specific products/components)212 - Estimated % of target company COGS (with source/logic)213 - % of supplier revenue from target company (with source)214 - TTM Revenue, Net Income, Gross Margin215 - Market cap216 - Relationship summary (sole source? multi-source? critical?)217 - Their key suppliers (Tier 2) if researched218 - 10-quarter financials: Revenue, Gross Profit, Net Income, GM% (with Daloopa citation IDs)219 - 10-quarter inventory: RM, WIP, FG, Total, RM%, WIP%, FG% (with Daloopa citation IDs)220 - Reporting currency and unit (e.g., USD $M, NTD B, KRW T)221222TIER 1 CUSTOMERS (sorted by estimated % of target revenue, descending):223 For each:224 - Name, ticker, description225 - What target company supplies to them (specific products/services)226 - Estimated % of target revenue from this customer (with source/logic)227 - Estimated % of customer COGS from target (input criticality, with source)228 - Switching cost assessment (High/Medium/Low with reasoning)229 - TTM Revenue, COGS, Net Income, Gross Margin230 - Market cap231 - Relationship summary (exclusive? multi-source? long-term contract? spot?)232 - 10-quarter financials: Revenue, Gross Profit, Net Income, GM% (with Daloopa citation IDs)233 - 10-quarter inventory: RM, WIP, FG, Total, RM%, WIP%, FG% (with Daloopa citation IDs)234 - Reporting currency and unit (e.g., USD $M, EUR M, JPY B)235236TIER 2 CUSTOMERS (for top 3-5 Tier 1 customers — who do THEY sell to?):237 For each Tier 1 customer, their key customers with basic data238 This traces the value chain forward: Target → Customer → End Market239240TIER 2 SUPPLIERS (for top 3-5 Tier 1 suppliers):241 For each Tier 1 supplier, their key suppliers with basic data242```243244### Phase 6b: Upstream Shock Analysis (Demand Shock → Suppliers)245246Prepare a narrative analysis of how a demand shock at the target company would ripple upstream through the supplier chain:2472481. **Classify each supplier by dependency level**:249 - **High dependency**: Target company is >20% of supplier's revenue → severe impact from demand shock250 - **Moderate dependency**: Target is 10-20% of revenue → meaningful but manageable impact251 - **Low dependency**: Target is <10% of revenue → diversified, minimal direct impact2522532. **Assess shock propagation for each supplier**:254 - **Revenue Impact** (High/Medium/Low): Based on % of revenue from target255 - **Margin Impact** (High/Medium/Low): Based on operating leverage, fixed costs, ability to find replacement demand256 - **Inventory Risk**: Suppliers with high FG% are more exposed to demand shocks; those with high RM% face supply-side risk257 - **Substitutability**: Can the target switch to alternatives? Can the supplier find other customers?2582593. **Build an impact matrix table** with columns: Supplier, Tier, Revenue Dependency, Revenue Impact, Margin Impact, Overall Risk2602614. **Write narrative sections**:262 - "Most Exposed Suppliers" — 2-3 paragraphs on suppliers facing highest risk263 - "Resilient Suppliers" — suppliers with diversified revenue bases264 - "Second-Order Effects" — how Tier 2 suppliers would be indirectly affected265 - "Key Monitoring Metrics" — what an analyst should watch (inventory days, order backlog, etc.)266267### Phase 6c: Downstream Shock Analysis (Supply Disruption → Customers)268269Prepare a narrative analysis of how a supply disruption at the target company (production halt, quality issue, capacity constraint, export ban) would ripple downstream through the customer chain:2702711. **Classify each customer by input criticality**:272 - **Critical input**: Target's product is a key component with no drop-in replacement; disruption halts customer production (e.g., TSMC to Apple — no alternative foundry for A-series chips)273 - **Important input**: Target is a significant but not sole supplier; customer can partially substitute with 3-6 month lead time274 - **Supplementary input**: Target provides a non-critical input; customer has multiple qualified alternatives2752762. **Assess downstream disruption for each customer**:277 - **Input Criticality** (High/Medium/Low): How essential is the target's product to the customer's operations?278 - **Switching Cost** (High/Medium/Low): How long and expensive to qualify an alternative? Are there contractual lock-ins?279 - **Revenue at Risk**: What portion of the customer's revenue depends on products that use the target's inputs?280 - **Inventory Buffer**: Does the customer hold significant RM inventory of the target's product? How many weeks/months of supply?281 - **Alternative Sources**: Who else could supply this? What's the capacity gap?2822833. **Build a downstream impact matrix table** with columns: Customer, Category, Input Criticality, Switching Cost, Revenue at Risk, Inventory Buffer, Overall Disruption Risk2842854. **Write narrative sections**:286 - "Most Vulnerable Customers" — customers who would face production disruption or revenue loss287 - "Customers with Alternatives" — those who can substitute away from the target288 - "Pricing Power Implications" — if the target faces a supply constraint, which customers have the leverage to secure allocation vs. which get cut first?289 - "Channel Inventory Signals" — what customer inventory levels (especially RM%) tell you about near-term order patterns for the target company290 - "Second-Order Downstream Effects" — how end consumers or Tier 2 customers would be affected291292---293294## HTML TEMPLATE & DESIGN SYSTEM295296Start from the HTML Report Template in `../design-system.md` (copy the full `<style>` block). Then add the following **additional CSS** for interactive dashboard components. Use the design system's color palette throughout.297298### Design Principles299- Follow `../design-system.md` for color palette, typography, and table conventions300- **Information density**: Show data compactly but with clear hierarchy301- **Interactive but not flashy**: Smooth transitions, click-to-expand, no animations for animation's sake302303### Core CSS304305Start with the full CSS from `../design-system.md`, then append these dashboard-specific styles:306307```html308<!DOCTYPE html>309<html lang="en">310<head>311<meta charset="UTF-8">312<meta name="viewport" content="width=device-width, initial-scale=1.0">313<title>[TICKER] Supply Chain Dashboard</title>314<style>315 /* === PASTE FULL CSS FROM design-system.md HTML Report Template HERE === */316317 /* === DASHBOARD-SPECIFIC EXTENSIONS BELOW === */318319 @media print {320 .no-print { display: none !important; }321 .interactive { pointer-events: none; }322 @page { margin: 0.5in; size: landscape; }323 }324325 :root {326 /* Extended palette for dashboard components — supplements design-system.md vars */327 --bg: var(--light-gray);328 --surface: #ffffff;329 --border: var(--mid-gray);330 --border-light: var(--light-gray);331 --text-primary: var(--near-black);332 --text-secondary: var(--dark-gray);333 --text-tertiary: #8a8a85;334 --accent: var(--steel-blue);335 --green-bg: #f0f9f2;336 --red-bg: #fef2f2;337 --amber: #92600a;338 --amber-bg: #fefce8;339 --blue-bg: #eff6ff;340 --node-supplier: var(--mid-gray);341 --node-customer: #dde8f0;342 --node-target: var(--navy);343 --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;344 --mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;345 }346347 /* Layout */348 .page-header {349 background: var(--surface);350 border-bottom: 3px solid var(--navy);351 padding: 24px 40px 16px;352 }353 .page-header h1 {354 font-size: 28px;355 font-weight: 700;356 color: var(--navy);357 letter-spacing: -0.5px;358 line-height: 1.2;359 }360 .page-header .subtitle {361 font-size: 14px;362 color: var(--text-secondary);363 margin-top: 4px;364 }365 .page-header .dateline {366 font-size: 12px;367 color: var(--text-tertiary);368 margin-top: 8px;369 font-family: var(--mono);370 }371372 .container {373 max-width: 1400px;374 margin: 0 auto;375 padding: 24px 40px;376 }377378 /* Section Headers */379 h2 {380 font-family: var(--sans);381 font-size: 20px;382 font-weight: 700;383 margin: 32px 0 16px;384 padding-bottom: 6px;385 border-bottom: 1px solid var(--mid-gray);386 letter-spacing: -0.3px;387 color: var(--navy);388 }389 h3 {390 font-family: var(--sans);391 font-size: 13px;392 font-weight: 700;393 text-transform: uppercase;394 letter-spacing: 0.8px;395 color: var(--steel-blue);396 margin: 20px 0 10px;397 }398399 /* KPI Bar */400 .kpi-bar {401 display: flex;402 gap: 0;403 border: 1px solid var(--border);404 border-radius: 6px;405 overflow: hidden;406 background: var(--surface);407 margin: 16px 0;408 }409 .kpi-item {410 flex: 1;411 padding: 12px 16px;412 border-right: 1px solid var(--border-light);413 text-align: center;414 }415 .kpi-item:last-child { border-right: none; }416 .kpi-label {417 font-size: 10px;418 text-transform: uppercase;419 letter-spacing: 0.5px;420 color: var(--text-tertiary);421 font-weight: 600;422 }423 .kpi-value {424 font-size: 18px;425 font-weight: 700;426 margin-top: 2px;427 font-variant-numeric: tabular-nums;428 }429 .kpi-sub {430 font-size: 11px;431 color: var(--text-tertiary);432 margin-top: 1px;433 }434435 /* Supply Chain Visualization */436 .chain-view {437 display: flex;438 gap: 24px;439 align-items: flex-start;440 margin: 20px 0;441 overflow-x: auto;442 padding-bottom: 16px;443 }444 .chain-column {445 min-width: 280px;446 flex-shrink: 0;447 }448 .chain-column-header {449 font-family: var(--sans);450 font-size: 11px;451 font-weight: 700;452 text-transform: uppercase;453 letter-spacing: 1px;454 color: var(--text-tertiary);455 margin-bottom: 12px;456 padding-bottom: 6px;457 border-bottom: 1px solid var(--border);458 text-align: center;459 }460 .chain-arrow {461 display: flex;462 align-items: center;463 justify-content: center;464 color: var(--text-tertiary);465 font-size: 24px;466 min-width: 40px;467 padding-top: 40px;468 flex-shrink: 0;469 }470471 /* Company Cards */472 .company-card {473 background: var(--surface);474 border: 1px solid var(--border);475 border-radius: 6px;476 padding: 14px 16px;477 margin-bottom: 10px;478 cursor: pointer;479 transition: border-color 0.15s, box-shadow 0.15s;480 }481 .company-card:hover {482 border-color: var(--text-secondary);483 box-shadow: 0 2px 8px rgba(0,0,0,0.06);484 }485 .company-card.target-card {486 background: var(--navy);487 color: white;488 border-color: var(--navy);489 }490 .company-card.target-card .card-ticker { color: rgba(255,255,255,0.7); }491 .company-card.target-card .card-metric-label { color: rgba(255,255,255,0.5); }492 .company-card.target-card .card-metric-value { color: white; }493 .company-card.target-card .card-desc { color: rgba(255,255,255,0.7); }494 .company-card.expanded { border-color: var(--steel-blue); box-shadow: 0 2px 12px rgba(74,111,165,0.15); }495 .company-card.supplier-card { border-left: 3px solid var(--node-supplier); }496 .company-card.customer-card { border-left: 3px solid var(--node-customer); }497498 .card-header {499 display: flex;500 justify-content: space-between;501 align-items: flex-start;502 }503 .card-name {504 font-family: var(--sans);505 font-size: 16px;506 font-weight: 700;507 line-height: 1.2;508 }509 .card-ticker {510 font-family: var(--mono);511 font-size: 11px;512 color: var(--text-tertiary);513 margin-top: 2px;514 }515 .card-badge {516 font-size: 10px;517 font-weight: 700;518 padding: 2px 8px;519 border-radius: 3px;520 white-space: nowrap;521 }522 .badge-pct-high { background: var(--red-bg); color: var(--red); }523 .badge-pct-med { background: var(--amber-bg); color: var(--amber); }524 .badge-pct-low { background: var(--green-bg); color: var(--green); }525526 .card-supplies {527 font-size: 12px;528 color: var(--text-secondary);529 margin-top: 6px;530 line-height: 1.4;531 }532533 .card-metrics {534 display: grid;535 grid-template-columns: repeat(3, 1fr);536 gap: 8px;537 margin-top: 10px;538 padding-top: 10px;539 border-top: 1px solid var(--border-light);540 }541 .card-metric-label {542 font-size: 9px;543 text-transform: uppercase;544 letter-spacing: 0.3px;545 color: var(--text-tertiary);546 }547 .card-metric-value {548 font-size: 13px;549 font-weight: 700;550 font-variant-numeric: tabular-nums;551 }552553 .card-desc {554 font-size: 12px;555 color: var(--text-secondary);556 margin-top: 8px;557 line-height: 1.45;558 }559560 /* Expanded Detail Panel */561 .detail-panel {562 display: none;563 margin-top: 12px;564 padding-top: 12px;565 border-top: 1px solid var(--border-light);566 }567 .company-card.expanded .detail-panel { display: block; }568569 .detail-section {570 margin-bottom: 14px;571 }572 .detail-section h4 {573 font-size: 11px;574 font-weight: 700;575 text-transform: uppercase;576 letter-spacing: 0.5px;577 color: var(--text-tertiary);578 margin-bottom: 6px;579 }580581 .relationship-bar {582 height: 8px;583 background: var(--border-light);584 border-radius: 4px;585 overflow: hidden;586 margin: 4px 0;587 }588 .relationship-fill {589 height: 100%;590 border-radius: 4px;591 transition: width 0.3s;592 }593 .fill-red { background: var(--red); }594 .fill-amber { background: var(--amber); }595 .fill-green { background: var(--green); }596 .fill-blue { background: var(--accent); }597598 /* Drill-down button */599 .drill-btn {600 display: inline-block;601 font-size: 11px;602 font-weight: 600;603 color: var(--accent);604 cursor: pointer;605 padding: 4px 0;606 border: none;607 background: none;608 font-family: var(--sans);609 }610 .drill-btn:hover { text-decoration: underline; }611612 /* Concentration Table */613 .conc-table {614 width: 100%;615 border-collapse: collapse;616 font-size: 13px;617 margin: 12px 0;618 }619 .conc-table th {620 font-size: 10px;621 text-transform: uppercase;622 letter-spacing: 0.5px;623 color: var(--text-tertiary);624 font-weight: 600;625 text-align: left;626 padding: 6px 10px;627 border-bottom: 2px solid var(--border);628 background: var(--bg);629 }630 .conc-table th:not(:first-child) { text-align: right; }631 .conc-table td {632 padding: 8px 10px;633 border-bottom: 1px solid var(--border-light);634 font-variant-numeric: tabular-nums;635 }636 .conc-table td:not(:first-child) { text-align: right; }637 .conc-table tr:hover { background: var(--blue-bg); }638 .conc-table .row-total {639 font-weight: 700;640 border-top: 2px solid var(--border);641 background: var(--bg);642 }643644 /* Risk indicator */645 .risk-tag {646 display: inline-block;647 font-size: 10px;648 font-weight: 700;649 padding: 1px 6px;650 border-radius: 3px;651 }652 .risk-high { background: var(--red-bg); color: var(--red); }653 .risk-med { background: var(--amber-bg); color: var(--amber); }654 .risk-low { background: var(--green-bg); color: var(--green); }655656 /* Tabs for switching views */657 .tab-bar {658 display: flex;659 gap: 0;660 border-bottom: 2px solid var(--border);661 margin-bottom: 20px;662 }663 .tab {664 padding: 10px 20px;665 font-size: 13px;666 font-weight: 600;667 color: var(--text-tertiary);668 cursor: pointer;669 border-bottom: 2px solid transparent;670 margin-bottom: -2px;671 transition: color 0.15s, border-color 0.15s;672 font-family: var(--sans);673 background: none;674 border-top: none;675 border-left: none;676 border-right: none;677 }678 .tab:hover { color: var(--text-primary); }679 .tab.active {680 color: var(--text-primary);681 border-bottom-color: var(--text-primary);682 }683 .tab-content { display: none; }684 .tab-content.active { display: block; }685686 /* Methodology / Source Notes */687 .methodology-box {688 background: var(--bg);689 border: 1px solid var(--border);690 border-radius: 6px;691 padding: 16px 20px;692 margin: 16px 0;693 font-size: 12px;694 color: var(--text-secondary);695 line-height: 1.5;696 }697 .methodology-box h4 {698 font-size: 11px;699 font-weight: 700;700 text-transform: uppercase;701 letter-spacing: 0.5px;702 color: var(--text-tertiary);703 margin-bottom: 8px;704 }705706 /* Links & References */707 a { color: var(--accent); text-decoration: none; }708 a:hover { text-decoration: underline; }709710 .source-tag {711 font-size: 9px;712 color: var(--text-tertiary);713 font-style: italic;714 }715716 /* Footer */717 .page-footer {718 margin-top: 40px;719 padding: 16px 0;720 border-top: 3px solid var(--navy);721 font-size: 11px;722 color: var(--text-tertiary);723 text-align: center;724 }725726 /* Print button */727 .dl-btn {728 display: inline-block;729 padding: 10px 24px;730 background: var(--navy);731 color: white;732 border: none;733 border-radius: 5px;734 font-size: 13px;735 font-weight: 600;736 cursor: pointer;737 font-family: var(--sans);738 }739 .dl-btn:hover { background: var(--steel-blue); }740741 /* Two-column layout */742 .two-col {743 display: grid;744 grid-template-columns: 1fr 1fr;745 gap: 20px;746 }747 @media (max-width: 800px) {748 .two-col { grid-template-columns: 1fr; }749 .chain-view { flex-direction: column; }750 .chain-arrow { transform: rotate(90deg); padding-top: 0; }751 }752</style>753</head>754```755756### Core JavaScript Pattern757758The dashboard uses vanilla JavaScript for interactivity. Include these functions in a `<script>` tag at the end of the body:759760```javascript761<script>762// Tab switching763function switchTab(tabId) {764 document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));765 document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));766 document.querySelector(`[data-tab="${tabId}"]`).classList.add('active');767 document.getElementById(tabId).classList.add('active');768}769770// Card expand/collapse771function toggleCard(cardId) {772 const card = document.getElementById(cardId);773 card.classList.toggle('expanded');774}775776// Navigate to tier 2 view for a specific supplier777function drillDown(companyTicker) {778 // Switch to the tier-2 tab and scroll to the relevant section779 switchTab('tier2');780 const section = document.getElementById('tier2-' + companyTicker);781 if (section) {782 section.scrollIntoView({ behavior: 'smooth', block: 'start' });783 section.style.outline = '2px solid var(--accent)';784 setTimeout(() => { section.style.outline = 'none'; }, 2000);785 }786}787788// Initialize789document.addEventListener('DOMContentLoaded', () => {790 // Set first tab active791 const firstTab = document.querySelector('.tab');792 if (firstTab) firstTab.click();793});794</script>795```796797---798799## DOCUMENT STRUCTURE800801The HTML document has these sections. Every section is mandatory.802803### Section 1: Print Button Bar804```html805<div class="no-print" style="text-align:center; padding:16px; background:var(--surface); border-bottom:1px solid var(--border);">806 <button class="dl-btn" onclick="window.print()">Download as PDF</button>807 <span style="font-size:12px; color:var(--text-tertiary); margin-left:12px;">or Cmd+P → Save as PDF</span>808</div>809```810811### Section 2: Page Header812```html813<div class="page-header">814 <h1>[TICKER] — Supply Chain Map</h1>815 <div class="subtitle">[Full Company Name] · Interactive Supply Chain Analysis</div>816 <div class="dateline">Prepared [Date] · Data sourced from <a href="https://daloopa.com">Daloopa</a> · TTM through [Latest Quarter]</div>817</div>818```819820### Section 3: Target Company KPI Bar821Show 6 KPIs for the target company:822```html823<div class="container">824 <div class="kpi-bar">825 <div class="kpi-item"><div class="kpi-label">TTM Revenue</div><div class="kpi-value">$XXB</div></div>826 <div class="kpi-item"><div class="kpi-label">TTM COGS</div><div class="kpi-value">$XXB</div></div>827 <div class="kpi-item"><div class="kpi-label">Gross Margin</div><div class="kpi-value">XX.X%</div></div>828 <div class="kpi-item"><div class="kpi-label">Suppliers Mapped</div><div class="kpi-value">XX</div></div>829 <div class="kpi-item"><div class="kpi-label">Top 5 = % of COGS</div><div class="kpi-value">~XX%</div></div>830 <div class="kpi-item"><div class="kpi-label">Key Customers</div><div class="kpi-value">XX</div></div>831 </div>832```833834### Section 4: Page Layout835836The dashboard uses a **single scrollable page** (no tabs) with the following vertical order:8371. KPI bar (target company overview)8382. Canvas network visualization (full chain: Tier 3 → Tier 2 → Tier 1 → Target → Customers → Tier 2 Customers)8393. Inventory Health Overview table (suppliers AND customers)8404. Supplier cards grouped by tier8415. Customer cards grouped by category8426. Upstream Shock Analysis (demand shock → suppliers, narrative + impact matrix)8437. Downstream Shock Analysis (supply disruption → customers, narrative + impact matrix)8448. Concentration Analysis summary (both upstream and downstream)8459. Footer846847Each supplier and customer card is clickable — opening a **full-screen detail overlay** with 10-quarter financials, inventory tables, and Canvas charts. The overlay is dismissed with × or backdrop click.848849### Section 5: Canvas Network Visualization850851Replace the HTML card-based chain view with a **Canvas-based tier-grouped network**:852853- Use a `<canvas>` element spanning the full container width, ~420px height854- **Column layout**: Tier 3 (left) → Tier 2 → Tier 1 → Target (center) → Customers (right)855- Draw each company as a rounded rectangle node with ticker label856- Draw connection lines (bezier curves or straight lines) between related nodes857- Color-code by tier: Target = navy (#1B2A4A), Tier 1 = steel blue (#4A6FA5), Tier 2 = gold (#C5A55A), Tier 3 = dark gray (#6C757D), Customers = mid gray (#E9ECEF)858- **Clickable nodes**: Track click coordinates with a `click` event listener on the canvas, determine which node was clicked via hit-testing, then open the detail overlay for that company859- Column headers ("TIER 1", "TIER 2", "TARGET", etc.) drawn as text above each column860- Responsive: redraw on `window.resize`861862```javascript863// Example network drawing function pattern:864function drawNetwork() {865 const cv = document.getElementById('networkCanvas');866 const ctx = cv.getContext('2d');867 cv.width = cv.parentElement.clientWidth;868 cv.height = 420;869 ctx.clearRect(0, 0, cv.width, cv.height);870871 // Define columns: x positions for each tier872 const cols = {873 tier3: cv.width * 0.08,874 tier2: cv.width * 0.28,875 tier1: cv.width * 0.48,876 target: cv.width * 0.68,877 customers: cv.width * 0.88878 };879880 // Draw column headers, nodes, and connection lines881 // Store node positions for hit-testing on click882}883```884885### Section 5b: Inventory Health Overview886887Below the network, add an **Inventory Health Overview** table showing all suppliers AND customers:888889```890| Company | Ticker | Role | Total Inventory | RM% | WIP% | FG% | Composition Bar |891```892893- The "Role" column shows "Supplier T1", "Supplier T2", "Customer", or "Target"894- The "Composition Bar" column renders a stacked horizontal bar (RM = blue, WIP = amber, FG = green) using inline CSS `background: linear-gradient(...)`895- Sort by total inventory descending or by FG% descending (highest FG% = most demand-shock exposure)896- Include the target company at the top of the table, then suppliers, then customers897- Each inventory value must link to its Daloopa citation898- **Analytical note**: For suppliers, rising FG% signals demand weakness from the target. For customers, rising RM% signals stockpiling of the target's inputs (bullish near-term, potential destocking risk later). Falling RM% at customers signals reduced orders ahead.899900### Section 5c: Supplier Cards by Tier901902Below the inventory overview, render supplier cards grouped under tier headings:903904```905── TIER 1 · Critical / Sole-Source ──────906[Card: TSMC] [Card: Samsung] [Card: Broadcom] ...907908── TIER 2 · Major Component ─────────────909[Card: Qualcomm] [Card: Skyworks] [Card: TXN] ...910911── TIER 3 · Specialty ───────────────────912[Card: Corning] [Card: Cirrus Logic] ...913```914915Each card shows: Company name, ticker, what they supply, TTM revenue, gross margin, estimated % of target COGS, a colored dot for tier. Clicking a card opens the detail overlay.916917### Section 5d: Customer Cards by Category918919Below the supplier cards, render customer cards grouped under category headings:920921```922── CHANNEL PARTNERS · Distribution & Retail ──────923[Card: Best Buy] [Card: AT&T] [Card: Verizon] ...924925── ENTERPRISE / B2B · Direct Customers ───────────926[Card: Enterprise customer 1] [Card: Enterprise customer 2] ...927928── END-MARKET EXPOSURE · Indirect Demand ─────────929[Card: End-market exposure 1] ...930```931932Categories should be adapted to the target company's business model:933- **B2B/Components companies**: Group by end-market vertical (Auto, Aeros934935…(truncated)