/* ───────────────────────────────────────────────────────────────────────────
   Aircraft.Market — global MOBILE layer
   Every rule here is gated to small screens (max-width:768px), so the desktop
   layout is never affected. This file is injected before </head> on every page
   by the server, so it applies site-wide without editing each page.
   ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* Stop sideways scrolling / overflow on every page */
  html, body { overflow-x: hidden !important; max-width: 100% !important; }
  * { min-width: 0; }

  /* Media + embeds never exceed the viewport */
  img, svg, video, canvas, iframe { max-width: 100% !important; height: auto; }

  /* Collapse ANY multi-column CSS grid (class-based or inline) to one column */
  [style*="grid-template-columns"],
  .cards, .cat-grid, .metrics,
  .qw-row-2, .qw-row-3, .qw-row-4, .qw-row-5,
  .chart-grid, .chart-grid-2, .chart-grid-3,
  .dark-panel-grid, .sub-grid, .fs-body, .grid, .row-2, .row-3, .row-4 {
    grid-template-columns: 1fr !important;
  }

  /* Wide tables scroll horizontally instead of breaking the page */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-wrap, .table-scroll, .overflow-x { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

  /* Navs / top bars wrap rather than overflow */
  nav, .nav, .navbar, .topbar { flex-wrap: wrap !important; row-gap: 8px; }
  .nav-links, .topbar-right { flex-wrap: wrap !important; gap: 10px !important; }

  /* Keep oversized hero type readable on small screens */
  h1 { font-size: clamp(24px, 7vw, 40px) !important; line-height: 1.15 !important; }
  h2 { font-size: clamp(20px, 6vw, 30px) !important; line-height: 1.2 !important; }

  /* Trim big horizontal padding so content isn't pinched */
  .container, .main, .page-header, .page-header-inner,
  .submit-bar, .section, .wrap, .content { padding-left: 16px !important; padding-right: 16px !important; }

  /* Flex toolbars/rows wrap on mobile */
  .submit-bar-inner, .quickbar, .toolbar, .filters, .btn-row, .actions { flex-wrap: wrap !important; }

  /* Full-width primary buttons feel better on touch */
  .btn-submit, .qw-submit-btn, .ql-post { width: 100% !important; }
}
