* {
  box-sizing: border-box;
}

:root {
  --red: #d71920;
  --red-dark: #b51218;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6d737c;
  --border: #e2e5e9;
  --user: #d71920;
  --assistant: #f0f1f3;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(215,25,32,.10), transparent 32%),
    var(--bg);
}

.app-shell {
  width: min(100%, 900px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 20px;
}

h1 {
  margin: 0;
  font-size: 18px;
}

.app-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.demo-badge {
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid #f0b4b7;
  border-radius: 999px;
  color: var(--red-dark);
  background: #fff5f5;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 22px 16px 10px;
}

.message-row {
  display: flex;
  margin: 0 0 14px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message {
  max-width: min(82%, 620px);
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 14px;
  white-space: pre-wrap;
}

.message.user {
  color: #fff;
  background: var(--user);
  border-bottom-right-radius: 5px;
}

.message.assistant {
  background: var(--assistant);
  border-bottom-left-radius: 5px;
}

.typing {
  color: var(--muted);
  font-style: italic;
}

.quick-questions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.quick-btn {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid #d9dde2;
  border-radius: 999px;
  color: #333;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.quick-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 12px 13px;
  border: 1px solid #d6d9de;
  border-radius: 12px;
  outline: none;
  font: inherit;
  line-height: 1.3;
}

textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215,25,32,.10);
}

#send-btn {
  align-self: stretch;
  min-width: 82px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--red);
  font-weight: 700;
  cursor: pointer;
}

#send-btn:hover:not(:disabled) {
  background: var(--red-dark);
}

#send-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.disclaimer {
  padding: 11px 16px;
  color: #646a72;
  background: #f7f7f8;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  body {
    padding: 24px;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,.07);
  }

  .chat-card {
    min-height: 600px;
  }

  .chat {
    padding: 28px 24px 14px;
  }

  .quick-questions {
    padding-left: 24px;
    padding-right: 24px;
  }

  .input-area {
    padding-left: 24px;
    padding-right: 24px;
  }
}
