/* Ask BC chat panel — slides in from the right when the header button is clicked. */

#ask-bc-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface, #ffffff);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  z-index: 9999;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  border-left: 1px solid var(--ink-faint, #e5e7eb);
}
#ask-bc-panel.is-open { display: flex; }

.ask-bc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1565c0;
  color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.ask-bc-header-logo {
  width: 103px;
  height: auto;
  display: block;
  flex-shrink: 0;
}
.ask-bc-header-sub {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
}
.ask-bc-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  font-size: 22px;
  line-height: 1;
  border-radius: 6px;
}
.ask-bc-close:hover { background: rgba(255, 255, 255, 0.15); color: white; }

.ask-bc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ask-bc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ask-bc-msg.user {
  align-self: flex-end;
  background: #1565c0;
  color: white;
  border-bottom-right-radius: 4px;
}
.ask-bc-msg.assistant {
  align-self: flex-start;
  background: var(--surface-alt, #f1f5f9);
  color: var(--ink, #1f2937);
  border-bottom-left-radius: 4px;
}
.ask-bc-msg.error {
  align-self: flex-start;
  background: #fee2e2;
  color: #991b1b;
}
.ask-bc-msg code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}
.ask-bc-msg.user code { background: rgba(255, 255, 255, 0.18); }

.ask-bc-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-alt, #f1f5f9);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.ask-bc-typing span {
  width: 7px;
  height: 7px;
  background: var(--ink-soft, #6b7280);
  border-radius: 50%;
  animation: ask-bc-dots 1.2s infinite;
}
.ask-bc-typing span:nth-child(2) { animation-delay: 0.15s; }
.ask-bc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-bc-dots {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

.ask-bc-confirm {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #fef3c7;
  border-top: 1px solid #f59e0b;
}
.ask-bc-confirm button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.ask-bc-confirm .confirm { background: #16a34a; color: white; }
.ask-bc-confirm .cancel  { background: #dc2626; color: white; }

.ask-bc-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ink-faint, #e5e7eb);
  background: var(--surface, #ffffff);
}
.ask-bc-input-area input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--ink-faint, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.ask-bc-input-area input:focus { border-color: #1565c0; }
.ask-bc-input-area button {
  padding: 10px 18px;
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.ask-bc-input-area button:disabled { background: #9ca3af; cursor: not-allowed; }

.ask-bc-toolbadge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 4px;
  background: rgba(21, 101, 192, 0.1);
  color: #1565c0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
