/* fit-scroll.css: the page scrolls as one page (the user, 2026-11-08: "the scrolling is so bad"; "scrolling up in menus
   doesn't even scroll the entire site so you just get stuck in menus"; "when I open a menu it very very choppily scrolls
   down"; "scrolling down also scrolls the generated samples for no reason").
   Loaded last. Folds (html[data-fold]) keep their two halves; Voice to voice is not touched.
   What it undoes, everywhere else:
   - the Studio's composer and Delivery | Sound column / drawer stuck under the header, the takes sliding beneath them
     (fit.css 268-280, fit-s.css S1, fit-l.css 2): a swipe or wheel over the settings scrolled only them
     (overscroll-behavior: contain) or nothing at all, and the open drawer covered most of a phone's screen;
   - the drawer's height measured from where it sits (--sdmax), its paper margins (--sph): opening it re-measured, the
     browser shifted the page, a scroll re-measured again 140 ms later ... the page crept down in steps;
   - the home composer stuck under the header on tablets and computers (fit.css 110-113). Phones keep the composer docked
     at the bottom of the home page (no box of its own to scroll, nothing to trap);
   - html { scroll-behavior: smooth } (app.css): scrolls made by code that ask for no animation (keeping a field above
     the keyboard, a take reached with Tab) no longer glide while you scroll yourself. Section links still glide. */

html { scroll-behavior: auto; }

/* ---------- the Studio: composer, settings, status, takes in the page's own flow ---------- */
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) .g-studio.panel.composer {
  position: relative !important; top: auto !important; bottom: auto !important; box-shadow: none !important; margin-bottom: 0 !important; }
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > #sidePanel {
  position: relative !important; top: auto !important; max-height: none !important; overflow: visible !important;
  margin-top: 0 !important; box-shadow: none !important; z-index: auto !important; }
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > #sidePanel::before { content: none !important; }
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > #sidePanel > .sidebody {
  overflow: visible !important; max-height: none !important; flex: 0 0 auto !important; overscroll-behavior: auto !important; }
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > .work > #speakStatus:not(:empty) {
  position: relative !important; top: auto !important; }
html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > .work:has(> #takes:not(:empty))::after { content: none !important; }
/* (narrow: the gap the stuck pair kept above the takes) */
@media (max-width: 567px), (max-width: 899px) and (min-height: 501px), (max-width: 899px) and (pointer: fine) {
  html:not([data-fold]) .studio.m-speak:not([data-mode="vtv"]) > .work > #takes { margin-top: 12px !important; }
}
/* a take scrolled into view (a link, Tab) lands under the header, as on any page */
html:not([data-fold]):has(body[data-view="voices"] .studio.m-speak:not([data-mode="vtv"])) { scroll-padding-top: calc(var(--stick, 64px) + 12px) !important; }

/* ---------- the home page on tablets and computers: the composer scrolls with the page ---------- */
@media (min-width: 641px) and (min-height: 600px) {
  html:not([data-fold]) .stage.g-home > .g-composer { position: relative !important; top: auto !important;
    box-shadow: 0 1px 2px rgba(20, 20, 23, .04), 0 8px 32px rgba(20, 20, 23, .05) !important; }
  html:not([data-fold])[data-scheme="dark"] .stage.g-home > .g-composer { box-shadow: none !important; }
}

/* ---------- boxes that keep their own scroll hand it on to the page at their end ---------- */
html:not([data-fold]) .g-studio .emphview.tall, html:not([data-fold]) .panel.voice .tabpane { overscroll-behavior: auto !important; }

/* the wide home, a take arriving while you read further down: next.js (fitTakeAnchor) puts the row you read back
   exactly; the browser's own anchoring (the composer no longer stuck, it picked a node above the list) corrected first
   and left the row 3-4 px off */
@media (min-width: 641px) and (min-height: 600px) {
  html:not([data-fold]):has(body[data-view="synth"]) { overflow-anchor: none; }
}
