:root {
  --bg: #10151c;
  --panel: #171d27;
  --panel2: #1d2532;
  --border: #2a3444;
  --text: #dbe2ea;
  --muted: #8b95a5;
  --accent: #4f9cff;
  --user: #2f6fd0;
  --assistant: #3aa46f;
  --ok: #3aa46f;
  --warn: #d9a441;
  --err: #d9534f;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
}
#app { display: flex; height: 100vh; width: 100vw; }
#sidebar {
  width: 264px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 14px 0 14px; overflow-y: auto;
}
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { color: var(--muted); font-size: 11.5px; margin: 2px 0 10px; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 12px;
        padding: 3px 8px; border-radius: 20px; background: var(--panel2);
        border: 1px solid var(--border); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.ok .dot { background: var(--ok); }
.conn.bad .dot { background: var(--err); }
.conn.warn .dot { background: var(--warn); }
.conn-text { color: var(--text); font-size: 11.5px; }
.section-label { margin: 14px 0 6px; font-size: 10.5px; text-transform: uppercase;
                 letter-spacing: .8px; color: var(--muted); }
#agent-list { list-style: none; padding: 0; }
#agent-list li {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel2);
  transition: background .12s;
}
#agent-list li:hover { background: #24304a; }
#agent-list li.active { background: #26364f; border-color: var(--accent); }
#agent-list li .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.st-available .dot { background: var(--muted); }
.st-working .dot { background: var(--warn); }
.st-waiting .dot { background: #b07bd9; }
.st-complete .dot { background: var(--ok); }
.st-error .dot { background: var(--err); }
.st-unknown .dot { background: var(--muted); }
.agent-name { font-weight: 600; font-size: 13.5px; }
.agent-sub { color: var(--muted); font-size: 11px; margin-left: 4px; }
.status-chip {
  font-size: 10.5px; color: var(--muted); padding: 1px 8px;
  border-radius: 12px; background: var(--panel2); border: 1px solid var(--border);
  white-space: nowrap;
}
#agent-list li .status-chip { margin-left: auto; }
.activity { list-style: none; padding: 0; font-size: 11px;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.activity li { color: var(--muted); padding: 3px 4px; border-bottom: 1px solid #202836;
               word-break: break-all; line-height: 1.35; }
.activity li .tag { font-weight: 700; }
#chat { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
#chat-header { padding: 12px 18px; border-bottom: 1px solid var(--border);
               display: flex; align-items: center; gap: 10px; background: var(--panel); }
#chat-title { font-size: 16px; font-weight: 700; }
.chat-meta { color: var(--muted); font-size: 11px; }
#messages { flex: 1; overflow-y: auto; padding: 16px 18px; }
.msg { display: flex; gap: 10px; margin: 8px 0; max-width: 92%; }
.msg .bubble {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 10px; white-space: pre-wrap;
  word-break: break-word; max-width: 100%;
}
.msg.user { flex-direction: row-reverse; margin-left: auto; max-width: 82%; }
.msg.user .bubble { background: #243d63; border-color: var(--user); }
.msg .who { font-size: 10.5px; color: var(--muted); }
.msg .seq { font-size: 10px; color: var(--muted); }
.streaming .bubble::after {
  content: ""; display: inline-block; width: 7px; height: 13px;
  background: var(--warn); margin-left: 3px; animation: blink 1s steps(2, end) infinite;
}
@keyframes blink { 0% { opacity: .15; } 100% { opacity: 1; } }
#composer-wrap { display: flex; flex-direction: column; padding: 12px 18px;
                 border-top: 1px solid var(--border); background: var(--panel); }
#composer { display: flex; gap: 10px; }
textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 140px;
  background: #0d1119; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
#send-btn {
  background: var(--accent); color: #0b0f14; border: 0; border-radius: 8px;
  padding: 0 18px; font-weight: 600; cursor: pointer;
}
#send-btn:disabled { background: #2c3a52; color: var(--muted); cursor: not-allowed; }
#send-state { min-height: 18px; font-size: 11px; color: var(--muted);
              padding-top: 4px; word-break: break-all; }
#send-state.error { color: var(--err); }
#send-state.ok { color: var(--ok); }
#send-state.queued { color: var(--warn); }
.st-queued .dot { background: var(--warn); }
.status-chip.queued { color: var(--warn); border-color: var(--warn); }
/* ================= Phase 2C — War Room additions (additive) ================= */
#agent-list { list-style: none; padding: 0; }
#agent-list li {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel2);
  transition: background .12s; flex-wrap: wrap;
}
#agent-list li:hover { background: #24304a; }
#agent-list li.active { background: #26364f; border-color: var(--accent); }
#agent-list li.inert { cursor: default; opacity: .72; }
#agent-list li .avatar {
  width: 26px; height: 26px; border-radius: 50%; color: #0b0f14;
  font-size: 10.5px; font-weight: 700; line-height: 26px; text-align: center;
  flex: 0 0 auto;
}
/* CC-UI 2026-09-18 (David #798): canon face thumbnails — the same
   .avatar slot now holds an <img> when a canon photo exists; the letter
   chip rules above remain the fallback (operator/guests/gauge-pending). */
#agent-list li img.avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  flex: 0 0 auto;
}
.msg img.face-thumb {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
  flex: 0 0 auto;
}
#agent-list li .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
#agent-list li .agent-name { font-weight: 600; font-size: 13px; }
#agent-list li .agent-sub { color: var(--muted); font-size: 10.5px; }
#agent-list li .status-chip { margin-left: auto; white-space: normal; }
.st-online .dot { background: var(--ok); }
.st-ready .dot { background: var(--ok); }
.st-offline .dot { background: var(--err); }
.st-thinking .dot { background: #7fb0e8; }
.st-working .dot { background: var(--warn); }
.st-waiting .dot { background: #b07bd9; }
.st-queued .dot { background: var(--warn); }
.st-error .dot { background: var(--err); }
.st-unknown .dot { background: var(--muted); }

.operator-card {
  margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel2); font-size: 11px;
  color: var(--muted);
}
.operator-card.hidden { display: none; }
.operator-card .op-title { font-weight: 700; color: var(--text); }
.operator-card .op-line { margin-top: 4px; }
.operator-card .op-facts { font-family: ui-monospace, Menlo, Consolas, monospace; }

.transcript-tabs {
  display: flex; gap: 4px; padding: 4px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.transcript-tabs .tab {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-size: 11px; padding: 3px 10px; border-radius: 12px; cursor: pointer;
}
.transcript-tabs .tab.active { background: #26364f; color: var(--text); border-color: var(--accent); }

#right {
  width: 300px; background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 14px 0 14px; overflow-y: auto;
}
.panel-list { list-style: none; padding: 0; font-size: 11px; }
.panel-list li {
  padding: 7px 8px; margin-bottom: 4px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel2); color: var(--muted);
}
.panel-list li.empty { color: var(--muted); border-style: dashed; }
.panel-list li .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; margin-right: 4px; }
.mission-title { font-weight: 600; color: var(--text); display: block; }
.mission-meta { word-break: break-word; }
.worker-key { font-family: ui-monospace, Menlo, Consolas, monospace; display: block; }
.worker-meta { word-break: break-word; }

.target-select {
  background: #0d1119; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 6px; font-size: 12px; max-width: 150px;
}
#composer { display: flex; gap: 8px; align-items: stretch; }
