/* PayTrace shared mobile layer. Everything below is scoped to phones/small tablets. */
.mnav-toggle, .mnav-drawer, .mfoot { display: none; }

@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { overflow-x: clip; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  img, svg, video, canvas { max-width: 100%; }

  /* ── NAV ── */
  nav { padding-top: env(safe-area-inset-top); }
  .nav-inner { gap: 10px; }
  .mnav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; flex-shrink: 0; padding: 0;
    background: transparent; border: 1px solid var(--border, rgba(0,0,0,.12)); border-radius: 10px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mnav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text, #0F1710); transition: transform .2s, opacity .2s; }
  .mnav-open .mnav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mnav-open .mnav-toggle span:nth-child(2) { opacity: 0; }
  .mnav-open .mnav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* the drawer replaces the desktop auth pills and CTA on phones */
  .nav-inner .nav-auth-btns, .nav-inner .nav-right > a.btn-nav, .nav-inner > a.btn-nav, .nav-inner .btn-ghost-sm { display: none !important; }
  .nav-inner .nav-right { margin-left: auto; }
  .nav-inner .nav-right .nav-user { max-width: 52vw; }
  .nav-inner .nav-right + .mnav-toggle, .nav-inner .nav-user + .mnav-toggle { margin-left: 8px; }
  .nav-badge { display: none; }

  .mnav-drawer {
    display: block; position: fixed; left: 0; right: 0; top: 64px; bottom: 0; z-index: 2000;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--bg, #F0EEE6); background-color: var(--bg, #F0EEE6); isolation: isolate; border-top: 1px solid var(--border, rgba(0,0,0,.1));
    padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .mnav-drawer[hidden] { display: none; }
  .mnav-open { overflow: hidden; }
  .mnav-list { list-style: none; margin: 0; padding: 0; }
  .mnav-list li { border-bottom: 1px solid var(--border, rgba(0,0,0,.08)); }
  .mnav-list a {
    display: flex; align-items: center; justify-content: space-between; min-height: 56px;
    font-size: 17px; font-weight: 500; color: var(--text, #0F1710); text-decoration: none;
  }
  .mnav-list a::after { content: '→'; color: var(--text3, #7A8C7C); font-size: 16px; }
  .mnav-cta { display: grid; gap: 10px; margin-top: 24px; }
  .mnav-btn {
    display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 12px;
    font: 600 16px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; border: 1px solid var(--border, rgba(0,0,0,.15));
  }
  .mnav-btn.ghost { background: transparent; color: var(--text, #0F1710); }
  .mnav-btn.solid { background: var(--green, #00B87A); border-color: var(--green, #00B87A); color: #fff; }

  /* ── TYPE & TAP TARGETS ── */
  body { font-size: 16px; line-height: 1.6; }
  p, li { font-size: max(15px, 1em); }
  small, .small, [class*="label"], [class*="caption"], [class*="eyebrow"], [class*="tag"], [class*="badge"], [class*="meta"] { font-size: max(12px, 1em); }
  a, button { -webkit-tap-highlight-color: rgba(0,184,122,.15); }
  button, .btn, [class^="btn-"], [class*=" btn-"], input[type="submit"], select { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; } /* stops iOS focus-zoom */

  input, select, textarea { box-sizing: border-box; max-width: 100%; }

  /* ── TABLES & CODE: scroll inside their own box ── */
  .tscroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; border-radius: 12px; }
  .tscroll > table { min-width: 560px; margin: 0; }
  pre, code.block { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  p code, li code, td code { word-break: break-word; overflow-wrap: anywhere; }

  /* ── FOOTER ── */
  footer.has-mfoot > .footer-inner, footer.has-mfoot > .footer-copy, footer.has-mfoot > .footer-links { display: none !important; }
  footer.has-mfoot { display: block !important; padding: 40px 20px calc(28px + env(safe-area-inset-bottom)) !important; text-align: left; }
  .mfoot { display: block; max-width: 560px; margin: 0 auto; }
  .mfoot-name { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 500; letter-spacing: -.3px; color: var(--text, #0F1710); }
  .mfoot-name .g { color: var(--green, #00B87A); }
  .mfoot-brand p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--text2, #3D4A3F); max-width: 34ch; }
  .mfoot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border, rgba(0,0,0,.1)); }
  .mfoot-cols div:last-child { grid-column: 1 / -1; }
  .mfoot-cols h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3, #7A8C7C); }
  .mfoot-cols a { display: block; padding: 9px 0; font-size: 15px; color: var(--text2, #3D4A3F); text-decoration: none; }
  .mfoot-base { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border, rgba(0,0,0,.1)); font-size: 12.5px; line-height: 1.5; color: var(--text3, #7A8C7C); }

  /* footer links on pages without the structured footer (privacy/terms/login) */
  .footer-links a { display: inline-block; padding: 10px 4px; }
}
@media (max-width: 380px) {
  .mfoot-cols { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* ── Homepage proof strip: compact hero stat + two supporting stats ── */
  .kpi-strip { grid-template-columns: 1fr 1fr !important; margin: 40px 0 !important; }
  .kpi-strip-item { padding: 20px 18px !important; border-right: none !important; border-bottom: 1px solid var(--border2, var(--border)) !important; }
  .kpi-strip-item:first-child { grid-column: 1 / -1; }
  .kpi-strip-item:nth-child(2) { border-right: 1px solid var(--border2, var(--border)) !important; border-bottom: none !important; }
  .kpi-strip-item:last-child { border-bottom: none !important; }
  .kpi-strip-num { font-size: 34px !important; margin-bottom: 6px !important; }
  .kpi-strip-label { font-size: 13.5px !important; line-height: 1.4 !important; }
  .kpi-strip-label br { display: none; }
  /* FAQ rows must grow with their text */
  .faq-item, .faq-item summary, .faq-item p { height: auto !important; max-height: none !important; }
  .faq-item summary { min-height: 56px; padding-top: 14px; padding-bottom: 14px; align-items: flex-start; }
}

@media (max-width: 768px) {
  /* Type floor: nothing readable below 12px on phones */
  th, .detect-pill, .flag, .param-type, .code-lang, .param-req, .capacity-track-val, .ent-feature-note,
  .c-str, .c-key, .c-num, .c-gray, .c-kw, .c-fn, label { font-size: max(12px, 1em); }
  .c-str, .c-key { font-size: 12px; }
  /* Code samples wrap inside the screen instead of stretching the page */
  pre, .code-block, .code-body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; max-width: 100%; }
  .param-table { min-width: 520px; }
  .orb { display: none; }
}

@media (max-width: 768px) {
  /* Enterprise: decorative floating-icon scene pushed the headline ~360px down the screen */
  .hero-float { display: none !important; }
  /* readable table-of-contents / legal links */
  .toc a, .toc-list a, .legal-toc a { display: block; padding: 10px 0; }
}

@media (max-width: 768px) {
  /* While the menu is open the header must be solid, not see-through to the page */
  .mnav-open nav { background: var(--bg, #F0EEE6) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; z-index: 2100 !important; }
}

@media (max-width: 768px) {
  /* Enterprise comparison: fit all three columns on a phone, no hidden Enterprise column */
  .tscroll > table.compare, table.compare { min-width: 0 !important; width: 100%; table-layout: fixed; }
  table.compare th, table.compare td { padding: 12px 8px !important; font-size: 13px !important; line-height: 1.4; word-break: break-word; }
  table.compare th:first-child, table.compare td:first-child { width: 32%; }
  table.compare thead th { font-size: 11px !important; letter-spacing: .04em; }
}
