@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap");
:root {
  --bg: #050805;
  --panel: #08110b;
  --panel-2: #0c1810;
  --line: #14331f;
  --text: #ecece8;
  --muted: #7a8f80;
  --green: #00ff6a;
  --green-dim: #0a8f3c;
  --danger: #ff6b6b;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--mono); }
body { display: flex; flex-direction: column; overflow: hidden; }
header.app {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex: 0 0 auto;
}
.brand { display: flex; gap: 8px; align-items: center; font-weight: 600; letter-spacing: .08em; color: var(--text); text-transform: uppercase; font-size: 12px; }
.brand img { width: 28px; height: 28px; border-radius: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button, .btn {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 5px 9px; border-radius: 4px; cursor: pointer; font-family: inherit; font-size: 11px;
}
button.primary { background: #04210f; border-color: var(--green-dim); color: var(--green); }
button:hover, button.active { border-color: var(--line); color: var(--text); }
input, textarea, select {
  background: #031008; color: var(--text); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 8px; font-family: var(--mono); font-size: 12px;
}
label.toggle { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; }
.ide { display: flex; flex: 1; min-height: 0; }
.left { width: 240px; min-width: 160px; max-width: 480px; background: var(--panel); overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.right { width: 0; min-width: 0; max-width: 70%; background: var(--panel); overflow: auto; padding: 0 10px 12px; border-left: 1px solid var(--line); }
.center { flex: 1; min-width: 180px; display: flex; flex-direction: column; min-height: 0; }
.vsplit { width: 5px; cursor: col-resize; background: transparent; flex: 0 0 5px; }
.vsplit:hover, .hsplit:hover { background: var(--green-dim); }
.hsplit { height: 5px; cursor: row-resize; background: transparent; flex: 0 0 5px; }
.exhead { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.leftbody { overflow: auto; padding: 8px 6px 16px; flex: 1; font-size: 12px; }
.tree-item { padding: 3px 6px; cursor: pointer; white-space: nowrap; border-radius: 3px; }
.tree-item:hover { background: #0c1c12; }
.tree-item.sel { color: var(--green); background: #0a1a10; }
.tree-dir { color: var(--muted); }
.tree-item.proj { font-weight: 600; }
.tabs, .btabs, .rtabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.tabs button, .btabs button, .rtabs button { border-radius: 0; }
.tabs button.dirty::after { content: " ●"; color: var(--green); }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--line); align-items: center; }
#filename { min-width: 140px; flex: 1; }
.edterm { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.editor { flex: 1; min-height: 80px; }
.bottom { height: 25%; min-height: 120px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pane { flex: 1; overflow: auto; padding: 10px; font-size: 12px; white-space: pre-wrap; background: #020604; }
.pane .err { color: var(--danger); }
.pane .meta { color: var(--muted); margin-bottom: 6px; }
.term-in { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); }
.term-in input { flex: 1; }
.hints { font-size: 11px; color: var(--muted); padding: 0 10px; min-height: 0; }
.hints.on { padding: 4px 10px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 12px; }
.ai-log { min-height: 140px; overflow: auto; font-size: 12px; line-height: 1.5; margin-top: 8px; white-space: pre-wrap; color: var(--text); }
.hidden { display: none !important; }
.install { display: none; }
.palette {
  position: fixed; left: 50%; top: 12%; transform: translateX(-50%); width: min(520px, 92vw);
  background: var(--panel); border: 1px solid var(--line); z-index: 20; padding: 10px;
}
.palette input { width: 100%; margin-bottom: 8px; }
.palitem { padding: 6px; cursor: pointer; }
.palitem:hover { color: var(--green); }
.collapsed-right { width: 0 !important; padding: 0 !important; overflow: hidden; border: 0 !important; }
.sara-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0; }
.sara-actions button { font-size: 10px; border: 1px solid var(--line); }
#saraq { width: 100%; min-height: 64px; margin: 6px 0; }
.ctx {
  position: fixed; z-index: 30; background: var(--panel); border: 1px solid var(--line);
  min-width: 160px; padding: 4px;
}
.ctx button { display: block; width: 100%; text-align: left; }
.dlg {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40;
  display: flex; align-items: center; justify-content: center;
}
.dlg-card { background: var(--panel); border: 1px solid var(--line); padding: 16px; width: min(360px, 90vw); }
.dlg-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.dlg-card .row { margin-top: 12px; justify-content: flex-end; }
.hint-act { display: inline-flex; gap: 6px; margin-left: 8px; }
.hint-act button { font-size: 10px; }
.rtabs { justify-content: space-between; padding: 6px 0; }
