body {
  display: grid;
  grid-template-columns: 640px 1fr;
  gap: 4rem;
  max-width: 1100px;
  margin: 4rem auto;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #111;
  padding: 0 1.5rem;
  align-items: start;
}

p { margin: 1em 0; }

/* Chapter navigation bar */
.chapter-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.chapter-nav a {
  font-family: sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  text-decoration: none;
  padding: 0.2em 0.5em;
  border: 1px solid #ddd;
  border-radius: 3px;
}
.chapter-nav a:hover {
  color: #b5955a;
  border-color: #b5955a;
}
.chapter-nav a.active {
  color: #b5955a;
  border-color: #b5955a;
  background: #fef3cd;
}

h1, h2, h3 { font-family: Georgia, serif; text-transform: uppercase; }

/* Table of contents */
#toc {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  background: #fafaf8;
  border-left: 3px solid #e8d8b0;
  font-family: sans-serif;
  font-size: 0.8rem;
  line-height: 1.7;
}
.toc-label {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b5955a;
  margin: 0 0 0.5em;
}
#toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
#toc li a {
  color: #555;
  text-decoration: none;
}
#toc li a:hover {
  color: #b5955a;
  text-decoration: underline;
}
#toc .toc-h1 { padding-left: 0; }
#toc .toc-h2 { padding-left: 1.25em; }
#toc .toc-h3 { padding-left: 2.5em; font-style: italic; }

/* Annotation spans — inline highlights */
.ann {
  background: #fef3cd;
  padding: 0 2px;
  border-radius: 2px;
  border-bottom: 1px solid #d4a843;
  cursor: pointer;
}
.ann.active {
  background: #fde68a;
  border-bottom-color: #b5955a;
}

/* Sticky annotation panel */
#panel {
  position: sticky;
  top: 2rem;
  border-left: 3px solid #e8d8b0;
  padding-left: 1.25rem;
  font-family: sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #444;
  transition: border-color 0.2s;
}
#panel.has-content {
  border-left-color: #b5955a;
}

#panel-empty {
  color: #bbb;
  font-style: italic;
}
#panel-content {
  display: none;
}
#panel.has-content #panel-empty {
  display: none;
}
#panel.has-content #panel-content {
  display: block;
}

#panel-title {
  display: block;
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b5955a;
  margin-bottom: 0.6em;
}

/* Chapter list (index page) */
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e0d8cc;
}
.chapter-list li {
  border-bottom: 1px solid #e0d8cc;
}
.chapter-list a {
  display: flex;
  flex-direction: column;
  padding: 0.9em 0.25em;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.chapter-list a:hover {
  background: #fefbf5;
}
.chapter-list a:hover .ch-label {
  color: #b5955a;
}
.ch-label {
  font-family: sans-serif;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  margin-bottom: 0.2em;
  transition: color 0.15s;
}
.ch-title {
  font-family: Georgia, serif;
  font-size: 1rem;
  color: #222;
  line-height: 1.4;
}

/* Title block (used on cover page) */
.title-block {
  text-align: center;
  margin: 4rem 0 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #ccc;
}
.title-block p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
}
.title-block h1 {
  font-size: 2.6rem;
  font-style: italic;
  font-weight: normal;
  margin: 0.15em 0 0.4em;
  letter-spacing: 0.02em;
  color: #111;
}
.title-block h2 {
  font-size: 1rem;
  font-weight: normal;
  margin: 0 0 0.25em;
  color: #444;
}
.title-block h3 {
  font-size: 0.95rem;
  font-weight: normal;
  font-style: italic;
  color: #666;
  margin: 0;
}
