:root {
    font-size: 62.5%;
    color-scheme: var(--color-scheme);
}

html {
    font-family: "Open Sans", sans-serif;
    color: var(--fg);
    background-color: var(--bg);
    text-size-adjust: none;
    -webkit-text-size-adjust: none;
}

body {
    margin: 0;
    font-size: 1.6rem;
    overflow-x: hidden;
}

code {
    font-family: var(--mono-font) !important;
    font-size: var(--code-font-size);
    direction: ltr !important;
}

main {
    overflow-wrap: break-word;
}

.table-wrapper {
    overflow-x: auto;
}

h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    font-size: unset;
}

.left { float: left; }
.right { float: right; }
.boring { opacity: 0.6; }
.hide-boring .boring { display: none; }
.hidden { display: none !important; }

h2, h3 { margin-block-start: 2.5em; }
h4, h5 { margin-block-start: 2em; }

.header + .header h3,
.header + .header h4,
.header + .header h5 {
    margin-block-start: 1em;
}

h1:target::before,
h2:target::before,
h3:target::before,
h4:target::before,
h5:target::before,
h6:target::before {
    display: inline-block;
    content: "»";
    margin-inline-start: -3rem;
    width: 3rem;
}

:target {
    scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
}

.page {
    outline: 0;
    padding: 0 var(--page-padding);
    margin-block-start: calc(0rem - var(--menu-bar-height));
}

.page-wrapper {
    box-sizing: border-box;
    background-color: var(--bg);
}

.no-js .page-wrapper,
.js:not(.sidebar-resizing) .page-wrapper {
    transition: margin-left 0.3s ease, transform 0.3s ease;
}

[dir=rtl] .js:not(.sidebar-resizing) .page-wrapper {
    transition: margin-right 0.3s ease, transform 0.3s ease;
}

.content {
    overflow-y: auto;
    padding: 0 0.5rem 5rem 0.5rem;
}

.content main {
    margin-inline-start: auto;
    margin-inline-end: auto;
    max-width: var(--content-max-width);
}

.content p,
.content ol,
.content ul {
    line-height: 1.45em;
}

.content a {
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content img,
.content video {
    max-width: 100%;
}

.content .header:link,
.content .header:visited {
    color: var(--fg);
}

.content .header:visited:hover {
    text-decoration: none;
}

table {
    margin: 0 auto;
    border-collapse: collapse;
}

table td {
    padding: 0.3rem 2rem;
    border: 0.1rem var(--table-border-color) solid;
}

table thead {
    background: var(--table-header-bg);
}

table thead td {
    font-weight: 700;
    border: none;
}

table thead th {
    padding: 0.3rem 2rem;
}

table thead tr {
    border: 0.1rem var(--table-header-bg) solid;
}

table tbody tr:nth-child(2n) {
    background: var(--table-alternate-bg);
}

blockquote {
    margin: 2rem 0;
    padding: 0 2rem;
    color: var(--fg);
    background-color: var(--quote-bg);
    border-block-start: 0.1rem solid var(--quote-border);
    border-block-end: 0.1rem solid var(--quote-border);
}

.warning {
    margin: 2rem;
    padding: 0 2rem;
    border-inline-start: 0.2rem solid var(--warning-border);
}

.warning:before {
    position: absolute;
    width: 3rem;
    height: 3rem;
    margin-inline-start: calc(-1.5rem - 2.1rem);
    content: "ⓘ";
    text-align: center;
    background-color: var(--bg);
    color: var(--warning-border);
    font-weight: bold;
    font-size: 2rem;
}

blockquote .warning:before {
    background-color: var(--quote-bg);
}

kbd {
    background-color: var(--table-border-color);
    border-radius: 0.4rem;
    border: solid 0.1rem var(--theme-popup-border);
    box-shadow: inset 0 -0.1rem 0 var(--theme-hover);
    display: inline-block;
    font-size: var(--code-font-size);
    font-family: var(--mono-font);
    line-height: 1rem;
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

sup {
    line-height: 0;
}

.footnote-definition {
    font-size: 0.9em;
}

.footnote-definition ul,
.footnote-definition ol {
    padding-left: 2rem;
}

.footnote-definition > li {
    position: relative;
}

.footnote-definition > li:target {
    scroll-margin-top: 50vh;
}

.footnote-reference:target {
    scroll-margin-top: 50vh;
}

.footnote-definition > li:target::before {
    border: 0.2rem solid var(--footnote-highlight);
    border-radius: 0.6rem;
    position: absolute;
    top: -0.8rem;
    right: -0.8rem;
    bottom: -0.8rem;
    left: -3.2rem;
    pointer-events: none;
    content: "";
}

@media not (prefers-reduced-motion) {
    .footnote-reference:target {
        animation: fn-highlight 0.8s;
        border-radius: 0.2rem;
    }

    @keyframes fn-highlight {
        from {
            background-color: var(--footnote-highlight);
        }
    }
}

.tooltiptext {
    position: absolute;
    visibility: hidden;
    color: #fff;
    background-color: #333;
    transform: translateX(-50%);
    left: -0.8rem;
    top: -3.5rem;
    font-size: 0.8em;
    text-align: center;
    border-radius: 0.6rem;
    padding: 0.5rem 0.8rem;
    margin: 0.5rem;
    z-index: 1000;
}

.tooltipped .tooltiptext {
    visibility: visible;
}

.chapter li.part-title {
    color: var(--sidebar-fg);
    margin: 0.5rem 0;
    font-weight: bold;
}

.result-no-output {
    font-style: italic;
}

.gel-sidebar {
    border-right: 0.4rem solid #292929;
    width: var(--sidebar-width, 25rem);
}