/* 사장님 서류함 — 책상 위 서류 한 장. 남색 잉크, 붉은 도장. */
:root {
  --desk: #e9ecf1;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #5a6478;
  --line: #cfd5df;
  --seal: #c8102e;
  --soft: #f3f5f9;
  --ui: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --doc: 'Gowun Batang', 'Noto Serif KR', serif;
  --r: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 400 16px/1.65 var(--ui); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }

.site-header, main, .site-footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.wide, .site-header, .site-footer { max-width: 1240px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.site-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.05rem; text-decoration: none; }
.seal { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--seal); border-radius: 6px; color: var(--seal); font: 700 15px/1 var(--doc); transform: rotate(-6deg); }
.site-header nav { display: flex; gap: 16px; font-size: 0.92rem; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); text-decoration: underline; }

.intro { padding: 20px 0 20px; }
.crumb { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); }
.crumb a { color: var(--muted); }
h1 { font: 900 clamp(1.9rem, 5vw, 2.6rem)/1.2 var(--ui); letter-spacing: -0.02em; margin: 0 0 10px; }
.home h1 { font-size: clamp(2.3rem, 8vw, 3.8rem); line-height: 1.12; }
.home { padding: 36px 0 28px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 40em; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 6px 0 10px; }

/* 작업 화면: 왼쪽 입력, 오른쪽 종이 */
.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.panel, .preview { min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; width: 100%; }
legend::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; }
.f { display: block; min-width: 0; }
.f.full { grid-column: 1 / -1; }
.f span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 3px; }
input, select, textarea { width: 100%; min-width: 0; height: 44px; padding: 0 10px; font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--soft); border: 1.5px solid transparent; border-radius: 6px; }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background: var(--card); }
input::placeholder, textarea::placeholder { color: #9aa3b2; }

.items { display: grid; gap: 8px; margin-bottom: 8px; }
.item { display: grid; grid-template-columns: 1fr 64px 92px 36px; grid-template-areas: 'name name name del' 'spec qty price price'; gap: 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.i-name { grid-area: name; } .i-spec { grid-area: spec; } .i-qty { grid-area: qty; } .i-price { grid-area: price; } .i-del { grid-area: del; }
.i-qty, .i-price { text-align: right; }
.i-del { height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; border-radius: 6px; }
.i-del:hover { background: var(--soft); color: var(--seal); }
#add-item { margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font: 700 0.95rem var(--ui); cursor: pointer; }
.btn:hover { background: #0c1630; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 500; }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 0.88rem; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.status { min-height: 1.4em; margin: 8px 0 0; font-size: 0.88rem; color: var(--seal); }

.preview-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 0.88rem; color: var(--muted); }
.stage { position: relative; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(20, 33, 61, .12), 0 12px 32px -12px rgba(20, 33, 61, .28); }
.print-bar { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--desk) 30%); text-align: center; }
.print-bar .btn { width: 100%; max-width: 420px; min-height: 50px; }

.page-text { max-width: 760px; margin-top: 44px; }
.page-text section, .related { margin-bottom: 36px; }
.tips { padding-left: 1.2em; margin: 0; }
.tips li { margin-bottom: 8px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }
.related ul, .cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.related ul { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.related a { display: block; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 500; }
.related a:hover, .cards a:hover { border-color: var(--ink); }

.shelf { margin-bottom: 36px; scroll-margin-top: 16px; }
.shelf h2 { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.shelf h2 small { font-weight: 400; font-size: 0.88rem; color: var(--muted); }
.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cards a { display: block; height: 100%; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.cards strong { display: block; font-size: 1.08rem; margin-bottom: 4px; }
.cards span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.site-footer { margin-top: 48px; padding-top: 16px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.site-footer p { margin: 0 0 6px; max-width: 60em; }

@media (min-width: 940px) {
  .work { grid-template-columns: 400px minmax(0, 1fr); gap: 28px; }
  .preview { position: sticky; top: 16px; max-width: 720px; }
  .print-bar { display: none; }
}

/* ── 종이 (A4). 크기는 mm·pt 로 잡아 인쇄와 화면이 같은 모양이 되게 합니다. ── */
.sheet { width: 210mm; min-height: 297mm; padding: 16mm 15mm; background: #fff; color: #111; font: 400 10.5pt/1.5 var(--ui); transform-origin: 0 0; word-break: keep-all; }
.sheet h2, .sheet p { margin: 0; }
.d-title { font: 700 25pt/1.2 var(--doc); text-align: center; letter-spacing: 0.35em; padding-left: 0.35em; margin-bottom: 9mm !important; }
table.d { width: 100%; border-collapse: collapse; }
.d th, .d td { border: 0.3mm solid #222; padding: 1.5mm 2mm; font-size: 9.5pt; vertical-align: middle; }
.d th { background: #f0f2f5; font-weight: 500; text-align: center; white-space: nowrap; }
.d-head { display: grid; grid-template-columns: 1fr 100mm; gap: 6mm; align-items: end; margin-bottom: 5mm; }
.d-date { margin-bottom: 4mm !important; }
.d-name { font-size: 13pt; border-bottom: 0.3mm solid #222; padding-bottom: 1mm; margin-bottom: 3mm !important; }
.d-small { font-size: 9pt; color: #444; margin-top: 1mm !important; }
.d-vert { width: 8mm; writing-mode: vertical-rl; letter-spacing: 0.4em; }
.d-biz td { height: 7.2mm; }
.d-total { display: flex; align-items: baseline; gap: 4mm; padding: 2.5mm 3mm; border: 0.5mm solid #222; margin-bottom: 3mm !important; }
.d-total strong { font-size: 13pt; flex: 1; }
.d-total span { font-size: 9.5pt; }
.d-items td { height: 7.6mm; }
.c-no { width: 9mm; text-align: center; } .c-spec { width: 20mm; text-align: center; } .c-qty { width: 15mm; text-align: right; } .c-num { width: 26mm; text-align: right; }
.d-items tfoot td { font-weight: 700; }
.d-note { margin-top: 4mm; border: 0.3mm solid #222; padding: 2mm 3mm; min-height: 22mm; font-size: 9.5pt; }
.d-note strong { font-weight: 500; }
.d-sign { margin-top: 8mm !important; text-align: right; }
.d-sign span { display: inline-block; width: 40mm; border-bottom: 0.3mm solid #222; }

.d-cert { padding: 28mm 24mm; }
.d-cert .d-title { margin-bottom: 16mm !important; }
.d-kv th { width: 34mm; padding: 3.2mm 2mm; font-size: 11pt; }
.d-kv td { padding: 3.2mm 4mm; font-size: 11pt; }
.c-body { margin-top: 20mm !important; text-align: center; font: 400 13pt/1.9 var(--doc); }
.c-date { margin-top: 18mm !important; text-align: center; font: 400 12.5pt var(--doc); }
.c-biz { margin: 16mm 0 0 auto; border-collapse: collapse; }
.c-biz th { text-align: justify; text-align-last: justify; font-weight: 400; color: #333; padding: 1.2mm 5mm 1.2mm 0; width: 34mm; white-space: nowrap; }
.c-biz td { padding: 1.2mm 0; min-width: 62mm; }
.c-biz strong { font-size: 13pt; letter-spacing: 0.2em; }
.c-seal { margin-left: 6mm; color: #666; }

.notice { display: flex; padding: 14mm; height: 297mm; }
.notice.landscape { width: 297mm; height: 210mm; min-height: 210mm; }
.n-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 9mm; padding: 14mm 12mm; border: 1.2mm solid #111; }
.n-title { font: 900 46pt/1.15 var(--ui); letter-spacing: -0.01em; }
.landscape .n-title { font-size: 42pt; }
.n-big { font: 900 28pt/1.3 var(--ui); padding: 4mm 8mm; text-wrap: balance; }
.n-rows { margin: 0; width: 100%; max-width: 150mm; display: grid; gap: 0; }
.landscape .n-rows { max-width: 200mm; }
.n-rows div { display: grid; grid-template-columns: 46mm 1fr; align-items: baseline; gap: 5mm; padding: 3.2mm 0; border-bottom: 0.3mm solid #999; text-align: left; }
.n-rows dt { font-size: 15pt; color: #444; }
.n-rows dd { margin: 0; font-size: 21pt; font-weight: 700; overflow-wrap: anywhere; }
.n-body p { font-size: 18pt; line-height: 1.7; }
.n-foot { font-size: 17pt; }
.n-shop { font-size: 20pt; font-weight: 700; margin-top: 2mm !important; }
.n-bold .n-inner { border-color: var(--seal); border-width: 2.4mm; }
.n-bold .n-title { font-family: 'Black Han Sans', var(--ui); font-weight: 400; font-size: 58pt; color: var(--seal); }
.n-bold.landscape .n-title { font-size: 52pt; }
.n-bold .n-big { background: #111; color: #fff; }
.n-soft .n-inner { border: 0; background: #f6f1e7; border-radius: 10mm; }
.n-soft .n-title, .n-soft .n-big, .n-soft .n-shop { font-family: 'Jua', var(--ui); font-weight: 400; }
.n-soft .n-title { font-size: 50pt; color: #3d5a45; }
.n-soft .n-big { color: #3d5a45; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .intro, .panel, .preview-bar, .preview .hint, .page-text, .print-bar, .skip { display: none !important; }
  main, main.wide { max-width: none; margin: 0; padding: 0; }
  .work { display: block; }
  .preview { position: static; max-width: none; }
  .stage { height: auto !important; overflow: visible; box-shadow: none; }
  .sheet { transform: none !important; min-height: 0; }
  .notice { height: 296mm; } .notice.landscape { height: 209mm; }
  .sheet, .n-bold .n-big, .n-soft .n-inner, .d th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.c-body { text-wrap: balance; }

/* 근로계약서 */
.warn { margin: 6px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--seal); white-space: pre-line; }
.warn:empty { display: none; }
.d-contract { padding: 16mm 18mm 14mm; font-size: 10pt; }
.d-contract .d-title { margin-bottom: 6mm !important; font-size: 22pt; }
.blank { display: inline-block; width: 28mm; border-bottom: 0.3mm solid #222; }
.k-intro { margin-bottom: 4mm !important; }
.k-list { margin: 0; padding-left: 5.5mm; }
.k-list > li { margin-bottom: 2.6mm; padding-left: 1mm; }
.k-list > li > strong { display: inline-block; min-width: 31mm; }
.k-sub { margin-top: 1mm !important; color: #222; }
.d-contract .c-date { margin-top: 6mm !important; font-size: 11.5pt; }
.k-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-top: 6mm; }
.k-sign table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.k-sign th { width: 8mm; writing-mode: vertical-rl; letter-spacing: 0.3em; background: #f0f2f5; border: 0.3mm solid #222; font-weight: 500; }
.k-sign td { border: 0.3mm solid #222; padding: 1.6mm 2mm; }
.k-sign td:nth-child(2), .k-sign tr:not(:first-child) td:first-child { width: 17mm; white-space: nowrap; color: #333; }
/* 급여명세서·손익표 */
.d-pay .d-title { margin-bottom: 8mm !important; }
.p-info th { width: 28mm; font-size: 9.5pt; padding: 2mm; } .p-info td { font-size: 10pt; padding: 2mm 3mm; }
.p-h { margin: 6mm 0 1.5mm; font-size: 10.5pt; font-weight: 700; }
.p-table th, .p-table td { padding: 2mm 3mm; font-size: 10pt; }
.p-table thead th:first-child, .p-table tfoot th { text-align: left; padding-left: 3mm; }
.p-table td.c-num, .p-table th.c-num { width: 36mm; text-align: right; }
.p-table tfoot td { font-weight: 700; }
.p-net { margin-top: 6mm !important; }
.p-net strong { text-align: right; font-size: 15pt; }
.p-from { margin-top: 12mm !important; text-align: right; }
.p-meta { text-align: center; margin: -4mm 0 2mm !important; font-size: 11pt; }
/* 원산지 표시판 (A3 가로) */
.origin { width: 420mm; min-height: 297mm; height: 297mm; padding: 12mm; display: flex; }
.o-inner { flex: 1; border: 1.5mm solid #111; padding: 8mm 12mm; display: flex; flex-direction: column; }
.o-title { font: 900 64pt/1.2 var(--ui); text-align: center; letter-spacing: 0.08em; padding-bottom: 5mm; border-bottom: 1mm solid #111; margin-bottom: 4mm !important; }
.o-table { width: 100%; border-collapse: collapse; }
.o-table th, .o-table td { padding: 2.2mm 3mm; border-bottom: 0.4mm solid #999; vertical-align: baseline; text-align: left; line-height: 1.15; }
.o-table th { width: 34%; font: 700 40pt/1.15 var(--ui); white-space: nowrap; }
.o-table td { font: 900 60pt/1.15 var(--ui); }
.o-shop { margin-top: auto !important; text-align: right; font-size: 20pt; font-weight: 700; }
@media print { .origin { height: 296mm; } }

/* 근로시간 입력표 */
.sched-wrap { overflow-x: auto; margin-bottom: 4px; }
.sched { border-collapse: collapse; width: 100%; min-width: 340px; }
.sched th { font-size: 0.78rem; font-weight: 500; color: var(--muted); padding: 0 2px 4px; text-align: left; }
.sched tbody th { width: 22px; font-size: 0.9rem; color: var(--ink); font-weight: 700; }
.sched td { padding: 2px; }
.sched input { height: 38px; padding: 0 4px; font-size: 0.85rem; }
#sched-sum { font-weight: 700; color: var(--ink); }
/* 근로계약서 2025 양식 */
.k-kind { text-align: center; margin: -4mm 0 5mm !important; font-size: 10.5pt; color: #333; }
.k-sched { width: auto !important; min-width: 0; margin: 1.5mm 0 1mm; }
.k-sched th, .k-sched td { padding: 1mm 2.2mm !important; font-size: 8.8pt; text-align: center; width: auto !important; }
.k-sched tbody th { white-space: nowrap; }
.k-attach { margin-top: 10mm !important; }

.d-contract { padding: 13mm 17mm 11mm; font-size: 9.6pt; line-height: 1.45; }
.d-contract .d-title { margin-bottom: 4mm !important; }
.d-contract .k-list > li { margin-bottom: 1.8mm; }
.d-contract .k-sub { margin-top: 0.6mm !important; }
.d-contract .c-date { margin-top: 4mm !important; }
.d-contract .k-sign { margin-top: 4mm; }
.d-contract .k-sign td { padding: 1.2mm 2mm; }
.d-consent { padding: 17mm 22mm 14mm; }
.d-consent .d-title { letter-spacing: 0.12em; padding-left: 0.12em; margin-bottom: 10mm !important; }
.d-consent .d-kv th, .d-consent .d-kv td { padding: 2.2mm 3mm; font-size: 10.5pt; }
.d-consent .d-kv th { width: 40mm; }
.d-consent .p-h { margin-top: 5mm; }
.d-consent .c-body { margin-top: 12mm !important; }
.d-consent .c-date { margin-top: 10mm !important; }
.d-consent .p-from { margin-top: 8mm !important; }
.d-consent .k-attach { margin-top: 8mm !important; }
