:root {
  color: #18332b;
  background: #f7f8f4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pine: #18332b;
  --green: #176342;
  --green-dark: #0f4f34;
  --sage: #e8f1e9;
  --paper: #ffffff;
  --line: #d9e2da;
  --muted: #66756e;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--green-dark); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 3px solid #e4a52e; outline-offset: 3px; }

.ask-layout {
  width: min(100% - 32px, 820px);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: clamp(38px, 7vh, 76px) 0 32px;
}

.ask-heading { text-align: center; }
.conversation-started .ask-layout { padding-top: 18px; }
.conversation-started .ask-heading > .eyebrow,
.conversation-started .ask-heading > h1,
.conversation-started .ask-heading > p { display: none; }
.conversation-started .city-control { margin-top: 0; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ask-heading h1 {
  margin: 0;
  color: var(--pine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 6vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.ask-heading > p:not(.eyebrow, .city-help) {
  max-width: 590px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 1rem;
}

.city-control {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 5px 7px 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}
.city-control select {
  max-width: 250px;
  border: 0;
  border-radius: 999px;
  background: var(--sage);
  color: var(--pine);
  padding: 7px 30px 7px 11px;
  font-weight: 750;
}
.city-help { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }

.chat-panel {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  margin-top: 32px;
}
.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 0 140px;
}
.welcome { margin: auto; padding: 34px 0 54px; text-align: center; }
.welcome-title { margin: 0 0 16px; color: var(--muted); font-size: .88rem; font-weight: 750; }
.ask-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ask-examples button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: #315349;
  padding: 9px 14px;
  font-size: .84rem;
}
.ask-examples button:hover { border-color: #a8c5b1; background: var(--sage); }

.message { width: min(100%, 690px); line-height: 1.55; overflow-wrap: anywhere; }
.message > p:first-child { margin-top: 0; }
.message > p:last-child { margin-bottom: 0; }
.message.user {
  width: fit-content;
  max-width: min(84%, 620px);
  align-self: flex-end;
  border-radius: 20px 20px 5px 20px;
  background: var(--sage);
  padding: 11px 16px;
  white-space: pre-wrap;
}
.message.answer { align-self: flex-start; }
.message.answer { scroll-margin-top: 84px; }
.message.answer > p:first-child { color: #31483f; }
.ai-match-label { color: var(--green); font-size: .82rem; font-weight: 800; }

.answer-card {
  margin-top: 14px;
  padding: 2px 0 8px;
}
.answer-card h3 { margin: 0 0 10px; color: var(--pine); font-size: .88rem; letter-spacing: .01em; }
.answer-card p { margin: 9px 0; }
.answer-card .answer-text { color: #172f27; font-size: 1.05rem; font-weight: 650; }
.answer-card .meta { color: var(--muted); font-size: .76rem; }
.answer-context { margin: 12px 0; color: #435950; font-size: .9rem; }
.answer-context summary { width: fit-content; cursor: pointer; color: var(--green-dark); font-weight: 750; }
.answer-context p { margin: 8px 0; }
.answer-why {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9f4;
}
.answer-why h4 { margin: 0 0 8px; font-size: .95rem; }
.answer-why p { margin: 8px 0; }
.answer-why .history-gap {
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff8e8;
  color: #5c4c2d;
  font-size: .86rem;
}
.answer-why .why-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  font-size: .82rem;
}
.links { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.links a { font-size: .84rem; font-weight: 750; text-underline-offset: 3px; }
.links a:first-child {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 999px;
  background: var(--green);
  color: white;
  padding: 7px 14px;
  text-decoration: none;
}
.links a:first-child:hover { background: var(--green-dark); }
.missing-part { border-left: 3px solid #c59a46; padding: 8px 12px; color: #66552e; }

.related-guides { margin-top: 18px; }
.related-guides h3 { margin: 0 0 8px; font-size: .9rem; }
.related-guide { display: grid; gap: 3px; padding: 11px 0; border-top: 1px solid var(--line); }
.related-guide a { font-weight: 750; }
.related-guide span { color: var(--muted); font-size: .8rem; }

.source-leads { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.source-leads h3, .source-leads h4 { margin: 0 0 8px; }
.source-leads h3 { font-size: .9rem; }
.source-leads h4 { font-size: .88rem; }
.source-lead {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.source-lead blockquote { margin: 8px 0; color: var(--muted); }
.source-lead p, .source-lead-note { color: var(--muted); font-size: .8rem; }
.web-leads { display: grid; gap: 8px; margin-top: 14px; }
.web-leads h3 { margin: 0; font-size: .9rem; }
.web-leads a { font-weight: 750; }

.research-action {
  margin-top: 18px;
  border-radius: 16px;
  background: #f4f1e7;
  padding: 15px;
  color: #564d34;
  font-size: .84rem;
}
.research-action p { margin: 0 0 10px; }
.research-action button, .message.answer > button {
  border: 1px solid #b7a778;
  border-radius: 999px;
  background: var(--paper);
  color: #493f24;
  padding: 8px 13px;
  font-weight: 800;
}
.research-action button:disabled { cursor: wait; opacity: .65; }

.composer-wrap {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: auto;
  padding: 12px 0 8px;
  background: linear-gradient(to bottom, rgba(247,248,244,0), #f7f8f4 22%);
}
.ask-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid #bfcac2;
  border-radius: 25px;
  background: var(--paper);
  padding: 10px 10px 10px 18px;
  box-shadow: 0 10px 35px rgba(25, 50, 42, .12);
}
.ask-form:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23,99,66,.12), 0 10px 35px rgba(25,50,42,.1);
}
.ask-form textarea {
  width: 100%;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pine);
  padding: 8px 0;
  line-height: 1.45;
}
.ask-form textarea::placeholder { color: #8b9691; }
.ask-form button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
}
.ask-form button:hover { background: var(--green-dark); }
.ask-form button:disabled { cursor: wait; opacity: .55; }
.ask-form button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.composer-note { margin: 8px 8px 0; color: var(--muted); font-size: .74rem; text-align: center; }

.answer-policy {
  max-width: 660px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.answer-policy summary { width: fit-content; margin: 0 auto; cursor: pointer; font-weight: 750; }
.answer-policy p { margin: 8px 0; }

@media (max-width: 640px) {
  .ask-layout { width: min(100% - 24px, 820px); min-height: calc(100vh - 64px); padding-top: 28px; }
  .ask-heading h1 { font-size: 2.35rem; }
  .ask-heading > p:not(.eyebrow, .city-help) { font-size: .92rem; }
  .city-control { margin-top: 18px; }
  .city-control select { max-width: 190px; }
  .chat-panel { min-height: 430px; margin-top: 24px; }
  .welcome { padding: 18px 0 34px; }
  .ask-examples { display: grid; }
  .ask-examples button { text-align: left; }
  .message.user { max-width: 90%; }
  .answer-card { padding: 16px; }
  .conversation-started .ask-layout { padding-top: 12px; }
  .conversation-started .chat-panel { margin-top: 14px; }
  .conversation-started .answer-card { padding: 0 0 8px; }
  .composer-wrap { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
