:root {
  --bg: #faf8f4; --panel: #f1ede5; --text: #26231f; --muted: #756e64;
  --line: #e0d9cc; --accent: #8a5a2b; --hl: #f6e3b4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18; --panel: #232220; --text: #e6e1d8; --muted: #9a9286;
    --line: #34312d; --accent: #d9a46a; --hl: #5a4a22;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel); font-size: 14px;
}
.bar .home { font-weight: 600; }
.bar .crumb { color: var(--muted); }
.bar .crumb::before { content: "/"; margin-right: 14px; color: var(--line); }
.bar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
button {
  font: inherit; font-size: 13px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
button:hover { color: var(--accent); border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-size: 15px; padding: 8px 16px; }
button.primary:hover { color: var(--bg); opacity: .9; }
main { padding: 40px 20px 80px; }
.narrow { max-width: 36em; margin: 0 auto; }
.narrow h1 { font: 600 28px/1.25 Georgia, serif; margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 14px; }
.dev { margin-top: 36px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 8px; }
.dev p { margin-top: 0; }
code { font-size: 13px; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.shelf, .toc { padding: 0; margin: 20px 0; }
.shelf { list-style: none; }
.shelf li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.shelf a, .shelf .book { font: 600 19px/1.3 Georgia, serif; }
.small { font-size: 13px; margin-top: 28px; }
form + form { margin-top: 12px; }
.toc { padding-left: 1.6em; }
.toc li { padding: 5px 0; }
.toc li .muted { margin-left: 8px; font-size: 13px; }
.prose { max-width: 38em; margin: 0 auto; font: 19px/1.65 Georgia, "Iowan Old Style", "Palatino Linotype", serif; }
.prose h1 { font: 600 30px/1.25 Georgia, serif; margin: 0 0 28px; }
.prose h2 { font: 600 22px/1.3 Georgia, serif; margin: 44px 0 16px; }
.prose h3, .prose h4, .prose h5, .prose h6 { font: 600 19px/1.3 Georgia, serif; margin: 32px 0 12px; }
.prose p { margin: 0 0 .9em; }
.prose ul { padding-left: 1.3em; }
.prose blockquote { margin: 0 0 1em; color: var(--muted); font-style: italic; }
.pager {
  max-width: 38em; margin: 48px auto 0; display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 16px; font-size: 15px;
}
/* ---- reading with comments ---- */
.reading { max-width: 38em; margin: 0 auto; }
.reading .prose, .reading .pager { max-width: none; }
.notes { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 14px; }
.notes h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.notes .hint { color: var(--muted); margin: 0 0 14px; }
.notes.has .hint { display: none; }
@media (min-width: 1180px) {
  .reading { max-width: 64em; display: grid; grid-template-columns: minmax(0, 38em) 20em; gap: 56px; }
  .notes { margin-top: 0; border-top: 0; padding-top: 6px; position: sticky; top: 16px;
           align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
}
mark.c { background: var(--hl); color: inherit; border-radius: 2px; cursor: pointer; }
mark.c.flash, .card.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.add {
  position: absolute; z-index: 5; background: var(--accent); color: var(--bg); border-color: var(--accent);
  font-size: 14px; padding: 6px 14px; box-shadow: 0 2px 10px rgb(0 0 0 / .25);
}
.add:hover { color: var(--bg); opacity: .92; }
.add.docked { position: fixed; left: 16px; right: 16px; bottom: 16px; top: auto; padding: 12px; font-size: 16px; }
.compose { background: var(--panel); border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.compose blockquote, .card blockquote {
  margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--hl); color: var(--muted);
  font: italic 14px/1.45 Georgia, serif; white-space: pre-line;
}
.card blockquote { cursor: pointer; }
.compose textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 8px; border-radius: 6px; resize: vertical;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.tags button { font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.tags button[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.compose .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.compose .error { color: #c0392b; margin: 6px 0 0; }
.cards { list-style: none; margin: 0; padding: 0; }
.card { padding: 10px 0; border-bottom: 1px solid var(--line); }
.card .tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--hl); margin-bottom: 4px; }
.card .body { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.card .lost { color: #c0392b; font-size: 13px; margin: 4px 0; }
.card .foot { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.card .foot .when { margin-right: auto; }
.card .foot button { font-size: 12px; padding: 2px 8px; }
@media (max-width: 699px) { .notes { padding-bottom: 72px; } }

@media (max-width: 640px) {
  main { padding: 24px 16px 60px; }
  .prose { font-size: 17px; }
  .bar { padding: 10px 16px; flex-wrap: wrap; }
}
