# Specification: Phase 7 Stabilization and Polishing

## 1. Overview
The final refinements of Phase 7 introduced several regressions and technical debt, including `ImportError` crashes in the modular renderer and layout issues where Markdown tables are vertically squashed. This track aims to stabilize the application and restore high-signal visual features (like entry tinting) in a robust, theme-compliant manner.

## 2. Functional Requirements
*   **Fix Core Imports:** Update `src/discussion_entry_renderer.py` and other new modular files to use correct `src` prefixed imports, resolving the `ImportError`.
*   **Restore Entry Tinting:** Re-implement background tinting for discussion entries (User, AI, Vendor API) using `draw_list.add_rect_filled` and appropriate ImGui layering to ensure visibility without stacking issues.
*   **Definitive Table Width Fix:** Refactor the entry group layout to ensure the Markdown renderer inherits the full panel width, preventing tables and long text from squashing into narrow columns.
*   **Centralize Colors:** Move all hardcoded `vec4` and `ImVec4` constants from `gui_2.py` and modular renderers into `src/theme_2.py`. Expose them via `theme.get_role_tint()` and similar helpers.

## 3. Non-Functional Requirements
*   **Stability:** Use `py_update_definition` and smaller `replace` calls to avoid file corruption.
*   **Validation:** Every step must be verified by running the UI test suite.

## 4. Acceptance Criteria
*   The application launches and renders the Discussion Hub without any import or syntax errors.
*   Discussion entries are clearly tinted based on role.
*   Markdown tables scale horizontally to fill the panel width.
*   The code contains zero hardcoded `vec4` color literals in the renderer logic.
*   All UI tests pass.