:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #171c24;
  --line: #2a3340;
  --text: #e8edf4;
  --muted: #9aa6b6;
  --accent: #6ea8fe;
  --user: #1d3a5f;
  --assistant: #1c2430;
  --think: #141920;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
}

aside {
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  overflow: auto;
  background: #12171e;
}

h1 { font-size: 18px; margin: 0 0 8px; }
.lede, .hint { color: var(--muted); font-size: 13px; }
.lede a, a { color: var(--accent); }

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

#log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.bubble {
  border-radius: 12px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.user { background: var(--user); align-self: flex-end; max-width: 85%; }
.bubble.assistant { background: var(--assistant); align-self: stretch; }
.think {
  background: var(--think);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.think summary { cursor: pointer; color: var(--text); }

.composer { display: flex; gap: 8px; align-items: flex-end; }
textarea#prompt { min-height: 52px; resize: vertical; }
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #071018;
  font-weight: 650;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.examples button { font-weight: 500; font-size: 13px; }
.thumb { height: 48px; border-radius: 6px; margin-top: 8px; }
.error { color: #ffb4b4; font-size: 13px; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  main { height: 80vh; }
}
