:root {
  color-scheme: dark;
  --bg: #090d13;
  --panel: #141a23;
  --panel2: #101720;
  --line: #273142;
  --text: #eef3fb;
  --muted: #9aa7ba;
  --accent: #ff5a5f;
  --good: #32d093;
  --warn: #f2ba4b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.hidden { display: none !important; }
.loginShell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.loginPanel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}
.brandMark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #221b22;
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 16px;
}
.brandMark.small { width: 36px; height: 36px; margin: 0; }
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line);
  background: #0d121a;
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.sideBrand { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.sideBrand span { display: block; color: var(--muted); font-size: 12px; }
.sideSectionTitle {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.main { padding: 24px; overflow: auto; }
.topbar, .panel, .statusStrip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}
.topActions, .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 12px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 26px; }
h2 { margin-bottom: 0; font-size: 18px; }
.statusStrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
}
.statusStrip div { background: var(--panel2); padding: 14px; }
.statusStrip span { display: block; font-size: 20px; font-weight: 900; }
.statusStrip label { color: var(--muted); font-size: 12px; }
.panel { margin-top: 16px; padding: 18px; }
.panelHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}
.panelHead p, .muted, .projectCard p, .agent p, .suggestion p, .message p, .builderResult { color: var(--muted); }
label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e141d;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}
textarea { resize: vertical; }
button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .55; }
.secondary, .fullButton { background: #222c3a; color: var(--text); }
.fullButton { width: 100%; }
.formGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.workspaceGrid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.projectHeader { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.projectNav, .list { display: grid; gap: 10px; }
.projectCard, .agent, .suggestion, .message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  padding: 12px;
}
.projectCard { cursor: pointer; }
.projectCard.active { outline: 2px solid var(--accent); }
.row, .projectTop, .agentTop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #222c3a;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.required { color: var(--accent); }
.chatBar { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.chatScope { margin-bottom: 12px; }
.chatLog {
  display: grid;
  gap: 10px;
  min-height: 46vh;
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0e141d;
}
.message.user { border-color: #38527d; }
.message.assistant { border-color: #4b3844; }
.chatInput { display: grid; grid-template-columns: 1fr 110px; gap: 10px; margin-top: 12px; }
.builderResult {
  margin-top: 14px;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e141d;
  padding: 12px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
}
.good { color: var(--good); }
.warn, .errorText { color: var(--warn); }
.errorText { min-height: 20px; margin-bottom: 0; }
@media (max-width: 920px) {
  .app, .workspaceGrid, .formGrid, .chatBar, .chatInput { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .statusStrip { grid-template-columns: repeat(2, 1fr); }
}
