/* Phones and tablets (mobile audit, 2026-10-29: /root/sectest/mobile-audit.py). Loaded after site.css and a11y.css
   on every customer-facing layout; kept out of site.css like a11y.css. Touch screens get 44px targets and 16px form
   text (iOS Safari zooms into anything smaller); narrow screens get grids that fit and cards that give their
   content more room. */

/* ---- Fit the screen: a single grid column may shrink below its widest word or code line (1fr can't, and pushed
   the plans page 7px past a 375px phone and API Apps 14px past 360px) */
@media (max-width: 940px) { .step-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .mcp-connect { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .mcp-connect { padding: 18px 16px; } }
@media (max-width: 860px) { .faq-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 959px) { .ft-copy-grid { grid-template-columns: minmax(0, 1fr); } }

/* A long email in the plans page's "Report saved to …" pill, and the cookie card, wrap instead of widening the page */
@media (max-width: 520px) {
    .pill { max-width: 100%; flex-wrap: wrap; }
    .pill .nowrap { white-space: normal; overflow-wrap: anywhere; }
    .cc-card { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}

/* Small phones: cards give their content more of the screen (the edge-to-edge parts follow) */
@media (max-width: 420px) {
    .pcard { padding: 18px 16px; }
    .pcard .table-wrap { margin: 8px -16px -18px; }
    .pcard .receipts-fine { margin: 24px -16px -18px; }
}

/* Add a card: Stripe's card form draws its own boxes, so less padding around it (it had 235px of a 375px screen) */
@media (max-width: 520px) {
    .card-setup { padding: 0 4px 6px; }
    .card-setup-element { padding: 0; background: none; border: 0; }
}

/* API keys: a key's pop-over (access, rename) opens in the row on phones instead of floating off the right edge */
@media (max-width: 520px) {
    .row-pop-body { position: static; width: auto; margin-top: 8px; box-shadow: none; }
}

/* The FAQ's topic links wrap instead of running off a 360px screen */
@media (max-width: 760px) {
    .faq-toc { max-width: 100%; }
    .faq-toc a { white-space: normal; }
}

/* ---- Touch screens: 44px targets (operator rule, WCAG 2.5.8) */
@media (pointer: coarse) {
    .theme-toggle, .nav-toggle { width: 44px; height: 44px; }
    .account-chip { min-height: 44px; min-width: 44px; }
    .site-nav a { min-height: 44px; display: flex; align-items: center; }
    .brand { min-height: 44px; display: inline-flex; align-items: center; }
    .btn, .leak-exit, .site-video-sound { min-height: 44px; }
    .faq-toc a { min-height: 44px; display: inline-flex; align-items: center; }
    summary { min-height: 44px; }
    .link-button, .btn-text, .pdf-link, .pcard-link, .confirm-change, .login-back, .promo-link, .legal-brand, .blog-rss { min-height: 44px; display: inline-flex; align-items: center; }

    .footer-cols a, .doc-toc a { min-height: 44px; display: flex; align-items: center; }
    .tabs a, .ft-crumbs a, .crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
    .demo-use { min-width: 44px; min-height: 44px; }
    .ft-crumbs a, .crumbs a { min-width: 44px; justify-content: center; }
    nav a, footer a, a.button, .button, button, td a { min-height: 44px; }
    nav a:not([class]), footer a:not([class]), td a:not([class]) { display: inline-flex; align-items: center; }
    nav a, footer a { min-width: 44px; }
    li > a:not([class]), .post-chip, .cc-link { min-height: 44px; }
    .post-chip { display: inline-flex; align-items: center; }
    .stat-note a, .passkey-link, .cc-link, .enh-tag { min-height: 44px; display: inline-flex; align-items: center; }
    .icon-btn, summary.btn { min-width: 44px; justify-content: center; }
    .lp-integration a { min-height: 44px; display: inline-flex; align-items: center; }
    a[href^="/account/report-problem"], li[id^="src-"] > a, .ac-map a, .ws-case h3 a { padding-block: 13px; }
    .contact-switch .passkey-link { min-height: 44px; display: inline-flex; align-items: center; }
    label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 44px; }

    /* 16px form text, so iOS doesn't zoom the page when a field gets focus (selects and text areas carry two :not()s
       so page rules like ".field select" don't win) */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
    select:not([data-x]):not([data-y]), textarea:not([data-x]):not([data-y]) { font-size: max(16px, 1em); }
}

/* Short lists (API dashboard keys and recent requests, billing): a long request path or key name wraps instead of
   widening the list past the screen (mini-list is a grid whose items kept their min-content width; release sweep 10/30) */
.mini-list { grid-template-columns: minmax(0, 1fr); }
.mini-list li { min-width: 0; }
.mini-list li > span:nth-child(2) b, .mini-list li > span:nth-child(2) small { overflow-wrap: anywhere; }
