:root {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text-muted: #6B7280;
  --accent: #10B981;
  --accent-dark: #059669;
  --border: #E5E7EB;
  --bubble-agent: #F3F4F6;
  --bubble-user: #D1FAE5;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-lg: 18px;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ============ WELCOME SCREEN ============ */

.welcome-header { text-align: center; margin-top: 24px; }

.logo {
  font-size: 64px;
  margin-bottom: 12px;
}

.welcome-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.tagline {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.agent-intro {
  font-size: 14px;
  color: var(--text-muted);
}

.welcome-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0 24px;
  box-shadow: var(--shadow);
}

.welcome-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.welcome-card p {
  font-size: 15px;
  color: var(--text-muted);
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:active { transform: scale(0.98); }

.preset-chips-welcome {
  margin-top: 32px;
}

.preset-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}

.chip-clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chip-clickable:hover {
  background: var(--bubble-user);
  border-color: var(--accent);
}

.welcome-footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
}

.welcome-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ CONVERSATION SCREEN ============ */

.conv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.back-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  padding: 0 8px;
  font-family: inherit;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title h2 { font-size: 18px; font-weight: 600; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active { background: var(--accent); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Mode toggles */

.mode-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.toggle-label {
  color: var(--text-muted);
  min-width: 50px;
}

.mode-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Input area */

.input-area { margin-bottom: 20px; }

.input-panel { display: none; }
.input-panel.active { display: block; }

.mic-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 32px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s, background 0.15s;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mic-btn:hover { background: var(--accent-dark); }
.mic-btn:active { transform: scale(0.98); }
.mic-btn.listening { background: #EF4444; box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35); }

.mic-icon { font-size: 36px; }
.mic-label { font-size: 15px; font-weight: 500; }

#text-form {
  display: flex;
  gap: 8px;
}

#text-question {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

#text-question:focus { border-color: var(--accent); }

.send-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.send-btn:hover { background: var(--accent-dark); }

/* Preset chips inline */

.preset-chips-inline {
  margin-bottom: 20px;
}

.preset-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 6px 0;
}

.preset-group-label:first-child {
  margin-top: 0;
}

.preset-chips-inline .chips {
  flex-direction: column;
  gap: 6px;
}

.preset-chips-inline .chip {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
}

.preset-chips-inline .chip:hover {
  background: var(--bubble-user);
  border-color: var(--accent);
}

/* Transcript */

.transcript {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
  min-height: 200px;
}

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

.bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
}

.message.agent .bubble {
  background: var(--bubble-agent);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: var(--bubble-user);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

/* Desktop adjustments */
@media (min-width: 600px) {
  body { padding: 20px 0; }
  .container { border-radius: var(--radius-lg); background: var(--bg); }
}
