/* Botream documentation: the landing page's slate gray, light and plain. */
:root {
  --brand: #42525f;
  --brand-dark: #2c3740;
  --ink: #1f262d;
  --text: #3d4851;
  --muted: #6b747c;
  --line: #e2e6ea;
  --tint: #f6f7f9;
  --soft: #edf0f3;
  --accent: #f59e0b;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #1570ef;
  --code-bg: #f6f8fa;
  --topbar: 60px;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 16px); }
body { margin: 0; font: 15px/1.7 Inter, system-ui, 'Segoe UI', sans-serif; color: var(--text); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration-color: rgba(66, 82, 95, .35); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: .86em; background: var(--soft); border-radius: 5px; padding: .12em .38em; color: var(--ink); }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: var(--topbar); padding: 0 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand-docs { font-weight: 500; color: var(--muted); border-left: 1px solid var(--line); padding-left: 8px; margin-left: 2px; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: 24px; }
.search input { width: 100%; height: 36px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--tint); border: 1px solid var(--line); border-radius: 9px; outline: none; }
.search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(66, 82, 95, .12); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(31, 40, 48, .14); padding: 6px; }
.search-results a { display: block; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--soft); }
.search-results .r-title { font-weight: 600; color: var(--ink); }
.search-results .r-section { color: var(--muted); font-size: 13px; }
.search-results .r-snippet { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.search-results mark { background: #fff3c4; color: inherit; border-radius: 3px; }
.search-results .empty { padding: 10px; color: var(--muted); font-size: 14px; }
.site-link { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.lang-link { color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; }
.lang-link:hover { border-color: var(--brand); }
.version { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 20px; padding: 2px 9px; }
.menu-button { display: none; border: 0; background: none; font-size: 20px; color: var(--ink); cursor: pointer; padding: 4px 6px; }

/* ── Layout ── */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.sidebar { position: sticky; scroll-behavior: auto; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); }
.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 4px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.5; }
.sidebar li.nested a { padding-left: 24px; font-size: 13.5px; color: var(--muted); }
.sidebar li a:hover { background: var(--tint); color: var(--ink); }
.sidebar li a[aria-current='page'] { background: var(--soft); color: var(--brand-dark); font-weight: 600; }

.content { min-width: 0; padding: 34px 48px 40px; }
article { max-width: 820px; }
.toc { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 30px 16px 40px 8px; font-size: 13px; }
.toc-title { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 12.5px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.45; }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }

/* ── Article ── */
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); margin: 0 0 14px; }
h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); margin: 42px 0 12px; padding-top: 6px; }
h3 { font-size: 18px; color: var(--ink); margin: 30px 0 8px; }
h4 { font-size: 15px; color: var(--ink); margin: 24px 0 8px; }
h5 { font-size: 14.5px; color: var(--ink); margin: 18px 0 6px; }
h2, h3, h4, h5 { position: relative; }
.anchor { position: absolute; left: -20px; color: var(--line); text-decoration: none; font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
article > p:first-of-type, .lead { font-size: 17px; color: var(--muted); }
p, ul, ol { margin: 0 0 14px; }
li { margin: 3px 0; }
li > p { margin: 0 0 6px; }
strong { color: var(--ink); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }

pre.code { margin: 0 0 18px; padding: 14px 16px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.65; }
pre.code code { background: none; padding: 0; font-size: inherit; color: var(--ink); white-space: pre; }
.tok-cmd { color: #8b3dbf; font-weight: 600; }
.tok-param { color: #1f6feb; }
.tok-str { color: #0f7b47; }
.tok-var { color: #b45309; font-weight: 500; }

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink); background: var(--tint); }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
table.params td:first-child { white-space: nowrap; }
.req { display: inline-block; font-size: 11px; font-weight: 600; color: #b54708; background: #fffaeb; border: 1px solid #fedf89; border-radius: 10px; padding: 0 6px; margin-left: 4px; }

.callout { margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); border-left-width: 4px; background: var(--tint); }
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--brand); }
.callout.tip { border-left-color: var(--green); background: #f3fbf5; }
.callout.warning, .callout.important { border-left-color: var(--accent); background: #fffbf0; }

/* ── Command reference ── */
.command { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; scroll-margin-top: calc(var(--topbar) + 16px); }
.command h2 { margin-top: 34px; }
.command h2 code { font-size: .95em; background: var(--soft); padding: .1em .45em; }
.command-label { font-weight: 500; color: var(--muted); font-size: .7em; margin-left: 6px; }
.block-note, .muted { color: var(--muted); font-size: 14px; }
.variant { margin: 10px 0 16px; padding-left: 14px; border-left: 2px solid var(--soft); }
.command-list { columns: 1; padding-left: 18px; }
.command-list li { margin: 4px 0; }

/* ── Pager, footer ── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 820px; margin-top: 48px; }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--brand); }
.pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.pager .next { text-align: right; }
.footer { max-width: 820px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ── Smaller screens ── */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: block; }
  .sidebar { position: fixed; top: var(--topbar); left: 0; z-index: 25; width: 290px; max-width: 86vw; background: #fff; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 16px 40px rgba(31, 40, 48, .16); }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 24px 16px 32px; }
  .site-link, .version, .brand-docs { display: none; }
  .lang-link { margin-left: auto; }
  .search { margin-left: 4px; }
  h1 { font-size: 27px; }
  h2 { font-size: 20px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
}
