/* Results panel — sticky dark card with priority stats + full metrics */ function ResultsPanel({ result }) { const f = window.fmt; const fuel = window.SicosaEngine.FUELS[result.inputs.fuelType]; const profitBatchDisplay = result.inputs.includeFixedCosts ? result.profitPerBatchWithFixedAmd : result.profitPerBatchAmd; const profitBatchUsd = result.inputs.includeFixedCosts ? result.usd.profitPerBatchWithFixed : result.usd.profitPerBatch; const profitPositive = profitBatchDisplay > 0; // Priority outputs (top of panel) // 1. Cost per liter 2. Break-even selling price 3. Profit per batch return ( ); } function Section({ label }) { return (
{label}
); } function Metric({ k, amd, usd, unit, decimals = 0, signed = false, dim = false, strong = false }) { const f = window.fmt; const sign = signed && amd > 0 ? "+" : ""; const cls = "metrics__row" + (signed && amd > 0 ? " is-positive" : signed && amd < 0 ? " is-negative" : ""); const display = unit === "%" ? sign + amd.toFixed(decimals) + "%" : sign + (decimals > 0 ? f.amdL(amd) : f.amd(amd)) + (unit ? " " + unit : ""); return (
{k}
{display}
{usd != null ? "$" + f.usd(usd) : ""}
); } window.ResultsPanel = ResultsPanel;