/* 2차 — 점검 › 원고 분석 (사용자 요청 2026-10-15). 공통 토큰(theme.css·tf.css)을 쓴다 — 어두운 화면은 토큰이 따라온다 */

.an { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 위의 요약 숫자 */
.an-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.an-sum div {
    background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1);
    padding: 10px 12px; display: flex; flex-direction: column; min-width: 0;
}
.an-sum b { font-size: 22px; font-weight: 900; color: var(--tf-deep); font-variant-numeric: tabular-nums; line-height: 1.15; }
.an-sum span { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 줄여 넣을 원고 — 경고가 아니라 참고라 중립 색(사용자 결정 2026-10-16) */
.an-sum .is-condense b { color: var(--text-2); }
.an-sum .is-under b { color: var(--warn); }
.an-sum .is-blank b { color: var(--hknu-amber, var(--warn)); }
@media (max-width: 560px) {
    .an-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .an-sum b { font-size: 19px; }
}

.an-bar-top { margin-bottom: 0; }
.an-rule { margin-left: auto; font-size: 12px; }
@media (max-width: 720px) { .an-rule { margin-left: 0; width: 100%; } }

.an-running { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--tf-deep); }
:root[data-theme="dark"] .an-running { color: var(--tf); }
.an-spin {
    width: 12px; height: 12px; border-radius: 50%; flex: none;
    border: 2px solid color-mix(in srgb, var(--tf) 30%, transparent); border-top-color: var(--tf);
    animation: an-spin .9s linear infinite;
}
@keyframes an-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .an-spin { animation: none; } }

/* 항목 묶음 */
.an-group { border-left: 4px solid var(--line); }
.an-group.v-condense { border-left-color: var(--line-strong); }
.an-group.v-under { border-left-color: var(--warn); }
.an-group.v-ok { border-left-color: var(--ok); }
.an-group + .an-group { margin-top: 0; }

.an-ghead {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 8px 16px; align-items: center;
    padding: 12px 14px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) { .an-ghead { grid-template-columns: minmax(0, 1fr); } }
.an-nodes { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.an-node { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.an-node-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.an-node-pages { font-size: 12px; color: var(--text-2); white-space: nowrap; }

.an-cmp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.an-cmp-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.an-cmp-text .sep { color: var(--line-strong); }
.an-cmp-text .tag { margin-left: auto; }
.an-condense { color: var(--text-2); }

/* 목표 대 추정 막대 — 채움 = 추정, 세로 금 = 목표 */
.an-meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface-sunken); overflow: visible; }
.an-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--tf); }
.v-condense .an-meter-fill { background: var(--text-3); }
.v-under .an-meter-fill { background: var(--warn); }
.v-ok .an-meter-fill { background: var(--ok); }
.an-meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }

/* 원고 한 줄 */
.an-doc + .an-doc { border-top: 1px solid var(--line); }
.an-doc-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 6px 12px; align-items: center;
    padding: 10px 8px 10px 14px; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .an-doc-row:hover { background: var(--surface-2); } }
.an-doc.is-open .an-doc-row { background: var(--tf-tint); }
.an-doc-name { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.an-doc-name a { font-weight: 600; color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.an-doc-name a:hover { text-decoration: underline; color: var(--tf-deep); }
.an-authors { font-size: 12px; color: var(--text-2); }
.an-doc-stats { display: flex; align-items: center; justify-content: flex-end; gap: 4px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.an-stat b { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 1px; }
.an-stat.is-warn b { color: var(--warn); }
.an-stat.is-ok b { color: var(--ok); }
.an-when { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.an-chev {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: none; color: var(--text-3); border-radius: 50%; cursor: pointer;
}
.an-chev svg { width: 18px; height: 18px; }
.an-chev:hover { background: var(--surface-sunken); color: var(--text); }

/* 폰 — 이름 아래에 숫자, 펼침 단추는 오른쪽 위 */
@media (max-width: 720px) {
    .an-doc-row { grid-template-columns: minmax(0, 1fr) 36px; padding-left: 12px; }
    .an-doc-name { grid-column: 1; grid-row: 1; }
    .an-chev { grid-column: 2; grid-row: 1; }
    .an-doc-stats { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

/* 펼친 것 */
.an-detail { padding: 10px 14px 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.an-facts { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); }
.an-facts b { color: var(--text); }
.an-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
@media (max-width: 900px) { .an-cols { grid-template-columns: minmax(0, 1fr); } }
.an-col { min-width: 0; }
.an-h { font-size: 13.5px; font-weight: 800; margin: 2px 0 6px; display: flex; gap: 6px; align-items: baseline; }

.an-toc { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.an-toc li {
    display: flex; gap: 8px; align-items: baseline; justify-content: space-between;
    padding: 3px 8px 3px calc(8px + (var(--lv, 1) - 1) * 14px);
}
.an-toc li + li { border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.an-toc li.lv-1 { font-weight: 800; }
.an-toc li.lv-2 { font-weight: 600; }
.an-toc-t { min-width: 0; overflow-wrap: anywhere; }
.an-toc-p { flex: none; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.an-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.an-kind {
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
    border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer;
}
.an-kind.is-on { background: var(--tf-tint); border-color: var(--tf); color: var(--tf-deep); font-weight: 700; }

.an-blanks { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.an-blanks li { padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.an-blanks li + li { border-top: 1px solid var(--line); }
.an-b-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.an-b-where { font-size: 11.5px; color: var(--text-3); min-width: 0; overflow-wrap: anywhere; }
.an-b-text { font-size: 13px; overflow-wrap: anywhere; }
.an-b-ctx { font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.an-b-ctx mark { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; font-weight: 700; }
.an-clean { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; }
.an-clean svg { width: 16px; height: 16px; }

/* 통합본 구간 — 원고 자리에 버전이 없어 통합본을 원고 번호로 나눈 구간을 센 것(사용자 요청 2026-10-15) */
.an-via, .an-via-tag {
    display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--tf-tint);
    border-radius: var(--r-sm); padding: 0 6px; white-space: nowrap; text-decoration: none;
}
a.an-via:hover { color: var(--tf-deep); text-decoration: underline; }
.an-via-note { font-size: 12px; color: var(--text-2); line-height: 1.5; overflow-wrap: anywhere; }
.an-via-note .an-via-tag, .an-via-src .an-via-tag { margin-right: 4px; }
.an-via-src { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }

/* hwp 등 분석 못 한 원고의 짧은 안내 */
.an-hint { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* 계획서 목차의 '추정 n쪽' — 쪽 배정 곁에 작고 중립으로, 누르면 원고 분석(사용자 결정 2026-10-16) */

