/* ═══════════════════════════════════════════════════════════════════════
   cyclonePORT Nexus — Integrated User Guide
   Onboarding Tutorial + Contextual Info Tooltips
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Onboarding Overlay ──────────────────────────────────────────────── */
.guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.guide-overlay.active {
    pointer-events: auto;
}

/* Dark backdrop with spotlight cutout */
.guide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    transition: opacity 0.3s ease;
}

/* SVG-based spotlight mask for smooth cutout */
.guide-backdrop svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Spotlight highlight ring */
.guide-spotlight {
    position: fixed;
    z-index: 10002;
    border-radius: 8px;
    box-shadow: 0 0 0 4px var(--primary-color), 0 0 0 6px rgba(99, 102, 241, 0.3);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Step Card (Popover) ─────────────────────────────────────────────── */
.guide-card {
    position: fixed;
    z-index: 10003;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    overflow: hidden;
}

.guide-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card header with step icon */
.guide-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-alt);
}

.guide-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    background: var(--primary-light);
    color: var(--primary-color);
}

.guide-card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.guide-card-header .guide-step-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card body */
.guide-card-body {
    padding: 16px 20px;
}

.guide-card-body p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.guide-card-body p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.guide-card-body ul {
    margin: 8px 0 0;
    padding-left: 18px;
    list-style: none;
}

.guide-card-body ul li {
    position: relative;
    padding-left: 4px;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.guide-card-body ul li::before {
    content: "•";
    position: absolute;
    left: -14px;
    color: var(--primary-color);
    font-weight: bold;
}

/* Card footer with navigation */
.guide-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 16px;
    gap: 12px;
}

/* Progress dots */
.guide-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-progress-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.guide-progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.guide-progress-dot.completed {
    background: var(--success-color);
}

/* Navigation buttons */
.guide-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.guide-btn-skip {
    background: transparent;
    color: var(--text-secondary);
    padding: 7px 10px;
}

.guide-btn-skip:hover {
    color: var(--text-primary);
    background: var(--bg-surface-alt);
}

.guide-btn-prev {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.guide-btn-prev:hover {
    background: var(--border-color);
}

.guide-btn-next {
    background: var(--primary-color);
    color: #fff;
}

.guide-btn-next:hover {
    filter: brightness(1.1);
}

.guide-btn-finish {
    background: var(--success-color);
    color: #fff;
}

.guide-btn-finish:hover {
    filter: brightness(1.1);
}

/* Arrow/caret pointing from card to target */
.guide-card-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
    z-index: -1;
}

.guide-card-arrow.arrow-top {
    top: -7px;
    left: 32px;
    border-right: none;
    border-bottom: none;
}

.guide-card-arrow.arrow-bottom {
    bottom: -7px;
    left: 32px;
    border-left: none;
    border-top: none;
}

.guide-card-arrow.arrow-left {
    left: -7px;
    top: 24px;
    border-right: none;
    border-top: none;
}

.guide-card-arrow.arrow-right {
    right: -7px;
    top: 24px;
    border-left: none;
    border-bottom: none;
}

/* ─── Welcome / Completion Modal ──────────────────────────────────────── */
.guide-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guide-modal-overlay.visible {
    opacity: 1;
}

.guide-modal {
    width: 440px;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    padding: 32px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.guide-modal-overlay.visible .guide-modal {
    transform: scale(1);
}

.guide-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--primary-light);
    color: var(--primary-color);
}

.guide-modal h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.guide-modal p {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.guide-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-modal-actions .guide-btn {
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
}

.guide-modal-actions .guide-btn-next {
    width: 100%;
}

.guide-modal-actions .guide-btn-skip {
    width: 100%;
}

/* ─── Contextual Info Tooltips (ℹ icons) ──────────────────────────────── */
.guide-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: help;
    vertical-align: middle;
    margin-left: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: relative;
    user-select: none;
    line-height: 1;
}

.guide-info-icon:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Info tooltip popover */
.guide-info-popover {
    position: fixed;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 0;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.guide-info-popover.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.guide-info-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-alt);
    border-radius: 10px 10px 0 0;
}

.guide-info-popover-header h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.guide-info-popover-close {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.guide-info-popover-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.guide-info-popover-body {
    padding: 12px 16px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 280px;
    overflow-y: auto;
}

.guide-info-popover-body p {
    margin: 0 0 8px;
}

.guide-info-popover-body p:last-child {
    margin-bottom: 0;
}

.guide-info-popover-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.guide-info-popover-body .guide-tip {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: var(--warning-light);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.guide-info-popover-body .guide-tip::before {
    content: "Tip";
    flex-shrink: 0;
    font-weight: 700;
    font-size: 11px;
    color: var(--primary-color, #2563eb);
}

.guide-info-popover-body .guide-warning {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: var(--danger-light);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.guide-info-popover-body .guide-warning::before {
    content: "!";
    flex-shrink: 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--danger-color, #dc2626);
}

/* Arrow for popover */
.guide-info-popover-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.guide-info-popover-arrow.arrow-top {
    top: -6px;
    border-right: none;
    border-bottom: none;
}

.guide-info-popover-arrow.arrow-bottom {
    bottom: -6px;
    border-left: none;
    border-top: none;
}

/* ─── Sidebar Guide Button ────────────────────────────────────────────── */
.sidebar-footer-btn.guide-trigger-btn {
    color: var(--primary-color);
}

.sidebar-footer-btn.guide-trigger-btn:hover {
    background: var(--primary-light);
}

/* Pulse animation for first-time indicator */
.guide-trigger-btn .guide-new-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-left: 4px;
    animation: guidePulse 2s ease infinite;
}

@keyframes guidePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ─── Mobile Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .guide-card {
        width: calc(100vw - 24px);
        max-width: 360px;
        left: 50% !important;
        transform: translateX(-50%) translateY(8px);
    }

    .guide-card.visible {
        transform: translateX(-50%) translateY(0);
    }

    .guide-card-arrow {
        display: none;
    }

    .guide-card-footer {
        flex-direction: column;
        gap: 10px;
    }

    .guide-progress {
        order: 2;
    }

    .guide-nav-buttons {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .guide-modal {
        padding: 24px;
    }

    .guide-modal h3 {
        font-size: 18px;
    }

    .guide-info-popover {
        width: calc(100vw - 16px);
        max-width: 320px;
        left: 50% !important;
        transform: translateX(-50%) translateY(4px);
    }

    .guide-info-popover.visible {
        transform: translateX(-50%) translateY(0);
    }

    .guide-info-popover-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .guide-card {
        border-radius: 10px;
    }

    .guide-card-header {
        padding: 12px 16px 10px;
    }

    .guide-card-body {
        padding: 12px 16px;
    }

    .guide-card-footer {
        padding: 10px 16px 14px;
    }

    .guide-btn {
        padding: 8px 12px;
        font-size: 12.5px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   DOCUMENTATION VIEWER & FAQ
   ═══════════════════════════════════════════════════════════════════════ */

/* ——— Page Layout ——————————————————————————————————————————————— */
.guide-doc-page {
    max-width: 1200px;
    margin: 0 auto;
}

.guide-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.guide-doc-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0;
}

.guide-doc-header h2 .nx-icon {
    color: var(--primary-color, #2563eb);
}

.guide-doc-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ——— Search ———————————————————————————————————————————————————— */
.guide-doc-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    min-width: 240px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-doc-search-wrap:focus-within {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.guide-doc-search-wrap .nx-icon {
    color: var(--text-tertiary, #9ca3af);
    flex-shrink: 0;
}

.guide-doc-search {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary, #111827);
    width: 100%;
}

.guide-doc-search::placeholder {
    color: var(--text-tertiary, #9ca3af);
}

.guide-restart-tour-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ——— Tabs ——————————————————————————————————————————————————————— */
.guide-doc-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    margin-bottom: 20px;
}

.guide-doc-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    border-radius: var(--radius-sm, 6px) var(--radius-sm, 6px) 0 0;
}

.guide-doc-tab:hover {
    color: var(--text-primary, #111827);
    background: var(--bg-inset, #f9fafb);
}

.guide-doc-tab.active {
    color: var(--primary-color, #2563eb);
    border-bottom-color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.guide-doc-tab .nx-icon {
    flex-shrink: 0;
}

.guide-doc-tab-content {
    display: none;
}

.guide-doc-tab-content.active {
    display: block;
}

/* ——— Documentation Layout ——————————————————————————————————————— */
.guide-doc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    min-height: 500px;
}

/* ——— Section Nav (Sidebar) ——————————————————————————————————————— */
.guide-doc-sidebar {
    position: sticky;
    top: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 12px;
    border-right: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.guide-doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color, #e5e7eb);
    border-radius: 2px;
}

.guide-doc-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s, color 0.15s;
}

.guide-doc-nav-link:hover {
    background: var(--bg-inset, #f9fafb);
    color: var(--text-primary, #111827);
}

.guide-doc-nav-link.active {
    background: var(--primary-light, #eff6ff);
    color: var(--primary-color, #2563eb);
}

.guide-doc-nav-link .nx-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.guide-doc-nav-sublink {
    display: block;
    padding: 5px 10px 5px 34px;
    font-size: 12.5px;
    color: var(--text-tertiary, #9ca3af);
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s, color 0.15s;
}

.guide-doc-nav-sublink:hover {
    background: var(--bg-inset, #f9fafb);
    color: var(--text-secondary, #6b7280);
}

.guide-doc-nav-sublink.active {
    color: var(--primary-color, #2563eb);
    background: var(--primary-light, #eff6ff);
}

/* ——— Documentation Content ——————————————————————————————————————— */
.guide-doc-main {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding-right: 8px;
}

.guide-doc-main::-webkit-scrollbar {
    width: 4px;
}

.guide-doc-main::-webkit-scrollbar-thumb {
    background: var(--border-color, #e5e7eb);
    border-radius: 2px;
}

.guide-doc-section {
    margin-bottom: 32px;
    scroll-margin-top: 20px;
}

.guide-doc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #2563eb);
}

.guide-doc-section-title .nx-icon {
    color: var(--primary-color, #2563eb);
}

.guide-doc-subsection {
    margin-bottom: 24px;
    scroll-margin-top: 20px;
}

.guide-doc-subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 10px 0;
    padding-left: 12px;
    border-left: 3px solid var(--primary-color, #2563eb);
}

.guide-doc-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary, #374151);
}

.guide-doc-text p {
    margin: 0 0 10px 0;
}

.guide-doc-text ul, .guide-doc-text ol {
    margin: 8px 0 12px 0;
    padding-left: 22px;
}

.guide-doc-text li {
    margin-bottom: 4px;
}

.guide-doc-text strong {
    color: var(--text-primary, #111827);
    font-weight: 600;
}

.guide-doc-text em {
    color: var(--text-tertiary, #6b7280);
}

.guide-doc-text code {
    background: var(--bg-inset, #f3f4f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ——— Search Highlight ——————————————————————————————————————————— */
mark.guide-search-highlight {
    background: #fef08a;
    color: #92400e;
    padding: 1px 2px;
    border-radius: 2px;
}

/* ——— No Results ————————————————————————————————————————————————— */
.guide-doc-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-tertiary, #9ca3af);
}

.guide-doc-no-results .nx-icon {
    opacity: 0.4;
    margin-bottom: 12px;
}

.guide-doc-no-results p {
    font-size: 14px;
    margin: 8px 0 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════════════════════════════════════════ */

.guide-faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.guide-faq-header {
    text-align: center;
    margin-bottom: 28px;
}

.guide-faq-header h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 8px 0;
}

.guide-faq-header h3 .nx-icon {
    color: var(--primary-color, #2563eb);
}

.guide-faq-header p {
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-faq-item {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-faq-item:hover {
    border-color: var(--primary-color, #2563eb);
}

.guide-faq-item.open {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}

.guide-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    cursor: pointer;
    gap: 12px;
    transition: background 0.15s;
}

.guide-faq-question:hover {
    background: var(--bg-inset, #f9fafb);
}

.guide-faq-question span:first-child {
    flex: 1;
}

.guide-faq-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--text-tertiary, #9ca3af);
}

.guide-faq-item.open .guide-faq-chevron {
    transform: rotate(180deg);
    color: var(--primary-color, #2563eb);
}

.guide-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.guide-faq-item.open .guide-faq-answer {
    max-height: 500px;
}

.guide-faq-answer-inner {
    padding: 0 16px 16px 16px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary, #374151);
}

/* ═══════════════════════════════════════════════════════════════════════
   DOCUMENTATION VIEWER — MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .guide-doc-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .guide-doc-header h2 {
        font-size: 18px;
    }

    .guide-doc-header-actions {
        width: 100%;
    }

    .guide-doc-search-wrap {
        min-width: 0;
        flex: 1;
    }

    .guide-doc-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .guide-doc-sidebar {
        position: relative;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
        padding-right: 0;
        padding-bottom: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .guide-doc-nav-sublink {
        padding-left: 10px;
        font-size: 12px;
    }

    .guide-doc-main {
        max-height: none;
        padding-right: 0;
    }

    .guide-doc-section-title {
        font-size: 16px;
    }

    .guide-doc-tabs {
        gap: 0;
    }

    .guide-doc-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    .guide-faq-question {
        padding: 12px 14px;
        font-size: 13px;
    }

    .guide-faq-answer-inner {
        padding: 0 14px 14px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .guide-doc-header h2 {
        font-size: 16px;
    }

    .guide-doc-search-wrap {
        padding: 6px 10px;
    }

    .guide-doc-search {
        font-size: 13px;
    }

    .guide-restart-tour-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .guide-doc-section-title {
        font-size: 15px;
    }

    .guide-doc-subsection-title {
        font-size: 14px;
    }

    .guide-doc-text {
        font-size: 13px;
    }
}

/* ——— Guide nav item icon color in sidebar ———————————————————————— */
#guideNavItem .nav-link .nx-icon {
    color: currentColor;
}

/* ——— Documentation Tables ——————————————————————————————————————— */
.guide-doc-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.guide-doc-text table th,
.guide-doc-text table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    text-align: left;
}

.guide-doc-text table th {
    background: var(--bg-inset, #f9fafb);
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.guide-doc-text table td {
    color: var(--text-secondary, #374151);
}

.guide-doc-text table tr:hover td {
    background: var(--bg-inset, #f9fafb);
}

/* ═══════════════════════════════════════════════════════════════════════
   FIX 1: Hide collapse button on mobile (sidebar already works correctly)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #sidebarToggleBtn {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   FIX 2: Info icon alignment on nav links & badge offset fix
   ═══════════════════════════════════════════════════════════════════════ */

/* Tooltip "i" icon next to nav links (child) and tab buttons (adjacent sibling).
   Tab-button icons are siblings to avoid nesting interactive elements inside
   <button> tags (invalid HTML). Nav-link icons stay inside <a> for layout. */
.nav-link .guide-info-icon,
.tab-button + .guide-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
    position: relative;
    top: 0;
}

/* Prevent the info icon from affecting nav link flex layout */
.nav-link {
    position: relative;
}

/* Collapsed sidebar: hide guide info icons */
.sidebar.collapsed .guide-info-icon {
    display: none;
}

/* Restart Tour badge — position absolute so it doesn't push content */
.guide-trigger-btn {
    position: relative;
}

.guide-trigger-btn .guide-new-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin: 0;
}

/* Collapsed sidebar: keep guide items centered */
.sidebar.collapsed .guide-trigger-btn .guide-new-badge {
    top: 2px;
    right: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FIX 5: Mobile doc viewer — collapsible table of contents
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .guide-doc-sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
        padding-right: 0;
        padding-bottom: 0;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        overflow: hidden;
    }

    /* Collapsed by default on mobile — show only toggle */
    .guide-doc-sidebar.collapsed {
        max-height: 44px;
    }

    .guide-doc-sidebar .guide-doc-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary, #111827);
        cursor: pointer;
        background: var(--bg-inset, #f9fafb);
        border-radius: var(--radius-sm, 6px);
        margin-bottom: 6px;
        user-select: none;
    }

    .guide-doc-sidebar .guide-doc-nav-toggle .toggle-chevron {
        transition: transform 0.25s ease;
    }

    .guide-doc-sidebar.collapsed .guide-doc-nav-toggle .toggle-chevron {
        transform: rotate(-90deg);
    }

    .guide-doc-sidebar.collapsed .guide-doc-nav-link,
    .guide-doc-sidebar.collapsed .guide-doc-nav-sublink {
        display: none;
    }

    /* Compact nav links on mobile */
    .guide-doc-nav-link {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .guide-doc-nav-sublink {
        padding: 4px 10px 4px 28px;
        font-size: 11.5px;
    }
}

/* Desktop: hide the toggle button */
@media (min-width: 769px) {
    .guide-doc-nav-toggle {
        display: none !important;
    }
}
