/* =====================================================================
   휴대폰(QR) — 360 폭 기준 반응형. 11/17 입력 화면 정리안(피그마 IN4fSX0FTlnLLmeFR9ho7I · 360×800 · 에프엠 확인 완료)의 값.
     M0: 가운데 묶음(제목 300 · 질문 14/22 + 굵은 줄 16/24 · START 240×60) y 252~488 · 로고 120×32 아래에서 72
     M1 입력 중(키보드): 질문 y 40 · 채널명 128 320×52 · 내용 192 320×128(모서리 26) · 동의 줄 328 · [전송하기] 380 320×56 (끝 436 — 키보드 자리 496 위)
     M1 입력(키보드 없음): 같은 묶음이 세로 가운데로(y 210) — 11/17 사장이 정리안에서 정한 두 상태
     M2 전송 완료 = 시작 화면 위 팝업 312×226 · 동의 팝업 328×450(문구 상자 288×288 · [닫기] 96 + [동의하고 전송])
   ⚠ 입력 글자 16px — 16px 미만이면 아이폰 사파리가 입력할 때 화면을 확대한다
   ⚠ 답변 100자(11/17): 내용 칸은 세 줄까지 128, 네 줄부터 164(다섯 줄)까지 자란다 — scripts/answerBox.js
   좌우 여백 20. 디자인 슬롯 m*_bg@2x.jpg 를 넣으면 그 그림이 배경을 덮는다
   ===================================================================== */
.is-mobile {
  --btn-h: var(--m-btn-h); --btn-font: var(--m-btn-font); --btn-w: 0px; --btn-pad: 24px; --btn-stroke: 1.5px;
  --consent-box: 24px; --consent-radius: 4px; --consent-stroke: 1.5px; --consent-gap: 10px;
  --glow-inset: 4px 0 -4px; --glow-blur: 8px; --glow-opacity: .55;
  /* 팝업 — 전송 완료 · 동의는 한가운데(정리안), 나머지 안내는 위쪽 84 에서(키보드가 늦게 내려가도 보이게) */
  --pop-top: 84px; --pop-w: 312px; --pop-w-wide: 328px; --pop-side: 16px; --pop-pad: 36px 24px 24px; --pop-pad-wide: 28px 20px 20px; --pop-radius: 28px;
  --pop-title: 22px; --pop-title-lh: 30px; --pop-body: var(--m-body); --pop-body-lh: 22px; --pop-gap: 12px;
  --pop-actions-top: 28px; --pop-btn-gap: 8px; --pop-btn-w: 100%; --pop-btn-h: 52px; --pop-btn-font: 17px;
  --terms-gap: 16px; --terms-pad: 16px 20px 16px 16px; --terms-radius: 16px; --terms-max-h: clamp(96px, calc(100svh - 194px), 288px); --terms-font: 13px; --terms-lh: 21px;
  --terms-item-gap: 14px; --terms-head-gap: 1px;
  min-height: 100vh; min-height: 100svh; background: var(--c-bg);
}
/* 리본 — 화면에 고정된 층(뒤). background-attachment: fixed 는 아이폰 사파리가 무시해서 고정 요소로 깐다(11/15 리뷰) */
.is-mobile::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/brand/t_ribbon_tl.png") left top / 160px 115px no-repeat,
              url("../assets/brand/t_ribbon_br.png") right bottom / 153px 65px no-repeat;
}
/* 전송 완료(/done)는 시작 화면 위 팝업이라 배경 슬롯도 m0 것을 쓴다 */
.has-m0-bg.is-mobile[data-screen="/"]::before,
.has-m0-bg.is-mobile[data-screen="/done"]::before,
.has-m1-bg.is-mobile[data-screen="/write"]::before { display: none; }
#view { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; }
#popupLayer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#popupLayer > * { pointer-events: auto; }
.popup-dim { position: absolute; }
/* 동의 팝업 버튼 — [닫기] 96 고정, [동의하고 전송]이 나머지 */
.popup--consent .popup__btn.btn--ghost { flex: 0 0 96px; padding: 0; }
.page {
  position: relative; min-height: 100vh; min-height: 100svh; max-width: 480px; margin: 0 auto;
  padding: 40px var(--m-margin) 32px; text-align: center; display: flex; flex-direction: column; align-items: stretch;
}
/* 디자인 배경 — 페이지 뒤 전체(뷰포트 고정, 위 정렬) */
.has-m0-bg .page--m0::before, .has-m1-bg .page--m1::before {
  content: ""; position: fixed; inset: 0; z-index: -1; background-position: center top; background-size: cover; background-repeat: no-repeat;
}
.has-m0-bg .page--m0::before { background-image: var(--img-m0-bg); }
.has-m1-bg .page--m1::before { background-image: var(--img-m1-bg); }
.page--boot { justify-content: center; font-size: var(--m-body); }
.m__wide { width: 100%; }

/* ── M0 시작 (M2 팝업 뒤 배경도 이 화면) — 가운데 묶음은 로고 위 공간의 한가운데, 로고는 아래에서 72 ── */
.page--m0 { justify-content: center; padding-top: 0; padding-bottom: 60px; }
.m0__title { align-self: center; width: 300px; max-width: 100%; height: auto; }
.m0__question { margin-top: 16px; font-size: var(--m-lead); line-height: var(--m-lead-lh); }
.m0__question .q__main { font-size: var(--m-question); line-height: var(--m-question-lh); }
.m0__actions { margin-top: 36px; display: flex; justify-content: center; }
/* START — 흰 알약 240×60. 글자는 왼쪽 20 · 폭 170 가운데(오른쪽에 전송 아이콘 40) */
.m0__start { position: relative; width: 240px; height: 60px; --glow-opacity: .6; transition: transform var(--dur-fast) var(--ease-soft); }
.m0__start:active { transform: scale(.97); }
.m0__start-label {
  position: absolute; left: 20px; top: 0; width: 170px; height: 60px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-size: 26px; font-weight: 700; letter-spacing: 0; line-height: 30px;
}
.m0__start-icon { position: absolute; left: 190px; top: 10px; width: 40px; height: 40px; }
/* ⚠ 가운데 정렬에 transform 을 쓰지 않는다 — 등장 모션(data-anim)이 transform 을 덮어 끝날 때 로고가 튄다 */
.m0__logo { position: absolute; left: 0; right: 0; bottom: 72px; width: 120px; height: auto; margin: 0 auto; }

/* ── M1 입력 — 자리는 '입력 중(키보드)' 기준(위에서 40). 키보드가 없을 때는 묶음(.m1__form)을 세로 가운데로 내린다 ──
   내리는 거리(--m1-rest)는 화면 높이에 따라 scripts/mobile/main.js 가 잰다(360×800 에서 170 → 묶음 y 210).
   ⚠ 등장 모션(data-anim)이 요소의 transform 을 쓰므로 자리 이동은 바깥 .m1__form 에 건다 */
.page--m1 { justify-content: flex-start; }
.m1__form { display: flex; flex-direction: column; align-items: stretch; will-change: transform; }
.page--m1.is-ready .m1__form { transition: transform var(--dur-med) var(--ease-soft); }
.page--m1:not(.is-typing) .m1__form { transform: translateY(var(--m1-rest, 0px)); }
.m1__question { padding-bottom: 10px; font-size: var(--m-lead); line-height: var(--m-lead-lh); }
.m1__question .q__main { font-size: var(--m-question); line-height: var(--m-question-lh); }
.m1__channel { margin-top: 8px; height: 52px; }
.m1__content { margin-top: 12px; height: 128px; border-radius: 26px; }
.m1__input {
  display: block; width: 100%; height: 100%; margin: 0; padding: 0 20px; resize: none; overflow: hidden;
  font-family: var(--font-answer); font-size: var(--m-input); font-weight: 500; line-height: var(--m-input-lh); text-align: center;
  background: transparent; border: 0; border-radius: inherit; outline: none; caret-color: var(--c-send);
}
/* 내용 칸 — 위아래 여백 · 칸 높이는 scripts/answerBox.js 가 글 길이에 맞춰 준다(세 줄까지 가운데 · 네 줄부터 칸이 자람 · 다섯 줄 넘으면 안에서 스크롤) */
.m1__input--text { padding-top: 52px; scrollbar-width: none; }
.m1__input--text::-webkit-scrollbar { display: none; }
.m1__input--text.is-scroll { overflow-y: auto; }
.m1__input::placeholder { color: var(--c-dim); opacity: 1; }
.m1__input:focus::placeholder { color: #B9B7B6; }
/* 글자 수 — 칸 오른쪽 아래. 흰 바탕을 깔아 글과 겹쳐도 숫자가 읽힌다 */
.m1__content > .m1__count {
  position: absolute; z-index: 2; right: 16px; bottom: 8px; margin: 0; padding: 0 4px; border-radius: 4px; background: #fff;
  font-family: var(--font-en); font-size: var(--m-small); font-weight: 400; line-height: 16px; letter-spacing: 0;
  color: var(--c-dim); font-variant-numeric: tabular-nums; pointer-events: none;
}
.m1__count b { font-weight: 400; }
.m1__count.is-over b { color: var(--c-danger); font-weight: 700; }
.m1__consent { margin-top: 8px; height: 44px; padding-left: 12px; font-size: var(--m-body); line-height: 20px; }
.m1__send { margin-top: 8px; width: 100%; }

/* ── M9 안내 — 참여 시간 아님 / QR 꺼짐 / 잠시 후 다시 (정리안에 없는 화면 — 같은 말투로 맞춤) ── */
.page--m9 { justify-content: center; padding-top: 0; padding-bottom: 60px; }
.m9__brand { align-self: center; width: 220px; max-width: 70%; height: auto; }
.m9__title { margin: 40px 0 0; font-size: 22px; font-weight: 700; line-height: 30px; letter-spacing: 0; color: var(--c-text); }
.m9__lead { margin: 12px 0 0; font-size: var(--m-body); line-height: 22px; color: var(--c-sub); }
.m9__actions { margin-top: 28px; }
