:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #f4f7fb;
  color: #172033;
}

.chat-card {
  box-sizing: border-box;
  width: min(100%, 560px);
  min-height: 520px;
  margin: 0 auto;
  padding: 18px;
  background: #fff;
  border: 1px solid #dfe5ef;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(23 32 51 / 10%);
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e8ecf3;
  padding-bottom: 14px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
}

h1, p { margin: 0; }
h1 { font-size: 1.15rem; }
header p { color: #5e6b80; font-size: .82rem; }

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 350px;
  overflow-y: auto;
  padding: 16px 2px;
}

.message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.assistant { align-self: flex-start; background: #eef3ff; }
.user { align-self: flex-end; background: #1d4ed8; color: #fff; }
.pending { color: #5e6b80; font-style: italic; }
.error { align-self: flex-start; background: #fff1f0; color: #a4261a; }

form { display: flex; gap: 8px; }
input {
  min-width: 0;
  flex: 1;
  border: 1px solid #b9c3d4;
  border-radius: 9px;
  padding: 11px;
  font: inherit;
}
button {
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  background: #1d4ed8;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }
.notice { margin-top: 10px; color: #69758a; font-size: .72rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
