/* 나비플레이 앱 화면(/app/phone · /app/tablet · /app/pc) — 설치 앱이 띄우는 어두운 화면.
 * 사이트 전체 스타일(:app)에도 함께 실리므로 모든 규칙을 .app-shell 아래에만 둡니다. 색은 tokens.css 변수만 씁니다. */

.app-shell {
  /* 기기가 다크 모드여도 바뀌지 않는 앱 화면 전용 글자색 · 짙은색.
     (공용 --color-background · --color-text 는 다크 모드에서 서로 뒤바뀌어, 어두운 바탕에 검은 글자가 되었습니다) */
  --app-fg: var(--color-grey-50);
  --app-ink: var(--color-grey-900);
  margin: 0;
  min-height: 100vh;
  background: var(--color-background-dark);
  color: var(--app-fg);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app-shell .app {
  box-sizing: border-box;
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-shell--tablet .app { max-width: none; min-height: 100vh; justify-content: center; }
.app-shell--pc .app { max-width: 480px; padding-top: 32px; }

/* hidden 속성은 display:flex 같은 규칙보다 늘 이깁니다(로그인 두 단계가 한꺼번에 보이던 문제) */
.app-shell [hidden] { display: none !important; }

.app-shell .app__loading { color: var(--color-ink-muted); text-align: center; margin-top: 40vh; }

.app-shell .app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell .app-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell .app-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.app-shell .app-subtitle { font-size: 1.1rem; font-weight: 700; margin: 0; }
.app-shell .app-lead { font-size: 1.05rem; line-height: 1.55; margin: 0; }
.app-shell .app-note { color: var(--color-ink-muted); font-size: 0.92rem; line-height: 1.5; margin: 0; }

.app-shell .app-card {
  background: var(--color-ink-2);
  border: 1px solid var(--color-ink-3);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-shell .app-card--hero { border-color: var(--color-primary-dark); }
/* PC 소리 확인 팝업(폰 첫 화면 위 · 2026-10-08) — 문제가 있으면 노란 테두리, 안내 줄도 노랗게. 정상이면 저절로 닫힘 */
.app-shell .app-card--warn { border-color: var(--color-status-warning); }
.app-shell .app-audio { gap: 8px; }
.app-shell .app-audio__line { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.app-shell .app-audio__line--warn { color: var(--color-status-warning); }
/* 연결 상태 점검 목록(폰 · 태블릿 설정 · 2026-10-08) — ✓ 정상 · ✗ 문제(노랑) · – 참고 */
.app-shell .app-diag { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.app-shell .app-diag__item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-ink-3); }
.app-shell .app-diag__mark { width: 20px; flex: none; font-weight: 700; color: var(--color-ink-muted); }
.app-shell .app-diag__item.is-ok .app-diag__mark { color: var(--color-primary-dark); }
.app-shell .app-diag__item.is-problem .app-diag__mark,
.app-shell .app-diag__item.is-problem strong { color: var(--color-status-warning); }
.app-shell .app-diag__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.app-shell .app-form { display: flex; flex-direction: column; gap: 10px; }
.app-shell .app-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: var(--color-ink-muted); }

.app-shell .app-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-ink-3);
  background: var(--color-background-dark);
  color: var(--app-fg);
  font-size: 1.05rem;
}

.app-shell .app-input--code { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; }

.app-shell .app-btn {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-ink-3);
  background: var(--color-ink-3);
  color: var(--app-fg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.app-shell .app-btn:disabled { opacity: 0.5; }
.app-shell .app-btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.app-shell .app-btn--primary { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: var(--color-background-dark); }
.app-shell .app-btn--ghost { background: transparent; }
.app-shell .app-btn--danger { background: transparent; border-color: var(--color-error); color: var(--color-error); }
.app-shell .app-btn--small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.app-shell .app-btn--large { min-height: 60px; font-size: 1.15rem; }

.app-shell .app-devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.app-shell .app-device { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-ink-3); }
.app-shell .app-device__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.app-shell .app-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-status-inactive); flex: none; }
.app-shell .app-dot.is-online { background: var(--color-primary-dark); }

.app-shell .app-pairing { align-items: center; text-align: center; }
.app-shell .app-qr { width: min(280px, 70vw); height: auto; aspect-ratio: 1; border-radius: 12px; background: var(--app-fg); }
.app-shell .app-code { font-size: 2.2rem; font-weight: 700; letter-spacing: 0.15em; margin: 0; font-variant-numeric: tabular-nums; }

.app-shell .app-poster { width: 45%; align-self: center; border-radius: 12px; }

.app-shell .app-video { width: 100%; max-height: 62vh; background: var(--app-ink); border-radius: 12px; object-fit: contain; }
.app-shell .app-stage { position: fixed; inset: 0; background: var(--app-ink); }
.app-shell .app-video--full { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; }

.app-shell .app-status { text-align: center; font-size: 1rem; margin: 0; color: var(--color-ink-muted); }
.app-shell .app-status[data-state="synced"] { color: var(--color-primary-dark); }
.app-shell .app-status[data-state="syncing"] { color: var(--color-secondary); }
.app-shell .app-status--overlay {
  position: absolute; left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px;
  background: var(--color-ink-2); opacity: 0.85;
}

.app-shell .app-marker {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--color-ink-3); background: var(--color-ink-2);
}
.app-shell .app-marker--overlay { position: absolute; left: 16px; right: 16px; bottom: 16px; opacity: 0.92; }
/* 태블릿 수동 재생 단추(5원칙) — 화면 가운데 */
.app-shell .app-manual--overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 220px; }
.app-shell .app-marker__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.app-shell .app-marker__title { font-size: 0.95rem; font-weight: 600; }
.app-shell .app-marker__detail { font-size: 0.82rem; color: var(--color-ink-muted); font-variant-numeric: tabular-nums; }
/* 마커 점: 꺼짐 회색 · 듣는 중 청록 · 들을 때마다 노랗게(보류한 마커는 주황) 크게 깜빡임 */
.app-shell .app-marker__dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--color-status-inactive);
}
.app-shell .app-marker__dot.is-on { background: var(--color-primary-dark); }
.app-shell .app-marker__dot.is-blink { animation: app-marker-blink 0.7s ease-out; }
.app-shell .app-marker__dot.is-reject { animation: app-marker-reject 0.7s ease-out; }
@keyframes app-marker-blink {
  0% { background: var(--color-secondary); transform: scale(1.9); box-shadow: 0 0 0 6px var(--color-secondary); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}
@keyframes app-marker-reject {
  0% { background: var(--color-error); transform: scale(1.6); }
  100% { transform: scale(1); }
}

/* 앱 화면 안 확인 창(confirmDialog) */
.app-shell .app-dialog {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgb(0 0 0 / 60%);
}
.app-shell .app-dialog__box { width: min(420px, 100%); }
.app-shell .app-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.app-shell .app-remote { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }

.app-shell .app-version { text-align: center; color: var(--color-ink-muted); font-size: 0.8rem; margin: 8px 0 0; }

.app-shell .app-standby { align-items: center; text-align: center; max-width: 560px; margin: 0 auto; }

/* 폰 첫 화면 — 켜자마자 QR 을 기다리는 카메라(가운데 네모 안내선) · 아래 코드 입력 */
.app-shell .app-scanner {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 52vh; margin: 0 auto;
  overflow: hidden; border-radius: 16px; background: var(--app-ink);
}
.app-shell .app-scanner__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-shell .app-scanner__frame {
  position: absolute; inset: 18%; border: 3px solid var(--color-primary); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 35%);
}
.app-shell .app-scanner__hint { text-align: center; }
.app-shell .app-form .app-row .app-input { flex: 1; min-width: 0; }

/* 설정 — 톱니 아이콘 · 줄 단추 · 약관 본문 */
/* 태블릿 대기 화면: 내용은 가운데, 톱니는 오른쪽 위 구석 */
.app-shell .app-corner { position: fixed; top: 16px; right: 16px; }
.app-shell .app-icon-btn { min-width: 44px; min-height: 44px; padding: 8px; display: inline-flex; align-items: center; justify-content: center; }
.app-shell .app-btn--row { justify-content: space-between; text-align: left; }
.app-shell .app-legal { line-height: 1.65; font-size: 0.95rem; overflow-wrap: anywhere; }
.app-shell .app-legal h2 { font-size: 1.1rem; margin: 1.2em 0 0.4em; }
.app-shell .app-legal h3 { font-size: 1rem; margin: 1em 0 0.3em; }
.app-shell .app-legal ul,
.app-shell .app-legal ol { padding-left: 1.3em; }
.app-shell .app-legal table { width: 100%; border-collapse: collapse; font-size: 0.85rem; display: block; overflow-x: auto; }
.app-shell .app-legal th,
.app-shell .app-legal td { border: 1px solid var(--color-ink-3); padding: 6px; }

.app-shell .app-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 12px 16px; border-radius: 12px;
  background: var(--app-fg); color: var(--app-ink);
  font-size: 0.95rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 10;
}

.app-shell .app-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── 통역사 앱(/app/interpreter · 결정 56) ───────────────────── */
.app-shell .wb-assignments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.app-shell .wb-assignment { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px;
  border-radius: 10px; border: 1px solid var(--color-ink-3); background: var(--color-background-dark); color: var(--app-fg); }
.app-shell .wb-step { gap: 10px; }
.app-shell .wb-step--locked { opacity: 0.55; }
.app-shell .wb-step__badge { float: right; font-size: 0.8rem; color: var(--color-ink-muted); }
.app-shell .wb-step--done .wb-step__badge { color: var(--color-primary-dark); }
.app-shell .wb-step--ready .wb-step__badge { color: var(--color-secondary); }
.app-shell .wb-error { color: var(--color-error); }
.app-shell .wb-graph { width: 100%; height: 48px; background: var(--color-background-dark); border-radius: 6px; }
.app-shell .wb-manual__list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; }
.app-shell .wb-check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; padding: 6px 0; }
.app-shell .wb-check input { width: 22px; height: 22px; flex: none; }
.app-shell .wb-option { text-align: left; color: var(--app-fg); display: flex; flex-direction: column; gap: 8px; }
.app-shell .wb-option ul { margin: 0; padding-left: 1.2em; color: var(--color-ink-muted); line-height: 1.5; }
.app-shell .wb-meter { height: 14px; border-radius: 7px; background: var(--color-background-dark); overflow: hidden; border: 1px solid var(--color-ink-3); }
.app-shell .wb-meter__fill { display: block; height: 100%; width: 0; background: var(--color-status-inactive); transition: width 0.1s linear; }
.app-shell .wb-meter__fill[data-advice="ok"] { background: var(--color-primary-dark); }
.app-shell .wb-meter__fill[data-advice="loud"] { background: var(--color-error); }
.app-shell .wb-meter__text { font-size: 0.92rem; }
.app-shell .wb-gaps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.app-shell .wb-gaps li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.92rem; }
.app-shell .wb-camera { width: 100%; max-height: 62vh; background: var(--app-ink); border-radius: 12px; object-fit: contain; }
.app-shell .wb-camera.is-mirrored { transform: scaleX(-1); }
.app-shell .wb-shoot { position: fixed; inset: 0; background: var(--app-ink); display: flex; }
.app-shell .wb-shoot .wb-camera { flex: 1; max-height: none; height: 100%; border-radius: 0; }
.app-shell .wb-shoot__top { position: absolute; top: 12px; left: 12px; display: flex; gap: 12px; font-size: 0.95rem;
  background: var(--color-ink-2); padding: 6px 10px; border-radius: 8px; }
.app-shell .wb-shoot__side { width: 168px; flex: none; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; padding: 12px; }
.app-shell .wb-shoot__side .app-remote { flex-direction: column; }
.app-shell .wb-record { width: 76px; height: 76px; border-radius: 50%; border: 5px solid var(--app-fg); background: var(--color-error); }
.app-shell .wb-record.is-recording { border-radius: 16px; animation: wb-blink 1s steps(2) infinite; }
@keyframes wb-blink { 50% { opacity: 0.6; } }
.app-shell .wb-timeline { position: relative; height: 34px; border-radius: 6px; background: var(--color-ink-3); overflow: hidden; }
.app-shell .wb-timeline__take { position: absolute; top: 4px; bottom: 4px; background: var(--color-primary-dark); min-width: 2px; }
.app-shell .wb-timeline__take.is-selected { background: var(--color-secondary); }
.app-shell .wb-timeline__overlap { position: absolute; top: 0; bottom: 0; background: var(--color-error); opacity: 0.8; min-width: 2px; }
.app-shell .wb-timeline__sample { position: absolute; bottom: 0; height: 4px; background: var(--color-status-warning); }
.app-shell .wb-takes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.app-shell .wb-take { display: flex; align-items: center; gap: 8px; border: 1px solid var(--color-ink-3); border-radius: 10px; padding: 6px 10px; }
.app-shell .wb-take.is-selected { border-color: var(--color-secondary); }
.app-shell .wb-take.is-off { opacity: 0.5; }
.app-shell .wb-take__pick { flex: 1; text-align: left; background: none; border: 0; color: var(--app-fg); display: flex; flex-direction: column; gap: 2px; }
.app-shell .wb-take__use { display: flex; gap: 6px; align-items: center; font-size: 0.9rem; }
.app-shell .wb-preview { max-height: 40vh; }
/* 편집: 클립 막대 단추 · 이음새 줄 · 동작 묶음 · 촬영 화면 찍은 구간 막대 */
.app-shell button.wb-timeline__take { border: 0; padding: 0; cursor: pointer; }
.app-shell .wb-timeline__playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--app-fg); }
.app-shell .wb-seam { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.88rem; color: var(--color-ink-muted); padding: 2px 10px; border-left: 3px solid var(--color-ink-3); }
.app-shell .wb-seam.is-overlap { border-left-color: var(--color-error); color: var(--app-fg); }
.app-shell .wb-tools { display: flex; flex-direction: column; gap: 6px; }
.app-shell .wb-tools__title { font-size: 0.85rem; color: var(--color-ink-muted); }
.app-shell .wb-tools__row { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .wb-position { font-variant-numeric: tabular-nums; }
.app-shell .wb-shoot__bottom { position: absolute; left: 12px; right: 180px; bottom: 12px; }
.app-shell .wb-timeline--shoot { height: 16px; opacity: 0.9; }
