* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f5f7;
  color: #1f2933;
}
.chat-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.chat-card {
  width: min(760px, 100%);
  height: min(760px, 90vh);
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}
.chat-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.chat-header h1 { margin: 0 0 4px; font-size: 20px; }
.chat-header p { margin: 0; color: #65707c; font-size: 14px; }
.messages {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  align-self: flex-end;
  background: #1f2933;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message.assistant {
  align-self: flex-start;
  background: #eef1f4;
  border-bottom-left-radius: 4px;
}
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.links a {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid #c5cbd3;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2933;
  background: #fff;
  font-size: 13px;
}
.composer {
  border-top: 1px solid #e8eaed;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
textarea {
  width: 100%;
  resize: none;
  border: 1px solid #cfd5dc;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  min-height: 46px;
  max-height: 140px;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: #1f2933;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button.secondary {
  background: #fff;
  color: #1f2933;
  border: 1px solid #cfd5dc;
}
button:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 600px) {
  .chat-shell { padding: 0; }
  .chat-card { height: 80vh;  height: 80vh; border-radius: 0; border: 0; }
  .message { max-width: 90%; }
  .chat-shell {        min-height: 80vh;        height: 80vh;        padding: 0;    }
}
