/*------------------------------------------------
   Reset
------------------------------------------------*/

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, button, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    line-height: inherit;
    vertical-align: baseline;
}  
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote::before,
blockquote::after {
    content: none;
}
q::before,
q::after {
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
a {
    text-decoration: none;
}
strong {
    font-weight: bold;
}
em {
    font-style: italic;
}
html {
    user-select: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/*------------------------------------------------
   Fonts
------------------------------------------------*/

@font-face {
    font-family: 'source_serif_4';
    src: url('SourceSerif4-Regular.ttf.woff2') format('woff2'),
         url('SourceSerif4-Regular.ttf.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'source_serif_4';
    src: url('SourceSerif4-Bold.ttf.woff2') format('woff2'),
         url('SourceSerif4-Bold.ttf.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'source_serif_4';
    src: url('SourceSerif4-It.ttf.woff2') format('woff2'),
         url('SourceSerif4-It.ttf.woff') format('woff');
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: 'source_serif_4';
    src: url('SourceSerif4-BoldIt.ttf.woff2') format('woff2'),
         url('SourceSerif4-BoldIt.ttf.woff') format('woff');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'source_sans_3';
    src: url('SourceSans3-Regular.ttf.woff2') format('woff2'),
         url('SourceSans3-Regular.ttf.woff2') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'robotobold';
    src: url('roboto-bold-webfont.woff2') format('woff2'),
         url('roboto-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'jetbrains_mono';
    src: url('jetbrainsmono-medium-webfont.woff2') format('woff2'),
         url('jetbrainsmono-medium-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'jetbrains_mono';
    src: url('jetbrainsmono-bold-webfont.woff2') format('woff2'),
         url('jetbrainsmono-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/*------------------------------------------------
   Light mode
------------------------------------------------*/

:root {
    --bg-page: #ffffff;
    --bg-banner: #5d8cac;
    --bg-sidebar: #e0e0e0;
    --bg-popup: #f8f8f8;
    --bg-sidebar-hover: #c8d1d7;
    --bg-sidebar-selected: #eeeeee;
    --bg-code-block: #f4f4f4;
    --bg-highlight: #ffffd0;
    
    --text-banner: #ffffff;
    --text-primary: #181818;
    --text-secondary: #404040;
    --text-toc-heading: #1e3a5f;
    --text-wip: #d73030;
    --text-muted: #909090;
    --text-doc-meta-value: #545454;
    --text-code: #7d7d7d;
    --text-code-inline: #909090;

    --link-color: #269eff;
    --type-color: #28b6b6;
    --symbol-color: #269eff;
    --var-color: #404040;
    --button-background: #dfebf3;

    --border-primary: #181818;
    --border-secondary: #d4d4d4;
    --border-sidebar: #999999;
    --border-popup: #cccccc;
    --border-content: #aaaaaa;
    --border-doc-meta: #d4d4d4;
    --border-table: #e8e8e8;
    --shadow-opacity: 0.05;
    --shadow-popup-opacity: 0.05;
    
    --scrollbar-thumb: #80868b42;
    --caret-icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDEyIDEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogPHBhdGggZD0ibTYgMSA1IDUtNSA1IiBmaWxsPSJub25lIiBzdHJva2U9IiNhYWFhYWEiIHN0cm9rZS13aWR0aD0iMS44Ii8+Cjwvc3ZnPgo=);
}

/*------------------------------------------------
   Dark mode
------------------------------------------------*/

[data-theme="dark"] {
    --bg-page: #1a1a1a;
    --bg-banner: #2a4a67;
    --bg-sidebar: #282828;
    --bg-popup: #181818;
    --bg-sidebar-hover: #2b3945;
    --bg-sidebar-selected: #263339;
    --bg-code-block: #0f0f0f;
    --bg-highlight: #3a3a20;
    
    --text-primary: #e4e4e4;
    --text-secondary: #b0b0b0;
    --text-toc-heading: #c1deff;
    --text-wip: #ff7777;
    --text-muted: #808080;
    --text-doc-meta-value: #b2b2b2;
    --text-code: #a8a8a8;
    --text-code-inline: #a0a0a0;
    
    --link-color: #5dade2;
    --type-color: #48d1cc;
    --symbol-color: #5dade2;
    --var-color: #c0c0c0;
    --button-background: #263339;
    
    --border-primary: #707070;
    --border-secondary: #404040;
    --border-sidebar: #707070;
    --border-popup: #404040;
    --border-content: #404040;
    --border-doc-meta: #404040;
    --border-table: #333333;
    --shadow-opacity: 0.1;
    --shadow-popup-opacity: 0.5;
    
    --scrollbar-thumb: #60606080;
    --caret-icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDEyIDEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogPHBhdGggZD0ibTYgMSA1IDUtNSA1IiBmaWxsPSJub25lIiBzdHJva2U9IiM3MDcwNzAiIHN0cm9rZS13aWR0aD0iMS44Ii8+Cjwvc3ZnPgo=);
}

/*------------------------------------------------
   Page
------------------------------------------------*/

html {
    background: var(--bg-page);
}

.inner-body {
    max-width: 1170px;
    margin-left: auto;
    margin-right: auto;
}

#hamburger {
    display: none;
    position: relative;
    width: 30px;
    height: 30px;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDcuOTM3NSA3LjkzNzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogPHJlY3QgaWQ9InJlY3QxNDAyIiB4PSIxLjA1ODMiIHk9IjMuNDM5NiIgd2lkdGg9IjUuODIwOCIgaGVpZ2h0PSIxLjA1ODMiIHJ5PSIuNTI5MTciIGZpbGw9IiNlMGUwZTAiLz4KIDx1c2UgaWQ9InVzZTE0MDQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTIuMTE2NykiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHhsaW5rOmhyZWY9IiNyZWN0MTQwMiIvPgogPHVzZSB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDQuMjMzMykiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHhsaW5rOmhyZWY9IiN1c2UxNDA0Ii8+Cjwvc3ZnPgo=);
    background-size: 28px 28px;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

#hamburger:hover,
#hamburger.highlight {
    background-color: rgba(255, 255, 255, 0.15);
}

/*------------------------------------------------
   Theme toggle button
------------------------------------------------*/

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Icon via CSS mask - color comes from background-color */
.theme-toggle::before {
    content: '';
    width: 22px;
    height: 22px;
    background-color: var(--text-banner);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z' fill='white'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: background-color 0.2s ease;
}

/* Sun icon (shown in dark mode) */
[data-theme="dark"] .theme-toggle::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='5' fill='white'/%3E%3Cpath d='M12 1L12 3M12 21L12 23M4.22 4.22L5.64 5.64M18.36 18.36L19.78 19.78M1 12L3 12M21 12L23 12M4.22 19.78L5.64 18.36M18.36 5.64L19.78 4.22' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='5' fill='white'/%3E%3Cpath d='M12 1L12 3M12 21L12 23M4.22 4.22L5.64 5.64M18.36 18.36L19.78 19.78M1 12L3 12M21 12L23 12M4.22 19.78L5.64 18.36M18.36 5.64L19.78 4.22' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/*------------------------------------------------
   Content styles
------------------------------------------------*/

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

.content .highlighted {
    background: var(--bg-highlight);
}

.content-parent {
    padding: 10px 20px;
    background: var(--bg-page);
}

.content {
    font-family: "source_serif_4", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.32;
    user-select: text;
}
.content h1 {
    font-family: "robotobold", "Helvetica Neue", Arial, sans-serif;
    font-size: 42px;
    margin-bottom: 20px;
    overflow: visible;
}
.content h1 .right {
    float: right;
    position: relative;
    top: 0;
    text-align: left;
    margin: 8px 0 8px 24px;
    padding: 8px 12px 8px;
    border: 1px solid var(--border-doc-meta);
}
.content h1 .right .meta-label {
    display: block;
    font-family: "source_sans_3", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
}
.content h1 .right .meta-value {
    display: block;
    font-family: "jetbrains_mono", Courier, monospace, sans-serif;
    font-size: 17px;
    line-height: 1.2;
    margin-bottom: 5px;
}
.content h1 .right .meta-value:last-child {
    margin-bottom: 0;
}
.content h1 .right .meta-label:nth-child(3) {
    margin-top: 3px;
}
.content h1 .right .meta-label {
    color: var(--text-muted);
}
.content h1 .right .meta-value {
    color: var(--text-doc-meta-value);
}
.content h2 {
    font-family: "robotobold", "Helvetica Neue", Arial, sans-serif;
    font-size: 31px;
    margin-top: 50px;
    margin-bottom: 28px;    
    border-bottom: 1px solid var(--border-secondary);
}
.content h1 code {
    font-family: "jetbrains_mono", Courier, monospace, sans-serif;
    line-height: 1;
}
.content h2 code, .content h3 code {
    font-family: "jetbrains_mono", Courier, monospace, sans-serif;
    font-weight: bold;
    line-height: 1;
}
.content h2 code {
    font-size: 30px;
}
.content h3 {
    font-family: "robotobold", "Helvetica Neue", Arial, sans-serif;
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 19px;    
}
.content p {
    margin-bottom: 20px;
}
.content code {
    font-family: "jetbrains_mono", Courier, monospace, sans-serif;
    font-size: 83%;
}
.content p code, .content ul code {
    color: var(--text-code-inline);
}
.content pre {
    font-family: "jetbrains_mono", Courier, monospace, sans-serif;
    padding: 6px 16px;
    margin-bottom: 1.5em;
    color: var(--text-code);
    background-color: var(--bg-code-block);
    overflow-x: auto;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    font-size: 95%;
    line-height: 1.1;
}
.content pre::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
}
.content ul {
    margin-left: 48px;
    margin-bottom: 1.5em;
    list-style-type: disc;
}
.content .type {
    color: var(--type-color);
}
.content .symbol {
    color: var(--symbol-color);
}
.content .var {
    color: var(--var-color);
}
.content .caption {
    font-size: 14px;
    font-family: "source_sans_3", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-muted);
    margin-left: 13px;
}
.content .caption code {
    font-size: 12px;
}

/*------------------------------------------------
   API tables
------------------------------------------------*/

.content table.api {
    border: 2px solid var(--border-table);
    border-collapse: separate;    
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -ms-border-radius: 10px;
    -o-border-radius: 10px;
    border-radius: 10px;
    margin: 32px auto 36px auto;
    color: var(--text-muted);
    max-width: 90%;
    line-height: 1.2;
}
.content table.api td.prefix {
    text-align: right;
    padding-left: 16px;
}
.content table.api td.suffix {
    padding-right: 16px;
}
.content table.api tr:not(:first-child) td.heading {
    border-top: 2px solid var(--border-table);
}
.content table.api tr.heading + tr.entry td {
    padding-top: 6px;
}
.content table.api tr.heading + tr td.template {
    padding-top: 6px;
}
/* Single-category API tables get extra top breathing room without affecting multi-category tables. */
.content table.api.single-group tr.heading + tr.entry td {
    padding-top: 14px;
}
.content table.api.single-group tr.heading + tr td.template {
    padding-top: 14px;
}
.content table.api.single-group tr.entry:first-child td {
    padding-top: 14px;
}
.content table.api.single-group tr:first-child td.template {
    padding-top: 14px;
}
.content table.api tr.entry:has(+ tr td.heading) td {
    padding-bottom: 14px;
}
.content table.api tr.entry:first-child td {
    padding-top: 6px;
}
.content table.api tr:first-child td.template {
    padding-top: 6px;
}
.content table.api tr.entry:last-child td {
    padding-bottom: 14px;
}
.content table.api td.template {
    padding: 0px 16px;
}
.content table.api td.heading {
    font-size: 14px;
    font-family: "source_sans_3", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-muted);
    padding: 0px 8px 4px 8px;
}

/*------------------------------------------------
   API definitions
------------------------------------------------*/

.content dl.api_defs dt code {
    color: var(--text-muted);
}
.content dl.api_defs dt {
    margin-bottom: 14px;
    margin-top: 24px;
    line-height: 1.2;
}
.content dl.api_defs dd {
    margin-left: 32px;
    margin-bottom: 32px;
}

/*------------------------------------------------
   Grid tables
------------------------------------------------*/

.content table.grid {
    border-collapse: collapse;
    margin: 0 auto 1.5em auto;
    color: var(--text-secondary);
}
.content table.grid td {
    border: 2px solid var(--border-table);
    padding: 0px 8px;
}

/*------------------------------------------------
   Directory/TOC shared styles
------------------------------------------------*/

.directory ul {
    line-height: 1.45;
    overflow: hidden;
}
.directory span.caret-down::before {
    -ms-transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
}
.directory .nested {
    display: none;
    height: 0px;
}
.directory .active {
    display: block;
    height: auto;
}
.directory span.caret {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
}
.directory span.caret::before {
    content: var(--caret-icon);
    position: absolute;
    left: -16px;
    transform-origin: 55% 50%;
    transition: transform 0.1s linear;
}
.directory li {
    padding-left: 22px;
}
.directory ul ul li {
    padding-left: 40px;
}
.directory ul ul ul li {
    padding-left: 58px;
}
.directory ul ul ul ul li {
    padding-left: 76px;
}
.directory ul ul ul ul ul li {
    padding-left: 92px;
}
.directory ul ul ul ul ul ul li {
    padding-left: 112px;
}
.directory li.selected > span:first-child {
    font-weight: bold;
}
.directory li.selectable:hover {
    background: var(--bg-sidebar-hover);
    border-radius: 6px;
}
.directory a {
    color: inherit;
}
.directory .toc-header {
    margin-left: 5px;
    color: var(--text-muted);
}

.directory .toc-heading {
    margin: 16px 0px 8px 22px;
    font-family: "robotobold", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: var(--text-toc-heading);
}

.scroller {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    height: 100%;
    transform-origin: top right;
}

.scroller .inner {
    margin: 8px 2px 8px 6px;
    white-space: nowrap;
}
.scroller ul {
    margin-bottom: 0px;
}

.scroller::-webkit-scrollbar, scrollbar {
    width: 8px;
}

.scroller::-webkit-scrollbar-thumb, scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.mobile-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0px 16px 5px;
    border-bottom: 1px solid var(--border-secondary);
    margin-bottom: 4px;
}

.mobile-nav a {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 14px;
}

.mobile-nav .nav-link {
    padding: 4px 8px;
    border-radius: 4px;
}

.mobile-nav .nav-link:hover {
    background: var(--bg-sidebar-hover);
}

.mobile-nav .theme-toggle {
    margin-left: auto;
}

.mobile-nav .theme-toggle:hover {
    background: var(--bg-sidebar-hover);
}

.mobile-nav .theme-toggle::before {
    background-color: var(--text-secondary);
}
