/* 문서 뷰어 전용 조각. 색·간격·곡률은 JDS 토큰만 쓴다 */

/* 보기 영역: 가로로 넘치는 것(확대한 쪽, 넓은 표)은 이 안에서만 민다 */
.viewer { min-width: 0; overflow-x: auto; }

/* PDF 쪽 */
.pv { display: grid; gap: var(--s4); justify-items: center; }
.pv--edit { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); justify-items: stretch; }
.pv-item { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 0; }
.pv-cv { display: block; max-width: none; outline: 1px solid var(--bd); }
.pv-item.is-del { opacity: .4; }
.pv--edit .pv-cv { width: 100%; height: auto; }
/* 쪽 번호 + 아이콘 4개가 한 줄에 들어가도록 간격과 칸을 줄인다 */
.pv-cap { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: var(--s1); font-size: 13px; color: var(--tx-2); }
.pv-cap .btn { margin: 0; width: 28px; min-width: 28px; height: 28px; padding: 0; }
.pv-no { font-variant-numeric: tabular-nums; }

/* 이미지 */
.v-img { display: block; max-width: 100%; height: auto; margin-inline: auto; }

/* 글 */
.v-text {
    display: block; width: 100%; min-height: 60vh; margin: 0; padding: var(--s3);
    border: 1px solid var(--bd); border-radius: var(--r-card); background: var(--sf);
    font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: inherit;
    white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; tab-size: 4;
}
pre.v-text { overflow: auto; }

/* 표: 셀 편집, 시트 탭. 머리 칸(열 문자, 행 번호)은 스크롤해도 붙어 있다 */
#tabs { max-width: 100%; overflow-x: auto; }
.vw-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--bd); border-radius: var(--r-card); }
.vw-sheet { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.vw-sheet td {
    min-width: 88px; padding: 6px 10px; border: 1px solid var(--bd);
    white-space: nowrap; outline: none;
}
.vw-sheet td:focus { outline: 2px solid var(--sky-a); outline-offset: -2px; }
.vw-sheet th {
    position: sticky; background: var(--sf-2); color: var(--tx-2);
    font-size: 13px; font-weight: 500; text-align: center;
    min-width: 40px; padding: 4px 8px; border: 1px solid var(--bd);
}
/* 겹침 순서: 모서리 3 > 머리 행 2 > 행 번호 열 1. 모서리는 머리 행 규칙보다 구체적으로 써야 이긴다 */
.vw-sheet .vw-head th { top: 0; z-index: 2; }
.vw-sheet th[scope="row"] { left: 0; z-index: 1; }
.vw-sheet .vw-head .vw-corner { left: 0; top: 0; z-index: 3; }

/* 공유 대화상자 */
.share-dlg { max-width: min(360px, calc(100vw - 32px)); padding: var(--s4); }
.share-code { margin: 0 0 var(--s3); font-size: 28px; font-weight: 700; letter-spacing: .08em; text-align: center; font-variant-numeric: tabular-nums; }
