/* The documentation's pages (tools/docs-site.py): readable on a phone and printed, light and dark */
:root { --bg: #fff; --fg: #1c2330; --muted: #5b6474; --line: #e3e7ee; --accent: #1a6fd6; --code: #f4f6f9; --side: #f8f9fb; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --fg: #e3e7ee; --muted: #9aa3b2; --line: #2a3039; --accent: #6aa8ff; --code: #1d2229; --side: #181c22; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 10; }
.top { display: flex; gap: 18px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg); z-index: 5; }
.top a { text-decoration: none; color: var(--fg); }
.top .brand { font-weight: 700; letter-spacing: .02em; }
.top .ver { color: var(--muted); font-size: 13px; margin-left: 4px; }
.top .search { margin-left: auto; color: var(--accent); }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 32px; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.layout.one { grid-template-columns: minmax(0, 820px); justify-content: center; }
.menu { position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; padding: 18px 0; font-size: 14px; }
.menu ul, .menu ol { list-style: none; margin: 0; padding: 0; }
.menu ol { padding-left: 12px; border-left: 1px solid var(--line); margin: 4px 0 8px 6px; }
.menu a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--fg); text-decoration: none; }
.menu a:hover { background: var(--side); }
.menu a.current { background: var(--side); color: var(--accent); font-weight: 600; }
main { min-width: 0; padding: 18px 0 40px; }
article { max-width: 820px; }
article h1 { font-size: 30px; line-height: 1.25; margin: 8px 0 18px; }
article h2 { font-size: 22px; margin: 34px 0 10px; padding-top: 6px; border-top: 1px solid var(--line); }
article h3 { font-size: 18px; margin: 24px 0 8px; }
article h1, article h2, article h3, article h4 { scroll-margin-top: 64px; }
.anchor { margin-left: 6px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; }
article img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code); padding: 12px 14px; border-radius: 8px; overflow: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
blockquote { margin: 14px 0; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--side); border-radius: 0 8px 8px 0; }
blockquote p { margin: 6px 0; }
.table { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--side); }
li { margin: 3px 0; }
.toc { position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; padding: 18px 0; font-size: 13px; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li.l3 { padding-left: 12px; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding: 2px 0; }
.toc a:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; max-width: 820px; }
.pager a { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; text-decoration: none; }
.pager a span { display: block; font-size: 12px; color: var(--muted); }
.pager .next { text-align: right; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 16px 20px; text-align: center; }
.searchbox input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.searchbox label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { color: var(--muted); }
.results { padding-left: 20px; }
.results li { margin: 12px 0; }
.results .page { color: var(--muted); font-size: 13px; margin-left: 8px; }
.results p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 1100px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu { position: static; max-height: none; border-bottom: 1px solid var(--line); }
}
@media print { .top, .menu, .toc, .pager, .skip { display: none; } .layout { display: block; } a { color: inherit; } }
