:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #657083;
  --line: #dce1e8;
  --accent: #1e4d7b;
  --accent-dark: #143957;
  --assistant: #eef4fa;
  --user: #eaf6ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 18px 24px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
}

.hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.chat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(21, 38, 58, .08);
  overflow: hidden;
}

.messages {
  height: min(62vh, 620px);
  overflow-y: auto;
  padding: 22px;
}

.message {
  max-width: 82%;
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message p { margin: 0; }

.assistant {
  background: var(--assistant);
  border-top-left-radius: 6px;
}

.user {
  background: var(--user);
  border-top-right-radius: 6px;
  margin-left: auto;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  color: var(--text);
}

textarea:focus {
  outline: 3px solid rgba(30, 77, 123, .12);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button:disabled { opacity: .55; cursor: wait; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
}

@media (max-width: 680px) {
  .page { padding-top: 24px; }
  .chat-form { grid-template-columns: 1fr; }
  button { min-height: 48px; }
  .message { max-width: 94%; }
}
