:root {
  --bg: #fbfaf7;
  --fg: #1d1d1b;
  --muted: #5d5b55;
  --accent: #8a3b12;
  --rule: #e2ded5;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --fg: #ecebe6;
    --muted: #a8a59c;
    --accent: #e39a6c;
    --rule: #34332f;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.6;
}

header, main, footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

nav a {
  margin-right: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

nav a:last-child { margin-right: 0; }

nav a[aria-current="page"], nav a:hover { color: var(--accent); }

main { padding-top: 1.5rem; padding-bottom: 2rem; }

h1 { font-size: 1.8rem; line-height: 1.25; margin: 0.5rem 0 1rem; }

h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }

a { color: var(--accent); }

.lead { font-size: 1.1rem; color: var(--muted); }

ol.oars { padding-left: 1.25rem; }

ol.oars li { margin-bottom: 1rem; }

.muted { color: var(--muted); font-family: system-ui, sans-serif; font-size: 0.9rem; }

.notice, .error {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  font-family: system-ui, sans-serif;
}

.error { border-left-color: #b3261e; }

a.button, button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font: 600 0.9rem system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

form.form, form.search { display: grid; gap: 0.4rem; max-width: 28rem; margin: 1rem 0; }
form.search { max-width: none; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; }
form.inline { display: inline-block; margin-right: 0.5rem; }

input, select, textarea {
  padding: 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font: 1rem system-ui, sans-serif;
}

textarea { font-family: ui-monospace, monospace; font-size: 0.85rem; width: 100%; }

ol.problems li, ul.evidence li { margin-bottom: 0.9rem; }
ol.problems .muted { display: block; }

blockquote { margin: 0; padding-left: 0.8rem; border-left: 2px solid var(--rule); white-space: pre-line; }

pre {
  overflow-x: auto;
  padding: 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

article.message { margin-bottom: 1.5rem; }

table { width: 100%; border-collapse: collapse; font: 0.9rem system-ui, sans-serif; }
th, td { padding: 0.35rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }

nav.pages { display: flex; gap: 1rem; font-family: system-ui, sans-serif; }

@media (max-width: 40rem) {
  form.search { grid-template-columns: 1fr; }
}

footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}
