:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --panel: #111417;
  --panel-2: #15191d;
  --panel-3: #1a1f24;
  --line: #252b31;
  --line-2: #303840;
  --text: #eef2f4;
  --muted: #8d98a2;
  --accent: #78ff3d;
  --accent-2: #b2ff91;
  --danger: #ff6d6d;
  --warn: #ffca5c;
  --radius: 10px;
  --topbar: 50px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.app-shell { height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: var(--topbar) minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) 14px 0; min-height: var(--topbar); border-bottom: 1px solid var(--line); background: rgba(11,13,15,.94); backdrop-filter: blur(16px); z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand-logo { width: 23px; height: 23px; }
.pill { border: 1px solid #335326; background: #14210f; color: var(--accent-2); border-radius: 999px; font-size: 10px; padding: 2px 6px; text-transform: uppercase; letter-spacing: .06em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .ghost-btn, .secondary-btn, .primary-btn, .send-btn { border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); background: var(--panel-2); min-height: 34px; padding: 0 10px; }
.icon-btn { width: 34px; padding: 0; display: grid; place-items: center; font-size: 17px; }
.icon-btn.small { width: 30px; min-height: 30px; }
.ghost-btn { background: transparent; color: #cbd2d7; }
.secondary-btn { width: 100%; background: var(--panel-2); }
.primary-btn, .send-btn { background: var(--accent); border-color: var(--accent); color: #071006; font-weight: 750; }
.primary-btn { width: 100%; }
.primary-btn:hover, .send-btn:hover { filter: brightness(1.04); }
.ghost-btn:hover, .secondary-btn:hover, .icon-btn:hover { background: var(--panel-3); }
.status-badge { font-size: 11px; border-radius: 999px; padding: 3px 8px; border: 1px solid var(--line-2); color: var(--muted); }
.status-badge.online { color: var(--accent-2); border-color: #335326; background: #12200e; }
.status-badge.error { color: #ffc0c0; border-color: #713a3a; background: #261212; }
.sidebar { grid-column: 1; grid-row: 2; min-width: 0; display: flex; flex-direction: column; background: #0e1113; border-right: 1px solid var(--line); overflow: hidden; }
.sidebar-section { padding: 12px; }
.sidebar-actions { display: grid; gap: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 9px; font-size: 11px; font-weight: 700; color: #bdc5ca; text-transform: uppercase; letter-spacing: .08em; }
.project-list { display: grid; gap: 3px; max-height: calc(100dvh - 245px); overflow: auto; }
.project-item { padding: 9px 10px; border-radius: 7px; display: grid; gap: 3px; color: #cbd2d7; border: 1px solid transparent; }
.project-item:hover { background: var(--panel-2); }
.project-item.active { color: var(--text); background: #171c20; border-color: #252d33; }
.project-item strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.project-item span { font-size: 11px; color: var(--muted); }
.empty-state-small { color: #68737d; font-size: 12px; padding: 8px 4px; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.browser-note { display: grid; gap: 4px; padding: 10px; border: 1px solid #253229; border-radius: 8px; background: #111713; font-size: 11px; }
.browser-note strong { color: var(--accent-2); }
.browser-note span { color: var(--muted); line-height: 1.35; }
.workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; background: var(--bg); }
.welcome-view { height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
.welcome-card { width: min(620px, 100%); text-align: center; }
.welcome-icon { width: 82px; height: 82px; border-radius: 20px; box-shadow: 0 18px 70px rgba(120,255,61,.09); }
.welcome-card h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.05; margin: 20px 0 10px; letter-spacing: -.045em; }
.welcome-card > p { color: var(--muted); line-height: 1.55; margin: 0 auto 24px; max-width: 520px; }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(420px, 100%); margin: 0 auto 26px; }
.welcome-actions button { min-height: 42px; }
.capability-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; text-align: left; }
.capability-grid div { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 12px; display: flex; gap: 8px; align-items: center; color: #c5cdd2; font-size: 12px; }
.capability-grid b { color: var(--accent); }
.project-view { height: 100%; display: grid; grid-template-rows: 48px minmax(0, 1fr); }
.project-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); background: #0d1012; min-width: 0; }
.project-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.project-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
.project-header-actions button { min-height: 30px; font-size: 11px; }
.panes { min-height: 0; display: grid; grid-template-columns: 220px minmax(300px, 1fr) minmax(320px, 38%); }
.pane { min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.pane:last-child { border-right: 0; }
.files-pane { display: grid; grid-template-rows: 34px minmax(0, 1fr); }
.pane-title { padding: 10px 12px 7px; font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.file-tree { overflow: auto; padding: 0 7px 12px; }
.file-row { display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 5px 7px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; color: #b9c3ca; cursor: pointer; }
.file-row:hover { background: var(--panel-3); }
.file-row.active { background: #20282e; color: var(--text); }
.file-row .file-icon { opacity: .7; }
.file-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-pane { display: grid; grid-template-rows: 36px minmax(0, 1fr); background: #0e1114; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 10px; border-bottom: 1px solid var(--line); font-size: 11px; color: #bfc7cc; }
.code-editor { resize: none; outline: none; width: 100%; height: 100%; border: 0; background: #0d1013; color: #dce4e9; padding: 16px; tab-size: 2; font: 12.5px/1.58 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; caret-color: var(--accent); }
.code-editor::selection { background: #29432a; }
.agent-pane { display: grid; grid-template-rows: 38px minmax(0, 1fr) auto auto; background: #101316; }
.agent-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.mode-switch { display: flex; background: #0c0f11; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.mode-btn { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 5px 10px; font-size: 11px; }
.mode-btn.active { background: #20262b; color: var(--text); }
.chat-log { overflow: auto; padding: 14px 14px 20px; }
.chat-empty { height: 100%; min-height: 180px; display: grid; place-content: center; text-align: center; gap: 6px; color: #c9d1d6; }
.chat-empty span { color: var(--muted); font-size: 12px; max-width: 280px; line-height: 1.5; }
.message { margin: 0 0 16px; }
.message .message-role { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.message.user .bubble { background: #1b2025; border: 1px solid #293139; }
.message .bubble { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 9px; padding: 10px 11px; font-size: 12.5px; line-height: 1.55; color: #dce3e7; }
.message.assistant .bubble { padding-left: 0; padding-right: 0; }
.message.error .bubble { color: #ffb1b1; }
.pending-changes { margin: 0 10px 10px; border: 1px solid #39512f; background: #111910; border-radius: 9px; padding: 10px; }
.pending-changes h3 { margin: 0 0 8px; font-size: 12px; color: var(--accent-2); }
.change-file { font: 11px ui-monospace, monospace; padding: 4px 0; color: #c7d2c2; }
.change-actions { display: flex; gap: 7px; margin-top: 9px; }
.change-actions button { min-height: 30px; font-size: 11px; width: auto; }
.composer { margin: 0 10px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #15191d; overflow: hidden; }
.composer textarea { width: 100%; min-height: 74px; max-height: 190px; resize: vertical; border: 0; outline: 0; color: var(--text); background: transparent; padding: 10px 11px; font: 12.5px/1.45 inherit; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px 8px 11px; }
.composer-footer .muted { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-btn { min-height: 30px; padding: 0 12px; font-size: 11px; }
.settings-dialog { border: 0; padding: 0; border-radius: 12px; color: var(--text); background: transparent; width: min(480px, calc(100vw - 28px)); }
.settings-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
.settings-card { background: #14181c; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.55); padding: 18px; display: grid; gap: 13px; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.settings-head h2 { margin: 0 0 4px; font-size: 18px; }
.settings-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.settings-card label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; color: #c7d0d5; }
.settings-card input, .settings-card select { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background: #0e1114; color: var(--text); min-height: 38px; padding: 7px 9px; outline: 0; }
.settings-card input:focus, .settings-card select:focus { border-color: #4b6940; }
.settings-card .checkbox-row { grid-template-columns: auto 1fr; align-items: center; font-weight: 500; color: var(--muted); }
.checkbox-row input { width: auto; min-height: auto; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
.settings-actions button { width: auto; }
.settings-status { min-height: 18px; font-size: 11px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #20262b; border: 1px solid #384149; color: #edf2f5; border-radius: 9px; padding: 9px 12px; font-size: 12px; z-index: 100; box-shadow: 0 12px 34px rgba(0,0,0,.4); max-width: min(520px, calc(100vw - 24px)); }
.mobile-only { display: none; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .panes { grid-template-columns: 180px minmax(260px, 1fr) minmax(280px, 42%); }
}
@media (max-width: 760px) {
  html, body { overflow: hidden; }
  .app-shell { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
  .topbar { padding-left: 8px; }
  .topbar .brand { margin-right: auto; margin-left: 8px; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); bottom: 0; width: min(82vw, 300px); z-index: 30; transform: translateX(-102%); transition: transform .18s ease; box-shadow: 20px 0 50px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .workspace { grid-column: 1; }
  .project-header { padding: 6px 9px; }
  .project-header-actions button { padding: 0 7px; }
  .panes { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(280px, 44%); }
  .files-pane { display: none; }
  .editor-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .agent-pane { border-right: 0; }
  .welcome-view { padding: 18px; }
  .welcome-actions, .capability-grid { grid-template-columns: 1fr; }
  .status-badge { display: none; }
}
@media (max-width: 480px) {
  .brand .pill { display: none; }
  .project-header-actions #addFilesBtn { display: none; }
  .project-meta { display: none; }
  .panes { grid-template-rows: 45% 55%; }
  .code-editor { font-size: 11px; padding: 12px; }
  .chat-log { padding: 10px; }
}
