:root {
  --bg: #0b0c0f;
  --bg-2: #0e1014;
  --panel: #12151b;
  --panel-2: #171a21;
  --panel-3: #1d212a;
  --line: #262b35;
  --line-soft: #1d222b;
  --text: #e9e7e2;
  --muted: #8b919d;
  --faint: #626975;
  --amber: #f2b45c;
  --amber-soft: #3a2d19;
  --green: #8ad19a;
  --green-soft: #1a2b20;
  --blue: #82aaff;
  --blue-soft: #1a2438;
  --red: #ff8585;
  --red-soft: #331b1e;
  --violet: #c792ea;
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(242, 180, 92, 0.07), transparent 60%),
    radial-gradient(800px 600px at 90% 0%, rgba(130, 170, 255, 0.05), transparent 60%);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); }
::selection { background: rgba(242, 180, 92, 0.25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #242a35; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100vh; position: relative; z-index: 1; }
.rail {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(18, 21, 27, 0.86), rgba(11, 12, 15, 0.7));
  padding: 18px 12px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2a2113, #17130c);
  border: 1px solid #4a3a20; color: var(--amber);
  box-shadow: 0 0 0 1px rgba(242, 180, 92, 0.08) inset;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; line-height: 1.1; font-size: 15px; }
.brand-sub { color: var(--faint); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.rail-label { color: var(--faint); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; padding: 10px 10px 7px; }
.projects { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.project-link {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); text-align: left; margin-bottom: 2px; transition: background 120ms, color 120ms;
}
.project-link:hover { background: var(--panel); color: var(--text); }
.project-link.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.project-key {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.03em; color: var(--amber);
  background: var(--amber-soft); border: 1px solid #4a3a20; border-radius: 5px; padding: 3px 5px; min-width: 34px; text-align: center;
}
.project-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.project-link .count { font-size: 10.5px; color: var(--faint); font-family: var(--mono); }
.rail-foot { border-top: 1px solid var(--line-soft); padding: 12px 8px 2px; display: flex; flex-direction: column; gap: 8px; }
.agent-status { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(255,255,255,0.03); }
.dot.ready { background: var(--green); box-shadow: 0 0 0 3px rgba(138,209,154,0.1); }
.dot.busy { background: var(--amber); animation: pulse 1.4s infinite; }
.dot.err { background: var(--red); }
.rail-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--faint); }
.rail-user button { background: none; border: 0; color: var(--faint); padding: 4px; border-radius: 6px; }
.rail-user button:hover { color: var(--text); background: var(--panel-2); }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 16px; padding: 0 22px;
  border-bottom: 1px solid var(--line-soft); background: rgba(11, 12, 15, 0.55); backdrop-filter: blur(12px);
}
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; }
.crumbs .key { font-family: var(--mono); font-size: 10px; color: var(--amber); border: 1px solid #4a3a20; background: var(--amber-soft); padding: 3px 6px; border-radius: 5px; }
.crumbs h1 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .muted { color: var(--faint); }
.spacer { flex: 1; }
.top-stats { display: flex; align-items: center; gap: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 54px; }
.stat b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 0 10px; height: 34px; width: 210px; color: var(--faint);
}
.search input { background: none; border: 0; outline: 0; width: 100%; color: var(--text); font-size: 12.5px; }
.search kbd { font-family: var(--mono); font-size: 9px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; color: var(--faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 12.5px; font-weight: 550; transition: background 120ms, border-color 120ms, transform 80ms;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #343a47; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #f7c373, #e9a748); border-color: #c88f3e; color: #23180a; font-weight: 650; }
.btn.primary:hover { background: linear-gradient(180deg, #ffd08a, #f2b45c); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #4a2a2e; background: var(--red-soft); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn.icon-only { width: 34px; padding: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }

/* ---------- board ---------- */
.board-wrap { flex: 1; min-height: 0; position: relative; }
.board {
  display: flex; gap: 14px; padding: 18px 22px 24px; height: 100%; overflow-x: auto; overflow-y: hidden;
  align-items: flex-start;
}
.column {
  flex: 1 1 0; min-width: 236px; max-width: 380px; display: flex; flex-direction: column; max-height: 100%; min-height: 120px;
  background: rgba(18, 21, 27, 0.5); border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: border-color 120ms, background 120ms;
}
.column.drag-over { border-color: #4a3a20; background: rgba(242, 180, 92, 0.04); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 13px 13px 10px; }
.col-dot { width: 7px; height: 7px; border-radius: 50%; }
.col-head h2 { font-size: 11px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 650; }
.col-count { font-family: var(--mono); font-size: 10px; color: var(--faint); background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 20px; padding: 1px 6px; }
.col-head .spacer { flex: 1; }
.col-add { background: none; border: 0; color: var(--faint); padding: 4px; border-radius: 6px; line-height: 0; }
.col-add:hover { color: var(--amber); background: var(--panel-2); }
.col-body { overflow-y: auto; padding: 0 9px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 70px; }
.col-empty { border: 1px dashed var(--line); border-radius: 10px; padding: 18px 10px; text-align: center; color: var(--faint); font-size: 11.5px; }
.col-empty.drag-over { border-color: #4a3a20; color: var(--amber); }

.card {
  position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 11px 10px 14px; cursor: pointer; transition: border-color 120ms, transform 120ms, background 120ms;
}
.card:hover { border-color: #39404e; background: var(--panel-3); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.45; transform: rotate(1deg); }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 4px; background: var(--line); }
.card.p-low::before { background: #4a5260; }
.card.p-medium::before { background: var(--blue); }
.card.p-high::before { background: var(--amber); }
.card.p-urgent::before { background: var(--red); }
.card-title { font-size: 13px; line-height: 1.4; font-weight: 550; letter-spacing: -0.005em; margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 5px;
  font-size: 9.5px; letter-spacing: 0.02em; border: 1px solid var(--line); color: var(--muted); background: var(--panel);
  font-family: var(--mono); white-space: nowrap;
}
.chip .icon { width: 11px; height: 11px; }
.chip.agent-running { color: var(--amber); border-color: #4a3a20; background: var(--amber-soft); }
.chip.agent-waiting { color: #ffd08a; border-color: #6b5328; background: #332712; }
.chip.agent-error { color: var(--red); border-color: #4a2a2e; background: var(--red-soft); }
.chip.question { color: #23180a; background: var(--amber); border-color: var(--amber); font-weight: 700; }
.chip.due-over { color: var(--red); border-color: #4a2a2e; background: var(--red-soft); }
.chip.subtle { color: var(--faint); }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.budget { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.budget-bar { height: 3px; border-radius: 4px; background: #262b35; overflow: hidden; }
.budget-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.budget-bar i.warn { background: var(--amber); }
.budget-bar i.over { background: var(--red); }
.budget-txt { font-family: var(--mono); font-size: 9px; color: var(--faint); display: flex; justify-content: space-between; }
.due { font-family: var(--mono); font-size: 9.5px; color: var(--faint); white-space: nowrap; }
.due.over { color: var(--red); }
.due.soon { color: var(--amber); }
.empty-board { margin: 80px auto; text-align: center; color: var(--muted); max-width: 380px; }
.empty-board h3 { color: var(--text); font-size: 17px; margin: 0 0 6px; }
.empty-board p { font-size: 12.5px; line-height: 1.6; margin: 0 0 16px; }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 180ms; z-index: 20; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(740px, 94vw);
  background: #0f1116; border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(0,0,0,0.45);
  transform: translateX(102%); transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; min-height: 0;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.drawer-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.drawer-top .task-id { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.drawer-title { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.drawer-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.status-select, .priority-select {
  height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 11.5px; padding: 0 8px; color: var(--text);
}
.status-select { font-weight: 600; }
.drawer-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 11px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-item span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.meta-item b { font-size: 11.5px; font-weight: 550; font-family: var(--mono); }
.drawer-tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.tab { background: none; border: 0; color: var(--faint); padding: 11px 10px 10px; font-size: 12px; font-weight: 550; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--amber); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; background: #0d0f14; }

/* question */
.question-card {
  border: 1px solid #5a4628; background: linear-gradient(180deg, #211a10, #19150e);
  border-radius: 13px; padding: 14px; margin-bottom: 16px; box-shadow: 0 0 0 1px rgba(242,180,92,0.05) inset;
}
.question-kicker { display: flex; align-items: center; gap: 7px; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; font-weight: 700; }
.question-kicker .dot { background: var(--amber); animation: pulse 1.4s infinite; }
.question-card h3 { margin: 0 0 6px; font-size: 14.5px; line-height: 1.45; font-weight: 600; }
.question-card .qctx { margin: 0 0 12px; color: #c9bda8; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 9px; text-align: left; padding: 9px 10px;
  border-radius: 9px; border: 1px solid #4a3a20; background: #17130d; color: var(--text);
  transition: background 120ms, border-color 120ms;
}
.option:hover { background: #241c11; border-color: #7a5d2e; }
.option-key { flex: 0 0 20px; height: 20px; border-radius: 5px; background: #2c2213; border: 1px solid #5a4628; color: var(--amber); display: grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.option-label { font-size: 12px; font-weight: 550; line-height: 1.35; }
.option-desc { display: block; color: #9d927f; font-size: 10.5px; line-height: 1.4; margin-top: 2px; font-weight: 400; }
.answer-row { display: flex; gap: 7px; }
.answer-row input { flex: 1; height: 34px; background: #13110d; border: 1px solid #3a2f1d; border-radius: 8px; padding: 0 10px; outline: none; font-size: 12.5px; }
.answer-row input:focus { border-color: #6b5328; }
.answered-note { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 11.5px; }

/* sections */
.section { margin-bottom: 22px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.section-head h3 { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 0; font-weight: 700; }
.section-head .spacer { flex: 1; }
.prose { font-size: 13px; line-height: 1.65; color: #d5d3ce; white-space: pre-wrap; word-break: break-word; }
.prose:empty::after { content: "No description yet. Add a brief so the agent knows what done means."; color: var(--faint); font-style: italic; }
.prose h1, .prose h2, .prose h3 { color: var(--text); line-height: 1.3; margin: 16px 0 8px; }
.prose h1 { font-size: 18px; } .prose h2 { font-size: 15px; } .prose h3 { font-size: 13px; }
.prose code { font-family: var(--mono); font-size: 11.5px; background: #1b1f27; border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
.prose pre { background: #0b0d11; border: 1px solid var(--line); border-radius: 9px; padding: 11px; overflow-x: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose ul { margin: 6px 0; padding-left: 20px; }
.prose blockquote { border-left: 2px solid var(--amber); margin: 10px 0; padding: 2px 0 2px 12px; color: var(--muted); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.subtasks { display: flex; flex-direction: column; gap: 6px; }
.subtask { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.subtask:hover { border-color: var(--line); background: var(--panel-2); }
.subtask .s-title { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask .s-status { font-family: var(--mono); font-size: 9px; color: var(--faint); text-transform: uppercase; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.comment:last-child { border-bottom: 0; }
.avatar { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 9px; font-weight: 700; font-family: var(--mono); flex: 0 0 24px; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.avatar.agent { background: var(--amber-soft); border-color: #4a3a20; color: var(--amber); }
.avatar.system { background: #17202b; border-color: #26384a; color: var(--blue); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.comment-head b { font-size: 11.5px; }
.comment-head span { font-size: 9.5px; color: var(--faint); font-family: var(--mono); }
.comment-body { font-size: 12.5px; line-height: 1.55; color: #d0cec9; white-space: pre-wrap; word-break: break-word; }
.composer { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 38px; max-height: 160px; resize: vertical; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; font-size: 12.5px; line-height: 1.5; }
.composer textarea:focus { border-color: #4a3a20; }

/* activity */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 4px; width: 1px; background: var(--line); }
.log-item { position: relative; padding: 0 0 12px; }
.log-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #343b47; border: 2px solid #0f1116; }
.log-item.k-agent::before { background: var(--amber); }
.log-item.k-tool::before { background: var(--blue); }
.log-item.k-test::before { background: var(--violet); }
.log-item.k-doc::before { background: var(--green); }
.log-item.k-question::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(242,180,92,0.12); }
.log-item.k-error::before, .log-item.k-warn::before { background: var(--red); }
.log-item.k-result::before { background: var(--green); }
.log-item .log-msg { font-size: 12px; line-height: 1.5; color: #cfcdc8; }
.log-item .log-time { font-family: var(--mono); font-size: 9px; color: var(--faint); margin-top: 2px; }
.log-empty { color: var(--faint); font-size: 12px; padding: 10px 0; }
.run-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 6px; font-size: 11px; background: var(--panel); }
.run-row .status { font-family: var(--mono); font-size: 9px; text-transform: uppercase; color: var(--faint); }
.run-row .status.completed { color: var(--green); }
.run-row .status.failed { color: var(--red); }
.run-row .spacer { flex: 1; }
.run-row .num { font-family: var(--mono); color: var(--faint); font-size: 9.5px; }

/* docs */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 9px; margin-bottom: 6px; background: var(--panel); }
.doc-icon { width: 28px; height: 28px; border-radius: 7px; background: #1a2029; border: 1px solid var(--line); display: grid; place-items: center; color: var(--blue); flex: 0 0 28px; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-size: 12px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-family: var(--mono); font-size: 9px; color: var(--faint); margin-top: 2px; }
.doc-actions { display: flex; gap: 3px; }
.doc-actions button { background: none; border: 0; color: var(--faint); padding: 5px; border-radius: 5px; line-height: 0; }
.doc-actions button:hover { color: var(--text); background: var(--panel-3); }
.upload-box { border: 1px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--faint); font-size: 11.5px; margin-top: 9px; }
.upload-box.drag-over { border-color: #4a3a20; color: var(--amber); }
.upload-box label { color: var(--amber); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.upload-box input { display: none; }

/* details */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 650; }
.field input, .field select, .field textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; font-size: 12.5px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #4a3a20; }
.field .hint { font-size: 10px; color: var(--faint); }
.full { grid-column: 1 / -1; }
.budget-panel { border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: var(--panel); }
.budget-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.budget-row b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.budget-row span { color: var(--faint); font-size: 10.5px; font-family: var(--mono); }
.budget-track { height: 6px; background: #242a34; border-radius: 6px; overflow: hidden; }
.budget-track i { display: block; height: 100%; border-radius: 6px; background: var(--green); }
.budget-track i.warn { background: var(--amber); }
.budget-track i.over { background: var(--red); }

/* modal & login */
.modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 40; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 150ms; }
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal { width: min(520px, 100%); background: #12151b; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); padding: 20px; transform: translateY(8px); transition: transform 150ms; }
.modal-scrim.open .modal { transform: none; }
.modal h2 { margin: 0 0 3px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.modal .sub { color: var(--faint); font-size: 11.5px; margin: 0 0 16px; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal textarea { min-height: 80px; resize: vertical; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: min(390px, 100%); background: rgba(18,21,27,0.9); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 40px 100px rgba(0,0,0,0.5); }
.login-card .brand { padding: 0 0 22px; }
.login-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -0.02em; }
.login-card p { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; line-height: 1.5; }
.login-card form { display: flex; flex-direction: column; gap: 11px; }
.login-card .field input { height: 40px; }
.login-err { color: var(--red); font-size: 12px; min-height: 16px; }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #1b2029; border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; font-size: 12px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: toastIn 180ms ease-out; }
.toast.err { border-color: #4a2a2e; color: #ffc9c9; background: #241417; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

.agent-running-line { display: flex; align-items: center; gap: 8px; color: var(--amber); font-size: 11.5px; }
.agent-running-line .loader { width: 12px; height: 12px; border: 2px solid #4a3a20; border-top-color: var(--amber); border-radius: 50%; animation: spin 0.9s linear infinite; }

@media (max-width: 1100px) {
  .top-stats .stat.optional { display: none; }
  .search { width: 160px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 74px minmax(0, 1fr); }
  .rail { padding: 14px 8px 10px; }
  .brand { justify-content: center; padding: 2px 0 16px; }
  .brand-text, .rail-label, .project-link .name, .project-link .count, .rail-user span, .agent-status span { display: none; }
  .project-link { justify-content: center; padding: 9px 6px; }
  .project-key { min-width: 0; }
  .topbar { padding: 0 14px; gap: 10px; }
  .top-stats { display: none; }
  .search { width: 130px; }
  .board { padding: 14px; gap: 10px; }
  .column { flex-basis: 280px; }
  .drawer { width: 100%; }
  .options { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal .form-grid { grid-template-columns: 1fr; }
}
