{% extends "base.html" %}
{% block content %}
<div class="header">
  <div>
    <div class="kicker">Source of truth</div>
    <h2 style="margin:8px 0 0">Your AI Memory Files</h2>
    <div class="small">Active scope: <strong>{{ active_scope.label }}</strong></div>
  </div>
  <span class="badge gold">Human-readable + portable</span>
</div>

<div class="folder">{{ memory_dir }}
{% for file in files %}
  {{ file.name }}
{% endfor %}
</div>

<div class="grid cols-3">
  {% for file in files %}
  <div class="card">
    <h3><a href="/files/{{ file.name }}{{ active_scope.query_suffix }}">{{ file.name }}</a></h3>
    <p>{{ file.desc }}</p>
    <div class="small">Entries: {{ file.count }}</div>
    {% if file.preview %}
    <div class="small" style="margin-top:8px">{{ file.preview[0] }}</div>
    {% endif %}
  </div>
  {% endfor %}
</div>
{% endblock %}
