/* Docubara – public documentation theme */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/inter.woff2') format('woff2-variations');
}

:root {
  --brand: #3f3f46;
  --font-body: 'Inter Variable', Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  /* plain neutral grays - the project colour is the only accent */
  --bg: #ffffff;
  --bg-soft: #f8f8f8;
  --bg-muted: #f1f1f2;
  --text: #1c1c1e;
  --text-soft: #48484c;
  --text-muted: #626268;
  --border: #e4e4e6;
  --border-strong: #d1d1d4;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --brand-text: color-mix(in srgb, var(--brand) 85%, black);
  --code-bg: #f7f7f8;
  --code-text: #27272a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px -12px rgba(0, 0, 0, .16);
  --header-h: 60px;
  --sidebar-w: 272px;
  --toc-w: 220px;
  --content-w: 760px;
  --radius: 10px;
  --radius-sm: 6px;
  color-scheme: light;
}
[data-theme='dark'] {
  /* OLED: true black */
  --bg: #000000;
  --bg-soft: #0a0a0b;
  --bg-muted: #161618;
  --text: #f0f0f2;
  --text-soft: #c4c4c8;
  --text-muted: #919196;
  --border: #222225;
  --border-strong: #333337;
  --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-text: color-mix(in srgb, var(--brand) 55%, white);
  --code-bg: #0d0d0e;
  --code-text: #e4e4e7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
html[data-layout='wide'] { --content-w: 940px; }
html[data-layout='compact'] { --content-w: 680px; --sidebar-w: 240px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); scroll-behavior: smooth; }
:root { --ease: cubic-bezier(.25, 1, .5, 1); --ease-in: cubic-bezier(.5, 0, .75, 0); --spring: cubic-bezier(.34, 1.3, .64, 1); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand-text); }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; text-decoration: none; }
.skip-link:focus { top: 12px; }
.mobile-only { display: none !important; }

/* ---------------------------------------------------------------- header */
.preview-bar { background: #fff7e0; color: #7a5300; text-align: center; font-size: 13px; padding: 6px 12px; border-bottom: 1px solid #f1dfa6; }
[data-theme='dark'] .preview-bar { background: #2b2412; color: #f3d48a; border-color: #4a3d17; }
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 650; letter-spacing: -.01em; min-width: 0; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; border-radius: var(--radius-sm); }
.brand-mark { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-select { position: relative; }
.version-select select {
  appearance: none; background: var(--bg-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737378' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 26px 3px 10px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--text-soft); cursor: pointer;
}
/* header links: plain text, a soft fill on hover – same as the footer and the website nav */
.header-links { display: flex; gap: 2px; margin-left: 4px; }
.header-links a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--text-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.header-links a:hover, .header-links a:focus-visible { color: var(--text); background: var(--bg-muted); outline: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; min-width: 220px;
  border: 1px solid var(--border); background: var(--bg-soft); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); font-size: 14px;
  transition: border-color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger .search-label { flex: 1; text-align: left; }
.search-trigger.full { width: 100%; min-width: 0; margin-bottom: 16px; }
.kbd { font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-bottom-width: 2px; background: var(--bg); border-radius: 4px; padding: 1px 5px; line-height: 1.4; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-soft); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }
.ti { display: none; }
html[data-theme-pref='light'] .ti-light, html[data-theme-pref='dark'] .ti-dark, html[data-theme-pref='system'] .ti-system { display: inline-grid; }
html:not([data-theme-pref]) .ti-system { display: inline-grid; }

/* ---------------------------------------------------------------- layout */
.layout { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); gap: 0; min-height: calc(100vh - var(--header-h) - 80px); }
.layout.no-nav { grid-template-columns: minmax(0, 1fr) var(--toc-w); }
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); border-right: 1px solid var(--border); }
html[data-sidebar='filled'] .sidebar { background: color-mix(in srgb, var(--bg-muted) 75%, var(--bg)); border-right-color: color-mix(in srgb, var(--text) 8%, transparent); }
.sidebar-scroll { height: 100%; overflow-y: auto; padding: 24px 16px 40px 20px; overscroll-behavior: contain; }
.sidebar-version { display: none; margin-bottom: 16px; }
.sidebar-links { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.sidebar-links a { padding: 5px 11px; border-radius: var(--radius-sm); background: var(--bg-muted); color: var(--text-soft); font-size: 13px; font-weight: 550; text-decoration: none; }
.sidebar-version select { width: 100%; padding: 8px 30px 8px 12px; border-radius: var(--radius-sm); font-size: 14px; }

/* custom dropdown (progressively replaces a native <select data-dd>) */
.dd-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; font: inherit; font-size: 12.5px; font-weight: 550;
  color: var(--text-soft); background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.dd-trigger:hover, .dd-trigger[aria-expanded='true'] { border-color: var(--border-strong); color: var(--text); }
.dd-trigger:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.dd-trigger .dd-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-trigger svg { flex-shrink: 0; color: var(--text-muted); transition: transform .2s var(--ease); }
.dd-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }
.dd-list {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: 280px; max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transform-origin: top left; animation: dd-in .22s var(--ease) both; outline: none;
}
.dd-list.closing { animation: dd-out .16s var(--ease-in) both; pointer-events: none; }
.dd-list { top: calc(100% + 9px); }
.dd-arrow {
  display: none; position: absolute; z-index: 61; top: calc(100% + 4px); left: 14px; width: 10px; height: 10px; transform: rotate(45deg);
  background: var(--bg-soft); border-left: 1px solid var(--border); border-top: 1px solid var(--border); animation: fade-in .22s var(--ease) both;
}
.dd-trigger[aria-expanded='true'] + .dd-arrow, [data-theme-toggle][aria-expanded='true'] + .dd-arrow { display: block; }
/* theme picker: light / dark / auto */
.theme-menu { position: relative; display: inline-flex; }
.theme-menu .dd-arrow { left: auto; right: 13px; }
.theme-menu .dd-list { left: auto; right: 0; min-width: 148px; transform-origin: top right; }
.theme-menu .dd-list li { gap: 9px; }
.theme-menu .dd-list li .dd-check { margin-left: auto; }
.theme-menu .dd-icon { display: inline-grid; place-items: center; color: var(--text-muted); }
.theme-menu .dd-icon svg { width: 15px; height: 15px; }
.theme-menu li.active .dd-icon, .theme-menu li[aria-selected='true'] .dd-icon { color: var(--brand); }
[data-theme-toggle][aria-expanded='true'] { background: var(--bg-muted); color: var(--text); }
.dd-list[hidden] { display: none; }
.dd-list li {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.4;
  color: var(--text-soft); cursor: pointer; user-select: none; transition: background-color .1s, color .1s;
}
.dd-list li .dd-check { flex-shrink: 0; color: var(--brand); opacity: 0; }
.dd-list li[aria-selected='true'] { color: var(--brand-text); font-weight: 550; }
.dd-list li[aria-selected='true'] .dd-check { opacity: 1; }
.dd-list li.active { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand-text); }
.dd-list li .dd-meta { margin-left: auto; padding-left: 14px; font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.sidebar-version .dd-trigger { width: 100%; height: 38px; font-size: 14px; padding: 0 10px 0 12px; }
.sidebar-version .dd-list { right: 0; max-width: none; width: auto; }
.sidebar-version .dd-list li { padding: 9px 10px 9px 8px; font-size: 14.5px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dd-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-3px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dd-list, .dd-list.closing { animation: none; } }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 1px 0; }
.nav-sub { padding-left: 12px; margin-left: 8px !important; border-left: 1px solid var(--border); }
.nav-group { margin-top: 6px !important; }
.nav-group > details > summary { list-style: none; }
.nav-group > details > summary::-webkit-details-marker { display: none; }
/* section labels: quiet, like the admin sidebar */
.nav-cat {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--text-muted);
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav-cat:hover { color: var(--text); }
.nav-cat-sub { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 560; color: var(--text-soft); }
.nav-cat-sub:hover { background: color-mix(in srgb, var(--bg-muted) 80%, transparent); }
.nav-group + .nav-group { margin-top: 14px !important; }
.nav-cat .chev { transition: transform .25s var(--ease); color: var(--text-muted); flex-shrink: 0; }
details[open] > .nav-cat .chev { transform: rotate(90deg); }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--radius-sm); color: var(--text-soft); text-decoration: none; font-size: 14px; line-height: 1.45; transition: background-color .18s var(--ease), color .18s var(--ease); }
.nav-item:hover { background: var(--bg-muted); color: var(--text); }
/* active page: a light tint of the accent, slightly deeper on hover */
.nav-item.active { background: color-mix(in srgb, var(--brand) 13%, transparent); color: var(--brand-text); font-weight: 550; }
.nav-item.active:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.nav-item.active svg { color: var(--brand); }
.nav-item:not(.active):hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav-item svg { color: var(--text-muted); flex-shrink: 0; }
.nav-method { font-size: 9.5px; font-weight: 750; letter-spacing: .03em; padding: 1px 4px; border-radius: 4px; min-width: 34px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: 12px 8px !important; position: relative; }
.nav-divider span { position: absolute; top: -9px; left: 0; background: var(--bg); padding-right: 8px; font-size: 11.5px; color: var(--text-muted); font-weight: 650; }
html[data-sidebar='filled'] .nav-divider span { background: color-mix(in srgb, var(--bg-muted) 75%, var(--bg)); }

.main { min-width: 0; padding: 40px 48px 64px; outline: none; }
.doc { max-width: var(--content-w); margin: 0 auto; }
/* breadcrumbs: same soft hover fill as the nav; the text stays aligned with the title */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 14px -7px; padding: 0; font-size: 13px; color: var(--text-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 2px; }
.breadcrumbs li + li::before { content: '/'; margin: 0 2px; color: var(--border-strong); }
.breadcrumbs li > a, .breadcrumbs li > span { display: inline-flex; align-items: center; height: 26px; padding: 0 7px; border-radius: var(--radius-sm); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color .15s var(--ease), background-color .15s var(--ease); }
.breadcrumbs a:hover, .breadcrumbs a:focus-visible { color: var(--text); background: var(--bg-muted); outline: none; }
.breadcrumbs [aria-current='page'] > span { color: var(--text-soft); font-weight: 500; }
.doc-title { font-size: 2.25rem; line-height: 1.2; letter-spacing: -.025em; font-weight: 720; margin: 0 0 12px; }
.doc-lead { font-size: 1.125rem; color: var(--text-soft); margin: 0 0 28px; }
.doc-header { margin-bottom: 8px; }

/* ----------------------------------------------------------------- prose */
.prose { font-size: 16px; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; letter-spacing: -.015em; line-height: 1.3; font-weight: 680; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h1 { font-size: 1.9rem; margin: 2.2em 0 .6em; }
.prose h2 { font-size: 1.5rem; margin: 2.2em 0 .7em; padding-top: .2em; }
.prose h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
.prose h5, .prose h6 { font-size: .95rem; margin: 1.4em 0 .4em; }
.heading-anchor { margin-left: 8px; color: var(--text-muted); opacity: 0; text-decoration: none; font-weight: 400; transition: opacity .15s; }
.prose :is(h1, h2, h3, h4, h5, h6):hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--brand-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li > p { margin: 0; }
.prose ul[data-type='taskList'] { list-style: none; padding-left: .2em; }
.prose ul[data-type='taskList'] li { display: flex; gap: 10px; align-items: flex-start; }
.prose ul[data-type='taskList'] label { margin-top: 3px; }
.prose ul[data-type='taskList'] input { accent-color: var(--brand); width: 15px; height: 15px; }
.prose ul[data-type='taskList'] li[data-checked='true'] > div { color: var(--text-muted); text-decoration: line-through; }
.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--border-strong); color: var(--text-soft); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: .6em 0; }

/* embeds: videos, Figma, Miro, draw.io, Google Docs … */
.prose figure { margin: 1.6em 0; }
.prose figcaption { margin-top: .6em; text-align: center; font-size: 13.5px; color: var(--text-muted); }
.prose .embed .embed-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-muted); }
.prose .embed-figma .embed-frame, .prose .embed-drawio .embed-frame, .prose .embed-miro .embed-frame, .prose .embed-google .embed-frame,
.prose .embed-excalidraw .embed-frame, .prose .embed-codepen .embed-frame, .prose .embed-canva .embed-frame { aspect-ratio: 4 / 3; }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .embed video { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: #000; }
.prose .diagram { display: flex; flex-direction: column; align-items: center; }
.prose .diagram img { margin: 0; padding: 16px; max-width: 100%; background: #fff; }

/* hover tooltips */
.prose .has-tip { cursor: help; border-bottom: 1.5px dotted color-mix(in srgb, var(--brand) 70%, transparent); background: color-mix(in srgb, var(--brand) 6%, transparent); border-radius: 2px; transition: background-color .15s var(--ease); }
.prose .has-tip:hover, .prose .has-tip:focus-visible, .prose .has-tip.tip-open { background: color-mix(in srgb, var(--brand) 13%, transparent); outline: none; }
.tip-pop {
  position: fixed; z-index: 90; max-width: min(340px, calc(100vw - 24px)); padding: 11px 14px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text-soft); font-size: 13.5px; line-height: 1.55;
  animation: tip-in .2s var(--ease) both;
}
.tip-pop.closing { animation: tip-out .14s var(--ease-in) both; pointer-events: none; }
.tip-pop::before {
  content: ''; position: absolute; left: var(--ax, 50%); width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--bg-soft);
}
.tip-pop[data-side='top']::before { bottom: -6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tip-pop[data-side='bottom']::before { top: -6px; border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.tip-pop .tip-title { margin: 0 0 4px; font-weight: 650; color: var(--text); font-size: 13.5px; }
.tip-pop p { margin: 0; }
.tip-pop p + p, .tip-pop ul + p, .tip-pop p + ul { margin-top: 6px; }
.tip-pop ul { margin: 0; padding-left: 18px; }
.tip-pop code { font-family: var(--font-mono); font-size: 12px; padding: 1px 4px; border-radius: 4px; background: var(--bg-muted); }
.tip-pop a { color: var(--brand-text); }
@keyframes tip-in { from { opacity: 0; transform: translateY(var(--ty, 4px)); } to { opacity: 1; transform: none; } }
@keyframes tip-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tip-pop, .tip-pop.closing { animation: none; } }
.prose mark { background: color-mix(in srgb, #ffd43b 45%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.prose kbd { font-family: var(--font-body); font-size: .8em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; background: var(--bg-soft); }
.prose :not(pre) > code { font-family: var(--font-mono); font-size: .86em; background: var(--bg-muted); border: 1px solid var(--border); padding: .12em .38em; border-radius: var(--radius-sm); color: var(--text); }
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table, .api-params { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td, .api-params th, .api-params td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th, .api-params th { background: var(--bg-soft); font-weight: 620; font-size: 13.5px; color: var(--text-soft); }
.prose tr:last-child td, .api-params tr:last-child td { border-bottom: 0; }
/* rows react like the nav: a soft fill under the pointer (header row excluded) */
.prose td, .api-params td { transition: background-color .15s var(--ease); }
.prose tr:hover > td, .api-params tr:hover > td { background: var(--bg-muted); }
.prose td > p, .prose th > p { margin: 0; }

/* code */
.prose pre, .code-block pre {
  position: relative; margin: 1.4em 0; padding: 16px 18px; border-radius: var(--radius); background: var(--code-bg); border: 1px solid var(--border);
  overflow-x: auto; font-size: 13.5px; line-height: 1.65; color: var(--code-text); tab-size: 2;
}
.prose pre code, .code-block pre code { font-family: var(--font-mono); background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose pre[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 8px; right: 10px; height: 24px; line-height: 24px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-family: var(--font-body); font-weight: 600;
  transition: opacity .15s var(--ease); pointer-events: none;
}
/* label and copy button share the top-right corner: hovering swaps the label for the button */
.prose pre[data-lang]:hover::before, .prose pre[data-lang]:focus-within::before { opacity: 0; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; height: 24px; padding: 0 9px; display: inline-flex; align-items: center;
  border: 0; border-radius: var(--radius-sm); background: var(--bg-muted); color: var(--text-soft);
  font: 500 12px var(--font-body); cursor: pointer; opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.copy-btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, var(--bg-muted)); }
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.copy-btn.copied { color: #16a34a; opacity: 1; }
/* touch screens have no hover: always show the button instead of the label */
@media (hover: none) { .copy-btn { opacity: 1; } .prose pre[data-lang]::before { opacity: 0; } }
.code-block { position: relative; }
.code-block pre { margin: .6em 0 1.2em; }
.code-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 1em; }

/* highlight.js tokens */
.hljs-comment, .hljs-quote { color: #6a737d; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-meta .hljs-keyword { color: #cf222e; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #0a3069; }
.hljs-number, .hljs-built_in, .hljs-type, .hljs-variable.language_ { color: #0550ae; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #8250df; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-selector-class, .hljs-selector-id { color: #116329; }
.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-template-variable { color: #953800; }
.hljs-deletion { color: #82071e; background: #ffebe9; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
[data-theme='dark'] .hljs-comment, [data-theme='dark'] .hljs-quote { color: #8b949e; }
[data-theme='dark'] .hljs-keyword, [data-theme='dark'] .hljs-selector-tag, [data-theme='dark'] .hljs-literal, [data-theme='dark'] .hljs-doctag { color: #ff7b72; }
[data-theme='dark'] .hljs-string, [data-theme='dark'] .hljs-regexp, [data-theme='dark'] .hljs-addition { color: #a5d6ff; }
[data-theme='dark'] .hljs-number, [data-theme='dark'] .hljs-built_in, [data-theme='dark'] .hljs-type { color: #79c0ff; }
[data-theme='dark'] .hljs-title, [data-theme='dark'] .hljs-title.function_, [data-theme='dark'] .hljs-section { color: #d2a8ff; }
[data-theme='dark'] .hljs-attr, [data-theme='dark'] .hljs-attribute, [data-theme='dark'] .hljs-property, [data-theme='dark'] .hljs-name { color: #7ee787; }
[data-theme='dark'] .hljs-symbol, [data-theme='dark'] .hljs-bullet, [data-theme='dark'] .hljs-link, [data-theme='dark'] .hljs-meta { color: #ffa657; }
[data-theme='dark'] .hljs-deletion { color: #ffdcd7; background: #67060c; }

/* callouts */
.callout { --c: #3b82f6; display: block; margin: 1.4em 0; padding: 14px 16px 14px 46px; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 8%, transparent); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); position: relative; }
.callout::before { content: ''; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; background: var(--c); -webkit-mask: var(--icon) no-repeat center / contain; mask: var(--icon) no-repeat center / contain; }
.callout > :last-child { margin-bottom: 0; }
.callout > :first-child { margin-top: 0; }
.callout-info { --c: #3b82f6; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.callout-tip { --c: #16a34a; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E"); }
.callout-warning { --c: #d97706; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10.3 3.9-8.2 14A2 2 0 0 0 3.8 21h16.4a2 2 0 0 0 1.7-3.1l-8.2-14a2 2 0 0 0-3.4 0ZM12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.callout-danger { --c: #dc2626; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E"); }
.callout-note { --c: var(--brand); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }

/* --------------------------------------------------------------- API docs */
.api-endpoint { margin: 8px 0 32px; }
.api-signature { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); margin-bottom: 16px; overflow-x: auto; }
.api-path { font-family: var(--font-mono); font-size: 14px; font-weight: 550; white-space: nowrap; }
.method { font-size: 12px; font-weight: 750; letter-spacing: .04em; padding: 3px 8px; border-radius: var(--radius-sm); flex-shrink: 0; }
.method-get { background: #dcfce7; color: #166534; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put { background: #fef3c7; color: #92400e; }
.method-patch { background: #ede9fe; color: #5b21b6; }
.method-delete { background: #fee2e2; color: #991b1b; }
.method-head { background: var(--bg-muted); color: var(--text-soft); }
[data-theme='dark'] .method-get { background: #11331f; color: #86efac; }
[data-theme='dark'] .method-post { background: #142a4d; color: #93c5fd; }
[data-theme='dark'] .method-put { background: #3a2a0c; color: #fcd34d; }
[data-theme='dark'] .method-patch { background: #2a1e4d; color: #c4b5fd; }
[data-theme='dark'] .method-delete { background: #3d1414; color: #fca5a5; }
.copy-inline { margin-left: auto; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; cursor: pointer; }
.api-summary { font-size: 1.05rem; color: var(--text-soft); }
.api-h { font-size: 1.05rem; font-weight: 650; margin: 28px 0 10px; }
.ctype { font-size: 12px; font-weight: 500; color: var(--text-muted); font-family: var(--font-mono); margin-left: 6px; }
.api-params code { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.req { font-size: 11px; color: #dc2626; font-weight: 600; margin-left: 4px; }
.type { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.api-response { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 0 14px; }
.api-response summary { cursor: pointer; padding: 10px 0; font-size: 14.5px; }
.status { font-family: var(--font-mono); font-weight: 700; font-size: 13px; padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
.status-2xx { background: #dcfce7; color: #166534; } .status-3xx { background: #e0f2fe; color: #075985; }
.status-4xx { background: #fef3c7; color: #92400e; } .status-5xx { background: #fee2e2; color: #991b1b; }
[data-theme='dark'] .status-2xx { background: #11331f; color: #86efac; } [data-theme='dark'] .status-4xx { background: #3a2a0c; color: #fcd34d; } [data-theme='dark'] .status-5xx { background: #3d1414; color: #fca5a5; } [data-theme='dark'] .status-3xx { background: #0c2a3d; color: #7dd3fc; }
.code-tabs-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.code-tabs-bar button { border: 0; background: none; padding: 8px 12px; font-size: 13.5px; font-weight: 550; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.code-tabs-bar button[aria-selected='true'] { color: var(--brand-text); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------- doc footer */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.tag { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft); }
.doc-meta { margin-top: 32px; font-size: 13px; color: var(--text-muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: border-color .15s var(--ease); }

.pager-link:hover { border-color: var(--brand); }
.pager-link.next { text-align: right; align-items: flex-end; grid-column: 2; }
.pager-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.pager-title { font-weight: 600; color: var(--text); }

/* ------------------------------------------------------------------- TOC */
.toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 20px 40px 8px; font-size: 13.5px; }
.toc-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
/* combination: the guide line + accent stripe, plus the nav's soft hover fill */
.toc li a { display: block; padding: 5px 10px 5px 14px; margin-left: -1px; border-left: 2px solid transparent; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted); text-decoration: none; line-height: 1.45; transition: color .15s var(--ease), border-color .2s var(--ease), background-color .15s var(--ease); }
.toc li.toc-l3 a { padding-left: 26px; }
.toc li.toc-l4 a { padding-left: 38px; }
.toc li a:hover, .toc li a:focus-visible { color: var(--text); background: var(--bg-muted); outline: none; }
.toc li a.active { color: var(--brand-text); border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); font-weight: 550; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-muted); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-right: -12px; }
/* footer links behave like the website nav: plain text, a soft fill on hover */
.footer-links a {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.footer-links a:hover, .footer-links a:focus-visible { color: var(--text); background: var(--bg-muted); outline: none; }
.powered strong { color: var(--text-soft); font-weight: 600; }
.footer-links a.powered { font-size: 12px; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-links { margin: 0 0 0 -12px; }
}
/* the Docubara wordmark as a mask, so it takes the footer's text colour (light and dark) */
.powered-logo {
  display: inline-block; height: 13px; width: calc(13px * 775 / 160); background: var(--text-soft);
  -webkit-mask: var(--logo) left center / contain no-repeat; mask: var(--logo) left center / contain no-repeat;
  transition: background-color .15s var(--ease);
}
.powered:hover .powered-logo { background: var(--text); }

/* ---------------------------------------------------------------- search */
.search-modal { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-modal .search-backdrop { animation: fade-in .35s var(--ease) both; }
.search-modal .search-dialog { animation: pop-in .42s var(--ease) both; }
.search-modal.is-closing .search-backdrop { animation: fade-out .26s var(--ease-in) both; }
.search-modal.is-closing .search-dialog { animation: pop-out .26s var(--ease-in) both; }
.search-results li a { transition: background-color .15s var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.doc { animation: rise .6s var(--ease) both; }
.search-results li { animation: fade-in .3s var(--ease) both; }
.search-results li:nth-child(2) { animation-delay: .03s; } .search-results li:nth-child(3) { animation-delay: .06s; } .search-results li:nth-child(n+4) { animation-delay: .09s; }
.toc { animation: fade-in .7s var(--ease) .15s both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); }
.search-backdrop { position: absolute; inset: 0; background: rgba(15, 17, 21, .45); backdrop-filter: blur(2px); }
.search-dialog { position: relative; width: 100%; max-width: 640px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 64px -12px rgba(0, 0, 0, .35); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-input-wrap input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search-input-wrap input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results li a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.search-results li[aria-selected='true'] a, .search-results li a:hover { background: var(--brand-soft); }
.sr-title { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.sr-section { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.sr-snippet { font-size: 13px; color: var(--text-soft); margin-top: 2px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-footer { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); background: var(--bg-soft); }
.search-footer .kbd { margin-right: 3px; }

/* ----------------------------------------------------------------- misc */
.empty-state { max-width: 460px; margin: 10vh auto; text-align: center; }
.empty-state svg { color: var(--text-muted); width: 40px; height: 40px; }
.empty-state h1 { font-size: 1.6rem; letter-spacing: -.02em; margin: 12px 0 8px; }
.empty-state p { color: var(--text-muted); }
.big-code { font-size: 4rem; font-weight: 800; letter-spacing: -.04em; color: var(--brand); margin: 0; line-height: 1; }

/* 404 */
.not-found { max-width: 520px; margin: 8vh 0 4vh; animation: rise .6s var(--ease) both; }
.nf-code { display: inline-block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--text-muted); padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.not-found h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.025em; margin: 16px 0 8px; }
.not-found > p { color: var(--text-muted); margin: 0; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.nf-actions .btn { height: 38px; font-size: 14px; padding: 0 16px; }
.nf-actions .btn svg { width: 15px; height: 15px; }
.btn.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn.btn-secondary:hover, .btn.btn-secondary:active { background: var(--bg-muted); }
.nf-label { margin: 40px 0 8px !important; font-size: 12.5px; font-weight: 600; color: var(--text-muted) !important; }
.nf-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.nf-list li + li { border-top: 1px solid var(--border); }
.nf-list a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; color: var(--text); transition: background-color .15s var(--ease); }
.nf-list a:hover { background: var(--bg-soft); }
.nf-title { font-size: 14.5px; font-weight: 550; }
.nf-trail { font-size: 12.5px; color: var(--text-muted); }
.nf-list a svg { margin-left: auto; flex-shrink: 0; color: var(--text-muted); width: 15px; height: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--radius-sm); border: 0; background: var(--brand); color: #fff; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; }
.btn { transition: background-color .15s var(--ease); }
.btn:hover { background: color-mix(in srgb, var(--brand) 72%, black); }
.btn:active { background: color-mix(in srgb, var(--brand) 60%, black); }
.gate-body { display: grid; place-items: center; min-height: 100vh; background: var(--bg-soft); }
.gate { width: 100%; padding: 16px; }
.gate-card { max-width: 400px; margin: 0 auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 32px; box-shadow: var(--shadow); text-align: center; }
.gate-card svg { color: var(--brand); }
.gate-card h1 { font-size: 1.35rem; margin: 12px 0 4px; letter-spacing: -.01em; }
.gate-form { display: grid; gap: 12px; margin-top: 20px; }
.gate-form input { height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 14px; font: inherit; background: var(--bg); color: var(--text); }
.gate-form input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.gate-error { color: #dc2626; font-size: 13.5px; margin: 0; }
.sidebar-backdrop { display: none; }

/* embed mode */
html[data-embed='true'] .site-header { position: sticky; }
html[data-embed='true'] .layout { min-height: 0; }
html[data-embed='true'] .sidebar, html[data-embed='true'] .toc { height: auto; max-height: calc(100vh - var(--header-h)); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .layout.no-nav { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .mobile-only { display: inline-grid !important; }
  .layout, .layout.no-nav { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .sidebar { transition: transform .32s var(--ease) !important; }
  body.nav-open .sidebar-backdrop { animation: fade-in .25s var(--ease) both; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 17, 21, .4); }
  .main { padding: 28px 20px 48px; }
  .header-links { display: none; }
  .sidebar-links { display: flex; }
  .search-trigger { min-width: 0; padding: 0 10px; }
  .search-trigger .search-label, .search-trigger .kbd { display: none; }
  .doc-title { font-size: 1.85rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: 1; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 12px; gap: 8px; }
  .version-select { display: none; }
  .version-select.sidebar-version { display: block; }
  .main { padding: 22px 16px 40px; }
  .doc-title { font-size: 1.6rem; }
  .doc-lead { font-size: 1.02rem; }
  .prose pre, .code-block pre { margin-left: -4px; margin-right: -4px; border-radius: var(--radius); font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .sidebar, .toc, .site-footer, .pager, .copy-btn { display: none !important; } .layout { display: block; } }

/* client-side navigation progress bar */
.nav-progress { position: fixed; top: 0; left: 0; z-index: 200; height: 2px; width: 100%; background: var(--brand); transform-origin: left; transform: scaleX(0); opacity: 0; pointer-events: none; }
.nav-progress.is-loading { opacity: 1; transform: scaleX(.7); transition: transform 2.5s cubic-bezier(.08, .8, .2, 1), opacity .1s; }
.nav-progress.is-done { opacity: 0; transform: scaleX(1); transition: transform .2s var(--ease), opacity .3s ease .15s; }

/* ------------------------------------------------------------------ custom scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  min-height: 40px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }
.sidebar-scroll::-webkit-scrollbar, .toc::-webkit-scrollbar, .search-results::-webkit-scrollbar, .dd-list::-webkit-scrollbar { width: 10px; }
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
}

/* ------------------------------------------------------------------ back to top */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 45; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--text-soft); cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .15s, color .15s;
}
.to-top.visible { opacity: 1; transform: translateY(var(--lift, 0px)); pointer-events: auto; }
.to-top:hover { color: var(--text); }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.to-top-ring rect { fill: none; stroke-width: 2; }
.to-top-ring .track { stroke: var(--border); }
.to-top-ring .bar { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.to-top:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
@media (max-width: 640px) { .to-top { right: 16px; bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }


/* ---- custom cursor, only inside the live preview on docubara.com (html[data-preview]) */
html[data-preview] { --cur: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'><path d='M5 3.5v15.2c0 .5.6.8 1 .4l3.6-3.4 2.4 5.4c.2.4.6.5 1 .4l1.8-.8c.4-.2.5-.6.4-1l-2.4-5.3 4.9-.3c.5 0 .8-.7.4-1L6 3.1c-.4-.3-1 0-1 .4z' fill='%2318181b' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/></svg>") 5 3, default; --cur-link: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'><path d='M5 3.5v15.2c0 .5.6.8 1 .4l3.6-3.4 2.4 5.4c.2.4.6.5 1 .4l1.8-.8c.4-.2.5-.6.4-1l-2.4-5.3 4.9-.3c.5 0 .8-.7.4-1L6 3.1c-.4-.3-1 0-1 .4z' fill='%2318181b' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/><circle cx='19.5' cy='5.5' r='3.2' fill='%2318181b' stroke='%23ffffff' stroke-width='1.5'/></svg>") 5 3, pointer; }
html[data-preview][data-theme="dark"] { --cur: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'><path d='M5 3.5v15.2c0 .5.6.8 1 .4l3.6-3.4 2.4 5.4c.2.4.6.5 1 .4l1.8-.8c.4-.2.5-.6.4-1l-2.4-5.3 4.9-.3c.5 0 .8-.7.4-1L6 3.1c-.4-.3-1 0-1 .4z' fill='%23fafafa' stroke='%23000000' stroke-width='1.5' stroke-linejoin='round'/></svg>") 5 3, default; --cur-link: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'><path d='M5 3.5v15.2c0 .5.6.8 1 .4l3.6-3.4 2.4 5.4c.2.4.6.5 1 .4l1.8-.8c.4-.2.5-.6.4-1l-2.4-5.3 4.9-.3c.5 0 .8-.7.4-1L6 3.1c-.4-.3-1 0-1 .4z' fill='%23fafafa' stroke='%23000000' stroke-width='1.5' stroke-linejoin='round'/><circle cx='19.5' cy='5.5' r='3.2' fill='%23fafafa' stroke='%23000000' stroke-width='1.5'/></svg>") 5 3, pointer; }
html[data-preview], html[data-preview] body { cursor: var(--cur); }
html[data-preview] :is(a, button, summary, label, select, [role="button"], [role="menuitem"], [role="option"], [tabindex]:not([tabindex="-1"])) { cursor: var(--cur-link); }
html[data-preview] :is(input:not([type="checkbox"]):not([type="radio"]), textarea, [contenteditable="true"]) { cursor: text; }
html[data-preview] :is(pre, code, p, li, td, th, h1, h2, h3, h4) { cursor: var(--cur); }
html[data-preview] :is(a, button) * { cursor: inherit; }

/* back arrow to the Docubara website (only on Docubara's own docs); not inside the home page live preview */
.back-link { margin-right: -2px; flex-shrink: 0; }
.back-link svg { width: 18px; height: 18px; }
html[data-preview] .back-link { display: none; }
