:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 860px;
  padding: 16px 20px 48px;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #101018;
  color: #e6e6f0;
}
h1 { font-size: 1.3rem; margin: 0 0 4px; }
.sub { margin: 2px 0; }
.dim { color: #9a9ab0; font-size: .9rem; }
.small { font-size: .82rem; }
code { background: #1c1c2a; padding: 1px 5px; border-radius: 4px; }
a { color: #8ab4ff; }

.settings, .entry {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 14px 0 0;
}
.entry { position: sticky; bottom: 10px; }
.field { flex: 1 1 320px; display: flex; gap: 8px; align-items: center; }
.field.check { flex: 0 0 auto; gap: 6px; }
.field.check label { flex: 0 0 auto; font-size: .85rem; color: #c9c9dd; cursor: pointer; }
.field.check input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: #4c5fd7; cursor: pointer; }
.field label { font-size: .82rem; color: #9a9ab0; flex: 0 0 88px; }
input, select, textarea, button {
  font: inherit;
  background: #1a1a26;
  color: inherit;
  border: 1px solid #33334a;
  border-radius: 8px;
  padding: 8px 10px;
}
input, select { flex: 1 1 auto; }
textarea { flex: 1 1 auto; resize: vertical; }
button {
  background: #4c5fd7;
  border-color: transparent;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: #5a6ee4; }
button[disabled] { opacity: .5; cursor: wait; }

#log { display: flex; flex-direction: column; gap: 8px; min-height: 120px; margin-top: 14px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: #2b3a8c; }
.msg.assistant { align-self: flex-start; background: #1c1c2a; }
.msg.error { align-self: stretch; max-width: 100%; background: #58242e; color: #ffc3cb; }
.state { font-size: .8rem; color: #9a9ab0; }
.state.ok { color: #6fdc9c; }
.state.err { color: #ff8a9b; }
footer { margin-top: 26px; border-top: 1px solid #26263a; padding-top: 10px; }
