:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5c564e;
  --line: #e4ddd2;
  --paper: #f7f4ee;
  --panel: #fffdf9;
  --accent: #8a3d12;
  --accent-ink: #fffaf6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Iowan Old Style", Palatino, Georgia, serif;
}

.top, main {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 { font-weight: 600; }
h1 { margin: 0; font-size: 32px; }
h2 { margin: 0 0 8px; font-size: 18px; }

.session, button, label, .status {
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.session { display: flex; gap: 8px; align-items: center; color: var(--muted); }

button, textarea, input {
  font: inherit;
}

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

button[hidden], section[hidden] { display: none; }

main {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 28px;
  padding: 22px 0 48px;
}

.log {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble {
  max-width: 70ch;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  white-space: pre-wrap;
}

.bubble.user { align-self: end; background: #f3ebe3; }

label { display: block; margin-bottom: 8px; color: var(--muted); }

.composer { display: flex; gap: 8px; align-items: end; }

textarea, input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
}

.status { min-height: 1.4em; color: var(--muted); }

.sources { margin: 0; padding-left: 18px; }
.sources li { margin-bottom: 6px; }

aside section + section { margin-top: 28px; }

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; }
  .top { align-items: start; flex-direction: column; }
}
