/* H1 — page title: Literata italic, large, no border */
.doc-content h1 {
  font-family: 'Literata', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-heading);
  margin: 0 0 1.25rem;
}

/* H2 — section headings: Space Mono, clean, with subtle rule */
.doc-content h2 {
  font-family: 'Space Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--color-heading-secondary);
  margin: 3rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-border);
}

.doc-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 2.5rem;
}

/* H3 — subsections: Literata bold, no monospace */
.doc-content h3 {
  font-family: 'Literata', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-heading-secondary);
  margin: 2.25rem 0 0.65rem;
  line-height: 1.35;
}

/* H4–H6 */
.doc-content h4 {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text-level1);
  margin: 1.75rem 0 0.5rem;
  line-height: 1.4;
}

.doc-content h5,
.doc-content h6 {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-level2);
  margin: 1.25rem 0 0.5rem;
  line-height: 1.4;
}

/* Body text */
.doc-content p {
  margin: 0 0 1.15rem;
  color: var(--color-text);
}

.doc-content p:last-child {
  margin-bottom: 0;
}

/* Emphasis */
.doc-content strong {
  font-weight: 700;
  color: var(--color-text-strong);
}

.doc-content em {
  font-style: italic;
}

/* Links — subtle underline, color shift on hover */
.doc-content a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-decoration-color: var(--color-text-link-underline);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.12s ease;
}

.doc-content a:hover {
  text-decoration-color: var(--color-text-link-hover);
}

/* Lists */
.doc-content ul,
.doc-content ol {
  margin: 0 0 1.15rem;
  padding-left: 1.5rem;
}

.doc-content li {
  margin: 0.25rem 0;
  padding-left: 0.125rem;
}

.doc-content li > ul,
.doc-content li > ol {
  margin: 0.15rem 0 0.15rem 0.5rem;
}

/* Blockquote */
.doc-content blockquote {
  margin: 1.5rem 0;
  padding: 0.7rem 1.25rem;
  border-left: 2px solid var(--bg-blockquote-border);
  background: var(--bg-blockquote);
  color: var(--color-text-quote);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  border-radius: 0;
}

/* Horizontal rule */
.doc-content hr {
  border: none;
  border-top: 1px solid var(--bg-border);
  margin: 2.5rem 0;
}

/* Tables — refined, neutral */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 14px;
}

.doc-content th {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-table-header);
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--bg-table-header-border);
  background: var(--bg-table-header);
}

.doc-content td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--bg-border);
  vertical-align: top;
  color: var(--color-text-table-cell);
}

.doc-content td a {
  color: var(--color-text-link);
}

.doc-content tr:hover td {
  background: var(--bg-table-row-hover);
}

/* Images */
.doc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

/* ── Code blocks (no language specified) ────────────────────────── */
.doc-content pre {
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0;
  overflow: auto;
  border-radius: 5px;
  border: 1px solid var(--border-code);
  background: var(--bg-code-block);
  font-family: 'Space Mono', "Consolas", "Monaco", monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 4;
  color: var(--color-text);
}

.doc-content pre code {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  font-size: inherit;
  color: inherit;
}

/* Inline code (no language specified) */
.doc-content :not(pre) > code {
  padding: 0.15em 0.4em;
  border-radius: 3px;
  background: var(--bg-code-inline);
  border: 1px solid var(--border-code-inline);
  font-family: 'Space Mono', "Consolas", "Monaco", monospace;
  font-size: 0.87em;
  color: var(--color-text);
}

/* ── Header Logos ────────────────────────── */

.doc-header-logos{
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.doc-header-logos > a{
  display: block;
}

.doc-header-logo{
  height: 22px;
  width: 22px;
  opacity: 0.8;
  display: block;
}

.doc-header-logo:hover{
  opacity: 0.5;
}

:root[data-theme="light"] .doc-header-logo {
    filter: invert(0);
}

:root[data-theme="dark"] .doc-header-logo {
    filter: invert(100%);
}

/* ── Theme toggle button ──────────────────────────────────────── */
.doc-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-theme-toggle button {
  background: var(--color-text);
  height: 22px;
  width: 22px;
  border-radius: 100%;
  border: none;
  opacity: 0.9;
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.doc-theme-toggle button:hover{
  opacity: 0.5;
}

.doc-theme-toggle .icon-sun,
.doc-theme-toggle .icon-moon {
  display: none;
  width: 16px;
  height: 16px;
}

:root[data-theme="light"] .doc-theme-toggle .icon-moon {
  display: inline;
  filter: invert(100%);
}

:root[data-theme="dark"] .doc-theme-toggle .icon-sun {
  display: inline;
}


/* ── Theme variables ──────────────────────────────────────────── */
:root,
:root[data-theme="light"] {
  --bg-body: #ffffff;
  --bg-sidebar: #fafaf9;
  --bg-sidebar-hover: #f5f4f2;
  --bg-sidebar-active: #efeeeb;
  --bg-sidebar-active-level2: #eae9e6;
  --bg-border: #e8e8e6;
  --bg-code-block: #f7f6f3;
  --bg-code-inline: #f0efec;
  --bg-code-selection: #e5e5e0;
  --bg-blockquote: #fafaf9;
  --bg-blockquote-border: #ddd;
  --bg-table-header: #f9f9f8;
  --bg-table-header-border: #ddd;
  --bg-table-row-hover: #fafaf9;
  --bg-scrollbar-thumb: #ccc;
  --bg-scrollbar-thumb-hover: #aaa;
  --bg-divider: #e8e8e6;

  --color-body: #1a1a1a;
  --color-text: #1f1f1a;
  --color-heading: #111;
  --color-heading-secondary: #1a1a1a;
  --color-text-level1: #444;
  --color-text-level1-hover: #111;
  --color-text-level1-active: #111;
  --color-text-level2: #666;
  --color-text-level2-hover: #222;
  --color-text-level2-active: #111;
  --color-text-level3: #888;
  --color-text-level3-hover: #333;
  --color-text-level3-active: #222;
  --color-text-toc: #888;
  --color-text-toc-hover: #444;
  --color-text-toc-active: #111;
  --color-text-toc-accent: #111;
  --color-text-toc-title: #bbb;
  --color-text-toc-level2: #999;
  --color-text-toc-level2-hover: #555;
  --color-text-link: #1a1a1a;
  --color-text-link-underline: #ccc;
  --color-text-link-hover: #555;
  --color-text-strong: #111;
  --color-text-quote: #555;
  --color-text-prevnext: #555;
  --color-text-prevnext-hover: #111;
  --color-text-prevnext-label: #aaa;
  --color-text-table-header: #666;
  --color-text-table-cell: #2a2a2a;
  --color-text-brand: #111;
  --color-text-brand-version: #aaa;

  --border-code: #e2e2df;
  --border-code-inline: #e8e7e4;

  --height-header: 60px;
  --width-sidebar: 248px;
}

:root[data-theme="dark"] {
  --bg-body: #1f1f1f;
  --bg-sidebar: #1e1e1e;
  --bg-sidebar-hover: #2a2a2a;
  --bg-sidebar-active: #262626;
  --bg-sidebar-active-level2: #262626;
  --bg-border: #2e2e2e;
  --bg-code-block: #252525;
  --bg-code-inline: #2a2a2a;
  --bg-code-selection: #3a3a3a;
  --bg-blockquote: #1e1e1e;
  --bg-blockquote-border: #333;
  --bg-table-header: #252525;
  --bg-table-header-border: #333;
  --bg-table-row-hover: #252525;
  --bg-scrollbar-thumb: #444;
  --bg-scrollbar-thumb-hover: #555;
  --bg-divider: #2e2e2e;

  --color-body: #d4d4d4;
  --color-text: #d1d1d1;
  --color-heading: #e8e8e8;
  --color-heading-secondary: #d4d4d4;
  --color-text-level1: #aaa;
  --color-text-level1-hover: #e8e8e8;
  --color-text-level1-active: #e8e8e8;
  --color-text-level2: #999;
  --color-text-level2-hover: #ccc;
  --color-text-level2-active: #e8e8e8;
  --color-text-level3: #777;
  --color-text-level3-hover: #aaa;
  --color-text-level3-active: #ccc;
  --color-text-toc: #999;
  --color-text-toc-hover: #999;
  --color-text-toc-active: #e8e8e8;
  --color-text-toc-accent: #e8e8e8;
  --color-text-toc-title: #666;
  --color-text-toc-level2: #555;
  --color-text-toc-level2-hover: #888;
  --color-text-link: #d4d4d4;
  --color-text-link-underline: #444;
  --color-text-link-hover: #e8e8e8;
  --color-text-strong: #e8e8e8;
  --color-text-quote: #888;
  --color-text-prevnext: #888;
  --color-text-prevnext-hover: #e8e8e8;
  --color-text-prevnext-label: #666;
  --color-text-table-header: #888;
  --color-text-table-cell: #d4d4d4;
  --color-text-brand: #e8e8e8;
  --color-text-brand-version: #666;

  --border-code: #3a3a3a;
  --border-code-inline: #333;
}

/* ── Header bar ───────────────────────────────────────────────── */
.doc-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--height-header);
  padding: 0 1.25rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--bg-border);
  z-index: 1000;
}

.doc-header-brand {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-brand);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.doc-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.doc-header-brand .version {
  font-size: 10px;
  color: var(--color-text-brand-version);
  font-weight: 400;
  margin-left: 0.35em;
}

.doc-header-search {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 400px;
  margin: 0 auto;
}

.doc-header-search input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 14px;
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  background: var(--bg-body);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.12s ease;
}

.doc-header-search input:focus {
  border-color: var(--color-text-toc);
}

.doc-header-search input::placeholder {
  color: var(--color-text-level3);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1001;
  overflow: hidden;
  display: none;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-results-list li a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 13px;
  color: var(--color-text-level1);
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.search-results-list li a:hover {
  background: var(--bg-sidebar-hover);
}

/* ── Version dropdown ─────────────────────────────────────────── */
#version-select {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  background: var(--bg-body);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

#version-select:hover {
  border-color: var(--color-text-toc);
}

#version-select:focus {
  border-color: var(--color-text-toc);
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-body);
  color: var(--color-body);
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  /* width: 100vw; */
  height: 100vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* ── Scrollbar refinements ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-scrollbar-thumb-hover);
}

/* ── Layout shell ─────────────────────────────────────────────── */
.doc-layout {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--height-header));
  /* width: 100vw; */
  /* overflow: hidden; */
}

.doc-main {
  flex: 1 1;
  overflow-y: scroll;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.doc-sidebar {
  width: var(--width-sidebar);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0 1rem;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scrollbar-width: thin;
  gap: 2rem;
}

/* ── Brand header ─────────────────────────────────────────────── */
.doc-brand {
  padding: 0 1.25rem 1rem;
  margin-bottom: 0.5rem;
}

.doc-brand h1 {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-brand);
  text-decoration: none;
  line-height: 1;
}

.doc-brand .version {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--color-text-brand-version);
  font-weight: 400;
  margin-left: 0.35em;
  vertical-align: baseline;
}

.doc-brand-divider {
  border: none;
  border-top: 1px solid var(--bg-divider);
  margin: 0 1.25rem 0.75rem;
}

/* ── Nav links ────────────────────────────────────────────────── */
.doc-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  /* flex: 1; */
}

.doc-nav li {
  margin: 0;
}

/* ── Level 1: Section page links (top-level) ───────────────────── */
.doc-nav > ul > li {
  margin-top: 1px;
}

.doc-nav > ul > li:first-child {
  margin-top: 0;
}

.doc-nav > ul > li > a {
  display: block;
  padding: 0.3rem 1.25rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-text-level1);
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease;
  border-radius: 4px;
}

.doc-nav > ul > li > a:hover {
  color: var(--color-text-level1-hover);
  background-color: var(--bg-sidebar-hover);
}

/* Level 1 active */
.doc-nav > ul > li > a.active {
  color: var(--color-text-level1-active);
  font-weight: 700;
  background-color: var(--bg-sidebar-active);
}

/* ── Level 2: Nested pages under a section ─────────────────────── */
.doc-nav .doc-children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-nav .doc-children > li {
  margin: 0;
}

.doc-nav .doc-children > li > a {
  display: block;
  padding: 0.2rem 1.25rem 0.2rem 2.125rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-level2);
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease;
  border-radius: 4px;
}

.doc-nav .doc-children > li > a:hover {
  color: var(--color-text-level2-hover);
  background-color: var(--bg-sidebar-hover);
}

/* Level 2 active */
.doc-nav .doc-children > li > a.active {
  color: var(--color-text-level2-active);
  font-weight: 600;
  background-color: var(--bg-sidebar-active-level2);
}

/* ── Level 3: Deeply nested pages ──────────────────────────────── */
.doc-nav .doc-children .doc-children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-nav .doc-children .doc-children > li {
  margin: 0;
}

.doc-nav .doc-children .doc-children > li > a {
  display: block;
  padding: 0.15rem 1.25rem 0.15rem 2.875rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-level3);
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease;
  border-radius: 4px;
}

.doc-nav .doc-children .doc-children > li > a:hover {
  color: var(--color-text-level3-hover);
  background-color: var(--bg-sidebar-hover);
}

/* Level 3 active */
.doc-nav .doc-children .doc-children > li > a.active {
  color: var(--color-text-level3-active);
  font-weight: 500;
  background-color: var(--bg-sidebar-active-level2);
}

/* ── Content wrapper (for layout) ─────────────────────────────── */
.doc-content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  /* overflow-y: scroll; */
}

.doc-content {
  max-width: 780px;
  margin: 0;
  flex: 1 1;
  padding: 2.5rem 2.5rem 2.5rem;
}

/* ── "On this page" fixed TOC sidebar ──────────────────────────── */
.doc-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc( var(--height-header) );
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.doc-toc-title {
  font-family: 'Space Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-toc-title);
  margin: 0 0 0.5rem;
}

.doc-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-toc-list li {
  margin: 0;
}

.doc-toc-link {
  display: block;
  padding: 0.2rem 0 0.2rem 0.625rem;
  font-family: 'Literata', Georgia, serif;
  font-size: 12px;
  color: var(--color-text-toc);
  text-decoration: none;
  line-height: 1.55;
  border-left: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.doc-toc-link:hover {
  color: var(--color-text-toc-hover);
}

/* Active TOC link state — will be enhanced with JS later */
.doc-toc-link.active {
  color: var(--color-text-toc-active);
  border-left-color: var(--color-text-toc-accent);
  font-weight: 700;
}

/* H3 items get extra left indent */
.doc-toc-list .doc-toc-children > li > .doc-toc-link {
  padding-left: 1.375rem;
  font-size: 11.5px;
  color: var(--color-text-toc-level2);
}

.doc-toc-list .doc-toc-children > li > .doc-toc-link:hover {
  color: var(--color-text-toc-level2-hover);
}

/* Anchor headings are invisible but scannable */
.toc-anchor {
  display: inline;
  color: transparent;
  text-decoration: none;
  height: 0;
  margin: 0;
  padding: 0;
  scroll-margin-top: calc(var(--height-header) + 1rem);
}

/* Responsive: hide TOC on smaller screens */
@media (max-width: 1100px) {
  /* .doc-content-wrapper { flex-direction: column; } */
  /* .doc-toc { display: none; width: 0; max-height: 0; overflow: hidden; } */
  .doc-content { padding: 1.5rem 1.5rem 2.5rem; max-width: 520px; }
}

/* ── Prev/Next navigation ─────────────────────────────────────── */
.doc-prevnext {
  display: flex;
  justify-content: space-between;
  padding: 1.75rem 0 0;
  margin-top: 1.75rem;
  border-top: 1px solid var(--bg-border);
  gap: 1rem;
}

.doc-prevnext-link {
  font-family: 'Literata', Georgia, serif;
  font-size: 14px;
  color: var(--color-text-prevnext);
  text-decoration: none;
  transition: color 0.12s ease;
  line-height: 1.5;
  display: inline-block;
  min-width: 0;
  flex: 1;
}

.doc-prevnext-link:hover {
  color: var(--color-text-prevnext-hover);
}

.doc-prevnext-label {
  font-family: 'Space Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-prevnext-label);
  display: block;
  margin-bottom: 0.2rem;
}

.doc-prevnext-prev {
  text-align: left;
}

.doc-prevnext-next {
  text-align: right;
}

/* ── Page actions (view source / edit) ────────────────────────── */
.doc-page-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 0 0;
  margin-top: 0.75rem;
  border-top: 1px solid var(--bg-border);
}

.doc-page-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-prevnext-label);
  text-decoration: none;
  transition: color 0.12s ease;
  letter-spacing: 0.02em;
}

.doc-page-action:hover {
  color: var(--color-text-prevnext-hover);
}

.doc-page-action svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.doc-page-action:hover svg {
  opacity: 1;
}

/* ── Mobile sidebar (below 768px) ─────────────────────────────── */
@media (max-width: 767px) {
  .doc-layout { position: relative; }

  /* Hamburger button — now inside header */
  .doc-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
  }

  .doc-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    margin: 2px 0;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* Hide search on mobile to save space */
  .doc-header-search {
    display: none;
  }

  /* Sidebar hidden off-screen */
  .doc-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 268px;
    max-height: calc(100vh - 60px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
  }

  .doc-sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Backdrop overlay */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .sidebar-backdrop.visible {
    display: block;
  }

  /* Main content takes full width */
  /* .doc-main { flex: none; } */
}

/* ── Sidebar footer wrapper ────────────────────────────────────── */
.doc-footer-wrapper {
  flex-shrink: 0;
}

/* ── Sidebar footer ────────────────────────────────────────────── */
.doc-footer {
  border-top: 1px solid var(--bg-divider);
  padding: 0.75rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.doc-footer a {
  font-family: 'Space Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-prevnext-label);
  text-decoration: none;
  transition: color 0.12s ease;
}

.doc-footer a:hover {
  color: var(--color-text-prevnext-hover);
}

.doc-footer a::before {
  content: "│";
  margin: 0 0.5rem;
  color: var(--bg-border);
  flex-shrink: 0;
}

.doc-footer a:first-child::before {
  display: none;
}

.doc-footer-notice {
  padding: 0 1.25rem 0.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-level3);
  text-align: left;
  line-height: 1.6;
}

.doc-footer-notice a {
  color: var(--color-text-prevnext-label);
  text-decoration: underline;
  text-decoration-color: var(--bg-border);
  text-underline-offset: 2px;
  transition: color 0.12s ease, text-decoration-color 0.12s ease;
}

.doc-footer-notice a:hover {
  color: var(--color-text-prevnext-hover);
  text-decoration-color: var(--color-text-prevnext-label);
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
  .doc-hamburger { display: none; }
  .sidebar-backdrop { display: none !important; }
}

/**
 * Peteos Prism Theme
 * Clean, neutral base with subtle color coding — designed for documentation
 */

code[class*="language-"],
pre[class*="language-"] {
	color: #1a1a1a;
	font-family: 'Space Mono', "Consolas", "Monaco", monospace;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	font-size: 13px;
	line-height: 1.65;
	tab-size: 4;
	hyphens: none;
}

pre > code[class*="language-"] {
	font-size: 12.5px;
}

pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
	background: #e5e5e0;
}

pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
	background: #e5e5e0;
}

/* Code blocks */
pre[class*="language-"] {
	padding: 1.15rem 1.35rem;
	margin: 1.5rem 0;
	overflow: auto;
	border-radius: 5px;
	border: 1px solid #e2e2df;
	background: #f7f6f3;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
	padding: 0.15em 0.4em;
	border-radius: 3px;
	background: #f0efec;
	border: 1px solid #e8e7e4;
	font-size: 0.87em;
}

/* Token colors — neutral, low-contrast palette */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: #aaa;
	font-style: italic;
}

.token.namespace {
	opacity: 0.7;
}

.token.tag {
	color: #6a6;
}

.token.string {
	color: #c41a1a;
}

.token.attr-value {
	color: #c41a1a;
}

.token.punctuation {
	color: #888;
}

.token.operator {
	color: #888;
}

.token.keyword {
	color: #555;
	font-weight: 600;
}

.token.number {
	color: #0b7fc0;
}

.token.boolean {
	color: #0b7fc0;
}

.token.function {
	color: #6a6;
}

.token.class-name {
	color: #6a6;
}

.token.constant {
	color: #0b7fc0;
}

.token.property,
.token.attr-name {
	color: #c41a1a;
}

.token.variable {
	color: #333;
}

.token.parameter {
	color: #996;
}

.token.inserted {
	color: #44aa44;
}

.token.deleted {
	color: #c41a1a;
}

.token.regex {
	color: #888;
}

.token.url {
	color: #0b7fc0;
}

.token.symbol {
	color: #0b7fc0;
}

.token.builtin {
	color: #555;
}

.token.important {
	color: #c41a1a;
	font-weight: 600;
}

.token.important,
.token.bold {
	font-weight: bold;
}

.token.italic {
	font-style: italic;
}

/**
 * Peteos Prism Dark Theme
 * Neutral dark palette matching the dark mode design
 */

:root[data-theme="dark"] code[class*="language-"],
:root[data-theme="dark"] pre[class*="language-"] {
	color: #d4d4d4;
	font-family: 'Space Mono', "Consolas", "Monaco", monospace;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	font-size: 13px;
	line-height: 1.65;
	tab-size: 4;
	hyphens: none;
}

:root[data-theme="dark"] pre > code[class*="language-"] {
	font-size: 12.5px;
}

:root[data-theme="dark"] pre[class*="language-"]::-moz-selection,
:root[data-theme="dark"] pre[class*="language-"] ::-moz-selection,
:root[data-theme="dark"] code[class*="language-"]::-moz-selection,
:root[data-theme="dark"] code[class*="language-"] ::-moz-selection {
	background: #3a3a3a;
}

:root[data-theme="dark"] pre[class*="language-"]::selection,
:root[data-theme="dark"] pre[class*="language-"] ::selection,
:root[data-theme="dark"] code[class*="language-"]::selection,
:root[data-theme="dark"] code[class*="language-"] ::selection {
	background: #3a3a3a;
}

/* Code blocks */
:root[data-theme="dark"] pre[class*="language-"] {
	padding: 1.15rem 1.35rem;
	margin: 1.5rem 0;
	overflow: auto;
	border-radius: 5px;
	border: 1px solid #3a3a3a;
	background: #252525;
}

/* Inline code */
:root[data-theme="dark"] :not(pre) > code[class*="language-"] {
	padding: 0.15em 0.4em;
	border-radius: 3px;
	background: #2a2a2a;
	border: 1px solid #333;
	font-size: 0.87em;
}

/* Token colors — neutral dark palette */
:root[data-theme="dark"] .token.comment,
:root[data-theme="dark"] .token.prolog,
:root[data-theme="dark"] .token.doctype,
:root[data-theme="dark"] .token.cdata {
	color: #666;
	font-style: italic;
}

:root[data-theme="dark"] .token.namespace {
	opacity: 0.7;
}

:root[data-theme="dark"] .token.tag {
	color: #6a9;
}

:root[data-theme="dark"] .token.string {
	color: #e8a076;
}

:root[data-theme="dark"] .token.attr-value {
	color: #e8a076;
}

:root[data-theme="dark"] .token.punctuation {
	color: #666;
}

:root[data-theme="dark"] .token.operator {
	color: #666;
}

:root[data-theme="dark"] .token.keyword {
	color: #7b8c00;
	font-weight: 600;
}

:root[data-theme="dark"] .token.number {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.boolean {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.function {
	color: #6a9;
}

:root[data-theme="dark"] .token.class-name {
	color: #6a9;
}

:root[data-theme="dark"] .token.constant {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.property,
:root[data-theme="dark"] .token.attr-name {
	color: #e8a076;
}

:root[data-theme="dark"] .token.variable {
	color: #999;
}

:root[data-theme="dark"] .token.parameter {
	color: #c4a55a;
}

:root[data-theme="dark"] .token.inserted {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.deleted {
	color: #e8a076;
}

:root[data-theme="dark"] .token.regex {
	color: #666;
}

:root[data-theme="dark"] .token.url {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.symbol {
	color: #4eb9cb;
}

:root[data-theme="dark"] .token.builtin {
	color: #7b8c00;
}

:root[data-theme="dark"] .token.important {
	color: #e8a076;
	font-weight: 600;
}

:root[data-theme="dark"] .token.important,
:root[data-theme="dark"] .token.bold {
	font-weight: bold;
}

:root[data-theme="dark"] .token.italic {
	font-style: italic;
}
