:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #ddd6c8;
  --card: #fffdf8;
  --accent: #c45c26;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
}
.brand { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: 0.01em; }
nav { display: flex; gap: 8px; align-items: center; }
button, select, textarea { font: inherit; color: inherit; }
nav button, nav a {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--muted);
  cursor: pointer;
}
nav button.on, nav a:hover { border-color: var(--line); color: var(--ink); background: white; }
.layout {
  display: grid;
  grid-template-columns: 220px 1fr 360px;
  min-height: calc(100vh - 54px);
}
#spine { border-right: 1px solid var(--line); padding: 14px 12px 32px; }
#spine button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
}
#spine button.on { background: white; }
#spine .code { display: block; font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: 0.04em; }
#spine .name { display: block; color: var(--muted); font-size: 13px; }
.stage { position: relative; min-height: 640px; background-image: radial-gradient(#e4ddd0 1px, transparent 1px); background-size: 18px 18px; }
#map { width: 100%; height: 100%; min-height: 640px; display: block; cursor: grab; touch-action: none; }
#map:active { cursor: grabbing; }
#list { padding: 28px 32px 80px; max-width: 720px; }
#list article { padding: 14px 0; border-bottom: 1px solid var(--line); }
#list h2 { font-size: 15px; margin: 22px 0 6px; font-family: ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
#list h3 { margin: 0 0 4px; font-size: 20px; }
#list p { margin: 0; color: var(--muted); }
#list button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.card { border-left: 1px solid var(--line); padding: 22px 20px 40px; background: var(--card); }
.kicker { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
h1 { font-size: 32px; line-height: 1.15; margin: 0 0 12px; font-weight: 600; }
.summary { font-size: 18px; line-height: 1.45; margin: 0 0 16px; }
.pill { display: inline-block; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--line); }
.pill.sourced { color: #1e6b3a; border-color: #b7d7c2; }
.pill.inferred { color: #8a5a12; border-color: #ead7b0; }
.pill.uncertain { color: #666; }
.cite { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { text-decoration: none; color: var(--ink); background: var(--paper); border-radius: 999px; padding: 4px 10px; font-size: 14px; }
figure { margin: 12px 0; }
img { max-width: 100%; border-radius: 8px; background: white; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
form { margin-top: 22px; display: grid; gap: 8px; }
form label { display: grid; gap: 4px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 13px; color: var(--muted); }
textarea, select { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
form button { background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; justify-self: start; }
#answer { margin-top: 16px; }
#answer p { margin: 0 0 8px; }
#answer .hit { font-size: 14px; color: var(--muted); }
.sheet-page { padding: 32px 16px 64px; }
.sheet { max-width: 680px; margin: 0 auto; }
.questions { padding: 0; list-style: none; display: grid; gap: 12px; }
.questions li { line-height: 1.4; }
.node-label { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; fill: var(--ink); pointer-events: none; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  #spine { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; overflow: auto; }
  #spine button { width: auto; border-left: 0; }
  .card { border-left: 0; border-top: 1px solid var(--line); }
}
