/* SPDX-License-Identifier: MIT */
/* The style sheet of the built-in style modern. The colors are custom
   properties: one set for the light theme, and one for the dark theme
   from prefers-color-scheme. tools/contrast.tcl checks each pair of a
   text color and its background against WCAG 2.2 AA. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1d2125;
  --muted: #545c64;
  --link: #0b57a4;
  --line: #c9ced4;
  --focus: #0b57a4;
  --code-bg: #f3f5f7;
  --code-text: #1d2125;
  --tok-c: #5a6470;
  --tok-s: #0a6630;
  --tok-k: #8a1c7c;
  --tok-n: #8f4400;
  --tok-v: #0b57a4;
  --tok-p: #6b3fa0;
  --note-bg: #eef4fb;
  --note-line: #0b57a4;
  --warn-bg: #fdf3e7;
  --warn-line: #9a4a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --text: #e6e8eb;
    --muted: #a9b1ba;
    --link: #7ab7ff;
    --line: #3a4048;
    --focus: #7ab7ff;
    --code-bg: #1e2227;
    --code-text: #e6e8eb;
    --tok-c: #9aa4ae;
    --tok-s: #7fd18b;
    --tok-k: #e59ae0;
    --tok-n: #f0b16a;
    --tok-v: #7ab7ff;
    --tok-p: #c3a6f0;
    --note-bg: #17263a;
    --note-line: #7ab7ff;
    --warn-bg: #33240f;
    --warn-line: #f0b16a;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -10000px; top: 0; }
.skip:focus { left: 1rem; top: .5rem; background: var(--bg); color: var(--link); padding: .5rem .75rem; z-index: 10; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
input[type="search"], button { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: 6px; padding: .35rem .6rem; }
button { cursor: pointer; }
input[type="search"]:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.search input { width: 14rem; max-width: 50vw; }
.search-page { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.search-page label { flex-basis: 100%; font-weight: 700; }
.search-page input { flex: 1; min-width: 12rem; }
#search-results { padding-left: 1.25rem; }
#search-results li { margin-bottom: 1rem; }
#search-results p { margin: .15rem 0 0; color: var(--muted); }
.logo { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.logo:has(.mark) { display: inline-flex; align-items: center; }
.logo .mark { flex: none; width: 26px; height: 26px; margin-right: .5rem; }
.docs { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 13rem; gap: 2rem; max-width: 80rem; margin: 0 auto; padding: 1.5rem; }
.menu { font-size: .95rem; }
.menu ul { list-style: none; margin: 0 0 .5rem; padding: 0; }
.menu li a { display: block; padding: .15rem .5rem; text-decoration: none; border-radius: 4px; }
.menu a[aria-current] { font-weight: 700; color: var(--text); background: var(--code-bg); }
.menu details { margin-bottom: .5rem; }
.menu summary { cursor: pointer; font-weight: 700; padding: .15rem 0; }
.menu .part { margin: .5rem 0 .1rem .5rem; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
main { min-width: 0; }
main h1 { margin-top: 0; line-height: 1.25; }
main h2, main h3 { line-height: 1.3; margin-top: 2rem; }
.toc { font-size: .9rem; position: sticky; top: 1rem; align-self: start; }
.toc-title { margin: 0 0 .25rem; font-weight: 700; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: .75rem; }
.toc a { text-decoration: none; }
pre { overflow-x: auto; padding: .75rem 1rem; background: var(--code-bg); color: var(--code-text); border-radius: 6px; line-height: 1.45; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .3em; border-radius: 4px; }
.tok-c { color: var(--tok-c); font-style: italic; }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); }
.tok-n { color: var(--tok-n); }
.tok-v { color: var(--tok-v); }
.tok-p { color: var(--tok-p); }
.table { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: .3rem .6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }
th[align="center"], td[align="center"] { text-align: center; }
th[align="right"], td[align="right"] { text-align: right; }
blockquote { margin: 1rem 0; padding: .25rem 1rem; border-left: 4px solid var(--line); }
.alert { background: var(--note-bg); border-left-color: var(--note-line); border-radius: 0 6px 6px 0; }
.alert.warning, .alert.caution, .alert.important { background: var(--warn-bg); border-left-color: var(--warn-line); }
.alert-title { font-weight: 700; margin-bottom: .25rem; }
img { max-width: 100%; height: auto; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; }
.pager span { display: block; font-size: .85rem; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }
@media (max-width: 64rem) { .docs { grid-template-columns: 14rem minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 48rem) { .docs { display: block; padding: 1rem; } .menu { margin-bottom: 1.5rem; } }
