:root {
  --wiki-green: #008275;
  --wiki-green-dark: #006d64;
  --wiki-accent-text: #006d64;
  --wiki-paper: #ffffff;
  --wiki-bg: #f5f5f5;
  --wiki-text: #212529;
  --wiki-muted: #62676b;
  --wiki-border: #d2d5d7;
  --wiki-link: #005fb8;
  --wiki-soft: #f7f7f8;
  --wiki-warn: #fff7d6;
  --wiki-warn-border: #e1b800;
  --wiki-warn-text: #725f12;
  --wiki-shadow: 0 1px 3px rgb(0 0 0 / 9%);
  --wiki-focus: #ffbf47;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
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: 15px;
  line-height: 1.7;
}
a { color: var(--wiki-link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--wiki-focus);
  outline-offset: 2px;
}
button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  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: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 28%));
}
.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);
  border-radius: 6px;
  box-shadow: var(--wiki-shadow);
}
.wiki-sidebar, .toc-panel { position: sticky; top: 72px; }
.wiki-sidebar {
  max-height: calc(100vh - 88px);
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #a7abad transparent;
  scrollbar-width: thin;
}
.wiki-sidebar::-webkit-scrollbar { width: 7px; }
.wiki-sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: #a7abad; }
.wiki-sidebar::-webkit-scrollbar-track { background: transparent; }
.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: 13px;
  font-weight: 700;
}
.side-links { padding: 6px 0; }
.side-links a { display: block; padding: 5px 11px; color: var(--wiki-text); font-size: 13px; }
.side-links a:hover, .side-links a.active { background: color-mix(in srgb, var(--wiki-green) 10%, transparent); text-decoration: none; color: var(--wiki-accent-text); }
.side-note { padding: 9px 11px; color: var(--wiki-muted); font-size: 12px; }
.side-tree-group > summary {
  padding: 9px 11px;
  background: var(--wiki-soft);
  border-bottom: 1px solid var(--wiki-border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.side-tree,
.side-tree ul { margin: 0; padding: 5px 0; list-style: none; }
.side-tree .side-tree { margin-left: 12px; padding-block: 0 3px; border-left: 1px solid var(--wiki-border); }
.side-tree li { margin: 0; }
.side-tree a { display: block; padding: 4px 11px; color: var(--wiki-text); font-size: 12px; line-height: 1.45; }
.side-tree .side-tree a { padding-left: 10px; }
.side-tree a:hover,
.side-tree a.active { color: var(--wiki-accent-text); background: color-mix(in srgb, var(--wiki-green) 10%, transparent); text-decoration: none; }

.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: 13px; }
.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: 12px; }
.wiki-related {
  display: grid;
  grid-template-columns: 86px 1fr;
  margin: 12px 0 16px;
  border: 1px solid var(--wiki-border);
  font-size: 13px;
}
.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); }
.wiki-hierarchy {
  margin: 11px 0 14px;
  border: 1px solid var(--wiki-border);
  font-size: 12px;
}
.wiki-hierarchy__row { display: grid; grid-template-columns: 82px minmax(0, 1fr); }
.wiki-hierarchy__row + .wiki-hierarchy__row { border-top: 1px solid var(--wiki-border); }
.wiki-hierarchy__row > strong { padding: 7px 9px; color: #fff; background: #6a6a6a; text-align: center; }
.wiki-hierarchy__row > span,
.wiki-hierarchy__row > details { min-width: 0; padding: 7px 10px; background: var(--wiki-soft); }
.wiki-hierarchy__row details > summary { cursor: pointer; color: var(--wiki-link); font-weight: 700; }
.wiki-hierarchy__links { margin-top: 7px; line-height: 1.8; }

.document-directory { margin: 12px 0 22px; }
.document-directory__intro { margin: 0 0 10px; color: var(--wiki-muted); font-size: 12px; }
.directory-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.directory-group { min-width: 0; border: 1px solid #aaa; background: var(--wiki-paper); }
.directory-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  color: var(--wiki-text);
  background: #f1f1f1;
  cursor: pointer;
}
.directory-group > summary strong { font-size: 14px; }
.directory-group > summary span { color: var(--wiki-muted); font-size: 11px; font-weight: 400; white-space: nowrap; }
.directory-group[open] > summary { border-bottom: 1px solid #aaa; }
.directory-group > p { margin: 9px 11px 4px; color: var(--wiki-muted); font-size: 11px; }
.directory-tree { margin: 0; padding: 6px 11px 10px 27px; }
.directory-tree .directory-tree { margin: 3px 0 3px 5px; padding: 1px 0 1px 17px; border-left: 1px solid #ccc; }
.directory-tree li { margin: 3px 0; }
.directory-tree a { overflow-wrap: anywhere; }
.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: var(--wiki-warn-text); font-size: 12px; }
.official-synopsis-box { margin: 14px 0 18px; overflow: hidden; border: 1px solid var(--wiki-border); background: var(--wiki-paper); box-shadow: var(--wiki-shadow); }
.official-synopsis-box__header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 13px; color: #fff; background: var(--wiki-green-dark); }
.official-synopsis-box__header strong { font-size: 14px; }
.official-synopsis-box__header a { color: #fff; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.official-synopsis-box__body { padding: 12px 15px 5px; }
.official-synopsis-box__body .wiki-quote { margin: 0; padding: 0; border: 0; background: transparent; }
.official-synopsis-box__body .wiki-quote p { white-space: pre-line; }
.official-synopsis-box__body p { margin: 0 0 .68em; }
.official-synopsis-box__note { margin: 0; padding: 8px 15px 10px; border-top: 1px solid var(--wiki-border); color: var(--wiki-muted); background: var(--wiki-soft); font-size: 11px; }
.lead { margin: 16px 0; font-size: 16px; line-height: 1.82; }
.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: 13px; }
.wiki-note { margin: 11px 0; padding: 9px 12px; border-left: 4px solid #777; background: var(--wiki-soft); color: var(--wiki-muted); font-size: 13px; }
.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 {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  overscroll-behavior-inline: contain;
  scrollbar-color: #9ba1a6 transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar { height: 7px; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: #9ba1a6; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.mobile-cell-value { display: contents; }
.wiki-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.62; }
.wiki-table th, .wiki-table td { padding: 8px 10px; border: 1px solid #b8b8b8; vertical-align: top; }
.wiki-table td { background: var(--wiki-paper); }
.wiki-table th { color: var(--wiki-text); text-align: center; background: #eceeef; }
.wiki-table thead th { color: #fff; background: #55595c; }
.wiki-table thead th a,
.infobox .infobox-title a {
  color: inherit;
  font-weight: 700;
  text-decoration-color: rgb(255 255 255 / 70%);
  text-underline-offset: 2px;
}
.wiki-table thead th a:hover,
.wiki-table thead th a:focus-visible,
.infobox .infobox-title a:hover,
.infobox .infobox-title a:focus-visible { color: inherit; text-decoration: underline; }
.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: 13px; 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: 13px; }
.metric-card strong { display: block; color: var(--wiki-accent-text); 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: 13px; }
.toc-list { padding: 7px 0; }
.toc-list a { display: block; padding: 3px 10px; color: var(--wiki-text); font-size: 12px; }
.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-accent-text); background: color-mix(in srgb, var(--wiki-green) 8%, transparent); text-decoration: none; }
.toc-number { display: inline-block; min-width: 30px; color: var(--wiki-accent-text); }
.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; }
.goal-dashboard td:first-child { min-width: 170px; }
.goal-dashboard td:last-child { min-width: 240px; }
.goal-state { display: inline-flex; padding: 2px 7px; border: 1px solid var(--wiki-border); border-radius: 999px; color: var(--wiki-accent-text); background: color-mix(in srgb, var(--wiki-green) 8%, var(--wiki-paper)); font-size: 10px; font-weight: 700; }
.actionable-list { margin: 8px 0 18px; padding-left: 1.8em; }
.actionable-list li { padding: 3px 0; }
.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-paper); color: var(--wiki-muted); }
.check-item[data-ready="true"] .status-badge { border-color: var(--wiki-green); color: var(--wiki-accent-text); background: color-mix(in srgb, var(--wiki-green) 10%, var(--wiki-paper)); }
.check-item[data-blocked="true"] .status-badge { border-color: #b8a26f; color: #7c662e; background: rgba(184,162,111,.12); }
.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; }

/* 모든 공개 문서에 적용하는 나무위키형 화면: 조밀한 헤더, 단일 본문, 우측 목차, 문서 도구 탭. */
body.namu-preview {
  --wiki-paper: #fff;
  --wiki-bg: #f1f1f1;
  font-size: 14px;
  line-height: 1.68;
}
.namu-preview .topbar {
  height: 50px;
  border-bottom: 1px solid #008b82;
  background: #00a495;
  box-shadow: 0 1px 3px rgb(0 0 0 / 24%);
}
.namu-preview .topbar-inner { max-width: 1280px; padding-inline: 12px; }
.namu-preview .wiki-brand { gap: 7px; font-size: 17px; }
.namu-preview .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
.namu-preview .top-links a { padding-inline: 11px; font-size: 13px; }
.namu-preview .search-shell { width: min(350px, 34vw); }
.namu-preview .search-shell input {
  height: 32px;
  border: 1px solid rgb(0 0 0 / 18%);
  border-radius: 2px;
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
}
.namu-preview .wiki-grid {
  max-width: 1280px;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  padding: 16px 12px 64px;
}
.namu-preview .wiki-sidebar { display: none; }
.namu-preview .wiki-article {
  grid-column: 1;
  padding: 21px 27px 36px;
  border-color: #ccc;
  border-radius: 0;
  box-shadow: none;
}
.namu-preview .toc-panel {
  grid-column: 2;
  grid-row: 1;
  top: 66px;
  max-height: calc(100vh - 82px);
  max-height: calc(100dvh - 82px);
  border-color: #ccc;
  border-radius: 0;
  box-shadow: none;
}
.namu-preview .toc-title {
  padding: 8px 10px;
  color: #555;
  background: #f5f5f5;
  font-size: 12px;
}
.namu-preview .toc-list a { padding-block: 2px; font-size: 11px; }
.namu-preview .document-head {
  position: relative;
  padding-bottom: 11px;
  margin-bottom: 15px;
  border-bottom-color: #aaa;
}
.namu-preview .document-head-top {
  min-height: 31px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}
.namu-preview .breadcrumb { margin: 4px 0 0; font-size: 12px; }
.namu-preview .document-title {
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 2.05rem;
  font-weight: 500;
}
.namu-page-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #bbb;
  border-radius: 2px;
  background: #fff;
  font-size: 11px;
  line-height: 1;
}
.namu-page-actions > a,
.namu-page-actions > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-left: 1px solid #ccc;
  color: #555;
}
.namu-page-actions > :first-child { border-left: 0; }
.namu-page-actions > a:hover { background: #f2f2f2; text-decoration: none; }
.namu-page-actions > .active { color: #fff; background: #555; font-weight: 700; }
.namu-page-actions > .disabled { color: #aaa; background: #fafafa; cursor: default; }
.namu-preview .wiki-related {
  grid-template-columns: 78px 1fr;
  margin-block: 11px 16px;
  border-color: #aaa;
}
.namu-preview .wiki-related strong { background: #5b5b5b; }
.namu-preview .wiki-related span { background: #f5f5f5; }
.namu-preview .wiki-heading {
  margin-top: 1.7em;
  border-bottom-color: #aaa;
  letter-spacing: -.035em;
}
.namu-preview h2.wiki-heading { border-bottom-width: 1px; font-size: 1.72rem; }
.namu-preview h3.wiki-heading { font-size: 1.38rem; }
.namu-preview .wiki-table { font-size: 12px; line-height: 1.6; }
.namu-preview .wiki-table th,
.namu-preview .wiki-table td { padding: 6px 8px; border-color: #aaa; }
.namu-preview .wiki-table th { background: #e9e9e9; }
.namu-preview .wiki-table thead th,
.namu-preview .infobox .infobox-title { background: #00a495; }
.namu-preview .infobox { width: min(490px, 100%); font-size: 12px; }
.namu-preview .infobox th,
.namu-preview .infobox td { padding: 6px 8px; border-color: #aaa; }
.namu-preview .wiki-fold { border-color: #aaa; }
.namu-preview .wiki-fold > summary { padding: 6px 9px; background: #f4f4f4; font-size: 12px; }
.namu-preview .spoiler-box { padding: 9px 12px; border-width: 1px; font-size: 12px; }
.namu-preview .spoiler-symbol { flex-basis: 28px; width: 28px; height: 28px; font-size: 17px; }
.namu-preview .categories { border-color: #aaa; background: #f5f5f5; }
.namu-preview .categories .tag {
  border: 0;
  color: #0275d8;
  background: transparent;
  font-size: 11px;
}
:root[data-theme="dark"] body.namu-preview {
  --wiki-paper: #27292d;
  --wiki-bg: #1d1f21;
  --wiki-text: #e2e4e7;
  --wiki-muted: #b5b9bf;
  --wiki-border: #50545a;
  --wiki-link: #5bc0de;
  --wiki-soft: #34373c;
}
:root[data-theme="dark"] .namu-page-actions { border-color: #555; background: #2d2f34; }
:root[data-theme="dark"] .namu-page-actions > a,
:root[data-theme="dark"] .namu-page-actions > span { border-color: #555; color: #ddd; }
:root[data-theme="dark"] .namu-page-actions > .active { color: #fff; background: #00a495; }
:root[data-theme="dark"] .namu-page-actions > .disabled { color: #777; background: #24262a; }
:root[data-theme="dark"] .namu-preview .wiki-related strong { background: #454545; }
:root[data-theme="dark"] .namu-preview .wiki-related span,
:root[data-theme="dark"] .namu-preview .toc-title,
:root[data-theme="dark"] .namu-preview .wiki-fold > summary,
:root[data-theme="dark"] .namu-preview .categories { background: #34373c; }
:root[data-theme="dark"] .directory-group,
:root[data-theme="dark"] .directory-group > summary { border-color: #60646a; background: #34373c; }
:root[data-theme="dark"] .directory-tree .directory-tree { border-color: #60646a; }
:root[data-theme="dark"] .wiki-hierarchy__row > strong { background: #454545; }
@media (max-width: 640px) {
  .namu-preview .document-head-top { display: block; }
  .namu-page-actions { width: max-content; max-width: 100%; margin-top: 8px; }
  .namu-page-actions > a,
  .namu-page-actions > span { min-height: 27px; padding-inline: 8px; }
  .directory-groups { grid-template-columns: minmax(0, 1fr); }
  .wiki-hierarchy__row { grid-template-columns: minmax(0, 1fr); }
  .wiki-hierarchy__row > strong { text-align: left; }
}
:root[data-theme="dark"] {
  --wiki-paper: #282a2e;
  --wiki-bg: #1d1f21;
  --wiki-text: #e2e4e7;
  --wiki-muted: #b5b9bf;
  --wiki-border: #50545a;
  --wiki-link: #ec9f19;
  --wiki-accent-text: #6ed9ce;
  --wiki-soft: #34373c;
  --wiki-warn: #3c361d;
  --wiki-warn-border: #b79b19;
  --wiki-warn-text: #f4e6a8;
  --wiki-focus: #ffd166;
}
:root[data-theme="dark"] .topbar { background: #2e3033; }
:root[data-theme="dark"] .wiki-table th,
:root[data-theme="dark"] .infobox th { background: #3b3d42; }
:root[data-theme="dark"] .wiki-table td { background: var(--wiki-paper); }
: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; }
  .namu-preview .wiki-grid { grid-template-columns: minmax(0, 1fr); }
  .namu-preview .toc-panel { display: none; }
}
/* 세력 갈래 링크 스트립. 예전에는 본문 없는 표로 렌더돼 빈 tbody가 남았다. */
.wiki-link-strip { margin: 10px 0 14px; }
.wiki-link-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wiki-link-strip-item { margin: 0; }
.wiki-link-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--wiki-border);
  border-radius: 3px;
  color: var(--wiki-accent-text);
  background: var(--wiki-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.wiki-link-strip a:hover,
.wiki-link-strip a:focus-visible {
  background: color-mix(in srgb, var(--wiki-green) 10%, var(--wiki-paper));
  text-decoration: 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: 62px; 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; }
  .namu-preview .wiki-grid { display: block; padding: 10px 8px 55px; }
  .namu-preview .wiki-article { padding: 19px 18px 32px; }
  .ui-preview-banner { align-items: flex-start; flex-direction: column; }
  .ui-preview-banner__actions { margin-left: 0; }
}
@media (max-width: 520px) {
  .topbar-inner { padding: 0 7px; }
  .wiki-grid { padding: 7px 0 50px; }
  .wiki-article { border-left: 0; border-right: 0; border-radius: 0; padding: 16px 13px 28px; }
  .document-title { font-size: 1.72rem; }
  .draft-badge { display: none; }
  .completion-callout { grid-template-columns: 1fr; }
  .official-synopsis-box__header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .table-scroll { overflow-x: visible; }
  .wiki-table { min-width: 0; }
  .wiki-table th, .wiki-table td {
    padding-right: 7px;
    padding-left: 7px;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }
  .wiki-table.mobile-key-value-table { table-layout: fixed; }
  .wiki-table.mobile-key-value-table tbody > tr > :first-child { width: 34%; }

  .wiki-table.mobile-card-table {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
  }
  .wiki-table.mobile-card-table thead {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .wiki-table.mobile-card-table tbody {
    display: grid;
    width: 100%;
    gap: 9px;
  }
  .wiki-table.mobile-card-table tbody > tr {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--wiki-border);
    border-radius: 4px;
    background: var(--wiki-paper);
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
  }
  .wiki-table.mobile-narrative-table tbody > tr { grid-template-columns: minmax(0, 1fr); }
  .wiki-table.mobile-record-table tbody > tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-table.mobile-card-table tbody > tr > :is(th, td) {
    display: block;
    width: auto;
    min-width: 0;
    padding: 7px 9px 8px;
    border: 0;
    border-top: 1px solid var(--wiki-border);
    color: var(--wiki-text);
    background: var(--wiki-paper);
    text-align: left;
  }
  .wiki-table.mobile-card-table tbody > tr > :is(th, td)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--wiki-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
  }
  .wiki-table.mobile-card-table .mobile-cell-value {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .wiki-table.mobile-card-table tbody > tr > .mobile-row-title {
    grid-column: 1 / -1;
    border-top: 0;
    border-left: 4px solid var(--wiki-green);
    background: color-mix(in srgb, var(--wiki-green) 8%, var(--wiki-paper));
  }
  .wiki-table.mobile-card-table .mobile-row-title::before { color: var(--wiki-accent-text); }
  .wiki-table.mobile-card-table .mobile-row-title .mobile-cell-value {
    font-size: 13px;
    font-weight: 700;
  }
  .wiki-table.mobile-record-table tbody > tr > .mobile-cell-wide { grid-column: 1 / -1; }
  .wiki-table.mobile-roster-table tbody > tr > :nth-child(2) { grid-column: 1 / -1; }
  .wiki-table.compact.mobile-card-table tbody { gap: 7px; }
  .wiki-table.compact.mobile-card-table tbody > tr > :is(th, td) { padding: 6px 8px 7px; }

  .wiki-table.mobile-link-grid-table {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
  }
  .wiki-table.mobile-link-grid-table > :is(thead, tbody) { display: block; }
  .wiki-table.mobile-link-grid-table > :is(thead, tbody) > tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .wiki-table.mobile-link-grid-table > :is(thead, tbody) > tr > :is(th, td) {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--wiki-text);
    background: var(--wiki-soft);
  }
  .wiki-table.mobile-link-grid-table > :is(thead, tbody) > tr > :is(th, td):last-child:nth-child(odd) { grid-column: 1 / -1; }
  .wiki-table.mobile-link-grid-table a {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    border: 1px solid var(--wiki-border);
    border-radius: 3px;
    color: var(--wiki-accent-text);
    background: var(--wiki-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }
  .wiki-table.mobile-link-grid-table a:hover,
  .wiki-table.mobile-link-grid-table a:focus-visible {
    color: var(--wiki-accent-text);
    background: color-mix(in srgb, var(--wiki-green) 10%, var(--wiki-paper));
    text-decoration: none;
  }
  .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; }
}
