:root {
            --bg: #0a0a0f; --surface: #111118; --border: #1e1e2e;
            --accent: #7c3aed; --accent-glow: rgba(124,58,237,0.3); --accent-light: #a78bfa;
            --text: #e2e8f0; --text-muted: #64748b; --user-bg: #1e1030;
            --molt-orange: #ff6b35; --molt-orange-glow: rgba(255,107,53,0.2);
            --success: #22c55e; --error: #ef4444;
            --nav-height: 60px;
            --safe-bottom: env(safe-area-inset-bottom, 0px);
        }
        * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
        html, body { height: 100%; overflow: hidden; }
        body { font-family: 'DM Mono', monospace; background: var(--bg); color: var(--text); display: flex; }
        body::before { content: ''; position: fixed; top: -200px; left: 30%; width: 600px; height: 400px; background: radial-gradient(ellipse, rgba(124,58,237,0.08) 0%, transparent 70%); pointer-events: none; z-index: 0; }

        /* ════════════════════════════════
           DESKTOP LAYOUT (>= 768px)
        ════════════════════════════════ */
        .conv-panel {
            width: 220px; flex-shrink: 0; border-right: 1px solid var(--border);
            background: var(--surface); display: flex; flex-direction: column; z-index: 1;
        }
        .conv-header {
            padding: 14px 14px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
            background: var(--surface);
        }
        .conv-logo {
            width: 100%; height: auto; max-height: 48px; object-fit: contain; display: block;
            /* logo has black bg — blend it out */
            mix-blend-mode: lighten;
            filter: drop-shadow(0 0 10px rgba(124,58,237,0.28));
        }
        .new-chat-btn {
            margin: 8px 10px; padding: 8px; background: rgba(124,58,237,0.15); color: var(--accent-light);
            border: 1px solid rgba(124,58,237,0.35); border-radius: 8px; font-family: 'DM Mono', monospace;
            font-size: 11px; cursor: pointer; transition: all 0.2s; text-align: center;
            flex-shrink: 0; letter-spacing: 0.3px;
        }
        .new-chat-btn:hover { background: rgba(124,58,237,0.28); border-color: var(--accent); color: white; }
        .conv-list { flex: 1; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 3px; }
        .conv-list::-webkit-scrollbar { width: 3px; }
        .conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

        /* ── SIDEBAR FOOTER ── */
        .conv-footer {
            flex-shrink: 0; border-top: 1px solid var(--border);
            padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
        }
        .conv-footer-status { display: flex; align-items: center; gap: 6px; }
        .status-dot {
            width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
            flex-shrink: 0; transition: background 0.3s;
        }
        .status-dot.online  { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
        .status-dot.offline { background: var(--error);   box-shadow: 0 0 6px rgba(239,68,68,0.4); }
        .status-text { font-size: 11px; color: var(--text-muted); }
        .conv-footer-links {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
        }
        .footer-link {
            font-size: 10px; color: var(--text-muted); text-decoration: none;
            padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
            transition: all 0.2s; text-align: center; white-space: nowrap; overflow: hidden;
            text-overflow: ellipsis;
        }
        .footer-link:hover { border-color: var(--accent); color: var(--accent-light); }
        .conv-footer-version { font-size: 10px; color: #2d2d3d; }
        .conv-item {
            display: flex; align-items: center; gap: 6px; padding: 7px 10px;
            border-radius: 8px; cursor: pointer; transition: all 0.15s; border: 1px solid transparent;
        }
        .conv-item:hover { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.2); }
        .conv-item.active { background: rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.4); }
        .conv-item-text { flex: 1; overflow: hidden; }
        .conv-item-title { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .conv-item-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
        .conv-item-del {
            opacity: 0; width: 20px; height: 20px; background: none; border: none;
            color: var(--error); cursor: pointer; font-size: 14px; border-radius: 4px;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s;
        }
        .conv-item:hover .conv-item-del { opacity: 1; }
        .conv-item-del:hover { background: rgba(239,68,68,0.15); }
        .conv-empty { padding: 20px 10px; text-align: center; color: var(--text-muted); font-size: 11px; line-height: 1.6; }

        /* CHAT PANEL */
        .chat-panel { flex: 1; display: flex; flex-direction: column; padding: 0; min-width: 0; position: relative; z-index: 1; }
        header { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
        .chat-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); letter-spacing: 0.2px; }
        .chat-title.has-msgs { color: var(--text); }
        .header-right { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
        .badge { font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: 'DM Mono', monospace; }
        .badge-groq { color: var(--accent-light); background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3); }
        .badge-molt { color: var(--molt-orange); background: rgba(255,107,53,0.1); border: 1px solid rgba(255,107,53,0.3); }
        .btn-small { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: 3px 9px; font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.2s; }
        .btn-small:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(124,58,237,0.08); }
        /* mobile menu toggle — hidden on desktop */
        .mobile-menu-btn { display: none; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px; }

        #chatbox { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 14px; margin-bottom: 0; }
        #chatbox::-webkit-scrollbar { width: 4px; }
        #chatbox::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
        .msg { display: flex; gap: 10px; animation: fadeUp 0.2s ease; }
        @keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
        /* AI messages — full-width dashboard style */
        .msg.ai { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 0; border-bottom: 1px solid rgba(30,30,46,0.5); }
        .msg.ai:last-child { border-bottom: none; }
        .msg.ai .avatar { display: none; }
        /* User messages — compact right-aligned */
        .msg.user { flex-direction: row; justify-content: flex-end; padding: 10px 0; }
        .msg.user .avatar { display: none; }
        .avatar { display: none; }
        .bubble { max-width: 100%; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.7; word-break: break-word; }
        .bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
        .bubble img { display:block; width:100%; max-width:520px; height:auto; margin:10px 0 6px; border-radius:12px; border:1px solid var(--border); background:#020617; object-fit:cover; }
        .bubble pre { background: transparent; margin: 0; overflow: hidden; }
        .bubble pre code { font-family: 'DM Mono', monospace; font-size: 13px; color: inherit; background: none; padding: 0; border-radius: 0; display: block; overflow-x: auto; }
        .bubble code { font-family: 'DM Mono', monospace; font-size: 13px; }
        .bubble :not(pre) > code { background: rgba(124,58,237,0.15); padding: 2px 5px; border-radius: 4px; color: var(--accent-light); font-size: 13px; }

        /* Code block wrapper */
        .code-block { background: #0d0d14; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
        .code-block-header { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
        .code-lang { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
        .code-copy-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; border-radius: 5px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.15s; display: flex; align-items: center; gap: 5px; line-height: 1.4; }
        .code-copy-btn:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(124,58,237,0.1); }
        .code-copy-btn.copied { border-color: var(--success); color: var(--success); background: rgba(34,197,94,0.08); }
        .code-block pre { margin: 0; padding: 0; border: none; border-radius: 0; background: transparent; }
        .code-block pre code.hljs { padding: 14px 16px; background: transparent; font-size: 13px; line-height: 1.6; }
        .bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; } .bubble li { margin: 3px 0; }
        .bubble h1, .bubble h2, .bubble h3 { font-family: 'Syne', sans-serif; margin: 10px 0 6px; color: var(--accent-light); }
        .bubble strong { color: #e2e8f0; } .bubble a { color: var(--accent-light); }
        .msg.user .bubble { background: var(--user-bg); border: 1px solid rgba(124,58,237,0.3); border-bottom-right-radius: 4px; color: #c4b5fd; }
        .msg.user .bubble { max-width: 62%; background: rgba(30,16,48,0.85); border: 1px solid rgba(124,58,237,0.22); border-radius: 12px 12px 3px 12px; color: #c4b5fd; font-size: 13px; padding: 9px 14px; }
        .msg.ai .bubble { background: transparent; border: none; border-left: 2px solid rgba(124,58,237,0.4); border-radius: 0; padding: 2px 16px; }
        .msg-role-label { font-size: 10px; color: var(--accent-light); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 6px; font-family: 'DM Mono', monospace; opacity: 0.65; padding: 0; }
        .thought-bubble { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-left: 7px; width: 20px; height: 20px; border-radius: 999px; cursor: pointer; opacity: 0.82; vertical-align: middle; background: rgba(124,58,237,0.14); border: 1px solid rgba(124,58,237,0.24); transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
        .thought-bubble:hover, .thought-bubble:focus, .thought-bubble.open { opacity: 1; outline: none; transform: translateY(-1px); background: rgba(124,58,237,0.2); border-color: rgba(167,139,250,0.5); }
        .thought-bubble-icon { font-size: 11px; line-height: 1; }
        .thought-bubble-content { display: none; position: absolute; z-index: 40; bottom: calc(100% + 10px); left: -6px; width: 280px; max-width: min(78vw, 280px); padding: 12px 13px; background: linear-gradient(180deg, rgba(20,18,31,0.98), rgba(12,11,21,0.98)); border: 1px solid rgba(124,58,237,0.45); border-radius: 12px; box-shadow: 0 16px 36px rgba(0,0,0,0.46); color: #e7ddff; font-size: 12.5px; line-height: 1.58; text-transform: none; letter-spacing: normal; font-family: 'DM Mono', monospace; white-space: normal; backdrop-filter: blur(10px); }
        .thought-bubble-content::after { content: ''; position: absolute; top: 100%; left: 14px; border: 7px solid transparent; border-top-color: rgba(124,58,237,0.35); }
        .thought-bubble:hover .thought-bubble-content, .thought-bubble:focus .thought-bubble-content, .thought-bubble.open .thought-bubble-content { display: block; }
        .molt-notice { font-size: 11px; color: var(--molt-orange); margin-top: 6px; opacity: 0.8; }
        .thinking-dots span { display: inline-block; width: 5px; height: 5px; background: var(--accent-light); border-radius: 50%; margin: 0 2px; animation: bounce 1.2s infinite; }
        .thinking-dots span:nth-child(2) { animation-delay: 0.2s; } .thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
        .empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); text-align: center; }
        .empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); text-align: center; padding: 0 24px; }
        .empty-state .icon { font-size: 28px; opacity: 0.25; }
        .empty-state p { font-size: 12px; max-width: 280px; line-height: 1.7; color: var(--text-muted); }
        .empty-state .quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
        .empty-state .quick-prompt { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; cursor: pointer; transition: all 0.15s; font-family: 'DM Mono', monospace; }
        .empty-state .quick-prompt:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(124,58,237,0.07); }

        /* INPUT */
        .input-area {
              display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border);
              border-radius: 10px; padding: 7px 7px 7px 14px; transition: border-color 0.2s;
              flex-shrink: 0; align-items: center; min-width: 0; width: 100%;
        }
        .input-area:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
        #userInput {
            flex: 1; background: transparent; border: none; outline: none;
            color: var(--text); font-family: 'DM Mono', monospace; font-size: 14px;
            min-width: 0; min-height: 38px; max-height: 120px; line-height: 38px;
            overflow-y: auto; white-space: pre-wrap; word-break: break-word; cursor: text;
        }
        #userInput:empty:before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
        #sendBtn { width: 38px; height: 38px; background: var(--accent); border: none; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; box-shadow: 0 0 10px var(--accent-glow); }
        #sendBtn:hover { background: #6d28d9; transform: scale(1.05); }
        #sendBtn:active { transform: scale(0.96); }
        #sendBtn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
        #sendBtn svg { width: 16px; height: 16px; fill: white; }

        /* RIGHT SIDEBAR */
    .sidebar { display: none; }
    .acct-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,0.7); display: none; align-items: flex-start; justify-content: flex-end; z-index: 1100; padding: 53px 0 0 0; }
    .acct-backdrop.open { display: flex; }
    .acct-card { width: 300px; height: calc(100vh - 53px); background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px; overflow-y: auto; animation: slideInRight 0.2s ease; }
    @keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    .acct-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
    .acct-card-title { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; color: var(--text); }
    .acct-close-btn { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
    .acct-close-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
    .acct-btn { background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.3); color: var(--accent-light); border-radius: 6px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.2s; }
    .acct-btn:hover { background: rgba(124,58,237,0.2); border-color: var(--accent); }
        .user-info { display: flex; align-items: center; gap: 8px; }
        .user-avatar { width: 28px; height: 28px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 0 8px var(--accent-glow); }
        .user-name { font-size: 12px; font-weight: 600; flex: 1; }

        .discord-sync-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
        .discord-sync-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
        .discord-sync-row { display: flex; flex-direction: column; gap: 4px; }
        .discord-linked { display: flex; align-items: center; gap: 6px; font-size: 12px; }
        .discord-icon { font-size: 14px; }
        .discord-tag-display { flex: 1; color: var(--accent-light); font-size: 11px; }
        .btn-danger-small { background: none; border: 1px solid rgba(239,68,68,0.3); color: var(--error); border-radius: 20px; padding: 2px 8px; font-size: 10px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.2s; }
        .btn-danger-small:hover { background: rgba(239,68,68,0.1); }
        .auth-form { display: flex; flex-direction: column; gap: 6px; }
        .auth-input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 9px; font-size: 11px; font-family: 'DM Mono', monospace; outline: none; transition: border-color 0.2s; }
        .auth-input:focus { border-color: var(--accent); }
        .auth-input::placeholder { color: var(--text-muted); }
        .auth-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
        .auth-tab { flex: 1; padding: 5px; font-size: 11px; text-align: center; cursor: pointer; color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; transition: all 0.2s; font-family: 'DM Mono', monospace; }
        .auth-tab.active { color: var(--accent-light); border-color: var(--accent); background: rgba(124,58,237,0.1); }
        .auth-btn { background: var(--accent); color: white; border: none; border-radius: 7px; padding: 7px; font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.2s; font-weight: 600; }
        .auth-btn:hover { background: #6d28d9; }
        .auth-error { font-size: 10px; color: var(--error); text-align: center; }
        .molt-header { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
        .molt-logo { font-size: 18px; }
        .molt-header-text h2 { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700; color: var(--molt-orange); }
        .molt-header-text p { font-size: 10px; color: var(--text-muted); }
        .molt-refresh { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 5px; padding: 3px 7px; font-size: 11px; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.2s; }
        .molt-refresh:hover { border-color: var(--molt-orange); color: var(--molt-orange); }
        .molt-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
        .molt-tab { flex: 1; padding: 8px; font-size: 11px; text-align: center; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all 0.2s; font-family: 'DM Mono', monospace; }
        .molt-tab.active { color: var(--molt-orange); border-bottom-color: var(--molt-orange); }
        .molt-content { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
        .molt-content::-webkit-scrollbar { width: 3px; }
        .molt-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
        .molt-post { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 10px; cursor: pointer; transition: all 0.2s; }
        .molt-post:hover, .molt-post:active { border-color: rgba(255,107,53,0.4); box-shadow: 0 0 8px var(--molt-orange-glow); }
        .molt-post-title { font-size: 11px; font-family: 'Syne', sans-serif; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 5px; }
        .molt-post-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); }
        .molt-upvotes { color: var(--molt-orange); font-weight: 600; }
        .molt-agent { background: rgba(255,107,53,0.08); border: 1px solid rgba(255,107,53,0.2); border-radius: 4px; padding: 1px 4px; }
        .molt-submolt { margin-left: auto; background: rgba(124,58,237,0.1); border-radius: 4px; padding: 1px 4px; color: var(--accent-light); }
        .molt-loading { text-align: center; color: var(--text-muted); font-size: 11px; padding: 16px; }
        .molt-loading-dots span { display: inline-block; width: 4px; height: 4px; background: var(--molt-orange); border-radius: 50%; margin: 0 2px; animation: bounce 1.2s infinite; }
        .molt-loading-dots span:nth-child(2) { animation-delay: 0.2s; } .molt-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        .molt-status { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
        .molt-status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--molt-orange); box-shadow: 0 0 5px var(--molt-orange); animation: pulse 2s infinite; }
        @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

        /* ════════════════════════════════
           MOBILE LAYOUT (< 768px)
        ════════════════════════════════ */
        @media (max-width: 767px) {
            body { flex-direction: column; overflow: hidden; }

            /* Hide desktop panels */
            .conv-panel { display: none; }
            .sidebar { display: none; }

            /* Chat panel fills screen minus bottom nav */
            .chat-panel {
                 padding: 0;
                height: calc(100vh - var(--nav-height) - var(--safe-bottom));
            }

            header { margin-bottom: 12px; padding-bottom: 12px; }
                        header { margin-bottom: 0; }
            .mobile-menu-btn { display: flex; }
            .badge-groq, .badge-molt { display: none; }

            .bubble { max-width: 88%; font-size: 15px; }
            .bubble { max-width: 90%; font-size: 15px; }
            .msg.user .bubble { max-width: 82%; }
            #chatbox { padding: 12px 12px 10px; }

            /* Input sits just above bottom nav */
            .input-area {
                 border-radius: 8px;
                 margin: 8px 12px;
                 padding: 8px 8px 8px 14px;
            }
            #userInput { font-size: 16px; line-height: 36px; min-height: 36px; } /* 16px prevents iOS zoom */
            #sendBtn { width: 40px; height: 40px; border-radius: 10px; }

            /* ── BOTTOM NAV ── */
            .bottom-nav {
                display: flex; flex-shrink: 0;
                height: calc(var(--nav-height) + var(--safe-bottom));
                padding-bottom: var(--safe-bottom);
                background: var(--surface);
                border-top: 1px solid var(--border);
                z-index: 100;
            }
            .bottom-nav-item {
                flex: 1; display: flex; flex-direction: column; align-items: center;
                justify-content: center; gap: 3px; cursor: pointer;
                color: var(--text-muted); transition: color 0.2s; font-size: 10px;
                font-family: 'DM Mono', monospace; border: none; background: none;
                padding-top: 8px;
            }
            .bottom-nav-item .nav-icon { font-size: 20px; line-height: 1; }
            .bottom-nav-item.active { color: var(--accent-light); }
            .bottom-nav-item:nth-child(3).active { color: var(--molt-orange); }

            /* ── MOBILE DRAWER (conversations) ── */
            .mobile-drawer {
                position: fixed; top: 0; left: 0; width: 80%; max-width: 300px;
                height: 100%; background: var(--surface); border-right: 1px solid var(--border);
                z-index: 200; transform: translateX(-100%); transition: transform 0.3s ease;
                display: flex; flex-direction: column;
            }
            .mobile-drawer.open { transform: translateX(0); }
            .drawer-overlay {
                position: fixed; inset: 0; background: rgba(0,0,0,0.6);
                z-index: 199; opacity: 0; pointer-events: none; transition: opacity 0.3s;
            }
            .drawer-overlay.open { opacity: 1; pointer-events: all; }
            .drawer-header {
                padding: 20px 16px 14px; border-bottom: 1px solid var(--border);
                display: flex; align-items: center; justify-content: space-between;
                background: linear-gradient(180deg, rgba(124,58,237,0.1) 0%, rgba(124,58,237,0.03) 70%, transparent 100%);
            }
            .drawer-logo {
                width: 100%; height: auto; max-height: 46px; object-fit: contain; mix-blend-mode: lighten;
                filter: drop-shadow(0 0 9px rgba(124,58,237,0.24));
            }
            .drawer-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; }
            .drawer-title span { color: var(--accent-light); }
            .drawer-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 4px; }
            .drawer-new-btn {
                margin: 10px; padding: 10px; background: var(--accent); color: white;
                border: none; border-radius: 10px; font-family: 'DM Mono', monospace;
                font-size: 13px; cursor: pointer; transition: all 0.2s; text-align: center;
                box-shadow: 0 0 12px var(--accent-glow);
            }
            .drawer-conv-list { flex: 1; overflow-y: auto; padding: 4px 10px; display: flex; flex-direction: column; gap: 4px; }
            .drawer-conv-list .conv-item { padding: 10px 12px; }
            .drawer-conv-list .conv-item-title { font-size: 13px; }
            .drawer-conv-list .conv-item-meta { font-size: 11px; }
            .drawer-conv-list .conv-item-del { opacity: 1; width: 26px; height: 26px; font-size: 16px; }

            /* ── MOBILE SCREENS (Moltbook & Account) ── */
            .mobile-screen {
                display: none; position: fixed; inset: 0;
                bottom: calc(var(--nav-height) + var(--safe-bottom));
                background: var(--bg); z-index: 50; flex-direction: column; overflow: hidden;
            }
            .mobile-screen.active { display: flex; }
            .mobile-screen-header {
                padding: 16px; border-bottom: 1px solid var(--border);
                font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px;
                display: flex; align-items: center; gap: 10px; flex-shrink: 0;
            }
            .mobile-screen-header span { color: var(--molt-orange); }
            .mobile-screen-header .accent { color: var(--accent-light); }
            .mobile-screen-body { flex: 1; overflow-y: auto; padding: 16px; }

            /* Account screen */
            .mobile-auth { max-width: 400px; margin: 0 auto; }
            .mobile-auth .auth-panel { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
            .mobile-auth .auth-panel h3 { font-size: 13px; }
            .mobile-auth .auth-input { font-size: 16px; padding: 10px 12px; } /* 16px prevents iOS zoom */
            .mobile-auth .auth-btn { padding: 10px; font-size: 13px; }
            .mobile-auth .auth-tab { font-size: 13px; padding: 8px; }
            .mobile-auth .user-info { padding: 4px 0; }
            .mobile-auth .user-name { font-size: 14px; }
        }

        /* Desktop hides mobile-only elements */
        @media (min-width: 768px) {
            .bottom-nav { display: none; }
            .mobile-drawer { display: none; }
            .drawer-overlay { display: none; }
            .mobile-screen { display: none !important; }
        }

        /* Tablet: hide right sidebar but keep left */
        @media (min-width: 768px) and (max-width: 1024px) {
            .sidebar { display: none; }
        }
        /* ── DEV PANEL ── */
        .dev-panel {
            position: fixed; bottom: 70px; right: 16px; width: 340px; max-height: 70vh;
            background: #0d0d14; border: 1px solid #7c3aed; border-radius: 14px;
            font-family: 'DM Mono', monospace; font-size: 11px; z-index: 999;
            box-shadow: 0 0 30px rgba(124,58,237,0.3); display: none; flex-direction: column;
            overflow: hidden;
        }
        .dev-panel.open { display: flex; }
        .dev-header {
            padding: 10px 14px; background: rgba(124,58,237,0.15); border-bottom: 1px solid #1e1e2e;
            display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
        }
        .dev-header span { color: #a78bfa; font-weight: 700; font-size: 12px; letter-spacing: 0.5px; }
        .dev-toggle-btn {
            background: none; border: 1px solid #7c3aed; color: #a78bfa; border-radius: 6px;
            padding: 2px 8px; font-size: 10px; cursor: pointer; font-family: 'DM Mono', monospace;
            transition: all 0.2s;
        }
        .dev-toggle-btn:hover { background: rgba(124,58,237,0.2); }
        .dev-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
        .dev-body::-webkit-scrollbar { width: 3px; }
        .dev-body::-webkit-scrollbar-thumb { background: #1e1e2e; }
        .dev-section { display: flex; flex-direction: column; gap: 4px; }
        .dev-section-title { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
        .dev-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
        .dev-label { color: #64748b; }
        .dev-value { color: #e2e8f0; text-align: right; }
        .dev-value.good  { color: #22c55e; }
        .dev-value.warn  { color: #f59e0b; }
        .dev-value.bad   { color: #ef4444; }
        .dev-value.accent { color: #a78bfa; }
        .dev-bar-wrap { height: 4px; background: #1e1e2e; border-radius: 4px; flex: 1; overflow: hidden; }
        .dev-bar { height: 100%; background: #7c3aed; border-radius: 4px; transition: width 0.3s; }
        .dev-prompt { background: #111118; border: 1px solid #1e1e2e; border-radius: 8px; padding: 8px; color: #64748b; font-size: 10px; line-height: 1.5; max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
        .dev-prompt::-webkit-scrollbar { width: 3px; }
        .dev-prompt::-webkit-scrollbar-thumb { background: #1e1e2e; }
        .dev-fab {
            position: fixed; bottom: 80px; right: 16px; width: 38px; height: 38px;
            background: rgba(124,58,237,0.9); border: none; border-radius: 10px; color: white;
            font-size: 16px; cursor: pointer; z-index: 998; display: none;
            align-items: center; justify-content: center; box-shadow: 0 0 14px rgba(124,58,237,0.5);
            transition: all 0.2s;
        }
        .dev-fab:hover { background: #7c3aed; transform: scale(1.05); }
        .dev-fab.visible { display: flex; }
        .dev-fab.panel-open { bottom: calc(70vh + 90px); }
        @media (max-width: 767px) {
            .dev-panel { bottom: 70px; width: calc(100vw - 32px); right: 16px; max-height: 60vh; }
            .dev-fab { bottom: 74px; }
            .dev-fab.panel-open { bottom: calc(60vh + 80px); }
        }
        @media (min-width: 768px) {
            .dev-panel { bottom: 16px; }
            .dev-fab { bottom: 16px; }
            .dev-fab.panel-open { bottom: calc(70vh + 30px); }
        }