@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@media print { .vs-no-print { display: none !important; } }

html, body {
  height: 100%;
  font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  letter-spacing: -0.005em;       /* v3.1: 한글 가독성 미세 보정 */
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root { height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ─── App Shell ─── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── 스테이지 안내 바가 있을 때의 자리 확보 (2026-08-21 · #1248 · F-MISC-103) ──────
   배너는 «흐름 안»에 있다(덮지 않는다 — 전폭 고정 띠가 버튼을 가려 신고가 났던 선례가 있다).
   그래서 루트를 세로 flex 로 바꿔 띠가 자기 높이만큼 가져가고 나머지를 셸이 채우게 한다.
   ★.app 의 height:100vh 를 그대로 두면 «띠 + 100vh」가 되어 화면이 띠 높이만큼 넘친다.
   ★이 규칙은 body.ex-has-stage-bar 일 때만 산다 — 운영·개발에서는 한 줄도 적용되지 않는다.
   ★styles/app-shell.css 에 두면 안 된다 — index.html 이 그 파일을 로드하지 않는다(조용히 미적용).
   ※모바일 셸(MApp·MobileView)은 position:fixed; inset:0 이라 흐름 밖이다 — 뷰포트 기준으로
     띠 높이만큼 내려 준다(top). 그래야 띠가 셸에 덮이지 않는다. */
body.ex-has-stage-bar #root { display: flex; flex-direction: column; }
body.ex-has-stage-bar .app { height: auto; flex: 1 1 auto; min-height: 0; }
/* ★로그인·역할선택 화면도 «뷰포트 전체»를 쓴다(.login-page·.role-select-page 의 min-height:100vh,
   .login-brand-inner 는 그 안의 좌측 패널). 이것들을 그대로 두면 «띠 + 100vh」가 되어
   로그인 화면에만 30px 짜리 세로 스크롤바가 생긴다 — 셸(.app)만 고치면 놓치는 자리다.
   ※이 화면들은 App() 이 «일찍 반환»하는 갈래라 .app 을 거치지 않는다. */
body.ex-has-stage-bar .login-page,
body.ex-has-stage-bar .role-select-page,
body.ex-has-stage-bar .login-brand-inner { min-height: calc(100vh - var(--ex-stage-bar-h, 0px)); }

body.ex-has-stage-bar [data-m-shell] {
  top: var(--ex-stage-bar-h, 0px) !important;
  /* ★height 도 같이 푼다 — MobileView 는 height:100dvh 가 인라인이라 top 만 내리면
     띠 높이만큼 아래로 넘친다(하단 탭바가 화면 밖으로 밀린다). bottom:0 + height:auto 로
     남은 높이를 스스로 잡게 한다(MApp 의 inset:0 도 같은 결과). */
  bottom: 0 !important;
  height: auto !important;
}

/* ── 좁은 기기에서 «PC 로 보기» (2026-08-10 사용자 지시) ────────────────────────
   폰 폭(375~430px)에 데스크톱 셸을 넣으면 사이드레일 56 + 사이드바 256 이 고정이라
   본문이 60px 남짓만 남는다. 그렇다고 뷰포트를 width=1280 으로 축소 렌더하면
   글씨를 읽을 수 없고, 그 방식이 깜빡임 루프의 원인이기도 했다(lib/device.js 주석).
   → 레이아웃 폭을 **태블릿(1024px)으로 고정**하고, 이동·확대는 **브라우저 기본 팬·줌**에 맡긴다
      (lib/device.js 가 viewport 를 `width=1024, initial-scale=1, user-scalable=yes` 로 잡는다).
      손가락으로 밀면 화면이 움직이고, 핀치로 축소하면 1024 전체가 한눈에 들어온다.
   ★CSS 가로 스크롤 컨테이너(#root overflow-x)로 만들지 않는다 — 2026-08-10 에 그렇게 했다가
     제보 «드래그 이동이 안 된다 · 확대가 안 된다»를 받았다. 두 가지가 겹친 결과였다:
       ① 그건 «페이지 안의 스크롤»이라 핀치 줌 대상이 아니다.
       ② 가로 제스처를 조상에 넘기려고 안쪽 스크롤러에 건 `touch-action: pan-y` 가
          **가로 패닝과 핀치 줌을 «둘 다» 금지**한다(그 값의 뜻이 «세로만 허용»이다).
     ☞ 브라우저 기본 팬·줌은 요소 위 어디서 잡든 동작한다 — touch-action 을 좁히지 않는 것이 답이다.
   클래스는 EX_DEVICE.syncViewport 가 body 에 붙인다(강제 desktop + 기기 폭 < 1024 일 때만). */
/* 레이아웃 폭 보장 — 뷰포트 메타를 무시하는 환경(일부 인앱 웹뷰)에서도 찌그러지지 않게 남긴다.
   메타가 먹히면 레이아웃 뷰포트가 이미 1024 라 이 규칙은 아무 일도 하지 않는다. */
body.ux-desk-narrow .app { min-width: var(--ux-desk-min, 1024px); }
/* 화면 전체를 덮는 것들(모달·드로어·전체화면 목록)은 100vw 로 잡히면 폰 폭(375)에 맞춰져
   본문과 어긋난다 — 최소 폭을 같이 준다. */
body.ux-desk-narrow .issue-list-fs,
body.ux-desk-narrow .modal-overlay,
body.ux-desk-narrow .detail-panel-overlay,
body.ux-desk-narrow .spotlight-overlay { min-width: var(--ux-desk-min, 1024px); }

/* 이슈 리스트 전체화면 모드 — 페이지 본문을 확장 */
.issue-list-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
}

.side-rail {
  width: 56px;
  background: var(--surface-sunken);  /* v3.1.2: 살짝 진한 회색으로 1단계 분리 명확히 */
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  flex-shrink: 0;
  z-index: 20;
}

.issue-nav {
  width: 256px;             /* v3.1: 240 → 256 — "내가 결재할 이슈" 같은 라벨 잘림 방지 */
  height: 100%;             /* v3.1.3: 부모 높이 채워서 내부 .scrollable이 정상 동작 */
  background: var(--surface-base);   /* v3.1.2: 흰색 유지 */
  display: flex;
  flex-direction: column;
  overflow: hidden;         /* v3.1.3: 가로 overflow 차단 — 내부 .scrollable이 세로 스크롤 담당 */
  flex-shrink: 0;
  z-index: 10;
}
.issue-nav::-webkit-scrollbar { width: 4px; }
.issue-nav::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-base);
  position: relative;
}

/* ═══ Page header — v3.1 ═══ */
.page-hd {
  height: 52px;            /* was 48 — 여유 */
  padding: 0 18px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface-base);
}
.page-hd-title {
  font-size: var(--fs-h2);  /* was h3 — 페이지 타이틀 위계 ↑ */
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
.page-hd-sep { color: var(--text-disabled); font-size: var(--fs-meta); }

.page-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  position: relative;
}

/* ─── Utility ─── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 2px; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-sm { font-size: var(--fs-meta); }
.text-xs { font-size: var(--fs-caption); }
.text-xxs { font-size: var(--fs-tiny); }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.color-secondary { color: var(--text-secondary); }
.color-tertiary { color: var(--text-tertiary); }
.color-red { color: var(--explan-red); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }

/* Scrollbar */
.scrollable { overflow-y: auto; }
.scrollable::-webkit-scrollbar { width: 4px; }
.scrollable::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }

/* ── 태블릿 모드 (개발정의서_태블릿화면 §4) ────────────────────────────────────
   .tablet-mode 는 TabletStage 가 콘솔 루트에 붙인다. 실기기에서는 같은 규칙을
   미디어쿼리(뷰포트 ≤1366 + 터치)로 걸면 프레임 없이도 그대로 성립한다.
   ★기능을 빼지 않는다 — 여기서 하는 건 손가락으로 누를 수 있게 만드는 것뿐이다. */
.tablet-mode { --tablet: 1; height: 100%; }
/* 스테이지 안에서는 100vh 가 '브라우저 창'을 가리켜 프레임을 뚫고 나간다 — 컨테이너 기준으로 */
.tablet-mode .app { height: 100%; }
/* 터치 타깃 — 마우스 포인터 기준(28px)으로는 손끝이 옆 항목을 누른다 */
.tablet-mode .rail-btn,
.tablet-mode .rail-item { min-width: 40px; min-height: 40px; }
.tablet-mode .sidebar-item,
.tablet-mode .nav-item { min-height: 40px; }
/* 세로 모드: 밀도 높은 표는 컬럼을 줄이지 않고 가로로 스크롤한다(전 컬럼 접근 보장) */
.tablet-portrait .issue-table { min-width: 980px; }
.tablet-portrait .table-scroll,
.tablet-portrait .list-scroll { overflow-x: auto; }
