<article>
    <h3>Theme Switcher</h3>
    <div style="display:flex; gap:0.5rem; flex-wrap:wrap; align-items:center;">
        <label for="theme-select" style="margin:0;">Select Theme:</label>        <select id="theme-select" name="theme" hx-get="{{ url_for('htmx_theme_preview') }}" hx-target="#theme-preview" hx-trigger="load, change" hx-include="#theme-select" hx-swap="innerHTML">
            {% for t in themes %}
            <option value="{{ t }}" {% if t == current_theme %}selected{% endif %}>{{ t }}</option>
            {% endfor %}
        </select>
        <button class="small" hx-post="{{ url_for('apply_theme') }}" hx-target="body" hx-include="#theme-select" hx-swap="none">Apply</button>
    </div>
    <div id="theme-preview" style="margin-top:1rem;">
        <!-- Preview generated by theme-preview endpoint -->
    </div>
</article> 