/* Phone fixes (2026-11-25). Only applies on screens 640px wide or less, so desktop is unchanged.
   Linked on every page and also imported by loomi-nav.css (so new pages get it). Selectors start with
   "html body" so they win over page and nav styles either way. Colours, fonts and the nav's look are unchanged. */
@media (max-width: 640px) {
  /* 1. Wide research tables scroll inside themselves instead of pushing the whole page sideways */
  html body .stat-tbl, html body article table, html body .post table {
    display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  html body .stat-tbl th { padding: 9px 10px; font-size: 12px; letter-spacing: .04em; }
  html body .stat-tbl td { padding: 9px 10px; font-size: 15px; }

  /* 2. Long code lines and long words stay inside the screen */
  html body pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html body :not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }
  html body article, html body .post, html body .wrap { overflow-wrap: break-word; }

  /* 3. Desk greeting card fits the screen */
  html body #jg-card { max-width: calc(100vw - 24px) !important; box-sizing: border-box; }

  /* 4. Nav: Desk pill readable; logo and Desk pill easier to tap (same look, bigger touch area) */
  html body header.lnav a.lnav__desk { font-size: 11.5px; height: 24px; min-height: 24px; padding: 0 10px; border-radius: 12px; }
  html body header.lnav a.lnav__desk, html body header.lnav a.lnav__logo { position: relative; }
  html body header.lnav a.lnav__desk::after, html body header.lnav a.lnav__logo::after {
    content: ""; position: absolute; top: -10px; bottom: -10px; left: -4px; right: -4px;
  }

  /* 5. Small text links get a bigger touch area without moving anything */
  html body .crumb a, html body .meta a[rel="author"], html body .joinform a, html body footer a {
    position: relative; display: inline-block; padding: 6px 0;
  }
  html body .crumb a::after, html body .meta a[rel="author"]::after, html body footer a::after {
    content: ""; position: absolute; top: -6px; bottom: -6px; left: -2px; right: -2px;
  }
  html body .joinform a { padding: 10px 0; }

  /* 6. The smallest labels go up to a readable size (only where they were under 11px) */
  html body .labcard .stats .k { font-size: 11px; }
  html body .labcard .tg, html body span.lg-free { font-size: 11.5px; }
  html body .ladder th { font-size: 12px; }

  /* 7. Text boxes at 16px so iPhone does not zoom in when you tap them */
  html body input[type="text"], html body input[type="email"], html body input[type="search"], html body input[type="tel"],
  html body input[type="number"], html body input[type="password"], html body input:not([type]), html body select, html body textarea { font-size: 16px; }

  /* 8. A few wide cards and labels on single pages (scanner v2, smart money, quant dashboard, NorthTape pricing) */
  html body .bezel-etch { white-space: normal; letter-spacing: .1em; }
  html body .sm-alert__dates { white-space: normal; }
  html body article.panel, html body .rcard { min-width: 0; max-width: 100%; box-sizing: border-box; }
  html body .rcard .rh { flex-wrap: wrap; }
  html body .rcard .rt { white-space: normal; }

  /* 9. Safety net: nothing a few pixels too wide can make the whole page slide sideways */
  html, html body { overflow-x: clip; }
}
