:root {
  font-size: 1em;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: "Source Code Pro", monospace;
  --tx-color: #141414;
  --bg-color: #ffffff;
  --link-color: #2A6286;
  --sidebar-sh-color: rgba(0, 0, 0, 0.09);
  --sidebar-pkg-bg-color: #f1f1f1;
  --sidebar-pkglnk-tx-color: #141414;
  --sidebar-pkglnk-tx-color-hover: #fff;
  --sidebar-pkglnk-tx-color-active: #000;
  --sidebar-pkglnk-bg-color: transparent;
  --sidebar-pkglnk-bg-color-hover: #555;
  --sidebar-pkglnk-bg-color-active: #FFBB4D;
  --search-bg-color: #f3f3f3;
  --search-bg-color-focus: #ffffff;
  --search-sh-color: rgba(0, 0, 0, 0.18);
  --help-sh-color: rgba(0, 0, 0, 0.75);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

/* layout */

.canvas {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: var(--ui);
  color: var(--tx-color);
  background-color: var(--bg-color);
}

.flex-main {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  z-index: 100;
}

.flex-filler {
  flex-grow: 1;
  flex-shrink: 1;
}

.flex-left {
  width: 12rem;
  max-width: 15vw;
  min-width: 9.5rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overflow-wrap: break-word;
  flex-shrink: 0;
  flex-grow: 0;
  z-index: 300;
}

.flex-right {
  display: flex;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex-grow: 1;
  flex-shrink: 1;
  z-index: 200;
}

.flex-right>.wrap {
  width: 60rem;
  max-width: 85vw;
  flex-shrink: 1;
}

.help-modal {
  z-index: 400;
}

/* sidebar */

.sidebar {
  font-size: 1rem;
  background-color: var(--bg-color);
  box-shadow: 0 0 1rem var(--sidebar-sh-color);
}

.sidebar .logo {
  padding: 1rem 0.35rem 0.35rem 0.35rem;
}

.sidebar .logo>svg, .sidebar .logo>img {
  display: block;
  overflow: visible;
}

.sidebar .logo>img {
  width: 100%;
}

.sidebar h2 {
  margin: 0.5rem;
  padding: 0;
  font-size: 1.2rem;
}

.sidebar h2>span {
  border-bottom: 0.125rem dotted var(--tx-color);
}

.sidebar .packages {
  list-style-type: none;
  margin: 0;
  padding: 0;
  background-color: var(--sidebar-pkg-bg-color);
}

.sidebar .packages>li>a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--sidebar-pkglnk-tx-color);
  background-color: var(--sidebar-pkglnk-bg-color);
  text-decoration: none;
}

.sidebar .packages>li>a:hover {
  color: var(--sidebar-pkglnk-tx-color-hover);
  background-color: var(--sidebar-pkglnk-bg-color-hover);
}

.sidebar .packages>li>a.active {
  color: var(--sidebar-pkglnk-tx-color-active);
  background-color: var(--sidebar-pkglnk-bg-color-active);
}

.sidebar p.str {
  margin: 0.5rem;
  font-family: var(--mono);
}

/* docs section */

.docs {
  padding: 1rem 0.7rem 2.4rem 1.4rem;
  font-size: 1rem;
  background-color: var(--bg-color);
  overflow-wrap: break-word;
}

.docs .search {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.5rem;
  font-size: 1rem;
  font-family: var(--ui);
  color: var(--tx-color);
  background-color: var(--search-bg-color);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom-width: 0.125rem;
  border-bottom-style: solid;
  border-bottom-color: var(--tx-color);
  outline: none;
  transition: border-bottom-color 0.35s, background 0.35s, box-shadow 0.35s;
  border-radius: 0;
  -webkit-appearance: none;
}

.docs .search:focus {
  background-color: var(--search-bg-color-focus);
  border-bottom-color: #ffbb4d;
  box-shadow: 0 0.3em 1em 0.125em var(--search-sh-color);
}

.docs .search::placeholder {
  font-size: 1rem;
  font-family: var(--ui);
  color: var(--tx-color);
  opacity: 0.5;
}

.docs a {
  color: var(--link-color);
}

.docs p {
  margin: 0.8rem 0;
}

.docs pre {
  font-family: var(--mono);
  font-size: 1em;
  background-color: #F5F5F5;
  padding: 1em;
  overflow-x: auto;
}

.docs code {
  font-family: var(--mono);
  font-size: 1em;
}

.docs h1 {
  font-size: 1.4em;
  margin: 0.8em 0;
  padding: 0;
  border-bottom: 0.0625rem dashed;
}

.docs h2 {
  font-size: 1.3em;
  margin: 0.5em 0;
  padding: 0;
  border-bottom: 0.0625rem solid;
}

#listNav {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #f1f1f1;
}

#listNav li {
  float: left;
}

#listNav li a {
  display: block;
  color: #000;
  text-align: center;
  padding: .5em .8em;
  text-decoration: none;
}

#listNav li a:hover {
  background-color: #555;
  color: #fff;
}

#listNav li a.active {
  background-color: #FFBB4D;
  color: #000;
}

#listSearchResults li.selected {
  background-color: #93e196;
}

#tableFnErrors dt {
  font-weight: bold;
}

.examples {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.examples li {
  padding: 0.5em 0;
  white-space: nowrap;
  overflow-x: auto;
}

.docs td {
  margin: 0;
  padding: 0.5em;
  max-width: 27em;
  text-overflow: ellipsis;
  overflow-x: hidden;
}

/* help dialog */

.help-modal {
  display: flex;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(0.3em);
}

.help-modal>.dialog {
  max-width: 97vw;
  max-height: 97vh;
  overflow: auto;
  font-size: 1rem;
  color: #fff;
  background-color: #333;
  border: 0.125rem solid #000;
  box-shadow: 0 0.5rem 2.5rem 0.3rem var(--help-sh-color);
}

.help-modal h1 {
  margin: 0.75em 2.5em 1em 2.5em;
  font-size: 1.5em;
  text-align: center;
}

.help-modal dt, .help-modal dd {
  display: inline;
  margin: 0 0.2em;
}

.help-modal dl {
  margin-left: 0.5em;
  margin-right: 0.5em;
}

.help-modal kbd {
  display: inline-block;
  padding: 0.3em 0.2em;
  font-size: 1.2em;
  font-size: var(--mono);
  line-height: 0.8em;
  vertical-align: middle;
  color: #000;
  background-color: #fafbfc;
  border-color: #d1d5da;
  border-bottom-color: #c6cbd1;
  border: solid 0.0625em;
  border-radius: 0.1875em;
  box-shadow: inset 0 -0.0625em 0 #c6cbd1;
  cursor: default;
}

/* tokens */

.tok-kw {
  color: #333;
  font-weight: bold;
}

.tok-str {
  color: #d14;
}

.tok-builtin {
  color: #0086b3;
}

.tok-comment {
  color: #777;
  font-style: italic;
}

.tok-fn {
  color: #900;
  font-weight: bold;
}

.tok-null {
  color: #008080;
}

.tok-number {
  color: #008080;
}

.tok-type {
  color: #458;
  font-weight: bold;
}

/* dark mode */

@media (prefers-color-scheme: dark) {
  :root {
    --tx-color: #bbb;
    --bg-color: #111;
    --link-color: #88f;
    --sidebar-sh-color: rgba(128, 128, 128, 0.09);
    --sidebar-pkg-bg-color: #333;
    --sidebar-pkglnk-tx-color: #fff;
    --sidebar-pkglnk-tx-color-hover: #fff;
    --sidebar-pkglnk-tx-color-active: #000;
    --sidebar-pkglnk-bg-color: transparent;
    --sidebar-pkglnk-bg-color-hover: #555;
    --sidebar-pkglnk-bg-color-active: #FFBB4D;
    --search-bg-color: #3c3c3c;
    --search-bg-color-focus: #000;
    --search-sh-color: rgba(255, 255, 255, 0.28);
    --help-sh-color: rgba(142, 142, 142, 0.5);
  }
  .docs pre {
    background-color: #2A2A2A;
  }
  #listNav {
    background-color: #333;
  }
  #listNav li a {
    color: #fff;
  }
  #listNav li a:hover {
    background-color: #555;
    color: #fff;
  }
  #listNav li a.active {
    background-color: #FFBB4D;
    color: #000;
  }
  #listSearchResults li.selected {
    background-color: #000;
  }
  #listSearchResults li.selected a {
    color: #fff;
  }
  .tok-kw {
    color: #eee;
  }
  .tok-str {
    color: #2e5;
  }
  .tok-builtin {
    color: #ff894c;
  }
  .tok-comment {
    color: #aa7;
  }
  .tok-fn {
    color: #e33;
  }
  .tok-null {
    color: #ff8080;
  }
  .tok-number {
    color: #ff8080;
  }
  .tok-type {
    color: #68f;
  }
}

@media only screen and (max-width: 750px) {
  .canvas {
    overflow: auto;
  }
  .flex-main {
    flex-direction: column;
    display: block;
  }
  .sidebar {
    min-width: calc(100vw - 2.8rem);
    padding-left: 1.4rem;
    padding-right: 1.4rem;
  }
  .logo {
    max-width: 6.5rem;
  }
  .flex-main>.flex-filler {
    display: none;
  }
  .flex-main>.flex-right>.flex-filler {
    display: none;
  }
  .flex-main>.flex-right>.wrap {
    max-width: 100vw;
  }
  .flex-main>.flex-right>.wrap>.docs {
    padding-right: 1.4rem;
    background: transparent;
  }
  .packages {
    display: flex;
    flex-wrap: wrap;
  }
  .table-container table {
    display: flex;
    flex-direction: column;
  }
  .table-container tr {
    display: flex;
    flex-direction: column;
  }
  .examples {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    margin-left: -1.4rem;
    margin-right: -1.4rem;
  }
  .examples li {
    width: max-content;
    padding-left: 1.4rem;
    padding-right: 1.4rem;
  }
  .mobile-scroll-container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    margin-left: -1.4rem;
    margin-right: -1.4rem;
    max-width: 100vw;
  }
  .mobile-scroll-container>.scroll-item {
    margin-left: 1.4rem;
    margin-right: 1.4rem;
    box-sizing: border-box;
    width: max-content;
    display: inline-block;
    min-width: calc(100% - 2.8rem);
  }
}