/* ============================================================================
   CANON MOBILE — the responsive floor.

   505 pages have linked this file since the Canon adoption pass; it had never
   been written, in this or any branch, so all 505 were requesting a 404. This
   is the first version. It is NOT a recovery of something lost — there was
   nothing to recover — so it is deliberately the smallest file that can honour
   the contract those pages already state:

     "Canon tokens + responsive floor. Placed before this page's own CSS, so
      the page still wins wherever it disagrees. Opt out of the mobile floor
      with <body class="canon-mobile-off">."

   Three constraints follow from that, and from DESIGN-LAW:

   1. A FLOOR, NOT A LAYOUT. 425 of the 505 pages already carry their own
      @media queries and tuned clamp() grids. This file must not have opinions
      that compete with them. So: nothing here sets a colour, a font stack, a
      spacing scale, a radius, or a grid. Every rule below prevents a page from
      *breaking* on a narrow viewport. None of them restyle one that works.

   2. NO INVENTED BREAKPOINT. 900px is Canon's, used in 64 of the existing
      queries — more than twice the next value. This file uses that number and
      introduces none of its own.

   3. THE OPT-OUT IS REAL. Everything viewport-conditional is nested under
      body:not(.canon-mobile-off), so a page that wants none of it says so once
      and gets its own behaviour back intact.

   Because it loads before the page's own CSS, any page that disagrees with a
   rule here wins by source order at equal specificity — which is the intended
   relationship, not a loophole.
   ========================================================================== */

/* ── Unconditional: these cannot change a desktop layout ──────────────────
   iOS inflates text in portrait unless told not to, which silently breaks any
   layout tuned to a type scale. Replaced elements are capped because a single
   oversized image is the most common cause of a page that scrolls sideways. */

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

img,
video,
canvas {
	max-width: 100%;
	height: auto;
}

/* svg is deliberately absent: canon-reset.css sizes icons with
   `svg:has(> use){width:1em;height:1em}`, and a max-width/height:auto pair here
   would fight it on every icon in the estate. */

/* ── At or below Canon's 900px breakpoint ─────────────────────────────────── */

@media (max-width: 900px) {
	/* A long unbroken string — a hash, a URL, a receipt id, all of which this
	   estate prints constantly — forces the whole page wider than the screen.
	   Breaking inside one is always better than scrolling the document. */
	body:not(.canon-mobile-off) {
		overflow-wrap: break-word;
	}

	/* Code and preformatted text are the exception: breaking a line changes what
	   it means. They scroll inside their own box instead of widening the page. */
	body:not(.canon-mobile-off) pre {
		max-width: 100%;
		overflow-x: auto;
	}

	/* Safari zooms the viewport when a control smaller than 16px takes focus, and
	   never zooms back out. max() keeps any page that already asks for more.
	   This is the one rule here that can alter type size, and only on controls,
	   and only on small screens. */
	body:not(.canon-mobile-off) :is(input, select, textarea) {
		font-size: max(16px, 1em);
	}
}
