/* 폼 컨트롤 공통 부품(2026-11-07, 아이폰 우선).
   체크박스·라디오(.han-check), select, 날짜·월 입력, placeholder, 파일 입력, 접기 제목을 한 곳에서 정한다.
   플랫폼 기본 모양에 기대지 않아 iOS·안드로이드·데스크톱이 같은 크기·정렬로 보인다.
   다른 CSS 파일이 모양(테두리·여백·카드 느낌)만 정하고, 크기·정렬·체크 표시는 여기서 맡는다. 마지막에 불러온다. */
:root{--han-check-size:20px;--han-check-line:#7d8696;--han-check-on:var(--blue,var(--secondary));--han-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23626873' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 6 4.5 4.5L12.5 6'/%3E%3C/svg%3E");--han-checkmark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.4 3 3L12.5 4.8'/%3E%3C/svg%3E")}

/* 1) 체크박스·라디오 ─ 글자 첫 줄에 맞추는 20px 상자. 칩처럼 input을 숨기는 형태(온보딩·글쓰기 주제 칩)는 제외 */
input[type=checkbox]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *),
input[type=radio]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){
 -webkit-appearance:none;appearance:none;flex:none;box-sizing:border-box;
 width:var(--han-check-size);height:var(--han-check-size);min-width:var(--han-check-size);min-height:var(--han-check-size);max-width:var(--han-check-size);
 margin:2px 0 0;padding:0;font:inherit;
 margin-top:calc((1lh - var(--han-check-size)) / 2);
 border:1.5px solid var(--han-check-line);border-radius:6px;background:#fff center/14px no-repeat;
 cursor:pointer;transition:background-color .12s ease-out,border-color .12s ease-out}
input[type=radio]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){border-radius:50%}
input[type=checkbox]:checked:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){background-color:var(--han-check-on);border-color:var(--han-check-on);background-image:var(--han-checkmark)}
input[type=radio]:checked:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){border-color:var(--han-check-on);background:radial-gradient(circle,var(--han-check-on) 0 4.5px,#fff 5.5px)}
input[type=checkbox]:focus-visible,input[type=radio]:focus-visible{outline:2px solid var(--han-check-on);outline-offset:2px}
input[type=checkbox]:disabled,input[type=radio]:disabled{opacity:.45;cursor:not-allowed}

/* 체크 한 줄(라벨) ─ 상자 20px + 글자. 상자가 직접 들어 있는 라벨이면 클래스 없이도 적용된다. 배치(display·열·정렬)만 여기서 정하고, 테두리·여백·카드 느낌은 개별 CSS가 맡는다.
   :has를 모르는 브라우저(iOS 15.3 이하)가 규칙째 버리지 않도록 :has 선택자는 규칙마다 따로 둔다 */
.han-check{display:grid;grid-template-columns:var(--han-check-size) minmax(0,1fr);column-gap:10px;row-gap:0;align-items:start;align-content:center}
label:has(>input[type=checkbox]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *)):not(.prep-select-label){display:grid;grid-template-columns:var(--han-check-size) minmax(0,1fr);column-gap:10px;row-gap:0;align-items:start;align-content:center}
label:has(>input[type=radio]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *)):not(.prep-select-label){display:grid;grid-template-columns:var(--han-check-size) minmax(0,1fr);column-gap:10px;row-gap:0;align-items:start;align-content:center}
/* 누르는 영역 44px(:where라 개별 CSS의 더 큰 min-height가 이긴다) */
:where(.han-check){min-height:44px;line-height:1.5;cursor:pointer}
:where(label:has(>input[type=checkbox])){min-height:44px;line-height:1.5;cursor:pointer}
:where(label:has(>input[type=radio])){min-height:44px;line-height:1.5;cursor:pointer}
/* :has를 모르는 브라우저: 배치 규칙이 없어도 상자와 글자가 같은 줄에 오도록 인라인으로 둔다 */
@supports not selector(:has(*)){
 input[type=checkbox],input[type=radio]{margin:0 10px 0 0;vertical-align:middle}
 /* .stack label{display:grid}처럼 라벨이 위아래로 쌓는 규칙을 이기고 상자와 글자를 한 줄에 둔다 */
 .stack .check,.han-check,#cities-form .city-stage-options label,.interest-choice,.school-compare,.prep-form .prep-date-undecided{display:flex;align-items:center;gap:10px}
 /* 설명이 여러 줄일 수 있는 카드형 선택은 첫 줄 쪽에 둔다 */
 .trade-radius-option,.top-option,.stack .trade-radius-option,.stack .top-option,.prep-action-check,.pickup-inquiry .pickup-question{display:flex;align-items:flex-start;gap:12px}
 #sheet.home-content-popup .top-option{align-items:center}
 .top-option>input,.trade-radius-option>input{margin-top:2px}
 /* flex 줄은 gap이 간격을 맡으므로 상자의 오른쪽 여백은 뺀다(좁은 칸에서 글자가 줄바꿈되지 않게) */
 :is(.stack .check,.han-check,#cities-form .city-stage-options label,.interest-choice,.school-compare,.prep-form .prep-date-undecided,.trade-radius-option,.top-option,.prep-action-check,.pickup-inquiry .pickup-question)>input{margin-right:0}
}
/* 상자 하나만 든 라벨(준비 할 일 선택칸)은 가운데에 둔다 */
label.prep-select-label>input[type=checkbox]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){margin:0}

/* 2) select ─ 앱 입력칸과 같은 높이·테두리·화살표(WebKit 기본 27px 알약 대신) */
select:not([multiple]):not([size]){
 -webkit-appearance:none;appearance:none;box-sizing:border-box;
 background-color:var(--card,#fff);background-image:var(--han-chevron);background-repeat:no-repeat;background-position:right 14px center;background-size:16px;
 padding-right:42px;text-overflow:ellipsis}
:where(select:not([multiple]):not([size])){min-height:46px;padding-left:12px;border:1px solid var(--line,#e5e9ef);border-radius:var(--radius-control,12px);color:var(--ink,#17191f);line-height:1.4}
select:disabled{opacity:.55}

/* 3) 날짜·월·시간 입력 ─ 높이·정렬을 맞추고, 비어 있으면 회색 오늘 날짜 대신 안내 글자를 보여 준다(form-controls.js가 data-empty를 단다) */
input[type=date],input[type=month],input[type=time],input[type=datetime-local]{
 -webkit-appearance:none;appearance:none;box-sizing:border-box;display:block;min-height:46px;text-align:start;line-height:1.4;position:relative}
input[type=date]::-webkit-date-and-time-value,input[type=month]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value,input[type=datetime-local]::-webkit-date-and-time-value{text-align:start;min-height:1.4em}
input[data-empty]:not(:focus){color:transparent}
input[data-empty]:not(:focus)::-webkit-datetime-edit,input[data-empty]:not(:focus)::-webkit-datetime-edit-fields-wrapper{color:transparent;opacity:0}
input[data-empty]:not(:focus)::before{content:attr(data-hint);position:absolute;inset-inline:12px;top:50%;transform:translateY(-50%);color:var(--muted,#626873);pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 4) placeholder ─ 입력값으로 오해하지 않게 같은 색·굵기로 */
::placeholder{color:var(--muted,#626873);opacity:1;font-weight:var(--w-regular,400)}

/* 5) 파일 입력 ─ 기본 'Choose File' 대신 앱 문구 버튼(form-controls.js가 감싼다). 입력칸은 화면에서만 숨기고 키보드 포커스·접근성 이름은 그대로 둔다 */
input[type=file]{max-width:100%;color:var(--muted,#626873)}
input[type=file]::file-selector-button{min-height:44px;margin-inline-end:12px;padding:0 16px;border:1px solid var(--line,#e5e9ef);border-radius:var(--radius-control,12px);background:#fff;color:var(--ink,#17191f);font:inherit;font-weight:var(--w-strong,600);cursor:pointer}
.han-file{position:relative;display:flex;align-items:center;gap:12px;min-width:0;min-height:44px}
.han-file>input[type=file]{position:absolute;width:1px;height:1px;margin:0;padding:0;opacity:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none}
.han-file-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border:1px solid var(--line,#e5e9ef);border-radius:var(--radius-control,12px);background:#fff;color:var(--ink,#17191f);font-weight:var(--w-strong,600);cursor:pointer}
.han-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted,#626873)}
.han-file:focus-within .han-file-btn{outline:2px solid var(--blue,var(--secondary));outline-offset:2px}

/* 6) 시트 안 접기 제목·큰 제목 ─ 누르는 높이 44px, legend는 섹션 제목 크기 */
/* :where로 명시도를 0으로 둔다 — 더보기 메뉴(.action-menu)·메시지 메뉴(.msg-menu)·숨긴 ▶ 등 개별 summary 규칙이 있으면 그쪽이 이긴다 */
:where(#sheet details:not(.chat-system-note))>summary{display:list-item;box-sizing:border-box;min-height:44px;padding-block:10px}
/* 평소에 숨기는 메시지 메뉴 summary는 키보드 포커스 때만 32px로 보이므로 공통 높이를 받지 않는다 */
.meetup-chat li .msg-menu>summary{min-height:0;padding-block:0}
#sheet fieldset>legend{font-size:var(--text-control);font-weight:var(--w-strong,600);line-height:1.4}
#sheet .flow-form-footer button,#sheet button.textbtn,#sheet .done-btn{min-height:44px}

/* 홈 콘텐츠 설정 팝업은 설명을 숨겨 한 줄이므로 상자를 가운데에 둔다(제목 글자가 라벨보다 커서 1lh 계산이 맞지 않는다) */
#sheet.home-content-popup .top-option{align-items:center}
#sheet.home-content-popup .top-option>input[type=radio]:not(.ob-city *,.ob-other *,.ob-stage *,.chip-choice *,.compose-extras .life-topic-grid .check *){margin-top:0}

/* 모든 폭 공통: iOS가 가로 회전 때 글자를 키우지 않게 하고, 가로로 눕혔을 때 노치 옆으로 내용이 들어가지 않게 한다 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
#bottom-nav{padding-left:max(4px,env(safe-area-inset-left));padding-right:max(4px,env(safe-area-inset-right))}
/* 필수 칸 표시(2026-11-08): 칸 이름 옆 작은 빨간 별표(화면 읽기는 required로 '필수') */
.req-mark{margin-left:3px;color:var(--danger);font-weight:var(--w-bold);font-size:.9em}
