/**
 * Shared layout guards for every portal page.
 *
 * Loaded AFTER each page's inline <style> (and after nav.css), so equal-specificity ties
 * fall this way — that is what lets one file fix the same defect on nine pages instead of
 * nine near-identical patches drifting apart.
 *
 * Scope is deliberately narrow: horizontal overflow, touch targets and iOS focus-zoom.
 * Nothing here changes colour, spacing rhythm or desktop typography.
 */

/* ---- No page scrolls sideways. The tables that genuinely need the room scroll inside
   their own wrapper (.tblwrap / .tw / .lineswrap / .sw), never the document. */
html, body { max-width: 100%; overflow-x: hidden; }

.tblwrap, .tw, .lineswrap, .swwrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;   /* momentum scrolling on iOS */
}
@media print {
  .tblwrap, .tw, .lineswrap, .swwrap { overflow: visible; }
}

/* Long unbroken strings — Odoo product names, document refs, pasted Maps URLs — must wrap
   rather than push the page wide. Cells and note blocks only; inputs and code are left alone. */
td, th, .notes, .muted { overflow-wrap: anywhere; }

/* ---- Touch: iOS zooms the whole viewport when a focused control is under 16px, and never
   zooms back. Only below the desktop breakpoint, so nothing on a wall TV or a laptop moves.
   !important because several pages set the size through the `font:` shorthand at a
   specificity a shared sheet cannot out-rank. */
@media screen and (max-width: 1024px) {
  input:not([type=checkbox]):not([type=radio]):not([type=file]),
  select,
  textarea { font-size: 16px !important; }

  /* A thumb needs ~40px. The pages set padding and font-size but almost never min-height,
     so this lands without a fight. */
  button,
  select,
  input[type=date], input[type=search], input[type=text], input[type=number] { min-height: 40px; }
  button { padding-block: 8px; }

  /* Small overlay controls that must stay small — they are chrome, not targets. */
  #rp-thumbs .rp-x, .pager .arrow, button.rp-x { min-height: 0; }
}
