body {
  background: #181c24;
  color: #e0e0e0;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
.navbar {
  background: #23283b;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  box-shadow: 0 2px 8px #0004;
  position: sticky; /* Make navbar stick to top */
  top: 0; /* Stick to the top */
  z-index: 100; /* Ensure it's above other content */
}
.navbar .logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #ba1923;
  margin-right: 40px;
  letter-spacing: 2px;
}
.navbar nav {
  margin-left: 32px;
  flex: 1 1 auto;
  align-items: center; /* Vertically center nav items */
  display: flex; /* Ensure align-items works */
}
.navbar nav a {
  color: #e0e0e0;
  text-decoration: none;
  margin-right: 24px;
  font-size: 1.1em;
  transition: color 0.2s;
}
.navbar nav a:hover, .navbar nav a.active {
  color: #ba1923;
}
.github-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 16px;
  transition: opacity 0.15s;
  opacity: 0.85;
}
.github-btn:hover,
.github-btn:focus {
  opacity: 1;
}
.github-btn img.github-icon {
  height: 20px;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  display: block;
}
.github-icon {
  height: 30px;
  width: 30px;
  display: block;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  transition: box-shadow 0.15s, transform 0.12s;
}
.github-btn:hover .github-icon,
.github-btn:focus .github-icon {
  box-shadow: 0 2px 8px #0004;
  transform: scale(1.08);
}
.container {
  width: calc(100% - 48px);
  max-width: 1500px;
  margin: 22px auto 0 auto;
  background: #23283b;
  border-radius: 12px;
  box-shadow: 0 4px 32px #000a;
  padding: 24px;
}
h1 {
  color: #ba1923;
  margin-top: 0;
  font-size: 2.2em;
  letter-spacing: 1px;
}
.logo-img {
  height: 36px;
  vertical-align: middle;
  margin-right: 12px;
  border-radius: 6px;
}
.placeholder {
  color: #888;
  font-style: italic;
  margin: 32px 0;
  text-align: center;
}

.docs-header h1 {
  margin-bottom: 8px;
}

.docs-lead {
  margin: 0;
  color: #d6d6d6;
}

.docs-note {
  margin-top: 10px;
  color: #b6b8c2;
  font-size: 0.96em;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.docs-toc {
  align-self: start;
  position: sticky;
  top: 74px;
  background: #1c2131;
  border: 1px solid #2c3348;
  border-radius: 10px;
  padding: 14px 12px;
}

.docs-toc h2 {
  margin: 0 0 10px 0;
  font-size: 1em;
  color: #ba1923;
}

.docs-toc a {
  display: block;
  color: #d4d7e2;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.95em;
}

.docs-toc a:hover {
  background: #2a3043;
  color: #fff;
}

.docs-toc a.current {
  background: #ba1923;
  color: #fff;
}

.docs-main {
  min-width: 0;
  width: 100%;
}

.docs-section {
  background: #1c2131;
  border: 1px solid #2c3348;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.docs-section h2 {
  margin-top: 0;
  color: #e5e7ef;
}

/* Anchorable headings/entries (manual ids + links in Docs pages) */
.docs-section h2[id],
.docs-section h3[id],
.docs-section h4[id],
.docs-section li[id] {
  scroll-margin-top: 84px; /* account for sticky navbar */
}

.doc-anchor {
  position: relative;
}

.doc-anchor-link {
  color: inherit;
  text-decoration: none;
}

.doc-anchor-link:hover,
.doc-anchor-link:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
}

.doc-anchor-hash {
  margin-left: 10px;
  color: #bac0d0;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.doc-anchor:hover .doc-anchor-hash,
.doc-anchor:focus-within .doc-anchor-hash {
  opacity: 1;
}

.doc-anchor-hash:hover,
.doc-anchor-hash:focus {
  color: #e5e7ef;
  outline: none;
}

.doc-anchor-hash[data-copied="1"]::after {
  content: " copied";
  margin-left: 6px;
  font-size: 0.85em;
  color: #50fa7b;
}

/* Targeted section outline (wraps only the heading text, not full width) */
.docs-section .doc-anchor:target .doc-anchor-link {
  display: inline-block;
  outline: 2px solid rgba(186, 25, 35, 0.65);
  outline-offset: 6px;
  border-radius: 10px;
}

.docs-section li:target {
  display: inline-block;
  outline: 2px solid rgba(186, 25, 35, 0.65);
  outline-offset: 6px;
  border-radius: 10px;
}

.docs-section p,
.docs-section li {
  line-height: 1.55;
}

.docs-section pre {
  background: #121621;
  border: 1px solid #2d3449;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.zk-codewrap {
  position: relative;
  padding-top: 38px; /* room for the overlay button */
}

.zk-run-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font: inherit;
  font-size: 0.92em;
  color: #e5e7ef;
  background: rgba(35, 40, 59, 0.92);
  border: 1px solid #2d3449;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
  pointer-events: none; /* enabled on hover/focus */
}

.zk-codewrap:hover .zk-run-btn,
.zk-codewrap:focus-within .zk-run-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.zk-codewrap.zk-resetting .zk-run-btn {
  opacity: 0 !important;
  transform: translateY(-2px) !important;
  pointer-events: none !important;
}

.zk-run-btn:hover,
.zk-run-btn:focus {
  background: rgba(186, 25, 35, 0.92);
  outline: none;
}

.docs-section code {
  color: #f2f2f2;
  background: #121621;
  border: 1px solid #2d3449;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.95em;
  box-shadow: inset 0 -1px 0 #0006;
}

.docs-section pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.platform-card {
  background: #171b28;
  border: 1px solid #2f3548;
  border-radius: 10px;
  padding: 12px;
}

.platform-card h4 {
  margin: 0 0 8px 0;
  color: #dbe0ef;
}

.platform-card pre {
  margin: 0;
}

.docs-section pre code.zk-code {
  color: #d4d4d4;
}

.docs-section pre code.zk-code .tok-comment { color: #6A9955; font-style: italic; }
.docs-section pre code.zk-code .tok-keyword { color: #569CD6; }
.docs-section pre code.zk-code .tok-keyword-control { color: #C678DD; }
.docs-section pre code.zk-code .tok-builtin { color: #569CD6; }
.docs-section pre code.zk-code .tok-function { color: #DCDCAA; }
.docs-section pre code.zk-code .tok-variable { color: #9CDCFE; }
.docs-section pre code.zk-code .tok-type { color: #4EC9B0; }
.docs-section pre code.zk-code .tok-number { color: #B5CEA8; }
.docs-section pre code.zk-code .tok-string { color: #CE9178; }
.docs-section pre code.zk-code .tok-escape { color: #D7BA7D; }
.docs-section pre code.zk-code .tok-boolean { color: #569CD6; }
.docs-section pre code.zk-code .tok-operator { color: #D4D4D4; }
.docs-section pre code.zk-code .tok-property { color: #FFB86C; }

/* Error Highlight Colors */
.zk-code-error .tok-error-syntax-label { color: #ff5555; font-weight: bold; }
.zk-code-error .tok-error-ref-label { color: #569CD6; font-weight: bold; }
.zk-code-error .tok-error-type-label { color: #f1fa8c; font-weight: bold; }
.zk-code-error .tok-error-runtime-label { color: #C678DD; font-weight: bold; }
.zk-code-error .tok-error-internal-label { background-color: #ff5555; color: #fff; font-weight: bold; padding: 0 4px; }
/* Error Message Body */
.zk-code-error .tok-error-msg { color: #f8f8f2; }
/* Location/File Path */
.zk-code-error .tok-error-loc { color: #f8f8f2; font-weight: bold; }
/* Code and Line Numbers inside Error Blocks */
.zk-code-error .tok-error-line-num { color: #6272a4; }
.zk-code-error .tok-error-line-code { color: #f8f8f2; }
/* Error Pointer */
.zk-code-error .tok-error-pointer { color: #ff5555; font-weight: bold; }
/* Extra Info Labels */
.zk-code-error .tok-error-meta-label { color: #6272a4; }
.zk-code-error .tok-error-expected-val { color: #50fa7b; font-weight: bold; }
.zk-code-error .tok-error-found-val { color: #ff5555; font-weight: bold; }
.zk-code-error .tok-error-kind-val { color: #ff5555; font-weight: bold; }


.placeholder-card {
  margin-top: 10px;
  background: #171b28;
  border: 1px dashed #3a4157;
  border-radius: 8px;
  padding: 10px 12px;
  color: #b9becc;
}

.docs-page-label {
  display: inline-block;
  font-size: 0.85em;
  color: #bac0d0;
  background: #171b28;
  border: 1px solid #2f3548;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #2c3348;
}

.docs-pager a,
.docs-pager span {
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #384057;
  background: #171b28;
  color: #dbe0ef;
  font-size: 0.92em;
}

.docs-pager a:hover {
  background: #2a3043;
}

.docs-pager .disabled {
  opacity: 0.45;
}

/* Hamburger styles */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0;
  margin-right: 0;
  z-index: 102;
  position: static;
  padding: 0;
}
.hamburger:focus,
.hamburger:active {
  outline: none;
  background: none;
  box-shadow: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2.5px;
  background: #ba1923;
  margin: 3px 0;
  border-radius: 2px;
  transition: background 0.18s;
}
.hamburger.active span {
  background: #ffffff;
}

/* Hide the menu-github button by default (desktop), show navbar-github */
.menu-github { display: none; }
.navbar-github { display: flex; }

/* Responsive navbar for mobile */
@media (max-width: 800px) {
  .navbar {
    flex-wrap: nowrap;
    position: sticky;
    height: 56px; /* Same height as desktop */
    padding: 0 12px;
    justify-content: flex-start;
    align-items: center;
  }
  .logo-img {
    order: 0;
    margin-right: 0;
  }
  nav {
    order: 1;
    margin-left: 0;
    flex: unset;
  }
  .hamburger {
    display: flex;
    margin-left: auto;
    margin-right: 0;
    order: 3;
  }
  .navbar nav {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: min(82vw, 280px);
    height: 100vh;
    background: #23283b;
    flex-direction: column;
    align-items: flex-start;
    padding: 56px 0 8px 0;
    box-shadow: -2px 0 12px #0006;
    z-index: 100;
    display: flex;
    transition: transform 0.22s cubic-bezier(0.4, 0.2, 0.2, 1);
    box-sizing: border-box;
  }

  .navbar.menu-open nav {
    transform: translateX(0);
  }

  /* Regular navbar github button */
  .navbar > .github-btn {
    display: none !important;
  }

  /* Menu github button */
  .navbar nav .github-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 56px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border-bottom: none;
    z-index: 101;
  }

  .navbar:not(.menu-open) .github-btn {
    display: none !important;
  }

  .navbar nav a {
    width: 100%;
    padding: 14px 24px;
    border-bottom: 1px solid #2226;
    margin: 0;
  }

  .container {
    width: calc(100% - 16px);
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }

  .docs-toc {
    position: static;
    padding: 10px;
  }

  .docs-toc a {
    padding: 8px 10px;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .docs-header h1 {
    font-size: 1.55em;
  }

  .docs-section {
    padding: 12px;
  }

  .docs-section pre {
    font-size: 0.92em;
    padding: 10px;
  }

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

  .docs-pager a,
  .docs-pager span {
    width: 100%;
    text-align: center;
  }
}

/* Container styling */
.lib-dropdown {
  margin-bottom: 1rem;
  border: 1px solid #ba1923;
  border-radius: 8px;
  overflow: hidden;
  background: #384057;
}

/* Header/Toggle area */
.lib-dropdown summary {
  padding: 1rem;
  cursor: pointer;
  background: #384057;
  list-style: none;
  display: flex;
  align-items: center;
  user-select: none; /* Prevents text highlighting on double-click */
}

.lib-dropdown summary h3 {
  margin: 0;
  display: inline-block;
  color: #fff;
}

/* Add a custom arrow */
.lib-dropdown summary::before {
  content: "▶";
  font-size: 0.8rem;
  margin-right: 10px;
  transition: transform 0.3s ease; /* Kept only the arrow rotation transition */
  color: #ba1923;
}

.lib-dropdown[open] summary::before {
  transform: rotate(90deg);
}

/* Content area */
.lib-content {
  padding: 1rem;
  background: #181c24;
  border-top: 1px solid #ba1923;
}
