# W3-FE-4 — in-place screen settings inside «✎ تخصيص الشاشة» + element consumers (FE)

Read _COMMON.md first. DESIGN (binding): /home/moonui3/public_html/knowledge-base/plans/visit-shell-completion/design/FABLE-inplace-settings.md §A, §2.3 key table, §1 contract, i18n list. Orchestrator decisions in LEDGER.md (log line «Fable design spec ✅»). BE: W2-BE-C report /home/moonui3/public_html/knowledge-base/plans/visit-shell-completion/reports/W2-BE-C.md (PUT client/doctor with fields/elements/features, GET effective+source, facility type endpoint, complaint hpi/duration, dx text mode). Review rows: review-A #47-#58, review-C #22-#25, review-B #7 #23 #56 #59. You own visit-shell.component.* in this wave.

## Tasks
1. **Per-card ⚙ popover** (Fable §A): fields (ظاهر / إلزامي, Select|Text, 🔒 lock, source tag) + elements (switch, lock, source); header ⚙ on the dark header strip in edit mode; cards without rules have no ⚙; «رجّع الكارت للافتراضي» / «تم» (no save inside — the edit bar's save persists).
2. **Edit bar**: scope switch «للعيادة كلها | لي أنا» (doctor scope only when allowed), level strip, one primary save following scope, reset per scope, dirty-switch confirm, cross-level hints, doctor read-only for client-only rules, 🔒 rows grey.
3. **«إعدادات التخصص» side sheet**: feature groups (gyn 6, dental 8 → write-through), shell switch (nutrition/dental), collapsed «عام للعيادة» block (allow_doctor_override + facility type with the 4 resulting modes, needs clinic.settings.manage, inline confirm).
4. **Decision 7 narrowed**: layout saves stay locked ONLY for types whose layout can't be split yet — after W2-FE-6 the nutrition split is done and dental already is: unlock layout saves for nutrition and dental too (check W2-FE-6 report); rules/features/shell save for every type.
5. **Required/locked cards**: diagnosis-insured forced row «مفروض: مريض مؤمّن», gyn_cats note, dental chart required (W1-FE-1 set the flag).
6. **Element consumers** (every element key in the §2.3 table must work): header insurance / last visit / doctor (visit-header + classic header if the same component — shared); complaint ★ quick, note, and NEW HPI + duration fields (BE columns from W2-BE-C; save like the note, with the W1-FE-1 flush-before-sign hook); lab «نتائج سابقة» (lab.prev — show/hide the previous-results strip in the lab card if one exists, else add a small «آخر نتيجة» hint per chosen test); rx interactions alert (rx.interact); diagnosis secondary list (dx.secondary) and dx input mode select/text (W2-FE-2 exposes `inputMode`; insured forces select). Field rules visible/required applied generically (required → asterisk + finish-panel soft/hard per the spec).
7. **Layer colouring + source tags** (A #57 #58): a «تلوين بالطبقة» toggle in the edit bar colours fields L1–L4 (prototype legend colours); source tags shown on card heads in edit mode (already) — keep, and per Fable P2 make `.from` colours consistent.
8. Fix the P1/P2 deviations Fable listed in §C that are inside your files (edit bar overflow, pills, actionable finish-banner lines — make each soft-warning line a link that jumps to the card).

Run ng build at the end. Do not deploy, do not commit.

## Added by the orchestrator
9. **Dental plan + FMX cards (S2c deferral, review-A #11, review-D D8):** add `dent_plan` (treatment plan panel, sizes M/L/F) and `dent_fmx` (imaging/FMX view, feature `imaging`, sizes M/F) as addable dental catalog cards hosting the existing dental workspace sub-components (features/dental/workspace/…) without changing the workspace itself; not in the default layout (the workspace keeps them). Unlock dental + nutrition layout saves (W2-FE-6 confirmed nutrition is ready; dental tabs/props persist per review-A #45).
10. Screenshots: if you take any, mint a token with a unique name (e.g. claude-visual-check-fe4) and revoke only that name.
