/* LibAI Cockpit — minimal ChatGPT-ish dark UI, mobile-first. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1f2330;
  --text: #e8eaf0;
  --muted: #8b90a0;
  --accent: #4f8cff;
  --user: #2b3550;
  --error: #ff6b6b;
  --ok: #4cd07d;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }

/* ── login ── */
.login {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--panel);
  border: 1px solid #262b3a;
  border-radius: 16px;
  padding: 36px 28px;
  width: 100%; max-width: 380px;
  text-align: center;
}
.login-card .logo { font-size: 42px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: var(--panel-2); border: 1px solid #2c3245;
  border-radius: 10px; color: var(--text); font-size: 16px;
}
.login-card button {
  width: 100%; padding: 12px;
  background: var(--accent); border: 0; border-radius: 10px;
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.error { color: var(--error); font-size: 13px; margin-top: 12px; }

/* ── chat ── */
.chat { display: flex; flex-direction: column; height: 100dvh; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid #232839;
}
.hdr-title { font-weight: 600; }
.status { color: var(--muted); font-size: 12px; }
.status.online { color: var(--ok); }
.status.busy { color: var(--accent); }

main {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--user); border-bottom-right-radius: 4px; }
.msg.bot  { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.card { align-self: flex-start; background: #23301f; border: 1px solid #33502b; font-size: 14px; }
.msg.err  { align-self: flex-start; background: #3a2026; border: 1px solid #5c2e38; }
.msg.thinking { color: var(--muted); font-style: italic; }
.msg code { background: #0c0e14; padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.msg pre {
  background: #0c0e14; padding: 10px; border-radius: 8px;
  overflow-x: auto; margin: 6px 0; font-size: 13px;
}
.meta { align-self: flex-start; color: var(--muted); font-size: 11px; margin-top: -8px; padding-left: 6px; }

footer { padding: 10px 12px 14px; background: var(--panel); border-top: 1px solid #232839; }
footer form { display: flex; gap: 8px; align-items: flex-end; }
footer textarea {
  flex: 1; resize: none; max-height: 160px;
  background: var(--panel-2); border: 1px solid #2c3245;
  border-radius: 12px; color: var(--text);
  padding: 11px 13px; font-size: 16px; font-family: inherit;
}
footer button {
  background: var(--accent); border: 0; border-radius: 12px;
  color: #fff; font-size: 18px; padding: 10px 16px; cursor: pointer;
}
footer button:disabled { opacity: 0.5; cursor: default; }
.hint { color: var(--muted); font-size: 11px; text-align: center; margin-top: 8px; }
