/* ===== 마이웨이 웹앱 셸 =====
   시안 뷰어(폰 목업)를 걷어내고, 화면 자체가 브라우저를 꽉 채우는 앱으로 동작한다.
   base.css / theme-c.css 뒤에 로드되어 '앱 바깥' 구조만 덮어쓴다. */

/* data-auth 로 감춘 영역은 레이아웃에서도 완전히 빠진다 (클래스의 display 보다 우선) */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  background: var(--page);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ---------- 기기 화면 ---------- */
.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: background .28s ease;
}
/* 스플래시처럼 어두운 화면에서는 셸 바탕(노치 영역 포함)도 같이 어두워진다 */
.app.is-dark { background: var(--brand); }

.app__stage { position: absolute; inset: 0; overflow: hidden; }
.app__stage > .view { position: absolute; inset: 0; margin: 0; display: block; }

/* 큰 화면(PC)에서는 가운데 앱 컬럼으로 —
   폰 가로모드(높이가 낮다)는 여기에 걸리지 않는다 */
@media (min-width: 700px) and (min-height: 600px) {
  body { display: flex; align-items: center; justify-content: center; }
  .app {
    max-width: 480px;
    height: min(100dvh - 48px, 880px);
    border-radius: 26px;
    box-shadow: 0 1px 2px rgba(70,52,32,.08), 0 24px 60px rgba(70,52,32,.18);
  }
  .app__stage { border-radius: 26px; }
  .view__scr { border-radius: 26px; }
}

/* 손가락으로 쓰는 기기(폰·태블릿·폴더블)는 화면비와 무관하게 언제나 꽉 채운다.
   크롬 개발자도구의 기기 모드도 여기에 해당한다. */
@media (hover: none), (pointer: coarse) {
  body { display: block; }
  .app {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .app__stage, .view__scr { border-radius: 0; }
}

/* ---------- 화면 전환 ---------- */
/* 화면 전환 — 눈이 편하도록 이동폭은 줄이고 감속을 길게 */
@keyframes appIn     { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes appInBack { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.app__stage > .is-in      { animation: appIn .28s cubic-bezier(.16,.84,.44,1) both; }
.app__stage > .is-in-back { animation: appInBack .28s cubic-bezier(.16,.84,.44,1) both; }
@media (prefers-reduced-motion: reduce) {
  .app__stage > .is-in, .app__stage > .is-in-back { animation: none; }
}

/* ---------- 스크롤 ---------- */
.body, .sheet, .side__l {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.body::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 0; height: 0; }

/* 텍스트 드래그 선택은 앱답게 끄되, 입력 영역 느낌의 요소는 예외 */
.sc { -webkit-user-select: none; user-select: none; }
.sc .input, .sc .field { -webkit-user-select: text; user-select: text; }

/* ---------- 토스트 ---------- */
.toast {
  position: absolute; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 86%; z-index: 60;
  background: rgba(40,33,26,.92); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.5;
  padding: 11px 16px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(40,33,26,.28);
  animation: toastIn .2s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.is-out { opacity: 0; transition: opacity .25s ease; }

/* ---------- 로그인 안내 시트 ---------- */
.gate { position: absolute; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.gate__dim { position: absolute; inset: 0; background: rgba(48,36,24,.45); animation: gateDim .2s ease both; }
.gate__sheet {
  position: relative; width: 100%;
  background: var(--surface);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 26px 22px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; text-align: center;
  animation: gateUp .26s cubic-bezier(.22,.7,.3,1) both;
}
.gate__sheet h2 { font-size: 17px; font-weight: 600; color: var(--ink); }
.gate__sheet p { font-size: 13.5px; line-height: 1.6; color: var(--ink2); margin-bottom: 10px; }
.gate__sheet .btn { width: 100%; }
@keyframes gateDim { from { opacity: 0; } to { opacity: 1; } }
@keyframes gateUp  { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gate__dim, .gate__sheet { animation: none; }
}

/* 전화번호 안내 시트 */
.sheet__tel { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: .01em;
              -webkit-user-select: text; user-select: text; margin-bottom: 14px; }
