:root {
  --bg: #f7f5f2;
  --panel: #ffffff;
  --text: #1d1d1d;
  --muted: #5f5a54;
  --line: #e6e0d8;
  --dark: #111827;
  --dark-2: #1f2937;
  --soft: #faf8f5;
  --shadow: 0 10px 28px rgba(0,0,0,0.05);
  --green: #15803d;
  --blue: #2563eb;
  --red-bg: #fef2f2;
  --red-text: #991b1b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

.page {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand a {
  font-size: 1.3rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.hero {
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  margin: 0 0 14px;
}

.lead {
  max-width: 820px;
  font-size: 1.05rem;
  color: #444;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.counter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.counter-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.counter-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--text);
}

.chat-box {
  min-height: 360px;
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fafaf9;
  padding: 16px;
  margin-bottom: 18px;
  scroll-behavior: smooth;
}

.user-message,
.mentor-message {
  margin-bottom: 16px;
  max-width: 88%;
}

.user-message {
  margin-left: auto;
}

.message-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #78716c;
  margin-bottom: 6px;
}

.message-body {
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.55;
  white-space: normal;
}

.user-message .message-body {
  background: var(--dark);
  color: #fff;
}

.mentor-message .message-body {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.system-message .message-body {
  background: #f5f5f4;
}

.error-message .message-body {
  border-color: #ef4444;
  background: var(--red-bg);
  color: var(--red-text);
}

.answer-question-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #78716c;
  margin-bottom: 6px;
}

.answer-question-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.quick-prompts {
  margin-top: 14px;
}

.quick-prompts-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.chip {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #374151;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  background: #fff;
  transform: translateY(-1px);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-row input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d6d3d1;
  font-size: 1rem;
  background: #fff;
}

.input-row input:focus {
  outline: 2px solid #d1d5db;
  outline-offset: 1px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.96rem;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--dark);
  color: #fff;
}

.btn-primary:hover {
  background: var(--dark-2);
}

.btn-primary.is-accepted {
  background: var(--green);
}

.btn-primary.is-thinking {
  background: var(--blue);
}

.small-note {
  margin-top: 10px;
  font-size: 0.84rem;
  color: #78716c;
}

@media (max-width: 760px) {
  .topbar {
    padding: 18px 16px;
  }

  .nav {
    display: none;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 18px;
  }

  .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-box {
    min-height: 300px;
  }

  .conversation-header {
    flex-direction: column;
    align-items: start;
  }
}