:root {
  --ink: #17233b;
  --muted: #68748a;
  --faint: #94a0b4;
  --line: #e4e8ef;
  --paper: #fbfcfe;
  --panel: #ffffff;
  --navy: #101a2f;
  --blue: #3167d9;
  --blue-soft: #edf3ff;
  --gold: #d38c33;
  --green: #25805b;
  --shadow: 0 16px 44px rgba(20, 36, 67, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
button, input { font: inherit; }
a { color: var(--blue); }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1500px; height: 100%; margin: 0 auto; padding: 0 30px; display: flex; align-items: center; gap: 28px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; display: grid; place-items: center; color: #b9cdfd; font-size: 21px; }
.brand strong { display: block; font-size: 20px; line-height: 1.05; }
.brand small { display: block; margin-top: 3px; color: #a8b4ca; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-note { margin-left: auto; color: #aebbd1; font-size: 12px; }
.mobile-menu { display: none; color: #fff; background: transparent; border: 0; font-size: 24px; cursor: pointer; }

.layout { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { border-right: 1px solid var(--line); background: #f7f9fc; }
.sidebar-inner { position: sticky; top: 76px; height: calc(100vh - 76px); padding: 27px 18px 18px; display: flex; flex-direction: column; }
.search-box { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 11px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--faint); box-shadow: 0 3px 10px rgba(28, 48, 87, .03); }
.search-box span { font-size: 23px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box kbd { border: 1px solid var(--line); background: #f8f9fb; border-radius: 4px; padding: 1px 5px; color: var(--faint); font-size: 10px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; margin: 28px 8px 10px; color: var(--ink); font-size: 12px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.page-count { color: var(--faint); font-weight: 500; }
.filters { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 3px 13px; border-bottom: 1px solid var(--line); }
.filter { cursor: pointer; color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 6px 7px; font-size: 11px; }
.filter span { margin-left: 2px; color: var(--faint); }
.filter:hover { color: var(--blue); background: var(--blue-soft); }
.filter.active { color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.page-list { overflow-y: auto; padding: 10px 0; flex: 1; }
.page-item { display: block; color: var(--muted); text-decoration: none; margin: 2px 0; padding: 9px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.page-item:hover { color: var(--ink); background: #eef3fb; }
.page-item.active { color: var(--blue); background: var(--blue-soft); border-left-color: var(--blue); }
.page-item-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.page-item-meta { display: flex; gap: 6px; margin-top: 3px; color: var(--faint); font-size: 10px; }
.empty-list { padding: 24px 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sidebar-foot { padding: 16px 7px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; line-height: 1.65; }

.main { min-width: 0; }
.content-wrap { max-width: 1010px; padding: 30px 58px 50px; margin: 0 auto; }
.breadcrumbs { min-height: 20px; margin-bottom: 28px; color: var(--faint); font-size: 11px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }
.article { min-height: 560px; }
.article-header { padding: 33px 38px 30px; margin-bottom: 32px; border: 1px solid #e4e9f2; border-radius: 16px; background: linear-gradient(135deg, #fff 0%, #f8faff 100%); box-shadow: var(--shadow); }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: block; width: 20px; height: 2px; background: var(--blue); }
.article-header h1 { max-width: 850px; margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 44px); line-height: 1.18; letter-spacing: -.045em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 21px; color: var(--muted); font-size: 11px; }
.kind-badge { padding: 4px 8px; border-radius: 5px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.kind-project { background: var(--green); }
.kind-decision { background: var(--gold); }
.article-meta .source-count { color: var(--muted); }
.markdown { max-width: 900px; font-size: 15px; line-height: 1.82; }
.markdown > :first-child { margin-top: 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { color: var(--navy); line-height: 1.3; letter-spacing: -.025em; scroll-margin-top: 100px; }
.markdown h1 { margin: 2.2em 0 .65em; font-size: 30px; }
.markdown h2 { margin: 2.05em 0 .65em; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 24px; }
.markdown h3 { margin: 1.8em 0 .55em; font-size: 19px; }
.markdown h4 { margin: 1.5em 0 .45em; font-size: 16px; }
.markdown p { margin: 0 0 1.05em; }
.markdown strong { color: var(--navy); font-weight: 750; }
.markdown em { color: #344463; }
.markdown code { padding: 2px 5px; border: 1px solid #e6eaf1; border-radius: 4px; color: #a8492b; background: #f7f8fa; font: .87em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.markdown pre { overflow-x: auto; margin: 1.4em 0; padding: 17px 19px; border: 1px solid #263858; border-radius: 9px; color: #e6edf7; background: #14223b; box-shadow: 0 8px 20px rgba(16, 26, 47, .13); }
.markdown pre code { padding: 0; border: 0; color: inherit; background: transparent; font-size: 12px; line-height: 1.65; }
.markdown ul, .markdown ol { margin: .45em 0 1.15em; padding-left: 1.5em; }
.markdown li { margin: .25em 0; padding-left: 3px; }
.markdown li::marker { color: var(--blue); }
.markdown blockquote { margin: 1.25em 0; padding: 10px 18px; border-left: 3px solid #a6bce9; color: #51617d; background: #f5f8fe; }
.markdown hr { margin: 2.3em 0; border: 0; border-top: 1px solid var(--line); }
.markdown a { text-decoration: underline; text-decoration-color: #b9cbed; text-underline-offset: 3px; }
.markdown a:hover { text-decoration-color: var(--blue); }
.markdown .wiki-link { text-decoration: none; font-weight: 650; }
.markdown .broken-link { color: #9c5362; border-bottom: 1px dashed #d9a8b2; cursor: help; }
.markdown table { width: 100%; overflow: hidden; margin: 1.4em 0; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.markdown th, .markdown td { padding: 9px 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown th { color: var(--navy); background: #f2f5fa; font-weight: 750; }
.markdown tr:nth-child(even) td { background: #fbfcfe; }
.source-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.source-strip a { display: inline-flex; align-items: center; max-width: 100%; padding: 5px 8px; overflow: hidden; border: 1px solid #dfe6f3; border-radius: 6px; color: #526789; background: #f5f8fd; font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.source-strip a:hover { color: var(--blue); border-color: #b5c8ee; }
.error-card { padding: 34px; border: 1px solid #efced5; border-radius: 13px; color: #833e4c; background: #fff7f8; }
.home-intro { margin-bottom: 30px; }
.home-intro h1 { margin: 0 0 10px; color: var(--navy); font-size: clamp(35px, 5vw, 58px); letter-spacing: -.06em; }
.home-intro p { max-width: 680px; color: var(--muted); font-size: 16px; }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0 34px; }
.stat-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.stat-card strong { display: block; color: var(--navy); font-size: 25px; letter-spacing: -.04em; }
.stat-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 58px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.spinner { width: 15px; height: 15px; border: 2px solid #dbe3f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.backdrop { display: none; }

@media (max-width: 840px) {
  .topbar-inner { padding: 0 18px; gap: 13px; }
  .mobile-menu { display: block; }
  .topbar-note { display: none; }
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 30; top: 76px; bottom: 0; left: 0; width: min(310px, 88vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 10px 0 30px rgba(12, 27, 55, .14); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-inner { top: 0; height: 100%; }
  .backdrop { position: fixed; z-index: 25; inset: 76px 0 0; background: rgba(8, 17, 34, .37); }
  .backdrop.visible { display: block; }
  .content-wrap { padding: 23px 20px 38px; }
  .article-header { padding: 25px 23px 23px; margin-bottom: 24px; }
  .markdown { font-size: 14px; }
  .markdown table { display: block; overflow-x: auto; white-space: normal; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .content-wrap { padding-left: 15px; padding-right: 15px; }
  .home-stats { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 29px; }
  .site-footer { flex-direction: column; }
}
