:root {
  --blue: #3888f8;
  --ink: #081020;
  --muted: #64748b;
  --line: #e6eaf1;
  --bg: #f4f6fb;
  --bubble-user: #3888f8;
  --bubble-bot: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #eaf1ff 0%, var(--bg) 55%);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shell {
  width: 100%;
  max-width: 520px;
  height: min(760px, 92dvh);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(8, 16, 32, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* header */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--ink);
  color: #fff;
}
.bar-id { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
}
.title { font-weight: 700; font-size: 16px; }
.status { font-size: 12.5px; color: #aebbd2; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.demo-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--blue); border: 1px solid rgba(56,136,248,.4);
  padding: 4px 9px; border-radius: 999px;
}

/* log */
.log {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}
.msg {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: var(--bubble-user);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg.bot {
  align-self: flex-start;
  background: var(--bubble-bot);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg.err { background: #fef2f2; border-color: #f4caca; color: #9b1c1c; align-self: center; font-size: 13.5px; }

.typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #b8c2d6;
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* hint chips */
.hint { padding: 10px 18px 4px; font-size: 13px; color: var(--muted); }
.chip {
  font: inherit; font-size: 13px;
  background: #eef3ff; color: #2563c9; border: 1px solid #d6e2ff;
  padding: 6px 10px; border-radius: 999px; cursor: pointer; margin: 4px 4px 0 0;
}
.chip:hover { background: #e2ecff; }

/* composer */
.composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.input {
  flex: 1; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 16px; outline: none; background: #fff;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56,136,248,.15); }
.send {
  width: 46px; height: 46px; border: none; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 20px; cursor: pointer;
  flex-shrink: 0; transition: transform .08s, background .2s;
}
.send:hover { background: #2c74e0; }
.send:active { transform: scale(.94); }
.send:disabled { background: #b7c7e6; cursor: default; }

/* footer */
.brand { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 18px 14px; }
.brand a { color: var(--blue); font-weight: 600; text-decoration: none; }
.brand a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  body { padding: 0; }
  .shell { height: 100dvh; max-width: none; border-radius: 0; border: none; }
}
