/* 업무 프로세스(jiju-process). 순서도는 process.js 가 Mermaid 로 그린다.
   화면 규칙: 흰 카드 한 겹, 카드 안은 소제목·간격으로 나눔(바탕·테두리 상자 없음), 회색 위주, 생 파랑 금지. */
.pf .head { margin-bottom: 14px; }
.pf .head p { max-width: 860px; margin-top: 8px; font-size: 15px; line-height: 1.7; }
.pf .head .pf-how { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* 주제 탭(한 번에 하나). 고른 탭은 진한 글자 + 밑줄, 나머지는 회색 글자. 좁은 화면은 가로 스크롤 */
.pf-tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pf-tabs a:hover { color: var(--text); }
.pf-tabs a[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.pf-tabs a:focus-visible, .pf-subtabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
/* 주제 안 작은 탭: 텍스트 링크 */
.pf-subtabs { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 18px; font-size: 14px; }
.pf-subtabs a { display: inline-flex; align-items: center; min-height: 34px; color: var(--muted); }
.pf-subtabs a:hover { color: var(--text); }
.pf-subtabs a[aria-selected="true"] { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.pf-js .pf-part > h3.pf-sub:first-child { display: none; }
/* 탭 아래 이동 줄 */
.pf-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 28px; font-size: 14px; color: var(--body); }
.pf-pager .pf-pn { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.pf-pager a { display: inline-flex; align-items: center; min-height: 32px; }
.pf-pager a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.pf-card { margin-top: 20px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; scroll-margin-top: 84px; }
.pf-title h2 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.pf-title p { max-width: 880px; margin-top: 8px; font-size: 15px; line-height: 1.75; color: #33373e; }
.pf-sub { margin-top: 28px; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.pf-note { margin-top: 6px; font-size: 13.5px; line-height: 1.65; color: var(--body); }

/* 기호 설명: 넓은 화면은 늘 펼침(요약 줄 숨김), 좁은 화면은 접힘 */
.pf-key > summary { display: none; }
.pf-key-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.pf-more { display: none; }
/* 도형 읽는 법 */
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 13px; color: var(--body); }
.pf-legend li { display: inline-flex; align-items: center; gap: 7px; }
.pf-legend i { display: inline-block; width: 22px; height: 14px; border: 1px solid #b4b9c1; background: #fff; }
.pf-legend .lg-start { border-radius: 999px; background: #1e1e23; border-color: #1e1e23; }
.pf-legend .lg-step { border-radius: 3px; }
.pf-legend .lg-q { width: 14px; height: 14px; margin: 0 4px; transform: rotate(45deg); background: #f1f2f4; border-color: #8a8f98; }
.pf-legend .lg-due { border: 1.5px dashed #30343b; clip-path: polygon(22% 0, 78% 0, 100% 50%, 78% 100%, 22% 100%, 0 50%); background: #f8f9fa; }
.pf-legend .lg-warn { border: 2.5px solid #1e1e23; border-radius: 3px; }
.pf-legend .lg-act { border-radius: 3px; background: #dcdfe3; border-color: #686d76; }
.pf-legend .lg-ro { border-radius: 3px; background: #16171b; border-color: #16171b; }
.pf-legend .lg-roq { width: 14px; height: 14px; margin: 0 4px; transform: rotate(45deg); background: #16171b; border-color: #16171b; }
.pf-legend .lg-start { background: #f1f2f4; border: 2px solid #1e1e23; }
/* 순서도 안 로율 표식 */
.ro-tag { display: inline-block; margin: 0 6px 2px 0; padding: 0 6px; border: 1px solid #fff; border-radius: 3px; font-size: 11px; font-weight: 700; line-height: 17px; letter-spacing: .02em; vertical-align: middle; }
.pf-legend .lg-doc { transform: skewX(-16deg); background: #f8f9fa; border-color: #c9cdd2; }
.pf-legend .lg-ref { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 26% 50%); border-color: #c9cdd2; background: #e9ebee; }

/* 도구 줄 + 그림 */
.pf-tool { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pf-hint { font-size: 12.5px; color: var(--muted); }
.pf-zoom { flex: none; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 700 13px Pretendard, sans-serif; color: var(--text); cursor: pointer; }
.pf-zoom:hover { border-color: var(--accent-line); }
.pf-zoom:disabled { opacity: .5; cursor: default; }
.pf-canvas { position: relative; margin-top: 10px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; text-align: center; }
.pf-canvas svg { display: inline-block; height: auto; vertical-align: top; }
.pf-canvas svg a { cursor: pointer; }
.pf-canvas svg a:hover .label-container, .pf-canvas svg a:hover rect, .pf-canvas svg a:hover polygon { stroke: #1e1e23 !important; }
.pf-wait { padding: 40px 0; font-size: 14px; color: var(--muted); }
.pf-fail { padding: 24px 0; font-size: 14px; color: var(--body); }

/* 필요 서류 / 기한 */
.pf-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 32px; }
.pf-meta h3 { font-size: 15px; font-weight: 700; }
.pf-meta ul { margin-top: 8px; }
.pf-meta li, .pf-text li { position: relative; padding-left: 14px; font-size: 14px; line-height: 1.7; color: #33373e; }
.pf-meta li + li { margin-top: 4px; }
.pf-meta li::before, .pf-text ul li::before { content: ""; position: absolute; left: 2px; top: .75em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.pf-meta a, .pf-text a, .pf-foot a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }

/* 글로 보기 */
.pf-text { margin-top: 26px; }
.pf-text summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 14px; font-weight: 700; color: var(--body); cursor: pointer; list-style: none; }
.pf-text summary::-webkit-details-marker { display: none; }
.pf-text summary::after { content: "+"; font-weight: 400; color: var(--muted); }
.pf-text[open] summary::after { content: "−"; }
.pf-text > ol { counter-reset: pf; margin-top: 8px; }
.pf-text > ol > li { counter-increment: pf; padding-left: 28px; }
.pf-text > ol > li + li { margin-top: 8px; }
.pf-text > ol > li::before { content: counter(pf); position: absolute; left: 0; top: 0; width: 20px; font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.pf-text ul { margin-top: 4px; }
.pf-text ul li { font-size: 13.5px; }

/* 기한 표 */
.pf-table-wrap { margin-top: 16px; overflow-x: auto; }
.pf-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.pf-table th, .pf-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.6; }
.pf-table thead th { font-size: 12.5px; color: var(--muted); border-bottom-color: var(--accent-line); }
.pf-table tbody th { width: 24%; font-weight: 700; }
.pf-table td:last-child { width: 26%; font-size: 13px; color: var(--body); }
.pf-foot { margin-top: 22px; font-size: 13px; }

/* 크게 보기 */
.pf-modal { width: min(1400px, calc(100vw - 32px)); height: calc(100vh - 32px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--text); overflow: hidden; }
.pf-modal[open] { display: flex; flex-direction: column; }
.pf-modal::backdrop { background: rgba(20, 22, 26, .5); }
.pf-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.pf-modal-bar b { min-width: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.pf-modal-btns { display: flex; flex: none; gap: 6px; }
.pf-modal-btns button { min-width: 38px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 700 14px Pretendard, sans-serif; color: var(--text); cursor: pointer; }
.pf-modal-btns .pf-close { background: var(--accent); border-color: var(--accent); color: #fff; }
.pf-stage { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; outline: 0; }
.pf-stage.dragging { cursor: grabbing; }
.pf-stage > svg { transform-origin: 0 0; }
.pf-modal-hint { padding: 8px 20px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  /* 첫 화면에 탭과 순서도 첫 칸이 보이게: 소개문 두 줄 + 더 보기, 읽는 법·범례 접기, 안내 문구 숨김, 탭 줄 고정 */
  .pf .head { margin-bottom: 8px; }
  .pf .head .pf-how { display: none; }
  .pf-intro.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pf-more { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; font: 700 13.5px Pretendard, sans-serif; color: var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .pf-tabs { position: sticky; top: var(--pf-top, 64px); z-index: 6; background: #fff; }
  .pf-title p { font-size: 14px; line-height: 1.65; }
  .pf-key { margin-top: 10px; }
  .pf-key > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13.5px; font-weight: 700; color: var(--body); cursor: pointer; list-style: none; }
  .pf-key > summary::-webkit-details-marker { display: none; }
  .pf-key > summary::after { content: "+"; font-weight: 400; color: var(--muted); }
  .pf-key[open] > summary::after { content: "−"; }
  .pf-hint { display: none; }
  .pf-tool { justify-content: flex-end; margin-top: 10px; }
  .pf-sub, .pf-subtabs { margin-top: 12px; }
}
@media (max-width: 760px) {
  .pf-card { padding: 20px 16px; border-radius: 16px; }
  .pf-tabs { margin-left: -16px; margin-right: -16px; padding: 0 8px; }
  .pf-tabs a { padding: 0 10px; font-size: 14px; }
  .pf-pager { font-size: 13.5px; }
  .pf-title h2 { font-size: 19px; }
  .pf-meta { grid-template-columns: 1fr; gap: 20px; }
  .pf-canvas { max-height: 72vh; margin-left: -16px; margin-right: -16px; padding: 0 16px; overflow: auto; text-align: left; }
  .pf-modal { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .pf-modal-bar { padding: 10px 10px 10px 14px; }
  .pf-modal-btns button { min-width: 36px; padding: 0 10px; }
  .pf-table { min-width: 0; }
  .pf-table thead { display: none; }
  .pf-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pf-table tbody th, .pf-table td, .pf-table td:last-child { display: block; width: auto; padding: 0; border: 0; }
  .pf-table td { margin-top: 4px; }
  .pf-table td:last-child { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
}
@media print {
  .pf-tool, .pf-modal { display: none; }
  .pf-canvas { overflow: visible; }
}
.pf-ro-h { margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--body); }
.pf-ro-h + ol { counter-reset: pf; margin-top: 8px; }
.pf-ro-h + ol > li { counter-increment: pf; padding-left: 28px; }
.pf-ro-h + ol > li + li { margin-top: 8px; }
.pf-ro-h + ol > li::before { content: counter(pf); position: absolute; left: 0; top: 0; width: 20px; font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.pf-guide { margin-top: 18px; font-size: 14px; line-height: 1.9; color: var(--body); }
.pf-guide a { margin-right: 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }

/* 순서도 창: 설계 도면 같은 닫힌 칸. 위 막대(제목 · + − 맞춤 크게 보기) + 격자 바탕. 순서도는 이 칸 안에서만 움직인다 */
.pf-js .pf-tool { display: none; }
.pf-canvas.pf-view { margin: 16px 0 0; padding: 0; max-height: none; overflow: hidden; border: 1px solid #dfe2e6; border-radius: 14px; background: #fff; text-align: left; }
.pf-vbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 8px 6px 14px; border-bottom: 1px solid #e6e9ed; background: #fafbfc; }
.pf-vbar b { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 700; color: #30343b; text-overflow: ellipsis; white-space: nowrap; }
.pf-vctl { display: flex; flex: none; gap: 4px; }
.pf-vctl button { height: 30px; min-width: 30px; padding: 0 9px; border: 1px solid #dfe2e6; border-radius: 8px; background: #fff; font: 700 13px Pretendard, sans-serif; color: #1e1e23; cursor: pointer; }
.pf-vctl button:hover { border-color: #8a8f98; }
.pf-vctl .pf-zoom { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; background: #1e1e23; border-color: #1e1e23; color: #fff; }
.pf-grid { background-color: #fff;
  background-image: linear-gradient(#e6e9ed 1px, transparent 1px), linear-gradient(90deg, #e6e9ed 1px, transparent 1px),
    linear-gradient(#f0f2f5 1px, transparent 1px), linear-gradient(90deg, #f0f2f5 1px, transparent 1px); }
.pf-vport { position: relative; height: 640px; overflow: hidden; cursor: grab; touch-action: pan-x pan-y; outline: 0; user-select: none; -webkit-user-select: none; }
.pf-vport.is-active { touch-action: none; }
.pf-vport:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.pf-vport.dragging, .pf-stage.dragging { cursor: grabbing; }
.pf-vport > svg, .pf-stage > svg { position: absolute; left: 0; top: 0; display: block; max-width: none !important; }
.pf-vport .node rect, .pf-vport .node polygon, .pf-vport .node path, .pf-stage .node rect, .pf-stage .node polygon, .pf-stage .node path { filter: drop-shadow(0 1px 1.5px rgba(20, 22, 26, .09)); }
.pf-vmark { position: absolute; left: 12px; bottom: 9px; font-size: 11px; letter-spacing: .02em; color: #9aa0a8; pointer-events: none; }
.pf-vpct { position: absolute; right: 12px; bottom: 9px; font-size: 11px; font-weight: 700; color: #8a8f98; pointer-events: none; font-variant-numeric: tabular-nums; }
.pf-vhint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 24px); overflow: hidden; padding: 4px 11px; border: 1px solid #e6e9ed; border-radius: 999px; background: rgba(255, 255, 255, .94); font-size: 12px; color: #505660; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; transition: opacity .3s, background .2s, color .2s; }
.pf-vhint.flash { border-color: #1e1e23; background: #1e1e23; color: #fff; }
.pf-vport.is-active .pf-vhint:not(.flash) { opacity: 0; }
.pf-mini { position: absolute; right: 10px; bottom: 28px; padding: 4px; border: 1px solid #dfe2e6; border-radius: 8px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(20, 22, 26, .08); cursor: pointer; touch-action: none; }
.pf-mini[hidden] { display: none; }
.pf-mini svg { display: block; pointer-events: none; }
.pf-mini i { position: absolute; border: 1.5px solid #1e1e23; border-radius: 2px; background: rgba(30, 30, 35, .06); pointer-events: none; }
@media (max-width: 640px) {
  /* 첫 화면에 순서도 창이 바로 보이게 카드 소개를 두 줄로 */
  .pf-title p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pf-canvas.pf-view { margin: 12px 0 0; }
  .pf-vbar { padding-left: 12px; }
  .pf-vctl button { padding: 0 8px; }
}
