                <form id="toolForm" class="tool-form">
                    <div class="control-row" id="languageControl">
                        <span class="control-label">Language</span>
                        <label><input type="radio" name="language" value="en" checked> English</label>
                        <label><input type="radio" name="language" value="no"> Norsk</label>
                    </div>

                    <div class="control-row is-hidden" id="transcribeLangControl">
                        <span class="control-label">Language</span>
                        <label><input type="radio" name="transcribeLang" value="auto" checked> Auto-detect</label>
                        <label><input type="radio" name="transcribeLang" value="no"> Norsk</label>
                        <label><input type="radio" name="transcribeLang" value="en"> English</label>
                    </div>

                    <div class="control-row is-hidden" id="diarizeControl">
                        <span class="control-label">Speakers</span>
                        <label><input type="checkbox" id="diarizeCheck" name="diarize"> Separate speakers</label>
                        <span class="control-label" style="margin-left:1.25rem">Count</span>
                        <input type="number" id="numSpeakersInput" name="num_speakers" min="2" max="10" placeholder="auto" class="num-speakers-input" aria-label="Expected speaker count">
                    </div>

                    <div class="control-row is-hidden" id="redactionControl">
                        <span class="control-label">Mode</span>
                        <label><input type="radio" name="redactionMode" value="standard" checked> Standard</label>
                        <label><input type="radio" name="redactionMode" value="strict"> Strict</label>
                        <span class="control-label" style="margin-left:1.25rem">Region</span>
                        <label><input type="radio" name="redactionRegion" value="nordic" checked> Nordic</label>
                        <label><input type="radio" name="redactionRegion" value="european"> European</label>
                        <label><input type="radio" name="redactionRegion" value="echr"> ECHR</label>
                        <label><input type="radio" name="redactionRegion" value="global"> Global</label>
                    </div>

                    <div class="upload-zone is-hidden" id="audioZone" role="region" aria-label="Audio upload">
                        <input type="file" id="audioInput" accept="audio/*,video/mp4,video/webm" aria-label="Choose audio file">
                        <div id="audioPrompt" class="upload-prompt">
                            <span class="upload-icon" aria-hidden="true">&#9654;</span>
                            <p>Drop audio file here, or <label for="audioInput" class="upload-browse">browse</label></p>
                            <p class="upload-hint"><strong>MP3</strong>, <strong>WAV</strong>, <strong>OGG</strong>, <strong>M4A</strong>, <strong>FLAC</strong>, <strong>WEBM</strong> &mdash; max 200&thinsp;MB</p>
                        </div>
                        <div id="audioFileInfo" class="upload-file is-hidden">
                            <ul class="upload-file-list"><li id="audioFileLine"><span id="audioFileName" class="upload-filename"></span><span id="audioFileSize" class="upload-chars"></span></li></ul>
                            <button type="button" id="audioClear" class="upload-clear" aria-label="Clear audio file">&times;</button>
                        </div>
                    </div>

                    <div class="upload-zone is-hidden" id="uploadZone" role="region" aria-label="File upload">
                        <input type="file" id="uploadInput" multiple accept=".pdf,.docx,.txt" aria-label="Choose files">
                        <div id="uploadPrompt" class="upload-prompt">
                            <span class="upload-icon" aria-hidden="true">&#8679;</span>
                            <p>Drop up to 5 files (<strong>.pdf</strong>, <strong>.docx</strong>, <strong>.txt</strong>), or <label for="uploadInput" class="upload-browse">browse</label></p>
                            <p class="upload-hint">Text is extracted in memory and never stored.</p>
                        </div>
                        <div id="uploadFileInfo" class="upload-file is-hidden">
                            <ul id="uploadFileList" class="upload-file-list"></ul>
                            <button type="button" id="uploadClear" class="upload-clear" aria-label="Clear uploaded files">&times;</button>
                        </div>
                    </div>

                    <div class="alias-section is-hidden" id="aliasSection">
                        <div class="alias-header">
                            <span class="control-label">Name aliases</span>
                            <button type="button" id="addAliasRow" class="alias-add-btn">+ Add</button>
                        </div>
                        <div id="aliasRows"></div>
                        <p class="alias-hint">Replace a name with a bracketed alias, e.g. &ldquo;David Jr&rdquo; &rarr; [Junior]</p>
                    </div>

                    <label class="input-label" for="toolInput" id="inputLabel">Question</label>
                    <textarea id="toolInput" name="toolInput" rows="10" required></textarea>

                    <div class="form-footer">
                        <p id="toolStatus" class="form-status" role="status" aria-live="polite"></p>
                        <button id="runButton" type="submit">Run Tool</button>
                    </div>
                </form>

                <section id="results" class="results" aria-live="polite">
                    <div class="empty-state">
                        <h3>Ready</h3>
                        <p>Choose a tool, run a request, and the answer will show the evidence trail beside it.</p>
                    </div>
                </section>
