* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #1a1a2e;
  color: #fff;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 600;
}

main {
  display: flex;
  flex: 1;
  gap: 1px;
  background: #ddd;
}

.panel {
  flex: 1;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.panel h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 16px;
}

.input-area {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

#customer-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

#customer-input:focus {
  border-color: #4a6cf7;
}

#send-btn {
  padding: 10px 20px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#send-btn:hover {
  background: #3a5ce5;
}

#assist-content {
  flex: 1;
}

#assist-content .placeholder {
  color: #bbb;
  font-style: italic;
}

#log-panel {
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 20px;
  max-height: 240px;
  overflow-y: auto;
}

#log-panel h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 12px;
}

.log-entry {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #f0f4ff;
  border-radius: 6px;
  font-size: 14px;
}

.log-entry .timestamp {
  color: #999;
  font-size: 12px;
  margin-right: 8px;
}

/* Suggestion cards */
.suggestion-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #e0e0e0;
}

.suggestion-card.top-match {
  border-left-color: #4a6cf7;
  background: #fafbff;
}

.category-badge {
  display: inline-block;
  background: #eef1ff;
  color: #4a6cf7;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.inferred-question {
  font-style: italic;
  color: #666;
  font-size: 13px;
  margin-bottom: 8px;
}

.answer {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.source {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.feedback-buttons {
  display: flex;
  gap: 8px;
}

.feedback-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.feedback-btn:hover {
  background: #f5f5f5;
}

.feedback-btn.selected {
  border-color: #4a6cf7;
  background: #eef1ff;
}

/* Loading state */
.loading {
  color: #999;
  font-style: italic;
  padding: 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #4a6cf7;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-results, .error {
  color: #999;
  font-style: italic;
  padding: 20px 0;
}

.error {
  color: #e74c3c;
}

#assist-content {
  overflow-y: auto;
}

/* Intent analysis banner */
.intent-banner {
  background: #f8f9fe;
  border: 1px solid #e0e4f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.intent-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 6px;
}

.intent-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.urgency-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.urgency-high { background: #fde8e8; color: #c0392b; }
.urgency-medium { background: #fef9e7; color: #b7950b; }
.urgency-low { background: #e8f8f5; color: #1e8449; }

.intent-text {
  font-size: 14px;
  color: #333;
}

.intent-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.keyword-tag {
  font-size: 11px;
  background: #e8ecff;
  color: #4a6cf7;
  padding: 2px 8px;
  border-radius: 3px;
}

/* Agent instruction block */
.agent-instruction {
  background: #f0faf0;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0 12px;
}

.instruction-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2e7d32;
  margin-bottom: 6px;
}

.instruction-body {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  white-space: pre-line;
}

/* FAQ details toggle */
.faq-details {
  margin: 8px 0;
}

.faq-details summary {
  font-size: 12px;
  color: #888;
  cursor: pointer;
  padding: 4px 0;
}

.faq-details summary:hover {
  color: #4a6cf7;
}

.faq-details[open] .inferred-question,
.faq-details[open] .answer {
  margin-top: 8px;
}

/* Disabled send button */
#send-btn:disabled {
  background: #a0b4f7;
  cursor: not-allowed;
}
