/* steps.css — 단계 그림·건 화면 단계별 표시(두 앱 공용 /shared/steps.css · shared/stage_bar.html · /shared/steps.js).
   2026-11-01 구매포탈 portal.css 에서 공용화(SQ관리 지적·실적관리 프로젝트 단계가 함께 쓴다). 칸 이름은 그대로 .buy-step·.buy-pin·.bst.
   단계 열쇠별 숨김 줄은 stage_pin 이 화면마다 그린다(새 단계를 더해도 이 파일을 고치지 않는다). */
/* 구매포탈 7-2 — 단계 그림(결재칸 .ea-box 와 같은 꼴: 위 칩·가운데 내용·아래 날짜, › 로 잇는다 — 요청 ⑤) */
.buy-steps-wrap{overflow-x:auto;padding:.125rem 0 .5rem;margin-bottom:.5rem}
.buy-steps{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem 0;align-items:stretch}
/* 칸 폭은 5rem(가장 긴 날짜·번호가 들어가는 폭)~8rem 사이에서 한 줄을 나눠 쓴다 — 고정 7.25rem 이던 때는 PC 1280~1536 폭에서
   9칸이 두 줄이었다(감사 A-41). 그래도 모자라면(태블릿·휴대폰) 두 줄로. 긴 이름(협력사)은 말줄임 + 마우스를 올리면 전체 */
.buy-step{position:relative;display:flex;flex:1 1 5rem;min-width:5rem;max-width:8rem}
.buy-step+.buy-step{margin-left:1rem}
.buy-step+.buy-step::before{content:"›";position:absolute;left:-.75rem;top:50%;transform:translateY(-50%);color:var(--text-sub);
  font-size:var(--fs-title)}
.buy-step-in{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.25rem;min-width:0;width:100%;
  padding:.5625rem .25rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);text-align:center;color:var(--text)}
a.buy-step-in{text-decoration:none}
.buy-step .st{display:inline-flex;align-items:center;height:var(--chip-h);padding:0 .5rem;border-radius:var(--radius-sm);
  background:var(--th-bg);color:var(--text-sub);font-size:var(--fs-badge);font-weight:var(--fw-semibold);white-space:nowrap}
.buy-step.appr .st{background:var(--ink);color:var(--on-ink)}
.buy-step .who{max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:var(--fs-label);font-weight:var(--fw-semibold);
  white-space:nowrap}
.buy-step .ft{font-size:var(--fs-hint);color:var(--text-sub);white-space:nowrap;font-variant-numeric:tabular-nums}
.buy-step.done .ft{color:var(--text)}
.buy-step.now .buy-step-in{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.buy-step.now .ft{color:var(--accent);font-weight:var(--fw-semibold)}
.buy-step.late .ft{color:var(--red);font-weight:var(--fw-semibold)}
.buy-step.wait .buy-step-in{opacity:.55}
.buy-step.skip .buy-step-in{border-style:dashed;opacity:.6}
.buy-step.ret .buy-step-in{border-color:var(--yellow)}
.buy-step.ret .ft{color:var(--yellow-ink);font-weight:var(--fw-semibold)}
.buy-step.bad .buy-step-in{border-color:var(--red)}
.buy-step.bad .ft{color:var(--red);font-weight:var(--fw-semibold)}
/* 전자결재 문서 안 단계 그림 — 두 줄(2026-10-09 오너 '한 줄에 표시할 양이 많다', stage_bar split): 한 줄에 절반(--half, 올림)씩
   같은 폭, 뒷줄 첫 칸(.brk)은 › 없이 왼쪽부터. 휴대폰은 지금처럼 폭대로 접힌다 */
@media (min-width:641px){
  .buy-steps.split .buy-step{flex:0 0 calc((100% - (var(--half) - 1) * 1rem) / var(--half));max-width:none}
  .buy-steps.split .buy-step.brk{margin-left:0}
  .buy-steps.split .buy-step.brk::before{display:none}
}
/* 건 화면 단계 그림 고정(2026-10-08 오너 '틀고정 · 접고 펼 수 있게' → 10-09 '처음부터 붙어 있게' — buy/_stages.html stage_pin ·
   buy.js). 그림 자체가 머리말 아래에 닿는 순간부터 붙는다(잘리지 않음). 위 작은 줄 = '진행 단계'(붙으면 .stuck — 번호·제목, 같은 한 줄
   높이라 본문이 움직이지 않는다) · [접기]/[펼치기]. 붙은 표시는 그림자(1px 선 — 높이에 들지 않는다). PC 는 .fold, 휴대폰은 .open 으로 접고 편다 */
.buy-pin-sent{height:1px;margin-bottom:-1px}
.buy-pin{position:sticky;top:var(--header-h);z-index:var(--z-toolbar);background:var(--bg)}
.buy-pin.stuck{box-shadow:0 1px 0 var(--line)}
.buy-pin-head{display:flex;align-items:center;gap:.75rem;min-height:var(--ctl-h-sm);padding:.25rem 0}
.buy-pin-label{flex:0 1 auto;min-width:0;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-label);
  color:var(--text-sub)}
.buy-pin .t-stuck{display:none;color:var(--text)}
.buy-pin.stuck .t-stuck{display:inline}
.buy-pin.stuck .t-plain{display:none}
.buy-pin-mini{display:inline-flex;flex:1 1 auto;min-width:0;align-items:center;gap:.5rem;overflow:hidden;white-space:nowrap;font-size:var(--fs-label)}
.buy-pin-mini .ft.now{color:var(--accent);font-weight:var(--fw-semibold)}
.buy-pin-mini .ft.ret{color:var(--yellow-ink);font-weight:var(--fw-semibold)}
.buy-pin-mini .ft.bad{color:var(--red);font-weight:var(--fw-semibold)}
.buy-pin-tog{margin-left:auto;flex:none}
.buy-pin-tog span{display:inline-flex;align-items:center;gap:.25rem}
@media (min-width:641px){
  .buy-pin.fold .buy-steps-wrap,.buy-pin.fold .t-fold,.buy-pin:not(.fold) .t-open,.buy-pin:not(.fold) .buy-pin-mini{display:none}
}
@media (max-width:640px){                                   /* 휴대폰 — 늘 접힌 채로 시작(세 줄 그림이 화면을 덮지 않게) */
  .buy-pin:not(.open) .buy-steps-wrap,.buy-pin:not(.open) .t-fold,.buy-pin.open .t-open,.buy-pin.open .buy-pin-mini,
  .buy-pin-label{display:none}
  .buy-pin-mini{flex-wrap:wrap;row-gap:0;white-space:normal}   /* 지금 단계 줄이 넘치면 두 줄로(끝 '…/9단계'가 [펼치기] 앞에서 '6'만 남고 잘렸다 — 10-14) */
}
.buy-dots{display:inline-flex;align-items:center;gap:.1875rem;vertical-align:middle}
.buy-dots i{display:block;width:.5rem;height:.5rem;border-radius:50%;background:var(--line)}
.buy-dots i.done{background:var(--ink)}
.buy-dots i.skip{background:var(--line);box-shadow:inset 0 0 0 1px var(--text-sub)}
.buy-dots i.now{background:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.buy-dots i.ret{background:var(--yellow)}
.buy-dots i.bad{background:var(--red)}
/* 점 설명(data-tip — 2026-11-12 대표): 커서를 올리면 바로 · 점 사이 틈까지 누름 자리(::before) · 풍선(::after)은 키트 .ih[data-tip] 와 같은 모양 */
.buy-dots i[data-tip]{position:relative}
.buy-dots i[data-tip]::before{content:"";position:absolute;inset:-.375rem -.125rem}
.buy-dots i[data-tip]::after{content:attr(data-tip);position:absolute;left:-.25rem;bottom:calc(100% + .375rem);z-index:var(--z-menu);width:max-content;max-width:min(18rem,70vw);
  padding:.25rem .5rem;border-radius:var(--radius-sm);background:var(--ink);color:var(--on-ink);font-size:var(--fs-hint);font-weight:var(--fw-regular);font-style:normal;line-height:1.4;
  text-align:left;white-space:normal;pointer-events:none;display:none}
@media (hover:hover) and (pointer:fine){.buy-dots i[data-tip]:hover::after{display:block}}
.buy-cur{margin-left:.375rem;font-size:var(--fs-label);font-weight:var(--fw-semibold)}
.buy-cur.now{color:var(--accent)} .buy-cur.ret{color:var(--yellow-ink)} .buy-cur.bad{color:var(--red)}
/* 목록 진행 칸(shared/stage_bar.html stage_dots — 11-08 저녁 대표): 점 줄 위 · 단계 글 아래 왼쪽 맞춤 → 열 폭 = 둘 중 긴 것.
   휴대폰 카드형 목록(m-rows)은 열이 없으니 한 줄 그대로 */
.buy-prog{display:inline-flex;flex-direction:column;align-items:flex-start;gap:.25rem;vertical-align:middle}
.buy-prog>.buy-cur{margin-left:0;line-height:1.2}
@media (max-width:640px){
  table.tbl.m-rows .buy-prog{flex-direction:row;align-items:center;gap:.375rem}
}
@media (max-width:640px){
  .buy-step-in{min-width:6rem;padding:.5rem .5rem}
}
@media print{
  .buy-steps-wrap{overflow:visible}
}
@media (hover:hover) and (pointer:fine){
  a.buy-step-in:hover{border-color:var(--ink);text-decoration:none}
}
/* 건 화면 단계별 표시(2026-10-31 대표 '캡처의 단계에 해당하는 것만 페이지에 — 단계별 구분이 없다', 결정 1안 · docs/notes/buy-steps.md): 단계 칸 = 화면 전환
   (buy/_stages.html tabs · buysteps.js). 칸(data-step)에 보는 단계(.bst data-view)가 없으면 숨긴다 — 서버 HTML 에는 모든 칸이 있고 처음 단계도 서버가 정한다.
   all = 전체 보기(한 장) · 완료 줄은 그 단계 맨 아래(order). 인쇄는 전체 */
.bst{display:flex;flex-direction:column}
.bst>*{min-width:0}
.bst[data-view="all"] .bst-only,.bst[data-view="all"] .bst-fin:not(.act){display:none}
.bst-fin{order:9;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem .875rem;margin-bottom:var(--gap);
  padding:.75rem var(--card-px);background:var(--surface);border:1px solid var(--ink);border-radius:var(--radius)}
.bst[data-view="all"] .bst-fin{order:0}
.bst-fin-tx{flex:1 1 15rem;min-width:0;font-size:var(--fs-label)}
.bst-fin-tx b{font-weight:var(--fw-semibold)}
.bst-fin-bt{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem}
.bst-fin-bt:empty{display:none}
.bst-fin-bt form{margin:0}
/* 접힌 보조 자료(고객 견적 '견적 검토 자료' — 2026-10-31 시안): 한 카드 안에 칸들을 이어서 — 안쪽 카드의 바탕·여백을 없앤다. 전체 보기·인쇄·주소로 온 칸은 펼침(buysteps.js) */
.bst-more>summary{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.375rem .75rem;list-style:none;cursor:pointer}
.bst-more>summary::-webkit-details-marker{display:none}
.bst-more[open]>summary{margin-bottom:var(--sec-gap)}
.bst-more[open] .t-open,.bst-more:not([open]) .t-fold{display:none}
.bst-more .card{margin:0;padding:0;background:none;border-radius:0;box-shadow:none}
.bst-more>.card+.card,.bst-more>.card+.buy-sim{margin-top:var(--sec-gap)}
button.buy-step-in{font:inherit;cursor:pointer}
.buy-step.sel::after{content:"";position:absolute;left:18%;right:18%;bottom:-.3125rem;height:.1875rem;border-radius:2px;background:var(--ink)}
/* 범례(stage_pin tabs .buy-pin-key — 2026-11-08 SQ 증빙·성과물 1차-b): 검정 테두리(.now) = 현재 처리할 단계 · 밑줄(.sel) = 보고 있는 단계. 두 표시가 다른 칸일 때만
   보인다(steps.js legend — 정상이면 숨김). 넓은 PC 는 위 작은 줄 안(높이 그대로) · 접으면 숨김 · 1100px 이하(좁은 PC·태블릿·휴대폰)는 그 줄 아래 한 줄
   (버튼 셋인 실적관리 프로젝트가 641~665px 에서 한 줄을 넘는다 — 11-08 독립 검토) */
.buy-pin-key{display:inline-flex;flex:none;align-items:center;gap:.375rem;font-size:var(--fs-hint);color:var(--text-sub);white-space:nowrap}   /* 줄지 않는다 — 붙은 띠의 긴 제목(.buy-pin-label 말줄임)이 먼저 준다 */
.buy-pin-key .k-now{flex:none;width:1rem;height:.75rem;border-radius:var(--radius-sm);box-shadow:inset 0 0 0 2px var(--ink)}
.buy-pin-key .k-sel{flex:none;width:1rem;height:.1875rem;margin-left:.5rem;border-radius:2px;background:var(--ink)}
@media (min-width:641px){.buy-pin.fold .buy-pin-key{display:none}}
@media (max-width:1100px){
  .buy-pin-head:has(.buy-pin-key:not([hidden])){flex-wrap:wrap;row-gap:0}   /* 범례가 보일 때만 줄바꿈 — 숨김이면 기존 배치 그대로 */
  .buy-pin-key{order:9;flex:1 1 100%;flex-wrap:wrap;row-gap:.125rem;white-space:normal}
}
.buy-step.unsaved .buy-step-in{position:relative}
.buy-step.unsaved .buy-step-in::after{content:"";position:absolute;top:.375rem;right:.375rem;width:.5rem;height:.5rem;border-radius:50%;background:var(--red)}
.buy-pin.tabs .buy-step{flex-basis:4.625rem;min-width:4.625rem}   /* 10칸이 PC 1280 폭에서도 한 줄(날짜 칸 폭 안에서 — 게이트 check_steps_browser) */
.buy-pin.tabs .buy-step+.buy-step{margin-left:.75rem}
.buy-pin.tabs .buy-step+.buy-step::before{left:-.625rem}
.buy-pin-acts{display:inline-flex;flex:none;align-items:center;gap:.375rem;margin-left:auto}
.buy-pin-acts+.buy-pin-tog{margin-left:0}
.buy-pin-acts .btn[aria-pressed="true"]{border-color:var(--ink);font-weight:var(--fw-semibold)}
@media (hover:hover) and (pointer:fine){button.buy-step-in:hover{border-color:var(--ink)}}
@media (max-width:640px){                                   /* 휴대폰 — 단계 칸 한 줄 가로 이동(이름만) · 접기 없음 */
  .buy-pin.tabs:not(.open) .buy-steps-wrap{display:block}
  .buy-pin.tabs .buy-steps-wrap{overflow-x:auto;overscroll-behavior-x:contain;margin-bottom:.25rem}
  .buy-pin.tabs .buy-steps{flex-wrap:nowrap;width:max-content}
  .buy-pin.tabs .buy-step{flex:0 0 auto;min-width:0;max-width:none}
  .buy-pin.tabs .buy-step-in{min-width:0;padding:.3125rem .375rem}
  .buy-pin.tabs .buy-step .who,.buy-pin.tabs .buy-step .ft{display:none}
  .buy-pin.tabs .buy-pin-tog,.buy-pin.tabs .buy-pin-mini{display:none}
  .buy-pin.tabs .buy-pin-label{display:block}
}
@media print{
  .bst [data-step]{display:block!important}
  .bst .bst-fin,.bst .bst-only{display:none!important}
}
