{% if results %}
<p>Found {{ results|length }} result(s){% if query %} for "<strong>{{ query }}</strong>"{% endif %}</p>
{% for r in results %}
<article>
    <header>
        <strong>Score: {{ "%.2f"|format(r.score) }}</strong> &middot;
        <a href="/sessions/{{ r.session_id }}">{{ r.session_id[:16] }}</a> &middot;
        Project: {{ r.project or 'unknown' }}
    </header>
    <pre style="white-space: pre-wrap; word-wrap: break-word;">{{ r.chunk_text[:500] }}</pre>
    {% if r.session_summary %}
    <footer><small>Summary: {{ r.session_summary }}</small></footer>
    {% endif %}
</article>
{% endfor %}
{% elif query %}
<p>No results found for "<strong>{{ query }}</strong>".</p>
{% else %}
<p>Enter a search query to find past conversations.</p>
{% endif %}
