
@layer ifix-mobile-layout {
  .ifix-hero-example-toggle { display: none; }

  @media (max-width: 720px) {
    html:is(#ifix-ui,:root) .growth-header {
      gap: 6px !important;
      padding-inline: 8px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .ifix-header-brand-controls {
      flex: 0 0 auto !important;
      gap: 2px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .ifix-header-brand-controls .growth-brand {
      width: clamp(82px, 24vw, 112px) !important;
      flex-basis: clamp(82px, 24vw, 112px) !important;
    }
    html:is(#ifix-ui,:root) .growth-header :is(.growth-menu,.mobile-search-toggle) {
      width: 44px !important;
      min-width: 44px !important;
      height: 44px !important;
      border-radius: 50% !important;
    }
    html:is(#ifix-ui,:root) .growth-header .mobile-search-toggle {
      margin-inline-start: auto !important;
      border: 1px solid rgb(128 151 168 / .36) !important;
      background: var(--sg-panel, Canvas) !important;
    }
    html:is(#ifix-ui,:root) .growth-header .growth-header-actions {
      gap: clamp(4px, 2vw, 10px) !important;
    }
    html:is(#ifix-ui,:root) .growth-header .growth-search {
      padding-inline: 6px !important;
      gap: 3px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .growth-search > .search-action-divider {
      margin-inline: 2px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .growth-search input {
      min-width: 0 !important;
      padding-inline: 6px !important;
      font-size: 16px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .growth-search .phase02-search-panel {
      position: absolute !important;
      max-height: min(52dvh, 310px) !important;
      overflow: auto !important;
    }
    html:is(#ifix-ui,:root) .ui-bottom-nav > a[href="/ifix-shop/"] {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .ui-bottom-nav {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    html:is(#ifix-ui,:root) .ui-bottom-nav > :is(a,button) {
      flex: 1 1 0 !important;
      min-width: 0 !important;
    }
    html:is(#ifix-ui,:root) .ui-bottom-nav .ui-find svg { display: none !important; }
    html:is(#ifix-ui,:root) .ui-bottom-nav .ui-find::before {
      content: "";
      width: 26px;
      height: 26px;
      background: url("/brand/ifix-ai-hex-wrench.v2.png") center / contain no-repeat;
    }
    html:is(#ifix-ui,:root)[data-theme="light"] .ui-bottom-nav .ui-find::before {
      filter: url("/brand/ifix-ai-wrench-theme.v1.svg#light-wrench");
    }
    html:is(#ifix-ui,:root) .sidebar.common-sidebar {
      overscroll-behavior: contain;
      max-height: calc(100dvh - 64px);
    }
    html:is(#ifix-ui,:root) .sidebar.common-sidebar .precision-sidebar-support {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-layout {
      gap: 12px !important;
      padding: 20px 16px !important;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-intro {
      gap: 10px !important;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      justify-self: start;
      min-height: 44px;
      padding: 0 10px;
      border: 0;
      border-radius: 8px;
      color: var(--sg-accent-text, LinkText);
      background: transparent;
      font: inherit;
      font-size: 13px;
      cursor: pointer;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle::after {
      content: "▾";
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle[aria-expanded="true"]::after {
      transform: rotate(180deg);
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-chat:not([data-mobile-open]) {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .feed:has(> .ifix-ai-home-hero) > .library-section:not(.category-results) {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .ui-category-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      gap: 6px !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .ui-category-grid > :is(a,button) {
      min-height: 79px !important;
      height: auto !important;
      padding: 7px 3px !important;
      gap: 5px !important;
      font-size: 10px !important;
      line-height: 1.25 !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .ui-category-grid svg {
      width: 26px !important;
      height: 26px !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main :is(.reference-recommendation-grid,.qa-shorts-row) {
      display: grid !important;
      grid-auto-flow: column !important;
      grid-template-columns: none !important;
      grid-auto-columns: min(77%, 310px) !important;
      gap: 12px !important;
      overflow-x: auto !important;
      scroll-snap-type: x proximity;
      overscroll-behavior-inline: contain;
      padding: 3px 3px 10px !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .qa-shorts-row {
      grid-auto-columns: min(46%, 190px) !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main :is(.reference-recommendation-grid,.qa-shorts-row) > * {
      min-width: 0 !important;
      scroll-snap-align: start;
    }
    html:is(#ifix-ui,:root) .ui-discovery-side :is(.precision-trending,.ui-agent-card,.reference-related) {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .ifix-home-trend-grid > :nth-child(n+4) {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .ifix-home-trending .precision-panel-title {
      align-items: center !important;
    }

    /* Give each top-level action one obvious place on a phone. */
    html:is(#ifix-ui,:root) .growth-header {
      flex-wrap: nowrap !important;
    }
    html:is(#ifix-ui,:root) .growth-header .ifix-header-brand-controls .growth-brand {
      min-width: clamp(82px, 24vw, 112px) !important;
      max-width: clamp(82px, 24vw, 112px) !important;
    }
    html:is(#ifix-ui,:root) body:has(.ui-bottom-nav) .growth-header-actions > :is(.growth-ai-agent,.precision-profile) {
      display: none !important;
    }
    html:is(#ifix-ui,:root) .growth-header .mobile-search-toggle {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      gap: 5px;
      width: 76px !important;
      min-width: 76px !important;
      border-radius: 22px !important;
    }
    html:is(#ifix-ui,:root) .growth-header .mobile-search-toggle[aria-expanded="false"]::after {
      content: "Search";
      font-size: 12px;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-intro h1 {
      font-size: clamp(27px, 7.9vw, 37px) !important;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-intro p {
      font-size: 14px !important;
      line-height: 1.4 !important;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle {
      min-height: 40px;
      padding-inline: 0 8px;
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle::after {
      content: "";
      width: 6px;
      height: 6px;
      border: solid currentColor;
      border-width: 0 1px 1px 0;
      transform: translateY(-2px) rotate(45deg);
    }
    html:is(#ifix-ui,:root) .ifix-ai-home-hero .ifix-hero-example-toggle[aria-expanded="true"]::after {
      transform: translateY(2px) rotate(225deg);
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .ui-category-grid {
      grid-auto-flow: column !important;
      grid-template-columns: none !important;
      grid-auto-columns: minmax(83px, 1fr) !important;
      overflow-x: auto !important;
      padding: 2px 2px 8px !important;
      scroll-snap-type: x proximity;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .ui-category-grid > :is(a,button) {
      scroll-snap-align: start;
      min-height: 70px !important;
      font-size: 11px !important;
    }
    html:is(#ifix-ui,:root) .ui-discovery-main .reference-recommendation-grid {
      grid-auto-columns: min(91%, 400px) !important;
    }
  }
}
