/* HeyDali 모바일 반응형 — 인라인 스타일 위에 얹는 공용 오버라이드.
   페이지 마크업이 인라인 스타일 기반이라 속성 선택자 + !important로 덮는다. */

@media (max-width: 900px) {
  /* 섹션 좌우 여백 축소 */
  section[style*="padding:180px 40px"] { padding: 150px 24px 60px !important; }
  section[style*="padding:110px 40px"] { padding: 70px 24px !important; }
  section[style*="padding:120px 40px"] { padding: 80px 24px !important; }
  section[style*="padding:150px 40px 130px"] { padding: 90px 24px 80px !important; }
  section[style*="padding:0 40px"] { padding-left: 24px !important; padding-right: 24px !important; }
  section[style*="padding:40px 40px"] { padding-left: 24px !important; padding-right: 24px !important; }
  footer div[style*="padding:0 40px"] { padding-left: 24px !important; padding-right: 24px !important; }

  /* 2단 본문 그리드 → 1단 */
  div[style*="grid-template-columns:0.75fr 1.25fr"],
  div[style*="grid-template-columns:0.8fr 1.2fr"],
  div[style*="grid-template-columns:0.9fr 1.1fr"],
  div[style*="grid-template-columns:1.1fr 0.9fr"],
  div[style*="grid-template-columns:1fr 1.4fr"],
  section[style*="grid-template-columns:1fr 1.15fr"] {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  /* 통계 카드 4단 → 2단 */
  .hd-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .hd-stat { border-left: none !important; }
  .hd-stat:nth-child(even) { border-left: 1px solid #ececec !important; }
  .hd-stat:nth-child(n+3) { border-top: 1px solid #ececec; }

  /* 교육 분야 5단 → 2단 */
  div[style*="grid-template-columns:repeat(5,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  .hd-edu-field { border-left: none !important; }
  .hd-edu-field:nth-child(even) { border-left: 1px solid #ececec !important; }
  .hd-edu-field:nth-child(n+3) { border-top: 1px solid #ececec; }

  /* 3·4단 카드 그리드 → 2단 */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* 푸터 4단 → 2단 */
  div[style*="grid-template-columns:1.3fr 1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; gap: 36px !important; }

  /* 메인 서비스 행: 번호+제목 / 아래로 설명·링크 */
  .hd-service-row,
  div[style*="grid-template-columns:64px 1fr 1.1fr 130px"] {
    grid-template-columns: 44px 1fr !important;
    row-gap: 10px !important;
  }
  .hd-service-row > *:nth-child(3),
  .hd-service-row > *:nth-child(4),
  div[style*="grid-template-columns:64px 1fr 1.1fr 130px"] > *:nth-child(3),
  div[style*="grid-template-columns:64px 1fr 1.1fr 130px"] > *:nth-child(4) { grid-column: 2 !important; justify-self: start; }

  /* 교육 강의 이력: 그리드 → 줄바꿈 플렉스 */
  .hd-lect-row { display: flex !important; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
  .hd-lect-row .y { width: 100%; }
}

@media (max-width: 640px) {
  /* 폰: 카드·입력 그리드 전부 1단 */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns:1.3fr 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }

  section[style*="padding:180px 40px"] { padding: 130px 18px 50px !important; }
  section[style*="padding:0 40px"],
  section[style*="padding:40px 40px"] { padding-left: 18px !important; padding-right: 18px !important; }
  footer div[style*="padding:0 40px"] { padding-left: 18px !important; padding-right: 18px !important; }

  /* 메인 텍스트 마퀴·증명서·후기 크기 조정 */
  .hd-marq-unit { font-size: 34px !important; }
  .hd-cert-img { height: 210px !important; }
  .hd-client-box { width: 130px !important; height: 60px !important; }

  /* 고정 네비 여백 */
  body > div[style*="position:fixed"][style*="top:0"] { padding: 14px 18px !important; }
}
