body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: #ffffff;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 15px;
}
.header-icon {
  font-size: 48px;
  margin: 10px 0;
}
.chat-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 80vh;
  max-width: 600px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}
.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 3px;
}
.message {
  margin: 12px 0;
  max-width: 80%;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
}
.timestamp {
  font-size: 0.7em;
  color: #888;
  margin-bottom: 4px;
  user-select: none;
}
/* Scenario bubble - centered container, left-justified text */
.message.scenario {
  align-self: center !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  margin: 12px 0 !important;
}
.message.scenario .bubble {
  background: #e8e8e8;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px 20px;
  max-width: 450px;
  min-width: 300px;
  text-align: left !important;
}
.scenario-title {
  font-size: 0.8em !important;
  font-weight: bold !important;
  text-transform: uppercase !important;
  margin-bottom: 8px !important;
  color: #555 !important;
}
.scenario-content {
  font-size: 1em !important;
  line-height: 1.4 !important;
  text-transform: none !important;
}
/* Bot message */
.bot .message-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.bot .avatar {
  font-size: 1.5em;
}
.bot-bubble {
  background: #cce4ff;     /* light blue */
  color: #000;
  border-radius: 10px 10px 10px 0;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* Coaching tip message */
.coach .message-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.coach .avatar {
  font-size: 1.5em;
}
.coach-bubble {
  background: #fff9c4; /* lighter yellow */
  color: #000;
  border-radius: 10px 10px 10px 0;
  padding: 10px;
  line-height: 1.4;
  font-weight: normal; /* explicitly not bold */
  font-size: 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* User message (avatar on right) */
.user .message-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: flex-end;
}
.user .avatar {
  font-size: 1.5em;
  order: 2; /* avatar after bubble */
}
.user .bubble {
  background: #d0ffd0;
  border-radius: 10px 10px 0 10px;
  padding: 10px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* Generic bubble style */
.bubble {
  word-wrap: break-word;
  max-width: 100%;
  font-size: 1.1rem;
  line-height: 1.4;
}
.bubble.loading {
  font-style: italic;
  color: #888;
  position: relative;
}

.bubble.loading::after {
  content: "";
  animation: dots 1.4s infinite;
  position: absolute;
}

@keyframes dots {
  0% { content: "."; }
  25% { content: ".."; }
  50% { content: "..."; }
  75% { content: ""; }
  100% { content: ""; }
}
/* Input row */
.input-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  max-width: 600px;
}
input[type="text"] {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1em;
  box-sizing: border-box;
}
.send-btn,
.mic-btn {
  font-size: 1.5em;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: transform 0.1s ease-in-out;
}
.send-btn:hover,
.mic-btn:hover {
  transform: scale(1.1);
}
.send-btn:active,
.mic-btn:active {
  transform: scale(0.95);
}