/* =====================================================================
   Bima API Documentation theme
   Used only by Pages/Shared/_Layout_APIDocs.cshtml (/Docs pages)
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root,
[data-bs-theme="light"] {
    --theme-main-bg: #80c739;               /* Bima brand green */
    --docs-accent: #4f8f17;                 /* brand green, darkened for readable text */
    --docs-accent-strong: #3d7410;
    --docs-accent-soft: #f1f8e9;
    --docs-accent-border: #cfe6b4;

    --docs-bg: #ffffff;
    --docs-bg-subtle: #f7f8fa;
    --docs-surface: #ffffff;
    --docs-border: #e5e7eb;
    --docs-border-strong: #d1d5db;
    --docs-text: #1f2937;
    --docs-text-muted: #6b7280;
    --docs-heading: #111827;
    --docs-link: #2563eb;

    --docs-code-inline-bg: #f3f4f6;
    --docs-code-inline-text: #be185d;

    --docs-code-bg: #0f172a;
    --docs-code-header: #1e293b;
    --docs-code-text: #e2e8f0;
    --docs-code-border: #1e293b;

    --docs-info-bg: #eff6ff;
    --docs-info-border: #3b82f6;
    --docs-warn-bg: #fff7ed;
    --docs-warn-border: #f97316;
    --docs-danger-bg: #fef2f2;
    --docs-danger-border: #ef4444;

    --docs-header-h: 60px;
    --docs-sidebar-w: 272px;
    --docs-toc-w: 220px;
    --docs-radius: 10px;
    --docs-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);

    --docs-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --docs-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-bs-theme="dark"] {
    --docs-accent: #9bd65c;
    --docs-accent-strong: #b5e486;
    --docs-accent-soft: rgba(128, 199, 57, .12);
    --docs-accent-border: rgba(128, 199, 57, .35);

    --docs-bg: #0d1117;
    --docs-bg-subtle: #11161d;
    --docs-surface: #161b22;
    --docs-border: #262c36;
    --docs-border-strong: #343b47;
    --docs-text: #d1d7e0;
    --docs-text-muted: #8b949e;
    --docs-heading: #f0f3f6;
    --docs-link: #6ea8fe;

    --docs-code-inline-bg: #1f2630;
    --docs-code-inline-text: #f9a8d4;

    --docs-code-bg: #0a0e14;
    --docs-code-header: #151b23;
    --docs-code-border: #262c36;

    --docs-info-bg: rgba(59, 130, 246, .10);
    --docs-warn-bg: rgba(249, 115, 22, .10);
    --docs-danger-bg: rgba(239, 68, 68, .10);

    --docs-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- Base ---------- */
html {
    font-size: 15px;
    scroll-padding-top: calc(var(--docs-header-h) + 20px);
}

body.docs-body {
    font-family: var(--docs-font);
    background: var(--docs-bg);
    color: var(--docs-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

    a:hover {
        text-decoration: underline;
    }

::selection {
    background: rgba(128, 199, 57, .3);
}

/* ---------- Header ---------- */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--docs-header-h);
    background: color-mix(in srgb, var(--docs-bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--docs-border);
}

.docs-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
}

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--docs-heading);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
}

    .docs-brand:hover {
        text-decoration: none;
        color: var(--docs-heading);
    }

    .docs-brand img {
        border-radius: 6px;
    }

.docs-brand-muted {
    font-weight: 500;
    color: var(--docs-text-muted);
}

.docs-version {
    font-family: var(--docs-mono);
    font-size: .7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--docs-accent);
    background: var(--docs-accent-soft);
    border: 1px solid var(--docs-accent-border);
}

.docs-search-trigger {
    align-items: center;
    gap: 10px;
    width: 260px;
    margin-left: 24px;
    padding: 6px 10px;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    background: var(--docs-bg-subtle);
    color: var(--docs-text-muted);
    font-size: .875rem;
    text-align: left;
    transition: border-color .15s ease;
}

    .docs-search-trigger:hover {
        border-color: var(--docs-border-strong);
    }

    .docs-search-trigger span {
        flex: 1;
    }

kbd {
    font-family: var(--docs-mono);
    font-size: .7rem;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--docs-surface);
    color: var(--docs-text-muted);
    border: 1px solid var(--docs-border);
    box-shadow: none;
}

.docs-header-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .docs-header-links a {
        padding: 6px 12px;
        border-radius: 6px;
        color: var(--docs-text);
        font-size: .9rem;
        font-weight: 500;
    }

        .docs-header-links a:hover {
            background: var(--docs-bg-subtle);
            text-decoration: none;
        }

.docs-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--docs-text-muted);
}

    .docs-icon-btn:hover {
        background: var(--docs-bg-subtle);
        color: var(--docs-heading);
    }

.docs-theme-icon-dark {
    display: none;
}

[data-bs-theme="dark"] .docs-theme-icon-light {
    display: none;
}

[data-bs-theme="dark"] .docs-theme-icon-dark {
    display: inline-block;
}

/* ---------- Shell ---------- */
.docs-shell {
    display: flex;
    align-items: flex-start;
}

.docs-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--docs-header-h));
}

.docs-main-inner {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 32px 40px 48px;
}

/* ---------- Sidebar ---------- */
.docs-sidebar-wrap {
    flex: 0 0 auto;
}

.docs-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

@media (min-width: 992px) {
    .docs-sidebar-wrap {
        width: var(--docs-sidebar-w);
        position: sticky;
        top: var(--docs-header-h);
        height: calc(100vh - var(--docs-header-h));
        border-right: 1px solid var(--docs-border);
        background: var(--docs-bg-subtle);
    }

    .docs-sidebar,
    .docs-sidebar .offcanvas-body {
        height: 100%;
    }

        .docs-sidebar .offcanvas-body {
            display: flex !important;
            padding: 20px 16px !important;
            overflow-y: auto !important;
        }
}

@media (max-width: 991.98px) {
    .docs-sidebar {
        --bs-offcanvas-width: 300px;
        background: var(--docs-bg) !important;
    }
}

.docs-search {
    position: relative;
    margin-bottom: 18px;
}

    .docs-search i {
        position: absolute;
        left: 11px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--docs-text-muted);
        font-size: .8rem;
        pointer-events: none;
    }

    .docs-search input {
        width: 100%;
        padding: 7px 10px 7px 32px;
        font-size: .875rem;
        border-radius: 8px;
        border: 1px solid var(--docs-border);
        background: var(--docs-surface);
        color: var(--docs-text);
        outline: none;
        transition: border-color .15s ease, box-shadow .15s ease;
    }

        .docs-search input:focus {
            border-color: var(--theme-main-bg);
            box-shadow: 0 0 0 3px rgba(128, 199, 57, .2);
        }

.docs-nav {
    flex: 1;
}

.docs-nav-group + .docs-nav-group {
    margin-top: 18px;
}

.docs-nav-heading {
    padding: 0 10px 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--docs-text-muted);
}

.docs-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: .9rem;
    color: var(--docs-text);
    border-left: 2px solid transparent;
    transition: background-color .12s ease, color .12s ease;
}

    .docs-nav-link i {
        color: var(--docs-text-muted);
        font-size: .85rem;
    }

    .docs-nav-link:hover {
        background: var(--docs-border);
        text-decoration: none;
        color: var(--docs-heading);
    }

    .docs-nav-link.active {
        background: var(--docs-accent-soft);
        color: var(--docs-accent-strong);
        font-weight: 600;
        border-left-color: var(--theme-main-bg);
        border-radius: 0 6px 6px 0;
    }

        .docs-nav-link.active i {
            color: var(--docs-accent);
        }

.docs-nav-empty {
    padding: 8px 10px;
    font-size: .85rem;
    color: var(--docs-text-muted);
}

.docs-sidebar-footer {
    margin-top: 24px;
}

.docs-help-card {
    padding: 12px 14px;
    font-size: .85rem;
    border-radius: var(--docs-radius);
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
    color: var(--docs-text);
}

/* ---------- Article ---------- */
.doc-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 920px;
    line-height: 1.7;
}

.docs-breadcrumb {
    margin-bottom: 14px;
    font-size: .85rem;
}

    .docs-breadcrumb .breadcrumb-item,
    .docs-breadcrumb .breadcrumb-item a {
        color: var(--docs-text-muted);
    }

        .docs-breadcrumb .breadcrumb-item.active {
            color: var(--docs-accent);
            font-weight: 500;
        }

/* Page wrapper used by every view */
.doc-page {
    padding: 0;
}

    .doc-page > br {
        display: none;
    }

.doc-title {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--docs-heading);
    margin: 0 0 12px;
}

    .doc-title + p,
    .doc-lead {
        font-size: 1.1rem;
        color: var(--docs-text-muted);
        margin-bottom: 28px;
    }

.doc-content h2 {
    position: relative;
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -.01em;
    color: var(--docs-heading);
    margin: 0 0 14px;
}

.doc-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--docs-heading);
    margin: 24px 0 10px;
}

.doc-section {
    padding-top: 36px;
    margin-top: 36px;
    border-top: 1px solid var(--docs-border);
}

.doc-title + p + .doc-section,
.doc-title + .doc-lead + .doc-section {
    border-top: 0;
    margin-top: 0;
    padding-top: 8px;
}

/* Heading anchor (#) added by docs.js */
.doc-anchor {
    position: absolute;
    left: -1.1em;
    padding-right: .3em;
    color: var(--docs-text-muted);
    opacity: 0;
    font-weight: 400;
    transition: opacity .15s ease;
}

.doc-content h2:hover .doc-anchor,
.doc-anchor:focus {
    opacity: 1;
    text-decoration: none;
}

.doc-content p,
.doc-content li {
    color: var(--docs-text);
}

.doc-content ul li + li {
    margin-top: 6px;
}

.doc-content strong {
    color: var(--docs-heading);
    font-weight: 600;
}

/* Inline code */
.doc-content :not(pre) > code:not(.json) {
    font-family: var(--docs-mono);
    font-size: .85em;
    padding: .15em .4em;
    border-radius: 5px;
    background: var(--docs-code-inline-bg);
    color: var(--docs-code-inline-text);
    word-break: break-word;
}

/* ---------- Endpoint block ---------- */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 18px;
    padding: 8px 8px 8px 8px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    background: var(--docs-bg-subtle);
    font-family: var(--docs-mono);
    max-width: 100%;
}

.doc-content .api-endpoint code {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: none;
    color: var(--docs-heading);
    font-size: .92rem;
    font-weight: 500;
    word-break: break-all;
}

.api-method {
    flex: 0 0 auto;
    font-family: var(--docs-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 9px;
    border-radius: 6px;
    color: #fff;
}

.api-method-post { background: #16a34a; }
.api-method-get { background: #2563eb; }
.api-method-put { background: #d97706; }
.api-method-delete { background: #dc2626; }

.api-endpoint-copy,
.code-block-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: var(--docs-font);
    font-size: .75rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.api-endpoint-copy {
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
    color: var(--docs-text-muted);
}

    .api-endpoint-copy:hover {
        color: var(--docs-heading);
        border-color: var(--docs-border-strong);
    }

    .api-endpoint-copy.copied,
    .code-block-btn.copied {
        color: #16a34a;
        border-color: #16a34a;
    }

/* ---------- Callouts ---------- */
.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin: 18px 0;
    border-radius: var(--docs-radius);
    border: 1px solid transparent;
    border-left-width: 4px;
    font-size: .95rem;
}

    .callout > i {
        margin-top: 4px;
    }

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

.callout-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.callout-info {
    background: var(--docs-info-bg);
    border-color: var(--docs-info-border);
}

    .callout-info > i {
        color: var(--docs-info-border);
    }

.callout-warning {
    background: var(--docs-warn-bg);
    border-color: var(--docs-warn-border);
}

    .callout-warning > i {
        color: var(--docs-warn-border);
    }

.callout-danger {
    background: var(--docs-danger-bg);
    border-color: var(--docs-danger-border);
}

    .callout-danger > i {
        color: var(--docs-danger-border);
    }

/* ---------- Cards (overview / products pages) ---------- */
.doc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0 8px;
}

.doc-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: var(--docs-radius);
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
    color: var(--docs-text);
    box-shadow: var(--docs-shadow);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

a.doc-card:hover {
    text-decoration: none;
    border-color: var(--theme-main-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
}

.doc-card-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    margin-bottom: 6px;
    background: var(--docs-accent-soft);
    color: var(--docs-accent);
    font-size: 1rem;
}

.doc-card-title {
    font-weight: 600;
    color: var(--docs-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .doc-card-title .fa-arrow-right {
        font-size: .8rem;
        color: var(--docs-text-muted);
        transition: transform .15s ease;
    }

a.doc-card:hover .doc-card-title .fa-arrow-right {
    transform: translateX(3px);
    color: var(--docs-accent);
}

.doc-card-text {
    font-size: .9rem;
    color: var(--docs-text-muted);
    line-height: 1.55;
}

/* Numbered step list */
.doc-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 16px 0;
}

    .doc-steps li {
        counter-increment: step;
        position: relative;
        padding: 0 0 18px 44px;
    }

        .doc-steps li::before {
            content: counter(step);
            position: absolute;
            left: 0;
            top: 0;
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-size: .8rem;
            font-weight: 600;
            color: var(--docs-accent);
            background: var(--docs-accent-soft);
            border: 1px solid var(--docs-accent-border);
        }

        .doc-steps li:not(:last-child)::after {
            content: "";
            position: absolute;
            left: 13.5px;
            top: 32px;
            bottom: 4px;
            width: 1px;
            background: var(--docs-border);
        }

        .doc-steps li + li {
            margin-top: 0 !important;
        }

/* Figure */
.doc-figure {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    background: #fff;
    text-align: center;
}

    .doc-figure img {
        max-width: 100%;
        height: auto;
    }

    .doc-figure figcaption {
        margin-top: 10px;
        font-size: .85rem;
        color: #6b7280;
    }

/* ---------- Tabs (Parameters / Payload / Response) ---------- */
.doc-content .nav-tabs {
    gap: 4px;
    border-bottom: 1px solid var(--docs-border);
    margin-top: 8px;
}

    .doc-content .nav-tabs .nav-link {
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        margin-bottom: -1px;
        padding: 8px 14px;
        font-size: .875rem;
        font-weight: 500;
        color: var(--docs-text-muted);
        background: transparent;
    }

        .doc-content .nav-tabs .nav-link:hover {
            color: var(--docs-heading);
            border-bottom-color: var(--docs-border-strong);
        }

        .doc-content .nav-tabs .nav-link.active {
            color: var(--docs-accent-strong);
            border-bottom-color: var(--theme-main-bg);
            background: transparent;
        }

.doc-content .tab-content {
    padding-top: 16px;
}

.doc-pane-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

    .doc-pane-toolbar button {
        font-size: .78rem;
        padding: 3px 10px;
        border-radius: 6px;
        border: 1px solid var(--docs-border);
        background: var(--docs-surface);
        color: var(--docs-text-muted);
    }

        .doc-pane-toolbar button:hover {
            color: var(--docs-heading);
            border-color: var(--docs-border-strong);
        }

/* ---------- Parameter tables ---------- */
.doc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    margin-bottom: 1rem;
}

    .doc-table-wrap > .table {
        margin-bottom: 0;
        border: 0;
    }

.doc-content .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--docs-bg-subtle);
    --bs-table-color: var(--docs-text);
    --bs-table-hover-color: var(--docs-text);
    --bs-table-border-color: var(--docs-border);
    font-size: .875rem;
    line-height: 1.5;
    width: 100%;
}

    .doc-content .table > thead th {
        background: var(--docs-bg-subtle);
        color: var(--docs-text-muted);
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .05em;
        text-transform: uppercase;
        white-space: nowrap;
        padding: 10px 12px;
    }

    .doc-content .table > tbody > tr > td {
        padding: 10px 12px;
        vertical-align: top;
    }

/* Bordered tables inside the wrapper: drop the outer border so the rounded wrapper shows */
.doc-table-wrap > .table-bordered > :not(caption) > * > :first-child {
    border-left-width: 0;
}

.doc-table-wrap > .table-bordered > :not(caption) > * > :last-child {
    border-right-width: 0;
}

.doc-table-wrap > .table-bordered > :not(caption) > *:first-child > * {
    border-top-width: 0;
}

.doc-table-wrap > .table-bordered > tbody > tr:last-child > * {
    border-bottom-width: 0;
}

/* Field / type columns (classes added by docs.js) */
.doc-field {
    font-family: var(--docs-mono);
    font-size: .82rem;
    font-weight: 500;
    color: var(--docs-heading);
    white-space: normal;
    word-break: normal;
}

.doc-type {
    font-family: var(--docs-mono);
    font-size: .8rem;
    color: #7c3aed;
    white-space: nowrap;
}

[data-bs-theme="dark"] .doc-type {
    color: #c4b5fd;
}

.doc-limit {
    font-family: var(--docs-mono);
    font-size: .8rem;
    color: var(--docs-text-muted);
}

.doc-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.5;
}

.doc-badge-required {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.doc-badge-optional {
    color: var(--docs-text-muted);
    background: var(--docs-bg-subtle);
    border: 1px solid var(--docs-border);
}

[data-bs-theme="dark"] .doc-badge-required {
    color: #fca5a5;
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
}

/* Status code badges (error codes table) */
.doc-status {
    font-family: var(--docs-mono);
    font-weight: 600;
    font-size: .8rem;
    padding: 2px 8px;
    border-radius: 6px;
}

.doc-status-2xx { color: #15803d; background: #f0fdf4; }
.doc-status-4xx { color: #b45309; background: #fffbeb; }
.doc-status-5xx { color: #b91c1c; background: #fef2f2; }
.doc-status-6xx { color: #6d28d9; background: #f5f3ff; }

[data-bs-theme="dark"] .doc-status-2xx { color: #86efac; background: rgba(34, 197, 94, .12); }
[data-bs-theme="dark"] .doc-status-4xx { color: #fcd34d; background: rgba(245, 158, 11, .12); }
[data-bs-theme="dark"] .doc-status-5xx { color: #fca5a5; background: rgba(239, 68, 68, .12); }
[data-bs-theme="dark"] .doc-status-6xx { color: #c4b5fd; background: rgba(139, 92, 246, .14); }

/* ---------- Nested objects (details/summary) ---------- */
.pl_details {
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    background: var(--docs-surface);
    overflow: hidden;
}

    .pl_details[open] {
        box-shadow: var(--docs-shadow);
    }

    .pl_details > .table,
    .pl_details > .doc-table-wrap {
        margin: 0;
        border: 0;
        border-top: 1px solid var(--docs-border);
        border-radius: 0;
    }

.pl_summary {
    list-style: none;
    cursor: pointer;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--docs-text);
    user-select: none;
}

    .pl_summary::-webkit-details-marker {
        display: none;
    }

    .pl_summary::before {
        content: "\f054"; /* fa-chevron-right */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: .65rem;
        color: var(--docs-text-muted);
        transition: transform .15s ease;
    }

    .pl_summary > span:first-child {
        flex: 1;
    }

    .pl_summary:hover {
        background: var(--docs-bg-subtle);
    }

details[open] > .pl_summary::before {
    transform: rotate(90deg);
}

.pl_badge {
    font-family: var(--docs-mono);
    font-size: .7rem;
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    padding: 1px 9px;
}

[data-bs-theme="dark"] .pl_badge {
    color: #c4b5fd;
    background: rgba(139, 92, 246, .12);
    border-color: rgba(139, 92, 246, .35);
}

.pl_details .table > thead th {
    font-size: .68rem;
}

.pl_details .table > tbody > tr > td,
.pl_details .table > thead > tr > th {
    padding: 8px 10px;
}

/* ---------- Code blocks ---------- */
.code-block {
    position: relative;
    margin: 0 0 1rem;
    border-radius: var(--docs-radius);
    border: 1px solid var(--docs-code-border);
    background: var(--docs-code-bg);
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px;
    background: var(--docs-code-header);
    border-bottom: 1px solid var(--docs-code-border);
}

.code-block-lang {
    flex: 1;
    font-family: var(--docs-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.code-block-btn {
    border: 1px solid #334155;
    background: transparent;
    color: #cbd5e1;
}

    .code-block-btn:hover {
        background: #334155;
        color: #fff;
    }

.code-block pre {
    margin: 0;
    max-height: 520px;
    overflow: auto;
}

.code-block.expanded pre {
    max-height: none;
}

.code-block pre code,
.code-block pre code.hljs {
    display: block;
    padding: 16px 18px;
    background: transparent;
    color: var(--docs-code-text);
    font-family: var(--docs-mono);
    font-size: .82rem;
    line-height: 1.65;
    white-space: pre;
    tab-size: 4;
}

/* Fallback for any raw JSON sample not yet enhanced by docs.js */
code.json {
    display: block;
    padding: 14px 18px;
    background: var(--docs-code-bg);
    color: var(--docs-code-text);
    font-family: var(--docs-mono);
    font-size: .82rem;
    line-height: 1.6;
    border-radius: var(--docs-radius);
    overflow-x: auto;
    white-space: pre-wrap;
}

.pl_pre {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
}

/* highlight.js token colours (GitHub dark inspired) */
.hljs-attr,
.hljs-attribute { color: #7dd3fc; }
.hljs-string { color: #a5d6a7; }
.hljs-number { color: #fdba74; }
.hljs-literal,
.hljs-keyword { color: #f9a8d4; }
.hljs-punctuation { color: #94a3b8; }
.hljs-comment { color: #64748b; font-style: italic; }

/* Code panel scrollbars */
.code-block pre::-webkit-scrollbar { width: 10px; height: 10px; }
.code-block pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; border: 2px solid var(--docs-code-bg); }
.code-block pre::-webkit-scrollbar-track { background: transparent; }

/* ---------- On this page (TOC) ---------- */
.docs-toc {
    display: none;
    flex: 0 0 var(--docs-toc-w);
    width: var(--docs-toc-w);
    position: sticky;
    top: calc(var(--docs-header-h) + 32px);
    max-height: calc(100vh - var(--docs-header-h) - 64px);
    overflow-y: auto;
    font-size: .85rem;
}

@media (min-width: 1280px) {
    .docs-toc:not([hidden]) {
        display: block;
    }
}

.docs-toc-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--docs-heading);
    margin-bottom: 10px;
}

.docs-toc ul {
    border-left: 1px solid var(--docs-border);
}

.docs-toc li a {
    display: block;
    padding: 4px 0 4px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--docs-text-muted);
    line-height: 1.4;
}

    .docs-toc li a:hover {
        color: var(--docs-heading);
        text-decoration: none;
    }

    .docs-toc li a.active {
        color: var(--docs-accent-strong);
        border-left-color: var(--theme-main-bg);
        font-weight: 500;
    }

.docs-toc li.toc-h3 a {
    padding-left: 26px;
    font-size: .8rem;
}

.docs-toc-top {
    display: inline-block;
    margin-top: 16px;
    font-size: .8rem;
    color: var(--docs-text-muted);
}

/* ---------- Pager ---------- */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--docs-border);
}

.docs-pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    color: var(--docs-heading);
    transition: border-color .15s ease;
}

    .docs-pager-link:hover {
        text-decoration: none;
        border-color: var(--theme-main-bg);
    }

    .docs-pager-link.next {
        grid-column: 2;
        text-align: right;
    }

.docs-pager-label {
    font-size: .78rem;
    color: var(--docs-text-muted);
}

.docs-pager-title {
    font-weight: 600;
    color: var(--docs-accent-strong);
}

/* ---------- Footer ---------- */
.docs-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 40px;
    border-top: 1px solid var(--docs-border);
    font-size: .82rem;
    color: var(--docs-text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    html {
        font-size: 14px;
    }

    .docs-header-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .docs-main-inner {
        padding: 20px 16px 32px;
    }

    .doc-title {
        font-size: 1.7rem;
    }

    .docs-footer {
        padding: 16px;
    }

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

        .docs-pager-link.next {
            grid-column: 1;
            order: -1;
        }

        .docs-pager > span:empty {
            display: none;
        }

    .doc-anchor {
        display: none;
    }
}

@media print {
    .docs-header, .docs-sidebar-wrap, .docs-toc, .docs-pager, .api-endpoint-copy, .code-block-btn {
        display: none !important;
    }

    .code-block pre {
        max-height: none;
    }
}

/* ---------- Extra field badges ---------- */
.doc-badge-fixed {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.doc-badge-conditional {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

[data-bs-theme="dark"] .doc-badge-fixed {
    color: #93c5fd;
    background: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .35);
}

[data-bs-theme="dark"] .doc-badge-conditional {
    color: #fcd34d;
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .35);
}

/* ---------- "At a glance" summary (product pages) ---------- */
.doc-glance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    margin: 0 0 8px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    background: var(--docs-border);
    overflow: hidden;
}

.doc-glance-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--docs-surface);
    font-size: .875rem;
    line-height: 1.5;
}

.doc-glance-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--docs-text-muted);
}

.doc-glance-item code {
    align-self: flex-start;
}

/* ---------- End-to-end flow diagram ---------- */
.doc-flow {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.doc-flow-step {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 14px;
}

    .doc-flow-step:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 17px;
        top: 38px;
        bottom: 0;
        width: 2px;
        background: var(--docs-border);
    }

.doc-flow-num {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: .9rem;
    color: var(--docs-accent-strong);
    background: var(--docs-accent-soft);
    border: 2px solid var(--docs-accent-border);
    z-index: 1;
}

.doc-flow-body {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    background: var(--docs-surface);
}

.doc-flow-step.is-key .doc-flow-body {
    border-color: var(--theme-main-bg);
    box-shadow: 0 0 0 3px rgba(128, 199, 57, .15);
}

.doc-flow-step.is-optional .doc-flow-body {
    border-style: dashed;
}

.doc-flow-step.is-optional .doc-flow-num {
    background: var(--docs-bg-subtle);
    color: var(--docs-text-muted);
    border-color: var(--docs-border-strong);
    border-style: dashed;
}

.doc-flow-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--docs-heading);
}

.doc-flow-tag {
    font-size: .68rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    color: var(--docs-text-muted);
    background: var(--docs-bg-subtle);
    border: 1px solid var(--docs-border);
}

.doc-flow-desc {
    margin-top: 4px;
    font-size: .875rem;
    color: var(--docs-text-muted);
    line-height: 1.55;
}

.doc-flow-eps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.doc-flow-ep {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px 3px 4px;
    border: 1px solid var(--docs-border);
    border-radius: 7px;
    background: var(--docs-bg-subtle);
    font-family: var(--docs-mono);
    font-size: .76rem;
    color: var(--docs-heading);
}

    .doc-flow-ep:hover {
        text-decoration: none;
        border-color: var(--theme-main-bg);
    }

    .doc-flow-ep .api-method {
        font-size: .62rem;
        padding: 1px 6px;
    }

.doc-flow-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.doc-flow-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    padding: 4px 10px;
    border-radius: 7px;
    background: var(--docs-info-bg);
    color: var(--docs-text);
    border: 1px dashed var(--docs-info-border);
}

    .doc-flow-note strong {
        font-weight: 600;
    }

/* Legend under the flow */
.doc-flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .8rem;
    color: var(--docs-text-muted);
}

    .doc-flow-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .doc-flow-legend i.swatch {
        width: 14px;
        height: 14px;
        border-radius: 4px;
        border: 1px solid var(--docs-border-strong);
        display: inline-block;
    }

        .doc-flow-legend i.swatch.key {
            border: 2px solid var(--theme-main-bg);
        }

        .doc-flow-legend i.swatch.optional {
            border-style: dashed;
        }

        .doc-flow-legend i.swatch.note {
            border: 1px dashed var(--docs-info-border);
            background: var(--docs-info-bg);
        }

/* Colour swatch used in the plate-code table */
.doc-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--docs-border-strong);
    vertical-align: -2px;
    margin-right: 6px;
}

/* Compact list of inline codes */
.doc-codes code {
    margin: 0 4px 4px 0;
    display: inline-block;
}
