/* ═════ editor/word_editor.css — 한글 워드 에디터(iframe·단독 로드 전용) ═════ */
/* 포털과 분리(iframe 로드 시 이 문서에만 적용) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
}
body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: #e6e8ea;
  margin: 0;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 15px; /* base 폰트 1px 증가 */
}

/* ── 메뉴바 ── */
.menu-bar {
  background: #edeef0;
  border-bottom: 1px solid #c3c8cf;
  display: flex;
  align-items: center;
  padding: 2px 6px;
  gap: 2.2px;
  flex-shrink: 0;
} /* gap 10% 증가 */
.menu-item {
  padding: 3.3px 11px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 13px;
  color: #222;
  position: relative;
} /* padding 10% 증가 */
.menu-item:hover {
  background: #e3e4e8;
}
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #c3c8cf;
  border-radius: 3px;
  min-width: 160px;
  z-index: 1000;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.08);
}
.menu-item:hover .dropdown {
  display: block;
}
.dropdown-item {
  padding: 5.5px 15.4px;
  cursor: pointer;
  font-size: 13px;
  color: #222;
  white-space: nowrap;
} /* padding 10% 증가 */
.dropdown-item:hover {
  background: #f3f4f6;
}
.dropdown-sep {
  height: 1.1px;
  background: #dadee2;
  margin: 3.3px 0;
} /* height, margin 10% 증가 */

/* ── 공통 툴바 ── */
.toolbar {
  background: #edeef0;
  border-bottom: 1px solid #c5c8cc;
  display: flex;
  align-items: center;
  padding: 3.3px 6.6px;
  gap: 2.2px;
  flex-wrap: wrap;
} /* padding/gap 10% 증가 */
.tb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 아이콘과 글자 위아래 간격 15% 증가, 가로 최소 너비 10% 증가 */
  min-width: 37.4px; /* 34px → 37.4px (10% 증가) */
  padding: 3.45px 2.2px 2.2px; /* 수직 패딩 약 15% 증가 */
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  gap: 1.15px; /* 아이콘-라벨 간격 15% 증가 */
  flex-shrink: 0;
  transition: background 0.1s;
}
.tb-btn:hover {
  background: #dee1e4;
  border-color: #c5c8cc;
}
.tb-btn.active {
  background: #e2e4e6;
  border-color: #b1b4ba;
}
.tb-icon {
  width: 22px; /* 20px → 22px (10% 증가) */
  height: 19.8px; /* 18px → 19.8px (10% 증가) */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17.25px; /* 15px → 17.25px (15% 증가, 아이콘의 시각적 높이 증가) */
  line-height: 1;
}
.tb-label {
  font-size: 11.5px; /* 10px → 11.5px (15% 증가, 라벨의 높이 증가) */
  color: #555;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.sep {
  width: 1.1px;
  height: 33px;
  background: #d3d7da;
  margin: 0 3.3px;
  flex-shrink: 0;
} /* sep width/height/margin 10% 증가 */

/* ── 서식 툴바 ── */
.fmt-bar {
  background: #edeef0;
  border-bottom: 1px solid #c5c8cc;
  display: flex;
  align-items: center;
  padding: 3.3px 6.6px;
  gap: 4.4px;
  flex-wrap: wrap;
}
.fmt-bar {
  background: #edeef0;
  border-bottom: 1px solid #c5c8cc;
  display: flex;
  align-items: center;
  padding: 3px 6px;
  gap: 4px;
  flex-wrap: wrap;
}
.fmt-select {
  height: 22px;
  border: 1px solid #c5c8cc;
  border-radius: 2px;
  background: #fff;
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
  color: #222;
  font-family: "Malgun Gothic", sans-serif;
} /* +1px */
.fmt-input {
  height: 22px;
  border: 1px solid #c5c8cc;
  border-radius: 2px;
  background: #fff;
  font-size: 12px;
  padding: 0 4px;
  color: #222;
  font-family: "Malgun Gothic", sans-serif;
  text-align: center;
} /* +1px */
.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  color: #222;
  transition: background 0.1s;
} /* +1px */
.fmt-btn:hover {
  background: #dee1e4;
  border-color: #c5c8cc;
}
.fmt-btn.active {
  background: #e2e4e6;
  border-color: #b1b4ba;
}
.sep2 {
  width: 1px;
  height: 20px;
  background: #d3d7da;
  margin: 0 2px;
  flex-shrink: 0;
}
.color-row {
  width: 16px;
  height: 3px;
  border-radius: 1px;
  margin-top: 1px;
}

/* ── 색상 팔레트 팝업 ── */
.color-popup {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #c3c8cf;
  border-radius: 4px;
  padding: 8px;
  z-index: 500;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.12);
}
.color-popup.show {
  display: block;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 18px);
  gap: 2px;
}
.color-cell {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.color-cell:hover {
  transform: scale(1.2);
}

/* ── 표 삽입 팝업 ── */
.table-popup {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #c3c8cf;
  border-radius: 4px;
  padding: 8px;
  z-index: 500;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.12);
}
.table-popup.show {
  display: block;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(10, 18px);
  gap: 2px;
  margin-bottom: 6px;
}
.table-cell {
  width: 18px;
  height: 18px;
  border: 1px solid #c5c8cc;
  border-radius: 2px;
  cursor: pointer;
  background: #f6f7f9;
}
.table-cell.hover {
  background: #cfe1ef;
  border-color: #92afd1;
}
.table-info {
  font-size: 12px;
  color: #555;
  text-align: center;
} /* +1px */

/* ── 찾기/바꾸기 패널 ── */
.find-bar {
  display: none;
  background: #f3f4f6;
  border-bottom: 1px solid #d3d7da;
  padding: 6px 10px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.find-bar.show {
  display: flex;
}
.find-bar input {
  height: 24px;
  border: 1px solid #c5c8cc;
  border-radius: 3px;
  padding: 0 8px;
  font-size: 13px;
  width: 160px;
} /* +1px */
.find-bar button {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #b1b4ba;
  border-radius: 3px;
  background: #edeef0;
  cursor: pointer;
  font-size: 12px;
  font-family: "Malgun Gothic", sans-serif;
} /* +1px */
.find-bar button:hover {
  background: #dee1e4;
}
.find-result {
  font-size: 12px;
  color: #666;
} /* +1px */

/* ── 페이지 영역 ── */
.page-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: #e6e8ea;
}
.page {
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  margin: 0 auto 20px;
  padding: 20mm 22mm;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.12);
  position: relative;
}
.editor {
  outline: none;
  min-height: 257mm;
  font-family: "함초롬바탕", "Batang", serif;
  font-size: 15px;
  line-height: 1.8;
  color: #111;
  word-break: break-word;
} /* +1px */
.editor:empty::before {
  content: "여기를 클릭하여 입력을 시작하세요...";
  color: #aaa;
  pointer-events: none;
}

/* ── 편집 표 스타일 ── */
.editor table {
  border-collapse: collapse;
  margin: 8px 0;
  width: auto;
}
.editor table td,
.editor table th {
  border: 1px solid #bbb;
  padding: 4px 8px;
  min-width: 40px;
  min-height: 20px;
}
.editor table th {
  background: #f3f4f6;
  font-weight: bold;
}
.editor table td:focus,
.editor table th:focus {
  outline: 2px solid #92afd1;
  background: #f0f4fa;
}

/* ── 상태바 ── */
.status-bar {
  background: #eceef1;
  border-top: 1px solid #c5c8cc;
  padding: 2px 12px;
  font-size: 11px;
  color: #555;
  display: flex;
  gap: 20px;
  flex-shrink: 0;
} /* +1px */

/* ── 검토서 데모(포털 연동용 id 유지) ── */
.we-docname {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin: 0 0 10px;
} /* +1px */
.we-h {
  font-size: 23px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 16px;
  line-height: 1.35;
} /* +1px */
.we-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid #e2e8f0;
  margin: 0 0 18px;
  font-size: 14px;
} /* +1px */
.we-meta__cell {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}
.we-meta__cell:nth-child(odd) {
  border-right: 1px solid #e2e8f0;
}
.we-meta__k {
  flex: 0 0 88px;
  background: #f7f9fa;
  padding: 8px 10px;
  font-weight: 700;
  color: #334155;
}
.we-meta__v {
  flex: 1;
  padding: 8px 10px;
  min-width: 0;
  word-break: break-word;
}
.we-block {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}
.we-block p {
  margin: 0 0 8px;
}
.we-block__muted {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
} /* +1px */

/* ── 인쇄 ── */
@media print {
  .menu-bar,
  .toolbar,
  .fmt-bar,
  .find-bar,
  .status-bar {
    display: none !important;
  }
  .page-area {
    padding: 0;
    background: #fff;
  }
  .page {
    box-shadow: none;
    margin: 0;
    padding: 15mm 20mm;
  }
}

/* ── 스크롤바 ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #e2e4e6;
}
::-webkit-scrollbar-thumb {
  background: #bbc2c8;
  border-radius: 4px;
}
