/* Claude Code terminal-style chat — mimics the CLI SREs actually use */

.claude-chat {
  background: #1a1d21;
  border: 1px solid #383a3e;
  border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: #d1d2d3;
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Header bar — minimal, terminal window feel */
.claude-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #2a2d31;
  background: #141619;
}

.claude-chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #a1a1aa;
  font-weight: 500;
}

.claude-chat-header-title .spark {
  color: #d97706;
  font-size: 14px;
  line-height: 1;
}

/* Traffic lights (terminal decoration) */
.claude-chat-dots {
  display: flex;
  gap: 6px;
}
.claude-chat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3f3f46;
}

/* Body — terminal content area */
.claude-chat-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

/* Message animations */
.claude-msg {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.claude-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* User message — right-aligned with subtle bg */
.claude-msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  padding: 7px 12px;
  color: #e4e4e7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
}

/* Pasted log line inside a user message */
.claude-user-log {
  margin: 6px 0 0;
  padding: 7px 9px;
  background: #0f1013;
  border: 1px solid #2a2d31;
  border-radius: 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #a1a1aa;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  max-height: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Claude message — left-aligned with starburst prefix */
.claude-msg-reply {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
  padding-right: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  color: #d4d4d8;
}

.claude-msg-reply .spark {
  color: #d97706;
  font-size: 15px;
  line-height: 1.4;
  flex-shrink: 0;
  margin-top: 1px;
}

.claude-msg-reply strong {
  color: #e4e4e7;
  font-weight: 600;
}

/* Tool call card — framed box mimicking Claude Code's tool rendering */
.claude-tool-card {
  background: #0f1013;
  border: 1px solid #2a2d31;
  border-radius: 6px;
  overflow: hidden;
  font-size: 12.5px;
  margin: 2px 0;
}

.claude-tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #16181c;
  border-bottom: 1px solid #23262b;
  color: #a1a1aa;
  font-size: 11.5px;
  font-weight: 500;
}

.claude-tool-header .tool-icon {
  color: #d97706;
  font-size: 12px;
}

.claude-tool-header .tool-name {
  color: #e4e4e7;
}

.claude-tool-body {
  padding: 10px 12px;
  color: #d4d4d8;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tool body — cost drivers layout */
.claude-drivers-head {
  color: #e4e4e7;
  font-weight: 600;
  margin-bottom: 6px;
}

.claude-drivers-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  color: #d4d4d8;
}

.claude-drivers-row .rank {
  color: #71717a;
  flex-shrink: 0;
  width: 24px;
}

.claude-drivers-row .name {
  flex: 1;
  color: #e4e4e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.claude-drivers-row .delta {
  color: #a1a1aa;
  flex-shrink: 0;
}

.claude-drivers-row .new-flag {
  color: #fbbf24;
  margin-left: 4px;
}

.claude-drivers-footer {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #23262b;
  color: #a1a1aa;
  font-size: 11.5px;
}

/* Tool body — filter YAML */
.claude-filter-line {
  color: #d4d4d8;
}
.claude-filter-line.comment { color: #71717a; }
.claude-filter-line.key { color: #a5d8ff; }
.claude-filter-line.value { color: #fbbf24; }

/* Action button — same visual as Slack's */
.claude-action-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

.claude-console-btn {
  background: #d97706;
  color: #09090b;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.claude-console-btn:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

/* Mode toggle — top right of chat panel */
.claude-mode-toggle {
  display: inline-flex;
  gap: 2px;
  background: #0f1013;
  border: 1px solid #2a2d31;
  border-radius: 6px;
  padding: 2px;
}
.claude-mode-btn {
  background: transparent;
  border: none;
  color: #71717a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.claude-mode-btn .mode-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.15s ease;
}
.claude-mode-btn:hover { color: #d4d4d8; }
.claude-mode-btn:hover .mode-icon { filter: grayscale(0.3) opacity(0.85); }
.claude-mode-btn.active {
  background: #27272a;
  color: #e4e4e7;
}
.claude-mode-btn.active .mode-icon {
  filter: none;
  opacity: 1;
}
.claude-mode-btn.active[data-mode="claude"] {
  color: #e4b285;
}

/* Responsive */
@media (max-width: 520px) {
  .claude-chat { font-size: 12.5px; }
  .claude-chat-body { padding: 12px 14px 14px; }
  .claude-msg-user { max-width: 92%; font-size: 12.5px; }
  .claude-msg-reply { font-size: 12.5px; padding-right: 8px; }
  .claude-tool-body { font-size: 11px; }
  .claude-drivers-row .name { font-size: 11.5px; }
}
