/* Minolith Docs — Dark Theme */

:root {
    --docs-bg: #0a0a0f;
    --docs-bg-raised: #101018;
    --docs-surface: #14141e;
    --docs-border: rgba(255, 255, 255, 0.06);
    --docs-border-hover: rgba(255, 255, 255, 0.12);
    --docs-text: #eaeaf0;
    --docs-text-secondary: #8888a0;
    --docs-text-muted: #8888a4;
    --docs-primary: #00d4aa;
    --docs-primary-hover: #00eabc;
    --docs-primary-dim: rgba(0, 212, 170, 0.12);
    --docs-accent: #a78bfa;
    --docs-sidebar-width: 260px;
    --docs-content-max: 820px;
    --docs-header-height: 112px; /* site-header 56px + docs-sub-header 56px */
    --docs-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --docs-font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body.layout-docs {
    font-family: var(--docs-font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--docs-text);
    background: var(--docs-bg);
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ────────────────────────────────────────────────────── */

/* The main site-header is now shared from website.css */
/* Override sticky position to stack site-header + sub-header */
body.layout-docs .site-header {
    position: sticky;
    top: 0;
    z-index: 101;
}

.docs-sub-header {
    position: sticky;
    top: 56px; /* below site-header */
    z-index: 100;
    height: 56px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--docs-border);
}

.docs-sub-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.docs-sub-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-sub-header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--docs-text-secondary);
    letter-spacing: -0.01em;
}

.docs-sub-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.docs-sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    margin-right: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.docs-sidebar-toggle .hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--docs-text);
    border-radius: 1px;
    transition: transform 200ms, opacity 200ms;
}

.docs-sidebar-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.docs-sidebar-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.docs-sidebar-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.docs-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.docs-logo img {
    display: block;
    filter: invert(1) brightness(2);
    transition: opacity 150ms;
}

.docs-logo:hover img {
    opacity: 0.8;
}

.docs-logo-divider {
    color: var(--docs-text-muted);
    font-weight: 300;
    font-size: 18px;
}

.docs-logo-sub {
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: color 150ms;
}

.docs-logo-sub:hover {
    color: var(--docs-text);
}

.docs-header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.docs-header-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: color 150ms;
}

.docs-header-link:hover {
    color: var(--docs-text);
}

.docs-header-link--primary {
    padding: 6px 16px;
    background: var(--docs-primary);
    color: var(--docs-bg);
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.15);
    transition: all 200ms;
}

.docs-header-link--primary:hover {
    background: var(--docs-primary-hover);
    color: var(--docs-bg);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.25);
}

/* ── Layout ────────────────────────────────────────────────────── */

.docs-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--docs-header-height));
}

/* ── Sidebar ───────────────────────────────────────────────────── */

.docs-sidebar {
    position: sticky;
    top: var(--docs-header-height);
    width: var(--docs-sidebar-width);
    height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 24px 0 24px 24px;
    flex-shrink: 0;
    border-right: 1px solid var(--docs-border);
    background: var(--docs-bg-raised);
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-nav-section {
    margin-bottom: 24px;
}

.docs-nav-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--docs-text-muted);
    padding: 0 12px;
    margin-bottom: 6px;
    font-family: var(--docs-font-mono);
}

.docs-nav-list {
    list-style: none;
}

.docs-nav-link {
    display: block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--docs-text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: color 150ms, background 150ms;
}

.docs-nav-link:hover {
    color: var(--docs-text);
    background: rgba(255, 255, 255, 0.03);
}

.docs-nav-link.is-active {
    color: var(--docs-primary);
    background: var(--docs-primary-dim);
    font-weight: 500;
}

/* ── Main content ──────────────────────────────────────────────── */

.docs-main {
    flex: 1;
    min-width: 0;
    max-width: var(--docs-content-max);
    padding: 32px 48px 80px;
}

/* ── Breadcrumbs ───────────────────────────────────────────────── */

.docs-breadcrumbs {
    margin-bottom: 24px;
}

.docs-breadcrumbs ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.docs-breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 6px;
    color: var(--docs-text-muted);
}

.docs-breadcrumbs a {
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: color 150ms;
}

.docs-breadcrumbs a:hover {
    color: var(--docs-primary);
}

.docs-breadcrumbs span {
    color: var(--docs-text-muted);
}

.docs-breadcrumbs [aria-current="page"] {
    color: var(--docs-text);
}

/* ── Prose (rendered markdown) ─────────────────────────────────── */

.prose {
    line-height: 1.7;
}

.prose h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--docs-border);
}

.prose h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--docs-border);
}

.prose h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.prose h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
}

.prose h5,
.prose h6 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* Heading anchor links */
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    position: relative;
}

.prose .heading-anchor {
    position: absolute;
    left: -1.2em;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-weight: 400;
    opacity: 0;
    transition: opacity 150ms;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.prose h5:hover .heading-anchor,
.prose h6:hover .heading-anchor,
.prose .heading-anchor:focus {
    opacity: 1;
}

.prose .heading-anchor:hover {
    color: var(--docs-primary);
}

.prose p {
    margin-bottom: 16px;
}

.prose a {
    color: var(--docs-primary);
    text-decoration: none;
    transition: color 150ms;
}

.prose a:hover {
    color: var(--docs-primary-hover);
    text-decoration: underline;
}

.prose strong {
    font-weight: 600;
    color: var(--docs-text);
}

.prose ul,
.prose ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.prose li {
    margin-bottom: 4px;
    color: var(--docs-text-secondary);
}

.prose li > ul,
.prose li > ol {
    margin-top: 4px;
    margin-bottom: 4px;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--docs-border);
    margin: 32px 0;
}

.prose blockquote {
    border-left: 3px solid var(--docs-primary);
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--docs-primary-dim);
    border-radius: 0 6px 6px 0;
    color: var(--docs-text-secondary);
}

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

/* Inline code */
.prose code {
    font-family: var(--docs-font-mono);
    font-size: 0.875em;
    background: rgba(0, 212, 170, 0.08);
    color: var(--docs-primary);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 170, 0.1);
}

/* Code blocks */
.prose pre {
    position: relative;
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--docs-border);
}

.prose pre code {
    display: block;
    padding: 18px 22px;
    font-size: 13px;
    line-height: 1.65;
    background: #0c0c14;
    color: #cdd6f4;
    overflow-x: auto;
    border-radius: 10px;
    border: none;
}

/* Copy button */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--docs-font-mono);
    background: rgba(255, 255, 255, 0.06);
    color: var(--docs-text-muted);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms;
    z-index: 1;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--docs-text-secondary);
    border-color: var(--docs-border-hover);
}

.code-copy-btn.is-copied {
    color: var(--docs-primary);
    border-color: rgba(0, 212, 170, 0.25);
}

/* Code language labels */
.code-lang-label {
    position: absolute;
    top: 8px;
    right: 60px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--docs-font-mono);
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

/* HTTP method badges */
.method-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--docs-font-mono);
    border-radius: 4px;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-right: 4px;
}

.method-badge--get {
    background: rgba(0, 212, 170, 0.12);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.15);
}

.method-badge--post {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.method-badge--put {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.method-badge--patch {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.method-badge--delete {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.method-badge--options,
.method-badge--head {
    background: rgba(255, 255, 255, 0.06);
    color: var(--docs-text-muted);
    border: 1px solid var(--docs-border);
}

/* Mobile table wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border-radius: 8px;
    border: 1px solid var(--docs-border);
}

.table-wrapper:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

.table-wrapper table {
    margin: 0;
    border-radius: 0;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.prose thead th {
    text-align: left;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--docs-border-hover);
    background: var(--docs-bg-raised);
    color: var(--docs-text);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.prose tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--docs-border);
    vertical-align: top;
    color: var(--docs-text-secondary);
}

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

.prose tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.prose tbody code {
    font-size: 0.85em;
}

/* Images */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid var(--docs-border);
}

/* ── Content header (breadcrumbs + agent toggle) ──────────────── */

.docs-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.docs-content-header .docs-breadcrumbs {
    margin-bottom: 0;
}

/* ── Agent toggle button ──────────────────────────────────────── */

.docs-agent-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--docs-font-mono);
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--docs-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms;
    white-space: nowrap;
    flex-shrink: 0;
}

.docs-agent-toggle:hover {
    color: var(--docs-primary);
    border-color: rgba(0, 212, 170, 0.25);
    background: var(--docs-primary-dim);
}

.docs-agent-toggle.is-active {
    color: var(--docs-primary);
    border-color: rgba(0, 212, 170, 0.3);
    background: var(--docs-primary-dim);
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.1);
}

.docs-agent-toggle-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Raw markdown view ────────────────────────────────────────── */

.docs-raw-container {
    margin-top: 0;
}

.docs-raw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #0c0c14;
    border: 1px solid var(--docs-border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.docs-raw-badge {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--docs-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--docs-text-muted);
}

.docs-raw-copy {
    padding: 4px 12px;
    font-size: 12px;
    font-family: var(--docs-font-mono);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--docs-text-muted);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms;
}

.docs-raw-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--docs-text-secondary);
    border-color: var(--docs-border-hover);
}

.docs-raw-copy.is-copied {
    color: var(--docs-primary);
    border-color: rgba(0, 212, 170, 0.25);
}

.docs-raw-pre {
    margin: 0;
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--docs-border);
    border-top: 1px solid var(--docs-border);
    overflow: hidden;
}

.docs-raw-pre code {
    display: block;
    padding: 20px 24px;
    font-family: var(--docs-font-mono);
    font-size: 13px;
    line-height: 1.65;
    background: #0c0c14;
    color: #cdd6f4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
}

/* ── Page footer ───────────────────────────────────────────────── */

.docs-page-footer {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--docs-border);
}

.docs-page-footer p {
    font-size: 13px;
    color: var(--docs-text-muted);
}

/* ── Previous / Next navigation ───────────────────────────────── */

.docs-prev-next {
    display: flex;
    gap: 12px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--docs-border);
}

.docs-prev-next-card {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 16px 20px;
    background: var(--docs-bg-raised);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}

.docs-prev-next-card:hover {
    border-color: var(--docs-border-hover);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.docs-prev-next-card:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

.docs-prev-next-card svg {
    color: var(--docs-text-muted);
    flex-shrink: 0;
    transition: color 200ms, transform 200ms;
}

.docs-prev-next-card:hover svg {
    color: var(--docs-primary);
}

.docs-prev-next-card--prev:hover svg {
    transform: translateX(-2px);
}

.docs-prev-next-card--next {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.docs-prev-next-card--next:hover svg {
    transform: translateX(2px);
}

.docs-prev-next-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-prev-next-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--docs-text-muted);
    font-family: var(--docs-font-mono);
}

.docs-prev-next-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-text);
    transition: color 200ms;
}

.docs-prev-next-card:hover .docs-prev-next-title {
    color: var(--docs-primary);
}

@media (max-width: 480px) {
    .docs-prev-next {
        flex-direction: column;
    }

    .docs-prev-next-card--next {
        justify-content: flex-start;
        text-align: left;
        flex-direction: row-reverse;
    }
}

/* ── Focus styles ──────────────────────────────────────────────── */

.docs-header-link:focus-visible,
.docs-nav-link:focus-visible,
.docs-logo:focus-visible,
.docs-logo-sub:focus-visible,
.prose a:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .docs-main {
        padding: 24px 32px 64px;
    }
}

@media (max-width: 768px) {
    .docs-sidebar-toggle {
        display: flex;
    }

    .docs-sidebar {
        position: fixed;
        top: var(--docs-header-height);
        left: 0;
        bottom: 0;
        z-index: 50;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 250ms ease;
        box-shadow: none;
        border-right: 1px solid var(--docs-border);
    }

    .docs-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
    }

    .docs-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: var(--docs-header-height);
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
    }

    .docs-overlay.is-visible {
        display: block;
    }

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

    .prose h1 {
        font-size: 26px;
    }

    .prose h2 {
        font-size: 20px;
    }

    .prose h3 {
        font-size: 17px;
    }

    .prose pre code {
        font-size: 12px;
    }

    .docs-header-link:not(.docs-header-link--primary) {
        display: none;
    }

    .docs-content-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .docs-main {
        padding: 16px 12px 48px;
    }

    .prose table {
        font-size: 12px;
    }

    .prose thead th,
    .prose tbody td {
        padding: 8px 6px;
    }
}

/* ── Search trigger button ────────────────────────────────────── */

.docs-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.docs-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    font-size: 14px;
    font-family: var(--docs-font-sans);
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms;
    min-width: 200px;
}

.docs-search-trigger:hover {
    color: var(--docs-text-secondary);
    border-color: var(--docs-border-hover);
    background: rgba(255, 255, 255, 0.06);
}

.docs-search-trigger:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

.docs-search-trigger svg {
    flex-shrink: 0;
}

.docs-search-trigger-text {
    flex: 1;
    text-align: left;
}

.docs-search-trigger-kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--docs-font-sans);
    font-weight: 500;
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    line-height: 1;
}

/* ── Search overlay ───────────────────────────────────────────── */

.docs-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.docs-search-overlay[hidden] {
    display: none;
}

.docs-search-dialog {
    width: 100%;
    max-width: 560px;
    max-height: 480px;
    background: var(--docs-bg-raised);
    border: 1px solid var(--docs-border-hover);
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 48px rgba(0, 212, 170, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.docs-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--docs-border);
}

.docs-search-icon {
    display: flex;
    align-items: center;
    color: var(--docs-text-muted);
    flex-shrink: 0;
}

.docs-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: var(--docs-font-sans);
    color: var(--docs-text);
    caret-color: var(--docs-primary);
}

.docs-search-input::placeholder {
    color: var(--docs-text-muted);
}

.docs-search-esc {
    padding: 3px 8px;
    font-size: 11px;
    font-family: var(--docs-font-sans);
    font-weight: 500;
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    flex-shrink: 0;
}

.docs-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.docs-search-results::-webkit-scrollbar {
    width: 4px;
}

.docs-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.docs-search-group {
    margin-bottom: 8px;
}

.docs-search-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--docs-text-muted);
    font-family: var(--docs-font-mono);
    padding: 6px 12px 4px;
}

.docs-search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 100ms;
}

.docs-search-item:hover,
.docs-search-item.is-active {
    background: rgba(255, 255, 255, 0.04);
}

.docs-search-item.is-active {
    background: var(--docs-primary-dim);
}

.docs-search-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--docs-text);
}

.docs-search-item.is-active .docs-search-item-title {
    color: var(--docs-primary);
}

.docs-search-item-desc {
    font-size: 13px;
    color: var(--docs-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-search-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--docs-text-muted);
}

.docs-search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--docs-border);
    font-size: 12px;
    color: var(--docs-text-muted);
}

.docs-search-count {
    font-family: var(--docs-font-mono);
    font-size: 11px;
}

.docs-search-hints {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.docs-search-hints kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: var(--docs-font-sans);
    color: var(--docs-text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--docs-border);
    border-radius: 3px;
}

/* Search responsive */

@media (max-width: 768px) {
    .docs-search-trigger {
        min-width: auto;
        padding: 6px 8px;
    }

    .docs-search-trigger-text,
    .docs-search-trigger-kbd {
        display: none;
    }

    .docs-search-overlay {
        padding-top: 8vh;
        padding-left: 12px;
        padding-right: 12px;
    }

    .docs-search-dialog {
        max-height: 70vh;
    }

    .docs-search-hints {
        display: none;
    }
}

/* ── Right-hand Table of Contents ─────────────────────────────── */

.docs-toc {
    position: sticky;
    top: var(--docs-header-height);
    width: 200px;
    height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 32px 16px 32px 0;
    flex-shrink: 0;
}

.docs-toc::-webkit-scrollbar {
    width: 3px;
}

.docs-toc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.docs-toc::-webkit-scrollbar-track {
    background: transparent;
}

.docs-toc-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--docs-text-muted);
    font-family: var(--docs-font-mono);
    margin-bottom: 12px;
    padding-left: 12px;
}

.docs-toc-list {
    list-style: none;
}

.docs-toc-item {
    margin-bottom: 2px;
}

.docs-toc-item--nested {
    padding-left: 12px;
}

.docs-toc-link {
    display: block;
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--docs-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: color 150ms, border-color 150ms, background 150ms;
}

.docs-toc-link:hover {
    color: var(--docs-text-secondary);
}

.docs-toc-link.is-active {
    color: var(--docs-primary);
    border-left-color: var(--docs-primary);
    background: rgba(0, 212, 170, 0.04);
}

.docs-toc-link:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* TOC hidden state (when no headings or on landing page) */

.docs-toc[hidden] {
    display: none;
}

/* ── TOC responsive ───────────────────────────────────────────── */

@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════════════
   Docs Landing Page (index)
   ══════════════════════════════════════════════════════════════════ */

/* ── Skip nav ─────────────────────────────────────────────────── */

.docs-skip-nav {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 1000;
    padding: 8px 16px;
    background: var(--docs-primary);
    color: var(--docs-bg);
    border-radius: 0 0 6px 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: top 150ms;
}

.docs-skip-nav:focus {
    top: 0;
}

/* ── Index layout ─────────────────────────────────────────────── */

.layout-docs-index {
    overflow-x: hidden;
}

.docs-index {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Dot-grid background ──────────────────────────────────────── */

.docs-index-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 80%);
    pointer-events: none;
}

/* ── Hero section ─────────────────────────────────────────────── */

.docs-index-hero {
    padding: 80px 0 64px;
    text-align: center;
}

.docs-index-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--docs-text);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--docs-text) 0%, var(--docs-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.docs-index-subtitle {
    font-size: 18px;
    line-height: 1.65;
    color: var(--docs-text-secondary);
    max-width: 640px;
    margin: 0 auto 48px;
}

/* ── Quick start steps ────────────────────────────────────────── */

.docs-index-quickstart {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px;
    background: var(--docs-bg-raised);
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 48px rgba(0, 212, 170, 0.03);
}

.docs-index-quickstart-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--docs-text-muted);
    font-family: var(--docs-font-mono);
    margin-bottom: 20px;
}

.docs-index-quickstart-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.docs-index-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.docs-index-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--docs-primary-dim);
    color: var(--docs-primary);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--docs-font-mono);
    flex-shrink: 0;
    border: 1px solid rgba(0, 212, 170, 0.15);
}

.docs-index-step-body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.docs-index-step-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--docs-text);
}

.docs-index-step-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--docs-primary);
    text-decoration: none;
    transition: color 150ms;
}

.docs-index-step-link:hover {
    color: var(--docs-primary-hover);
    text-decoration: underline;
}

/* ── Section heading ──────────────────────────────────────────── */

.docs-index-section-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--docs-text-muted);
    font-family: var(--docs-font-mono);
    margin-bottom: 24px;
}

/* ── Service card grid ────────────────────────────────────────── */

.docs-index-services {
    padding: 48px 0 64px;
}

.docs-index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.docs-index-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: var(--docs-bg-raised);
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 250ms, box-shadow 250ms, transform 250ms;
    overflow: hidden;
}

.docs-index-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 300ms;
    pointer-events: none;
}

.docs-index-card:hover {
    border-color: var(--docs-border-hover);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 40px rgba(0, 212, 170, 0.04);
    transform: translateY(-2px);
}

.docs-index-card:hover::before {
    opacity: 1;
}

.docs-index-card:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

/* Card icon containers with per-service colour accent */

.docs-index-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: box-shadow 250ms;
}

.docs-index-card-icon--context {
    background: rgba(0, 212, 170, 0.1);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--context {
    box-shadow: 0 0 16px rgba(0, 212, 170, 0.12);
}

.docs-index-card-icon--changelog {
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--changelog {
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.12);
}

.docs-index-card-icon--feedback {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--feedback {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.12);
}

.docs-index-card-icon--runbooks {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--runbooks {
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.12);
}

.docs-index-card-icon--agents {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--agents {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.12);
}

.docs-index-card-icon--styleguide {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.12);
}

.docs-index-card:hover .docs-index-card-icon--styleguide {
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.12);
}

.docs-index-card-icon--tasks {
    background: rgba(250, 204, 21, 0.08);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.15);
}

.docs-index-card:hover .docs-index-card-icon--tasks {
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.08);
}

.docs-index-card-icon--documents {
    background: rgba(168, 130, 255, 0.08);
    color: #a882ff;
    border: 1px solid rgba(168, 130, 255, 0.15);
}

.docs-index-card:hover .docs-index-card-icon--documents {
    box-shadow: 0 0 16px rgba(168, 130, 255, 0.08);
}

.docs-index-card-icon--bootstrap {
    background: rgba(0, 212, 170, 0.06);
    color: var(--docs-text-secondary);
    border: 1px solid var(--docs-border);
}

.docs-index-card:hover .docs-index-card-icon--bootstrap {
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.04);
}

/* Card content */

.docs-index-card-content {
    flex: 1;
    min-width: 0;
}

.docs-index-card-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--docs-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-index-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--docs-font-mono);
    border-radius: 4px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.docs-index-card-badge--free {
    background: var(--docs-primary-dim);
    color: var(--docs-primary);
    border: 1px solid rgba(0, 212, 170, 0.15);
}

.docs-index-card-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--docs-text-secondary);
}

.docs-index-card-arrow {
    display: flex;
    align-items: center;
    color: var(--docs-text-muted);
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 200ms, transform 200ms;
}

.docs-index-card:hover .docs-index-card-arrow {
    color: var(--docs-primary);
    transform: translateX(3px);
}

/* ── Guides grid ──────────────────────────────────────────────── */

.docs-index-guides {
    padding: 0 0 64px;
}

.docs-index-guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.docs-index-guide-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 200ms, background 200ms;
}

.docs-index-guide-card:hover {
    border-color: var(--docs-border-hover);
    background: rgba(20, 20, 30, 0.8);
}

.docs-index-guide-card:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

.docs-index-guide-icon {
    color: var(--docs-text-muted);
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 200ms;
}

.docs-index-guide-card:hover .docs-index-guide-icon {
    color: var(--docs-primary);
}

.docs-index-guide-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.docs-index-guide-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--docs-text-muted);
}

/* ── CTA section ──────────────────────────────────────────────── */

.docs-index-cta {
    padding: 0 0 80px;
}

.docs-index-cta-inner {
    text-align: center;
    padding: 48px 32px;
    background: var(--docs-bg-raised);
    border: 1px solid var(--docs-border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.docs-index-cta-inner::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.4), transparent);
}

.docs-index-cta-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--docs-text);
    margin-bottom: 8px;
}

.docs-index-cta-desc {
    font-size: 16px;
    color: var(--docs-text-secondary);
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.docs-index-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.docs-index-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 250ms;
}

.docs-index-cta-btn--primary {
    background: var(--docs-primary);
    color: var(--docs-bg);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.15);
}

.docs-index-cta-btn--primary:hover {
    background: var(--docs-primary-hover);
    box-shadow: 0 0 32px rgba(0, 212, 170, 0.25);
    transform: translateY(-1px);
}

.docs-index-cta-btn--secondary {
    background: transparent;
    color: var(--docs-text-secondary);
    border: 1px solid var(--docs-border);
}

.docs-index-cta-btn--secondary:hover {
    color: var(--docs-text);
    border-color: var(--docs-border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.docs-index-cta-btn:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}

/* ── Footer ───────────────────────────────────────────────────── */

.docs-index-footer {
    border-top: 1px solid var(--docs-border);
    padding: 24px 0;
}

.docs-index-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--docs-text-muted);
}

.docs-index-footer-links {
    display: flex;
    gap: 20px;
}

.docs-index-footer-links a {
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color 150ms;
}

.docs-index-footer-links a:hover {
    color: var(--docs-text-secondary);
}

/* ── Index responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
    .docs-index-hero {
        padding: 56px 0 48px;
    }

    .docs-index-title {
        font-size: 32px;
    }

    .docs-index-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .docs-index-quickstart {
        padding: 24px;
    }

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

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

    .docs-index-cta-inner {
        padding: 32px 20px;
    }

    .docs-index-cta-title {
        font-size: 22px;
    }

    .docs-index-footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .docs-index-hero {
        padding: 40px 0 36px;
    }

    .docs-index-title {
        font-size: 26px;
    }

    .docs-index-step-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ── Reduced Motion ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .docs-index-cta-btn--primary:hover {
        transform: none !important;
    }
}

/* ── Additional Focus Styles ─────────────────────────────────── */

.docs-index-footer-links a:focus-visible,
.docs-index-guide-card:focus-visible,
.docs-skip-nav:focus-visible {
    outline: 2px solid var(--docs-primary);
    outline-offset: 2px;
}
