:root {
  --bg: #0f1115; --panel: #171a21; --border: #262b36; --text: #e6e9ef;
  --muted: #8a93a6; --accent: #14b8a6; --accent2: #22d3ee; --warn: #fbbf24; --bad: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, "DejaVu Sans", Arial, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel);
}
h1 { font-size: 18px; margin: 0; font-weight: 800; }
.muted { color: var(--muted); font-weight: 400; }
.health { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--accent); } .dot.bad { background: var(--bad); }
.tokenbar { display: flex; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.tokenbar input { flex: 1; }
input, button {
  background: #0c0e12; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font: inherit;
}
button { background: var(--accent); color: #04120f; border: 0; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(1.08); }
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
#ventures { padding: 16px 20px 0; }
.venture-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.venture-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.vc-head { display: flex; align-items: center; gap: 8px; }
.vname { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.vdot.ok { background: var(--accent); } .vdot.bad { background: var(--bad); } .vdot.na { background: var(--border); }
.stage-badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stage-badge.live { color: var(--accent2); border-color: var(--accent2); }
.stage-badge.building { color: var(--warn); border-color: var(--warn); }
.stage-badge.paused, .stage-badge.retired { color: var(--bad); border-color: var(--bad); }
.vc-meta { font-size: 12px; margin: 6px 0 8px; }
.vc-links { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.vc-links a { color: var(--accent2); text-decoration: none; }
.vc-repo { font-family: ui-monospace, monospace; font-size: 11px; }
.launchpad { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chip { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; background: var(--panel); }
.chip:hover { border-color: var(--accent); }
main { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 20px; }
@media (max-width: 880px) { main { grid-template-columns: 1fr; } }
.tiles { display: grid; gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.tile h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile .row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-top: 1px solid var(--border); }
.tile .row:first-of-type { border-top: 0; }
.pill { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); }
.pill.running, .pill.active { color: var(--accent2); border-color: var(--accent2); }
#chat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
#chat h2 { font-size: 14px; margin: 0 0 10px; }
.messages { flex: 1; min-height: 280px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 90%; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #1d2530; }
.msg.assistant { align-self: flex-start; background: #11261f; border: 1px solid #1c3a30; }
.msg .tools { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
#chat-form { display: flex; gap: 8px; }
#chat-input { flex: 1; }
