:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --text: #2a2522;
  --muted: #6f655d;
  --border: #e3dcd2;
  --accent: #8a3b12;
  --mark: #f4d58d;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1d22;
    --surface: #23262d;
    --text: #e8e4de;
    --muted: #a39b91;
    --border: #353943;
    --accent: #e8a36f;
    --mark: #6b5320;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1d22;
  --surface: #23262d;
  --text: #e8e4de;
  --muted: #a39b91;
  --border: #353943;
  --accent: #e8a36f;
  --mark: #6b5320;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 16px 2rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Georgia, 'Iowan Old Style', serif;
}
header { padding-top: 2rem; }
h1 { margin: 0; font-size: 2rem; letter-spacing: 0.02em; }
.sub { margin: 0.25rem 0 1rem; color: var(--muted); }
input[type="search"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#status { color: var(--muted); font-size: 0.9rem; min-height: 1.5em; }

#results { list-style: none; margin: 0; padding: 0; }
#results > li {
  margin: 0 0 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
h2 { margin: 0; font-size: 1.15rem; }
h2 a { color: var(--accent); text-decoration: none; }
h2 a:hover { text-decoration: underline; }
.meta { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.lines { margin: 0.5rem 0 0; padding: 0; list-style: none; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.lines li { margin: 0.2rem 0; overflow-wrap: anywhere; }
.lines a { color: inherit; text-decoration: none; }
.lines a:hover { text-decoration: underline; }
.tag {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}
mark { background: var(--mark); color: inherit; border-radius: 2px; }
footer { margin-top: 2rem; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--accent); }

.crumbs { margin: 0; font-size: 0.9rem; }
.crumbs a, .read, .prevnext a, .archive a, .meta a { color: var(--accent); }
.static h1 { margin: 0.5rem 0 0; }
.page { margin: 1.25rem 0; }
.page h2 { font-size: 1.05rem; color: var(--muted); }
.transcript {
  margin: 0.5rem 0;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
}
.transcript p { margin: 0.25rem 0; }
.captions { margin: 0.5rem 0; font-size: 0.92rem; }
.captions dt { color: var(--muted); font-size: 0.8rem; }
.captions dd { margin: 0 0 0.4rem; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.archive { padding-left: 0; list-style: none; }
.archive li { margin: 0.15rem 0; }
