:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --accent: #1f6feb;
  --accent-2: #0d47a1;
  --text: #1c2330;
  --muted: #6b7686;
  --border: #e3e8ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.chat {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.assistant .bubble { background: #eef2f7; border-bottom-left-radius: 4px; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg .bubble img { max-width: 220px; border-radius: 8px; margin-top: 6px; display: block; }
.msg.escalated .bubble { background: #fff4e5; border: 1px solid #ffd699; }

.typing .bubble { color: var(--muted); font-style: italic; }

.preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.attach {
  cursor: pointer;
  font-size: 20px;
  padding: 6px 8px;
  user-select: none;
}
#input {
  flex: 1;
  border: none;
  resize: none;
  font: inherit;
  font-size: 15px;
  padding: 8px;
  outline: none;
  max-height: 140px;
  background: transparent;
  color: var(--text);
}
#send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}
#send:hover { background: var(--accent-2); }
#send:disabled { opacity: .5; cursor: default; }
