/* ============================================================
   product-motion.css — 제품 처리 흐름 모션 무대(.pm)
   메인 #solutions 제품 카드와 BABEL OPS 상세 #lifecycle이 공유한다(한/영 동일).
   원칙: 모든 요소의 CSS 기본 상태 = 끝 프레임(완성 그림). product-motion.js는
   등장 애니메이션만 얹고(fill: backwards) 끝나면 이 기본 상태로 돌아온다.
   그래서 JS 미로드·reduced-motion·인쇄에서는 완성 그림이 그대로 보인다.
   애니메이션 대상 속성은 transform·opacity뿐이다.
   ============================================================ */

.pm {
  --pm-human: #ffc46b;
  --pm-warn: #ffb347; /* GOSIMS 오류 표식 — 사람 판단(--pm-human)과 의미가 다르다 */
  --pm-neutral: rgba(205, 232, 240, .9);
  --pm-line: rgba(205, 232, 240, .28);
  --pm-bar: rgba(205, 232, 240, .14);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(44px, auto) auto;
  grid-template-areas: "cap btn" "stage stage";
  align-items: center;
  column-gap: 12px;
  margin: 32px 0 0;
}

.pm-caption {
  grid-area: cap;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pm-toggle {
  grid-area: btn;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

/* 버튼 자리 예약 — JS가 켜진 문서에서는 숨겨도 자리를 차지해 캡션 줄바꿈·무대 위치가 밀리지 않는다 */
.pm-toggle[hidden] { display: none; }
.js .pm-toggle[hidden] { display: inline-flex; visibility: hidden; }
.pm-toggle:hover { border-color: rgba(53, 199, 232, .5); }
.pm-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pm-stage {
  grid-area: stage;
  container-type: inline-size;
  display: grid;
  gap: 18px;
  margin-top: 14px;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 17, 24, .55);
}

/* --- 구간 태그(AI 처리 · 담당자 판단) — 노드 2~3·4~5 위의 괄호 ------------ */

.pm-zones {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 30px;
}

.pm-zone {
  position: relative;
  margin: 0 14%;
  padding: 7px 4px 0;
  border-top: 1px solid currentColor;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  text-align: center;
}

.pm-zone::before,
.pm-zone::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 1px;
  height: 7px;
  background: currentColor;
}

.pm-zone::before { left: 0; }
.pm-zone::after { right: 0; }
.pm-zone-ai { grid-column: 2 / 4; }
.pm-zone-human { grid-column: 4 / 6; color: var(--pm-human); }

/* --- 6단계 레일 ---------------------------------------------------------- */

.pm-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.pm-node {
  position: relative;
  padding: 0 10px;
  text-align: center;
}

/* 연결선 — 출발 노드(li)에 붙어 다음 노드까지 간다. JS의 grow 프리셋(균일 scale)이
   transform-origin 쪽에서부터 그린다: 데스크톱은 왼쪽 끝, 모바일은 위쪽 끝 */
.pm-link {
  position: absolute;
  top: 13px;
  left: calc(50% + 20px);
  width: calc(100% - 40px);
  height: 2px;
  border-radius: 1px;
  background: var(--pm-line);
  transform-origin: 0 50%;
}

.pm-badge {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 1px solid var(--pm-line);
  border-radius: 50%;
  color: #031015;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.pm-fill {
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: -1px;
  left: -1px;
  z-index: -1;
  border-radius: 50%;
  background: var(--accent);
}

/* 중립 노드(시작·끝): 숫자는 다른 노드처럼 어두운 색 — 꺼져 있을 때 묻혔다가 밝은 중립 채움으로 켜진다 */
.pm-node:nth-child(1) .pm-fill,
.pm-node:nth-child(6) .pm-fill { background: var(--pm-neutral); }
.pm-node:nth-child(4) .pm-fill,
.pm-node:nth-child(5) .pm-fill { background: var(--pm-human); }

.pm-node strong {
  display: block;
  min-height: 2.6em;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.pm-node span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

/* --- 패널(모의 UI — 글자 없는 막대) + 이력 ----------------------------- */

.pm-panels {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.pm-panel-ai { display: grid; gap: 10px; }

.pm-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.pm-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.pm-approve::before { background: var(--pm-human); }
.pm-code { background: rgba(3, 10, 14, .7); }

.pm-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--pm-bar);
}

.pm-card-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}
.pm-bar-del { background: rgba(255, 128, 128, .42); }
.pm-bar-add { background: rgba(96, 214, 150, .55); }
.w35 { width: 35%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; }
.w85 { width: 85%; } .w90 { width: 90%; } .w100 { width: 100%; }

.pm-commit {
  display: grid;
  grid-template-columns: 8px 44px;
  align-items: center;
  gap: 6px;
  justify-self: end;
  margin-top: 2px;
}

.pm-commit-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pm-commit .pm-bar { height: 6px; }

.pm-check {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--pm-human);
  color: #031015;
}

/* 이력(OPS .pm-log)·모니터(GOSIMS .pmg-monitor) 행 — 공용 규칙 */
.pm-log, .pmg-monitor { margin: 0; padding: 0; list-style: none; }
.pm-log { padding-top: 2px; }
.pm-log li, .pmg-monitor li { position: relative; display: flex; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.3; }
.pm-log li:first-child, .pmg-monitor li:first-child { border-top: 0; padding-top: 2px; }
.pm-log i, .pmg-dot { flex: none; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: rgba(205, 232, 240, .4); }
/* 모니터 행: 점은 첫 줄에 고정(절대 배치)하고 글·「재처리」 칩은 flex 줄바꿈 — 좁은 열에서 칩이 다음 줄로
   내려가도 글 시작선(18px)에 맞춰 선다. 한 줄일 때의 위치는 점을 흐름에 둔 때와 같다(8px 패딩 + 반 줄) */
.pmg-monitor li { flex-wrap: wrap; gap: 4px 8px; padding-left: 18px; }
.pmg-dot { position: absolute; top: calc(8px + .65em); left: 0; margin: -4px 0 0; background: rgba(96, 214, 150, .75); }
.pmg-monitor li:first-child .pmg-dot { top: calc(2px + .65em); }

/* --- 메인 카드의 실제 화면 썸네일 링크 ---------------------------------- */

.pm-shot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.pm-shot img {
  width: 180px;
  margin-right: 14px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pm-shot span { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(205, 232, 240, .35); }
.pm-shot:hover span { color: var(--text); text-decoration-color: var(--accent); }
.pm-shot:focus-visible span { color: var(--text); text-decoration-color: var(--accent); }
.pm-shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

/* --- GOSIMS 무대(.pm-gosims) — 기관 시스템 ↔ e나라도움 데이터 흐름 --------
   메인 GOSIMS 카드(.product-detail 안 — OPS 카드와 같은 2단 구조)와 상세 #integration(전폭)이 공유한다.
   레일은 5노드. AI/사람 구간이 없으므로 02~04는 accent, 01·05는 중립(OPS 규칙을 덮어쓴다).
   메인 카드는 무대가 첫 자식이라(복사문 없음) 위 여백은 카드 패딩만 남긴다. */

.product-detail > .pm:first-child { margin-top: 0; }

.pm-headline {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
}

.pm-rail-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pm-gosims .pm-node:nth-child(4) .pm-fill { background: var(--accent); }
.pm-gosims .pm-node:nth-child(5) .pm-fill { background: var(--pm-neutral); }

/* 도식 = 3열 × 2단. 레일 01~05(등간격 5열: 10·30·50·70·90%)와 세로로 맞춘다 —
   01 ERP 상자(왼쪽 열) · 02~04 코어와 송신/수신 레인(가운데 열) · 05 운영 모니터(오른쪽 열 위).
   e나라도움 상자는 단계가 아니라 상대 시스템이라 번호가 없고, 화살표가 닿는 아래 단 오른쪽에 둔다
   (모니터를 아래 전폭에 두면 레일 05가 e나라도움 상자 위에 걸려 「운영 관리 = e나라도움」으로 읽힌다).
   ERP 상자는 두 단에 걸치되 내용 높이로 가운데 정렬 — 코어·레인 전체(GOSIMS)와 마주 본다. */
.pmg-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-areas: "erp core ops" "erp lanes gov";
  gap: 14px;
  align-items: stretch;
}

.pmg-erp { grid-area: erp; }
.pmg-core { grid-area: core; }
.pmg-lanes { grid-area: lanes; }
.pmg-box.pmg-gov { grid-area: gov; align-self: stretch; } /* 송신·수신 화살표 둘 다 상자 안쪽을 향하게 레인 높이에 맞춘다 */
.pmg-ops { grid-area: ops; }

.pmg-box {
  display: grid;
  align-self: center; /* 상자는 내용 높이 — 빈 공간으로 늘리지 않고 제 칸 안에서 가운데 */
  align-content: center; /* 늘어난 상자(e나라도움)에서도 이름·칩이 한 덩어리로 가운데 */
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.pmg-box strong { font-size: 14px; line-height: 1.3; }
.pmg-box .pmg-chips { justify-content: center; }
.pmg-box .pmg-chips li { text-align: center; }

/* 단계 번호 표식 — 레일의 01~05와 도식의 각 부분을 잇는다 */
.pmg-num { margin-right: 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0; }

/* 05 운영 모니터 — 코어·상자와 같은 패널 꼴로 레일 05 아래(오른쪽 열 위)에 선다 */
.pmg-ops {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.pmg-ops .pmg-num { margin: 5px 10px 0 0; }

.pmg-chips {
  display: flex;
  flex-wrap: wrap;
  margin: -3px;
  padding: 0;
  list-style: none;
}

/* 칩 모서리 12px: 한 줄 칩(높이 약 22px)에서는 999px과 같은 알약 모양이고, 좁은 칸에서 두 줄로 접힌 칩만
   둥근 사각형이 된다(알약 반지름이 두 줄 글을 누르는 「빽빽한」 모양을 피한다) */
.pmg-chips li {
  margin: 3px;
  padding: 4px 9px;
  border: 1px solid var(--pm-line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.pmg-lanes {
  display: grid;
  align-self: center;
  align-content: start;
  gap: 10px;
}

.pmg-core {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(53, 199, 232, .35);
  border-radius: 10px;
  background: rgba(53, 199, 232, .06);
}

.pmg-core b { color: var(--accent); font-size: 12px; letter-spacing: .04em; }

.pmg-pipe {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pmg-pipe li {
  padding: 6px 4px;
  border-radius: 6px;
  background: rgba(8, 17, 24, .6);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

/* 상세 #integration(.detail-section — 메인 카드에는 없는 클래스)의 파이프라인 칩은 메인 카드처럼 12px·칩마다 1줄.
   3열은 가운데 열(무대의 1.5/3.5 − 여백)이 칩 3개를 한 줄씩 담을 수 있을 때만 — 영문 「Interface engine」(12px 96.2px +
   좌우 여백 4px)은 무대 내용 폭 약 813px부터 들어간다(한국어 「인터페이스 엔진」 80.6px + 8px은 약 732px부터).
   840px 이하(약 905px 뷰포트 이하 — 768·375·360 포함)에서는 세로 1열로 둔다(한·영 공용). */
.detail-section .pmg-pipe li { font-size: 12px; }
@container (max-width: 840px) {
  .detail-section .pmg-pipe { grid-template-columns: 1fr; }
}

.pmg-lane {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "dir arrow" "chips chips";
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
}

.pmg-dir { grid-area: dir; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* 화살표: 2px 선 + 삼각 머리(::after는 자식이라 선과 함께 늘어난다). 송신은 왼쪽에서, 수신은 오른쪽에서 자란다 */
.pmg-arrow {
  grid-area: arrow;
  position: relative;
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--pm-line);
  transform-origin: 0 50%;
}

.pmg-arrow::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -1px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--pm-line);
  border-right: 0;
}

.pmg-lane-recv .pmg-arrow { transform-origin: 100% 50%; }
.pmg-lane-recv .pmg-arrow::after { right: auto; left: -1px; border-left: 0; border-right: 7px solid var(--pm-line); }
.pmg-lane .pmg-chips { grid-area: chips; }
.pmg-lane-recv .pmg-chips { justify-content: flex-end; }

/* 오류 표식: 장식(텍스트 없음 — 「!」 기호). 녹색 상태 점을 덮어 「이 건은 오류가 났다」를 남기는 상태 표식이라
   끝 프레임에도 그대로 보인다 — 행이 녹색으로 뜬 뒤 덮이고, 그 옆에 「재처리」가 붙는다 */
.pmg-err {
  position: absolute;
  left: -4px;
  top: calc(8px + .65em); /* 점과 같은 첫 줄 중심 — 칩이 둘째 줄로 내려가도 점 위에 남는다 */
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--pm-warn);
  color: #031015;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.pmg-err::after { content: "!"; }

.pmg-retry {
  padding: 3px 9px;
  border: 1px solid rgba(53, 199, 232, .5);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

/* --- 반응형 -------------------------------------------------------------- */

/* 무대가 넓으면(상세 페이지 컨테이너) 패널을 레일의 6열에 맞춰 구간 아래에 둔다 —
   티켓·코드는 01~03, 승인은 04~05, 이력은 06 아래. 컨테이너 쿼리 미지원은 위 3열 그대로. */
@container (min-width: 820px) {
  .pm-panels { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pm-panel-ai { grid-column: 1 / 4; grid-template-columns: 1fr 1fr; align-items: start; }
  .pm-panel-human { grid-column: 4 / 6; }
  .pm-panel-log { grid-column: 6 / 7; }
}

/* 좁은 무대 — 메인 GOSIMS 카드(.product-detail) 안에서만. 2단 구간(921px 이상)의 무대 내용 폭은 372~617px,
   1열 구간(641~920px)은 556~729px. 뷰포트가 아니라 무대 폭(.pm-stage 컨테이너, content-box 기준)으로 판단하고
   선택자를 .product-detail로 한정해 상세 #integration은 어떤 폭에서도 매칭되지 않는다(배치 불변).
   641px 이상 뷰포트로 한정해 모바일(아래 640px 블록)과 겹치지 않게 한다.
   - 544px 이하(921~약 1187px 뷰포트): 3열 흐름을 세로로 쌓는다(3열이면 ERP 상자 안쪽이 좁아 영문 칩
     「Accounting/Budget」이 글자 중간에서 끊긴다 — 실측: 무대 내용 폭 540px까지 끊기고 541px부터 한 줄. 4px 여유)
     — 규칙은 640px 블록의 GOSIMS 접기와 같다.
   - 544px 초과~760px(약 1188px 이상 2단 · 641~920px 1열): 흐름은 3열로 두되 양쪽 열을 1.05fr·1.15fr로 조금 넓히고
     상자 여백을 12px로 — e나라도움 칩 「보조사업·집행 연계 API」(127px)가 한 줄에 들어가고(1:1.5:1·14px면 안쪽
     118~125px) 무대 545px에서 ERP 상자 이름 「01 ERP·업무시스템」(117px)이 안쪽(123px)에 들어간다(1fr이면
     118px — 글자 중간에서 끊긴다). 가운데 열은 1.5fr을 유지해 레일 02(30%)·04(70%)가 가운데 열 위에 남는다. 모니터 행
     「전자세금계산서 + 재처리」는 오른쪽 열 안쪽 164px 이상(무대 약 600px — 1280px 뷰포트 — 이상)에서 한 줄,
     그 아래(1188~약 1270px)에서는 「재처리」 칩이 둘째 줄로 내려간다. 파이프라인 칩 3개는 세로 1열(가운데 열
     215~290px에서 칩 한 칸이 65~90px — 「인터페이스 엔진」·「Interface engine」이 2줄로 깨진다).
   - 500px 이하(921~약 1120px 뷰포트): 레일 한 칸 74~100px. 좌우 여백을 10px→4px로 줄여 420px 초과 구간(한 칸
     84px 이상)에서 「검증·전처리」(14px·약 72px)가 한 줄에 든다(·는 keep-all에서도 끊긴다 — 상자 76px 이상, 4px 여유 ·
     Pretendard Variable 실측). 여백 0이던 때는 무대 465~472px(약 1068~1078px 뷰포트)에서 「인터페이스 송신」(93px)이
     한 줄로 펴지며 「검증·전처리」와 간격이 11px로 좁았다 — 4px이면 이 구간 안에서는 늘 「인터페이스 / 송신」 2줄이다.
     영문은 아래 :lang(en) 규칙(여백 0)이 우선한다.
   - 420px 이하(921~약 995px 뷰포트, 한국어): 한 칸 74~84px에서 이웃 노드명이 한 줄씩이면 사이 간격이 5~12px로
     빽빽하다(간격 = 한 칸 − 두 이름 폭의 평균. 「데이터 생성」 67.5 ↔ 「검증·전처리」 71.9px는 한 칸 81.7px부터 12px).
     13px로 줄여도 921px에서 10px이라 글자를 줄이는 대신 노드명 상자를 가장 긴 낱말 폭(min-content)으로 좁혀 모든 이름을
     낱말마다 줄바꿈한다(「검증· / 전처리」 포함 2줄 — 간격 우선, 사용자 결정 D-12). 한국어는 keep-all이라 낱말 안에서는
     끊기지 않고(가장 긴 「인터페이스」 63.7px) min-height 2.6em = 두 줄이라 레일 높이는 그대로다.
     영문은 「pre-processing」 하이픈에서도 끊겨 3~4줄이 되므로 제외. */
@media (min-width: 641px) {
  @container (max-width: 500px) {
    .product-detail .pm-gosims .pm-node { padding: 0 4px; }
  }
  @container (max-width: 420px) {
    :lang(ko) .product-detail .pm-gosims .pm-node strong { width: min-content; margin-right: auto; margin-left: auto; }
  }
  @container (max-width: 544px) {
    .product-detail .pmg-flow { grid-template-columns: 1fr; grid-template-areas: none; gap: 10px; }
    .product-detail .pmg-erp, .product-detail .pmg-core, .product-detail .pmg-lanes,
    .product-detail .pmg-box.pmg-gov, .product-detail .pmg-ops { grid-area: auto; }
    .product-detail .pmg-lane { grid-template-columns: 1fr; grid-template-areas: "dir" "arrow" "chips"; justify-items: center; }
    .product-detail .pmg-arrow { width: 2px; height: 28px; transform-origin: 50% 0; }
    .product-detail .pmg-arrow::after {
      top: auto; right: auto; bottom: -1px; left: -4px;
      border-left: 5px solid transparent; border-right: 5px solid transparent;
      border-top: 7px solid var(--pm-line); border-bottom: 0;
    }
    .product-detail .pmg-lane-recv .pmg-arrow { transform-origin: 50% 100%; }
    .product-detail .pmg-lane-recv .pmg-arrow::after {
      bottom: auto; top: -1px; left: -4px;
      border-left: 5px solid transparent; border-right: 5px solid transparent;
      border-top: 0; border-bottom: 7px solid var(--pm-line);
    }
    .product-detail .pmg-lane .pmg-chips, .product-detail .pmg-lane-recv .pmg-chips { justify-content: center; }
  }
  @container (width > 544px) and (width <= 760px) {
    .product-detail .pmg-flow { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, 1.15fr); }
    .product-detail .pmg-box { padding: 12px; }
    .product-detail .pmg-pipe { grid-template-columns: 1fr; }
  }
  /* 3열 무대의 오른쪽 열이 260px 미만(메인 카드 전 구간 · 상세 641~약 900px 뷰포트): 모니터 05 표식을 행 위로
     올리고 행 글자를 12px로 — 한국어 행이 한 줄에 들어간다(영문 「Electronic tax invoices + Reprocessing」은
     칩이 둘째 줄로 내려간다 — 위 .pmg-monitor li 줄바꿈 규칙) */
  @container (width > 544px) and (width <= 820px) {
    .pmg-ops { grid-template-columns: minmax(0, 1fr); }
    .pmg-ops .pmg-num { margin: 0 0 2px; }
    .pmg-monitor li { font-size: 12px; }
  }
}

/* 메인 OPS 카드의 좁은 무대(내용 폭 483px 이하 — 2단 921~약 1078px · 1열 카드 641~약 659px 뷰포트, 한국어. 뷰포트 폭은 스크롤바
   없는 기준이고 일반 스크롤바(15px)가 있으면 경계가 +15px 밀린다 — 1093·674px. 어느 쪽이든 6개가 고르게 맞는다): 노드명 상자(44~60px)에
   두 낱말 이름이 일부만 줄바꿈되어(「요청 / 등록」 2줄 · 「AI 분석」 1줄) 들쭉날쭉하다 — 위 GOSIMS D-12처럼 min-content로 낱말마다
   나눠 「검수」(한 낱말)만 빼고 모두 2줄로 맞춘다(min-height 2.6em = 두 줄이라 레일 높이는 그대로). 경계는 맑은 고딕 실측(내용 폭
   481px까지 일부 2줄, 482px부터 모두 1줄 — 2단·1열 모두 같다)에 2px 여유 — Segoe UI는 474px, Noto Sans KR은 448px까지라 이 안에 든다. */
@media (min-width: 641px) {
  @container (max-width: 483px) {
    :lang(ko) .product-detail .pm:not(.pm-gosims) .pm-node strong { width: min-content; margin-right: auto; margin-left: auto; }
  }
}

@media (max-width: 640px) {
  .pm-stage { gap: 16px; padding: 16px 14px 14px; }

  /* 구간 태그: 괄호 대신 칩 2개 */
  .pm-zones { display: flex; flex-wrap: wrap; margin: -4px; min-height: 0; }
  .pm-zone { margin: 4px; padding: 5px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; }
  .pm-zone::before, .pm-zone::after { display: none; }

  /* 레일: 세로 1열 — 배지 왼쪽, 문구 오른쪽. 선은 배지 아래에서 다음 항목 상단(row-gap)까지 세로로 잇는다 */
  .pm-rail { grid-template-columns: 1fr; row-gap: 18px; }
  .pm-node {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 12px;
    padding: 0;
    text-align: left;
  }
  .pm-badge { grid-row: 1 / 3; margin: 0; }
  .pm-node strong { min-height: 0; margin-top: 5px; }
  .pm-node span { margin-top: 2px; text-align: left; }
  .pm-link {
    top: 28px;
    bottom: -18px;
    left: 13px;
    width: 2px;
    height: auto;
    transform-origin: 50% 0;
  }

  .pm-panels { grid-template-columns: 1fr; }
  .pm-shot img { width: 140px; }

  /* GOSIMS: 상자를 세로로 쌓고 송신·수신 레인은 세로 화살표(아래로 / 위로 자란다) */
  .pm-rail-5 { grid-template-columns: 1fr; }
  .pm-headline { font-size: 14px; }
  .pmg-flow { grid-template-columns: 1fr; grid-template-areas: none; gap: 10px; }
  .pmg-erp, .pmg-core, .pmg-lanes, .pmg-box.pmg-gov, .pmg-ops { grid-area: auto; }
  .pmg-lane { grid-template-columns: 1fr; grid-template-areas: "dir" "arrow" "chips"; justify-items: center; }
  .pmg-arrow { width: 2px; height: 28px; transform-origin: 50% 0; }
  .pmg-arrow::after {
    top: auto; right: auto; bottom: -1px; left: -4px;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 7px solid var(--pm-line); border-bottom: 0;
  }
  .pmg-lane-recv .pmg-arrow { transform-origin: 50% 100%; }
  .pmg-lane-recv .pmg-arrow::after {
    bottom: auto; top: -1px; left: -4px;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 0; border-bottom: 7px solid var(--pm-line);
  }
  .pmg-lane .pmg-chips, .pmg-lane-recv .pmg-chips { justify-content: center; }

  /* 메인 GOSIMS 카드는 모바일에서도 카드 패딩(28px×2)만큼 무대가 좁다(375px 뷰포트에서 내용 폭 240px —
     전폭이던 때보다 58px 좁다) — 파이프라인 칩 한 칸이 68px뿐이라 한·영 모두 2줄로 깨진다. 무대 내용 폭 360px
     이하(칩 한 칸 110px 미만 — 영문 12px 「Interface engine」 약 102px 기준)에서 칩을 세로 1열로 둔다
     (.product-detail 한정 — 상세 #integration은 어떤 폭에서도 매칭되지 않는다). */
  @container (max-width: 360px) {
    .product-detail .pmg-pipe { grid-template-columns: 1fr; }
  }
}

/* ===== 영문판(:lang(en)) 레이아웃 방어 =====
   영문 단계명이 길어 좁은 열에서 3줄로 늘어나는 것을 막는다. 한국어 렌더는 바꾸지 않는다. */
:lang(en) .pm-node { padding: 0 3px; }
:lang(en) .pm-node strong { font-size: 13px; letter-spacing: 0; }
:lang(en) .pm-zone { font-size: 11px; }
:lang(en) .pmg-pipe li { padding: 6px 2px; }
:lang(en) .pm-headline { font-size: 14px; }
/* 파이프라인 칩 3개: 1024 미만에서는 코어 상자 좌우 여백·칩 간격을 줄인다(옆 상자 폭은 그대로). 칩 글자를 10px로
   줄이던 규칙은 뺐다 — 상세는 위 .detail-section 규칙(12px·무대 840px 이하 1열)이, 메인 카드는 아래 12px 규칙이 맡는다 */
@media (max-width: 1023px) {
  :lang(en) .pmg-core { padding-right: 8px; padding-left: 8px; }
  :lang(en) .pmg-pipe { gap: 4px; }
}
@media (min-width: 641px) and (max-width: 760px) {
  :lang(en) .pm-node strong { font-size: 12px; }
}
/* 메인 카드 무대의 파이프라인 칩은 641px 이상에서 늘 1열(544px 초과)이거나 코어가 전폭(544px 이하 — 칩 한 칸 110px
   이상)이라 10~11px로 줄일 이유가 없다 — 12px로 올린다(위 1023px 이하 10px 규칙보다 우선) */
@media (min-width: 641px) {
  :lang(en) .product-detail .pmg-pipe li { padding: 6px 2px; font-size: 12px; }
}
@media (max-width: 640px) {
  :lang(en) .pm-node strong { font-size: 14px; }
  /* 모바일 영문: 상세 375px에서 칩 한 칸 91px에 10px 글자·좌우 여백 6px뿐 — 한·영 공용 3열을 영문만 1열로 풀고 12px */
  :lang(en) .pmg-pipe { grid-template-columns: 1fr; }
  :lang(en) .pmg-pipe li { padding: 6px 4px; font-size: 12px; }
}
/* 메인 카드의 좁은 무대(내용 폭 500px 이하 — 921~약 1120px 뷰포트): 레일 한 칸이 OPS 6노드 62~81px·GOSIMS 5노드
   75~97px뿐이라 13px로는 「registration」·「Deployment」·「transmission」·「Operational」이 글자 중간에서 끊긴다
   (body의 overflow-wrap:anywhere). 11px·좌우 여백 0으로 가장 긴 단어가 한 칸에 들어오게 한다(실측: 13px OPS는
   내용 폭 491px부터 끊기지 않는다). 내용 폭 388px 이하(921~약 945px 뷰포트)에서는 OPS 6노드 한 칸(62~64px)에 11px
   「Deployment」(약 64px — 내용 폭 384px부터 들어간다, 4px 여유)도 넘쳐 10.5px(약 61px)로 한 단계 더 줄인다.
   .product-detail 한정(상세 무대는 내용 폭 820px 이상). */
@media (min-width: 641px) {
  @container (max-width: 500px) {
    :lang(en) .product-detail .pm .pm-node { padding: 0; }
    :lang(en) .product-detail .pm .pm-node strong { font-size: 11px; }
  }
  @container (max-width: 388px) {
    :lang(en) .product-detail .pm:not(.pm-gosims) .pm-node strong { font-size: 10.5px; }
  }
}
/* 같은 좁은 무대의 OPS 구간 태그: 태그 칸(두 노드 폭 127~167px)에서 좌우 14% 여백·4px 안쪽 여백을 빼면 84~112px라
   「Your team decides」(11px 약 101px)가 내용 폭 452px까지 2줄로 깨진다. 여백을 6%·0으로 줄여 112px 이상을 주고
   (두 괄호 사이는 15px 이상 남는다) 「AI handles」도 같은 여백으로 맞춘다. 1열 카드(641px~)도 포함 — 스크롤바가 없으면 무대
   465px 이상이지만 일반 스크롤바(15px)가 있으면 641px에서 450px라 같은 2줄이 난다(A17 실측 641~643px). GOSIMS 무대에는 구간 태그가 없다. */
@media (min-width: 641px) {
  @container (max-width: 500px) {
    :lang(en) .product-detail .pm-zone { margin-right: 6%; margin-left: 6%; padding-right: 0; padding-left: 0; }
  }
}
/* 메인 카드 GOSIMS 5노드 영문 노드명 간격(목표 12px 이상). 간격 = 한 칸(내용 폭/5) − 이웃 두 이름의 가장 넓은 줄 폭 평균.
   11px 실측: 「pre-processing」 78 · 「Data creation」 70.7 · 「Result reception」 85.2 · 「management」 68.9 ·
   「transmission」 66.2 · 「creation」 42.4 · 「reception」 49.4px.
   - 내용 폭 502px 이하(921~약 1123px 뷰포트): 두 낱말 이름 01 「Data / creation」·04 「Result / reception」을 낱말마다
     줄바꿈(min-content — min-height 2.6em = 두 줄이라 레일 높이는 그대로. body의 overflow-wrap: anywhere는 min-content를
     글자 하나 폭으로 줄이므로 break-word로 되돌린다 — 넘칠 때만 끊는 비상 동작은 같다). 나머지 셋은 이미 두 줄이고
     「Validation and pre-processing」은 min-content면 4줄이 되므로 제외. 이것만으로 남는 병목은 02↔03(78·66.2 → 한 칸
     84.1px, 내용 폭 421px부터 12px). 500px 초과~502px 띠는 위 공용 규칙이 풀려 13px·여백 3px인데 01이 한 줄로 펴지면
     02와 간격이 12px 언저리라(내용 폭 500.5px에서 12.3px) 두 줄을 2px 더 유지한다.
   - 423px 이하(921~약 999px 뷰포트): 레일 노드명을 10.5px·자간 −0.02em으로(「pre-processing」 71.5 · 「transmission」
     60.6px → 내용 폭 391px부터 12px). 11px로 돌아가는 첫 폭의 02↔03 간격이 내용 폭 420.5px에서 12.05px뿐이라 3px 더 유지한다.
   - 393px 이하(921~약 953px 뷰포트): 02가 두 줄로 펴지면 03과 간격이 8px로 좁아 이 폭에서는 02를 「Validation / and pre- /
     processing」 세 줄로 묶는다(변경 전에도 이 구간은 세 줄 — 11px 「pre-processing」이 한 칸 78px에 들지 않았다).
     두 줄로 펴지는 첫 폭의 간격이 내용 폭 390.4px에서 12.05px뿐이라 3px 더 유지한다.
   경계 여유(2~3px)는 대체 글꼴 실측 기준이다 — 이 PC의 Playwright(system-ui → 맑은 고딕)보다 Aside 실측이 이웃 간격을
     약 0.3px 좁게 재므로 경계 직후 첫 폭이 Playwright 12.5px 이상(Aside 환산 12.2px 이상)이 되게 잡았다.
   한국어(위 :lang(ko) min-content 규칙)와 상세 페이지(.detail-section)는 매칭되지 않는다. */
@media (min-width: 641px) {
  @container (max-width: 502px) {
    :lang(en) .product-detail .pm-gosims .pm-node:nth-child(1) strong,
    :lang(en) .product-detail .pm-gosims .pm-node:nth-child(4) strong { width: min-content; margin-right: auto; margin-left: auto; overflow-wrap: break-word; }
  }
  @container (max-width: 423px) {
    :lang(en) .product-detail .pm-gosims .pm-node strong { font-size: 10.5px; letter-spacing: -.02em; }
  }
  @container (max-width: 393px) {
    :lang(en) .product-detail .pm-gosims .pm-node:nth-child(2) strong { max-width: 5.3em; margin-right: auto; margin-left: auto; }
  }
}
/* GOSIMS 3열 도식의 영문 e‑NaraDoum 상자: 영문 송신 칩 3개(11px 95·112·115px)는 레인 열(209~284px)에서 2~3줄로 쌓여
   레인이 한국어(1줄)보다 60~90px 높고, 레인 높이에 맞춰 늘린 상자(align-self: stretch)는 내용보다 50~70px 크다.
   칩을 더 줄이거나 2열로 묶어도 3줄→1줄은 안 되므로(열 폭 부족) 상자를 내용 높이로 되돌리고(center), 화살표가 상자를
   향하는 관계는 송신 레인의 행 순서를 뒤집어 지킨다 — 송신은 칩 위·「03 Send →」 아래, 수신은 「← 04 Receive」 위·칩 아래.
   두 화살표가 레인 블록 가운데에 이웃해 서므로 가운데 정렬된 상자 안에 들어간다(실측: 상자 위·아래 가장자리까지 39px 이상).
   3열 배치에만 — 상세(.detail-section)는 641px 이상이면 늘 3열, 메인 카드(.product-detail)는 무대 544px 초과일 때
   (위 .product-detail 3열 규칙과 같은 경계. 1190px 뷰포트의 무대가 544.x px라 min-width: 545px로는 빠진다).
   세로로 쌓는 배치(≤544px 컨테이너·≤640px 뷰포트)는 세로 화살표 규칙 그대로. 한국어 렌더는 바꾸지 않는다. */
@media (min-width: 641px) {
  :lang(en) .detail-section .pmg-lane-send { grid-template-areas: "chips chips" "dir arrow"; }
  :lang(en) .detail-section .pmg-box.pmg-gov { align-self: center; }
  @container (width > 544px) {
    :lang(en) .product-detail .pmg-lane-send { grid-template-areas: "chips chips" "dir arrow"; }
    :lang(en) .product-detail .pmg-box.pmg-gov { align-self: center; }
  }
}

/* ===== 인쇄·reduced-motion 안전망 =====
   build 뒤 재생 전·일시정지 중에 인쇄하거나 설정이 도중에 바뀌어도 끝 프레임을 강제한다.
   작성자 !important는 WAAPI 애니메이션 값보다 우선한다. */
@media print, (prefers-reduced-motion: reduce) {
  .pm [data-pm] { opacity: 1 !important; transform: none !important; }
}
