/* ============================================================
   /api-doc: inline search in the header (api-doc-search.js)
   Brand purple #180054, pink #FB698E. Pink never carries white text.
   ============================================================ */

body.api-doc-page .apidoc-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 520px;
    margin: 0 24px;
}

.apidoc-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 10px 0 12px;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 10px;
}

.apidoc-search-field:focus-within {
    border-color: #FB698E;
    box-shadow: 0 0 0 2px #ffffff;
}

.apidoc-search-field .fa {
    color: #4A4660;
    font-size: 16px;
}

.apidoc-search-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: #14112A;
    font-size: 15px;
}

/* The field's own ring is drawn by :focus-within on the wrapper above. */
.apidoc-search-field input:focus,
.apidoc-search-field input:focus-visible {
    outline: none;
}

.apidoc-search-field input::placeholder {
    color: #5A5670;
}

.apidoc-search-field kbd {
    font: 600 12px/1 Consolas, "SF Mono", Menlo, monospace;
    color: #4A4660;
    background: #F1EDFB;
    border: 1px solid #D6CFEA;
    border-radius: 5px;
    padding: 3px 6px;
    box-shadow: none;
}

.apidoc-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(640px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 6px 0;
    background: #ffffff;
    border: 1px solid #DCD8E8;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(24, 0, 84, 0.18);
    z-index: 1060;
    color: #14112A;
    text-align: left;
}

.apidoc-sr-label {
    padding: 12px 16px 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #5A5670;
}

.apidoc-sr-opt {
    padding: 9px 16px 9px 13px;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.apidoc-sr-opt:hover {
    background: #F7F6FB;
}

.apidoc-sr-opt[aria-selected="true"] {
    background: #F1EDFB;
    border-left-color: #180054;
}

.apidoc-sr-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
}

.apidoc-sr-head code {
    background: none;
    padding: 0;
    color: #14112A;
    font-weight: 600;
    font-size: 14px;
}

.apidoc-sr-title {
    font-weight: 600;
}

.apidoc-sr-head code + .apidoc-sr-title {
    font-weight: 500;
    color: #4A4660;
}

.apidoc-sr-code {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 5px;
    background: #180054;
    color: #ffffff;
    font: 700 12.5px/1.1 Consolas, "SF Mono", Menlo, monospace;
}

.apidoc-sr-code mark {
    background: #FB698E;
    color: #180054;
}

.apidoc-sr-meta,
.apidoc-sr-ctx {
    font-size: 12.5px;
    color: #5A5670;
}

.apidoc-sr-ctx {
    margin-top: 3px;
    font-family: Consolas, "SF Mono", Menlo, monospace;
}

.apidoc-sr-snip {
    margin-top: 3px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #3E3A55;
}

.apidoc-sr-more,
.apidoc-sr-empty {
    padding: 6px 16px 10px;
    font-size: 13px;
    color: #4A4660;
}

.apidoc-sr-empty {
    padding: 16px;
    font-size: 14px;
}

.apidoc-sr-ask {
    padding: 0;
    border: 0;
    background: none;
    color: #2B0F78;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.apidoc-search-results mark {
    background: #FFE6EC;
    color: #180054;
    font-weight: 700;
    padding: 0 1px;
    border-radius: 3px;
}

/* Method badges: dark text on light tints, each above 7:1. */
.apidoc-method {
    display: inline-block;
    min-width: 46px;
    padding: 3px 6px;
    border-radius: 5px;
    font: 700 11px/1.2 Consolas, "SF Mono", Menlo, monospace;
    letter-spacing: 0.03em;
    text-align: center;
}

.apidoc-sr-ctx .apidoc-method {
    min-width: 0;
    padding: 1px 4px;
    font-size: 10px;
}

.apidoc-method-get { background: #DFF3E6; color: #0B4F25; }
.apidoc-method-post { background: #E4DCF8; color: #2B0F78; }
.apidoc-method-patch { background: #FFEFCF; color: #6A3F00; }
.apidoc-method-put { background: #FFEFCF; color: #6A3F00; }
.apidoc-method-delete { background: #FCE3E3; color: #8A1414; }

/* Where a search result lands. */
.apidoc-search-hit {
    background: #FFF4C2 !important;
    transition: background 1.5s ease;
    border-radius: 6px;
}

/* Focus is always visible on this page. */
body.api-doc-page a:focus-visible,
body.api-doc-page button:focus-visible,
body.api-doc-page select:focus-visible,
body.api-doc-page [tabindex]:focus-visible {
    outline: 3px solid #180054;
    outline-offset: 2px;
}

body.api-doc-page header a:focus-visible,
body.api-doc-page header button:focus-visible {
    outline-color: #ffffff;
}

body.api-doc-page .header-api select:focus-visible {
    outline: 3px solid #FB698E;
    outline-offset: 2px;
}

/* Below 992px the field becomes a full-width bar under the fixed header. */
@media (max-width: 991px) {
    body.api-doc-page .apidoc-search {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        max-width: none;
        margin: 0;
        padding: 8px 16px 10px;
        background: #180054;
        z-index: 1040;
    }

    body.api-doc-page .apidoc-search-field kbd {
        display: none;
    }

    body.api-doc-page .apidoc-search-results {
        left: 16px;
        right: 16px;
        width: auto;
        max-height: 70vh;
    }

    body.api-doc-page .api_sub_wrapper {
        margin-top: 130px;
    }
}

/* ============================================================
   Reference sections rendered from the catalog (ApiCatalog)
   ============================================================ */

.apidoc-nav,
.apidoc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Groups start open; style.css hides .sub-menu for the old jQuery toggle. */
body.api-doc-page .api_left_slidebar .menu.apidoc-nav .item .sub-menu {
    display: block;
}

body.api-doc-page .api_left_slidebar .menu.apidoc-nav .item .sub-menu[hidden] {
    display: none;
}

.apidoc-nav-toggle {
    position: relative;
    display: block;
    width: 100%;
    padding: 6px 0 6px 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}

.api_left_slidebar .menu .item .apidoc-nav-toggle .dropdown {
    position: static;
    margin: 0 10px 0 0;
}

.apidoc-nav .apidoc-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.apidoc-nav .apidoc-method {
    min-width: 40px;
    font-size: 9.5px;
    padding: 2px 4px;
}

.apidoc-nav .apidoc-sub-item[aria-current] {
    background: #ECE5FD;
    color: #180054;
    font-weight: 600;
    border-radius: 8px;
}

button.sidebar_menu_toggle,
button.sidebar_close {
    border: 0;
    background: none;
    padding: 4px;
    cursor: pointer;
}

.apidoc-endpoint-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
    padding: 8px 10px;
    background: #F7F6FB;
    border: 1px solid #DCD8E8;
    border-radius: 10px;
}

.apidoc-endpoint-line code {
    background: none;
    color: #14112A;
    font-size: 15px;
    font-weight: 600;
    padding: 0;
}

.apidoc-ref-h3 {
    margin: 26px 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: #180054;
}

.apidoc-request-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 12px 0 0;
    font-size: 14px;
}

.apidoc-request-meta dt {
    font-weight: 600;
    color: #4A4660;
}

.apidoc-request-meta dd {
    margin: 0;
}

.apidoc-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 12px;
}

.apidoc-table-scroll:focus-visible {
    outline: 3px solid #180054;
    outline-offset: 2px;
}

.apidoc-table-scroll .apidoc-guide-table {
    margin: 0;
}

.apidoc-fields {
    margin: 0 0 12px;
}

.apidoc-field {
    padding: 8px 0;
    border-bottom: 1px solid #ECEAF3;
}

.apidoc-field dt {
    font-weight: 600;
}

.apidoc-field dd {
    margin: 4px 0 0;
}

.apidoc-codes .apidoc-code-tag {
    white-space: nowrap;
}

.api-endpoint tr:target,
.api-endpoint .apidoc-field:target {
    background: #FFF4C2;
}

/* Copy actions and the machine-readable links */
.apidoc-copy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 6px;
}

.apidoc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #CFC7E6;
    border-radius: 8px;
    background: #ffffff;
    color: #180054;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.apidoc-action-btn:hover {
    background: #F1EDFB;
}

.apidoc-machine {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #ECEAF3;
}

.apidoc-machine .apidoc-copy-page {
    width: 100%;
    justify-content: center;
    margin: 6px 0 10px;
}

.apidoc-machine-links {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.apidoc-machine-links li {
    padding: 4px 0;
}

.apidoc-machine-links a {
    color: #2B0F78;
    text-decoration: underline;
}

/* ============================================================
   Layout: navigation | reference | sticky code column
   ============================================================ */

html {
    scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body.api-doc-page {
    background: #ffffff;
    color: #14112A;
}

body.api-doc-page .api_sub_wrapper {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    margin-top: 70px;
}

body.api-doc-page .api_left_slidebar {
    width: auto;
    min-width: 0;
    background: #F7F6FB;
    border-right: 1px solid #E4E0EF;
    padding: 18px 14px 40px;
}

body.api-doc-page .api_rihgt_slidebar {
    background: #ffffff;
    padding: 32px 40px 80px;
    min-width: 0;
}

body.api-doc-page .apidoc-page-intro h1 {
    color: #180054;
    font-size: 32px;
}

/* Inline code: Bootstrap's pink (#e83e8c) is 4.0:1 on white; purple on a tint is 13:1. */
body.api-doc-page .api_rihgt_slidebar :not(pre) > code {
    background: #F1EDFB;
    color: #2B0F78;
    padding: 1px 5px;
    border-radius: 4px;
}

body.api-doc-page .apidoc-page-intro p {
    color: #3E3A55;
    font-size: 16.5px;
}

body.api-doc-page .api-endpoint {
    padding: 40px 0 8px;
    border-top: 1px solid #ECEAF3;
}

body.api-doc-page .api_rihgt_slidebar-ttl h2 {
    color: #180054;
    font-size: 25px;
    margin-bottom: 10px;
}

body.api-doc-page .api_rihgt_slidebar_lft p,
body.api-doc-page .apidoc-endpoint-prose > p {
    color: #3E3A55;
    line-height: 1.65;
}

.apidoc-ep-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
    gap: 40px;
    align-items: start;
}

.apidoc-endpoint-prose {
    min-width: 0;
}

.apidoc-endpoint-code {
    position: sticky;
    top: 86px;
    min-width: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Code cards: dark panel, light text (each colour pair above 7:1). */
.apidoc-code-card {
    background: #120B33;
    color: #EDEAF8;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.apidoc-code-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.apidoc-code-path {
    background: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    overflow-wrap: anywhere;
}

.apidoc-code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.apidoc-code-title {
    margin: 0;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #CFC8EC;
}

.apidoc-lang-tabs {
    display: flex;
    flex-wrap: wrap;
}

.apidoc-lang-tab {
    padding: 10px 11px 8px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: #CFC8EC;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.apidoc-lang-tab:hover {
    color: #ffffff;
}

.apidoc-lang-tab[aria-selected="true"] {
    color: #ffffff;
    border-bottom-color: #FB698E;
}

body.api-doc-page .apidoc-code-card .apidoc-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 7px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

body.api-doc-page .apidoc-code-card .apidoc-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.api-doc-page .apidoc-code-card :focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 1px;
}

body.api-doc-page .apidoc-code-card .apidoc-code {
    max-height: 460px;
    overflow: auto;
    margin: 0;
    padding: 14px 16px;
    color: #EDEAF8;
    font-size: 13px;
    white-space: pre;
}

body.api-doc-page .apidoc-code-card .apidoc-code code {
    color: #EDEAF8;
}

/* Return codes and HTTP statuses in light tables: purple on a light tint. */
body.api-doc-page .apidoc-code-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: #F1EDFB;
    color: #180054;
    font-size: 12.5px;
}

body.api-doc-page .apidoc-guide-table thead th {
    color: #3E3A55;
}

body.api-doc-page .span_muted {
    color: #5A5670;
}

body.api-doc-page .apidoc-sidebar-heading {
    color: #4A4660;
    margin: 6px 6px 8px;
}

body.api-doc-page .api_left_slidebar .menu .item a,
body.api-doc-page .apidoc-nav-toggle {
    color: #2C2840;
    border-radius: 8px;
    padding: 6px 8px;
}

body.api-doc-page .api_left_slidebar .menu .item a:hover,
body.api-doc-page .apidoc-nav-toggle:hover {
    background: #ECE5FD;
    color: #180054;
}

body.api-doc-page .api_left_slidebar .menu .item .sub-menu a {
    padding-left: 22px;
    font-size: 14.5px;
}

/* One column below 1200px: the code follows the prose. */
@media (max-width: 1199px) {
    .apidoc-ep-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .apidoc-endpoint-code {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

/* Phones and small tablets: the navigation becomes a drawer. */
@media (max-width: 991px) {
    html {
        scroll-padding-top: 140px;
    }

    body.api-doc-page .api_sub_wrapper {
        display: block;
        margin-top: 130px; /* the fixed header plus the search bar under it */
    }

    body.api-doc-page .api_left_slidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -320px;
        width: 300px;
        height: auto;
        margin: 0;
        z-index: 1100;
        visibility: hidden;
        box-shadow: 0 0 40px rgba(24, 0, 84, 0.25);
        transition: left 0.2s ease, visibility 0.2s;
    }

    body.api-doc-page .api_left_slidebar.sidebar_left {
        left: 0;
        visibility: visible;
    }

    body.api-doc-page .api_rihgt_slidebar {
        padding: 20px 16px 48px;
    }

    body.api-doc-page .apidoc-page-intro h1 {
        font-size: 26px;
    }

    body.api-doc-page .api_rihgt_slidebar-ttl h2 {
        font-size: 22px;
    }

    body.api-doc-page .api_key_slidebar_form {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.api-doc-page .api_left_slidebar {
        transition: none;
    }
}

body.api-doc-page .api_rihgt_slidebar .apidoc-code-card code.apidoc-code-path,
body.api-doc-page .api_rihgt_slidebar .apidoc-endpoint-line code {
    background: none;
    padding: 0;
}

body.api-doc-page .api_rihgt_slidebar .apidoc-code-card code.apidoc-code-path {
    color: #ffffff;
}

/* Return codes by endpoint */
.apidoc-code-jump ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 4px 0 16px;
    padding: 0;
}

.apidoc-code-jump a.apidoc-code-tag {
    display: inline-block;
    min-width: 40px;
    min-height: 32px;
    padding: 6px 9px;
    text-align: center;
    text-decoration: none;
}

.apidoc-code-jump a.apidoc-code-tag:hover {
    background: #180054;
    color: #ffffff;
}

.apidoc-matrix tbody {
    border-top: 2px solid #DCD8E8;
}

.apidoc-matrix th[scope="rowgroup"] {
    vertical-align: top;
    background: #F7F6FB;
}

.apidoc-matrix td a {
    color: #14112A;
    text-decoration: none;
    white-space: nowrap;
}

.apidoc-matrix td a:hover code {
    text-decoration: underline;
}

.apidoc-matrix tbody:target th[scope="rowgroup"] {
    background: #FFF4C2;
}
