:root {
    --brand: #198BEA;
    --brand-600: #1476c9;
    --brand-dark: #0a5f9e;
    --brand-050: #eaf5ff;
    --brand-rgb: 25, 139, 234;

    --purple: #7c3aed;
    --purple-600: #6d28d9;
    --purple-050: #f5f3ff;
    --purple-rgb: 124, 58, 237;

    --emerald: #059669;
    --emerald-050: #ecfdf5;
    --emerald-rgb: 5, 150, 105;

    --amber: #d97706;
    --amber-050: #fffbeb;
    --amber-rgb: 217, 119, 6;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    --font-display: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 
 * Dynamic theme override for the Publisher Panel.
 * When `enablePublisherTheme` in JS is true, .publisher-theme-active is added to the wrapper.
 * This overrides standard brand blue colors with the Publisher's real teal/emerald brand colors.
 */
.docs-wrapper.publisher-theme-active {
    --brand: #0D9488;          /* Primary Accent Teal */
    --brand-600: #0A7A70;      /* Hover Accent Dark Teal */ 
    --brand-dark: #0f1a2e;     /* Deep Navy Blue for titles/sidebars */
    --brand-050: #CCFBF1;      /* Light Teal Backgrounds */
    --brand-rgb: 13, 148, 136; /* RGB values of the primary teal color */

    /* Override purple variables to teal for dynamic publisher active states */
    --purple: #0D9488;
    --purple-600: #0A7A70;
    --purple-050: #CCFBF1;
    --purple-rgb: 13, 148, 136;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
}

/* Layout Structure */
.docs-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 310px 1fr 250px;
    min-height: calc(100vh - 80px);
    position: relative;
    background-color: var(--bg-body);
}

/* Custom Scrollbar for sidebars and text areas */
.doc-custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.doc-custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.doc-custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 100px;
}
.doc-custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ═══ 1. LEFT SIDEBAR NAVIGATION ═══ */
.doc-sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

/* Segmented Controller (iOS Switcher Style) */
.doc-switcher-container {
    position: relative;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}
.doc-switcher-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: var(--brand);
    border-radius: calc(var(--radius-md) - 2px);
    box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.25);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
}
.doc-switcher-btn {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-display);
    cursor: pointer;
    z-index: 2;
    text-align: center;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.doc-switcher-btn.active {
    color: #ffffff;
}

/* Purple theme color switch for publisher slider */
.docs-wrapper.publisher-active .doc-switcher-slider {
    transform: translateX(100%);
    background: var(--purple);
    box-shadow: 0 4px 10px rgba(var(--purple-rgb), 0.25);
}

/* Search Input Box */
.doc-search-container {
    position: relative;
    width: 100%;
}
.doc-search-input {
    width: 100%;
    padding: 11px 40px 11px 36px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--text-primary);
    transition: var(--transition);
}
.doc-search-input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}
.doc-search-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
.docs-wrapper.publisher-active .doc-search-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(var(--purple-rgb), 0.15);
}
.doc-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.doc-search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

/* Dynamic Menu Lists */
.doc-menu-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}
.doc-menu-section {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}
.doc-menu-section.active {
    display: block;
}
.doc-menu-group {
    margin-bottom: 24px;
}
.doc-menu-group-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 14px;
    text-align: left;
}
.doc-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.doc-menu-link-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border-left: 2px solid transparent;
}
.doc-menu-link-item a:hover {
    color: var(--brand);
    background-color: var(--brand-050);
}
.docs-wrapper.publisher-active .doc-menu-link-item a:hover {
    color: var(--purple);
    background-color: var(--purple-050);
}
.doc-menu-link-item.doc-link-active a {
    color: var(--brand);
    background-color: var(--brand-050);
    border-left-color: var(--brand);
    font-weight: 700;
}
.docs-wrapper.publisher-active .doc-menu-link-item.doc-link-active a {
    color: var(--purple);
    background-color: var(--purple-050);
    border-left-color: var(--purple);
}
a strong{
    color: var(--text-secondary);
    font-family: var(--font-body);
}
a strong:hover{
    color: var(--brand);
}
.doc-menu-link-item .iconify {
    font-size: 16px;
    flex-shrink: 0;
    transition: var(--transition);
}
.doc-menu-link-item a:hover .iconify {
    transform: translateX(1px);
}

/* ═══ 2. CENTER READING CANVAS ═══ */
.docs-canvas {
    padding: 40px 48px;
    overflow-y: auto;
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
}

/* Dynamic Breadcrumbs */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 70px 0 28px 0;
    font-family: var(--font-display);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.docs-breadcrumb .breadcrumb-item {
    transition: var(--transition);
}
.docs-breadcrumb .breadcrumb-item.active {
    color: var(--brand);
    font-weight: 700;
}
.docs-wrapper.publisher-active .docs-breadcrumb .breadcrumb-item.active {
    color: var(--purple);
}
.docs-breadcrumb .breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 400;
}
.doc-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out forwards;
    /* Override global section styles from main site CSS */
    padding: 0 !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
    gap: unset !important;
    margin: 0 !important;
}
.doc-section.active {
    display: block !important;
    /* Keep overrides active on the visible section too */
    padding: 0 !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
}

/* Typographical Hierarchies */
.doc-header-card {
    margin-bottom: 40px;
    position: relative;
}
.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.badge-scholar {
    background-color: var(--brand-050);
    color: var(--brand);
    border: 1px solid rgba(var(--brand-rgb), 0.15);
}
.badge-publisher {
    background-color: var(--purple-050);
    color: var(--purple);
    border: 1px solid rgba(var(--purple-rgb), 0.15);
}
.doc-main-title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.doc-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Standard Inner Subheadings */
.docs-canvas h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 16px;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.docs-canvas h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: var(--brand);
    border-radius: 100px;
}

.docs-wrapper.publisher-active .docs-canvas h2::before {
    background-color: var(--purple);
}
.docs-canvas h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}
.docs-canvas p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.7;
}
.docs-canvas ul {
    list-style: none;
    padding-left: 8px;
    margin-bottom: 20px;
}
.docs-canvas ul li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.docs-canvas ul li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--brand);
    font-weight: bold;
}
.docs-wrapper.publisher-active .docs-canvas ul li::before {
    color: var(--purple);
}

.docs-canvas ol {
    list-style: none;
    counter-reset: doc-ol-counter;
    padding-left: 0;
    margin-bottom: 24px;
}
.docs-canvas ol li {
    position: relative;
    padding-left: 32px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.7;
}
.docs-canvas ol li::before {
    counter-increment: doc-ol-counter;
    content: counter(doc-ol-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--brand-050);
    color: var(--brand);
    border: 1px solid rgba(var(--brand-rgb), 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.docs-wrapper.publisher-active .docs-canvas ol li::before {
    background-color: var(--purple-050);
    color: var(--purple);
    border-color: rgba(var(--purple-rgb), 0.15);
}

/* Styled Callouts & Alerts */
.doc-alert {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid transparent;
    font-size: 13.5px;
    line-height: 1.6;
}
.doc-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}
.doc-alert-content > strong:first-child {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 13.5px;
}
.doc-alert-info {
    background-color: var(--brand-050);
    border-color: rgba(var(--brand-rgb), 0.12);
    color: var(--brand-dark);
}
.doc-alert-info .doc-alert-icon {
    color: var(--brand);
}
.doc-alert-info .doc-alert-content strong {
    color: var(--brand-dark);
}
.doc-alert-success {
    background-color: var(--emerald-050);
    border-color: rgba(var(--emerald-rgb), 0.12);
    color: #064e3b;
}
.doc-alert-success .doc-alert-icon {
    color: var(--emerald);
}
.doc-alert-success .doc-alert-content strong {
    color: #064e3b;
}
.doc-alert-warning {
    background-color: var(--amber-050);
    border-color: rgba(var(--amber-rgb), 0.12);
    color: #78350f;
}
.doc-alert-warning .doc-alert-icon {
    color: var(--amber);
}
.doc-alert-warning .doc-alert-content strong {
    color: #78350f;
}

/* Copyable Code Blocks */
.code-block-wrapper {
    position: relative;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    background-color: #0f172a;
    border: 1px solid #1e293b;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e293b;
    padding: 8px 16px;
    border-bottom: 1px solid #334155;
}
.code-lang-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.copy-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}
.copy-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}
.copy-btn .iconify {
    font-size: 14px;
}
.docs-pre {
    margin: 0 !important;
    padding: 16px 20px !important;
    background: transparent !important;
    overflow-x: auto;
}
.docs-code {
    font-family: var(--font-mono) !important;
    font-size: 12.5px !important;
    color: #e2e8f0 !important;
    background: transparent !important;
    padding: 0 !important;
    display: block;
    white-space: pre;
    line-height: 1.6;
}
.code-keyword {
    color: #f472b6;
}
.code-string {
    color: #34d399;
}
.code-variable {
    color: #818cf8;
}
.code-comment {
    color: #64748b;
    font-style: italic;
}
.code-function {
    color: #38bdf8;
}

/* Step Guide / Timelines */
.step-timeline {
    position: relative;
    margin: 32px 0;
    padding-left: 28px;
}
.step-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: var(--border-color);
}
.step-item {
    position: relative;
    margin-bottom: 28px;
}
.step-item:last-child {
    margin-bottom: 0;
}
.step-badge {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--brand);
    box-shadow: var(--shadow-sm);
    z-index: 2;
    transition: var(--transition);
}
.docs-wrapper.publisher-active .step-badge {
    border-color: var(--purple);
    color: var(--purple);
}
.step-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.step-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Onboarding Avatar Graphic Demo */
.avatar-demo-container {
    display: flex;
    gap: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    align-items: center;
    color: #ffffff;
    border: 1px solid #334155;
}
.avatar-demo-circle {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.avatar-demo-face {
    width: 60px;
    height: 60px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.avatar-demo-eyes {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}
.avatar-demo-eye {
    width: 6px;
    height: 6px;
    background: #0f172a;
    border-radius: 50%;
}
.avatar-demo-mouth {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 9px;
    border: 2.5px solid #0f172a;
    border-top: none;
    border-radius: 0 0 18px 18px;
}
.avatar-demo-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: var(--emerald);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2.5px solid #0f172a;
    color: #ffffff;
}
.avatar-demo-text {
    font-size: 13.5px;
    line-height: 1.6;
}
.avatar-demo-text h4 {
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 700;
}

/* ═══ 3. RIGHT SIDE TABLE OF CONTENTS ═══ */
.docs-toc {
    padding: 40px 20px 40px 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    border-left: 1px solid transparent;
    z-index: 10;
}
.toc-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toc-item a {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    line-height: 1.4;
    padding-left: 8px;
    border-left: 2px solid transparent;
}
.toc-item.item-h3 a {
    padding-left: 18px;
    font-size: 11px;
    color: var(--text-muted);
}
.toc-item a:hover {
    color: var(--brand);
}
.docs-wrapper.publisher-active .toc-item a:hover {
    color: var(--purple);
}

.toc-item.active a {
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 700;
}
.docs-wrapper.publisher-active .toc-item.active a {
    color: var(--purple);
    border-left-color: var(--purple);
}

/* Real-time search highlighting tags */
.search-highlight {
    background-color: #fef08a;
    color: #854d0e;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ═══ RESPONSIVE BREAKPOINTS ═══ */

/* Tablet Large: Hide TOC, keep sidebar */
@media (max-width: 1200px) {
    .docs-wrapper {
        grid-template-columns: 280px 1fr;
    }
    .docs-toc {
        display: none;
    }
    .docs-canvas {
        padding: 40px 32px;
    }
}

/* Tablet: Reduce padding, scale headings */
@media (max-width: 1024px) {
    .docs-wrapper {
        grid-template-columns: 260px 1fr;
    }
    .docs-canvas {
        padding: 32px 24px;
    }
    .docs-canvas h2 {
        font-size: 20px;
    }
    .doc-main-title {
        font-size: 28px;
    }
}

/* Mobile: Off-canvas sidebar with toggle */
@media (max-width: 768px) {
    .docs-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    /* Off-canvas sidebar — hidden off left edge by default */
    .doc-sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        width: 300px;
        height: 100vh;
        z-index: 999;
        border-right: 1px solid var(--border-color);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 80px;
        overflow-y: auto;
    }

    /* Slide in when active */
    .doc-sidebar.sidebar-open {
        left: 0;
    }

    .docs-canvas {
        padding: 20px 16px 20px 64px;
        max-width: 100%;
    }

    .docs-breadcrumb {
        font-size: 11px;
        padding-left: 0;
    }

    .doc-main-title {
        font-size: 24px;
    }

    .docs-canvas h2 {
        font-size: 18px;
    }

    .docs-canvas h3 {
        font-size: 14px;
    }

    /* Prevent step-timeline from overflowing on narrow screens */
    .step-timeline {
        padding-left: 24px;
        overflow-x: hidden;
    }

    /* Show the hamburger button */
    #docSidebarToggle {
        display: flex;
    }
}

/* Very small mobile: micro-adjustments */
@media (max-width: 480px) {
    .doc-main-title {
        font-size: 20px;
    }

    .docs-canvas h2 {
        font-size: 16px;
    }

    /* Stack alert icon and content vertically */
    .doc-alert {
        flex-direction: column;
        gap: 10px;
    }

    /* Cap image heights so very tall screenshots don't overflow */
    .doc-img-card img {
        object-fit: contain;
        max-height: 380px;
    }

    /* Pagination stacks on tiny screens */
    .doc-pagination {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .doc-img-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ SCREENSHOT IMAGE CARDS ═══ */
.doc-img-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    background: #fff;
    transition: var(--transition);
}
.doc-img-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.doc-img-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}
.doc-img-caption {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.doc-img-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 640px) {
    .doc-img-grid {
        grid-template-columns: 1fr;
    }
}

.doc-img-step-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
    margin-bottom: 8px;
}
.docs-wrapper.publisher-active .doc-img-step-label {
    color: var(--purple);
}

/* ══════ PAGINATION ══════ */
.doc-pagination {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.doc-pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: var(--transition);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.doc-pagination-btn:hover {
    color: var(--brand);
}
.docs-wrapper.publisher-active .doc-pagination-btn:hover {
    color: var(--purple);
}
.doc-pagination-btn .iconify {
    font-size: 14px;
    transition: transform 0.2s ease;
}
.doc-pagination-btn.prev:hover .iconify {
    transform: translateX(-3px);
}
.doc-pagination-btn.next:hover .iconify {
    transform: translateX(3px);
}

/* ══════ CUSTOM BUTTONS ══════ */
.doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.doc-btn-primary {
    background: var(--brand);
    color: #ffffff;
    border: 1px solid transparent;
}

.doc-btn-primary:hover {
    background: var(--brand-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #ffffff;
}

.docs-wrapper.publisher-active .doc-btn-primary {
    background: var(--purple);
}

.docs-wrapper.publisher-active .doc-btn-primary:hover {
    background: var(--purple-600);
}

/* ══════ MOBILE SIDEBAR OVERLAY ══════ */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#sidebarOverlay.active {
    display: block;
    animation: fadeIn 0.2s ease forwards;
}

/* ══════ HAMBURGER TOGGLE BUTTON ══════ */
/* Hidden by default on desktop (769px+) */
@media (min-width: 769px) {
    #docSidebarToggle {
        display: none !important;
    }
}
#docSidebarToggle {
    position: fixed;
    top: 96px;
    left: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--brand);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(var(--brand-rgb), 0.35);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition);
}
#docSidebarToggle:hover {
    background: var(--brand-600);
    transform: scale(1.08);
}
#docSidebarToggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 100px;
    transition: var(--transition);
}
/* X shape when open */
#docSidebarToggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#docSidebarToggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#docSidebarToggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
/* Publisher theme hamburger */
.docs-wrapper.publisher-active ~ #docSidebarToggle {
    background: var(--purple);
    box-shadow: 0 4px 16px rgba(var(--purple-rgb), 0.40);
}

/* Dynamic theme variables for search modal in Publisher mode */
.docs-wrapper.publisher-theme-active ~ .doc-search-modal-overlay,
.docs-wrapper.publisher-active ~ .doc-search-modal-overlay {
    --brand: #0D9488;          /* Primary Accent Teal */
    --brand-600: #0A7A70;      /* Hover Accent Dark Teal */ 
    --brand-dark: #0f1a2e;     /* Deep Navy Blue for titles/sidebars */
    --brand-050: #CCFBF1;      /* Light Teal Backgrounds */
    --brand-rgb: 13, 148, 136; /* RGB values of the primary teal color */

    --purple: #0D9488;
    --purple-600: #0A7A70;
    --purple-050: #CCFBF1;
    --purple-rgb: 13, 148, 136;
}

.doc-search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45); /* Slate 900 translucent */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: docSearchFadeIn 0.2s ease-out;
}

@keyframes docSearchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.doc-search-modal-card {
    width: 100%;
    max-width: 680px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 16px;
    animation: docSearchSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes docSearchSlideDown {
    from { transform: translateY(-20px) scale(0.98); }
    to { transform: translateY(0) scale(1); }
}

/* Header styling */
.doc-search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.doc-search-modal-icon {
    font-size: 22px;
    color: var(--brand);
    transition: var(--transition);
}

/* Dynamic theme coloring for search modal icon */
.docs-wrapper.publisher-theme-active ~ .doc-search-modal-overlay .doc-search-modal-icon,
.docs-wrapper.publisher-active ~ .doc-search-modal-overlay .doc-search-modal-icon {
    color: var(--purple) ;
}

#docSearchModalInput {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--text-primary);
    background: transparent;
}

#docSearchModalInput::placeholder {
    color: var(--text-muted);
}

.doc-search-modal-close {
    background: transparent;
    border: none;
    outline: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.doc-search-modal-close:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

/* Body and Search Results */
.doc-search-modal-body {
    max-height: 380px;
    overflow-y: auto;
    padding: 20px;
    background: #fafbfe;
}

.doc-search-modal-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Group Headers */
.doc-search-group-title {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-search-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.doc-search-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual Search Items */
.doc-search-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
}

.doc-search-item:hover, 
.doc-search-item.active {
    border-color: var(--brand);
    background: var(--brand-050);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(var(--brand-rgb), 0.08);
}

/* Publisher-specific active state coloring */
.docs-wrapper.publisher-theme-active ~ .doc-search-modal-overlay .doc-search-item:hover,
.docs-wrapper.publisher-theme-active ~ .doc-search-modal-overlay .doc-search-item.active,
.docs-wrapper.publisher-active ~ .doc-search-modal-overlay .doc-search-item:hover,
.docs-wrapper.publisher-active ~ .doc-search-modal-overlay .doc-search-item.active {
    border-color: var(--purple);
    background: var(--purple-050);
    box-shadow: 0 4px 6px -1px rgba(var(--purple-rgb), 0.08);
}

.doc-search-item-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-search-item-meta .meta-arrow {
    font-size: 10px;
}

.doc-search-item-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.doc-search-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Snippet highlight markers */
.doc-search-item .search-highlight {
    background: rgba(var(--brand-rgb), 0.16); /* Dynamic background based on active theme */
    color: var(--brand-600);                  /* Dynamic text color based on active theme */
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Empty Search Results / Guides */
.doc-search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 12px;
    color: var(--text-muted);
}

.doc-search-empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    opacity: 0.6;
}

.doc-search-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.doc-search-empty-desc {
    font-size: 13px;
    max-width: 280px;
    line-height: 1.4;
}

/* Modal Footer controls */
.doc-search-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
    gap: 16px;
}

.footer-help-item {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.key-badge {
    background: #ffffff;
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    text-transform: uppercase;
}

/* Keyboard / shortcode sidebar indicator */
.doc-search-kbd {
    font-family: inherit;
    font-size: 10px;
    background: var(--bg-body);
    border: 1px solid var(--border-hover);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
}

/* Mobile search responsive overrides */
@media (max-width: 768px) {
    .doc-search-modal-overlay {
        padding-top: 0;
    }
    .doc-search-modal-card {
        height: 100vh;
        max-height: 100vh;
        width: 100vw;
        margin: 0;
        border-radius: 0;
    }
    .doc-search-modal-body {
        max-height: none;
        flex: 1;
    }
}

/* ═══ 4. SCHOLARJMS INTEGRATION BANNER ═══ */
.jms-integration-banner {
    background-color: #eafbee;
    border: 1px solid #bbf7d0;
    padding: 24px 30px; 
    margin-bottom: 32px;
    border-radius: 12px;
}

.jms-integration-badge {
    background-color: #22c55e;
    color: white;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 24px;
    display: inline-block;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.jms-integration-title {
    color: #115e32;
    font-size: 40px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    font-family: var(--font-display);
    letter-spacing: -1px;
    line-height: normal;
}

.jms-integration-subtitle {
    color: #166534;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
    max-width: 100%;
}

/* ═══ 5. PLATFORM COMPARISON TABLE ═══ */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}
.doc-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    text-align: left;
}
.doc-comparison-table th {
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.95rem;
}
.doc-comparison-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 0.95rem;
}
.doc-comparison-table tr:last-child td {
    border-bottom: none;
}
.doc-comparison-table tr:hover td {
    background-color: #fafbfd;
}
.doc-comparison-table td:not(:first-child),
.doc-comparison-table th:not(:first-child) {
    text-align: center;
}
.comp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}
.comp-icon.yes { color: #10b981; }
.comp-icon.no { color: #ef4444; }
.comp-icon.partial { color: #f59e0b; }