/* Common shell and tokens from the live cs-eval design.css + tuning.css,
   checked 2026-10-08. Loaded only by the knowledge page; no remote assets. */
@font-face { font-family: 'Pretendard Variable'; src: url('assets/PretendardVariable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --bg: #f7f8fa;
  --surface: #fff;
  --surface-2: #f0f2f5;
  --text: #1b1d24;
  --muted: #656b78;
  --faint: #7a808c;
  --line: #e5e7eb;
  --strong-line: #cbd0d8;
  --red: #f51c49;
  --red-text: #d81940;
  --red-soft: #fff0f3;
  --pink: var(--red-soft);
  --green: #147d60;
  --green-soft: #e6f6ef;
  --blue: #1764b0;
  --ice: #f5f9ff;
  --amber: #8a5b00;
  --amber-soft: #fff8e6;
  --header: rgba(255, 255, 255, .88);
  --header-height: 82px;
  --radius: 22px;
  --graph-bg: var(--surface);
  --shadow: 0 16px 50px -24px #19213226;
}
:root[data-theme=dark] {
  --bg: #0d0e12;
  --surface: #17191f;
  --surface-2: #20232b;
  --text: #f2f3f5;
  --muted: #a4a9b5;
  --faint: #969ca9;
  --line: #2b2e37;
  --strong-line: #454a58;
  --red: #ff385e;
  --red-text: #ff7c96;
  --red-soft: #33202a;
  --green: #72d3b2;
  --green-soft: #15372d;
  --blue: #8fc4ff;
  --ice: #1a2432;
  --amber: #f2cd7c;
  --amber-soft: #332c1c;
  --header: rgba(13, 14, 18, .9);
  --graph-bg: var(--surface);
  --shadow: 0 16px 50px -24px #0009;
}
body[data-page=knowledge] { font-size: 17px; overflow: hidden; }

/* Match the host's header, official wordmark and page navigation. */
.site-header {
  height: var(--header-height);
  padding: 0;
  display: block;
  position: relative;
  z-index: 50;
  background: var(--header);
  backdrop-filter: blur(18px);
}
.header-inner {
  max-width: none;
  width: 100%;
  margin: auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand { display: flex; align-items: center; gap: 7px; flex: 0 0 286px; }
.brand-logo {
  --logo-width: 170px;
  display: block;
  position: relative;
  flex: 0 0 auto;
  width: var(--logo-width);
  aspect-ratio: 2000 / 360;
  line-height: 0;
}
.brand-logo > img { position: absolute; inset: 0; width: 100%; height: auto; max-width: none; }
.brand-divider { height: 22px; width: 1px; margin: 0 11px; background: var(--line); }
.brand-service { font-size: 13px; font-weight: 620; color: var(--muted); letter-spacing: -.2px; white-space: nowrap; }
.header-nav { display: flex; align-self: center; align-items: center; gap: 27px; margin: auto; }
.header-nav a {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 590;
  white-space: nowrap;
  color: var(--muted);
  padding: 0 0 7px;
  margin-bottom: -7px;
}
.header-nav a:hover, .header-nav a[aria-current=page] { color: var(--text); }
.header-nav a[aria-current=page]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--red);
}
.beat-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.header-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; color: var(--muted); border-radius: 9px; }
.menu-toggle:hover { background: var(--surface-2); color: var(--text); }

/* The same system / light / dark switch, including shared preference storage. */
.theme-switch {
  --theme-index: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex: 0 0 138px;
  width: 138px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.theme-switch[data-active=light] { --theme-index: 1; }
.theme-switch[data-active=dark] { --theme-index: 2; }
.theme-switch::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 4px #0b12201a;
  transform: translateX(calc(var(--theme-index) * 100%));
  transition: transform .28s cubic-bezier(.22, .8, .24, 1), background-color .2s ease;
}
.theme-switch button { position: relative; z-index: 1; display: grid; place-items: center; min-height: 32px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); transition: color .2s ease, transform .18s ease; }
.theme-switch button:hover, .theme-switch button[aria-pressed=true] { color: var(--text); }
.theme-switch button:active { transform: scale(.92); }
.theme-switch svg { width: 17px; height: 17px; stroke-width: 1.7; }

/* A standard cs-eval sidebar, with the two knowledge panes filling the rest. */
.kb-shell { max-width: none; width: 100%; margin: 0 auto; padding: 16px 24px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.topline { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.crumb { display: flex; align-items: center; gap: 8px; }
.crumb svg { width: 12px; height: 12px; }
.workspace { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; padding: 0; margin: 0; width: 100%; max-width: none; height: auto; min-height: 0; flex: 1; }
.exploration-rail { width: auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 2px 0 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.side-title { font-size: 12px; letter-spacing: 1.3px; font-weight: 600; color: var(--faint); padding: 12px 12px 14px; white-space: nowrap; }
.rail-main, .rail-bottom { align-items: stretch; gap: 4px; }
.rail-item { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 46px; padding: 12px; border-radius: 10px; text-align: left; font-size: 14px; font-weight: 400; color: var(--muted); line-height: 1.55; }
.rail-item > span { font-size: inherit; }
.rail-item svg { width: 18px; height: 18px; }
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item.active { background: var(--red-soft); color: var(--red-text); font-weight: 650; }
.rail-item.active::before { content: none; }
.rail-bottom { margin-top: 18px; }
.rail-divider { width: auto; height: 1px; margin: 0 12px 12px; background: var(--line); }
.rail-item > .tiny-count { min-width: 20px; font-size: 10px; margin-left: auto; background: var(--surface-2); }
.side-note { margin: 20px 12px 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; word-break: keep-all; }
.workspace-body { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.workspace-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 24px; max-width: none; margin: 0 0 12px; padding: 0; }
.workspace-title { display: block; min-width: 0; }
.workspace-title h1 { font-size: 30px; font-weight: 720; line-height: 1.25; letter-spacing: -1.2px; }
.workspace-title p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.55; word-break: keep-all; }
.global-search { flex: 0 1 420px; width: 43%; max-width: 420px; height: 46px; padding: 0 14px; border-radius: 11px; box-shadow: none; }
.global-search input { font-size: 14px; }
.global-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.portal-panels { flex: 1; min-height: 0; width: 100%; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); border-radius: var(--radius); box-shadow: none; }

/* Reading uses the host's type scale, border tokens and compact cards. */
.btn { min-height: 36px; padding: 7px 12px; border-radius: 11px; font-size: 13px; font-weight: 620; gap: 9px; }
.btn.primary { background: #dd1740; border-color: #dd1740; }
.btn.primary:hover { background: #c71338; border-color: #c71338; }
.text-button { font-size: 12px; }
.badge { font-size: 11px; border-radius: 6px; }
.tiny-count { border-radius: 5px; }
.reader-toolbar { min-height: 56px; padding: 10px 20px; gap: 12px; }
.toolbar-label strong { font-size: 14px; font-weight: 650; }
.toolbar-label svg { width: 18px; height: 18px; }
.scope-controls { gap: 12px; }
.scope-select select, .expire-control { font-size: 12px; }
.scope-count { font-size: 11px; }
.reader-scroll { padding: 22px 22px 28px; }
.reader-scroll[data-view=wiki] { padding-top: 18px; }
.breadcrumbs, .breadcrumbs button { font-size: 12px; }
.wiki-overview { margin-bottom: 16px; gap: 12px; }
.wiki-overview h2 { font-size: 24px; font-weight: 700; letter-spacing: -.8px; }
.wiki-heading p { font-size: 13px; line-height: 1.7; }
.wiki-overview .hero-meta { flex: 0 0 240px; padding: 10px 0; background: var(--surface-2); border-radius: 10px; }
.wiki-overview .hero-meta > div { padding-inline: 6px; }
.wiki-overview .hero-meta strong { font-size: 20px; white-space: nowrap; }
.wiki-overview .hero-meta span, .wiki-overview .hero-meta strong small { font-size: 11px; }
.reader-scroll[data-view=wiki] .reader-tabs { gap: 20px; margin: 12px 0 16px; }
.reader-scroll[data-view=wiki] .reader-tabs button { padding: 9px 0 11px; font-size: 13px; }
.section-heading h3 { font-size: 15px; }
.section-heading .small { font-size: 11px; }
.path-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr)); gap: 8px; }
.path-grid .path-card { padding: 12px; min-height: 108px; border-radius: 10px; gap: 6px; transition: border-color .15s; }
.path-grid .path-card strong { font-size: 14px; }
.path-grid .path-card p, .path-grid .path-empty { font-size: 11px; line-height: 1.6; }
.path-grid .path-icon { width: 26px; height: 26px; border-radius: 7px; }
.path-grid .path-icon svg { width: 14px; height: 14px; }
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.feature-grid .feature-card { padding: 14px; border-radius: 10px; }
.feature-grid .feature-card-head button { font-size: 14px; }
.feature-grid .feature-path, .feature-grid .coverage-note { font-size: 11px; }
.coverage-cell { font-size: 10px; }
.coverage-cell strong { font-size: 13px; }
.unit-header h2 { font-size: 27px; font-weight: 720; }
.unit-header .unit-id { font-size: 12px; }
.unit-header .unit-dates, .unit-disclosure-note { font-size: 11px; }
.unit-statement { font-size: 15px; line-height: 1.85; }
.unit-row h3 { font-size: 14px; }
.unit-row p { font-size: 13px; line-height: 1.8; }
.detail-section > h3, .section-summary h3 { font-size: 15px; }
.context-hint, .context-extra { font-size: 12px; }
.context-field > label, .condition-result, .condition-check { font-size: 12px; }
.condition-result strong { font-size: 13px; }
.context-field select, .context-field input[type=text] { font-size: 13px; min-height: 38px; border-radius: 8px; }
.pending-list, .questions-list, .simple-list, .lookup-row, .related-row button { font-size: 13px; }
.step-list li, .answer-card p { font-size: 14px; line-height: 1.85; }
.source-head strong, .source-card blockquote, .fragment-card { font-size: 13px; }
.source-head a, .source-card .source-locator, .lookup-row .lookup-path { font-size: 11px; }
.link-tags button { font-size: 12px; }
.reader-footer { padding: 11px 18px; font-size: 10px; }
.reader-footer .text-button { font-size: 11px; }
.navigation-drawer { top: 56px; font-size: 13px; }
.nav-tree-item { font-size: 13px; min-height: 38px; }

/* Keep the requested simple circles and luminous, animated relations. */
.graph-pane, .graph-stage { background: var(--surface); }
#graph-canvas .kbg-root { --kbg-bg: var(--surface); --kbg-panel: var(--surface); --kbg-text: var(--text); --kbg-muted: var(--muted); --kbg-line: var(--line); --kbg-soft: var(--surface-2); }
.graph-header { min-height: 56px; padding: 10px 20px; }
.graph-header h2 { font-size: 18px; font-weight: 700; letter-spacing: -.6px; }
.graph-context { padding: 0 20px 12px; gap: 8px; flex-wrap: wrap; }
.graph-context-label, .graph-stats { font-size: 11px; }
.segmented { border-radius: 9px; background: var(--surface-2); }
.segmented button { font-size: 12px; padding: 6px 9px; border-radius: 7px; }
.graph-options { font-size: 12px; padding: 10px 18px; gap: 18px; }
.graph-options select { font-size: 12px; }
.graph-footer { padding: 12px 18px; }
.graph-legend, .graph-relation-legend, .graph-direction, .graph-accessible { font-size: 10px; }
.graph-controls { border-radius: 11px; }
.graph-controls button { width: 31px; height: 31px; border-radius: 7px; }
.graph-tip { font-size: 10px; }
.toast { font-size: 13px; }

@container (max-width: 520px) {
  .reader-toolbar { row-gap: 8px; padding: 10px 18px; }
  .scope-controls { gap: 12px; padding-top: 8px; }
  .scope-count { display: block; margin-left: auto; }
  .navigation-drawer { top: 89px; }
}
@container (max-width: 480px) {
  .wiki-overview .hero-meta { flex-basis: 100%; }
}
@media (max-width: 1280px) {
  .header-inner { padding: 0 24px; gap: 24px; }
  .header-nav { gap: 21px; }
  .brand-service, .brand-divider { display: none; }
  .brand { flex-basis: 178px; }
  .kb-shell { padding-inline: 24px; }
  .workspace { grid-template-columns: 160px minmax(0, 1fr); gap: 20px; }
  .side-title { font-size: 10px; letter-spacing: .8px; }
  .side-item { font-size: 14px; padding: 10px; }
  .global-search { flex-basis: 330px; }
  .workspace-title p { max-width: 360px; font-size: 13px; }
}
@media (max-width: 980px) {
  .header-inner { gap: 18px; }
  .header-nav { gap: 17px; }
  .brand-logo { --logo-width: 152px; }
  .kb-shell { padding-top: 18px; }
  .topline { margin-bottom: 10px; }
  .workspace { display: flex; flex-direction: column; gap: 16px; }
  .exploration-rail { flex: 0 0 auto; flex-direction: row; gap: 8px; align-items: center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 0 2px; }
  .exploration-rail::-webkit-scrollbar { display: none; }
  .side-title, .side-note, .rail-divider { display: none; }
  .rail-main, .rail-bottom { flex-direction: row; flex: 0 0 auto; width: auto; gap: 6px; }
  .rail-bottom { margin: 0; padding-left: 8px; border-left: 1px solid var(--line); }
  .rail-item { flex: 0 0 auto; width: auto; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; font-size: 12px; }
  .rail-item.active { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
  .rail-item svg { width: 15px; height: 15px; }
  .workspace-body { flex: 1; }
  .workspace-heading { margin-bottom: 16px; }
  .workspace-title h1 { font-size: 28px; }
  .workspace-title p { max-width: none; }
  .portal-panels { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); }
}
@media (max-width: 850px) {
  .portal-panels { display: flex; flex-direction: column; }
  .reading-pane, .graph-pane { width: 100%; flex: 1; min-height: 0; }
  .reader-scroll { padding-bottom: 70px; }
  .graph-footer { padding-bottom: 66px; }
  .workspace-heading { gap: 18px; }
  .workspace-title p { max-width: 320px; }
}
@media (max-width: 760px) {
  :root { --header-height: 68px; }
  .header-inner { padding: 0 20px; justify-content: space-between; }
  .brand { flex: 0 0 auto; }
  .brand-logo { --logo-width: 149px; }
  .header-tools { gap: 9px; }
  .theme-switch { flex-basis: 108px; width: 108px; }
  .menu-toggle { display: flex; }
  .header-nav { display: none; position: absolute; top: calc(var(--header-height) - 1px); left: 0; right: 0; padding: 12px 20px 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 15px 25px #0001; margin: 0; align-items: stretch; gap: 0; }
  .header-nav.open { display: flex; flex-direction: column; }
  .header-nav a { padding: 13px 12px; margin: 0; min-height: 46px; border-radius: 10px; }
  .header-nav a[aria-current=page] { background: var(--red-soft); color: var(--red-text); }
  .header-nav a[aria-current=page]::after { display: none; }
  .kb-shell { padding: 16px 20px 14px; }
  .topline { font-size: 12px; }
  .workspace { gap: 14px; }
  .workspace-heading { flex-wrap: wrap; gap: 14px; }
  .workspace-title h1 { font-size: 29px; }
  .workspace-title p { max-width: none; font-size: 14px; }
  .global-search { width: 100%; flex-basis: 100%; max-width: none; height: 44px; }
}
@media (max-width: 560px) {
  .kb-shell { padding-top: 12px; }
  .workspace-title h1 { font-size: 25px; }
  .workspace-title p { display: none; }
  .workspace-heading { gap: 10px; margin-bottom: 12px; }
  .global-search input { font-size: 13px; }
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-grid .path-card strong { font-size: 13px; }
  .reader-scroll { padding-inline: 18px; }
  .wiki-overview h2 { font-size: 22px; }
  .graph-header { padding-inline: 18px; }
  .unit-header h2 { font-size: 24px; }
  .unit-statement { font-size: 14px; }
}
@media (max-width: 380px) {
  .header-inner { padding: 0 15px; }
  .brand-logo { --logo-width: 136px; }
  .header-tools { gap: 5px; }
  .menu-toggle { width: 32px; }
  .kb-shell { padding-inline: 16px; }
  .scope-controls { gap: 9px; }
  .scope-select select, .expire-control, .scope-count { font-size: 11px; }
  .segmented button { font-size: 11px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-switch::before, .theme-switch button { transition: none; }
}

/* 로딩 점 구체(orb-loading.js) — 원 돌기 자리를 그대로 이어받는다 */
.loading-orb{width:56px;height:56px;display:block;margin-bottom:2px}
