Now add the chart button and container after the response containers. Let me find the Round 2 container:


1186:                <div class="card" id="ai-response-round2-container" style="display: none;">
1189:                        <button class="btn btn-secondary" onclick="document.getElementById('ai-response-round2-container').style.display='none'">Close</button>
2016:            var container = document.getElementById('ai-response-round2-container');
3004:            document.getElementById('ai-response-round2-container').style.display = 'none';


1186→

  1187→

  1188→
AI Response Round 2 - Summary

  1189→                        <button class="btn btn-secondary" onclick="document.getElementById('ai-response-round2-container').style.display='none'">Close</button>
  1190→

  1191→

  1192→

  1193→

  1194→
  1195→
  1196→                <?php if (!empty($savedResponses)): ?>
  1197→

  1198→

  1199→
Previous AI Analyses (<?= $totalSavedResponses ?> total)

  1200→

  1201→

  1202→                        <?php foreach ($savedResponses as $saved):
  1203→                            // Determine what to display as the "question"
  1204→                            $displayQuestion = $saved['question'] ?? 'General Analysis';
  1205→                            $hasContext = !empty($saved['context']);

AI Response Round 2 - Summary

                        <button class="btn btn-secondary" onclick="document.getElementById('ai-response-round2-container').style.display='none'">Close</button>

                <?php if (!empty($savedResponses)): ?>

Previous AI Analyses (<?= $totalSavedResponses ?> total)

                        <?php foreach ($savedResponses as $saved):
                            // Determine what to display as the "question"
                            $displayQuestion = $saved['question'] ?? 'General Analysis';
                            $hasContext = !empty($saved['context']);


Edit

                <!-- Saved Responses -->
                <?php if (!empty($savedResponses)): ?>

Relationship Chart

                            <button class="btn btn-secondary" onclick="document.getElementById('d3-chart-container').style.display='none'">Close</button>

                <?php if (!empty($savedResponses)): ?>