/* ===== 탈퇴·청약철회 진단 (withdraw.js, 재개발 계산기와 같은 틀) ===== */
.wd-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: wd; }
.wd-steps li { counter-increment: wd; }
.wd-steps button { display: block; width: 100%; padding: 10px 4px 9px; border: 0; border-radius: 12px; background: var(--bg); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2); line-height: 1.3; cursor: pointer; }
.wd-steps button::before { content: counter(wd); display: block; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; background: #fff; color: var(--muted); font-size: 12px; line-height: 22px; box-shadow: inset 0 0 0 1.5px var(--line); }
.wd-steps li.done button { background: var(--primary-bg); color: var(--primary); }
.wd-steps li.done button::before { content: "✓"; background: var(--primary); color: #fff; box-shadow: none; }
.wd-pg + .wd-pg { margin-top: 4px; }
.wd-mbar { display: none; }
.wd-q { padding: 14px 4px 6px; }
.wd-q > p:first-child { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--text); }
.wd-safe { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #F0FAF4; color: #1F6B45; font-size: 13.5px; }
.wd-note { margin: 8px 0 4px; }
.wd-doc .rd-seg { margin-bottom: 6px; }
.rd-in input[type="date"] { width: 180px; text-align: left; font-weight: 600; }
.wd-text .rd-in input { width: 300px; max-width: 100%; text-align: left; font-weight: 600; }
.wd-acct { margin: 12px 0 2px; padding: 12px 14px 4px; border-radius: 12px; background: var(--bg); }
.wd-acct > p { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.wd-acct > p small { display: block; margin-top: 2px; font-weight: 500; color: var(--muted); }
.wd-acct .rd-row { border-bottom-color: #E5E8EC; }
.wd-text .rd-in select { width: 300px; max-width: 100%; text-align: left; font-weight: 600; }
.wd-acct-t { width: 100%; margin: -2px 0 12px; border-collapse: collapse; font-size: 14px; }
.wd-acct-t th { width: 64px; padding: 5px 8px; border: 1px solid #C9CED6; background: #F6F7F9; font-weight: 700; white-space: nowrap; }
.wd-acct-t td { padding: 5px 10px; border: 1px solid #C9CED6; font-weight: 600; }
.wd-att { margin: 12px 0 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.wd-att > p { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.wd-att > p small { font-weight: 500; color: var(--muted); }
.wd-att .rd-check { font-weight: 600; font-size: 14.5px; }
/* 쪽 머리말 · 카드 · 만들 문서 고르기 */
.wd-pg { margin: 0 0 22px; }
.wd-pg-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; }
.wd-pg-head > span { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; }
.wd-pg-head h3 { margin: 2px 0 2px; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.wd-pg-head p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.wd-card { margin: 0 0 12px; padding: 4px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.wd-card .rd-row:last-child { border-bottom: 0; }
.wd-card-t { margin: 10px 0 2px; font-size: 14.5px; font-weight: 800; }
.wd-card-t small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.wd-card.wd-acct, .wd-card.wd-att { background: #fff; }
.wd-card.wd-att { padding-bottom: 10px; }
.wd-kinds { margin: 14px 0 0; }
.wd-kinds-t { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.wd-kind { display: block; margin: 0 0 8px; cursor: pointer; }
.wd-kind input { position: absolute; opacity: 0; pointer-events: none; }
.wd-kind span { display: block; padding: 14px 16px 13px 46px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); position: relative; }
.wd-kind span::before { content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px #C5CBD3; background: #fff; }
.wd-kind b { display: block; font-size: 16px; font-weight: 800; }
.wd-kind small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.wd-kind input:checked + span { background: var(--primary-bg); box-shadow: inset 0 0 0 2px var(--primary); }
.wd-kind input:checked + span::before { box-shadow: inset 0 0 0 6px var(--primary); }
.wd-kind input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.wd-more { margin: 0 0 12px; border-radius: 14px; background: var(--bg); }
.wd-more summary { padding: 13px 14px; font-size: 14.5px; font-weight: 700; cursor: pointer; list-style: none; }
.wd-more summary::-webkit-details-marker { display: none; }
.wd-more summary::before { content: "＋ "; color: var(--primary); }
.wd-more[open] summary::before { content: "－ "; }
.wd-more summary small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.wd-more .rd-row { margin: 0 14px; }
.wd-link { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* 결과: D-day · 30일 진행 막대 · 달력 */
.rd-hero.wd-hero small b { display: inline; margin: 0; font-size: inherit; font-weight: 800; color: var(--text); letter-spacing: 0; }
.wd-line { margin: 14px 0 6px; }
.wd-bar { position: relative; height: 10px; border-radius: 999px; background: #EEF0F3; }
.wd-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #2BB673, #F2A93B); }
.wd-line.over .wd-bar i { background: #E5383B; }
.wd-bar em { position: absolute; top: 14px; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; background: var(--text); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; white-space: nowrap; }
.wd-ends { display: flex; justify-content: space-between; margin-top: 30px; font-size: 12px; color: var(--muted); }
.rd-hero .wd-ends b { display: inline; margin: 0 0 0 4px; font-size: 13px; letter-spacing: 0; color: var(--text); }
.wd-cal { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; height: 40px; padding: 0 14px; border: 1.5px solid var(--primary); border-radius: 10px; background: #fff; color: var(--primary); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.rd-hero .wd-cal small { display: inline; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
/* 서명 */
.wd-sign-pad { position: relative; margin-top: 8px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.wd-sign-pad canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.wd-sign-pad::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 34px; border-bottom: 1.5px dashed #D5DAE1; pointer-events: none; }
.wd-sign-hint { position: absolute; left: 0; right: 0; top: 52px; text-align: center; font-size: 15px; font-weight: 700; color: #C5CBD3; pointer-events: none; }
.wd-sign-pad button { position: absolute; right: 8px; top: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; }
/* 문서: A4 종이처럼 */
.wd-paper { margin: 18px 0 0; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; background: var(--bg); }
.wd-paper-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.wd-paper-head b { display: block; font-size: 14.5px; }
.wd-paper-head small { font-size: 12px; color: var(--muted); }
.wd-btns { display: flex; gap: 6px; }
.wd-btns button { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; }
.wd-btns button:last-child { background: var(--primary); border-color: var(--primary); color: #fff; }
.wd-sheet { padding: 4px 14px 16px; }
.wd-letter { max-width: 640px; margin: 0 auto; padding: 34px 32px 30px; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px -12px rgba(15,23,42,.25); font-size: 14.5px; line-height: 1.8; word-break: keep-all; color: #111827; }
.wd-letter h5 small { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: 2px; color: #4B5563; }
.wd-letter h5 { margin: 0 0 20px; padding-bottom: 12px; text-align: center; font-size: 20px; font-weight: 800; letter-spacing: 1px; border-bottom: 3px double #111827; text-wrap: balance; }
.wd-meta { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.wd-meta th { width: 64px; padding: 6px 8px; border: 1px solid #C9CED6; background: #F6F7F9; font-weight: 800; letter-spacing: 2px; vertical-align: middle; white-space: nowrap; }
.wd-meta td { padding: 5px 10px; border: 1px solid #C9CED6; }
.wd-meta td.wd-sub { font-size: 13px; color: #374151; }
.wd-letter p { margin: 0 0 10px; }
.wd-letter mark { display: inline-block; height: 1.25em; vertical-align: -0.2em; border-radius: 4px; background: #FFF3B0; }
.wd-letter mark.wd-s { width: 5.5em; } .wd-letter mark.wd-l { width: min(14em, 60%); }
.wd-letter .wd-attach { margin-top: 16px; padding-top: 10px; border-top: 1px solid #E5E7EB; font-size: 13.5px; }
.wd-attach b { margin-right: 10px; }
.wd-attach span { display: block; padding-left: 40px; }
.wd-letter .wd-date { margin: 22px 0 6px; text-align: center; }
.wd-letter .wd-sign { margin: 0 0 22px; text-align: right; font-weight: 700; }
.wd-sig { height: 46px; max-width: 150px; margin-left: 6px; vertical-align: middle; }
.wd-seal { display: inline-block; margin-left: 6px; color: #9CA3AF; }
.wd-letter .wd-to { margin: 0; padding-top: 14px; border-top: 1px solid #111827; text-align: center; font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.wd-to small { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 700; color: #4B5563; letter-spacing: 0; }
.wd-meta td small { font-size: 12px; color: #6B7280; }
.wd-how ol { margin: 8px 0 0; padding-left: 20px; font-size: 14.5px; line-height: 1.7; }
.wd-how li { margin-bottom: 6px; }
.wd-todo { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--bg); }
.wd-todo .rd-check { font-weight: 600; font-size: 14.5px; }
@media (max-width: 640px) {
  .wd-steps { gap: 4px; } .wd-steps li { padding: 8px 2px; font-size: 11.5px; }
  #withdraw .rd-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }   /* 이름이 세 줄로 접히지 않게 이름 아래 입력칸 */
  #withdraw .rd-in { display: flex; } #withdraw .rd-in input { flex: 1; width: auto; min-width: 0; }
  .wd-text .rd-in, .wd-text .rd-in input, .rd-in input[type="date"] { width: 100%; }
  .wd-btns { width: 100%; } .wd-btns button { flex: 1; }
  .wd-sheet { padding: 0 8px 10px; }
  .wd-letter { padding: 24px 16px 22px; font-size: 13.5px; }
  .wd-letter h5 { font-size: 17px; }
  .wd-meta { font-size: 13px; } .wd-meta th { width: 52px; letter-spacing: 0; }
  .wd-attach span { padding-left: 0; }
}
/* ===== 폰: 앱처럼 한 단계씩 ===== */
@media (max-width: 720px) {
  .wd-app .wd-pg { display: none; }
  .wd-app .wd-pg.on { display: block; animation: wdIn .18s ease; }
  .wd-pg-head h3 { font-size: 17px; } .wd-card { padding: 2px 12px; }
  .wd-app .wd-steps { position: sticky; top: 56px; z-index: 6; margin: 0 -16px 14px; padding: 8px 16px; background: rgba(255,255,255,.97); box-shadow: 0 1px 0 var(--line); }
  .wd-app .wd-steps button { padding: 7px 2px 6px; font-size: 11.5px; }
  .wd-app .wd-steps button::before { width: 20px; height: 20px; line-height: 20px; margin-bottom: 3px; }
  .wd-app .wd-steps li.on button { background: var(--primary); color: #fff; }
  .wd-app .wd-steps li.on button::before { background: #fff; color: var(--primary); box-shadow: none; }
  .wd-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #111827; color: #fff; transform: translateY(110%); transition: transform .2s ease; }
  body.wd-bar-on:not(.wd-typing) .wd-mbar { transform: none; }
  body.wd-bar-on { padding-bottom: 76px; }
  .wd-mbar small { display: block; font-size: 11.5px; color: #9CA3AF; }
  .wd-mbar strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
  .wd-mbar span { display: flex; gap: 6px; flex: none; }
  .wd-mbar button { height: 46px; padding: 0 16px; border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
  .wd-mprev { background: #374151; color: #fff; }
  .wd-mnext { min-width: 84px; background: var(--primary); color: #fff; }
  .rd-toast { bottom: 96px; }
}
@keyframes wdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wd-app .wd-pg.on { animation: none; } .wd-mbar { transition: none; } }
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body.wd-printing > *:not(#wdPrintArea) { display: none !important; }
  body.wd-printing { background: #fff !important; padding: 0 !important; }
  #wdPrintArea { display: none; }
  body.wd-printing #wdPrintArea { display: block; }
  body.wd-printing #wdPrintArea .wd-letter { max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; font-size: 11pt; }
  body.wd-printing .wd-letter mark { background: none; border-bottom: 1px solid #000; border-radius: 0; }
  body.wd-printing .wd-seal { color: #000; }
}
/* 법정 서식 (주택법 시행규칙 별지 제14호의4서식) */
.wd-form { font-size: 14px; line-height: 1.65; }
.wd-form-src { margin: 0 0 6px !important; font-size: 11.5px; color: #4B5563; }
.wd-letter .wd-form-t { margin: 0 0 14px; padding-bottom: 8px; border-bottom: 0; font-size: 22px; letter-spacing: 6px; }
.wd-letter .wd-form-t small { letter-spacing: 2px; }
.wd-ft { width: 100%; table-layout: fixed; border-collapse: collapse; border-top: 2px solid #111827; border-bottom: 2px solid #111827; font-size: 13.5px; }
.wd-ft th { width: 92px; padding: 8px 6px; border: 1px solid #9CA3AF; border-left: 0; background: #F6F7F9; font-weight: 700; text-align: center; vertical-align: middle; line-height: 1.45; }
.wd-ft td { padding: 8px 10px; border: 1px solid #9CA3AF; vertical-align: middle; }
.wd-ft td:last-child { border-right: 0; }
.wd-ft td.sub { width: 82px; text-align: center; background: #FAFAFB; font-weight: 600; line-height: 1.45; }
.wd-ft td.w30 { width: 34%; }
.wd-ft .k { display: block; font-size: 11.5px; color: #6B7280; }
.wd-ft td.nw { white-space: nowrap; }
.wd-letter .wd-form-st { margin: 14px 0 10px; text-indent: 0.6em; }
.wd-letter .wd-r { text-align: right; margin: 18px 0 6px; }
.wd-letter .wd-form-to { margin: 18px 0 0; display: flex; align-items: center; gap: 14px; font-size: 15px; }
.wd-form-to b { text-align: center; line-height: 1.3; font-size: 16px; }
.wd-cut { position: relative; margin: 22px 0 14px; border-top: 2px dashed #6B7280; text-align: center; }
.wd-cut span { position: relative; top: -11px; padding: 0 12px; background: #fff; font-size: 12px; letter-spacing: 4px; color: #4B5563; }
.wd-letter .wd-form-t2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 19px; letter-spacing: 6px; }
.wd-letter .wd-recv { margin: 12px 0 0; padding-left: 40%; line-height: 2; }
.wd-letter .wd-form-foot { margin: 14px 0 0; font-size: 11.5px; color: #6B7280; text-align: center; }
.wd-break { margin: 26px -32px; border-top: 6px solid #EEEBE2; text-align: center; }
.wd-break span { position: relative; top: -12px; padding: 2px 10px; border-radius: 999px; background: #EEEBE2; font-size: 11.5px; font-weight: 700; color: #6B655A; }
.wd-cover { margin: 14px 0 0; }
.wd-cover small { display: block; font-weight: 500; color: #9A9384; }
@media (max-width: 640px) {
  .wd-ft { font-size: 12.5px; } .wd-ft th { width: 66px; padding: 6px 3px; } .wd-ft td.sub { width: 60px; }
  .wd-letter .wd-recv { padding-left: 25%; }
  .wd-break { margin: 22px -16px; }
}
@media print {
  body.wd-printing .wd-break { break-before: page; page-break-before: always; height: 0; margin: 0; border: 0; }
  body.wd-printing .wd-break span { display: none; }
  body.wd-printing .wd-cut span { background: #fff; }
}
/* 접수증 아래 모집주체·주소·대표자: 이름표와 쓰는 칸을 한 줄씩 맞춤 */
.wd-letter table.wd-recv { width: 62%; margin: 14px 0 0 auto; border-collapse: collapse; font-size: 13.5px; }
.wd-recv th { width: 76px; padding: 9px 0 3px; text-align: left; font-weight: 700; letter-spacing: 4px; vertical-align: bottom; }
.wd-recv td { padding: 9px 0 3px; border-bottom: 1px solid #9CA3AF; text-align: right; vertical-align: bottom; }
@media (max-width: 640px) { .wd-letter table.wd-recv { width: 88%; } }
@media print {
  @page { size: A4; margin: 14mm 15mm; }
  body.wd-printing #wdPrintArea .wd-letter { font-size: 10.5pt; line-height: 1.6; }
  body.wd-printing .wd-form-foot { display: none; }
  body.wd-printing .wd-letter p { margin-bottom: 7px; }
  body.wd-printing .wd-ft th, body.wd-printing .wd-ft td { padding-top: 6px; padding-bottom: 6px; }
  body.wd-printing .wd-letter .wd-date { margin-top: 14px; }
  body.wd-printing .wd-letter .wd-sign { margin-bottom: 14px; }
}

/* 오와 열: 두 장 모든 표의 칸 너비를 같게, 번호 문단은 내어쓰기, 이름표는 양끝 맞춤 */
.wd-ft { table-layout: fixed; }
.wd-ft th { width: 96px; }
.wd-ft td.sub { width: 92px; }
.wd-ft-in { margin: 4px 0 12px; }
.wd-ft td { font-weight: 500; }
.wd-letter .wd-num { padding-left: 1.3em; text-indent: -1.3em; }
.wd-letter .wd-form-st { text-indent: 0; }
.wd-attach b { display: block; margin: 0 0 2px; }
.wd-attach span { padding-left: 1.3em; }
.wd-recv th { text-align-last: justify; letter-spacing: 0; padding-right: 14px; }
.wd-letter table.wd-recv { width: 58%; }
@media (max-width: 640px) {
  .wd-ft th { width: 70px; } .wd-ft td.sub { width: 66px; }
  .wd-letter table.wd-recv { width: 86%; }
}

/* 둘째 장: 제목 아래 이중선과 표 윗줄이 겹치지 않게, 표와 본문 사이 간격 */
.wd-letter > h5:not(.wd-form-t):not(.wd-form-t2) { border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
.wd-letter .wd-ft + .wd-num { margin-top: 14px; }
.wd-letter .wd-ft-in + .wd-num { margin-top: 10px; }

/* 빈 양식 인쇄 */
.wd-blankbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #F3F1EA; font-size: 14.5px; }
.wd-blankbar b { margin-right: 4px; }
.wd-blankbtns { display: flex; gap: 6px; }
.wd-blankbtns button { height: 38px; padding: 0 12px; border: 1px solid #CFC8B6; border-radius: 9px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: #23201B; cursor: pointer; }
.wd-blank-link { display: block; width: 100%; margin-top: 6px; text-align: right; font-size: 13.5px; }
.wd-ymd { letter-spacing: 1px; }
/* 손으로 쓸 칸은 넉넉하게 */
.wd-handwrite mark.wd-s { width: 9em; height: 1.6em; }
.wd-handwrite mark.wd-l { width: 70%; height: 1.6em; }
.wd-handwrite .wd-ft td { height: 34px; }
@media print { body.wd-printing .wd-handwrite .wd-ft td { height: 30px; } }
@media (max-width: 640px) { .wd-blankbtns { width: 100%; } .wd-blankbtns button { flex: 1; } }
/* 빈 양식: 표 칸 안에 밑줄 하나만 있으면 칸 자체가 쓰는 자리라 밑줄을 숨김 */
.wd-handwrite .wd-ft td > mark:only-child { visibility: hidden; }

/* 인쇄용 문서는 화면에 보이지 않게 (인쇄할 때만 꺼냄) */
@media screen { #wdPrintArea { display: none; } }
/* 30일 지났는데 청약 철회를 고른 경우 */
.wd-warn { margin: 8px 0 4px; padding: 10px 12px; border-left: 3px solid #C2410C; background: #FFF4EC; font-size: 14.5px; line-height: 1.55; color: #7C2D12; text-wrap: pretty; }
.wd-blankbar > span:first-child { text-wrap: balance; }
.wd-nw { font-style: normal; white-space: nowrap; }
