:root {
    --primary: #842CC3;
    --primary-hover: #6b23a0;
    --primary-soft: rgba(132, 44, 195, 0.09);
    --secondary: #87F3A4;
    --secondary-ink: #14532d;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-tertiary: #e7e5e4;
    --surface: #ffffff;
    --text: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --border: #d6d3d1;
    --border-light: #e7e5e4;
    --code-bg: #1c1917;
    --code-text: #e7e5e4;
    --shadow: 0 16px 40px rgba(28, 25, 23, 0.07);
    --sidebar-width: 300px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.api-docs-shell {
    min-height: 100vh;
}

.api-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 32px 0;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

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

.brand-link:hover {
    color: var(--primary);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 10px 22px rgba(132, 44, 195, 0.22);
}

.brand-copy {
    min-width: 0;
}

.brand-name,
.brand-subline {
    display: block;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subline {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 16px;
    min-height: 28px;
    max-width: 100%;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

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

.nav-label {
    padding: 0 24px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 24px;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-placeholder {
    padding: 10px 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.api-main {
    width: auto;
    max-width: 1180px;
    margin-left: var(--sidebar-width);
    padding: 48px 64px 72px;
}

.doc-section {
    scroll-margin-top: 28px;
}

.hero-section {
    margin-bottom: 34px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-section h1 {
    max-width: 840px;
    margin: 0 0 16px;
    color: var(--text);
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.hero-subtitle {
    max-width: 780px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.12rem;
    line-height: 1.75;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    max-width: 100%;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.hero-badge.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.hero-badge.secondary {
    border-color: var(--secondary);
    background: var(--secondary);
    color: var(--text);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 44px;
}

.info-card,
.auth-card,
.rate-card,
.tag-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.info-card {
    min-width: 0;
    padding: 24px 28px;
}

.card-label,
.section-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inline-code,
.endpoint-path,
.param-name,
.param-type,
.response-code,
.media-type,
.code-block pre {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.inline-code {
    display: block;
    max-width: 100%;
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--primary);
    font-size: 0.88rem;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.muted-copy,
.section-intro {
    color: var(--text-secondary);
}

.muted-copy {
    margin: 14px 0 0;
    font-size: 0.92rem;
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.2;
}

.section-intro {
    max-width: 720px;
    margin: 0;
    font-size: 1rem;
}

.auth-section {
    margin-bottom: 56px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 20px;
}

.auth-card,
.rate-card {
    min-width: 0;
    padding: 28px;
}

.auth-card h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
}

.auth-facts {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.fact-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.fact-label {
    color: var(--text-muted);
    font-weight: 800;
}

.fact-value {
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 22px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.settings-link:hover {
    background: var(--primary-hover);
}

.code-block {
    min-width: 0;
    border-radius: 12px;
    background: var(--code-bg);
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    padding: 20px 22px;
    color: var(--code-text);
    font-size: 0.82rem;
    line-height: 1.7;
    white-space: pre;
}

.rate-card {
    margin-top: 20px;
}

.rate-card p {
    margin: 0 0 10px;
    color: var(--text-secondary);
}

.rate-card ul {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.rate-card li {
    position: relative;
    padding: 8px 0 8px 18px;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.rate-card li::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.endpoints-section {
    margin-bottom: 64px;
}

.endpoint-groups {
    display: grid;
    gap: 28px;
}

.tag-group {
    overflow: hidden;
}

.tag-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
}

.tag-header h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 900;
}

.tag-header p {
    margin: 0;
    color: var(--text-secondary);
}

.endpoint-list {
    display: grid;
    gap: 1px;
    background: var(--border-light);
}

.endpoint-card {
    min-width: 0;
    padding: 24px 28px;
    background: var(--surface);
    scroll-margin-top: 28px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.endpoint-card:hover {
    box-shadow: inset 3px 0 0 var(--primary), 0 12px 28px rgba(132, 44, 195, 0.08);
}

.endpoint-card.active-card {
    box-shadow: inset 3px 0 0 var(--primary);
}

.endpoint-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    margin-bottom: 12px;
}

.method-pill {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #fff;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.method-get {
    background: var(--success);
}

.method-post {
    background: var(--primary);
}

.method-put,
.method-patch {
    background: var(--warning);
}

.method-delete {
    background: var(--danger);
}

.method-options,
.method-head,
.method-trace {
    background: var(--info);
}

.endpoint-path {
    min-width: 0;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.endpoint-summary {
    margin: 0 0 8px;
    font-size: 1.02rem;
    font-weight: 850;
}

.endpoint-description {
    max-width: 760px;
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.endpoint-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.meta-pill.auth-required {
    border-color: rgba(132, 44, 195, 0.25);
    background: var(--primary-soft);
    color: var(--primary);
}

.endpoint-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.detail-column {
    min-width: 0;
}

.compact-list {
    display: grid;
    gap: 8px;
}

.compact-item {
    min-width: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
}

.param-line,
.response-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.param-name,
.response-code,
.media-type {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.param-required {
    color: var(--danger);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.param-type {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.param-desc,
.response-desc,
.empty-state {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.request-body {
    display: grid;
    gap: 8px;
}

.media-type {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

.empty-state {
    margin-top: 0;
}

.explorer-section {
    margin-top: 48px;
}

.swagger-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden;
}

.swagger-panel #swagger-ui {
    min-width: 0;
    padding: 20px;
}

.swagger-ui {
    color: var(--text);
    font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.swagger-ui .topbar {
    display: none;
}

.swagger-ui .info {
    margin: 18px 0 24px;
}

.swagger-ui .info .title,
.swagger-ui .opblock-tag,
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui table thead tr td,
.swagger-ui table thead tr th,
.swagger-ui .response-col_status,
.swagger-ui .response-col_description {
    font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.swagger-ui .opblock {
    border-radius: 10px;
}

.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-path__deprecated {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.swagger-ui .scheme-container {
    margin: 0 0 24px;
    padding: 18px 0;
    background: transparent;
    box-shadow: none;
}

.swagger-ui .btn.authorize {
    border-color: var(--primary);
    color: var(--primary);
}

.swagger-ui .btn.authorize svg {
    fill: var(--primary);
}

.swagger-ui .btn.execute {
    background-color: var(--primary);
    border-color: var(--primary);
}

.swagger-ui .highlight-code > .microlight,
.swagger-ui .model-example {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 1120px) {
    .api-main {
        padding-right: 36px;
        padding-left: 36px;
    }

    .endpoint-details {
        grid-template-columns: 1fr 1fr;
    }

    .detail-column.responses-column {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    html {
        scroll-padding-top: 16px;
    }

    .api-sidebar {
        display: none;
    }

    .api-main {
        width: 100%;
        margin-left: 0;
        padding: 32px 22px 56px;
    }

    .info-grid,
    .auth-layout,
    .endpoint-details {
        grid-template-columns: 1fr;
    }

    .detail-column.responses-column {
        grid-column: auto;
    }

    .hero-section h1 {
        font-size: 2.1rem;
    }

    .endpoint-card,
    .tag-header,
    .auth-card,
    .rate-card,
    .info-card {
        padding: 22px;
    }

    .endpoint-header {
        align-items: flex-start;
    }

    .swagger-panel #swagger-ui {
        padding: 12px;
    }
}

@media (max-width: 560px) {
    .api-main {
        padding-right: 16px;
        padding-left: 16px;
    }

    .hero-section h1 {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .endpoint-header {
        display: grid;
        gap: 9px;
    }

    .method-pill {
        width: fit-content;
    }

    .fact-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .code-block pre {
        padding: 18px;
        font-size: 0.76rem;
    }
}
