# Side Panel

Follows: **Surface Treatment**, **Visual Hierarchy**, **Density & Spacing**, and **Interaction States** from [`../philosophy.md`](../interface.md), plus the package-first rules in [`component-guide.md`](selection.md).

`SidePanel` is a focused, contextual surface anchored to the right edge of the viewport. It reveals object details or a short single-object workflow without navigating away from a collection.

## Anatomy

- A translucent dismissible overlay.
- Fixed right-edge panel with header, optional description, scrollable body, and optional footer actions. Header/body hierarchy comes from spacing; scroll-aware dividers indicate content continuing behind the fixed regions.
- Header close control is icon-only with an accessible label.

## Rules

- The resting outline uses the same subtle boundary contrast as other panels and inputs. Select its reference from the adjacent rendered surfaces; an inspector is not a stronger-border category.

- Use for inspection and focused creation flows. Do not use it as a substitute for a broad settings page or a multi-step wizard.
- Preserve the list/table behind the panel so object context remains clear.
- Close via escape, overlay, or the close control.
- Use `sm` for simple confirmations, `md` as the default inspection width, and `lg` only for dense source material or form workflows.
- The body scrolls; the header and footer remain fixed within the panel.
- Show a subtle 1px divider beneath the header only while body content is scrolled above the visible area. Show a subtle 1px divider above the footer only while more body content remains below. At the top the header divider is hidden; at the bottom the footer divider is hidden. Hide both when the body does not overflow, and update these states when content or available space changes and when the panel reopens.
- Fade divider opacity using `--duration-fast` and `--ease-out`; this is scroll-state feedback, without movement or layout changes. Under reduced motion, update visibility immediately. Preserve the ordinary surface-aware subtle border strength.
- For primary sections inside the body, follow the layout guide's [divider conditions](../layout.md#divider-conditions). Structural section dividers span the body width; subordinate dividers span content edges. The scroll-aware header/footer rules above retain precedence for their own boundaries and do not require always-visible header lines.
- Follow the layout guide's [container spacing rules](../layout.md#container-spacing-and-shared-content-edges): default the shell's outer content clearance to equal block and inline insets, and align header, body, and footer content edges. Scrolling regions and fixed actions may need different block spacing; preserve inline alignment and give the exception an interaction reason. The overlay makes this a separate layer whose inset can differ from the underlying page. A persistent pane presented as a peer to a collection instead shares that peer group's padding treatment.
- On open, the overlay fades in and the panel slides in from the right using `--duration-normal` and `--ease-out`. Respect reduced-motion preferences.
