/* The documentation site's theme (tools/docsite.mjs). Tokens on :root; dark by prefers-color-scheme or data-theme. */
:root {
  --bg: #ffffff; --bg-side: #f7f8fa; --ink: #1b1f26; --muted: #5d6472; --line: #e3e6eb; --accent: #1559c4;
  --accent-soft: #e8f0fe; --code-bg: #f4f5f7; --code-ink: #1b1f26; --table-head: #f4f5f7; --quote: #f4f7fb;
  --tip: #1a7f37; --important: #8250df; --warning: #9a6700; --caution: #cf222e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1318; --bg-side: #12171d; --ink: #e4e8ee; --muted: #9aa3b1; --line: #252c35; --accent: #5b9bff;
    --accent-soft: #16233a; --code-bg: #161c23; --code-ink: #dfe5ec; --table-head: #161c23; --quote: #131b26;
    --tip: #3fb950; --important: #a371f7; --warning: #d29922; --caution: #f85149;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1318; --bg-side: #12171d; --ink: #e4e8ee; --muted: #9aa3b1; --line: #252c35; --accent: #5b9bff;
  --accent-soft: #16233a; --code-bg: #161c23; --code-ink: #dfe5ec; --table-head: #161c23; --quote: #131b26;
  --tip: #3fb950; --important: #a371f7; --warning: #d29922; --caution: #f85149;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* (links inside running text are underlined: colour alone does not mark them - WCAG 1.4.1) */
.content :is(p, li, td, th, dd, blockquote, caption, .callout) a:not(.sym-link) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.content :is(p, li, td, th, dd, blockquote, caption, .callout) a:not(.sym-link):hover { text-decoration-color: currentColor; }
.content .cards a { text-decoration: none; }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.brand .ver { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-weight: 400; margin-left: 4px; }
.top-links { display: flex; gap: 18px; margin-left: auto; font-size: 15px; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--ink); text-decoration: none; }
.search { position: relative; flex: 0 1 300px; }
.search input {
  width: 100%; font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-side); color: var(--ink);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--bg); }
.search .results {
  position: absolute; top: calc(100% + 6px); left: 0; width: min(520px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); z-index: 20;
}
.search .results a { display: block; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search .results a:last-child { border-bottom: 0; }
.search .results a[aria-selected], .search .results a:hover { background: var(--accent-soft); }
.search .r-h { font-weight: 600; font-size: 14.5px; margin-right: 8px; }
.search .r-p { font-size: 12.5px; color: var(--muted); }
.search .r-x { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.search .r-x mark { background: none; color: var(--accent); font-weight: 600; }
.search .r-none { padding: 12px 14px; font-size: 14px; color: var(--muted); }
.menu { display: none; font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 4px 10px; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; max-width: 1400px; margin: 0 auto; }
.side {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 20px 12px 40px 20px;
  border-right: 1px solid var(--line); background: var(--bg-side); font-size: 14.5px;
}
.nav-filter { position: sticky; top: -20px; margin: -20px -12px 10px -20px; padding: 16px 12px 10px 20px; background: var(--bg-side); z-index: 1; }
.nav-filter input {
  width: 100%; font: inherit; font-size: 13.5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.nav-filter input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.nav-setting { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.nav-setting select {
  font: inherit; font-size: 13.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.nav-setting select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.content h3 .sym-link { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); text-decoration: none; opacity: 0; }
.content h3:hover .sym-link, .content h3 .sym-link:focus { opacity: 1; }
.side [hidden] { display: none !important; }
.side summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; user-select: none;
}
.side summary::-webkit-details-marker { display: none; }
.side summary::before {
  content: ""; flex: none; width: 5px; height: 5px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s;
}
.side details[open] > summary::before { transform: rotate(45deg); }
.side summary:hover { background: var(--accent-soft); }
.nav-area > summary { font-weight: 600; margin-top: 2px; }
.nav-area > a, .nav-area > details, .nav-group > a { margin-left: 13px; }
.nav-none { padding: 4px 8px; color: var(--muted); font-size: 13.5px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.page-foot {
  display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.page-foot .pf-k { font-weight: 600; color: var(--ink); margin-right: 4px; }
.page-foot .pf-report { margin-left: auto; }
.pf-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pf-help button {
  font: inherit; font-size: 13px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); cursor: pointer;
}
.pf-help button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pf-help button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pf-help button:disabled:not([aria-pressed="true"]) { opacity: 0.55; cursor: default; }
.pf-table { flex-basis: 100%; margin: 8px 0 0; font-size: 13px; }
.pf-table caption { text-align: left; padding-bottom: 6px; color: var(--muted); }
.pf-table th[scope="row"] { font-weight: 600; white-space: nowrap; }
.side a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink); }
.side a:hover { background: var(--accent-soft); text-decoration: none; }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.content { padding: 32px 48px 80px; min-width: 0; max-width: 860px; }
.toc { position: sticky; top: 56px; align-self: start; padding: 32px 16px; font-size: 13.5px; max-height: calc(100vh - 56px); overflow-y: auto; }
.toc-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.toc a { display: block; padding: 3px 0; color: var(--muted); }
.toc a.h3 { padding-left: 12px; }
.toc a:hover { color: var(--ink); }
.content h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 16px; text-wrap: balance; }
.content h2 { font-size: 24px; line-height: 1.3; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); text-wrap: balance; }
.content h3 { font-size: 18px; margin: 28px 0 8px; }
.content p, .content li { max-width: 72ch; }
.content code {
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; background: var(--code-bg);
  padding: 0.12em 0.35em; border-radius: 4px;
}
.content pre { background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; border-radius: 8px; overflow-x: auto; line-height: 1.55; }
.content pre code { background: none; padding: 0; font-size: 13.5px; }
.content blockquote { margin: 16px 0; padding: 10px 16px; background: var(--quote); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; color: var(--ink); }
.content blockquote p { margin: 4px 0; }
.content table { border-collapse: collapse; display: block; overflow-x: auto; margin: 16px 0; font-size: 14.5px; }
.content th, .content td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; vertical-align: top; }
.content th { background: var(--table-head); font-weight: 600; }
.content img { max-width: 100%; }
@media (max-width: 1200px) { .layout { grid-template-columns: 240px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; height: auto; z-index: 9; border-right: 0; }
  body.nav-open .side { display: block; }
  .menu { display: inline-block; }
  .top-links { display: none; }
  .top { gap: 12px; padding: 0 16px; }
  .search { flex: 1 1 auto; }
  .content { padding: 24px 16px 60px; }
  .content h1 { font-size: 28px; }
}
.cards ul { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.content .cards li {
  position: relative; max-width: none; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.content .cards li:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgb(0 0 0 / 0.07); }
.cards .card-k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cards a { font-weight: 600; font-size: 16px; }
.cards a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.cards p { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.groups > ul { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px 28px; }
.content .groups li { max-width: none; }
.groups > ul > li > strong { display: block; font-size: 15px; margin-bottom: 6px; }
.groups ul ul { list-style: none; padding: 0; margin: 0; }
.groups ul ul li { padding: 3px 0; font-size: 14.5px; }
.content blockquote.callout { --c: var(--accent); border-left-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--bg)); }
.callout-tip { --c: var(--tip) !important; }
.callout-important { --c: var(--important) !important; }
.callout-warning { --c: var(--warning) !important; }
.callout-caution { --c: var(--caution) !important; }
.content .callout-t { font-weight: 650; color: var(--c); margin: 2px 0 2px; font-size: 14.5px; }
.tabs { margin: 1.2em 0; }
.tab-bar { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: -1px; position: relative; }
.tab-bar [role="tab"] {
  font: inherit; font-size: 14px; padding: 7px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  background: none; color: var(--muted); cursor: pointer;
}
.tab-bar [role="tab"]:hover { color: var(--ink); }
.tab-bar [role="tab"][aria-selected="true"] { color: var(--accent); font-weight: 600; border-color: var(--line); background: var(--bg); position: relative; top: 1px; }
.tab-bar [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 600px) { .tab-bar [role="tab"] { padding: 6px 9px; font-size: 13px; } }
.tabs .tab-panel > .repl { margin-top: 0; border-top-left-radius: 0; }
.content .repl-static pre.repl-code {
  margin: 0; padding: 12px 14px; border-radius: 0; overflow-x: auto; background: var(--repl-bg); color: var(--repl-ink);
  font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; tab-size: 4;
}
.content .repl-static pre.repl-code code { font: inherit; background: none; padding: 0; }
.content .repl-static pre.repl-text { background: none; border-radius: 0; }
