UNPKG

claude-code-web

Version:

Web-based interface for Claude Code CLI accessible via browser

2,196 lines (1,888 loc) 42.2 kB
:root { --bg-primary: #0d1117; --bg-secondary: #161b22; --bg-tertiary: #21262d; --text-primary: #f0f6fc; --text-secondary: #8b949e; --accent: #58a6ff; --accent-hover: #4493e0; --success: #3fb950; --error: #f85149; --warning: #d29922; --border: #30363d; --border-hover: #484f58; --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace; } [data-theme="light"] { --bg-primary: #ffffff; --bg-secondary: #f6f8fa; --bg-tertiary: #f0f3f6; --text-primary: #24292f; --text-secondary: #656d76; --accent: #0969da; --accent-hover: #0860ca; --success: #1a7f37; --error: #cf222e; --warning: #9a6700; --border: #d0d7de; --border-hover: #bcc4ce; } * { box-sizing: border-box; margin: 0; padding: 0; } html { overflow-x: hidden; width: 100%; overscroll-behavior: none; /* Disable pull-to-refresh */ } body { font-family: var(--font-mono); background-color: var(--bg-primary); color: var(--text-primary); height: 100vh; height: 100dvh; /* Dynamic viewport height for mobile */ overflow: hidden; width: 100%; overscroll-behavior: none; /* Disable pull-to-refresh */ touch-action: pan-x pan-y; /* Allow normal scrolling but prevent browser gestures */ position: relative; } #app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; /* Dynamic viewport height for mobile */ max-height: 100vh; max-height: 100dvh; } /* Header styles removed - using tab-based interface */ /* Usage Stats Bar - Compact Single Line */ .usage-stats-bar { background-color: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 6px 12px; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 20px; font-size: 12px; height: 32px; overflow: hidden; } .usage-stat { display: flex; align-items: center; gap: 6px; } .stat-label { color: var(--text-secondary); font-size: 11px; } .stat-value { color: var(--text-primary); font-weight: 500; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; } /* Color coding for usage levels */ .stat-value.success { color: #3fb950; } .stat-value.warning { color: #ffa657; } .stat-value.danger { color: #ff7b72; } .usage-stats-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); } .usage-models { margin-bottom: 12px; } .model-usage { display: flex; justify-content: space-between; font-size: 11px; padding: 4px 0; } .model-name { color: var(--text-secondary); } .model-stats { color: var(--text-primary); } .usage-projections { display: flex; gap: 16px; flex-wrap: wrap; } .projection-item { display: flex; gap: 6px; font-size: 11px; } .projection-item span:first-child { color: var(--text-secondary); } .projection-item span:last-child { color: var(--text-primary); font-weight: 500; } /* Mobile optimizations */ @media (max-width: 768px) { .usage-stats-bar { padding: 3px 4px; gap: 4px; height: 24px; flex-wrap: nowrap !important; font-size: 9px; overflow-x: auto; overflow-y: hidden; } .usage-stat { gap: 2px; flex: 0 0 auto; white-space: nowrap; } /* Hide cost stat completely on mobile */ .usage-stat[data-label="Cost:"] { display: none !important; } .stat-label { display: none !important; } .stat-value { font-size: 9px; } /* Show abbreviated labels with values */ .usage-stat::before { content: attr(data-label); color: var(--text-secondary); font-size: 8px; margin-right: 1px; } } /* Even smaller screens */ @media (max-width: 480px) { .usage-stats-bar { padding: 2px 3px; gap: 3px; height: 20px; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; justify-content: space-between; align-items: center; } .usage-stat { display: inline-flex !important; align-items: center; gap: 1px; flex: 1 1 0; min-width: 0; max-width: 25%; } .usage-stat:last-child { justify-self: auto; } .stat-value { font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; } .usage-stat::before { font-size: 7px; } } /* Session Tabs Bar */ .session-tabs-bar { background-color: var(--bg-secondary); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; min-height: 36px; position: relative; overflow: visible; /* Ensure dropdown can overflow */ } .tabs-section { display: flex; align-items: center; flex: 1; overflow-x: auto; overflow-y: visible; /* Allow dropdown to overflow vertically */ scrollbar-width: thin; scrollbar-color: var(--border) transparent; } .tabs-section::-webkit-scrollbar { height: 4px; } .tabs-section::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 2px; } .tabs-container { display: flex; align-items: center; gap: 2px; padding: 4px 0; } .session-tab { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background-color: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px 6px 0 0; color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.3s ease; min-width: 120px; max-width: 200px; position: relative; user-select: none; } .session-tab:hover { background-color: var(--bg-primary); color: var(--text-primary); } .session-tab.active { background-color: var(--bg-primary); color: var(--text-primary); border-bottom-color: var(--bg-primary); } .session-tab.dragging { opacity: 0.5; } .tab-content { display: flex; align-items: center; gap: 6px; flex: 1; overflow: hidden; position: relative; } .tab-icon { width: 14px; height: 14px; flex-shrink: 0; } .tab-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: all 0.3s ease; position: relative; } .tab-status.active { background-color: var(--success); } .tab-status.idle { background-color: #3b82f6; /* Blue to indicate Claude likely finished */ animation: idle-gentle-pulse 3s infinite; } .tab-status.disconnected { background-color: var(--error); } .tab-status.error { background-color: var(--error); } /* Pulse animation for active sessions */ .tab-status.pulse { animation: pulse 2s infinite; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } } @keyframes idle-gentle-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.1); } } /* Unread indicator - changes status dot to blue */ .tab-status.unread { background-color: #3b82f6 !important; animation: unread-pulse 1.5s infinite; } @keyframes unread-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .session-tab.has-unread .tab-name { color: #3b82f6; font-weight: 600; } .tab-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tab-close { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 3px; opacity: 0; transition: opacity 0.2s; cursor: pointer; flex-shrink: 0; } .session-tab:hover .tab-close { opacity: 0.6; } .tab-close:hover { opacity: 1; background-color: var(--border); } .tab-new { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background-color: transparent; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; flex-shrink: 0; margin-left: 4px; } .tab-new:hover { background-color: var(--bg-tertiary); color: var(--text-primary); } .tab-settings { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background-color: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 4px; transition: all 0.2s; margin-left: auto; flex-shrink: 0; } .tab-settings:hover { background-color: var(--bg-tertiary); color: var(--text-primary); } /* Tab Overflow Dropdown for Mobile */ .tab-overflow-wrapper { position: relative; display: none; } .tab-overflow-btn { width: auto; height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background-color: transparent; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; margin-left: 4px; } .tab-overflow-btn:hover { background-color: var(--bg-tertiary); color: var(--text-primary); } .tab-overflow-count { font-size: 12px; font-weight: 600; } .tab-overflow-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; background-color: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); min-width: 200px; max-width: 300px; z-index: 10000; /* Higher z-index to ensure it appears above everything */ max-height: 400px; overflow-y: auto; } .tab-overflow-menu.active { display: block; } .overflow-tab-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; transition: background-color 0.2s; border-bottom: 1px solid var(--border); } .overflow-tab-item:last-child { border-bottom: none; } .overflow-tab-item:hover { background-color: var(--bg-tertiary); } .overflow-tab-item.active { background-color: var(--bg-tertiary); color: var(--accent); } .overflow-tab-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; } .overflow-tab-close { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 3px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; } .overflow-tab-close:hover { background-color: var(--error); color: white; } /* Mobile-specific styles */ @media (max-width: 768px) { /* Overflow wrapper visibility is controlled by JavaScript */ } /* Terminal Container */ .terminal-container { flex: 1; overflow: hidden; position: relative; display: flex; flex-direction: column; } .terminal-wrapper { flex: 1; overflow: hidden; position: relative; } /* Session Dropdown Styles - Hidden when using tabs */ .session-dropdown { position: relative; display: none; /* Hide dropdown when using tabs */ } .session-btn { display: flex; align-items: center; gap: 8px; } .session-btn svg { opacity: 0.8; } .dropdown-arrow { transition: transform 0.2s; } .session-dropdown-menu { position: absolute; top: 100%; right: 0; margin-top: 8px; background-color: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); min-width: 320px; max-width: 400px; z-index: 1000; display: none; } .session-dropdown-menu.active { display: block; } .session-dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; } .session-dropdown-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); } .session-list { max-height: 300px; overflow-y: auto; } .session-item { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: background-color 0.2s; } .session-item:hover { background-color: var(--bg-tertiary); } .session-item.active { background-color: var(--bg-tertiary); border-left: 3px solid var(--accent); padding-left: 13px; } .session-info { display: flex; align-items: center; gap: 12px; flex: 1; } .session-status { font-size: 10px; } .session-details { flex: 1; } .session-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; } .session-meta { font-size: 11px; color: var(--text-secondary); } .session-folder { font-size: 11px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; } .session-actions { display: flex; gap: 4px; } .no-sessions { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 13px; } .session-dropdown-footer { padding: 12px 16px; border-top: 1px solid var(--border); } /* Session Modal Styles */ .session-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 2000; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); } .session-modal.active { display: flex; } .session-modal .modal-content { background-color: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border); width: 90%; max-width: 480px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .form-group { margin-bottom: 16px; } .form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-primary); } .form-group input { width: 100%; padding: 8px 12px; background-color: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; } .form-group input:focus { outline: none; border-color: var(--accent); } .btn-small { padding: 6px 12px; font-size: 12px; } .btn-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; } .btn-icon:hover { color: var(--text-primary); background-color: var(--bg-tertiary); } .btn { padding: 6px 12px; border: 1px solid var(--border); background-color: var(--bg-tertiary); color: var(--text-primary); border-radius: 6px; cursor: pointer; font-family: var(--font-mono); font-size: 12px; font-weight: 500; transition: all 0.2s ease; } .btn:hover:not(:disabled) { background-color: var(--bg-secondary); border-color: var(--border-hover); } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn-primary { background-color: var(--accent); color: white; border-color: var(--accent); } .btn-primary:hover:not(:disabled) { background-color: var(--accent-hover); border-color: var(--accent-hover); } .btn-secondary { background-color: var(--bg-tertiary); border-color: var(--border); } .btn-danger { background-color: var(--error); color: white; border-color: var(--error); } .btn-danger:hover:not(:disabled) { background-color: #d73a49; border-color: #d73a49; } .btn-danger-skip { width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; background-color: #8b0000; color: white; border: 2px solid #660000; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; } .btn-danger-skip:hover { background-color: #a00000; border-color: #800000; box-shadow: 0 0 10px rgba(139, 0, 0, 0.5); } .btn-danger-skip svg { width: 24px; height: 24px; } .main { flex: 1; display: flex; overflow: hidden; } .terminal-container { flex: 1; position: relative; background-color: var(--bg-primary); width: 100%; overflow: hidden; } #terminal { width: 100%; height: 100%; padding: 16px; box-sizing: border-box; } .terminal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(13, 17, 23, 0.95); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); } .overlay-content { text-align: center; padding: 40px; background-color: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border); max-width: 520px; } .loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 16px; } .spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top: 3px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .start-prompt h2 { margin-bottom: 12px; color: var(--text-primary); } .start-prompt p { margin-bottom: 20px; color: var(--text-secondary); line-height: 1.5; } .start-buttons { display: flex; gap: 12px; align-items: stretch; justify-content: center; flex-wrap: wrap; } .start-buttons .btn { min-width: 180px; } .error-message h3 { color: var(--error); margin-bottom: 12px; } .error-message p { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; } .settings-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.7); display: none; align-items: center; justify-content: center; z-index: 1000; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); } .settings-modal.active { display: flex; } .modal-content { background-color: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border); width: 400px; max-width: 90vw; max-height: 80vh; overflow-y: auto; position: relative; margin: 20px auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); } .modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; } .modal-header h2 { font-size: 18px; font-weight: 600; } .close-btn, .modal-close { background: none; border: none; font-size: 24px; color: var(--text-secondary); cursor: pointer; padding: 0; min-width: 44px; min-height: 44px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 4px; -webkit-tap-highlight-color: transparent; } .close-btn:hover { background-color: var(--bg-tertiary); color: var(--text-primary); } .modal-body { padding: 20px; } .setting-group { margin-bottom: 20px; display: flex; align-items: center; gap: 12px; } .setting-group label { flex: 0 0 auto; width: 100px; font-weight: 500; font-size: 14px; } .setting-group input[type="range"] { flex: 1; height: 4px; background: var(--border); outline: none; border-radius: 2px; } .setting-group input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: var(--accent); cursor: pointer; border-radius: 50%; } .setting-group select { flex: 1; padding: 6px 12px; background-color: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; font-family: var(--font-mono); } .setting-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); } #fontSizeValue { flex: 0 0 auto; width: 40px; font-size: 12px; color: var(--text-secondary); } .modal-footer { padding: 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; } /* Plan Modal Styles */ .plan-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.75); z-index: 10001; animation: fadeIn 0.3s ease; } .plan-modal.active { display: flex; align-items: center; justify-content: center; } .plan-modal .modal-content { background-color: var(--bg-secondary); border-radius: 12px; width: 90%; max-width: 800px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .plan-modal .modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; } .plan-modal .modal-header h2 { margin: 0; color: var(--text-primary); font-size: 1.5rem; } .plan-modal .modal-body { flex: 1; padding: 20px; overflow-y: auto; } .plan-status { display: flex; align-items: center; gap: 10px; padding: 10px 15px; background-color: var(--bg-tertiary); border-radius: 8px; margin-bottom: 20px; } .plan-status-indicator { width: 10px; height: 10px; border-radius: 50%; background-color: #10b981; animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .plan-status-text { color: var(--text-secondary); font-size: 0.9rem; } .plan-content { background-color: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; padding: 20px; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; color: var(--text-primary); } .plan-content h2 { color: var(--accent); font-size: 1.2rem; margin: 1rem 0; } .plan-content h3 { color: var(--text-primary); font-size: 1rem; margin: 0.8rem 0; } .plan-content ul, .plan-content ol { margin: 0.5rem 0 0.5rem 1.5rem; } .plan-content li { margin: 0.3rem 0; } .plan-content code { background-color: var(--bg-tertiary); padding: 2px 6px; border-radius: 3px; color: var(--accent); } .plan-content pre { background-color: var(--bg-tertiary); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 10px 0; } .plan-modal .modal-footer { padding: 20px; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 15px; } .plan-modal .btn { padding: 10px 30px; font-size: 1rem; font-weight: 600; } .plan-modal .btn-success { background-color: #10b981; color: white; } .plan-modal .btn-success:hover { background-color: #059669; } .plan-modal .btn-danger { background-color: #ef4444; color: white; } .plan-modal .btn-danger:hover { background-color: #dc2626; } /* Legacy mobile styles - removed in favor of comprehensive mobile styles section below */ .xterm .xterm-viewport { background-color: transparent !important; overflow-y: auto !important; overflow-x: hidden !important; } .xterm .xterm-screen { background-color: transparent !important; } /* Fix xterm canvas width on mobile */ .xterm { width: 100%; height: 100%; } .xterm-screen canvas { max-width: 100%; } /* Fix scrollbar extending beyond viewport */ .xterm-viewport::-webkit-scrollbar { width: 10px; height: 10px; } .xterm-viewport::-webkit-scrollbar-track { background: var(--bg-secondary); } .xterm-viewport::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; } .xterm-viewport::-webkit-scrollbar-thumb:hover { background: var(--border-hover); } /* Folder Browser Modal */ .folder-browser-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); } .folder-browser-modal.active { display: flex; align-items: center; justify-content: center; } .folder-browser-content { width: 90%; max-width: 700px; max-height: 80vh; display: flex; flex-direction: column; } .folder-browser-body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 20px; gap: 16px; overflow: hidden; } .folder-path-bar { display: flex; gap: 8px; align-items: center; } .btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 8px; background-color: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; transition: all 0.2s ease; min-width: 36px; height: 36px; } .btn-icon:hover { background-color: var(--accent); color: white; border-color: var(--accent); } .btn-icon:disabled { opacity: 0.5; cursor: not-allowed; } .btn-icon:disabled:hover { background-color: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); } .folder-path-input { flex: 1; padding: 8px 12px; background-color: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; font-family: var(--font-mono); font-size: 13px; } .folder-create-bar { display: flex; gap: 8px; align-items: center; padding: 12px; background-color: var(--bg-tertiary); border: 1px solid var(--accent); border-radius: 4px; } .folder-name-input { flex: 1; padding: 8px 12px; background-color: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; font-family: var(--font-mono); font-size: 13px; } .folder-name-input:focus { outline: none; border-color: var(--accent); } .btn-small { padding: 6px 12px; font-size: 12px; } .folder-list-container { flex: 1; min-height: 200px; max-height: 400px; border: 1px solid var(--border); border-radius: 4px; background-color: var(--bg-tertiary); overflow: hidden; display: flex; flex-direction: column; } .folder-list { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; } .folder-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 4px; background-color: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; transition: all 0.2s ease; font-size: 14px; } .folder-item:hover { background-color: var(--accent); color: white; border-color: var(--accent); } .folder-icon { flex-shrink: 0; width: 20px; height: 20px; } .folder-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .folder-browser-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); } .checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; } .checkbox-label input[type="checkbox"] { cursor: pointer; } .folder-browser-buttons { display: flex; gap: 8px; } .empty-folder-message { padding: 40px; text-align: center; color: var(--text-secondary); font-size: 14px; } /* Mobile Menu Styles */ .hamburger-btn { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-width: 44px; min-height: 44px; width: 44px; height: 44px; background: transparent; border: none; cursor: pointer; padding: 10px; margin: 0; border-radius: 4px; -webkit-tap-highlight-color: transparent; transition: background-color 0.2s ease; } .hamburger-btn:hover { background-color: var(--bg-tertiary); } .hamburger-line { display: block; width: 24px; height: 2px; background-color: var(--text-primary); border-radius: 2px; transition: all 0.3s ease; } .hamburger-btn.active .hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); } .hamburger-btn.active .hamburger-line:nth-child(2) { opacity: 0; } .hamburger-btn.active .hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); } .mobile-menu { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background-color: var(--bg-secondary); border-right: 1px solid var(--border); z-index: 3000; transition: left 0.3s ease; display: flex; flex-direction: column; } .mobile-menu.active { left: 0; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3); } .mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); } .mobile-menu-header h2 { font-size: 18px; font-weight: 600; margin: 0; } .close-menu-btn { background: transparent; border: none; color: var(--text-primary); font-size: 28px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; } .mobile-menu-content { padding: 20px; display: flex; flex-direction: column; gap: 12px; } .mobile-menu-btn { padding: 12px 16px; background-color: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-family: var(--font-mono); font-size: 14px; font-weight: 500; transition: all 0.2s ease; text-align: left; } .mobile-menu-btn:hover:not(:disabled) { background-color: var(--accent); color: white; border-color: var(--accent); } .mobile-menu-btn:disabled { opacity: 0.5; cursor: not-allowed; } .mobile-menu-btn.btn-danger { background-color: var(--error); color: white; border-color: var(--error); } .mobile-menu-btn.btn-danger:hover:not(:disabled) { background-color: #d73a49; border-color: #d73a49; } .desktop-only { display: block; } /* Ensure pre-formatted text and code blocks wrap properly */ pre, code { word-wrap: break-word; white-space: pre-wrap; overflow-wrap: break-word; } /* Mobile Modal Fixes */ @media (max-width: 768px) { /* Base modal fixes */ .settings-modal, .session-modal, .folder-browser-modal { padding: 10px; align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; } .modal-content { width: calc(100% - 20px); max-width: none; max-height: calc(100vh - 20px); margin: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; } .folder-browser-content { width: calc(100% - 20px); max-width: none; max-height: calc(100vh - 20px); height: auto; } .modal-header { padding: 15px; position: sticky; top: 0; background-color: var(--bg-secondary); z-index: 10; } .modal-body { padding: 15px; } .modal-footer { padding: 15px; position: sticky; bottom: 0; background-color: var(--bg-secondary); z-index: 10; gap: 10px; } /* Ensure buttons in modals are touch-friendly */ .modal-footer .btn { min-height: 44px; padding: 12px 20px; } /* Fix folder browser specific issues */ .folder-list-container { max-height: 40vh; overflow-y: auto; -webkit-overflow-scrolling: touch; } .folder-item { min-height: 44px; padding: 12px; } /* Session modal fixes */ .session-list { max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; } .session-item { min-height: 44px; padding: 10px; } /* Ensure close buttons are easily tappable */ .close-btn, .modal-close { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); } } /* Mobile Responsive Styles */ @media (max-width: 768px) { .hamburger-btn { display: flex; flex-shrink: 0; } .desktop-only { display: none !important; } .header { padding: 8px 12px; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 0; flex-shrink: 0; min-height: 44px; } .header-content { flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; min-width: 0; } .header-info { display: flex; flex-direction: row; gap: 8px; align-items: center; justify-content: flex-end; } .status { font-size: 11px; padding: 2px 6px; white-space: nowrap; } .working-dir { font-size: 11px; padding: 2px 6px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .header-controls { display: none; } .main { flex: 1; overflow: hidden; } .terminal-container { padding: 0; width: 100%; height: 100%; overflow: hidden; } #terminal { padding: 8px; width: 100%; height: 100%; box-sizing: border-box; } /* Force xterm to respect mobile viewport */ .xterm { width: 100% !important; height: 100% !important; } .xterm-viewport { width: 100% !important; overflow-x: hidden !important; overflow-y: auto !important; } .xterm-screen { width: 100% !important; } .overlay-content { padding: 20px; max-width: 90%; } .start-prompt h2 { font-size: 20px; } .start-prompt p { font-size: 14px; } /* Modal styles are handled in the Mobile Modal Fixes section above */ } /* Extra small devices (phones in portrait) */ @media (max-width: 480px) { .header { padding: 6px 8px; display: flex; flex-direction: row; align-items: center; } .hamburger-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 8px; } .header-info { gap: 6px; } .status { font-size: 10px; padding: 1px 4px; } .working-dir { font-size: 10px; padding: 1px 4px; max-width: 120px; } .btn { padding: 8px 12px; font-size: 11px; } .start-buttons { flex-direction: column; width: 100%; } .start-buttons .btn { width: 100%; } /* Extra terminal fixes for very small screens */ #terminal { padding: 4px; } /* Ensure modals don't overflow */ .modal-content { max-height: 85vh; overflow-y: auto; } /* Adjust main container */ .main { padding: 0; margin: 0; } body { overflow-x: hidden; } } /* Mode Switcher Styles */ .mode-switcher { position: fixed; bottom: 80px; /* Increased from 20px to avoid covering text input */ right: 20px; z-index: 1000; display: none; flex-direction: column; gap: 10px; } /* Show mode switcher on mobile devices */ @media (max-width: 1024px) and (hover: none) and (pointer: coarse), (max-width: 768px) { .mode-switcher { display: flex; } } .mode-switcher-btn { display: flex; align-items: center; justify-content: center; padding: 12px; background-color: var(--bg-secondary); color: var(--text-primary); border: 2px solid var(--border); border-radius: 50%; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; width: 56px; height: 56px; } .mode-switcher-btn:hover { background-color: var(--bg-tertiary); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); } .mode-switcher-btn:active { transform: translateY(0); } .mode-switcher-btn.switching { animation: modeSwitchPulse 0.3s ease; } @keyframes modeSwitchPulse { 0% { transform: scale(1); } 50% { transform: scale(0.95); background-color: var(--accent); } 100% { transform: scale(1); } } .mode-switcher-btn svg { width: 24px; height: 24px; stroke: var(--accent); flex-shrink: 0; } /* Add visual indicator for current mode */ .mode-switcher-btn[data-mode="chat"] { border-color: var(--success); } .mode-switcher-btn[data-mode="code"] { border-color: var(--accent); } .mode-switcher-btn[data-mode="plan"] { border-color: var(--warning); } /* Escape Button Styles */ .escape-btn { display: flex; align-items: center; justify-content: center; padding: 12px; background-color: var(--bg-secondary); color: var(--text-primary); border: 2px solid var(--error); border-radius: 50%; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; width: 56px; height: 56px; } .escape-btn:hover { background-color: var(--bg-tertiary); border-color: #ff4444; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 68, 68, 0.2); } .escape-btn:active { transform: translateY(0); } .escape-btn.pressed { animation: escapeBtnPress 0.2s ease; } @keyframes escapeBtnPress { 0% { transform: scale(1); } 50% { transform: scale(0.9); background-color: var(--error); } 100% { transform: scale(1); } } .escape-btn svg { width: 24px; height: 24px; stroke: var(--error); flex-shrink: 0; } /* Usage Progress Bar */ .usage-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; } .usage-progress-bar { height: 100%; background: linear-gradient(90deg, #3fb950, #56d364); /* Green for normal usage */ transition: width 0.3s ease, background 0.3s ease; width: 0%; } .usage-progress-bar.success { background: linear-gradient(90deg, #3fb950, #56d364); /* Green */ } .usage-progress-bar.warning { background: linear-gradient(90deg, #ffa657, #ffdf5d); /* Yellow */ } .usage-progress-bar.danger { background: linear-gradient(90deg, #ff7b72, #ffa198); /* Red */ } .usage-progress-text { display: none; /* Hidden by default, shown on hover */ position: absolute; right: 5px; top: -20px; font-size: 10px; color: rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.8); padding: 2px 5px; border-radius: 3px; } .usage-progress:hover .usage-progress-text { display: block; } /* Commands menu button ("/") anchored in editor */ .commands-menu { position: absolute; /* Within .terminal-container */ top: 12px; right: 12px; z-index: 5; } .commands-button { background: #1f2937; color: #f3f4f6; border: 1px solid #374151; border-radius: 20px; width: 36px; height: 36px; font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 600; line-height: 36px; text-align: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.25); } .commands-button:hover { background: #111827; } .commands-dropdown { position: absolute; top: 42px; right: 0; width: 280px; max-height: 320px; overflow: auto; background: #0f172a; color: #e5e7eb; border: 1px solid #334155; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); display: none; } .commands-dropdown.open { display: block; } .commands-item { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; } .commands-item:last-child { border-bottom: none; } .commands-item:hover { background: rgba(255,255,255,0.06); } .commands-empty, .commands-error { padding: 10px 12px; color: #9ca3af; } /* Custom command modal */ .commands-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.7); display: none; align-items: center; justify-content: center; z-index: 1001; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); } .commands-modal.active { display: flex; } .commands-modal .modal-content { width: 640px; max-width: 92vw; } .commands-textarea { width: 100%; min-height: 220px; resize: vertical; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }