:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --border: #e2e2df;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 { font-size: 1.75rem; margin: 0 0 0.75rem; }

.lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.form label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 500;
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font: inherit;
}

button,
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 0.375rem;
  padding: 0.6rem 1rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: #1d4ed8;
}

.inline { display: inline; }

.task-list {
  list-style: none;
  padding: 0;
}

.task-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.task-list li a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
}

.task-list li a:hover {
  background: #f0f0ee;
}

.chat-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.chat-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.chat-list li a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
}

.chat-list li a:hover {
  background: #f0f0ee;
}

.chat-messages {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
}

.chat-message {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  white-space: pre-wrap;
}

.chat-message.user {
  background: #e0ecff;
  margin-left: 2rem;
}

.chat-message.assistant {
  background: #f0f0ee;
  margin-right: 2rem;
}

.assistant-placeholder {
  opacity: 0.7;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font: inherit;
}

.chat-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
}
