.kb-article {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  line-height: 1.75;
  font-size: 15.5px;
  color: #1f2937;
  max-width: 920px;
}

/* Headings */
.kb-article h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
}

.kb-article h3 {
  font-size: 18px;
  margin: 28px 0 10px;
}

/* Paragraphs */
.kb-article p {
  margin: 14px 0;
}

/* Lists */
.kb-article ul,
.kb-article ol {
  margin: 12px 0 12px 26px;
}

.kb-article li {
  margin: 6px 0;
}

/* Code Blocks */
.kb-article pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 18px 0;
}

.kb-article code {
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 14px;
}

/* Inline code */
.kb-article p code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Tables */
.kb-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.kb-article th,
.kb-article td {
  border: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
}

.kb-article th {
  background: #f8fafc;
  font-weight: 600;
}
/* ===== CODE COPY BUTTON ===== */
.kb-article pre {
  position: relative;
}

.kb-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #334155;
  color: #e5e7eb;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.85;
}

.kb-copy-btn:hover {
  opacity: 1;
  background: #475569;
}

.kb-copy-btn.copied {
  background: #16a34a;
  color: #ffffff;
}
/* ===== STICKY TOC ===== */
#tocBox {
  position: sticky;
  top: 90px; /* below header */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-toggle {
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}

.toc-list a {
  display: block;
  padding: 4px 6px;
  border-radius: 4px;
  color: #334155;
  text-decoration: none;
}

.toc-list a:hover {
  background: #f1f5f9;
}

/* Active TOC item */
.toc-list a.active {
  background: #2563eb;
  color: #ffffff;
}

/* Collapsed TOC */
#tocBox.toc-collapsed .toc-list {
  display: none;
}

/* Mobile behavior */
@media (max-width: 991px) {
  #tocBox {
    position: static;
    max-height: none;
  }
}
