/* The documentation loads jb-tokens and this sheet alone: the article is an island, the sidebar and top bar chrome, everything between canvas. */

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

:root {
    /* The application's toolbar height from CustomHeader.kt, not a number of this page's own. */
    --doc-topbar-h: var(--jb-toolbar-h);
    --doc-measure: 720px;
    /* The distance from the sidebar to the article's first character, fixed so the column does not move on resize. */
    --doc-gutter: var(--jb-sp-7);
    /* Where a page's name sits in the sidebar; everything in the tree is positioned from this one number. */
    --doc-nav-indent: var(--jb-sp-5);
}

/* The gutter is held whether a page needs it or not, so paging between a short and long page moves nothing. */
html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--jb-bg-canvas);
    color: var(--jb-fg-secondary);
    font-family: var(--jb-font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--jb-focus);
    outline-offset: 2px;
}

/* The first thing in the tab order, and out of the way until reached, so a keyboard can skip the sidebar. */
.doc-skip {
    position: absolute;
    top: var(--jb-sp-2);
    left: var(--jb-sp-2);
    z-index: 800;
    padding: var(--jb-sp-2) var(--jb-sp-3);
    background: var(--jb-bg-raised);
    border: 1px solid var(--jb-border-raised);
    border-radius: var(--jb-r-md);
    color: var(--jb-fg);
    font-size: 13px;
    transform: translateY(-200%);
}

.doc-skip:focus {
    transform: none;
    text-decoration: none;
}

/* ============================================================= top bar == */

.doc-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--jb-sp-4);
    height: var(--doc-topbar-h);
    padding: 0 var(--jb-sp-4);
    background: var(--jb-bg-toolbar);
    border-bottom: 1px solid var(--jb-border);
}

.doc-brand {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    flex: none;
    color: var(--jb-fg);
    font-size: 14px;
    font-weight: var(--jb-w-semi);
}

.doc-brand:hover {
    text-decoration: none;
}

.doc-brand img {
    width: 20px;
    height: 20px;
    border-radius: var(--jb-r-sm);
}

/* Two marks, one for each ground, the same pair the application's sidebar carries. */
.doc-logo-light,
[data-theme="light"] .doc-logo-dark {
    display: none;
}

[data-theme="light"] .doc-logo-light {
    display: block;
}

.doc-brand-sub {
    color: var(--jb-fg-secondary);
    font-weight: var(--jb-w-normal);
}

.doc-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    flex: none;
    margin-left: auto;
}

.doc-topbar-link {
    padding: 0 var(--jb-sp-3);
    color: var(--jb-fg-secondary);
    font-size: 14px;
    line-height: var(--jb-h-control);
}

.doc-topbar-link:hover {
    color: var(--jb-fg);
    text-decoration: none;
}

.doc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--jb-toolbar-btn);
    height: var(--jb-toolbar-btn);
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--jb-r-md);
    color: var(--jb-fg-icon);
}

.doc-icon-btn:hover {
    background: var(--jb-bg-hover);
}

.doc-icon-btn svg {
    width: var(--jb-icon);
    height: var(--jb-icon);
}

.doc-icon-moon {
    display: none;
}

[data-theme="light"] .doc-icon-moon {
    display: block;
}

[data-theme="light"] .doc-icon-sun {
    display: none;
}

/* ============================================================== search == */

.doc-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    max-width: 420px;
}

.doc-search input {
    width: 100%;
    height: var(--jb-h-control);
    /* Room on the left for the magnifier and on the right for the shortcut, which varies by platform. */
    padding: 0 var(--jb-sp-7) 0 var(--jb-sp-6);
    background: var(--jb-bg-inset);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-md);
    color: var(--jb-fg);
    font-family: inherit;
    font-size: 13px;
}

.doc-search input::placeholder {
    color: var(--jb-fg-placeholder);
}

.doc-search input::-webkit-search-cancel-button {
    display: none;
}

.doc-search-icon {
    position: absolute;
    left: var(--jb-sp-2);
    width: var(--jb-icon);
    height: var(--jb-icon);
    color: var(--jb-fg-tertiary);
    pointer-events: none;
}

.doc-search kbd {
    position: absolute;
    top: 50%;
    right: var(--jb-sp-2);
    transform: translateY(-50%);
    min-width: 22px;
    padding: 0 var(--jb-sp-1);
    background: var(--jb-bg-island);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg-tertiary);
    font-family: var(--jb-font-mono);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* The results hang under the field as a dropdown, the one surface here that floats and can be dismissed, so it earns a shadow. */
.doc-search-menu {
    position: absolute;
    top: calc(100% + var(--jb-sp-2));
    left: 0;
    /* Wider than the field it hangs off: a result is a path and a sentence, and 560 is the drawer width. */
    width: min(560px, calc(100vw - 2 * var(--jb-sp-4)));
    z-index: 10;
    max-height: min(60vh, 420px);
    padding: var(--jb-sp-1);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--jb-bg-raised);
    border: 1px solid var(--jb-border-raised);
    border-radius: var(--jb-r-md);
    box-shadow: var(--jb-shadow-popup);
    scrollbar-width: thin;
    scrollbar-color: var(--jb-fg-tertiary) transparent;
}

.doc-search-menu::-webkit-scrollbar {
    width: 10px;
}

.doc-search-menu::-webkit-scrollbar-track {
    background: transparent;
}

.doc-search-menu::-webkit-scrollbar-thumb {
    background: var(--jb-fg-tertiary);
    border-radius: 0;
}

.doc-search-menu::-webkit-scrollbar-thumb:hover {
    background: var(--jb-fg-secondary);
}

.doc-search-menu[hidden] {
    display: none;
}

.doc-search-label,
.doc-search-note {
    margin: 0;
    padding: var(--jb-sp-2) var(--jb-sp-3);
    color: var(--jb-fg-tertiary);
    font-size: 12px;
    line-height: var(--jb-lh-ui);
}

.doc-search-result {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    padding: var(--jb-sp-2) var(--jb-sp-3);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg);
}

/* One highlight, moved by the pointer and the arrow keys alike, so the row Return opens is never in doubt. */
.doc-search-result.is-active {
    background: var(--jb-bg-selected);
}

.doc-search-result:hover {
    text-decoration: none;
}

.doc-search-icon-row {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--jb-fg-tertiary);
}

.doc-search-result.is-active .doc-search-icon-row {
    color: var(--jb-fg-secondary);
}

.doc-search-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-search-title,
.doc-search-snippet,
.doc-search-trail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Where in the page the words were: a row found by its prose has to show its evidence. */
.doc-search-snippet {
    color: var(--jb-fg-secondary);
    font-size: 12px;
    line-height: var(--jb-lh-ui);
}

.doc-search-title {
    font-size: 13px;
    line-height: var(--jb-lh-ui);
}

.doc-search-trail {
    color: var(--jb-fg-tertiary);
    font-size: 11px;
    line-height: var(--jb-lh-ui);
}

.doc-search-menu mark {
    background: none;
    color: var(--jb-link);
    font-weight: var(--jb-w-medium);
}

/* ================================================================== nav == */

.doc-shell {
    display: flex;
    align-items: flex-start;
}

/* Chrome, so it wears the canvas and a hairline; drawing the tree as a panel would put two panels on the page. */
.doc-nav {
    position: sticky;
    top: var(--doc-topbar-h);
    flex: none;
    width: var(--jb-sidebar-w);
    height: calc(100vh - var(--doc-topbar-h));
    padding: var(--jb-sp-4) var(--jb-sp-2) var(--jb-sp-6);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--jb-border);
    scrollbar-width: thin;
    scrollbar-color: var(--jb-fg-tertiary) transparent;
}

.doc-nav::-webkit-scrollbar {
    width: 10px;
}

.doc-nav::-webkit-scrollbar-track {
    background: transparent;
}

.doc-nav::-webkit-scrollbar-thumb {
    background: var(--jb-fg-tertiary);
    border-radius: 0;
}

.doc-nav::-webkit-scrollbar-thumb:hover {
    background: var(--jb-fg-secondary);
}

.doc-nav-group + .doc-nav-group {
    margin-top: var(--jb-sp-3);
}

.doc-nav-group[hidden] {
    display: none;
}

/* The group's name is also the control that opens it, and expanding is instant, the way an IDE tree expands. */
.doc-nav-title {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-1);
    /* The chevron is 12 and the gap after it 4, so the name lands exactly on --doc-nav-indent. */
    padding: var(--jb-sp-1) var(--jb-sp-2);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg);
    font-size: 13px;
    font-weight: var(--jb-w-semi);
    list-style: none;
    user-select: none;
}
.doc-nav-title::-webkit-details-marker {
    display: none;
}
.doc-nav-title:hover {
    background: var(--jb-bg-hover);
}
.doc-nav-chevron {
    width: 12px;
    height: 12px;
    flex: none;
    color: var(--jb-fg-tertiary);
}
.doc-nav-group[open] > .doc-nav-title .doc-nav-chevron {
    transform: rotate(90deg);
}

/* The sections of the page being read, under the link to that page and nowhere else. */
.doc-nav-sections {
    display: flex;
    flex-direction: column;
    margin: var(--jb-sp-1) 0 var(--jb-sp-2) var(--doc-nav-indent);
}

.doc-nav-sections a {
    display: block;
    padding: var(--jb-sp-1) var(--jb-sp-3);
    border-left: 2px solid var(--jb-border);
    color: var(--jb-fg-tertiary);
    font-size: 13px;
    line-height: var(--jb-lh-ui);
}

.doc-nav-sections a:hover {
    border-left-color: var(--jb-border-raised);
    color: var(--jb-fg-secondary);
    text-decoration: none;
}

.doc-nav-sections a.is-active {
    border-left-color: var(--jb-accent);
    color: var(--jb-link);
}

.doc-nav-sections a.doc-nav-sub {
    padding-left: var(--jb-sp-6);
}

.doc-nav-sections[hidden] {
    display: none;
}

.doc-nav-link {
    display: block;
    padding: var(--jb-sp-1) var(--jb-sp-2) var(--jb-sp-1) var(--doc-nav-indent);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg-secondary);
    font-size: 13px;
    line-height: var(--jb-lh-ui);
}

.doc-nav-link:hover {
    background: var(--jb-bg-hover);
    color: var(--jb-fg);
    text-decoration: none;
}

.doc-nav-link.is-current {
    background: var(--jb-bg-selected-muted);
    color: var(--jb-fg);
    font-weight: var(--jb-w-medium);
}

/* ================================================================= main == */

/* The canvas the island sits on, sixteen on every side, the gutter the application's content area keeps. */
.doc-main {
    flex: 1;
    min-width: 0;
    padding: var(--jb-sp-4) var(--jb-sp-4) var(--jb-sp-8);
}

/* The island, the only one on the page, because the article is the only thing on the page. */
.doc-body {
    /* A floor, or the 404 draws a panel two inches tall on an acre of canvas. */
    min-height: calc(100vh - var(--doc-topbar-h) - var(--jb-sp-4) - var(--jb-sp-8));
    padding: var(--doc-gutter);
    background: var(--jb-bg-island);
    border: 1px solid var(--jb-border-island);
    border-radius: var(--jb-r-panel);
    /* The article is the thing being read, so it takes the primary foreground rather than the secondary weight a label gets. */
    color: var(--jb-fg);
}

/* The island runs the page's width and its children are capped at a readable measure, so the column inside is the text. */
.doc-body > * {
    max-width: var(--doc-measure);
}

/* ================================================================ prose == */

/* The group the page belongs to, above its name, for a reader who arrived from a search engine. */
.doc-eyebrow {
    margin: 0 0 var(--jb-sp-2);
    color: var(--jb-link);
    font-size: 13px;
    font-weight: var(--jb-w-medium);
    line-height: var(--jb-lh-ui);
}

.doc-body h1 {
    margin: 0 0 var(--jb-sp-4);
    color: var(--jb-fg);
    font-size: 32px;
    font-weight: var(--jb-w-semi);
    line-height: var(--jb-lh-tight);
    letter-spacing: -0.02em;
}

.doc-lead {
    margin: 0 0 var(--jb-sp-6);
    color: var(--jb-fg-secondary);
    font-size: 18px;
    line-height: 1.6;
}

.doc-body h2 {
    margin: var(--jb-sp-7) 0 var(--jb-sp-3);
    color: var(--jb-fg);
    font-size: 24px;
    font-weight: var(--jb-w-semi);
    line-height: var(--jb-lh-tight);
    scroll-margin-top: var(--jb-sp-8);
}

.doc-body h3 {
    margin: var(--jb-sp-6) 0 var(--jb-sp-2);
    color: var(--jb-fg);
    font-size: 18px;
    font-weight: var(--jb-w-semi);
    line-height: var(--jb-lh-ui);
    scroll-margin-top: var(--jb-sp-8);
}

/* The address of a section, placed after the heading because the margin here belongs to the step numbers. */
.doc-anchor {
    margin-left: var(--jb-sp-2);
    color: var(--jb-fg-tertiary);
    font-weight: var(--jb-w-normal);
    opacity: 0;
}

.doc-body h2:hover > .doc-anchor,
.doc-body h3:hover > .doc-anchor,
.doc-anchor:focus-visible {
    opacity: 1;
}

.doc-anchor:hover {
    color: var(--jb-link);
    text-decoration: none;
}

/* The label over a table of fields, not a heading, since eighty of them would ruin navigating by heading. */
.doc-fields-label {
    margin: var(--jb-sp-4) 0 var(--jb-sp-2);
    color: var(--jb-fg-secondary);
    font-size: 13px;
    font-weight: var(--jb-w-medium);
    line-height: var(--jb-lh-ui);
}

.doc-body p {
    margin: 0 0 var(--jb-sp-4);
}

.doc-body ul,
.doc-body ol {
    margin: 0 0 var(--jb-sp-4);
    padding-left: var(--jb-sp-5);
}

.doc-body li + li {
    margin-top: var(--jb-sp-2);
}

.doc-body strong {
    font-weight: var(--jb-w-semi);
}

/* Monospace is for data: inline code names a header, a field or a value, and prose never does. */
.doc-body code {
    padding: 0.1em var(--jb-sp-1);
    background: var(--jb-bg-inset);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg);
    font-family: var(--jb-font-mono);
    font-size: 0.875em;
    /* break-word rather than anywhere, since break-word also shrinks a cell's minimum width to one character. */
    overflow-wrap: break-word;
}

.doc-body a > code {
    color: inherit;
}

/* ================================================================ steps == */
/* A numbered walkthrough where order matters, with a rule down the left saying the steps belong together. */

/* Specific enough to beat the list rule above, which would indent the walkthrough away from its headings. */
.doc-body .doc-steps {
    margin: 0 0 var(--jb-sp-5);
    padding-left: 0;
    list-style: none;
    counter-reset: doc-step;
}

.doc-steps > li {
    position: relative;
    padding: 0 0 var(--jb-sp-5) var(--jb-sp-6);
    counter-increment: doc-step;
}

.doc-steps > li::before {
    content: counter(doc-step);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--jb-bg-inset);
    border: 1px solid var(--jb-border);
    border-radius: 50%;
    color: var(--jb-fg);
    font-size: 12px;
    font-weight: var(--jb-w-medium);
}

.doc-steps > li::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 32px;
    bottom: 0;
    width: 1px;
    background: var(--jb-border);
}

.doc-steps > li:last-child {
    padding-bottom: 0;
}

.doc-steps > li:last-child::after {
    display: none;
}

/* A step's name is a section's name, and only its line box is pinned, so the digit shares its centre. */
.doc-steps > li > h2 {
    margin-top: 0;
    line-height: 24px;
}

/* ================================================================= code == */
/* Every code block wears the same head: a name or its languages on the left, the copy control on the right. */

.doc-code {
    margin: 0 0 var(--jb-sp-4);
    background: var(--jb-bg-inset);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-md);
}

.doc-code-head {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    min-height: var(--jb-h-control);
    padding: 0 var(--jb-sp-2);
    border-bottom: 1px solid var(--jb-border);
}

.doc-code-label {
    flex: 1;
    min-width: 0;
    padding: 0 var(--jb-sp-2);
    color: var(--jb-fg-tertiary);
    font-size: 12px;
    line-height: var(--jb-lh-ui);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Choosing a language chooses it in every block and on every later page, because a reader writing Python keeps writing Python. */
.doc-code-tabs {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.doc-code-tabs::-webkit-scrollbar {
    display: none;
}

.doc-code-tab {
    flex: none;
    height: 22px;
    padding: 0 var(--jb-sp-2);
    background: none;
    border: 0;
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg-tertiary);
    font-family: inherit;
    font-size: 12px;
    line-height: 22px;
    cursor: default;
}

.doc-code-tab:hover {
    background: var(--jb-bg-hover);
    color: var(--jb-fg-secondary);
}

.doc-code-tab[aria-selected="true"] {
    background: var(--jb-bg-selected-muted);
    color: var(--jb-fg);
}

.doc-code-pane[hidden] {
    display: none;
}

.doc-code pre {
    margin: 0;
    padding: var(--jb-sp-3) var(--jb-sp-4);
    overflow-x: auto;
    color: var(--jb-fg-editor);
    font-family: var(--jb-font-mono);
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
    /* A long line scrolls, on the same thin bar the application's own scrolling panes use. */
    scrollbar-width: thin;
    scrollbar-color: var(--jb-fg-tertiary) transparent;
}

.doc-code pre::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.doc-code pre::-webkit-scrollbar-track {
    background: transparent;
}

.doc-code pre::-webkit-scrollbar-thumb {
    /* The one grey with the same value in both themes, so it reads on the light page too. */
    background: var(--jb-fg-tertiary);
    border-radius: 0;
}

.doc-code pre::-webkit-scrollbar-thumb:hover {
    background: var(--jb-fg-secondary);
}

/* The editor's own token colours, which jb-tokens.css already carries for both themes. */
.tok-comment  { color: var(--jb-fg-tertiary); }
.tok-keyword  { color: var(--jb-syntax-keyword); }
.tok-string   { color: var(--jb-syntax-string); }
.tok-number   { color: var(--jb-syntax-number); }
.tok-function { color: var(--jb-syntax-function); }
.tok-metadata { color: var(--jb-syntax-metadata); }
.tok-constant { color: var(--jb-syntax-constant); }

.doc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg-tertiary);
    cursor: default;
}

.doc-copy-btn:hover {
    background: var(--jb-bg-hover);
    color: var(--jb-fg);
}

.doc-copy-btn svg {
    width: 14px;
    height: 14px;
}

.doc-copy-btn.is-done {
    color: var(--jb-success);
}

/* ================================================================ notes == */

.doc-note {
    margin: 0 0 var(--jb-sp-4);
    padding: var(--jb-sp-3) var(--jb-sp-4);
    background: var(--jb-bg-inset);
    border-left: 2px solid var(--jb-accent);
    border-radius: 0 var(--jb-r-md) var(--jb-r-md) 0;
    font-size: 14px;
}

.doc-note p {
    margin: 0;
}

.doc-note p + p {
    margin-top: var(--jb-sp-2);
}

.doc-note-warn {
    border-left-color: var(--jb-warning-solid);
}

.doc-note-danger {
    border-left-color: var(--jb-error-solid);
}

/* =============================================================== tables == */

.doc-table-wrap {
    margin: 0 0 var(--jb-sp-4);
    overflow-x: auto;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Every column but the description keeps its name on one line, since a hyphen is a break opportunity; a wide table scrolls. */
.doc-table th,
.doc-table td {
    padding: var(--jb-sp-2) var(--jb-sp-3);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    border-bottom: 1px solid var(--jb-border);
}

.doc-table th {
    padding-top: 0;
    color: var(--jb-fg-secondary);
    font-size: 13px;
    font-weight: var(--jb-w-medium);
}

.doc-table tr:last-child td {
    border-bottom: 0;
}

.doc-table th:first-child,
.doc-table td:first-child {
    padding-left: 0;
}

.doc-table th:last-child,
.doc-table td:last-child {
    padding-right: 0;
}

.doc-table .doc-col-desc {
    width: 100%;
    white-space: normal;
}

.doc-table .doc-col-type {
    color: var(--jb-fg-tertiary);
    font-family: var(--jb-font-mono);
    font-size: 12px;
    white-space: nowrap;
}

/* A type that names an object links to it, marked quietly because a column of blue would shout. */
.doc-col-type a {
    color: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.doc-col-type a:hover {
    color: var(--jb-link);
    text-decoration: underline solid;
}

/* ================================================================ cards == */
/* The only thing on these pages drawn as a panel, because a card here is a way out of the page. */

.doc-cards {
    display: grid;
    gap: var(--jb-sp-3);
    margin: 0 0 var(--jb-sp-5);
}

.doc-cards-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.doc-cards-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Raised, because it sits on an island, the same relationship a feature card has to its column. */
.doc-card {
    display: flex;
    flex-direction: column;
    gap: var(--jb-sp-2);
    padding: var(--jb-sp-4);
    background: var(--jb-bg-raised);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-md);
    color: var(--jb-fg-secondary);
}

.doc-card:hover {
    background: var(--jb-bg-hover-subtle);
    border-color: var(--jb-border-raised);
    text-decoration: none;
}

.doc-card:hover .doc-card-title {
    color: var(--jb-link);
}

.doc-card-eyebrow {
    color: var(--jb-fg-tertiary);
    font-size: 12px;
    line-height: var(--jb-lh-ui);
}

.doc-card-title {
    color: var(--jb-fg);
    font-size: 16px;
    font-weight: var(--jb-w-semi);
    line-height: var(--jb-lh-ui);
}

.doc-card-text {
    font-size: 14px;
    line-height: var(--jb-lh-prose);
}

.doc-card-more {
    margin-top: auto;
    color: var(--jb-link);
    font-size: 13px;
}

.doc-card-more::after {
    content: " \2192";
}

/* ================================================================ pager == */

/* Both ends of the walk are absent on a page outside it, and a rule with nothing under it means nothing. */
.doc-pager:not(:has(.doc-pager-link)) {
    display: none;
}

.doc-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--jb-sp-3);
    margin-top: var(--jb-sp-7);
    padding-top: var(--jb-sp-5);
    border-top: 1px solid var(--jb-border);
}

.doc-pager-link {
    display: flex;
    flex-direction: column;
    gap: var(--jb-sp-1);
    padding: var(--jb-sp-3) var(--jb-sp-4);
    background: var(--jb-bg-raised);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-md);
}

.doc-pager-link:hover {
    background: var(--jb-bg-hover-subtle);
    border-color: var(--jb-border-raised);
    text-decoration: none;
}

.doc-pager-link:hover .doc-pager-title {
    color: var(--jb-link);
}

.doc-pager-forward {
    grid-column: 2;
    text-align: right;
}

.doc-pager-label {
    color: var(--jb-fg-tertiary);
    font-size: 12px;
}

.doc-pager-label::before {
    content: "\2190\00a0";
}

.doc-pager-forward .doc-pager-label::before {
    content: none;
}

.doc-pager-forward .doc-pager-label::after {
    content: "\00a0\2192";
}

.doc-pager-title {
    color: var(--jb-fg);
    font-size: 14px;
    font-weight: var(--jb-w-medium);
}

/* ============================================================ reference == */
/* The generated half, where a section is a group of endpoints rather than a panel, so the endpoints carry the borders. */

.doc-endpoints,
.doc-schemas {
    margin-bottom: var(--jb-sp-4);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-md);
    overflow: hidden;
}

.doc-endpoint + .doc-endpoint,
.doc-schema + .doc-schema {
    border-top: 1px solid var(--jb-border);
}

.doc-endpoint,
.doc-schema {
    scroll-margin-top: var(--jb-sp-8);
}

.doc-endpoint > summary {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    padding: var(--jb-sp-2) var(--jb-sp-3);
    list-style: none;
}

.doc-endpoint > summary::-webkit-details-marker {
    display: none;
}

.doc-endpoint > summary:hover {
    background: var(--jb-bg-hover-subtle);
}

.doc-endpoint[open] > summary {
    border-bottom: 1px solid var(--jb-border);
}

.doc-chevron {
    flex: none;
    width: var(--jb-icon);
    height: var(--jb-icon);
    color: var(--jb-fg-tertiary);
}

.doc-endpoint[open] > summary .doc-chevron,
.doc-schema[open] > summary .doc-chevron {
    transform: rotate(90deg);
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 20px;
    padding: 0 var(--jb-sp-2);
    border-radius: var(--jb-r-sm);
    font-family: var(--jb-font-mono);
    font-size: 11px;
    font-weight: var(--jb-w-medium);
}

.doc-method-get {
    background: var(--jb-info-bg);
    border: 1px solid var(--jb-info-border);
    color: var(--jb-link);
}

.doc-method-post {
    background: var(--jb-success-bg);
    border: 1px solid var(--jb-success-border);
    color: var(--jb-success);
}

.doc-method-put,
.doc-method-patch {
    background: var(--jb-warning-bg);
    border: 1px solid var(--jb-warning-border);
    color: var(--jb-warning);
}

.doc-method-delete {
    background: var(--jb-error-bg);
    border: 1px solid var(--jb-error-border);
    color: var(--jb-error);
}

.doc-endpoint-path {
    flex: none;
    color: var(--jb-fg);
    font-family: var(--jb-font-mono);
    font-size: 13px;
}

.doc-tag {
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 20px;
    padding: 0 var(--jb-sp-2);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-r-sm);
    color: var(--jb-fg-tertiary);
    font-size: 11px;
}

.doc-tag-key {
    border-color: var(--jb-warning-border);
    color: var(--jb-warning);
}

.doc-endpoint-summary {
    flex: 1;
    min-width: 0;
    color: var(--jb-fg-tertiary);
    font-size: 13px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-endpoint-body {
    padding: var(--jb-sp-4);
}

.doc-endpoint-body > :last-child {
    margin-bottom: 0;
}

.doc-endpoint-body p:not(.doc-fields-label) {
    margin: 0 0 var(--jb-sp-3);
}

.doc-schema > summary {
    display: flex;
    align-items: center;
    gap: var(--jb-sp-2);
    padding: var(--jb-sp-2) var(--jb-sp-3);
    list-style: none;
}

.doc-schema > summary::-webkit-details-marker {
    display: none;
}

.doc-schema > summary:hover {
    background: var(--jb-bg-hover-subtle);
}

.doc-schema[open] > summary {
    border-bottom: 1px solid var(--jb-border);
}

.doc-schema-name {
    flex: 1;
    color: var(--jb-fg);
    font-family: var(--jb-font-mono);
    font-size: 13px;
}

.doc-count {
    color: var(--jb-fg-tertiary);
    font-size: 12px;
}

.doc-schema .doc-table-wrap {
    margin: 0;
    padding: var(--jb-sp-3) var(--jb-sp-4);
}

/* =========================================================== responsive == */

.doc-nav-btn {
    display: none;
}

.doc-nav-backdrop {
    display: none;
}

/* Between the sidebar staying and the column reaching its measure, the island's own padding is the only thing that can give. */
@media (max-width: 1180px) {
    :root {
        --doc-gutter: var(--jb-sp-6);
    }
}

@media (max-width: 1000px) {
    .doc-nav-btn {
        display: inline-flex;
    }

    .doc-nav {
        position: fixed;
        top: var(--doc-topbar-h);
        left: 0;
        z-index: 500;
        background: var(--jb-bg-island);
        transform: translateX(-100%);
    }

    .doc-nav.is-open {
        transform: none;
    }

    .doc-nav-backdrop {
        display: block;
        position: fixed;
        top: var(--doc-topbar-h);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        background: var(--jb-alpha-b-50);
        opacity: 0;
        pointer-events: none;
    }

    .doc-nav-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .doc-main {
        padding: var(--jb-sp-3) var(--jb-sp-3) var(--jb-sp-6);
    }

    .doc-brand-sub {
        display: none;
    }
}

@media (max-width: 640px) {
    .doc-topbar {
        gap: var(--jb-sp-2);
    }

    .doc-topbar-link {
        display: none;
    }

    /* The mark alone: at 390 the wordmark, the shortcut hint and a usable field cannot all have their width. */
    .doc-brand span {
        display: none;
    }

    .doc-search kbd {
        display: none;
    }

    /* The field is too narrow here to hang results off, so they take the width of the page. */
    .doc-search-menu {
        position: fixed;
        top: calc(var(--doc-topbar-h) + var(--jb-sp-1));
        left: var(--jb-sp-2);
        right: var(--jb-sp-2);
        width: auto;
    }

    .doc-search input {
        padding-right: var(--jb-sp-3);
    }

    :root {
        --doc-gutter: var(--jb-sp-4);
    }

    .doc-body h1 {
        font-size: 24px;
    }

    .doc-endpoint > summary {
        flex-wrap: wrap;
    }

    .doc-endpoint-summary {
        flex: 1 0 100%;
        text-align: left;
        white-space: normal;
    }

    .doc-pager {
        grid-template-columns: 1fr;
    }

    .doc-pager-forward {
        grid-column: 1;
    }
}

/* Under 16px, iOS zooms on focus and does not zoom back out; the density is kept everywhere else. */
@media (pointer: coarse) {
    .doc-search input {
        font-size: 16px;
    }
}
