/* ==========================================================================
   dlog · 새 UI — 08 프로젝트 상세 (공개 레이아웃)
   ========================================================================== */

.pjd-wrap { display: flex; flex-direction: column; gap: 18px; padding-top: 26px; padding-bottom: 70px; }

.pjd-crumb a {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.pjd-crumb a:hover { color: var(--brand); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.pjd-card { padding: 22px 24px; }

.pjd-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px; align-items: start;
}
.pjd-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pjd-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sticky { position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------- 헤더 카드 ---------- */
.pjd-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pjd-badges .st {
  height: 26px; padding: 0 12px;
  display: inline-grid; place-items: center; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 800;
}
.pjd-badges .cat {
  font-size: 11.5px; font-weight: 700; color: var(--brand-ink);
  background: var(--brand-soft); border-radius: var(--r-full); padding: 4px 11px;
}
.pjd-badges .dd {
  font-size: 12px; font-weight: 800; color: var(--ink-3);
  margin-left: auto;
}
.pjd-badges .dd.urgent { color: var(--danger); }

.pjd-card h1 {
  margin-top: 13px;
  font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.35;
}

.pjd-brand {
  display: flex; align-items: center; gap: 11px;
  margin-top: 16px; padding: 13px 15px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
}
.pjd-brand .grow { min-width: 0; }
.pjd-brand b { display: block; font-size: 14px; font-weight: 700; }
.pjd-brand .grow > span { display: block; font-size: 12px; color: var(--ink-3); }
.pjd-brand .prop {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 700; color: var(--brand);
}

.pjd-facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; margin-top: 16px;
}
.pjd-facts > div { background: var(--surface); padding: 13px 14px; min-width: 0; }
.pjd-facts dt { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pjd-facts dd { margin-top: 5px; font-size: 13.5px; font-weight: 600; }
.pjd-facts dd b { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- 소개 ---------- */
.pjd-desc { margin-top: 12px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.pjd-desc + .pjd-desc { margin-top: 8px; }

.pjd-sub { margin-top: 22px; margin-bottom: 10px; font-size: 13px; font-weight: 800; color: var(--ink-2); }

.pjd-todos { display: flex; flex-direction: column; gap: 9px; }
.pjd-todos li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.pjd-todos svg { flex: none; margin-top: 2px; }

/* ---------- 첨부 파일 ---------- */
.t-h2 .cnt { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--brand); }

.pjd-files { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.pjd-files li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
}
.pjd-files .ft {
  flex: none; width: 42px; height: 42px;
  display: grid; place-items: center; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  background: #EEF0F6; color: var(--ink-2);
}
.pjd-files .ft-pdf { background: #FDECEC; color: #DC2626; }
.pjd-files .ft-jpg { background: #E8F1FE; color: var(--info); }
.pjd-files .ft-ai  { background: #FEF3E2; color: #D97706; }
.pjd-files .grow { min-width: 0; }
.pjd-files b { display: block; font-size: 13.5px; font-weight: 700; }
.pjd-files .grow > span { display: block; font-size: 12px; color: var(--ink-3); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: var(--r-sm); }

/* ---------- 사이드: 진행 단계 ---------- */
.pjd-side-h { font-size: 15px; font-weight: 800; margin-bottom: 16px; }

.pjd-steps { display: flex; flex-direction: column; }
.pjd-steps li {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 20px;
}
.pjd-steps li:last-child { padding-bottom: 0; }
/* 연결선 */
.pjd-steps li:not(:last-child)::before {
  content: ''; position: absolute;
  left: 6px; top: 16px; bottom: 2px; width: 2px;
  background: var(--line);
}
.pjd-steps li.done:not(:last-child)::before { background: var(--ok); }

.pjd-steps .dot {
  position: relative; z-index: 1; flex: none;
  width: 14px; height: 14px; margin-top: 2px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
}
.pjd-steps li.done .dot { background: var(--ok); border-color: var(--ok); }
.pjd-steps li.now .dot {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18);
}

.pjd-steps .tx { min-width: 0; }
.pjd-steps b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.pjd-steps span span { display: block; font-size: 12px; color: var(--ink-3); }
.pjd-steps li.done b { color: var(--ink-2); }
.pjd-steps li.now b { color: var(--brand-ink); }

/* ---------- 사이드: 비슷한 프로젝트 ---------- */
.pjd-others { display: flex; flex-direction: column; gap: 13px; }
.pjd-others a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pjd-others .grow { min-width: 0; }
.pjd-others b { display: block; font-size: 13px; font-weight: 700; }
.pjd-others .grow > span { display: block; font-size: 11.5px; color: var(--ink-3); }
.pjd-others a:hover b { color: var(--brand); }

/* ---------- 반응형 ---------- */
@media (max-width: 1000px) {
  .pjd-body { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 620px) {
  .pjd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pjd-card { padding: 18px 16px; }
}

/* ==========================================================================
   비어 있는 항목 안내 · 내 프로젝트 표시
   ========================================================================== */
.pjd-none {
  padding: 14px 2px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.pjd-own {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  background: #F5F6FA;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ==========================================================================
   제안서 작성 모달
   ========================================================================== */
.pjp-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 26, 35, .55);
}
.pjp-overlay[hidden] { display: none; }

.pjp-modal {
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.pjp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.pjp-head h3 { font-size: 16px; font-weight: 800; }
.pjp-head .icon-btn { font-size: 22px; line-height: 1; color: var(--ink-3); }

.pjp-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.pjp-for {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #F5F6FA;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.pjp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pjp-field { display: grid; gap: 6px; }
.pjp-field > span:first-child {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.pjp-field .req { color: var(--danger); font-style: normal; }

.pjp-field input,
.pjp-field textarea {
  width: 100%;
  padding: 11px 13px;
  background: #FBFBFD;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 14.5px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pjp-field textarea { resize: vertical; line-height: 1.6; }
.pjp-field input:focus,
.pjp-field textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16);
}

/* 금액 · 일수 뒤에 붙는 단위 */
.pjp-suffix { position: relative; display: block; }
.pjp-suffix input { padding-right: 38px; }
.pjp-suffix i {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 13px;
  color: var(--ink-3);
  pointer-events: none;
}

.pjp-err {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-bg);
  color: #B42318;
  font-size: 13px;
  font-weight: 600;
}
.pjp-err[hidden] { display: none; }

.pjp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

@media (max-width: 520px) {
  .pjp-overlay { padding: 0; align-items: flex-end; }
  .pjp-modal { max-width: none; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .pjp-row { grid-template-columns: 1fr; }
}

/* ---------- 받은 제안 (등록자) ---------- */
.pjd-props { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.pjd-prop { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.pjd-prop.st-accepted { border-color: var(--brand); background: var(--brand-tint); }
.pjd-prop.st-rejected { opacity: .6; }
.pjd-prop-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pjd-prop .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pjd-prop .who img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pjd-prop .who b { display: block; font-size: 14px; }
.pjd-prop .who span span { display: block; font-size: 12px; color: var(--ink-3); }
.pjd-prop-st { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); background: #EEF1F6; color: var(--ink-2); }
.st-accepted .pjd-prop-st { background: var(--brand); color: #fff; }
.pjd-prop-terms { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.pjd-prop-terms span { display: inline-flex; align-items: center; gap: 4px; }
.pjd-prop-terms svg { color: var(--ink-3); }
.pjd-prop-msg { margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.pjd-prop-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.pjd-own a { color: var(--brand); font-weight: 600; margin-left: 4px; }
.pjd-own.ok { color: var(--ok); }

/* 관심 프로젝트 */
.pjd-scrap.on { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.pjd-scrap.on svg { fill: currentColor; }
