/* ============================================================================
   CANON MOBILE APPS — the layout canon-mobile.css deliberately refuses to be.

   canon-mobile.css is a FLOOR: it stops text inflation and long-token overflow
   and has no opinion about layout. That was the right call for 505 pages, and
   it is why linking it into the mockups changed nothing — measured, 92 apps
   scrolled sideways before and 94 after.

   These 425 files are desktop app mockups with fixed toolbars and fixed grids.
   Fixing them needs an opinion, so the opinion lives in its own file that a page
   opts into, rather than being smuggled into the floor.

   DIAGNOSED BY HAND on five overflowing apps before writing a single rule:

     acrobat-pro     1048px   .tb-right, .zoom-group      parent flex/nowrap
     after-effects    700px   .titlebar-right             parent flex/nowrap
                             .frames-inner                min-width:820px
     airtable         612px   .toolbar-right              parent flex/nowrap
                             table.grid                   min-width:1180px
     apple-music      824px   .upper, .player             grid 230px 594px
     asana            602px   .listwrap                   min-width:760px

   Three causes, so three rules. The min-width case is NOT handled here — CSS
   cannot give an element's parent a scrollbar, and guessing which ancestor
   should scroll is how you break a layout silently. canon-app.js measures that
   one at runtime and only acts where overflow actually exists.

   Scoped to <=900px, which is this estate's one breakpoint, and to
   body:not(.mobile-off) so a page can decline all of it in one place.
   ========================================================================== */

@media (max-width: 900px) {

  /* 1. Toolbars wrap instead of pushing the document.
        A row that cannot fit should stack. When it overflows instead, the
        controls on its right-hand end become unreachable — the page scrolls
        sideways and the user has no reason to think anything is over there. */
  body:not(.mobile-off) :is(
    header, .topbar, .toolbar, .titlebar, .tabbar, .workbar, .chrome, .actionbar,
    [class*="bar-"], [class*="-bar"], [class*="toolbar"], [class*="titlebar"]
  ) {
    flex-wrap: wrap;
    height: auto;
    row-gap: 8px;
  }

  /* Groups inside those bars keep their own shape but stop forcing width. */
  body:not(.mobile-off) :is(
    [class*="-right"], [class*="-left"], [class*="-group"], [class*="actions"]
  ) {
    min-width: 0;
    flex-wrap: wrap;
  }

  /* 2. Fixed multi-column grids collapse to one column.
        Only grids that actually declare pixel tracks — a grid already using
        fr/auto/minmax is responsive by construction and is left alone. */
  body:not(.mobile-off) .upper,
  body:not(.mobile-off) .player,
  body:not(.mobile-off) .split,
  body:not(.mobile-off) .columns,
  body:not(.mobile-off) [class*="two-col"],
  body:not(.mobile-off) [class*="three-col"],
  body:not(.mobile-off) [class*="-split"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* A sidebar beside content becomes a strip, not a disappearance. A nav that
     vanishes at a breakpoint is a nav you cannot reach. */
  body:not(.mobile-off) :is(.sidebar, .side, .rail, .leftrail, .nav-rail) {
    max-width: 100%;
  }

  /* 3. Nothing here touches min-width — see the header. canon-app.js does it,
        measured, at runtime. */
}
