/* studio_shell_scroll.css — the studio shell never moves (owner 2026-11-01: "the header with the search bar, and
   the left panel with the logo and the 6 main pages, should NEVER move when scrolling the main viewing area").

   WHY: the studio scrolled the DOCUMENT (studio.css undoes layout.css's >=1024 lock), so #topbar, in normal flow,
   scrolled away, and the position:fixed #sidebar shifted too: fixed boxes hang off the LAYOUT viewport, and while
   the document scrolls the browser lets the VISUAL viewport slide inside it (WebKit iPad: 1070 visible of a 1080
   layout viewport, visualViewport.offsetTop 0 -> 10, the sidebar read -10; on a real iPad / iPhone the same slide
   comes with Safari's toolbar resizing as the page scrolls).

   THE MODEL (all sizes, the layout.css >=1024 gray-bar lesson applied to the studio): the document never scrolls
   (html/body/#app pinned to the viewport, overflow hidden, no overscroll), so iOS has nothing to collapse its
   toolbar against (no gray gap) and nothing to rubber-band (the shell is never dragged). .workspace is the one
   scroller; #topbar sticks at its top with its own opaque background; #sidebar stays fixed. .workspace is NOT
   positioned, so it makes no stacking context: the exercise's fixed #view (z 110), sheets, dialogs, the plan
   page and the constellation's fixed stage still stack against the root exactly as before. Pages that lock
   their own frame (the constellation's .workspace:has(#view .cmg), higher specificity) keep it.

   Every lock is keyed to the shell existing (:has(> #app > .workspace)), so any non-shell screen on /app keeps
   the normal document scroll. Without :has() support nothing here applies except the sticky header. */

html:has(> body.hts-studio > #app > .workspace){ height:100%; overflow:hidden; overscroll-behavior:none; }
body.hts-studio:has(> #app > .workspace){ height:100%; overflow:hidden; overscroll-behavior:none; }
body.hts-studio > #app:has(> .workspace){ height:100%; }

body.hts-studio .workspace{
  height:100%; box-sizing:border-box;
  overflow-x:hidden; overflow-y:auto;
  overscroll-behavior:none;                 /* no bounce: the sticky header is never pulled down with the content */
  scroll-padding-top:80px;                  /* scrollIntoView({block:"start"}) lands below the header, not under it */
  scroll-padding-bottom:100px;              /* was on body (studio.css devices block); body no longer scrolls */
}
body.hts-studio.hts-studio.hts-studio #topbar{ position:sticky; top:0; z-index:20; }

/* phones: the bar is 64px; the lesson line sheet locked body only, so lock the scroller it sits in too */
@media (max-width:700px){
  body.hts-studio .workspace{ scroll-padding-top:64px; }
}
body.hts-studio.st-inspector-sheet.hts-sheet-open .workspace{ overflow-y:hidden; }
