:root {
  --bg: #f4efe5;
  --panel: rgba(255, 252, 247, 0.84);
  --panel-strong: #fffaf3;
  --text: #17211f;
  --muted: #566461;
  --line: rgba(23, 33, 31, 0.1);
  --brand: #0f766e;
  --brand-deep: #0b4f4a;
  --accent: #db7c2f;
  --danger: #b9382f;
  --shadow: 0 24px 80px rgba(23, 33, 31, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(219, 124, 47, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 30%),
    linear-gradient(135deg, #f6f2ea 0%, #ece6db 100%);
}
body { min-height: 100vh; }
code {
  font-family: inherit;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
}
.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}
.hero-panel, .chat-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.hero-panel {
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -48px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.22), rgba(219, 124, 47, 0.26));
  filter: blur(8px);
}
.brand-chip {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-panel h1 {
  margin: 20px 0 12px;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}
.hero-copy {
  max-width: 42ch;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}
.hero-points {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}
.hero-points div {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(23, 33, 31, 0.08);
  background: rgba(255, 250, 243, 0.88);
  font-size: 15px;
  line-height: 1.6;
}
.chat-panel {
  min-height: calc(100vh - 48px);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chat-header h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
  font-weight: 700;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
}
.lead-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(23, 33, 31, 0.08);
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.88);
}
.lead-copy h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.lead-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}
.lead-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.lead-form input,
.lead-form select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(23, 33, 31, 0.12);
  background: #fffdf8;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
}
.messages {
  flex: 1;
  margin: 18px 0;
  padding-right: 6px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  max-width: 88%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.message-role {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.message-bubble {
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.message.assistant .message-bubble {
  background: var(--panel-strong);
  border: 1px solid rgba(23, 33, 31, 0.08);
}
.message.user .message-bubble {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #f8fffe;
}
.docs-panel {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(23, 33, 31, 0.08);
  background: rgba(255, 250, 243, 0.88);
}
.hidden { display: none; }
.docs-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.docs-header p {
  margin: 0 0 14px;
  color: var(--muted);
}
.docs-list {
  display: grid;
  gap: 12px;
}
.doc-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 33, 31, 0.08);
  background: #fffdf8;
}
.doc-card h4 {
  margin: 8px 0;
  font-size: 17px;
}
.doc-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}
.doc-card a {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}
.doc-meta {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.primary-button,
.secondary-button,
.ghost-button,
#send-button {
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.primary-button,
#send-button {
  color: #fffaf3;
  background: linear-gradient(135deg, var(--accent) 0%, #c56115 100%);
}
.secondary-button {
  color: var(--brand-deep);
  background: rgba(15, 118, 110, 0.12);
}
.ghost-button {
  color: white;
  background: var(--danger);
}
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.input-wrap {
  display: flex;
  align-items: stretch;
  border-radius: 24px;
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid rgba(23, 33, 31, 0.09);
}
#message-input {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 16px 18px;
  font: inherit;
  line-height: 1.5;
  max-height: 180px;
}
#send-button:disabled {
  cursor: wait;
  opacity: 0.7;
}
.helper-text {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 960px) {
  .page-shell { grid-template-columns: 1fr; }
  .chat-panel { min-height: 70vh; }
}
@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    margin: 10px auto;
    gap: 14px;
  }
  .hero-panel, .chat-panel { border-radius: 22px; padding: 18px; }
  .lead-form { grid-template-columns: 1fr; }
  .chat-form { grid-template-columns: 1fr; }
  #send-button { height: 52px; }
  .message { max-width: 100%; }
}
