# Panel System — GOLD (GOLD = Goal, Outcome, Limitation, Definition)

## Goal
Replace every panel-management code path in the live chrome with a single, well-tested runtime. Eliminate the dead `__fvcmsOpenEdgePanel` bug, the 4-corner `panel-dock-position` semantics, and the S1/S2/S3 surface model.

## Outcome
A single `PanelSystem` module that owns all panel lifecycle. The Edge Panel becomes a normal panel created by `PanelSystem.createPanel({ type: 'edge', dockEdge: 'right' })`. The CMS Panel is a normal panel. The Dev Panel is a normal panel. VibeChat is a normal panel. Custom panels are normal panels.

## Limitation
The Panel System is NOT a multi-surface OS. There are no surfaces beyond what a single panel can show in its tabs and what the Edge Panel shows in its 6 internal surfaces (CMS, Vibe, Workspace, FreshVibe App, Custom Panels, History). There is no "S2 routing layer" or "background app surface".

## Definition
A panel is a runtime object that has:
- a unique `id`
- a `state` (floating, pinned-L, pinned-R, docked-T, docked-B, minimized, maximized)
- a list of `tabs` (each tab references a module)
- a `dockEdge` (where the panel is anchored, or null if floating)
- a `position` (x, y when floating, or null when docked)
- a `size` (width, height)
- a `minimizable` flag (true by default; locked false in Pro Mode)
- a `pin` flag (true if pinned, false if floating)
- an `isFocused` flag (true when active)

A panel is NOT a module. A module is content. A panel is a UI surface that hosts modules in its tabs.
