:root {
  color-scheme: light;
  --canvas: #f4f6ef;
  --surface: #ffffff;
  --surface-muted: #edf2e7;
  --ink: #17251a;
  --ink-soft: #465a49;
  --green: #275d3a;
  --green-dark: #183f27;
  --green-soft: #dcebdd;
  --copper: #9a5a2f;
  --line: #cad5c3;
  --error: #9f2d25;
  --focus: #1266a8;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, textarea { font: inherit; }
a { color: var(--green); }
button { touch-action: manipulation; }

.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--green-dark);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(244, 246, 239, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar__inner {
  width: min(1080px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; min-width: 0; }
.brand img { display: block; width: 184px; height: auto; max-width: 100%; }
.topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.text-link { font-size: 0.9rem; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--green-dark);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.page-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 36px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
  align-items: end;
  gap: 36px;
  margin-bottom: 26px;
}

.product-label { margin: 0 0 5px; color: var(--copper); font-size: 0.95rem; font-weight: 800; }
h1, h2 { text-wrap: balance; }
h1 { margin: 0; max-width: 18ch; font-size: 2.6rem; line-height: 1.06; letter-spacing: -0.03em; }
.lede { max-width: 67ch; margin: 16px 0 0; color: var(--ink-soft); font-size: 1.05rem; text-wrap: pretty; }

.source-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 3px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.source-note__dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2c8a4b;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.source-note strong, .source-note span { display: block; }
.source-note strong { color: var(--ink); }

.chat {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chat__header {
  min-height: 76px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.chat__header h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.015em; }
.status { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.82rem; }
.status[data-state="error"] { color: var(--error); font-weight: 700; }

.clear-button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--green-dark);
  background: transparent;
  border: 1px solid #aebda7;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.clear-button:hover { background: #ffffff; }

.messages {
  min-height: 315px;
  max-height: min(55vh, 600px);
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.message { max-width: min(76ch, 88%); }
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message__label { margin-bottom: 5px; color: var(--ink-soft); font-size: 0.75rem; font-weight: 800; }

.message--assistant {
  align-self: flex-start;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--surface-muted);
  border-radius: 4px var(--radius) var(--radius) var(--radius);
}

.message--user {
  align-self: flex-end;
  padding: 12px 15px;
  color: #ffffff;
  background: var(--green);
  border-radius: var(--radius) 4px var(--radius) var(--radius);
}

.message--user .message__label { color: #dbeadf; }
.message__meta { margin-top: 8px; color: var(--ink-soft); font-size: 0.76rem; }
.message--error { color: #741f19; background: #fff0ee; }

.suggestions {
  padding: 0 20px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--green-dark);
  background: #ffffff;
  border: 1px solid #aebda7;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.suggestions button:hover, .suggestions button:focus-visible { background: var(--green-soft); }

.composer {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcf9;
}

.composer label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 0.84rem; font-weight: 800; }

.composer textarea {
  width: 100%;
  min-height: 86px;
  max-height: 220px;
  resize: vertical;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #9dac96;
  border-radius: 9px;
  line-height: 1.45;
}

.composer textarea::placeholder { color: #526456; opacity: 1; }
.composer textarea:disabled { color: #667368; background: #f0f2ed; }

.composer__footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer__hint { margin: 0; color: var(--ink-soft); font-size: 0.76rem; }

.send-button {
  min-width: 118px;
  min-height: 42px;
  padding: 9px 15px;
  color: #ffffff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.send-button:hover { background: var(--green-dark); border-color: var(--green-dark); }
.send-button:disabled { color: #e3e8e2; background: #68786b; border-color: #68786b; cursor: wait; }
.send-button__busy { display: none; }
.send-button[aria-busy="true"] .send-button__ready { display: none; }
.send-button[aria-busy="true"] .send-button__busy { display: inline; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.guidance {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.guidance p { max-width: 65ch; margin: 0; }

footer {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

footer nav { display: flex; gap: 15px; }

@media (max-width: 720px) {
  .topbar__inner, .page-shell, footer { width: min(100% - 24px, 900px); }
  .brand img { width: 142px; }
  .text-link, .phone-link span { display: none; }
  .phone-link { padding-inline: 10px; font-size: 0.82rem; }
  .page-shell { padding-top: 28px; }
  .intro { grid-template-columns: 1fr; gap: 18px; }
  h1 { max-width: 19ch; font-size: 2rem; }
  .messages { min-height: 350px; padding-inline: 14px; }
  .message { max-width: 94%; }
  .suggestions, .composer { padding-inline: 14px; }
  .composer__footer { align-items: flex-end; }
  .composer__hint { max-width: 22ch; }
  .guidance { flex-direction: column; gap: 12px; }
}

@media (max-width: 430px) {
  .topbar__actions { gap: 8px; }
  .brand img { width: 124px; }
  .chat__header { align-items: flex-start; }
  .clear-button { max-width: 92px; }
  .suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 16px; }
  .suggestions button { flex: 0 0 auto; }
  .composer__footer { align-items: stretch; flex-direction: column; }
  .send-button { width: 100%; }
  footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
