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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
}

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

header {
  text-align: center;
  padding: 24px 0 16px;
}

header h1 {
  font-size: 1.8rem;
  color: #1a202c;
}

.subtitle {
  color: #718096;
  font-size: 0.9rem;
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  border-color: #4f86f7;
  background: #ebf4ff;
  color: #2b6cb0;
}

.mode-hint {
  text-align: center;
  font-size: 0.85rem;
  color: #718096;
  margin-bottom: 12px;
}

.chat-box {
  background: white;
  border-radius: 16px;
  padding: 16px;
  min-height: 360px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.message {
  display: flex;
}

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

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.6;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.assistant .bubble {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  color: #2d3748;
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: #4f86f7;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.loading .bubble {
  color: #a0aec0;
  font-style: italic;
}

.input-area {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#userInput {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#userInput:focus {
  border-color: #4f86f7;
}

#sendBtn {
  padding: 12px 20px;
  background: #4f86f7;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#sendBtn:hover {
  background: #3a72e8;
}

#sendBtn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.quick-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #718096;
}

.quick {
  padding: 6px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.83rem;
  color: #4a5568;
  transition: all 0.2s;
}

.quick:hover {
  border-color: #4f86f7;
  color: #2b6cb0;
}

@media (max-width: 480px) {
  header h1 { font-size: 1.4rem; }
  .chat-box { min-height: 300px; max-height: 380px; }
  .bubble { max-width: 92%; font-size: 0.9rem; }
}
