:root {
  color-scheme: only light;
  --bg: #f4f3ee;
  --surface: #ffffff;
  --text: #1b1d21;
  --muted: #646a73;
  --line: #dcdad2;
  --accent: #24449c;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecf8;
  --warn-bg: #fff7e0;
  --warn-line: #ecd590;
  --warn-text: #5c4a12;
  --danger: #b3261e;
  --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}


* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--accent); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ───────── 머리말 · 꼬리말 */

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.logo { font-family: var(--mono); font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo b { color: var(--accent); }
.logo small { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.site-header nav { display: flex; gap: 18px; font-size: 15px; white-space: nowrap; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 4px 0; }

main { padding: 28px 0 0; }

h1 { font-size: 30px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.35; margin: 40px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 22px 0 6px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 18px; max-width: 46em; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }

.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text);
  border-radius: var(--radius); padding: 12px 14px; font-size: 15px; margin: 0 0 22px; max-width: 60em;
}
.notice b { margin-right: 6px; }

/* ───────── 홈 */

.hero { padding: 26px 0 8px; }
.hero h1 { font-size: 36px; }
.hero .points { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.hero .points li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.finder { margin: 26px 0 0; scroll-margin-top: 16px; }
.search {
  width: 100%; font: inherit; font-size: 17px; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 16px; min-height: 52px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.search::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font-size: 15px; font-weight: 600; min-height: 38px;
}
.chips button span { margin-left: 4px; font-weight: 500; font-size: 13px; color: var(--muted); }
.chips button:hover { border-color: var(--accent); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips button.on span { color: inherit; opacity: .8; }
.chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.found { margin: 12px 0 0; min-height: 1.4em; font-size: 14.5px; color: var(--muted); }

.cat { scroll-margin-top: 16px; }
.cat h2 { margin: 30px 0 2px; }
.cat-desc { margin: 0; font-size: 14.5px; color: var(--muted); }
.cat .cards { margin-top: 12px; }

/* 상황 목록: 서식 페이지에서는 한 줄로 접어 두고, 펼치면 검색되는 목록이 나온다 */
.picker { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.picker summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: "펼치기"; margin-left: auto; flex: none; font-size: 13px; font-weight: 500; color: var(--accent); }
.picker[open] summary::after { content: "접기"; }
.picker summary b { color: var(--accent); margin: 0 -4px 0 0; }
.picker summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 400; color: var(--muted); }
.picker summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.picker-body { padding: 0 14px 12px; border-top: 1px solid var(--line); }
.picker-q { width: 100%; margin-top: 12px; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 42px; }
.picker-q:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 12px; max-height: 340px; overflow: auto; margin: 10px -6px 0; padding: 0; list-style: none; }
.picker-list a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.picker-list a:hover { background: var(--accent-soft); }
.picker-list strong { display: block; font-size: 15px; }
.picker-list span { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); }
.picker-none, .picker-more { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* 상황 카드 (상황별 찾기, 홈의 검색 결과): 서식 카드보다 작게 */
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.cards.compact > li { padding: 12px 14px; }
.cards.compact strong { font-size: 16px; margin-bottom: 2px; }
.cards.compact span { font-size: 13.5px; line-height: 1.45; }
.finder-more { margin: 4px 0 0; font-size: 14.5px; }
.sits { margin-top: 18px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-soft); }
.sits h2 { margin: 0; font-size: 17px; }
.sits-more { margin: 12px 0 0; font-size: 14.5px; }
.none { margin: 30px 0; padding: 22px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.none p { margin: 4px 0; }
.none b { color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
/* 카드 상자는 li가 맡고, 카드 어디를 눌러도 열리도록 링크의 누르는 영역을 상자 전체로 넓힌다. */
.cards > li {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 16px; transition: border-color .15s, transform .15s;
}
.cards > li:hover { border-color: var(--accent); transform: translateY(-2px); }
.cards > li > a { display: block; flex: 1 1 auto; color: var(--text); text-decoration: none; }
.cards > li > a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.cards > li > a:focus-visible { outline: none; }
.cards > li > a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.cards strong { display: block; font-size: 19px; margin-bottom: 4px; }
.cards span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.cards em { display: inline-block; margin-top: 12px; font-style: normal; font-size: 14px; font-weight: 600; color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14.5px; }

/* ───────── 작성 도구 */

.tool { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 22px; align-items: start; }
.tool-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-bottom: 10px; }
.tool-head h2 { margin: 0; font-size: 17px; }
.tool-head .mini { display: flex; gap: 6px; }
.tool-head .segs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 8px; color: var(--accent); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; }
.field { grid-column: 1 / -1; min-width: 0; }
.field.half { grid-column: auto; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field .opt { font-weight: 500; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 44px;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.field .hint { min-height: 1em; }
.hint.warn { color: var(--danger); font-weight: 600; }
.hint.caution { margin-top: 10px; }

/* ───────── 품목 표 입력 (견적서 · 거래명세서 · 품의서) */

.field .lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.items-ui { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 10px; }
.field .items-on { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; margin: 0 0 4px; }
.field .items-on input { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); }
.items-list[hidden], .items-foot[hidden] { display: none; }
.item-row { padding: 9px 0 11px; border-top: 1px dashed var(--line); }
.item-row:first-child { border-top: 0; padding-top: 2px; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.item-head b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.item-amt { flex: 1; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.item-del { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 6px; min-height: 30px; border-radius: 6px; }
.item-del:hover { color: var(--danger); }
.item-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.item-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.field .item-cell { grid-column: span 4; margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.item-cell span { display: block; margin-bottom: 2px; }
.field .item-cell input { min-height: 40px; padding: 7px 8px; }
/* 한 품목을 두 줄에: 품명·규격 / 수량·단가·비고. 월/일이 있는 표는 세 줄 */
.field .item-cell.c-name { grid-column: span 8; }
.field .item-cell.c-qty { grid-column: span 3; }
.field .item-cell.c-note { grid-column: span 5; }
.field .item-cell.c-md { grid-column: span 3; }
.field .item-cell.c-md + .c-name { grid-column: span 9; }
.field .item-cell.c-md ~ .c-price { grid-column: span 5; }
.field .item-cell.c-md ~ .c-note { grid-column: 1 / -1; }
/* 급여명세서: 항목·금액 / 계산 방법 */
.field .g-name-price-note .c-note { grid-column: 1 / -1; }
.item-cell.c-qty input, .item-cell.c-price input { text-align: right; font-variant-numeric: tabular-nums; }
.items-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.items-sum { flex: 1 1 190px; margin: 0; text-align: right; font-size: 13.5px; font-weight: 600; line-height: 1.45; font-variant-numeric: tabular-nums; }
.items-sum.warn { color: var(--danger); }
.ins-tool { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ins-tool summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); }
.ins-tool summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ins-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; margin: 10px 0 8px; }
.field .ins-row .item-cell { grid-column: auto; }
.field .ins-row select { min-height: 40px; padding: 7px 8px; }
.ins-tool .hint { margin-top: 8px; font-weight: 400; }

/* ───────── 서명 · 도장 설정 */

.seals > .hint { margin: 0 0 4px; }
.seal-ui { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 10px 12px 12px; margin-top: 8px; }
.seal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14.5px; }
.seal-state { font-size: 13px; color: var(--muted); }
.seal-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.seal-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; font-size: 13.5px; }
.seal-opts label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.seal-opts input[type="range"] { width: 120px; accent-color: var(--accent); }
.seal-opts input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.seal-opts select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.btn.danger { color: var(--danger); }

.sign-dialog { width: min(92vw, 560px); border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); color: var(--text); }
.sign-dialog::backdrop { background: rgba(10, 12, 20, .55); }
.sign-dialog h2 { margin: 0 0 2px; font-size: 18px; }
.sign-canvas { display: block; width: 100%; aspect-ratio: 5 / 2; margin: 12px 0; background: #fff; border: 1px dashed #9aa1ac; border-radius: 10px; touch-action: none; cursor: crosshair; }
.sign-row { display: flex; gap: 8px; align-items: center; }
.sign-row .sp { flex: 1; }
.save-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; vertical-align: middle; }
.badge.many { background: var(--warn-bg); color: var(--warn-text); }
.seg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.seg span { margin-right: 2px; }
.seg button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; padding: 4px 9px; border-radius: 6px; min-height: 30px; }
.seg button.on { border-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.safe { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }

button { font: inherit; cursor: pointer; }
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 10px 16px; font-weight: 600; font-size: 16px; min-height: 46px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: 14px; min-height: 34px; font-weight: 500; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 16px -16px 0; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line);
}
.actions .btn.primary { flex: 1 1 150px; max-width: 280px; }
.actions .tip { font-size: 13px; color: var(--muted); flex: 1 1 260px; margin: 0; line-height: 1.45; }

#paper-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.paper { position: relative; width: 794px; min-height: 1123px; padding: 76px; background: #fff; color: #000; transform-origin: 0 0; }
.page-guide { position: absolute; left: 0; right: 0; border-top: 2px dashed #d0605a; pointer-events: none; }
.page-guide span { position: absolute; right: 10px; top: 4px; font: 600 13px/1.4 var(--sans); color: #b3261e; background: #fff; padding: 0 6px; }

.capture { position: absolute; left: -10000px; top: 0; width: 794px; padding: 0 76px; background: #fff; overflow: hidden; }

/* ───────── 문서 (화면 미리보기 · 인쇄 · PDF 공통) */
/* 크기는 모두 em으로 잡아, 글자 크기(작게·보통·크게)를 바꾸면 문서 전체가 함께 커지고 줄어든다. */

.doc {
  display: flow-root;
  font-family: "Nanum Myeongjo", "AppleMyungjo", "Batang", "바탕", "Noto Serif KR", serif;
  font-size: 15px; line-height: 1.8; color: #000; text-align: justify;
  word-break: normal; overflow-wrap: anywhere; line-break: strict;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.doc.ff-g { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif; }
.doc.fs-s { font-size: 13.5px; line-height: 1.72; }
.doc.fs-l { font-size: 16.5px; }

.doc p { margin: 0; }
.doc h1 { font-size: 2.2em; font-weight: 800; text-align: center; margin: .25em 0 1.5em; line-height: 1.3; letter-spacing: 0; }
.doc.ff-g h1 { font-weight: 700; }
.doc h2 { font-size: 1.06em; font-weight: 700; text-align: left; margin: 1.7em 0 .35em; letter-spacing: 0; }

.doc table.info { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1.5px solid #000; margin: 0 0 1.15em; }
.doc table.info th, .doc table.info td { border: 1px solid #000; padding: .5em .75em; vertical-align: middle; text-align: left; font-weight: 400; }
.doc table.info th { background: #f2f2f2; padding: .5em .25em; text-align: center; font-weight: 700; white-space: nowrap; }
.doc col.c-side { width: 5.2em; }
.doc col.c-label { width: 7.2em; }
.doc col.c-short { width: 10.5em; }
.doc table.info th.top { vertical-align: top; }
.doc td.tall { height: 7em; vertical-align: top; }
.doc td.amount { font-size: 1.2em; font-weight: 700; }
.doc td.strong { font-weight: 700; }

.doc .stmt { margin: 1.5em 0; text-indent: 1em; }
.doc .stmt.center { margin: 2.4em 0; text-align: center; text-indent: 0; line-height: 2.05; }
.doc .daeum { margin: 1.4em 0 1.1em; text-align: center; font-weight: 700; }
.doc .body { margin: 1.4em 0; }
.doc .date { margin: 3em 0 2em; text-align: center; font-size: 1.1em; }
.doc .signer { margin: .6em 0; text-align: right; font-size: 1.1em; }
.doc .signer .role { margin-right: 1.6em; }
.doc .signer .nm { margin-right: 1.1em; font-weight: 700; }
.doc .to { margin-top: 3em; text-align: left; font-size: 1.3em; font-weight: 800; }
.doc.ff-g .to { font-weight: 700; }
.doc .to-top { margin-bottom: 1.2em; text-align: left; font-size: 1.2em; font-weight: 700; }

.doc .blank { display: inline-block; min-width: 7.5em; height: 1.25em; border-bottom: 1px solid #000; vertical-align: bottom; }
.doc .blank.l { min-width: 14em; }
.doc .blank.sign { min-width: 8em; }
.doc .gap { display: inline-block; width: 2em; }
.doc .gap.w { width: 3.4em; }
.doc .lines div { height: 2.2em; border-bottom: 1px solid #999; }

.doc .seal-slot { position: relative; display: inline-block; white-space: nowrap; text-indent: 0; }
.doc .seal-slot.right { float: right; color: #555; font-size: .88em; }
.doc .seal-slot.sign { height: 1em; }
.doc .signer .seal-slot.on { margin-right: 1.2em; }
.doc .signer .seal-slot.on.sign { margin-right: 0; }
.doc img.stamp { position: absolute; left: 50%; top: 50%; max-width: none; opacity: .93; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.doc img.stamp.sign { opacity: 1; }
.doc img.stamp.dragging { cursor: grabbing; outline: 1px dashed #24449c; outline-offset: 3px; }

/* 품목 표 · 견적서 · 거래명세서 · 품의서 */

.doc table.items, .doc table.calc { font-size: .88em; line-height: 1.5; margin-bottom: 1em; }
.doc table.items th, .doc table.items td, .doc table.calc th, .doc table.calc td { padding: .36em .42em; }
.doc table.items td.c { text-align: center; }
.doc table.items td.n, .doc table.calc td.n { text-align: right; font-variant-numeric: tabular-nums; }
.doc table.items tfoot td { font-weight: 700; }
.doc table.items tfoot th small { font-weight: 400; font-size: .85em; }
.doc table.items td.net { font-size: 1.2em; }
.doc col.i-won { width: 8.6em; }
.doc col.c-calc { width: 9em; }
.doc table.six { font-size: .92em; }
.doc table.six th, .doc table.six td { padding: .4em .5em; }
.doc col.c-six { width: 6.6em; }

/* 근로계약서의 조항 */
.doc .stmt.tight { margin: 0 0 .9em; }
.doc .clauses { margin: 0 0 .4em; }
.doc .cl { margin: .26em 0; text-align: left; line-height: 1.6; }
.doc .date.tight { margin: 1.5em 0 1.1em; }
.doc table.sign th, .doc table.sign td { padding-top: .4em; padding-bottom: .4em; }
.doc .cl b { margin-right: .7em; font-weight: 700; }
.doc .cl.sub { margin: .08em 0; padding-left: 1.5em; }
.doc .cl.etc { margin-top: .3em; }
.doc col.i-no { width: 2.9em; }
.doc col.i-md { width: 4.3em; }
.doc col.i-spec { width: 6.6em; }
.doc col.i-qty { width: 3.5em; }
.doc col.i-price { width: 5.6em; }
.doc col.i-sup { width: 6.2em; }
.doc col.i-tax { width: 5.3em; }
.doc col.i-amt { width: 7em; }
.doc col.i-note { width: 4.6em; }
.doc col.i-note2 { width: 7em; }
.doc .unit { margin: 0 0 .25em; text-align: right; font-size: .85em; }

.doc table.split { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0 0 1em; }
.doc table.split > tbody > tr > td { padding: 0; border: 0; vertical-align: top; text-align: left; }
.doc table.split > tbody > tr > td.s-left { padding-right: 1.1em; }
.doc col.s-left { width: 37%; }
.doc .kv { margin: 0 0 .25em; text-align: left; }
.doc .kv b { display: inline-block; min-width: 4.6em; font-weight: 700; }
.doc .rcpt { margin: .6em 0 .6em; padding-bottom: .2em; border-bottom: 1px solid #000; text-align: left; font-size: 1.22em; font-weight: 800; line-height: 1.5; }
.doc.ff-g .rcpt { font-weight: 700; }
.doc .say { margin-top: .6em; text-align: left; }
.doc table.info.last { margin-bottom: 0; }

.doc table.party, .doc table.party2 { margin-bottom: 0; line-height: 1.5; }
.doc table.party { font-size: .9em; }
.doc table.party2 { font-size: .86em; margin-bottom: 1.15em; }
.doc table.party th, .doc table.party td, .doc table.party2 th, .doc table.party2 td { padding: .4em .42em; }
.doc table.party th, .doc table.party2 th { padding: .4em .15em; }
.doc th.v { line-height: 1.4; }
.doc col.p-side { width: 1.9em; }
.doc col.p-label { width: 4.7em; }
.doc col.p-label2 { width: 4.7em; }
.doc col.p-val2 { width: 7.6em; }
.doc col.q-side { width: 1.9em; }
.doc col.q-label { width: 4.6em; }
.doc col.q-val { width: 9em; }
.doc col.q-label2 { width: 2.9em; }

.doc table.total th small { display: block; font-size: .76em; font-weight: 400; line-height: 1.3; }
.doc table.total td.amount { text-align: center; }
.doc table.total .sub { font-size: .82em; font-weight: 400; }
.doc td.note { height: 3.2em; vertical-align: top; }
.doc h1.tight { margin-bottom: 1.05em; }
.doc .stmt.center.tight { margin: 1em 0; }

.doc table.split.head > tbody > tr > td { vertical-align: middle; }
.doc table.split.head h1 { margin: 0; text-align: left; padding-left: .35em; letter-spacing: .12em; }
.doc col.s-appr { width: 62%; }
.doc .compact h2 { margin: 1em 0 .2em; }
.doc .compact .body { margin: .45em 0; }
.doc .compact .unit { margin-top: -.9em; }
.doc table.approval { margin-left: auto; border-collapse: collapse; border: 1.5px solid #000; font-size: .9em; line-height: 1.4; }
.doc table.approval th, .doc table.approval td { width: 5em; border: 1px solid #000; padding: .3em .2em; text-align: center; font-weight: 700; }
.doc table.approval th { background: #f2f2f2; }
.doc table.approval th.v { width: 1.9em; }
.doc table.approval td { height: 3.9em; }
.doc .line { margin: .12em 0; text-align: left; }
.doc .line b { display: inline-block; min-width: 6.4em; font-weight: 700; }
.doc .end { margin-top: .6em; text-align: right; font-weight: 700; }

/* ───────── 안내 글 */

.prose { max-width: 46em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 8px 0; }
.prose li { margin: 6px 0; }
.prose dt { font-weight: 700; margin-top: 16px; }
.prose dd { margin: 4px 0 0; color: var(--muted); }
.prose p { margin: 10px 0; }

.report { max-width: 46em; margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }

.others { margin-top: 44px; }
.others ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0 0; list-style: none; }
.others a { display: block; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--text); font-size: 15px; }
.others a:hover { border-color: var(--accent); color: var(--accent); }

.ad { margin: 28px 0; min-height: 90px; text-align: center; }
.partner { margin: 32px 0; }
.partner .disclosure { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ───────── 좁은 화면 */

@media (max-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 26px; }
  .hero h1 { font-size: 29px; }
  .logo small { display: none; }
}

/* ───────── 인쇄: 문서만 출력 */

#print-root { display: none; }

@page { size: A4; margin: 0; }

@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  /* 한 장 = A4 한 쪽. 쪽 나눔은 app.js가 정한 위치를 그대로 쓴다 */
  .print-page { box-sizing: border-box; width: 210mm; height: 297mm; overflow: hidden; break-after: page; page-break-after: always; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-clip { box-sizing: border-box; padding-left: 76px; overflow: hidden; }
  .print-clip > .doc { width: 642px; }
  .doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
