:root {
  --green: #1B4332;
  --green-deep: #143329;
  --cream: #F8F4ED;
  --line: #E7DFD1;
  --sand: #EFE8DB;
  --gold: #C9A267;
  --brown: #7A5C2E;
  --ink: #22302A;
  --text: #475569;
  --muted: #5C6878;
}

.docs-crumb {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

/* Navigation: groups fold, the whole menu folds on narrow screens. */
.docs-nav details > summary {
  list-style: none;
  cursor: pointer;
}
.docs-nav details > summary::-webkit-details-marker { display: none; }
.docs-group { margin-top: 18px; }
.docs-group:first-of-type { margin-top: 0; }
.docs-group > summary { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.docs-group > summary::after { content: "+"; font-size: 13px; color: var(--brown); }
.docs-group[open] > summary::after { content: "\2212"; }
.docs-nav a:hover { color: var(--brown); }
.docs-nav a[aria-current="page"]:hover { color: var(--cream); }
.docs-menu > summary { display: none; }

@media (max-width: 860px) {
  .docs-nav { max-width: none !important; flex-basis: 100% !important; padding: 20px 0 0 !important; }
  .docs-menu > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
    font-weight: 600;
    color: var(--green);
  }
  .docs-menu[open] > summary { margin-bottom: 16px; }
  main { padding-top: 24px !important; }
}

/* Search */
.docs-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(20, 51, 41, 0.14);
}
.docs-search-results[hidden] { display: none; }
.docs-search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.docs-search-results a:hover,
.docs-search-results a:focus,
.docs-search-results a[aria-selected="true"] { background: var(--sand); outline: none; color: var(--green); }
.docs-search-results small { display: block; font-size: 12px; color: var(--muted); }
.docs-search-results .empty { padding: 8px 10px; font-size: 13.5px; color: var(--muted); }

/* Article typography */
.doc { max-width: 820px; color: var(--text); font-size: 16px; line-height: 1.7; overflow-wrap: break-word; }
.doc h1 {
  margin-top: 10px;
  font-weight: 600;
  font-size: clamp(32px, 3.4vw, 42px);
  line-height: 1.14;
  color: var(--green);
}
.doc h2 { margin-top: 48px; font-weight: 600; font-size: 28px; line-height: 1.25; color: var(--green); }
.doc h3 { margin-top: 32px; font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--green); }
.doc h4 { margin-top: 24px; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 16px; color: var(--ink); }
.doc h5, .doc h6 { margin: 20px 0 0; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); }
.doc h2, .doc h3, .doc h4 { scroll-margin-top: 16px; }
.doc p { margin-top: 14px; }
.doc h1 + p { font-size: 18px; }
.doc ul, .doc ol { margin: 14px 0 0; padding-left: 24px; }
.doc li + li { margin-top: 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }
.doc li > p { margin-top: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--green); font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.doc a:hover { color: var(--brown); }
.doc code {
  padding: 1px 5px;
  background: var(--sand);
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--ink);
}
.doc pre {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--green-deep);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--cream);
  overflow-x: auto;
}
.doc pre code { padding: 0; background: none; font-size: inherit; color: inherit; }
.doc blockquote {
  margin: 16px 0 0;
  padding: 4px 18px 14px;
  background: #FFFFFF;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
}
.doc hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.doc img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.doc .table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #FFFFFF; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.doc th, .doc td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { background: var(--sand); font-weight: 600; color: var(--ink); white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }
