/* KanBot — mission control for CLI agents.
   Aesthetic: deep charcoal control room, electric-blue accent, mono labels. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  --bg:        #0b0d11;
  --bg-grid:   #14171d;
  --surface:   #14171d;
  --surface-2: #1a1e26;
  --surface-3: #222732;
  --line:      #262c37;
  --line-soft: #1d222b;
  --text:      #e7e9ee;
  --text-dim:  #9aa3b2;
  --text-faint:#5c6573;

  --brand:     #4f8cff;
  --brand-dim: #2f6fe0;
  --cyan:      #4fd1e0;
  --violet:    #b491f5;
  --green:     #5fd28a;
  --red:       #ff6b6b;
  --blue:      #6aa6ff;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ui:   'Sora', system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 0);
  background-size: 28px 28px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--ui); cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: var(--ui); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- layout ---- */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 58px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101319, #0d0f14);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 800; color: #ffffff; font-size: 16px;
  box-shadow: 0 0 24px -4px var(--brand-dim);
}
.brand .name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .name span { color: var(--brand); }
.brand .ver { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }

.board-select {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; min-width: 180px;
}
.topbar .spacer { flex: 1; }

.btn {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: .15s; display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { background: var(--surface-3); border-color: #313846; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  color: #ffffff; border-color: transparent; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* runner status pill */
.runners { display: flex; align-items: center; gap: 9px; }
.runner-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 6px 11px 6px 9px; border-radius: 100px; font-size: 12px;
}
.runner-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.runner-pill.online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.runner-pill.busy .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.2s infinite; }
.runner-pill .caps { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.runner-pill .runner-safe { font-family: var(--mono); font-size: 9.5px; color: var(--green);
  border: 1px solid rgba(95,210,138,.35); border-radius: 100px; padding: 1px 6px; }
.runner-pill.empty { color: var(--text-faint); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- board ---- */
.board {
  flex: 1; display: flex; gap: 14px; padding: 18px 20px;
  overflow-x: auto; overflow-y: hidden;
}
.column {
  flex: 1 1 0; min-width: 300px; max-width: 520px;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface), #101318);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  max-height: 100%;
}
.column.drag-over { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-dim) inset; }
.col-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 14px 11px; border-bottom: 1px solid var(--line-soft);
}
.col-head .kind-dot { width: 9px; height: 9px; border-radius: 3px; }
.col-head .title { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.col-head .count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--text-faint); background: var(--surface-2);
  padding: 2px 8px; border-radius: 100px; min-width: 24px; text-align: center;
}
.kind-backlog { background: var(--text-faint); }
.kind-queued  { background: var(--brand); }
.kind-running { background: var(--cyan); }
.kind-review  { background: var(--violet); }
.kind-done    { background: var(--green); }
.kind-custom  { background: var(--blue); }
.kind-info    { background: var(--blue); }

.col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.col-body.empty-hint::after {
  content: 'drop tasks here'; font-family: var(--mono); font-size: 11px;
  color: var(--text-faint); text-align: center; padding: 18px 0; opacity: .5;
}

/* ---- card ---- */
.card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-sm); padding: 11px 12px;
  cursor: grab; transition: .14s; position: relative;
}
.card:hover { background: var(--surface-3); transform: translateY(-1px); border-left-color: var(--brand); }
.card.dragging { opacity: .4; }
.card.s-queued  { border-left-color: var(--brand); }
.card.s-running { border-left-color: var(--cyan); }
.card.s-running::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 3px;
  background: var(--cyan); border-radius: 3px; animation: pulse 1.1s infinite;
}
.card.s-review  { border-left-color: var(--violet); }
.card.s-done    { border-left-color: var(--green); }
.card.s-failed  { border-left-color: var(--red); }
.card.s-cancelled { border-left-color: var(--text-faint); opacity: .7; }

.card .ctitle { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-bottom: 7px; }
.card .cmeta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.agent-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; letter-spacing: .03em;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; flex: 0 0 auto;
}
.agent-badge .adot { width: 6px; height: 6px; border-radius: 50%; }
.card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag-chip {
  font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 500;
}
.tag-chip .insight-mark { font-size: 9px; opacity: .85; }
.card .status-line {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  margin-top: 7px; display: flex; align-items: center; gap: 6px;
}
.spinner {
  width: 9px; height: 9px; border: 1.5px solid var(--cyan); border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* add card composer */
.add-card {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  padding: 9px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  text-align: center; transition: .15s;
}
.add-card:hover { color: var(--brand); border-color: var(--brand-dim); }

/* ---- drawer ---- */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(5,6,9,.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 40;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.2,.7,.2,1);
  z-index: 50; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.drawer-head .x { margin-left: auto; font-size: 20px; color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px; }
.drawer-head .x:hover { background: var(--surface-3); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > .label { display: flex; align-items: center; gap: 8px; }
.input, .textarea, .select {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; width: 100%;
  transition: .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand-dim); }
.textarea { resize: vertical; min-height: 92px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.title-input {
  background: transparent; border: none; color: var(--text); font-size: 18px;
  font-weight: 600; width: 100%; padding: 2px 0;
}
.title-input:focus { outline: none; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.drawer-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.toggle { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 36px; height: 20px; border-radius: 100px; background: var(--surface-3); position: relative; transition: .15s; }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-faint); transition: .15s; }
.toggle input:checked + .track { background: var(--brand-dim); }
.toggle input:checked + .track::after { transform: translateX(16px); background: var(--brand); }

/* tag editor */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
/* image paste/drop */
.textarea.drag-img { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.img-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); }

.tag-input {
  width: 100%; margin: 8px 0; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 12.5px;
  font-family: var(--mono); transition: .15s;
}
.tag-input:focus { outline: none; border-color: var(--brand); }
.tag-input::placeholder { color: var(--text-faint); }
.tag-add { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

/* collapsible loop section */
.loop-toggle {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--text-faint); padding: 2px 0; cursor: pointer; text-align: left;
}
.loop-toggle:hover { color: var(--text-dim); }
.loop-body { margin-top: 8px; }
.tag-pickable {
  font-family: var(--mono); font-size: 10.5px; padding: 3px 9px; border-radius: 100px;
  border: 1px solid var(--line); cursor: pointer; transition: .12s; display: inline-flex; gap: 5px; align-items: center;
}
.tag-pickable:hover { border-color: var(--brand); }
.tag-pickable .rm { opacity: .6; }

/* sessions */
.session { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.session-head {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  background: var(--surface-2); cursor: pointer; font-size: 12px;
}
.session-head .sstatus { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 5px; }
.ss-running { background: rgba(79,209,224,.14); color: var(--cyan); }
.ss-success { background: rgba(95,210,138,.14); color: var(--green); }
.ss-failed, .ss-cancelled { background: rgba(255,107,107,.14); color: var(--red); }
.ss-pending, .ss-assigned { background: rgba(255,157,61,.14); color: var(--brand); }
.session-head .smeta { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.terminal {
  background: #08090c; font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  padding: 12px 14px; max-height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.terminal .ln { display: block; }
.terminal .ln.stderr { color: #ffb0b0; }
.terminal .ln.system { color: var(--brand); opacity: .85; }
.terminal .ln.stdout { color: #cdd3dd; }
.terminal:empty::after { content: 'no output yet…'; color: var(--text-faint); }

/* insights */
.insight-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.insight-card .ihead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.insight-card .isum { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.insight-card .idetail { font-family: var(--mono); font-size: 11px; color: var(--text-dim); white-space: pre-wrap; max-height: 160px; overflow-y: auto; background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.insight-card.fail { opacity: .65; }

/* modal (new board / new tag) */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(5,6,9,.6); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 60;
}
.modal-scrim.open { display: grid; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  width: min(440px, 92vw); padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
  max-height: 92vh; overflow-y: auto;
}
.modal.wide { width: min(820px, 95vw); padding: 26px; }
.modal h3 { font-size: 15px; font-weight: 600; }
.modal .label { margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.color-row { display: flex; gap: 7px; }
.swatch { width: 24px; height: 24px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.swatch.sel { border-color: var(--text); }

/* empty state */
.empty-board { margin: auto; text-align: center; color: var(--text-faint); }
.empty-board .big { font-size: 15px; color: var(--text-dim); margin-bottom: 8px; }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
  padding: 9px 16px; border-radius: 100px; font-size: 12.5px; box-shadow: var(--shadow);
  animation: toastin .2s ease;
}
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

.hidden { display: none !important; }

/* demo banner (Vercel, no backend) */
.demo-pill {
  font-family: var(--mono); font-size: 11px; color: var(--brand);
  background: rgba(79,140,255,.1); border: 1px solid rgba(79,140,255,.3);
  padding: 6px 12px; border-radius: 100px; white-space: nowrap;
}
.demo-pill b { color: var(--text); font-weight: 600; }

/* copy-pasteable command row */
.cmd-row { display: flex; align-items: center; gap: 8px; background: #07080b;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px 9px 12px; }
.cmd-row .cmd-text { font-family: var(--mono); font-size: 13px; color: #d6dbe4; flex: 1;
  white-space: nowrap; overflow-x: auto; }
.cmd-row .cmd-text::before { content: '$ '; color: var(--text-faint); }
.cmd-row .cmd-copy { font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 11px; flex: 0 0 auto; transition: .12s; cursor: pointer; }
.cmd-row .cmd-copy:hover { border-color: var(--brand); color: var(--brand); }

/* local-network-access warning */
.lna-warn {
  font-size: 13px; line-height: 1.55; color: var(--text);
  background: rgba(255,157,61,.08); border: 1px solid rgba(245,196,81,.35);
  border-left: 3px solid #f5c451; border-radius: var(--radius-sm); padding: 12px 14px;
}
.lna-warn code { font-family: var(--mono); font-size: 11.5px; color: var(--brand);
  background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.lna-warn b { color: var(--text); }

/* onboarding modal */
.onb-steps { display: flex; flex-direction: column; gap: 8px; }
.onb-step { display: flex; align-items: center; gap: 10px; }
.onb-step .onb-num {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand); color: #fff; font-family: var(--mono); font-size: 11px;
  font-weight: 700; display: grid; place-items: center;
}
.onb-step code {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 9px; flex: 1;
}

/* API reference modal */
.api-spec {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: #cdd3dd;
  background: #07080b; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; max-height: 58vh; overflow: auto; white-space: pre;
}

/* live badge on the sessions button */
.live-badge {
  background: var(--cyan); color: #062227; font-family: var(--mono); font-weight: 700;
  font-size: 10px; padding: 1px 6px; border-radius: 100px; margin-left: 2px;
  animation: pulse 1.3s infinite;
}

/* discovered agent session cards (compact, live inside Backlog/Running/Done) */
.card.sess { border-left-color: var(--text-faint); }
.card.sess.s-running { border-left-color: var(--cyan); }
.sess-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.sess-name { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.sess-age { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); flex: 0 0 auto; }
.sess-work { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); flex: 0 0 auto; }
.sess-preview { font-size: 12px; color: var(--text-dim); line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sess-pv-tag { color: var(--text-faint); font-family: var(--mono); }

/* revive modal: terminal "where it left off" preview */
.terminal-card { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #07080b; }
.term-bar { display: flex; align-items: center; gap: 9px; padding: 9px 13px; background: #0e1117; border-bottom: 1px solid var(--line); }
.term-dots { display: flex; gap: 7px; }
.term-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-left: 4px; }
.term-body {
  font-family: var(--mono); font-size: 13px; line-height: 1.65; padding: 16px 18px;
  max-height: 56vh; min-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; color: #cdd3dd;
}
.term-line { display: block; margin-bottom: 12px; }
.term-line:last-child { margin-bottom: 0; }
.term-comment { color: var(--text-faint); }
.term-user { color: var(--green); }
.term-prompt { color: var(--brand); user-select: none; margin-right: 8px; font-weight: 700; }
.term-out { color: #d6dbe4; }

/* markdown rendered inside the terminal transcript preview */
.term-body .md { white-space: normal; }
.term-body .md-p { margin: 3px 0; }
.term-body .md-sp { height: 7px; }
.term-body .md-h { font-weight: 700; color: #fff; margin: 9px 0 4px; }
.term-body .md-h1 { font-size: 15px; } .term-body .md-h2 { font-size: 14px; } .term-body .md-h3 { font-size: 13px; }
.term-body .md strong { color: #fff; font-weight: 700; }
.term-body .md em { font-style: italic; color: #e7e9ee; }
.term-body .md a { color: var(--brand); }
.term-body .md-code, .term-body .md code { background: rgba(255,255,255,.08); color: #9fd0ff;
  padding: 1px 5px; border-radius: 4px; font-size: .95em; }
.term-body .md-pre { background: #0c0f15; border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px; margin: 6px 0; overflow-x: auto; white-space: pre; color: #cdd3dd; }
.term-body .md-list { margin: 4px 0 4px 18px; padding: 0; }
.term-body .md-list li { margin: 2px 0; }
.term-body .md-table { border-collapse: collapse; margin: 7px 0; font-size: 12px; }
.term-body .md-table th, .term-body .md-table td { border: 1px solid var(--line); padding: 4px 9px; text-align: left; vertical-align: top; }
.term-body .md-table th { color: #fff; background: rgba(255,255,255,.04); }
.sess-foot { display: flex; align-items: center; gap: 8px; }
.sess-turns { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.sess-revive { margin-left: auto; font-family: var(--ui); font-size: 11px; padding: 3px 10px;
  border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-dim); transition: .12s; }
.sess-revive:hover { border-color: var(--brand); color: var(--brand); }
.card.sess.s-running .sess-revive { background: linear-gradient(135deg, var(--brand), var(--brand-dim)); color: #ffffff; border-color: transparent; font-weight: 600; }

/* resume badge on cards */
.resume-badge { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); border: 1px solid rgba(79,209,224,.3); padding: 1px 6px; border-radius: 5px; }

/* sessions browser */
.sess-browser { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.sess-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.sess-row.active { border-color: rgba(79,209,224,.4); }
.sess-row .sinfo { flex: 1; min-width: 0; }
.sess-row .stitle { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-row .ssub { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-row .working-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.2s infinite; flex: 0 0 auto; }
.sess-row .idle-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: 0 0 auto; }
.sess-section-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin: 6px 0 2px; }

/* ---- v0.3 polish: command override, image cells, statuses ---- */
.cmd-badge { color: var(--brand) !important; border-color: rgba(79,140,255,.35) !important; }
.mono-input { font-family: var(--mono) !important; font-size: 12px !important; }

/* richer card status lines */
.card .status-line.warn { color: var(--brand); }
.card .status-line.s-done { color: var(--green); }
.card .status-line.s-failed { color: var(--red); }
.card .status-line.s-cancelled { color: var(--text-faint); }

/* removable image thumbnails */
.img-cell { position: relative; width: 72px; height: 72px; }
.img-cell .img-thumb { width: 100%; height: 100%; }
.img-rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; line-height: 1; display: grid; place-items: center; transition: .12s;
}
.img-rm:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* session terminal chevron */
.session-head .schev { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-left: 8px; }

/* the prominent New task button in the topbar */
#newTaskBtn { font-weight: 600; }
#workflowsBtn { font-weight: 600; box-shadow: 0 0 22px -8px var(--brand-dim); }

/* ---- workflows -------------------------------------------------------- */
.wf-modal-head { display: flex; flex-direction: column; gap: 4px; }
.wf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wf-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.wf-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.wf-row:hover { border-color: var(--line); background: var(--surface-3); }
.wf-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wf-title { display: flex; align-items: center; gap: 8px; }
.wf-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.wf-stepcount { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.wf-desc { font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.wf-chain { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.wf-step-pill {
  font-size: 11px; color: var(--text-dim); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.wf-loop { color: var(--violet); font-family: var(--mono); font-size: 9.5px; }
.wf-arrow { color: var(--text-faint); font-size: 11px; }
.wf-ctrls { display: flex; gap: 6px; flex: 0 0 auto; }
.wf-badge { color: var(--violet); border-color: rgba(180,145,245,.4); }

/* builder — fixed header + scroll body + sticky footer */
.modal.wf-builder { gap: 0; padding: 0; max-height: 90vh; overflow: hidden; }
.wf-build-head { padding: 20px 24px 14px; display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--line-soft); }
.wf-build-sub { font-size: 12px; color: var(--text-faint); }
.wf-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.wf-name-input { font-size: 15px; font-weight: 600; }
.wf-build-actions {
  position: sticky; bottom: 0; padding: 14px 24px; margin: 0;
  border-top: 1px solid var(--line-soft); background: var(--surface);
}

/* the visual chain — overview of the whole workflow */
.wf-build-chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0 2px; }
.wf-cpill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 200px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px 4px 5px; cursor: pointer; color: var(--text-dim); font-size: 12px;
}
.wf-cpill:hover { border-color: var(--brand-dim); color: var(--text); }
.wf-cpill.on { border-color: var(--brand); color: var(--text); background: rgba(79,140,255,.10); }
.wf-cpill-n {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text);
  background: var(--surface-3); border-radius: 50%; width: 18px; height: 18px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.wf-cpill.on .wf-cpill-n { background: var(--brand); color: #fff; }
.wf-cpill-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* steps accordion */
.wf-steps { display: flex; flex-direction: column; gap: 8px; }
.wf-step { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.wf-step.open { border-color: var(--brand-dim); box-shadow: 0 0 0 1px var(--brand-dim) inset; }
.wf-step-head { display: flex; align-items: center; gap: 10px; padding: 9px 11px; }
.wf-step:not(.open) .wf-step-head { cursor: pointer; }
.wf-step:not(.open) .wf-step-head:hover { background: var(--surface-3); }
.wf-step-num {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text);
  background: var(--surface-3); border-radius: 6px; width: 22px; height: 22px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.wf-step.open .wf-step-num { background: var(--brand); color: #fff; }
.wf-step-title { flex: 1 1 auto; font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-step-name { flex: 1 1 auto; font-weight: 600; }
.wf-step-sum { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; overflow: hidden; }
.wf-chip {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-dim);
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.wf-chip.loop { color: var(--violet); border-color: rgba(180,145,245,.35); }
.wf-chip.warn { color: var(--red); border-color: rgba(255,107,107,.35); }
.wf-chevron { color: var(--text-faint); font-size: 13px; flex: 0 0 auto; }
.wf-step-tools { display: flex; gap: 5px; flex: 0 0 auto; }
.wf-prompt { min-height: 104px; margin: 0 11px; width: calc(100% - 22px); }
.wf-mini {
  font-family: var(--mono); font-size: 13px; line-height: 1; color: var(--text-dim);
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px;
  width: 26px; height: 26px; cursor: pointer; flex: 0 0 auto;
}
.wf-mini:hover:not(:disabled) { color: var(--text); border-color: var(--brand-dim); }
.wf-mini:disabled { opacity: .35; cursor: default; }
.wf-mini.danger:hover { color: var(--red); border-color: rgba(255,107,107,.4); }
/* calmer labels inside the builder — sentence case, less shouting */
.wf-builder .label { text-transform: none; letter-spacing: .01em; font-family: var(--ui); font-size: 11px; color: var(--text-dim); }
.wf-adv-toggle {
  background: none; border: none; border-top: 1px solid var(--line-soft);
  color: var(--text-dim); font-size: 11.5px; cursor: pointer; font-family: var(--ui);
  padding: 9px 11px 4px; margin: 4px 0 0; text-align: left; width: 100%;
}
.wf-adv-toggle:hover { color: var(--text); }
.wf-adv { display: none; flex-direction: column; gap: 12px; padding: 4px 11px 12px; }
.wf-adv.open { display: flex; }
.wf-step-row > * { flex: 1; }
.wf-flags { display: flex; flex-direction: column; gap: 7px; }
.wf-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.wf-check input { accent-color: var(--brand); }
.wf-addstep { align-self: flex-start; }
.mono-input { font-family: var(--mono); font-size: 12px; }
.sess-pick { accent-color: var(--brand); width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; }
.wf-toggle { display: flex; gap: 8px; }

/* calmer modal subtitles (workflows + sessions) */
.wf-modal-head .label { text-transform: none; letter-spacing: .01em; font-family: var(--ui); font-size: 12px; color: var(--text-dim); }

/* automations empty-state pitch */
.wf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 34px 24px; }
.wf-empty-mark { font-size: 30px; line-height: 1; }
.wf-empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.wf-empty-sub { font-size: 13px; color: var(--text-dim); line-height: 1.55; max-width: 460px; }
.wf-empty .btn { margin-top: 6px; }

/* suggestion cards */
.sug-loading { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; padding: 18px 4px; }
.sug-row { border-left: 3px solid var(--violet); }
.sug-kind {
  font-family: var(--mono); font-size: 9px; padding: 2px 7px; border-radius: 999px; flex: 0 0 auto;
}
.sug-kind.pat { color: var(--violet); background: rgba(180,145,245,.14); }
.sug-kind.proj { color: var(--cyan); background: rgba(79,209,224,.12); }
.sug-sources { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.sug-src-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; }

/* inspect modal "working" indicator */
.insp-working { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 11px; color: var(--cyan); font-weight: 500; vertical-align: middle; }
.insp-working.idle { color: var(--text-faint); font-weight: 400; }

/* ---- automations: full-screen surface (replaces the modal soup) ------- */
.auto-view { position: fixed; inset: 0; background: var(--bg); z-index: 70; display: none; flex-direction: column; }
.auto-view.open { display: flex; animation: autoIn .14s ease; }
@keyframes autoIn { from { opacity: 0; } to { opacity: 1; } }
.auto-head {
  display: flex; align-items: center; gap: 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.auto-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.auto-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auto-title { font-size: 17px; font-weight: 600; color: var(--text); }
.auto-sub { font-size: 12.5px; color: var(--text-dim); }
.auto-back {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: var(--radius-sm); padding: 7px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.auto-back:hover { color: var(--text); border-color: var(--brand-dim); }
.auto-head-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.auto-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.auto-close:hover { color: var(--text); border-color: var(--red); }
.auto-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 26px max(24px, calc((100% - 980px) / 2));
  display: flex; flex-direction: column; gap: 16px;
}
.auto-foot {
  flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px max(24px, calc((100% - 980px) / 2));
  border-top: 1px solid var(--line); background: var(--surface);
}
/* the builder lives directly in the surface now — drop the old modal chrome */
.auto-body .wf-list { max-height: none; overflow: visible; }
.auto-body .wf-steps { max-height: none; overflow: visible; }
.auto-body .wf-scroll { display: contents; }
.auto-body .wf-prompt { width: calc(100% - 22px); }

/* distillation */
.sug-refined { font-size: 10px; color: var(--violet); margin-top: 3px; font-weight: 500; }
.sug-raw { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.wf-reduction { font-size: 11px; color: var(--green); margin-top: 4px; font-weight: 500; }

/* centered loading / empty / error state inside the automations surface */
.auto-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; padding: 64px 24px; margin: auto; max-width: 460px;
}
.auto-state-mark { font-size: 30px; color: var(--text-faint); line-height: 1; }
.auto-state-title { font-size: 16px; font-weight: 600; color: var(--text); }
.auto-state-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.auto-state .btn { margin-top: 8px; }
.spinner.big { width: 26px; height: 26px; border-width: 3px; }
.wf-distill { align-self: flex-start; color: var(--violet); border-color: rgba(180,145,245,.35); }
.wf-distill:hover { border-color: var(--violet); }

/* ============================================================================
   TERMINAL THEME — phosphor-green TUI on black: monospace, squared boxes,
   flat surfaces, faint scanlines. Overrides the tokens + the few gradient rules.
   ========================================================================== */
:root {
  --bg:        #070809;
  --bg-grid:   #0d0f12;
  --surface:   #0b0d10;
  --surface-2: #0f1216;
  --surface-3: #161a20;
  --line:      #1f2733;
  --line-soft: #141a22;
  --text:      #d4dbe2;
  --text-dim:  #8b98a7;
  --text-faint:#55606e;

  --brand:     #3ddc84;   /* phosphor green accent */
  --brand-dim: #1f9e5a;
  --cyan:      #5ad7e0;
  --green:     #3ddc84;

  --ui:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,.9);
}

/* faint CRT scanlines instead of the dot grid */
body {
  background-color: #070809;
  background-image: repeating-linear-gradient(
    to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  background-size: auto;
}

/* flatten the gradient/glow surfaces into terminal panes */
.topbar { background: #0a0c0f; }
.brand .mark {
  background: #0c170f; color: var(--brand); border: 1px solid var(--brand-dim);
  box-shadow: none; border-radius: 3px;
}
.brand .name span { color: var(--brand); }

.btn.primary {
  background: rgba(61,220,132,.10); color: var(--brand);
  border: 1px solid var(--brand-dim); font-weight: 600;
}
.btn.primary:hover { background: rgba(61,220,132,.18); filter: none; }

/* a blinking block caret on the brand for that live-terminal feel */
.brand .name::after {
  content: '▮'; color: var(--brand); margin-left: 6px; font-weight: 400;
  animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }

/* prompt markers on column + section headers */
.col-head .title::before { content: '» '; color: var(--text-faint); }
.auto-title::before { content: '❯ '; color: var(--brand); }

/* primary green accents where electric-blue was */
.kind-dot.kind-running { box-shadow: 0 0 8px var(--cyan); }
.runner-pill.online .dot { box-shadow: 0 0 8px var(--green); }
#workflowsBtn { box-shadow: none; }
.spinner { border-top-color: var(--brand); }

/* ---- demo status bar + connect panel (hosted/no-backend) -------------- */
.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px; font-size: 12px; color: var(--text-dim);
  background: #0a0c0f; border-top: 1px solid var(--line);
}
.demo-bar-left { display: flex; align-items: center; gap: 9px; flex: 1; }
.demo-bar b { color: var(--brand); }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 8px var(--brand); animation: pulse 1.6s infinite; }
body.demo .board { padding-bottom: 52px; }   /* clear the fixed bar */

.connect-head { display: flex; flex-direction: column; gap: 6px; }
.connect-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.connect-term { margin: 2px 0; }
.connect-term-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; max-height: none; min-height: auto; }
.connect-hint { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.connect-cmd { display: flex; align-items: center; gap: 9px; }
.connect-prompt { color: var(--brand); font-family: var(--mono); }
.connect-cmd-text { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--text); }
.connect-copy {
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; background: var(--surface-2);
}
.connect-copy:hover { color: var(--brand); border-color: var(--brand-dim); }
.connect-steps { display: flex; flex-direction: column; gap: 10px; }
.connect-step { display: flex; align-items: flex-start; gap: 11px; }
.connect-step-n {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--brand);
  border: 1px solid var(--brand-dim); border-radius: 4px; width: 22px; height: 22px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.connect-step-t { font-size: 13px; color: var(--text); font-weight: 500; }
.connect-step-s { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.connect-status { font-family: var(--mono); font-size: 12px; min-height: 18px; }
.connect-status.searching { color: var(--cyan); }
.connect-status.ok { color: var(--brand); }
.connect-status.fail { color: var(--red); }

/* ============================================================================
   TUI OVERHAUL — framed panes, status bar, command palette, keyboard select.
   ========================================================================== */

/* fieldset-style framed columns: title sits ON the top border (┌─ TITLE ─┐) */
.board { padding-top: 26px; }
.column {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  position: relative;
  margin-top: 4px;
  overflow: visible;
}
.col-head {
  position: absolute; top: -11px; left: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 9px; border-bottom: none;
  background: var(--bg);          /* "cuts" the border for the legend */
}
.col-head .count { background: var(--surface-2); border: 1px solid var(--line); }
.col-body { padding-top: 16px; }

/* keyboard-selected card */
.card { position: relative; }
.card.kb-sel {
  border-color: var(--brand) !important;
  box-shadow: -3px 0 0 0 var(--brand) inset, 0 0 22px -8px var(--brand);
}
.card.kb-sel::after {
  content: '❯'; position: absolute; top: 9px; right: 9px;
  color: var(--brand); font-family: var(--mono); font-size: 12px;
}

/* ---- status / keybind bar ---- */
.statusbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 28px; padding: 0 14px;
  border-top: 1px solid var(--line); background: #0a0c0f;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); user-select: none;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sb-left { overflow: hidden; }
.sb-dim { color: var(--text-faint); white-space: nowrap; }
.sb-dim.warn { color: var(--red); }
.sb-tag { font-weight: 700; white-space: nowrap; }
.sb-tag.live { color: var(--brand); } .sb-tag.work { color: var(--cyan); }
.sb-tag.demo { color: var(--cyan); cursor: pointer; }
.sb-connect { color: var(--brand); cursor: pointer; white-space: nowrap; }
.sb-connect:hover { text-decoration: underline; }
.sb-key { display: inline-flex; align-items: center; gap: 5px; }
.sb-key kbd {
  font-family: var(--mono); font-size: 10px; color: var(--brand);
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 3px; padding: 1px 5px;
}
.sb-key-l { color: var(--text-faint); }

/* ---- command palette ---- */
.palette-scrim {
  position: fixed; inset: 0; background: rgba(5,6,9,.55); backdrop-filter: blur(3px);
  display: none; justify-content: center; align-items: flex-start; z-index: 90;
}
.palette-scrim.open { display: flex; }
.palette {
  margin-top: 12vh; width: min(640px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); overflow: hidden;
}
.palette-in { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.palette-prompt { color: var(--brand); font-family: var(--mono); }
.palette-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 14px; }
.palette-list { max-height: 46vh; overflow-y: auto; }
.palette-item { display: flex; align-items: baseline; gap: 12px; padding: 9px 15px; cursor: pointer; }
.palette-item.sel { background: rgba(61,220,132,.10); box-shadow: -3px 0 0 0 var(--brand) inset; }
.palette-item-l { font-family: var(--mono); font-size: 13px; color: var(--text); }
.palette-item-h { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-left: auto; white-space: nowrap; }

/* ---- boot splash ---- */
.boot {
  position: fixed; inset: 0; z-index: 200; background: #070809;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
/* CRT power-off: collapse to a scanline, flash, snap to a point — not a fade. */
.boot.done { animation: crt-off .34s cubic-bezier(.5, 0, .75, 1) forwards; pointer-events: none; }
@keyframes crt-off {
  0%   { transform: scaleY(1) scaleX(1);    filter: brightness(1); opacity: 1; }
  55%  { transform: scaleY(.014) scaleX(1.05); filter: brightness(2.4); opacity: 1; }
  100% { transform: scaleY(.014) scaleX(0);  filter: brightness(5); opacity: 0; }
}
.boot-art {
  font-family: var(--mono); color: var(--brand); font-size: 14px; line-height: 1.15;
  white-space: pre; text-shadow: 0 0 14px rgba(61,220,132,.45);
}
.boot-mark {
  display: flex; align-items: center; gap: 16px;
  text-shadow: 0 0 18px rgba(61,220,132,.45);
}
.boot-glyph { font-family: var(--mono); color: var(--brand); font-size: 40px; line-height: 1; }
.boot-word {
  font-family: var(--mono); color: var(--brand); font-weight: 700;
  font-size: 44px; letter-spacing: .22em;
}
.boot-line { font-family: var(--mono); color: var(--text-dim); font-size: 12px; }
.boot-caret { color: var(--brand); animation: term-blink 1s steps(1) infinite; }

/* retire the old fixed demo bar / extra padding */
.demo-bar { display: none; }
body.demo .board { padding-bottom: 0; }

/* ---- onboarding: scan + profile reveal -------------------------------- */
.onboard {
  position: fixed; inset: 0; z-index: 150; background: #070809;
  display: none; align-items: center; justify-content: center; padding: 40px;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
.onboard.show { display: flex; }
.onboard.done { display: none; }  /* instant cut, no fade */
.ob-stage { width: min(720px, 94vw); }

/* scan */
.ob-scan-head { font-family: var(--mono); font-size: 15px; color: var(--text); }
.ob-scan-head .ob-prompt { color: var(--brand); margin-right: 4px; }
.ob-scan-log { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; }
.ob-log-line { font-family: var(--mono); font-size: 13px; color: var(--text-dim); animation: ob-in .25s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-log-hit { color: var(--brand); }
@keyframes ob-in { from { opacity: 0; transform: translateY(3px); } }

/* reveal */
.ob-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--brand); text-transform: uppercase; }
.ob-title { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--text); margin-top: 8px; }
.ob-sub { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; margin-top: 8px; max-width: 620px; }
.ob-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.ob-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; transition: .12s;
}
.ob-card:hover { border-color: var(--brand-dim); }
.ob-card.on { border-color: var(--brand); background: rgba(61,220,132,.08); box-shadow: -3px 0 0 0 var(--brand) inset; }
.ob-card-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.ob-card-b { flex: 1; min-width: 0; }
.ob-card-l { font-size: 14px; font-weight: 600; color: var(--text); }
.ob-card-m { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-card-chk { font-family: var(--mono); color: var(--brand); width: 16px; text-align: center; flex: 0 0 auto; }
.ob-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ob-actions .btn { padding: 9px 18px; }

.sb-learn { color: var(--brand); white-space: nowrap; }
@media (max-width: 640px) { .ob-grid { grid-template-columns: 1fr; } }

/* ---- build (auto-analyze focus -> automations) ----------------------- */
.build-prog { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 6px 2px 4px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.build-line { display: flex; align-items: center; gap: 9px; color: var(--cyan); }
.build-count { color: var(--brand); }
.build-summary { color: var(--text); font-weight: 500; }
.build-clock { color: var(--text-faint); font-variant-numeric: tabular-nums; margin-left: 2px; }

/* keep the proof-of-life pinned while results scroll under it */
.build-sticky {
  position: sticky; top: 0; z-index: 6;
  background: var(--bg, #06090b);
  padding: 8px 0 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
/* pulsing "working" beacon — unmistakable that it's still running */
.build-pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 0 rgba(61,220,132,.65); animation: build-pulse 1.25s ease-out infinite;
}
@keyframes build-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61,220,132,.6); }
  70%  { box-shadow: 0 0 0 9px rgba(61,220,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); }
}
.build-working {
  font-size: 10.5px; letter-spacing: .14em; font-weight: 700; color: var(--brand);
  animation: build-blink 1.4s steps(2, start) infinite;
}
.build-working.stalled { color: #e0564d; animation: none; }
@keyframes build-blink { 50% { opacity: .35; } }
.build-term-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px;
  background: var(--brand); animation: build-blink 1s steps(2, start) infinite; vertical-align: middle;
}
.build-term.done .build-term-dot { animation: none; background: var(--text-faint); }

/* the live agent terminal feed */
.build-term {
  margin: 12px 0 6px; border: 1px solid var(--line); border-radius: 6px;
  background: #05080a; overflow: hidden; box-shadow: 0 0 0 1px rgba(61,220,132,.05);
}
.build-term-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--brand);
  padding: 7px 12px; border-bottom: 1px solid var(--line); background: rgba(61,220,132,.05);
  text-transform: uppercase;
}
.build-term.done .build-term-head { color: var(--text-faint); background: transparent; }
.build-term-body {
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: #8fb9a3;
  padding: 10px 12px; max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.build-term-line { animation: ob-in .18s ease; }
.build-term.done .build-term-body { color: var(--text-dim); }

/* ---- goal spree ------------------------------------------------------- */
.spree-form { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.spree-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.spree-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spree-goal { min-height: 96px; }
.spree-note { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.spree-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; margin: 12px 0; }
.spree-bar-fill { height: 100%; width: 0; background: var(--brand); transition: width .2s linear; }
.spree-tasks { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 13px; }
.spree-task { display: flex; gap: 9px; color: var(--text-dim); }
.spree-task.done { color: var(--brand); }
.spree-task.done .spree-task-t { text-decoration: line-through; opacity: .75; }
.spree-box { flex: 0 0 auto; }
.spree-blockers { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; }
.spree-blockers-h { color: #e0b341; margin-bottom: 5px; }
.spree-block { color: var(--text-dim); padding: 2px 0; }
.build-pulse.off { animation: none; background: var(--text-faint); box-shadow: none; }
.build-line.spree-done .build-working { color: var(--text-faint); animation: none; }
.wf-empty-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wf-resume {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding: 10px 14px; border: 1px solid var(--brand-dim); border-radius: 6px;
  background: rgba(61,220,132,.06); font-family: var(--mono); font-size: 13px;
}
.wf-resume-t { flex: 1; color: var(--brand); }
