:root {
  --wiki-green: #00a495;
  --wiki-green-dark: #007f73;
  --wiki-paper: #ffffff;
  --wiki-bg: #efefef;
  --wiki-text: #373a3c;
  --wiki-muted: #72777b;
  --wiki-border: #d3d6d8;
  --wiki-link: #0275d8;
  --wiki-soft: #f7f7f7;
  --wiki-warn: #fff7d6;
  --wiki-warn-border: #e1b800;
  --wiki-shadow: 0 1px 3px rgb(0 0 0 / 9%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--wiki-bg);
  color: var(--wiki-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.68;
}
a { color: var(--wiki-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  color: #fff;
  background: var(--wiki-green);
  box-shadow: 0 1px 4px rgb(0 0 0 / 24%);
}
.topbar-inner {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wiki-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}
.wiki-brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
  width: 25px;
  height: 25px;
  border: 3px solid #fff;
  border-radius: 50% 50% 42% 42%;
  position: relative;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: #fff;
}
.brand-mark::before { width: 3px; height: 24px; left: 8px; top: -3px; transform: rotate(28deg); }
.brand-mark::after { width: 15px; height: 3px; left: 2px; top: 9px; transform: rotate(-20deg); }
.top-links { display: flex; align-self: stretch; }
.top-links a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  border-left: 1px solid rgb(255 255 255 / 17%);
}
.top-links a:hover, .top-links a.active { background: rgb(0 0 0 / 15%); text-decoration: none; }
.search-shell { position: relative; margin-left: auto; width: min(360px, 34vw); }
.search-shell input {
  width: 100%;
  height: 34px;
  padding: 0 40px 0 11px;
  border: 0;
  border-radius: 3px;
  color: #222;
  background: #fff;
}
.search-shell .search-icon { position: absolute; right: 11px; top: 6px; color: #777; pointer-events: none; }
.search-results {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--wiki-border);
  background: var(--wiki-paper);
  box-shadow: 0 5px 18px rgb(0 0 0 / 24%);
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 8px 11px; border-bottom: 1px solid var(--wiki-border); color: var(--wiki-text); }
.search-results a:hover, .search-results a.selected { background: var(--wiki-soft); text-decoration: none; }
.search-results strong { display: block; font-size: 13px; }
.search-results small { display: block; color: var(--wiki-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-button, .mobile-menu {
  width: 36px;
  height: 34px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 3px;
  color: #fff;
  background: rgb(0 0 0 / 8%);
  cursor: pointer;
}
.mobile-menu { display: none; }

.wiki-grid {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 16px 64px;
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr) 245px;
  gap: 16px;
  align-items: start;
}
.wiki-sidebar, .wiki-article, .toc-panel {
  background: var(--wiki-paper);
  border: 1px solid var(--wiki-border);
  box-shadow: var(--wiki-shadow);
}
.wiki-sidebar, .toc-panel { position: sticky; top: 70px; }
.side-section + .side-section { border-top: 1px solid var(--wiki-border); }
.side-title {
  margin: 0;
  padding: 9px 11px;
  background: var(--wiki-soft);
  border-bottom: 1px solid var(--wiki-border);
  font-size: 12px;
  font-weight: 700;
}
.side-links { padding: 6px 0; }
.side-links a { display: block; padding: 5px 11px; color: var(--wiki-text); font-size: 12px; }
.side-links a:hover, .side-links a.active { background: color-mix(in srgb, var(--wiki-green) 10%, transparent); text-decoration: none; color: var(--wiki-green-dark); }
.side-note { padding: 9px 11px; color: var(--wiki-muted); font-size: 11px; }

.wiki-article { min-width: 0; padding: 24px 30px 38px; }
.document-head { border-bottom: 1px solid #b9b9b9; padding-bottom: 13px; margin-bottom: 14px; }
.breadcrumb { margin-bottom: 8px; color: var(--wiki-muted); font-size: 12px; }
.document-title-row { display: flex; align-items: flex-start; gap: 10px; }
.document-title { margin: 0; font-size: clamp(1.9rem, 4vw, 2.35rem); line-height: 1.25; letter-spacing: -0.045em; font-weight: 600; }
.draft-badge { margin-top: 5px; padding: 2px 7px; border: 1px solid #d38b00; color: #9b6500; background: #fff6d9; border-radius: 2px; font-size: 11px; white-space: nowrap; }
.document-meta { margin-top: 8px; color: var(--wiki-muted); font-size: 11px; }
.wiki-related {
  display: grid;
  grid-template-columns: 86px 1fr;
  margin: 12px 0 16px;
  border: 1px solid var(--wiki-border);
  font-size: 12px;
}
.wiki-related strong { padding: 7px 9px; color: #fff; background: var(--wiki-green-dark); text-align: center; }
.wiki-related span { padding: 7px 10px; background: var(--wiki-soft); }
.document-tabs { display: flex; flex-wrap: wrap; margin: 0 0 15px; border-bottom: 1px solid var(--wiki-green); }
.document-tabs a { padding: 6px 12px; border: 1px solid var(--wiki-border); border-bottom: 0; color: var(--wiki-text); background: var(--wiki-soft); font-size: 12px; }
.document-tabs a.active { border-color: var(--wiki-green); color: #fff; background: var(--wiki-green); }
.document-tabs a:hover { text-decoration: none; }

.spoiler-box { display: flex; gap: 13px; align-items: center; margin: 15px 0; padding: 12px 15px; border: 2px solid var(--wiki-warn-border); background: var(--wiki-warn); }
.spoiler-symbol { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--wiki-warn-border); font-size: 21px; font-weight: 800; }
.spoiler-box strong, .spoiler-box span { display: block; }
.spoiler-box span { color: #725f12; font-size: 12px; }
.lead { margin: 16px 0; font-size: 15px; line-height: 1.8; }
.wiki-heading { position: relative; scroll-margin-top: 67px; margin: 1.85em 0 .7em; padding-bottom: 6px; border-bottom: 1px solid #aaa; line-height: 1.35; letter-spacing: -.025em; }
h2.wiki-heading { border-bottom-width: 2px; font-size: 1.75rem; }
h3.wiki-heading { font-size: 1.42rem; }
h4.wiki-heading { font-size: 1.18rem; }
.heading-number { margin-right: .32em; color: inherit; }
.heading-anchor { float: right; color: #aaa; font-size: 11px; padding: 8px 3px; }
p { margin: .72em 0; }
.muted { color: var(--wiki-muted); }
.small { font-size: 12px; }
.wiki-note { margin: 11px 0; padding: 9px 12px; border-left: 4px solid #777; background: var(--wiki-soft); color: var(--wiki-muted); font-size: 12px; }
.wiki-note.info { border-left-color: var(--wiki-green); }
.wiki-note.danger { border-left-color: #c83838; background: #fff1f1; color: #743030; }
.completion-callout { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--wiki-green); background: color-mix(in srgb, var(--wiki-green) 6%, var(--wiki-paper)); }
.completion-callout strong { display: block; font-size: 15px; }
.wiki-button { display: inline-block; padding: 7px 11px; border: 1px solid var(--wiki-green-dark); border-radius: 2px; color: #fff; background: var(--wiki-green); cursor: pointer; font-size: 12px; }
.wiki-button:hover { color: #fff; background: var(--wiki-green-dark); text-decoration: none; }
.wiki-button.secondary { color: var(--wiki-text); background: var(--wiki-soft); border-color: var(--wiki-border); }
.wiki-button.secondary:hover { color: var(--wiki-text); background: #e9e9e9; }
.fold-toolbar { display: flex; justify-content: flex-end; gap: 6px; margin: 8px 0; }

.table-scroll { overflow-x: auto; margin: 12px 0; }
.wiki-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wiki-table th, .wiki-table td { padding: 7px 9px; border: 1px solid #b8b8b8; vertical-align: top; }
.wiki-table th { text-align: center; background: #ececec; }
.wiki-table thead th { color: #fff; background: #5b5b5b; }
.wiki-table.compact th, .wiki-table.compact td { padding: 5px 7px; }
.infobox { width: min(520px, 100%); margin: 10px auto 18px; border-collapse: collapse; font-size: 13px; }
.infobox th, .infobox td { border: 1px solid #aaa; padding: 7px 10px; }
.infobox th { width: 28%; background: #e9e9e9; text-align: center; }
.infobox .infobox-title { color: #fff; background: var(--wiki-green-dark); font-size: 17px; }
.wiki-list { margin: .6em 0; padding-left: 1.8em; }
.wiki-list li { margin: .28em 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.tag { display: inline-block; padding: 2px 6px; border: 1px solid var(--wiki-border); border-radius: 2px; color: var(--wiki-muted); background: var(--wiki-soft); font-size: 11px; }
.status-tag { display: inline-block; padding: 1px 6px; border-radius: 10px; background: #e7eef5; color: #40576d; font-size: 10px; }
.status-tag.open { background: #fff0d8; color: #875400; }
.status-tag.done { background: #dff5e8; color: #17633a; }

.wiki-fold { margin: 10px 0; border: 1px solid var(--wiki-border); background: var(--wiki-paper); }
.wiki-fold > summary { display: flex; align-items: center; gap: 7px; padding: 7px 10px; list-style: none; cursor: pointer; background: var(--wiki-soft); font-size: 12px; font-weight: 700; }
.wiki-fold > summary::-webkit-details-marker { display: none; }
.wiki-fold > summary::before { content: "▶"; font-size: 9px; transition: transform .12s ease; }
.wiki-fold[open] > summary::before { transform: rotate(90deg); }
.fold-count { margin-left: auto; color: var(--wiki-muted); font-weight: 400; }
.fold-body { padding: 10px 13px; border-top: 1px solid var(--wiki-border); }
.beat-list { margin: 0; padding-left: 1.8em; }
.beat-list li { padding: 4px 0; }
.beat-list li:target, :target.highlight-target { animation: targetFlash 2s ease; }
@keyframes targetFlash { 0%, 45% { background: #fff0a6; } 100% { background: transparent; } }
.arc-card { margin: 13px 0 22px; padding: 0 0 3px; border-top: 3px solid var(--wiki-green); }
.arc-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 6px 0 10px; color: var(--wiki-muted); font-size: 11px; }
.arc-summary { font-size: 14px; }
.part-cards, .entity-cards, .metric-grid { display: grid; gap: 10px; }
.part-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.entity-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 12px 0; }
.part-card, .entity-card, .metric-card { padding: 11px 13px; border: 1px solid var(--wiki-border); background: var(--wiki-soft); }
.part-card h3, .entity-card h3 { margin: 0 0 5px; font-size: 14px; }
.part-card p, .entity-card p { margin: 4px 0; font-size: 12px; }
.metric-card strong { display: block; color: var(--wiki-green-dark); font-size: 1.55rem; line-height: 1.25; }
.metric-card span { color: var(--wiki-muted); font-size: 11px; }
.alpha-filter, .content-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.filter-input, .filter-select { min-height: 34px; padding: 6px 9px; border: 1px solid var(--wiki-border); border-radius: 2px; color: var(--wiki-text); background: var(--wiki-paper); }
.filter-input { min-width: min(330px, 100%); flex: 1; }

.toc-panel { max-height: calc(100vh - 88px); overflow: auto; padding-bottom: 8px; }
.toc-title { margin: 0; padding: 9px 11px; border-bottom: 1px solid var(--wiki-border); background: var(--wiki-soft); font-size: 12px; }
.toc-list { padding: 7px 0; }
.toc-list a { display: block; padding: 3px 10px; color: var(--wiki-text); font-size: 11px; }
.toc-list a[data-level="3"] { padding-left: 22px; }
.toc-list a[data-level="4"] { padding-left: 36px; }
.toc-list a:hover, .toc-list a.active { color: var(--wiki-green-dark); background: color-mix(in srgb, var(--wiki-green) 8%, transparent); text-decoration: none; }
.toc-number { display: inline-block; min-width: 30px; color: var(--wiki-green-dark); }
.page-footer { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--wiki-border); color: var(--wiki-muted); font-size: 11px; }
.categories { margin-top: 14px; padding: 8px 10px; border: 1px solid var(--wiki-border); background: var(--wiki-soft); font-size: 11px; }
.footnote-ref { padding-left: 2px; font-size: .78em; vertical-align: super; }
.footnotes { margin-top: 26px; color: var(--wiki-muted); font-size: 11px; }
.footnotes hr { border: 0; border-top: 1px solid var(--wiki-border); }
.footnotes ol { margin: 8px 0; padding-left: 24px; }
.footnote-back { margin-left: 4px; }
.backtop { position: fixed; right: 18px; bottom: 18px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--wiki-border); border-radius: 3px; color: var(--wiki-text); background: var(--wiki-paper); box-shadow: var(--wiki-shadow); }
.backtop:hover { text-decoration: none; }

.checklist-toolbar { position: sticky; top: 60px; z-index: 30; margin: 12px 0; padding: 10px; border: 1px solid var(--wiki-border); background: var(--wiki-paper); box-shadow: var(--wiki-shadow); }
.checklist-toolbar-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.progress-shell { height: 12px; margin: 9px 0 5px; overflow: hidden; border-radius: 8px; background: #dedede; }
.progress-bar { height: 100%; width: 0; background: var(--wiki-green); transition: width .2s ease; }
.progress-text { display: flex; justify-content: space-between; gap: 10px; color: var(--wiki-muted); font-size: 11px; }
.checklist-group { margin: 12px 0; border: 1px solid var(--wiki-border); }
.checklist-group > summary { cursor: pointer; padding: 9px 11px; background: var(--wiki-soft); font-weight: 700; }
.checklist-items { padding: 5px 10px; }
.check-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 7px; padding: 7px 2px; border-bottom: 1px dotted var(--wiki-border); }
.check-item:last-child { border-bottom: 0; }
.status-badge { align-self: start; display: inline-flex; justify-content: center; border: 1px solid var(--wiki-border); border-radius: 999px; padding: 2px 7px; font-size: 10px; background: var(--wiki-panel); color: var(--wiki-muted); }
.status-in_progress { border-color: #d79c28; color: #9a6500; background: rgba(215,156,40,.12); }
.status-awaiting_review { border-color: #6f73d8; color: #5055aa; background: rgba(111,115,216,.12); }
.status-blocked_by_evidence { border-color: #c85d5d; color: #a03d3d; background: rgba(200,93,93,.12); }
.status-complete, .status-not_applicable_approved { border-color: #4c9b68; color: #337248; background: rgba(76,155,104,.12); }
.check-item .task-title { display: block; font-size: 12px; }
.check-item .task-detail { display: block; color: var(--wiki-muted); font-size: 10px; }
.check-item .task-link { white-space: nowrap; font-size: 10px; }
.check-item.complete .task-title { color: var(--wiki-muted); text-decoration: line-through; }
.check-item.hidden, .checklist-group.hidden { display: none; }
.checklist-finish { display: none; margin: 15px 0; padding: 16px; border: 2px solid var(--wiki-green); background: #e8fff5; text-align: center; font-weight: 700; }
.checklist-finish.show { display: block; }
.admin-topbar { background: #5a5963; }
.admin-grid { grid-template-columns: 225px minmax(0, 1fr) 245px; }

:root[data-theme="dark"] {
  --wiki-paper: #2b2d31;
  --wiki-bg: #1f2023;
  --wiki-text: #d8dadd;
  --wiki-muted: #a6a9ad;
  --wiki-border: #4c4f54;
  --wiki-link: #69b8eb;
  --wiki-soft: #35373c;
  --wiki-warn: #3c361d;
  --wiki-warn-border: #b79b19;
}
:root[data-theme="dark"] .wiki-table th,
:root[data-theme="dark"] .infobox th { background: #3b3d42; }
:root[data-theme="dark"] .wiki-table thead th,
:root[data-theme="dark"] .infobox .infobox-title { background: #176c64; }
:root[data-theme="dark"] .search-shell input { color: #eee; background: #33363a; }
:root[data-theme="dark"] .wiki-note.danger { color: #f4c3c3; background: #4a2929; }
:root[data-theme="dark"] .checklist-finish { color: #b9f1d6; background: #183d2d; }

@media (max-width: 1180px) {
  .wiki-grid { grid-template-columns: 205px minmax(0, 1fr); }
  .toc-panel { display: none; }
}
@media (max-width: 820px) {
  .mobile-menu { display: block; }
  .top-links { display: none; }
  .wiki-grid { display: block; padding: 10px 8px 55px; }
  .wiki-sidebar { display: none; position: fixed; z-index: 90; top: 58px; left: 8px; bottom: 8px; width: min(300px, calc(100vw - 16px)); overflow: auto; }
  body.sidebar-open .wiki-sidebar { display: block; }
  .wiki-article { padding: 19px 18px 32px; }
  .search-shell { width: auto; flex: 1; }
  .wiki-brand { margin-right: 0; }
  .wiki-brand span { display: none; }
}
@media (max-width: 520px) {
  .topbar-inner { padding: 0 7px; }
  .wiki-grid { padding: 7px 0 50px; }
  .wiki-article { border-left: 0; border-right: 0; padding: 16px 13px 28px; }
  .document-title { font-size: 1.72rem; }
  .draft-badge { display: none; }
  .completion-callout { grid-template-columns: 1fr; }
  .wiki-table { min-width: 510px; }
  .infobox { min-width: 0; }
  .wiki-related { grid-template-columns: 1fr; }
  .wiki-related strong { text-align: left; }
  .check-item { grid-template-columns: 88px 1fr; }
  .check-item .task-link { grid-column: 2; }
}
@media print {
  .topbar, .wiki-sidebar, .toc-panel, .document-tabs, .backtop, .checklist-toolbar { display: none !important; }
  .wiki-grid { display: block; padding: 0; }
  .wiki-article { border: 0; box-shadow: none; padding: 0; }
  details > * { display: block !important; }
}
