/* ================================================================
   PDF 도구 — "인쇄소" 디자인
   책상(질감 있는 배경) 위에 놓인 교정지(시트) 위에서 작업하는 컨셉.
   재단선(crop mark), 서류철 탭, 확인 도장이 시그니처.
   ================================================================ */
:root {
  --desk: #EFEDE6;          /* 책상: 따뜻한 회백색 */
  --sheet: #FDFCF9;         /* 교정지 */
  --card: #FFFFFF;          /* 시트 위 종이 조각 */
  --ink: #191C21;           /* 잉크 */
  --ink-soft: #5E6167;
  --line: #D9D5CA;          /* 연한 괘선 */
  --rule: #C9C4B6;          /* 시트 테두리 */
  --blue: #0A63BE;          /* 리소 블루 (인터랙션) */
  --blue-soft: #EFF6FD;
  --stamp: #C94A2B;         /* 도장 주홍 */
  --danger: #C23B2E;
  --ok: #2E7D4F;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background-color: var(--desk);
  background-image: radial-gradient(rgba(25,28,33,.06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 80px;
}

/* ===== 인트로 ===== */
.page-intro { text-align: center; margin-bottom: 30px; max-width: 620px; position: relative; }
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 5px 14px 4px;
  margin-bottom: 18px;
}
h1 {
  font-family: "Song Myung", "Noto Serif KR", serif;
  font-weight: 400;
  font-size: clamp(34px, 6vw, 48px);
  letter-spacing: 0.02em;
}
.page-intro p { margin-top: 12px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }

/* 확인 도장 */
.stamp {
  position: absolute;
  right: -78px; top: -14px;
  width: 108px; height: 108px;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 14px; font-weight: 700; line-height: 1.45;
  letter-spacing: 0.06em;
  transform: rotate(11deg);
  opacity: .88;
  pointer-events: none;
}
.stamp::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid var(--stamp);
  border-radius: 50%;
  opacity: .55;
}
@media (max-width: 860px) {
  .stamp { position: static; margin: 18px auto 0; transform: rotate(-7deg); }
}

main { width: 100%; max-width: 660px; }

/* ===== 서류철 탭 ===== */
.tabs {
  display: flex;
  gap: 5px;
  padding: 0 14px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}
.tabs button {
  padding: 11px 15px 10px;
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  background: #E6E3D8;
  font: inherit;
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  top: 1px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.tabs button:hover { background: #EEEBE1; color: var(--ink); }
.tabs button[aria-selected="true"] {
  background: var(--sheet);
  color: var(--ink);
  font-weight: 700;
  padding-top: 13px;
}
.tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 520px) {
  .tabs { padding: 0 8px; gap: 4px; }
  .tabs button { font-size: 12.5px; padding: 10px 9px 9px; }
  .tabs button[aria-selected="true"] { padding-top: 12px; }
}

/* ===== 교정지(시트) + 재단선 ===== */
.sheet {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 rgba(25,28,33,.09);
  padding: 28px clamp(16px, 4vw, 34px) 34px;
  z-index: 1;
}
.crop { position: absolute; width: 15px; height: 15px; pointer-events: none; border: 0 solid #9A9482; }
.crop.c1 { top: -11px; left: -11px; border-left-width: 1.5px; border-top-width: 1.5px; }
.crop.c2 { top: -11px; right: -11px; border-right-width: 1.5px; border-top-width: 1.5px; }
.crop.c3 { bottom: -11px; left: -11px; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.crop.c4 { bottom: -11px; right: -11px; border-right-width: 1.5px; border-bottom-width: 1.5px; }

.panel { display: none; }
.panel.active { display: block; }

/* ===== 업로드 영역 ===== */
.dropzone {
  border: 1.5px dashed #B7B1A1;
  padding: 42px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: transparent;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.dropzone:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dz-icon { width: 52px; height: 64px; margin: 0 auto 16px; position: relative; }
.dz-icon .sheet { /* 아이콘 내부의 종이 낱장 (레이아웃용 .sheet와 무관하도록 재정의) */
  position: absolute; inset: 0;
  background: var(--card);
  border: 1.2px solid #B7B1A1;
  box-shadow: none;
  padding: 0;
  border-radius: 2px;
}
.dz-icon .sheet:nth-child(1) { transform: rotate(-7deg) translateX(-7px); }
.dz-icon .sheet:nth-child(2) { transform: rotate(5deg) translateX(7px); }
.dz-icon .sheet:nth-child(3) {
  border-color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-weight: 700; font-size: 18px;
}
.dz-icon.split .sheet:nth-child(1) { transform: rotate(0) translateX(-14px); }
.dz-icon.split .sheet:nth-child(2) { transform: rotate(0) translateX(14px); }
.dropzone strong { display: block; font-size: 16px; font-weight: 600; }
.dropzone span { display: block; margin-top: 7px; font-size: 13px; color: var(--ink-soft); }
input[type="file"] { display: none; }

/* ===== 파일 목록 ===== */
#stack { margin-top: 26px; display: none; }
#stack.visible { display: block; }
.stack-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.stack-head h2 { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
.stack-head button {
  background: none; border: none; font: inherit; font-size: 13px;
  color: var(--danger); cursor: pointer; text-decoration: underline;
}
ul.file-list { list-style: none; position: relative; }
ul.file-list::before {
  content: "";
  position: absolute; left: 17px; top: 12px; bottom: 12px;
  width: 1.5px; background: var(--line);
}
li.file-item {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 13px 13px 13px 11px;
  margin-bottom: 9px;
  box-shadow: 2.5px 2.5px 0 rgba(25,28,33,.07);
  transition: opacity .2s, border-color .12s;
}
li.file-item.dragging { opacity: .45; }
li.file-item.drag-over { border-color: var(--blue); }
.order-badge {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.file-meta { flex: 1; min-width: 0; }
.file-meta .name {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta .info { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.file-meta .info .err { color: var(--danger); }
.file-actions { display: flex; gap: 4px; flex: none; }
.file-actions button {
  width: 31px; height: 31px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.file-actions button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.file-actions button.remove:hover { border-color: var(--danger); color: var(--danger); }
.file-actions button:disabled { opacity: .3; cursor: default; }
.file-actions button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
li.file-item[draggable="true"] { cursor: grab; }
li.file-item[draggable="true"]:active { cursor: grabbing; }

/* ===== 나누기 / 삭제 파일 카드 ===== */
#splitInfo { display: none; margin-top: 24px; }
#splitInfo.visible { display: block; }
.split-file-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 14px;
  box-shadow: 2.5px 2.5px 0 rgba(25,28,33,.07);
}
.split-file-card .doc-icon {
  flex: none;
  width: 34px; height: 44px;
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-size: 10px; font-weight: 700;
  border-radius: 2px;
}

/* ===== 방식 선택 ===== */
fieldset.split-modes { border: none; margin-top: 22px; }
fieldset.split-modes legend {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 11px; letter-spacing: 0.02em;
}
.mode-option {
  display: block;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 13px 16px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.mode-option:hover { border-color: var(--ink); }
.mode-option.selected {
  background: var(--card);
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--blue);
}
.mode-option .mode-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.mode-option input[type="radio"] { accent-color: var(--blue); }
.mode-option .mode-desc { margin-top: 4px; margin-left: 26px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.mode-option .mode-extra { margin-top: 10px; margin-left: 26px; display: none; }
.mode-option.selected .mode-extra { display: block; }
.mode-extra input[type="text"], .mode-extra input[type="number"] {
  width: 100%;
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  font: inherit;
  font-size: 14px;
}
.mode-extra input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.mode-extra .hint { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }

/* ===== 끼워넣기 슬롯 ===== */
.insert-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .insert-slots { grid-template-columns: 1fr; } }
.slot-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: 0.02em; }
.dropzone.compact { padding: 24px 14px; }
.dropzone.compact .dz-icon { width: 40px; height: 50px; margin-bottom: 12px; }
.dropzone.compact strong { font-size: 14px; }
.dropzone.compact span { font-size: 12px; }
.dropzone.loaded { border-style: solid; border-color: var(--ok); background: #F2F9F4; }
.dropzone.loaded strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 실행 버튼 ===== */
.action-bar { margin-top: 22px; display: none; }
.action-bar.visible { display: block; }
.action-bar > button {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--sheet);
  font: inherit;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(25,28,33,.22);
  transition: background .12s, box-shadow .1s, transform .1s;
}
.action-bar > button:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); }
.action-bar > button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(25,28,33,.22); }
.action-bar > button:disabled {
  background: transparent; color: var(--ink-soft);
  border: 1px dashed #B7B1A1; box-shadow: none; cursor: default;
}
.action-bar > button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.status { margin-top: 12px; text-align: center; font-size: 13px; color: var(--ink-soft); min-height: 20px; }
.status.ok { color: var(--ok); font-weight: 600; }
.status.err { color: var(--danger); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ================================================================
   사이트 공통 레이아웃
   ================================================================ */
.site-header {
  width: 100%;
  margin: -48px -20px 40px;
  padding: 0 20px;
  box-sizing: content-box;
  display: flex;
  justify-content: center;
  border-bottom: 1.5px solid var(--ink);
  background: var(--desk);
}
.site-header .inner {
  width: 100%; max-width: 880px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 15px 0; flex-wrap: wrap;
}
.brand {
  font-family: "Song Myung", "Noto Serif KR", serif;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 8px;
}
.brand::before { content: "◉"; color: var(--blue); font-size: 13px; }
.brand .dot { display: none; }
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 11px;
  transition: color .12s, background .12s;
}
.site-nav a:hover { color: var(--ink); background: rgba(25,28,33,.05); }
.site-nav a.current { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--blue); }
.site-nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.site-footer {
  width: 100%;
  margin-top: 72px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: center;
  padding: 28px 20px 12px;
}
.site-footer .inner { max-width: 880px; width: 100%; text-align: center; }
.site-footer nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer a { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--blue); text-decoration: underline; }
.site-footer .copy { font-size: 12px; color: var(--ink-soft); line-height: 1.7; }

/* ===== 글 페이지 (교정지 스타일) ===== */
article.doc {
  width: 100%;
  max-width: 700px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 rgba(25,28,33,.09);
  padding: 44px clamp(22px, 5vw, 52px);
  line-height: 1.8;
  font-size: 15px;
}
article.doc h1 {
  font-family: "Song Myung", "Noto Serif KR", serif;
  font-weight: 400;
  font-size: clamp(26px, 4.5vw, 34px);
  margin-bottom: 8px;
}
article.doc .doc-sub {
  color: var(--ink-soft); font-size: 14px;
  margin-bottom: 30px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
article.doc h2 {
  font-family: "Song Myung", "Noto Serif KR", serif;
  font-weight: 400;
  font-size: 21px;
  margin: 38px 0 12px;
}
article.doc h3 { font-size: 16px; margin: 24px 0 8px; }
article.doc p { margin: 0 0 14px; }
article.doc ol, article.doc ul { margin: 0 0 14px 22px; }
article.doc li { margin-bottom: 7px; }
article.doc code {
  background: var(--desk);
  border: 1px solid var(--line);
  padding: 1px 6px;
  font-size: 13px;
}
article.doc a { color: var(--blue); }
article.doc .callout {
  background: var(--blue-soft);
  border: 1px solid #BFD9F2;
  border-left: 3px solid var(--blue);
  padding: 14px 16px;
  font-size: 14px;
  margin: 18px 0;
}
article.doc table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
article.doc th, article.doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
article.doc th { background: var(--desk); }

/* ===== 홈 하단 콘텐츠 ===== */
.home-content { width: 100%; max-width: 660px; margin-top: 60px; }
.home-content section { margin-bottom: 44px; }
.home-content h2 {
  font-family: "Song Myung", "Noto Serif KR", serif;
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.home-content p { font-size: 15px; line-height: 1.8; margin-bottom: 12px; }
.guide-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .guide-cards { grid-template-columns: 1fr; } }
.guide-cards a {
  display: block;
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 2.5px 2.5px 0 rgba(25,28,33,.07);
  transition: transform .1s, box-shadow .1s, border-color .12s;
}
.guide-cards a:hover {
  border-color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(25,28,33,.1);
}
.guide-cards .t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.guide-cards .d { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

/* ===== FAQ ===== */
details.faq {
  background: var(--sheet);
  border: 1px solid var(--rule);
  margin-bottom: 9px;
  box-shadow: 2.5px 2.5px 0 rgba(25,28,33,.07);
}
details.faq summary {
  padding: 15px 18px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "Q. "; color: var(--blue); font-weight: 700; }
details.faq[open] summary { border-bottom: 1px solid var(--line); }
details.faq .a { padding: 14px 18px; font-size: 14px; line-height: 1.75; }
