:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #e3e8f0;
  --text: #16202e;
  --muted: #6b7a90;
  --brand: #2f6bff;
  --brand-soft: #eaf0ff;
  --bot: #fff5e6;
  --bot-line: #f0c987;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 9px;
  padding: 9px 14px;
  background: var(--brand);
  color: #fff;
}
button.ghost { background: transparent; color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }

input, textarea {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  color: var(--text);
  background: #fff;
}
input:focus, textarea:focus { border-color: var(--brand); }

/* ---------- kerangka chat ---------- */
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
}
.chat-head .judul { font-weight: 600; }
.chat-head .status { font-size: 12px; opacity: .85; }

.pesan-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  background: var(--panel);
  border: 1px solid var(--border);
}
.bubble .meta { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.baris { display: flex; }
.baris.kanan { justify-content: flex-end; }
.baris.kanan .bubble { background: var(--brand); color: #fff; border-color: var(--brand); }
.baris.kanan .bubble .meta { color: rgba(255, 255, 255, .8); }
.baris.bot .bubble { background: var(--bot); border-color: var(--bot-line); }

.mengetik { font-size: 12px; color: var(--muted); padding: 0 16px 6px; height: 18px; }

.composer {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.composer textarea { flex: 1; resize: none; height: 44px; max-height: 140px; }

/* ---------- dropdown shortcut ---------- */
.saran {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 12px;
  right: 12px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 32, 60, .16);
  display: none;
  z-index: 20;
}
.saran.tampil { display: block; }
.saran-item { padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.saran-item:last-child { border-bottom: none; }
.saran-item.aktif { background: var(--brand-soft); }
.saran-item .kode { font-weight: 600; color: var(--brand); }
.saran-item .isi {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
