/* Live chat */

* { box-sizing: border-box; }
body.chat-standalone,
.chat-app-mount.chat-page {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f7;
  color: #111827;
}
.dev-banner {
  text-align: center;
  padding: 8px 16px;
  background: #f59e0b;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.dev-banner a { color: #1f2937; text-decoration: underline; }
html.chat-embed .app-wrap {
  min-height: 100%;
}
.app-wrap {
  display: flex;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}
.chat-column {
  flex: 1;
  min-width: 0;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
}
h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.version {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 400;
  vertical-align: middle;
  margin-left: 6px;
}
.subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}
.chat-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.messages {
  flex: 1;
  min-height: 200px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* When viewing a loaded transcript, messages fill the whole chat card */
.chat-card.transcript-view .messages {
  max-height: none;
}
.bubble {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 90%;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.user {
  align-self: flex-end;
  background: #2563eb;
  color: white;
  border-bottom-right-radius: 4px;
}
.bubble.bot {
  align-self: flex-start;
  background: #f3f4f6;
  color: #111827;
  border-bottom-left-radius: 4px;
}
.bubble.thinking {
  align-self: flex-start;
  background: #f3f4f6;
  color: #9ca3af;
  font-style: italic;
  border-bottom-left-radius: 4px;
}
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: flex-end;
}
textarea {
  flex: 1;
  min-height: 60px;
  max-height: 120px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
}
textarea:focus {
  outline: 2px solid #2563eb33;
  border-color: #2563eb;
}
button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
button:disabled { opacity: 0.5; cursor: default; }
.footer-note {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 4px;
}
.upload-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.transcript-btn {
  background: #f3f4f6;
  color: #374151;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.transcript-btn:hover { background: #e5e7eb; }
.transcript-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}
.transcript-bar .filename {
  font-size: 0.8rem;
  color: #6b7280;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bubble.llm-entry {
  align-self: flex-start;
  background: #fef9c3;
  color: #92400e;
  font-size: 0.78rem;
  border-bottom-left-radius: 4px;
  font-family: monospace;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .app-wrap {
    flex-direction: column;
    min-height: 100dvh;
  }
  .chat-column {
    padding: 16px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  h1 { font-size: 1.3rem; }
  .subtitle { font-size: 0.82rem; margin-bottom: 1rem; }
  .chat-card {
    padding: 14px 12px 12px;
    border-radius: 12px;
  }
  .messages {
    max-height: 55vh;
    min-height: 140px;
  }
  textarea {
    font-size: 16px;
    min-height: 48px;
    max-height: 96px;
    resize: none;
    padding: 10px 12px;
  }
  button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }
  .footer-note { display: none; }
}
    