/* phone-mode.css — 📱 토글·바텀시트·토스트·설치 배너(2026-11-03).
 * 확대·전체화면 자체는 앱 셸(templates/app_shell.html)이 iframe 배율·최상위 전체화면으로 처리하므로 레이아웃 CSS 는 없다. */

/* ── 📱 토글(top_nav 우측, 터치 기기에서만: 태블릿=확대·글자 크기, 휴대폰=전체화면·설치) ── */
.hj-phone-toggle { display: none; }
html[data-hj-touch] .hj-phone-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; background: transparent; color: #adb5bd; border-radius: 50%;
    font-size: 1.15rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
html[data-hj-touch] .hj-phone-toggle:active { background: rgba(67, 97, 238, 0.12); color: #4361ee; }
html[data-hj-phone] .hj-phone-toggle { color: #4361ee; }

/* ── 바텀시트 ── */
.hj-phone-sheet-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, 0.45); z-index: 100500; display: flex; align-items: flex-end; justify-content: center; }
.hj-phone-sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); box-sizing: border-box; box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.2); }
.hj-phone-sheet__title { font-size: 0.86rem; color: #6c757d; padding: 4px 6px 10px; }
.hj-phone-sheet__opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 12px; border: 1px solid #e9ecef; border-radius: 12px; background: #fff; font-size: 1rem; color: #212529; text-align: left; cursor: pointer; box-sizing: border-box; }
.hj-phone-sheet__opt + .hj-phone-sheet__opt { margin-top: 8px; }
.hj-phone-sheet__opt i { width: 22px; text-align: center; color: #4361ee; font-size: 1.1rem; }
.hj-phone-sheet__opt.is-on { border-color: #4361ee; background: #eef2ff; font-weight: 600; }
.hj-phone-sheet__opt small { margin-left: auto; color: #4361ee; font-size: 0.78rem; }
.hj-phone-sheet__seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hj-phone-sheet__segbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 8px 6px; border: 1px solid #e9ecef; border-radius: 12px; background: #fff; font-size: 0.95rem; color: #212529; cursor: pointer; }
.hj-phone-sheet__segbtn small { color: #868e96; font-size: 0.72rem; }
.hj-phone-sheet__segbtn.is-on { border-color: #4361ee; background: #eef2ff; font-weight: 600; }
.hj-phone-sheet__segbtn.is-on small { color: #4361ee; }
.hj-phone-sheet__note { font-size: 0.8rem; color: #6c757d; padding: 10px 6px 0; }
.hj-phone-sheet__diag { font-size: 0.72rem; color: #adb5bd; padding: 12px 6px 0; word-break: break-all; }

/* ── 1회 토스트 ── */
.hj-phone-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); background: rgba(33, 37, 41, 0.94); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4; z-index: 100510; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); opacity: 0; transition: opacity 0.25s ease; pointer-events: none; }
.hj-phone-toast.is-show { opacity: 1; }

/* ── 홈 화면 앱 설치 배너(터치 기기·미설치일 때, 하루 1회) ── */
.hj-install-banner { position: fixed; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 100490; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #16233f; color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
.hj-install-banner__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hj-install-banner__text b { font-size: 0.92rem; }
.hj-install-banner__text span { font-size: 0.78rem; color: #cbd5e1; line-height: 1.35; }
.hj-install-banner__btns { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.hj-install-banner__btn { min-width: 64px; min-height: 36px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 10px; background: transparent; color: #fff; font-size: 0.84rem; cursor: pointer; }
.hj-install-banner__btn.is-primary { background: #4361ee; border-color: #4361ee; font-weight: 700; }
/* 입력 모달이 열려 있으면 설치 안내를 숨긴다 — 배너(z 100490)가 품목 모달(z 100120)의 [저장 및 적용] 버튼을 덮어
   저장 탭이 배너에 떨어지던 문제(2026-11-09 폭수 수정 불가 점검에서 실측: 저장 버튼 중심의 맨 위 요소가 배너). */
body:has(.modal[style*="display: flex"], .modal[style*="display: block"], #manualModal[style*="display: flex"]) .hj-install-banner { display: none; }

/* ── 터치 기기: 따라다니는 툴레일의 확대/축소(줌 도구) 제거 — 화면 크기는 📱 시트 3단으로 통일(사용자 요청 2026-11-04) ── */
html[data-hj-touch] .tool-zoom-wrap { display: none !important; }
/* 셸 안 alert 대체 알림창(phone_mode.js hjAlert) — 네이티브 alert 는 전체화면을 풀기 때문 */
.hj-alert-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 100700; display: flex; align-items: center; justify-content: center; padding: 20px; }
.hj-alert { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.3); padding: 20px 18px 14px; box-sizing: border-box; }
.hj-alert__msg { font-size: 1rem; line-height: 1.55; color: #1f2937; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow-y: auto; }
.hj-alert__ok { display: block; width: 100%; min-height: 48px; margin-top: 16px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font-size: 1rem; font-weight: 800; cursor: pointer; }
.hj-alert__ok:active { background: #1d4ed8; }
