html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

.book,
.appendix {
  margin: auto;
  width: 100%;
}

@media screen and (min-width: 768px) {
  .book,
  .appendix {
    max-width: 46rem;
  }
}

@media screen and (min-width: 992px) {
  .book,
  .appendix {
    max-width: 55rem;
  }
}

@media screen and (min-width: 1200px) {
  .book,
  .appendix {
    max-width: 55rem;
  }
}

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

pre {
  font-family: monospace;
  font-size: 1em;
}

a {
  background-color: transparent;
}

strong {
  font-weight: bolder;
}

code {
  font-family: monospace;
  font-size: 1em;
}

sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

pre {
  overflow: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  line-height: 1.77777778;
}

@media screen and (min-width: 4000px) {
  html {
    background: #000;
  }

  html body {
    margin: auto;
    max-width: 250rem;
  }
}

@media screen and (max-width: 320px) {
  html {
    font-size: calc(16 / 320 * 100vw);
  }
}

body {
  font-size: 1rem;
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  color: var(--main-text-color);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media screen and (max-width: 767.9px) {
  body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /*
  See: https://developer.mozilla.org/en-US/docs/Web/API/Popover_API

  - :popover-open pseudo-class matches a popover element when it is in the showing state
  - ::backdrop full-screen element placed directly behind popover
  */
  nav.toc-sidebar:popover-open {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(20rem, 85vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--background);
    border: 0;
    border-right: 0.0625rem solid #d8d8d8;
    box-shadow: 0 0 1.5rem rgb(0 0 0 / 0.35);
  }

  nav.toc-sidebar::backdrop {
    background: rgb(0 0 0 / 0.5);
  }
}

a {
  text-decoration: underline;
  color: var(--link-color);
}

ul {
  padding: 0;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 1rem;
  margin-left: 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
}

thead th {
  text-align: left;
}

hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 800;
  line-height: 1.1;
  margin: 1.5rem 0 0.5rem;
}

/*
  Major-second scale see: https://typescale.com/
  rounded to .025rem (0.4px)
*/
h1 {
  font-size: 2rem;
  color: var(--heading-color);
}

h2 {
  font-size: 1.8rem;
  color: var(--heading-color);
}

h3 {
  font-size: 1.6rem;
  color: var(--heading-color);
}

h4 {
  font-size: 1.425rem;
  color: var(--heading-color);
}

h5 {
  font-size: 1.275rem;
  color: var(--small-heading-color);
}

h6 {
  font-size: 1.125rem;
}

:is(.note, .tip, .warning, .caution, .important) h3 {
  font-size: 1.425rem;
}

strong {
  font-weight: bold;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

dt > *:first-child,
dd > *:first-child {
  margin-top: 0;
}

dt > *:last-child,
dd > *:last-child {
  margin-bottom: 0;
}

pre,
code {
  font-family: monospace;
}

code {
  padding: 0.2em 0.4em;
  background: var(--inline-code-background);
  border-radius: 0.375rem;
}

div.book .programlisting,
div.appendix .programlisting {
  border-radius: 0.5rem;
  padding: 1rem;
  overflow: auto;
  background: var(--codeblock-background);
  color: var(--codeblock-text-color);
}

:is(.note, .tip, .warning, .caution, .important) {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow: auto;
  background: #f4f4f4;
}

:is(.note, .tip, .warning, .caution, .important) > .title {
  font-weight: 800;
  line-height: 110%;
  color: inherit;
  margin-bottom: 0;
}

:is(.note, .tip, .warning, .caution, .important) > :first-child {
  margin-top: 0;
}

:is(.note, .tip, .warning, .caution, .important) > :last-child {
  margin-bottom: 0;
}

.note {
  color: var(--note-text-color);
  background: var(--note-background);
}

.tip {
  color: var(--tip-text-color);
  background: var(--tip-background);
}

.important {
  color: var(--important-text-color);
  background: var(--important-background);
}

.warning {
  color: var(--warning-text-color);
  background: var(--warning-background);
}

.caution {
  color: var(--caution-text-color);
  background: var(--caution-background);
}

div.book div.example,
div.appendix div.example {
  margin-top: 1.5em;
}

div.book div.example details,
div.appendix div.example details {
  padding: 5px;
}

div.book div.example details[open],
div.appendix div.example details[open] {
  border: 1px solid #aaa;
  border-radius: 4px;
}

div.book div.example details > summary,
div.appendix div.example details > summary {
  cursor: pointer;
}

div.book br.example-break,
div.appendix br.example-break {
  display: none;
}

div.book div.footnotes > hr,
div.appendix div.footnotes > hr {
  border-color: #d8d8d8;
}

div.book div.footnotes > br,
div.appendix div.footnotes > br {
  display: none;
}

div.book dt,
div.appendix dt {
  margin-top: 1em;
}

div.book code,
div.appendix code {
  -webkit-hyphens: none;
  -moz-hyphens: none;
  hyphens: none;
}

div.book span.command,
div.appendix span.command {
  font-family: monospace;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  hyphens: none;
}

div.book .informaltable th,
div.book .informaltable td,
div.appendix .informaltable th,
div.appendix .informaltable td {
  padding: 0.5rem;
}

div.book .variablelist .term,
div.appendix .variablelist .term {
  font-weight: 500;
}

/*
  This relies on highlight.js applying certain classes on the prompts.
  For more details, see https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html#stylable-scopes
*/
.hljs-meta.prompt_ {
  user-select: none;
  -webkit-user-select: none;
}

:root {
  --sidebar-width: 20rem;
  --header-height: 3rem;
  --background: #fff;
  --main-text-color: #000;
  --link-color: #405d99;
  --heading-color: #6586c8;
  --small-heading-color: #6a6a6a;
  /* NOTE */
  --note-text-color: #0065d2;
  --note-background: #e4f5ff;
  /* TIP */
  --tip-text-color: #188000;
  --tip-background: #e8fae3;
  /* IMPORTANT */
  --important-text-color: #8a3db8;
  --important-background: #fbedff;
  /* WARNING */
  --warning-text-color: #aa4a00;
  --warning-background: #fff0db;
  /* CAUTION */
  --caution-text-color: #be222a;
  --caution-background: #ffebe8;
  --codeblock-background: #f2f8fd;
  --codeblock-text-color: #000;
  --inline-code-background: #818b981f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #242424;
    --main-text-color: #fff;
    --link-color: #6586c8;
    --small-heading-color: #fff;
    /* NOTE */
    --note-text-color: #66c6ff;
    --note-background: #1e2f44;
    /* TIP */
    --tip-text-color: #80e05f;
    --tip-background: #22331d;
    /* IMPORTANT */
    --important-text-color: #ea9dff;
    --important-background: #35273f;
    /* WARNING */
    --warning-text-color: #ffaa00;
    --warning-background: #3c2a13;
    /* CAUTION */
    --caution-text-color: #ff8c84;
    --caution-background: #422522;
    --codeblock-background: #393939;
    --codeblock-text-color: #fff;
    --inline-code-background: #656c7633;
  }

  :is(.note, .tip, .warning, .caution, .important) {
    border: 2px solid;
    font-weight: 400;
  }
}

@font-face {
  font-family: Roboto;
  src:
    url(Roboto.ttf) format("truetype") tech(variations),
    url(Roboto.ttf) format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

div.chapter,
div.page {
  content-visibility: auto;
}

.navheader {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--background);
}

nav.toc-sidebar {
  height: 100%;
  padding: 0 1rem 2rem;
  background-color: var(--background);
  color: var(--main-text-color);
}

/* menu button, shown on mobile, hidden on desktop */
.toc-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.8rem;
  border: 0.0625rem solid #d8d8d8;
  border-radius: 0.25rem;
  background: var(--background);
  color: var(--main-text-color);
  font: inherit;
  cursor: pointer;
  position: fixed;
  top: 0.5rem;
  left: 0.8rem;
  z-index: 2;
}

nav.toc-sidebar .toc {
  margin-bottom: 0;
}

nav.toc-sidebar ol.toc,
nav.toc-sidebar ol.toc ol {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

nav.toc-sidebar ol.toc ol {
  padding-left: 1em;
}

nav.toc-sidebar li {
  margin: 0;
}

nav.toc-sidebar summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  list-style: none;
}

nav.toc-sidebar summary::before {
  content: "▸";
  flex: none;
  font-size: 0.75em;
}
nav.toc-sidebar details[open] > summary::before {
  content: "▾";
}

nav.toc-sidebar a {
  display: block;
  width: 100%;
  padding: 3px 8px;
  border-left: 3px solid transparent;
  border-radius: 3px;
  color: inherit;
  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}
nav.toc-sidebar a:hover {
  background-color: #f2f2f2 !important;
}

nav.toc-sidebar a.active {
  background-color: #d8d8d8;
  border-left-color: #444;
  font-weight: 600;
}
nav.toc-sidebar a.active-trail {
  border-left-color: #bbb;
  background-color: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
  nav.toc-sidebar a:hover {
    /* hover should win over scroll selectors despite beeing less specific */
    background-color: #606060 !important;
  }
  nav.toc-sidebar a.active {
    background-color: #373737;
    border-left-color: #eee;
    font-weight: 600;
  }
  nav.toc-sidebar a.active-trail {
    border-left-color: #eee;
    background-color: #323232;
  }
}

@media screen and (min-width: 768px) {
  body {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--header-height) auto minmax(0, 1fr);
  }

  body:has(> nav.toc-sidebar) {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .navheader {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  nav.toc-sidebar {
    /* un-pop the drawer */
    display: block;
    position: static;
    inset: auto;
    /*  */
    margin: 0;
    grid-column: 1;
    grid-row: 3;
    max-height: none;
    overflow-y: auto;
    border: none;
  }

  /* Hide the toggle button on desktop */
  .toc-toggle {
    display: none;
  }

  main.content {
    grid-column: 1 / -1;
    grid-row: 3;
    overflow-y: auto;
    padding: 0 1rem;
  }

  body:has(> nav.toc-sidebar) main.content {
    grid-column: 2;
  }
}

.manual-header {
  background-color: var(--background);
  border-bottom: 0.0625rem solid #d8d8d8;
  display: flex;
  flex-direction: column;
}

.manual-header--title {
  order: -1;
  padding: 0.5rem 1rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--small-heading-color);
  text-align: center;
}

.manual-header--tabs {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  margin: 0;
  padding: 0;
}

.manual-header--tab {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--main-text-color);
  text-decoration: none;
  border-bottom: 0.1875rem solid transparent;
  border-top: 0.1875rem solid transparent;
  transition: border-bottom-color 0.15s ease;
}

.manual-header--tab:hover {
  border-bottom-color: var(--heading-color);
  color: var(--main-text-color);
}

.manual-header--tab-active {
  border-bottom-color: var(--heading-color);
  color: var(--heading-color);
  font-weight: 700;
}

@media screen and (min-width: 768px) {
  .manual-header {
    height: var(--header-height);
    flex-direction: row;
    align-items: stretch;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .manual-header--title {
    order: 0;
    margin-left: auto;
    padding: 0 1rem;
    align-self: center;
  }

  .manual-header--tabs {
    justify-content: flex-start;
    padding: 0 1rem;
  }
}
