/* ════════════════════════════════════════
   All-line Office — 자료실(시안 A 「3D 자료실」) — public/css/office-library.css (2026-10-04)
   색: 교단 CI(가구 나무 Earth #5E3929, 분류 색은 office-library.js 설정). 그라데이션·특수효과 없음.
════════════════════════════════════════ */
.lib-overlay { z-index: 2100; }   /* 사무실 전체화면(body.office-full #view-office, z-index 1500)보다 위 — 2026-10-04 전체화면에서 창이 뒤로 숨던 문제 */
.lib-modal:focus { outline: none; }
.lib-modal { width: min(1160px, calc(100vw - 32px)); height: min(720px, calc(100vh - 40px)); background: #fff; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; color: #1B2533; box-shadow: 0 20px 50px rgba(15, 23, 35, .35); }
.lib-head { height: 76px; flex-shrink: 0; box-sizing: border-box; padding: 0 24px; border-bottom: 1px solid #E6EAF0; display: flex; align-items: center; gap: 14px; }
.lib-logo { width: 44px; height: 44px; border-radius: 12px; background: #5E3929; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.lib-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lib-title b { font-size: 21px; letter-spacing: -.3px; }
.lib-title span { font-size: 13px; color: #5B6776; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lib-ro-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #FFF3E6; border: 1px solid #F6C79A; color: #8A4310; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lib-x { width: 44px; height: 44px; border-radius: 10px; border: 1px solid #DFE5EC; background: #fff; color: #5B6776; cursor: pointer; font-size: 17px; flex-shrink: 0; }
.lib-x:hover { background: #F3F6F9; color: #1B2533; }
.lib-body { flex: 1; min-height: 0; display: flex; }

/* 방 — 벽·걸레받이·바닥 */
.lib-room { flex: 1; min-width: 0; position: relative; overflow: hidden; background: #EEF2F6; }
.lib-wall { position: absolute; left: 0; right: 0; top: 0; bottom: 252px; background: #EEF2F6; }
.lib-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 252px; background: #DCE3EA; border-top: 10px solid #C8D2DD; box-sizing: border-box; }
.lib-room.is-two .lib-wall { bottom: 360px; }
.lib-room.is-two .lib-floor { height: 360px; }
.lib-tabs { position: absolute; left: 20px; top: 28px; display: flex; gap: 6px; }
.lib-tab { border: 1px solid #C9D2DC; background: #fff; border-radius: 8px; padding: 6px 12px; font-family: inherit; font-size: 13px; font-weight: 600; color: #1B2533; cursor: pointer; }
.lib-tab.is-on { background: #5E3929; border-color: #5E3929; color: #fff; }
.lib-hint { position: absolute; left: 20px; bottom: 16px; font-size: 12.5px; color: #4E5A68; }
.lib-rows { position: absolute; inset: 0; }
.lib-row { position: absolute; left: 0; right: 0; bottom: 48px; display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.lib-room.is-two .lib-row.is-front { bottom: 22px; transform: scale(.78); transform-origin: bottom center; z-index: 2; }
.lib-room.is-two .lib-row.is-back { bottom: 296px; transform: scale(.64); transform-origin: bottom center; z-index: 1; }
.lib-room.is-two .lib-hint { display: none; }

/* 가구 */
.lib-piece { position: relative; width: 140px; padding: 0; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 12px; font-family: inherit; transition: transform .18s ease; }
.lib-piece:hover { transform: translateY(-4px); }
.lib-piece.is-on { transform: translateY(-8px); }
.lib-piece:focus-visible { outline: 3px solid #FFA92D; outline-offset: 4px; border-radius: 8px; }
.lib-art { display: block; width: 140px; height: 243px; font-family: inherit; }
.lib-piece.is-locked .lib-art { filter: grayscale(.85); opacity: .7; }
.lib-lock { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #1B2533; color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.lib-plate { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; white-space: nowrap; background: #fff; color: #1B2533; border: 1px solid #C9D2DC; }
.lib-plate small { font-size: 12px; font-weight: 500; opacity: .8; }
.lib-piece.is-on .lib-plate { background: var(--lib-c, #2F557F); border-color: var(--lib-c, #2F557F); color: #fff; }

/* 오른쪽 — 자료 목록 */
.lib-side { width: 360px; flex-shrink: 0; box-sizing: border-box; padding: 22px; border-left: 1px solid #E6EAF0; background: #FAFBFC; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.lib-side-h { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.lib-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.lib-side-d { font-size: 13px; color: #5B6776; margin-top: -4px; }
.lib-items { display: flex; flex-direction: column; gap: 10px; }
.lib-item { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 14px; min-height: 64px; background: #fff; border: 1px solid #E1E7EE; border-radius: 12px; text-align: left; font-family: inherit; color: #1B2533; }
button.lib-item { cursor: pointer; }
button.lib-item:hover { border-color: #2F557F; }
button.lib-item:focus-visible { outline: 3px solid #FFA92D; outline-offset: 2px; }
.lib-item.is-locked { background: #F2F4F7; border-style: dashed; border-color: #C9D1DB; }
.lib-ic { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; background: #E3E7EC; color: #6B7684; }
.lib-it-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-it-t b { font-size: 14.5px; font-weight: 600; }
.lib-it-t small { font-size: 12px; color: #5B6776; }
.lib-item.is-locked .lib-it-t b { color: #5B6776; }
.lib-go { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #2F557F; white-space: nowrap; }
.lib-note { margin-top: auto; display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #FFF7EC; border: 1px solid #F6D3A8; color: #7A4A12; font-size: 12.5px; line-height: 1.6; }
.lib-note i { margin-top: 3px; }
.lib-foot { height: 52px; flex-shrink: 0; box-sizing: border-box; padding: 0 24px; border-top: 1px solid #E6EAF0; display: flex; align-items: center; gap: 22px; font-size: 12.5px; color: #5B6776; }
.lib-foot i { margin-right: 4px; }
.lib-sp { flex: 1; }
.lib-mobile { display: none; }

/* 좁은 화면 — 그림 대신 목록 */
@media (max-width: 760px) {
  .lib-room, .lib-side, .lib-foot, .lib-title span { display: none; }
  .lib-mobile { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; padding: 16px; }
  .lib-mobile .lib-side-h { margin-top: 8px; font-size: 16px; }
}
@media (max-height: 640px) { .lib-hint { display: none; } }

/* 메뉴 화면 쪽 — 자료실 표시 칩 · 오른쪽 패널 지금 화면 */
.lib-ro-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: #FFF3E6; border: 1px solid #F6C79A; color: #8A4310; font-size: 12.5px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.lib-pcard { width: 100%; text-align: left; font-family: inherit; }

/* ── 조회 전용(body.lib-ro) — 자료실에서 연 화면의 추가·수정·삭제·업로드 단추를 숨긴다. 엑셀·PDF 내려받기는 그대로 ── */
body.lib-ro .view.active [onclick*="OpenUpload("], body.lib-ro .modal-overlay [onclick*="OpenUpload("],
body.lib-ro .view.active [onclick*="OpenNew("], body.lib-ro .modal-overlay [onclick*="OpenNew("],
body.lib-ro .view.active [onclick*="OpenEdit("], body.lib-ro .modal-overlay [onclick*="OpenEdit("],
body.lib-ro .view.active [onclick*="Delete("], body.lib-ro .modal-overlay [onclick*="Delete("],
body.lib-ro .view.active [onclick*="Purge"], body.lib-ro .modal-overlay [onclick*="Purge"],
body.lib-ro .view.active [onclick*="rlEditNew("], body.lib-ro .view.active [onclick*="rlEditOpen("], body.lib-ro .view.active [onclick*="rlStatusAsk("],
body.lib-ro .view.active [onclick*="ymEditOpen("], body.lib-ro .view.active [onclick*="ymStatusAsk("], body.lib-ro .view.active [onclick*="ymAttachPick("],
body.lib-ro .view.active [onclick*="navTo('population-upload')"],
body.lib-ro #rl-go-admin, body.lib-ro #rl-new, body.lib-ro #ym-go-admin { display: none !important; }

/* ── 자료실 간단 보기(2026-10-07 사무장 지시) — 기초자료·교회정보·목회정보 7화면
   제목 · 대시보드(요약 카드) · 조회 항목 · 표만 보인다. 설명 글(제목 아래 p)과 안내 상자(십일금 누계 안내)는 숨긴다.
   조회 항목은 한 줄로: 검색칸을 줄이고 「필터 초기화」·「엑셀 다운로드」를 검색 오른쪽으로 올린다.
   ★자료실에서 연 화면(body.lib-ro)에서만 — 원래 메뉴로 들어가면 지금 그대로다. 화면 js 는 손대지 않는다(다시 그려도 그대로).
   ★:has() 를 못 쓰는 옛 브라우저는 조회 항목만 예전처럼 두 줄로 보인다(설명 숨김은 그대로). */
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > p,
body.lib-ro .tt-head > .tt-notice { display: none; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > h2 { margin-bottom: 12px !important; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 14px !important; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:first-child { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap !important; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:last-child {
  margin-top: 0 !important; flex: 0 0 auto; flex-wrap: nowrap !important; align-items: center; padding-bottom: 2px; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:last-child > span { display: none; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:last-child .btn { white-space: nowrap; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) div:has(> input[id$="-f-kw"]) { flex: 0 1 240px !important; min-width: 140px !important; }
/* 조회 항목 칸은 줄어들지 않게(2026-10-07 — 한 줄로 두니 년도 칸이 줄어 「2026 (18」처럼 잘렸다). 줄일 곳은 검색칸뿐.
   년도(시작~끝) 칸은 조금 넓힌다. 다 못 들어가면 「필터 초기화」·「엑셀 다운로드」가 다음 줄로 내려간다. */
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:first-child > div:not(:has(> input[id$="-f-kw"])) { flex-shrink: 0; }
body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:first-child > div:has(select[id$="-year-from"]) { width: 268px !important; }
/* 기말보고 년도 범위 경고 — 글이 있을 때만 한 줄 아래 전체 폭으로 */
body.lib-ro .rp-head #rp-range-hint { order: 3; flex-basis: 100%; margin-top: 0 !important; }
body.lib-ro .rp-head #rp-range-hint:empty { display: none; }
/* 좁은 화면 — 한 줄에 다 못 들어가면 조회 항목은 예전처럼 줄을 바꾼다 */
@media (max-width: 1100px) {
  body.lib-ro :is(.tt-head, .bp-head, .rp-head, .chs-head, .ci-head, .ca-head, .pi-head) > div:has(input[id$="-f-kw"]) > div:first-child { flex-wrap: wrap !important; }
}
