:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  padding: 0 24px;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
}

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

.brand span,
.site-header nav a {
  color: var(--muted);
  font-size: 12px;
}

.site-header nav {
  display: flex;
  gap: 18px;
}

.site-header nav a {
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--blue);
}

.docs-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 100%;
  min-height: calc(100vh - 60px);
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 18px 32px;
}

.docs-sidebar__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.docs-sidebar__heading strong {
  font-size: 14px;
}

.docs-sidebar__heading span {
  color: var(--muted);
  font-size: 10px;
}

.search-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.search-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  padding: 8px 10px;
}

.search-field input:focus {
  outline: 0;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.docs-nav section {
  margin-top: 22px;
}

.docs-nav h2 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.docs-nav a {
  display: block;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  padding: 9px 10px;
  text-decoration: none;
}

.docs-nav a:hover {
  background: #f8fafc;
}

.docs-nav a.active {
  border-left-color: var(--blue);
  background: var(--blue-soft);
  color: #1d4ed8;
}

.docs-nav a strong,
.docs-nav a span {
  display: block;
}

.docs-nav a strong {
  font-size: 12px;
}

.docs-nav a span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.docs-empty {
  color: var(--muted);
  font-size: 12px;
}

.docs-content {
  min-width: 0;
  max-width: 100%;
  padding: 34px 40px 56px;
}

.docs-content__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 1040px);
  margin: 0 auto 20px;
}

.docs-group {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.docs-content h1 {
  margin: 6px 0 0;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: 0;
}

.docs-content__header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.docs-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.docs-actions button,
.docs-actions a {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.docs-actions button:hover,
.docs-actions a:hover {
  border-color: #bfdbfe;
  color: var(--blue);
}

.docs-source {
  width: min(100%, 1040px);
  max-width: 100%;
  min-height: 540px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 24px 28px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.docs-error {
  width: min(100%, 1040px);
  margin: 0 auto 16px;
  border-left: 3px solid var(--red);
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 14px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .docs-content {
    padding: 28px 24px 48px;
  }

  .docs-content__header {
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 0 16px;
  }

  .brand span {
    display: none;
  }

  .site-header nav {
    gap: 10px;
  }

  .site-header nav a:last-child {
    display: none;
  }

  .docs-layout {
    display: block;
  }

  .docs-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .docs-content {
    overflow: hidden;
    padding: 24px 16px 40px;
  }

  .docs-sidebar__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .docs-actions {
    flex-wrap: wrap;
  }

  .docs-source {
    padding: 18px;
  }
}
