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

body {
  font-family: Georgia, "Times New Roman", serif;
  background: #f5f1eb;
  color: #2c2c2c;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: #1a3a2a;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover {
  opacity: 0.7;
}

/* Chat area */

.chat {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Intro / symptom form */

.intro label {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: #1a3a2a;
}

.intro textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #c5bfb3;
  border-radius: 6px;
  background: #fff;
  color: #2c2c2c;
  resize: vertical;
}

.intro textarea:focus {
  outline: none;
  border-color: #1a3a2a;
}

.intro textarea.invalid {
  border-color: #c06030;
}

.intro button {
  margin-top: 0.75rem;
  padding: 0.6rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  background: #1a3a2a;
  color: #f5f1eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.intro button:hover {
  background: #2a5a3a;
}

/* Message bubbles */

.message {
  max-width: 85%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.patient {
  align-self: flex-end;
  background: #d4e6dc;
  color: #1a3a2a;
  border-bottom-right-radius: 2px;
  font-style: italic;
}

.message.gp {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #ddd8ce;
  border-bottom-left-radius: 2px;
}

.message.gp .speaker {
  font-weight: bold;
  font-size: 0.85rem;
  color: #1a3a2a;
  margin-bottom: 0.3rem;
}

/* Choices */

.choices {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fade-in 0.3s ease;
}

.choices button {
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: #1a3a2a;
  border: 1px solid #1a3a2a;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.choices button:hover {
  background: #1a3a2a;
  color: #f5f1eb;
}

/* Ending */

.message.ending {
  border-left: 3px solid #1a3a2a;
}

.restart {
  align-self: center;
  margin-top: 0.5rem;
  animation: fade-in 0.3s ease;
}

.restart button {
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: transparent;
  color: #6b6b6b;
  border: 1px solid #c5bfb3;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.restart button:hover {
  border-color: #1a3a2a;
  color: #1a3a2a;
}

/* Loading indicator */

.typing {
  align-self: flex-start;
  padding: 0.85rem 1rem;
  animation: fade-in 0.2s ease;
}

.typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  background: #aaa;
  border-radius: 50%;
  animation: dot-pulse 1s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* Debug bar */

.debug-bar {
  margin-top: 0.6rem;
  padding: 0.4rem 0.5rem;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #888;
  background: #f9f7f4;
  border-top: 1px dashed #ddd8ce;
  border-radius: 0 0 6px 6px;
  word-break: break-word;
}

.debug-bar .debug-label {
  font-weight: bold;
  color: #999;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.debug-bar .debug-topic {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  background: #d4e6dc;
  color: #1a3a2a;
  border-radius: 3px;
  font-size: 0.65rem;
}

.debug-bar .debug-ack {
  color: #6a8f7a;
  font-style: italic;
}

.debug-bar .debug-callback {
  color: #c06030;
  font-weight: bold;
  font-style: italic;
}

/* Disclaimer */

.disclaimer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #a09a90;
  font-style: italic;
}
