:root {
  --ink: #16201d;
  --muted: #66716d;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --line: #d8dfdc;
  --accent: #087f6b;
  --accent-dark: #056454;
  --accent-pale: #e1f0ec;
  --danger: #a33c34;
  --shadow: 0 18px 50px rgba(18, 42, 35, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 5vw; border-bottom: 1px solid var(--line); background: rgba(244,246,243,.94);
}
.brand { font-weight: 760; font-size: 20px; letter-spacing: 0; }
.brand-dot { color: var(--accent); }
.status { color: var(--muted); font-size: 14px; }
.main { width: min(960px, 90vw); margin: 0 auto; flex: 1; padding: 56px 0 72px; }
.main.narrow { width: min(840px, 90vw); }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
h1 { margin: 12px 0 18px; font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: 0; max-width: 820px; }
h2 { margin: 12px 0 20px; font-size: clamp(30px, 4.5vw, 46px); line-height: 1.08; letter-spacing: 0; }
h3 { font-size: 18px; margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.65; }
.lead { font-size: 19px; max-width: 680px; }
.hero-actions, .form-actions { display: flex; gap: 12px; margin-top: 30px; align-items: center; }
.button {
  border: 1px solid var(--accent); border-radius: 7px; padding: 14px 20px; min-height: 50px;
  background: var(--accent); color: white; font-weight: 700; transition: background .16s, transform .16s;
}
.button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button.ghost { color: var(--muted); border-color: transparent; background: transparent; }
.promise {
  margin-top: 72px; border-top: 1px solid var(--line); padding-top: 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.promise strong { display: block; margin-bottom: 8px; font-size: 15px; }
.promise span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 14px; font-weight: 700; }
input, textarea {
  width: 100%; padding: 14px 15px; border: 1px solid #cbd4d0; border-radius: 7px;
  background: white; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); }
.fineprint { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.progress { height: 6px; background: #dfe5e2; margin: 14px 0 54px; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.question { min-height: 470px; }
.question h2 { max-width: 820px; }
.options { display: grid; gap: 12px; margin-top: 30px; }
.option {
  text-align: left; padding: 19px 20px; min-height: 62px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 17px;
}
.option:hover { border-color: #92aaa2; }
.option.selected { border-color: var(--accent); background: var(--accent-pale); box-shadow: 0 0 0 1px var(--accent); }
.question-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 36px; }
.question-footer p { font-size: 14px; max-width: 520px; margin: 0; }
.error { color: var(--danger); font-size: 14px; margin-top: 14px; }
.loader { display: grid; place-items: center; min-height: 62vh; text-align: center; }
.pulse {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 28px;
  border: 1px solid var(--accent); box-shadow: 0 0 0 0 rgba(8,127,107,.3);
  animation: pulse 1.7s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 25px rgba(8,127,107,0); } 100% { box-shadow: 0 0 0 0 rgba(8,127,107,0); } }
.profile-header { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 38px; }
.confidence { min-width: 120px; text-align: right; }
.confidence strong { font-size: 32px; display: block; }
.confidence span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 22px; align-items: start; }
.profile-copy { margin-top: 0; }
.dimension { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dimension:last-child { border-bottom: 0; }
.dimension-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.meter { height: 5px; background: #e6ebe8; border-radius: 10px; margin: 8px 0; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.dimension p { margin: 0; font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font-size: 13px; color: #40504b; }
.section { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.chat { min-height: 620px; display: flex; flex-direction: column; padding: 0; overflow: hidden; position: sticky; top: 20px; }
.chat-head { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.chat-head p { margin: 4px 0 0; font-size: 13px; }
.messages { padding: 22px; flex: 1; display: flex; flex-direction: column; gap: 14px; max-height: 520px; overflow-y: auto; }
.message { padding: 13px 15px; border-radius: 7px; line-height: 1.55; font-size: 14px; white-space: pre-wrap; }
.message.user { background: var(--accent); color: white; align-self: flex-end; max-width: 86%; }
.message.assistant { background: #edf1ef; color: var(--ink); align-self: flex-start; max-width: 92%; }
.chat-form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; min-height: 52px; max-height: 130px; }
.chat-form .button { min-width: 52px; padding: 0 16px; }
.reset { margin-top: 32px; font-size: 13px; }

@media (max-width: 760px) {
  .topbar { padding: 0 5vw; height: 62px; }
  .main { padding-top: 36px; }
  .promise, .grid, .dashboard { grid-template-columns: 1fr; }
  .promise { gap: 20px; margin-top: 48px; }
  .panel { padding: 20px; }
  .progress { margin-bottom: 38px; }
  .question { min-height: auto; }
  .question-footer, .profile-header { align-items: stretch; flex-direction: column; }
  .question-footer .button { width: 100%; }
  .confidence { text-align: left; }
  .chat { position: static; min-height: 560px; }
}
