.gdpai-chat-root, .gdpai-chat {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

.gdpai-chat {
  --gdpai-accent: var(--gdpai-brand, #0ea5e9);
  width: min(720px, 100%);
  margin: 1rem auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  background: #fff;
}

.gdpai-header {
  padding: 12px 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.02), rgba(0,0,0,0.02));
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gdpai-dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--gdpai-accent);
  box-shadow: 0 0 0 4px rgba(14,165,233,0.15);
}
.gdpai-title { font-weight: 600; }

.gdpai-messages {
  padding: 16px;
  height: min(60vh, 560px);
  overflow: auto;
  background: #fcfcfd;
}

.gdpai-msg {
  margin: 10px 0;
  display: grid;
  gap: 6px;
}

.gdpai-msg .role { font-size: 12px; color: #64748b; }
.gdpai-msg .bubble {
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.45;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.gdpai-msg.user .bubble {
  border-color: rgba(14,165,233,0.35);
  background: rgba(14,165,233,0.06);
}

/* Assistant content tables */
.gdpai-chat .bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 14px;
}
.gdpai-chat .bubble th,
.gdpai-chat .bubble td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}
.gdpai-chat .bubble thead th {
  background: #f8fafc;
  font-weight: 600;
}
.dark .gdpai-chat .bubble th,
.dark .gdpai-chat .bubble td { border-color: #1f2937; }
.dark .gdpai-chat .bubble thead th { background: #111827; }

.gdpai-footer {
  border-top: 1px solid #f1f5f9;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.gdpai-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  outline: none;
}
.gdpai-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  background: var(--gdpai-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.gdpai-btn[disabled] { opacity: .6; cursor: not-allowed; }
.gdpai-meta {
  padding: 8px 14px 14px;
  color: #94a3b8;
  font-size: 12px;
}
.dark .gdpai-chat { background: #0b0f14; border-color: #1f2937; }

/* Grounding metadata styling */
.gdpai-chat .bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.gdpai-chat .gdpai-grounding {
  font-size: 12px;
  color: #64748b;
}
.gdpai-chat .gdpai-grounding .gdpai-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f5f9;
}
.dark .gdpai-chat .gdpai-grounding .gdpai-chip {
  background: #1f2937;
}
.gdpai-chat .gdpai-grounding a {
  text-decoration: none;
}
.gdpai-chat .gdpai-grounding .gdpai-sep {
  margin: 0 4px;
}
.gdpai-chat .bubble-wrap{display:flex;flex-direction:column;gap:.25rem}
.gdpai-chat .gdpai-grounding{font-size:12px;color:#64748b}
.gdpai-chat .gdpai-grounding .gdpai-chip{display:inline-block;padding:2px 6px;border-radius:999px;background:#f1f5f9}
.gdpai-chat.dark .gdpai-grounding .gdpai-chip{background:#1f2937}
.gdpai-chat .gdpai-grounding a{text-decoration:none}
.gdpai-chat .gdpai-grounding .gdpai-sep{margin:0 4px}
