/* ============================================
   MOBILE NAVIGATION REDESIGN
   ============================================
   
   Complete redesign of mobile navigation:
   - Always-visible bottom navigator with Notes, Create/AI, Graph, Modes
   - Bible navigator on right side
   - Top-left menu button with pull-up overlay
   - MOBILE ONLY - No effect on desktop
*/

/* ============================================
   ENSURE NO DESKTOP EFFECT
   ============================================ */
@media (min-width: 1367px) {
    .mobile-nav-redesign,
    .mobile-nav-redesign *,
    .mobile-menu-sidebar,
    .mobile-menu-sidebar *,
    .mobile-menu-btn,
    .mobile-modes-popup,
    .mobile-modes-popup *,
    .mobile-graph-title,
    .mobile-graph-close-btn,
    .mobile-graph-controls,
    .mobile-graph-legend {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* ============================================
   MOBILE ONLY STYLES (max-width: 1024px)
   ============================================ */
@media (max-width: 1366px) {
    
    /* Hide the old mobile hero navigation header */
    .mobile-hero-navigation,
    #mobileHeroNav {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Hide the old mobile bottom nav */
    .mobile-bottom-nav:not(.mobile-nav-redesign) {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* Hide old mobile Bible navigator (replaced by new compact version) */
    .mobile-bible-navigator:not(.mobile-bible-nav-compact) {
        display: none !important;
    }
    
    /* Hide the old nav-visible based nav */
    .mobile-bottom-nav.nav-visible:not(.mobile-nav-redesign) {
        display: none !important;
        transform: translateY(100%) !important;
    }
    
    /* ============================================
       TOP LEFT MENU BUTTON
       ============================================ */
    
    .mobile-menu-btn {
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1250;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-menu-btn svg {
        width: 18px;
        height: 18px;
        color: #374151;
    }
    
    [data-theme="dark"] .mobile-menu-btn {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
    
    [data-theme="dark"] .mobile-menu-btn svg {
        color: #e5e7eb;
    }
    
    /* Bible reader: subtle sidebar button, more visible on scroll-up */
    .page-about .mobile-menu-btn {
        background: rgba(255, 255, 255, 0.25);
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: none;
        opacity: 0.45;
    }
    
    .page-about .mobile-menu-btn:active {
        opacity: 0.9;
    }
    
    .page-about .mobile-menu-btn svg {
        color: rgba(55, 65, 81, 0.85);
    }
    
    [data-theme="dark"] .page-about .mobile-menu-btn {
        background: rgba(31, 41, 55, 0.25);
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: none;
        opacity: 0.45;
    }
    
    [data-theme="dark"] .page-about .mobile-menu-btn svg {
        color: rgba(229, 231, 235, 0.85);
    }
    
    /* Hide AI toggle button on mobile Bible reader (accessed via bottom nav) */
    .page-about .ai-toggle-btn {
        display: none !important;
    }
    
    /* Hide top-navbar on Bible reader page — replaced by thin scroll header */
    .page-about .top-navbar {
        display: none !important;
    }
    
    /* Remove navbar padding on Bible page since top-navbar is hidden */
    .page-about .main-wrapper {
        padding-top: 0 !important;
    }
    
    /* Hide floating hamburger on Bible page — replaced by header hamburger */
    .page-about .mobile-menu-btn {
        display: none !important;
    }

    /* Safety: ensure thin scroll header NEVER shows on non-Bible pages */
    body:not(.page-about) .mobile-scroll-header {
        display: none !important;
    }

    /* Hide thin scroll header on Shalom welcome screen (no Bible content loaded) */
    .page-about:has(.shalom-welcome) .mobile-scroll-header {
        display: none !important;
    }

    /* Show floating hamburger on Shalom welcome screen even though it's page-about */
    .page-about:has(.shalom-welcome) .mobile-menu-btn {
        display: flex !important;
    }

    /* ============================================
       THIN SCROLL HEADER (Bible Reader Only)
       ============================================
       Starts as a minimal line at top, expands on scroll-up.
    */
    
    .mobile-scroll-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 28px;
        z-index: 1300;
        background: #ffffff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        opacity: 1;
        transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                    padding 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                    border-bottom-color 0.3s ease;
        pointer-events: auto;
        will-change: height;
        overflow: hidden;
    }
    
    .mobile-scroll-header.mobile-header-visible {
        height: 38px;
        opacity: 1;
        padding: 0 14px;
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }
    
    .mobile-scroll-header.mobile-header-hidden {
        height: 0;
        opacity: 0;
        pointer-events: none;
        border-bottom-color: transparent;
    }
    
    .mobile-scroll-header-btn {
        width: 28px;
        height: 28px;
        border: none;
        background: transparent;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 6px;
        color: #4b5563;
        -webkit-tap-highlight-color: transparent;
        opacity: 0.4;
        transition: opacity 0.3s ease, transform 0.3s ease;
        transform: scale(0.75);
    }
    
    .mobile-scroll-header.mobile-header-visible .mobile-scroll-header-btn {
        opacity: 1;
        transform: scale(1);
    }
    
    .mobile-scroll-header-btn:active {
        background: rgba(0, 0, 0, 0.06);
    }
    
    .mobile-scroll-header-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-scroll-header-aa {
        font-size: 15px;
        font-weight: 600;
        letter-spacing: -0.5px;
        line-height: 1;
        color: #4b5563;
    }
    
    /* Dark mode thin header */
    [data-theme="dark"] .mobile-scroll-header {
        background: #121212;
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    
    [data-theme="dark"] .mobile-scroll-header-btn {
        color: #d1d5db;
    }
    
    [data-theme="dark"] .mobile-scroll-header-btn:active {
        background: rgba(255, 255, 255, 0.08);
    }
    
    [data-theme="dark"] .mobile-scroll-header-aa {
        color: #d1d5db;
    }

    /* ============================================
       TEXT SETTINGS SHEET (aA Bottom Sheet)
       ============================================ */
    
    .text-settings-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1400;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        -webkit-tap-highlight-color: transparent;
    }
    
    .text-settings-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .text-settings-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1401;
        background: #ffffff;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        padding: 0 0 env(safe-area-inset-bottom, 16px) 0;
        max-height: 60vh;
        overflow-y: auto;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        will-change: transform;
    }
    
    .text-settings-overlay.active .text-settings-sheet {
        transform: translateY(0);
    }
    
    .text-settings-handle {
        display: flex;
        justify-content: center;
        padding: 10px 0 6px;
    }
    
    .text-settings-handle-bar {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #d1d5db;
    }
    
    .text-settings-content {
        padding: 4px 20px 20px;
    }
    
    .text-settings-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .text-settings-row:last-child {
        border-bottom: none;
    }
    
    .text-settings-label {
        font-size: 14px;
        font-weight: 500;
        color: #374151;
    }
    
    .text-settings-control {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* Font size stepper */
    .text-size-stepper {
        display: flex;
        align-items: center;
        gap: 0;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .text-size-btn {
        width: 36px;
        height: 32px;
        border: none;
        background: #f9fafb;
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }
    
    .text-size-btn:active {
        background: #e5e7eb;
    }
    
    .text-size-value {
        width: 36px;
        text-align: center;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        background: #ffffff;
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
        line-height: 32px;
    }
    
    /* Font family selector — scrollable horizontal list */
    .font-family-options {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
        scrollbar-width: none;
        max-width: 230px;
    }
    
    .font-family-options::-webkit-scrollbar {
        display: none;
    }
    
    .font-family-chip {
        padding: 5px 10px;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        background: #f9fafb;
        font-size: 12px;
        color: #374151;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .font-family-chip.active {
        background: #1f2937;
        color: #ffffff;
        border-color: #1f2937;
    }
    
    .font-family-chip:active {
        transform: scale(0.96);
    }
    
    /* Weight stepper (reuses text-size-stepper pattern) */
    .text-weight-stepper {
        display: flex;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .text-weight-btn {
        width: 32px;
        height: 32px;
        border: none;
        background: #f9fafb;
        cursor: pointer;
        font-size: 16px;
        font-weight: 500;
        color: #6b7280;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }
    
    .text-weight-btn:active {
        background: #e5e7eb;
    }
    
    .text-weight-value {
        min-width: 56px;
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        color: #374151;
        background: #ffffff;
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
        line-height: 32px;
    }
    
    /* Dark mode text settings */
    [data-theme="dark"] .text-settings-sheet {
        background: #1f2937;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    }
    
    [data-theme="dark"] .text-settings-handle-bar {
        background: #4b5563;
    }
    
    [data-theme="dark"] .text-settings-row {
        border-bottom-color: #374151;
    }
    
    [data-theme="dark"] .text-settings-label {
        color: #e5e7eb;
    }
    
    [data-theme="dark"] .text-size-stepper {
        border-color: #4b5563;
    }
    
    [data-theme="dark"] .text-size-btn {
        background: #374151;
        color: #e5e7eb;
    }
    
    [data-theme="dark"] .text-size-btn:active {
        background: #4b5563;
    }
    
    [data-theme="dark"] .text-size-value {
        background: #1f2937;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    [data-theme="dark"] .font-family-chip {
        background: #374151;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    [data-theme="dark"] .font-family-chip.active {
        background: #e5e7eb;
        color: #1f2937;
        border-color: #e5e7eb;
    }
    
    [data-theme="dark"] .text-weight-stepper {
        border-color: #4b5563;
    }
    
    [data-theme="dark"] .text-weight-btn {
        background: #374151;
        color: #e5e7eb;
    }
    
    [data-theme="dark"] .text-weight-btn:active {
        background: #4b5563;
    }
    
    [data-theme="dark"] .text-weight-value {
        background: #1f2937;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    /* ============================================
       SIDEBAR MENU OVERLAY (Slides from Left)
       ============================================ */
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1300;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* When sidebar is open, hide thin scroll header */
    body.sidebar-open .mobile-scroll-header {
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .mobile-menu-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1350;
        background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .mobile-menu-sidebar.active {
        transform: translateX(0);
    }
    
    [data-theme="dark"] .mobile-menu-sidebar {
        background: linear-gradient(180deg, #121212 0%, #1a1a1a 100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }
    
    /* Sidebar Header with Logo */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    [data-theme="dark"] .mobile-menu-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .mobile-menu-logo {
        width: 40px;
        height: 40px;
    }
    
    .mobile-menu-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .mobile-menu-close {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        background: rgba(0, 0, 0, 0.05);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-close:active {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-close svg {
        width: 16px;
        height: 16px;
        color: #374151;
    }
    
    [data-theme="dark"] .mobile-menu-close {
        background: rgba(255, 255, 255, 0.1);
    }
    
    [data-theme="dark"] .mobile-menu-close svg {
        color: #e5e7eb;
    }
    
    .mobile-menu-content {
        padding: 16px 12px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .mobile-menu-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        border-radius: 12px;
        text-decoration: none;
        color: #374151;
        font-size: 15px;
        font-weight: 500;
        transition: all 0.2s ease;
        background: transparent;
        border: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }
    
    .mobile-menu-item:active {
        background: rgba(0, 0, 0, 0.06);
    }
    
    .mobile-menu-item svg {
        width: 20px;
        height: 20px;
        color: #6b7280;
        flex-shrink: 0;
    }
    
    [data-theme="dark"] .mobile-menu-item {
        color: #e5e7eb;
    }
    
    [data-theme="dark"] .mobile-menu-item:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    [data-theme="dark"] .mobile-menu-item svg {
        color: #9ca3af;
    }
    
    .mobile-menu-item.active {
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
    }
    
    .mobile-menu-item.active svg {
        color: #3b82f6;
    }
    
    [data-theme="dark"] .mobile-menu-item.active {
        background: rgba(147, 197, 253, 0.1);
        color: #93c5fd;
    }
    
    [data-theme="dark"] .mobile-menu-item.active svg {
        color: #93c5fd;
    }
    
    /* Sidebar Footer */
    .mobile-menu-footer {
        margin-top: auto;
        padding: 16px 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    [data-theme="dark"] .mobile-menu-footer {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    /* Mobile menu logout button styling */
    .mobile-menu-logout {
        color: #dc2626 !important;
        text-decoration: none;
    }
    
    .mobile-menu-logout:hover,
    .mobile-menu-logout:active {
        background: rgba(239, 68, 68, 0.1) !important;
        color: #dc2626 !important;
    }
    
    [data-theme="dark"] .mobile-menu-logout {
        color: #f87171 !important;
    }
    
    [data-theme="dark"] .mobile-menu-logout:hover,
    [data-theme="dark"] .mobile-menu-logout:active {
        background: rgba(239, 68, 68, 0.15) !important;
    }
    
    /* Mobile menu theme toggle styling */
    .mobile-menu-theme-toggle .theme-icon-dark {
        display: none;
    }
    
    .mobile-menu-theme-toggle .theme-icon-light {
        display: block;
    }
    
    [data-theme="dark"] .mobile-menu-theme-toggle .theme-icon-dark {
        display: block;
    }
    
    [data-theme="dark"] .mobile-menu-theme-toggle .theme-icon-light {
        display: none;
    }
    
    /* ============================================
       BOTTOM NAVIGATOR - FLOATING PILL DESIGN
       ============================================ */
    
    .mobile-nav-redesign {
        position: fixed !important;
        bottom: 16px !important;
        left: 8px !important;
        right: 8px !important;
        height: auto !important;
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 18px !important;
        z-index: 1200 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 10px !important;
        margin-bottom: env(safe-area-inset-bottom, 0) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease !important;
        will-change: transform, opacity;
    }
    
    /* Scroll-based hide: slide down + fade */
    .mobile-nav-redesign.mobile-nav-scroll-hidden {
        transform: translateY(calc(100% + 30px)) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Also hide the hamburger menu button on scroll */
    .mobile-menu-btn {
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    }
    
    .mobile-menu-btn.mobile-btn-scroll-hidden {
        transform: translateY(-70px);
        opacity: 0;
        pointer-events: none;
    }
    
    /* Hide bottom nav on non-Bible pages */
    body.hide-mobile-nav .mobile-nav-redesign,
    body.page-home .mobile-nav-redesign,
    body.page-landing .mobile-nav-redesign,
    body.page-theologians .mobile-nav-redesign,
    body.page-bible-studies .mobile-nav-redesign,
    body.page-church-fathers .mobile-nav-redesign {
        display: none !important;
    }
    
    [data-theme="dark"] .mobile-nav-redesign {
        background: #1f2937 !important;
        border-color: #374151 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    }
    
    /* ============================================
       EXPAND/COLLAPSE TOGGLE BUTTON
       ============================================ */
    
    .mobile-nav-expand-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 42px;
        padding: 0;
        margin-right: 4px;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        flex-shrink: 0;
    }
    
    .mobile-nav-expand-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    .mobile-nav-expand-toggle:active {
        background: rgba(0, 0, 0, 0.08);
        transform: scale(0.9);
    }
    
    [data-theme="dark"] .mobile-nav-expand-toggle {
        color: #9ca3af;
    }
    
    [data-theme="dark"] .mobile-nav-expand-toggle:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Arrow rotates when expanded (points right to indicate collapse) */
    .mobile-nav-redesign:not(.mobile-nav-collapsed) .mobile-nav-expand-toggle svg {
        transform: rotate(180deg);
    }
    
    /* ============================================
       COLLAPSED STATE - Minimal floating pill
       ============================================ */
    
    .mobile-nav-redesign.mobile-nav-collapsed {
        left: auto !important;
        right: 10px !important;
        bottom: 12px !important;
        width: auto !important;
        justify-content: flex-end !important;
        padding: 4px 6px !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.35) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    [data-theme="dark"] .mobile-nav-redesign.mobile-nav-collapsed {
        background: rgba(0, 0, 0, 0.25) !important;
        border-color: rgba(255, 255, 255, 0.06) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-nav-left {
        display: none !important;
        width: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-nav-expand-toggle {
        margin-right: 4px;
        width: 22px;
        height: 24px;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-nav-expand-toggle svg {
        width: 14px;
        height: 14px;
    }
    
    /* Much smaller pills when collapsed */
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-pill {
        padding: 3px 6px;
        border-radius: 6px;
        background: transparent;
        border: none;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-pill:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-book,
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-chapter {
        font-size: 10px;
        font-weight: 600;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-pill.translation-pill {
        padding: 3px 5px;
        background: transparent;
        border: none;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-pill.translation-pill span {
        font-size: 9px;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-bible-nav-compact {
        gap: 2px;
    }
    
    .mobile-nav-redesign.mobile-nav-collapsed .mobile-nav-right {
        gap: 2px;
    }
    
    /* Smooth expand animation */
    .mobile-nav-redesign {
        transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }
    
    .mobile-nav-left {
        transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden;
    }
    
    .mobile-nav-redesign:not(.mobile-nav-collapsed) .mobile-nav-left {
        opacity: 1;
    }
    
    /* Left side: Mode buttons */
    .mobile-nav-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    /* Right side: Bible navigator */
    .mobile-nav-right {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    /* Nav button base style - Minimalistic rounded rectangle */
    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        height: 42px;
        padding: 4px 5px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #f9fafb;
        color: #6b7280;
        font-size: 8px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        box-shadow: none;
        flex-shrink: 0;
    }
    
    .mobile-nav-btn svg {
        width: 16px;
        height: 16px;
        margin-bottom: 1px;
    }
    
    .mobile-nav-btn:active {
        transform: scale(0.96);
        background: #e5e7eb;
    }
    
    [data-theme="dark"] .mobile-nav-btn {
        background: #374151;
        border-color: #4b5563;
        color: #9ca3af;
    }
    
    [data-theme="dark"] .mobile-nav-btn:active {
        background: #4b5563;
    }
    
    /* All buttons use same neutral style - active state is highlighted */
    .mobile-nav-btn.notes-btn,
    .mobile-nav-btn.create-btn,
    .mobile-nav-btn.graph-btn,
    .mobile-nav-btn.modes-btn,
    .mobile-nav-btn.ai-btn {
        border-color: #e5e7eb;
        color: #6b7280;
        background: #f9fafb;
    }
    
    /* Active button gets subtle highlight */
    .mobile-nav-btn.active {
        background: #374151;
        border-color: #374151;
        color: white;
    }
    
    [data-theme="dark"] .mobile-nav-btn.notes-btn,
    [data-theme="dark"] .mobile-nav-btn.create-btn,
    [data-theme="dark"] .mobile-nav-btn.graph-btn,
    [data-theme="dark"] .mobile-nav-btn.modes-btn,
    [data-theme="dark"] .mobile-nav-btn.ai-btn {
        border-color: #4b5563;
        color: #9ca3af;
        background: #374151;
    }
    
    [data-theme="dark"] .mobile-nav-btn.active {
        background: #e5e7eb;
        border-color: #e5e7eb;
        color: #1f2937;
    }
    
    /* ============================================
       BIBLE NAVIGATOR (Right Side) - Two Pills Design
       ============================================ */
    
    .mobile-bible-nav-compact {
        display: flex;
        align-items: center;
        gap: 4px;
        background: transparent;
        padding: 0;
        border-radius: 0;
        border: none;
        height: auto;
    }
    
    /* Pill button base */
    .mobile-bible-pill {
        display: flex;
        align-items: center;
        gap: 3px;
        padding: 8px 10px;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-family: inherit;
    }
    
    .mobile-bible-pill:active {
        background: #e5e7eb;
        transform: scale(0.97);
    }
    
    [data-theme="dark"] .mobile-bible-pill {
        background: #374151;
        border-color: #4b5563;
    }
    
    [data-theme="dark"] .mobile-bible-pill:active {
        background: #4b5563;
    }
    
    /* Book name in pill */
    .mobile-bible-book {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        white-space: nowrap;
    }
    
    /* Chapter number in pill */
    .mobile-bible-chapter {
        font-size: 13px;
        font-weight: 600;
        color: #6b7280;
    }
    
    [data-theme="dark"] .mobile-bible-book {
        color: #f3f4f6;
    }
    
    [data-theme="dark"] .mobile-bible-chapter {
        color: #9ca3af;
    }
    
    /* Translation pill - slightly smaller */
    .mobile-bible-pill.translation-pill {
        padding: 8px 10px;
        background: #f9fafb;
    }
    
    .mobile-bible-pill.translation-pill span {
        font-size: 11px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    [data-theme="dark"] .mobile-bible-pill.translation-pill {
        background: #1f2937;
    }
    
    [data-theme="dark"] .mobile-bible-pill.translation-pill span {
        color: #9ca3af;
    }
    
    /* ============================================
       MODES POPUP (Vertical circles)
       ============================================ */
    
    .mobile-modes-popup {
        position: fixed;
        bottom: 82px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1250;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 20px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(20px);
        transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    
    .mobile-modes-popup.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    [data-theme="dark"] .mobile-modes-popup {
        background: rgba(31, 41, 55, 0.98);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }
    
    .mobile-mode-option {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 2px solid;
        background: white;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-mode-option svg {
        width: 20px;
        height: 20px;
    }
    
    /* Notes mode option */
    .mobile-mode-option[data-mode="notes"] {
        border-color: #10b981;
        color: #10b981;
    }
    
    .mobile-mode-option[data-mode="notes"]:active,
    .mobile-mode-option[data-mode="notes"].active {
        background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
        color: white;
    }
    
    /* Reader mode option */
    .mobile-mode-option[data-mode="reader"] {
        border-color: #64748b;
        color: #64748b;
    }
    
    .mobile-mode-option[data-mode="reader"]:active,
    .mobile-mode-option[data-mode="reader"].active {
        background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
        color: white;
    }
    
    /* AI mode option */
    .mobile-mode-option[data-mode="ai"] {
        border-color: #3b82f6;
        color: #3b82f6;
    }
    
    .mobile-mode-option[data-mode="ai"]:active,
    .mobile-mode-option[data-mode="ai"].active {
        background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
        color: white;
    }
    
    [data-theme="dark"] .mobile-mode-option {
        background: #374151;
    }
    
    /* ============================================
       VERY SMALL SCREENS (under 360px)
       ============================================ */
}

@media (max-width: 360px) {
    .mobile-nav-redesign {
        left: 4px !important;
        right: 4px !important;
        padding: 6px 8px !important;
    }
    
    .mobile-nav-btn {
        min-width: 36px;
        height: 38px;
        padding: 3px 4px;
        font-size: 7px;
    }
    
    .mobile-nav-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .mobile-nav-left {
        gap: 3px;
    }
    
    .mobile-nav-expand-toggle {
        width: 24px;
        margin-right: 2px;
    }
    
    .mobile-bible-pill {
        padding: 6px 8px;
    }
    
    .mobile-bible-book,
    .mobile-bible-chapter {
        font-size: 11px;
    }
    
    .mobile-bible-pill.translation-pill span {
        font-size: 9px;
    }
}

@media (max-width: 1366px) {
    /* ============================================
       PAGE ADJUSTMENTS FOR BOTTOM NAV
       ============================================ */
    
    /* Add padding to main content for bottom nav */
    .main-wrapper {
        padding-bottom: 82px !important;
    }
    
    /* Adjust Bible content wrapper */
    .bible-content-wrapper,
    .bible-book-content {
        padding-bottom: 90px !important;
    }
    
    /* Ensure chapter content has room for nav */
    .chapter-content {
        padding-bottom: 100px !important;
    }
    
    /* ============================================
       ANIMATIONS
       ============================================ */
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeOutDown {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(10px);
        }
    }
    
    /* ============================================
       ENSURE PROPER Z-INDEX LAYERING
       ============================================ */
    
    /* Books panel and its close button should be above bottom nav */
    #books-panel-slide,
    .books-panel-slide,
    .books-panel {
        z-index: 1400 !important;
    }
    
    #books-panel-overlay,
    .books-panel-overlay {
        z-index: 1390 !important;
    }
    
    .books-panel-close,
    #books-panel-close {
        z-index: 10 !important;
        position: relative !important;
        pointer-events: auto !important;
    }
    
    /* Translation panel should also be above bottom nav */
    #translation-panel-slide,
    .translation-panel-slide,
    .translation-panel {
        z-index: 1400 !important;
    }
    
    .translation-panel-overlay {
        z-index: 1390 !important;
    }
    
    /* ============================================
       MOBILE BOOKS PANEL - Slide OVER screen from Left
       ============================================ */
    
    /* Prevent content from shifting on mobile */
    body.books-panel-active .main-wrapper,
    body.books-panel-active #main-wrapper,
    body.books-panel-active.notes-mode-active .main-wrapper,
    body.books-panel-active.notes-mode-active #main-wrapper {
        margin-left: 0 !important;
        transform: none !important;
    }
    
    .books-panel,
    #books-panel-slide,
    .books-panel-slide {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 80vw !important;
        max-width: 320px !important;
        height: 100vh !important;
        border-radius: 0 16px 16px 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }
    
    .books-panel.active,
    #books-panel-slide.active,
    .books-panel-slide.active {
        transform: translateX(0) !important;
    }
    
    /* Books panel overlay with blur - MUST be visible */
    .books-panel-overlay,
    #books-panel-overlay {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.4) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        backdrop-filter: blur(4px) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1390 !important;
    }
    
    .books-panel-overlay.active,
    #books-panel-overlay.active,
    body.books-panel-active .books-panel-overlay,
    body.books-panel-active #books-panel-overlay {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    /* ============================================
       MOBILE TRANSLATION PANEL - Slide OVER screen from Left
       ============================================ */
    
    .translation-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 80vw !important;
        max-width: 320px !important;
        height: 100vh !important;
        border-radius: 0 16px 16px 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }
    
    .translation-panel.active {
        transform: translateX(0) !important;
    }
    
    /* Translation panel overlay with blur */
    .translation-panel-overlay {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.4) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 1390 !important;
    }
    
    .mobile-menu-overlay {
        z-index: 1300;
    }
    
    .mobile-menu-sidebar {
        z-index: 1350;
    }
    
    .mobile-modes-popup {
        z-index: 1250;
    }
    
    .mobile-nav-redesign {
        z-index: 1200 !important;
    }
    
    .mobile-menu-btn {
        z-index: 1250;
    }
}

/* ============================================
   ADDITIONAL DESKTOP PROTECTION
   ============================================ */
@media (min-width: 1367px) {
    /* Ensure absolutely nothing from mobile nav shows on desktop */
    .mobile-menu-btn,
    .mobile-menu-overlay,
    .mobile-menu-sidebar,
    .mobile-nav-redesign,
    .mobile-modes-popup,
    .mobile-bible-nav-compact,
    #mobileMenuBtn,
    #mobileMenuOverlay,
    #mobileMenuSidebar,
    #mobileNavRedesign,
    #mobileModesPopup,
    #mobileBibleNavCompact {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
    }
    
    /* Ensure desktop sidebar and navigation remain unaffected - no changes needed */
}

/* ============================================
   MOBILE-ONLY: SMALLER BIBLE STUDY CARDS
   ============================================ */
@media (max-width: 1366px) {
    /* Bible Studies Page - Compact Cards (manage-bibles-card) */
    .manage-bibles-card {
        margin-bottom: 12px !important;
    }
    
    .manage-bibles-card .card-graph-preview {
        height: 100px !important;
        min-height: 100px !important;
        max-height: 100px !important;
        border-radius: 10px !important;
    }
    
    .manage-bibles-card .card-info {
        padding: 8px 10px !important;
    }
    
    .manage-bibles-card .card-title {
        font-size: 14px !important;
        margin-bottom: 2px !important;
    }
    
    .manage-bibles-card .card-translation-badge,
    .manage-bibles-card .study-card-notes-count {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    
    /* Bible Studies Grid */
    .manage-bibles-grid {
        gap: 10px !important;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }
    
    /* Bible Studies Page Header */
    .manage-bibles-header h1 {
        font-size: 22px !important;
    }
    
    .manage-bibles-header p,
    .manage-bibles-header .subtitle {
        font-size: 13px !important;
    }
}

/* ============================================
   MOBILE-ONLY: SMALLER CHURCH FATHER/THEOLOGIAN CARDS
   2-COLUMN GRID LAYOUT
   ============================================ */
@media (max-width: 1366px) {
    /* Church Fathers Grid - 2 columns on mobile */
    .cf-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 8px !important;
    }
    
    /* Church Fathers List - Compact Cards (cf-card) - smaller for 2-per-row */
    .cf-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 12px 8px !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
        gap: 8px !important;
    }
    
    .cf-card .cf-avatar,
    .cf-avatar {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        font-size: 18px !important;
    }
    
    .cf-card .cf-avatar img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .cf-card .cf-info {
        padding-left: 0 !important;
        text-align: center !important;
    }
    
    .cf-card .cf-name,
    .cf-name {
        font-size: 12px !important;
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
    }
    
    .cf-card .cf-meta,
    .cf-meta {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
    
    .cf-card .cf-role,
    .cf-role {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
    
    /* Hide the arrow on mobile since cards are now vertical */
    .cf-card .cf-arrow {
        display: none !important;
    }
    
    /* Church Fathers Page Header */
    .cf-title {
        font-size: 20px !important;
        text-align: center !important;
    }
    
    .cf-subtitle {
        font-size: 12px !important;
        text-align: center !important;
    }
    
    /* Add bottom padding */
    .cf-container,
    .manage-bibles-container {
        padding-bottom: 20px !important;
    }
    
    /* ============================================
       CHURCH FATHER PROFILE SLIDE PANEL - MOBILE
       ULTRA COMPACT - Everything much smaller
       ============================================ */
    .cf-profile-panel {
        max-width: 100% !important;
        width: 100% !important;
        right: -100% !important;
    }
    
    .cf-profile-panel.open {
        right: 0 !important;
    }
    
    .cf-profile-content {
        padding: 8px 10px !important;
    }
    
    .cf-profile-close {
        top: 10px !important;
        left: 10px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 1.1rem !important;
        padding: 0 !important;
        z-index: 20 !important;
    }
    
    /* ============================================
       PP-* CLASSES (Profile Panel inline styles)
       These are the actual classes used in the panel
       ============================================ */
    
    /* Profile Header - Ultra compact horizontal layout */
    .cf-profile-content .pp-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 4px 0 8px 0 !important;
        margin-bottom: 8px !important;
        padding-top: 50px !important; /* Increased to avoid back button overlap */
        border-bottom-width: 1px !important;
        padding-bottom: 10px !important;
    }
    
    /* Avatar - TINY */
    .cf-profile-content .pp-avatar {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        flex-shrink: 0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    }
    
    .cf-profile-content .pp-avatar img {
        width: 45px !important;
        height: 45px !important;
    }
    
    /* Mini graph - Show in top right, small size */
    .cf-profile-content .pp-mini-graph {
        display: flex !important;
        position: absolute !important;
        top: 24px !important;
        right: 0 !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 8px !important;
        max-width: none !important;
    }
    
    .cf-profile-content .pp-mini-graph svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Profile Info */
    .cf-profile-content .pp-info {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0 !important;
        padding-right: 55px !important; /* Space for mini graph */
    }
    
    .cf-profile-content .pp-name {
        font-size: 1.1rem !important;
        margin-bottom: 1px !important;
        line-height: 1.15 !important;
    }
    
    .cf-profile-content .pp-era {
        font-size: 0.7rem !important;
        margin-bottom: 1px !important;
    }
    
    .cf-profile-content .pp-title {
        font-size: 0.65rem !important;
        margin-bottom: 6px !important;
    }
    
    /* Badge and Follow button - tiny */
    .cf-profile-content .pp-badge {
        font-size: 0.6rem !important;
        padding: 2px 8px !important;
        margin-right: 4px !important;
    }
    
    .cf-profile-content .pp-follow {
        padding: 4px 10px !important;
        font-size: 0.65rem !important;
        border-radius: 12px !important;
    }
    
    /* Sections - VERY compact */
    .cf-profile-content .pp-section {
        margin-bottom: 10px !important;
    }
    
    .cf-profile-content .pp-section-title {
        font-size: 0.85rem !important;
        margin: 0 0 6px 0 !important;
        padding-bottom: 4px !important;
        border-bottom-width: 1px !important;
    }
    
    /* Bio text - Small */
    .cf-profile-content .pp-bio {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }
    
    /* Works list - Ultra compact */
    .cf-profile-content .pp-work {
        padding: 6px 8px !important;
        margin-bottom: 4px !important;
        border-radius: 6px !important;
    }
    
    .cf-profile-content .pp-work-name {
        font-size: 0.75rem !important;
        margin-bottom: 1px !important;
    }
    
    .cf-profile-content .pp-work-meta {
        font-size: 0.6rem !important;
    }
    
    /* Commentaries - Compact */
    .cf-profile-content .pp-comm {
        padding: 6px 8px !important;
        margin-bottom: 4px !important;
        border-radius: 4px !important;
        border-left-width: 2px !important;
    }
    
    .cf-profile-content .pp-comm-ref {
        font-size: 0.7rem !important;
        margin-bottom: 3px !important;
    }
    
    .cf-profile-content .pp-comm-text {
        font-size: 0.65rem !important;
        line-height: 1.35 !important;
    }
    
    .cf-profile-content .pp-comm-cite {
        font-size: 0.55rem !important;
        margin-top: 3px !important;
    }
    
    /* View full profile link */
    .cf-profile-content .pp-view-full {
        font-size: 0.7rem !important;
        margin-top: 8px !important;
    }
    
    /* ============================================
       TP-* CLASSES (Theologian Profile - fallback)
       ============================================ */
    .cf-profile-content .tp-header,
    .cf-profile-panel .tp-header {
        flex-direction: row !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 10px !important;
        padding: 4px 0 8px 0 !important;
        margin-bottom: 8px !important;
        padding-top: 50px !important; /* Increased to avoid back button overlap */
    }
    
    .cf-profile-content .tp-avatar,
    .cf-profile-panel .tp-avatar {
        width: 45px !important;
        height: 45px !important;
        flex-shrink: 0 !important;
    }
    
    .cf-profile-content .tp-avatar-init,
    .cf-profile-panel .tp-avatar-init {
        font-size: 1rem !important;
    }
    
    .cf-profile-content .tp-verified,
    .cf-profile-panel .tp-verified {
        width: 14px !important;
        height: 14px !important;
        font-size: 8px !important;
        bottom: 0 !important;
        right: 0 !important;
        border-width: 2px !important;
    }
    
    .cf-profile-content .tp-info,
    .cf-profile-panel .tp-info {
        padding-top: 0 !important;
        padding-right: 55px !important; /* Space for mini graph */
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .cf-profile-content .tp-name,
    .cf-profile-panel .tp-name {
        font-size: 1.1rem !important;
        margin-bottom: 1px !important;
        line-height: 1.15 !important;
    }
    
    .cf-profile-content .tp-era,
    .cf-profile-panel .tp-era {
        font-size: 0.7rem !important;
        margin-bottom: 1px !important;
    }
    
    .cf-profile-content .tp-title,
    .cf-profile-panel .tp-title {
        font-size: 0.65rem !important;
        margin-bottom: 6px !important;
    }
    
    .cf-profile-content .tp-actions,
    .cf-profile-panel .tp-actions {
        justify-content: flex-start !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }
    
    .cf-profile-content .tp-badge,
    .cf-profile-panel .tp-badge {
        font-size: 0.6rem !important;
        padding: 2px 8px !important;
    }
    
    .cf-profile-content .tp-follow-btn,
    .cf-profile-panel .tp-follow-btn {
        padding: 4px 10px !important;
        font-size: 0.65rem !important;
    }
    
    /* TP mini graph - Show in top right, larger size for better visibility */
    .cf-profile-content .tp-mini-graph,
    .cf-profile-panel .tp-mini-graph {
        display: flex !important;
        position: absolute !important;
        top: 50px !important; /* Moved down to avoid back button */
        right: 10px !important;
        width: 70px !important;
        height: 70px !important;
        border-radius: 10px !important;
        max-width: none !important;
    }
    
    .cf-profile-content .tp-mini-graph svg,
    .cf-profile-panel .tp-mini-graph svg {
        width: 35px !important;
        height: 35px !important;
    }
    
    .cf-profile-content .tp-section-title,
    .cf-profile-panel .tp-section-title,
    .cf-profile-content h2,
    .cf-profile-panel h2 {
        font-size: 0.85rem !important;
        margin: 8px 0 6px 0 !important;
        padding-bottom: 4px !important;
    }
    
    .cf-profile-content .tp-bio,
    .cf-profile-panel .tp-bio,
    .cf-profile-content p,
    .cf-profile-panel p:not(.mobile-notes-empty p) {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
    }
    
    .cf-profile-content .tp-works-list,
    .cf-profile-panel .tp-works-list {
        gap: 4px !important;
    }
    
    .cf-profile-content .tp-work-item,
    .cf-profile-panel .tp-work-item,
    .cf-profile-content .work-card,
    .cf-profile-panel .work-card {
        padding: 6px 8px !important;
        border-radius: 6px !important;
    }
    
    .cf-profile-content .tp-work-title,
    .cf-profile-panel .tp-work-title,
    .cf-profile-content .work-title,
    .cf-profile-panel .work-title {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        margin-bottom: 1px !important;
    }
    
    .cf-profile-content .tp-work-year,
    .cf-profile-panel .tp-work-year,
    .cf-profile-content .work-meta,
    .cf-profile-panel .work-meta {
        font-size: 0.6rem !important;
    }
    
    /* View full profile link */
    .cf-profile-content .view-full-profile,
    .cf-profile-panel .view-full-profile {
        font-size: 0.85rem !important;
        margin-top: 12px !important;
    }
    
    /* ============================================
       THEOLOGIAN PROFILE PAGE - MOBILE STYLES
       ============================================ */
    /* Profile Header - Stack vertically on mobile */
    .tp-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
        padding-bottom: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Profile Avatar - Smaller on mobile */
    .tp-avatar {
        width: 80px !important;
        height: 80px !important;
    }
    
    .tp-avatar-init {
        font-size: 2rem !important;
    }
    
    .tp-verified {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
        bottom: 4px !important;
        right: 4px !important;
        border-width: 3px !important;
    }
    
    /* Profile Info - Center and reduce padding */
    .tp-info {
        padding-top: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }
    
    .tp-name {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }
    
    .tp-era {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
    }
    
    .tp-title {
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }
    
    /* Actions - Smaller buttons */
    .tp-actions {
        justify-content: center !important;
        gap: 10px !important;
    }
    
    .tp-badge {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }
    
    .tp-follow-btn {
        padding: 8px 20px !important;
        font-size: 0.95rem !important;
    }
    
    /* Stats section - Compact on mobile */
    .tp-stats {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px !important;
    }
    
    .tp-stat {
        flex: 1 1 45% !important;
        padding: 10px !important;
    }
    
    .tp-stat-value {
        font-size: 1.2rem !important;
    }
    
    .tp-stat-label {
        font-size: 0.75rem !important;
    }
    
    /* Section titles - Smaller */
    .tp-section-title {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    /* Bio text - Smaller */
    .tp-bio {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Works list - Compact */
    .tp-works-list {
        gap: 8px !important;
    }
    
    .tp-work-item {
        padding: 12px !important;
    }
    
    .tp-work-title {
        font-size: 0.95rem !important;
    }
    
    .tp-work-year {
        font-size: 0.8rem !important;
    }
    
    /* Connections/followers - Smaller */
    .tp-connection-item {
        padding: 10px !important;
    }
    
    .tp-connection-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    
    .tp-connection-name {
        font-size: 0.9rem !important;
    }
    
    /* Graph modal - Full screen on mobile */
    .theologian-graph-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
    
    .theologian-graph-header {
        padding: 12px 16px !important;
    }
    
    .theologian-graph-title {
        font-size: 1.1rem !important;
    }
    
    /* ============================================
       STANDALONE THEOLOGIAN PROFILE PAGE - MOBILE
       Mini graph and back button fixes
       ============================================ */
    /* Mini graph on standalone profile page - larger for mobile */
    .tp-page .tp-mini-graph {
        width: 80px !important;
        height: 80px !important;
        top: 0 !important;
        right: 0 !important;
    }
    
    .tp-page .tp-mini-graph svg {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Ensure tp-info doesn't overlap with mini graph */
    .tp-page .tp-info {
        padding-right: 90px !important;
    }
    
    /* Back button on standalone profile page - ensure no overlap */
    .tp-page .tp-back {
        display: block !important;
        margin-bottom: 1rem !important;
        position: relative !important;
        z-index: 5 !important;
    }
}

/* ============================================
   MOBILE NOTES PANEL (Slide up from bottom)
   ============================================ */
@media (max-width: 1366px) {
    .mobile-notes-panel-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
    
    .mobile-notes-panel-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-notes-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60vh;
        background: #ffffff;
        border-radius: 16px 16px 0 0;
        z-index: 1550;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        display: flex;
        flex-direction: column;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
    }
    
    .mobile-notes-panel.active {
        transform: translateY(0);
    }
    
    [data-theme="dark"] .mobile-notes-panel {
        background: #1f2937;
    }
    
    .mobile-notes-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px 8px;
        border-bottom: none;
    }
    
    [data-theme="dark"] .mobile-notes-panel-header {
        border-bottom-color: transparent;
    }
    
    .mobile-notes-panel-handle {
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        background: #d1d5db;
        border-radius: 2px;
    }
    
    [data-theme="dark"] .mobile-notes-panel-handle {
        background: #4b5563;
    }
    
    .mobile-notes-panel-title {
        font-size: 15px;
        font-weight: 600;
        color: #374151;
        margin: 0;
    }
    
    [data-theme="dark"] .mobile-notes-panel-title {
        color: #f3f4f6;
    }
    
    .mobile-notes-panel-close {
        background: transparent;
        border: none;
        padding: 4px;
        cursor: pointer;
        color: #9ca3af;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .mobile-notes-panel-close:active {
        background: #f3f4f6;
    }
    
    [data-theme="dark"] .mobile-notes-panel-close {
        color: #6b7280;
    }
    
    [data-theme="dark"] .mobile-notes-panel-close:active {
        background: #374151;
    }
    
    .mobile-notes-panel-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 14px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
        max-height: calc(60vh - 44px);
    }
    
    .mobile-notes-list {
        display: flex;
        flex-direction: column;
        gap: 1px;
        padding-bottom: 12px;
    }
    
    .mobile-note-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 8px;
        background: transparent;
        border-radius: 10px;
        border: none;
        cursor: pointer;
        transition: all 0.15s ease;
        position: relative;
    }
    
    .mobile-note-item:active {
        background: #f3f4f6;
        transform: scale(0.99);
    }
    
    [data-theme="dark"] .mobile-note-item {
        background: transparent;
        border-color: transparent;
    }
    
    [data-theme="dark"] .mobile-note-item:active {
        background: #2d2d2d;
    }
    
    /* Left section: color dot + theme label (inline) */
    .mobile-note-left {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        flex-shrink: 0;
        min-width: 36px;
    }
    
    .mobile-note-theme-label {
        font-size: 8px;
        font-weight: 500;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        text-align: center;
        max-width: 42px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    [data-theme="dark"] .mobile-note-theme-label {
        color: #9ca3af;
    }
    
    .mobile-note-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(124, 58, 237, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: #7c3aed;
    }
    
    .mobile-note-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-note-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    /* Note title (content preview) - main title of the note */
    .mobile-note-title {
        font-size: 13px;
        font-weight: 500;
        color: #1f2937;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    [data-theme="dark"] .mobile-note-title {
        color: #f9fafb;
    }
    
    /* Bible reference at bottom right */
    .mobile-note-ref-bottom {
        font-size: 10px;
        font-weight: 400;
        color: #9ca3af;
        text-align: right;
        margin-top: 0;
    }
    
    [data-theme="dark"] .mobile-note-ref-bottom {
        color: #9ca3af;
    }
    
    /* Old reference style - keep for backwards compatibility but hide */
    .mobile-note-reference {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 2px;
        display: none;
    }
    
    [data-theme="dark"] .mobile-note-reference {
        color: #f3f4f6;
    }
    
    .mobile-note-preview {
        font-size: 12px;
        color: #6b7280;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    [data-theme="dark"] .mobile-note-preview {
        color: #9ca3af;
    }
    
    .mobile-note-arrow {
        color: #d1d5db;
        flex-shrink: 0;
        align-self: center;
    }
    
    .mobile-notes-empty {
        text-align: center;
        padding: 30px 20px;
        color: #9ca3af;
    }
    
    .mobile-notes-empty svg {
        width: 36px;
        height: 36px;
        margin-bottom: 10px;
        opacity: 0.4;
    }
    
    .mobile-notes-empty p {
        font-size: 13px;
        margin: 0;
    }
    
    /* ============================================
       VERSE HIGHLIGHT (when navigating from notes)
       ============================================ */
    .verse-highlight,
    [data-verse].verse-highlight,
    .verse.highlighted {
        background: rgba(124, 58, 237, 0.2) !important;
        border-radius: 4px !important;
        animation: verseHighlightPulse 2.5s ease-out forwards !important;
    }
    
    @keyframes verseHighlightPulse {
        0% {
            background: rgba(124, 58, 237, 0.35);
        }
        50% {
            background: rgba(124, 58, 237, 0.2);
        }
        100% {
            background: transparent;
        }
    }
    
    [data-theme="dark"] .verse-highlight,
    [data-theme="dark"] [data-verse].verse-highlight,
    [data-theme="dark"] .verse.highlighted {
        background: rgba(167, 139, 250, 0.25) !important;
    }
    
    /* ============================================
       MOBILE NOTE COLOR CIRCLE (replaces page icon)
       ============================================ */
    .mobile-note-color-circle {
        width: 20px;
        height: 20px;
        min-width: 20px;
        border-radius: 50%;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Hide the old icon when color circle is present */
    .mobile-note-item .mobile-note-icon {
        display: none;
    }
    
    /* ============================================
       MOBILE NOTE NAVIGATION POPUP 
       (shown after clicking note and navigating)
       ============================================ */
    .mobile-note-nav-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 9600;
        padding: 8px 16px 20px;
        max-height: 50vh;
    }
    
    .mobile-note-nav-popup.visible {
        transform: translateY(0);
    }
    
    [data-theme="dark"] .mobile-note-nav-popup {
        background: #1f2937;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }
    
    .mobile-note-nav-handle {
        display: flex;
        justify-content: center;
        padding: 8px 0;
    }
    
    .mobile-note-nav-handle .handle-bar {
        width: 40px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
    }
    
    [data-theme="dark"] .mobile-note-nav-handle .handle-bar {
        background: #4b5563;
    }
    
    .mobile-note-nav-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    [data-theme="dark"] .mobile-note-nav-header {
        border-bottom-color: #374151;
    }
    
    .mobile-note-nav-badge {
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        color: white;
        text-transform: capitalize;
    }
    
    .mobile-note-nav-ref {
        flex: 1;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        font-style: italic;
    }
    
    [data-theme="dark"] .mobile-note-nav-ref {
        color: #e5e7eb;
    }
    
    .mobile-note-nav-close {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #f3f4f6;
        border: none;
        font-size: 18px;
        color: #6b7280;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .mobile-note-nav-close:active {
        background: #e5e7eb;
    }
    
    [data-theme="dark"] .mobile-note-nav-close {
        background: #374151;
        color: #9ca3af;
    }
    
    .mobile-note-nav-body {
        padding: 16px 0;
        cursor: pointer;
    }
    
    .mobile-note-nav-body p {
        font-size: 15px;
        color: #374151;
        line-height: 1.6;
        margin: 0;
    }
    
    [data-theme="dark"] .mobile-note-nav-body p {
        color: #e5e7eb;
    }
    
    .mobile-note-nav-hint {
        text-align: center;
        font-size: 12px;
        color: #9ca3af;
        padding-top: 8px;
    }
    
    /* ============================================
       MOBILE CREATE MODE (hide faint highlights)
       ============================================ */
    body.mobile-create-mode-active .verse-highlight-faint,
    body.mobile-create-mode-active .faint-verse-highlight,
    body.mobile-create-mode-active .verse-has-note {
        background: transparent !important;
        opacity: 0 !important;
    }
    
    /* Highlight the Create button when in create mode */
    body.mobile-create-mode-active .create-btn {
        background: rgba(124, 58, 237, 0.15) !important;
    }
    
    body.mobile-create-mode-active .create-btn svg {
        color: #7c3aed !important;
    }
    
    /* ============================================
       MOBILE STUDY GRAPH (fullscreen minimal)
       Override desktop CSS for clean mobile experience
       ============================================ */
    .study-graph-modal {
        display: flex !important;
        opacity: 0;
        pointer-events: none;
    }
    
    .study-graph-modal.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    .study-graph-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: #f5f0ff !important;
    }
    
    /* Enable touch interactions for graph */
    .study-graph-svg {
        touch-action: none !important;
    }
    
    .study-graph-svg .node-group {
        touch-action: none !important;
    }
    
    /* Hide the bottom nav when graph is open */
    .study-graph-modal.active ~ .mobile-nav-redesign,
    body:has(.study-graph-modal.active) .mobile-nav-redesign {
        display: none !important;
    }
    
    /* Hide desktop header and legend on mobile - go minimal */
    .study-graph-header {
        display: none !important;
    }
    
    .study-graph-legend {
        display: none !important;
    }
    
    /* Hide the animated background */
    .study-graph-bg-animation {
        display: none !important;
    }
    
    /* Mobile graph title - floating at top */
    .mobile-graph-title {
        position: absolute;
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        align-items: center;
        gap: 10px;
        font-size: 18px;
        font-weight: 600;
        color: #1e1e3f;
    }
    
    .mobile-graph-title svg {
        color: #7c3aed;
        width: 22px;
        height: 22px;
    }
    
    /* Mobile floating close button (X) - top right */
    .mobile-graph-close-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 100;
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(239, 68, 68, 0.15);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-graph-close-btn svg {
        width: 20px;
        height: 20px;
        color: #ef4444;
    }
    
    .mobile-graph-close-btn:active {
        transform: scale(0.95);
        background: rgba(239, 68, 68, 0.25);
    }
    
    /* Mobile expandable controls panel - top left */
    .mobile-graph-controls {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 100;
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .mobile-graph-controls-toggle {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: white;
        border: 1px solid rgba(124, 58, 237, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-graph-controls-toggle svg {
        width: 20px;
        height: 20px;
        color: #7c3aed;
        transition: transform 0.3s ease;
    }
    
    .mobile-graph-controls.expanded .mobile-graph-controls-toggle {
        border-radius: 20px 20px 0 0;
    }
    
    .mobile-graph-controls.expanded .mobile-graph-controls-toggle svg {
        transform: rotate(180deg);
    }
    
    /* Expanded vertical panel */
    .mobile-graph-controls-panel {
        position: absolute;
        top: 40px;
        left: 0;
        width: 40px;
        background: white;
        border: 1px solid rgba(124, 58, 237, 0.2);
        border-top: none;
        border-radius: 0 0 20px 20px;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-graph-controls.expanded .mobile-graph-controls-panel {
        max-height: 200px;
        opacity: 1;
    }
    
    .mobile-graph-controls-panel button {
        width: 100%;
        height: 44px;
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    .mobile-graph-controls-panel button:active {
        background: rgba(124, 58, 237, 0.1);
    }
    
    .mobile-graph-controls-panel button svg {
        width: 18px;
        height: 18px;
        color: #7c3aed;
    }
    
    .mobile-graph-controls-panel button:last-child {
        border-radius: 0 0 19px 19px;
    }
    
    /* Divider between panel buttons */
    .mobile-graph-controls-panel button + button {
        border-top: 1px solid rgba(124, 58, 237, 0.1);
    }
    
    /* Mobile graph legend at bottom - HIDDEN per user request */
    .mobile-graph-legend {
        display: none !important;
    }
    
    /* ============================================
       CHURCH FATHERS / THEOLOGIAN GRAPH - MOBILE
       Minimal styling similar to Study Graph
       ============================================ */
    
    /* Full screen container on mobile */
    .theologian-graph-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
    
    /* Hide the bottom nav when Theologian graph is open */
    .theologian-graph-modal.open ~ .mobile-nav-redesign,
    body:has(.theologian-graph-modal.open) .mobile-nav-redesign {
        display: none !important;
    }
    
    /* Hide desktop header on mobile - go minimal */
    .theologian-graph-header {
        display: none !important;
    }
    
    /* Hide desktop legend on mobile */
    .theologian-graph-legend {
        display: none !important;
    }
    
    /* Mobile Theologian graph title - floating at top center */
    .mobile-theologian-graph-title {
        position: absolute;
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        align-items: center;
        gap: 10px;
        font-size: 16px;
        font-weight: 600;
        color: #1e1e3f;
        max-width: calc(100% - 120px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    [data-theme="dark"] .mobile-theologian-graph-title {
        color: #f0f0f8;
    }
    
    .mobile-theologian-graph-title svg {
        color: #6b5b95;
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    
    [data-theme="dark"] .mobile-theologian-graph-title svg {
        color: #a0c7ff;
    }
    
    /* Mobile floating close button (X) - top right */
    .mobile-theologian-graph-close {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 100;
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(239, 68, 68, 0.15);
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-theologian-graph-close svg {
        width: 20px;
        height: 20px;
        color: #ef4444;
    }
    
    .mobile-theologian-graph-close:active {
        transform: scale(0.95);
        background: rgba(239, 68, 68, 0.25);
    }
    
    /* Mobile expandable controls panel - top left */
    .mobile-theologian-graph-controls {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 100;
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .mobile-theologian-graph-controls-toggle {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-toggle {
        background: #2a2a2a;
        border-color: rgba(160, 199, 255, 0.2);
    }
    
    .mobile-theologian-graph-controls-toggle svg {
        width: 20px;
        height: 20px;
        color: #6b7280;
        transition: transform 0.3s ease;
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-toggle svg {
        color: #a0c7ff;
    }
    
    .mobile-theologian-graph-controls.expanded .mobile-theologian-graph-controls-toggle {
        border-radius: 20px 20px 0 0;
    }
    
    .mobile-theologian-graph-controls.expanded .mobile-theologian-graph-controls-toggle svg {
        transform: rotate(180deg);
    }
    
    /* Expanded vertical panel with zoom controls only (no folder button) */
    .mobile-theologian-graph-controls-panel {
        position: absolute;
        top: 40px;
        left: 0;
        width: 40px;
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-top: none;
        border-radius: 0 0 20px 20px;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-panel {
        background: #2a2a2a;
        border-color: rgba(160, 199, 255, 0.2);
    }
    
    .mobile-theologian-graph-controls.expanded .mobile-theologian-graph-controls-panel {
        max-height: 150px;
        opacity: 1;
    }
    
    .mobile-theologian-graph-controls-panel button {
        width: 100%;
        height: 44px;
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    .mobile-theologian-graph-controls-panel button:active {
        background: rgba(0, 0, 0, 0.06);
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-panel button:active {
        background: rgba(160, 199, 255, 0.1);
    }
    
    .mobile-theologian-graph-controls-panel button svg {
        width: 18px;
        height: 18px;
        color: #6b7280;
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-panel button svg {
        color: #a0c7ff;
    }
    
    .mobile-theologian-graph-controls-panel button:last-child {
        border-radius: 0 0 19px 19px;
    }
    
    /* Divider between panel buttons */
    .mobile-theologian-graph-controls-panel button + button {
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }
    
    [data-theme="dark"] .mobile-theologian-graph-controls-panel button + button {
        border-color: rgba(160, 199, 255, 0.1);
    }
    
    /* Commentary panel on mobile - smaller text and full screen */
    .theologian-commentary-panel {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        left: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        max-height: 55vh !important;
        border-radius: 16px 16px 0 0 !important;
        transform: translateY(100%) !important;
        padding: 16px !important;
    }
    
    .theologian-commentary-panel.open {
        transform: translateY(0) !important;
    }
    
    /* MUCH smaller text for commentary on mobile */
    .commentary-verse-ref {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
    }
    
    .scripture-toggle {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
        margin-bottom: 10px !important;
    }
    
    .scripture-content.expanded {
        padding: 10px !important;
        max-height: 200px !important;
        margin-bottom: 10px !important;
    }
    
    .scripture-text {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }
    
    .scripture-text .verse-num {
        font-size: 0.65rem !important;
    }
    
    .commentary-section {
        margin-top: 12px !important;
        padding-top: 10px !important;
    }
    
    .commentary-section-label {
        font-size: 0.65rem !important;
        margin-bottom: 6px !important;
    }
    
    .commentary-body {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }
    
    .commentary-citation {
        font-size: 0.7rem !important;
        margin-top: 10px !important;
    }
    
    .theologian-commentary-close {
        width: 28px !important;
        height: 28px !important;
        top: 10px !important;
        right: 10px !important;
        font-size: 16px !important;
    }
        
}