/* =========================================================
   MEZERTEC 모바일 화면 보정 (mobile.css)
   - 페이지 스타일이 인라인 style 속성이므로 !important로 덮어씀
   - PC 화면(769px 이상)에는 영향 없음
   ========================================================= */

/* ---------- 공통: 링크로 이동할 때 고정 헤더에 제목이 가리지 않게 ---------- */
[id] { scroll-margin-top: 96px; }

/* ---------- 태블릿 이하: 메뉴가 두 줄로 내려가면 드롭다운 패널이 메뉴를 덮던 문제 ---------- */
@media (max-width: 1180px) {
  #site-cmm-menu, #site-probe-menu, #cmm-menu, #probe-menu {
    top: 100% !important;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  [id] { scroll-margin-top: 112px; }

  /* ---------- 헤더 ---------- */
  /* 스크롤하면 로고 줄은 올라가고 메뉴 줄(+위치 표시)만 고정 */
  div[style*="position: sticky; top: 0; z-index: 40"],
  header[style*="position: sticky"] { top: -61px !important; }

  div[style*="min-height: 76px"] {
    padding: 0 16px !important;
    min-height: 0 !important;
    gap: 0 12px !important;
    flex-wrap: wrap !important;
  }
  div[style*="min-height: 76px"] > a:first-child {
    height: 61px; box-sizing: border-box;
    padding: 8px 0 !important; gap: 3px !important; justify-content: center;
  }
  div[style*="min-height: 76px"] > a:first-child > img { height: 28px !important; }
  div[style*="min-height: 76px"] > a:first-child > span {
    font-size: 11px !important; line-height: 14px; padding-left: 29px !important;
  }
  /* 주 메뉴: 한 줄 + 좌우 스크롤 */
  nav[style*="gap: 4px 28px"] {
    order: 3; width: 100%; flex: 0 0 100%;
    flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden;
    gap: 0 20px !important; font-size: 15px !important;
    border-top: 1px solid #E3E8EF; margin: 0 -16px; padding: 0 16px;
    box-sizing: content-box; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  nav[style*="gap: 4px 28px"]::-webkit-scrollbar { display: none; }
  nav[style*="gap: 4px 28px"] > * {
    flex: 0 0 auto; white-space: nowrap;
    font-size: 15px !important; padding: 11px 0 !important; min-height: 44px; box-sizing: border-box;
  }
  nav[style*="gap: 4px 28px"] > a:last-child { padding-right: 28px !important; }
  /* KOR | ENG 버튼은 로고 오른쪽 */
  div[role="group"][style*="border-radius: 999px"] { order: 2; }
  div[role="group"][style*="border-radius: 999px"] > a { padding: 5px 11px !important; }

  /* 위치 표시(브레드크럼) */
  nav[style*="min-height: 44px"][style*="gap: 4px 10px"] {
    padding: 0 16px !important; min-height: 36px !important; font-size: 13px !important;
    flex-wrap: nowrap !important; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  }
  nav[style*="min-height: 44px"][style*="gap: 4px 10px"] > * {
    padding-top: 7px !important; padding-bottom: 7px !important; min-height: 0 !important; font-size: 13px !important;
  }

  /* 드롭다운 패널 */
  #site-cmm-menu > div, #site-probe-menu > div, #cmm-menu > div, #probe-menu > div {
    padding: 14px 16px !important; gap: 8px !important;
    grid-template-columns: 1fr !important;
  }
  #site-cmm-menu a, #site-probe-menu a, #cmm-menu a, #probe-menu a {
    padding: 12px 14px !important; gap: 12px !important;
  }
  #site-cmm-menu a > span[aria-hidden], #site-probe-menu a > span[aria-hidden],
  #cmm-menu a > span[aria-hidden], #probe-menu a > span[aria-hidden] {
    width: 40px !important; height: 40px !important;
  }

  /* 메인 맨 위 띠(이메일·KOR/ENG) */
  div[style*="padding: 8px 24px"] { padding: 6px 16px !important; font-size: 12px !important; }

  /* ---------- 여백 ---------- */
  [style*="padding: 0 24px"] { padding-left: 16px !important; padding-right: 16px !important; }
  [style*="padding: 96px 24px"], [style*="padding: 88px 24px"], [style*="padding: 80px 24px"],
  [style*="padding: 72px 24px"], [style*="padding: 64px 24px"], [style*="padding: 56px 24px"] {
    padding: 48px 16px !important;
  }
  [style*="padding: 36px 24px"] { padding: 28px 16px !important; }
  [style*="padding: 28px 24px"] { padding: 22px 16px !important; }
  [style*="padding: 24px 20px"], [style*="padding: 24px 28px"], [style*="padding: 24px 22px"] { padding: 20px 18px !important; }
  [style*="padding: 32px 28px"], [style*="padding: 28px 32px"], [style*="padding: 28px 28px 32px"] { padding: 22px 20px !important; }
  [style*="padding: 28px;"], [style*="padding: 32px;"] { padding: 20px !important; }

  [style*="gap: 56px"], [style*="gap: 48px"], [style*="gap: 40px 56px"] { gap: 28px !important; }
  [style*="gap: 40px;"], [style*="gap: 36px"] { gap: 24px !important; }

  /* ---------- 글자 크기 ---------- */
  [style*="font-size: 56px"], [style*="font-size: 52px"] { font-size: 34px !important; line-height: 1.22 !important; }
  [style*="font-size: 48px"] { font-size: 32px !important; line-height: 1.25 !important; }
  [style*="font-size: 40px"], [style*="font-size: 38px"] { font-size: 28px !important; line-height: 1.3 !important; }
  [style*="font-size: 36px"], [style*="font-size: 34px"] { font-size: 26px !important; line-height: 1.3 !important; }
  [style*="font-size: 30px"], [style*="font-size: 28px"] { font-size: 23px !important; }
  [style*="font-size: 26px"], [style*="font-size: 24px"] { font-size: 20px !important; }
  [style*="font-size: 22px"] { font-size: 19px !important; }
  [style*="font-size: 18px"] { font-size: 16px !important; }
  [style*="font-size: 17px"] { font-size: 16px !important; }

  /* 주메뉴 글자는 위의 일괄 축소에서 제외 */
  nav[style*="gap: 4px 28px"] > * { font-size: 15px !important; }

  /* ---------- 표 ---------- */
  table th, table td { padding: 10px 12px !important; font-size: 14px !important; }
  table { font-size: 14px !important; }
  /* 가로로 넘치는 표: 안내 문구 + 오른쪽 그림자 (mobile.js가 표시 여부 판단) */
  [data-mz-scroll="1"]::before {
    content: "← 좌우로 밀어서 보기 →";
    display: block; position: sticky; left: 0;
    font-size: 12px; color: #5A6780; padding: 0 0 6px; white-space: nowrap;
  }
  html[lang="en"] [data-mz-scroll="1"]::before { content: "← Swipe to see more →"; }

  /* 고정 폭 그림(스타일러스 도해 등)은 화면에 맞춤 */
  svg[style*="min-width: 720px"] { min-width: 600px !important; }

  /* ---------- 오른쪽 아래 빠른 메뉴(메인) ---------- */
  nav[style*="position: fixed; right: 14px"] { right: 10px !important; bottom: 14px !important; gap: 6px !important; }
  nav[style*="position: fixed; right: 14px"] > * {
    width: 46px !important; height: 46px !important; font-size: 11px !important;
    box-shadow: 0 2px 8px rgba(10,31,60,0.25);
  }

  /* ---------- 버튼: 화면 폭에 맞게 ---------- */
  a[style*="padding: 15px 28px"], a[style*="padding: 14px 28px"] { padding: 13px 20px !important; }

  /* 이미지 높이가 고정된 카드 */
  [style*="height: 380px"] { height: 240px !important; }
}

@media (max-width: 380px) {
  [style*="font-size: 56px"], [style*="font-size: 52px"] { font-size: 30px !important; }
  nav[style*="gap: 4px 28px"] { gap: 0 16px !important; }
}

/* 영문: 오른쪽 아래 둥근 버튼 안 글자가 넘치지 않게 */
html[lang="en"] nav[style*="position: fixed; right: 14px"] > button { font-size: 10px !important; line-height: 1.15 !important; }
@media (max-width: 768px) {
  html[lang="en"] nav[style*="position: fixed; right: 14px"] > button { font-size: 9px !important; }
}
