{# ═══════════════════════════════════════════════════════════════════════════
HB360 report body — server-rendered saved estimate + (optional) Package B
report. Used by the account page (/tools/my-estimate) and the public
share view. Context: estimate (array), report (array|null), project.
Parent page must include _hb360_tags.html.twig once (pills CSS/JS).
═══════════════════════════════════════════════════════════════════════════ #}
{% import '@HoneybeeWeb/inc/_hb360_tags.html.twig' as hb360 %}
<style>
.hbr-headline { background: var(--n-dark); border-radius: var(--n-radius-sm); padding: 22px 20px; text-align: center; margin-bottom: 14px; }
.hbr-headline .v { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 2.2rem; color: #fff; line-height: 1.05; }
.hbr-headline .l { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); margin-top: 6px; }
.hbr-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 4px 0 14px; }
@media (min-width: 720px) { .hbr-kpis { grid-template-columns: repeat(4, 1fr); } }
.hbr-kpi { background: var(--n-cream); border: 1px solid var(--n-border); border-radius: var(--n-radius-sm); padding: 14px 16px; }
.hbr-kpi .v { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.3rem; color: var(--n-dark); line-height: 1.1; }
.hbr-kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--n-muted); margin: 4px 0 6px; }
.hbr-sec { margin: 26px 0 10px; }
.hbr-sec h3 { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--n-dark); margin: 0 0 2px; }
.hbr-sec .sub { font-size: 12px; color: var(--n-muted); }
.hbr-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.hbr-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--n-muted); padding: 7px 8px; border-bottom: 1.5px solid var(--n-border-md); }
.hbr-table td { padding: 8px; border-bottom: 1px solid var(--n-border); color: var(--n-dark); }
.hbr-table td.num, .hbr-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.hbr-table tfoot td { font-weight: 800; border-top: 1.5px solid var(--n-border-md); border-bottom: none; }
.hbr-bar { background: var(--n-amber-dim); height: 10px; border-radius: 5px; position: relative; overflow: hidden; min-width: 60px; }
.hbr-bar span { position: absolute; inset: 0 auto 0 0; background: var(--n-amber); border-radius: 5px; }
.hbr-verdict { border-left: 3px solid var(--n-amber); background: var(--n-cream); border-radius: var(--n-radius-sm); padding: 12px 14px; font-size: 13px; color: var(--n-dark); line-height: 1.6; margin-top: 8px; }
.hbr-note { font-size: 12px; color: var(--n-muted); line-height: 1.6; margin-top: 16px; padding: 12px 14px; background: var(--n-cream); border-radius: var(--n-radius-sm); border-left: 3px solid var(--n-amber); }
</style>
{% set fig = estimate.figures|default({}) %}
{# ── The saved estimate (Package A recap) ── #}
<div class="hbr-headline">
<div class="v">€{{ estimate.annual_savings|number_format(0, ',', '.') }}</div>
<div class="l">estimated bill saving / year {{ hb360.tag('assumed', fig.annual_savings.basis|default('')) }}</div>
</div>
<div class="hbr-kpis">
<div class="hbr-kpi"><div class="v">{{ estimate.kwp|number_format(estimate.kwp < 100 ? 1 : 0, ',', '.') }}</div><div class="l">System size (kWp)</div>{{ hb360.tag(fig.system_kwp.tag|default('assumed'), fig.system_kwp.basis|default('')) }}</div>
<div class="hbr-kpi"><div class="v">{{ estimate.annual_gen_kwh|number_format(0, ',', '.') }}</div><div class="l">Annual yield (kWh)</div>{{ hb360.tag(fig.annual_yield.tag|default('assumed'), fig.annual_yield.basis|default('')) }}</div>
<div class="hbr-kpi"><div class="v">€{{ estimate.capex_eur|number_format(0, ',', '.') }}</div><div class="l">Indicative CAPEX</div>{{ hb360.tag(fig.capex.tag|default('assumed'), fig.capex.basis|default('')) }}</div>
<div class="hbr-kpi"><div class="v">{{ estimate.payback_years ? estimate.payback_years ~ ' yrs' : '—' }}</div><div class="l">Simple payback</div>{{ hb360.tag(fig.payback.tag|default('assumed'), fig.payback.basis|default('')) }}</div>
</div>
<div style="font-size:12.5px;color:var(--n-muted)">
{{ estimate.panels|number_format(0, ',', '.') }} modules · roof {{ estimate.area_m2|number_format(0, ',', '.') }} m²
{{ hb360.tag(fig.roof_area.tag|default('assumed'), fig.roof_area.basis|default('')) }} ·
sources: {{ estimate.yield_source|default('—') }}{{ estimate.roof_source is defined and estimate.roof_source ? ' · roof via ' ~ estimate.roof_source : '' }} ·
site works {{ hb360.tag('needs site survey', fig.structure.basis|default('')) }}
</div>
{% if report %}
{# ── Package B: full feasibility ── #}
{% set rfig = report.figures|default({}) %}
<div class="hbr-sec">
<h3>System design {{ hb360.tag(rfig.design.tag|default('assumed'), rfig.design.basis|default('')) }}</h3>
<table class="hbr-table">
<tr><td>Array</td><td class="num">{{ report.design.panels|number_format(0, ',', '.') }} × {{ report.design.module_wp }} Wp = {{ report.design.kwp|number_format(report.design.kwp < 100 ? 1 : 0, ',', '.') }} kWp</td></tr>
<tr><td>Inverter capacity (AC)</td><td class="num">{{ report.design.inverter_ac_kw|number_format(1, ',', '.') }} kW (DC/AC {{ report.design.dc_ac_ratio }})</td></tr>
<tr><td>Array area</td><td class="num">{{ report.design.array_area_m2|number_format(0, ',', '.') }} m²</td></tr>
<tr><td>Specific yield</td><td class="num">{{ report.design.specific_yield|number_format(0, ',', '.') }} kWh/kWp/yr</td></tr>
</table>
</div>
<div class="hbr-sec">
<h3>Month-by-month generation {{ hb360.tag(rfig.monthly.tag|default('assumed'), rfig.monthly.basis|default('')) }}</h3>
{% set maxGen = (report.monthly|map(m => m.gen_kwh)|sort)|last %}
<table class="hbr-table">
<thead><tr><th>Month</th><th style="width:40%"></th><th class="num">Generation</th><th class="num">Used on site</th><th class="num">Export</th></tr></thead>
<tbody>
{% for m in report.monthly %}
<tr>
<td>{{ m.month }}</td>
<td><div class="hbr-bar"><span style="width:{{ maxGen > 0 ? (100 * m.gen_kwh / maxGen)|round : 0 }}%"></span></div></td>
<td class="num">{{ m.gen_kwh|number_format(0, ',', '.') }}</td>
<td class="num">{{ m.offset_kwh|number_format(0, ',', '.') }}</td>
<td class="num">{{ m.export_kwh|number_format(0, ',', '.') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="hbr-sec">
<h3>Load match {{ hb360.tag(rfig.load_match.tag|default('assumed'), rfig.load_match.basis|default('')) }}</h3>
<table class="hbr-table">
<tr><td>Your annual consumption</td><td class="num">{{ report.load_match.annual_consumption_kwh|number_format(0, ',', '.') }} kWh</td></tr>
<tr><td>Solar used on site</td><td class="num">{{ report.load_match.offset_kwh|number_format(0, ',', '.') }} kWh ({{ report.load_match.self_consumption_pct }}% of generation)</td></tr>
{% if report.load_match.bill_coverage_pct is not null %}
<tr><td>Bill coverage</td><td class="num">{{ report.load_match.bill_coverage_pct }}%</td></tr>
{% endif %}
<tr><td>Surplus to grid {{ hb360.tag('needs utility approval', rfig.export_revenue.basis|default('')) }}</td><td class="num">{{ report.load_match.export_kwh|number_format(0, ',', '.') }} kWh</td></tr>
<tr><td>Still imported from grid</td><td class="num">{{ report.load_match.import_kwh|number_format(0, ',', '.') }} kWh</td></tr>
</table>
</div>
<div class="hbr-sec">
<h3>Battery (BESS) indication {{ hb360.tag(rfig.bess.tag|default('needs site survey'), rfig.bess.basis|default('')) }}</h3>
<div class="hbr-verdict">
{% if report.bess.recommended is same as(true) %}<b>🔋 Worth modelling.</b>{% elseif report.bess.recommended is same as(false) %}<b>Not indicated yet.</b>{% else %}<b>Needs your usage.</b>{% endif %}
{{ report.bess.verdict }}
</div>
</div>
<div class="hbr-sec">
<h3>25-year economics {{ hb360.tag(rfig.roi.tag|default('assumed'), rfig.roi.basis|default('')) }}</h3>
<div class="hbr-kpis" style="margin-top:8px">
<div class="hbr-kpi"><div class="v">{{ report.roi.payback_years ? report.roi.payback_years ~ ' yrs' : '> 25 yrs' }}</div><div class="l">Payback</div></div>
<div class="hbr-kpi"><div class="v">€{{ report.roi.net_benefit_25yr|number_format(0, ',', '.') }}</div><div class="l">25-yr net benefit</div></div>
<div class="hbr-kpi"><div class="v">€{{ report.roi.npv|number_format(0, ',', '.') }}</div><div class="l">NPV @ {{ report.roi.assumptions.discount_rate_pct }}%</div></div>
<div class="hbr-kpi"><div class="v">{{ report.load_match.self_consumption_pct }}%</div><div class="l">Self-consumption</div></div>
</div>
<table class="hbr-table">
<thead><tr><th>Year</th><th class="num">Saving</th><th class="num">O&M</th><th class="num">Cumulative</th></tr></thead>
<tbody>
{% for y in report.roi.years %}
{% if y.year in [1, 5, 10, 15, 20, 25] %}
<tr><td>{{ y.year }}</td><td class="num">€{{ y.saving|number_format(0, ',', '.') }}</td><td class="num">€{{ y.om|number_format(0, ',', '.') }}</td><td class="num">€{{ y.cumulative|number_format(0, ',', '.') }}</td></tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<div class="sub" style="font-size:12px;color:var(--n-muted);margin-top:6px">
Assumes {{ report.roi.assumptions.degradation_pct_yr }}%/yr degradation, {{ report.roi.assumptions.tariff_escalation_pct_yr }}%/yr tariff escalation,
O&M {{ report.roi.assumptions.om_pct_capex_yr }}% of CAPEX/yr. Savings from self-consumed energy only — export revenue excluded
{{ hb360.tag('needs utility approval', rfig.export_revenue.basis|default('')) }}.
</div>
</div>
<div class="hbr-sec">
<h3>Bill of quantities {{ hb360.tag(rfig.boq.tag|default('needs site survey'), rfig.boq.basis|default('')) }}</h3>
<table class="hbr-table">
<thead><tr><th>Item</th><th class="num">Qty</th><th>Unit</th><th>Note</th></tr></thead>
<tbody>
{% for b in report.boq %}
<tr><td>{{ b.item }}</td><td class="num">{{ b.qty|number_format(0, ',', '.') }}</td><td>{{ b.unit }}</td><td style="color:var(--n-muted)">{{ b.note }}</td></tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="hbr-sec">
<h3>Indicative cost split {{ hb360.tag(rfig.cost_split.tag|default('assumed'), rfig.cost_split.basis|default('')) }}</h3>
<table class="hbr-table">
<tbody>
{% for s in report.cost_split %}
<tr><td>{{ s.block }}</td><td class="num">{{ s.share_pct }}%</td><td class="num">€{{ s.amount|number_format(0, ',', '.') }}</td></tr>
{% endfor %}
</tbody>
<tfoot><tr><td colspan="2">Indicative CAPEX (ex-VAT)</td><td class="num">€{{ report.capex_eur|number_format(0, ',', '.') }}</td></tr></tfoot>
</table>
</div>
{% if report.package_c is defined and report.package_c.ok|default(false) %}
{% set pc = report.package_c %}
{% set cfig = pc.figures|default({}) %}
<div class="hbr-sec" style="border-top:2px solid var(--n-border-md);padding-top:18px;margin-top:30px">
<h3>Package C — hybrid design (PV + battery + backup + EV)</h3>
<div class="sub">Battery absorbs the surplus first, EV charging uses what remains, the genset is capacity insurance, finance sees the whole package.</div>
</div>
<div class="hbr-sec">
<h3>Battery storage {{ hb360.tag(cfig.bess.tag|default('needs site survey'), cfig.bess.basis|default('')) }}</h3>
{% if pc.bess.ok|default(false) %}
<table class="hbr-table">
<tr><td>Recommended size</td><td class="num">{{ pc.bess.nameplate_kwh|number_format(1, ',', '.') }} kWh / {{ pc.bess.power_kw|number_format(1, ',', '.') }} kW</td></tr>
<tr><td>Energy shifted to evening use</td><td class="num">{{ pc.bess.shifted_kwh_yr|number_format(0, ',', '.') }} kWh/yr</td></tr>
<tr><td>Self-consumption</td><td class="num">{{ pc.bess.self_consumption_before_pct }}% → {{ pc.bess.self_consumption_after_pct }}%</td></tr>
<tr><td>Indicative cost / added saving</td><td class="num">€{{ pc.bess.capex_eur|number_format(0, ',', '.') }} / €{{ pc.bess.saving_eur_yr|number_format(0, ',', '.') }} per yr</td></tr>
<tr><td>Battery payback</td><td class="num">{{ pc.bess.payback_years ? pc.bess.payback_years ~ ' yrs' : '—' }}</td></tr>
</table>
{% else %}
<div class="hbr-verdict">{{ pc.bess.reason|default('Storage not sized.') }}</div>
{% endif %}
</div>
{% if pc.evse.ok|default(false) %}
<div class="hbr-sec">
<h3>EV charging {{ hb360.tag(cfig.evse.tag|default('needs utility approval'), cfig.evse.basis|default('')) }}</h3>
<table class="hbr-table">
<thead><tr><th>Charger</th><th class="num">Count</th><th class="num">Annual energy</th><th class="num">Indicative cost</th></tr></thead>
<tbody>
{% for c in pc.evse.chargers %}
<tr><td>{{ c.type }}</td><td class="num">{{ c.count }}</td><td class="num">{{ c.annual_kwh|number_format(0, ',', '.') }} kWh</td><td class="num">€{{ c.capex_eur|number_format(0, ',', '.') }}</td></tr>
{% endfor %}
</tbody>
</table>
<table class="hbr-table">
<tr><td>Added diversified peak</td><td class="num">{{ pc.evse.diversified_peak_kw|number_format(1, ',', '.') }} kW (diversity {{ pc.evse.diversity_factor }})</td></tr>
<tr><td>Covered by PV surplus</td><td class="num">{{ pc.evse.pv_covered_kwh|number_format(0, ',', '.') }} kWh ({{ pc.evse.pv_coverage_pct }}%)</td></tr>
<tr><td>Grid energy for charging</td><td class="num">{{ pc.evse.grid_kwh|number_format(0, ',', '.') }} kWh ≈ €{{ pc.evse.energy_cost_eur_yr|number_format(0, ',', '.') }}/yr</td></tr>
</table>
<div class="hbr-verdict">{{ pc.evse.grid_note }} {{ hb360.tag('needs utility approval') }}</div>
</div>
{% endif %}
{% if pc.genset.ok|default(false) %}
<div class="hbr-sec">
<h3>Backup genset {{ hb360.tag(cfig.genset.tag|default('needs site survey'), cfig.genset.basis|default('')) }}</h3>
<div class="hbr-verdict">{% if pc.genset.recommended %}<b>⚙ Recommended.</b>{% else %}<b>Optional.</b>{% endif %} {{ pc.genset.verdict }}</div>
<table class="hbr-table">
<tr><td>Critical load / frame size</td><td class="num">{{ pc.genset.critical_kw|number_format(1, ',', '.') }} kW → {{ pc.genset.kva }} kVA</td></tr>
<tr><td>Battery ride-through</td><td class="num">{{ pc.genset.bess_ride_through_hrs }} h</td></tr>
<tr><td>Indicative cost</td><td class="num">€{{ pc.genset.capex_eur|number_format(0, ',', '.') }}</td></tr>
<tr><td>Outage running cost</td><td class="num">€{{ pc.genset.running_cost_eur_yr|number_format(0, ',', '.') }}/yr ({{ pc.genset.fuel_l_yr|number_format(0, ',', '.') }} l diesel · €{{ pc.genset.diesel_cost_per_kwh }}/kWh vs grid €{{ pc.genset.grid_cost_per_kwh }})</td></tr>
</table>
</div>
{% endif %}
{% if pc.finance.ok|default(false) %}
<div class="hbr-sec">
<h3>Financing the package {{ hb360.tag(cfig.finance.tag|default('assumed'), cfig.finance.basis|default('')) }}</h3>
<div class="hbr-kpis" style="margin-top:8px">
<div class="hbr-kpi"><div class="v">€{{ pc.combined.capex_eur|number_format(0, ',', '.') }}</div><div class="l">Package CAPEX</div></div>
<div class="hbr-kpi"><div class="v">€{{ pc.combined.saving_eur_yr|number_format(0, ',', '.') }}</div><div class="l">Saving / yr</div></div>
<div class="hbr-kpi"><div class="v">{{ pc.combined.self_sufficiency_pct is not null ? pc.combined.self_sufficiency_pct ~ '%' : '—' }}</div><div class="l">Self-sufficiency</div></div>
<div class="hbr-kpi"><div class="v">{{ pc.finance.cash.irr_pct is not null ? pc.finance.cash.irr_pct ~ '%' : '—' }}</div><div class="l">IRR (cash)</div></div>
</div>
<table class="hbr-table">
<tr><td>Cash purchase</td><td class="num">payback {{ pc.finance.cash.payback_years ? pc.finance.cash.payback_years ~ ' yrs' : '> ' ~ pc.finance.assumptions.years ~ ' yrs' }} · NPV €{{ pc.finance.cash.npv|number_format(0, ',', '.') }}</td></tr>
<tr><td>{{ (pc.finance.assumptions.loan_share * 100)|round }}% loan @ {{ (pc.finance.assumptions.loan_rate * 100)|round(1) }}% / {{ pc.finance.assumptions.loan_years }} yrs</td>
<td class="num">equity €{{ pc.finance.loan.equity_eur|number_format(0, ',', '.') }} · instalment €{{ pc.finance.loan.annuity_eur_yr|number_format(0, ',', '.') }}/yr · {{ pc.finance.loan.self_financing ? 'saving covers the instalment from year 1' : 'cash-positive in year ' ~ (pc.finance.loan.cash_positive_year ?: '> ' ~ pc.finance.assumptions.years) }}</td></tr>
{% if pc.finance.lcoe.eur_per_kwh is not null %}
<tr><td>Levelized cost of your solar energy</td><td class="num">€{{ pc.finance.lcoe.eur_per_kwh|number_format(3, ',', '.') }}/kWh {{ pc.finance.lcoe.beats_grid ? '— beats' : '— above' }} your grid tariff (€{{ pc.finance.lcoe.grid_tariff }}/kWh)</td></tr>
{% endif %}
</table>
<div class="sub" style="font-size:12px;color:var(--n-muted);margin-top:6px">Indicative lenses — no tax, depreciation or subsidy treatment. Not an offer of finance.</div>
</div>
{% endif %}
<div class="hbr-note">{{ pc.disclaimer }}</div>
{% endif %}
{% if report.package_d is defined and report.package_d.ok|default(false) %}
{% set pd = report.package_d %}
{% set dfig = pd.figures|default({}) %}
<div class="hbr-sec" style="border-top:2px solid var(--n-border-md);padding-top:18px;margin-top:30px">
<h3>Package D — grid & connection concept</h3>
<div class="sub">Regime: {{ pd.jurisdiction_hint }} · A briefing pack for the DNO enquiry and the protection study — not a design.</div>
</div>
<div class="hbr-verdict" style="border-left-color:#b4452f;background:#fdf3f0">
<b>⚠ {{ pd.engineer_handoff.headline }}</b><br>
{{ pd.engineer_handoff.next }}
</div>
<div class="hbr-sec">
<h3>Nearby grid infrastructure {{ hb360.tag(dfig.scan.tag|default('assumed'), dfig.scan.basis|default('')) }}</h3>
{% if pd.scan.ok|default(false) %}
<table class="hbr-table">
<thead><tr><th>Asset</th><th class="num">Voltage</th><th class="num">Distance</th><th class="num">Confidence</th><th>Note</th></tr></thead>
<tbody>
{% for c in pd.scan.candidates %}
<tr>
<td>{{ c.type }}{{ c.name ? ' · ' ~ c.name : '' }}</td>
<td class="num">{{ c.voltage_kv is not null ? c.voltage_kv ~ ' kV' : '—' }}</td>
<td class="num">{{ c.distance_m|number_format(0, ',', '.') }} m</td>
<td class="num">{{ (c.confidence * 100)|round }}%</td>
<td style="color:var(--n-muted);font-size:12px">{{ c.note }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="sub" style="font-size:12px;color:var(--n-muted);margin-top:6px">{{ pd.scan.caveat }} Source: {{ pd.scan.source }}.</div>
{% else %}
<div class="hbr-verdict">{{ pd.scan.reason }}</div>
{% endif %}
{% if pd.route %}
<table class="hbr-table">
<tr><td>Indicative cable route to {{ pd.route.to }} {{ hb360.tag(dfig.route.tag|default('assumed'), dfig.route.basis|default('')) }}</td>
<td class="num">{{ pd.route.route_m|number_format(0, ',', '.') }} m ≈ €{{ pd.route.cost_eur|number_format(0, ',', '.') }} ({{ pd.route.eur_per_m }} €/m)</td></tr>
</table>
{% endif %}
</div>
<div class="hbr-sec">
<h3>Connection level indication {{ hb360.tag(dfig.connection.tag|default('needs utility approval'), dfig.connection.basis|default('')) }}</h3>
<table class="hbr-table">
<tr><td>Design capacity</td><td class="num">{{ pd.grid.design_kva|number_format(1, ',', '.') }} kVA (export {{ pd.grid.export_peak_kw }} kW / import {{ pd.grid.import_peak_kw }} kW{{ pd.grid.export_cap_pct < 100 ? ' · feed-in capped at ' ~ pd.grid.export_cap_pct ~ '%' : '' }})</td></tr>
<tr><td>Indicated level</td><td class="num">{{ pd.grid.level }} — {{ pd.grid.level_label }} ({{ pd.grid.regime }})</td></tr>
{% if pd.grid.transformer_kva %}
<tr><td>Transformer concept</td><td class="num">{{ pd.grid.transformer_kva }} kVA</td></tr>
{% endif %}
{% if pd.grid.existing_connection_kva %}
<tr><td>Your existing connection</td><td class="num">{{ pd.grid.existing_connection_kva }} kVA → headroom {{ pd.grid.headroom_kva }} kVA {{ pd.grid.upgrade_likely ? '· upgrade likely' : '· may suffice' }} {{ hb360.tag('needs utility approval') }}</td></tr>
{% endif %}
{% for it in pd.grid.budget.items %}
<tr><td style="color:var(--n-muted)">{{ it.item }}</td><td class="num">€{{ it.eur|number_format(0, ',', '.') }}</td></tr>
{% endfor %}
<tr><td><b>Indicative connection budget (excl. DNO charges)</b></td><td class="num"><b>€{{ pd.grid.budget.total_eur|number_format(0, ',', '.') }}</b></td></tr>
</table>
<div class="sub" style="font-size:12px;color:var(--n-muted);margin-top:6px">{{ pd.grid.caveat }}</div>
</div>
<div class="hbr-sec">
<h3>Protection concept checklist {{ hb360.tag(dfig.protection.tag|default('needs utility approval'), dfig.protection.basis|default('')) }}</h3>
<div style="overflow-x:auto">
<table class="hbr-table">
<thead><tr><th>Location</th><th>Function</th><th>ANSI</th><th>Standard</th><th>Scope</th></tr></thead>
<tbody>
{% for row in pd.protection.rows %}
<tr>
<td>{{ row.location }}</td>
<td>{{ row.function }}{{ row.note ? ' — ' : '' }}<span style="color:var(--n-muted);font-size:12px">{{ row.note }}</span></td>
<td class="num">{{ row.ansi }}</td>
<td style="font-size:12px">{{ row.standard }}</td>
<td style="font-size:11px;white-space:nowrap">{{ row.scope == 'study' ? '📐 study first' : '🧑🔧 engineer + DNO' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="hbr-verdict" style="border-left-color:#b4452f;background:#fdf3f0;margin-top:10px">
<b>No settings, no ratings, no coordination.</b> {{ pd.protection.caveat }}
</div>
</div>
<div class="hbr-sec">
<h3>EMS / plant control functions {{ hb360.tag(dfig.ems.tag|default('assumed'), dfig.ems.basis|default('')) }}</h3>
<table class="hbr-table">
<thead><tr><th>Function</th><th>Why</th><th>Where</th></tr></thead>
<tbody>
{% for fn in pd.ems.functions %}
<tr><td>{{ fn.function }}</td><td style="color:var(--n-muted);font-size:12px">{{ fn.why }}</td><td style="font-size:12px">{{ fn.where }}</td></tr>
{% endfor %}
</tbody>
</table>
<table class="hbr-table">
<thead><tr><th>Metering point</th><th>Why</th></tr></thead>
<tbody>
{% for m in pd.ems.metering %}
<tr><td>{{ m.point }}</td><td style="color:var(--n-muted);font-size:12px">{{ m.why }}</td></tr>
{% endfor %}
</tbody>
</table>
<div class="hbr-verdict">🐝 {{ pd.ems.honeycore_note }}</div>
</div>
<div class="hbr-sec">
<h3>What to bring to the DNO enquiry</h3>
<ul style="font-size:13px;color:var(--n-dark);line-height:1.9;margin:6px 0 0;padding-left:20px">
{% for b in pd.engineer_handoff.bring %}<li>{{ b }}</li>{% endfor %}
</ul>
</div>
<div class="hbr-note" style="border-left-color:#b4452f">{{ pd.disclaimer }}</div>
{% endif %}
<div class="hbr-note">{{ report.disclaimer }}</div>
<div style="margin-top:6px">{{ hb360.legend() }}</div>
{% else %}
<div class="hbr-note">{{ estimate.disclaimer|default('Indicative estimate only — not a quote.') }}</div>
{% endif %}