#cci-agent-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--beacon), var(--beacon-dim));
  color: var(--navy-base);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
#cci-agent-launcher:hover { transform: scale(1.06); }
#cci-agent-launcher svg { width: 26px; height: 26px; }

#cci-agent-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 999;
  width: min(360px, calc(100vw - 44px));
  height: min(520px, calc(100vh - 140px));
  background: var(--navy-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--body);
}
#cci-agent-panel.open { display: flex; }

.cci-agent-header {
  padding: 14px 16px;
  background: var(--navy-panel-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cci-agent-header-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cci-agent-header-title::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 6px var(--signal);
}
.cci-agent-header-actions { display: flex; align-items: center; gap: 6px; }
.cci-agent-icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-mid); width: 28px; height: 28px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.cci-agent-icon-btn:hover { color: var(--text-hi); background: rgba(255,255,255,0.06); }
.cci-agent-icon-btn.active { color: var(--signal); }
.cci-agent-icon-btn svg { width: 16px; height: 16px; }

.cci-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cci-agent-msg {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.cci-agent-msg.user {
  align-self: flex-end;
  background: var(--beacon);
  color: var(--navy-base);
  border-bottom-right-radius: 3px;
}
.cci-agent-msg.assistant {
  align-self: flex-start;
  background: var(--navy-panel-2);
  color: var(--text-hi);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
}
.cci-agent-msg.system {
  align-self: center;
  color: var(--text-low);
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: center;
}
.cci-agent-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
}
.cci-agent-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-low);
  animation: cci-agent-bounce 1.2s infinite ease-in-out;
}
.cci-agent-typing span:nth-child(2) { animation-delay: .15s; }
.cci-agent-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cci-agent-bounce {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.cci-agent-input-row {
  border-top: 1px solid var(--line);
  padding: 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--navy-panel);
}
.cci-agent-input {
  flex: 1;
  resize: none;
  max-height: 90px;
  background: var(--navy-base);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-hi);
  font-family: var(--body);
  font-size: 13.5px;
  padding: 9px 11px;
  line-height: 1.4;
}
.cci-agent-input:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
.cci-agent-input::placeholder { color: var(--text-low); }

.cci-agent-mic, .cci-agent-send {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--navy-panel-2);
  color: var(--text-mid);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.cci-agent-mic svg, .cci-agent-send svg { width: 16px; height: 16px; }
.cci-agent-mic:hover, .cci-agent-send:hover { color: var(--text-hi); border-color: var(--text-mid); }
.cci-agent-send.primary { background: var(--beacon); border-color: var(--beacon); color: var(--navy-base); }
.cci-agent-send.primary:hover { background: #ff7d4d; }
.cci-agent-mic.listening {
  background: var(--beacon-dim);
  border-color: var(--beacon);
  color: var(--navy-base);
  animation: cci-agent-pulse 1.4s infinite;
}
@keyframes cci-agent-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,107,53,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255,107,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,53,0); }
}

.cci-agent-mic[hidden] { display: none; }

@media (max-width: 480px) {
  #cci-agent-panel { right: 12px; left: 12px; width: auto; bottom: 84px; }
  #cci-agent-launcher { right: 16px; bottom: 16px; }
}
