:root {
  color-scheme: light;
  --canvas: oklch(98.5% 0.004 250);
  --surface: oklch(99.4% 0.003 250);
  --sidebar: oklch(97.2% 0.006 250);
  --raised: oklch(100% 0.004 250);
  --ink: oklch(22% 0.018 250);
  --text: oklch(33% 0.02 250);
  --muted: oklch(48% 0.024 250);
  --subtle: oklch(60% 0.02 250);
  --line: oklch(89% 0.012 250);
  --line-strong: oklch(82% 0.018 250);
  --accent: oklch(46% 0.135 255);
  --accent-hover: oklch(40% 0.15 255);
  --accent-soft: oklch(95.5% 0.028 255);
  --success: oklch(43% 0.105 158);
  --success-soft: oklch(95% 0.025 158);
  --warning: oklch(49% 0.105 78);
  --warning-soft: oklch(95% 0.03 78);
  --danger: oklch(49% 0.115 28);
  --danger-soft: oklch(95% 0.03 28);
  --focus: 0 0 0 3px oklch(72% 0.13 255 / 0.28);
  --sidebar-width: 312px;
  --toc-width: 232px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: oklch(99.2% 0.004 250 / 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--raised);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  font-weight: 600;
}

.topnav a {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.sidebar,
.toc {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
}

.sidebar {
  padding: 22px 18px 32px 24px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-control {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.docs-stats {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.module-nav {
  display: grid;
  gap: 2px;
}

.module-button {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.module-button:hover {
  background: oklch(94.8% 0.01 250);
}

.module-button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.module-button.active {
  border-color: oklch(86% 0.045 255);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.module-button strong {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.content {
  min-width: 0;
  padding: 38px 48px 72px;
  background: var(--surface);
}

.search-results {
  margin: 0 0 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
}

.search-results h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.result-list {
  display: grid;
  gap: 6px;
}

.result-button {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.result-button:hover,
.result-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  outline: none;
}

.result-button strong {
  color: var(--accent);
  font-size: 13px;
}

.result-button span {
  color: var(--muted);
  font-size: 13px;
}

.detail {
  max-width: 800px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs span:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--subtle);
}

.detail-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.detail h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: 0;
}

.summary {
  max-width: 72ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.tag.core {
  border-color: oklch(78% 0.055 158);
  background: var(--success-soft);
  color: var(--success);
}

.tag.pilot {
  border-color: oklch(78% 0.06 78);
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.risk {
  border-color: oklch(78% 0.06 28);
  background: var(--danger-soft);
  color: var(--danger);
}

.doc-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

.doc-section p {
  max-width: 72ch;
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 22px;
}

li + li {
  margin-top: 7px;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 22px;
  padding-left: 0;
  list-style: none;
}

.capability-list li {
  position: relative;
  padding-left: 16px;
}

.capability-list li::before {
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.milestone-list {
  display: grid;
  gap: 12px;
  padding-left: 0;
  list-style: none;
  counter-reset: milestone;
}

.milestone-list li {
  position: relative;
  margin: 0;
  padding-left: 46px;
  counter-increment: milestone;
}

.milestone-list li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--muted);
  content: "M" counter(milestone);
  font-size: 11px;
  font-weight: 750;
}

.milestone-list strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toc {
  padding: 34px 24px 32px 20px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.toc p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.toc a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.toc-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.toc-meta dl {
  margin: 0;
}

.toc-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
}

.toc-meta dt,
.toc-meta dd {
  margin: 0;
}

.toc-meta dd {
  color: var(--ink);
  font-weight: 650;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    min-height: 0;
    padding: 14px 16px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .module-nav {
    max-height: 320px;
    overflow: auto;
  }

  .content {
    padding: 28px 18px 56px;
  }

  .stat {
    justify-content: flex-start;
  }

  .detail h1 {
    font-size: 26px;
  }

  .capability-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .brand small {
    display: none;
  }

  .topnav {
    gap: 12px;
  }

  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .detail h1 {
    font-size: 24px;
  }
}
