:root {
  --navy: #14375C;
  --navy-deep: #0e2a47;
  --coral: #EE5A36;
  --cream: #F2EBD5;
  --bg: #f7f8fa;
  --line: #e4e7ec;
  --text: #23303f;
  --muted: #7b8794;
  --green: #1d8a4e;
  --amber: #b97509;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 55, 92, .07), 0 6px 20px rgba(20, 55, 92, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
}
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

/* ---------- 상단 바 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 860px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
}
.topbar img { width: 42px; height: 42px; object-fit: contain; }
.brand-name { font-weight: 800; color: var(--navy); font-size: 17px; line-height: 1.25; }
.brand-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.topbar .right { margin-left: auto; font-size: 12.5px; color: var(--muted); text-align: right; }

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 80px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}

/* ---------- 프로젝트 헤더 ---------- */
.hero { background: var(--navy); color: #fff; border: none; }
.hero .org { color: var(--cream); font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.hero h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; }
.hero .meta { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.75); }

/* 단계 표시 */
.steps { display: flex; margin-top: 20px; gap: 6px; }
.step { flex: 1; text-align: center; position: relative; }
.step .dot {
  width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 700;
}
.step.done .dot { background: var(--coral); color: #fff; }
.step.now .dot { background: #fff; color: var(--navy); box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.step .lbl { font-size: 12px; color: rgba(255,255,255,.75); font-weight: 600; }
.step.done .lbl, .step.now .lbl { color: #fff; }

/* ---------- 섹션 ---------- */
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-num {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  background: var(--navy); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.sec-head h2 { font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.sec-head .spacer { flex: 1; }

/* 상태 뱃지 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 99px; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-waiting { background: #f1f3f5; color: var(--muted); }
.b-designing { background: #e8f0fe; color: #2456a6; }
.b-review { background: #fdeee9; color: var(--coral); }
.b-revising { background: #fdf3e2; color: var(--amber); }
.b-confirmed { background: #e6f4ec; color: var(--green); }

.dday { font-size: 13px; font-weight: 800; color: var(--coral); }
.dday.safe { color: var(--navy); }
.dday.over { color: #c0392b; }
.dday .date { color: var(--muted); font-weight: 500; margin-left: 6px; }

/* ---------- 시안 뷰 ---------- */
.proof {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fafbfc; text-align: center;
}
.proof img { display: block; width: 100%; }
.proof .pdfbox { padding: 34px 20px; }
.proof .vtag {
  background: var(--cream); color: var(--navy); font-weight: 800; font-size: 12.5px;
  padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.proof .vnote { font-weight: 500; color: var(--muted); font-size: 12px; }

.btn {
  border: none; border-radius: 10px; font-weight: 700; font-size: 15px;
  padding: 12px 22px; transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn-confirm { background: var(--navy); color: #fff; }
.btn-revise { background: #fff; color: var(--coral); border: 1.5px solid var(--coral); }
.btn-sub { background: #f1f3f5; color: var(--text); font-size: 13.5px; padding: 9px 16px; }
.btn-coral { background: var(--coral); color: #fff; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.confirmed-banner {
  margin-top: 14px; background: #e6f4ec; color: var(--green);
  border-radius: 10px; padding: 12px 16px; font-weight: 700; font-size: 14.5px;
}

/* 이전 버전 */
details.olds { margin-top: 14px; }
details.olds summary { cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.old-list { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.old-item { width: 130px; font-size: 12px; color: var(--muted); }
.old-item .thumb {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff;
  height: 90px; display: flex; align-items: center; justify-content: center;
}
.old-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 항목 카드 ---------- */
.item-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; background: #fff; }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.item-head .nm { font-weight: 800; font-size: 16px; color: var(--navy); }
.item-head .spec { font-size: 13px; color: var(--muted); background: #f1f3f5; border-radius: 6px; padding: 2px 8px; }
.item-head .spacer { flex: 1; }
.lock-note {
  background: var(--cream); border-radius: 10px; padding: 14px 16px;
  font-size: 13.5px; color: var(--navy); font-weight: 600; margin-bottom: 16px;
}

/* ---------- 안내사항 ---------- */
.notice { background: var(--cream); border: none; }
.notice h3 { color: var(--navy); font-size: 15.5px; font-weight: 800; margin-bottom: 10px; }
.notice ul { list-style: none; }
.notice li { font-size: 14px; color: var(--navy); padding: 4px 0 4px 22px; position: relative; }
.notice li::before { content: '·'; position: absolute; left: 8px; font-weight: 900; color: var(--coral); }

/* ---------- 폼 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.field input[type=text], .field input[type=date], .field textarea, .field select, .field input[type=password] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); }
.field textarea { min-height: 90px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: inline-block; border: 1.5px solid var(--line); border-radius: 99px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: #fff;
}
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 요청서 표 */
table.reqtbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.reqtbl th, table.reqtbl td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.reqtbl th { background: #f7f8fa; color: var(--navy); font-size: 12.5px; white-space: nowrap; width: 92px; }
table.reqtbl td { white-space: pre-wrap; }

/* ---------- 모달 ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(14, 42, 71, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow: auto;
}
.modal h3 { color: var(--navy); font-size: 17px; margin-bottom: 14px; }

/* ---------- 뒤로가기 ---------- */
.backlink { font-size: 13.5px; color: var(--muted); cursor: pointer; font-weight: 600; margin-bottom: 14px; display: inline-block; }
.backlink:hover { color: var(--navy); }

/* 파일 드래그앤드롭 */
.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 26px 16px;
  text-align: center; color: var(--muted); font-size: 14px; font-weight: 600;
  cursor: pointer; background: #fafbfc; transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--coral); background: #fdeee9; color: var(--coral); }
.ref-list { margin-top: 10px; text-align: left; }
.ref-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin-top: 6px;
}
.ref-item .rm { margin-left: auto; color: #c0392b; font-weight: 800; cursor: pointer; padding: 0 4px; }

/* 기본 규격 안내 */
.spec-guide {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.7;
}
.spec-guide b { color: var(--navy); }

/* 작업 순서 뱃지 */
.order-chip {
  display: inline-flex; align-items: center; background: var(--navy); color: #fff;
  font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 3px 9px; white-space: nowrap;
}
.move-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 6px;
  width: 26px; height: 26px; font-size: 12px; color: var(--navy); line-height: 1; padding: 0;
}
.move-btn:hover { border-color: var(--navy); }

/* 요청서 단계 라벨 */
.step-tag {
  display: inline-block; background: var(--coral); color: #fff; font-size: 11.5px; font-weight: 800;
  border-radius: 6px; padding: 3px 9px; letter-spacing: .05em; margin-bottom: 8px;
}

/* ---------- 푸터 ---------- */
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 20px; }
.footer img { width: 34px; opacity: .85; margin-bottom: 6px; }
.footer b { color: var(--navy); }

/* ---------- 토스트 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--navy-deep); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 99px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200; max-width: 90vw;
}
#toast.on { opacity: 1; }

@media (max-width: 640px) {
  .card { padding: 18px; }
  .hero h1 { font-size: 21px; }
  .step .lbl { font-size: 10.5px; }
  .row2 { grid-template-columns: 1fr; }
  .btn-row .btn { flex: 1; text-align: center; }
}
