/* Shared Partner API Docs — sidebar layout */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Slim top brand bar */
.docs-top {
    position: sticky;
    top: 0;
    z-index: 120;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.docs-top-brand {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.docs-top-brand span {
    color: #94a3b8;
    font-weight: 500;
    margin-left: 6px;
}

.docs-menu-btn {
    display: none;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Shell: sidebar + content */
.docs-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1180px;
    margin: 0 auto;
    min-height: calc(100vh - 52px);
}

.docs-sidebar {
    position: sticky;
    top: 52px;
    align-self: start;
    height: calc(100vh - 52px);
    overflow-y: auto;
    padding: 20px 14px 32px;
    border-right: 1px solid #e2e8f0;
    background: #fff;
}

.docs-sidebar-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0 10px 10px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav a {
    display: block;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1.35;
    transition: background 0.15s, color 0.15s;
}

.nav a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav a.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.docs-main {
    padding: 28px 28px 72px;
    min-width: 0;
}

.header {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.header .eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4338ca;
    background: #eef2ff;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header p {
    color: #64748b;
    font-size: 15px;
    max-width: 680px;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px 30px;
    margin-bottom: 18px;
    scroll-margin-top: 68px;
}

.card h2 {
    font-size: 19px;
    margin-bottom: 6px;
}

.card .sub {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 18px;
}

.url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.post,
.get {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.post {
    background: #dcfce7;
    color: #15803d;
}

.get {
    background: #dbeafe;
    color: #1d4ed8;
}

.url {
    font-family: ui-monospace, 'Courier New', monospace;
    font-size: 13px;
    color: #475569;
    word-break: break-all;
}

.note {
    background: #eef2ff;
    border-left: 4px solid #6366f1;
    padding: 12px 16px;
    border-radius: 0 10px 10px 0;
    font-size: 14px;
    color: #475569;
    margin-bottom: 18px;
}

.note.warn {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.note code,
td code,
.steps code,
.sub code {
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
}

h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: #334155;
}

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

th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

.field {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: #1e293b;
}

.yes {
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
}

.code {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    font-size: 13px;
    font-family: ui-monospace, 'Courier New', monospace;
    overflow-x: auto;
    line-height: 1.7;
    white-space: pre;
}

.copy-wrap {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #334155;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #475569;
}

.steps {
    padding-left: 20px;
    color: #475569;
    font-size: 14px;
}

.steps li {
    margin-bottom: 10px;
}

.pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-right: 6px;
}

.success { background: #dcfce7; color: #16a34a; }
.failed  { background: #fee2e2; color: #dc2626; }
.pending { background: #fef3c7; color: #b45309; }
.initiated { background: #e0e7ff; color: #4338ca; }
.refund { background: #fce7f3; color: #be185d; }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.badge-bio { background: #e0e7ff; color: #4338ca; }
.badge-no  { background: #f1f5f9; color: #64748b; }

.docs-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .docs-menu-btn { display: inline-flex; }

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

    .docs-sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        width: min(280px, 86vw);
        height: calc(100vh - 52px);
        z-index: 110;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
    }

    body.docs-nav-open .docs-sidebar {
        transform: translateX(0);
    }

    .docs-backdrop {
        display: none;
        position: fixed;
        inset: 52px 0 0 0;
        background: rgba(15, 23, 42, 0.35);
        z-index: 105;
    }

    body.docs-nav-open .docs-backdrop {
        display: block;
    }

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

    .header,
    .card {
        padding: 20px 16px;
    }

    .header h1 {
        font-size: 22px;
    }
}
