/* Research Home 2.0 — mobile-only density and first-viewport polish.
   Kept outside the component so desktop/tablet behavior stays unchanged. */
@media (max-width: 639px) {
  main.bg-white > div[class*="max-w-[1680px]"] {
    padding: 12px 14px calc(5.75rem + env(safe-area-inset-bottom)) !important;
  }

  /* First viewport: reduce stacked whitespace and keep the hierarchy crisp. */
  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type {
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div {
    border-radius: 16px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child {
    padding: 20px 18px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child h1 {
    font-size: 30px !important;
    line-height: 1.16 !important;
    letter-spacing: -0.025em !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child p.mt-4 {
    margin-top: 14px !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  /* The first sentence already explains the value on a phone; remove the duplicate support line. */
  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child p.mt-1\.5 {
    display: none !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child div.mt-6 {
    margin-top: 18px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:first-child div.mt-6 > button {
    height: 44px !important;
    min-width: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    justify-content: center !important;
    white-space: nowrap !important;
    font-size: 14px !important;
  }

  /* Onboarding card: fix 0 / 10 wrapping and turn the three large tiles into compact rows. */
  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) {
    padding: 17px 18px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child {
    gap: 10px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div:first-child {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 {
    margin-top: 13px !important;
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 14px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 > div:first-child {
    min-width: 82px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 > div:first-child > div:first-child {
    white-space: nowrap !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 .text-3xl {
    margin-top: 3px !important;
    font-size: 28px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 .text-lg {
    font-size: 16px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > div:first-child > div.mt-4 > p {
    padding-bottom: 0 !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div:first-child > button {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 {
    margin-top: 13px !important;
    display: block !important;
    border-top: 1px solid #e2e8f0 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 > div {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 10px !important;
    align-items: center !important;
    padding: 10px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 > div + div {
    border-top: 1px solid #eef2f7 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 > div > span {
    grid-row: 1 / 3 !important;
    width: 34px !important;
    height: 34px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 > div > div.mt-3 {
    margin-top: 0 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:first-of-type > div:nth-child(2) > div.mt-5 > div > div.mt-1 {
    margin-top: 2px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  /* Discovery list: horizontal swipe cards surface several companies without a long vertical wall. */
  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] {
    margin-bottom: 12px !important;
    border-radius: 16px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div:first-child {
    padding: 14px 16px !important;
    gap: 8px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div:first-child h2 {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div:first-child p {
    margin-top: 4px !important;
    line-height: 1.5 !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scroll-snap-type: x mandatory !important;
    background: #ffffff !important;
    padding: 12px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid::-webkit-scrollbar {
    display: none !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid > div {
    flex: 0 0 min(78vw, 300px) !important;
    min-height: 198px !important;
    padding: 15px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    scroll-snap-align: start !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid > div > .mt-4:first-of-type {
    margin-top: 10px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid > div > .space-y-2\.5 {
    margin-top: 12px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:nth-of-type(2)[class*="overflow-hidden"] > div.grid > div > button {
    margin-top: 14px !important;
  }

  /* Lower content keeps the same design system, just with tighter mobile padding. */
  main.bg-white > div[class*="max-w-[1680px]"] > section:last-of-type {
    gap: 12px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:last-of-type > div {
    border-radius: 16px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:last-of-type > div > div:first-child {
    padding: 14px 16px !important;
  }

  main.bg-white > div[class*="max-w-[1680px]"] > section:last-of-type > div > div:first-child h2 {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }
}
