"""Unit: the admin summary-edit affordance in the viewer (phase 57, task 02). The browser behavior itself is E2E-gated by the phase-57 story suite; like the other frontend-adjacent unit files (test_save_chat_ui.py pattern), this module pins the JS/CSS markers the edit contract depends on, so a silent regression is caught without a browser: * the ``docAdminReady()`` gate — the module-cached /api/whoami promise (header.js's ``fetchIsAdmin``, the SAME single request per page the shared header makes — no second whoami call site in document.js); non-admin / fetch failure → NO button, NO wiring (the public viewer is byte-for-byte the phase-36 section: the bare ``section.append (title, body)`` construction stays first, the admin affordance is a post-render ``.then`` on the gate promise); * the editor construction — the header row (``.doc-summary-head`` with the bare h2 + a real ``type="button"`` Edit), the swap-in ``