{# Finite State briefing shell — full HTML document template consumed via {% extends "_briefing_shell.html" %} (NOT include — {% block %}s only resolve through inheritance). Owns: the document doctype, html, head (tokens via _design_system, fonts, readiness beacons), body, the 880px briefing page frame, and the per-page header/footer. Fragment-mode contract (T0b § item 3): The shell wraps ALL document chrome (DOCTYPE, html, head, body open/close, briefing header/footer, .page wrapper) in a render-mode gate (see the actual if/endif pair further down). In fragment mode the shell emits ONLY the block content — no chrome. The fragment_extractor (fs_report/renderers/fragment_extractor.py) strips chrome and re-emits scoped styles; the compound assembler (B1) is responsible for shared chrome (cover page, page-break CSS, library loads) at bundle level. Recipe templates that extend this shell do NOT add their own render-mode wrapper — the shell owns it. Token + design-system contract (post-T0a reconciliation): This shell includes ONLY {% include "_design_system.html" %}. _design_system.html includes _tokens_inline.html transitively (T0a Task 3 outcome), so including _tokens_inline.html directly here would double-emit the token {% if render_mode != 'fragment' %}
{% block briefing_header %} {# Default chrome: Finite State logo on the left, metadata band on the right (recipe name · period · generated · record count · folder · project). Each label+value pair is wrapped in .meta-segment with white-space:nowrap so segments stay together; bullets between segments are the natural break points if the band is too long for one line. Recipes override this block ONLY if they need different chrome — the default fits every Phase 1a briefing recipe. #} {% include "_default_logo.html" %} {{ recipe_name | default("Briefing") }} {% if start_date and end_date %} · {{ start_date }} → {{ end_date }}{% endif %} {% if generated_at %} · Generated {{ generated_at }}{% endif %} {% if metadata and metadata.transformed_count is defined %} · {{ metadata.transformed_count }} records{% endif %} {% if folder_path %} · Folder: {{ folder_path }}{% endif %} {% if scan_metadata and scan_metadata.project_name %} · Project: {{ scan_metadata.project_name }}{% elif project_label %} · Project: {{ project_label }}{% endif %} {# B1 #15: surface a portfolio-wide scope — the only case the project/ folder segments above leave blank — so an unpinned report isn't silent about what it covers. #} {% if effective_scope is defined and effective_scope and effective_scope.scope_kind == 'portfolio' %} · Scope: Portfolio{% endif %} {% endblock %}{# Theme toggle lives in the shell chrome (outside the briefing_header block so a recipe overriding that block can't drop it). _theme_init.html — included transitively via _design_system.html in — already restores localStorage["fs-theme"] pre-paint and enforces explicit-theme/pdf_mode determinism, so the button only mounts the control; it adds NO restore-on-load script (a second initializer would fight the PDF determinism). @media print in _design_system.html hides .fs-theme-toggle, so PDFs are unaffected. #}{% include "_theme_toggle.html" %}
{% else %} {# Fragment mode: emit a
wrapper so the ancestor-scoped .briefing CSS selectors continue to match. The document is gated out in fragment mode, so without this wrapper the briefing styles would have nothing to attach to. (B1.4 follow-up.) #}
{% endif %} {# Content blocks render in ALL modes — fragment included. #} {% block page_frame %} {% block hero %}{% endblock %} {% block stats %}{% endblock %} {% block actions %}{% endblock %} {% block distribution %}{% endblock %} {% block methodology %}{% endblock %} {% block sections %}{% endblock %} {% endblock %} {% if render_mode != 'fragment' %}
{% else %}
{% endif %}