/* ============================================================
   Mastera - 계약서 작성/출력 스타일
   ============================================================ */

/* ─── Templates Page ─── */
.contract-templates-page {
  padding: 48px 0 80px;
}
.contract-templates-page .info-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--primary);
}
.contract-templates-page .info-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 8px;
}
.contract-templates-page .info-header p {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.template-card {
  border: 1.5px solid var(--border);
  background: var(--white);
  padding: 28px 24px 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.template-card:not(.disabled):hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.template-card.disabled {
  opacity: 0.55;
}

.template-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  background: var(--bg-alt);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.template-card-badge.avail {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.template-card-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-dark);
}

.template-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.template-card p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 18px;
}

.template-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.template-card-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-alt);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

.template-card-btns {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}
.template-card-btns .template-card-btn {
  flex: 1;
  border-radius: 4px;
  margin-top: 0;   /* 래퍼(.template-card-btns)가 margin-top:auto 담당 */
}
.template-card-btn {
  display: block;
  width: 100%;
  height: 42px;
  background: var(--primary);
  color: var(--accent);
  border: none;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  line-height: 42px;
  letter-spacing: 0.02em;
  margin-top: auto;       /* 카드 하단 정렬 */
  border-radius: 4px;
}
.template-card-btn:hover {
  background: var(--sub-navy);
}
.template-card-btn--popup {
  background: #f0f2f7;
  color: var(--primary);
  border-left: 1px solid #dde2ec;
  font-weight: 600;
}
.template-card-btn--popup:hover {
  background: #e2e6f0;
}
.template-card-btn.soon {
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: not-allowed;
  margin-top: auto;
}

.contract-notice {
  padding: 16px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── Wizard Page ─── */
.contract-wizard-page {
  padding: 40px 0 80px;
}
.contract-wizard-page.popup-mode {
  padding-top: 0;
  background: #f7f8fa;
}
.contract-wizard-page .wrap {
  max-width: 680px;
}

/* ── 팝업 닫기 바 ── */
.popup-close-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.popup-close-bar strong {
  font-size: 14px;
  color: var(--text-body);
  font-weight: 700;
}
.popup-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1;
  padding: 3px 8px;
  border-radius: 4px;
  transition: background .15s;
}
.popup-close-btn:hover { background: #e5e7eb; color: #333; }

/* Split wrap (overrides default wrap width) */
.wizard-split-wrap {
  max-width: 1200px;
  width: 100%;
  padding: 0 24px;
  margin: 0 auto;
}
.wizard-split {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 28px;
  align-items: start;
}
.wizard-panel {
  /* left column - existing wizard styles apply */
}

/* ── Preview Panel ── */
.preview-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  background: #fff;
  box-shadow: var(--shadow-md);
}

/* 패널 헤더 - 심플 라이브 인디케이터 */
.preview-panel-hd {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--primary);
  color: rgba(255,255,255,0.9);
}
.preview-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: pv-pulse 1.6s ease-in-out infinite;
}
@keyframes pv-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
  50%       { opacity: 0.5; box-shadow: 0 0 0 4px rgba(74,222,128,0); }
}
.preview-hd-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-doc {
  padding: 28px 32px;
  font-family: 'Malgun Gothic', '맑은 고딕', AppleGothic, sans-serif;
  font-size: 12.5px;
  line-height: 1.85;
  color: #333;
  position: relative;
}

/* PREVIEW 워터마크 */
.preview-doc-stamp {
  position: absolute;
  top: 24px;
  right: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(100,120,200,.18);
  border: 1.5px solid rgba(100,120,200,.15);
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
}

/* 문서 제목 */
.preview-doc-main-title {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #111;
  margin-bottom: 4px;
  padding-top: 4px;
}

/* 제목 아래 장식선 */
.preview-doc-title-rule {
  margin: 8px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.preview-doc-title-rule::before,
.preview-doc-title-rule::after {
  content: '';
  display: block;
  height: 1px;
  width: 48px;
  background: #333;
}
.preview-doc-title-rule::after { background: #333; }
/* 가운데 마름모 */
.preview-doc-title-rule {
  position: relative;
}
.preview-doc-title-rule::before {
  flex: 1;
  max-width: 60px;
}
.preview-doc-title-rule::after {
  flex: 1;
  max-width: 60px;
}
/* 가운데 점 추가 - pseudo 2개 모자라면 box-shadow 활용 */
.preview-doc-title-rule {
  width: 160px;
  height: 8px;
  background: radial-gradient(circle, #333 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  background-repeat: no-repeat;
  background-position: center;
}
/* 깔끔하게 단순화 */
.preview-doc-title-rule {
  margin: 6px auto 18px;
  width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, #888 30%, #333 50%, #888 70%, transparent);
}
.preview-preamble {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
  font-size: 12.5px;
  line-height: 1.85;
}
.preview-article {
  margin-bottom: 12px;
}
.preview-article h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: #111;
  margin-bottom: 3px;
}
.preview-article p,
.preview-article li {
  font-size: 12px;
  color: #444;
  line-height: 1.8;
}
.preview-article ol {
  padding-left: 16px;
  margin: 2px 0;
}

/* 표준 조항 - 내용은 그대로 보이되 남색 계열로 구분 */
.preview-article--std,
.doc-article--std {
  border-left: 2px solid #3b5fa0;
  padding-left: 8px;
}
.preview-article--std .preview-article-title,
.doc-article--std .doc-article-title {
  color: #2c4a8a !important;
}
.preview-article--std,
.preview-article--std p,
.preview-article--std li,
.preview-article--std ol,
.preview-article--std ul,
.doc-article--std,
.doc-article--std p,
.doc-article--std li,
.doc-article--std ol,
.doc-article--std ul {
  color: #3a5080 !important;
  opacity: 0.85;
}
/* 표준 조항 근거 배지 */
.doc-std-basis {
  display: inline-block;
  font-size: 10.5px;
  color: #2c4a8a;
  background: #edf1fa;
  border: 1px solid #b8c8e8;
  border-radius: 3px;
  padding: 2px 7px;
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: .01em;
}
.doc-std-basis::before {
  content: '⚖ ';
}
/* 표준 조항 안내 배지 */
.preview-std-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: #e8eef8;
  border: 1px solid #b0c4e8;
  border-radius: 4px;
  font-size: 10px;
  color: #2c4a8a;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.01em;
}
/* 더 이상 사용하지 않지만 혹시 남아있는 경우 */
.preview-std-note { display: none; }

/* Live value spans */
.preview-val {
  font-weight: 700;
  color: var(--accent-dark);
  border-bottom: 1.5px dashed var(--accent);
  padding: 0 2px;
  transition: color 0.2s;
}
.preview-val.empty {
  color: #ccc;
  border-color: #e5e5e5;
  font-weight: 400;
}

/* Sign section */
.preview-sign {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}
.preview-sign-date {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}
.preview-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.preview-sign-party {
  padding: 10px 12px;
  border: 1px solid #ddd;
  font-size: 11.5px;
}
.preview-sign-party + .preview-sign-party { border-left: none; }
.preview-sign-party dt {
  font-weight: 700;
  font-size: 11px;
  color: #666;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.preview-sign-party dd {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: #333;
}

/* Mobile toggle button */
.preview-toggle-btn {
  display: none;
  width: 100%;
  height: 40px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-sub);
  cursor: pointer;
  margin-bottom: 16px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--transition);
}
.preview-toggle-btn:hover { background: var(--border); }

.wizard-header {
  margin-bottom: 28px;
}
.wizard-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}
.wizard-header p {
  font-size: 13px;
  color: var(--text-muted);
}
.wizard-header a {
  font-size: 12px;
  color: var(--accent-dark);
  text-decoration: none;
}
.wizard-header a:hover { text-decoration: underline; }

/* Progress */
.wizard-progress {
  margin-bottom: 32px;
}
.wizard-progress-bar-wrap {
  height: 3px;
  background: var(--bg-alt);
  margin-bottom: 10px;
}
.wizard-progress-bar {
  height: 3px;
  background: var(--accent);
  transition: width 0.35s ease;
}
.wizard-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.wizard-progress-info strong {
  color: var(--accent-dark);
  font-weight: 700;
}

/* Step panels */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

.wizard-step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.wizard-step-num {
  display: inline-flex;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Form groups */
.wiz-group {
  margin-bottom: 20px;
}
.wiz-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.wiz-group .req { color: #c55; margin-left: 2px; }
.wiz-group .opt { font-weight: 400; color: var(--text-muted); margin-left: 4px; font-size: 12px; }
.wiz-group .hint,
.wiz-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
  padding: 4px 8px;
  background: #f5f6f8;
  border-left: 2px solid var(--border);
  border-radius: 0 3px 3px 0;
}

.wiz-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.wiz-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,126,0.12);
}
.wiz-input::placeholder { color: var(--text-muted); }
.wiz-input + .wiz-input { margin-top: 8px; }

.wiz-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 90px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.wiz-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,126,0.12);
}

/* Radio / Checkbox */
.wiz-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.wiz-choice-lbl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  background: var(--white);
  transition: var(--transition);
  user-select: none;
}
.wiz-choice-lbl:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
}
.wiz-choice-lbl input { accent-color: var(--accent-dark); width: 14px; height: 14px; }

/* Two-column row */
.wiz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wiz-row-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

/* Number input with unit */
.wiz-num-wrap { position: relative; }
.wiz-num-wrap .wiz-input { padding-right: 38px; text-align: right; }
.wiz-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── VAT 선택 UI ── */
.wiz-vat-wrap {
  margin-top: 8px;
}
.wiz-vat-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wiz-vat-lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-body);
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color .15s, background .15s;
}
.wiz-vat-lbl:has(input:checked) {
  border-color: var(--accent-dark);
  background: #eef2fb;
  color: var(--accent-dark);
  font-weight: 600;
}
.wiz-vat-lbl input { display: none; }
.wiz-vat-result {
  margin-top: 7px;
  padding: 7px 11px;
  background: #f0f4fb;
  border: 1px solid #c5d3ee;
  border-radius: 6px;
  font-size: 12px;
  color: #334e82;
  line-height: 1.6;
}
.wiz-vat-result b { color: #1f3a72; }
/* 인쇄본 VAT 표시 */
.doc-vat-row {
  display: block;
  margin-top: 4px;
  font-size: .88em;
  color: #334e82;
  background: #f0f4fb;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #c5d3ee;
}
.doc-vat-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 10px 14px;
  background: #f0f4fb;
  border: 1px solid #c5d3ee;
  border-radius: 6px;
  font-size: .9em;
  color: #334e82;
}
.doc-vat-label {
  font-weight: 700;
  font-size: .82em;
  white-space: nowrap;
  background: #3b5fa0;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
}

/* Special terms dynamic list */
.special-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.special-item { display: flex; gap: 8px; align-items: flex-start; }
.special-item .wiz-textarea { flex: 1; min-height: 72px; }
.special-del {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 5px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.special-del:hover { border-color: #d44; color: #d44; }

.special-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px dashed var(--border);
  background: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.special-add:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.wiz-btn {
  height: 48px;
  padding: 0 26px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.wiz-btn-prev {
  background: var(--bg-alt);
  color: var(--text-sub);
  border: 1.5px solid var(--border);
}
.wiz-btn-prev:hover { background: var(--border); }
.wiz-btn-prev:disabled { visibility: hidden; }
.wiz-btn-next {
  background: var(--primary);
  color: var(--accent);
  flex: 1;
  max-width: 200px;
}
.wiz-btn-next:hover { background: var(--sub-navy); }
.wiz-btn-submit {
  background: var(--accent-dark);
  color: var(--white);
  flex: 1;
  max-width: 240px;
}
.wiz-btn-submit:hover { background: var(--accent); color: var(--primary); }

/* ─── Print / Preview Page ─── */
.contract-print-page {
  padding: 32px 0 80px;
}
.contract-print-page .wrap {
  max-width: 860px;
}

.print-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.print-toolbar h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
}
.print-btns { display: flex; gap: 10px; }

.print-btn {
  height: 42px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.print-btn-primary { background: var(--primary); color: var(--accent); }
.print-btn-primary:hover { background: var(--sub-navy); }
.print-btn-secondary { background: var(--bg-alt); color: var(--text); border: 1.5px solid var(--border); }
.print-btn-secondary:hover { background: var(--border); }

/* ─── Contract Document ─── */
.contract-doc {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  padding: 64px 80px;
  font-family: 'Malgun Gothic', '맑은 고딕', AppleGothic, sans-serif;
  font-size: 14px;
  color: #222;
  line-height: 1.9;
}

.doc-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 2px solid #333;
}

.doc-preamble {
  font-size: 14px;
  color: #333;
  line-height: 1.9;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.doc-article {
  margin-bottom: 20px;
}
.doc-article h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}
.doc-article > ol {
  padding-left: 22px;
  margin: 0;
}
.doc-article > ol > li {
  font-size: 14px;
  color: #333;
  line-height: 1.85;
  margin-bottom: 4px;
}
/* 가나다 sub-items */
.doc-article > ol > li > ol {
  list-style: none;
  padding-left: 10px;
  margin-top: 4px;
}
.doc-article > ol > li > ol > li {
  font-size: 13.5px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 3px;
}
.doc-article > ol > li > ol > li::before {
  content: attr(data-ko) '. ';
  font-weight: 600;
  color: #222;
}

.doc-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 24px 0;
}

.doc-special {
  margin-top: 8px;
  padding: 16px 20px;
  background: #fafafa;
  border: 1px solid #eee;
}
.doc-special h4 {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}
.doc-special ol { padding-left: 20px; }
.doc-special li { font-size: 13.5px; color: #444; line-height: 1.8; margin-bottom: 5px; }

.doc-sign-date {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 28px;
}

.doc-sign-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.doc-sign-party {
  padding: 18px 22px;
  border: 1px solid #ddd;
}
.doc-sign-party + .doc-sign-party { border-left: none; }
.doc-sign-party dt {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.doc-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: #333;
  margin-bottom: 7px;
}
.sign-line {
  display: inline-block;
  min-width: 80px;
  border-bottom: 1px solid #bbb;
  text-align: center;
  font-size: 11px;
  color: #bbb;
  padding-bottom: 1px;
}

/* ─── Print Media ─── */
@media print {
  /* 불필요한 요소 숨기기 */
  .print-toolbar,
  .contract-notice,
  .topbar,
  .header,
  .cat-nav,
  .music-mini-bar,
  footer,
  .footer { display: none !important; }

  /* 여백·배경 제거 */
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  /* 문서 컨테이너 초기화 - position: fixed 절대 사용 금지 */
  .contract-print-page {
    padding: 0 !important;
  }
  .contract-print-page .wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .contract-doc {
    box-shadow: none !important;
    border: none !important;
    padding: 15mm 20mm !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* 페이지 나뉠 때 조항 잘리지 않게 */
  .doc-article {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .doc-sign-parties {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* ─── Template Group Label ─── */
.template-group { margin-bottom: 40px; }
.template-group-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #eee);
}

/* ─── Preview visible toggle (mobile) ─── */
.preview-panel.preview-visible { display: block !important; }

/* ─── doc-confirm-table ─── */
.doc-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin: .75em 0;
  font-size: .9em;
}
.doc-confirm-table th,
.doc-confirm-table td {
  border: 1px solid #d0d0d0;
  padding: 7px 12px;
  text-align: left;
}
.doc-confirm-table th {
  background: #f5f5f5;
  font-weight: 600;
  width: 120px;
}
/* 표 안의 .doc-en 은 인라인으로 나란히 표시 */
.doc-confirm-table .doc-en,
.doc-bilingual .doc-confirm-table .doc-en {
  display: inline !important;
  margin-left: .35em;
  font-size: .88em;
  color: #6a7d9e;
  font-style: italic;
}
/* 영문 병기 모드에서 왼쪽 열(필드명) 너비 축소 */
.doc-bilingual .doc-confirm-table th,
.doc-bilingual .doc-confirm-table td:first-child,
.preview-bilingual .doc-confirm-table th,
.preview-bilingual .doc-confirm-table td:first-child {
  width: 100px;
  white-space: nowrap;
}
}
.doc-agree-note {
  margin-top: 1em;
  font-weight: 600;
  text-align: center;
}

/* ─── 한/영 병기 스타일 ─── */
/* 기본: 영문 숨김 (단일 언어 모드) */
.doc-en {
  display: none;
}
/* 영문 병기 모드: 인라인으로 나란히 표시 */
.doc-bilingual .doc-en,
.preview-doc.preview-bilingual .doc-en {
  display: inline;
  font-size: .84em;
  color: #5a6a88;
  font-style: italic;
  margin-left: .3em;
}
/* 표 안: 이미 inline이지만 명시적으로 강조 */
.doc-bilingual .doc-confirm-table .doc-en,
.preview-bilingual .doc-confirm-table .doc-en {
  display: inline !important;
}
.doc-agree-en {
  margin-top: 1.4em;
  padding-top: .9em;
  border-top: 1px dashed #ccc;
  font-size: .92em;
  text-align: center;
}
.doc-confirm-bilingual td:first-child {
  width: 160px;
  font-size: .85em;
  color: #444;
}
/* 미리보기에서 표준조항 안의 영문 */
.preview-article--std .doc-en {
  color: #5a7ab8 !important;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .wizard-split { grid-template-columns: 300px 1fr; gap: 20px; }
}
@media (max-width: 900px) {
  .template-grid { grid-template-columns: 1fr 1fr; }
  .wizard-split { grid-template-columns: 1fr; }
  .preview-panel { display: none; position: static; max-height: none; margin-bottom: 20px; }
  .preview-panel.mobile-open { display: block; }
  .preview-toggle-btn { display: flex; }
  .wizard-split-wrap { padding: 0 16px; }
}
@media (max-width: 640px) {
  .template-grid { grid-template-columns: 1fr; }
  .wiz-row { grid-template-columns: 1fr; }
  .contract-doc { padding: 32px 22px; }
  .doc-title { font-size: 20px; }
  .doc-sign-parties { grid-template-columns: 1fr; }
  .doc-sign-party + .doc-sign-party { border-left: 1px solid #ddd; border-top: none; }
  .print-toolbar { flex-direction: column; align-items: flex-start; }
  .preview-sign-grid { grid-template-columns: 1fr; }
  .preview-sign-party + .preview-sign-party { border-left: 1px solid #ddd; border-top: none; }
}
