/* ============================================================
   Genver Parser — mockup
   토큰은 genver-docs 의 디자인 시스템을 그대로 이어받는다.
   ============================================================ */

:root {
  --bg-app: #fbfbfc;
  --bg-panel: #ffffff;
  --bg-sidebar: #f8f8fa;
  --bg-subtle: #f3f3f6;
  --bg-hover: #eeeef2;
  --bg-active: #e7e7ed;
  --bg-sunken: #eaeaec;

  --text-1: #18181b;
  --text-2: #5b5b66;
  --text-3: #8a8a95;
  --text-inv: #ffffff;

  --border-1: #ededf1;
  --border-2: #e0e0e6;
  --border-3: #c9c9d2;

  --accent: #5b5bd6;
  --accent-hover: #4e4ec4;
  --accent-press: #4444b0;
  --accent-subtle: #f1f1fe;
  --accent-border: #d7d7f8;
  --accent-text: #4a4ab5;

  --success: #167c3c;
  --success-subtle: #e9f6ed;
  --success-border: #c6e5d1;
  --warning: #9a5700;
  --warning-subtle: #fdf2e4;
  --warning-border: #f3ddbb;
  --danger: #c22b2b;
  --danger-subtle: #fdecec;
  --danger-border: #f5c9c9;

  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-20: 20px;

  --r-4: 4px;
  --r-6: 6px;
  --r-8: 8px;
  --r-10: 10px;
  --r-14: 14px;

  --sh-1: 0 1px 2px rgba(20, 20, 35, 0.05);
  --sh-2: 0 4px 12px rgba(20, 20, 35, 0.07), 0 0 0 1px rgba(20, 20, 35, 0.04);
  --sh-3: 0 16px 48px rgba(20, 20, 35, 0.16), 0 0 0 1px rgba(20, 20, 35, 0.06);
  --sh-paper: 0 1px 2px rgba(20, 20, 35, 0.06), 0 10px 30px rgba(20, 20, 35, 0.07);

  --ring: 0 0 0 3px rgba(91, 91, 214, 0.16);

  --menu-w: 216px;
  --toc-w: 288px;
  --side-w: 468px;
  --split-w: 1px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: "Pretendard Variable", Pretendard, "IBM Plex Sans KR", -apple-system,
    BlinkMacSystemFont, system-ui, sans-serif;
  font-size: var(--fs-14);
  color: var(--text-1);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
svg { display: block; }

/* ── 골격 ───────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--menu-w) var(--split-w) var(--toc-w) var(--split-w) minmax(520px, 1fr) var(--split-w) var(--side-w);
  height: 100vh;
}

/* 기준 화면(스키마 · 지식팩)에서는 근거 패널을 접고 표를 넓게 쓴다 */
body.no-side .app {
  grid-template-columns: var(--menu-w) var(--split-w) var(--toc-w) var(--split-w) minmax(520px, 1fr);
}
body.no-side .side,
body.no-side .splitter[data-split="side"] { display: none; }
body.no-side .paper { max-width: 1080px; }

.splitter {
  background: var(--border-1);
  cursor: col-resize;
  position: relative;
}
.splitter::after {
  content: "";
  position: absolute;
  inset: 0 -4px;
}
.splitter:hover { background: var(--accent-border); }

/* ── 메뉴 ───────────────────────────────────────────────── */

.menu {
  background: var(--bg-sidebar);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.brand { display: flex; gap: 9px; align-items: center; padding: 4px 6px 16px; }
.logo {
  width: 26px; height: 26px; flex: none;
  border-radius: 7px;
  background: linear-gradient(145deg, #6a6ae0, #4b4bc0);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
}
.brand .mark { display: block; font-size: var(--fs-13); font-weight: 700; letter-spacing: -0.01em; }
.brand .sub { display: block; font-size: var(--fs-11); color: var(--text-3); }

.nav-label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 8px 5px;
  letter-spacing: 0.02em;
}

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-6);
  font-size: var(--fs-13);
  color: var(--text-2);
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active { background: var(--bg-active); color: var(--text-1); font-weight: 600; }
.nav-item .ico { width: 16px; height: 16px; flex: none; opacity: 0.75; }
.nav-item .ico svg { width: 16px; height: 16px; }

.menu-foot { margin-top: auto; padding: 8px 8px 0; border-top: 1px solid var(--border-1); }
.menu-foot .row { display: flex; justify-content: space-between; font-size: var(--fs-11); color: var(--text-3); padding: 3px 0; }
.menu-foot .row b { font-weight: 600; color: var(--text-2); }

/* ── 목차 ───────────────────────────────────────────────── */

.toc {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  padding: 13px 14px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.panel-head h2 { font-size: var(--fs-13); font-weight: 700; }
.panel-head .meta { font-size: var(--fs-11); color: var(--text-3); }

.gauge { padding: 0 14px 8px; }
.gauge-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--bg-sunken); }
.gauge-bar i { display: block; height: 100%; }
.gauge-bar i.present { background: var(--success); }
.gauge-bar i.partial { background: #d99328; }
.gauge-bar i.absent  { background: var(--danger); }
.gauge-bar i.na      { background: var(--border-3); }
.gauge-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-top: 7px; font-size: var(--fs-11); color: var(--text-2); }
.gauge-legend span { display: inline-flex; align-items: center; gap: 4px; }
.gauge-legend .dot { width: 7px; height: 7px; border-radius: 99px; }

.dot { width: 7px; height: 7px; border-radius: 99px; flex: none; }
.dot.present { background: var(--success); }
.dot.partial { background: #d99328; }
.dot.absent  { background: var(--danger); }
.dot.absent.mild { background: #e0a2a2; }
.dot.na      { background: var(--border-3); }

/* 3분할 세그먼트 — 종합소견 · 원문 순서 · 재구성 보고서 */
.seg { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px; }
.seg-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  border-radius: var(--r-6);
  border: 1px solid transparent;
  font-size: var(--fs-12);
  color: var(--text-2);
  text-align: left;
}
.seg-btn:hover { background: var(--bg-hover); }
.seg-btn.on {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-text);
  font-weight: 600;
}
.seg-btn .ico { width: 14px; height: 14px; flex: none; opacity: 0.85; }
.seg-btn .ico svg { width: 14px; height: 14px; }
.seg-btn .t { flex: 1; }
.seg-btn .n { font-size: var(--fs-11); color: var(--text-3); font-variant-numeric: tabular-nums; }
.seg-btn.on .n { color: var(--accent-text); }

.toc-list { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }

.toc-op {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 8px;
  border-radius: var(--r-6);
  font-size: var(--fs-13);
  font-weight: 600;
  margin-bottom: 6px;
}
.toc-op:hover { background: var(--bg-hover); }
.toc-op.active { background: var(--accent-subtle); color: var(--accent-text); }
.toc-op .ico { width: 15px; height: 15px; opacity: 0.8; }

.toc-chap { padding: 10px 8px 3px; font-size: var(--fs-11); font-weight: 700; color: var(--text-3); letter-spacing: 0.01em; }

.toc-sec {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-6);
  font-size: var(--fs-13);
  color: var(--text-2);
  text-align: left;
}
.toc-sec:hover { background: var(--bg-hover); color: var(--text-1); }
.toc-sec.active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 600; }
.toc-sec .num { font-size: var(--fs-11); color: var(--text-3); width: 10px; flex: none; }
.toc-sec .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-sec .ev { font-size: var(--fs-11); color: var(--text-3); font-variant-numeric: tabular-nums; }
.toc-sec.na .t { color: var(--text-3); }

.toc-foot { border-top: 1px solid var(--border-1); padding: 9px 14px; font-size: var(--fs-11); color: var(--text-3); }

/* ── 보고서 ─────────────────────────────────────────────── */

.report { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-app); }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-1);
}
.topbar .file { font-size: var(--fs-13); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: var(--fs-11);
  background: var(--bg-subtle);
  color: var(--text-2);
  border: 1px solid var(--border-1);
  white-space: nowrap;
}
.chip.accent { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-text); }

.btn {
  padding: 5px 11px;
  border-radius: var(--r-6);
  font-size: var(--fs-12);
  border: 1px solid var(--border-2);
  background: var(--bg-panel);
  color: var(--text-2);
  white-space: nowrap;
}
.btn { display: inline-flex; align-items: center; gap: 5px; }
.btn svg { width: 13px; height: 13px; flex: none; }
.btn:hover { background: var(--bg-hover); color: var(--text-1); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }

.report-scroll { flex: 1; overflow-y: auto; padding: 26px 0 120px; scroll-behavior: smooth; }
.paper {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  background: var(--bg-panel);
  border-radius: var(--r-14);
  box-shadow: var(--sh-paper);
  padding: 34px 40px 44px;
}

.doc-head { border-bottom: 1px solid var(--border-1); padding-bottom: 18px; margin-bottom: 8px; }
.doc-kicker { font-size: var(--fs-11); color: var(--text-3); letter-spacing: 0.04em; font-weight: 600; }
.doc-title { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; margin: 5px 0 3px; }
.doc-sub { font-size: var(--fs-13); color: var(--text-2); }
.doc-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }

/* 종합소견 */
.opinion { padding: 22px 0 6px; }
.op-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.01em; }
.op-title .tag { font-size: var(--fs-11); font-weight: 600; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 99px; padding: 1px 7px; }
.op-lead { margin-top: 12px; font-size: var(--fs-15); line-height: 1.72; }
.op-block { margin-top: 20px; }
.op-h { font-size: var(--fs-12); font-weight: 700; color: var(--text-3); letter-spacing: 0.03em; margin-bottom: 7px; }
.op-block p { font-size: var(--fs-14); line-height: 1.72; color: var(--text-1); }
.op-block p + p { margin-top: 8px; }

.op-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.op-card { border: 1px solid var(--border-1); border-radius: var(--r-10); padding: 13px 14px; background: var(--bg-panel); }
.op-card.strong { background: var(--success-subtle); border-color: var(--success-border); }
.op-card.weak { background: var(--warning-subtle); border-color: var(--warning-border); }
.op-card h4 { font-size: var(--fs-12); font-weight: 700; margin-bottom: 7px; }
.op-card.strong h4 { color: var(--success); }
.op-card.weak h4 { color: var(--warning); }
.op-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.op-card li { font-size: var(--fs-13); line-height: 1.6; padding-left: 11px; position: relative; }
.op-card li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 99px; background: currentColor; opacity: 0.45; }

.miss-rows { display: flex; flex-direction: column; gap: 7px; }
.miss-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border-1); border-radius: var(--r-8); padding: 9px 11px; }
.miss-w { font-size: var(--fs-11); font-weight: 700; border-radius: var(--r-4); padding: 1px 6px; flex: none; margin-top: 2px; }
.miss-w.fatal { background: var(--danger-subtle); color: var(--danger); }
.miss-w.major { background: var(--warning-subtle); color: var(--warning); }
.miss-w.usual { background: var(--bg-subtle); color: var(--text-3); }
.miss-row .txt { font-size: var(--fs-13); line-height: 1.6; }
.miss-row .txt b { font-weight: 700; }

.diag-rows { display: flex; flex-direction: column; gap: 7px; }
.diag {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--danger-border);
  background: var(--danger-subtle);
  border-radius: var(--r-8);
  padding: 10px 12px;
}
.diag.mild { border-color: var(--warning-border); background: var(--warning-subtle); }
.diag .ico { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--danger); }
.diag.mild .ico { color: var(--warning); }
.diag .body { flex: 1; }
.diag .t { font-size: var(--fs-13); font-weight: 600; }
.diag .d { font-size: var(--fs-12); color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.diag code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-12); background: rgba(255,255,255,0.7); padding: 1px 4px; border-radius: var(--r-4); }

.ask { list-style: none; counter-reset: q; display: flex; flex-direction: column; gap: 8px; }
.ask li { counter-increment: q; display: flex; gap: 9px; font-size: var(--fs-13); line-height: 1.6; }
.ask li::before {
  content: counter(q);
  flex: none;
  width: 18px; height: 18px;
  border-radius: 99px;
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-size: var(--fs-11);
  font-weight: 700;
  display: grid; place-items: center;
  margin-top: 2px;
}

/* 장·절 */
.chapter { margin-top: 34px; }
.chap-head {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text-1);
}
.chap-num { font-size: var(--fs-13); font-weight: 800; color: var(--accent-text); }
.chap-title { font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.01em; }

.section { padding: 20px 0 4px; scroll-margin-top: 14px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-title { font-size: var(--fs-15); font-weight: 700; }
.sec-title .n { color: var(--text-3); font-weight: 600; margin-right: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-11);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid transparent;
}
.badge.present { background: var(--success-subtle); color: var(--success); border-color: var(--success-border); }
.badge.partial { background: var(--warning-subtle); color: var(--warning); border-color: var(--warning-border); }
.badge.absent  { background: var(--danger-subtle); color: var(--danger); border-color: var(--danger-border); }
.badge.na      { background: var(--bg-subtle); color: var(--text-3); border-color: var(--border-2); }

.item { padding: 10px 0; border-top: 1px solid var(--border-1); }
.item:first-of-type { border-top: none; padding-top: 2px; }
.item-label { font-size: var(--fs-12); font-weight: 700; color: var(--text-3); margin-bottom: 4px; }
.item-text { font-size: var(--fs-14); line-height: 1.74; }
.item-text b { font-weight: 700; }
.item-text .num { font-variant-numeric: tabular-nums; }
.item-list { list-style: none; margin-top: 5px; display: flex; flex-direction: column; gap: 4px; }
.item-list li { font-size: var(--fs-13); line-height: 1.66; padding-left: 11px; position: relative; color: var(--text-1); }
.item-list li::before { content: ""; position: absolute; left: 1px; top: 8px; width: 4px; height: 4px; border-radius: 99px; background: var(--border-3); }

.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }

.ev-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-11);
  font-weight: 600;
  padding: 2px 8px 2px 6px;
  border-radius: 99px;
  border: 1px solid var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent-text);
}
.ev-chip:hover { background: #e7e7fb; }
.ev-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-chip .ic { width: 12px; height: 12px; opacity: 0.85; }

.ex-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-11);
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  background: var(--bg-panel);
}
.ex-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.ex-btn.on { border-color: var(--text-1); color: var(--text-1); background: var(--bg-active); }
.ex-btn .ic { width: 12px; height: 12px; opacity: 0.7; }

/* 부재 판정 */
.gap { border: 1px dashed var(--border-3); border-radius: var(--r-10); padding: 12px 14px; background: var(--bg-subtle); }
.gap.fatal { border-color: var(--danger-border); background: var(--danger-subtle); }
.gap-t { font-size: var(--fs-13); font-weight: 600; }
.gap.fatal .gap-t { color: var(--danger); }
.gap-d { font-size: var(--fs-13); color: var(--text-2); line-height: 1.66; margin-top: 5px; }
.gap-scope {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.6;
}
.gap-scope b { color: var(--text-2); font-weight: 600; }

/* ── 원문 순서 보고서 ───────────────────────────────────── */

.src-note {
  border: 1px solid var(--accent-border);
  background: var(--accent-subtle);
  border-radius: var(--r-10);
  padding: 12px 14px;
  font-size: var(--fs-13);
  line-height: 1.7;
  color: var(--accent-text);
  margin: 20px 0 6px;
}

.src-group { margin-top: 30px; }
.src-group-head {
  display: flex; align-items: baseline; gap: 9px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--text-1);
}
.src-group-head .t { font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.01em; }
.src-group-head .r { font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; }

.src-page { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-1); scroll-margin-top: 14px; }
.src-thumb { width: 176px; flex: none; }
.src-thumb .cap { cursor: zoom-in; }
.src-thumb .pl { font-size: var(--fs-11); color: var(--text-3); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.src-main { flex: 1; min-width: 0; }
.src-p { font-size: var(--fs-11); font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.src-title { font-size: var(--fs-14); font-weight: 700; line-height: 1.5; margin: 2px 0 2px; }
.src-sub { font-size: var(--fs-12); color: var(--text-3); margin-bottom: 5px; }
.src-body { font-size: var(--fs-13); line-height: 1.72; color: var(--text-1); }

.read-tag { font-size: var(--fs-11); font-weight: 600; padding: 1px 6px; border-radius: var(--r-4); border: 1px solid var(--border-2); color: var(--text-3); }
.read-tag.image { background: var(--warning-subtle); border-color: var(--warning-border); color: var(--warning); }

.map-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.map-label { font-size: var(--fs-11); color: var(--text-3); }
.map-chip {
  font-size: var(--fs-11);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  background: var(--bg-panel);
  color: var(--text-2);
}
.map-chip:hover { border-color: var(--accent-border); background: var(--accent-subtle); color: var(--accent-text); }
.map-chip.on { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }

.sec-preview { padding: 4px 14px 14px; }
.sec-preview .item { padding: 12px 0; }
.sec-preview .item + .item { border-top: 1px solid var(--border-1); }
.map-none { font-size: var(--fs-11); color: var(--text-3); font-style: normal; }

.note-good, .note-flag {
  margin-top: 9px;
  border-radius: var(--r-8);
  padding: 8px 11px;
  font-size: var(--fs-12);
  line-height: 1.62;
  display: flex; gap: 8px; align-items: flex-start;
}
.note-good { background: var(--success-subtle); border: 1px solid var(--success-border); color: #14603a; }
.note-flag { background: var(--warning-subtle); border: 1px solid var(--warning-border); color: var(--warning); }
.note-good .ic, .note-flag .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* ══ 도식화 보고서 ═══════════════════════════════════════ */

.dg-cover {
  border: 1px solid var(--border-1);
  border-radius: var(--r-12);
  padding: 30px 30px 26px;
  background: linear-gradient(155deg, var(--bg-panel) 0%, var(--accent-subtle) 100%);
  margin-top: 20px;
}
.dg-cover .kicker { font-size: var(--fs-11); font-weight: 700; letter-spacing: 0.06em; color: var(--accent-text); }
.dg-cover h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 5px; }
.dg-cover .sub { font-size: var(--fs-15); color: var(--text-2); line-height: 1.55; }
.dg-cover .stamp { font-size: var(--fs-11); color: var(--text-3); margin-top: 14px; font-variant-numeric: tabular-nums; }
.dg-cover .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.dg-legend {
  display: flex; flex-wrap: wrap; gap: 7px 16px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border-1);
  font-size: var(--fs-11); color: var(--text-3);
}
.dg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dg-legend .tag {
  font-style: normal; font-size: var(--fs-11); font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
}
.tag-quote { background: var(--accent-subtle); color: var(--accent-text); }
.tag-rebuild { background: var(--warning-subtle); color: var(--warning); }
.tag-new { background: var(--success-subtle); color: #14603a; }

.dg-chap { margin-top: 40px; }
.dg-chap-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--text-1); padding-bottom: 8px; }
.dg-chap-head .num { font-size: var(--fs-13); font-weight: 800; color: var(--accent-text); }
.dg-chap-head .t { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }

/* 본문이 먼저다. 도식은 문장을 받친다. */
.dg-sec { margin-top: 26px; scroll-margin-top: 14px; }
.dg-sec-head {
  display: flex; align-items: baseline; gap: 9px;
  font-size: var(--fs-16); font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.dg-sec-head .n {
  flex: none;
  font-size: var(--fs-11); font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-2);
  border-radius: var(--r-4);
  padding: 1px 6px;
}
.dg-p { font-size: var(--fs-14); line-height: 1.85; color: var(--text-1); margin: 0 0 14px; }
.dg-p b { font-weight: 700; }
.dg-p i { font-style: normal; color: var(--text-3); }
.dg-h {
  font-size: var(--fs-14); font-weight: 800; letter-spacing: -0.01em;
  margin: 22px 0 10px; padding-left: 9px;
  border-left: 3px solid var(--accent);
}
.dg-list { margin: 0 0 14px; padding-left: 18px; }
.dg-list li { font-size: var(--fs-14); line-height: 1.8; margin-bottom: 5px; }

/* 사실과 해석을 섞지 않는다. 판단은 눈으로 구분되게 둔다. */
.dg-judge {
  margin: 20px 0 6px;
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--text-1);
  border-radius: var(--r-8);
  background: var(--bg-subtle);
  padding: 14px 16px 15px;
}
.dg-judge .jt {
  display: inline-block;
  font-size: var(--fs-11); font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}
.dg-judge .jb { font-size: var(--fs-14); line-height: 1.85; }
.dg-judge .jb b { font-weight: 700; }

/* 문단에 붙는 근거 표지 */
.p-ev { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.ev-chip.mini { height: 19px; padding: 0 6px; font-size: var(--fs-11); gap: 3px; }
.ev-chip.mini .ic { width: 11px; height: 11px; }

figure.fig + .dg-p, figure.fig + .dg-h, figure.fig + .dg-judge { margin-top: 22px; }

figure.fig {
  margin: 22px 0 0;
  border: 1px solid var(--border-1);
  border-radius: var(--r-12);
  background: var(--bg-panel);
  overflow: hidden;
  scroll-margin-top: 14px;
}
figure.fig.picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
/* 원본 도판을 인용한 도식은 눌러 그 도판을 열 수 있다. 지금 열려 있는 것은 표시해 둔다. */
figure.fig.has-cite { cursor: pointer; }
figure.fig.has-cite:hover { border-color: var(--border-3); }
figure.fig.cited { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-subtle); }
figure.fig.cited .cite-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.fig-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-subtle);
}
.fig-head .n {
  flex: none;
  font-size: var(--fs-11); font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.fig-head h4 { flex: 1; font-size: var(--fs-14); font-weight: 700; letter-spacing: -0.01em; }
.cite-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border: 1px solid var(--accent-border);
  border-radius: 99px;
  background: var(--bg-panel);
  color: var(--accent-text);
  font-size: var(--fs-11); font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
}
.cite-btn:hover { background: var(--accent-subtle); }
.cite-btn .ic { width: 12px; height: 12px; }
.fig-origin { font-size: var(--fs-11); font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.fig-origin.quote { background: var(--accent-subtle); color: var(--accent-text); }
.fig-origin.rebuild { background: var(--warning-subtle); color: var(--warning); }
.fig-origin.new { background: var(--success-subtle); color: #14603a; }

.fig-body { padding: 16px 14px; }
figcaption {
  padding: 11px 14px 13px;
  border-top: 1px solid var(--border-1);
  font-size: var(--fs-12);
  line-height: 1.7;
  color: var(--text-2);
  background: var(--bg-subtle);
}
.fig-tools { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 12px; }

/* kpi · stat-strip */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.kpi-card { border: 1px solid var(--border-1); border-radius: var(--r-8); padding: 11px 12px; background: var(--bg-panel); }
.kpi-card.warn { border-color: var(--warning-border); background: var(--warning-subtle); }
.kpi-card.good { border-color: var(--success-border); background: var(--success-subtle); }
.kpi-card .l { font-size: var(--fs-11); color: var(--text-3); font-weight: 600; }
.kpi-card .v { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: 3px; }
.kpi-card .v i { font-size: var(--fs-12); font-weight: 600; font-style: normal; color: var(--text-2); margin-left: 3px; }
.kpi-card .d { font-size: var(--fs-11); color: var(--text-3); margin-top: 4px; line-height: 1.5; }

.strip { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border-1); border-radius: var(--r-8); overflow: hidden; }
.strip > div { flex: 1 1 140px; padding: 12px 13px; border-right: 1px solid var(--border-1); }
.strip > div:last-child { border-right: 0; }
.strip .v { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.strip .v i { font-size: var(--fs-12); font-style: normal; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.strip .l { font-size: var(--fs-12); font-weight: 700; margin-top: 2px; }
.strip .d { font-size: var(--fs-11); color: var(--text-3); margin-top: 3px; line-height: 1.5; }

/* progress */
.pg-rows { display: flex; flex-direction: column; gap: 7px; }
.pg-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 42px 150px; gap: 9px; align-items: center; font-size: var(--fs-12); }
.pg-row .l { font-weight: 600; }
.pg-track { height: 16px; border-radius: var(--r-4); background: var(--bg-active); overflow: hidden; }
.pg-fill { height: 100%; background: var(--success); }
.pg-fill.major { background: var(--warning); }
.pg-fill.fatal { background: var(--danger); }
.pg-row .rt { font-size: var(--fs-11); font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pg-row .n { font-size: var(--fs-11); color: var(--text-3); }
.pg-foot { font-size: var(--fs-11); color: var(--text-3); margin-top: 9px; }

/* callout */
.callout { border-radius: var(--r-10); padding: 14px 16px; border: 1px solid; }
.callout.danger { background: var(--danger-subtle); border-color: var(--danger-border); }
.callout.warn { background: var(--warning-subtle); border-color: var(--warning-border); }
.callout .lead { font-size: var(--fs-13); font-weight: 700; line-height: 1.65; }
.callout.danger .lead { color: var(--danger); }
.callout.warn .lead { color: var(--warning); }
.callout ul { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.callout li { font-size: var(--fs-13); line-height: 1.68; padding-left: 13px; position: relative; color: var(--text-1); }
.callout li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 99px; background: currentColor; opacity: 0.5; }
.callout li i { font-style: normal; font-size: var(--fs-11); color: var(--text-3); }
.callout .foot { font-size: var(--fs-12); color: var(--text-2); margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--border-2); line-height: 1.65; }

/* org */
.org { display: flex; flex-direction: column; gap: 9px; align-items: center; }
.org-key { border: 1px solid var(--accent-border); background: var(--accent-subtle); border-radius: var(--r-8); padding: 10px 14px; text-align: center; min-width: 60%; }
.org-key .l { font-size: var(--fs-14); font-weight: 800; color: var(--accent-text); }
.org-key .s { font-size: var(--fs-11); color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.org-line { width: 1px; height: 12px; background: var(--border-2); }
.org-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 7px; width: 100%; }
.org-node { border: 1px solid var(--border-1); border-radius: var(--r-6); padding: 8px 9px; background: var(--bg-panel); text-align: center; }
.org-node .l { font-size: var(--fs-12); font-weight: 700; }
.org-node .s { font-size: var(--fs-11); color: var(--text-3); margin-top: 2px; }

/* steps-arrow */
.steps { display: flex; gap: 4px; }
.step {
  flex: 1; position: relative;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  padding: 10px 12px 10px 14px;
  background: var(--bg-panel);
}
.step.target { border-color: var(--accent-border); background: var(--accent-subtle); }
.step.now { border-color: var(--warning-border); background: var(--warning-subtle); }
.step .l { font-size: var(--fs-12); font-weight: 800; }
.step .s { font-size: var(--fs-11); color: var(--text-3); }
.step .d { font-size: var(--fs-11); color: var(--text-2); margin-top: 5px; line-height: 1.5; }
.step-legend { display: flex; gap: 14px; margin-top: 10px; font-size: var(--fs-11); color: var(--text-3); }
.step-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.step-legend i.target { background: var(--accent); }
.step-legend i.now { background: var(--warning); }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.fn-row { border: 1px solid var(--border-1); border-radius: var(--r-8); padding: 11px 14px; background: var(--bg-panel); text-align: center; }
.fn-row:nth-child(1) { width: 100%; }
.fn-row:nth-child(2) { width: 82%; }
.fn-row:nth-child(3) { width: 64%; }
.fn-row.bad { border-color: var(--danger-border); background: var(--danger-subtle); }
.fn-row .l { font-size: var(--fs-11); font-weight: 800; color: var(--text-3); letter-spacing: 0.04em; }
.fn-row .v { font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.fn-row .d { font-size: var(--fs-11); color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.fn-bad { margin-top: 9px; width: 100%; font-size: var(--fs-11); color: var(--danger); background: var(--danger-subtle); border: 1px solid var(--danger-border); border-radius: var(--r-6); padding: 7px 10px; line-height: 1.6; }

/* bar */
.bars { display: flex; flex-direction: column; gap: 6px; position: relative; }
.bar-row { display: grid; grid-template-columns: 106px minmax(0, 1fr) 104px; gap: 10px; align-items: center; }
.bar-row .l { font-size: var(--fs-12); color: var(--text-2); text-align: right; }
.bar-row > .n { font-size: var(--fs-11); color: var(--text-3); }
.bar-track { position: relative; height: 22px; background: var(--bg-subtle); border-radius: var(--r-4); }
.bar-fill {
  height: 100%; border-radius: var(--r-4);
  background: var(--accent); opacity: 0.82;
  display: flex; align-items: center; justify-content: flex-end;
}
.bar-row.top .bar-fill { opacity: 1; }
.bar-fill .v { font-size: var(--fs-11); font-weight: 700; color: #fff; padding-right: 7px; }
.bar-track .v.out { position: absolute; top: 0; line-height: 22px; font-size: var(--fs-11); font-weight: 700; color: var(--text-1); }
.bar-row.band { margin-bottom: 2px; }
.bar-row.band .l { font-size: var(--fs-11); color: var(--text-3); }
.band-strip { position: relative; height: 14px; border-bottom: 1px solid var(--border-2); }
.band-seg {
  position: absolute; top: 3px; height: 9px;
  background: rgba(22, 163, 74, 0.16);
  border-left: 2px solid #0f7a45; border-right: 2px solid #0f7a45;
}
.band-seg span {
  position: absolute; right: 0; top: -12px;
  font-size: 9.5px; font-weight: 700; color: #0f7a45; white-space: nowrap;
}
.bar-foot { font-size: var(--fs-11); color: var(--text-3); margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.bar-foot .band-key { color: #14603a; }

/* bar-group — 표가 둘이면 두 줄로 나란히 둔다. 한 줄에 섞으면 출처가 지워진다 */
.bg-rows { display: flex; flex-direction: column; gap: 7px; }
.bg-row { display: grid; grid-template-columns: 106px minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.bg-row > .l { font-size: var(--fs-12); color: var(--text-2); text-align: right; }
.bg-row > .n { font-size: var(--fs-11); color: var(--text-3); }
.bg-row.mark > .l { font-weight: 700; color: var(--text-1); }
.bg-band { display: grid; grid-template-columns: 106px minmax(0, 1fr) 92px; gap: 10px; align-items: center; margin-bottom: 2px; }
.bg-tracks { display: flex; flex-direction: column; gap: 3px; }
.bg-line { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; align-items: center; }
.bg-line .tag { font-size: 9.5px; color: var(--text-3); text-align: right; letter-spacing: -0.2px; }
.bg-track { position: relative; height: 15px; background: var(--bg-subtle); border-radius: 3px; }
.bg-fill { height: 100%; border-radius: 3px; display: flex; align-items: center; justify-content: flex-end; }
.bg-fill.s0 { background: #9aa4b2; }
.bg-fill.s1 { background: var(--accent); opacity: 0.85; }
.bg-fill .v { font-size: 10px; font-weight: 700; color: #fff; padding-right: 6px; }
.bg-track .v.out { position: absolute; top: 0; line-height: 15px; font-size: 10px; font-weight: 700; color: var(--text-1); }
.bg-track .na { position: absolute; left: 6px; line-height: 15px; font-size: 9.5px; color: var(--text-3); font-style: italic; }
.bg-line.mk .bg-track { outline: 1.5px solid #c0392b; outline-offset: 1px; border-radius: 3px; }
.bg-line.mk .tag { color: #c0392b; font-weight: 700; }

/* gauge */
.gauge-fig { display: flex; gap: 18px; align-items: center; }
.gauge-dial {
  flex: none; width: 116px; height: 116px; border-radius: 99px;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-active) 0);
  display: grid; place-items: center;
  position: relative;
}
.gauge-dial::after { content: ""; position: absolute; inset: 11px; background: var(--bg-panel); border-radius: 99px; }
.gauge-dial .in { position: relative; z-index: 1; text-align: center; }
.gauge-dial .v { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.gauge-dial .u { font-size: var(--fs-11); color: var(--text-3); }
.gauge-rows { flex: 1; }
.gauge-rows .r { display: flex; justify-content: space-between; font-size: var(--fs-12); padding: 6px 0; border-bottom: 1px solid var(--border-1); }
.gauge-rows .r b { font-variant-numeric: tabular-nums; }
.gauge-rows .note { font-size: var(--fs-11); color: var(--text-3); margin-top: 8px; line-height: 1.6; }

/* layers */
.layers { display: flex; flex-direction: column; gap: 5px; }
.layer { display: grid; grid-template-columns: 92px 1fr; gap: 11px; align-items: center; border: 1px solid var(--border-1); border-radius: var(--r-6); padding: 9px 12px; background: var(--bg-panel); }
.layer .l { font-size: var(--fs-12); font-weight: 700; color: var(--accent-text); }
.layer .d { font-size: var(--fs-12); color: var(--text-1); line-height: 1.6; }
.layer:first-child, .layer:last-child { background: var(--bg-subtle); }

/* table-compare */
table.cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-12); }
table.cmp th { text-align: left; font-size: var(--fs-11); font-weight: 700; color: var(--text-3); padding: 7px 9px; border-bottom: 1px solid var(--border-2); background: var(--bg-subtle); }
table.cmp th:first-child { width: 116px; }
table.cmp td { padding: 8px 9px; border-bottom: 1px solid var(--border-1); line-height: 1.55; }
table.cmp td:first-child { font-weight: 600; color: var(--text-2); }
table.cmp td.mk { background: var(--accent-subtle); font-weight: 700; color: var(--accent-text); }
.cmp-note { font-size: var(--fs-11); color: var(--text-3); margin-top: 9px; line-height: 1.6; }

/* timeline-h */
.tl-row { margin-bottom: 12px; }
.tl-label { font-size: var(--fs-11); font-weight: 700; color: var(--text-3); margin-bottom: 5px; display: flex; gap: 7px; align-items: center; }
.tl-label .tot { background: var(--bg-subtle); border-radius: 99px; padding: 1px 8px; font-weight: 700; color: var(--text-1); }
.tl-row.warn .tl-label .tot { background: var(--warning-subtle); color: var(--warning); }
.tl-steps { display: flex; gap: 5px; }
.tl-step { flex: 1; border: 1px solid var(--border-1); border-radius: var(--r-6); padding: 9px 11px; background: var(--bg-panel); }
.tl-row.warn .tl-step { border-color: var(--warning-border); background: var(--warning-subtle); }
.tl-step .l { font-size: var(--fs-11); font-weight: 700; color: var(--text-3); }
.tl-step .v { font-size: var(--fs-14); font-weight: 800; letter-spacing: -0.02em; margin-top: 1px; }
.tl-step .d { font-size: var(--fs-11); color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.tl-check { margin-top: 4px; font-size: var(--fs-11); color: var(--accent-text); background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: var(--r-6); padding: 7px 10px; line-height: 1.6; }

/* checklist */
.ck-rows { display: flex; flex-direction: column; }
.ck-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border-1); font-size: var(--fs-13); }
.ck-box { flex: none; width: 16px; height: 16px; border-radius: var(--r-4); border: 1px solid var(--border-2); display: grid; place-items: center; margin-top: 2px; }
.ck-box svg { width: 11px; height: 11px; }
.ck-row.on .ck-box { background: var(--success-subtle); border-color: var(--success-border); color: var(--success); }
.ck-row.off .ck-box { background: var(--bg-subtle); color: transparent; }
.ck-row .l { flex: 1; line-height: 1.55; }
.ck-row.off .l { color: var(--text-2); }
.ck-row .n { font-size: var(--fs-11); color: var(--text-3); text-align: right; max-width: 40%; line-height: 1.5; }

/* quote-fig 짝 목록 */
.pairs { display: flex; flex-direction: column; gap: 7px; }
.pair { display: grid; grid-template-columns: 148px 1fr; gap: 12px; border: 1px solid var(--border-1); border-radius: var(--r-6); padding: 9px 12px; }
.pair .k { font-size: var(--fs-12); font-weight: 700; color: var(--accent-text); }
.pair .v { font-size: var(--fs-12); line-height: 1.62; }

/* ── 스키마 · 지식팩 화면 ───────────────────────────────── */

.def-head { border-bottom: 1px solid var(--border-1); padding-bottom: 16px; }
.def-kicker { font-size: var(--fs-11); color: var(--text-3); letter-spacing: 0.04em; font-weight: 600; }
.def-title { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin: 5px 0 4px; }
.def-sub { font-size: var(--fs-13); color: var(--text-2); }
.def-stat { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }

.kv-rows { display: flex; flex-direction: column; gap: 6px; }
.kv-row { display: flex; gap: 12px; font-size: var(--fs-13); line-height: 1.62; border: 1px solid var(--border-1); border-radius: var(--r-8); padding: 9px 12px; }
.kv-row .k { flex: none; width: 118px; font-weight: 700; color: var(--text-2); font-size: var(--fs-12); padding-top: 1px; }
.kv-row .v { flex: 1; }

.rule-list { list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: r; }
.rule-list li {
  counter-increment: r;
  display: flex; gap: 10px;
  font-size: var(--fs-13);
  line-height: 1.7;
  border-left: 2px solid var(--accent-border);
  padding: 2px 0 2px 11px;
}
.rule-list li::before {
  content: counter(r);
  flex: none; width: 17px; height: 17px;
  border-radius: 99px;
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-size: var(--fs-11); font-weight: 700;
  display: grid; place-items: center;
  margin-top: 3px;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-12); }
table.tbl th {
  text-align: left;
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--text-3);
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-subtle);
  white-space: nowrap;
}
table.tbl td { padding: 8px 9px; border-bottom: 1px solid var(--border-1); vertical-align: top; line-height: 1.6; }
table.tbl tr:hover td { background: var(--bg-subtle); }
table.tbl td.n { font-variant-numeric: tabular-nums; color: var(--text-3); width: 20px; }
table.tbl td.title { font-weight: 600; white-space: nowrap; }
table.tbl td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-11); color: var(--text-2); }
.tbl-wrap { border: 1px solid var(--border-1); border-radius: var(--r-10); overflow: hidden; }

table.sch { table-layout: fixed; }
table.sch col.c-n { width: 26px; }
table.sch col.c-t { width: 108px; }
table.sch col.c-e { width: 27%; }
table.sch col.c-w { width: 70px; }
table.sch td.title { white-space: normal; }
table.sch td.mono { word-break: keep-all; }

.wtag { font-size: var(--fs-11); font-weight: 700; border-radius: var(--r-4); padding: 1px 6px; white-space: nowrap; }
.wtag.fatal { background: var(--danger-subtle); color: var(--danger); }
.wtag.major { background: var(--warning-subtle); color: var(--warning); }
.wtag.mild  { background: var(--bg-subtle); color: var(--text-2); }
.wtag.na    { background: var(--bg-subtle); color: var(--text-3); }

.def-block { margin-top: 26px; }
.def-h { font-size: var(--fs-15); font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.def-d { font-size: var(--fs-12); color: var(--text-2); line-height: 1.66; margin-bottom: 11px; }

.chk-rows { display: flex; flex-direction: column; gap: 5px; }
.chk-row { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-13); line-height: 1.62; padding: 7px 0; border-bottom: 1px solid var(--border-1); }
.chk-cat {
  flex: none; width: 44px;
  font-size: var(--fs-11); font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-subtle);
  border-radius: var(--r-4);
  text-align: center;
  padding: 2px 0;
  margin-top: 2px;
}

.found-note {
  margin-top: 10px;
  border: 1px solid var(--success-border);
  background: var(--success-subtle);
  border-radius: var(--r-8);
  padding: 10px 12px;
  font-size: var(--fs-12);
  line-height: 1.66;
  color: #14603a;
  display: flex; gap: 8px; align-items: flex-start;
}
.found-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* ══ 편집 · 내보내기 — genver-docs 의 것을 그대로 가져왔다 ══ */

.split-btn { position: relative; display: inline-flex; }
.split-btn.busy { opacity: 0.6; pointer-events: none; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-caret { width: 24px; margin-left: 1px; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.split-caret svg { width: 11px; height: 11px; }

.dl-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 58;
  min-width: 252px;
  padding: 5px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  box-shadow: var(--sh-3);
}
.dl-item {
  display: flex; flex-direction: column; gap: 1px;
  width: 100%; padding: 7px 9px;
  border: 0; border-radius: var(--r-6);
  background: none; text-align: left;
}
.dl-item:hover:not(:disabled) { background: var(--bg-hover); }
.dl-item strong { font-size: var(--fs-12); font-weight: 600; color: var(--text-1); }
.dl-item span { font-size: var(--fs-11); color: var(--text-3); }
.dl-item:disabled { cursor: not-allowed; }
.dl-item:disabled strong { color: var(--text-3); }
.dl-sep { height: 1px; background: var(--border-1); margin: 5px 4px; }
.dl-opt { display: flex; align-items: flex-start; gap: 7px; padding: 5px 9px; font-size: var(--fs-11); color: var(--text-2); line-height: 1.5; }
.dl-opt input { margin-top: 2px; accent-color: var(--accent); }
.dl-note { padding: 4px 9px 7px; font-size: var(--fs-11); color: var(--text-3); line-height: 1.55; }

.edit-bar {
  flex-shrink: 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-sidebar);
}
.edit-bar.inactive .eb-group { opacity: 0.45; }
.eb-group { display: inline-flex; align-items: center; gap: 2px; }
.eb-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--border-2); }
.eb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r-6);
  background: transparent;
  color: var(--text-2);
  font: inherit;
}
.eb-btn svg { width: 16px; height: 16px; }
.eb-btn.glyph { font-size: var(--fs-14); line-height: 1; }
.eb-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.eb-btn.active { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-text); }
.eb-select {
  height: 28px; padding: 0 22px 0 8px;
  border: 1px solid var(--border-2); border-radius: var(--r-6);
  background: var(--bg-panel)
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235b5b66' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M4.6 6.6L8 10l3.4-3.4'/%3E%3C/svg%3E")
    no-repeat right 4px center / 14px;
  color: var(--text-1); font: inherit; font-size: var(--fs-12);
  appearance: none; cursor: pointer;
}
.eb-select.narrow { width: 74px; }
.eb-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-6); cursor: pointer; }
.eb-color:hover { background: var(--bg-hover); }
.eb-color input[type="color"] { position: absolute; inset: auto 0 0 0; width: 100%; height: 5px; padding: 0; border: 0; border-radius: 2px; background: none; cursor: pointer; }
.eb-glyph { font-size: var(--fs-14); font-weight: 700; line-height: 1; color: var(--text-1); transform: translateY(-2px); }
.eb-glyph.mark { background: #fff29a; padding: 0 2px; border-radius: 2px; }
.eb-swatches { display: inline-flex; align-items: center; gap: 3px; }
.eb-swatches button { width: 16px; height: 16px; border: 1px solid rgba(20, 20, 35, 0.14); border-radius: 4px; background: var(--sw); }
.eb-swatches button:hover { transform: scale(1.16); }
.eb-status {
  margin-left: auto; padding: 0 8px; height: 24px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-3);
  font-size: var(--fs-11); font-weight: 500; white-space: nowrap;
}
.eb-status[data-state="dirty"] { background: var(--warning-subtle); color: var(--warning); }
.eb-status[data-state="saving"] { background: var(--accent-subtle); color: var(--accent-text); }
.eb-status[data-state="saved"] { background: var(--success-subtle); color: var(--success); }

body.editing .report-scroll { background: var(--bg-app); }
body.editing .paper { box-shadow: var(--sh-2); }
[contenteditable="true"]:focus { outline: none; }
body.editing .item-text:hover,
body.editing .dg-p:hover,
body.editing .dg-judge .jb:hover,
body.editing figcaption:hover { background: var(--accent-subtle); border-radius: var(--r-4); }

/* 사람이 고친 자리는 표시를 남긴다. 근거는 원본 그대로이므로 둘이 어긋날 수 있다. */
.edited-mark {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 5px;
  font-size: var(--fs-11); font-weight: 700;
  color: var(--warning);
  background: var(--warning-subtle);
  border: 1px solid var(--warning-border);
  border-radius: 99px;
  padding: 1px 7px;
  white-space: nowrap;
}
.edited-mark svg { width: 10px; height: 10px; }
.item.edited > .item-text { border-left: 2px solid var(--warning); padding-left: 9px; }
.dg-p.edited, .dg-judge .jb.edited, figcaption.edited { border-left: 2px solid var(--warning); padding-left: 9px; }

.sel-fab {
  position: fixed; z-index: 70;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 99px;
  background: var(--accent); color: #fff;
  border: 0;
  font-size: var(--fs-12); font-weight: 600;
  box-shadow: var(--sh-3);
}
.sel-fab svg { width: 13px; height: 13px; }

.fig-bar {
  position: fixed; z-index: 69;
  display: flex; align-items: center; gap: 3px;
  padding: 5px 7px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  box-shadow: var(--sh-3);
}
.fig-bar .eb-btn.wide { width: auto; padding: 0 9px; font-size: var(--fs-12); }
.fig-bar .eb-btn.danger:hover { background: #fdeaea; color: #c22b2b; }
.fig-bar .eb-select { max-width: 132px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90;
  max-width: 520px;
  padding: 10px 16px;
  border-radius: var(--r-8);
  background: #18181b; color: #fff;
  font-size: var(--fs-12); line-height: 1.55;
  box-shadow: var(--sh-3);
}
.toast[hidden] { display: none; }

/* ── 우측: 근거 · 해설 ─────────────────────────────────── */

.side { background: var(--bg-panel); border-left: 1px solid var(--border-1); display: flex; flex-direction: column; overflow: hidden; }

.side-tabs { display: flex; gap: 2px; padding: 9px 12px 0; border-bottom: 1px solid var(--border-1); }
.tab {
  padding: 7px 13px;
  font-size: var(--fs-13);
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--text-1); font-weight: 600; border-bottom-color: var(--accent); }
.tab .cnt { font-size: var(--fs-11); color: var(--text-3); background: var(--bg-subtle); border-radius: 99px; padding: 0 5px; }
.side-tabs .spacer { flex: 1; }
.side-tabs .close { font-size: var(--fs-12); color: var(--text-3); padding: 6px 4px; }
.side-tabs .close:hover { color: var(--text-1); }

.side-body { flex: 1; overflow-y: auto; }

.side-empty { height: 100%; display: grid; place-items: center; padding: 30px; text-align: center; }
.side-empty .in { max-width: 260px; }
.side-empty .ic { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--border-3); }
.side-empty .ic svg { width: 34px; height: 34px; }
.side-empty h3 { font-size: var(--fs-13); font-weight: 700; margin-bottom: 5px; }
.side-empty p { font-size: var(--fs-12); color: var(--text-3); line-height: 1.66; }

.ev-head { padding: 13px 16px 10px; border-bottom: 1px solid var(--border-1); }
.ev-for { font-size: var(--fs-11); color: var(--text-3); }
.ev-title { font-size: var(--fs-14); font-weight: 700; margin-top: 2px; line-height: 1.5; }

.ev-one { padding: 14px 16px 18px; border-bottom: 1px solid var(--border-1); }
.ev-page { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.ev-page .p { font-size: var(--fs-12); font-weight: 700; }
.ev-page .k { font-size: var(--fs-11); color: var(--text-3); }
.ev-page .spacer { flex: 1; }
.ev-page .zoom { font-size: var(--fs-11); color: var(--accent-text); font-weight: 600; }

.cap {
  position: relative;
  border-radius: var(--r-8);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: #000;
  cursor: zoom-in;
  box-shadow: var(--sh-1);
}
.cap img { width: 100%; display: block; }
.cap .box {
  position: absolute;
  border: 2px solid #ffd23f;
  border-radius: 3px;
  box-shadow: 0 0 0 9999px rgba(10, 10, 20, 0.46);
  pointer-events: none;
  animation: pulse 1.6s ease-out 1;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 9999px rgba(10,10,20,0.46), 0 0 0 0 rgba(255,210,63,0.75); }
  100% { box-shadow: 0 0 0 9999px rgba(10,10,20,0.46), 0 0 0 14px rgba(255,210,63,0); }
}
.cap .full {
  position: absolute; inset: 0;
  border: 2px dashed rgba(255,210,63,0.9);
  border-radius: var(--r-8);
  pointer-events: none;
}

.quote {
  margin-top: 10px;
  border-left: 2px solid var(--accent-border);
  padding: 3px 0 3px 10px;
  font-size: var(--fs-12);
  color: var(--text-2);
  line-height: 1.66;
}
.quote b { color: var(--text-1); font-weight: 600; }
.ev-note { margin-top: 8px; font-size: var(--fs-11); color: var(--text-3); line-height: 1.6; }
.ev-note .ok { color: var(--success); font-weight: 600; }
.ev-note .no { color: var(--danger); font-weight: 600; }

/* 해설 */
.ex-wrap { padding: 14px 16px 26px; }
.ex-block { border-top: 1px solid var(--border-1); padding: 13px 0; }
.ex-block:first-child { border-top: none; padding-top: 2px; }
.ex-h { display: flex; align-items: center; gap: 6px; font-size: var(--fs-11); font-weight: 700; color: var(--accent-text); letter-spacing: 0.03em; margin-bottom: 6px; }
.ex-h .bar { width: 3px; height: 11px; border-radius: 99px; background: var(--accent); }
.ex-block p { font-size: var(--fs-13); line-height: 1.75; color: var(--text-1); }
.ex-block p + p { margin-top: 7px; }
.ex-block .dl { display: flex; flex-direction: column; gap: 7px; margin-top: 3px; }
.ex-block .dl div { font-size: var(--fs-13); line-height: 1.68; }
.ex-block .dl b { font-weight: 700; }
.ex-foot {
  margin-top: 14px;
  border-top: 1px solid var(--border-1);
  padding-top: 11px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.ex-foot .pack { font-size: var(--fs-11); color: var(--text-3); flex: 1; line-height: 1.5; }
.ex-foot .pack b { color: var(--text-2); font-weight: 600; }
.warnline {
  margin: 12px 16px 0;
  border: 1px solid var(--warning-border);
  background: var(--warning-subtle);
  border-radius: var(--r-8);
  padding: 9px 11px;
  font-size: var(--fs-11);
  color: var(--warning);
  line-height: 1.6;
}

/* 라이트박스 */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(14, 14, 22, 0.86);
  display: grid; place-items: center;
  padding: 34px;
  z-index: 60;
  cursor: zoom-out;
}
.lightbox .frame { position: relative; max-width: 1200px; width: 100%; }
.lightbox img { width: 100%; border-radius: var(--r-8); display: block; }
.lightbox .box { position: absolute; border: 2px solid #ffd23f; border-radius: 3px; box-shadow: 0 0 0 9999px rgba(10,10,20,0.5); }
.lightbox .cap-label { color: #e8e8ef; font-size: var(--fs-12); margin-top: 10px; text-align: center; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d6de; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c0c0cb; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════════════════════
   목업에 없던 화면 — 업로드 · 목록 · 진행률 · 설정.
   토큰과 골격은 위의 것을 그대로 쓴다.
   ══════════════════════════════════════════════════════════ */

.toc-hint { padding: 12px 14px; font-size: 12px; line-height: 1.7; color: var(--text-3); }
.empty-note { margin: 40px 0; padding: 22px 24px; border: 1px dashed var(--border-2);
  border-radius: 12px; color: var(--text-3); font-size: 13.5px; line-height: 1.8; background: var(--bg-subtle); }
.empty-note b { color: var(--text-1); }
.dim { color: var(--text-3); }
.dim.err { color: #b02525; }

/* 업로드 */
.drop { margin: 22px 0 26px; border: 2px dashed var(--border-2); border-radius: 16px;
  background: var(--bg-subtle); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: #f2f8f4; }
.drop-in { padding: 46px 24px; text-align: center; }
.drop-in .ic svg { width: 34px; height: 34px; stroke: var(--accent); fill: none; }
.drop-in .t { margin-top: 12px; font-size: 15px; font-weight: 600; display: flex;
  gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.drop-in .d { margin-top: 7px; font-size: 12.5px; color: var(--text-3); }

.stage-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stage-strip .st { font-size: 11.5px; font-weight: 700; color: var(--text-3);
  border: 1px solid var(--border-2); border-radius: 99px; padding: 3px 9px; background: #fff; }
.stage-strip .st i { font-style: normal; font-weight: 500; margin-left: 5px; }

/* 목록 */
.tbl.list td { vertical-align: top; }
.tbl.list tr.cur { background: #f2f8f4; }
.lnk { background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  font-weight: 700; cursor: pointer; text-align: left; }
.lnk:hover { text-decoration: underline; }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }

/* 진행률 */
.prog-head { font-size: 13.5px; margin-bottom: 8px; }
.prog-bar { height: 8px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; border: 1px solid var(--border-2); }
.prog-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.stage-list { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 2px; }
.stage-row { display: grid; grid-template-columns: 18px 38px 118px 1fr; gap: 8px;
  align-items: center; font-size: 12.5px; color: var(--text-3); padding: 3px 6px; border-radius: 6px; }
.stage-row .ic svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; }
.stage-row .id { font-weight: 800; font-variant-numeric: tabular-nums; }
.stage-row.done { color: var(--text-1); }
.stage-row.cur { background: #f2f8f4; color: var(--text-1); font-weight: 700; }
.prog-log { margin-top: 14px; max-height: 190px; overflow: auto; background: #0f172a;
  color: #cfe3d8; border-radius: 8px; padding: 11px 13px; font-size: 11.5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; line-height: 1.65; }

/* 지표 격자 — 종합소견과 진행률이 함께 쓴다 */
.metric-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 8px; }
.metric { border: 1px solid var(--border-2); border-radius: 9px; padding: 9px 11px; background: #fff; }
.metric .mk { font-size: 11.5px; color: var(--text-3); }
.metric .mv { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 1px 0 2px; }
.metric .md { font-size: 11px; color: var(--text-3); line-height: 1.55; }

/* 설정 */
.eb-input { border: 1px solid var(--border-2); border-radius: 7px; padding: 5px 9px;
  font: inherit; font-size: 12.5px; background: #fff; color: var(--text-1); min-width: 92px; }
.eb-input.wide, .eb-select.wide { width: 100%; max-width: 420px; }
.kv-row .k i { display: block; font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 400; margin-top: 1px; }
.kv-row .v code { font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: var(--bg-subtle); padding: 2px 6px; border-radius: 5px; }
.sw { display: inline-flex; align-items: center; cursor: pointer; }
.sw input { display: none; }
.sw span { width: 38px; height: 21px; border-radius: 99px; background: #d4d4d8; position: relative; transition: background .15s; }
.sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::after { transform: translateX(17px); }
.test-out { margin-top: 12px; }
.ok-note { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: #1d6b3f;
  background: #eaf5ee; border: 1px solid #bfe0cc; border-radius: 8px; padding: 8px 11px; }
.ok-note svg { width: 14px; height: 14px; stroke: #1d6b3f; fill: none; }

/* 재구성 항목의 표 접지 표시 */
.item-table { margin-top: 4px; font-size: 11.5px; color: var(--text-3);
  background: var(--bg-subtle); border-radius: 6px; padding: 4px 8px; display: inline-block; }
