/* pn-build-scroll-20260927.css — THE BUILD THREAD GETS ITS OWN REGION (CEO, launch day 2026-09-27)
   "Scrolling errors" on the pitch flow, BUILD stage: the "Pitch squad · building the response"
   thread (#floorchat, rendered by showFloorChat() in script-01.js) scrolled and painted OVER the
   "02 Your response" card instead of sitting in its own region.

   ROOT CAUSE (measured in Playwright, 1440×900 and 390×844 — not read off the source):
   1. `#floorchat` is `position:fixed; inset:0` (style-01.css) but it is rendered INSIDE `.content`,
      and `.content{contain:paint}` (pn-system-v4.css, for the office light field) makes `.content`
      the containing block for every fixed descendant. On a scroll container that means the
      "fixed" overlay behaves like `position:absolute` at the scroll ORIGIN: wheel over the backdrop
      and `.content` scrolls under it (measured scrollTop 0 → 700) and the whole overlay rides up
      with the content (overlay top 60 → -640) — the response card and the room card come out from
      under it and the thread's bottom bubbles paint over them. pn-docket-fold-20260912.css already
      lifts that containment for the pitch view, but only ≤760px.
   2. The panel is capped at `84vh` (or the cased viewport cap in pn-contain-20260927.css), measured
      against the WINDOW, while it starts `7vh` down inside an overlay that is only the glass tall —
      so a full thread grows the panel past the overlay's bottom (desk: panel bottom 879 vs overlay
      840; phone 879 vs 844). The newest bubble (the one `log.scrollTop=scrollHeight` pins) sat
      below the fold, and the overflow itself added to `.content`'s scroll height.
   3. Phone only (≤720px): pn-system-v4.css lets `.pad/.dev/.screen/.content` grow to their content
      (document scroll), but pn-shell-adopt.css locks html AND body to `overflow:hidden; height:100%`
      on every in-game view, pitch included — so the BUILD page (≈2,090px tall on 844) had no
      scroller at all: a touch scroll moved nothing.

   THE FIX (CSS only, no script-01.js change):
   A. While the thread is open, `.content` drops its paint containment so `#floorchat` is really
      fixed, and stops scrolling so the page underneath cannot move behind the backdrop.
   B. Cased, the overlay is anchored to the glass rect (the `.pnac` / `#pn-pub` pattern), not the
      window; on a phone the glass vars are 0 and it stays full-bleed.
   C. The panel is bounded by the OVERLAY (max-height:100% of a padded flex box), the header and
      establishing still never shrink, and `.fc-log` is the one scrollable region inside it, with
      scroll chaining contained.
   D. Phone pitch view: <body> becomes the page scroller (fixed children stay viewport-fixed —
      body is not transformed below 1025px), and is locked again while the thread is open. */

/* ── A · the thread is open → the page beneath holds still and stops being a containing block ── */
html body .content:has(> #app #floorchat:not([hidden])),
html body .content:has(#floorchat:not([hidden])){
  contain: none !important;
  overflow: hidden !important;
}

/* ── B · the overlay: the device glass when cased, the whole screen on a phone ── */
html body #floorchat.floorchat{
  position: fixed !important;
  top: var(--pn-glass-t, 0px) !important;
  right: var(--pn-glass-r, 0px) !important;
  bottom: var(--pn-glass-b, 0px) !important;
  left: var(--pn-glass-l, 0px) !important;
  box-sizing: border-box !important;
  align-items: flex-start;
  padding: clamp(52px, 7vh, 72px) 12px 16px !important;   /* top clears the sticky stage rail */
  overflow: hidden !important;
  overscroll-behavior: contain;
}
html body #floorchat.floorchat[hidden]{ display: none !important; }

/* ── C · the panel fits the overlay; the log is the only thing that scrolls ── */
html body #floorchat .fc-panel,
html.pn-cased body #floorchat .fc-panel{
  max-height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
html body #floorchat .fc-establish,
html body #floorchat .fc-head{ flex: none; }
html body #floorchat .fc-log{
  flex: 1 1 auto !important;
  min-height: 96px;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html body #floorchat .fc-typing{ flex: none; }
/* a short window: give the thread the height, not the establishing still */
@media (max-height: 700px){
  html body #floorchat .fc-establish{ max-height: 34vh; overflow: hidden; }
}

/* ── D · phone: the BUILD page scrolls; the thread locks it while it runs ── */
@media (max-width: 720px){
  html:root body.pn-folio[data-view="pitch"]:not([data-view="boot"]):not([data-view="create"]):not([data-view="meetteam"]):not([data-view="store"]):not([data-view="weeksummary"]){
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  html:root body.pn-folio[data-view="pitch"]:not([data-view="boot"]):not([data-view="create"]):not([data-view="meetteam"]):not([data-view="store"]):not([data-view="weeksummary"]):has(#floorchat:not([hidden])){
    overflow: hidden !important;
  }
}
