<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Preferences – Healthy Self Journal</title>
    <link rel="stylesheet" href="/static/css/app.css" />
  </head>
  <body>
    <main class="hsj-container">
      <header class="hsj-header">
        <h1>Preferences</h1>
      </header>
      <form id="prefs-form" method="post" action="/settings/save" style="max-width: 720px;">
        <div class="hsj-field">
          <label for="sessions_dir">Sessions folder</label>
          <div style="display:flex;gap:0.5rem;align-items:center;">
            <input id="sessions_dir" name="sessions_dir" type="text" value="{{ sessions_dir }}" style="flex:1;" />
            <button id="pick-folder" type="button">Choose…</button>
          </div>
        </div>
        <div class="hsj-field">
          <label>
            <input id="resume" name="resume" type="checkbox" {% if resume == 'true' %}checked{% endif %} />
            Resume last session on launch
          </label>
        </div>
        <div class="hsj-field">
          <label>
            <input id="voice" name="voice" type="checkbox" {% if voice == 'true' %}checked{% endif %} />
            Voice mode (speak questions)
          </label>
        </div>
        <div style="display:flex;gap:0.5rem;align-items:center;">
          <button type="submit">Save</button>
          <button id="apply-restart" type="button">Apply & Restart</button>
          <a href="/setup" title="Run Setup Again" style="margin-left:auto;">Run Setup Again</a>
          <a href="/" style="">Back</a>
        </div>
      </form>
    </main>
    <script src="/static/js/settings.js"></script>
  </body>
  </html>


