:root {
  --bg: #fbfbfa;
  --fg: #1d1d1f;
  --dim: #6b6b70;
  --accent: #0a7ea4;
  --border: #e4e4e2;
  --code-bg: #f2f2f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}
header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; }
.dim { color: var(--dim); }
#layout { display: flex; align-items: flex-start; }
#sidebar {
  width: 260px;
  flex: 0 0 260px;
  height: calc(100vh - 45px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 12px;
}
#filter {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
#pages a {
  display: block;
  padding: 4px 6px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
}
#pages a:hover { background: var(--code-bg); color: var(--accent); }
#pages .section { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
main { flex: 1; padding: 18px 28px; max-width: 820px; overflow-x: auto; }
#ask-form { display: flex; gap: 8px; margin-bottom: 8px; }
#q { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
button {
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
#progress { margin: 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
#answer:not(:empty), #page:not(:empty) {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 18px;
  margin-top: 12px;
  background: #fff;
}
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: var(--code-bg); padding: 12px; border-radius: 6px; overflow-x: auto; }
code { background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
pre code { background: none; padding: 0; }
.err { color: #b00020; }
a { color: var(--accent); }
