:root {
        --doc-primary: #4f46e5;
        --doc-primary-soft: rgba(79, 70, 229, 0.08);
        --doc-secondary: #0ea5e9;
        --doc-dark: #0f172a;
        --doc-slate: #334155;
        --doc-muted: #64748b;
        --doc-border: #e2e8f0;
        --doc-surface: #ffffff;
        --doc-bg: #f8fafc;
    }

    body {
        background: var(--doc-bg);
        color: var(--doc-slate);
        scroll-behavior: smooth;
    }

    /* ── Hero Header (Compact & Focused) ── */
    .manual-hero {
        background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #0f172a 100%);
        color: #ffffff;
        padding: 1.75rem 0 1.25rem;
        margin-top: -1.5rem;
        margin-bottom: 1.25rem;
        position: relative;
        overflow: hidden;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .manual-hero::before {
        content: '';
        position: absolute;
        top: -40%;
        left: -5%;
        width: 380px;
        height: 380px;
        background: radial-gradient(circle, rgba(79, 70, 229, 0.22) 0%, transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }
    .manual-hero::after {
        content: '';
        position: absolute;
        bottom: -40%;
        right: -5%;
        width: 360px;
        height: 360px;
        background: radial-gradient(circle, rgba(62, 199, 191, 0.18) 0%, transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }

    .search-shell {
        max-width: 680px;
        margin: 0 auto;
        position: relative;
    }
    .search-shell .form-control {
        height: 46px;
        border-radius: 12px;
        padding-left: 2.75rem;
        padding-right: 5.75rem;
        font-size: 0.91rem;
        font-weight: 500;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.98);
        color: var(--doc-dark);
        box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
        transition: all 0.2s ease;
    }
    .search-shell .form-control:focus {
        border-color: #3EC7BF;
        box-shadow: 0 0 0 3px rgba(62, 199, 191, 0.3);
        background: #ffffff;
    }
    .search-shell .search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.05rem;
        color: var(--doc-primary);
        pointer-events: none;
    }
    .search-shell .kbd-shortcut {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        padding: 2px 7px;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.03em;
    }

    /* ── Role Filter Bar (Segmented Single-Row Pill Track) ── */
    .role-filter-bar {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 4px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        margin-top: 0.85rem;
        max-width: 100%;
    }
    .role-pill {
        border: 1px solid transparent;
        background: transparent;
        color: rgba(255, 255, 255, 0.82);
        padding: 0.32rem 0.75rem;
        border-radius: 999px;
        font-size: 0.77rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.18s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        white-space: nowrap;
    }
    .role-pill i {
        font-size: 0.8rem;
    }
    .role-pill:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }
    .role-pill.active {
        background: #3EC7BF;
        border-color: #3EC7BF;
        color: #0f172a;
        font-weight: 800;
        box-shadow: 0 4px 12px rgba(62, 199, 191, 0.35);
    }

    /* ── Sticky Sidebar TOC ── */
    .doc-sidebar {
        position: sticky;
        top: 96px;
        max-height: calc(100vh - 116px);
        overflow-y: auto;
        padding-right: 0.5rem;
    }
    .doc-sidebar::-webkit-scrollbar {
        width: 5px;
    }
    .doc-sidebar::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }
    .toc-card {
        background: var(--doc-surface);
        border: 1px solid var(--doc-border);
        border-radius: 20px;
        padding: 1.25rem;
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
    }
    .toc-link {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        padding: 0.55rem 0.75rem;
        border-radius: 10px;
        color: var(--doc-slate);
        text-decoration: none;
        font-size: 0.84rem;
        font-weight: 600;
        transition: all 0.2s ease;
        margin-bottom: 2px;
    }
    .toc-link i {
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }
    .toc-link:hover {
        background: #f1f5f9;
        color: var(--doc-primary);
    }
    .toc-link.active {
        background: var(--doc-primary-soft);
        color: var(--doc-primary);
        font-weight: 800;
    }
    .toc-num {
        font-size: 0.7rem;
        font-weight: 800;
        background: #f1f5f9;
        color: #475569;
        padding: 2px 6px;
        border-radius: 6px;
        margin-left: auto;
    }
    .toc-link.active .toc-num {
        background: var(--doc-primary);
        color: #ffffff;
    }

    /* ── Manual Chapter Cards (Single-Chapter Reader Mode) ── */
    .doc-chapter {
        background: var(--doc-surface);
        border: 1px solid var(--doc-border);
        border-radius: 24px;
        padding: 2.25rem;
        margin-bottom: 1.5rem;
        box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.04);
        scroll-margin-top: 105px;
        transition: border-color 0.25s ease;
    }
    .doc-chapter:hover {
        border-color: rgba(79, 70, 229, 0.25);
    }
    .chapter-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding-bottom: 1.25rem;
        margin-bottom: 1.25rem;
        border-bottom: 2px solid #f1f5f9;
    }
    .chapter-icon {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    .chapter-badge {
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 0.35rem 0.75rem;
        border-radius: 999px;
    }

    /* ── "In This Chapter" Quick-Jump Topic Bar ── */
    .chapter-topic-bar {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 0.85rem 1rem;
        margin-bottom: 1.5rem;
    }
    .chapter-topic-label {
        font-size: 0.7rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #64748b;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .chapter-topic-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .topic-jump-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #334155;
        font-size: 0.76rem;
        font-weight: 700;
        padding: 0.3rem 0.65rem;
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.18s ease;
    }
    .topic-jump-pill:hover, .topic-jump-pill.active {
        background: var(--doc-primary-soft);
        border-color: var(--doc-primary);
        color: var(--doc-primary);
    }

    /* ── Sidebar Nested Active Chapter Sub-Links ── */
    .toc-subnav {
        padding-left: 1.85rem;
        margin: 0.25rem 0 0.5rem;
        border-left: 2px solid #e2e8f0;
        margin-left: 1.1rem;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .toc-sublink {
        font-size: 0.75rem;
        font-weight: 600;
        color: #64748b;
        text-decoration: none;
        padding: 0.28rem 0.5rem;
        border-radius: 6px;
        transition: all 0.15s ease;
        line-height: 1.3;
    }
    .toc-sublink:hover, .toc-sublink.active {
        color: var(--doc-primary);
        background: var(--doc-primary-soft);
        font-weight: 700;
    }

    /* ── Sub-sections & Progressive Disclosure Accordions ── */
    .doc-section {
        margin-bottom: 1.1rem;
        padding: 1.15rem 1.25rem;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: #ffffff;
        scroll-margin-top: 110px;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .doc-section:hover {
        border-color: #cbd5e1;
    }
    .doc-section.sec-expanded {
        border-color: rgba(79, 70, 229, 0.32);
        box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.07);
    }
    .doc-section:last-child {
        margin-bottom: 0;
    }
    .doc-section h4 {
        font-size: 1.06rem;
        font-weight: 800;
        color: var(--doc-dark);
        margin-bottom: 0.55rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        cursor: pointer;
        user-select: none;
    }
    .doc-section h4:hover {
        color: var(--doc-primary);
    }
    .sec- toggle-bar-wrap {
        margin-top: 0.65rem;
    }
    .sec-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        color: #1e293b;
        font-size: 0.78rem;
        font-weight: 700;
        padding: 0.38rem 0.85rem;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.18s ease;
        margin-top: 0.45rem;
    }
    .sec-toggle-btn:hover {
        background: var(--doc-primary-soft);
        border-color: var(--doc-primary);
        color: var(--doc-primary);
    }
    .doc-section.sec-expanded .sec-toggle-btn {
        background: var(--doc-primary-soft);
        border-color: rgba(79, 70, 229, 0.3);
        color: var(--doc-primary);
    }
    .sec-toggle-meta {
        font-size: 0.7rem;
        font-weight: 800;
        background: #e2e8f0;
        color: #334155;
        padding: 1px 7px;
        border-radius: 999px;
    }
    .doc-section.sec-expanded .sec-toggle-meta {
        background: var(--doc-primary);
        color: #ffffff;
    }
    .sec-details-drawer {
        display: none;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px dashed #e2e8f0;
    }
    .doc-section.sec-expanded .sec-details-drawer {
        display: block;
    }

    /* ── GitBook / Stripe Bottom Chapter Pagination ── */
    .chapter-pagination-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    .chapter-nav-card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: #ffffff;
        border: 1px solid var(--doc-border);
        border-radius: 18px;
        padding: 1.15rem 1.35rem;
        text-decoration: none;
        color: var(--doc-dark);
        transition: all 0.2s ease;
        box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.04);
    }
    .chapter-nav-card:hover {
        border-color: var(--doc-primary);
        background: #fafbff;
        transform: translateY(-2px);
        box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 0.14);
    }
    .chapter-nav-card.next-card {
        text-align: right;
        align-items: flex-end;
    }
    .chapter-nav-dir {
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--doc-muted);
        margin-bottom: 0.25rem;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .chapter-nav-title {
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--doc-dark);
    }
    .chapter-nav-card:hover .chapter-nav-title {
        color: var(--doc-primary);
    }
    @media (max-width: 575.98px) {
        .chapter-pagination-bar {
            grid-template-columns: 1fr;
        }
    }
    .nav-path {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        padding: 0.25rem 0.65rem;
        font-size: 0.78rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 0.85rem;
    }
    .nav-path i {
        color: var(--doc-primary);
    }

    .ui-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        background: #eef2ff;
        color: #4338ca;
        border: 1px solid #c7d2fe;
        border-radius: 6px;
        padding: 1px 7px;
        font-size: 0.8rem;
        font-weight: 700;
        white-space: nowrap;
    }
    .ui-btn-success {
        background: #ecfdf5;
        color: #047857;
        border-color: #a7f3d0;
    }
    .ui-btn-danger {
        background: #fef2f2;
        color: #b91c1c;
        border-color: #fecaca;
    }
    .ui-btn-warning {
        background: #fffbeb;
        color: #b45309;
        border-color: #fde68a;
    }

    .step-list {
        counter-reset: doc-step;
        list-style: none;
        padding-left: 0;
        margin-bottom: 1rem;
    }
    .step-list li {
        counter-increment: doc-step;
        position: relative;
        padding-left: 2.5rem;
        margin-bottom: 0.75rem;
        font-size: 0.93rem;
        line-height: 1.6;
    }
    .step-list li::before {
        content: counter(doc-step);
        position: absolute;
        left: 0;
        top: 0.1rem;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 8px;
        background: var(--doc-primary-soft);
        color: var(--doc-primary);
        font-weight: 800;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Callout Boxes ── */
    .doc-callout {
        border-radius: 14px;
        padding: 1rem 1.25rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: flex-start;
        gap: 0.85rem;
        font-size: 0.88rem;
        line-height: 1.55;
    }
    .doc-callout i {
        font-size: 1.2rem;
        margin-top: 0.05rem;
        flex-shrink: 0;
    }
    .doc-callout-info {
        background: #f0f9ff;
        border: 1px solid #bae6fd;
        color: #0c4a6e;
    }
    .doc-callout-warning {
        background: #fffbeb;
        border: 1px solid #fde68a;
        color: #78350f;
    }
    .doc-callout-security {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #7f1d1d;
    }
    .doc-callout-tip {
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
        color: #14532d;
    }

    /* ── Workflow Pipeline Strip ── */
    .workflow-strip {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        padding: 0.85rem 1.1rem;
        margin: 1rem 0;
    }
    .wf-node {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        font-weight: 700;
        color: #0f172a;
        box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    }
    .wf-arrow {
        color: #94a3b8;
        font-weight: bold;
    }

    mark.doc-highlight {
        background: #fef08a;
        color: #0f172a;
        padding: 0 3px;
        border-radius: 4px;
    }

    /* ── Print Styles ── */
    @media print {
        .header-main, footer, .doc-sidebar-col, .manual-hero .search-shell, .manual-hero .role-filter-bar, .no-print, .sec-toggle-btn, .chapter-topic-bar, .chapter-pagination-bar {
            display: none !important;
        }
        .sec-details-drawer {
            display: block !important;
        }
        .main-content {
            padding-top: 0 !important;
        }
        .manual-hero {
            background: #ffffff !important;
            color: #000000 !important;
            padding: 1rem 0 !important;
            margin: 0 0 1.5rem 0 !important;
            border-bottom: 2px solid #000 !important;
        }
        .manual-hero p, .manual-hero h1, .manual-hero span {
            color: #000000 !important;
        }
        .doc-chapter {
            box-shadow: none !important;
            border: 1px solid #cbd5e1 !important;
            page-break-inside: avoid;
            margin-bottom: 1.5rem !important;
            padding: 1.5rem !important;
        }
        .doc-main-col {
            width: 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }

    @media (max-width: 991.98px) {
        .doc-chapter {
            padding: 1.5rem;
        }
        .doc-sidebar {
            position: static;
            max-height: none;
            margin-bottom: 1.5rem;
        }
    }
