/* PRC Documentation — static site styles.
   Self-hosted Inter, PRC amber accent, light/dark via data-theme on <html>. */

@font-face {
  font-family: "Inter";
  src: url("inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-side: #f6f7f8;
  --bg-raise: #edeef1;
  --ink: #21262d;
  --ink-soft: #59636e;
  --ink-faint: #8b94a0;
  --line: #e5e7eb;
  --acc: #e8820c;
  --acc-text: #dd7300;
  --acc-soft: rgba(232, 130, 12, 0.13);
  --acc-underline: rgba(232, 130, 12, 0.5);
  --code-bg: #f6f7f9;
  --scrim: rgba(16, 18, 22, 0.45);
  --shadow-sm: 0 1px 3px rgba(16, 18, 22, 0.07);
  --shadow-lg: 0 18px 60px rgba(16, 18, 22, 0.22);
  /* code tokens */
  --tok-kw: #cf222e; --tok-str: #0a3069; --tok-num: #0550ae; --tok-cm: #6e7781;
  --tok-fn: #8250df; --tok-ty: #953800; --tok-var: #24292f;
}
html[data-theme="dark"] {
  --bg: #0d1017;
  --bg-side: #11151d;
  --bg-raise: #1a2029;
  --ink: #e3e8ef;
  --ink-soft: #9aa5b3;
  --ink-faint: #667180;
  --line: #222a36;
  --acc: #ffa726;
  --acc-text: #ffb74d;
  --acc-soft: rgba(255, 167, 38, 0.13);
  --acc-underline: rgba(255, 167, 38, 0.4);
  --code-bg: #131924;
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.6);
  --tok-kw: #ff7b72; --tok-str: #a5d6ff; --tok-num: #79c0ff; --tok-cm: #8b949e;
  --tok-fn: #d2a8ff; --tok-ty: #ffa657; --tok-var: #c9d1d9;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Keep the scrollbar gutter permanently: otherwise short pages (no page
     scrollbar) and long pages have different viewport widths, and the layout
     visibly shifts when navigating between them. overflow-y:scroll is the
     universally-applied form; scrollbar-gutter is the modern hint. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--acc-soft); color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
a { color: inherit; }

button { font-family: inherit; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.icon-btn:hover { background: var(--bg-raise); color: var(--ink); }
html:not([data-theme="dark"]) .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: none; }

/* ---------- frame ---------- */
.layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 232px;
  max-width: 1460px;
  margin: 0 auto;
}
.topbar { display: none; }
.sidebar-scrim { display: none; } /* mobile-only backdrop — must never be a grid item */

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.side-top { display: flex; align-items: center; gap: 4px; }
.site-home {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 9px;
  transition: background 0.13s;
}
.site-home:hover { background: var(--bg-raise); }
.site-home .logo { width: 32px; height: 32px; flex-shrink: 0; }
/* The RiA emblem is black line art on transparency — invert it for dark mode. */
html[data-theme="dark"] img.logo { filter: invert(1); }
.site-home span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.site-home strong { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.site-home small { color: var(--ink-faint); font-size: 11.5px; font-weight: 500; }

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.13s, color 0.13s;
}
.sidebar-search:hover { border-color: var(--acc); color: var(--ink-soft); }
.sidebar-search span { flex: 1; text-align: left; }
.sidebar-search kbd {
  font: 500 10.5px/1.6 "Inter", sans-serif;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  background: var(--bg-raise);
}

.nav-tree { flex: 1; font-size: 13.5px; padding-top: 4px; }
.nav-tree a {
  display: block;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.nav-tree a:hover { background: var(--bg-raise); color: var(--ink); }
.nav-tree a.active { background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }

/* top-level entries: Welcome + section heads + top-level pages */
.nav-tree > a,
.nav-tree > .nav-group > summary > a {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 10px;
}
.nav-tree > a:first-child { margin-top: 0; }
.nav-tree > a.active,
.nav-tree > .nav-group > summary > a.active { color: var(--acc-text); }

.nav-group > summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  border-radius: 7px;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary > a { flex: 1; }
.nav-group > summary .chev {
  padding: 2px 7px;
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 10px;
  transition: transform 0.15s;
}
.nav-group:not([open]) > summary .chev { transform: rotate(-90deg); }
.nav-children {
  margin: 2px 0 4px 13px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}
.nav-children .nav-group > summary > a { font-weight: 550; color: var(--ink-soft); }
.nav-children .nav-group > summary > a:hover { color: var(--ink); }
.nav-children .nav-group > summary .chev { margin-top: 0; }
.nav-children a.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--acc);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-foot a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-foot a:hover { background: var(--bg-raise); color: var(--acc-text); }
.sidebar-foot .ext { color: var(--ink-faint); font-size: 11px; }
.sidebar-foot a:hover .ext { color: var(--acc-text); }

/* ---------- article ---------- */
.content { min-width: 0; padding: 40px 56px 64px; }
article { max-width: 740px; }

.crumbs {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--acc-text); }
.crumb-sep { margin: 0 7px; opacity: 0.7; }

h1 {
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0 0 26px;
}
h1 img.h1-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  margin-right: 12px;
  vertical-align: -5px;
}
h1 .h1-icon-emoji { margin-right: 10px; }
h1::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--acc);
  margin-top: 14px;
}
h2 { font-size: 21.5px; font-weight: 650; letter-spacing: -0.015em; margin: 40px 0 12px; }
h3 { font-size: 17.5px; font-weight: 650; letter-spacing: -0.01em; margin: 30px 0 10px; }
h4 { font-size: 15.5px; font-weight: 650; margin: 24px 0 8px; }
h2, h3, h4 { scroll-margin-top: 28px; line-height: 1.35; }
.hlink {
  margin-left: 8px;
  color: var(--ink-faint);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
  transition: opacity 0.12s;
}
h2:hover .hlink, h3:hover .hlink, h4:hover .hlink { opacity: 1; }
.hlink:hover { color: var(--acc-text); }

p { margin: 0 0 12px; }
.blank { height: 10px; }
.indent { margin-left: 22px; }
article a {
  color: var(--acc-text);
  text-decoration: underline;
  text-decoration-color: var(--acc-underline);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s;
}
article a:hover { text-decoration-color: var(--acc-text); }
ul, ol { margin: 0 0 14px; padding-left: 24px; }
li { margin: 4px 0; }
li::marker { color: var(--ink-faint); }
li.todo { list-style: none; margin-left: -20px; }
li.todo input { accent-color: var(--acc); }
hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
blockquote {
  margin: 14px 0;
  padding: 4px 2px 4px 16px;
  border-left: 3px solid var(--acc);
  color: var(--ink-soft);
  font-size: 15px;
}
code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.86em;
  background: var(--bg-raise);
  border-radius: 5px;
  padding: 2px 5.5px;
}
s { color: var(--ink-faint); }

/* toggles — Q&A cards (Troubleshooting) */
article details {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color 0.13s;
}
article details:hover { border-color: var(--acc); }
article details > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 16px;
}
article details > summary::-webkit-details-marker { display: none; }
article details > summary::before {
  content: "▸";
  color: var(--acc);
  flex-shrink: 0;
  transition: transform 0.15s;
}
article details[open] > summary::before { transform: rotate(90deg); }
.toggle-body { padding: 0 16px 12px 34px; }
.toggle-body > :last-child { margin-bottom: 0; }

/* callouts */
.callout {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  margin: 16px 0;
  border-radius: 10px;
  background: var(--bg-side);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-faint);
  font-size: 15px;
}
.callout-icon { font-size: 17px; line-height: 1.5; flex-shrink: 0; }
img.callout-icon { width: 20px; height: 20px; margin-top: 3px; }
.callout-body { min-width: 0; }
.callout-body > p:last-child { margin-bottom: 0; }
.callout-orange, .callout-yellow { background: var(--acc-soft); border-color: var(--acc-underline); border-left-color: var(--acc); }
.callout-red { background: rgba(220, 54, 46, 0.07); border-color: rgba(220, 54, 46, 0.25); border-left-color: #dc362e; }
.callout-blue { background: rgba(9, 105, 218, 0.06); border-color: rgba(9, 105, 218, 0.22); border-left-color: #0969da; }
.callout-green, .callout-teal { background: rgba(26, 127, 55, 0.06); border-color: rgba(26, 127, 55, 0.22); border-left-color: #1a7f37; }
.callout-gray { border-left-color: var(--ink-faint); }

/* code blocks */
.codeblock {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--shadow-sm);
}
.codehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.codehead .copy {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.5px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.13s, color 0.13s, border-color 0.13s;
}
.codeblock:hover .copy, .codehead .copy:focus-visible { opacity: 1; }
.codehead .copy:hover { color: var(--acc-text); border-color: var(--acc); }
.codeblock pre {
  margin: 0;
  padding: 13px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.codeblock pre code { background: none; color: var(--ink); padding: 0; font-size: inherit; }
.codeblock figcaption {
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.equation { background: var(--code-bg); padding: 10px 14px; border-radius: 8px; }

/* highlight.js tokens */
.hljs-keyword, .hljs-literal, .hljs-deletion { color: var(--tok-kw); }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--tok-str); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id { color: var(--tok-num); }
.hljs-comment, .hljs-quote { color: var(--tok-cm); font-style: italic; }
.hljs-title, .hljs-section, .hljs-name, .hljs-function .hljs-title { color: var(--tok-fn); }
.hljs-type, .hljs-class .hljs-title, .hljs-built_in, .hljs-attribute, .hljs-attr, .hljs-selector-class, .hljs-selector-tag, .hljs-template-tag { color: var(--tok-ty); }
.hljs-variable, .hljs-params, .hljs-template-variable { color: var(--tok-var); }

/* figures */
.img { margin: 20px 0; text-align: center; }
.img img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.img figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.video {
  margin: 20px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow-sm);
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* child-page links — plain text with an amber arrow */
.pagelink {
  display: flex;
  align-items: baseline;
  gap: 9px;
  width: fit-content;
  padding: 3px 0;
  font-size: 15px;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none !important;
}
.pagelink img.pl-icon {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: -3px;
}
.pagelink .pl-icon-emoji { margin-right: 7px; }
.pagelink .pl-arrow { color: var(--acc); transition: transform 0.14s; }
.pagelink:hover .pl-arrow { transform: translateX(3px); }
.pagelink:hover span:last-child { color: var(--acc-text); }
.pagelink.sub {
  margin-left: 27px;
  padding: 1px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.pagelink.sub .pl-arrow { color: var(--ink-faint); }
.pagelink.sub:hover .pl-arrow { color: var(--acc); transform: none; }

/* bookmark cards */
.bookmark {
  display: block;
  margin: 12px 0;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.13s, transform 0.13s, box-shadow 0.13s;
}
.bookmark:hover { border-color: var(--acc); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.bm-title { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.bm-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  line-height: 1.55;
}
.bm-host { display: block; font-size: 12px; font-weight: 500; color: var(--ink-faint); margin-top: 6px; }

/* file downloads */
.file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 10px 6px 0;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.13s, background 0.13s;
}
.file:hover { border-color: var(--acc); background: var(--acc-soft); }
.file-icon { color: var(--acc); font-size: 14px; }
.file-name { font-weight: 600; font-size: 14px; }
.file-size { color: var(--ink-faint); font-size: 12px; }

/* external-object chips (GitHub links) */
.extobj {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 8px 4px 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none !important;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  transition: border-color 0.13s, background 0.13s;
}
.extobj:hover { border-color: var(--acc); background: var(--acc-soft); }
.extobj-domain {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}
.extobj.inline { margin: 0 4px 0 0; padding: 2px 9px; }
.mention { font-weight: 550; }
.mention::before { content: "📄 "; font-size: 0.85em; }

/* tables */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 14px; text-align: left; vertical-align: top; }
th {
  background: var(--bg-side);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
td { border-top: 1px solid var(--line); }
tr:first-child td { border-top: none; }
tbody tr:hover td, table tr:hover td { background: var(--bg-side); }

/* columns */
.cols { display: flex; gap: 30px; margin: 8px 0; }
.col { min-width: 0; }
@media (max-width: 760px) { .cols { flex-direction: column; gap: 0; } }

/* notion text colors */
.nc-gray { color: #787774; } .nc-brown { color: #9f6b53; } .nc-orange { color: #d9730d; }
.nc-yellow { color: #cb912f; } .nc-green, .nc-teal { color: #448361; } .nc-blue { color: #337ea9; }
.nc-purple { color: #9065b0; } .nc-pink { color: #c14c8a; } .nc-red { color: #d44c47; }
.nc-gray_background { background: rgba(120, 119, 116, 0.13); border-radius: 3px; padding: 0 3px; }
.nc-orange_background, .nc-yellow_background { background: var(--acc-soft); border-radius: 3px; padding: 0 3px; }
.nc-red_background { background: rgba(212, 76, 71, 0.13); border-radius: 3px; padding: 0 3px; }
.nc-blue_background { background: rgba(51, 126, 169, 0.13); border-radius: 3px; padding: 0 3px; }
.nc-green_background { background: rgba(68, 131, 97, 0.13); border-radius: 3px; padding: 0 3px; }

/* pager + meta */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  max-width: 740px;
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  min-width: 0;
}
.pager-link.next { text-align: right; margin-left: auto; }
.pager-label { font-size: 12px; font-weight: 500; color: var(--ink-faint); }
.pager-title { color: var(--acc-text); font-weight: 600; font-size: 14.5px; transition: color 0.12s; }
.pager-link:hover .pager-title { text-decoration: underline; text-underline-offset: 3px; }
.page-meta {
  display: flex;
  gap: 18px;
  max-width: 740px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.page-meta a { color: var(--ink-faint); text-decoration: none; }
.page-meta a:hover { color: var(--acc-text); }

/* toc */
.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 46px 20px 24px 4px;
  font-size: 13px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.toc-title {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block;
  padding: 3.5px 0 3.5px 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color 0.12s, border-color 0.12s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc li a:hover { color: var(--acc-text); }
.toc li.active > a { color: var(--acc-text); border-left-color: var(--acc); font-weight: 550; }
.toc .toc-l3 a { padding-left: 26px; }
.toc .toc-l4 a { padding-left: 38px; }

/* ---------- search ---------- */
.search-overlay[hidden] { display: none; }
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 11vh 16px 16px;
  backdrop-filter: blur(2px);
}
.search-box {
  width: min(640px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
#searchInput {
  width: 100%;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 1px solid var(--line);
}
.search-results { max-height: 55vh; overflow-y: auto; }
.search-results .hit {
  display: block;
  padding: 11px 20px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.search-results .hit:last-child { border-bottom: none; }
.search-results .hit:hover, .search-results .hit.sel { background: var(--acc-soft); }
.hit-title { font-weight: 600; font-size: 14.5px; }
.hit-crumb { font-size: 12px; color: var(--ink-faint); margin-left: 8px; }
.hit-snip { font-size: 13px; color: var(--ink-soft); margin-top: 2px; line-height: 1.55; }
.hit-snip mark { background: none; color: var(--acc-text); font-weight: 600; }
.search-empty { padding: 20px; color: var(--ink-faint); font-size: 14px; }

/* ---------- scrollbars (webkit) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 272px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-side);
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
  }
  .menu-btn:hover { background: var(--bg-raise); }
  .topbar-title {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    font-weight: 650;
    font-size: 14.5px;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
  }
  .topbar-title .logo { width: 24px; height: 24px; }
  .topbar .icon-btn { width: 34px; height: 34px; color: var(--ink); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: auto;
    z-index: 60;
    transform: translateX(-103%);
    transition: transform 0.2s ease-out;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--scrim);
    z-index: 50;
  }
  .content { padding: 24px 20px 52px; }
  h1 { font-size: 25px; }
  h2 { font-size: 19.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
