/* 흰 바탕, 검정 글씨, 강조색 하나. 강조색은 config.json 의 theme 에서 바꿉니다(빌드할 때 아래 값이 덮어써집니다) */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --fg: #222222;
  --muted: #6b6b6b;
  --line: #ebebeb;
  --soft: #f6f7f8;
  --accent: #2563EB;
  --accent-ink: #FFFFFF;
  --accent-soft: #EEF4FF;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.35; letter-spacing: -0.02em; text-wrap: balance; }
h1 { letter-spacing: -0.03em; }
mark { background: none; color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 72px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #ffffff; }
.skip:focus { left: 8px; }
.dot { display: none; }

/* ---------- layout */
.layout { display: flex; min-height: 100vh; }
main { flex: 1 1 auto; min-width: 0; }
.wrap { max-width: 860px; margin: 0 auto; padding: 64px 48px 56px; display: flex; flex-direction: column; gap: 72px; }
.wrap--article { max-width: 1020px; flex-direction: row; align-items: flex-start; gap: 48px; }

/* ---------- sidebar */
.side { flex: 0 0 248px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; padding: 20px 12px 32px; background: var(--bg); border-right: 1px solid var(--line); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.menu-btn { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.menu { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }
.menu-group { display: flex; flex-direction: column; gap: 2px; }
.menu-label { padding: 0 10px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.nav-row:hover { color: var(--ink); }
.nav-row.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-row.is-active .count { color: var(--accent); }
.nav-name { display: flex; align-items: center; gap: 8px; }
.count { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ---------- shared blocks */
.block { display: flex; flex-direction: column; gap: 20px; }
.block--tight { gap: 12px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.block h2, .block-head h2 { font-size: 22px; font-weight: 700; }
.h-small { font-size: 17px !important; font-weight: 700; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.more:hover { color: var(--accent); text-decoration-color: var(--accent); }
.eyebrow { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--muted); }
.eyebrow::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lead { font-size: 18px; color: var(--fg); }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb a:hover { color: var(--ink); }
.crumb-cat { font-weight: 700; color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; cursor: pointer; }
.btn:hover { filter: brightness(0.92); }
.btn--lg { min-height: 54px; padding: 0 26px; border-radius: 14px; font-size: 17px; }
.btn-ghost { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.foot { display: flex; flex-direction: column; gap: 8px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--muted); letter-spacing: 0; }
.foot a:hover { color: var(--accent); }
.foot-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; }
.foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.foot-by { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.foot-by a { font-weight: 700; color: var(--fg); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; color: var(--fg); }
.foot-info { display: flex; flex-wrap: wrap; gap: 0 14px; }
.foot-info span { white-space: nowrap; }
.foot-copy { color: #9a9a9a; }

/* ---------- hero and page headers */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px; }
.hero-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: 38px; font-weight: 800; line-height: 1.3; letter-spacing: -0.035em; }
.hero-img { flex: 0 1 260px; width: 260px; border-radius: 16px; }
.search { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.search input { flex: 1 1 240px; min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; font-size: 16px; color: var(--ink); }
.search input:focus { border-color: var(--accent); outline: none; }
.search button { height: 52px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.search button:hover { filter: brightness(0.92); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.hero-note { font-size: 14px; color: var(--muted); }
.search--sub { margin-top: 16px; }
.search-label { flex: 1 1 100%; font-size: 13px; font-weight: 600; color: var(--muted); }
.search--sub input { height: 48px; }
.search--sub button { height: 48px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.search--sub button:hover { filter: none; border-color: var(--accent); color: var(--accent); }

.panel { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.panel-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel-title { display: flex; align-items: center; gap: 12px; }
.panel-icon { flex: 0 0 auto; color: var(--ink); }
.panel h1 { font-size: 38px; font-weight: 800; line-height: 1.3; }
.panel-img { flex: 0 1 220px; width: 220px; border-radius: 16px; }

/* ---------- home */
.when { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.when-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px 20px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s; }
.when-card:hover { border-color: var(--accent); }
.when-card:hover .when-label { color: var(--accent); }
.when-label { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.when-title { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.when-lines { font-size: 14px; line-height: 1.6; color: var(--fg); }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 44px 48px; }
.topic { display: flex; flex-direction: column; }
.topic-head { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.topic-head:hover .topic-name { color: var(--accent); }
.topic-icon { flex: 0 0 auto; color: var(--ink); }
.topic-name { flex: 1; }
.q-row { display: flex; align-items: center; min-height: 46px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.q-row:hover { color: var(--accent); }
.topic .more { align-self: flex-start; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.topic .more::after { content: "→"; margin-left: 4px; }
.topic .more:hover { color: var(--accent); }

/* ---------- lists */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.list-row { display: flex; flex-direction: column; gap: 4px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.list-row:hover .list-title { color: var(--accent); }
.list-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.list-sum { font-size: 15px; color: var(--muted); }
.list-cat { font-size: 13px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink); transition: border-color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.search-status { color: var(--muted); }

/* ---------- banner */
.banner { display: block; }
.banner img { display: block; width: 100%; border-radius: 16px; }
.banner--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: 16px; border: 1px dashed #c9c9c9; border-radius: 16px; text-align: center; }
.banner--empty strong { font-size: 15px; color: var(--fg); }
.banner--empty span { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.banner--side { margin-top: 24px; }
.banner--side.banner--empty { min-height: 180px; }

/* ---------- article */
.article { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.article-head { display: flex; flex-direction: column; gap: 14px; }
.article h1 { font-size: 36px; font-weight: 800; line-height: 1.35; }
.meta { font-size: 13px; color: var(--muted); }
.answer { display: flex; flex-direction: column; gap: 8px; padding: 24px 26px; border-radius: 16px; background: var(--accent-soft); }
.answer h2 { font-size: 13px; font-weight: 700; color: var(--accent); }
.answer p { font-size: 18px; font-weight: 600; line-height: 1.65; letter-spacing: -0.02em; color: var(--ink); }
.cover img { display: block; width: 100%; border-radius: 16px; }
.cover:not(.cover--wide) img { aspect-ratio: 16 / 9; object-fit: cover; }

.prose { display: flex; flex-direction: column; gap: 14px; }
.article > *, .prose > * { min-width: 0; max-width: 100%; }
.prose h2 { margin-top: 30px; font-size: 23px; font-weight: 700; line-height: 1.4; }
.prose h2:first-child { margin-top: 0; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose li::marker { color: var(--muted); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: #b5b5b5; text-underline-offset: 4px; }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.prose a.btn, .prose a.btn:hover { color: var(--accent-ink); text-decoration: none; }
.prose figure { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.prose figure img { display: block; width: 100%; border-radius: 12px; }
.prose figcaption { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.checks { display: flex; flex-direction: column; gap: 12px; }
.cl-list, .prose ul.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.cl-list li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; padding: 11px 0 11px 28px; border-bottom: 1px solid var(--line); }
.cl-list li:last-child { border-bottom: 0; }
.cl-list li::before { content: ""; position: absolute; left: 0; top: 16px; width: 15px; height: 15px; border: 1.5px solid #c2c2c2; border-radius: 4px; }
.check-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; }
.check-hint { font-size: 12px; letter-spacing: 0; color: var(--muted); }

.copybox { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; border-radius: 16px; background: var(--soft); }
.copy-text { font-size: 16px; color: var(--ink) !important; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.copy-status { font-size: 13px; color: var(--muted); }
.consult { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 6px; padding: 22px 24px; border-radius: 16px; background: var(--accent-soft); }
.consult-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink) !important; }
.consult-text { font-size: 15px; }

.back { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; }
.back h2 { font-size: 13px; font-weight: 700; color: var(--muted); }
.back-list { display: flex; flex-direction: column; }
.back-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; font-weight: 700; color: var(--ink); }
.back-row::after { content: "→"; margin-left: auto; }
.back-row:hover { color: var(--accent); }
.back-when { flex: 0 0 auto; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }

.sources { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.sources h2 { font-size: 17px; font-weight: 700; }
.sources ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sources li::marker { color: var(--muted); }
.sources a { color: var(--ink); text-decoration: underline; text-decoration-color: #b5b5b5; text-underline-offset: 4px; }
.sources a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.src-note { color: var(--muted); }
.asof { font-size: 13px; color: var(--muted); }

.related { display: flex; flex-direction: column; gap: 8px; }
.rel { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.rel-row { display: flex; align-items: center; min-height: 52px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.rel-row:hover { color: var(--accent); }
.prevnext { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.pn { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s; }
.pn:hover { border-color: var(--accent); }
.pn:hover .pn-title { color: var(--accent); }
.pn--next { text-align: right; }
.pn-label { font-size: 12px; color: var(--muted); }
.pn-title { font-weight: 700; color: var(--ink); }

.aside { flex: 0 0 200px; position: sticky; top: 24px; padding-top: 34px; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc h2 { padding: 0 10px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.toc-row { display: flex; align-items: center; min-height: 40px; padding: 4px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.toc-row:hover { color: var(--accent); }
.toc-m { display: none; border: 1px solid var(--line); border-radius: 12px; }
.toc-m summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m[open] summary svg { transform: rotate(180deg); }
.toc-m-body { display: flex; flex-direction: column; padding: 0 6px 8px; }

/* ---------- checklist page */
.cl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.cl { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cl-group { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.cl-head { flex: 1 1 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cl-head h2 { font-size: 24px; font-weight: 800; }
.cl-head span { font-size: 13px; font-weight: 700; color: var(--muted); }
.cl-items { flex: 999 1 400px; min-width: 0; }
.cl-item:target { border-radius: 8px; background: var(--accent-soft); box-shadow: 0 0 0 8px var(--accent-soft); }
.copy-mini { min-height: 32px; margin-top: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.copy-mini:hover, .copy-mini.is-done { border-color: var(--accent); color: var(--accent); }
.check-link { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.check-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- mobile */
@media (max-width: 860px) {
  .layout { display: block; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; max-height: 100vh; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { min-height: 56px; padding: 0 8px 0 6px; }
  .menu-btn { display: flex; }
  .menu { display: none; gap: 8px; margin-top: 0; padding: 4px 8px 12px; border-top: 1px solid var(--line); }
  .side.is-open .menu { display: flex; }
  .nav-row { min-height: 44px; }
  .menu-label { padding-top: 8px; }

  .wrap { padding: 28px 20px 40px; gap: 48px; }
  .wrap--article { flex-direction: column; align-items: stretch; gap: 28px; }
  .hero { flex-direction: column; align-items: stretch; gap: 20px; }
  .hero-text { flex: 0 0 auto; gap: 12px; }
  .hero h1 { font-size: 30px; }
  .hero-img { order: -1; flex: 0 0 auto; width: 100%; }
  .lead { font-size: 17px; }
  .panel { flex-direction: column; align-items: stretch; gap: 18px; }
  .panel-text { flex: 0 0 auto; gap: 12px; }
  .panel h1 { font-size: 30px; }
  .panel-icon { width: 28px; height: 28px; }
  .panel-img { order: -1; flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
  .block h2, .block-head h2 { font-size: 20px; }
  .topics { gap: 36px; }
  .prose h2 { font-size: 21px; }

  .when { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 8px; }
  .when-card { flex: 0 0 140px; padding: 16px 14px; }
  .when-lines { font-size: 13px; }
  .list-title { font-size: 17px; }

  .article { gap: 28px; }
  .article h1 { font-size: 28px; }
  .answer { padding: 20px; }
  .answer p { font-size: 17px; }
  .toc-m { display: block; }
  .aside { position: static; flex: 0 0 auto; width: 100%; padding-top: 0; }
  .toc { display: none; }
  .banner--side { margin-top: 0; }
  .banner--empty, .banner--side.banner--empty { min-height: 100px; }
  table { font-size: 14px; min-width: 0; }
  th, td { padding: 12px 10px; word-break: keep-all; overflow-wrap: break-word; }
  th:first-child, td:first-child { padding-left: 14px; }
  .pn--next { text-align: left; }

  .cl-group { flex-direction: column; gap: 6px; padding: 22px 0; }
  .cl-head { flex: 0 0 auto; flex-direction: row; align-items: baseline; gap: 10px; }
  .cl-head h2 { font-size: 22px; }
  .cl-items { flex: 0 0 auto; }
  .copy-mini { min-height: 36px; margin: 0 0 0 auto; align-self: center; }
  .foot { gap: 6px; }
  .foot-info span { white-space: normal; }
  .foot-links a { min-height: 40px; }
}

@media print {
  .side, .banner, .cl-tools, .skip, .foot, .copy-mini, .copy-row, .check-link { display: none !important; }
  .layout { display: block; }
  .wrap { padding: 0; max-width: none; }
  .cl-group { break-inside: avoid; }
}
