<!-- Summary -->
<div class="flex items-center gap-4 mb-6">
    <div class="gate {% if total > 0 %}gate-fail{% else %}gate-pass{% endif %}">
        <span class="gate-icon">&#9678;</span>
        {{ total }} file{{ 's' if total != 1 }} affected
    </div>
    <div class="mono text-xs text-dim">
        {{ confirmed|length }} confirmed &middot; {{ potential|length }} potential &middot; depth {{ result.depth_reached }}
    </div>
</div>

<!-- Target symbol -->
<div class="card mb-6" style="padding:14px 18px;border-color:var(--accent)">
    <div class="flex items-center gap-3">
        <span class="badge badge-{{ result.symbol.kind }}">{{ result.symbol.kind }}</span>
        <span class="mono text-white" style="font-weight:600">{{ result.symbol.name }}</span>
        <span class="mono text-xs text-faint">{{ result.symbol.file }}</span>
    </div>
</div>

<!-- Mermaid graph -->
{% if total > 0 and total <= 30 %}
<div class="card mb-6" style="padding:20px;overflow-x:auto">
    <div class="section-title" style="margin-bottom:12px">Impact Graph</div>
    <pre class="mermaid">{{ mermaid_code }}</pre>
</div>
{% elif total > 30 %}
<div class="card mb-6" style="padding:16px">
    <div class="mono text-xs text-dim">Graph hidden ({{ total }} nodes would be too dense). See file lists below.</div>
</div>
{% endif %}

<!-- Confirmed files -->
{% if confirmed %}
<div class="mb-6">
    <div class="section-title">Confirmed ({{ confirmed|length }} files reference "{{ result.symbol.name }}")</div>
    <div class="table-frame">
        <table>
            <thead><tr><th>File</th><th class="r">Depth</th><th class="r">References</th><th>Symbols</th></tr></thead>
            <tbody>
                {% for entry in confirmed %}
                <tr>
                    <td class="mono bright text-sm">{{ entry.file }}</td>
                    <td class="mono r dim">{{ entry.depth }}</td>
                    <td class="mono r accent">{{ entry.occurrences }}</td>
                    <td>
                        {% for sym in entry.symbols[:5] %}
                        <span class="tag" style="margin:1px">{{ sym.name }}</span>
                        {% endfor %}
                        {% if entry.symbols|length > 5 %}
                        <span class="mono text-xs text-faint">+{{ entry.symbols|length - 5 }}</span>
                        {% endif %}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endif %}

<!-- Potential files -->
{% if potential %}
<div>
    <div class="section-title">Potential ({{ potential|length }} files import the module but don't reference "{{ result.symbol.name }}" by name)</div>
    <div class="table-frame">
        <table>
            <thead><tr><th>File</th><th class="r">Depth</th><th>Symbols</th></tr></thead>
            <tbody>
                {% for entry in potential %}
                <tr>
                    <td class="mono dim text-sm">{{ entry.file }}</td>
                    <td class="mono r faint">{{ entry.depth }}</td>
                    <td>
                        {% for sym in entry.symbols[:5] %}
                        <span class="tag" style="margin:1px">{{ sym.name }}</span>
                        {% endfor %}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endif %}

{% if total == 0 %}
<div class="empty-state">
    <div style="font-size:20px;margin-bottom:8px;opacity:0.3">&#10003;</div>
    No files would be affected by changing this symbol
</div>
{% endif %}
