/* The Chapters list of the chapter bar (28 Nov 2026). The pill style of the section bars reaches every link inside
   nav.stx-pills, and the chapter bar is one of those bars, so each chapter in the list had become a pill. Here each
   chapter is a plain full-width row again: numbers in one right-aligned column, rows at least 44 px tall, the chapter
   being read marked, and a list that scrolls inside its own panel and stops above the foot of the screen.
   Loaded after the other site design sheets. Previous, Chapters and Next keep their pill look. */

/* the panel: paper in light, night blue in dark; a shade at the foot while more chapters lie below */
html:not(#_):not(#__) nav.chx-pillbar .chx-chapwrap .chx-chap-panel:not(#_) {
  padding: 8px 0 10px; color: #1c2a3f; border: 1px solid #e2d3ac; border-top: 3px solid #d8b366;
  box-shadow: 0 14px 32px rgba(20, 31, 48, 0.28);
  background-color: #fffaf0;
  background-image: linear-gradient(#fffaf0 30%, rgba(255,250,240,0)), linear-gradient(rgba(255,250,240,0), #fffaf0 70%), linear-gradient(rgba(28,42,63,0.18), rgba(28,42,63,0)), linear-gradient(rgba(28,42,63,0), rgba(28,42,63,0.18));
  background-position: top, bottom, top, bottom; background-size: 100% 28px, 100% 28px, 100% 10px, 100% 10px; background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
/* wider screens (tablet and desktop): a dropdown 420 px wide that ends 16 px above the foot of the screen.
   Phones keep the full-screen list with its Close button. --chapmenu-top is set by the script when the list opens. */
@media (min-width: 700px) {
  html:not(#_):not(#__) nav.chx-pillbar .chx-chapwrap .chx-chap-panel:not(#_) {
    box-sizing: border-box; width: min(420px, calc(100vw - 32px)); max-width: none;
    max-height: min(70vh, calc(100vh - var(--chapmenu-top, 46vh) - 16px));
    max-height: min(70vh, calc(100dvh - var(--chapmenu-top, 46vh) - 16px));
    border-radius: 0 0 6px 6px;
  }
}
html:not(#_):not(#__) nav.chx-pillbar .chx-chap-panel :is(ol, li):not(#_) { list-style: none; margin: 0; padding: 0; }

/* one chapter = one plain full-width row */
html:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_) {
  display: grid !important; grid-template-columns: 2.25em minmax(0, 1fr); column-gap: 12px; align-items: baseline;
  width: 100% !important; box-sizing: border-box !important; min-height: 44px !important; padding: 11px 20px 11px 16px !important; margin: 0 !important;
  border: 0 !important; border-left: 4px solid transparent !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  color: #1c2a3f !important; -webkit-text-fill-color: #1c2a3f !important; font-size: 17px !important; font-weight: 400 !important; line-height: 1.3 !important;
  white-space: normal !important; text-align: left !important; text-decoration: none !important;
}
/* the chapter number: a fixed column, right-aligned, bronze on paper */
html:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_) > .n {
  text-align: right; color: #8a6420 !important; -webkit-text-fill-color: #8a6420 !important; font-variant-numeric: lining-nums tabular-nums; min-width: 0;
}
html:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):is(:hover, :focus-visible) {
  background: #f6ebd2 !important; border-left-color: #d8b366 !important;
}
html:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):focus-visible { outline: 3px solid #8a6420 !important; outline-offset: -3px !important; }
/* the chapter being read */
html:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):is([aria-current="page"], [aria-current="true"]) {
  background: #f6ebd2 !important; border-left-color: #8a6420 !important; font-weight: 600 !important;
}
/* part headings inside the panel */
html:not(#_):not(#__):not(#___) body nav.chx-pillbar:not(#_) details.chx-chapters .chx-chap-panel p.chx-chap-part:not(#_) {
  margin: 0; padding: 14px 20px 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.3;
  color: #8a6420 !important; -webkit-text-fill-color: #8a6420 !important; border-top: 1px solid #e2d3ac; background: none;
}
html:not(#_):not(#__):not(#___) body nav.chx-pillbar:not(#_) details.chx-chapters .chx-chap-panel p.chx-chap-part:first-of-type:not(#_) { border-top: 0; padding-top: 8px; }

/* dark mode */
html.theme-dark:not(#_):not(#__) nav.chx-pillbar .chx-chapwrap .chx-chap-panel:not(#_) {
  background-color: #1f2c40; color: #f6ebd2; border-color: #3a4a63; border-top-color: #d8b366; box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  background-image: linear-gradient(#1f2c40 30%, rgba(31,44,64,0)), linear-gradient(rgba(31,44,64,0), #1f2c40 70%), linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0)), linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.45));
}
html.theme-dark:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_) { color: #f6ebd2 !important; -webkit-text-fill-color: #f6ebd2 !important; }
html.theme-dark:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_) > .n { color: #d8b366 !important; -webkit-text-fill-color: #d8b366 !important; }
html.theme-dark:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):is(:hover, :focus-visible) { background: #2a3a54 !important; border-left-color: #d8b366 !important; }
html.theme-dark:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):focus-visible { outline-color: #e8cd8a !important; }
html.theme-dark:not(#_):not(#__):not(#___) body:not(.home) nav.chx-pillbar:not(#_):not(#__) .chx-chap-panel a:not(#_):is([aria-current="page"], [aria-current="true"]) { background: #2a3a54 !important; border-left-color: #d8b366 !important; }
html.theme-dark:not(#_):not(#__):not(#___) body nav.chx-pillbar:not(#_) details.chx-chapters .chx-chap-panel p.chx-chap-part:not(#_) { color: #d8b366 !important; -webkit-text-fill-color: #d8b366 !important; border-top-color: #3a4a63; }
