/* === DOCS LAYOUT === */
.docs-page {
  display: flex;
  min-height: calc(100vh - 60px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  gap: 0;
}

/* === DOCS SIDEBAR === */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 40px 0 80px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(191,255,96,0.2) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(191,255,96,0.2); border-radius: 2px; }

.docs-nav-section {
  margin-bottom: 32px;
}
.docs-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 0 20px;
  margin-bottom: 8px;
  display: block;
}
.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
  line-height: 1.3;
}
.docs-nav-link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.03);
}
.docs-nav-link.active {
  color: var(--lime);
  background: rgba(191,255,96,0.07);
  font-weight: 600;
  border-right: 2px solid var(--lime);
  margin-right: -1px;
}

/* === DOCS MAIN CONTENT === */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 48px 48px 80px 48px;
  max-width: 800px;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 32px;
}
.docs-breadcrumb a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.docs-breadcrumb a:hover { color: var(--lime); }
.docs-breadcrumb-sep { color: #333; }

.docs-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 12px;
  display: block;
}
.docs-h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--fg);
  margin-bottom: 16px;
}
.docs-lead {
  font-size: 17px;
  color: var(--fg-dim);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 620px;
}

.docs-h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
  margin: 48px 0 16px;
  padding-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.docs-h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.docs-h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--fg);
  margin: 28px 0 10px;
}
.docs-p {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.75;
  margin-bottom: 16px;
}
.docs-p a, .docs-li a {
  color: var(--lime);
  text-decoration: none;
  transition: opacity 0.15s;
}
.docs-p a:hover, .docs-li a:hover { opacity: 0.75; text-decoration: underline; }

.docs-ul, .docs-ol {
  padding-left: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs-li {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.65;
}
.docs-li strong { color: var(--fg); }

/* === CODE BLOCKS === */
.docs-code-block {
  position: relative;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
}
.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0f0f0f;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.docs-code-filename {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--fg-dim);
}
.docs-copy-btn {
  background: rgba(191,255,96,0.08);
  border: 1px solid rgba(191,255,96,0.15);
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.docs-copy-btn:hover { background: rgba(191,255,96,0.15); color: var(--lime); }
.docs-copy-btn.copied { color: var(--lime); border-color: rgba(191,255,96,0.4); }

.docs-code-body {
  padding: 20px 24px;
  overflow-x: auto;
}
.docs-code-body pre {
  margin: 0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre;
}
.docs-code-body code {
  font-family: inherit;
}
/* Syntax highlights */
.tok-kw { color: var(--lime); }
.tok-cm { color: #555; font-style: italic; }
.tok-str { color: #7ee787; }
.tok-num { color: #f8c555; }
.tok-key { color: #79c0ff; }
.tok-val { color: #ffa657; }
.tok-dim { color: #555; }
.tok-ok { color: var(--lime); }

/* Inline code */
.docs-p code, .docs-li code, .docs-h3 code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--lime);
}

/* === CALLOUT BOXES === */
.docs-callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.6;
}
.docs-callout-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.docs-callout-tip {
  background: rgba(191,255,96,0.06);
  border: 1px solid rgba(191,255,96,0.2);
  color: var(--fg-dim);
}
.docs-callout-tip .docs-callout-icon { color: var(--lime); }
.docs-callout-warn {
  background: rgba(255,216,77,0.06);
  border: 1px solid rgba(255,216,77,0.2);
  color: #c8a820;
}
.docs-callout-warn .docs-callout-icon { color: var(--yellow); }
.docs-callout-info {
  background: rgba(79,149,255,0.06);
  border: 1px solid rgba(79,149,255,0.2);
  color: #8bb4f8;
}
.docs-callout-info .docs-callout-icon { color: #79c0ff; }
.docs-callout strong { color: var(--fg); }

/* === REFERENCE TABLES === */
.docs-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.docs-table th {
  background: #0f0f0f;
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.docs-table td {
  padding: 12px 16px;
  color: var(--fg-dim);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  line-height: 1.5;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(255,255,255,0.02); }
.docs-table td code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--lime);
}
.docs-table td strong { color: var(--fg); }

/* === DOCS INDEX CARDS === */
.docs-index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
.docs-index-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.docs-index-card:hover {
  border-color: rgba(191,255,96,0.25);
  background: #0c0d0a;
}
.docs-index-card-icon {
  width: 36px;
  height: 36px;
  background: var(--lime-dim);
  border: 1px solid var(--lime-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 16px;
}
.docs-index-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.docs-index-card-desc {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.55;
}

/* === PAGE NAV (prev/next) === */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.docs-page-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s;
  max-width: 48%;
}
.docs-page-nav-link:hover { border-color: rgba(191,255,96,0.25); }
.docs-page-nav-link.next { margin-left: auto; text-align: right; }
.docs-page-nav-dir {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  display: block;
  margin-bottom: 2px;
}
.docs-page-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

/* === EDIT ON GITHUB === */
.docs-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  font-size: 12px;
  color: var(--fg-dim);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.docs-edit-link:hover { opacity: 1; color: var(--lime); }

/* === MOBILE DRAWER === */
.docs-mobile-nav-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(191,255,96,0.07);
  border: 1px solid rgba(191,255,96,0.2);
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  margin-bottom: 24px;
}
.docs-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
}
.docs-drawer-overlay.open { display: block; }
.docs-drawer {
  position: fixed;
  left: -280px;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg);
  border-right: 1px solid rgba(191,255,96,0.15);
  z-index: 201;
  padding: 20px 0;
  overflow-y: auto;
  transition: left 0.25s ease;
}
.docs-drawer.open { left: 0; }
.docs-drawer-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 16px;
}
.docs-drawer-close-btn {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .docs-page {
    padding: 0 20px;
    flex-direction: column;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-mobile-nav-btn {
    display: flex;
  }
  .docs-content {
    padding: 32px 0 60px;
  }
  .docs-index-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .docs-page { padding: 0 16px; }
  .docs-h1 { font-size: 28px; }
  .docs-table-wrap { font-size: 12px; }
  .docs-page-nav { flex-direction: column; }
  .docs-page-nav-link { max-width: 100%; }
  .docs-page-nav-link.next { margin-left: 0; text-align: left; }
}
