/* PBC 트래커 사용설명서(/tools/pbc-tracker/guide) 전용. 모든 규칙은 .pg-body/.pg 아래로만 건다.
   상품 소개(page.css)와 같은 얼굴 — 장부 초록, 서류철(마닐라), 인주, 감사인 틱마크. */

.pg-body {
  background: #f4f6f1;
}

.pg {
  --pg-paper: #f4f6f1;
  --pg-ink: #142019;
  --pg-ink-2: #2b3a32;
  --pg-muted: #56645c;
  --pg-line: #dde3da;
  --pg-line-2: #c7d0c3;
  --pg-brand: #1b5640;
  --pg-brand-deep: #10372a;
  --pg-brand-soft: #e2eee6;
  --pg-manila: #efe2bd;
  --pg-manila-soft: #f8f1dc;
  --pg-manila-deep: #b8954a;
  --pg-seal: #c0392b;
  --pg-client: #2a5ea8;
  --pg-client-soft: #e4ecf8;
  --pg-warn: #9a5b0b;
  --pg-display: "Hahmlet", "Noto Serif KR", "Batang", serif;
  --pg-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pg-top: 0px;

  max-width: 1160px;
  margin: 0 auto;
  color: var(--pg-ink);
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.pg *,
.pg *::before,
.pg *::after {
  box-sizing: border-box;
}

.pg :where(p) {
  margin: 0;
}

.pg a:focus-visible,
.pg button:focus-visible,
.pg summary:focus-visible {
  outline: 2px solid var(--pg-brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── 머리말 ─────────────────────────────────────────── */
.pg-head {
  padding: 26px 0 8px;
}

.pg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pg-brand);
  font-family: var(--pg-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.pg-eyebrow::before {
  content: "";
  width: 9px;
  height: 15px;
  margin-right: 2px;
  border-right: 2.5px solid var(--pg-seal);
  border-bottom: 2.5px solid var(--pg-seal);
  border-radius: 0 0 2px 0;
  transform: rotate(40deg) translateY(-3px);
}

.pg-head h1 {
  margin: 14px 0 0;
  font-family: var(--pg-display);
  font-size: clamp(1.9rem, 3.3vw, 2.7rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.pg-head h1 em {
  font-style: normal;
  color: var(--pg-brand);
  background: linear-gradient(transparent 64%, var(--pg-manila) 64%, var(--pg-manila) 92%, transparent 92%);
  padding: 0 0.06em;
}

.pg-lead {
  max-width: 44em;
  margin-top: 14px;
  color: var(--pg-ink-2);
  font-size: 1.02rem;
}

.pg-open-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 20px;
}

.pg-open-row span {
  color: var(--pg-muted);
  font-size: 0.86rem;
}

.pg-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  background: var(--pg-brand);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.pg-open:hover {
  background: var(--pg-brand-deep);
}

/* 두 독자를 첫 화면에서 갈라 준다 — 누르면 그 탭이 열린다 */
.pg-who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.pg-who-card {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 20px 22px 18px;
  border-radius: 18px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pg-who-card:hover {
  transform: translateY(-2px);
}

.pg-who-card--audit {
  background:
    linear-gradient(rgba(239, 226, 189, 0.05) 1px, transparent 1px) 0 0 / 100% 24px,
    var(--pg-brand-deep);
  color: #e9f0ea;
  box-shadow: 0 24px 40px -30px rgba(16, 55, 42, 0.8);
}

.pg-who-card--client {
  border: 1px solid var(--pg-line);
  background: #fff;
  color: var(--pg-ink);
  box-shadow: 0 24px 40px -34px rgba(16, 55, 42, 0.5);
}

.pg-who-tag {
  justify-self: start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.pg-who-card--audit .pg-who-tag {
  background: rgba(239, 226, 189, 0.16);
  color: var(--pg-manila);
}

.pg-who-card--client .pg-who-tag {
  background: var(--pg-client-soft);
  color: var(--pg-client);
}

.pg-who-card b {
  margin-top: 4px;
  font-family: var(--pg-display);
  font-size: 1.22rem;
}

.pg-who-card > span:not(.pg-who-tag) {
  font-size: 0.92rem;
  line-height: 1.7;
  opacity: 0.88;
}

.pg-who-card em {
  margin-top: 8px;
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 700;
}

.pg-who-card--audit em {
  color: var(--pg-manila);
}

.pg-who-card--client em {
  color: var(--pg-client);
}

/* 한눈에 보는 순서: 일곱 정거장을 잇는 선 위로 점 하나가 지나간다 */
.pg-route {
  position: relative;
  margin-top: 26px;
  padding: 18px 20px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: #fff;
}

.pg-route-title {
  margin-bottom: 14px;
  color: var(--pg-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.pg-route ol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg-route ol::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 8px;
  height: 2px;
  background: linear-gradient(90deg, var(--pg-brand) 0 38%, var(--pg-client) 42% 68%, var(--pg-brand) 72% 100%);
  opacity: 0.35;
}

.pg-route ol::after {
  content: "";
  position: absolute;
  left: 7%;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pg-seal);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.15);
  opacity: 0;
}

.pg-route.is-play ol::after {
  animation: pg-route-dot 5.6s cubic-bezier(0.5, 0, 0.3, 1) 0.4s 1 both;
}

@keyframes pg-route-dot {
  0% { left: 7%; opacity: 0; }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { left: calc(93% - 12px); opacity: 0; }
}

.pg-route li {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
}

.pg-route a {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-top: 26px;
  color: var(--pg-ink);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.pg-route a::before {
  content: "";
  position: absolute;
  top: 2px;
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--pg-brand);
  border-radius: 50%;
  background: #fff;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.pg-route li.is-client a::before {
  border-color: var(--pg-client);
}

.pg-route a:hover::before {
  background: var(--pg-brand);
  transform: scale(1.2);
}

.pg-route li.is-client a:hover::before {
  background: var(--pg-client);
}

.pg-route.is-play li a::before {
  animation: pg-route-stop 0.6s ease both;
  animation-delay: calc(0.5s + var(--i, 0) * 0.78s);
}

@keyframes pg-route-stop {
  50% { background: var(--pg-manila); transform: scale(1.35); }
}

.pg-route-who {
  color: var(--pg-brand);
  font-size: 0.7rem;
  font-weight: 700;
}

.pg-route li.is-client .pg-route-who {
  color: var(--pg-client);
}

.pg-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.85rem;
}

.pg-quick .lbl {
  margin-right: 4px;
  color: var(--pg-muted);
  font-weight: 700;
}

.pg-quick a {
  padding: 4px 12px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--pg-ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pg-quick a:hover {
  border-color: var(--pg-brand);
  color: var(--pg-brand);
}

/* ── 탭: 서류철 색인 ────────────────────────────────── */
.pg-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  margin: 34px 0 0;
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pg-tabs::-webkit-scrollbar {
  display: none;
}

.pg-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 11px 18px 10px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--pg-manila);
  color: #5d4a1b;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pg-tab:hover {
  background: #f3e8c9;
}

.pg-tab[aria-selected="true"] {
  border-color: var(--pg-line);
  background: #fff;
  color: var(--pg-brand);
}

.pg-tab .n {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(93, 74, 27, 0.14);
  font-family: var(--pg-mono);
  font-size: 0.74rem;
  font-weight: 500;
}

.pg-tab[aria-selected="true"] .n {
  background: var(--pg-brand);
  color: #fff;
}

/* ── 본문: 흰 종이 한 장 + 왼쪽 차례 ───────────────────── */
.pg-panel {
  display: none;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  padding: 34px 40px 52px;
  border: 1px solid var(--pg-line);
  border-radius: 0 20px 20px 20px;
  background: #fff;
  box-shadow: 0 30px 60px -50px rgba(16, 55, 42, 0.5);
}

.pg-panel.on {
  display: grid;
}

.pg-toc {
  position: sticky;
  top: calc(var(--pg-top) + 20px);
  align-self: start;
  max-height: calc(100vh - var(--pg-top) - 40px);
  overflow: auto;
  font-size: 0.88rem;
}

.pg-toc > p {
  margin-bottom: 10px;
  color: var(--pg-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pg-toc ol {
  counter-reset: toc;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--pg-line);
  list-style: none;
}

.pg-toc li {
  counter-increment: toc;
}

.pg-toc a {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  margin-left: -2px;
  padding: 7px 8px 7px 12px;
  border-left: 2px solid transparent;
  color: var(--pg-muted);
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.pg-toc a::before {
  content: counter(toc);
  font-family: var(--pg-mono);
  font-size: 0.76rem;
}

.pg-toc a:hover {
  color: var(--pg-ink);
}

.pg-toc a.is-current {
  border-left-color: var(--pg-brand);
  background: var(--pg-brand-soft);
  color: var(--pg-brand);
  font-weight: 700;
}

.pg-col {
  min-width: 0;
  max-width: 820px;
}

.pg-panel section {
  padding-bottom: 12px;
  scroll-margin-top: calc(var(--pg-top) + 18px);
}

.pg-panel section + section {
  margin-top: 30px;
  padding-top: 34px;
  border-top: 1px solid var(--pg-line);
}

.pg-panel h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--pg-display);
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.pg-panel h2 .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--pg-brand);
  color: #fff;
  font-family: var(--pg-mono);
  font-size: 0.86rem;
  font-weight: 500;
}

.pg-col h3 {
  margin: 22px 0 8px;
  font-size: 1.04rem;
}

.pg-col p {
  margin: 10px 0;
}

.pg-col ul,
.pg-col ol {
  margin: 10px 0;
}

.pg-col a {
  color: var(--pg-brand);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* 화면 속 단추·메뉴 이름: 실제 단추처럼 보이게 */
.pg-col code {
  display: inline-block;
  margin: 0 1px;
  padding: 0 8px;
  border: 1px solid var(--pg-line-2);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #fff;
  color: var(--pg-ink);
  font-family: inherit;
  font-size: 0.86em;
  font-weight: 700;
  line-height: 1.75;
  white-space: nowrap;
}

/* 단계: 번호 정거장을 세로선으로 잇는다 */
.pg-steps {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: pgs;
}

.pg-steps::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--pg-brand-soft);
}

.pg-steps li {
  position: relative;
  padding: 6px 0 6px 44px;
  counter-increment: pgs;
}

.pg-steps li::before {
  content: counter(pgs);
  position: absolute;
  left: 0;
  top: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--pg-brand);
  border-radius: 50%;
  background: #fff;
  color: var(--pg-brand);
  font-family: var(--pg-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.pg-checks {
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.pg-checks li {
  position: relative;
  padding-left: 28px;
}

.pg-checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--pg-line-2);
  border-radius: 4px;
}

.pg-checks li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.32em;
  width: 5px;
  height: 11px;
  border-right: 2px solid var(--pg-seal);
  border-bottom: 2px solid var(--pg-seal);
  transform: rotate(40deg);
}

/* 실제 화면 장면 */
.pg-panel .pt-player {
  margin: 20px 0 24px;
}

/* 알림 상자 */
.pg-note,
.pg-warn {
  margin: 14px 0;
  padding: 13px 16px;
  border-radius: 0 12px 12px 0;
  font-size: 0.94rem;
}

.pg-note {
  border-left: 3px solid var(--pg-brand);
  background: var(--pg-brand-soft);
}

.pg-warn {
  border-left: 3px solid var(--pg-manila-deep);
  background: var(--pg-manila-soft);
}

.pg-warn::before {
  content: "주의";
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--pg-manila-deep);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  vertical-align: 1px;
}

.pg-sub {
  color: var(--pg-muted);
  font-size: 0.9em;
}

/* 표 — 사이트 전역 table{min-width}가 상자를 밀어내므로 여기서 푼다 */
.pg-tw {
  margin: 14px 0;
  overflow-x: auto;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
}

.pg table {
  min-width: 0;
}

.pg-t {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.pg-t th,
.pg-t td {
  padding: 10px 14px;
  border-top: 1px solid var(--pg-line);
  text-align: left;
  vertical-align: top;
}

.pg-t thead th {
  border-top: 0;
  background: var(--pg-manila-soft);
  color: #5d4a1b;
  font-size: 0.82rem;
  white-space: nowrap;
}

.pg-t tbody th {
  background: #fafbf9;
  white-space: nowrap;
}

.pg-t td + td,
.pg-t th + td,
.pg-t th + th {
  border-left: 1px solid var(--pg-line);
}

.pg-t td code {
  white-space: nowrap;
}

/* 상태가 움직이는 길 */
.pg-states {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f6f8f5;
}

.pg-states > i {
  width: 22px;
  height: 2px;
  background: var(--pg-line-2);
}

.pg-st-fork {
  display: inline-grid;
  gap: 6px;
  padding-left: 30px;
  background:
    linear-gradient(var(--pg-line-2), var(--pg-line-2)) 0 50% / 14px 2px no-repeat,
    linear-gradient(var(--pg-line-2), var(--pg-line-2)) 14px 25% / 2px 50% no-repeat,
    linear-gradient(var(--pg-line-2), var(--pg-line-2)) 14px 25% / 14px 2px no-repeat,
    linear-gradient(var(--pg-line-2), var(--pg-line-2)) 14px 75% / 14px 2px no-repeat;
}

.pg-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pg-st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pg-st small {
  color: var(--pg-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pg-st[data-s="draft"] { background: #fff; color: var(--pg-muted); box-shadow: inset 0 0 0 1.5px var(--pg-line-2); }
.pg-st[data-s="requested"] { background: #eef1ee; color: #5d6a63; }
.pg-st[data-s="uploaded"] { background: var(--pg-client-soft); color: var(--pg-client); }
.pg-st[data-s="approved"] { background: #e0f1e7; color: #1f7a4d; }
.pg-st[data-s="rejected"] { background: #fdebe1; color: #a93509; }

.pg-st.is-now {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor;
}

/* FAQ */
.pg-faq {
  margin: 8px 0;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: #fff;
}

.pg-faq summary {
  position: relative;
  padding: 12px 44px 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.pg-faq summary::-webkit-details-marker {
  display: none;
}

.pg-faq summary::before,
.pg-faq summary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 12px;
  height: 2px;
  background: var(--pg-brand);
  transition: transform 0.25s ease;
}

.pg-faq summary::after {
  transform: rotate(90deg);
}

.pg-faq[open] summary::after {
  transform: rotate(0deg);
}

.pg-faq .bd {
  padding: 0 16px 14px;
  color: var(--pg-ink-2);
  font-size: 0.93rem;
}

/* ── 좁은 화면 ──────────────────────────────────────── */
@media (max-width: 980px) {
  .pg-panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 26px 22px 40px;
  }

  .pg-toc {
    display: none;
  }

  .pg-route ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 14px;
  }

  .pg-route ol::before,
  .pg-route ol::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .pg-who {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-tab {
    padding: 10px 13px 9px;
    font-size: 0.9rem;
  }

  .pg-tabs {
    padding: 0 4px;
  }

  .pg-panel {
    padding: 22px 16px 34px;
    border-radius: 0 14px 14px 14px;
  }

  .pg-panel h2 {
    font-size: 1.24rem;
  }

  .pg-route {
    padding: 16px 12px 14px;
  }

  .pg-route ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pg-route a {
    font-size: 0.78rem;
  }
}

/* 아주 좁은 화면: 탭 셋이 한 줄에 다 들어오게 나눠 갖고, 긴 이름은 두 줄로(옆으로 숨지 않게). */
@media (max-width: 520px) {
  .pg-tabs {
    gap: 4px;
    padding: 0;
    overflow: visible;
  }

  .pg-tab {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
    padding: 9px 8px 8px;
    font-size: 0.84rem;
    line-height: 1.25;
    white-space: normal;
    word-break: keep-all;
  }

  .pg-tab .n {
    flex: none;
    width: 19px;
    height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg *,
  .pg *::before,
  .pg *::after {
    animation: none !important;
    transition: none !important;
  }
}
