/* HKL AI Assistant - SolverAI brand palette
   (pulled from solverai.co's own CSS: --accent-grad and --cta-grad) */
:root {
  --accent-purple: #7c3aed;
  --accent-violet: #a855f7;
  --accent-pink: #ec4899;
  --accent-grad: linear-gradient(120deg, #7c3aed 0%, #a855f7 45%, #ec4899 100%);
  --cta-orange: #f97316;
  --cta-grad: linear-gradient(120deg, #f97316 0%, #fb8c3e 55%, #fbae3c 100%);

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f7f7fc;
  --border: #e5e5ea;
  --text: #3a3a44;
  --text-muted: #7a7a86;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 820px;
  margin: 0 auto;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-grad);
  flex-shrink: 0;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.poc-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-purple);
  background: #f4f0fe;
  border: 1px solid #e6e1f2;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---- Chat area ---- */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
}

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.empty-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-grad);
  margin-bottom: 18px;
}
.empty-state h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.empty-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 520px;
}
.suggestion-chip {
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.suggestion-chip:hover {
  border-color: var(--accent-violet);
  background: var(--surface-soft);
}
.suggestion-chip .chip-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-grad);
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0 24px;
}

.msg { display: flex; gap: 12px; max-width: 100%; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.msg.user .msg-avatar { background: var(--text); }
.msg.assistant .msg-avatar { background: var(--accent-grad); }

.msg-body {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user .msg-body { color: var(--text); }
.msg.assistant .msg-body { color: var(--text); }

.msg-body.pending::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent-violet);
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.msg-body table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
  width: 100%;
}
.msg-body th, .msg-body td {
  border: 1px solid var(--border);
  padding: 5px 9px;
  text-align: left;
}
.msg-body th { background: var(--surface-soft); font-weight: 600; }

/* ---- Composer ---- */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 20px 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(58, 58, 68, 0.05);
}
.composer textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  max-height: 160px;
  padding: 6px 4px;
}
.composer textarea::placeholder { color: var(--text-muted); }

.composer button {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--cta-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.composer button:hover { opacity: 0.92; }
.composer button:active { transform: scale(0.95); }
.composer button:disabled { opacity: 0.4; cursor: not-allowed; }

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 20px 14px;
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
  .app-header, .chat { padding-left: 14px; padding-right: 14px; }
  .composer { margin-left: 14px; margin-right: 14px; }
  .disclaimer { margin-left: 14px; margin-right: 14px; }
}
