# Embedded chat CSS isolation — local browser acceptance

The chat client loaded `static/css/main.css` into the host document. Its
Tailwind reset and generic utilities therefore changed unrelated pages: on the
customer portal the widget's `.fixed` rule overrode the sidebar's desktop
`lg:relative` rule, leaving the sidebar over the reservation content and
intercepting clicks.

The chat build now scopes generated selectors beneath
`#appmint-chat-container` in both the stable and hashed CSS artifacts. The
post-build hook runs the scoping step before stamping the loader. The local
artifact check confirms that widget `.fixed` is prefixed and the unscoped
`.fixed { position: fixed }` rule is absent. The production build completed
with warnings only (existing lint warnings); it did not fail compilation.

A fresh renderer/widget browser check remains required: the isolated CSS must
leave the customer sidebar in normal desktop flow while the widget launcher,
chat panel, popovers and mobile layout still work. The production build was
rerun after correcting `:root`/`html`/`body` handling; the generated artifact
contains host rules, scoped `.fixed`, and no unscoped `.fixed { position:
fixed }`. Until that browser check, this is a verified build repair rather than
a closed portal acceptance.

20 September artifact follow-up: the corrected build completed successfully and
was copied to the isolated local asset host at `http://127.0.0.1:4105`. Both
`appmint-chat.js` and `static/css/main.css` returned HTTP 200. Obsolete hashed
assets from the preceding local build were removed from that isolated serving
directory. The current stable and hashed stylesheets each contain 607 scoped
DOM rules and seven unchanged keyframe selectors; neither contains an invalid
scoped keyframe or an unscoped DOM selector. Reproduce this check with:

```sh
node tutorials-plan/application-fixes/assets/chat-css/verify-artifact.cjs \
  /Users/imzee/projects/chat-client /tmp/welcome-support-chat
```

The [machine-readable result](assets/chat-css/artifact-check.json) and
[verification script](assets/chat-css/verify-artifact.cjs) are durable. A fresh
Maya browser session against API r10 now passes the desktop acceptance: the
portal sidebar computed as `position: relative`, and the fixed chat launcher
and panel elements were descendants of `#appmint-chat-container`. Readback and
screenshot evidence are in
`assets/reservation-display/maya-widget-css-readback.json` and
`assets/reservation-display/maya-widget-css.png`. Mobile and popover behavior
remain outside this bounded desktop check.


## Recovered portal browser acceptance — 20 September 2026

**Passed** on the real local renderer after API recovery, using a fresh controlled
Maya customer magic link in this agent's own isolated browser. No shared browser
was closed. Tested URLs: `http://localhost:4106/account/reservations` and
`http://localhost:4106/account/files`; the loaded stylesheet was
`http://localhost:4105/static/css/main.css?v=0.1.5`.

- At 1440×1000, the sidebar computed to `position: relative`, width 288px. Its
  Reservations and Files links worked, and the reservation content started to
  its right. The sidebar no longer overlaid or intercepted the content.
- The actual chat launcher opened the configured Cedar & Form panel. The
  desktop panel occupied x=1020–1400, leaving the sidebar at x=0–288 untouched.
  Clicking the launcher again closed it; navigation to Files then succeeded.
- At 430×932, the panel remained inside the viewport (x=8, width=414). Its
  visible **Close chat** button closed it after the render completed. The Files
  screen and compact launcher remained usable.
- No message, ticket, file or reservation was created or edited. The browser
  observed automatic page-visit/telemetry POSTs during navigation; these are
  recorded in the evidence rather than described as zero network writes.

[Desktop closed](assets/chat-css/portal-desktop-closed.png) ·
[Desktop open](assets/chat-css/portal-desktop-open.png) ·
[Mobile open](assets/chat-css/portal-mobile-open.png) ·
[Mobile closed](assets/chat-css/portal-mobile-closed.png) ·
[Computed layout and request observations](assets/chat-css/browser-acceptance.json).

The earlier API recovery prerequisite above is resolved. This closes the
observed portal-sidebar CSS regression and launcher/panel acceptance. Emoji
popovers require an existing message and were not exercised in this read-only
check. Source compatibility review separately noted that the current common
Popover mounts under `document.body`, outside the scoped host; custom
`containerId` values likewise do not match the fixed CSS prefix. Neither
variant was used by this tested default-container portal.
