: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:250px}.big-image{max-height:400px;margin:0 auto;display:block}table{border-collapse:collapse;width:100%}table td,table th{border:1px solid #ccc;padding:2px 4px}table th{background-color:var(--background-2)}div.lua-example{position:relative}.example-run{color:#fff;background:#058e05;padding:2px 5px;position:absolute;top:0;right:0}.example-window{z-index:200;position:fixed;top:0}.example-window-hidden{display:none}.example-contents{transform-origin:50%;animation:.3s cubic-bezier(.18,.89,.32,1.28) popup}@keyframes popup{0%{scale:.5}to{scale:1}}@media (prefers-reduced-motion:reduce){.example-contents{animation:none}}.computer-container{width:620px;height:390px;margin-top:calc(.5em - 17px)}.titlebar{background:#dede6c;height:30px;display:flex}.titlebar-drag{cursor:grab;flex-grow:1}.titlebar-close{background:0 0;border:none;border-radius:0;width:30px;margin:0;padding:0 5px;font-size:15px}.titlebar-close:hover{background:#cc4c4c}@media (width<=700px){.computer-container{width:314px;height:219px}.titlebar{height:20px}.titlebar-close{font-size:7px}}:root{--recipe-bg:#ddd;--recipe-fg:#bbb;--recipe-hover:#aaa;--recipe-padding:4px;--recipe-size:32px}@media (prefers-color-scheme:dark){:root{--recipe-bg:#222;--recipe-fg:#444;--recipe-hover:#888}}.recipe-container{flex-wrap:wrap;justify-content:center;gap:1em;margin:1em 0;display:flex}.recipe{padding:var(--recipe-padding);background:var(--recipe-bg);column-gap:var(--recipe-padding);row-gap:var(--recipe-padding);grid-template-rows:auto auto;grid-template-columns:max-content 1fr max-content;display:inline-grid}.recipe-title{color:var(--foreground);grid-column-start:span 3}.recipe-inputs{column-gap:var(--recipe-padding);row-gap:var(--recipe-padding);grid-template-rows:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr;align-items:center;display:inline-grid}.recipe-item{padding:var(--recipe-padding);background-color:var(--recipe-fg)}.recipe-item:hover{background-color:var(--recipe-hover)}.recipe-icon{width:var(--recipe-size);height:var(--recipe-size);max-width:10vw;max-height:10vw;display:block}.recipe-arrow{width:var(--recipe-size);align-self:center;max-width:10vw}.recipe-output{align-self:center;position:relative}.recipe-count{bottom:0;right:var(--recipe-padding);color:#fff;text-shadow:-1px -1px #000,1px -1px #000,-1px 1px #000,1px 1px #000;position:absolute},.GpsRPa_actionButton{color:inherit;font-family:inherit;font-size:1em;line-height:inherit;cursor:pointer;background:0 0;border:none;margin:0;padding:0}.GpsRPa_actionButton.GpsRPa_disabled{cursor:initial;color:#888}.GpsRPa_iconFont{height:1em;overflow:visible}.GpsRPa_terminalView{justify-content:center;align-items:center;height:100%;display:flex;overflow-x:hidden}.GpsRPa_terminalCanvas{image-rendering:optimizeSpeed;image-rendering:-moz-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:-o-crisp-edges;image-rendering:optimize-contrast;-ms-interpolation-mode:nearest-neighbor;display:block}.GpsRPa_terminalBar{color:#000;fill:#000;background:#eee;font-size:.8em}.GpsRPa_terminalInfo,.GpsRPa_terminalButton{padding:3px;display:inline-block}.GpsRPa_terminalButtonsRight{float:right}.GpsRPa_terminalButton:hover{background:#ddd}.GpsRPa_terminalButton.GpsRPa_disabled:hover{background:0 0}.GpsRPa_terminalInput{z-index:-1000;opacity:0;position:absolute}.GpsRPa_terminalProgress{background:#333;height:2px}