/* ═══════════════════════════════════════════════════
   ECHO&DELTA 문서 셸 — AX Cases 두 문서 공간(cases.html 산업별 AX Case · jobs.html 산업별 직무 AX) 공용 (2026-10-19)
   수치 정본: work/finance-atlas-cases-20261019/design/개발-인계-명세-v2-문서공간.md §6 · 화면 wireframes-v10-docs.html.
   사이트 GNB 대신 사이드바 머리(워드마크만) + 산업 선택 + 트리, 오른쪽 위 막대는 경로만(사용자 결정 2026-10-19 —
   사이트 메뉴·아래 전환기·문의하기 없음, 머리의 공간 이름 ▾ 버튼·메뉴·시트도 제거). 두 공간 사이 이동은 GNB의 AX Cases 패널에서 한다.
   고정 배치는 dialog만(§10-5 3조) — 머리·사이드바·경로 막대는 sticky. 색·선은 전부 토큰
   구간: ≥1120 사이드바 + 본문 · 901–1119 페이지별(cases는 머리 줄 + 가로 사이드바, jobs는 사이드바 유지) · ≤900 머리 막대 + 시트
   ═══════════════════════════════════════════════════ */

/* ── 골격 — 머리(1열 1행)·사이드바(1열 2행)·본문(2열 전체). 머리와 사이드바를 나눠 둬야 ≤900·901–1119에서 머리 한 벌을 그대로 쓴다 ── */
.doc-shell { display: grid; grid-template-columns: var(--doc-side) minmax(0, 1fr); grid-template-rows: var(--doc-top) auto; min-width: 0; }
.doc-main { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }

/* ── 사이드바 머리 (§6.2) — 워드마크만(공간 버튼은 사용자 결정으로 제거, 2026-10-19). 52px, 아래 1.5px 잉크 ── */
.doc-head { position: sticky; top: 0; z-index: 25; grid-column: 1; grid-row: 1;
            display: flex; align-items: center; gap: 10px; height: var(--doc-top); padding: 0 16px;
            background: var(--surface); border-bottom: var(--rule-block) solid var(--ink); border-right: var(--rule-row) solid var(--rule-soft); }
.doc-head .wm { display: flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
                color: var(--ink); text-decoration: none; white-space: nowrap; }
.doc-head .wm b { color: var(--signal); font-weight: 700; }

/* ── 사이드바 (§6.1) — sticky, 머리 아래 높이만큼 독립 스크롤 ── */
.doc-side { position: sticky; top: var(--doc-top); grid-column: 1; grid-row: 2; align-self: start; min-width: 0;
            height: calc(100dvh - var(--doc-top)); overflow-y: auto; overscroll-behavior: contain;
            border-right: var(--rule-row) solid var(--rule-soft); }
.doc-nav { padding: 4px 12px 24px 20px; }   /* 라벨·항목 글자축 = 왼쪽 20 (wireframe sh-nav 12 + sh-sec 8) */
.doc-label { margin: 14px 0 4px; font-family: var(--f-mono); font-size: 12px; line-height: 1.5; letter-spacing: .08em; color: var(--ink-faint); }

/* 산업 선택 (§6.4) — 36px 상자. 펼치면 tokens.css의 .sector-menu */
.doc-pick { position: relative; margin: 14px 12px 6px; }
.doc-pick__btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px;
                 border: var(--rule-row) solid var(--rule-soft); background: var(--surface); cursor: pointer; text-align: left;
                 font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.doc-pick__k { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--ink-faint); }
.doc-pick__caret { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-faint); }
.doc-pick__btn[aria-expanded="true"] { border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .doc-pick__btn:hover { border-color: var(--rule-strong); } }
.doc-pick__menu { position: absolute; top: calc(100% + 4px); left: 0; width: 100%; }

/* 트리 (§8.2) — 묶음 버튼(펼침만) + 단계 페이지 링크. 현재 페이지 = 왼쪽 2px 코발트 + 600 */
.doc-tree { list-style: none; margin: 0; padding: 0; }
.doc-tree__grp { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% + 8px); min-height: 36px;
                 margin-left: -8px; padding: 6px 8px; border: 0; background: none; cursor: pointer; text-align: left;
                 font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink-muted); transition: color var(--t-press) ease; }
.doc-tree__grp[aria-expanded="true"] { font-weight: 600; color: var(--ink); }
.doc-tree__caret { flex: none; width: 12px; font-size: 12px; font-weight: 400; text-align: center; color: var(--ink-faint); }
.doc-tree__sub { list-style: none; margin: 0 0 4px; padding: 0 0 0 10px; }
.doc-tree__sub[hidden] { display: none; }
.doc-tree a { display: flex; align-items: baseline; gap: 8px; min-height: 32px; margin-left: -10px; padding: 5px 8px 5px 10px;
              font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); text-decoration: none; transition: color var(--t-press) ease; }
.doc-tree__n { font-family: var(--f-mono); font-size: 12px; color: var(--ink-faint); }
.doc-tree a[aria-current] { font-weight: 600; color: var(--ink); box-shadow: inset 2px 0 0 var(--signal); }
@media (hover: hover) and (pointer: fine) {
  .doc-tree__grp:hover, .doc-tree a:not([aria-current]):hover { color: var(--ink); }
}

/* ── 경로 막대 (§6.5) — 52px sticky, 경로만. 오른쪽은 비운다(사용자 결정) ── */
.doc-top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; height: var(--doc-top); padding: 0 24px;
           background: var(--surface); border-bottom: var(--rule-row) solid var(--rule-soft); }
.doc-crumb { display: flex; align-items: center; min-width: 0; margin: 0; padding: 0; list-style: none;
             font-size: 13px; line-height: 1.4; color: var(--ink-muted); white-space: nowrap; }
.doc-crumb li { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.doc-crumb li + li::before { content: "/"; margin: 0 8px; color: var(--ink-faint); }
.doc-crumb a { color: inherit; text-decoration: none; }
.doc-crumb [aria-current] { font-weight: 600; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .doc-crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }

/* ── 바텀시트 (§6.8) — jobs.html의 공간·직무·단계 시트. cases.html은 같은 값의 #atlas-sheet(atlas.css)를 쓴다 —
   그 dialog는 데스크톱 셀 팝업도 겸해서 옮기지 않았다 ── */
dialog.doc-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 90dvh; margin: 0; padding: 0;
                   border: 0; border-top: var(--rule-doc) solid var(--ink); background: var(--surface); color: var(--ink);
                   transition: transform 200ms var(--ease-out); }
dialog.doc-sheet[open] { display: flex; flex-direction: column; }
@starting-style { dialog.doc-sheet[open] { transform: translateY(100%); } }
dialog.doc-sheet::backdrop { background: var(--scrim); }
:root:has(dialog.doc-sheet[open]) { overflow: hidden; }
.doc-sheet__head { display: flex; align-items: center; flex: none; min-height: 52px; padding: 0 var(--frame-gutter);
                   border-bottom: var(--rule-row) solid var(--rule-soft); }
.doc-sheet__t { font-size: 15px; font-weight: 700; line-height: 1.4; }
.doc-sheet__x { margin-left: auto; min-height: 44px; padding: 0 0 0 12px; border: 0; background: none; cursor: pointer;
                font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.doc-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.doc-sheet__picks { list-style: none; margin: 0; padding: 0; }
.doc-sheet__pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
                   padding: 10px var(--frame-gutter); border-bottom: var(--rule-row) solid var(--rule-soft);
                   font-size: 16px; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.doc-sheet__pick[aria-current] { font-weight: 600; color: var(--ink); }
.doc-sheet__pick--sub { padding-left: calc(var(--frame-gutter) + 16px); font-size: 15px; min-height: 44px; }
.doc-sheet__n { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--ink-faint); }
@media (hover: none) { .doc-sheet__pick:active { background: var(--surface-muted); } }

/* 모바일 상자형 선택 줄 — cases(분야·업권·보기)·jobs(직무·단계) 공용 한 벌(2026-10-19). ≤900에서만 보인다 */
.doc-mpicks { display: none; }

/* ── 901–1119 · ≤900 공통 — 머리가 사이드바에서 떨어져 맨 위 한 줄이 되는 경우는 페이지 CSS가 정한다 ── */
@media (max-width: 900px) {
  /* 모바일 머리 막대 (§6.8) — 52px, 거터, 워드마크만. ☰ 없음 */
  .doc-shell { display: block; }
  .doc-head { position: relative; padding: 0 var(--frame-gutter); border-right: 0; }
  .doc-side, .doc-top { display: none; }
  /* 상자형 선택 줄 (명세 v2 §8.6, cases도 같은 부품) — 보이는 상자 36 + 위아래 4 = 터치 44(§9). 보기 상자는 오른쪽 끝, 넘치면 요약이 말줄임 */
  .doc-mpicks { display: flex; align-items: center; gap: 8px; padding: 12px var(--frame-gutter) 0; }
  .doc-mpick { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 36px; padding: 0 12px;
               border: var(--rule-row) solid var(--rule-soft); background: var(--surface); cursor: pointer;
               font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--ink); white-space: nowrap; }
  .doc-mpick > [data-bind], .doc-mpick__sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .doc-mpick::before { content: ""; position: absolute; inset: -4px 0; }
  .doc-mpick--end { margin-left: auto; }
  .doc-mpick__sum { font-weight: 500; color: var(--ink-muted); }
  .doc-mpick__caret { flex: none; font-size: 12px; font-weight: 400; color: var(--ink-faint); }
}
@media (hover: none) { .doc-mpick:active { background: var(--surface-muted); } }
