/* embdoc.css -- written by embdoc (tools/embdoc/assets.c) */
:root {
  --bg: #fbfbf8; --bg-elev: #ffffff; --fg: #1b1f22; --fg-soft: #3b4349;
  --muted: #687178; --rule: #e2e2dc; --rule-strong: #1b1f22;
  --code-bg: #f3f3ee; --accent: #0a7552; --accent-ink: #065b3f;
  --accent-soft: rgba(10, 117, 82, .08); --mark: rgba(242, 177, 0, .38);
  --shadow: 0 10px 30px rgba(20, 26, 30, .14);
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --bar: 56px; --text: 820px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1215; --bg-elev: #161b1f; --fg: #dde2df; --fg-soft: #b8c0bc;
    --muted: #89939a; --rule: #262d32; --rule-strong: #c5ccc8;
    --code-bg: #141a1e; --accent: #5ccf9f; --accent-ink: #86e0bb;
    --accent-soft: rgba(92, 207, 159, .11); --mark: rgba(242, 177, 0, .30);
    --shadow: 0 12px 34px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e1215; --bg-elev: #161b1f; --fg: #dde2df; --fg-soft: #b8c0bc;
  --muted: #89939a; --rule: #262d32; --rule-strong: #c5ccc8;
  --code-bg: #141a1e; --accent: #5ccf9f; --accent-ink: #86e0bb;
  --accent-soft: rgba(92, 207, 159, .11); --mark: rgba(242, 177, 0, .30);
  --shadow: 0 12px 34px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--bg); }
svg { width: 20px; height: 20px; flex: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 10px; z-index: 50; padding: 8px 12px;
  background: var(--bg-elev); border: 1px solid var(--rule); }
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--rule); }
.bar button { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid transparent;
  border-radius: 8px; background: none; color: var(--fg-soft); cursor: pointer; }
.bar button:hover { color: var(--fg); border-color: var(--rule); }
.menu { display: none !important; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg);
  text-decoration: none; font: 700 17px/1 var(--mono); letter-spacing: -.01em; }
.brand:hover { color: var(--fg); }
.brand svg { width: 24px; height: 24px; color: var(--accent); }
.brand .sub { font-weight: 400; color: var(--muted); padding-left: 9px;
  border-left: 1px solid var(--rule); }
.search { position: relative; flex: 1 1 auto; max-width: 460px; margin-left: 28px;
  display: flex; align-items: center; }
.search > svg { position: absolute; left: 10px; width: 17px; height: 17px;
  color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 34px 0 34px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-elev);
  color: var(--fg); font: 14px var(--sans); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 8px; font: 11px/1.5 var(--mono);
  color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; }
.repo { margin-left: auto; font: 13px var(--mono); color: var(--fg-soft); text-decoration: none; }
.repo:hover { color: var(--accent); }
.results { position: absolute; top: calc(100% + 6px); left: 0;
  width: min(640px, calc(100vw - 32px)); max-height: min(70vh, 580px); overflow: auto;
  padding: 6px; background: var(--bg-elev); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: var(--shadow); }
.results a { display: block; padding: 8px 10px; border-radius: 6px;
  color: var(--fg); text-decoration: none; }
.results a:hover, .results a[aria-selected='true'] { background: var(--accent-soft); }
.results .where { display: block; font: 11.5px/1.5 var(--mono); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .what { display: block; font-weight: 600; line-height: 1.35; }
.results .snip { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45;
  color: var(--fg-soft); overflow-wrap: anywhere; }
.results mark { background: var(--mark); color: inherit; border-radius: 2px; }
.results .none { padding: 12px; color: var(--muted); font-size: 14px; }
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr) 248px;
  grid-template-areas: 'side main toc'; max-width: 1500px; margin: 0 auto; }
.side { grid-area: side; position: sticky; top: var(--bar); align-self: start;
  height: calc(100vh - var(--bar)); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 14px 48px 20px; border-right: 1px solid var(--rule); font-size: 14px; }
.side .group + .group { margin-top: 20px; }
.side h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  padding-left: 10px; font: 600 11px/1.4 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.side h2::before { content: ''; width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 4px 10px; border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0; color: var(--fg-soft); text-decoration: none; line-height: 1.4; }
.side a:hover { color: var(--fg); background: var(--accent-soft); }
.side a[aria-current='page'] { color: var(--accent-ink); font-weight: 600;
  border-left-color: var(--accent); background: var(--accent-soft); }
main { grid-area: main; min-width: 0; padding: 26px 52px 72px; }
.toc { grid-area: toc; position: sticky; top: var(--bar); align-self: start;
  max-height: calc(100vh - var(--bar)); overflow-y: auto; padding: 30px 20px 40px 6px;
  font-size: 13px; }
.toc summary { list-style: none; margin-bottom: 10px; font: 600 11px/1.4 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc summary::-webkit-details-marker { display: none; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; margin-left: -1px; padding: 3px 0 3px 12px;
  border-left: 1px solid transparent; color: var(--muted); text-decoration: none;
  line-height: 1.35; }
.toc li.h3 a { padding-left: 24px; }
.toc code { font: .95em/1.3 var(--mono); }
.toc em { font-style: normal; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--accent-ink); border-left-color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 22px;
  font: 12px/1.5 var(--mono); color: var(--muted); }
.meta .group { display: inline-flex; align-items: center; gap: 7px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.meta .group::before { content: ''; width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent); }
.meta a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.meta a:hover { color: var(--accent); text-decoration: underline; }
.meta .edit::before { content: '\270E\00a0'; }
.doc { max-width: var(--text); overflow-wrap: break-word; }
.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 { color: var(--fg);
  scroll-margin-top: calc(var(--bar) + 16px); }
.doc h1 { margin: 0 0 22px; font-size: 2.15rem; line-height: 1.18;
  letter-spacing: -.022em; font-weight: 700; }
.doc h2 { margin: 52px 0 14px; padding-top: 20px; border-top: 1px solid var(--rule);
  font-size: 1.45rem; line-height: 1.3; letter-spacing: -.012em; }
.doc h3 { margin: 34px 0 10px; font-size: 1.15rem; line-height: 1.35; }
.doc h4 { margin: 26px 0 8px; font-size: 1rem; }
.doc h5, .doc h6 { margin: 22px 0 6px; font-size: .92rem; color: var(--fg-soft); }
.doc .hl { margin-left: 8px; font: 400 .8em var(--mono); color: var(--muted);
  text-decoration: none; opacity: 0; }
.doc h1:hover .hl, .doc h2:hover .hl, .doc h3:hover .hl, .doc h4:hover .hl,
.doc h5:hover .hl, .doc h6:hover .hl, .doc .hl:focus { opacity: 1; }
.doc p, .doc ul, .doc ol, .doc blockquote, .doc .table-wrap, .doc .codeblock {
  margin: 0 0 18px; }
.doc ul, .doc ol { padding-left: 1.6em; }
.doc li { margin: 5px 0; }
.doc li > ul, .doc li > ol { margin: 5px 0 0; }
.doc li > p { margin-bottom: 10px; }
.doc li::marker { color: var(--muted); }
.doc code { font: .86em/1.4 var(--mono); padding: .1em .34em; border-radius: 4px;
  background: var(--code-bg); border: 1px solid var(--rule); }
.doc a code { color: inherit; }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 36px 0; }
.doc blockquote { margin-left: 0; padding: 12px 18px; border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0; background: var(--accent-soft); color: var(--fg-soft); }
.doc blockquote > :last-child { margin-bottom: 0; }
.codeblock { position: relative; background: var(--code-bg);
  border: 1px solid var(--rule); border-radius: 8px; }
.codeblock pre { margin: 0; padding: 15px 16px; overflow-x: auto;
  font: 13.5px/1.55 var(--mono); tab-size: 8; }
.codeblock code { font: inherit; padding: 0; border: 0; background: none; }
.codeblock[data-lang]::before { content: attr(data-lang); position: absolute; top: -9px;
  left: 12px; padding: 1px 6px; font: 600 10px/14px var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 4px; }
.codeblock[data-lang='text']::before { content: none; }
.codeblock .copy { position: absolute; top: 7px; right: 7px; padding: 2px 8px;
  font: 11px/18px var(--mono); color: var(--muted); background: var(--bg-elev);
  border: 1px solid var(--rule); border-radius: 5px; cursor: pointer; opacity: 0; }
.codeblock:hover .copy, .codeblock .copy:focus { opacity: 1; }
.codeblock .copy:hover { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .codeblock .copy { opacity: 1; } }
.table-wrap { overflow-x: auto; border-top: 2px solid var(--rule-strong);
  border-bottom: 2px solid var(--rule-strong); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.doc th { padding: 9px 12px 7px; text-align: left; vertical-align: bottom; font-weight: 600;
  border-bottom: 1px solid var(--rule-strong); }
.doc td { padding: 7px 12px; vertical-align: top; border-top: 1px solid var(--rule); }
.doc tbody tr:first-child td { border-top: 0; }
.doc tbody tr:hover { background: var(--accent-soft); }
.doc td code, .doc th code { font-size: .84em; }
.doc code.nw { white-space: nowrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  max-width: var(--text); margin-top: 56px; }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--rule);
  border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager .dir { display: block; margin-bottom: 2px; font: 400 11px/1.4 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pager .next { grid-column: 2; text-align: right; }
.foot { max-width: var(--text); margin-top: 28px; padding-top: 14px;
  border-top: 1px solid var(--rule); font: 12px/1.5 var(--mono); color: var(--muted); }
.foot code { font: inherit; }
@media (max-width: 1200px) {
  .shell { grid-template-columns: 252px minmax(0, 1fr);
    grid-template-areas: 'side toc' 'side main'; grid-template-rows: auto 1fr; }
  .toc { position: static; max-height: none; overflow: visible; padding: 22px 52px 0; }
  .toc details { max-width: var(--text); padding: 8px 14px; border: 1px solid var(--rule);
    border-radius: 8px; }
  .toc summary { margin: 0; cursor: pointer; }
  .toc summary::after { content: ' +'; }
  .toc details[open] summary { margin-bottom: 8px; }
  .toc details[open] summary::after { content: ' \2212'; }
  .toc ul { max-height: 50vh; overflow-y: auto; }
  main { padding-top: 18px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'toc' 'main';
    grid-template-rows: auto 1fr; }
  .side { position: fixed; top: var(--bar); bottom: 0; left: 0; z-index: 25;
    width: min(300px, 86vw); height: auto; align-self: auto; background: var(--bg);
    transform: translateX(-100%); transition: transform .18s ease; visibility: hidden; }
  body.nav-open .side { transform: none; visibility: visible; box-shadow: var(--shadow); }
  body.nav-open::after { content: ''; position: fixed; inset: var(--bar) 0 0 0; z-index: 20;
    background: rgba(0, 0, 0, .28); }
  .menu { display: inline-flex !important; }
  .bar { gap: 8px; padding: 0 12px; }
  .brand .sub, .repo, .search kbd { display: none; }
  .search { margin-left: auto; max-width: none; }
  .search input { padding-right: 10px; }
  .results { position: fixed; top: calc(var(--bar) + 4px); left: 12px; right: 12px; width: auto; }
  .toc { padding: 16px 16px 0; }
  main { padding: 14px 16px 56px; }
  .doc h1 { font-size: 1.75rem; }
  .doc h2 { margin-top: 40px; }
  .codeblock { margin-left: -4px; margin-right: -4px; }
  .codeblock pre { font-size: 12.5px; padding: 14px 12px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media print {
  .bar, .side, .toc, .pager, .meta, .hl, .copy { display: none !important; }
  .shell { display: block; } main { padding: 0; }
  .codeblock pre { white-space: pre-wrap; }
}
