/* ====== Modal Layout (기본 주문 폼) ====== */
#largeModal .modal-dialog { width: 1100px; max-width: 96%; margin-top: 20px; }
#largeModal .modal-header { border-bottom: 1px solid #e9edf3; padding: 18px 20px; }
#largeModal .modal-title { font-size: 18px; font-weight: 900; }
#largeModal .modal-body { padding: 18px 20px 10px; background:#f7f9fc; }
#largeModal .modal-footer { border-top: 1px solid #e9edf3; padding: 14px 20px; background:#fff; }

.pm-wrap { display:flex; gap:16px; }
.pm-left { flex: 1 1 auto; min-width:0; }
.pm-right { flex: 0 0 320px; }

.pm-card { background:#fff; border:1px solid #e9edf3; border-radius:14px; padding:14px; margin-bottom:12px; }
.pm-card-title { font-weight:900; font-size:14px; margin-bottom:10px; color:#111; }

/* 옵션 박스 스타일 */
.pm-option-box {
  background: #fff;
  border: 1px solid #e9edf3;
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  min-height: 60px;
  flex-wrap: wrap;
}
.pm-option-box.gray-bg { background: #f3f6fb; border-color: transparent; }

/* 라디오 그룹 */
.pm-radio-group { display: flex; gap: 25px; align-items: center; flex-wrap: wrap; }
.pm-radio { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 700; color: #111; cursor: pointer; white-space: nowrap; }
.pm-radio input { margin: 0; cursor: pointer; }

/* 예약 입력창 */
.pm-date-inputs { display: flex; gap: 8px; margin-left: 25px; align-items: center; }
.pm-native-input { height: 36px; border-radius: 8px; background: #fff; border: 1px solid #dfe6f0; padding: 0 10px; font-size: 13px; color: #333; }

/* 가격 태그 */
.pm-price-tag { font-size: 11px; color: #fff; background: #2563eb; padding: 2px 6px; border-radius: 4px; font-weight: 700; margin-left: 4px; vertical-align: middle; }

/* 텍스트 입력창 스타일 */
.pm-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px;
  border: 1px solid #dfe6f0;
  border-radius: 12px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
}
.pm-textarea:focus { border-color: #2563eb; }

.pm-text-title { width:100%; height:42px; border-radius:12px; border:1px solid #dfe6f0; padding:0 12px; outline:none; transition: border-color 0.2s; }
.pm-text-title:focus { border-color: #2563eb; }

/* 모바일 대응 */
@media (max-width: 992px){
  .pm-wrap { flex-direction:column; }
  .pm-right { width:100%; }
  .pm-option-box { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pm-date-inputs { margin-left: 0; width: 100%; }
  .pm-native-input { flex: 1; }
  .pm-radio-group { gap: 15px; }
}

/* 기존 공통 스타일 */
.pm-tags{ border:1px solid #dfe6f0; border-radius:12px; padding:10px; background:#fff; }
.pm-tags-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.pm-tag{ display:inline-flex; align-items:center; gap:8px; background:#f3f4f6; border:1px solid #e5e7eb; border-radius:999px; padding:6px 10px; font-weight:700; font-size:12px; }
.pm-tag button{ border:0; background:transparent; cursor:pointer; font-size:14px; line-height:1; padding:0; color:#6b7280; }
.pm-tags input{ width:100%; border:0; outline:0; height:34px; }
.pm-drop{ border:2px dashed #d8e2f0; border-radius:12px; padding:16px 14px; background:#fbfdff; cursor:pointer; text-align:center; color:#6b7280; transition: border-color 0.2s; }
.pm-drop:hover{ border-color:#2563eb; color:#2563eb; }
.pm-filechips{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.pm-filechip{ flex: 0 0 calc(50% - 5px); background:#f8fafc; border:1px solid #e5e7eb; border-radius:12px; padding:10px 12px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.pm-filechip .name{ font-size:12px; font-weight:700; color:#111; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 240px; }
.pm-filechip .del{ font-size:12px; color:#ef4444; cursor:pointer; font-weight:900; }
.pm-help{ font-size:12px; color:#6b7280; margin-top:8px; }
.pm-summary-card{ background:#fff; border:1px solid #e9edf3; border-radius:14px; padding:14px; margin-bottom:12px; }
.pm-summary-title{ font-weight:900; font-size:14px; margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; }
.pm-summary-row{ display:flex; justify-content:space-between; padding:10px 0; border-top:1px solid #eef2f7; }
.pm-summary-row:first-of-type{ border-top:0; }
.pm-summary-row .k{ color:#6b7280; font-weight:700; }
.pm-summary-row .v{ color:#111; font-weight:900; }
.pm-summary-row .v.minus{ color:#ef4444; }
.pm-summary-row .v.blue{ color:#2563eb; }
.pm-pay-note{ margin-top:10px; font-size:12px; color:#6b7280; background:#f8fafc; border:1px solid #eef2f7; border-radius:12px; padding:10px 12px; }
.pm-btns{ display:flex; gap:10px; }
.pm-btn-cancel{ flex: 0 0 180px; height:46px; border-radius:12px; border:1px solid #dfe6f0; background:#fff; font-weight:900; }
.pm-btn-submit{ flex: 1 1 auto; height:46px; border-radius:12px; border:0; background:#2563eb; color:#fff; font-weight:900; }

/* ====== CW 스타일 (원고대필 모달) ====== */
#cwOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 20000;

  display: none;
  /* [수정] 상단 정렬 및 여백 조정 */
  align-items: flex-start;
  justify-content: center;
  padding: 10px; /* 전체 패딩 */
  padding-top: 10px; /* 상단 여백 최소화 (화면 위쪽에 붙게) */
  overflow-y: auto;
}

.cwPanel{
  position: relative;
  width: 520px;
  max-width: 100%;
  max-height: calc(100vh - 20px); /* 화면 높이 거의 다 쓰도록 */
  background:#fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  margin-bottom: 20px;
}

@media (max-width: 768px){
  #cwOverlay{
    padding: 0; /* 모바일은 꽉 차게 */
    padding-top: 0;
    align-items: flex-start;
  }
  .cwPanel{
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

.cwHead{ padding: 16px 18px; border-bottom: 1px solid #eef2f7; display:flex; align-items:center; justify-content:space-between; flex: 0 0 auto; background: #fff; }
.cwTitle{ font-size:18px; font-weight:900; color:#111; }
.cwStep{ font-size:12px; color:#6b7280; margin-top:4px; font-weight:700; }
.cwClose{ width:36px; height:36px; border-radius: 10px; border:1px solid #e5e7eb; background:#fff; font-size: 20px; line-height: 1; cursor:pointer; display: flex; align-items: center; justify-content: center; }
.cwBody{ padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; background:#fff; -webkit-overflow-scrolling: touch; }
.cwFoot{ padding: 14px 18px; border-top: 1px solid #eef2f7; display:flex; gap:10px; background:#fff; flex: 0 0 auto; }
.cwBtn{ height:46px; border-radius:12px; font-weight:900; border:0; cursor:pointer; }
.cwBtnGray{ background:#f3f4f6; color:#111; flex: 1 1 auto; }
.cwBtnBlue{ background:#2563eb; color:#fff; flex: 1 1 auto; }
.cwBtnBlue:disabled{ opacity:.45; cursor:not-allowed; }

.cwBox{ background:#f8fafc; border:1px solid #eef2f7; border-radius: 14px; padding: 14px; margin-bottom:12px; }
.cwMsg{ border-radius: 14px; border:1px solid #dbeafe; background:#eff6ff; padding:14px; font-size: 13px; line-height: 1.5; }
.cwMsg *{ max-width:100%; }

.cwQTitle{ font-weight:900; font-size:16px; margin-bottom:8px; color:#111; }
.cwHelp{ font-size:12px; color:#6b7280; margin-bottom:12px; }

.cwInput, .cwTextarea, .cwSelect{ width:100%; border:1px solid #dfe6f0; border-radius: 12px; padding: 10px 12px; box-sizing: border-box; }
.cwTextarea{ min-height:140px; resize: vertical; }

/* [수정] 라디오/체크박스 리스트 스타일 (flex 적용으로 깨짐 방지) */
.cwChoice {
  display: flex;
  align-items: flex-start; /* 텍스트가 길 경우 상단 정렬 */
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.cwChoice:hover{ background:#f9fafb; }
.cwChoice input{ margin-top: 3px; cursor: pointer; flex-shrink: 0; /* 크기 줄어듦 방지 */ }

.cwRepeatRows{ display:flex; flex-direction:column; gap:10px; }
.cwRepeatRow{ display:flex; align-items:center; gap:10px; }
.cwRepeatLabel{ font-weight:900; color:#111; flex:0 0 auto; }
.cwRepeatInput{ flex:1 1 auto; height:42px; border:1px solid #dfe6f0; border-radius:12px; padding:0 12px; background:#fff; }
.cwRepeatDel{ width:42px; height:42px; border-radius:12px; border:1px solid #fecaca; background:#fff; color:#ef4444; font-weight:900; cursor:pointer; flex:0 0 auto; }
.cwRepeatAdd{ width:100%; height:44px; border-radius:12px; border:1px dashed #cbd5e1; background:#f8fafc; font-weight:900; cursor:pointer; margin-top:10px; }
.cwFilePick{ height:42px; border-radius:12px; border:1px solid #dfe6f0; background:#fff; font-weight:900; padding:0 12px; cursor:pointer; flex:0 0 auto; }
.cwFileName{ flex:1 1 auto; height:42px; display:flex; align-items:center; border:1px solid #dfe6f0; border-radius:12px; background:#fff; padding:0 12px; color:#374151; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* 주의사항(Caution) 박스 스타일 */
.cwCautionBox {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 20px; /* 위쪽 여백 */
  margin-bottom: 10px;
  font-size: 13px;
  color: #c53030;
  line-height: 1.5;
}

/* ====== Dropzone 파일 업로드 스타일 ====== */
/* Dropzone 기본 스타일 커스터마이징 */
.dropzone {
  border: 2px dashed #d8e2f0;
  border-radius: 12px;
  background: #fbfdff;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  min-height: 120px;
  transition: all 0.2s;
}

/* Dropzone 호버 및 드래그 상태 */
.dropzone:hover,
.dropzone.dz-drag-hover {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Dropzone 메시지 스타일 */
.dropzone .dz-message {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  font-weight: 700;
}

.dropzone .dz-message .dz-button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* 파일 미리보기 영역 */
.dropzone .dz-preview {
  position: relative;
  display: inline-block;
  margin: 10px;
  vertical-align: top;
  background: transparent !important; /* 하얀 배경 제거 */
}

.dropzone .dz-preview:before,
.dropzone .dz-preview:after {
  display: none !important; /* 불필요한 가상 요소 제거 */
}

/* 이미지 미리보기 */
.dropzone .dz-preview .dz-image {
  border-radius: 8px;
  width: 120px;
  height: 120px;
  overflow: hidden;
  display: block;
  z-index: 10;
  background: #f3f4f6;
}

.dropzone .dz-preview .dz-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 파일 상세 정보 */
.dropzone .dz-preview .dz-details {
  opacity: 1;
  position: static;
  padding: 8px 0;
  text-align: center;
  background: transparent !important; /* 하얀 배경 제거 */
}

.dropzone .dz-preview .dz-filename {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  margin-top: 8px;
  display: block;
  background: transparent !important; /* 하얀 배경 제거 */
}

.dropzone .dz-preview .dz-filename span {
  color: #374151;
  background: transparent !important; /* 하얀 배경 제거 */
}

.dropzone .dz-preview .dz-size {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  display: none; /* 파일 크기는 숨김 */
}

/* 업로드 진행률 - 흰색 배경 제거 */
.dropzone .dz-preview .dz-progress {
  opacity: 0 !important; /* 완전히 숨김 */
  display: none !important; /* 완전히 숨김 */
  height: 4px;
  background: transparent !important;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
  position: static !important; /* absolute 위치 제거 */
  width: auto !important;
  left: auto !important;
  top: auto !important;
  margin-left: 0 !important;
  pointer-events: none;
}

.dropzone .dz-preview .dz-progress .dz-upload {
  display: none !important;
  height: 100%;
  background: #2563eb;
  transition: width 0.3s;
}

/* 삭제 버튼 */
.dropzone .dz-preview .dz-remove {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.dropzone .dz-preview .dz-remove:hover {
  background: #dc2626;
}

/* 성공/에러 상태 - 완전히 숨김 */
.dropzone .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone .dz-preview.dz-error .dz-error-mark {
  display: none !important;
}

/* 체크마크, X 마크 등 모든 SVG/아이콘 숨김 */
.dropzone .dz-preview .dz-success-mark svg,
.dropzone .dz-preview .dz-error-mark svg {
  display: none !important;
}

.dropzone .dz-preview.dz-error .dz-error-message {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  margin-top: 8px;
  z-index: 1000;
}

/* Dropzone 비활성화 상태 */
.dropzone.dz-clickable {
  cursor: pointer;
}

.dropzone.dz-started .dz-message {
  display: none;
}

/* Dropzone 모든 하얀 배경 제거 */
.dropzone .dz-preview .dz-image:before,
.dropzone .dz-preview .dz-image:after,
.dropzone .dz-preview .dz-details:before,
.dropzone .dz-preview .dz-details:after {
  display: none !important;
}

.dropzone .dz-preview * {
  box-shadow: none !important;
}


#articleEditorOverlay .articleEditorPanel {
  height: 100vh !important;
  width: 100% !important;
}

/* 기사 본문 에디터 높이 - 화면 꽉 채우기 */
#editorContent {
  min-height: calc(100vh - 280px) !important;
  max-height: calc(100vh - 280px) !important;
}
#articleEditorOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    z-index: 99999 !important;
}
/* 모바일 대응 */
@media (max-width: 768px) {
  .dropzone {
    min-height: 100px;
    padding: 15px;
  }

  .dropzone .dz-preview .dz-image {
    width: 80px;
    height: 80px;
  }

  .dropzone .dz-preview .dz-filename {
    max-width: 80px;
  }

  /* 모바일에서 드래그 텍스트 숨기고 클릭 텍스트로 변경 */
  #dropzoneDoc .dz-message,
  #dropzoneArticleImg .dz-message,
  #dropzoneProof .dz-message {
    font-size: 0; /* 기본 텍스트 숨김 */
  }

  #dropzoneDoc .dz-message::after {
    content: "파일을 선택하여 업로드하세요";
    font-size: 14px;
    display: block;
  }

  #dropzoneArticleImg .dz-message::after {
    content: "이미지를 선택하여 업로드하세요";
    font-size: 14px;
    display: block;
  }

  #dropzoneProof .dz-message::after {
    content: "증빙자료를 선택하여 업로드하세요";
    font-size: 14px;
    display: block;
  }

  /* 모바일에서 아이콘만 보이도록 */
  .dropzone .dz-message i {
    font-size: 14px !important;
    display: block;
    margin-bottom: 8px;
  }
  /* 모바일 기사 본문 에디터 높이 */
  #editorContent {
    min-height: calc(100vh - 180px) !important;
    max-height: calc(100vh - 180px) !important;
    padding: 15px !important;
  }

  /* 모바일 기사 작성 에디터 본문 영역 */
  #articleEditorOverlay .articleEditorBody {
    padding: 10px !important;
  }
  #articleEditorOverlay .articleEditorBody > div {
    padding: 10px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #articleEditorOverlay .articleEditorHead {
    padding: 10px 15px !important;
  }
  #articleEditorOverlay #editorTitle {
    padding: 12px 15px !important;
    margin-bottom: 10px !important;
  }
  #articleEditorOverlay #addImageBtn {
    padding: 10px !important;
    margin-top: 8px !important;
  }

}

/* ====== 에디터 placeholder 스타일 ====== */
#editorContent:empty:before {
    content: '기사 본문을 입력해주세요';
    color: #9ca3af;
    pointer-events: none;
}

/* ====== 기사 작성 버튼 및 에디터 이미지 스타일 ====== */
.pm-btn-write {
    width: 100%;
    padding: 15px 20px;
    background: #2075c8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.pm-btn-write:hover {
    background: #1a5fa8;
}
.pm-btn-write i {
    margin-right: 8px;
}
.editor-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 2px solid #2075c8;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.editor-image:hover {
    border-color: #ff6b6b;
}

/* ====== 모바일 스타일 - 입력폼 꽉 차게 ====== */
@media (max-width: 768px) {
    #largeModal .modal-dialog {

        margin: 5px;
        width: calc(100% - 10px);
    }
    #largeModal .modal-content {
        border-radius: 8px;
    }
    #largeModal .modal-body {
        padding: 10px;
    }
    #largeModal .pm-wrap {
        padding: 0;
    }
    #largeModal .pm-left {
        padding: 0;
    }
    #largeModal .pm-option-box {
        padding: 10px;
        margin-bottom: 10px;
    }
    #largeModal .form-group {
        margin-bottom: 10px;
    }
    #largeModal .form-control {
        width: 100%;
    }
    #largeModal #editorContent {
        min-height: 200px;
    }
    #largeModal .article-editor-wrapper {
        margin: 0;
    }

    /* 기사 작성 에디터 오버레이 - 모바일 전체 화면 */
    #articleEditorOverlay {
        overflow-y: auto !important;
    }
    #articleEditorOverlay .articleEditorPanel {
        height: 100vh;
        min-height: 100vh;
    }
    #articleEditorOverlay .articleEditorHead {
        padding: 15px !important;
    }
    #articleEditorOverlay .articleEditorBody {
        flex: 1;
        overflow-y: auto;
    }
    #articleEditorOverlay .articleEditorBody > div {
        padding: 15px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        min-height: calc(100vh - 180px);
    }
    #articleEditorOverlay .articleEditorFoot {
        padding: 15px !important;
        position: sticky;
        bottom: 0;
    }
    #articleEditorOverlay #editorContent {
        min-height: calc(100vh - 280px) !important;
        max-height: none !important;
    }

}