/* mobile.css — 휴대폰 폭(≤767px) 전용 보정 (두탑 대비 P2 모바일 · 2026-11-27 쿨경 "즉시 전부 진행")
 * lib/tw_head.inc 가 <link media="(max-width: 767px)"> 로만 싣는다 — 데스크톱(1440·1920)에서는 이 파일의 어떤 규칙도 적용되지 않는다
 *   (계약 tests/Unit/MobileLayoutContractTest.php — 모든 규칙이 767px 이하 미디어 안 · 1440 캡처 픽셀 대조).
 * 프리빌드 css/tailwind.min.css 에 없는 값은 여기서 쓴다(임의 값 클래스는 빌드에 없으면 안 먹는다).
 * 설계 docs/plans/dotop_gap_design_20261127.md 0-5 표 중심 원칙 — 표는 짜부라뜨리지 않고 가로 스크롤 상자 안에서 밀어 본다.
 */
@media (max-width: 767px) {
  /* 1) 가로 스크롤 상자 안의 표 — 좁은 폭에 맞추려 칸을 줄여 글자가 한 자씩 세로로 쌓이던 것(투찰 시뮬레이션 공고 표·일괄 투찰표 머리)을
   *    표 최소 폭을 두고 상자 안에서 가로로 밀어 보게 한다. 카드형 표(table-card-m)는 제외. */
  main .overflow-x-auto > table:not(.table-card-m),
  main .table-wrap > table:not(.table-card-m) { min-width: 600px; }
  main .overflow-x-auto > table:not(.table-card-m) th,
  main .table-wrap > table:not(.table-card-m) th { white-space: nowrap; }
  /* 칸 글자는 낱말 단위로 줄바꿈(학교 이름이 한 글자씩 끊기지 않게) · 여러 칸을 합친 안내 줄('공고가 없습니다')은 왼쪽부터(가운데면 600 폭 밖에 놓임) */
  main .overflow-x-auto > table:not(.table-card-m) td,
  main .table-wrap > table:not(.table-card-m) td { word-break: keep-all; }
  main .overflow-x-auto > table:not(.table-card-m) td[colspan] { text-align: left; }
  /* 가로로 밀 수 있는 상자임을 손가락 스크롤로 부드럽게 */
  main .overflow-x-auto { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

  /* 2) 터치 크기 — 버튼·선택·입력칸 최소 44px, 입력 글자 16px(아이폰이 입력칸을 누를 때 화면을 확대하지 않게) */
  main .btn, main select,
  main input[type="text"], main input[type="search"], main input[type="number"], main input[type="date"],
  main input[type="tel"], main input[type="email"], main input[type="password"], main input:not([type]) { min-height: 44px; }
  main select, main textarea,
  main input[type="text"], main input[type="search"], main input[type="number"], main input[type="date"],
  main input[type="tel"], main input[type="email"], main input[type="password"], main input:not([type]) { font-size: 16px; }
  /* 입력칸이 상자 폭을 넘지 않게(w-64 등 고정 폭 입력이 375 폭 카드 안에서 넘치던 것) */
  main input:not([type="checkbox"]):not([type="radio"]), main select, main textarea { max-width: 100%; }

  /* 3) 자동견적 갱신 알림 카드(js/price_chain_notice.js — 오른쪽 위 고정) — 휴대폰에선 화면 위쪽(메뉴 단추·요약 띠)을 덮었다.
   *    아래쪽으로 내리고, 서랍 메뉴(z-50)·가림막(z-40) 밑에 깔리게 한다. */
  #price-chain-card { top: auto !important; bottom: 12px !important; left: 12px !important; right: 12px !important; width: auto !important; z-index: 30 !important; }

  /* 4) 머리글 — 아이콘 단추 터치 크기 */
  header[role="banner"] button, header[role="banner"] a { min-height: 44px; min-width: 44px; justify-content: center; }

  /* 5) 서랍 메뉴 — 항목 터치 높이(묶음 단추·세부 메뉴 링크) */
  #sidebar .sb-btn { min-height: 44px; }
  #sidebar .sb-popup a { min-height: 44px; }
}
