/* ============================================================
   Noble Imprint Resource Website - Stylesheet
   Mockup B: Visual Catalog with List Toggle

   Class names match the approved mockup HTML.
   ============================================================ */

/* ----- Custom Properties ----- */
:root {
  --color-green: #536942;
  --color-green-light: #6a8556;
  --color-green-dark: #3e4f32;
  --color-gold: #dfb53b;
  --color-gold-light: #f5d36a;
  --color-charcoal: #242833;
  --color-bg: #ffffff;
  --color-bg-warm: #f6f8f5;
  --color-bg-sidebar: #fafbf9;
  --color-border: #e2e6df;
  --color-text: #3a3a3a;
  --color-text-light: #6b6b6b;
  --color-white: #ffffff;

  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-reading: 'Lora', Georgia, serif;
  --font-sans: 'Poppins', sans-serif;
  --font-heading: 'DM Sans', sans-serif;

  --sidebar-width: 280px;
  --header-height: 86px;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #9EA0A2;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   1. HEADER
   ============================================================ */
/* Default header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(58, 56, 56, 0.75);
  -webkit-backdrop-filter: blur(3px); /* Safari < 18 */
  backdrop-filter: blur(3px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.header-inner {
  display: grid;
  grid-template-areas: 'heading navigation icons';
  grid-template-columns: auto auto auto;
  align-items: center;
  column-gap: 2rem;
  padding: 8px 50px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  grid-area: heading;
  display: inline-block;
  padding: 7.5px;
  text-decoration: none;
  line-height: 0;
}

.logo-img {
  width: 150px;
  height: auto;
}

/* Nav */
.desktop-nav {
  grid-area: navigation;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.desktop-nav > a,
.nav-dropdown-toggle {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  padding: 12px;
  line-height: 1.8;
  transition: color 0.2s;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.desktop-nav > a span,
.nav-dropdown-toggle span {
  transition: text-decoration 100ms ease;
}

.desktop-nav > a:hover,
.nav-dropdown-toggle:hover {
  color: #d7b44a;
}

.desktop-nav > a:hover span,
.nav-dropdown-toggle:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #d7b44a;
}

.desktop-nav > a.active span {
  color: #d7b44a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* About dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.2);
  min-width: 20rem;
  padding: 0;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-green);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-dropdown-menu a:hover {
  color: #d7b44a;
}

/* Give button */
.header-icons {
  grid-area: icons;
  display: flex;
  align-items: center;
  justify-self: start;
  padding-left: 1rem;
}

.give-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: white;
  background-color: #d7b44a;
  padding: 8px 40px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s;
}

.give-btn:hover {
  background-color: #c4a340;
  text-decoration: none;
}

.give-btn .arrow-icon {
  transition: transform 0.2s ease;
  width: 20px;
  height: 20px;
}

.give-btn:hover .arrow-icon {
  transform: translateX(3px);
}

/* ============================================================
   2. LAYOUT: Sidebar + Main
   ============================================================ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  background: var(--color-bg);
}

/* ----- Sidebar (shared) ----- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

/* ----- Main content ----- */
.main {
  flex: 1;
  min-width: 0;
  padding: 3rem 4rem;
}

/* ============================================================
   3. SIDEBAR — Home: Library Navigation
   ============================================================ */
.sidebar-title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-light);
  padding: 0 1.25rem;
  margin-bottom: 1rem;
}

.nav-series {
  list-style: none;
}

.nav-series-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-green);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.nav-series-link:hover {
  background: rgba(83, 105, 66, 0.06);
}

.nav-caret {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.nav-series-link[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

.nav-subseries {
  list-style: none;
  display: none;
  overflow: hidden;
}

.nav-subseries.is-expanded {
  display: block;
}

.nav-sub-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.3rem 1.25rem 0.3rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.nav-sub-caret {
  width: 8px;
  height: 5px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.nav-sub-label[aria-expanded="true"] .nav-sub-caret {
  transform: rotate(180deg);
}

.nav-sub-books {
  list-style: none;
  display: none;
  padding: 0;
  margin: 0;
}

.nav-sub-books.is-expanded {
  display: block;
}

.nav-book-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.25rem 0.4rem 1.75rem;
  color: var(--color-text);
  transition: background 0.15s;
  font-size: 0.8rem;
}

.nav-book-item:hover {
  background: rgba(83, 105, 66, 0.04);
}

.nav-book-item.active {
  background: rgba(83, 105, 66, 0.1);
  color: var(--color-green);
  font-weight: 600;
}

.nav-thumb {
  width: 28px;
  height: 42px;
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  color: var(--color-white);
  text-align: center;
  line-height: 1.1;
  padding: 2px;
}

.nav-book-name {
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

/* ============================================================
   3b. SIDEBAR — Book detail: back link, cover, sessions
   ============================================================ */
.sidebar-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem 1rem;
  font-size: 0.78rem;
  color: var(--color-text-light);
  transition: color 0.15s;
}

.sidebar-back:hover {
  color: var(--color-green);
}

.sidebar-book-info {
  text-align: center;
  padding: 0 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-book-cover {
  width: 80px;
  height: 120px;
  border-radius: 5px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--color-white);
  text-align: center;
  line-height: 1.2;
  padding: 0.5rem;
}

.sidebar-book-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.sidebar-book-subtitle {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
}

.sidebar-book-author {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin-top: 0.3rem;
}

.sidebar-sessions-title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-light);
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

.nav-session-list {
  list-style: none;
  padding-top: 0.25rem;
}

.nav-session-row {
  display: flex;
  align-items: center;
}
.nav-session-row .nav-session-item {
  flex: 1;
  min-width: 0;
}
.nav-session-toggle {
  margin-right: 0.5rem;
}
.nav-session-headings.is-collapsed {
  display: none;
}

.nav-session-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  color: var(--color-text);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.nav-session-item:hover {
  background: var(--color-bg-warm);
}

.nav-session-item.active {
  border-left-color: var(--color-green);
  background: var(--color-bg-warm);
  font-weight: 600;
}

.nav-session-item .session-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  flex-shrink: 0;
}

.nav-session-item.active .session-num {
  background: var(--color-green);
  color: var(--color-white);
}
.nav-session-item .session-num.session-num--no-number {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  background: var(--color-border);
  border-radius: 50%;
  font-size: 0;
  margin: 0 6px;
}
.session-list .session-num.session-num--no-number {
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  background: var(--color-border);
  border-radius: 50%;
  font-size: 0;
  margin: 0 calc((1.5rem - 6px) / 2);
}

.nav-session-name {
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

/* Heading sub-nav under active session */
.nav-heading-list {
  list-style: none;
  padding: 0.15rem 0 0.25rem 0;
  margin: 0;
}
.nav-heading-list.is-collapsed {
  display: none;
}
.nav-heading-item {
  margin: 0;
}
.nav-heading-row {
  display: flex;
  align-items: center;
}
.nav-heading-link {
  display: block;
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-heading-link:hover {
  color: var(--color-green);
}
/* Heading level indentation — h2 starts indented past the session name text */
.nav-heading-link.nav-heading-level-2 {
  padding: 0.3rem 0.5rem 0.3rem 4.25rem;
  font-size: 0.72rem;
}
.nav-heading-link.nav-heading-level-3 {
  padding: 0.25rem 0.5rem 0.25rem 5rem;
  font-size: 0.68rem;
}
.nav-heading-link.nav-heading-level-4 {
  padding: 0.2rem 0.5rem 0.2rem 5.75rem;
  font-size: 0.65rem;
}
.nav-heading-link.nav-heading-level-5 {
  padding: 0.2rem 0.5rem 0.2rem 6.5rem;
  font-size: 0.62rem;
}
.nav-heading-link.nav-heading-level-6 {
  padding: 0.2rem 0.5rem 0.2rem 7.25rem;
  font-size: 0.62rem;
}
/* Expand/collapse toggle button */
.nav-heading-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0;
  margin-right: 0.5rem;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.nav-heading-toggle:hover {
  background: rgba(0,0,0,0.06);
  color: var(--color-green);
}
.nav-heading-chevron {
  transition: transform 0.2s ease;
}
.nav-heading-toggle[aria-expanded="true"] .nav-heading-chevron {
  transform: rotate(90deg);
}

/* Backward compat: old h2 classes */
.nav-h2-list {
  list-style: none;
  padding: 0.25rem 0 0.5rem 0;
  margin: 0;
}
.nav-h2-item {
  display: block;
  padding: 0.3rem 1.25rem 0.3rem 3.25rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
}
.nav-h2-item:hover {
  color: var(--color-green);
}

/* ============================================================
   4. HOMEPAGE — Visual Mode (default)
   ============================================================ */
.home-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.page-title {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  color: var(--color-charcoal);
  line-height: 1.2;
}

.page-subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 2.5rem;
}

.home-visual {
  display: block;
}

.series-section {
  margin-bottom: 3.5rem;
}

.series-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.series-heading {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  color: var(--color-charcoal);
}

.series-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.subseries-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-green-light);
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.grid-full-width {
  grid-column: 1 / -1;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.book-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s;
}

.book-card:hover {
  transform: translateY(-3px);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-white);
  line-height: 1.25;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-cover .cover-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
}

.book-cover .cover-badge.preview {
  color: #8a7340;
}

.book-cover .cover-badge.prerelease {
  color: #4a5a7a;
}

.book-card-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text);
  margin-top: 0.6rem;
  line-height: 1.3;
}

.book-card-sub {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin-top: 0.15rem;
}

.audiobook-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
  color: var(--color-green);
  opacity: 0.7;
}

/* ============================================================
   5. HOMEPAGE — View Toggle & List/Text Mode
   ============================================================ */

/* Toggle buttons */
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle button,
.view-toggle .toggle-btn {
  padding: 0.4rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  background: var(--color-white);
  color: var(--color-text-light);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.view-toggle button:not(:last-child),
.view-toggle .toggle-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.view-toggle button.active,
.view-toggle .toggle-btn.active {
  background: var(--color-green);
  color: var(--color-white);
}

.view-toggle button:hover:not(.active),
.view-toggle .toggle-btn:hover:not(.active) {
  background: var(--color-bg-warm);
}

/* Hide/show modes */
.home-text {
  display: none;
}

body.text-mode .home-visual {
  display: none;
}

body.text-mode .home-text {
  display: block;
}

/* List/Text mode series blocks */
.text-series-block {
  margin-bottom: 2rem;
}

.text-series-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-green);
  margin-bottom: 1rem;
}

.text-series-count {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
}

.text-subseries-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-green-light);
}

.text-subseries-title {
  white-space: nowrap;
}

.text-subseries-desc {
  font-weight: 400;
  color: var(--color-text-light);
}

.text-subseries-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.text-book-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, transform 0.15s;
}

.text-book-row:hover {
  background: var(--color-white);
  transform: translateX(4px);
}

.text-book-thumb {
  width: 32px;
  height: 48px;
  border-radius: 3px;
  flex-shrink: 0;
}

.text-book-info {
  flex: 1;
  min-width: 0;
}

.text-book-title {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.3;
}

.text-book-subtitle {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin-top: 0.1rem;
}

.text-book-meta {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--color-text-light);
  margin-top: 0.1rem;
}

.text-book-arrow {
  color: var(--color-border);
  font-size: 0.75rem;
  transition: color 0.15s;
  flex-shrink: 0;
}

.text-book-row:hover .text-book-arrow {
  color: var(--color-green);
}

/* ============================================================
   6. BOOK DETAIL PAGE
   ============================================================ */
.book-detail-top {
  margin-bottom: 2.5rem;
}

.book-detail-header {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.book-detail-cover {
  width: 180px;
  min-width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-sans);
  font-size: 1.3rem;
  color: var(--color-white);
  line-height: 1.25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.book-detail-info {
  flex: 1;
  min-width: 0;
}

.book-detail-subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.book-detail-author {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0 0 0.85rem;
}

.book-detail-meta {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-light);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-sep {
  color: var(--color-border);
}

/* Banner bars on book detail */
.banner-bar {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.banner-preview {
  background: #f0ebe0;
  color: #8a7340;
}

.banner-prerelease {
  background: #e8edf5;
  color: #4a5a7a;
}

/* Session list on book detail */
.book-sessions-area {
  margin-top: 1rem;
}

.sessions-heading-label {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-charcoal);
}

.session-list {
  list-style: none;
}

.session-list li {
  border-bottom: 1px solid var(--color-border);
}

.session-list li:first-child {
  border-top: 1px solid var(--color-border);
}

.session-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  color: var(--color-text);
  transition: color 0.15s;
}

.session-list a:hover {
  color: var(--color-green);
}

.session-num {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-light);
  width: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  flex: 1;
  margin-left: 0.5rem;
}

.session-arrow {
  color: var(--color-text-light);
}
.suggestion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #f0a800;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0 5px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* ============================================================
   7. SESSION READING PAGE
   ============================================================ */
.reading-top {
  margin-bottom: 1.5rem;
}

.reading-content {
  max-width: 680px;
}

/* Session content typography */
.session-content h1,
.reading-content h1 {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

.session-content h2,
.reading-content h2 {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-charcoal);
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
  scroll-margin-top: 100px;
}

.session-content h3,
.reading-content h3 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-charcoal);
  margin: 2rem 0 0.75rem;
}

.session-content h4,
.reading-content h4 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  color: var(--color-text-light);
}

.session-content h5,
.reading-content h5 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 1.5rem 0 0.35rem;
  color: #555;
}

.session-content h6,
.reading-content h6 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  margin: 1.25rem 0 0.25rem;
  color: #555;
}

.session-content table,
.reading-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-reading);
  font-size: 15px;
  line-height: 1.6;
}

.session-content th,
.reading-content th {
  font-family: var(--font-sans);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  background: #eae6df;
  border: 1px solid #ddd;
  color: var(--color-charcoal);
}

.session-content td,
.reading-content td {
  padding: 10px 14px;
  border: 1px solid #e5e5e5;
  vertical-align: top;
}

.session-content tbody tr:nth-child(even),
.reading-content tbody tr:nth-child(even) {
  background: #fafaf8;
}
.table-heading-row {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  background: #eae6df;
  color: var(--color-charcoal);
  border: 1px solid #ddd;
}

.session-content p,
.reading-content p {
  font-family: var(--font-reading);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.session-content ul,
.reading-content ul,
.session-content ol,
.reading-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.session-content ul,
.reading-content ul {
  list-style: disc;
}

.session-content ol,
.reading-content ol {
  list-style: decimal;
}

.session-content li,
.reading-content li {
  font-family: var(--font-reading);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Bibliography — Chicago-style hanging indent, no bullets. Scoped to the
   <Bibliography> wrapper (parser.js). Applies to both list entries and plain
   paragraph entries so mixed source formats render uniformly. */
.session-content .bibliography ul,
.reading-content .bibliography ul,
.session-content .bibliography ol,
.reading-content .bibliography ol {
  padding-left: 0;
  margin-left: 0;
  list-style: none;
}

.session-content .bibliography li,
.reading-content .bibliography li,
.session-content .bibliography p,
.reading-content .bibliography p {
  padding-left: 2em;
  text-indent: -2em;
  text-align: left;
  margin-bottom: 0.9rem;
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* Blockquote */
.session-content blockquote,
.reading-content blockquote {
  border-left: 3px solid var(--color-green);
  background: var(--color-bg-warm);
  padding: 0.75rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.session-content blockquote p,
.reading-content blockquote p {
  font-family: var(--font-reading);
  font-style: italic;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.session-content blockquote p:last-child,
.reading-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Attribution */
.attribution {
  text-align: right;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 600;
  margin: -0.5rem 0 1.5rem;
}

/* Per-book accent theming — active only when the book sets meta.json "accent"
   (adds .accent-themed + --accent on .session-content). Blockquotes and callouts
   are tinted from the one accent at different strengths so they stay distinct;
   other books are untouched. color-mix degrades gracefully (border still themed). */
.session-content.accent-themed blockquote {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.session-content.accent-themed .pullquote {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.session-content.accent-themed .pullquote::before {
  color: var(--accent);
}
.session-content.accent-themed .pullquote p {
  color: color-mix(in srgb, var(--accent) 80%, black);
}
/* Bible-ref links take the book's accent (green stays the global default) */
.session-content.accent-themed .bible-ref {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.session-content.accent-themed .bible-ref:hover {
  color: color-mix(in srgb, var(--accent) 75%, black);
}
/* External (http) and internal (root-relative "/…") links in prose render like
   the book's other links: underline + the book accent when themed (matches
   .bible-ref). Bible refs (href="#") and footnotes (href="#fn…") are unaffected. */
.session-content a[href^="http"],
.session-content a[href^="/"] {
  text-decoration: underline;
}
.session-content.accent-themed a[href^="http"],
.session-content.accent-themed a[href^="/"] {
  color: var(--accent);
}
.session-content.accent-themed a[href^="http"]:hover,
.session-content.accent-themed a[href^="/"]:hover {
  color: color-mix(in srgb, var(--accent) 75%, black);
}
/* Tables: heading bar + even rows tinted from the accent */
.session-content.accent-themed .table-heading-row,
.session-content.accent-themed th,
.reading-content.accent-themed th {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, black);
}
.session-content.accent-themed tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--accent) 9%, white);
}

/* Bold text: real Lora 600 (semibold, now loaded in header.ejs) — the default 700
   isn't loaded and gets faux-bolded (heavy/clunky). 600 is a clean, lighter bold. */
.session-content strong,
.session-content b,
.reading-content strong,
.reading-content b {
  font-weight: 600;
}

/* Pullquote callout */
.pullquote {
  background: rgba(83, 105, 66, 0.07);
  border-radius: 12px;
  padding: 2rem 2.5rem 1.75rem;
  margin: 2.5rem auto;
  max-width: 88%;
  position: relative;
  text-align: center;
}

.pullquote::before {
  content: "\201C";
  display: block;
  font-size: 3.5em;
  color: var(--color-green);
  opacity: 0.35;
  font-weight: 700;
  line-height: 0.6;
  margin-bottom: 0.5rem;
}

.pullquote p {
  font-family: var(--font-reading);
  font-size: 1.2em;
  font-weight: 500;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-green-dark);
  margin: 0;
}

/* ── Infographics ──────────────────────────────────────────────────────────
   Rendered from <Infographic>/<Item> markdown as a responsive accent-themed
   timeline: a vertical spine with icon/number nodes, label + body per item. */
.infographic {
  background: var(--accent, #8D4449);
  color: #fff;
  border-radius: 14px;
  padding: 2rem 1.75rem 2.25rem;
  margin: 2.5rem 0;
}
.info-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.55rem;
  text-align: center;
  margin-bottom: 0.55rem;
}
.info-intro {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 1.9rem;
  line-height: 1.6;
  opacity: 0.95;
}
.infographic .info-items {
  list-style: none;
  margin: 0;
  padding: 0;   /* beat the generic .session-content ul padding so spine + nodes align */
  position: relative;
}
.info-items::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 1rem;
  bottom: 1.5rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.3);
}
.info-item {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 0.25rem 0 1.5rem;
}
.info-item:last-child { padding-bottom: 0; }
.info-marker {
  position: relative;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--accent, #8D4449);
  border-radius: 50%;
}
.info-num {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.info-text { display: block; padding-top: 0.35rem; }
.info-label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.25;
  margin-bottom: 0.3rem;
}
.info-body {
  display: block;
  line-height: 1.55;
  font-size: 0.95rem;
  opacity: 0.96;
}
.info-body strong { color: #fff; }

/* Wide screens: two-column alternating timeline like the print layout.
   Odd/even items float into left/right columns that pack independently, so the
   alternating items interleave (compact, like the print) rather than each taking
   a full row. */
@media (min-width: 680px) {
  .infographic .info-items { display: flow-root; }
  .infographic .info-items::before { left: 50%; margin-left: -1px; top: 0.5rem; bottom: 0.5rem; }
  .infographic .info-item {
    display: block;
    width: 50%;
    box-sizing: border-box;
    position: relative;
    padding: 0 0 1.75rem;
    gap: 0;
  }
  .infographic .info-item:nth-child(odd) {
    float: left; clear: left;
    padding-right: 3rem;
    text-align: right;
  }
  .infographic .info-item:nth-child(even) {
    float: right; clear: right;
    padding-left: 3rem;
    text-align: left;
  }
  .infographic .info-item:nth-child(2) { margin-top: 3rem; }  /* default offset for the right column */
  /* hollow node ring on the spine (accent-filled center masks the line behind it) */
  .infographic .info-item::after {
    content: "";
    position: absolute;
    top: 0.3rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #8D4449);
    border: 2px solid #fff;
    box-sizing: border-box;
    z-index: 2;
  }
  .infographic .info-item:nth-child(odd)::after { right: -7px; }
  .infographic .info-item:nth-child(even)::after { left: -7px; }
  /* an "active" item shows a filled (solid) node instead of the hollow ring */
  .infographic .info-item--active::after { background: #fff; }
  /* short connector from the spine node toward the content */
  .infographic .info-item::before {
    content: "";
    position: absolute;
    top: calc(0.3rem + 6px);
    height: 2px;
    width: 1.75rem;
    background: rgba(255, 255, 255, 0.55);
    z-index: 1;
  }
  .infographic .info-item:nth-child(odd)::before { right: 0; }
  .infographic .info-item:nth-child(even)::before { left: 0; }
  /* icon/glyph floats at the outer edge, vertically centered on the label line
     (a small upward nudge so the tall glyph doesn't overhang into the body text) */
  .infographic .info-marker {
    position: absolute;
    top: -0.22rem;
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    font-size: 1.8rem;
    line-height: 1;
  }
  .infographic .info-item:nth-child(odd) .info-marker { left: 0; }
  .infographic .info-item:nth-child(even) .info-marker { right: 0; }
  /* only the label clears the icon; body spans the full half-width (under the icon) */
  .infographic .info-item:nth-child(odd) .info-label { padding-left: 3rem; }
  .infographic .info-item:nth-child(even) .info-label { padding-right: 3rem; }
  .infographic .info-text { padding-top: 0; }
}

@media (max-width: 480px) {
  .infographic { padding: 1.5rem 1.1rem 1.75rem; }
  .info-item { grid-template-columns: 2.5rem 1fr; gap: 0.75rem; }
  .info-marker { width: 2.5rem; height: 2.5rem; font-size: 1.2rem; }
  .info-items::before { left: 1.25rem; }
}

/* ── PracticeSummary: the print band (content contract §3b; Steve's pick 1, 2026-11-22) ──
   The book's accent, bleeding off the reading column's left edge (--ps-bleed = the column's left
   padding; v2 sets it per width in style-v2.css), a rounded right end, white sans text, bold label. */
.practice-summary {
  --ps-bleed: 16px;
  background: var(--accent, #8D4449);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.45;
  text-align: left;
  margin: 0.9em -14px 1.2em calc(-1 * var(--ps-bleed));
  padding: 0.85em 1.25em 0.9em var(--ps-bleed);
  border-radius: 0 1.7em 1.7em 0;
}
.practice-summary b { font-weight: 600; }

/* ── Timeline infographic (type="timeline": Five Movements; §3c, Steve's pick 3) ──
   One-sided below 680 px (phones), alternating left/right from 680 px like the print page.
   Each stop: a dot on the line, a short connector, the two-line bold title + its icon next to the line,
   the description under it. */
.infographic--timeline { --tl-hc: 21px; }
.infographic--timeline .info-intro { margin-bottom: 1.8rem; }
.infographic--timeline .tl-stops { list-style: none; margin: 0; padding: 0; position: relative; }
/* the line: one segment per stop, from its dot to the next stop's dot (so it ends at the last dot) */
.infographic--timeline .tl-stop:not(:last-child) > .tl-hd::after {
  content: ""; position: absolute; left: 6px; top: var(--tl-hc); bottom: calc(-1 * var(--tl-hc));
  width: 2px; background: rgba(255, 255, 255, 0.6);
}
.infographic--timeline .tl-stop { position: relative; padding: 0 0 1.7rem 2.1rem; text-align: left; hyphens: manual; }
.infographic--timeline .tl-stop:last-child { padding-bottom: 0; }
.infographic--timeline .tl-stop::after {
  content: ""; position: absolute; left: -1px; top: calc(var(--tl-hc) - 7px);
  width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%;
  background: var(--accent, #8D4449); border: 2px solid #fff; z-index: 2;
}
.infographic--timeline .tl-stop::before {
  content: ""; position: absolute; left: 13px; top: calc(var(--tl-hc) - 1px);
  width: 1.1rem; height: 2px; background: rgba(255, 255, 255, 0.75);
}
.infographic--timeline .tl-hd {
  display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center;
  gap: 10px; min-height: calc(var(--tl-hc) * 2);
}
.infographic--timeline .tl-title { font-family: var(--font-sans); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.infographic--timeline .tl-icon { flex: 0 0 auto; font-size: 24px; line-height: 0; color: #fff; }
.infographic--timeline .info-body { margin-top: 4px; }
@media (max-width: 480px) {
  .infographic--timeline { padding: 1.6rem 1.1rem 1.8rem; }
  .infographic--timeline .info-title { font-size: 1.35rem; }
}
/* timeline: alternating */
@media (min-width: 680px) {
  .infographic--timeline .tl-stop:nth-child(odd):not(:last-child) > .tl-hd::after { left: auto; right: -1px; }
  .infographic--timeline .tl-stop:nth-child(even):not(:last-child) > .tl-hd::after { left: -1px; }
  .infographic--timeline .tl-stop { width: 50%; box-sizing: border-box; }
  .infographic--timeline .tl-stop:nth-child(odd) { padding: 0 2.75rem 1.7rem 0; text-align: right; }
  .infographic--timeline .tl-stop:nth-child(odd) .tl-hd { flex-direction: row; justify-content: flex-end; }
  .infographic--timeline .tl-stop:nth-child(odd)::after { left: auto; right: -7px; }
  .infographic--timeline .tl-stop:nth-child(odd)::before { left: auto; right: 7px; width: 2rem; }
  .infographic--timeline .tl-stop:nth-child(even) { margin-left: 50%; padding: 0 0 1.7rem 2.75rem; }
  .infographic--timeline .tl-stop:nth-child(even)::after { left: -7px; }
  .infographic--timeline .tl-stop:nth-child(even)::before { left: 7px; width: 2rem; }
  .infographic--timeline .tl-stop:last-child { padding-bottom: 0; }
}

/* ── Per-session infographic themes ────────────────────────────────────────
   Opt in by wrapping a session's content in <div class="ig-theme-NAME">. Only
   colors/borders/background change — structure, spine, nodes, icons, spacing,
   and the minimum-dot-spacing JS are all unchanged. */
/* Blush gradient (white → soft blush, red headings & icons) */
.ig-theme-blush .infographic { --accent: #faf1f1; background: linear-gradient(135deg, #ffffff 0%, #f3dede 100%); color: #5c3d40; border: 1px solid #ecd9d9; }
.ig-theme-blush .info-title { color: #8D4449; }
.ig-theme-blush .info-marker { color: #8D4449; }
.ig-theme-blush .info-items::before { background: rgba(141,68,73,.28); }
.ig-theme-blush .info-item::after { border-color: #8D4449; }
.ig-theme-blush .info-item--active::after { background: #8D4449; }
.ig-theme-blush .info-item::before { background: rgba(141,68,73,.45); }
.ig-theme-blush .info-body strong { color: #8D4449; }
/* Accent-bar card (white card, red top bar + soft shadow, red icons, grey body) */
.ig-theme-card .infographic { --accent: #fff; background: #fff; color: #4b4b4b; border-top: 3px solid #8D4449; box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.ig-theme-card .info-title { color: #8D4449; }
.ig-theme-card .info-marker { color: #8D4449; }
.ig-theme-card .info-items::before { background: rgba(141,68,73,.25); }
.ig-theme-card .info-item::after { border-color: #8D4449; }
.ig-theme-card .info-item--active::after { background: #8D4449; }
.ig-theme-card .info-item::before { background: rgba(141,68,73,.40); }
.ig-theme-card .info-body strong { color: #333; }
/* Outline (white ground, thin red border, red text / icons / nodes) */
.ig-theme-outline .infographic { --accent: #fff; background: #fff; color: #8D4449; border: 1px solid #8D4449; }
.ig-theme-outline .info-title { color: #8D4449; }
.ig-theme-outline .info-items::before { background: rgba(141,68,73,.30); }
.ig-theme-outline .info-item::after { border-color: #8D4449; }
.ig-theme-outline .info-item--active::after { background: #8D4449; }
.ig-theme-outline .info-item::before { background: rgba(141,68,73,.50); }
.ig-theme-outline .info-body strong { color: #8D4449; }

/* Chapter section number (e.g. Seneca's original paragraph numbers) */
.chapter-num {
  font-weight: 700;
  font-size: 1.95em;
}

/* Sub-paragraph indent (paragraphs starting with bold number) */
.sub-para {
  text-indent: 1.5em;
}

/* Footnotes */
.footnotes-sep {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0 1.5rem;
}

.footnotes {
  font-family: var(--font-reading);
  color: var(--color-text-light);
  line-height: 1.6;
}

.footnotes ol {
  padding-left: 1.5em;
  margin: 0;
}

.session-content .footnotes li,
.reading-content .footnotes li {
  font-size: 13px;
  margin-bottom: 0.5em;
}

.session-content .footnotes li p,
.reading-content .footnotes li p {
  font-size: 13px;
  margin: 0;
}

/* Scroll offset for sticky header on anchor jumps */
.footnote-item {
  scroll-margin-top: 100px;
}

.footnote-ref a[id] {
  scroll-margin-top: 100px;
}

.footnote-ref a {
  color: var(--color-green);
  text-decoration: none;
  font-weight: 600;
}

.footnote-ref a:hover {
  text-decoration: underline;
}

.footnote-backref {
  color: var(--color-green);
  text-decoration: none;
  margin-left: 0.25em;
}

.footnote-backref:hover {
  text-decoration: underline;
}

/* Question block */
.question-block {
  border-left: 3px solid #cdccc9;
  background: #f6f5f4;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 4px 4px 0;
}

.question-block p {
  font-family: var(--font-reading);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin: 0;
}

/* Common content (shared sections) */
.common-content {
  background: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.common-content .section-tag {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-green);
  margin-bottom: 0.5rem;
}

.common-content p {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Cover images */
.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  position: absolute;
  top: 0;
  left: 0;
}

.book-cover {
  position: relative;
  overflow: hidden;
}

.nav-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.text-book-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.sidebar-book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.sidebar-book-cover {
  overflow: hidden;
}

.book-detail-cover {
  position: relative;
  overflow: hidden;
}

.book-detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
}

/* Image placeholders */
.image-placeholder {
  background: var(--color-bg-warm);
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin: 1.5rem 0;
}
.session-image {
  margin: 2rem 0;
  text-align: center;
}
.session-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.session-image figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Session prev/next nav */
.session-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.session-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
  max-width: 45%;
}

.session-nav-link:hover {
  border-color: var(--color-green);
  background: var(--color-bg-warm);
}

.session-nav-dir {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
}

.session-nav-name {
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.session-nav-next {
  margin-left: auto;
  text-align: right;
}

.session-nav-placeholder {
  border: none;
}

/* ============================================================
   8. UTILITIES
   ============================================================ */

/* Badges */
.badge {
  display: inline-block;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-preview {
  background: #f0ebe0;
  color: #8a7340;
}

.badge-prerelease {
  background: #e8edf5;
  color: #4a5a7a;
}

/* Breadcrumbs */
.breadcrumb {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--color-green);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.35rem;
}

/* Error page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 50vh;
}

.error-title {
  font-family: var(--font-sans);
  font-size: 4rem;
  color: var(--color-green);
  margin-bottom: 0.5rem;
}

.error-message {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.error-home-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-green);
  border: 1px solid var(--color-green);
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.error-home-link:hover {
  background: var(--color-green);
  color: var(--color-white);
}

/* ============================================================
   9. COVER COLOR CLASSES
   ============================================================ */
.cover-green {
  background: linear-gradient(135deg, #536942, #3d5030);
}

.cover-gold {
  background: linear-gradient(135deg, #c4a44e, #a08530);
}

.cover-slate {
  background: linear-gradient(135deg, #404A77, #2e3558);
}

.cover-charcoal {
  background: linear-gradient(135deg, #3a3f4d, #242833);
}

.cover-sage {
  background: linear-gradient(135deg, #7a9b6a, #5d7a4e);
}

.cover-warm {
  background: linear-gradient(135deg, #8b7355, #6b5840);
}

.cover-dark-green {
  background: linear-gradient(135deg, #2d4a2d, #1a331a);
}

/* ============================================================
   10. BIBLE
   ============================================================ */
.bible-content {
  font-family: var(--font-reading);
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
}

.bible-paragraph {
  font-family: var(--font-reading);
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
  margin-bottom: 1.25rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.bible-section-heading {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-green-dark);
  margin: 2rem 0 0.75rem;
}

.bible-verse {
  display: inline;
}

/* Bible reference links */
.bible-ref {
  color: var(--color-green);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-green);
  cursor: pointer;
  transition: color 0.15s;
}

.bible-ref:hover {
  color: var(--color-green-dark);
}

/* Verse popup */
.verse-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.verse-popup-overlay.is-visible {
  display: flex;
}

.verse-popup {
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 520px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.verse-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.verse-popup-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  flex-shrink: 0;
}

.verse-popup-close:hover {
  color: var(--color-text);
}

.verse-popup-scroll {
  overflow-y: auto;
  padding: 1.5rem 2rem;
  flex: 1;
}

.verse-popup-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-charcoal);
}

.verse-popup-body {
  font-family: var(--font-reading);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: #1a1a1a;
}

.verse-popup-body .verse-num {
  font-family: var(--font-sans);
  font-size: 0.7em;
  font-weight: 600;
  color: var(--color-green);
  margin-right: 2px;
  vertical-align: super;
}

.verse-popup-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 0.25rem; /* the link's 44px height gives the rest */
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.verse-popup-translation {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* The one link: "Go to Hebrews 11 ›", or "Go to Genesis 4 ›" for a cut passage (settings plan P5c). Semibold,
   with a 44px tap height (P7 design page, option A). */
.verse-popup-link {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.verse-popup-link:hover {
  text-decoration: underline;
}

.verse-popup-chapter {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-charcoal);
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.verse-popup-heading {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-green-dark);
  margin: 1rem 0 0.5rem;
}

/* Set like the reading page's text (Steve, 2026-10-23, as the app): 17px, .01em, justified + hyphenated. */
.verse-popup-body p {
  margin-bottom: 0.75rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.verse-gap {
  border-top: 1px dashed var(--color-border);
  margin: 1rem 0;
}

/* A passage cut at 3 chapters: a plain "… continues through Genesis 50" (the footer has the link) */
.verse-popup-body .verse-popup-continues {
  margin-top: 1rem;
  font-style: italic;
  color: var(--color-text-light);
}

.verse-popup-loading {
  text-align: center;
  padding: 2rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.verse-num {
  font-family: var(--font-sans);
  font-size: 0.7em;
  font-weight: 600;
  color: var(--color-green);
  margin-right: 2px;
  vertical-align: super;
  line-height: 0;
}

/* ============================================================
   10b. FOOTER
   ============================================================ */
.site-footer {
  background: #ffffff;
  color: #536942;
  font-family: var(--font-sans);
  border-top: 1px solid rgba(83, 105, 66, 0.08);
}

.footer-top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 50px 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 3rem;
}

.footer-logo-img {
  width: 180px;
  height: auto;
  opacity: 0.85;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: #536942;
  margin-bottom: 1rem;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link-list li {
  margin-bottom: 0.4rem;
}

.footer-link-list a {
  font-size: 0.82rem;
  color: rgba(83, 105, 66, 0.75);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link-list a:hover {
  color: #536942;
}

.footer-description {
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(83, 105, 66, 0.75);
}

.footer-bottom {
  border-top: 1px solid rgba(83, 105, 66, 0.08);
  padding: 1.5rem 50px;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-bottom-inner {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bottom small {
  font-size: 0.72rem;
  color: rgba(83, 105, 66, 0.5);
}

.footer-bottom a {
  color: rgba(83, 105, 66, 0.5);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-bottom a:hover {
  color: #536942;
}

.footer-build-time {
  font-size: 0.65rem;
  color: rgba(83, 105, 66, 0.35);
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .footer-top {
    padding: 2rem 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    padding: 1rem 1.5rem;
  }

  .footer-bottom-inner {
    justify-content: center;
    gap: 1rem;
  }
}

/* ============================================================
   11. MOBILE MENU DRAWER
   ============================================================ */

/* Hamburger button — hidden on desktop */
.menu-drawer-container {
  display: none;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: rgb(255, 255, 255);
  cursor: pointer;
  position: relative;
}

.hamburger-btn .icon-hamburger,
.hamburger-btn .icon-close {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: transform 150ms ease, opacity 150ms ease;
}

.hamburger-btn .icon-close {
  opacity: 0;
  transform: scale(0.8);
}

.hamburger-btn.is-open .icon-hamburger {
  opacity: 0;
  transform: scale(0.8);
}

.hamburger-btn.is-open .icon-close {
  opacity: 1;
  transform: scale(1);
}

/* Overlay — positioned below header */
.menu-drawer-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: calc(100vh - 100%);
  background: rgba(83, 105, 66, 0.5);
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.menu-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Drawer panel — positioned below header */
.menu-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: calc(100vh - 100%);
  background-color: #ffffff;
  color: #536942;
  z-index: 3;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 200ms ease;
  overflow-x: hidden;
  overflow-y: auto;
}

.menu-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

@media screen and (min-width: 750px) {
  .menu-drawer {
    width: 400px;
    border-right: 1px solid rgba(83, 105, 66, 0.1);
  }
}

.menu-drawer__inner {
  position: relative;
  height: 100%;
}

.menu-drawer__nav {
  display: block;
  width: 100%;
  padding: 30px 0;
}

.menu-drawer__menu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.menu-drawer__menu > li {
  display: block;
  margin: 0 0 2px 0;
  padding: 0;
}

.menu-drawer .menu-drawer__menu-item {
  display: block;
  width: 100%;
  padding: 11px 30px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: rgba(83, 105, 66, 0.75);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s, background-color 0.2s;
  box-sizing: border-box;
  line-height: 1.5;
}

.menu-drawer .menu-drawer__menu-item:hover,
.menu-drawer .menu-drawer__menu-item:focus,
.menu-drawer .menu-drawer__menu-item--active {
  color: rgb(83, 105, 66);
  background-color: rgba(83, 105, 66, 0.04);
}

.menu-drawer .menu-drawer__menu-item--active:hover {
  background-color: rgba(83, 105, 66, 0.08);
}

/* Submenu toggle — arrow pushed to far right via flexbox */
.menu-drawer .menu-drawer__submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 30px;
}

.menu-drawer__arrow {
  width: 15px;
  height: auto;
  flex-shrink: 0;
}

/* Submenu panel — slides from right */
.menu-drawer__submenu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 1;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 200ms ease;
  overflow-y: auto;
}

.menu-drawer__submenu.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* Back button */
.menu-drawer__back-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 26px 12px 30px;
  margin-top: 15px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: rgba(83, 105, 66, 0.75);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.menu-drawer__back-arrow {
  width: 15px;
  margin-right: 10px;
  transform: rotate(180deg);
}

/* Body scroll lock */
body.drawer-open {
  overflow: hidden;
}

/* Mobile TOC — hidden on desktop */
.mobile-toc-bar {
  display: none;
}
.mobile-toc-sidebar-dropdown {
  display: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 989px) {
  .menu-drawer-container {
    display: flex;
    align-items: center;
  }

  .desktop-nav {
    display: none;
  }

  .header-inner {
    display: flex;
    align-items: center;
    padding: 4px 30px 4px 15px;
    gap: 0;
    max-width: none;
  }

  .logo {
    grid-area: unset;
  }

  .header-icons {
    margin-left: auto;
  }

  .give-btn {
    font-size: 13px;
    padding: 6px 20px;
  }

  .mobile-toc-bar {
    display: block;
  }
}

@media (max-width: 1024px) {
  .give-btn {
    display: none;
  }
}

/* ---- Tablet (≤ 768px) ---- */
@media (max-width: 768px) {

  /* Layout: stack sidebar above main */
  .layout {
    flex-direction: column;
  }

  /* Sidebar becomes a collapsible panel */
  .sidebar {
    width: 100%;
    min-width: 100%;
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    overflow: visible;
  }

  /* Hide sidebar content by default on homepage, show toggle */
  .sidebar .nav-series {
    display: none;
  }

  .sidebar.sidebar-expanded .nav-series {
    display: block;
  }

  .sidebar .sidebar-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1.25rem;
  }

  .sidebar .sidebar-title::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-light);
    border-bottom: 2px solid var(--color-text-light);
    transform: rotate(45deg);
    transition: transform 200ms ease;
  }

  .sidebar.sidebar-expanded .sidebar-title::after {
    transform: rotate(-135deg);
  }

  /* Book/session sidebar — hidden on mobile, shown as dropdown from TOC bar */
  .sidebar {
    display: none !important;
  }
  .mobile-toc-bar.is-open ~ .main {
    /* dim content behind dropdown */
  }
  .mobile-toc-sidebar-dropdown {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--color-bg-sidebar);
    border-bottom: 1px solid var(--color-border);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
  }
  .mobile-toc-sidebar-dropdown.is-visible {
    display: block;
  }

  .main {
    padding: 1.5rem 1rem;
  }

  /* Homepage */
  .home-header-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .series-heading {
    font-size: 1.25rem;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
  }

  .book-cover {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .book-card-title {
    font-size: 0.78rem;
  }

  /* List view mobile */
  .text-book-row {
    padding: 0.5rem;
    gap: 0.6rem;
  }

  .text-book-title {
    font-size: 0.82rem;
  }

  /* Book detail page */
  .book-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .book-detail-cover {
    width: 140px;
    min-width: 140px;
  }

  .book-detail-meta {
    justify-content: center;
  }

  .book-detail-subtitle {
    font-size: 0.9rem;
  }

  /* Session reading page */
  .reading-content {
    padding: 0;
    max-width: 100%;
  }

  .session-content h1,
  .reading-content h1 {
    font-size: 1.6rem;
  }

  .session-content h2,
  .reading-content h2 {
    font-size: 1.25rem;
  }

  .session-content p,
  .reading-content p,
  .session-content li,
  .reading-content li {
    font-size: 16px;
  }

  .pullquote {
    max-width: 100%;
    padding: 1.5rem 1.25rem 1.25rem;
    margin: 1.5rem 0 2rem;
  }

  .pullquote p {
    font-size: 1.1em;
  }

  .question-block {
    padding: 0.75rem 1rem;
  }

  .session-content blockquote,
  .reading-content blockquote {
    padding: 0.6rem 1rem;
    margin: 1rem 0;
  }

  /* Breadcrumbs */
  .breadcrumb {
    font-size: 0.72rem;
    line-height: 1.6;
  }

  /* Mobile TOC bar — fixed below header */
  .mobile-toc-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--color-bg-warm);
    border-bottom: 1px solid var(--color-border);
    transition: transform 200ms ease;
  }

  .mobile-toc-bar.is-hidden {
    transform: translateY(-100%);
  }

  .mobile-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-green);
    background: none;
    border: none;
    cursor: pointer;
  }

  .mobile-toc-chevron {
    transition: transform 200ms ease;
  }

  .mobile-toc-bar.is-open .mobile-toc-chevron {
    transform: rotate(180deg);
  }

  .mobile-toc-panel {
    display: none;
    padding: 0 1rem 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
  }

  .mobile-toc-bar.is-open .mobile-toc-panel {
    display: block;
  }

  .mobile-toc-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
  }

  .mobile-toc-list li {
    margin: 0;
  }

  .mobile-toc-link {
    display: block;
    padding: 0.4rem 0;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .mobile-toc-link:hover {
    color: var(--color-green);
  }

  .mobile-toc-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
  }

  .mobile-toc-nav-link {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--color-green);
    text-decoration: none;
  }

  .mobile-toc-nav-next {
    margin-left: auto;
  }

  /* Heading sub-nav mobile — indented past session name */
  .nav-heading-link.nav-heading-level-2 { padding-left: 3.5rem; font-size: 0.7rem; }
  .nav-heading-link.nav-heading-level-3 { padding-left: 4.25rem; font-size: 0.67rem; }
  .nav-heading-link.nav-heading-level-4 { padding-left: 5rem; font-size: 0.64rem; }
  .nav-heading-link.nav-heading-level-5 { padding-left: 5.5rem; font-size: 0.62rem; }
  .nav-heading-link.nav-heading-level-6 { padding-left: 6rem; font-size: 0.62rem; }
  .nav-heading-toggle { width: 36px; min-width: 36px; height: 32px; } /* bigger touch target */

  /* H2 sub-nav mobile (backward compat) */
  .nav-h2-item {
    padding-left: 2.5rem;
    font-size: 0.7rem;
  }

  /* Session prev/next — keep side by side */
  .session-nav {
    flex-direction: row;
  }

  .session-nav-link {
    max-width: 45%;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 1rem;
  }
}

/* ---- Small phone (≤ 480px) ---- */
@media (max-width: 480px) {
  .header-inner {
    padding: 4px 10px;
  }

  .logo-img {
    width: 110px;
  }

  .main {
    padding: 1rem 0.75rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .book-detail-cover {
    width: 120px;
    min-width: 120px;
  }

  .session-content p,
  .reading-content p,
  .session-content li,
  .reading-content li {
    font-size: 15px;
  }

  .pullquote {
    padding: 1.25rem 1rem 1rem;
  }

  .pullquote p {
    font-size: 1.05em;
  }
}

/* ============================================================
   Authentication — Login Button, User Avatar, Dropdown
   ============================================================ */

/* Sidebar auth — bottom of sidebar */
.sidebar-auth {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.sidebar-auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-auth-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d7b44a;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
}
.sidebar-auth-info {
  overflow: hidden;
}
.sidebar-auth-name {
  font-size: 12px;
  font-weight: 500;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-auth-email {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-auth-link {
  display: block;
  background: none;
  border: none;
  color: #999;
  font: 12px 'DM Sans', sans-serif;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  width: 100%;
  text-align: left;
}
.sidebar-auth-link:hover {
  color: #d7b44a;
}
.sidebar-auth-link--signin {
  color: #aaa;
}
.sidebar-auth-link--signout {
  color: #888;
}

.login-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  white-space: nowrap;
}
.login-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.7);
}

.user-menu {
  position: relative;
}
.user-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: box-shadow .2s;
}
.user-avatar-btn:hover {
  box-shadow: 0 0 0 2px rgba(215,180,74,.5);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
}
.user-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d7b44a;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
  min-width: 220px;
  z-index: 1100;
  overflow: hidden;
}
.user-dropdown.is-open {
  display: block;
}
.user-dropdown-info {
  padding: 14px 16px 10px;
}
.user-dropdown-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
}
.user-dropdown-email {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}
.user-dropdown-divider {
  height: 1px;
  background: #eee;
}
.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: #333;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.user-dropdown-item:hover {
  background: #f5f5f5;
}
.user-dropdown-item--btn {
  color: #c0392b;
}

/* Mobile drawer auth items */
.menu-drawer__divider {
  height: 1px;
  background: rgba(255,255,255,.15);
  margin: 8px 0;
}
.menu-drawer__menu-item--btn {
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

/* ============================================================
   Admin Console
   ============================================================ */

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 24px 60px;
  width: 100%;
}
.admin-back {
  display: inline-block;
  font-size: 13px;
  color: #888;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color .15s;
}
.admin-back:hover {
  color: #d7b44a;
}
.admin-page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: #1a1a1a;
  margin-bottom: 24px;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 24px;
}
.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.admin-tab:hover {
  color: #333;
}
.admin-tab--active {
  color: #1a1a1a;
  border-bottom-color: #d7b44a;
}

/* Panels */
.admin-panel--hidden {
  display: none;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* Buttons */
.admin-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.admin-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}
.admin-btn--primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.admin-btn--primary:hover {
  background: #333;
}
.admin-btn--danger {
  color: #c0392b;
  border-color: #e8c4c0;
}
.admin-btn--danger:hover {
  background: #fdf0ef;
}
.admin-btn--sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* Tables */
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e5e5e5;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.admin-table tbody tr:hover {
  background: #fafafa;
}
.admin-table--compact th,
.admin-table--compact td {
  padding: 8px 10px;
}

/* User cell — use inline layout instead of flex on <td> to avoid row height misalignment */
.admin-user-cell {
  white-space: nowrap;
}
.admin-user-cell > * {
  vertical-align: middle;
  display: inline-block;
}
.admin-user-cell .admin-avatar,
.admin-user-cell .admin-avatar--initials {
  margin-right: 10px;
}
.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0d5b8;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
}
.admin-actions-cell {
  text-align: right;
  white-space: nowrap;
}

/* Book cell */
.admin-book-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-book-thumb {
  width: 32px;
  height: 42px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.admin-book-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges */
.admin-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.admin-badge--super {
  background: #d7b44a;
  color: #1a1a1a;
}
.admin-badge--admin {
  background: #e8e0cc;
  color: #5a4e32;
}
.admin-badge--none {
  background: #f5f5f5;
  color: #999;
}
.admin-badge--disabled {
  background: #f0f0f0;
  color: #aaa;
}
.admin-badge--banner {
  background: #e8f4fd;
  color: #2980b9;
}

/* Toggle switch */
.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.admin-toggle-input {
  display: none;
}
.admin-toggle-slider {
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.admin-toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform .2s;
}
.admin-toggle-input:checked + .admin-toggle-slider {
  background: #27ae60;
}
.admin-toggle-input:checked + .admin-toggle-slider::after {
  transform: translateX(16px);
}
.admin-toggle-label {
  font-size: 13px;
  color: #555;
  min-width: 48px;
}

/* Links */
.admin-link {
  background: none;
  border: none;
  color: #2980b9;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.admin-link:hover {
  color: #1a5276;
}
.admin-link--block {
  display: block;
  text-decoration: none;
  text-align: left;
}
.admin-role-summary {
  display: block;
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}
.admin-link--block:hover .admin-role-summary {
  color: #2980b9;
}
.admin-btn-inline {
  background: none;
  border: none;
  color: #2980b9;
  font: 12px 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  text-decoration: underline;
}
.admin-btn-inline:hover {
  color: #1a5276;
}

.text-muted {
  color: #999;
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
}
.admin-modal--wide {
  max-width: 640px;
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
}
.admin-modal-header h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.admin-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.admin-modal-close:hover {
  color: #333;
}
.admin-modal-body {
  padding: 20px;
}
.admin-modal-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 14px;
}
.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #eee;
}

/* Form elements */
.admin-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #666;
  margin-bottom: 6px;
}
.admin-input,
.admin-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: #333;
  background: #fff;
  transition: border-color .15s;
}
.admin-input:focus,
.admin-select:focus {
  outline: none;
  border-color: #d7b44a;
  box-shadow: 0 0 0 3px rgba(215,180,74,.15);
}
.admin-select--inline {
  width: auto;
  min-width: 160px;
  padding: 5px 8px;
  font-size: 12px;
}

/* Access management */
.admin-access-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-access-add .admin-select {
  width: auto;
  flex: 1;
}
.admin-access-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Tab badge */
.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
}
/* --- Diff Report --- */
.admin-diff-controls {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-diff-row { display: flex; flex-direction: column; gap: 4px; }
.admin-diff-row .admin-select { min-width: 220px; }
.admin-diff-file {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 16px;
}
.admin-diff-file-header {
  background: #f5f5f5;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}
.admin-diff-file-header--sticky {
  position: sticky;
  top: 86px;
  z-index: 5;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.admin-diff-file-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 8px;
}
.admin-diff-file-header-row:first-child { padding-bottom: 4px; }
.admin-diff-file-header-row:last-child { padding-top: 0; border-top: 1px solid #eee; }
.admin-diff-file-header-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-diff-mode-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.admin-diff-mode-label { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-diff-file-header-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
}
.admin-diff-file-header-cols--split { grid-template-columns: 1fr 1fr 1fr; }
.admin-diff-file-header-row--cols {
  display: grid !important;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
.admin-diff-col-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  text-align: center;
}
.admin-diff-col-label--from { background: #fce4e4; color: #a33; }
.admin-diff-col-label--to { background: #d4edda; color: #155724; }
.admin-diff-col-label--diff { background: #fff3cd; color: #856404; }
.admin-diff-col-label--clean { background: #e8f0fe; color: #1a56db; }
.admin-diff-file-header:hover { background: #ececec; }
.admin-diff-file-body {
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}
.admin-diff-file-body--collapsed { display: none; }
.admin-diff-chunk { padding: 4px 14px; white-space: pre-wrap; }
.admin-diff-chunk--equal { color: #666; }
.admin-diff-chunk--added { background: #d4edda; color: #155724; }
.admin-diff-chunk--removed { background: #f8d7da; color: #721c24; text-decoration: line-through; }
/* No strikethrough in split view — side-by-side comparison makes it redundant */
.admin-diff-file-body--split2 .admin-diff-chunk--removed, .admin-diff-file-body--split3 .admin-diff-chunk--removed { text-decoration: none; }
.admin-diff-file-body--split2 .admin-diff-word--removed, .admin-diff-file-body--split3 .admin-diff-word--removed { text-decoration: none; }
.admin-diff-chunk--changed { background: #fff8e1; padding: 4px 14px; }
.admin-diff-word--added { background: #a6f1b0; border-radius: 2px; padding: 0 1px; }
.admin-diff-word--removed { background: #f5a5a5; border-radius: 2px; padding: 0 1px; text-decoration: line-through; }
/* Diff + clean copy: fixed two-column grid on file body */
.admin-diff-file-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-left: 1px solid #e0e0e0;
}
/* Grid variants based on view mode */
.admin-diff-file-body--clean { grid-template-columns: 1fr 1fr; }
.admin-diff-file-body--split2 { grid-template-columns: 1fr 1fr; }
.admin-diff-file-body--split3 { grid-template-columns: 1fr 1fr 1fr; }
/* Elements that span all columns in the grid */
.admin-diff-file-body > .admin-diff-chunk--equal,
.admin-diff-file-body > .admin-diff-chunk--removed,
.admin-diff-file-body > .admin-diff-breadcrumb,
.admin-diff-file-body > .admin-diff-context-toggle { grid-column: 1 / -1; }
/* Change rows: diff in col 1, clean in col 2 */
.admin-diff-change-row { display: contents; }
.admin-diff-change-row-diff { min-width: 0; }
/* Split view from/to columns */
.admin-diff-change-row-from { min-width: 0; border-right: 1px solid #eee; }
.admin-diff-change-row-to { min-width: 0; }
.admin-diff-change-row-clean {
  padding: 6px 20px;
  background: #fff;
  border-left: 1px solid #ddd;
  font-family: 'Lora', Georgia, serif;
  font-size: 13px;
  line-height: 1.5;
  color: #222;
  word-wrap: break-word;
  overflow-wrap: break-word;
  user-select: text;
}
.admin-diff-change-row-clean sup { font-size: 0.7em; color: #888; vertical-align: super; }
.admin-diff-clean-text p { margin: 0 0 0.8em 0; }
.admin-diff-clean-text p:last-child { margin-bottom: 0; }
.admin-diff-copy-btn {
  float: right;
  padding: 2px 10px;
  font-size: 11px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  color: #666;
  margin-left: 8px;
}
.admin-diff-copy-btn:hover { background: #e8e8e8; color: #333; }
.admin-diff-copy-btn--done { background: #d4edda; border-color: #a6d9b0; color: #155724; }
/* Visual separation between change blocks */
.admin-diff-change-row-diff,
.admin-diff-change-row-clean { padding-bottom: 10px; margin-bottom: 2px; }
/* Removed-only changes span full width (no clean column) */
.admin-diff-change-row--removed-only { grid-column: 1 / -1; }
.admin-diff-change-row--removed-only .admin-diff-chunk--removed { grid-column: 1 / -1; }
.admin-diff-context-toggle {
  display: block;
  padding: 6px 14px;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  background: #fafafa;
  border-top: 1px dashed #e0e0e0;
  border-bottom: 1px dashed #e0e0e0;
}
.admin-diff-context-toggle:hover { background: #f0f0f0; color: #555; }
.admin-badge--modified { background: #d1ecf1; color: #0c5460; }
.admin-badge--added { background: #d4edda; color: #155724; }
.admin-badge--removed { background: #f8d7da; color: #721c24; }

/* Bible Validation */
.admin-badge--ok { background: #d4edda; color: #155724; }
.admin-badge--warn { background: #fff3cd; color: #856404; } /* amber: "Diffs Detected" */
.admin-badge--err { background: #f8d7da; color: #721c24; }
.admin-card {
  border: 1px solid #e5e0d5;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fcfbf7;
}
.admin-error { color: #721c24; }
.bv-change ins { background: #d4edda; text-decoration: none; }
.bv-change del { background: #f8d7da; }
.bv-change-status { margin-left: 8px; }

/* Bible Validation — sub-tabs */
.bv-subtabs { display: flex; gap: 4px; border-bottom: 2px solid #eae4d6; margin-bottom: 18px; }
.bv-subtab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; color: #8a7f66; cursor: pointer;
}
.bv-subtab:hover { color: #5a4e32; }
.bv-subtab--active { color: #5a4e32; border-bottom-color: #d7b44a; }
.bv-sub--hidden { display: none; }
.bv-lede { max-width: 70ch; margin-bottom: 16px; line-height: 1.5; }
.bv-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bv-toolbar .admin-label { margin: 0; }

/* Live checklist */
.bv-checklist-card { margin-top: 8px; }
.bv-step { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; font-size: 14px; border-radius: 6px; transition: background .2s, opacity .2s; }
.bv-step--pending { opacity: .45; }
.bv-step--run { background: #fff6de; box-shadow: inset 0 0 0 1px #f0e2b8; }
.bv-step--done { opacity: 1; }
.bv-ck { display: inline-block; width: 1.1em; text-align: center; font-weight: 700; }
.bv-ck--pending { color: #c7bfa8; }
.bv-ck--run { color: #d7b44a; animation: bv-spin 1s linear infinite; }
.bv-ck--done { color: #1e7e34; }
@keyframes bv-spin { to { transform: rotate(360deg); } }
.bv-books { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eae4d6; }
.bv-book { font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.bv-book--ok { background: #eef6ee; color: #2c6b34; }
.bv-book--diff { background: #fff3cd; color: #856404; font-weight: 600; }
.bv-book-diff { background: #856404; color: #fff; border-radius: 8px; padding: 0 5px; font-size: 11px; }

/* Result summary tiles */
.bv-result-head { margin-bottom: 12px; }
.bv-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 6px; }
.bv-tile { flex: 1 1 110px; min-width: 100px; border-radius: 8px; padding: 10px 12px; text-align: center; border: 1px solid #e5e0d5; background: #fff; }
.bv-tile-num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.bv-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: #8a7f66; margin-top: 2px; }
.bv-tile--ok .bv-tile-num { color: #1e7e34; }
.bv-tile--warn { background: #fffdf5; border-color: #f0e2b8; }
.bv-tile--warn .bv-tile-num { color: #9a7d16; }
.bv-tile--err { background: #fdf5f5; border-color: #f0c8c8; }
.bv-tile--err .bv-tile-num { color: #b02a37; }

/* Change cards */
.bv-change { margin: 10px 0; padding: 12px; }
.bv-change-loc { margin-bottom: 6px; }
.bv-diff-line { margin: 3px 0; line-height: 1.5; }
.bv-diff-tag { display: inline-block; width: 34px; font-size: 11px; text-transform: uppercase; color: #8a7f66; }
.bv-change--done { opacity: .6; }
.bv-change-actions { margin-top: 8px; }

/* Diff highlighting + side labels (Current vs BSB Site) */
.bv-diff-line { margin: 4px 0; line-height: 1.55; }
.bv-side { display: inline-block; min-width: 68px; margin-right: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px; color: #8a7f66; vertical-align: baseline; }
.bv-side--new { color: #1e7e34; }
.bv-change mark, .bv-struct-book mark { background: #ffe89a; color: inherit; padding: 0 2px; border-radius: 2px; font-weight: 600; }
.bv-struct-book { margin: 10px 0; padding: 8px 10px; border: 1px solid #eee6d3; border-radius: 6px; background: #fff; }
.bv-struct-title { font-weight: 700; margin-bottom: 2px; }
.bv-struct-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: #8a7f66; margin-top: 8px; }
.bv-struct-item { margin: 6px 0; padding-left: 8px; border-left: 2px solid #eee6d3; }
.bv-loc { display: inline-block; font-size: 11px; font-weight: 700; color: #5a4e32; background: #f1ead9; border-radius: 4px; padding: 1px 6px; margin-bottom: 2px; }
.admin-btn:disabled { opacity: .55; cursor: default; }

/* "See context" link + chapter popup */
.bv-context, .bv-qalink { font-size: 12px; color: #2980b9; cursor: pointer; text-decoration: none; }
.bv-context:hover, .bv-qalink:hover { text-decoration: underline; }
.bv-ctx-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; align-items: center; justify-content: center; }
.bv-ctx-modal { background: #fff; border-radius: 10px; width: min(680px, 92vw); max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.bv-ctx-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eee6d3; }
.bv-ctx-title { margin: 0; font-size: 18px; }
.bv-ctx-close { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: #8a7f66; }
.bv-ctx-body { padding: 16px 18px; overflow-y: auto; }
.bv-ctx-heading { font-weight: 700; margin: 12px 0 4px; color: #5a4e32; }
.bv-ctx-verse { margin: 4px 0; line-height: 1.6; }
.bv-ctx-verse sup { color: #b0a583; font-size: 11px; margin-right: 2px; }
.bv-ctx-verse--hl { background: #fff2a8; border-radius: 4px; padding: 4px 6px; }
.bv-ctx-note { margin: 4px 0 10px 18px; padding: 6px 10px; border-left: 3px solid #d7b44a; background: #fbf6e6; border-radius: 0 4px 4px 0; font-size: 13px; line-height: 1.5; color: #5a4e32; }
.bv-ctx-note-kind { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: #9a7d1a; margin-right: 6px; }
.admin-diff-loading {
  text-align: center;
  padding: 40px;
  color: #888;
}
.admin-diff-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
}
.admin-diff-mode-toggles { display: flex; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.admin-diff-mode-toggle { display: flex; gap: 0; }
.admin-diff-mode-btn {
  padding: 4px 14px;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #666;
  cursor: pointer;
}
.admin-diff-mode-btn:first-child { border-radius: 4px 0 0 4px; }
.admin-diff-mode-btn:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.admin-diff-mode-btn--active { background: #333; color: #fff; border-color: #333; }
.admin-diff-empty {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* Diff report two-column layout — break out of admin-main max-width */
.admin-diff-layout {
  display: flex;
  gap: 0;
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
}
.admin-diff-sidebar {
  width: 220px;
  min-width: 220px;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 86px);
  overflow-y: auto;
  border-right: 1px solid #e0e0e0;
  background: #fafafa;
  padding: 12px 0;
  font-size: 12px;
  scrollbar-width: thin;
}
.admin-diff-sidebar::-webkit-scrollbar { width: 4px; }
.admin-diff-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.admin-diff-sidebar-title {
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px 10px;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 8px;
}
.admin-diff-sidebar-file { margin-bottom: 4px; }
.admin-diff-sidebar-file-name {
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px 4px;
  color: #444;
  cursor: pointer;
}
.admin-diff-sidebar-file-name:hover { color: #000; }
.admin-diff-sidebar-link {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 12px;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.4;
}
.admin-diff-sidebar-link:hover { background: #f0f0f0; color: #222; }
.admin-diff-sidebar-link--active {
  border-left-color: #d7b44a;
  background: #fdf8ec;
  color: #333;
  font-weight: 600;
}
.admin-diff-sidebar-heading {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.admin-diff-sidebar-count {
  font-size: 10px;
  color: #999;
  font-weight: 400;
  flex-shrink: 0;
}
/* Collapsible depth 3-4 sections */
.admin-diff-sidebar-expand { display: none; }
.admin-diff-sidebar-expand--open { display: block; }
.admin-diff-sidebar-arrow {
  font-size: 8px;
  color: #999;
  flex-shrink: 0;
  transition: transform 0.15s;
  margin-right: 2px;
}
.admin-diff-sidebar-arrow--open { transform: rotate(90deg); }
.admin-diff-content {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 20px;
}

/* Breadcrumb bar on changed chunks */
.admin-diff-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 6px 14px;
  margin-top: 4px;
  background: #f0f0f0;
  border-left: 3px solid #d7b44a;
  font-size: 12px;
  color: #666;
  font-weight: 500;
  scroll-margin-top: 100px;
}
.admin-diff-breadcrumb-sep { color: #bbb; margin: 0 4px; }
.admin-diff-breadcrumb-part { color: #555; }
.admin-diff-breadcrumb-part:last-child { color: #333; font-weight: 600; }
.admin-diff-breadcrumb-line { color: #999; font-weight: 400; font-size: 11px; white-space: nowrap; }
.admin-diff-breadcrumb-from {
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  color: #a33;
  font-weight: 400;
}
.admin-diff-breadcrumb-from-label { font-weight: 600; }
.admin-diff-file-header { scroll-margin-top: 100px; }

/* Review meta */
.review-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #555;
}
.review-meta-item strong {
  color: #333;
}

/* Diff view */
.diff-view {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Lora', Georgia, serif;
  font-size: 14px;
  line-height: 1.7;
  max-height: 55vh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fafafa;
}
.diff-ins {
  background: #d4edda;
  text-decoration: none;
}
.diff-del {
  background: #f8d7da;
  text-decoration: line-through;
}

/* ============================================================
   Notification Preferences Page
   ============================================================ */

.notif-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 24px 60px;
  width: 100%;
}
.notif-prefs-container {
  margin-top: 20px;
}
.notif-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.notif-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px;
}
.notif-section-desc {
  font-size: 12px;
  color: #888;
  margin: 0 0 16px;
}
.notif-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}
.notif-book-row {
  border-top: 1px solid #f0f0f0;
}
.notif-book-row:first-child {
  border-top: none;
}
.notif-toggle-info {
  flex: 1;
  min-width: 0;
}
.notif-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
.notif-toggle-desc {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.notif-test-note {
  color: #e67e22;
  font-style: italic;
}
.notif-empty {
  font-size: 13px;
  color: #999;
  font-style: italic;
}
/* CSS toggle switch */
.notif-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.notif-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 22px;
  transition: background .2s;
}
.notif-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.notif-switch input:checked + .notif-slider {
  background: #27ae60;
}
.notif-switch input:checked + .notif-slider::before {
  transform: translateX(18px);
}

/* ============================================================
   Editor — Edit Toolbar + CodeMirror Container
   ============================================================ */

.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
/* Content gate: "Recent changes to this page aren't public yet." — a soft gold banner under the edit toolbar
   (the site's gold tokens; the fallbacks are their light values for pages without html.nc2). */
.nc-gate-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--nc2-ink, #111111);
  background: var(--nc2-gold-wash, #F8ECD3);
  border: 1px solid var(--nc2-gold, #DA9F28);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 4px 0 20px;
  max-width: 72ch;
  overflow-wrap: anywhere;
}
.nc-gate-note p { margin: 0; }
.nc-gate-note strong { font-weight: 600; }
.nc-gate-note p + p { margin-top: 4px; }
/* Held: the check's own message behind a native Details toggle (keyboard + screen reader, no script needed). */
.nc-gate-note__details { margin-top: 6px; }
.nc-gate-note__details > summary { cursor: pointer; display: inline-block; list-style: none; font-weight: 600; color: var(--nc2-gold-deep, #835F16); border-radius: 4px; }
.nc-gate-note__details > summary::-webkit-details-marker { display: none; }
.nc-gate-note__details > summary::before { content: '▸'; display: inline-block; width: 1.1em; }
.nc-gate-note__details[open] > summary::before { content: '▾'; }
.nc-gate-note__details > summary:focus-visible { outline: 2px solid var(--nc2-gold, #DA9F28); outline-offset: 2px; }
.nc-gate-note__details > p { margin: 6px 0 0; }
.nc-gate-note time { white-space: nowrap; }
html.nc-dark .nc-gate-note { color: var(--nc2-ink, #E8E3D9); background: var(--nc2-gold-wash, #3D3322); }
@media (max-width: 480px) { .nc-gate-note { padding: 10px 12px; font-size: 13.5px; } }
.edit-unavailable-msg {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #b71c1c;
  padding: 8px 14px;
  background: #fce4ec;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
}
/* History toggle */
.editor-history-toggle {
  display: flex;
  gap: 0;
  margin: 0 8px;
}
.editor-history-btn {
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 0 !important;
  border: 1px solid #ddd !important;
  background: #f5f5f5 !important;
  color: #888 !important;
}
.editor-history-btn:first-child { border-radius: 4px 0 0 4px !important; }
.editor-history-btn:last-child { border-radius: 0 4px 4px 0 !important; border-left: none !important; }
.editor-history-btn.active {
  background: #fff !important;
  color: #333 !important;
  border-color: #aaa !important;
  font-weight: 600 !important;
}
/* History cards */
.margin-card--history {
  position: static !important;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  margin-left: 8px;
  margin-right: 8px;
  font-family: 'DM Sans', sans-serif;
  left: auto !important;
  right: auto !important;
}
.margin-card-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.margin-card-status-badge--accepted { background: #e8f5e9; color: #2e7d32; }
.margin-card-status-badge--rejected { background: #fce4ec; color: #c62828; }
.margin-card-status-badge--stale { background: #fff3e0; color: #e65100; }
.margin-card-status-badge--resolved { background: #f5f5f5; color: #616161; }
.margin-card-location {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.margin-card-reject-reason {
  font-size: 12px;
  color: #c62828;
  font-style: italic;
  margin-top: 4px;
}
.edit-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.edit-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}
.edit-btn--primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.edit-btn--primary:hover {
  background: #333;
}
.edit-btn--review {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}
.edit-btn--review:hover {
  background: #ffecb5;
}
.edit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.edit-banner {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}
.edit-banner--pending {
  background: #fef3cd;
  border: 1px solid #ffc107;
  color: #856404;
}
.edit-banner-link {
  color: #856404;
  font-weight: 600;
  margin-left: 8px;
}

.editor-container {
  width: 100%;
}
.editor-nav {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 0 12px;
  color: #888;
}
.editor-nav-link {
  color: #666;
  text-decoration: none;
}
.editor-nav-link:hover {
  color: #d7b44a;
}
.editor-nav-sep {
  margin: 0 6px;
  color: #ccc;
}
.editor-nav-current {
  color: #333;
}
/* Editor modal (commit message, confirmations) */
.editor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  width: 420px;
  max-width: 90vw;
  font-family: 'DM Sans', sans-serif;
}
.editor-modal-header {
  padding: 16px 20px 0;
}
.editor-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.editor-modal-body {
  padding: 12px 20px;
}
.editor-modal-label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.editor-modal-textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}
.editor-modal-textarea:focus {
  outline: none;
  border-color: #d7b44a;
}
.editor-modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* Direct edit mode accent */
.editor-container.direct-editing .editor-toolbar {
  border-top: 3px solid #d7b44a;
}
.editor-container.direct-editing .editor-mode-label {
  color: #b8941f;
}
/* Edit mode: Google Docs-like layout */
.main.main--editing {
  padding: 0.5rem 1rem;
  max-width: none;
  background: #f0f0f0;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px 6px 0 0;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: sticky;
  top: var(--header-height);
  z-index: 99;
}
.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.edit-btn--source {
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 12px;
  padding: 4px 10px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.edit-btn--source:hover {
  background: #e8e8e8;
  border-color: #aaa;
}
.edit-btn--source.active {
  background: #333;
  color: #fff;
  border-color: #333;
}
/* Line numbers toggle */
.cm-hide-gutters .cm-gutters {
  display: none !important;
}
.editor-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  user-select: none;
}
.editor-toggle input[type="checkbox"] {
  accent-color: #d7b44a;
  margin: 0;
}
.editor-mode-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.editor-save-status {
  font-size: 12px;
  color: #27ae60;
  font-family: 'DM Sans', sans-serif;
  margin-left: 8px;
}
.editor-save-status.save-error {
  color: #c62828;
  font-weight: 500;
}
/* Stale file banner */
.direct-edit-lock-banner {
  padding: 8px 16px;
  background: #fce4ec;
  border-bottom: 1px solid #ef9a9a;
  color: #c62828;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}
.editor-stale-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff3e0;
  border-bottom: 1px solid #ffb74d;
  color: #e65100;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.stale-banner-icon {
  font-size: 16px;
}
.stale-banner-text {
  flex: 1;
}
.stale-banner-btn {
  background: #e65100;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.stale-banner-btn:hover {
  background: #bf360c;
}
.stale-banner-dismiss {
  background: none;
  border: none;
  color: #e65100;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
/* Shared-file direct-edit banner (shown when editing a common file via ?editFile) */
.editor-sharedfile-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(141, 68, 73, 0.08);
  border-bottom: 1px solid rgba(141, 68, 73, 0.35);
  color: #6b3438;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.editor-sharedfile-banner .shared-banner-text {
  flex: 1;
}
.editor-sharedfile-banner .shared-banner-back {
  color: #8D4449;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.editor-sharedfile-banner .shared-banner-back:hover {
  text-decoration: underline;
}
/* Presence indicator */
.editor-presence {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 8px;
}
.presence-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: default;
  position: relative;
}
.presence-avatar--photo {
  object-fit: cover;
}
.presence-avatar[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  background: #333;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
}
.editor-comment-input {
  width: 260px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.editor-comment-input:focus {
  outline: none;
  border-color: #d7b44a;
}

#codemirror-host {
  border: 1px solid #e5e5e5;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  min-height: 400px;
}
#codemirror-host .cm-editor {
  min-height: 400px;
}

/* Hide CM6's built-in search panel (we use our own in the toolbar) */
#codemirror-host .cm-panels { display: none; }

/* Keep selection highlight visible when editor loses focus (search input focused) */
#codemirror-host .cm-editor:not(.cm-focused) .cm-selectionBackground {
  background: rgba(212, 170, 0, 0.35) !important;
}

/* Toolbar search input */
.editor-search-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.editor-search-input {
  width: 130px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
}
.editor-search-input:focus { border-color: #999; }
.editor-search-input::placeholder { color: #aaa; }
.editor-search-count {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  min-width: 45px;
}

/* Toolbar tool buttons (search nav, prev/next card) */
.edit-btn--tool {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  border-radius: 3px;
  cursor: pointer;
  color: #555;
  white-space: nowrap;
}
.edit-btn--tool:hover { background: #e8e8e8; color: #333; }

/* Toolbar separator */
.editor-toolbar-sep {
  width: 1px;
  height: 20px;
  background: #ddd;
  margin: 0 4px;
}

/* Editor body: editor + margin panel side by side */
.editor-body {
  display: flex;
  position: relative;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  min-height: 400px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.editor-body #codemirror-host {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
}

/* Suggestion margin panel */
.suggestion-margin {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid #e5e5e5;
  background: #fafbf9;
  overflow-y: auto;
  position: relative;
  padding: 12px 0;
}
.margin-empty {
  padding: 16px;
  color: #999;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}

/* Margin cards */
.margin-card {
  position: absolute;
  left: 8px;
  right: 8px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-color .15s;
}
.margin-card:hover {
  border-color: #d7b44a;
}
/* Card status indicators (accept in progress) */
.margin-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 4px 0;
}
.margin-card-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.margin-card-saving {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #999;
}
.margin-card-status--loading { color: #666; }
.margin-card-status--success { color: #27ae60; font-weight: 600; }
.margin-card-status--stale { color: #b8941f; }
.margin-card-status--error { color: #c0392b; }
.margin-card--success {
  border-color: #27ae60;
  background: #f0faf4;
}
.margin-card--stale {
  border-color: #d7b44a;
  background: #fdf8e8;
}
/* Refresh overlay (covers editor during GitHub fetch) */
.editor-refresh-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #666;
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.page-reload-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #555;
  background: rgba(255,255,255,0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* Stale card details */
.margin-card-stale-label {
  display: block;
  font-size: 10px;
  color: #999;
  margin: 6px 0 3px;
}
.margin-card-stale-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}
.margin-action:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.margin-card--focused {
  animation: card-pulse 0.6s ease;
  border-color: #d7b44a;
}
.margin-card--removing {
  animation: card-remove 0.4s ease forwards;
  pointer-events: none;
}
@keyframes card-remove {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(20px); }
}
@keyframes card-pulse {
  0% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  30% { transform: scale(1.03); box-shadow: 0 2px 12px rgba(215,180,74,0.35); }
  100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
}
/* Pulse animation for inline decorations when clicking a margin card */
.cm-inline-pulse {
  animation: inline-pulse 0.6s ease;
}
@keyframes inline-pulse {
  0% { background: rgba(215,180,74,0.5); }
  100% { background: inherit; }
}
.margin-card-body {
  line-height: 1.5;
  word-break: break-word;
}
.margin-card-del {
  background: rgba(234, 67, 53, 0.12);
  color: #c62828;
  text-decoration: line-through;
  border-radius: 2px;
  padding: 0 2px;
}
.margin-card-ins {
  background: rgba(52, 168, 83, 0.15);
  color: #1e7e34;
  border-radius: 2px;
  padding: 0 2px;
}
.margin-card-arrow {
  color: #999;
  font-size: 11px;
}

/* Card header: avatar + name + actions */
.margin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.margin-card-user {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.margin-card-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.margin-card-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
}
.margin-card-name {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.margin-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.margin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  padding: 0;
}
.margin-action:hover {
  background: #f5f5f5;
}
.margin-action--accept {
  color: #27ae60;
}
.margin-action--accept:hover {
  background: #e8f5e9;
  border-color: #27ae60;
}
.margin-action--locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.margin-action--locked:hover {
  background: transparent;
  border-color: transparent;
}
.margin-action--reject {
  color: #c0392b;
}
.margin-action--reject:hover {
  background: #fdf0ef;
  border-color: #c0392b;
}
.margin-card-time {
  font-size: 10px;
  color: #aaa;
  margin-top: 4px;
}
/* Reply thread within margin cards */
.margin-card-thread {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}
.margin-card-reply {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: flex-start;
}
.margin-card-avatar--small {
  width: 16px;
  height: 16px;
  font-size: 8px;
  flex-shrink: 0;
  margin-top: 1px;
}
.margin-card-reply-content {
  min-width: 0;
  line-height: 1.4;
}
.margin-card-reply-author {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  margin-right: 4px;
}
.margin-card-reply-text {
  font-size: 11px;
  color: #333;
  word-break: break-word;
  margin-top: 1px;
}
.margin-card-reply-time {
  font-size: 9px;
  color: #bbb;
}
.margin-card-reply-input {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.margin-reply-field {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  min-width: 0;
}
.margin-reply-field:focus {
  border-color: #d7b44a;
}
.margin-reply-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  color: #d7b44a;
  padding: 0;
  flex-shrink: 0;
}
.margin-reply-send:hover {
  background: #fdf8e8;
  border-color: #d7b44a;
}
.margin-reply-send:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Comment cards */
.margin-card--comment {
  border-left: 3px solid #fbbc04;
}
.margin-card--anchor-lost {
  opacity: 0.85;
  border-left-color: #e8a040;
  border-left-style: dashed;
}
.margin-card-anchor-lost {
  font-size: 10px;
  color: #b47a20;
  background: #fef3dc;
  padding: 3px 8px;
  margin: -2px -10px 6px;
  border-radius: 2px;
  line-height: 1.4;
}
.margin-card-quote {
  display: block;
  font-size: 11px;
  font-style: italic;
  color: #888;
  margin-bottom: 4px;
  line-height: 1.4;
}
.margin-card-comment-text {
  margin: 0;
  font-size: 12px;
  color: #333;
  line-height: 1.4;
}
/* Edit button + inline editing */
.margin-action--edit {
  color: #999;
}
.margin-action--edit:hover {
  color: #555;
}
.margin-reply-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 0;
  margin-left: 8px;
  float: right;
}
.margin-reply-edit-btn:hover {
  color: #555;
}
.margin-card-edit-container {
  margin-top: 4px;
}
/* Bring the card being edited above overlapping neighbors */
.margin-card:has(.margin-card-edit-container) {
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.margin-card-edit-textarea {
  width: 100%;
  border: 1px solid #d7b44a;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.margin-card-edit-textarea--reply {
  font-size: 11px;
  min-height: 36px;
}
.margin-card-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-end;
}
.margin-card-edit-save, .margin-card-edit-cancel {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 3px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
  color: #555;
}
.margin-card-edit-save {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
.margin-card-edit-save:hover {
  background: #219a52;
}
.margin-card-edit-cancel:hover {
  background: #f5f5f5;
}
.margin-card-edit-save:disabled {
  opacity: 0.5;
  cursor: default;
}
.margin-card-edited {
  font-size: 9px;
  color: #aaa;
  font-style: italic;
}

.margin-action--resolve {
  color: #27ae60;
}
.margin-action--resolve:hover {
  background: #e8f5e9;
  border-color: #27ae60;
}

/* @-mention styling */
.mention {
  color: #27ae60;
  font-weight: 600;
  background: #e8f5e9;
  border-radius: 2px;
  padding: 0 2px;
}

/* Tribute.js autocomplete dropdown */
.tribute-container {
  position: absolute;
  z-index: 10000;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 180px;
  overflow-y: auto;
  min-width: 200px;
}
.tribute-container ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.tribute-container li {
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tribute-container li:hover,
.tribute-container li.highlight {
  background: #f5f5f5;
}
.tribute-container li.tribute-item--active {
  background: #e8f5e9;
}
.tribute-container li small {
  color: #888;
  font-size: 10px;
}
.tribute-container li.no-match {
  color: #999;
  cursor: default;
}

/* Comment highlight in editor */
.cm-comment-highlight {
  background: rgba(251, 188, 4, 0.25);
  border-bottom: 2px solid #fbbc04;
}

/* Floating "Add Comment" tooltip — appears on text selection */
.comment-tooltip {
  position: fixed;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0;
  background: #1a1a1a;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  white-space: nowrap;
  overflow: hidden;
}
.comment-tooltip-btn {
  background: none;
  border: none;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.comment-tooltip-btn:hover {
  background: #333;
}
.comment-tooltip-comment {
  padding: 5px 12px;
  border-right: 1px solid #444;
}
.comment-tooltip-bold {
  font-size: 14px;
  padding: 5px 8px;
  border-right: 1px solid #444;
}
.comment-tooltip-italic {
  font-size: 14px;
  padding: 5px 8px;
}

/* Comment popup — floating near the selection */
.comment-popup {
  position: absolute;
  z-index: 1100;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 12px;
  width: 250px;
}
.comment-popup-input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}
.comment-popup-input:focus {
  outline: none;
  border-color: #d7b44a;
}
.comment-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

/* Toast notifications */
.editor-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  cursor: pointer;
}
.editor-toast--info {
  background: #1a1a1a;
  color: #fff;
}
.editor-toast--success {
  background: #27ae60;
  color: #fff;
}
.editor-toast--error {
  background: #c0392b;
  color: #fff;
}

/* Inline suggestion decorations (in CodeMirror) */
.cm-suggestion-insert {
  background: rgba(52, 168, 83, 0.18);
  color: #1e7e34;
  text-decoration: underline;
  text-decoration-color: rgba(52, 168, 83, 0.4);
}
.cm-suggestion-delete {
  background: rgba(234, 67, 53, 0.12);
  color: #c62828;
  text-decoration: line-through;
  cursor: default;
  user-select: none;
}

/* ── Editor — dark (2026-11-27, Steve: "evaluate dark mode direct edit … needs fixed in general").
   The editor above (and the CodeMirror themes in editor-masking.js / editor-suggestions.js / editor.js) is drawn in
   light colours only; in dark mode the reader's pale ink landed on its white surfaces. This redraws every editor class
   that has a colour under html.nc-dark, from the site's dark tokens (--nc2-*, style-v2.css §1b) through the --ned-*
   tokens below — the only raw colours are the editor's own hues (insert green, delete red, shared-content rose).
   html.nc-dark .x (0,2,1) beats CodeMirror's generated `.ͼN .x` (0,2,0). Light mode is untouched.
   Gate: tests/unit/editor-dark.test.js (every coloured class covered), tests/editor-dark.spec.js (4.5:1 in each mode). */
html.nc-dark {
  --ned-page: var(--nc2-page, #151413);
  --ned-card: var(--nc2-card, #1F1E1C);
  --ned-ink: var(--nc2-ink, #E8E3D9);
  --ned-text-2: var(--nc2-text-2, #B9B3A8);
  --ned-muted: var(--nc2-icon, #9C9891);
  --ned-line: var(--nc2-bar-line, #3A3936);
  --ned-hair: var(--nc2-hairline, #2E2D2A);
  --ned-field: var(--nc2-field, #26231F);
  --ned-hover: var(--nc2-track, #2E2A23);
  --ned-wash: var(--nc2-wash, #24211C);
  --ned-gold: var(--nc2-gold, #DA9F28);
  --ned-gold-ink: var(--nc2-gold-deep, #E1B151);
  --ned-gold-wash: var(--nc2-gold-wash, #3D3322);
  --ned-scrim: rgba(21, 20, 19, 0.85);
  --ned-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  --ned-pop-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  /* insert green / delete red: kept green and red, lightened to read on the dark card */
  --ned-ins-ink: #8FD19E;
  --ned-ins-wash: rgba(52, 168, 83, 0.22);
  --ned-ins-line: rgba(143, 209, 158, 0.55);
  --ned-ok-wash: #1F3326;
  --ned-ok-line: #4CAF6A;
  --ned-del-ink: #F2B8B5;
  --ned-del-wash: rgba(234, 67, 53, 0.22);
  --ned-err-wash: #3A2222;
  --ned-err-line: #7A3B3B;
  --ned-warn-ink: #F0C86A;
  --ned-warn-wash: #3A2C1A;
  --ned-warn-line: #8A6A2A;
  --ned-comment-wash: rgba(251, 188, 4, 0.25);
  --ned-comment-line: #FBBC04;
  --ned-select: rgba(218, 159, 40, 0.35);
  --ned-active-line: rgba(182, 199, 226, 0.06);
  /* shared @include content: the light theme's rose, lifted for dark */
  --ned-shared-line: #C47A80;
  --ned-shared-wash: rgba(196, 122, 128, 0.10);
  --ned-shared-ink: #F0B7BB;
  /* the reading blocks inside the editor */
  --ned-quote-line: #7E9A6A;
  --ned-quote-wash: rgba(126, 154, 106, 0.12);
  --ned-callout-wash: rgba(126, 154, 106, 0.16);
  --ned-question-wash: rgba(218, 159, 40, 0.10);
  /* syntax colours (editor.js editorHighlightStyle; light = CodeMirror's defaults): the markdown markers (meta) muted,
     the rest lifted so each reads at 4.5:1 or better on the card */
  --ned-hl-meta: var(--nc2-text-2, #B9B3A8);
  --ned-hl-keyword: #D6A6E8;
  --ned-hl-url: #9DB8E8;
  --ned-hl-literal: #8FD19E;
  --ned-hl-string: #F2B8B5;
  --ned-hl-regexp: #F0A878;
  --ned-hl-def: #A8C2F0;
  --ned-hl-local: #C4A8F0;
  --ned-hl-type: #7FD1B9;
  --ned-hl-class: #7FC8D1;
  --ned-hl-macro: #9FC0D8;
  --ned-hl-prop: #A8C2F0;
  --ned-hl-comment: #D9A866;
  --ned-hl-invalid: #FF8A80;
}

/* page, toolbar, buttons */
html.nc-dark .main.main--editing { background: var(--ned-page); }
html.nc-dark .editor-toolbar { background: var(--ned-card); border-color: var(--ned-line); box-shadow: var(--ned-shadow); }
html.nc-dark .editor-container.direct-editing .editor-toolbar { border-top-color: var(--ned-gold); }
html.nc-dark .editor-mode-label { color: var(--ned-ink); }
html.nc-dark .editor-container.direct-editing .editor-mode-label { color: var(--ned-gold-ink); }
html.nc-dark .editor-toggle { color: var(--ned-text-2); }
html.nc-dark .editor-toggle input[type="checkbox"] { accent-color: var(--ned-gold); }
html.nc-dark .editor-save-status { color: var(--ned-ins-ink); }
html.nc-dark .editor-save-status.save-error { color: var(--ned-del-ink); }
html.nc-dark .editor-toolbar-sep { background: var(--ned-line); }
html.nc-dark .edit-btn,
html.nc-dark .edit-btn--tool,
html.nc-dark .edit-btn--source { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-ink); }
html.nc-dark .edit-btn:hover,
html.nc-dark .edit-btn--tool:hover,
html.nc-dark .edit-btn--source:hover { background: var(--ned-hover); border-color: var(--ned-muted); color: var(--ned-ink); }
html.nc-dark .edit-btn--primary,
html.nc-dark .edit-btn--source.active { background: var(--ned-ink); border-color: var(--ned-ink); color: var(--ned-page); }
html.nc-dark .edit-btn--primary:hover { background: var(--ned-text-2); border-color: var(--ned-text-2); color: var(--ned-page); }
html.nc-dark .edit-btn--review { background: var(--ned-gold-wash); border-color: var(--ned-gold); color: var(--ned-gold-ink); }
html.nc-dark .edit-btn--review:hover { background: var(--ned-hover); }
html.nc-dark .editor-history-btn { background: var(--ned-field) !important; border-color: var(--ned-line) !important; color: var(--ned-text-2) !important; }
html.nc-dark .editor-history-btn.active { background: var(--ned-card) !important; border-color: var(--ned-muted) !important; color: var(--ned-ink) !important; }
html.nc-dark .editor-search-input,
html.nc-dark .editor-comment-input { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-ink); }
html.nc-dark .editor-search-input:focus,
html.nc-dark .editor-comment-input:focus { border-color: var(--ned-gold); }
html.nc-dark .editor-search-input::placeholder { color: var(--ned-text-2); }
html.nc-dark .editor-search-count { color: var(--ned-text-2); }
html.nc-dark .editor-nav { color: var(--ned-text-2); }
html.nc-dark .editor-nav-link { color: var(--ned-text-2); }
html.nc-dark .editor-nav-link:hover { color: var(--ned-gold-ink); }
html.nc-dark .editor-nav-sep { color: var(--ned-muted); }
html.nc-dark .editor-nav-current { color: var(--ned-ink); }

/* banners */
html.nc-dark .edit-unavailable-msg,
html.nc-dark .direct-edit-lock-banner { background: var(--ned-err-wash); border-color: var(--ned-err-line); color: var(--ned-del-ink); }
html.nc-dark .edit-banner--pending { background: var(--ned-gold-wash); border-color: var(--ned-gold); color: var(--ned-gold-ink); }
html.nc-dark .edit-banner-link { color: var(--ned-gold-ink); }
html.nc-dark .editor-stale-banner { background: var(--ned-warn-wash); border-bottom-color: var(--ned-warn-line); color: var(--ned-warn-ink); }
html.nc-dark .stale-banner-btn { background: var(--ned-warn-ink); color: var(--ned-page); }
html.nc-dark .stale-banner-btn:hover { background: var(--ned-gold-ink); }
html.nc-dark .stale-banner-dismiss { color: var(--ned-warn-ink); }
html.nc-dark .editor-sharedfile-banner { background: var(--ned-shared-wash); border-bottom-color: var(--ned-shared-line); color: var(--ned-shared-ink); }
html.nc-dark .editor-sharedfile-banner .shared-banner-back { color: var(--ned-shared-ink); }

/* editor body + margin panel */
html.nc-dark .editor-body { background: var(--ned-card); border-color: var(--ned-line); box-shadow: var(--ned-shadow); color: var(--ned-ink); }
html.nc-dark #codemirror-host { border-color: var(--ned-line); }
html.nc-dark .suggestion-margin { background: var(--ned-page); border-left-color: var(--ned-line); }
html.nc-dark .margin-empty { color: var(--ned-text-2); }
html.nc-dark .editor-refresh-overlay,
html.nc-dark .page-reload-overlay { background: var(--ned-scrim); color: var(--ned-text-2); }

/* CodeMirror itself (the base theme's light cursor / active line / gutters, and the masking theme) */
html.nc-dark #codemirror-host .cm-editor { background: var(--ned-card); color: var(--ned-ink); }
html.nc-dark #codemirror-host .cm-content { caret-color: var(--ned-ink); color: var(--ned-ink); }
/* the site's focus ring (html.nc2 :focus-visible, a light navy in dark) drew a bright full-height line beside the text */
html.nc-dark #codemirror-host .cm-content:focus-visible { outline-color: var(--ned-line); }
html.nc-dark #codemirror-host .cm-cursor,
html.nc-dark #codemirror-host .cm-dropCursor { border-left-color: var(--ned-ink); }
html.nc-dark #codemirror-host .cm-activeLine { background: var(--ned-active-line); }
html.nc-dark #codemirror-host .cm-gutters { background: transparent; border-right-color: var(--ned-line); color: var(--ned-muted); }
html.nc-dark #codemirror-host .cm-activeLineGutter { background: var(--ned-active-line); color: var(--ned-ink); }
html.nc-dark #codemirror-host .cm-foldPlaceholder { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-selectionBackground,
html.nc-dark #codemirror-host .cm-editor:not(.cm-focused) .cm-selectionBackground { background: var(--ned-select) !important; }
html.nc-dark #codemirror-host .cm-revealed-syntax { color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-heading-4 { color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-heading-5,
html.nc-dark #codemirror-host .cm-heading-6 { color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-heading-line-2 { border-bottom-color: var(--ned-line); }
html.nc-dark #codemirror-host .cm-line:has(.cm-question-block) { background: var(--ned-question-wash); border-left-color: var(--ned-gold); }
html.nc-dark #codemirror-host .cm-callout { background: var(--ned-callout-wash); }
html.nc-dark #codemirror-host .cm-attribution { color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-line:has(.cm-blockquote) { background: var(--ned-quote-wash); border-left-color: var(--ned-quote-line); }
html.nc-dark #codemirror-host .cm-line:has(.cm-section-block) { background: var(--ned-wash); border-color: var(--ned-line); }
html.nc-dark #codemirror-host .cm-superscript { color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-image-placeholder { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-text-2); }

/* suggestions + comments in the text */
html.nc-dark .cm-suggestion-insert { background: var(--ned-ins-wash); color: var(--ned-ins-ink); text-decoration-color: var(--ned-ins-line); }
html.nc-dark .cm-suggestion-delete { background: var(--ned-del-wash); color: var(--ned-del-ink); }
html.nc-dark .cm-comment-highlight { background: var(--ned-comment-wash); border-bottom-color: var(--ned-comment-line); }

/* shared @include content */
html.nc-dark #codemirror-host .cm-shared-line { background-color: var(--ned-shared-wash); border-left-color: var(--ned-shared-line); }
html.nc-dark #codemirror-host .cm-shared-range { background-color: var(--ned-shared-wash); }
html.nc-dark #codemirror-host .cm-shared-affordance { border-left-color: var(--ned-shared-line); color: var(--ned-text-2); }
html.nc-dark #codemirror-host .cm-shared-src strong { color: var(--ned-shared-ink); }
html.nc-dark #codemirror-host .cm-shared-editlink { color: var(--ned-shared-ink); }

/* margin cards */
html.nc-dark .margin-card { background: var(--ned-card); border-color: var(--ned-line); box-shadow: var(--ned-shadow); color: var(--ned-ink); }
html.nc-dark .margin-card:hover,
html.nc-dark .margin-card--focused { border-color: var(--ned-gold); }
html.nc-dark .margin-card:has(.margin-card-edit-container) { box-shadow: var(--ned-pop-shadow); }
html.nc-dark .margin-card--history { background: var(--ned-card); border-color: var(--ned-line); }
html.nc-dark .margin-card--success { background: var(--ned-ok-wash); border-color: var(--ned-ok-line); }
html.nc-dark .margin-card--stale { background: var(--ned-gold-wash); border-color: var(--ned-gold); }
html.nc-dark .margin-card--comment { border-left-color: var(--ned-comment-line); }
html.nc-dark .margin-card--anchor-lost { border-left-color: var(--ned-warn-ink); }
html.nc-dark .margin-card-anchor-lost { background: var(--ned-warn-wash); color: var(--ned-warn-ink); }
html.nc-dark .margin-card-status-badge--accepted { background: var(--ned-ok-wash); color: var(--ned-ins-ink); }
html.nc-dark .margin-card-status-badge--rejected { background: var(--ned-err-wash); color: var(--ned-del-ink); }
html.nc-dark .margin-card-status-badge--stale { background: var(--ned-warn-wash); color: var(--ned-warn-ink); }
html.nc-dark .margin-card-status-badge--resolved { background: var(--ned-field); color: var(--ned-text-2); }
html.nc-dark .margin-card-status--loading,
html.nc-dark .margin-card-saving { color: var(--ned-text-2); }
html.nc-dark .margin-card-status--success { color: var(--ned-ins-ink); }
html.nc-dark .margin-card-status--stale { color: var(--ned-gold-ink); }
html.nc-dark .margin-card-status--error,
html.nc-dark .margin-card-reject-reason { color: var(--ned-del-ink); }
html.nc-dark .margin-card-spinner { border-color: var(--ned-line); border-top-color: var(--ned-text-2); }
html.nc-dark .margin-card-del { background: var(--ned-del-wash); color: var(--ned-del-ink); }
html.nc-dark .margin-card-ins { background: var(--ned-ins-wash); color: var(--ned-ins-ink); }
html.nc-dark .margin-card-name,
html.nc-dark .margin-card-comment-text,
html.nc-dark .margin-card-reply-text { color: var(--ned-ink); }
html.nc-dark .margin-card-location,
html.nc-dark .margin-card-stale-label,
html.nc-dark .margin-card-arrow,
html.nc-dark .margin-card-time,
html.nc-dark .margin-card-reply-author,
html.nc-dark .margin-card-reply-time,
html.nc-dark .margin-card-quote,
html.nc-dark .margin-card-edited { color: var(--ned-text-2); }
html.nc-dark .margin-card-thread { border-top-color: var(--ned-line); }
html.nc-dark .margin-action { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-text-2); }
html.nc-dark .margin-action:hover { background: var(--ned-hover); }
html.nc-dark .margin-action--accept,
html.nc-dark .margin-action--resolve { color: var(--ned-ins-ink); }
html.nc-dark .margin-action--accept:hover,
html.nc-dark .margin-action--resolve:hover { background: var(--ned-ok-wash); border-color: var(--ned-ok-line); }
html.nc-dark .margin-action--reject { color: var(--ned-del-ink); }
html.nc-dark .margin-action--reject:hover { background: var(--ned-err-wash); border-color: var(--ned-del-ink); }
html.nc-dark .margin-action--edit,
html.nc-dark .margin-reply-edit-btn { color: var(--ned-text-2); }
html.nc-dark .margin-action--edit:hover,
html.nc-dark .margin-reply-edit-btn:hover { color: var(--ned-ink); }
html.nc-dark .margin-reply-field,
html.nc-dark .margin-card-edit-textarea { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-ink); }
html.nc-dark .margin-reply-field::placeholder { color: var(--ned-text-2); }
html.nc-dark .margin-reply-field:focus,
html.nc-dark .margin-card-edit-textarea { border-color: var(--ned-gold); }
html.nc-dark .margin-reply-send { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-gold); }
html.nc-dark .margin-reply-send:hover { background: var(--ned-gold-wash); border-color: var(--ned-gold); }
html.nc-dark .margin-card-edit-cancel { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-ink); }
html.nc-dark .margin-card-edit-cancel:hover { background: var(--ned-hover); }
html.nc-dark .margin-card-edit-save { background: var(--ned-ins-ink); border-color: var(--ned-ins-ink); color: var(--ned-page); }
html.nc-dark .margin-card-edit-save:hover { background: var(--ned-ok-line); }

/* @-mentions, the selection tooltip, the comment popup, modal, toasts */
html.nc-dark .mention { background: var(--ned-ok-wash); color: var(--ned-ins-ink); }
html.nc-dark .tribute-container { background: var(--ned-card); border-color: var(--ned-line); box-shadow: var(--ned-pop-shadow); color: var(--ned-ink); }
html.nc-dark .tribute-container li:hover,
html.nc-dark .tribute-container li.highlight { background: var(--ned-hover); }
html.nc-dark .tribute-container li.tribute-item--active { background: var(--ned-ok-wash); }
html.nc-dark .tribute-container li small,
html.nc-dark .tribute-container li.no-match { color: var(--ned-text-2) !important; }
html.nc-dark .comment-tooltip { background: var(--ned-hover); border: 1px solid var(--ned-line); box-shadow: var(--ned-pop-shadow); }
html.nc-dark .comment-tooltip-btn { color: var(--ned-ink); }
html.nc-dark .comment-tooltip-btn:hover { background: var(--ned-line); }
html.nc-dark .comment-tooltip-comment,
html.nc-dark .comment-tooltip-bold { border-right-color: var(--ned-line); }
html.nc-dark .comment-popup { background: var(--ned-card); border-color: var(--ned-line); box-shadow: var(--ned-pop-shadow); color: var(--ned-ink); }
html.nc-dark .comment-popup-input,
html.nc-dark .editor-modal-textarea { background: var(--ned-field); border-color: var(--ned-line); color: var(--ned-ink); }
html.nc-dark .comment-popup-input:focus,
html.nc-dark .editor-modal-textarea:focus { border-color: var(--ned-gold); }
html.nc-dark .editor-modal-overlay { background: var(--ned-scrim); }
html.nc-dark .editor-modal { background: var(--ned-card); box-shadow: var(--ned-pop-shadow); color: var(--ned-ink); }
html.nc-dark .editor-modal-header h3 { color: var(--ned-ink); }
html.nc-dark .editor-modal-label { color: var(--ned-text-2); }
html.nc-dark .editor-toast { box-shadow: var(--ned-pop-shadow); }
html.nc-dark .editor-toast--info { background: var(--ned-hover); color: var(--ned-ink); }
html.nc-dark .editor-toast--success { background: var(--ned-ok-wash); color: var(--ned-ins-ink); }
html.nc-dark .editor-toast--error { background: var(--ned-err-wash); color: var(--ned-del-ink); }
/* ── end Editor — dark */

/* ============================================================
   Admin Console — Responsive
   ============================================================ */

@media (max-width: 768px) {
  .admin-main {
    padding: 20px 16px 40px;
  }
  .admin-page-title {
    font-size: 22px;
  }
  .admin-tab {
    padding: 8px 16px;
    font-size: 14px;
  }
  .admin-table {
    font-size: 13px;
  }
  .admin-table th,
  .admin-table td {
    padding: 8px;
  }
  .admin-access-add {
    flex-direction: column;
  }
  .admin-modal {
    margin: 16px;
  }
  .editor-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .editor-toolbar-right {
    flex-wrap: wrap;
  }
  .editor-comment-input {
    width: 100%;
  }
  .edit-toolbar {
    flex-wrap: wrap;
  }
  .editor-body {
    flex-direction: column;
  }
  .cm-gutters {
    display: none !important;
  }
  .suggestion-margin {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e5e5;
    position: static;
    max-height: 200px;
  }
  .margin-card {
    position: static;
    margin-bottom: 6px;
    left: auto;
    right: auto;
    margin-left: 8px;
    margin-right: 8px;
  }
}

/* Audiobook badge on book detail page */
.audiobook-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2d5a27;
  color: #fff;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  margin-bottom: 8px;
}
.audiobook-badge svg { flex-shrink: 0; }

/* ElevenLabs footer logo */
.footer-elevenlabs { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-left: auto; color: #888; font-size: 11px; }
.footer-elevenlabs a { color: #666; text-decoration: none; }
.footer-elevenlabs a:hover { color: #333; text-decoration: underline; }
.footer-elevenlabs-logo { height: 14px; width: auto; }

/* ============================================================
   Audio Player — Floating icon + sticky bottom bar
   ============================================================ */

.audio-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2d5a27;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
.audio-fab:hover { transform: scale(1.1); }
.audio-fab--loading { opacity: 0.6; pointer-events: none; }
.audio-fab--playing { background: #4a8c3f; }

.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e1e1e;
  color: #d4d4d4;
  z-index: 999;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
  font-size: 13px;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
}

.audio-player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.audio-player-extra {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 10px;
}

.audio-play-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.audio-play-btn:hover { color: #4a8c3f; }

.audio-time {
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  font-size: 12px;
  color: #999;
}

.audio-scrubber {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #444;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4a8c3f;
  cursor: pointer;
}
.audio-scrubber::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4a8c3f;
  border: none;
  cursor: pointer;
}

.audio-scrubber-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.audio-scrubber-container .audio-scrubber {
  flex: 1;
  min-width: 0;
}

.scrubber-h2-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
  cursor: pointer;
  z-index: 1;
  pointer-events: auto;
}
.scrubber-h2-marker:hover {
  background: rgba(255, 255, 255, 0.8);
  height: 14px;
}
.scrubber-h2-marker::before {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: -8px;
  right: -8px;
}

.audio-speed {
  background: #333;
  color: #d4d4d4;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 12px;
  cursor: pointer;
  /* Safari draws <select> natively and ignores the dark background above — light-gray "1x" on a
     white chip. A dark color-scheme makes the native control dark to match. */
  color-scheme: dark;
}

.audio-skip-btn {
  background: none;
  border: 1px solid #555;
  color: #999;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.audio-skip-btn:hover { color: #fff; border-color: #888; }

/* Bible A–B loop (Scripture memory): amber when a point is set / repeat is on. */
.audio-loop {
  display: flex;
  align-items: center;
  gap: 6px;
}
.audio-loop-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audio-loop-btn.is-set,
.audio-loop-btn[aria-pressed="true"] {
  color: #1e1e1e;
  background: #e0a33a;
  border-color: #e0a33a;
}
.audio-loop-btn:disabled { opacity: 0.4; cursor: default; }
.audio-loop-btn:disabled:hover { color: #999; border-color: #555; }
.audio-loop-range {
  font-size: 12px;
  color: #d4d4d4;
  white-space: nowrap;
}

.audio-expand-btn {
  display: none;
}

.audio-jump-link {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px;
  background: #fff;
  color: var(--color-green);
  font-family: var(--font-sans);
  font-size: 12px;
  text-decoration: none;
  z-index: 998;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.audio-jump-link:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.audio-close-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}
.audio-close-btn:hover { color: #fff; }

/* Text sync: highlight overlays are positioned absolutely via JS.
   The session-content container needs relative positioning. */
.session-content { position: relative; }

.heading-audio-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s;
  text-decoration: none;
}
.heading-audio-icon:hover {
  color: var(--color-green);
  opacity: 1;
}
h1:hover .heading-audio-icon,
h2:hover .heading-audio-icon,
h3:hover .heading-audio-icon,
h4:hover .heading-audio-icon,
h5:hover .heading-audio-icon,
h6:hover .heading-audio-icon {
  opacity: 0.5;
}

@media (max-width: 768px) {
  .heading-audio-icon {
    opacity: 0.4;
  }
}

/* Mobile: compact player with expandable extra controls */
@media (max-width: 768px) {
  .audio-fab { bottom: 80px; right: 16px; width: 42px; height: 42px; }
  .audio-player {
    display: block;
    height: auto;
    padding: 0;
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    position: fixed;
  }
  .audio-player > .audio-close-btn {
    position: absolute;
    top: 0;
    right: 4px;
    height: 48px;
    display: flex;
    align-items: center;
  }
  .audio-player-main {
    height: 48px;
    gap: 6px;
    padding: 0 32px 0 10px;
  }
  .audio-jump-link {
    bottom: 56px;
  }
  .audio-player-extra {
    display: none;
    border-top: 1px solid #333;
    padding: 8px 10px;
    gap: 12px;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap; /* the Bible's Loop group takes a second row */
  }
  .audio-player.is-expanded .audio-player-extra {
    display: flex;
  }
  .audio-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s;
  }
  .audio-player.is-expanded .audio-expand-btn {
    transform: rotate(180deg);
  }
  .audio-skip-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
  .audio-speed {
    padding: 4px 8px;
    font-size: 13px;
  }
}
/* iOS Safari zooms the page into a focused <select> under 16px (and stays zoomed). */
@media (hover: none) and (pointer: coarse) {
  .audio-speed { font-size: 16px; }
}

/* Pad reading content when player is visible */
.reading-content { transition: padding-bottom 0.3s; }
body:has(.audio-player:not([style*="none"])) .reading-content {
  padding-bottom: 70px;
}
@media (max-width: 768px) {
  body:has(.audio-player:not([style*="none"])) .reading-content {
    padding-bottom: 80px;
  }
  body:has(.audio-player.is-expanded:not([style*="none"])) .reading-content {
    padding-bottom: 120px;
  }
  body:has(.audio-player.is-expanded:not([style*="none"]) .audio-loop) .reading-content {
    padding-bottom: 170px;
  }
}

/* ============================================================
   AJAX Navigation
   ============================================================ */

/* Thin progress bar at top of viewport */
.ajax-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--gold, #d7b44a);
  z-index: 10000;
  transition: width 8s cubic-bezier(0.1, 0.5, 0.1, 1);
}
.ajax-nav-progress--active {
  width: 85%;
}
.ajax-nav-progress--done {
  width: 100%;
  transition: width 0.2s ease;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease 0.1s;
}

/* Tap-to-continue banner for Safari iOS autoplay failure */
.audio-tap-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-bottom: 16px;
  background: var(--gold, #d7b44a);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  -webkit-tap-highlight-color: transparent;
}
.audio-tap-banner:active {
  background: #c5a43e;
}
.audio-tap-banner svg {
  flex-shrink: 0;
}

/* Planning Calendar (Opening): fixed columns so the empty Teacher/Date columns
   get real width and the (now-stacked) Biblical Passage column stays compact. */
.session-content .pc-table { table-layout: fixed; }
.session-content .pc-table th:nth-child(1), .session-content .pc-table td:nth-child(1) { width: 32%; }
.session-content .pc-table th:nth-child(2), .session-content .pc-table td:nth-child(2) { width: 50%; }
.session-content .pc-table th:nth-child(3), .session-content .pc-table td:nth-child(3) { width: 18%; }

/* Core Content (Opening): give the Session column real width (like the Planning
   Calendar's first column) so the "Session N: Title (passage)" cell doesn't collapse. */
.session-content .cc-table { table-layout: fixed; }
.session-content .cc-table th:nth-child(1), .session-content .cc-table td:nth-child(1) { width: 32%; }
.session-content .cc-table th:nth-child(2), .session-content .cc-table td:nth-child(2) { width: 68%; }

/* Recall Learning Plan tables (Selected Passages / Recommended Reading): keep the
   "Session N" label in the first column on one line so it doesn't wrap. */
.session-content .lp-table th:first-child, .session-content .lp-table td:first-child { white-space: nowrap; }

/* Further Resources reading-plan tables: 4 equal-width Week columns (5 rows = 5 days).
   On phones the table scrolls horizontally inside .rp-scroll rather than crushing. */
.session-content .rp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.session-content .rp-table { table-layout: fixed; width: 100%; }
.session-content .rp-table th, .session-content .rp-table td { width: 25%; }
@media (max-width: 640px) {
  .session-content .rp-table { min-width: 34rem; }
}

/* ===== Admin Analytics dashboard (P3) ===== */
.an-controls { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.an-range { display:inline-flex; border:1px solid #e0ddd4; border-radius:8px; overflow:hidden; }
.an-range-btn { background:#fff; border:none; padding:6px 14px; font:inherit; font-size:13px; color:#6b6b66; cursor:pointer; border-right:1px solid #e0ddd4; }
.an-range-btn:last-child { border-right:none; }
.an-range-btn--active { background:#be9d26; color:#fff; font-weight:600; }
.an-bots { font-size:13px; color:#6b6b66; display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.an-status { font-size:13px; }
.an-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:18px; }
.an-tiles--audio { margin-bottom:8px; }
.an-tile { background:#fff; border:1px solid #ece9e0; border-radius:10px; padding:16px 18px; }
.an-tile-val { font-family:'Poppins',sans-serif; font-size:26px; font-weight:600; color:#2f2f2d; line-height:1.1; }
.an-tile-label { font-size:12px; color:#8a8a86; margin-top:4px; text-transform:uppercase; letter-spacing:.03em; }
.an-tile-sub { display:block; text-transform:none; letter-spacing:0; color:#b0aea6; font-size:11px; }
.an-card { background:#fff; border:1px solid #ece9e0; border-radius:12px; padding:18px 20px; margin-bottom:16px; }
.an-card-title { font-family:'Poppins',sans-serif; font-size:15px; font-weight:600; color:#2f2f2d; margin:0 0 14px; }
.an-card-sub { font-weight:400; color:#a7a59d; font-size:12px; margin-left:6px; }
.an-subhead { font-family:'Poppins',sans-serif; font-size:13px; font-weight:600; color:#4a4a47; margin:18px 0 10px; }
.ra-passage { display:flex; align-items:baseline; gap:10px; padding:8px 4px; border-bottom:1px solid #eee; font-size:14px; }
.ra-passage:last-child { border-bottom:none; }
.ra-passage-count { flex:none; font-weight:700; color:#0072B2; min-width:38px; }
.ra-passage-ref { flex:1 1 auto; color:#3a3a38; }
.ra-passage-book { flex:none; color:#8a8a86; font-size:12px; white-space:nowrap; }
.an-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:820px){ .an-grid { grid-template-columns:1fr; } }
.an-chart-box { position:relative; height:300px; }
.an-chart-box--sm { height:230px; }
.an-table-box { overflow-x:auto; }
.an-table { width:100%; border-collapse:collapse; font-size:13px; }
.an-table th { text-align:left; color:#8a8a86; font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.03em; padding:6px 10px; border-bottom:1px solid #ece9e0; }
.an-table td { padding:7px 10px; border-bottom:1px solid #f4f2ec; color:#3a3a38; }
.an-table td.an-num { text-align:right; font-variant-numeric:tabular-nums; color:#2f2f2d; }
.an-table tr:last-child td { border-bottom:none; }
.an-empty { color:#a7a59d; font-size:13px; padding:8px 2px; }
.an-book-select { font-size:13px; max-width:340px; }
.an-scope-title { font-family:'Poppins',sans-serif; font-size:18px; font-weight:600; color:#2f2f2d; margin:2px 0 14px; }
/* Analytics sub-tabs, leaderboard, funnel */
.an-subtabs { display:flex; gap:4px; border-bottom:1px solid #e0ddd4; margin-bottom:18px; }
.an-subtab { background:none; border:none; padding:8px 16px; font:inherit; font-size:14px; color:#6b6b66; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.an-subtab--active { color:#2f2f2d; font-weight:600; border-bottom-color:#be9d26; }
.an-sub--hidden { display:none; }
.an-lb th.an-sortable { cursor:pointer; user-select:none; white-space:nowrap; text-align:right; }
.an-lb th.an-th-left { text-align:left; }
.an-lb-row { cursor:pointer; }
.an-lb-row:hover td { background:#faf8f2; }
.an-funnel-row { display:flex; align-items:center; gap:12px; padding:5px 0; }
.an-funnel-label { flex:0 0 240px; font-size:13px; color:#3a3a38; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.an-funnel-bar-wrap { flex:1; background:#f1eee6; border-radius:4px; height:20px; overflow:hidden; }
.an-funnel-bar { height:100%; background:#0072B2; border-radius:4px; min-width:2px; }
.an-funnel-val { flex:0 0 96px; text-align:right; font-size:13px; color:#2f2f2d; font-variant-numeric:tabular-nums; }
.an-funnel-ret { color:#8a8a86; margin-left:8px; font-size:12px; }
@media (max-width:640px){ .an-funnel-label { flex-basis:120px; } }

.bv-struct-card { margin: 8px 0; }

/* Quotation Audit — per-book progress + results */
.qa-cover { width: 40px; height: 56px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.2); background: #efe9db; }
.qa-cover--none { display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.qa-live-books { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.qa-book-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.qa-book-row:nth-child(odd) { background: #faf7ef; }
.qa-book-meta { flex: 1 1 auto; min-width: 0; }
.qa-book-title { font-weight: 600; }
.qa-book { border: 1px solid #e5e0d5; border-radius: 8px; margin: 8px 0; background: #fff; }
.qa-book-summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; }
.qa-book-summary::-webkit-details-marker { display: none; }
.qa-book-body { padding: 0 12px 12px; }

.qa-finding { margin: 8px 0; padding: 10px; }
.qa-finding-head { margin-bottom: 4px; }
.qa-fix-actions { margin-top: 8px; }

/* Quotation Audit — enriched finding cards */
.qa-finding-session { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.qa-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.qa-block { margin: 6px 0; }
.qa-block-label { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: #8a7f66; margin-bottom: 2px; }
.qa-para { line-height: 1.6; padding: 6px 8px; background: #faf7ef; border-radius: 6px; }
/* In-session quote: whole span light yellow, only the differing words darker yellow. */
.qa-q { background: #fdf3c4; border-radius: 3px; padding: 0 1px; }
.qa-diff { background: #ffd23f; border-radius: 2px; padding: 0 1px; font-weight: 600; }
/* BSB span: whole span light green, only the differing (correct) words darker green. */
.qa-bsb { background: #dff2d8; border-radius: 3px; padding: 0 1px; }
.qa-diff-bsb { background: #a6e0a0; border-radius: 2px; padding: 0 1px; font-weight: 600; }
.qa-fix { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #eae4d6; }
.qa-fix-preview { margin-bottom: 6px; }

/* Compare summary groups + bulk refresh */
.bv-group-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #8a7f66; margin: 12px 0 4px; }
.bv-math { margin-top: 8px; }
.bv-refresh { margin: 14px 0; padding: 12px; border: 1px solid #e5e0d5; border-radius: 8px; background: #fffdf5; }

/* Compare results — one collapsible section per difference type */
.bv-section { margin-top: 12px; border: 1px solid #e5ddc9; border-radius: 8px; background: #fff; }
.bv-section > summary { cursor: pointer; padding: 10px 12px; font-size: 15px; user-select: none; list-style: none; }
.bv-section > summary::-webkit-details-marker { display: none; }
.bv-section > summary::before { content: "\25B8"; display: inline-block; width: 1em; color: #b8ab88; transition: transform .12s ease; }
.bv-section[open] > summary::before { transform: rotate(90deg); }
.bv-section[open] > summary { border-bottom: 1px solid #efe9d8; }
.bv-section > *:not(summary) { margin-left: 12px; margin-right: 12px; }
.bv-section > .bv-refresh:first-of-type { margin-top: 12px; }
.bv-count { color: #8a7d5a; font-weight: 400; font-size: 13px; margin-left: 4px; }
.bv-history-actions { margin-top: 12px; }

/* Quotation Audit — editable fix box, shown in the session's surrounding text */
.qa-fix-label { font-size: 12px; margin-bottom: 4px; }
.qa-fix-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.6;
  padding: 6px 8px; border: 1px solid #cdb86a; border-radius: 6px; resize: vertical;
  background: #fffdf3; box-shadow: 0 0 0 2px #fdf3c4; }
.qa-fix-inline { line-height: 1.6; padding: 6px 8px; background: #faf7ef; border-radius: 6px; }
.qa-fix-inline .qa-fix-text { margin: 6px 0; }
.qa-ctx-text { color: #9a8f77; }
.qa-fix-actions { margin-top: 8px; }

/* Publisher freshness banner (Bible Validation) */
.bv-fresh { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e5ddc9; border-radius: 8px; background: #fff; }
.bv-fresh--ok { border-color: #bfe3c0; background: #f2faf2; }
.bv-fresh--warn { border-color: #f0d98a; background: #fdf8e6; }
.bv-fresh--err { border-color: #eecaca; background: #fbf1f1; }
.bv-fresh-icon { font-size: 18px; line-height: 1.4; }
.bv-fresh-sub { font-size: 13px; color: #6b6350; margin-top: 2px; }

/* BSB applied-changes sync log */
.bv-log-row { border: 1px solid #e5ddc9; border-radius: 8px; margin-bottom: 8px; background: #fff; }
.bv-log-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.bv-log-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: #efe9d8; color: #7a6f52; white-space: nowrap; }
.bv-log-kind--verse { background: #e6f0fb; color: #3a6ea5; }
.bv-log-kind--restore { background: #f2e6e6; color: #a05a5a; }
.bv-log-msg { flex: 1; min-width: 180px; font-size: 14px; }
.bv-log-meta { font-size: 12px; }
.bv-log-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bv-log-diff { padding: 6px 12px 12px; border-top: 1px solid #efe9d8; }
.bv-log-file { margin-top: 6px; }

/* Sync-log / history: view-more + GitHub link */
.bv-more { margin: 10px 0; text-align: center; }
.bv-log-ghlink { margin-top: 8px; font-size: 13px; }

/* Small inline spinner for async loads */
.bv-spin { display: inline-block; width: 15px; height: 15px; border: 2px solid #e6ddc7; border-top-color: #b8923a; border-radius: 50%; animation: bv-spin 0.7s linear infinite; vertical-align: -3px; }
@keyframes bv-spin { to { transform: rotate(360deg); } }

/* ===== Admin: Home tab (shared Home content) ===== */
.hm-wrap{max-width:820px;padding:8px 0 32px}
.hm-intro,.hm-desc{color:#666;font-size:.9rem;line-height:1.5;margin:.25rem 0 1rem}
.hm-h{font-size:1.15rem;margin:1.6rem 0 .25rem}
.hm-h3{font-size:.95rem;margin:1.2rem 0 .5rem}
.hm-status{padding:10px 0;color:#666}
.hm-status--error{color:#b3261e}
.hm-books{list-style:decimal;padding-left:1.4rem;margin:0}
.hm-book{padding:10px 0;border-bottom:1px solid #eee}
.hm-book-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.hm-book-title{font-weight:600}
.hm-book-series{color:#888;font-size:.8rem}
.hm-book-btns{margin-left:auto;display:flex;gap:4px}
.hm-book-sub{color:#777;font-style:italic;font-size:.85rem;margin-top:2px}
.hm-tag{font-size:.7rem;font-weight:600;padding:1px 7px;border-radius:999px;background:#f8ecd3;color:#835f16}
.hm-tag--muted{background:#eee;color:#666}
.hm-tag--warn{background:#fde7e7;color:#8a1c1c}
.hm-sessions{margin-top:6px;font-size:.85rem}
.hm-sessions summary{cursor:pointer;color:#555}
.hm-session{display:block;padding:2px 0 2px 4px}
.hm-add{display:flex;gap:8px;margin-top:12px;align-items:center}
.hm-preview td{font-size:.85rem}
.hm-grid{display:grid;grid-template-columns:120px 1fr;gap:8px 12px;align-items:center;max-width:620px}
.hm-grid label{font-size:.85rem;color:#555}
.hm-actions{margin-top:16px;display:flex;align-items:center;gap:12px}
.hm-saved{font-size:.85rem;color:#666}
@media (max-width:600px){.hm-grid{grid-template-columns:1fr}.hm-book-btns{margin-left:0}}

/* ===== Sign-in (web sign-in plan P3, Collective-Shared plans/2026-10-05-common-web-sign-in.md) =====
   The kit's own panel/dialog styles are injected by the reader bundle (.ncsi*, --si-* tokens in
   reader-userdata/styles.js). These are the server-rendered pieces around it. */

/* Home, signed out: the closable prompt in the "Continue reading" slot (res-flow-1, res-flow-phone-home) */
.nc-prompt{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:36px;align-items:center;
  background:linear-gradient(180deg,#f3f6ef,#eef2e8);border:1px solid #dde4d4;border-radius:14px;padding:26px 30px;margin:0 0 30px}
.nc-prompt__x{position:absolute;right:10px;top:8px;width:36px;height:36px;border:0;border-radius:999px;background:transparent;
  color:#8b957f;font-size:22px;line-height:1;cursor:pointer}
.nc-prompt__x:hover{background:rgba(83,105,66,.1);color:var(--color-green)}
.nc-prompt__eyebrow{font:600 11px var(--font-sans);letter-spacing:.14em;text-transform:uppercase;color:var(--color-green);margin:0 0 6px}
.nc-prompt__title{font:400 28px/1.15 var(--font-serif);color:var(--color-charcoal);margin:0 0 10px;text-wrap:balance}
.nc-prompt__text{font:400 14.5px/1.6 var(--font-sans);color:#4a4a4a;margin:0 0 18px;max-width:540px}
.nc-prompt__text--narrow{display:none}
.nc-prompt__acts{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.nc-prompt__btn{display:inline-flex;align-items:center;min-height:44px;padding:0 22px;border-radius:8px;background:var(--color-green);
  color:#fff;font:600 14.5px var(--font-sans);text-decoration:none}
.nc-prompt__btn:hover{background:var(--color-green-dark);color:#fff}
.nc-prompt__app{font:500 14px var(--font-sans);color:var(--color-green);text-decoration:underline;text-underline-offset:3px}
/* Decoration only (aria-hidden): muted so it can't read as the visitor's own library. */
.nc-prompt__deco{display:flex;flex-direction:column;gap:10px;opacity:.8;pointer-events:none;user-select:none}
.nc-prompt__card{display:flex;gap:11px;align-items:center;background:#fff;border:1px solid #e1e6da;border-radius:10px;padding:9px 11px;
  box-shadow:0 2px 6px rgba(36,40,51,.05)}
.nc-prompt__cover{width:34px;height:51px;border-radius:2px;object-fit:cover;flex:none;filter:saturate(.75)}
.nc-prompt__card b{display:block;font:600 13px/1.3 var(--font-sans);color:var(--color-charcoal)}
.nc-prompt__card span{display:block;font-size:12px;color:var(--color-text-light)}
.nc-prompt__card .nc-prompt__dev{display:flex;align-items:center;gap:5px;margin-top:3px;font-weight:500;color:var(--color-green)}
.nc-prompt__dev svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2}
@media (max-width:989px){
  .nc-prompt{grid-template-columns:1fr;padding:22px 22px 20px;margin-bottom:24px}
  .nc-prompt__deco,.nc-prompt__eyebrow,.nc-prompt__text--wide{display:none}
  .nc-prompt__text--narrow{display:block}
  .nc-prompt__title{font-size:23px;padding-right:28px}
}
html.nc-dark .nc-prompt{background:#1f1d1a;border-color:#3a3633}
html.nc-dark .nc-prompt__title{color:#f2efe9}
html.nc-dark .nc-prompt__text{color:#c9c4bd}
html.nc-dark .nc-prompt__eyebrow,html.nc-dark .nc-prompt__app{color:#a7c48f}
html.nc-dark .nc-prompt__card{background:#26221f;border-color:#3a3633}
html.nc-dark .nc-prompt__card b{color:#e6e3df}
html.nc-dark .nc-prompt__card .nc-prompt__dev{color:#a7c48f}

/* /sign-in?returnTo= (res-flow-2): hero + four items + store links, and the kit's page panel */
.nc-sp{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,420px);gap:56px;align-items:start;padding-top:12px;max-width:1120px}
.nc-sp__title{font:400 44px/1.1 var(--font-serif);color:var(--color-charcoal);margin:0 0 16px;text-wrap:balance}
.nc-sp__lede{font:400 17px/1.7 var(--font-reading);color:var(--color-text);margin:0 0 26px;max-width:560px}
.nc-sp__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:18px}
.nc-sp__list li{display:grid;grid-template-columns:38px 1fr;gap:14px;font-size:14px;line-height:1.55;color:#4a4a4a}
.nc-sp__list b{display:block;color:var(--color-charcoal);font-weight:600;font-size:15px}
.nc-sp__ico{width:38px;height:38px;border-radius:50%;background:#e6ecdf;display:grid;place-items:center}
.nc-sp__ico svg{width:17px;height:17px;stroke:var(--color-green);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nc-sp__apps{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}
.nc-store{display:inline-block;background:#111;color:#fff;border-radius:8px;padding:7px 14px;font:500 11.5px/1.25 var(--font-sans);text-decoration:none}
.nc-store b{display:block;font-size:14.5px;font-weight:600}
.nc-store:hover{background:#333;color:#fff}
.nc-sp__panel{min-height:380px}
.nc-sp__panel .ncsi{max-width:none}
@media (max-width:989px){
  .nc-sp{grid-template-columns:1fr;gap:32px;padding-top:0}
  .nc-sp__panel{order:-1;min-height:0}
  .nc-sp__title{font-size:32px}
}
html.nc-dark .nc-sp__title,html.nc-dark .nc-sp__list b{color:#f2efe9}
html.nc-dark .nc-sp__lede,html.nc-dark .nc-sp__list li{color:#c9c4bd}
html.nc-dark .nc-sp__ico{background:#26221f}
html.nc-dark .nc-sp__ico svg{stroke:#a7c48f}

/* ============================================================
   Reader settings from the first paint (Bryan, 2026-10: pages flashed white 2-3 times in dark mode).
   The head script in partials/header.ejs sets html.nc-dark / --nc-font-scale / --font-reading before
   anything is drawn; these are the rules they feed. They used to exist only inside the reader bundle
   (src/reader-userdata/styles.js, injected at the end of the page load) — that copy stays, identical,
   for the reader's own UI; keep the two in step.
   ============================================================ */
.session-content p, .reading-content p, .session-content li, .reading-content li{ font-size:calc(17px * var(--nc-font-scale,1)) !important; }
.session-content h1, .reading-content h1{ font-size:calc(2rem * var(--nc-font-scale,1)) !important; }
.session-content h2, .reading-content h2{ font-size:calc(1.6rem * var(--nc-font-scale,1)) !important; }
.session-content h3, .reading-content h3{ font-size:calc(1.35rem * var(--nc-font-scale,1)) !important; }
.session-content h4, .reading-content h4{ font-size:calc(1.15rem * var(--nc-font-scale,1)) !important; }

html.nc-dark{
  color-scheme:dark;
  --color-bg:#1c1917; --color-bg-warm:#26221f; --color-bg-sidebar:#12100e;
  --color-border:#3a3633; --color-text:#e6e3df; --color-text-light:#a8a29e; --color-charcoal:#e6e3df;
}
/* The verse pop-up stays a white card in both themes, so it keeps the light theme's ink (Bible follow-ups F1). */
html.nc-dark .verse-popup{
  color-scheme:light;
  --color-border:#e2e6df; --color-text:#3a3a3a; --color-text-light:#6b6b6b; --color-charcoal:#242833;
}
html.nc-dark, html.nc-dark body{ background:#0c0a09; }
html.nc-dark body{ color:var(--color-text); }
html.nc-dark .reading-content, html.nc-dark .session-content,
html.nc-dark .session-content p, html.nc-dark .session-content li,
html.nc-dark .session-content blockquote, html.nc-dark .session-content td,
html.nc-dark .session-content strong, html.nc-dark .session-content em{ color:var(--color-text); }
html.nc-dark .session-content h1, html.nc-dark .session-content h2, html.nc-dark .session-content h3,
html.nc-dark .session-content h4, html.nc-dark .session-content h5, html.nc-dark .session-content h6{ color:#f2efe9; }
html.nc-dark .session-content a{ color:#93c5fd; }
html.nc-dark .question-block{ background:var(--color-bg-warm); }
html.nc-dark img:not([src*=".svg"]){ filter:brightness(.88); }
html.nc-verse-line .bible-content .bible-verse{ display:block; margin:.2rem 0; padding-left:1.5rem; text-indent:-1.5rem; }
html.nc-verse-line .bible-content .bible-verse .verse-num{ font-weight:700; }
html.nc-verse-line .bible-content .bible-paragraph sup{ font-weight:700; }
html.nc-verse-line .bible-content .bible-paragraph sup::before{ content:''; display:block; margin-top:.35rem; }
html.nc-verse-line .bible-content .bible-paragraph sup:first-child::before{ margin-top:0; }

/* Surfaces that were hard-coded white and stayed white in dark mode. */
html.nc-dark .site-footer{ background:#12100e; color:#a7c48f; border-top-color:#2a2623; }
html.nc-dark .site-footer a, html.nc-dark .footer-heading{ color:#a7c48f; }
html.nc-dark .footer-link-list a, html.nc-dark .footer-description,
html.nc-dark .footer-bottom small, html.nc-dark .footer-bottom a{ color:#c9c4bd; }
html.nc-dark .footer-bottom{ border-top-color:#2a2623; }
html.nc-dark .menu-drawer, html.nc-dark .menu-drawer__submenu{ background-color:#1c1917; color:#a7c48f; }
html.nc-dark .menu-drawer .menu-drawer__menu-item, html.nc-dark .menu-drawer__back-btn{ color:#c9c4bd; }
html.nc-dark .menu-drawer .menu-drawer__menu-item:hover,
html.nc-dark .menu-drawer .menu-drawer__menu-item:focus,
html.nc-dark .menu-drawer .menu-drawer__menu-item--active{ color:#e6e3df; background-color:rgba(167,196,143,.08); }
html.nc-dark .user-dropdown{ background:#1f1d1a; box-shadow:0 4px 24px rgba(0,0,0,.5); }
html.nc-dark .user-dropdown-name{ color:#f2efe9; }
html.nc-dark .user-dropdown-email{ color:#a8a29e; }
html.nc-dark .user-dropdown-divider{ background:#3a3633; }
html.nc-dark .user-dropdown-item{ color:#e6e3df; }
html.nc-dark .user-dropdown-item:hover{ background:#2a2623; }

/* ============================================================
   Home library search (Collective-Shared plans/2026-10-09-library-search-terms.md, P4;
   mockup plans/assets/2026-10-09-library-search/search-mockups.html). js/library-search.js.
   ============================================================ */
.nc-sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.page-subtitle:has(+ .nc-libsearch){ margin-bottom:1rem; }
.nc-libsearch{ max-width:560px; margin-bottom:2.25rem; }
.nc-libsearch__field{
  display:flex; align-items:center; gap:10px; height:46px; padding:0 14px;
  border:1.5px solid var(--color-border); border-radius:10px; background:var(--color-bg);
  color:#9a9a9a; transition:border-color .15s, box-shadow .15s;
}
.nc-libsearch__field:focus-within{ border-color:var(--color-green); box-shadow:0 0 0 3px rgba(83,105,66,.12); color:var(--color-green); }
.nc-libsearch:has(input:not(:placeholder-shown)) .nc-libsearch__field{ border-color:var(--color-green); color:var(--color-green); }
.nc-libsearch__icon{ flex:none; }
.nc-libsearch__field input{
  flex:1; min-width:0; height:100%; border:0; outline:0; background:transparent; padding:0;
  font-family:var(--font-sans); font-size:16px; color:var(--color-charcoal); -webkit-appearance:none; appearance:none;
}
.nc-libsearch__field input::placeholder{ color:#9a9a9a; opacity:1; }
.nc-libsearch__field input::-webkit-search-cancel-button,
.nc-libsearch__field input::-webkit-search-decoration{ -webkit-appearance:none; appearance:none; display:none; }
.nc-libsearch__clear{
  flex:none; border:0; background:none; padding:6px 0 6px 6px; cursor:pointer;
  font-family:var(--font-sans); font-size:13px; color:var(--color-text-light); text-decoration:underline;
}
.nc-libsearch__clear:hover{ color:var(--color-green); }
.nc-libsearch__hint{ font-family:var(--font-sans); font-size:12.5px; color:var(--color-text-light); margin-top:8px; }
.nc-libsearch__hint button{
  border:0; background:none; padding:0; font:inherit; color:inherit; cursor:pointer;
  text-decoration:underline; text-decoration-color:var(--color-border); text-underline-offset:2px;
}
.nc-libsearch__hint button:hover{ color:var(--color-green); text-decoration-color:currentColor; }

/* Searching: the results replace both the grid and the list (and the prompt / Continue strip). */
.main.is-lib-searching .home-visual,
.main.is-lib-searching .home-text,
.main.is-lib-searching > .nc-prompt,
.main.is-lib-searching > .nc-continue{ display:none !important; }
.nc-libresults[hidden]{ display:none; }
.nc-libresults{ max-width:720px; margin-bottom:3rem; }
.nc-libresults__head{
  font-family:var(--font-sans); font-size:11px; font-weight:600; letter-spacing:1.2px; text-transform:uppercase;
  color:var(--color-green); margin:0 0 6px;
}
.nc-libresults__list{ list-style:none; margin:0; padding:0; }
.nc-libresults__list li + li{ border-top:1px solid var(--color-border); }
.nc-libresults__row{
  display:flex; gap:14px; align-items:center; padding:12px 8px; margin:0 -8px; border-radius:6px;
  color:inherit; text-decoration:none; transition:background .15s;
}
.nc-libresults__row:hover, .nc-libresults__row:focus-visible{ background:var(--color-bg-warm); }
.nc-libresults__row:focus-visible{ outline:2px solid var(--color-green); outline-offset:-2px; }
.nc-libresults__cover{ width:40px; height:58px; flex:none; border-radius:3px; object-fit:cover; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.nc-libresults__cover--none{ display:block; background:var(--color-green); }
.nc-libresults__body{ min-width:0; flex:1; display:flex; flex-direction:column; gap:2px; }
.nc-libresults__title{ font-family:var(--font-sans); font-weight:600; font-size:14.5px; line-height:1.3; color:var(--color-charcoal); }
.nc-libresults__title .badge{ margin-left:4px; vertical-align:2px; }
.nc-libresults__path{ font-family:var(--font-sans); font-size:12px; color:var(--color-text-light); }
.nc-libresults__chip{
  align-self:flex-start; margin-top:2px; font-family:var(--font-sans); font-size:11.5px; font-weight:500;
  color:var(--color-green); background:var(--color-bg-warm); border:1px solid var(--color-border);
  border-radius:999px; padding:1px 9px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.nc-libresults__empty{ font-family:var(--font-sans); font-size:14px; color:var(--color-text-light); padding:10px 0; }
.nc-libresults__more{
  margin-top:10px; border:0; background:none; padding:4px 0; cursor:pointer;
  font-family:var(--font-sans); font-size:13px; font-weight:600; color:var(--color-green);
}
.nc-libresults__more:hover{ text-decoration:underline; }
@media (max-width: 768px){
  .page-subtitle:has(+ .nc-libsearch){ margin-bottom:.9rem; }
  .nc-libsearch{ margin-bottom:1.75rem; }
}
html.nc-dark .nc-libsearch__field{ background:#1f1d1a; }
html.nc-dark .nc-libsearch__field:focus-within,
html.nc-dark .nc-libsearch:has(input:not(:placeholder-shown)) .nc-libsearch__field{ border-color:#a7c48f; color:#a7c48f; box-shadow:0 0 0 3px rgba(167,196,143,.14); }
html.nc-dark .nc-libsearch__field input{ color:#f2efe9; }
html.nc-dark .nc-libsearch__field input::placeholder{ color:#8a847d; }
html.nc-dark .nc-libresults__head, html.nc-dark .nc-libresults__chip, html.nc-dark .nc-libresults__more,
html.nc-dark .nc-libsearch__clear:hover, html.nc-dark .nc-libsearch__hint button:hover{ color:#a7c48f; }
html.nc-dark .nc-libresults__title{ color:#f2efe9; }
html.nc-dark .nc-libresults__row:focus-visible{ outline-color:#a7c48f; }

/* ============================================================
   Bible typesetting (BIBLE_TYPE → html.nc-bt on every page; Collective-Shared ARCHITECTURE §9f,
   plans/2026-10-15-bible-typesetting.md). The --bt-* numbers are the shared tokens
   (tests/unit/fixtures/bible-layout.tokens.json; tests/unit/bible-type-css.test.js keeps them equal), in em
   of the verse text, so everything follows Text size. Sizes, spacing and roles only: the site's own fonts
   and colours stay. Both chapter renderings (audio blocks, verse spans) and the verse pop-up.
   ============================================================ */
html.nc-bt{
  --bt-verse-number-size:.6; --bt-verse-number-weight:600; --bt-verse-number-raise:.62; --bt-verse-number-gap-after:.2;
  --bt-chapter-title-size:1.35;
  --bt-chapter-number-size:1.75; --bt-chapter-number-weight:700;
  --bt-poetry-gutter:1.55; --bt-poetry-gutter-gap:.42; --bt-poetry-indent-step:1.25; --bt-poetry-stanza-gap:.7;
  --bt-psalm-title-size:.95;
  --bt-section-size:1; --bt-section-weight:600;
  --bt-sub-section-size:.92; --bt-sub-section-weight:600;
  --bt-division-size:.78; --bt-division-tracking:.16;
  --bt-division-range-size:.78;
  --bt-parallel-size:.8;
  --bt-acrostic-size:.78; --bt-acrostic-tracking:.16;
  --bt-ink:#111111; --bt-muted:#6b6b6b;
  --bt-number-font:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
html.nc-bt.nc-dark{ --bt-ink:#f2efe9; --bt-muted:#b9b3a8; }
html.nc-bt .bible-content{ --bt-text:calc(17px * var(--nc-font-scale, 1)); }
/* The pop-up is a white card in both themes (as before), so it keeps the light ink and muted grey. */
html.nc-bt .verse-popup-body{ --bt-text:calc(17px * var(--nc-font-scale, 1)); --bt-ink:#111111; --bt-muted:#6b6b6b; font-size:var(--bt-text); }

/* D4: the page title ("Psalm 1") 1.35× the verse text. */
html.nc-bt .bible-content h1{ font-size:calc(var(--bt-text) * var(--bt-chapter-title-size)) !important; line-height:1.25; }

/* D1: verse numbers. 0.6em semibold Inter, raised 0.62em (without opening the line), muted; a word space before
   (the only place a line may break), a 0.2em gap after with no break in it. Audio chapters have no character
   after the number, so the gap is a margin; text chapters keep a narrow no-break space (U+202F) inside the number
   (the anchor text needs a space there; unlike a no-break space, justification never stretches it), so the margin
   is the rest of 0.2em after Inter's U+202F (0.1455em of the number). */
html.nc-bt .bible-content .bible-paragraph sup,
html.nc-bt .bible-content .verse-num,
html.nc-bt .verse-popup-body .verse-num{
  font-family:var(--bt-number-font); font-size:calc(var(--bt-verse-number-size) * 1em); font-weight:var(--bt-verse-number-weight);
  font-style:normal; color:var(--bt-muted); vertical-align:baseline; position:relative; line-height:0;
  top:calc(var(--bt-verse-number-raise) / var(--bt-verse-number-size) * -1em);
  margin-right:calc(var(--bt-verse-number-gap-after) / var(--bt-verse-number-size) * 1em);
  font-variant-numeric:lining-nums proportional-nums;
}
html.nc-bt .bible-content .bible-verse .verse-num{ margin-right:calc(var(--bt-verse-number-gap-after) / var(--bt-verse-number-size) * 1em - .1455em); }
html.nc-bt.nc-verse-line .bible-content .bible-verse .verse-num,
html.nc-bt.nc-verse-line .bible-content .bible-paragraph sup{ font-weight:var(--bt-verse-number-weight); }

/* D3: the chapter number starts the chapter's first line (the text font, bold, ink) and verse 1's own number isn't
   drawn. The span is empty and data-nc-skip (the number is generated content; screen readers hear its label "Chapter
   N, verse 1"), and verse 1's number is only hidden, so anchors, narration and Find read exactly the text they did.
   The verse pop-up too, at each chapter it shows from verse 1 (Steve 2026-10-22; verse-popup-bt.js). */
html.nc-bt .bible-content .bt-chapnum, html.nc-bt .verse-popup-body .bt-chapnum{
  font-style:normal; font-weight:var(--bt-chapter-number-weight); color:var(--bt-ink);
  margin-right:calc(.12em * var(--bt-chapter-number-size));
}
html.nc-bt .bible-content .bt-chapnum::before, html.nc-bt .verse-popup-body .bt-chapnum::before{
  content:attr(data-n); font-size:calc(var(--bt-chapter-number-size) * 1em); line-height:.8; font-variant-numeric:lining-nums;
}
html.nc-bt .bible-content .bt-chapnum + sup, html.nc-bt .bible-content .bt-chapnum + .verse-num,
html.nc-bt .verse-popup-body .bt-chapnum + .verse-num{ display:none; }

/* D10: Verse layout = each verse on its own line with its number in a left column (1.55em, right-aligned, 0.42em
   gap; as poetry, D6), the chapter number in that column on the first line. The number is a zero-height block at
   its verse's start: it breaks the line there (no change to the DOM, so audio chapters keep their blocks) and hangs
   into the paragraph's left padding, on the first line's baseline. rtl = a wide number (Psalm 119) grows leftwards. */
html.nc-bt.nc-verse-line .bible-content .bible-paragraph{ padding-left:calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) * 1em); }
html.nc-bt.nc-verse-line .bible-content .bible-verse{ padding-left:0; text-indent:0; margin:.35rem 0 0; }
html.nc-bt.nc-verse-line .bible-content .bible-verse:first-child{ margin-top:0; }
html.nc-bt.nc-verse-line .bible-content .bible-paragraph sup::before{ content:none; }
html.nc-bt.nc-verse-line .bible-content .bible-paragraph sup,
html.nc-bt.nc-verse-line .bible-content .bible-verse .verse-num{
  display:block; height:0; position:static; top:auto; direction:rtl; text-align:right; white-space:nowrap;
  width:calc(var(--bt-poetry-gutter) / var(--bt-verse-number-size) * 1em);
  margin:.35rem 0 0 calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) / var(--bt-verse-number-size) * -1em);
  line-height:calc(1.8 / var(--bt-verse-number-size));
}
html.nc-bt.nc-verse-line .bible-content .bible-paragraph sup:first-child,
html.nc-bt.nc-verse-line .bible-content .bible-verse .verse-num{ margin-top:0; }
html.nc-bt.nc-verse-line .bible-content .bt-chapnum + sup,
html.nc-bt.nc-verse-line .bible-content .bt-chapnum + .verse-num{ display:none; }
/* A three-digit chapter number (Psalms 100–150) is wider than the column (it would leave the screen on a phone at
   Extra large), so it stays at the start of the first line as in Paragraph layout. */
html.nc-bt.nc-verse-line .bible-content .bt-chapnum:not(.bt-chapnum--wide){
  display:block; height:0; direction:rtl; text-align:right; white-space:nowrap; line-height:1.8;
  width:calc(var(--bt-poetry-gutter) * 1em); margin:0 0 0 calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) * -1em);
}
html.nc-bt.nc-verse-line .bible-content .bt-chapnum:not(.bt-chapnum--wide)::before{ line-height:0; }

/* D8: heading roles. Section 1.0× (the site's heading font, 600, ink); sub-section 0.92× 600 muted; the book
   division (\ms) 0.78× caps tracked centred muted with its range (\mr) under it; parallel passages (\r) 0.8×
   italic muted right under their heading; acrostic letters 0.78× caps tracked centred muted (D7). */
html.nc-bt .bible-content .bt-section, html.nc-bt .bible-content .bt-sub{
  font-family:var(--font-sans); line-height:1.35; text-align:left;
}
html.nc-bt .bible-content .bt-section{
  font-size:calc(var(--bt-text) * var(--bt-section-size)) !important; font-weight:var(--bt-section-weight);
  color:var(--bt-ink); margin:1.75em 0 .55em;
}
html.nc-bt .bible-content .bt-sub{
  font-size:calc(var(--bt-text) * var(--bt-sub-section-size)) !important; font-weight:var(--bt-sub-section-weight);
  color:var(--bt-muted); margin:1.4em 0 .5em;
}
html.nc-bt .bible-content .bt-division, html.nc-bt .bible-content .bt-division-range,
html.nc-bt .bible-content .bt-parallel, html.nc-bt .bible-content .bt-acrostic{
  font-family:var(--font-sans); color:var(--bt-muted); line-height:1.4;
}
html.nc-bt .bible-content .bt-division{
  font-size:calc(var(--bt-text) * var(--bt-division-size)); font-weight:600; text-transform:uppercase;
  letter-spacing:calc(var(--bt-division-tracking) * 1em); text-align:center; margin:1.6em 0 .25em;
}
html.nc-bt .bible-content .bt-division-range{
  font-size:calc(var(--bt-text) * var(--bt-division-range-size)); text-align:center; margin:0 0 1.2em;
}
html.nc-bt .bible-content .bt-parallel{
  font-size:calc(var(--bt-text) * var(--bt-parallel-size)); font-style:italic; margin:-.3em 0 .9em;
}
html.nc-bt .bible-content .bt-acrostic{
  font-size:calc(var(--bt-text) * var(--bt-acrostic-size)); font-weight:600; text-transform:uppercase;
  letter-spacing:calc(var(--bt-acrostic-tracking) * 1em); text-align:center; margin:1.4em 0 .5em;
}
/* A heading straight after the page title or another heading doesn't add its full space again. */
html.nc-bt .bible-content h1 + .bt-section, html.nc-bt .bible-content h1 + .bt-division,
html.nc-bt .bible-content h1 + .bt-acrostic, html.nc-bt .bible-content .bt-division-range + .bt-section{ margin-top:.6em; }

/* D11: the verse pop-up follows the same rules, in its own size (16px × Text size). */
html.nc-bt .verse-popup-heading{ font-family:var(--font-sans); color:var(--bt-muted); line-height:1.35; margin:1.1em 0 .45em; }
html.nc-bt .verse-popup-heading.bt-section{ font-size:calc(var(--bt-text) * var(--bt-section-size)); font-weight:var(--bt-section-weight); color:var(--bt-ink); }
html.nc-bt .verse-popup-heading.bt-sub{ font-size:calc(var(--bt-text) * var(--bt-sub-section-size)); font-weight:var(--bt-sub-section-weight); }
html.nc-bt .verse-popup-heading.bt-division{ font-size:calc(var(--bt-text) * var(--bt-division-size)); font-weight:600; text-transform:uppercase; letter-spacing:calc(var(--bt-division-tracking) * 1em); text-align:center; margin-bottom:.15em; }
html.nc-bt .verse-popup-heading.bt-division-range{ font-size:calc(var(--bt-text) * var(--bt-division-range-size)); font-weight:400; text-align:center; margin-top:0; }
html.nc-bt .verse-popup-heading.bt-acrostic{ font-size:calc(var(--bt-text) * var(--bt-acrostic-size)); text-transform:uppercase; letter-spacing:calc(var(--bt-acrostic-tracking) * 1em); text-align:center; }
html.nc-bt .verse-popup-body > .verse-popup-heading:first-child{ margin-top:0; }
html.nc-bt .verse-popup-body .verse-popup-continues{ font-size:calc(var(--bt-text) * .9); }

/* D13 (BIBLE_SMALLCAPS; Bible follow-ups F5): the divine name — "LORD", "GOD" … — in small capitals: its first letter
   as it is, the rest in span.bt-sc (bible-smallcaps.js / verse-popup-bt.js; the same characters, so anchors, copy and
   narration read "LORD"). The fonts have no small-caps glyphs, so the browser draws reduced capitals. */
html.nc-bt .bt-sc{ font-variant-caps:all-small-caps; }

/* P5 poetry (BIBLE_POETRY → html.nc-btp; D5–D7). A poetic <p> (.bt-poem) holds its lines as span.nc-ln blocks
   (audio chapters: inside the converter's own <p>, no text added — narration and anchors unchanged). The left
   column is the gutter (1.55em + .42em gap) as in Verse layout; \q1 / \q2 / \q3 start 0 / 1 / 2 steps (1.25em) in and
   a wrapped line hangs one step deeper than its own start; not justified; a stanza break adds .7em. */
html.nc-bt.nc-btp .bt-poem{
  --bt-column-number-rise:.15;
  text-align:left; hyphens:manual; -webkit-hyphens:manual;
  padding-left:calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) * 1em);
}
html.nc-bt.nc-btp .bt-poem:has(+ .bt-poem){ margin-bottom:calc(var(--bt-poetry-stanza-gap) * 1em); }
html.nc-bt.nc-btp .bt-poem .nc-ln{
  --bt-lvl:0; display:block;
  padding-left:calc((var(--bt-lvl) + 1) * var(--bt-poetry-indent-step) * 1em);
  text-indent:calc(var(--bt-poetry-indent-step) * -1em);
}
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-q2{ --bt-lvl:1; }
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-q3{ --bt-lvl:2; }
/* Row 17 (Bible follow-ups F6, D14): a hung line whose word is too wide for it (js/bible-hung-hyphens.js marks it)
   breaks the word with a hyphen instead of running past the edge. Where the browser has no hyphenation dictionary
   (Linux Chrome; the pop-up's reading-page size made Psalm 119's lines too wide there, nightly 2026-10-24) the word
   still breaks (overflow-wrap) rather than running out of the card; a dictionary's hyphen comes first. */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-hy{ hyphens:auto; -webkit-hyphens:auto; overflow-wrap:break-word; }
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-qc{ text-align:center; padding-left:0; text-indent:0; }
/* D7: \qr (Selah, "For the mouth of the LORD has spoken") right, italic, muted. */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-qr{ text-align:right; padding-left:0; text-indent:0; font-style:italic; color:var(--bt-muted); }
/* A prose stretch inside a poetic paragraph (a verse that turns into song: Exodus 15:1) reads as prose. */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-p{
  text-align:justify; hyphens:auto; -webkit-hyphens:auto; padding-left:0; text-indent:0;
  margin-left:calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) * -1em);
}
/* D7: \qa (ALEPH, MEM…) .78em caps, tracked, centred, muted; the KJV's Hebrew letter is drawn before its name. */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-qa{
  font-family:var(--font-sans); font-size:calc(var(--bt-acrostic-size) * 1em); font-weight:600; line-height:1.4;
  text-transform:uppercase; letter-spacing:calc(var(--bt-acrostic-tracking) * 1em); color:var(--bt-muted);
  text-align:center; padding-left:0; text-indent:0; margin:1.4em 0 .5em;
  margin-left:calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) / var(--bt-acrostic-size) * -1em);
}
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-qa:first-child{ margin-top:0; }
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-qa[data-he]::before{ content:attr(data-he) "\00a0"; }
/* D7: the psalm title (\d) italic .95em, above the first line, no verse number. Audio chapters: its own spoken <p>;
   text chapters + the pop-up: the verse's first piece (its number shows on the first poetic line). */
html.nc-bt.nc-btp .bible-content .bible-paragraph.bt-psalm-title{
  font-size:calc(var(--bt-text) * var(--bt-psalm-title-size)) !important; font-style:italic; text-align:left;
  hyphens:manual; -webkit-hyphens:manual; margin-bottom:.4em;
  padding-left:calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap)) / var(--bt-psalm-title-size) * 1em);
}
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-d{
  font-size:calc(var(--bt-psalm-title-size) * 1em); font-style:italic; padding-left:0; text-indent:0; margin-bottom:.4em;
}
/* D6: a line that starts a verse has its number in the column (1.55em, right-aligned, .42em before the text), near
   the line's baseline as in Verse layout; the chapter number sits there on the chapter's first line (D3). The number
   is an inline-block pulled back over the paragraph's padding and the line's own indent, so the text starts where it
   would anyway. A number inside a line stays as D1 draws it. */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-vs > sup:first-of-type,
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-vs > .bt-vnum{
  display:inline-block; height:auto; text-indent:0; text-align:right; white-space:nowrap; direction:ltr;
  font-weight:var(--bt-verse-number-weight);
  width:calc(var(--bt-poetry-gutter) / var(--bt-verse-number-size) * 1em);
  margin:0 calc((var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) / var(--bt-verse-number-size) * 1em) 0
    calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) / var(--bt-verse-number-size) * -1em);
  position:relative; top:calc(var(--bt-column-number-rise) / var(--bt-verse-number-size) * -1em);
}
html.nc-bt.nc-btp .bt-poem .bt-vnum{
  font-family:var(--bt-number-font); font-size:calc(var(--bt-verse-number-size) * 1em); line-height:0; color:var(--bt-muted);
  font-style:normal; font-variant-numeric:lining-nums proportional-nums;
}
html.nc-bt.nc-btp .bt-poem .bt-vnum::before{ content:attr(data-n); }
/* rtl: a two-digit number at 1.75em is wider than the 1.55em column, so it grows to the left and keeps the .42em gap
   (ltr overflowed rightwards onto the first word: "23The", P8). */
html.nc-bt.nc-btp .bt-poem .nc-ln.bt-vs > .bt-chapnum:not(.bt-chapnum--wide){
  display:inline-block; text-indent:0; text-align:right; white-space:nowrap; direction:rtl;
  width:calc(var(--bt-poetry-gutter) * 1em);
  margin:0 calc((var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) * 1em) 0
    calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) * -1em);
}
/* The number of a verse led by its psalm title / acrostic letter stays first in the DOM (the anchor text is
   unchanged) and isn't drawn there; .bt-vnum (or the chapter number) draws it on the first poetic line. */
html.nc-bt.nc-btp .bible-content .bt-vn-moved{ display:none !important; }
/* Verse 1’s own number stays hidden behind the chapter number (D3), in the column too. */
html.nc-bt.nc-btp .bt-poem .bt-chapnum + sup, html.nc-bt.nc-btp .bt-poem .bt-chapnum + .verse-num{ display:none !important; }
/* Verse layout (D10) with poetry: the lines already start each verse, so the poem keeps the rules above (no D10
   block numbers inside it); a verse's first line gets the Verse layout's gap. */
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .bible-verse{ margin:0; }
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem sup,
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .bible-verse .verse-num{
  display:inline; height:auto; width:auto; direction:ltr; text-align:left; white-space:normal; line-height:0;
  position:relative; top:calc(var(--bt-verse-number-raise) / var(--bt-verse-number-size) * -1em);
  margin:0 calc(var(--bt-verse-number-gap-after) / var(--bt-verse-number-size) * 1em) 0 0;
}
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .nc-ln.bt-vs{ margin-top:.35rem; }
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .bible-verse:first-child .nc-ln.bt-vs,
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem > .nc-ln.bt-vs:first-child{ margin-top:0; }
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .nc-ln.bt-vs > sup:first-of-type,
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .nc-ln.bt-vs > .verse-num:first-of-type{
  display:inline-block; white-space:nowrap; text-align:right;
  width:calc(var(--bt-poetry-gutter) / var(--bt-verse-number-size) * 1em);
  margin:0 calc((var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) / var(--bt-verse-number-size) * 1em) 0
    calc((var(--bt-poetry-gutter) + var(--bt-poetry-gutter-gap) + var(--bt-lvl) * var(--bt-poetry-indent-step)) / var(--bt-verse-number-size) * -1em);
  top:calc(var(--bt-column-number-rise) / var(--bt-verse-number-size) * -1em);
}
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .nc-ln.bt-vs > .bt-chapnum:not(.bt-chapnum--wide){
  height:auto; direction:rtl; line-height:inherit;
}
html.nc-bt.nc-btp.nc-verse-line .bible-content .bt-poem .nc-ln.bt-vs > .bt-chapnum:not(.bt-chapnum--wide)::before{ line-height:.8; }
/* The pop-up (D11): the same lines in its own size; verse numbers only (no chapter number). */
html.nc-bt.nc-btp .verse-popup-body .bt-poem{ margin-bottom:.75rem; }
