:root {
  --nav-width: 200px;

  --mobile-reveal-width: 3rem;
  --mobile-nav-height: 3rem;
  --reveal-border: #777;

  --foreground: #222;
  --background: #fff;
  --background-2: #f0f0f0;

  --link-colour: #004080;
  --code-colour: #c7254e;
  --source-link-colour: #505050;

  --sidebar-header: #d7d7d7;
  --sidebar-header-hover: #d0d0d0;
  --sidebar-header-collapsed: #e7e7e7;

  --highlight-header-colour: #FFFF99;

  --note-colour: var(--foreground);
  --note-background: #ebebeb;

  --info-colour: #005377;
  --info-background: #b3e8ff;

  --tip-colour: #00421c;
  --tip-background: #8df3b8;

  --warning-colour: #664d03;
  --warning-background: #fff3cd;

  --danger-colour: #3a0000;
  --danger-background: #ffb4b4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground: #fff;
    --background: #2f2f2f;
    --background-2: #1c1c1c;

    --link-colour: #06cff7;
    --code-colour: #ff7699;
    --source-link-colour: #bdbcbc;

    --sidebar-header: #060606;
    --sidebar-header-hover: #101010;
    --sidebar-header-collapsed: #060606;

    --highlight-header-colour: #000005;

    --note-background: #3d3d3d;

    --info-colour: #6ad2ff;
    --info-background: #00374e;

    --tip-colour: #68f5a2;
    --tip-background: #033518;

    --warning-colour: #e4c04c;
    --warning-background: #4d3900;

    --danger-colour: #fa9494;
    --danger-background: #570000;
  }
}

/* Basic reset on elements */
h1, h2, h3, h4, p, table, div, body, button {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  color: inherit;
  vertical-align: baseline;
}

/* Make the page a little more airy */
body {
  margin: 0px;
  padding: 0px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
}

/* Try to use system default fonts. */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans",
               "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

code, pre, kbd, .parameter, .type, .definition-name {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* Some definitions of basic tags */
code {
  color: var(--code-colour);
  background-color: var(--background-2);
}

.reference > code {
  color: inherit;
  background-color: inherit;
}

p, .admonition {
  margin: 0.9em 0;
}
p:last-child, .admonition:last-child { margin-bottom: 0 }

h1 {
  font-size: 2.2em;
  font-weight: 300;
  border-bottom: solid 1px #aaa;
}

h2, h3, h4 { margin: 1.4em 0 0.3em;}
h2 { font-size: 1.25em; }
h3 { font-size: 1.15em; font-weight: bold; }
h4 { font-size: 1.06em; }

a, a:focus, a:visited, a:active { font-weight: bold; color: var(--link-colour); text-decoration: none; }
a:active { outline: none; }
a:hover, a:focus { text-decoration: underline; }

blockquote {
  padding: 0.3em;
  margin: 1em 0;
  background: var(--background-2);
  border-left: solid 0.5em #ccc;
}

img {
  display: inline-block;
  max-width: 100%;
}

table, pre {
  width: 100%;
  overflow-x: auto;
  display: block;
}

pre {
  background: var(--background-2);
  padding: 2px;
  font-size: 0.9em;
}

/* Stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }

/* Make the target distinct; helps when we're navigating to a function */
h1:target, h2:target, h3:target, h4:target, h5:target, h6:target, a:target + * { background-color: var(--highlight-header-colour); }

/* Allow linking to any subsection */
a[name]::before, a.anchor::before { content: "§"; }

/* Layout */
nav {
  width: var(--nav-width);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;

  overflow-y: auto;

  font-size: 0.9em;
}

nav, nav .nav-links {
  overflow-x: hidden;
  scrollbar-width: thin;
}

nav, nav #nav-reveal, nav .nav-links {
  background-color: var(--background-2);
  z-index: 10;
}
nav h1, nav h1 a, nav h1 img { box-sizing: border-box; }
nav h1, nav h1 a { width: 100%; }
nav h1 img {
  display: block;
  margin: 0 auto;
  padding: 10px;
}
nav h1 { padding: 0em 10px; }

nav #nav-reveal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: var(--mobile-nav-height);
  width: var(--mobile-reveal-width);
  padding: 5px;
  font-size: 1.3em;

  border-right: solid 1px var(--reveal-border);
  border-bottom: solid 1px var(--reveal-border);
  cursor: pointer;
  outline: none;
}
nav #nav-reveal:focus { border-color: #333; }

nav h2 {
  background-color: var(--sidebar-header);
  font-size: 1.1em;
  padding: 5px 10px;
  margin-top: 0.5em;

  cursor: pointer;
}

nav h2:hover, nav h2.collapsed:hover { background-color: var(--sidebar-header-hover); }
nav h2.collapsed { background-color: var(--sidebar-header-collapsed); }
nav h2.collapsed + ul { display: none; }

nav h2::after { content: "▲"; float: right; }
nav h2.collapsed::after { content: "▼"; }

nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

nav ul .sidebar-link {
  display: block;
  padding: 0 10px;
}

nav ul .sidebar-link:hover { background-color: var(--sidebar-header-hover); }
nav ul .sidebar-link.selected { background-color: var(--sidebar-header); }

#main {
  margin-left: var(--nav-width);
  padding: 15px;
  box-sizing: border-box;

  min-height: 100vh;
  max-width: 1000px;

  display: flex;
  flex-direction: column;
}

@media (max-width: 800px) {
  nav {
    position: initial;
    height: var(--mobile-nav-height);
    width: 100%;
  }

  nav h1 {
    margin-left: var(--mobile-reveal-width);
    border-bottom: none;
  }
  nav h1, nav h1 img { height: 100%; }
  nav h1 img { margin: 0; padding: 5px; }

  nav #nav-reveal {
    display: block;
  }

  nav .nav-links {
    display: none;
    border-right: solid var(--reveal-border) 1px;

    width: var(--nav-width);
    overflow-y: scroll;

    position: fixed;
    top: var(--mobile-nav-height);
    bottom: 0;
    left: 0;

  }

  /* This is terrible, but I've not found a better way. */
  nav.nav-links-visible {
    position: fixed;
    border-bottom: solid var(--reveal-border) 1px;
  }
  nav.nav-links-visible .nav-links { display: block; }
  nav.nav-links-visible + #main { margin-top: var(--mobile-nav-height); }

  #main {
    margin-left: 0px;
    position: relative;
  }
}

#content {
  flex-grow: 1;
}

footer {
  text-align: right;
  font-size: 0.8em;
}

/* The definition lists at the top of each page */
table.definition-list {
  border-collapse: collapse;
}

table.definition-list td, table.definition-list th {
  border: 1px solid #cccccc;
  padding: 5px;
}

table.definition-list th {
  background-color: var(--background-2);
  min-width: 200px;
  white-space: nowrap;
  text-align: right;
}

/* Deprecated definitions */
table.definition-list tr.definition-deprecated th {
  text-decoration: line-through;
}

table.definition-list td { width: 100%; }

dl.definition dt {
  border-top: 1px solid #ccc;
  padding-top: 1em;
  display: flex;
}

dl.definition dt .definition-name {
  padding: 0 0.1em;
  margin: 0 0.1em;
  flex-grow: 1;
}

dl.definition dt .definition-name.definition-deprecated {
  text-decoration: line-through;
}

dl.definition dd {
  padding-bottom: 1em;
  margin: 10px 0 0 20px;
}

dl.definition h3 {
  font-size: .95em;
}

/* Links to source-code */
.source-link { font-size: 0.8em; }
.source-link::before { content: '[' }
.source-link::after  { content: ']' }
a.source-link, a.source-link:visited, a.source-link:active { color: var(--source-link-colour); }

/* Method definitions */
span.parameter:after, span.type-sep { content:":"; padding-left: 0.3em; }
.optional { text-decoration: underline dotted; }
.default-value code { background: none; }

/** Fancy colour display. */
.color-ref {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin: 0.1em 0.1em 0.3em 0.1em; /* Terrrible hack to force vertical alignment. */
  border: solid 1px black;
  box-sizing: border-box;
  vertical-align: middle;
}

/** Fancy keyboard shortcut styling, inspired by GitHub markdown. */
kbd {
  display: inline-block;
  padding: 4px 5px;
  font-size: 0.8em;
  line-height: 10px;
  color: #444d56;
  vertical-align: middle;
  background-color: #fafbfc;
  border: 1px solid #d1d5da;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #d1d5da;
}

/* styles for prettification of source */
.highlight .comment { color: #558817; }
.highlight .constant { color: #a8660d; }
.highlight .escape { color: #844631; }
.highlight .keyword { color: #aa5050; font-weight: bold; }
.highlight .library { color: #0e7c6b; }
.highlight .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
.highlight .string { color: #8080ff; }
.highlight .literal-kw { color: #8080ff; }
.highlight .number { color: #f8660d; }
.highlight .operator { color: #2239a8; font-weight: bold; }
.highlight .preprocessor, pre .prepro { color: #a33243; }
.highlight .global { color: #800080; }
.highlight .user-keyword { color: #800080; }
.highlight .prompt { color: #558817; }
.highlight .url { color: #272fc2; text-decoration: underline; }

.highlight a {
  color: inherit;
  font-weight: normal;
}

.admonition {
  color: var(--admonition-colour);
  background: var(--admonition-background);
  padding: 0.5em;
}

.admonition-heading {
  text-transform: uppercase;
  font-weight: bold;
  padding: 0;
  margin: 0;
}

.admonition {
  background: var(--admonition-background);
  color: var(--admonition-colour);
  border-left: solid 4px var(--admonition-colour);
}

.admonition-note {
  --admonition-background: var(--note-background);
  --admonition-colour: var(--note-colour);
}

.admonition-info {
  --admonition-background: var(--info-background);
  --admonition-colour: var(--info-colour);
}

.admonition-tip {
  --admonition-background: var(--tip-background);
  --admonition-colour: var(--tip-colour);
}

.admonition-warning {
  --admonition-background: var(--warning-background);
  --admonition-colour: var(--warning-colour);
}

.admonition-danger {
  --admonition-background: var(--danger-background);
  --admonition-colour: var(--danger-colour);
}

#search-form {
  position: relative;
  margin: 0.3em 0 1em 0;
}

#search-form > input {
  box-sizing: border-box;
  font-size: initial;
  padding: 0.5em;
  width: 100%;
}

#search-results {
  display: none;

  position: absolute;
  width: 100%;
  background-color: var(--background-2);
  box-sizing: border-box;

  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

#search-results > ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

#search-results > ul > li.active > a.search-result {
  background-color: var(--sidebar-header);
}

a.search-result {
  padding: 0.5em;
  display: block;
}
a.search-result, a.search-result:focus, a.search-result:visited, a.search-result:active {
  font-weight: inherit;
  color: inherit;
}
a.search-result:hover, a.search-result:focus {
  text-decoration: initial;
  background-color: var(--sidebar-header-hover);
}

.search-result > h3 {
  margin: 0;
  font-weight: normal;
}

.search-result > .search-page { font-size: 0.8em; }
.search-result > .search-summary {
  margin: 0;
}

.search-result .search-match { font-weight: bold; }

.search-error {
  padding: 0.5em;

  color: var(--danger-colour);
  background: var(--danger-background);
}


#search-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  background: rgba(0, 0, 0, 0.5);

  opacity: 0;
  transition: opacity ease 400ms, width 0s 400ms, height 0s 400ms;

  z-index: 11;
}

body.searching #search-form { z-index: 12; }

body.searching #search-results { display: block; }
body.searching #search-overlay {
  opacity: 1;
  width: 100%; height: 100%;
  transition: opacity ease 400ms, width 0s, height 0s;
}

/* Footnotes */
section[role=doc-endnotes] {
  border-top: solid 1px var(--foreground);
  font-size: 0.8em;
}

section[role=doc-endnotes] > ol > li::marker {
  font-weight: bold;

}
:root {
    --nav-width: 200px;

    --mobile-reveal-width: 3rem;
    --mobile-nav-height: 3rem;
    --reveal-border: #777;

    --foreground: #222;
    --background: #fff;
    --background-2: #f0f0f0;

    --link-colour: #004080;
    --code-colour: #c7254e;
    --source-link-colour: #505050;

    --sidebar-header: #d7d7d7;
    --sidebar-header-hover: #d0d0d0;
    --sidebar-header-collapsed: #e7e7e7;

    --highlight-header-colour: #FFFF99;

    --note-colour: var(--foreground);
    --note-background: #ebebeb;

    --info-colour: #005377;
    --info-background: #b3e8ff;

    --tip-colour: #00421c;
    --tip-background: #8df3b8;

    --warning-colour: #664d03;
    --warning-background: #fff3cd;

    --danger-colour: #3a0000;
    --danger-background: #ffb4b4;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --foreground: #fff;
      --background: #2f2f2f;
      --background-2: #1c1c1c;

      --link-colour: #06cff7;
      --code-colour: #ff7699;
      --source-link-colour: #bdbcbc;

      --sidebar-header: #060606;
      --sidebar-header-hover: #101010;
      --sidebar-header-collapsed: #060606;

      --highlight-header-colour: #000005;

      --note-background: #3d3d3d;

      --info-colour: #6ad2ff;
      --info-background: #00374e;

      --tip-colour: #68f5a2;
      --tip-background: #033518;

      --warning-colour: #e4c04c;
      --warning-background: #4d3900;

      --danger-colour: #fa9494;
      --danger-background: #570000;
    }
  }

  /* Basic reset on elements */
  h1, h2, h3, h4, p, table, div, body, button {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    color: inherit;
    vertical-align: baseline;
  }

  /* Make the page a little more airy */
  body {
    margin: 0px;
    padding: 0px;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
  }

  /* Try to use system default fonts. */
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans",
                 "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  }

  code, pre, kbd, .parameter, .type, .definition-name {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  }

  /* Some definitions of basic tags */
  code {
    color: var(--code-colour);
    background-color: var(--background-2);
  }

  .reference > code {
    color: inherit;
    background-color: inherit;
  }

  p, .admonition {
    margin: 0.9em 0;
  }
  p:last-child, .admonition:last-child { margin-bottom: 0 }

  h1 {
    font-size: 2.2em;
    font-weight: 300;
    border-bottom: solid 1px #aaa;
  }

  h2, h3, h4 { margin: 1.4em 0 0.3em;}
  h2 { font-size: 1.25em; }
  h3 { font-size: 1.15em; font-weight: bold; }
  h4 { font-size: 1.06em; }

  a, a:focus, a:visited, a:active { font-weight: bold; color: var(--link-colour); text-decoration: none; }
  a:active { outline: none; }
  a:hover, a:focus { text-decoration: underline; }

  blockquote {
    padding: 0.3em;
    margin: 1em 0;
    background: var(--background-2);
    border-left: solid 0.5em #ccc;
  }

  img {
    display: inline-block;
    max-width: 100%;
  }

  table, pre {
    width: 100%;
    overflow-x: auto;
    display: block;
  }

  pre {
    background: var(--background-2);
    padding: 2px;
    font-size: 0.9em;
  }

  /* Stop sublists from having initial vertical space */
  ul ul { margin-top: 0px; }
  ol ul { margin-top: 0px; }
  ol ol { margin-top: 0px; }
  ul ol { margin-top: 0px; }

  /* Make the target distinct; helps when we're navigating to a function */
  h1:target, h2:target, h3:target, h4:target, h5:target, h6:target, a:target + * { background-color: var(--highlight-header-colour); }

  /* Allow linking to any subsection */
  a[name]::before, a.anchor::before { content: "§"; }

  /* Layout */
  nav {
    width: var(--nav-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    overflow-y: auto;

    font-size: 0.9em;
  }

  nav, nav .nav-links {
    overflow-x: hidden;
    scrollbar-width: thin;
  }

  nav, nav #nav-reveal, nav .nav-links {
    background-color: var(--background-2);
    z-index: 10;
  }
  nav h1, nav h1 a, nav h1 img { box-sizing: border-box; }
  nav h1, nav h1 a { width: 100%; }
  nav h1 img {
    display: block;
    margin: 0 auto;
    padding: 10px;
  }
  nav h1 { padding: 0em 10px; }

  nav #nav-reveal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    height: var(--mobile-nav-height);
    width: var(--mobile-reveal-width);
    padding: 5px;
    font-size: 1.3em;

    border-right: solid 1px var(--reveal-border);
    border-bottom: solid 1px var(--reveal-border);
    cursor: pointer;
    outline: none;
  }
  nav #nav-reveal:focus { border-color: #333; }

  nav h2 {
    background-color: var(--sidebar-header);
    font-size: 1.1em;
    padding: 5px 10px;
    margin-top: 0.5em;

    cursor: pointer;
  }

  nav h2:hover, nav h2.collapsed:hover { background-color: var(--sidebar-header-hover); }
  nav h2.collapsed { background-color: var(--sidebar-header-collapsed); }
  nav h2.collapsed + ul { display: none; }

  nav h2::after { content: "▲"; float: right; }
  nav h2.collapsed::after { content: "▼"; }

  nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
  }

  nav ul .sidebar-link {
    display: block;
    padding: 0 10px;
  }

  nav ul .sidebar-link:hover { background-color: var(--sidebar-header-hover); }
  nav ul .sidebar-link.selected { background-color: var(--sidebar-header); }

  #main {
    margin-left: var(--nav-width);
    padding: 15px;
    box-sizing: border-box;

    min-height: 100vh;
    max-width: 1000px;

    display: flex;
    flex-direction: column;
  }

  @media (max-width: 800px) {
    nav {
      position: initial;
      height: var(--mobile-nav-height);
      width: 100%;
    }

    nav h1 {
      margin-left: var(--mobile-reveal-width);
      border-bottom: none;
    }
    nav h1, nav h1 img { height: 100%; }
    nav h1 img { margin: 0; padding: 5px; }

    nav #nav-reveal {
      display: block;
    }

    nav .nav-links {
      display: none;
      border-right: solid var(--reveal-border) 1px;

      width: var(--nav-width);
      overflow-y: scroll;

      position: fixed;
      top: var(--mobile-nav-height);
      bottom: 0;
      left: 0;

    }

    /* This is terrible, but I've not found a better way. */
    nav.nav-links-visible {
      position: fixed;
      border-bottom: solid var(--reveal-border) 1px;
    }
    nav.nav-links-visible .nav-links { display: block; }
    nav.nav-links-visible + #main { margin-top: var(--mobile-nav-height); }

    #main {
      margin-left: 0px;
      position: relative;
    }
  }

  #content {
    flex-grow: 1;
  }

  footer {
    text-align: right;
    font-size: 0.8em;
  }

  /* The definition lists at the top of each page */
  table.definition-list {
    border-collapse: collapse;
  }

  table.definition-list td, table.definition-list th {
    border: 1px solid #cccccc;
    padding: 5px;
  }

  table.definition-list th {
    background-color: var(--background-2);
    min-width: 200px;
    white-space: nowrap;
    text-align: right;
  }

  /* Deprecated definitions */
  table.definition-list tr.definition-deprecated th {
    text-decoration: line-through;
  }

  table.definition-list td { width: 100%; }

  dl.definition dt {
    border-top: 1px solid #ccc;
    padding-top: 1em;
    display: flex;
  }

  dl.definition dt .definition-name {
    padding: 0 0.1em;
    margin: 0 0.1em;
    flex-grow: 1;
  }

  dl.definition dt .definition-name.definition-deprecated {
    text-decoration: line-through;
  }

  dl.definition dd {
    padding-bottom: 1em;
    margin: 10px 0 0 20px;
  }

  dl.definition h3 {
    font-size: .95em;
  }

  /* Links to source-code */
  .source-link { font-size: 0.8em; }
  .source-link::before { content: '[' }
  .source-link::after  { content: ']' }
  a.source-link, a.source-link:visited, a.source-link:active { color: var(--source-link-colour); }

  /* Method definitions */
  span.parameter:after, span.type-sep { content:":"; padding-left: 0.3em; }
  .optional { text-decoration: underline dotted; }
  .default-value code { background: none; }

  /** Fancy colour display. */
  .color-ref {
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin: 0.1em 0.1em 0.3em 0.1em; /* Terrrible hack to force vertical alignment. */
    border: solid 1px black;
    box-sizing: border-box;
    vertical-align: middle;
  }

  /** Fancy keyboard shortcut styling, inspired by GitHub markdown. */
  kbd {
    display: inline-block;
    padding: 4px 5px;
    font-size: 0.8em;
    line-height: 10px;
    color: #444d56;
    vertical-align: middle;
    background-color: #fafbfc;
    border: 1px solid #d1d5da;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 #d1d5da;
  }

  /* styles for prettification of source */
  .highlight .comment { color: #558817; }
  .highlight .constant { color: #a8660d; }
  .highlight .escape { color: #844631; }
  .highlight .keyword { color: #aa5050; font-weight: bold; }
  .highlight .library { color: #0e7c6b; }
  .highlight .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
  .highlight .string { color: #8080ff; }
  .highlight .literal-kw { color: #8080ff; }
  .highlight .number { color: #f8660d; }
  .highlight .operator { color: #2239a8; font-weight: bold; }
  .highlight .preprocessor, pre .prepro { color: #a33243; }
  .highlight .global { color: #800080; }
  .highlight .user-keyword { color: #800080; }
  .highlight .prompt { color: #558817; }
  .highlight .url { color: #272fc2; text-decoration: underline; }

  .highlight a {
    color: inherit;
    font-weight: normal;
  }

  .admonition {
    color: var(--admonition-colour);
    background: var(--admonition-background);
    padding: 0.5em;
  }

  .admonition-heading {
    text-transform: uppercase;
    font-weight: bold;
    padding: 0;
    margin: 0;
  }

  .admonition {
    background: var(--admonition-background);
    color: var(--admonition-colour);
    border-left: solid 4px var(--admonition-colour);
  }

  .admonition-note {
    --admonition-background: var(--note-background);
    --admonition-colour: var(--note-colour);
  }

  .admonition-info {
    --admonition-background: var(--info-background);
    --admonition-colour: var(--info-colour);
  }

  .admonition-tip {
    --admonition-background: var(--tip-background);
    --admonition-colour: var(--tip-colour);
  }

  .admonition-warning {
    --admonition-background: var(--warning-background);
    --admonition-colour: var(--warning-colour);
  }

  .admonition-danger {
    --admonition-background: var(--danger-background);
    --admonition-colour: var(--danger-colour);
  }

  #search-form {
    position: relative;
    margin: 0.3em 0 1em 0;
  }

  #search-form > input {
    box-sizing: border-box;
    font-size: initial;
    padding: 0.5em;
    width: 100%;
  }

  #search-results {
    display: none;

    position: absolute;
    width: 100%;
    background-color: var(--background-2);
    box-sizing: border-box;

    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  #search-results > ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
  }

  #search-results > ul > li.active > a.search-result {
    background-color: var(--sidebar-header);
  }

  a.search-result {
    padding: 0.5em;
    display: block;
  }
  a.search-result, a.search-result:focus, a.search-result:visited, a.search-result:active {
    font-weight: inherit;
    color: inherit;
  }
  a.search-result:hover, a.search-result:focus {
    text-decoration: initial;
    background-color: var(--sidebar-header-hover);
  }

  .search-result > h3 {
    margin: 0;
    font-weight: normal;
  }

  .search-result > .search-page { font-size: 0.8em; }
  .search-result > .search-summary {
    margin: 0;
  }

  .search-result .search-match { font-weight: bold; }

  .search-error {
    padding: 0.5em;

    color: var(--danger-colour);
    background: var(--danger-background);
  }


  #search-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    background: rgba(0, 0, 0, 0.5);

    opacity: 0;
    transition: opacity ease 400ms, width 0s 400ms, height 0s 400ms;

    z-index: 11;
  }

  body.searching #search-form { z-index: 12; }

  body.searching #search-results { display: block; }
  body.searching #search-overlay {
    opacity: 1;
    width: 100%; height: 100%;
    transition: opacity ease 400ms, width 0s, height 0s;
  }

  /* Footnotes */
  section[role=doc-endnotes] {
    border-top: solid 1px var(--foreground);
    font-size: 0.8em;
  }

  section[role=doc-endnotes] > ol > li::marker {
    font-weight: bold;

  }
  /* default style put together by 9551 */

  @font-face {
      font-family: Fira;
      src: url(FiraCode-VF.ttf);
  }

  @font-face {
      font-family: Mine;
      src: url(cc.ttf);
  }

  :root {
      --nav-width: 200px;

      --mobile-reveal-width: 3rem;
      --mobile-nav-height: 3rem;
      --reveal-border: #6c6c6c;

      --foreground: #fff;
      --background: #161616;
      --background-2: #232323;

      --link-colour: #00a9ec;
      --code-colour: #cfcfcf;
      --source-link-colour: #505050;

      --sidebar-header: #4e4e4e;
      --sidebar-header-hover: #272727;
      --sidebar-header-collapsed: #525252;

      --highlight-header-colour: #3e3e3e;

      --note-colour: var(--foreground);
      --note-background: #6d6d6d;

      --info-colour: #005377;
      --info-background: #b3e8ff;

      --tip-colour: #00421c;
      --tip-background: #8df3b8;

      --caution-colour: #664d03;
      --caution-background: #fff3cd;

      --warning-colour: #3a0000;
      --warning-background: #ffb4b4;
  }

  @media (prefers-color-scheme: dark) {
      :root {
          --nav-width: 200px;

          --mobile-reveal-width: 3rem;
          --mobile-nav-height: 3rem;
          --reveal-border: #6c6c6c;

          --foreground: #fff;
          --background: #161616;
          --background-2: #232323;

          --link-colour: #00a9ec;
          --code-colour: #cfcfcf;
          --source-link-colour: #505050;

          --sidebar-header: #4e4e4e;
          --sidebar-header-hover: #272727;
          --sidebar-header-collapsed: #525252;

          --highlight-header-colour: #3e3e3e;

          --note-colour: var(--foreground);
          --note-background: #6d6d6d;

          --info-colour: #005377;
          --info-background: #b3e8ff;

          --tip-colour: #00421c;
          --tip-background: #8df3b8;

          --caution-colour: #664d03;
          --caution-background: #fff3cd;

          --warning-colour: #3a0000;
          --warning-background: #ffb4b4;
      }
  }

  /* Basic reset on elements */
  h1,
  h2,
  h3,
  h4,
  p,
  table,
  div,
  body,
  button {
      margin: 0;
      padding: 0;
      border: 0;
      font-size: 100%;
      font: inherit;
      color: inherit;
      vertical-align: baseline;
  }

  /* Make the page a little more airy */
  body {
      margin: 0px;
      padding: 0px;
      line-height: 1.6;
      color: var(--foreground);
      background: var(--background);
  }

  /* Try to use system default fonts. */
  body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  }

  code,
  pre,
  kbd,
  .parameter,
  .reference-code {
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  }

  .type {
      color: rgb(0, 132, 255) !important;
  }

  /* Some definitions of basic tags */
  code {
      color: var(--code-colour);
      font-family: Fira;
      font-weight: bolder;
      background-color: var(--background-2);
  }

  p,
  .admonition {
      margin: 0.9em 0;
  }
  p:last-child,
  .admonition:last-child {
      margin-bottom: 0;
  }

  h1 {
      font-size: 2.2em;
      font-weight: 300;
      border-bottom: solid 1px #aaa;
  }

  h2,
  h3,
  h4 {
      margin: 1.4em 0 0.3em;
  }
  h2 {
      font-size: 1.25em;
  }
  h3 {
      font-size: 1.15em;
      font-weight: bold;
  }
  h4 {
      font-size: 1.06em;
  }

  a,
  a:focus,
  a:visited,
  a:active {
      font-weight: bold;
      color: var(--link-colour);
      text-decoration: none;
  }
  a:active {
      outline: none;
  }
  a:hover,
  a:focus {
      text-decoration: underline;
  }

  blockquote {
      padding: 0.3em;
      margin: 1em 0;
      background: var(--background-2);
      border-left: solid 0.5em #ccc;
  }

  p > img {
      display: inline-block;
      width: calc(30% - 10px);
      margin: 5px;
      box-sizing: border-box;
      vertical-align: top;
      height: auto;
      object-fit: contain;
      min-width: 200px;
  }

  @media (max-width: 700px) {
      p > img {
          width: calc(50% - 10px);
      }
  }

  @media (max-width: 500px) {
      p > img {
          width: calc(100% - 10px);
      }
  }


  table,
  pre {
      width: 100%;
      overflow-x: auto;
      display: block;
  }

  pre {
      background: var(--background-2);
      padding: 2px;
      font-size: 0.9em;
  }

  /* Stop sublists from having initial vertical space */
  ul ul {
      margin-top: 0px;
  }
  ol ul {
      margin-top: 0px;
  }
  ol ol {
      margin-top: 0px;
  }
  ul ol {
      margin-top: 0px;
  }

  /* Make the target distinct; helps when we're navigating to a function */
  a:target + * {
      background-color: var(--highlight-header-colour);
  }

  /* Allow linking to any subsection */
  a[name]::before {
      content: "§";
  }

  /* Layout */
  nav {
      width: var(--nav-width);
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;

      overflow-y: auto;

      font-size: 0.9em;

      font-family: Fira !important;
  }

  nav,
  nav .nav-links {
      overflow-x: hidden;
      scrollbar-width: thin;
  }

  nav,
  nav #nav-reveal,
  nav .nav-links {
      background-color: var(--background-2);
      z-index: 10;
  }
  nav h1,
  nav h1 a,
  nav h1 img {
      box-sizing: border-box;
  }
  nav h1,
  nav h1 a {
      width: 100%;
  }
  nav h1 img {
      display: block;
      margin: 0 auto;
      padding: 10px;
  }
  nav h1 {
      padding: 0em 10px;
  }

  nav #nav-reveal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      height: var(--mobile-nav-height);
      width: var(--mobile-reveal-width);
      padding: 5px;
      font-size: 1.3em;

      border-right: solid 1px var(--reveal-border);
      border-bottom: solid 1px var(--reveal-border);
      cursor: pointer;
      outline: none;
  }
  nav #nav-reveal:focus {
      border-color: #333;
  }

  nav h2 {
      background-color: var(--sidebar-header);
      font-size: 1.1em;
      padding: 5px 10px;
      margin-top: 0.5em;

      cursor: pointer;
  }

  nav h2:hover,
  nav h2.collapsed:hover {
      background-color: var(--sidebar-header-hover);
  }
  nav h2.collapsed {
      background-color: var(--sidebar-header-collapsed);
  }
  nav h2.collapsed + ul {
      display: none;
  }

  nav h2::after {
      content: "▲";
      float: left;
  }
  nav h2.collapsed::after {
      content: "▼";
      float: left;
  }

  nav ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
  }

  nav ul .sidebar-link {
      display: block;
      padding: 0 10px;
  }

  nav ul .sidebar-link:hover {
      background-color: var(--sidebar-header-hover);
  }
  nav ul .sidebar-link.selected {
      background-color: var(--sidebar-header);
  }

  #main {
      margin-left: var(--nav-width);
      padding: 15px;
      box-sizing: border-box;

      min-height: 100vh;
      max-width: 100%;

      display: flex;
      flex-direction: column;
  }

  @media (max-width: 800px) {
      nav {
          position: initial;
          height: var(--mobile-nav-height);
          width: 100%;
      }

      nav h1 {
          margin-left: var(--mobile-reveal-width);
          border-bottom: none;
      }
      nav h1,
      nav h1 img {
          height: 100%;
      }
      nav h1 img {
          margin: 0;
          padding: 5px;
      }

      nav #nav-reveal {
          display: block;
      }

      nav .nav-links {
          display: none;
          border-right: solid var(--reveal-border) 1px;

          width: var(--nav-width);
          overflow-y: scroll;

          position: fixed;
          top: var(--mobile-nav-height);
          bottom: 0;
          left: 0;
      }

      /* This is terrible, but I've not found a better way. */
      nav.nav-links-visible {
          position: fixed;
          border-bottom: solid var(--reveal-border) 1px;
      }
      nav.nav-links-visible .nav-links {
          display: block;
      }
      nav.nav-links-visible + #main {
          margin-top: var(--mobile-nav-height);
      }

      #main {
          margin-left: 0px;
          position: relative;
      }
  }

  #content {
      flex-grow: 1;
      width: 98%;
      height: 98%;
      margin: 0 auto;
  }

  footer {
      text-align: left;
      font-size: 0.8em;
  }

  /* The definition lists at the top of each page */
  table.definition-list {
      border-collapse: collapse;
  }

  table.definition-list td,
  table.definition-list th {
      border: 1px solid #adadad;
      padding: 5px;
  }

  table.definition-list th {
      background-color: var(--background-2);
      min-width: 200px;
      white-space: nowrap;
      text-align: left;
  }

  /* Deprecated definitions */
  table.definition-list tr.definition-deprecated th {
      text-decoration: line-through;
  }

  table.definition-list td {
      width: 100%;
  }

  dl.definition dt {
      border-top: 1px solid #a9a9a9;
      padding-top: 1em;
      display: flex;
  }

  dl.definition dt .definition-name {
      padding: 0 0.1em;
      margin: 0 0.1em;
      flex-grow: 1;
  }

  dl.definition dt .definition-name.definition-deprecated {
      text-decoration: line-through;
  }

  dl.definition dd {
      padding-bottom: 1em;
      margin: 10px 0 0 20px;
  }

  dl.definition h3 {
      font-size: 0.95em;
  }

  /* Links to source-code */
  .source-link {
      font-size: 0.8em;
  }
  .source-link::before {
      content: "[";
  }
  .source-link::after {
      content: "]";
  }
  a.source-link,
  a.source-link:visited,
  a.source-link:active {
      color: var(--source-link-colour);
  }

  /* Method definitions */
  span.parameter:after {
      content: ":";
      padding-left: 0.3em;
  }
  .optional {
      text-decoration: underline dotted;
  }
  .default-value code {
      background: none;
  }

  /** Fancy colour display. */
  .color-ref {
      display: inline-block;
      width: 0.8em;
      height: 0.8em;
      margin: 0.1em 0.1em 0.3em 0.1em; /* Terrrible hack to force vertical alignment. */
      border: solid 1px black;
      box-sizing: border-box;
      vertical-align: middle;
  }

  /** Fancy keyboard shortcut styling, inspired by GitHub markdown. */
  kbd {
      display: inline-block;
      padding: 4px 5px;
      font-size: 0.8em;
      line-height: 10px;
      color: #444d56;
      vertical-align: middle;
      background-color: #fafbfc;
      border: 1px solid #d1d5da;
      border-radius: 3px;
      box-shadow: inset 0 -1px 0 #d1d5da;
  }

  /* styles for prettification of source */

  .highlight {
      font-family: Mine !important;
  }

  .highlight .comment {
      color: #69ac16;
  }
  .highlight .constant {
      color: #bd7313;
  }
  .highlight .escape {
      color: #844631;
  }
  .highlight .keyword {
      color: #c32020;
      font-weight: bold;
  }
  .highlight .library {
      color: #0e7c6b;
  }
  .highlight .marker {
      color: #d1582f;
      background: #fedc56;
      font-weight: bold;
  }
  .highlight .string {
      color: #00bbfa;
  }
  .highlight .literal-kw {
      color: #00b7ff;
  }
  .highlight .number {
      color: #f8660d;
  }
  .highlight .operator {
      color: #2239a8;
      font-weight: bold;
  }
  .highlight .preprocessor,
  pre .prepro {
      color: #a8162c;
  }
  .highlight .global {
      color: #800080;
  }
  .highlight .user-keyword {
      color: #800080;
  }
  .highlight .prompt {
      color: #68b010;
  }
  .highlight .url {
      color: #272fc2;
      text-decoration: underline;
  }

  .highlight a {
      color: inherit;
      font-weight: normal;
  }

  .admonition {
      color: var(--admonition-colour);
      background: var(--admonition-background);
      padding: 0.5em;
  }

  .admonition-heading {
      font-family: Mine;
      font-weight: bolder;
      text-transform: uppercase;
      font-weight: bolder;
      padding: 0;
      margin: 0;
  }

  .admonition {
      background: var(--admonition-background);
      color: var(--admonition-colour);
      border-left: solid 4px var(--admonition-colour);
  }

  .admonition-note {
      --admonition-background: var(--note-background);
      --admonition-colour: var(--note-colour);
  }

  .admonition-info {
      --admonition-background: var(--info-background);
      --admonition-colour: var(--info-colour);
  }

  .admonition-tip {
      --admonition-background: var(--tip-background);
      --admonition-colour: var(--tip-colour);
  }

  .admonition-caution {
      --admonition-background: var(--caution-background);
      --admonition-colour: var(--caution-colour);
  }

  .admonition-warning {
      font-family: Fira;
      font-weight: bolder;
      --admonition-background: var(--warning-background);
      --admonition-colour: var(--warning-colour);
  }

  #search-form {
      position: relative;
      margin: 0.3em 0 1em 0;
      color:rgb(228 228 228 / 1) !important;
  }

  #search-form > input {
      box-sizing: border-box;
      font-size: initial;
      padding: 0.5em;
      width: 100%;
      background-color: rgba(40, 40, 40, 180);
      color: rgba(255,255,255,180);
      font-family: Fira;
      font-weight: 900;
  }

  #search-results {
      display: none;

      position: absolute;
      width: 100%;
      background-color: var(--background-2);
      box-sizing: border-box;

      max-height: calc(100vh - 100px);
      overflow-y: auto;
  }

  #search-results > ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
  }

  #search-results > ul > li.active > a.search-result {
      background-color: var(--sidebar-header);
  }

  a.search-result {
      padding: 0.5em;
      display: block;
  }
  a.search-result,
  a.search-result:focus,
  a.search-result:visited,
  a.search-result:active {
      font-weight: inherit;
      color: inherit;
  }
  a.search-result:hover,
  a.search-result:focus {
      text-decoration: initial;
      background-color: var(--sidebar-header-hover);
  }

  .search-result > h3 {
      margin: 0;
      font-weight: normal;
  }

  .search-result > .search-page {
      font-size: 0.8em;
  }
  .search-result > .search-summary {
      margin: 0;
  }

  .search-result .search-match {
      font-weight: bold;
  }

  .search-error {
      padding: 0.5em;

      color: var(--warning-colour);
      font-family: Mine;
      font-weight: bolder;
      background: var(--warning-background);
  }

  #search-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 0;
      height: 0;
      background: rgba(0, 0, 0, 0.5);

      opacity: 0;
      transition: opacity ease 400ms, width 0s 400ms, height 0s 400ms;

      z-index: 11;
  }

  body.searching #search-form {
      z-index: 12;
  }

  body.searching #search-results {
      display: block;
  }
  body.searching #search-overlay {
      opacity: 1;
      width: 100%;
      height: 100%;
      transition: opacity ease 400ms, width 0s, height 0s;
  }
  /* Pretty tables, mostly inherited from table.definition-list */
  table.pretty-table {
      border-collapse: collapse;
      width: 100%;
  }

  table.pretty-table td,
  table.pretty-table th {
      border: 1px solid #cccccc;
      padding: 2px 4px;
  }

  table.pretty-table th {
      background-color: var(--background-2);
  }

  pre.highlight.highlight-lua {
      position: relative;
      background: var(--background-2);
      padding: 2px;
  }

  .example-run {
      position: absolute;
      top: 0;
      right: 0;
      background: #058e05;
      color: #fff;
      padding: 2px 5px;
  }

  .example-window {
      position: fixed;
      z-index: 200;
      top: 0px;
      top: 0px;
  }

  /* Behold, the most cursed CSS! copy-cat's resizing algorithm is a weird, in
       that it basically does "wrapper height - 40px" to determine the effective
       size. But the footer is actually 1em+6px high, so we need to do very weird
       things.
       Yes, it should probably be fixed on the copy-cat side.
     */
  .computer-container {
      width: 620px;
      height: calc(350px + 40px);
      margin-top: calc((1em + 6px - 40px) / 2);
  }

  .example-window-hidden {
      display: none;
  }

  .titlebar {
      display: flex;
      background: #dede6c;
      height: 30px;
  }

  .titlebar-drag {
      flex-grow: 1;
      cursor: grab;
  }

  .titlebar-close {
      background: none;
      padding: 0px 5px;
      border: none;
      border-radius: 0px;
      margin: 0px;
      font-size: 15px;
  }

  .titlebar-close:hover {
      background: #cc4c4c;
  }

  @media (max-width: 700px) {
      .computer-container {
          width: 314px;
          height: calc(179px + 40px);
      }

      .titlebar {
          height: 20px;
      }
      .titlebar-close {
          font-size: 7px;
      }
  }
