    :root {
      /* Your Mobile Marine - Light Theme */
      --bg-primary: #f8fafc;
      --bg-secondary: #ffffff;
      --bg-tertiary: #f1f5f9;
      --bg-elevated: #ffffff;
      --bg-hover: #e2e8f0;
      --border: #e2e8f0;
      --border-subtle: #f1f5f9;
      --text-primary: #1e293b;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --accent: #0284c7;
      --accent-hover: #0369a1;
      --accent-subtle: rgba(2, 132, 199, 0.1);
      --success: #16a34a;
      --success-subtle: rgba(22, 163, 74, 0.1);
      --warning: #d97706;
      --warning-subtle: rgba(217, 119, 6, 0.1);
      --error: #dc2626;
      --penn-navy: #0c4a6e;
      --penn-gold: #0284c7;
      --penn-gold-subtle: rgba(2, 132, 199, 0.1);
    }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); height: 100vh; overflow: hidden; }
    
    .app { display: grid; grid-template-columns: 1fr 380px; grid-template-rows: 52px 1fr; height: 100vh; max-height: 100vh; overflow: hidden; }
    
    /* Header */
    .header { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-subtle); }
    .logo { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
    .logo-icon { font-size: 22px; filter: drop-shadow(0 0 2px var(--accent)); }
    .header-right { display: flex; align-items: center; gap: 12px; }
    .datetime { text-align: right; }
    .time { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
    .date { color: var(--text-muted); font-size: 11px; }
    .status-pill { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--bg-tertiary); border-radius: 6px; font-size: 11px; }
    .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
    .status-dot.disconnected { background: var(--error); }
    .status-dot.connecting { background: var(--warning); animation: pulse 1s infinite; }
    @keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

    /* Main */
    .main { display: flex; flex-direction: column; background: var(--bg-secondary); border-right: 1px solid var(--border-subtle); min-height: 0; overflow: hidden; }
    .tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-tertiary); }
    .tab { padding: 6px 14px; font-size: 12px; font-weight: 500; color: var(--text-muted); background: none; border: none; border-radius: 5px; cursor: pointer; }
    .tab:hover { color: var(--text-secondary); }
    .tab.active { background: var(--bg-secondary); color: var(--accent); }
    .panel { display: none; flex: 1; overflow: hidden; min-height: 0; }
    .panel.active { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

    /* Chat */
    .chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
    .chat-messages::-webkit-scrollbar { width: 5px; }
    .chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .chat-messages::-webkit-scrollbar-track { background: transparent; }
    #panel-chat { min-height: 0; overflow: hidden; }
    .chat-input-area { flex-shrink: 0; }
    .message { max-width: 85%; animation: slideIn 0.2s; }
    @keyframes slideIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
    .message.user { align-self: flex-end; }
    .message.assistant { align-self: flex-start; }
    .message-meta { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; padding: 0 4px; }
    .message.user .message-meta { text-align: right; }
    .message-bubble { padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
    .message.user .message-bubble { background: var(--penn-navy); color: var(--text-primary); border-bottom-right-radius: 4px; }
    .message.assistant .message-bubble { background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-bottom-left-radius: 4px; }
    .typing-indicator { display: flex; gap: 4px; padding: 10px 14px; background: var(--bg-tertiary); border-radius: 12px; width: fit-content; }
    .typing-indicator span { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.4s infinite; }
    .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
    .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes bounce { 0%,60%,100% { transform:translateY(0); } 30% { transform:translateY(-4px); } }
    .chat-input-area { padding: 10px 12px; background: var(--bg-tertiary); border-top: 1px solid var(--border-subtle); }
    .input-wrapper { display: flex; gap: 8px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
    .input-wrapper:focus-within { border-color: var(--accent); }
    .chat-input { flex: 1; background: none; border: none; padding: 8px 10px; color: var(--text-primary); font-size: 13px; font-family: inherit; resize: none; outline: none; }
    .chat-input::placeholder { color: var(--text-muted); }
    .send-btn { background: var(--penn-navy); border: none; border-radius: 6px; padding: 8px 14px; color: var(--text-primary); font-weight: 500; font-size: 12px; cursor: pointer; }
    .send-btn:hover { background: #2A4A70; }
    .welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 30px; }
    .welcome-icon { font-size: 56px; margin-bottom: 16px; }
    .welcome-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
    .welcome-subtitle { color: var(--text-secondary); font-size: 13px; }

    /* Files */
    .files-layout { display: flex; height: 100%; }
    .file-list { width: 200px; border-right: 1px solid var(--border-subtle); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; }
    .file-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; margin-bottom: 3px; }
    .file-item:hover { background: var(--bg-hover); }
    .file-item.active { background: var(--penn-gold-subtle); color: var(--accent); }
    .file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .file-date { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
    .file-section { margin-bottom: 16px; }
    .file-section-header { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); padding: 8px 10px 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
    .file-search { width: calc(100% - 12px); background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text-primary); font-size: 12px; margin: 6px; outline: none; position: sticky; top: 0; z-index: 10; }
    .file-search:focus { border-color: var(--accent); }
    .file-search::placeholder { color: var(--text-muted); }
    #memoryFileList { max-height: calc(100vh - 280px); overflow-y: auto; }
    .file-empty { font-size: 11px; color: var(--text-muted); padding: 12px 10px; text-align: center; }
    .editor-wrap { flex: 1; display: flex; flex-direction: column; }
    .editor-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-tertiary); }
    .editor-title { font-size: 13px; font-weight: 600; }
    .editor-btns { display: flex; gap: 6px; }
    .editor-btn { padding: 5px 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 5px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
    .editor-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
    .editor-btn.save { background: var(--accent); border-color: var(--accent); color: white; }
    .editor-btn.save:hover { background: var(--accent-hover); }
    .editor-content { flex: 1; overflow: auto; padding: 12px; }
    .editor-textarea { width: 100%; height: 100%; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 12px; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; resize: none; outline: none; }
    .editor-textarea:focus { border-color: var(--accent); }

    /* Sidebar */
    .sidebar { background: var(--bg-primary); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
    .sidebar-header { padding: 12px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
    .sidebar-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
    .refresh-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; }
    .refresh-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
    .sidebar-content { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
    .sidebar-content::-webkit-scrollbar { width: 5px; }
    .sidebar-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .sidebar-content::-webkit-scrollbar-track { background: transparent; }

    /* Cards */
    /* Usage graph */
    /* Status footer */
    .status-footer { background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 10px 12px; margin-top: 16px; font-size: 11px; }
    .status-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
    .status-label { color: var(--text-muted); }
    .status-value { color: var(--text-secondary); font-weight: 500; }
    .footer-busy-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); margin-right: 4px; vertical-align: middle; }
    .footer-busy-dot.thinking { background: var(--accent); animation: pulse 0.8s infinite; }
    .usage-chart-area { margin-top: 8px; }
    .usage-gauge-mini { height: 4px; background: var(--bg-primary); border-radius: 2px; overflow: hidden; margin-top: 4px; }
    .usage-gauge-mini .usage-fill { height: 100%; border-radius: 2px; }
    .usage-fill.low { background: var(--text-muted); }
    .usage-fill.medium { background: var(--warning); }
    .usage-fill.high { background: var(--error); }
    .usage-sparkline { height: 20px; position: relative; }
    .usage-sparkline svg { width: 100%; height: 100%; }
    .usage-sparkline .axis { stroke: var(--border); stroke-width: 1; opacity: 0.3; }
    .usage-sparkline path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }
    
    /* Content blocks */
    .content-block { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
    .content-block.projects-block { background: var(--bg-tertiary); }
    .content-block.tasks-block { background: var(--bg-secondary); }
    .block-header { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); }
    .content-block .section { margin-bottom: 8px; }
    .content-block .section:last-child { margin-bottom: 0; }
    .today-item { display: flex; gap: 8px; font-size: 12px; margin-bottom: 6px; padding: 6px 8px; background: var(--bg-secondary); border-radius: 4px; }
    .today-time { font-weight: 600; color: var(--accent); min-width: 55px; }
    .section { margin-bottom: 18px; }
    .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; cursor: pointer; user-select: none; padding: 4px 0; border-radius: 4px; }
    .section-header:hover { background: var(--bg-hover); margin: 0 -4px; padding: 4px; margin-bottom: 8px; }
    .section-title { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
    .section-chevron { transition: transform 0.2s ease; font-size: 8px; }
    .section.collapsed .section-chevron { transform: rotate(-90deg); }
    .section-count { font-size: 10px; background: var(--accent-subtle); color: var(--accent); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
    .section-content { overflow: hidden; transition: max-height 0.3s ease, opacity 0.2s ease; }
    .section.collapsed .section-content { max-height: 0 !important; opacity: 0; margin: 0; }
    .task-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 8px; margin-bottom: 8px; font-size: 12px; }
    .task-title { font-weight: 500; line-height: 1.4; display: flex; align-items: center; gap: 6px; }
    .task-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
    .task-status { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
    .task-priority-high { color: var(--error); }
    .task-check { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; flex-shrink: 0; margin-top: 1px; transition: all 0.15s; }
    .task-check:hover { border-color: var(--accent); background: var(--accent-dim); }
    .task-check { width: 14px; height: 14px; border: 2px solid var(--border); border-radius: 3px; cursor: pointer; flex-shrink: 0; margin-top: 1px; }
    .task-check:hover { border-color: var(--accent); }
    .task-title { font-weight: 500; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
    .task-title:hover { color: var(--accent); }
    .status-badge { font-size: 9px; padding: 1px 6px; border-radius: 3px; color: white; font-weight: 500; white-space: nowrap; }
    .task-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
    .task-description { display: none; font-size: 11px; color: var(--text-secondary); margin-top: 8px; padding: 8px; background: var(--bg-tertiary); border-radius: 4px; line-height: 1.5; white-space: pre-wrap; }
    .task-item.expanded .task-description { display: block; }
    .task-item.expanded { background: var(--bg-tertiary); border-color: var(--border); }
    .task-actions { display: flex; gap: 4px; align-items: center; margin-left: auto; flex-shrink: 0; }
    .task-link { color: var(--text-muted); font-size: 12px; padding: 4px 6px; opacity: 0.6; text-decoration: none; border-radius: 4px; }
    .task-link:hover { opacity: 1; background: var(--bg-hover); color: var(--accent); }
    .waiting-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 6px; margin-bottom: 5px; font-size: 10px; }
    .waiting-avatar { width: 24px; height: 24px; background: var(--bg-elevated); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: var(--text-secondary); }
    .waiting-name { font-weight: 500; }
    .waiting-for { color: var(--text-muted); font-size: 10px; }
    .project-item { padding: 8px 10px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 6px; margin-bottom: 5px; cursor: pointer; transition: border-color 0.2s; }
    .project-item:hover { border-color: var(--border); }
    .project-name { font-size: 11px; font-weight: 500; }
    .project-meta { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
    .quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .quick-btn { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 10px 8px; text-align: center; cursor: pointer; }
    .quick-btn:hover { border-color: var(--accent); background: var(--bg-tertiary); }
    .quick-icon { font-size: 18px; margin-bottom: 3px; }
    .quick-label { font-size: 10px; font-weight: 500; color: var(--text-secondary); }
    .loading { display: flex; align-items: center; justify-content: center; padding: 30px; color: var(--text-muted); font-size: 12px; }

    /* Modal */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 100; }
    .modal-overlay.hidden { display: none; }
    .modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 20px; max-width: 360px; width: 90%; }
    .modal-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; text-align: center; }
    .modal-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; text-align: center; }
    .modal-input { width: 100%; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--text-primary); font-size: 13px; font-family: 'JetBrains Mono', monospace; margin-bottom: 10px; outline: none; }
    .modal-input:focus { border-color: var(--accent); }
    .modal-btn { width: 100%; background: var(--penn-navy); border: none; border-radius: 6px; padding: 10px; color: var(--text-primary); font-weight: 500; cursor: pointer; }
    .modal-btn:hover { background: #2A4A70; }

    /* Debug */
    .debug-panel { font-size: 10px; color: var(--text-muted); padding: 4px 12px; background: var(--bg-tertiary); border-top: 1px solid var(--border-subtle); }

    /* Activity Feed */
    .activity-section { border-top: 1px solid var(--border-subtle); margin-top: 12px; padding-top: 12px; }
    .activity-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
    .activity-filters { display: flex; gap: 4px; }
    .activity-filter { padding: 3px 8px; font-size: 10px; background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: 4px; color: var(--text-muted); cursor: pointer; }
    .activity-filter.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
    .activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 11px; }
    .activity-item:last-child { border-bottom: none; }
    .activity-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
    .activity-icon.complete { background: var(--success-subtle); color: var(--success); }
    .activity-icon.update { background: var(--accent-subtle); color: var(--accent); }
    .activity-icon.alert { background: var(--warning-subtle); color: var(--warning); }
    .activity-content { flex: 1; }
    .activity-text { color: var(--text-primary); }
    .activity-time { color: var(--text-muted); font-size: 10px; margin-top: 2px; }

    /* Checkbox Animation */
    .task-check { position: relative; transition: all 0.2s ease; }
    .task-check.completing { border-color: var(--success); background: var(--success); animation: checkPop 0.4s ease; }
    .task-check.completing::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 10px; font-weight: bold; }
    @keyframes checkPop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
    
    /* Confetti */
    .confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; overflow: hidden; }
    .confetti { position: absolute; font-size: 10px; pointer-events: none; }
    
    /* Task complete strikethrough */
    .task-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
    .task-item.completed { opacity: 0.6; transition: opacity 0.3s, transform 0.3s; }
    .task-item.removing { transform: translateX(20px); opacity: 0; }

    /* Agents Panel */
    .agents-container { padding: 16px; height: 100%; overflow-y: auto; min-height: 0; }
    #panel-agents { min-height: 0; overflow: hidden; }
    .agents-list { overflow-y: auto; max-height: calc(100vh - 180px); }
    .agents-list::-webkit-scrollbar { width: 5px; }
    .agents-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .agents-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
    .agents-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; }
    .agent-card { background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px; margin-bottom: 12px; transition: border-color 0.2s; }
    .agent-card:hover { border-color: var(--border); }
    .agent-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .agent-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
    .agent-icon.main { background: var(--penn-gold-subtle); }
    .agent-icon.subagent { background: var(--accent-subtle); }
    .agent-icon.cron { background: var(--warning-subtle); }
    .agent-info { flex: 1; }
    .agent-name { font-weight: 600; font-size: 13px; }
    .agent-type { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
    .agent-status { display: flex; align-items: center; gap: 5px; font-size: 11px; }
    .agent-status-dot { width: 6px; height: 6px; border-radius: 50%; }
    .agent-status-dot.active { background: var(--success); }
    .agent-status-dot.idle { background: var(--text-muted); }
    .agent-meta { font-size: 11px; color: var(--text-secondary); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
    .agent-meta-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
    .agent-meta-label { color: var(--text-muted); }
    .agent-task { background: var(--bg-elevated); padding: 8px 10px; border-radius: 6px; margin-top: 8px; font-size: 11px; color: var(--text-secondary); }
    .agent-task-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
    .agent-context { margin: 8px 0; padding: 8px 10px; background: var(--bg-tertiary); border-radius: 6px; border-left: 2px solid var(--accent); }
    .agent-context-item { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
    .agent-context-item:last-child { margin-bottom: 0; }
    .agent-last-msg { background: var(--bg-elevated); padding: 8px 10px; border-radius: 6px; margin-top: 8px; }
    .agent-last-msg-text { font-size: 11px; color: var(--text-secondary); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Mobile toggle button */
    .mobile-nav { display: none; }
    .mobile-toggle { 
      display: none; 
      position: fixed; 
      top: 33vh; 
      right: 0; 
      width: 32px; 
      height: 48px; 
      border-radius: 8px 0 0 8px; 
      background: var(--bg-tertiary); 
      border: 1px solid var(--border);
      border-right: none;
      color: var(--text-secondary); 
      font-size: 14px; 
      cursor: pointer; 
      z-index: 100; 
      transition: all 0.2s ease;
    }
    .mobile-toggle:active { transform: scale(0.95); }
    .mobile-toggle.open { background: var(--accent); border-color: var(--accent); color: var(--bg-primary); }

    /* Mobile Responsive */
    @media (max-width: 768px) {
      .app { 
        grid-template-columns: 1fr; 
        grid-template-rows: 52px 1fr; 
      }
      
      .header { padding: 0 12px; }
      .logo .logo-badge { display: none; }
      .datetime { display: none; }
      
      .main { border-right: none; }
      .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .tab { white-space: nowrap; padding: 8px 12px; }
      
      .sidebar { 
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 85%; 
        max-width: 340px;
        height: 100vh; 
        z-index: 99; 
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.4);
      }
      .sidebar.open { right: 0; }
      
      .mobile-toggle { display: flex; align-items: center; justify-content: center; }
      .mobile-nav { display: block; }
      
      .sidebar-header { 
        padding: 16px; 
        display: flex; 
        align-items: center; 
        justify-content: space-between;
      }
      .close-sidebar { 
        background: none; 
        border: none; 
        color: var(--text-secondary); 
        font-size: 24px; 
        cursor: pointer; 
        padding: 4px 8px;
      }
      
      /* Chat adjustments */
      .chat-messages { padding: 10px; }
      .message { max-width: 90%; }
      .message-bubble { padding: 10px 14px; font-size: 14px; }
      .chat-input { font-size: 16px; padding: 12px; }
      .send-btn { padding: 12px 18px; font-size: 14px; }
      
      /* Files - stack vertically */
      .files-layout { flex-direction: column; }
      .file-list { width: 100%; max-height: 150px; border-right: none; border-bottom: 1px solid var(--border-subtle); }
      
      /* Task items - larger touch targets */
      .task-item { padding: 12px; }
      .task-check { width: 20px; height: 20px; }
      .task-title { font-size: 14px; }
      
      .project-item { padding: 12px; }
      .quick-btn { padding: 14px 10px; }
      .quick-icon { font-size: 22px; }
      
      /* Agents panel */
      .agents-container { padding: 12px; }
      .agent-card { padding: 16px; }
      
      /* Welcome screen */
      .welcome-icon { font-size: 48px; }
      .welcome-title { font-size: 18px; }
      
      /* Debug panel hidden on mobile */
      .debug-panel { display: none; }
      
      /* Overlay when sidebar open */
      .sidebar-overlay { 
        display: none; 
        position: fixed; 
        inset: 0; 
        background: rgba(0,0,0,0.5); 
        z-index: 98; 
      }
      .sidebar-overlay.open { display: block; }
    }
    
    @media (max-width: 400px) {
      .header { padding: 0 8px; }
      .status-pill span:not(.status-dot) { display: none; }
      .tab { padding: 8px 10px; font-size: 11px; }
      .section-title { font-size: 9px; }
    }

/* Research Panel */
.research-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
  gap: 0;
}

.research-list {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px;
}

.research-item {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.research-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.research-item.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.research-item-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.research-item-meta {
  font-size: 12px;
  opacity: 0.7;
}

.research-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.research-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.research-title {
  font-weight: 600;
  font-size: 16px;
}

.research-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-primary);
}

.research-placeholder {
  color: var(--text-secondary);
  text-align: center;
  padding: 60px 20px;
}

/* Markdown rendering styles */
.research-content h1 { font-size: 28px; margin: 0 0 16px 0; color: var(--accent); }
.research-content h2 { font-size: 22px; margin: 24px 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.research-content h3 { font-size: 18px; margin: 20px 0 10px 0; }
.research-content h4 { font-size: 16px; margin: 16px 0 8px 0; color: var(--text-secondary); }
.research-content p { margin: 12px 0; line-height: 1.7; }
.research-content ul, .research-content ol { margin: 12px 0; padding-left: 24px; }
.research-content li { margin: 6px 0; line-height: 1.6; }
.research-content strong { color: var(--accent); }
.research-content code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.research-content pre { background: var(--bg-tertiary); padding: 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; }
.research-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 16px 0; color: var(--text-secondary); font-style: italic; }
.research-content a { color: var(--accent); text-decoration: none; }
.research-content a:hover { text-decoration: underline; }
.research-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.research-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.research-content th, .research-content td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; }
.research-content th { background: var(--bg-secondary); font-weight: 600; }

@media (max-width: 768px) {
  .research-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .research-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }
}

/* Task Update Modal */
.task-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.task-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.task-modal {
  background: var(--bg-secondary);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.task-modal-overlay.active .task-modal {
  transform: scale(1);
}

.task-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.task-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.task-modal-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.task-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.task-modal-close:hover {
  color: var(--text-primary);
}

.task-modal-body {
  padding: 20px;
}

.task-modal-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.task-modal-input {
  width: 100%;
  padding: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.task-modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.task-modal-input::placeholder {
  color: var(--text-muted);
}

.task-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.task-modal-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.task-modal-btn.secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.task-modal-btn.secondary:hover {
  background: var(--bg-primary);
}

.task-modal-btn.primary {
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
}

.task-modal-btn.primary:hover {
  filter: brightness(1.1);
}

/* Task item update button */
.task-update-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.task-update-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* Sidebar Tasks - Template Version */
.sidebar-section {
  margin-bottom: 20px;
}

.section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header .count {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}

.tasks-list, .projects-list {
  padding: 0 8px;
}

.sidebar-task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.sidebar-task:hover {
  border-color: var(--border);
  background: var(--bg-tertiary);
}

.sidebar-task .task-check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s;
}

.sidebar-task .task-check:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-task .task-info {
  flex: 1;
  min-width: 0;
}

.sidebar-task .task-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-task .task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.sidebar-task .priority-dot {
  color: var(--error);
  font-size: 10px;
}

.sidebar-task .task-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
}

.sidebar-task .status-badge {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}

.sidebar-task .project-name {
  color: var(--accent);
}

.sidebar-project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: background 0.15s ease;
}

.sidebar-project:hover {
  background: var(--bg-tertiary);
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Agent Activity Styles */
.agents-container {
  padding: 16px;
  height: 100%;
  overflow-y: auto;
}

.agents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.agents-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.agents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.agent-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.agent-status.running {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}

.agent-status.complete {
  background: var(--success);
}

.agent-info {
  flex: 1;
  min-width: 0;
}

.agent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.agent-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.agent-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.project-count {
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
