@charset "utf-8";
/* ==========================================================
   A4 업무 문서 공통 스타일 (210mm × 297mm)
   - 화면: 회색 배경 위 A4 용지, 입력칸은 옅은 배경만 표시
   - 인쇄: 여백 0 / 용지 안쪽 패딩으로 여백 처리, 입력 흔적 제거
   ========================================================== */

:root {
  /* 문서 (인쇄되는 색) */
  --ink: #1f1f1f;
  --sub: #5f6368;
  --muted: #9aa0a6;
  --line: #1f1f1f;
  --grid: #a8acb2;
  --grid-soft: #dadce0;
  --head: #f1f3f4;
  --accent: #1f1f1f;
  --accent-soft: #f6f7f8;
  /* 화면 전용 (입력 표시) */
  --field: #eef4fe;
  --field-hover: #e2ecfd;
  --field-focus: #fff7d1;
  --field-ph: #a3adbd;
  /* 앱 UI (화면 틀 — 종이는 항상 흰색) */
  --ui-bg: #f4f5f7;
  --ui-surface: #ffffff;
  --ui-border: #e3e6ea;
  --ui-hover: #eef0f3;
  --ui-text: #16181d;
  --ui-sub: #666d78;
  --ui-muted: #9aa1ab;
  --ui-primary: #1a73e8;
  --ui-primary-hover: #1664cf;
  --ui-on-primary: #ffffff;
  --ui-danger: #d93025;
  --glow-1: rgba(26, 115, 232, .10);
  --glow-2: rgba(124, 77, 255, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --zoom: 1;
  --fs: 9.5pt;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ui-bg: #0e1014;
    --ui-surface: #171a20;
    --ui-border: #2a2e36;
    --ui-hover: #20242c;
    --ui-text: #e9eaed;
    --ui-sub: #a0a6b0;
    --ui-muted: #6c727c;
    --ui-primary: #8ab4f8;
    --ui-primary-hover: #a8c7fa;
    --ui-on-primary: #0b1a33;
    --glow-1: rgba(138, 180, 248, .12);
    --glow-2: rgba(167, 139, 250, .09);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ui-bg); }
body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.55;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; cursor: pointer; }

/* ---------- 상단 도구막대 (화면 전용) ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 10px 20px;
  background: color-mix(in srgb, var(--ui-surface) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
  backdrop-filter: saturate(1.8) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 80%, transparent);
  color: var(--ui-text); font-size: 13.5px;
}
.tb-back {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--ui-sub); text-decoration: none;
  transition: background .15s, color .15s;
}
.tb-back:hover { background: var(--ui-hover); color: var(--ui-text); }
.tb-back svg { width: 20px; height: 20px; }
.tb-doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-ico {
  position: relative; flex: none;
  width: 28px; height: 36px; border-radius: 4px;
  background: #fff; border: 1px solid var(--ui-border);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.tb-ico::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 8px; height: 14px;
  background: repeating-linear-gradient(#c9ced6 0 1.5px, transparent 1.5px 4.5px);
}
.tb-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tb-title { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-cat { font-size: 12px; color: var(--ui-sub); }
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--ui-border); border-radius: 10px;
  background: var(--ui-surface); color: var(--ui-text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.tb-btn:hover { background: var(--ui-hover); }
.tb-btn:active { transform: scale(.97); }
.tb-btn svg { width: 17px; height: 17px; flex: none; }
.tb-btn.icon { width: 38px; padding: 0; }
.tb-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ui-primary) 14%, var(--ui-surface));
  border-color: color-mix(in srgb, var(--ui-primary) 40%, transparent);
  color: var(--ui-primary); font-weight: 600;
}
.tb-btn.primary {
  background: var(--ui-primary); border-color: var(--ui-primary); color: var(--ui-on-primary); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 12px color-mix(in srgb, var(--ui-primary) 30%, transparent);
}
.tb-btn.primary:hover { background: var(--ui-primary-hover); }
.tb-btn.armed { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
.tb-kbd { padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.2); font-size: 11px; font-weight: 500; }
.tb-zoom {
  display: inline-flex; align-items: center;
  height: 38px; border: 1px solid var(--ui-border); border-radius: 10px; overflow: hidden;
  background: var(--ui-surface);
}
.tb-zoom button { width: 34px; height: 100%; border: 0; background: transparent; color: var(--ui-text); font-size: 17px; }
.tb-zoom button:hover { background: var(--ui-hover); }
.tb-zoom span { min-width: 46px; text-align: center; font-size: 12.5px; color: var(--ui-sub); font-variant-numeric: tabular-nums; }
.tb-progress {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px 0 9px;
  border-radius: 10px; color: var(--ui-sub); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.tb-progress svg { width: 22px; height: 22px; transform: rotate(-90deg); }
.tb-progress circle { fill: none; stroke-width: 4; }
.tb-progress .trk { stroke: var(--ui-border); }
.tb-progress .val { stroke: var(--ui-primary); stroke-linecap: round; transition: stroke-dasharray .4s var(--ease); }
.tb-progress b { color: var(--ui-text); font-weight: 600; }
.tb-save {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 8px; font-size: 12.5px; color: var(--ui-muted); white-space: nowrap;
}
.tb-save svg { width: 15px; height: 15px; opacity: 0; transition: opacity .2s; }
.tb-save[data-state="saved"] { color: var(--ui-sub); }
.tb-save[data-state="saved"] svg { opacity: 1; color: #1e8e3e; }
.tb-save[data-state="error"] { color: var(--ui-danger); }
/* 목록: 작성 중 표시 */
.card.has-draft .thumb::before {
  content: "작성 중"; inset: 10px auto auto 10px; height: auto; z-index: 1; opacity: 1;
  padding: 4px 9px; border-radius: 999px; background: #1e8e3e; color: #fff; font-size: 11.5px; font-weight: 700;
}
.drafts .card.has-draft .thumb::before { content: "이어서 작성"; }
.drafts .card-c { color: #1e8e3e; font-weight: 600; }
.tb-div { width: 1px; height: 24px; margin: 0 2px; background: var(--ui-border); }

/* 단축키 도움말 */
.help {
  position: fixed; top: 70px; right: 20px; z-index: 60;
  width: 300px; padding: 16px 18px;
  background: var(--ui-surface); color: var(--ui-text);
  border: 1px solid var(--ui-border); border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06);
  font-size: 13px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .18s, transform .18s var(--ease);
}
.help.open { opacity: 1; transform: none; pointer-events: auto; }
.help h3 { margin-bottom: 10px; font-size: 13.5px; }
.help li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; color: var(--ui-sub); }
.help li + li { border-top: 1px solid var(--ui-border); }
.help kbd, .page-hint kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px;
  border: 1px solid var(--ui-border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--ui-bg); color: var(--ui-text);
  font: inherit; font-size: 11.5px; text-align: center;
}

/* 알림 */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70;
  padding: 11px 18px; border-radius: 999px;
  background: #16181d; color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.page-hint {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px;
  margin: 18px auto -6px; padding: 0 16px;
  font-size: 12.5px; color: var(--ui-sub);
}
.page-hint span { display: inline-flex; align-items: center; gap: 6px; }
.page-hint i { width: 11px; height: 11px; border-radius: 3px; background: var(--field); box-shadow: inset 0 0 0 1px #c9d8f5; }
@media (max-width: 960px) {
  .tb-save span, .tb-cat, .tb-ico, .tb-btn .lbl, .tb-progress span, .tb-div, .tb-kbd { display: none; }
  .toolbar { padding: 8px 12px; gap: 6px; }
  .tb-btn { padding: 0 11px; }
  .tb-zoom { display: none; }
}

/* ---------- A4 용지 ---------- */
@page { size: 210mm 297mm; margin: 0; }
.page {
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto 48px;
  padding: 13mm 14mm 12mm;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.08);
  counter-reset: sec;
  zoom: var(--zoom);
  animation: rise .5s var(--ease) both;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 입력 요소 (테두리 없음) ---------- */
.f {
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1.2mm 1.8mm;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: var(--field);
  color: inherit;
  font: inherit;
  line-height: 1.4;
}
.f:hover { background: var(--field-hover); }
.f:focus { background: var(--field-focus); }
.f::placeholder { color: var(--field-ph); }
.f.c { text-align: center; }
.f.num { text-align: right; font-variant-numeric: tabular-nums; }
.f.auto { background: transparent; color: var(--accent); font-weight: 600; cursor: default; }

.area {
  min-height: 14mm;
  padding: 2mm 2.6mm;
  background: var(--field);
  white-space: pre-wrap;
  outline: 0;
  line-height: 1.65;
}
.area:hover { background: var(--field-hover); }
.area:focus { background: var(--field-focus); }
.area.sm { min-height: 6.6mm; padding: 1.2mm 1.8mm; line-height: 1.45; }
[data-ph]:empty::before { content: attr(data-ph); color: var(--field-ph); pointer-events: none; }

[contenteditable] { outline: 0; }
[contenteditable]:not(.area):focus { background: var(--field-focus); }

input[type="checkbox"] {
  width: 3.4mm; height: 3.4mm; margin: 0;
  accent-color: var(--accent);
  vertical-align: middle; cursor: pointer;
}
.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 1mm 4.5mm; padding: 1.3mm 2mm; }
.opts label { display: inline-flex; align-items: center; gap: 1.2mm; cursor: pointer; white-space: nowrap; }
.opts .f { width: auto; flex: 1 1 24mm; }

.count { margin-top: 1mm; text-align: right; font-size: 8pt; color: var(--muted); }

/* ---------- 문서 머리 ---------- */
.doc-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 6mm;
  margin-bottom: 5.5mm;
}
.doc-head.has-appr { grid-template-columns: 1fr auto; }
.doc-title {
  font-size: 21pt;
  font-weight: 800;
  text-align: center;
  letter-spacing: .06em;
  line-height: 1.3;
}
.doc-title.wide { letter-spacing: .45em; text-indent: .45em; }
.doc-sub {
  margin-top: 1.5mm;
  text-align: center;
  font-size: 9.5pt;
  color: var(--sub);
}
.doc-head:not(.has-appr) .doc-title-wrap {
  padding-bottom: 4mm;
  border-bottom: 2px solid var(--line);
}

/* 결재란 */
.appr { border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; }
.appr th, .appr td { border: 1px solid var(--line); text-align: center; padding: 0; }
.appr th { width: 18mm; height: 6mm; background: var(--head); font-weight: 600; }
.appr th.vhead { width: 7mm; }
.appr .appr-sign { height: 15mm; vertical-align: middle; }
.appr .appr-date { height: 5.5mm; font-size: 7.5pt; color: var(--sub); }

/* ---------- 섹션 ---------- */
.sec { margin-top: 4.5mm; }
.sec:first-child { margin-top: 0; }
.sec-title {
  display: flex; align-items: center; gap: 2mm;
  margin-bottom: 2.2mm;
  font-size: 11pt; font-weight: 700; color: var(--accent);
}
.sec-title::before {
  content: ""; flex: none;
  width: 1.1mm; height: 3.8mm;
  background: var(--accent);
}
.numbered .sec-title::before {
  counter-increment: sec;
  content: counter(sec) ".";
  width: auto; height: auto;
  background: none;
}
.sec-title + .note { margin: -1mm 0 2mm; }

/* ---------- 표 공통 ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1.4px solid var(--line);
}
.tbl th, .tbl td {
  border: 1px solid var(--grid);
  padding: 0;
  vertical-align: middle;
}
.tbl th {
  background: var(--head);
  font-weight: 600;
  font-size: 9pt;
  text-align: center;
  padding: 1.1mm 1.5mm;
  line-height: 1.35;
}
.tbl td > .f { display: block; min-height: 6.6mm; }
.tbl td.c { text-align: center; }
.tbl td.num { text-align: right; padding: 1.3mm 1.8mm; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl + .tbl, .tbl-wrap + .tbl, .tbl + .tbl-wrap { margin-top: 3mm; }

/* 좌측 라벨형(키-값) 표 */
.kv col.kl { width: 17%; }
.kv.one col.kl { width: 20%; }
.kv col.vh { width: 8mm; }
.kv td > .opts { min-height: 7.2mm; }
.vhead { font-weight: 700; line-height: 1.5; letter-spacing: 0; }

/* 목록형 표 */
.grid thead th { background: var(--head); }
.grid tbody { counter-reset: row; }
.grid tbody tr { counter-increment: row; }
.grid td.no { text-align: center; color: var(--sub); font-size: 8.5pt; }
.grid td.no::before { content: counter(row); }
.grid th.rh { text-align: center; }
.grid tfoot th, .grid tfoot td { background: var(--accent-soft); font-weight: 700; }
.grid tfoot td { text-align: right; padding: 1.3mm 1.8mm; }
.pct-cell { position: relative; }
.pct-cell .bar {
  position: absolute; left: 0; bottom: 0;
  height: 1.1mm; width: 0;
  background: var(--accent);
}

.row-ctrl { display: flex; justify-content: flex-end; gap: 4px; margin-top: 3px; }
.row-ctrl button {
  font-size: 11px; padding: 2px 9px;
  border: 1px solid #c5ccd6; border-radius: 4px;
  background: #fff; color: #445;
}
.row-ctrl button:hover { background: var(--accent-soft); }
.tbl-wrap .row-ctrl { opacity: .45; transition: opacity .15s; }
.tbl-wrap:hover .row-ctrl, .row-ctrl:focus-within { opacity: 1; }
.cards [hidden], .cat-sec[hidden] { display: none; }

/* ---------- 합계 박스 ---------- */
.total {
  display: grid;
  grid-template-columns: 32mm 1fr auto;
  align-items: stretch;
  margin: 4mm 0;
  border: 1.6px solid var(--line);
}
.total > div { display: flex; align-items: center; padding: 2.6mm 4mm; }
.total-l {
  justify-content: center; flex-direction: column;
  background: var(--head); font-weight: 700;
  border-right: 1px solid var(--grid);
}
.total-l small { font-weight: 400; font-size: 7.5pt; color: var(--sub); }
.total-k { font-size: 11pt; font-weight: 700; letter-spacing: .03em; }
.total-n { font-size: 12.5pt; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 레이아웃 도우미 ---------- */
.split { display: flex; gap: 4mm; align-items: stretch; }
.split > .grow { flex: 1; min-width: 0; }
.split > .grow > .tbl { height: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.grid2 > .tbl { align-self: start; margin-top: 0; }
.mt { margin-top: 4mm; }

/* 사진 */
.photo {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 30mm; height: 40mm;
  background: var(--field) center / cover no-repeat;
  border: 1px solid var(--grid);
  color: var(--muted); font-size: 8.5pt; text-align: center; line-height: 1.4;
  cursor: pointer;
}
.photo:hover { background-color: var(--field-hover); }
.photo.filled span { display: none; }
.photos { display: grid; grid-template-columns: 2fr 1fr; gap: 3mm; }
.photos .photo { width: auto; height: 30mm; }
.photos .photo.main { grid-row: span 2; height: auto; }

/* ---------- 본문 문단 ---------- */
.intro { margin: 1mm 0 5mm; font-size: 10pt; line-height: 1.85; white-space: pre-wrap; }
.stmt { margin: 6mm 0 4mm; text-align: center; font-size: 10.5pt; }
.note { margin-top: 1.5mm; font-size: 8.5pt; color: var(--sub); white-space: pre-wrap; }
.callout {
  margin-top: 4mm; padding: 3mm 4mm;
  background: var(--accent-soft);
  border-left: 1.2mm solid var(--accent);
}
.callout b { display: block; margin-bottom: 1mm; color: var(--accent); }
.callout .area { background: transparent; min-height: 10mm; padding: 0; }

/* 조항 (계약·협약) */
.clause { margin-bottom: 2.4mm; }
.clause-t { font-weight: 700; margin-bottom: .8mm; }
.clause .area { min-height: 6.6mm; }

/* 번호 목록 (서약·안내) */
.pledge { counter-reset: pl; }
.pledge-item { display: grid; grid-template-columns: 7mm 1fr; margin-bottom: 1.8mm; }
.pledge-item::before {
  counter-increment: pl;
  content: counter(pl) ".";
  padding-top: 2mm; font-weight: 700;
}
.pledge-item .area { min-height: 8mm; }

/* SWOT */
.swot { display: grid; grid-template-columns: 1fr 1fr; border: 1.4px solid var(--line); }
.swot-cell { display: flex; flex-direction: column; min-height: 28mm; border: 1px solid var(--grid); }
.swot-cell b { padding: 1.3mm 2.5mm; background: var(--head); font-size: 9pt; }
.swot-cell .area { flex: 1; }

/* 라벨 줄 (공문 등) */
.lines { display: grid; gap: 1.2mm; }
.line {
  display: grid; grid-template-columns: 20mm 1fr;
  align-items: center;
}
.line .lbl { font-weight: 600; }
.line .seal-row { display: flex; align-items: center; gap: 2mm; }

/* 한 줄 나열형 */
.inline { display: flex; flex-wrap: wrap; gap: 1.2mm 5mm; }
.inline .it { display: flex; align-items: center; gap: 1.5mm; flex: 1 1 40mm; }
.inline .it > span { flex: none; font-weight: 600; }

/* ---------- 서명 ---------- */
.sign { margin-top: 6mm; text-align: center; }
.sign .stmt { margin-top: 0; }
.sign-date { margin: 4mm auto 0; width: 64mm; }
.sign-date .f { text-align: center; font-size: 10.5pt; }
.signers { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 3mm 10mm; margin-top: 5mm; }
.signer { display: flex; align-items: center; gap: 2mm; font-size: 10.5pt; }
.signer .lbl { font-weight: 600; padding: 0 1mm; }
.signer .f { width: 34mm; text-align: center; }
.seal { color: var(--sub); white-space: nowrap; }
.sign-to { margin-top: 9mm; text-align: left; font-size: 13pt; font-weight: 700; }

.party-sign { margin-top: 7mm; }
.ps-h {
  margin-bottom: 2mm; padding-bottom: 1mm;
  border-bottom: 2px solid var(--line);
  font-size: 11.5pt; font-weight: 800;
}

/* ---------- 공문 ---------- */
.slogan { text-align: center; font-size: 9pt; color: var(--sub); margin-bottom: 1.5mm; }
.letterhead {
  margin-bottom: 6mm; padding-bottom: 3mm;
  border-bottom: 2.4px solid var(--line);
  text-align: center; font-size: 19pt; font-weight: 800; letter-spacing: .08em;
}
.sender {
  display: flex; justify-content: center; align-items: center; gap: 4mm;
  margin: 14mm 0 8mm;
}
.sender .f { width: 110mm; text-align: center; font-size: 17pt; font-weight: 800; letter-spacing: .08em; }
.foot-info {
  margin-top: 10mm; padding-top: 2.5mm;
  border-top: 2px solid var(--line);
  font-size: 8.5pt;
}
.foot-info .inline + .inline { margin-top: 1mm; }

/* ---------- 목록(인덱스) 페이지 ---------- */
.index-body { min-height: 100vh; background: var(--ui-bg); color: var(--ui-text); font-size: 14px; }
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(56rem 28rem at 12% -8%, var(--glow-1), transparent 62%),
    radial-gradient(48rem 26rem at 92% -4%, var(--glow-2), transparent 60%);
}
.index-body > *:not(.bg-glow) { position: relative; z-index: 1; }
.index-body > .hero { z-index: 100; }
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: 0 auto; padding: 22px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.logo {
  position: relative; display: grid; place-items: end center;
  width: 26px; height: 32px; padding-bottom: 4px;
  border-radius: 4px 9px 4px 4px;
  background: var(--ui-text); color: var(--ui-bg);
  font-size: 9px; font-weight: 800;
}
.logo::after {
  content: ""; position: absolute; top: 0; right: 0; width: 9px; height: 9px;
  border-radius: 0 0 0 3px; background: var(--ui-muted);
}
.topnav small { color: var(--ui-sub); font-size: 13px; }
.hero { max-width: 760px; margin: 0 auto; padding: 56px 24px 12px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--ui-surface); border: 1px solid var(--ui-border);
  font-size: 12.5px; color: var(--ui-sub);
}
.hero-badge b {
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--ui-primary) 14%, transparent); color: var(--ui-primary); font-size: 11.5px;
}
.hero h1 {
  margin-top: 20px;
  font-size: clamp(32px, 5.6vw, 58px); font-weight: 800; line-height: 1.12; letter-spacing: -.045em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--ui-primary) 10%, #8b5cf6 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero > p { margin-top: 16px; color: var(--ui-sub); font-size: 16.5px; line-height: 1.6; }
.search-box {
  display: flex; align-items: center; gap: 12px;
  height: 60px; margin: 32px auto 0; padding: 0 12px 0 20px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 16px 40px rgba(20,30,60,.08);
  transition: box-shadow .2s, border-color .2s;
}
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--ui-primary) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-primary) 16%, transparent), 0 16px 40px rgba(20,30,60,.1);
}
.search-box svg { width: 21px; height: 21px; color: var(--ui-sub); flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ui-text); font: inherit; font-size: 17px; }
.search-box input::placeholder { color: var(--ui-muted); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd {
  padding: 4px 9px; border: 1px solid var(--ui-border); border-bottom-width: 2px; border-radius: 7px;
  background: var(--ui-bg); color: var(--ui-sub); font: inherit; font-size: 12px;
}
.search-wrap { position: relative; z-index: 1000; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 1000;
  max-height: 380px; overflow-y: auto; padding: 6px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border); border-radius: 16px;
  box-shadow: 0 24px 56px rgba(15,23,42,.16), 0 2px 8px rgba(0,0,0,.06);
  text-align: left;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .15s, transform .2s var(--ease);
}
.suggest.open { opacity: 1; transform: none; pointer-events: auto; }
.sg-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--ui-text); text-decoration: none; cursor: pointer;
}
.sg-item.active { background: var(--ui-hover); }
.sg-ico {
  flex: none; width: 22px; height: 28px; border-radius: 3px;
  background: #fff repeating-linear-gradient(#cfd4db 0 1.2px, transparent 1.2px 4px) 50% 60% / 60% 50% no-repeat;
  border: 1px solid var(--ui-border);
}
.sg-t { flex: 1; font-size: 15px; font-weight: 600; }
.sg-t mark { border-radius: 3px; background: color-mix(in srgb, var(--ui-primary) 22%, transparent); color: inherit; }
.sg-c { font-size: 12.5px; color: var(--ui-muted); }
.sg-go { font-size: 12px; color: var(--ui-muted); opacity: 0; }
.sg-item.active .sg-go { opacity: 1; }
.sg-empty { padding: 18px; text-align: center; color: var(--ui-sub); font-size: 14px; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; margin-top: 22px; font-size: 13px; color: var(--ui-sub); }
.stats span { display: inline-flex; align-items: center; gap: 6px; }
.stats svg { width: 15px; height: 15px; color: var(--ui-primary); }

.layout {
  display: grid; grid-template-columns: 196px 1fr; gap: 40px;
  max-width: 1240px; margin: 48px auto 0; padding: 0 28px 120px;
}
.side { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.side-t { margin: 0 12px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--ui-muted); }
.side a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 9px;
  color: var(--ui-sub); text-decoration: none; font-size: 14px;
  transition: background .15s, color .15s;
}
.side a:hover { background: var(--ui-hover); color: var(--ui-text); }
.side a.active { background: var(--ui-surface); color: var(--ui-text); font-weight: 600; box-shadow: 0 0 0 1px var(--ui-border), 0 1px 3px rgba(0,0,0,.05); }
.side a span { font-size: 12px; color: var(--ui-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-sec { margin-bottom: 52px; scroll-margin-top: 24px; }
.cat-sec h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.cat-sec h2 small { font-size: 13px; font-weight: 500; color: var(--ui-muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 20px; }
.card { display: block; color: inherit; text-decoration: none; outline: 0; }
.thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 210 / 297;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-border), 0 1px 2px rgba(0,0,0,.04), 0 6px 16px rgba(0,0,0,.05);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.thumb::before {
  content: ""; position: absolute; inset: 14% 12% auto; height: 62%;
  background:
    linear-gradient(#e7e9ed, #e7e9ed) 50% 0 / 40% 5% no-repeat,
    repeating-linear-gradient(#eef0f3 0 6%, transparent 6% 11%) 0 16% / 100% 84% no-repeat;
  transition: opacity .3s;
}
.thumb.ready::before { opacity: 0; }
.thumb iframe {
  position: absolute; top: 0; left: 0;
  width: 794px; height: 1123px; border: 0;
  transform-origin: 0 0; transform: scale(var(--s, .21));
  pointer-events: none; opacity: 0; transition: opacity .4s;
}
.thumb.ready iframe { opacity: 1; }
.thumb::after {
  content: "열기 →"; position: absolute; right: 10px; bottom: 10px;
  padding: 7px 13px; border-radius: 999px;
  background: #16181d; color: #fff; font-size: 12px; font-weight: 600;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .25s var(--ease);
}
.card:hover .thumb, .card:focus-visible .thumb {
  transform: translateY(-5px);
  box-shadow: 0 0 0 1px var(--ui-border), 0 18px 40px rgba(0,0,0,.14), 0 4px 10px rgba(0,0,0,.06);
}
.card:focus-visible .thumb { box-shadow: 0 0 0 3px var(--ui-primary), 0 18px 40px rgba(0,0,0,.14); }
.card:hover .thumb::after, .card:focus-visible .thumb::after { opacity: 1; transform: none; }
.card-meta { margin-top: 12px; padding: 0 2px; }
.card-t { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.card-t mark { border-radius: 3px; background: color-mix(in srgb, var(--ui-primary) 22%, transparent); color: inherit; }
.card-c { display: block; margin-top: 2px; font-size: 12px; color: var(--ui-muted); }
.card[hidden], .cat-sec[hidden], .side a[hidden] { display: none; }
.empty { display: none; padding: 80px 0; text-align: center; color: var(--ui-sub); font-size: 15px; }
.empty.show { display: block; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 8px; margin-top: 28px; padding: 0 16px 80px; }
  .side {
    top: 0; z-index: 5; flex-direction: row; gap: 6px; overflow-x: auto;
    margin: 0 -16px; padding: 10px 16px; background: var(--ui-bg);
    scrollbar-width: none;
  }
  .side-t { display: none; }
  .side a { flex: none; border: 1px solid var(--ui-border); border-radius: 999px; background: var(--ui-surface); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .topnav, .hero { padding-left: 16px; padding-right: 16px; }
}

.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- 양식 설명 · FAQ (화면 전용, 검색엔진용 본문) ---------- */
.guide { width: 210mm; max-width: calc(100% - 32px); margin: 8px auto 96px; color: var(--ui-text); font-size: 15px; line-height: 1.75; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; font-size: 13px; color: var(--ui-muted); }
.crumbs a { color: var(--ui-sub); text-decoration: none; }
.crumbs a:hover { color: var(--ui-primary); }
.guide h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.3; }
.g-intro { margin-top: 12px; color: var(--ui-sub); font-size: 16px; }
.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.g-card { padding: 22px 24px; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 16px; }
.g-card h3, .g-h3 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.g-h3 { margin: 44px 0 14px; }
.g-steps { counter-reset: st; margin-top: 12px; }
.g-steps li { position: relative; padding: 6px 0 6px 34px; counter-increment: st; }
.g-steps li::before {
  content: counter(st); position: absolute; left: 0; top: 8px;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--ui-primary) 14%, transparent); color: var(--ui-primary);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.g-tips { margin-top: 12px; }
.g-tips li { position: relative; padding: 6px 0 6px 20px; }
.g-tips li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-muted); }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 12px; }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 20px; cursor: pointer; list-style: none; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 20px; font-weight: 400; color: var(--ui-muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 16px; color: var(--ui-sub); }
.g-related { grid-template-columns: repeat(5, 1fr); }
.g-more { margin-top: 28px; font-size: 14px; color: var(--ui-sub); }
.g-more a { color: var(--ui-text); text-decoration: none; border-bottom: 1px solid var(--ui-border); }
.g-more a:hover { color: var(--ui-primary); border-color: currentColor; }
.g-top {
  display: inline-flex; margin-top: 28px; padding: 11px 18px; border-radius: 10px;
  background: var(--ui-text); color: var(--ui-bg); text-decoration: none; font-size: 14px; font-weight: 600;
}
.site-faq { margin-top: 12px; }
.site-faq h2 { margin-bottom: 18px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.site-faq .faq { font-size: 15px; line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  background: var(--ui-surface); border: 1px solid var(--ui-border);
  color: var(--ui-text); text-decoration: none; font-size: 14px;
}
.chip:hover { border-color: var(--ui-primary); color: var(--ui-primary); }
.site-foot { padding: 32px 16px 48px; text-align: center; font-size: 12.5px; color: var(--ui-muted); }
@media (max-width: 760px) {
  .g-grid { grid-template-columns: 1fr; }
  .g-related { grid-template-columns: repeat(2, 1fr); }
  .guide h2 { font-size: 22px; }
}

/* ---------- 미리보기 모드 / 목록 썸네일(embed) ---------- */
.preview .row-ctrl, .preview .count, .embed .row-ctrl, .embed .count { display: none; }
.preview .f, .preview .area, .preview [contenteditable], .preview .photo,
.embed .f, .embed .area, .embed [contenteditable], .embed .photo { background-color: transparent !important; }
.preview .f.auto, .embed .f.auto { color: inherit; }
.preview .f::placeholder, .embed .f::placeholder { color: transparent; }
.preview [data-ph]:empty::before, .embed [data-ph]:empty::before { content: none; }
.preview .photo:not(.filled) span { visibility: hidden; }
html.embed { background: #fff; overflow: hidden; }
.embed .toolbar, .embed .page-hint, .embed .help, .embed .toast { display: none !important; }
.embed .page { margin: 0; box-shadow: none; animation: none; zoom: 1; }

/* ---------- 인쇄 ---------- */
@media print {
  html, body { background: #fff; }
  .no-print, .toolbar, .row-ctrl, .count { display: none !important; }
  .page-hint { display: none !important; }
  .page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    zoom: 1;
    animation: none;
  }
  .help, .toast { display: none !important; }
  .f, .area, [contenteditable], .photo { background-color: transparent !important; }
  .f.auto { color: inherit; }
  .f::placeholder { color: transparent; }
  [data-ph]:empty::before { content: none; }
  .photo:not(.filled) span { visibility: hidden; }
  .sec, .sign, tr, .keep, .clause, .pledge-item, .total, .swot-cell, .signers, .party-sign, .repeat-item { break-inside: avoid; }
  .sec-title, .ps-h, .clause-t { break-after: avoid; }
  .sec.flow { break-inside: auto; }
}

/* ---------- 증명서 발급자 / 상장·수료증 ---------- */
.party-sign.issuer { width: 95mm; margin-left: auto; }
.award {
  display: flex; flex-direction: column;
  min-height: 268mm;
  padding: 16mm 18mm 18mm;
  border: 2.4mm double var(--ink);
  text-align: center;
}
.award-no { display: flex; align-items: center; gap: 1.5mm; width: 60mm; font-size: 10.5pt; }
.award-no .f { flex: 1; }
.award-title { margin: 22mm 0 16mm; font-size: 40pt; font-weight: 800; letter-spacing: .5em; text-indent: .5em; }
.award-to { width: 110mm; margin: 0 auto; font-size: 13pt; }
.award-to .line { grid-template-columns: 28mm 1fr; }
.award-to .lbl { text-align: justify; text-align-last: justify; padding-right: 4mm; }
.award-body { margin: 18mm 0; font-size: 16pt; line-height: 2.1; white-space: pre-wrap; }
.award-date { margin-top: auto; width: 80mm; align-self: center; }
.award-date .f { font-size: 13pt; }
.award-from { display: flex; justify-content: center; align-items: center; gap: 3mm; margin-top: 10mm; }
.award-from .f { width: 120mm; font-size: 17pt; font-weight: 800; letter-spacing: .06em; }
