:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18221f;
  background: #eef2ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(53, 128, 104, 0.16), transparent 34rem),
    #eef2ef;
}

button, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(18rem, 1fr) auto auto;
  width: min(58rem, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem;
  gap: 1rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: #28745d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.2rem); }

.conversation {
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d9e1dc;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1.5rem 4rem rgba(31, 57, 48, 0.08);
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-content: center;
  text-align: center;
  color: #63716c;
}

.empty-state h2 { margin: 0 0 0.5rem; color: #263b34; }
.empty-state p { margin: 0; }

.message {
  width: fit-content;
  max-width: min(85%, 42rem);
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.message.user {
  margin-left: auto;
  color: #fff;
  background: #246c57;
  border-bottom-right-radius: 0.3rem;
}

.message.assistant {
  margin-right: auto;
  background: #edf2ef;
  border: 1px solid #dce5df;
  border-bottom-left-radius: 0.3rem;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #ccd8d1;
  border-radius: 1rem;
  background: #fff;
}

textarea {
  width: 100%;
  max-height: 12rem;
  resize: none;
  border: 0;
  outline: 0;
  padding: 0.6rem;
  color: inherit;
  background: transparent;
  line-height: 1.45;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
}

#send-button { color: #fff; background: #246c57; }
.secondary-button { color: #285445; background: #dfeae4; }
button:disabled { cursor: wait; opacity: 0.55; }
.status { min-height: 1.25rem; margin: -0.5rem 0 0; color: #8b352c; font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 38rem) {
  .app-shell { padding: 0.75rem; }
  .app-header { align-items: flex-start; }
  .secondary-button { padding: 0.55rem 0.7rem; font-size: 0.82rem; }
  .message { max-width: 92%; }
}
