:root { --ink: #111827; --sub: #4b5563; --mute: #6b7280; --line: #e5e7eb; --soft: #f5f7fa; --acc: #2563eb; --acc-soft: #eff4ff; --w: #2b579a; --x: #1d7a46; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; color: var(--ink); background: #fff; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 56px; min-height: 60vh; }

/* 머리 */
.top { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; text-decoration: none; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--acc); color: #fff; font-size: 16px; }
.sbox { flex: 1; display: flex; max-width: 460px; margin-left: auto; }
.sbox input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; padding: 0 12px; font: inherit; font-size: 14px; background: var(--soft); }
.sbox button { height: 38px; border: 0; border-radius: 0 10px 10px 0; padding: 0 14px; background: var(--ink); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.gnb { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.gnb::-webkit-scrollbar { display: none; }
.gnb a { flex: none; padding: 6px 11px; border-radius: 999px; font-size: 14px; color: var(--sub); text-decoration: none; }
.gnb a:hover { background: var(--soft); color: var(--ink); }
.gnb a.on { background: var(--acc-soft); color: var(--acc); font-weight: 700; }

/* 홈 */
.hero { padding: 44px 0 28px; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.3; margin: 0 0 12px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--acc); }
.hero > p { color: var(--sub); margin: 0 0 20px; max-width: 640px; }
.hsearch { display: flex; max-width: 620px; box-shadow: 0 6px 24px rgba(17, 24, 39, .08); border-radius: 14px; }
.hsearch input { flex: 1; min-width: 0; height: 54px; border: 1px solid var(--line); border-right: 0; border-radius: 14px 0 0 14px; padding: 0 18px; font: inherit; font-size: 16px; }
.hsearch button { border: 0; border-radius: 0 14px 14px 0; padding: 0 22px; background: var(--acc); color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chips a { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--sub); }
.chips a:hover { border-color: var(--acc); color: var(--acc); }

.sh { font-size: 19px; margin: 36px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.sh .more { margin-left: auto; font-size: 14px; font-weight: 400; color: var(--mute); }
.cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cats a { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; height: 100%; transition: border-color .15s, box-shadow .15s; }
.cats a:hover { border-color: var(--acc); box-shadow: 0 4px 16px rgba(37, 99, 235, .1); }
.cats .ic { font-size: 22px; }
.cats b { font-size: 15px; }
.cats span:last-child { font-size: 13px; color: var(--mute); }

/* 목록 */
.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.item { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "b t" "b d" "b c"; column-gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; height: 100%; }
.item:hover { border-color: var(--acc); }
.item:hover b { color: var(--acc); }
.item .badge { grid-area: b; align-self: start; }
.item b { grid-area: t; font-size: 15px; }
.item .d { grid-area: d; font-size: 13px; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .c { grid-area: c; font-size: 12px; color: var(--mute); margin-top: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .03em; padding: 3px 6px; border-radius: 6px; color: #fff; vertical-align: middle; }
.badge.w { background: var(--w); }
.badge.x { background: var(--x); }
.alist { list-style: none; padding: 0; margin: 0; columns: 2 260px; column-gap: 24px; }
.alist li { padding: 6px 0; border-bottom: 1px solid var(--line); break-inside: avoid; font-size: 15px; }
.alist a { text-decoration: none; }
.alist a:hover { color: var(--acc); }
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { min-width: 34px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }

/* 상세 */
.crumb { font-size: 13px; color: var(--mute); margin: 18px 0 4px; }
.crumb a { text-decoration: none; }
.ph { font-size: clamp(22px, 4vw, 30px); line-height: 1.35; margin: 8px 0 8px; letter-spacing: -.01em; }
.ph small { font-size: 15px; color: var(--mute); font-weight: 400; }
.lead { color: var(--sub); margin: 0 0 18px; }
.meta { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 14px; margin: 4px 0 12px; }
.meta th, .meta td { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.meta th { color: var(--mute); font-weight: 400; width: 80px; background: var(--soft); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tags a { font-size: 13px; color: var(--acc); text-decoration: none; background: var(--acc-soft); padding: 2px 8px; border-radius: 6px; }
.dlbox { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 12px; background: var(--acc); color: #fff; font: inherit; font-weight: 700; text-decoration: none; border: 1px solid var(--acc); cursor: pointer; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.big { min-height: 56px; font-size: 16px; padding: 0 24px; text-align: center; }
.tips { background: var(--soft); border-radius: 14px; padding: 16px 20px; margin: 22px 0 0; }
.tips h2 { font-size: 16px; margin: 0 0 8px; }
.tips ul { margin: 0; padding-left: 20px; }
.tips li { margin: 4px 0; font-size: 14.5px; color: var(--sub); }
.preview { overflow-x: auto; background: var(--soft); border-radius: 14px; padding: 18px; }
.offi ul, .govs { list-style: none; padding: 0; margin: 0; }
.offi li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--sub); }
.offi a { color: var(--acc); font-weight: 700; }
.govs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.govs li { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.govs li > span { font-size: 13.5px; color: var(--sub); }
.govs .gl { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.govs .gl a { font-size: 13px; color: var(--acc); }

/* 다운로드·문서 */
.dlpage { max-width: 720px; padding: 12px 0; }
.dlpage #cd { color: var(--acc); }
.notice { margin: 24px 0; padding: 16px 20px 16px 36px; background: var(--soft); border-radius: 14px; font-size: 14px; color: var(--sub); }
.notice li { margin: 4px 0; }
.doc { max-width: 760px; }
.doc h2 { font-size: 17px; margin: 22px 0 6px; }
.doc p, .doc li { color: var(--sub); }

/* 꼬리 */
.foot { border-top: 1px solid var(--line); background: var(--soft); padding: 26px 0 34px; font-size: 13px; color: var(--mute); }
.fnav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.fnav a { text-decoration: none; color: var(--sub); }
.copy { margin: 6px 0 0; }

/* 서식 미리보기 종이 */
.fp-paper { background: #fff; color: #111; max-width: 760px; min-width: 520px; margin: 0 auto; padding: 44px 48px; box-shadow: 0 2px 12px rgba(17, 24, 39, .08); font-size: 13.5px; line-height: 1.65; }
.fp-paper.landscape { max-width: 980px; min-width: 760px; }
.fp-title { text-align: center; font-size: 24px; letter-spacing: .1em; margin: 0 0 26px; }
.fp-paper h3 { font-size: 14px; margin: 16px 0 6px; }
.fp-paper p { margin: 0 0 8px; }
.fp-paper table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; table-layout: fixed; }
.fp-paper th, .fp-paper td { border: 1px solid #555; padding: 6px 8px; height: 30px; vertical-align: middle; font-size: 12.5px; word-break: keep-all; overflow-wrap: anywhere; }
.fp-paper th { background: #f1f3f5; font-weight: 700; text-align: center; }
.fp-kv th { width: 18%; }
.fp-kv.wide th { width: 22%; }
.fp-kv td.tall { height: 72px; }
.fp-grid td.n { text-align: right; }
.fp-grid tr.sum td { background: #f1f3f5; font-weight: 700; }
.fp-list { margin: 4px 0 12px; padding-left: 22px; }
.fp-paper ul.fp-list { list-style: none; padding-left: 4px; }
.fp-paper ul.fp-list li::before { content: '□ '; }
.fp-note { font-size: 12px; color: #666; }
.fp-to { font-weight: 700; font-size: 15px; margin-top: 10px !important; }
.fp-date { text-align: center; margin: 18px 0 !important; }
.fp-sign { margin-top: 10px; }
.fp-seal { display: block; text-align: right; color: #888; }
.fp-foot { text-align: center; font-size: 11px; color: #999; margin-top: 18px !important; }

@media (max-width: 640px) {
  .bar { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; gap: 8px; }
  .sbox { max-width: none; flex-basis: 100%; }
  .hero { padding: 28px 0 16px; }
  .hsearch input { height: 50px; font-size: 15px; }
  .items { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .preview { padding: 10px; }
  .fp-paper { padding: 28px 22px; }
  .btn { flex: 1 1 auto; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  .top, .foot, .crumb, .ph, .lead, .meta, .tags, .dlbox, .tips, .offi, .detail > section:not(:has(.preview)), .sh { display: none !important; }
  main.wrap { padding: 0; }
  .preview { background: none; padding: 0; overflow: visible; }
  .fp-paper { box-shadow: none; padding: 0; max-width: none; min-width: 0; margin: 0; }
  .fp-paper tr, .fp-sign { break-inside: avoid; }
}
