/* synapse os — strict black & white, jcode.sh style. all mono, hairline rules. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #767676;
  --faint: #9a9a9a;
  --border: #e2e2e2;
  --border-soft: #eeeeee;
  --radius: 3px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
a { color: var(--text); }
::selection { background: #111; color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 420px; text-align: center; padding: 40px 24px; }
.logo { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin-bottom: 10px; }
.login-card > p { margin-bottom: 26px; }
.login-card input { width: 100%; margin-bottom: 12px; text-align: center; }
.login-card button { width: 100%; }

/* ---------- header ---------- */
header {
  display: flex; align-items: center; gap: 26px;
  max-width: 1020px; margin: 0 auto; padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px); z-index: 10;
}
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; letter-spacing: -.3px; }
nav { display: flex; gap: 18px; flex: 1; }
.tab {
  border: none; background: none; padding: 2px 0;
  font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 1px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--text); }
.header-right { display: flex; align-items: center; gap: 14px; }

/* ---------- layout ---------- */
main { max-width: 1020px; margin: 0 auto; padding: 26px 24px 80px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 34px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.section-head:first-child { margin-top: 4px; }
.section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.filters { display: flex; gap: 8px; align-items: center; }

/* ---------- controls ---------- */
input, textarea, select {
  font: inherit; font-size: 13.5px; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 11px; background: var(--bg); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: #111; }
textarea { width: 100%; resize: vertical; }
label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin: 14px 0 5px; letter-spacing: .2px;
}
.btn {
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  border-radius: var(--radius); padding: 8px 16px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.btn:hover { border-color: #111; }
.btn.primary { border-color: #111; background: #111; color: #fff; }
.btn.primary:hover { opacity: .82; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.small-btn { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- needs you ---------- */
.needs-list { display: flex; flex-direction: column; gap: 10px; }
.need {
  border: 1px solid #111; border-radius: var(--radius);
  padding: 14px 16px; background: var(--bg);
}
.need-top { display: flex; align-items: baseline; gap: 10px; }
.need-agent {
  background: #111; color: #fff; font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: var(--radius); white-space: nowrap;
}
.need-title { font-weight: 700; font-size: 13.5px; flex: 1; }
.need-q { font-size: 13px; margin: 8px 0 2px; white-space: pre-wrap; }
.need-answer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.need-answer textarea { flex: 1; }
.need-sent { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- fleet ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.agent-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; }
.agent-card .agent-head { display: flex; align-items: center; gap: 8px; }
.agent-card .agent-name { font-weight: 700; font-size: 14px; }
.agent-card .dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }
.dot.online { background: #111; }
.dot.idle { background: #d8d8d8; }
.agent-card .focus { font-size: 12px; color: var(--muted); margin: 6px 0 10px; min-height: 17px; }
.agent-card .counts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--muted); background: var(--bg);
}
.chip.strong { color: var(--text); border-color: #999; }
.chip.invert { background: #111; border-color: #111; color: #fff; }

/* ---------- tasks ---------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task { border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; }
.task.needs_human, .task.blocked { border-color: #111; }
.task-top { display: flex; align-items: center; gap: 10px; }
.task-title { font-weight: 600; font-size: 13.5px; flex: 1; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.status-pill {
  font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
  padding: 1px 8px; border-radius: var(--radius); white-space: nowrap;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg);
}
.status-in_progress { color: var(--text); border-color: var(--text); }
.status-done { color: var(--faint); text-decoration: line-through; }
.status-blocked, .status-needs_human { background: #111; border-color: #111; color: #fff; }
.task-agent { font-size: 12px; color: var(--muted); }
.task-detail { font-size: 12.5px; color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.task .checklist { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.check-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; cursor: pointer; }
.check-item input { margin-top: 3px; accent-color: #111; }
.check-item.done span { color: var(--faint); text-decoration: line-through; }
.task-actions { display: flex; gap: 6px; margin-top: 10px; }
.task-actions .btn { padding: 2px 9px; font-size: 11.5px; }
.task-meta { font-size: 11px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.progressbar { height: 3px; background: var(--border-soft); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progressbar > div { height: 100%; background: #111; transition: width .3s; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 12px; padding: 7px 2px; font-size: 12.5px;
  border-bottom: 1px solid var(--border-soft);
}
.feed-item .who { font-weight: 600; white-space: nowrap; }
.feed-item .when { color: var(--faint); margin-left: auto; white-space: nowrap; font-size: 11px; }

/* ---------- outbound ---------- */
.outbound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .outbound-grid { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.card input { width: 100%; }
.card details { margin-top: 12px; }
.card summary { cursor: pointer; }
.card .btn { margin-top: 16px; }
.research {
  margin-top: 14px; font-size: 12px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 12px;
  color: var(--muted);
}
.research strong { color: var(--text); }
.warn {
  border: 1px solid #111; padding: 7px 12px; border-radius: var(--radius);
  font-size: 12px; margin-bottom: 10px; font-weight: 600;
}

/* ---------- knowledge ---------- */
.knowledge-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.k-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; }
.k-head { display: flex; align-items: center; gap: 10px; }
.k-title { font-weight: 600; font-size: 13.5px; flex: 1; }
.k-cat {
  font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
  color: var(--muted); border: 1px solid var(--border); padding: 1px 8px; border-radius: var(--radius);
}
.k-content { font-size: 12.5px; color: #3d3d3d; margin-top: 8px; white-space: pre-wrap; }
.k-meta { font-size: 11px; color: var(--faint); margin-top: 8px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-card {
  background: var(--bg); border: 1px solid #111; border-radius: var(--radius);
  padding: 26px; width: 480px; max-height: 86vh; overflow-y: auto;
}
.modal-card h3 { font-size: 15px; margin-bottom: 4px; }
.modal-card input, .modal-card select { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- outbound (ported chat UI) ---------- */
.ob-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  padding: 4px 0 10px; border-bottom: 1px solid var(--border-soft); margin-top: 6px;
}
.ob-tab {
  display: flex; align-items: center; gap: 6px; max-width: 260px;
  font: inherit; font-size: 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--muted); padding: 4px 10px; white-space: nowrap;
}
.ob-tab.active { border-color: #111; color: #111; font-weight: 600; }
.ob-tab-title { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ob-x { color: var(--faint); padding: 0 2px; }
.ob-x:hover { color: #111; }
.ob-pulse { animation: obpulse 1.2s infinite; font-size: 11px; }
@keyframes obpulse { 50% { opacity: .35; } }
.ob-tabs-right { margin-left: auto; }

.ob-panes { display: flex; gap: 0; min-height: 480px; height: calc(100vh - 250px); }
.ob-pane { display: flex; flex-direction: column; flex: 1; min-width: 0; border-right: 1px solid var(--border-soft); }
.ob-pane:last-child { border-right: none; }
.ob-pane + .ob-pane { padding-left: 12px; }
.ob-pane-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.ob-picker { max-width: 40%; font-size: 12px; padding: 4px 8px; }
.ob-pane-close { margin-left: auto; }
.ob-bulk { display: flex; align-items: center; gap: 4px; }
.ob-bulk input { width: 170px; font-size: 12px; padding: 3px 8px; }

.ob-msgs { flex: 1; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 12px; }
.ob-empty { text-align: center; padding-top: 60px; font-size: 13px; line-height: 1.9; }
.ob-row { display: flex; }
.ob-row.right { justify-content: flex-end; }
.ob-err-row { align-items: center; gap: 8px; }
.ob-bubble {
  max-width: 90%; white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; font-size: 13px;
}
.ob-user { background: #111; color: #fff; border-color: #111; max-height: 160px; overflow-y: auto; }
.ob-pending { animation: obpulse 1.2s infinite; border-style: dashed; }
.ob-error { border-color: #111; font-weight: 600; }
.ob-error-txt { font-weight: 600; }

.ob-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ob-card input, .ob-card textarea { width: 100%; font-size: 13px; }
.ob-subj { font-weight: 600; }
.ob-research { color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.ob-research strong { color: var(--text); }
.ob-dup { border: 1px solid #111; border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; font-weight: 500; }
.ob-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ob-followups { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; margin: 0; text-transform: none; }
.ob-followups input { accent-color: #111; }
.ob-fname { width: 110px; font-size: 12px; padding: 4px 8px; }
.ob-sent-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; font-size: 13px; color: var(--muted); background: var(--bg);
}
.ob-sent-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-sent-txt strong { color: var(--text); }
.ob-replied { color: #111; font-weight: 600; }

.ob-compose { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.ob-master { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.ob-master-head { display: flex; align-items: center; gap: 8px; padding: 5px 10px; }
.ob-master-toggle { border: none; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; gap: 4px; align-items: center; }
.ob-master-toggle:hover { color: #111; }
.ob-master-toggle .rot { display: inline-block; transform: rotate(90deg); }
.ob-master-hint { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-master textarea { border: none; border-top: 1px solid var(--border-soft); border-radius: 0 0 var(--radius) var(--radius); font-size: 12px; line-height: 1.7; }
.ob-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.ob-inputrow textarea { flex: 1; resize: none; max-height: 160px; }
@media (max-width: 700px) { .ob-panes { height: auto; min-height: 420px; } }

/* ---------- meeting pre-briefs strip ---------- */
.briefs-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 4px; }
.brief-chip {
  display: flex; align-items: center; gap: 10px; font: inherit; font-size: 12.5px;
  border: 1px solid #111; border-radius: var(--radius); background: var(--bg);
  padding: 7px 12px; cursor: pointer; max-width: 100%;
}
.brief-chip:hover { background: #111; color: #fff; }
.brief-chip:hover .brief-when, .brief-chip:hover .brief-arrow { color: #fff; }
.brief-when { color: var(--muted); font-weight: 600; white-space: nowrap; }
.brief-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-arrow { color: var(--muted); white-space: nowrap; }
.brief-card { width: 640px; }
.brief-card .k-content { max-height: 55vh; overflow-y: auto; }
