:root {
    color-scheme: light;
    --primary: #673de6;
    --primary-soft: #f1edfd;
    --text: #172033;
    --muted: #626b7d;
    --border: #e5e7ee;
    --surface: #f8f9fc;
    --code: #151b2b;
    --header-height: 72px;
    --sidebar-width: 280px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: #fff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--header-height) + 24px);
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
}

a {
    color: var(--primary);
    text-underline-offset: 4px;
}

button, input, select {
    font: inherit;
}

button, select, summary {
    cursor: pointer;
}

button {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

main:focus {
    outline: none;
}

h1, h2, h3 {
    color: var(--text);
    line-height: 1.25;
}

h1 {
    margin: 12px 0 24px;
    font-size: clamp(30px, 2.8vw, 40px);
    letter-spacing: -1.2px;
    font-weight: 600;
}

h2 {
    margin: 40px 0 18px;
    font-size: 22px;
    letter-spacing: -.5px;
    font-weight: 600;
}

h3 {
    margin: 28px 0 14px;
    font-size: 17px;
    font-weight: 600;
}

p {
    margin: 0 0 18px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .87em;
}

:not(pre) > code {
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--surface);
    overflow-wrap: anywhere;
}

ul, ol {
    padding-left: 23px;
}

li {
    margin: 8px 0;
}

li::marker {
    color: var(--primary);
}

blockquote {
    margin: 24px 0;
    border-left: 3px solid var(--primary);
    padding: 18px 22px;
    background: var(--primary-soft);
    border-radius: 0 8px 8px 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 20px;
    z-index: 10;
    padding: 12px 18px;
    background: #fff;
}

.skip-link:focus {
    top: 10px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 12px 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.brand {
    display: flex;
    gap: 22px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
}

.brand img {
    display: block;
    object-fit: contain;
}

.brand span {
    border-left: 1px solid var(--border);
    padding-left: 22px;
    font-size: 14px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

.header-actions a {
    text-decoration: none;
    color: var(--muted);
}

.header-actions a:hover {
    color: var(--primary);
}

.version {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 6px;
    padding: 3px 9px;
}

.menu-button {
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    min-height: 44px;
    padding: 6px 12px;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: #fcfcfe;
    padding: 24px 16px 16px;
}

.search-box {
    flex: none;
    margin: 0 4px 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.search-box label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.search-box kbd {
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font: 11px/1.7 ui-monospace, monospace;
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 1px solid #ccd0dc;
    border-radius: 8px;
    min-height: 44px;
    padding: 9px 12px;
    background: #fff;
    color: var(--text);
}

#search-hint {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
}

.sidebar nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 4px 16px;
    scrollbar-width: thin;
    scrollbar-color: #ccd0dc transparent;
    scrollbar-gutter: stable;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-group + .nav-group {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.nav-label {
    padding: 0 12px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.nav-group a {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    margin-block: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #475167;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.nav-group a:focus-visible {
    outline-offset: -3px;
}

.nav-group a:hover {
    background: #f0f1f6;
}

.nav-group a[aria-current] {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 var(--primary);
}

.nav-method {
    flex: 0 0 42px;
    padding: 3px 4px;
    border-radius: 5px;
    background: #eaf6ef;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
}

.nav-method.get {
    background: #edf3ff;
}

.post {
    color: #16744f;
}

.get {
    color: #245db5;
}

#search-empty {
    font-size: 13px;
    padding: 12px;
    color: var(--muted);
}

main {
    margin-left: var(--sidebar-width);
    padding: 48px clamp(24px, 4vw, 64px) 24px;
}

.doc-page {
    max-width: 1360px;
    margin: 0 auto 64px;
}

.guide-page {
    max-width: 760px;
    margin-left: 0;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .12em;
    font-weight: 700;
}

.prose {
    overflow-wrap: anywhere;
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.prose > h1 + p {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.7;
}

.prose > h2 {
    padding-top: 12px;
}

.table-scroll {
    overflow-x: auto;
    margin: 24px 0;
}

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

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.endpoint-address {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 32px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.endpoint-address > code {
    background: none;
    padding: 0;
    font-size: 14px;
}

.method {
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    padding: 3px 8px;
    background: #eaf6ef;
}

.method.get {
    background: #edf3ff;
}

.auth-label {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
}

.endpoint-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 36px;
    align-items: start;
}

.endpoint-introduction {
    grid-column: 1;
    grid-row: 1;
}

.endpoint-description {
    grid-column: 1;
    grid-row: 2;
}

.endpoint-description, .endpoint-examples {
    min-width: 0;
}

.endpoint-examples {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.request-headers {
    margin: 24px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.request-headers summary {
    font-size: 13px;
    font-weight: 600;
}

.request-headers .fields {
    margin-top: 10px;
}

.fields {
    margin: 0;
}

.field {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.field:first-child {
    padding-top: 6px;
}

.field dt {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.field dt > code {
    font-size: 13px;
    font-weight: 600;
    background: none;
    padding: 0;
}

.field dd {
    margin: 8px 0 0;
    font-size: 14px;
    color: #535e72;
    overflow-wrap: anywhere;
}

.field dd p {
    margin-bottom: 8px;
}

.field dd p:last-child {
    margin-bottom: 0;
}

.field-type {
    color: var(--muted);
}

.required {
    color: var(--primary);
    font-size: 11px;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.allowed-values {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.related-link {
    margin-top: 30px;
    font-size: 13px;
}

.example-set {
    margin-bottom: 28px;
}

.example-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.example-heading h2 {
    margin: 0;
    font-size: 15px;
}

.example-picker {
    max-width: 78%;
    min-height: 44px;
    padding: 8px 28px 8px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
}

.empty-response {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
}

.code-block {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--code);
    border: 1px solid #2a344b;
}

.example-set .code-block {
    margin: 0;
}

.code-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px;
    border-bottom: 1px solid #2a344b;
    color: #b6c0d4;
    font-size: 11px;
}

.copy-button {
    min-height: 36px;
    border: 0;
    border-radius: 4px;
    padding: 4px 8px;
    background: transparent;
    color: #d7def0;
    font-size: 12px;
}

.copy-button:hover {
    background: #293148;
    color: #fff;
}

pre {
    overflow: auto;
    margin: 20px 0;
    padding: 22px;
    border-radius: 10px;
    background: var(--code);
    color: #e2e8f0;
    line-height: 1.75;
    tab-size: 4;
}

.code-block pre {
    margin: 0;
    border-radius: 0;
    max-height: 460px;
}

pre code {
    display: block;
    font-size: 13px;
}

.example-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.hljs-comment {
    color: #a3adc2;
}

.hljs-keyword, .hljs-literal {
    color: #c4b5fd;
}

.hljs-string, .hljs-attr {
    color: #a7f3d0;
}

.hljs-number, .hljs-variable {
    color: #fcd34d;
}

.hljs-title, .hljs-built_in {
    color: #93c5fd;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    color: var(--muted);
    font-size: 12px;
}

@media (min-width: 901px) {
    .menu-button {
        display: none;
    }
}

@media (max-width: 1150px) {
    .endpoint-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .endpoint-examples {
        grid-column: 1;
        grid-row: 2;
        margin-top: 16px;
    }
    .endpoint-description {
        grid-row: 3;
    }
}

@media (max-width: 900px) {
    :root {
        font-size: 16px;
    }
    .site-header {
        padding: 12px 20px;
    }
    .brand {
        gap: 10px;
    }
    .brand img {
        width: 140px;
    }
    .brand span {
        display: none;
    }
    .header-actions {
        gap: 14px;
    }
    .sidebar {
        position: static;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .enhanced .sidebar {
        display: none;
        position: fixed;
        z-index: 4;
        top: var(--header-height);
        bottom: 0;
        width: min(320px, 100%);
        box-shadow: 12px 0 30px #17203320;
    }
    .enhanced .sidebar.is-open {
        display: flex;
    }
    main {
        margin-left: 0;
        padding: 32px 24px 24px;
    }
    .guide-page {
        max-width: 100%;
    }
    .field dd {
        font-size: 15px;
    }
    .example-heading {
        flex-wrap: wrap;
    }
    .nav-group a {
        min-height: 44px;
    }
    .copy-button {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding-inline: 16px;
    }
    .brand img {
        width: 125px;
        height: 36px;
    }
    .header-actions {
        gap: 12px;
        font-size: 12px;
    }
    .version {
        display: none;
    }
    .header-actions > a:first-of-type {
        display: none;
    }
    main {
        padding-inline: 20px;
    }
    .endpoint-address {
        padding: 12px;
        gap: 8px;
    }
    .auth-label {
        width: 100%;
        margin-left: 0;
    }
    .table-scroll table {
        min-width: 540px;
    }
    pre {
        padding: 16px;
    }
    pre code {
        font-size: 12px;
    }
}

@media print {
    .site-header, .sidebar, .copy-button, .example-picker, .site-footer {
        display: none !important;
    }
    main {
        margin: 0;
        padding: 0;
    }
    .doc-page, [data-example] {
        display: block !important;
    }
    .endpoint-layout {
        display: block;
    }
    pre {
        white-space: pre-wrap;
        max-height: none !important;
        color: #000;
        background: #f5f5f5;
    }
    pre code, pre code * {
        color: inherit !important;
        background: transparent !important;
    }
    .code-block, .code-tools {
        background: #f5f5f5;
        color: #333;
        border-color: #ddd;
    }
    .table-scroll {
        overflow: visible;
    }
    .table-scroll table {
        min-width: 0;
    }
}
