/* ==========================================================
   Roop 공통 스타일 (사용자 앱 · 파트너스 공용)
   1. 기본값  2. 폰 프레임  3. 모바일 맞춤(≤430px)
   4. 토스트  5. 화면 목록 탭  6. 가로 스크롤 칩
   ========================================================== */

/* 1. 기본값 */
body { margin: 0; }
button, input, select, textarea { font-family: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; }

/* 2. 폰 프레임 (PC에서 390×844 기기처럼 보이게) */
body { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; background: #E9ECF1; }
#app { margin: 24px 0; border-radius: 40px; overflow: hidden; box-shadow: 0 20px 60px rgba(11, 11, 15, 0.18); flex-shrink: 0; }

/* 3. 모바일 맞춤: 실제 폰에서는 프레임을 벗기고 화면 가득 */
@media (max-width: 430px) {
  body { display: block !important; background: #FFFFFF !important; }
  #app { margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  #app > div { min-height: 100vh; min-height: 100dvh; }
  #app [style*="width: 390px"] { width: 100% !important; }
  [data-dock] { position: fixed !important; z-index: 50; }
  [data-dock="bar"] { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; padding-bottom: env(safe-area-inset-bottom) !important; }
  [data-dock="nav"] { bottom: calc(16px + env(safe-area-inset-bottom)) !important; }
  [data-dim] { position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; z-index: 60; }
  [role="img"][aria-label="Roop 파트너스"] { left: 50% !important; top: 50% !important; transform: translate(-50%, -60%); }
}

/* 4. 토스트 (준비 중 화면 · 저장 완료 안내) */
#todo-toast { position: fixed; left: 50%; bottom: 56px; z-index: 9999; transform: translate(-50%, 12px); padding: 12px 20px; border-radius: 24px; background: rgba(11, 11, 15, .88); color: #FFFFFF; font: 500 14px/20px 'Noto Sans KR', system-ui, sans-serif; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
#todo-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 5. 화면 목록으로 가는 임시 탭 (오른쪽 가장자리) */
.app-switch { position: fixed; right: 0; top: 50%; z-index: 70; display: flex; align-items: center; justify-content: center; width: 16px; height: 52px; transform: translateY(-50%); border-radius: 12px 0 0 12px; background: rgba(11, 11, 15, 0.16); color: rgba(255, 255, 255, 0.9); text-decoration: none; opacity: .55; transition: opacity .2s ease, width .2s ease; }
.app-switch:hover, .app-switch:focus-visible { opacity: 1; width: 24px; background: rgba(31, 79, 224, 0.85); }
.app-switch:focus-visible { outline: 2px solid #1F4FE0; outline-offset: 2px; }

/* 6. 가로 스크롤 칩 (다시 그려도 스크롤 위치 유지) */
[data-keep-scroll]::-webkit-scrollbar { display: none; }
[data-keep-scroll]::after { content: ""; flex: 0 0 1px; }

@media (prefers-reduced-motion: reduce) {
  #todo-toast, .app-switch { transition: none; }
}
