:root {
  --bg: #ffffff;
  --fg: #182230;
  --muted: #526071;
  --border: #dce3ec;
  --surface: #f6f8fb;
  --accent: #0f4c81;
  --code-bg: #f1f4f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 24rem;
}

#docs-search {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.search-results {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 20;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.25rem;
  max-height: 24rem;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-result-item {
  display: block;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--fg);
}

.search-result-item:hover {
  background: var(--surface);
}

.search-result-title {
  font-weight: 600;
  color: var(--accent);
}

.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem;
}

.sidebar {
  border-inline-end: 1px solid var(--border);
  padding-inline-end: 1rem;
}

.nav-sections {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-section {
  margin-bottom: 1rem;
}

.nav-section-title {
  display: block;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.nav-section ul {
  list-style: none;
  margin: 0;
  padding-inline-start: 0.75rem;
}

.nav-link {
  display: block;
  padding: 0.15rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.nav-link.active,
.nav-section-title.active {
  color: var(--accent);
  font-weight: 600;
}

.content {
  min-width: 0;
}

.doc-article h1,
.doc-article h2,
.doc-article h3 {
  line-height: 1.3;
  margin-top: 1.5rem;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.section-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  background: var(--surface);
}

.section-card h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  color: var(--accent);
}

.section-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: start;
  vertical-align: top;
}

th {
  background: var(--surface);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
}

code {
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: transparent;
}

.doc-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-inline-end: none;
    border-bottom: 1px solid var(--border);
    padding-inline-end: 0;
    padding-bottom: 1rem;
  }
}
