/* farpy-mobile-fix-1: phone-width presentation only (max-width: 767px).
   Desktop and tablet (>= 768px) are untouched: every rule below is inside the one media block.
   No copy, colour, font family, branding or section-order changes. Does not touch /_next/static. */
@media (max-width: 767px) {

  /* 1. Long hashes, URLs and code never push the layout wider than the phone. */
  main :is(p, li, dd, dt, td, th, a, span, figcaption, summary, h1, h2, h3) { overflow-wrap: break-word; }
  main :is(code, kbd, samp, .hash, .r14-v, .r14-k),
  main [class*="font-mono"],
  main a[href^="http"] { overflow-wrap: anywhere; word-break: normal; }
  main pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main pre > code { font-size: 13px; line-height: 1.55; }
  main :is(img, video, iframe, canvas, svg) { max-width: 100%; }
  main img { height: auto; }

  /* 2. Less dead air between sections on a phone (was 64px top + 64px bottom per section). */
  main > section.py-16 { padding-top: 2.75rem; padding-bottom: 2.75rem; }
  main section.mt-16 { margin-top: 2.75rem; }
  main > div.py-16 { padding-top: 2.5rem; padding-bottom: 2.75rem; }
  .r14 .r14-sec { margin-top: 2.25rem; padding-top: 2rem; }
  .r14 .r14-wrap > .r14-sec:first-child { margin-top: 0; }
  .r14 .r14-wrap { padding-bottom: 2.75rem; }

  /* 3. One consistent 16px side gutter. r14 sections nested inside an already padded page wrapper
        (topup) were inset twice (32px); account content stopped 40px short of the right edge. */
  main.topup .r14 .r14-wrap,
  main.wrap .r14 .r14-wrap,
  main .r14-wrap .r14-wrap { padding-left: 0; padding-right: 0; }
  .ws.acct, .acct.account-compact { width: 100%; max-width: 100%; }
  .ws.acct > main.wrap { width: 100%; max-width: 100%; }

  /* 4. Body text a phone can read: nothing under 14px except all-caps eyebrow labels. */
  .r14 .r14-row, .r14 .r14-term { font-size: 14px; }
  .r14 .r14-term-bar { font-size: 12px; }
  .r14 .r14-mono { font-size: 14px; }
  .r14 .r14-lore { font-size: 13px; }
  .r14 .r14-step p, .r14 .r14-card p, .r14 .r14-faq details p { font-size: 15px; line-height: 1.6; }
  .r10-cta-steps, .r10-hint { font-size: 14px; }
  .r10-field label { font-size: 15px; }
  .fx-credit, .fx-credit a { font-size: 14px; }
  main.topup dl > div > dt { font-size: 12px; }
  main :is(p, figcaption).text-xs:not([class*="tracking-"]):not([class*="uppercase"]) { font-size: 13px; line-height: 1.5; }
  main :is(.text-sm.text-muted, .text-sm.leading-relaxed) { line-height: 1.6; }

  /* 5. Tap targets >= 44px. */
  /* 5a. Header logo link. */
  header.sticky a[aria-label="Farpy home"] { min-height: 44px; display: inline-flex; align-items: center; }
  /* 5b. Footer: two columns instead of one 30-link column, and each link a 44px row. */
  footer.border-t > div.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
  footer.border-t nav > ul { margin-top: .5rem; }
  footer.border-t nav > ul > li { margin-top: 0 !important; }
  footer.border-t nav > ul > li > a { display: flex; align-items: center; min-height: 44px; font-size: 15px; }
  footer.border-t .fx-foot-end a[href="#top"],
  footer.border-t a[href^="mailto:"] { display: inline-flex; align-items: center; min-height: 44px; }
  footer.border-t > div.flex { gap: .25rem; }
  /* 5c. Standalone text links ("See proof", "Open the Blender lane", download lists): bigger hit area,
         same position (inline padding does not move the line box). */
  main :is(p, li, div, span) > a.text-sand,
  main p > a:not([class*="btn"]):not(.r10-cta):not(.r10-submit),
  main details > div > a,
  main .r14 .r14-actions > a:not(.r10-cta):not([class*="btn"]),
  main .r10-calc a, main .r10-out a { padding-top: 13px; padding-bottom: 13px; margin-top: -13px; margin-bottom: -13px; }
  main li > a.text-sand { display: inline-block; }
  /* 5d. FAQ disclosure rows. */
  main details > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  main details > summary > span.flex { width: 100%; }
  /* 5e. Docs / labs "on this site" side nav: wrap as 44px chips instead of a 20px-tall list stacked above the article. */
  main aside nav[aria-label="Section"] { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
  main aside nav[aria-label="Section"] > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; }
  /* 5f. Account tabs, related-links rows. */
  .account-tabs { flex-wrap: wrap; gap: .5rem; }
  html:root:root:root:root .account-tabs > .account-tab { min-height: 44px !important; height: auto !important; }
  nav.topup-related a, .site-v2-public-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  main button.h-10 { min-height: 44px; min-width: 44px; }

  /* 6. Grids that were too tight at 360px. */
  html ul.fx-topups.fx-topups--sm { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .r14 .r14-row { grid-template-columns: 1fr; gap: 0; }

  /* 6b. "Qualified GPUs online" stat (filled in by man27 after load) sat unstyled, flush under the step cards. */
  .r14 dl.r14-stats:not([hidden]) { margin: 1.5rem 0 0; padding: .9rem 1.2rem; background: var(--r14-panel); border: 1px solid var(--r14-line); border-radius: 1rem; }
  .r14 dl.r14-stats > div:not([hidden]) { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
  .r14 dl.r14-stats dt { font-size: 14px; color: var(--r14-muted); }
  .r14 dl.r14-stats dd { margin: 0; font-size: 1.5rem; line-height: 1.2; color: var(--r14-ink); }

  /* 7. Account header: title and Sign in button share the row cleanly. */
  .account-head-row { align-items: center; gap: 1rem; }
  .account-head-row > div { min-width: 0; flex: 1 1 auto; }
  .account-head-row > a { flex: 0 0 auto; }
}
