.feed-month {
  scroll-margin-top: calc(var(--header-height) + var(--s-4));
  margin-bottom: var(--s-6);
}

.feed-month__title {
  font-size: var(--fs-1);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}

.feed-entry {
  scroll-margin-top: calc(var(--header-height) + var(--s-4));
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cat-accent, var(--accent));
  background: var(--cat-bg, var(--surface));
}

[data-theme="dark"] .feed-entry {
  /* Taxonomy bg/chip colors are light-mode pastels — tint the dark surface instead. */
  background: color-mix(in srgb, var(--cat-accent) 10%, var(--surface));
  border-color: var(--border);
  border-left-color: color-mix(in srgb, var(--cat-accent) 50%, var(--border-strong));
}

[data-theme="dark"] .feed-entry .chip {
  background: color-mix(in srgb, var(--cat-accent) 7%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--cat-accent) 16%, var(--border));
  color: var(--muted);
}

.feed-entry__meta {
  font-size: var(--fs--1);
  color: var(--muted);
  margin-bottom: var(--s-2);
}

.feed-entry__title {
  font-size: var(--fs-1);
  margin-bottom: var(--s-3);
}

.feed-entry__summary {
  color: var(--fg);
  margin-bottom: var(--s-3);
}

.feed-entry__login-for-more {
  color: var(--muted);
  font-style: italic;
  margin: calc(-1 * var(--s-2)) 0 var(--s-3);
  font-size: var(--fs--1);
}

.feed-entry__media-login-required {
  color: var(--muted);
  font-style: italic;
  margin: var(--s-3) 0;
  padding: var(--s-5) var(--s-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--muted) 6%, var(--surface));
  text-align: center;
}

.feed-entry__body.is-collapsed {
  max-height: calc(1.65em * 10);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.feed-entry__expand {
  margin-top: var(--s-2);
}

.feed-empty {
  color: var(--muted);
  padding: var(--s-6) 0;
}

.month-note {
  margin-bottom: var(--s-5);
  padding: var(--s-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.feed-month__meta {
  font-size: var(--fs--1);
  margin: calc(-1 * var(--s-2)) 0 var(--s-4);
}

.doc-toc {
  margin-bottom: var(--s-6);
  padding: var(--s-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.doc-toc__title {
  font-size: var(--fs--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 var(--s-3);
}

.doc-toc__list {
  margin: 0;
  padding-left: var(--s-4);
}

.doc-toc__list--nested {
  margin-top: var(--s-1);
}

.doc-toc__item {
  margin-bottom: var(--s-1);
}

.doc-toc__item > a {
  color: var(--fg);
  text-decoration: none;
}

.doc-toc__item > a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* All Books — typography and layout overrides */
.books-all .doc-toc__list {
  list-style: none;
  padding-left: 0;
}

.books-all .doc-toc__item--book > a {
  font-weight: 650;
  color: var(--fg-strong);
}

.books-all .doc-toc__list--nested {
  list-style: none;
  margin-top: var(--s-1);
  margin-bottom: var(--s-2);
  padding-left: var(--s-5);
}

.books-all .doc-toc__item--chapter > a {
  font-size: var(--fs--1);
  font-weight: 550;
  color: var(--muted);
}

.books-all .feed-toc__collapsible > .feed-toc__summary a {
  font-weight: 650;
  color: var(--fg-strong);
}

.books-all .feed-toc__item--l2 > a {
  padding-left: calc(0.6rem + 1rem + var(--s-6));
  font-size: var(--fs--1);
  font-weight: 550;
  color: var(--muted);
}

.books-all .feed-month {
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--border);
}

.books-all .feed-month:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.books-all .feed-month__title {
  font-size: var(--fs-3);
  font-weight: 700;
  color: var(--fg-strong);
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
  margin: var(--s-6) 0 var(--s-2);
  padding-bottom: 0;
  border-bottom: none;
}

.books-all .feed-month:first-of-type .feed-month__title {
  margin-top: 0;
}

.books-all .feed-month__meta {
  text-align: center;
  margin-bottom: var(--s-5);
}

.books-all .feed-entry {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 0 var(--s-4);
  margin-bottom: var(--s-3);
}

.books-all .feed-entry__subtitle {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--fg-strong);
  margin: var(--s-6) 0 var(--s-3);
  padding: 0 0 var(--s-2);
  border: none;
  border-bottom: 2px solid var(--accent);
  line-height: 1.3;
}

.books-all .feed-entry:first-of-type .feed-entry__subtitle {
  margin-top: 0;
}

[data-theme="dark"] .books-all .feed-entry {
  background: transparent;
  border: none;
}

/* Book notes — scoped reading typography (detail + All Books) */
.book-prose {
  line-height: 1.62;
  max-width: 72ch;
}

.book-prose h2 {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--fg-strong);
  margin: var(--s-6) 0 var(--s-3);
  padding: 0 0 var(--s-2);
  border: none;
  border-bottom: 2px solid var(--accent);
  line-height: 1.3;
}

.book-prose > h2:first-child {
  margin-top: 0;
}

.book-prose h3 {
  margin: var(--s-5) 0 var(--s-3);
  font-size: var(--fs-1);
  line-height: 1.25;
  color: var(--fg-strong);
}

.book-prose ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 var(--s-5);
}

.book-prose > ul > li {
  position: relative;
  padding: var(--s-2) 0 var(--s-2) 1.35rem;
  line-height: 1.62;
}

.book-prose > ul > li::before {
  content: "-";
  position: absolute;
  left: 0;
  top: var(--s-2);
  color: var(--fg-strong);
  font-weight: 600;
}

.book-prose > ul > li > p {
  margin: 0;
}

.book-prose ul ul {
  margin: var(--s-2) 0 var(--s-2);
  padding-left: var(--s-4);
  border-left: 1px solid var(--border);
}

.book-prose ul ul > li {
  position: relative;
  padding: var(--s-1) 0 var(--s-1) 1.15rem;
  font-size: 0.96em;
  line-height: 1.55;
  color: var(--fg);
}

.book-prose ul ul > li::before {
  content: ">";
  position: absolute;
  left: 0;
  top: var(--s-1);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85em;
}

.book-prose ul ul > li > p {
  margin: 0;
}

.book-prose ul ul ul {
  margin-top: var(--s-1);
  padding-left: var(--s-3);
  border-left-color: color-mix(in oklab, var(--border) 70%, transparent);
}

.book-prose ul ul ul > li {
  font-size: 0.92em;
  padding: 0.15rem 0 0.15rem 1rem;
  line-height: 1.5;
  color: var(--fg);
}

.book-prose ul ul ul > li::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8em;
}

.book-prose li strong,
.book-prose p strong {
  color: var(--fg-strong);
  font-weight: 650;
}

.book-prose > ul > li:has(ul) > strong:only-child,
.book-prose > ul > li:has(ul) > p:only-child > strong:only-child {
  display: block;
  margin-top: var(--s-3);
  margin-bottom: var(--s-1);
  font-size: var(--fs-0);
  line-height: 1.35;
}

.book-prose > ul > li:has(ul):has(> strong:only-child),
.book-prose > ul > li:has(ul):has(> p:only-child > strong:only-child) {
  padding-left: 0;
}

.book-prose > ul > li:has(ul):has(> strong:only-child)::before,
.book-prose > ul > li:has(ul):has(> p:only-child > strong:only-child)::before {
  content: none;
}

.book-prose > ul > li:has(ul) > p:only-child > strong:only-child:first-child {
  margin-top: 0;
}

.books-all .book-prose {
  max-width: none;
}
