        :root {
            /* Light Theme (Default) */
            --bg-body: #f8f9fa;
            --bg-sidebar: #ffffff;
            --bg-surface: #ffffff;
            --text-primary: #2c3e50;
            --text-secondary: #5f6368;
            --accent: #3b82f6;
            --accent-hover: #2563eb;
            --border: #e2e8f0;
            --verse-num: #94a3b8;
            --highlight: #fef3c7;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --font-serif: 'Merriweather', 'Georgia', serif;
            --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            --font-size-base: 18px;
            --line-height: 1.8;
            --max-width: 800px;
        }

        /* Themes */
        [data-theme="sepia"] {
            --bg-body: #f4ecd8;
            --bg-sidebar: #fbf6e9;
            --bg-surface: #fbf6e9;
            --text-primary: #433422;
            --text-secondary: #745f47;
            --accent: #8b5cf6;
            --border: #e6dbbf;
            --verse-num: #a69279;
            --highlight: #eaddcf;
        }

        [data-theme="dark"] {
            --bg-body: #111827;
            --bg-sidebar: #1f2937;
            --bg-surface: #1f2937;
            --text-primary: #f3f4f6;
            --text-secondary: #9ca3af;
            --accent: #60a5fa;
            --accent-hover: #93c5fd;
            --border: #374151;
            --verse-num: #4b5563;
            --highlight: #374151;
        }

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

        body {
            font-family: var(--font-sans);
            background-color: var(--bg-body);
            color: var(--text-primary);
            height: 100vh;
            display: flex;
            flex-direction: column;
            transition: background-color 0.3s, color 0.3s;
            overflow: hidden;
            /* App-like feel */
        }

        /* Header */
        header {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border);
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 10;
            box-shadow: var(--shadow);
            flex-shrink: 0;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 700;
            font-size: 1.25rem;
            color: var(--accent);
            text-decoration: none;
        }

        .brand svg {
            width: 24px;
            height: 24px;
            fill: currentColor;
        }

        .header-controls {
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        button.icon-btn {
            background: none;
            border: none;
            color: var(--accent);
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: background 0.2s, color 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .icon-btn svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
        }

        button.icon-btn:hover {
            background-color: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
        }

        [data-theme="dark"] button.icon-btn:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* Main Layout */
        .app-container {
            display: flex;
            flex: 1;
            overflow: hidden;
            position: relative;
        }

        /* Sidebar (Navigation) */
        .sidebar {
            width: 280px;
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            z-index: 20;
            transform: translateX(-100%);
            /* Hidden by default on mobile/tablet */
        }

        @media (min-width: 1024px) {
            .sidebar {
                position: relative;
                transform: translateX(0);
            }
        }

        .sidebar.open {
            transform: translateX(0);
        }

        .sidebar-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .search-box {
            padding: 0.5rem;
            margin: 0.5rem;
        }

        .search-input {
            width: 100%;
            padding: 0.5rem;
            border-radius: 6px;
            border: 1px solid var(--border);
            background: var(--bg-body);
            color: var(--text-primary);
        }

        .book-list {
            overflow-y: auto;
            flex: 1;
        }

        .book-item {
            padding: 0.75rem 1rem;
            cursor: pointer;
            font-size: 0.95rem;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
        }

        .book-item:hover {
            background: rgba(0, 0, 0, 0.03);
            color: var(--text-primary);
        }

        .book-item.active {
            background: var(--accent);
            color: white;
        }

        .chapters-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 5px;
            padding: 10px;
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border);
        }

        .chapter-btn {
            background: var(--bg-body);
            border: 1px solid var(--border);
            border-radius: 4px;
            padding: 6px;
            text-align: center;
            cursor: pointer;
            font-size: 0.8rem;
            color: var(--text-primary);
        }

        .chapter-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .chapter-btn.active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        /* Reader Area */
        main {
            flex: 1;
            overflow-y: auto;
            position: relative;
            scroll-behavior: smooth;
        }

        .reader-content {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 2rem 1.5rem 6rem;
            /* Bottom padding for mobile nav */
        }

        .chapter-title {
            text-align: center;
            margin-bottom: 2rem;
            font-family: var(--font-serif);
        }

        .chapter-title h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .chapter-title span {
            color: var(--text-secondary);
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .scripture-text {
            font-family: var(--font-serif);
            font-size: var(--font-size-base);
            line-height: var(--line-height);
        }

        .verse {
            position: relative;
            padding: 2px 0;
            border-radius: 4px;
            transition: background 0.2s;
            cursor: text;
        }

        .verse:hover {
            background-color: rgba(0, 0, 0, 0.02);
        }

        [data-theme="dark"] .verse:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .verse-num {
            font-size: 0.7em;
            color: var(--verse-num);
            vertical-align: top;
            margin-right: 4px;
            font-weight: bold;
            font-family: var(--font-sans);
            user-select: none;
        }

        .highlighted {
            background-color: var(--highlight);
        }

        /* Navigation Footer (Floating) */
        .nav-footer {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-surface);
            border: 1px solid var(--border);
            padding: 0.5rem 1rem;
            border-radius: 50px;
            display: flex;
            gap: 1rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 100;
            align-items: center;
        }

        .nav-btn {
            background: none;
            border: none;
            color: var(--text-primary);
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 20px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .nav-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .nav-btn:hover:not(:disabled) {
            background: rgba(0, 0, 0, 0.05);
        }

        /* Settings Modal */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
        }

        .modal.active {
            opacity: 1;
            pointer-events: all;
        }

        .modal-content {
            background: var(--bg-surface);
            padding: 2rem;
            border-radius: 12px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        }

        .setting-group {
            margin-bottom: 1.5rem;
        }

        .setting-group h3 {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 0.75rem;
            text-transform: uppercase;
        }

        .theme-options,
        .font-options {
            display: flex;
            gap: 10px;
        }

        .theme-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 2px solid var(--border);
            cursor: pointer;
        }

        .theme-btn.light {
            background: #fff;
        }

        .theme-btn.sepia {
            background: #f4ecd8;
        }

        .theme-btn.dark {
            background: #1f2937;
        }

        .theme-btn.active {
            border-color: var(--accent);
            border-width: 3px;
        }

        .range-slider {
            width: 100%;
            cursor: pointer;
        }

        /* Loading Spinner */
        .loader {
            border: 3px solid var(--border);
            border-top: 3px solid var(--accent);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 50px auto;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* Toast Notification */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: #333;
            color: #fff;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 0.9rem;
            opacity: 0;
            transition: all 0.3s;
            z-index: 200;
        }

        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* Overlay for mobile sidebar */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 15;
            display: none;
        }

        .overlay.active {
            display: block;
        }

        .verse-actions {
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--text-primary);
            color: var(--bg-body);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            display: none;
            gap: 5px;
            white-space: nowrap;
        }

        .verse:hover .verse-actions {
            display: none;
        }

        /* Search Functionality Styles */
        .search-modal {
            max-width: 600px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
        }

        .search-box {
            display: flex;
            gap: 0.5rem;
        }

        .search-input {
            flex: 1;
            padding: 10px 15px;
            border: 1px solid var(--border);
            border-radius: 4px;
            background: var(--bg-body);
            color: var(--text-primary);
            font-size: 1rem;
            transition: border-color 0.2s;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .search-results {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 0;
        }

        .search-info {
            padding: 0.75rem 1rem;
            background: var(--bg-body);
            border-radius: 4px;
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }

        .search-result-item {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .search-result-item:hover {
            background-color: var(--highlight);
        }

        .search-result-ref {
            display: block;
            color: var(--accent);
            font-weight: 600;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: color 0.2s;
        }

        .search-result-ref:hover {
            color: var(--accent-hover);
        }

        .search-result-text {
            color: var(--text-primary);
            line-height: 1.6;
            font-size: 0.95rem;
            cursor: pointer;
            transition: color 0.2s;
        }

        .search-result-text:hover {
            color: var(--accent);
        }

        .no-results {
            padding: 2rem 1rem;
            text-align: center;
            color: var(--text-secondary);
            font-size: 1rem;
        }

        .error-message {
            padding: 2rem 1rem;
            text-align: center;
            color: #dc2626;
            font-size: 1rem;
        }

        @media (max-width: 768px) {
            .search-modal {
                max-height: 90vh;
                width: 90vw;
            }
        }