/* Phone only (<=768px): site header is not sticky/fixed and header rows stay on one line and scroll horizontally.
   Desktop (>=769px) is unchanged. Do not use these rules for table sticky columns or in-page panels except #gapAlertPanel's header offset. */
@media (max-width: 768px) {
  /* Un-pin the shared site header so it scrolls away with the page. */
  html body header.sticky,
  html body header.top-0,
  html body #siteHeader.sticky,
  html body #siteHeader.top-0 {
    position: static !important;
    top: auto !important;
  }

  /* Side panel used to sit under the sticky header (top-20). No reserved gap once the header unpins. */
  html body #gapAlertPanel.sticky {
    top: 0 !important;
  }

  html body header.sticky,
  html body #siteHeader {
    max-width: 100%;
  }

  html body header.sticky > div,
  html body #siteHeader > div {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Main header row: logo + nav stay on one line. */
  html body header.sticky > div > div.flex,
  html body header.sticky > div > div.hdr-row,
  html body #siteHeader .hdr-row {
    flex-wrap: nowrap !important;
    min-width: 0;
    max-width: 100%;
  }

  html body header.sticky > div > div.flex > div:first-child,
  html body #siteHeader .hdr-row > div:first-child {
    flex: 0 0 auto;
    min-width: 0;
  }

  /* Nav / buttons / in-row search: single line, swipe right. */
  html body header.sticky > div > div.flex > div.flex:last-child,
  html body #siteHeader .hdr-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  html body header.sticky > div > div.flex > div.flex:last-child::-webkit-scrollbar,
  html body #siteHeader .hdr-nav::-webkit-scrollbar {
    display: none;
  }

  html body header.sticky > div > div.flex > div.flex:last-child > *,
  html body #siteHeader .hdr-nav > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Home-style search that is currently w-full/order-last (its own wrapping row): keep it in the scrolling row instead.
     Paper/live mobile search stays a separate .hdr-search row; #hdrSearchWrap there is hidden on small screens and is not targeted. */
  html body header #hdrSearchWrap.w-full,
  html body header #hdrSearchWrap.order-last {
    width: auto !important;
    min-width: 160px;
    max-width: 220px;
    flex: 0 0 180px !important;
    order: 0 !important;
  }

  html body header #hdrSearchWrap.w-full input,
  html body header #hdrSearchWrap.order-last input {
    width: 100%;
    min-width: 0;
  }

  /* Dedicated mobile search row (paper/live): stay one line. */
  html body #siteHeader .hdr-search {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
}
