body { font-family: 'Noto Sans KR', sans-serif; }
/* nowrap — 좁은 칸(모바일 표)에서 '발송됨' 이 한 글자씩 세로로 쪼개지지 않게 */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; white-space: nowrap; }

/* ─── 커스텀 툴팁 (.tip + data-tip) ───
   네이티브 title 은 모바일/터치에서 안 뜨고 데스크톱서도 지연·무스타일 → CSS 툴팁으로 대체.
   hover(데스크톱) + focus(키보드/터치 탭) 둘 다에서 표시. 트리거에 tabindex="0" 필요. */
.tip { position: relative; display: inline-flex; outline: none; }
.tip::after, .tip::before {
  /* display:none — visibility:hidden 으로 숨기면 화면 오른쪽 밖으로 뻗은 말풍선 폭이 문서 폭에 계속 잡혀 가로 스크롤이 생긴다(지점 관리) */
  display: none;
  position: absolute; z-index: 50; pointer-events: none;
}
.tip::after {
  content: attr(data-tip);
  left: 0; bottom: calc(100% + 9px);
  width: max-content; max-width: 240px;
  background: #1e293b; color: #fff;
  font-size: 11px; font-weight: 400; line-height: 1.5;
  text-align: left; white-space: normal;
  padding: 8px 10px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.tip::before {  /* 아래쪽 화살표 — 아이콘 좌측에 맞춤 */
  content: ""; left: 6px; bottom: calc(100% + 3px);
  border: 6px solid transparent; border-top-color: #1e293b;
}
.tip:hover::after, .tip:hover::before,
.tip:focus::after, .tip:focus::before,
.tip:focus-visible::after, .tip:focus-visible::before {
  display: block; animation: tip-in .12s ease;
}
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
/* 좁은 화면(모바일): 말풍선을 아이콘 옆이 아니라 화면 아래쪽 띠로 띄운다.
   아이콘이 화면 오른쪽에 있으면 240px 말풍선이 화면 밖으로 잘리고, 숨겨 둔 상태에서도 문서 폭을 넓혀 옆으로 밀렸다(지점 관리).
   fixed 는 아이콘 위치와 상관없이 늘 화면 안에 있고 문서 폭에도 영향이 없다. */
@media (max-width: 767px) {
  .tip::after {
    position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px));   /* 80px = 우하단 둥근 버튼(촬영·도움말) 바로 위 */
    width: auto; max-width: none; z-index: 70;
    font-size: 12.5px; padding: 10px 12px;
  }
  .tip::before { display: none; }
}
/* iOS Safari: <input type="date"> 가 자기 컨텐츠 폭에 맞춰 줄어드는 이슈 해제 — w-full 이 실제로 먹게 한다 */
input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; box-sizing: border-box; }
/* iOS Safari 는 글자 크기가 16px 미만인 입력칸에 포커스하면 화면을 멋대로 확대한다(손으로 줄여야 돌아옴).
   좁은 화면에서는 작은 글자(text-sm·text-xs)로 지정된 입력칸·선택 상자를 16px 로 맞춰 막는다.
   이미 16px 이상인 칸(text-lg·text-xl 등)은 줄이지 않도록 '작은 크기를 명시한 칸'만 고른다.
   체크박스·날짜·시간 칸은 글자 입력이 아니라 제외. 표 안에서 크기를 따로 지정한 칸(#아이디 선택자)은 이 규칙보다 우선한다.
   주의: 한글 폰트는 입력칸 기본 폭(size=20)이 글자 크기에 비례해 커서, 16px 로 키우면 flex 줄 안의 검색창이 화면을 밀 수 있다.
   그런 칸에는 min-w-0 을 직접 줄 것(계약 목록 검색창). 여기서 min-width:0 을 일괄로 주면 min-w-[9rem] 같은 의도한 최소 폭이 무너진다. */
@media (max-width: 767px) {
  :is(input.text-sm, input.text-xs, label.text-sm input, label.text-xs input):is(:not([type]), [type="text"], [type="search"], [type="email"], [type="tel"], [type="number"], [type="password"], [type="url"]),
  select.text-sm, select.text-xs, textarea.text-sm, textarea.text-xs { font-size: 16px; }
}

/* /apply 가입 위저드 공용 입력 스타일 (단계 수가 많아 반복되는 유틸리티 클래스를 하나로 묶음) */
.wz-field {
  width: 100%; padding: 0.625rem 1rem;
  border: 1px solid #cbd5e1; border-radius: 0.5rem;
  outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
.wz-field:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.35); }

/* 템플릿 편집기 — 이미지 배치 대기 중에는 페이지 위에서 십자 커서로 클릭 지점을 고르게 한다 */
.tpl-placing .tpl-page, .tpl-placing .tpl-text { cursor: crosshair !important; }

/* 편집기에서 화면에 미리 그리는 글자(수정·이동·복제·입력칸)는 양식 PDF 와 같은 NanumGothic 으로.
   기본 Noto Sans KR 로 그리면 글자 폭이 달라 배경(PDF 렌더 이미지)과 크기가 어긋나 보인다. */
.tpl-ptext, input.tpl-inline { font-family: 'Nanum Gothic', 'Noto Sans KR', sans-serif; }
