/**
 * @file docs/css/data.css
 * @description 자료 탭(흐름 트리 · 서류 · 확인 질문)과 자세히 보기 창의 모양. 지도 탭은 geo.css.
 *   색은 tokens.css 의 역할 토큰만 쓰고, 갈래 색은 pages.js 가 --br 로 넘겨 준다(팔레트 역할 색).
 */

/* ---------- 공통 조각 ---------- */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
th .chips { display: flex; margin-top: 5px; }
.tag.step { text-decoration: none; color: var(--fg); }
.tag.step:hover { background: var(--active); }
.tag.step b { font-size: 0.72rem; color: var(--muted); }
.tag.alert { border-color: var(--alert); color: var(--alert); background: transparent; }
.cl.plain { font: 600 0.88rem/1.5 var(--font-body); }
.f-input {
  min-width: 0; width: min(320px, 100%); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 0.86rem;
}

/* ---------- 자세히 보기 창 ---------- */
.ad-dialog {
  width: min(780px, 94vw); max-height: 86vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--fg); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28); overflow: hidden;
}
.ad-dialog[open] { display: flex; flex-direction: column; }
.ad-dialog::backdrop { background: var(--scrim); }
.ad-dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 14px 12px 20px; border-bottom: 1px solid var(--line); flex: none; }
.ad-dlg-head h2 { margin: 2px 0 0; font-size: 1.08rem; line-height: 1.4; }
.ad-dlg-body { padding: 14px 20px 20px; overflow: auto; }
.ad-dlg-body h3 { font-size: 0.9rem; margin: 18px 0 6px; }
.ad-meta { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 0.9rem; }
.ad-meta dt { font-weight: 700; font-size: 0.8rem; color: var(--muted); padding-top: 2px; }
.ad-meta dd { margin: 0; min-width: 0; }
.ad-look { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.ad-look li { margin: 3px 0; }
.ad-look mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px; }
:root:is([data-skin="dark"], [data-skin="navy"]) .ad-look mark { background: #6b5a16; }

/* ---------- 흐름 트리 ---------- */
.tr-legend { display: grid; gap: 6px; }
.tr-leg { display: grid; grid-template-columns: 22px 48px 92px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 0.88rem; }
.tr-sw { display: inline-block; width: 22px; height: 5px; border-radius: 3px; }
.tr-list { border-top: 1px solid var(--line); }
.tr-row { position: relative; padding: 8px 4px 9px 82px; min-height: 42px; border-bottom: 1px dashed var(--line); }
.tr-row.is-miss { background: color-mix(in srgb, var(--alert) 6%, transparent); }
.tr-svg { position: absolute; left: 0; top: 0; width: 74px; height: 100%; overflow: visible; }
.tr-svg line, .tr-svg path { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.tr-dot { fill: var(--br); stroke: var(--surface); stroke-width: 2; }
.tr-dot.merge { stroke-width: 2.6; }
.tr-dot.guess { fill: var(--surface); stroke: var(--br); stroke-dasharray: 2.5 2; stroke-width: 2; }
.tr-dot.miss { stroke: var(--alert); stroke-width: 2.8; }
.tr-l1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tr-id { font-size: 0.74rem; color: var(--muted); }
.tr-date { font-size: 0.8rem; font-weight: 700; }
.tr-br { font-size: 0.74rem; font-weight: 700; }
.tr-msg { font-size: 0.92rem; }
.tr-l2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 5px; }
.tr-note { font-size: 0.8rem; color: var(--muted); flex-basis: 100%; }
table.t tr.is-late td { background: color-mix(in srgb, var(--alert) 7%, transparent); }

/* ---------- 서류 ---------- */
table.t.tm { font-size: 0.8rem; }
table.t.tm th[scope="row"] { min-width: 190px; background: var(--surface); font-size: 0.84rem; }
table.t.tm td { min-width: 104px; }
table.t.tm td.tm-empty { background: color-mix(in srgb, var(--sunken) 45%, transparent); }
table.t.tm tr.is-miss th, table.t.tm tr.is-miss td { border-bottom-style: dashed; color: var(--muted); }
.tm-sym { font-weight: 800; color: var(--fg); }
.cat-group { margin: 6px 0 14px; }
.cat-head { display: flex; align-items: center; gap: 4px; padding: 6px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.cat-row {
  display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto 52px; gap: 10px; align-items: baseline; width: 100%;
  border: 0; background: transparent; color: var(--fg); text-align: left; padding: 6px 8px; border-radius: var(--r-md); cursor: pointer; font: inherit;
}
.cat-row:hover { background: var(--active); }
.cat-g { text-align: center; font-weight: 700; }
.cat-id { font-size: 0.78rem; color: var(--muted); }
.cat-t { font-size: 0.9rem; }
.cat-d { font-size: 0.76rem; white-space: nowrap; }
.cat-io { font-size: 0.74rem; justify-self: end; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 7px; white-space: nowrap; }
pre.folder-tree { margin: 0; padding: 12px 14px; font: 0.8rem/1.6 var(--font-mono); background: var(--sunken); border-radius: var(--r-md); overflow: auto; }

/* ---------- 확인 질문 ---------- */
.q-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.q-bar h2 { font-size: 1.12rem; }
.q-group { margin: 14px 0 6px; }
.q-item { padding: 9px 0 10px; border-bottom: 1px dashed var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-text { font-size: 0.93rem; }
.q-no { color: var(--muted); font-size: 0.78rem; margin-right: 8px; }
.q-answer {
  display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 10px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 0.9rem; resize: vertical;
}
.q-answer:focus { outline: 2px solid var(--fg); outline-offset: 1px; }

@media (max-width: 560px) {
  .cat-row { grid-template-columns: 22px 40px minmax(0, 1fr); }
  .cat-d, .cat-io { display: none; }
  .tr-leg { grid-template-columns: 22px 44px minmax(0, 1fr); }
  .tr-leg > .muted { grid-column: 3; }
  .ad-meta { grid-template-columns: 64px minmax(0, 1fr); }
}
@media print {
  .q-answer { border: 0; padding: 0; }
}
.ico-wrap { display: inline-flex; align-items: center; }
