/* Phone fixes for the AI agents design pages (/, /artifacts, the 11 artifact pages, /download).
 * Kept apart from assets/ai-agents.css, which is generated by Gaurang's assemble script.
 * Touch targets: links and tabs under 24px tall get a larger invisible hit area (WCAG 2.2
 * target size), so they are easier to tap without changing how they look. */
@media (max-width: 767px) {
  .ag-hero__bar-link,
  .ag-win__tabs [data-screen],
  .ag-directory__try,
  .ag-directory__browse,
  .ag-prebuilt__more,
  .ag-services__link {
    position: relative;
  }
  .ag-hero__bar-link::after,
  .ag-win__tabs [data-screen]::after,
  .ag-directory__try::after,
  .ag-directory__browse::after,
  .ag-prebuilt__more::after,
  .ag-services__link::after {
    content: "";
    position: absolute;
    inset: -6px -4px;
  }
}

/* Phones and tablets: every picture shows whole, at the width of its column, and tab rows wrap.
 * The generated CSS keeps these Figma exports at 860-1100px and scrolls them sideways in a faded
 * box below 1100px, and lets the tab rows scroll; on a phone that reads as cut off (owner,
 * 2026-11-29). Same selectors as ai-agents.css, so this file (linked after it) wins. */
@media (max-width: 1099.98px) {
  .ag-scrollfig,
  .ag-timeline__scroller,
  .ag-scrollfig.has-more,
  .ag-timeline__scroller.has-more {
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ag-timeline__scroller { padding: 0; margin: 0; }
  .ag-page .ag-repo__figure img,
  .ag-page .ag-lifecycle__visual img,
  .ag-page .ag-observability__figure img,
  .ag-timeline__scroller img {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}
@media (max-width: 1279.98px) {
  .ag-prebuilt__tabs-scroll {
    justify-content: center;
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ag-prebuilt__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 1;
    max-width: 100%;
    border-radius: 24px;
  }
}
@media (max-width: 900px) {
  .ag-prebuilt__stage.is-view,
  .ag-prebuilt__stage.has-more {
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ag-page .ag-prebuilt__stage.is-view > .ag-prebuilt__view {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }
}
@media (max-width: 768px) {
  .ag-prebuilt__tabs-scroll { margin-inline: 0; padding-inline: 0; max-width: 100%; }
}
@media (max-width: 640px) {
  .ag-directory__filters {
    flex-wrap: wrap;
    overflow-x: visible;
    width: auto;
    margin-inline: 0;
    padding-inline: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
/* hero product window: the screen tabs wrap inside the title bar instead of scrolling out of it */
@media (max-width: 1099.98px) {
  .ag-win__bar { flex-wrap: wrap; }
  .ag-win__tabs { flex-wrap: wrap; overflow-x: visible; -webkit-mask-image: none; mask-image: none; }
}
/* 1100-1279px (small laptops): the lifecycle visual sits beside the steps in a column narrower than
 * its 860px minimum, so it scrolled there too. Fit it at every width; wide screens are unchanged
 * because their column is wider than the image's minimum. */
.ag-page .ag-lifecycle__visual img { min-width: 0; width: 100%; max-width: 100%; }
.ag-lifecycle__visual.ag-scrollfig { overflow-x: visible; -webkit-mask-image: none; mask-image: none; }
/* "By the numbers": "1,000,000+" is wider than a quarter-width card on small laptops (1100-1279px),
 * so the "+" was cut off. The number shrinks to fit its card (28px padding each side); where the
 * card is wide enough it stays at the design's 56px / 48px. */
.ag-stats__card { container-type: inline-size; }
.ag-stats__num { font-size: min(56px, calc((100cqi - 56px) / 5)); }
@media (max-width: 640px) {
  .ag-stats__num { font-size: min(48px, calc((100cqi - 56px) / 5)); }
}
/* The other figures fit at every width as well: at exactly 1100px the timeline and repo pipeline
 * (min-width 1100px) still scrolled by a few pixels. Where the column is wider nothing changes. */
.ag-page .ag-repo__figure img,
.ag-page .ag-observability__figure img,
.ag-timeline__scroller img { min-width: 0; max-width: 100%; }
/* Closing banner on the artifact pages: the headline is kept on one line above 1100px, and the longer
 * ones ("Describe your form. Watch the requests arrive.") ran past the banner at 1101-1279px. */
@media (min-width: 1100.02px) and (max-width: 1279.98px) {
  /* artifacts.css loads after this file, hence the extra .ah-page */
  .ah-page .ah-services .ag-services__title { white-space: normal; }
}
/* "Audited and certified" (home, runtime section): the same badges as the site footer (icon + label,
 * assets/image/home-page/*.svg) instead of dashed circles (owner, 2026-11-29). */
.ag-runtime__badges { flex-wrap: wrap; justify-content: center; gap: 16px 32px; }
.ag-runtime__badges li {
  width: auto; height: auto; border: 0; border-radius: 0; background: none;
  flex-direction: row; gap: 8px;
}
.ag-runtime__badges img { width: 36px; height: 36px; flex: none; }
.ag-runtime__badge-t { font-size: 14px; font-weight: 500; white-space: nowrap; }
/* Header: "Contact Sales" sits between Login and Sign Up Free (owner, 2026-11-29). Below 1024px the
 * three buttons do not fit next to the menu, so it hides there (Login hides below 960px); the phone
 * menu drawer keeps Contact sales. */
@media (max-width: 1023.98px) {
  .ag-hero .ag-nav__actions .ag-nav__sales { display: none; }
}
