:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17211b;
  background: #f3f5f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body { min-height: 100vh; background: #f3f5f4; }

button, textarea { font: inherit; }

button { cursor: pointer; }

.app-shell {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: #fff;
  border-inline: 1px solid #dde3df;
}

.topbar {
  min-height: 82px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e4e8e5;
  background: rgba(255, 255, 255, 0.96);
}

.eyebrow { margin: 0 0 3px; color: #287556; font-size: 11px; font-weight: 750; }

h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: 0; }

.reader-link {
  color: #245e49;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.conversation {
  min-height: 0;
  padding: 32px 24px 120px;
  overflow-y: auto;
}

.welcome { max-width: 680px; margin: 12vh auto 0; text-align: center; }

.welcome h2 { margin: 0 0 24px; font-size: 26px; letter-spacing: 0; }

.suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.suggestions button {
  min-height: 78px;
  padding: 12px;
  border: 1px solid #dce4df;
  border-radius: 8px;
  color: #34483d;
  background: #f8faf9;
  text-align: left;
  line-height: 1.5;
}

.suggestions button:hover { border-color: #7aa690; background: #f2f7f4; }

.message { max-width: 760px; margin: 0 auto 24px; }

.message.user { display: flex; justify-content: flex-end; }

.message.user .bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 8px 8px 2px 8px;
  color: #fff;
  background: #226b4d;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.assistant .answer {
  color: #25332b;
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.message.loading .answer { color: #728079; }

.sources { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e5e9e6; }

.sources strong { display: block; margin-bottom: 8px; font-size: 13px; color: #65736b; }

.sources a { display: block; padding: 5px 0; color: #27684f; font-size: 14px; text-decoration: none; }

.sources a:hover { text-decoration: underline; }

.composer {
  position: sticky;
  bottom: 26px;
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 8px 8px 8px 16px;
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: end;
  gap: 8px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 50, 40, 0.12);
}

.composer:focus-within { border-color: #3c8062; box-shadow: 0 0 0 3px rgba(60, 128, 98, 0.12); }

textarea {
  width: 100%;
  max-height: 150px;
  padding: 9px 0;
  resize: none;
  border: 0;
  outline: 0;
  color: #17211b;
  background: transparent;
  line-height: 1.5;
}

.composer button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #226b4d;
  font-size: 22px;
  font-weight: 700;
}

.composer button:disabled { cursor: default; opacity: 0.45; }

.disclaimer { margin: -14px 24px 9px; color: #89948e; font-size: 11px; text-align: center; }

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

@media (max-width: 700px) {
  .app-shell { border: 0; }
  .topbar { min-height: 70px; padding: 12px 16px; }
  h1 { font-size: 19px; }
  .conversation { padding: 24px 16px 106px; }
  .welcome { margin-top: 7vh; }
  .welcome h2 { font-size: 22px; }
  .suggestions { grid-template-columns: 1fr; }
  .suggestions button { min-height: 54px; }
  .composer { width: calc(100% - 24px); margin-inline: 12px; bottom: 25px; }
  .disclaimer { margin-inline: 12px; }
}
