/* Command Center COMMS — standalone team-communications surface + audio lane.
   Night build 2026-09-18 (David #4213/#4215).  Own file; the frozen
   war-room style.css is NOT touched (comms serves its own styles). */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
: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;
}
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: 300px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 14px 0 14px;
  overflow: hidden;
}
.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-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; max-height: 26vh; overflow-y: auto; }
#agent-list li {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel2);
}
#agent-list li.active { background: #26364f; border-color: var(--accent); }
#agent-list li .avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  flex: 0 0 auto; border: 1px solid var(--border);
}
#agent-list li .avatar-init {
  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; background: var(--accent);
}
#agent-list li .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.st-online .dot, .st-ready .dot { background: var(--ok); }
.st-working .dot { background: var(--warn); }
.st-thinking .dot { background: #7fb0e8; }
.st-waiting .dot { background: #b07bd9; }
.st-offline .dot, .st-error .dot { background: var(--err); }
.st-unknown .dot { background: var(--muted); }
.agent-name { font-weight: 600; font-size: 13px; }
.agent-sub { color: var(--muted); font-size: 10.5px; }
/* AUDIO panel */
.audio-panel { padding: 8px; }
.audio-modes { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.mode-btn { padding: 6px 10px; border-radius: 8px; background: #24304a; color: var(--text);
            border: 1px solid var(--border); font-size: 12px; cursor: pointer; }
.mode-btn:hover { background: #2b3a57; }
.mode-btn.active { background: #1f5f4a; color: #fff; border: 1px solid var(--ok); font-weight: 600; }
.audio-label { display: block; font-size: 10.5px; color: var(--muted); margin: 4px 0 2px; }
#in-device, #out-device {
  width: 100%; background: #0d1119; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 6px;
  font-size: 11.5px;
}
.mic-btn {
  width: 100%; margin-top: 8px; padding: 8px 0; border-radius: 10px;
  background: #24304a; color: var(--text); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
}
.mic-btn.recording { background: var(--err); color: #fff; }
.mic-btn:disabled { opacity: .45; cursor: not-allowed; }
.audio-status { font-size: 11px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.audio-status.error { color: var(--err); }
.audio-status.ok { color: var(--ok); }
.audio-hint { font-size: 10px; color: var(--muted); margin-top: 4px; }
.activity { list-style: none; padding: 0; font-size: 11px;
            max-height: 26vh; overflow-y: auto;
            font-family: ui-monospace, 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 */
#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);
               position: sticky; top: 0; z-index: 5; }
#chat-title { font-size: 16px; font-weight: 700; }
.chat-meta { color: var(--muted); font-size: 11px; }
.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; }
#messages { flex: 1; overflow-y: auto; padding: 16px 18px; }
.msg { display: flex; gap: 10px; margin: 8px 0; max-width: 92%; }
.msg .avatar {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
}
.msg .who { font-size: 10.5px; color: var(--muted); }
.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); }
/* COMPOSER */
#composer-wrap { display: flex; flex-direction: column; padding: 12px 18px;
                 border-top: 1px solid var(--border); background: var(--panel); }
#composer { display: flex; gap: 8px; align-items: stretch; }
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; }
.target-select { background: #0d1119; color: var(--text); border: 1px solid var(--border);
                 border-radius: 8px; padding: 6px 6px; font-size: 12px; max-width: 150px; }
#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); }
/* AVATAR CALL WINDOWS (David #4224, merged build) — summon buttons,
   Break-for-Control, and the honest update dock.  Additive. */
.call-panel { margin-top: 6px; }
.call-buttons { display: flex; flex-direction: column; gap: 6px; }
.call-btn {
  display: flex; align-items: center; gap: 8px;
  background: #161b22; color: #e6edf3; border: 1px solid #30363d;
  border-radius: 10px; padding: 6px 10px; font-size: 13px; cursor: pointer;
  text-align: left; width: 100%;
}
.call-btn:hover { border-color: #1f6feb; background: #1f6feb22; }
.call-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: #0d1117;
}
.bfc-btn {
  width: 100%; margin-top: 8px;
  background: #f8514922; color: #ff7b72; border: 1px solid #f8514966;
  border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.bfc-btn:hover { background: #f8514933; }
.bfc-btn.on { background: #f8514955; color: #ffa198; }
.bfc-state { font-size: 11px; color: #8b949e; margin-top: 4px; }
.bfc-state.on { color: #ff7b72; }
.cc-dock { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cc-card {
  background: #161b22; border: 1px solid #30363d; border-left: 3px solid #1f6feb;
  border-radius: 8px; padding: 8px 10px; font-size: 12px;
}
.cc-card-who { color: #8b949e; font-size: 11px; margin-bottom: 2px; }
.cc-card-text { color: #e6edf3; margin-bottom: 6px; }
.cc-card-btn {
  background: #1f6feb; color: #fff; border: 0; border-radius: 8px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.cc-card-btn:hover { background: #388bfd; }
