:root {
  --ink: #1e1b4b;
  --muted: #5b6478;
  --line: #dbe0ea;
  --bg: #eef2ff;
  --card: #fff;
  --accent: #4f46e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(800px 320px at 100% 0, #c7d2fe 0, transparent 50%),
    var(--bg);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 36px;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
}

.brand { margin: 0 0 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
.brand a { color: var(--accent); }
h1 { margin: 4px 0 0; font-size: 28px; letter-spacing: -0.03em; }
.sub { color: var(--muted); margin-top: 6px; max-width: 640px; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 70vh;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.chips h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

.chip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 62vh;
  overflow: auto;
}

.chip-list button,
.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  text-align: left;
  padding: 8px 10px;
}

.chip-list button:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

.chat {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 0;
  overflow: hidden;
}

.log {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.tin6-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 14.5px;
}

.tin6-msg.bot {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.tin6-msg.user {
  margin-left: auto;
  color: #fff;
  background: var(--accent);
  border-bottom-right-radius: 4px;
}

.form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.form textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 100px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
}

.form button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.foot {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--accent); font-weight: 600; }
