@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f8f9fa;
  --fg: #23272f;
  --muted: #6d7583;
  --border: #d9dee7;
  --border-strong: #c4cad6;
  --card: #fcfdff;
  --card-soft: #f1f4f8;
  --primary: #23272f;
  --primary-fg: #f8f9fa;
  --link: #40566f;
  --accent: #88a9a2;
  --code-bg: #f3f6fa;
  --code-fg: #1f2630;
  --sidebar-w: 256px;
  --header-h: 56px;
  --shell-max: 1280px;
  --shell-pad-l: 16px;
  --shell-pad-r: 16px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(198, 204, 216, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(198, 204, 216, 0.3) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--fg); text-decoration: none; }

.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(8px);
}

.docs-header-inner {
  max-width: var(--shell-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--shell-pad-r) 0 var(--shell-pad-l);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.docs-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.docs-brand:hover { color: var(--fg); }

.docs-brand-mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.docs-slash {
  color: var(--muted);
  font-size: 13px;
}

.docs-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.docs-header-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.docs-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}

.docs-header-link:hover {
  color: var(--fg);
  border-color: var(--border);
  background: rgba(241, 244, 248, 0.7);
}

.docs-header-link--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
}

.docs-header-link--primary:hover {
  border-color: var(--primary);
  background: #313743;
  color: var(--primary-fg);
}

.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-h);
  max-width: var(--shell-max);
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 16px 0 28px;
  background: rgba(248, 249, 250, 0.96);
  border-right: 1px solid var(--border);
}

.sidebar .logo { display: none; }

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--shell-pad-r) 0 var(--shell-pad-l);
}

.sidebar .section {
  padding: 18px 10px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.sidebar nav a {
  display: block;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}

.sidebar nav a:hover {
  color: var(--fg);
  background: rgba(241, 244, 248, 0.78);
}

.sidebar nav a.active {
  color: var(--fg);
  background: var(--card-soft);
  border-left-color: var(--primary);
  padding-left: 8px;
}

.content {
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 32px var(--shell-pad-r) 80px var(--shell-pad-l);
}

.content > * { max-width: 860px; }

@media (min-width: 640px) {
  :root {
    --shell-pad-l: 24px;
    --shell-pad-r: 24px;
  }

  .content {
    padding: 32px 32px 80px;
  }
}

@media (min-width: 768px) {
  .content {
    padding: 32px 36px 80px;
  }
}

@media (min-width: 1024px) {
  .content {
    padding: 32px 48px 80px;
  }
}

.content h1 {
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.content h2 {
  margin-top: 42px;
  margin-bottom: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.content h3 {
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.content p,
.content ul,
.content ol,
.content table {
  margin-bottom: 16px;
}

.content p,
.content li,
.content td {
  font-size: 13px;
}

.content ul,
.content ol {
  padding-left: 20px;
}

.content li {
  margin-bottom: 6px;
}

.content code {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--code-fg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

.content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(to right, rgba(198, 204, 216, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(198, 204, 216, 0.18) 1px, transparent 1px),
    var(--code-bg);
  background-size: 12px 12px, 12px 12px, auto;
  color: var(--code-fg);
  font-size: 12px;
  line-height: 1.7;
}

.content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.content .callout {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  background: var(--card-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

.concept-rail {
  margin: 24px 0 30px;
  padding: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(to right, rgba(198, 204, 216, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(198, 204, 216, 0.18) 1px, transparent 1px),
    var(--card);
  background-size: 16px 16px, 16px 16px, auto;
}

.concept-rail-head {
  margin-bottom: 14px;
  max-width: 680px;
}

.concept-rail-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.concept-rail-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.concept-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--border);
  background: rgba(252, 253, 255, 0.88);
  transition: border-color .12s ease, transform .12s ease, background .12s ease, color .12s ease;
}

.concept-card:hover {
  color: var(--fg);
  border-color: var(--border-strong);
  background: var(--card-soft);
  transform: translateY(-1px);
}

.concept-card.is-current {
  border-color: var(--primary);
  background: var(--card-soft);
}

.concept-card.is-current:hover {
  border-color: var(--primary);
  background: var(--card-soft);
  transform: none;
}

.concept-card-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.concept-card strong {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.concept-card.is-current strong {
  color: var(--primary);
}

.concept-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.lifecycle-card {
  display: grid;
  gap: 8px;
  min-height: 146px;
  padding: 14px;
  border: 1px solid var(--border);
  background: rgba(252, 253, 255, 0.88);
}

.lifecycle-card-step {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.lifecycle-card strong {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.lifecycle-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--card);
}

.content th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-soft);
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.content td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.content tr:last-child td { border-bottom: 0; }

.step {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.step-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 12px;
  font-weight: 600;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h3 { margin-top: 2px; }

@media (max-width: 860px) {
  body::before { opacity: 0.35; }

  .docs-header-inner {
    padding: 0 14px;
  }

  .docs-header-links {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .content {
    max-width: none;
    padding: 28px 20px 56px;
  }

  .layout {
    max-width: none;
  }

  .content h1 { font-size: 26px; }
  .content h2 { font-size: 18px; }
  .concept-grid {
    grid-template-columns: 1fr;
  }
}
