:root {
  --ink: #14110e;
  /* Original charcoal header (restore if needed): #1a1612 / #241f19 */
  --header: #4a151c;
  --header-2: #3a1016;
  --gold: #c4a35a;
  --gold-bright: #e0c07a;
  --gold-dim: #8a7340;
  --parchment: #f4ead6;
  --parchment-2: #efe3cc;
  --parchment-edge: #e2d3b4;
  --text: #2c2418;
  --text-soft: #5a4e3e;
  --verse-num: #8a5a28;
  --link: #7a4e1d;
  --link-hover: #a56a28;
  --danger: #8b2e2e;
  --ok: #3d6b3d;
  --muted: #7a6d5c;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", Calibri, Arial, sans-serif;
  --display: Cinzel, "Palatino Linotype", Palatino, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 50% -10%, #2a241c 0%, var(--ink) 55%);
  color: var(--parchment);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }

.site-header {
  background: linear-gradient(180deg, var(--header) 0%, var(--header-2) 100%);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.35rem 1.1rem 0;
}
.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.9rem;
  color: #f3ead7;
  padding: 0.1rem 0 0.4rem;
}
.account-bar strong { color: var(--gold-bright); font-weight: 700; }
.account-bar a { color: var(--gold); }
.account-bar a:hover { color: var(--gold-bright); }
.account-bar .sep { color: var(--gold-dim); }
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold-bright);
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--gold-bright); }
.brand-mark {
  width: 70px;
  height: 86px;
  flex: 0 0 70px;
  object-fit: contain;
  background: transparent;
}
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1;
}
.brand-text strong {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 3.3rem;
  line-height: 0.92;
}
.brand-text span {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (max-width: 980px) {
  .brand-text strong { font-size: 2.5rem; }
}
@media (max-width: 700px) {
  .brand-text strong { font-size: 1.9rem; }
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-main a, .nav-main .nav-link {
  color: #f3ead7;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav-main a:hover, .nav-main a.active {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom-color: var(--gold);
  background: rgba(196,163,90,.08);
}

.lookup-bar {
  margin-top: 0.45rem;
  padding: 0.55rem 0 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.lookup-bar input[type=text], .lookup-bar select, .field input, .field select, .field textarea {
  background: #2c261f;
  color: var(--parchment);
  border: 1px solid #5a4d3a;
  border-radius: 4px;
  padding: 0.48rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.lookup-bar input[type=text] { min-width: 240px; flex: 1; }
.lookup-bar select { min-width: 9rem; }
.lookup-bar #ddlVersion { min-width: 6.75rem; max-width: 8.5rem; flex: 0 0 auto; }
.lookup-bar #ddlTestament { min-width: 11.5rem; flex: 1 1 11.5rem; }
.lookup-bar #ddlBook { min-width: 11.5rem; flex: 1 1 11.5rem; }
.lookup-bar #ddlChapter,
.lookup-bar #ddlVerse { min-width: 7.5rem; max-width: 9.5rem; flex: 0 0 auto; }
.lookup-bar select:disabled { opacity: 0.55; cursor: not-allowed; }
.btn, input[type=submit], button.btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #c9ab66 0%, #9a7a38 100%);
  color: #1a1612;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 0.48rem 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.btn:hover, input[type=submit]:hover { filter: brightness(1.08); }
.btn.ghost {
  background: transparent;
  color: var(--gold-bright);
}
.btn-booklist { white-space: nowrap; }

.site-main {
  max-width: 1180px;
  margin: 1.25rem auto 2rem;
  padding: 0 1.1rem;
}
.panel {
  background: var(--parchment);
  color: var(--text);
  border: 1px solid var(--parchment-edge);
  box-shadow: var(--shadow);
  border-radius: 6px;
  padding: 1.35rem 1.5rem 1.6rem;
}
.panel h1, .panel h2, .panel h3 {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
}
.panel h1 { font-size: 1.65rem; font-weight: 600; }
.panel p.lead { color: var(--text-soft); margin-top: 0; }
.panel a { color: var(--link); }
.panel a:hover { color: var(--link-hover); }

.home-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 1.1rem;
}
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .lookup-bar input[type=text],
  .lookup-bar select { min-width: 0; width: 100%; max-width: none; flex: 1 1 100%; }
  .header-top { flex-direction: column; align-items: stretch; }
  .nav-main { justify-content: flex-start; }
}

.votd {
  border-left: 3px solid var(--gold);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1rem 0;
}
.votd .ref { font-weight: 700; color: var(--verse-num); }
.votd .text {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 0.35rem 0 0.5rem;
}

.popular-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.popular-list a {
  display: inline-block;
  background: #efe6d2;
  border: 1px solid #d9c9a6;
  color: var(--link);
  padding: 0.28rem 0.6rem;
  border-radius: 99px;
  font-size: 0.86rem;
  text-decoration: none;
}
.popular-list a:hover { background: #e7d7b0; }

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.9rem;
}
.reader-toolbar-bottom {
  margin: 1.25rem 0 0;
  margin-bottom: 0;
}
.reader-toolbar select { min-width: 140px; }
.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.toolbar-field label,
.toolbar-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
}
.toolbar-field label {
  color: #000;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.88rem;
}
.chapter-nav { display: flex; gap: 0.4rem; margin-left: auto; align-self: flex-end; }

.scripture {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text);
}
.scripture[dir=rtl] { text-align: right; }
.chapter-kicker {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.15rem;
}
.chapter-title {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.verse { display: inline; }
.verse .vn {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--verse-num);
  padding-right: 0.28rem;
  vertical-align: super;
  line-height: 1;
}
.verse .vn a { color: inherit; text-decoration: none; }
.verse.highlight {
  background: #f3d99a;
  box-shadow: 0 0 0 3px #f3d99a;
  border-radius: 2px;
}
.verse-heading {
  display: block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.1rem 0 0.35rem;
}
.book-intro {
  background: #efe6d2;
  border: 1px solid #d9c9a6;
  padding: 0.85rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}
.book-intro h3 { margin: 0 0 0.35rem; font-size: 1rem; font-family: var(--sans); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1rem; font-size: 0.88rem; }
@media (max-width: 640px) { .meta-grid { grid-template-columns: 1fr; } }

.notice, .error, .ok {
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
  margin: 0.6rem 0;
}
.notice { background: #efe6d2; border: 1px solid #d9c9a6; color: var(--text); }
.error { background: #f6e0d8; border: 1px solid #d9a090; color: var(--danger); }
.ok { background: #e1eedd; border: 1px solid #b7d0b0; color: var(--ok); }

.search-hit { padding: 0.7rem 0; border-bottom: 1px solid #e2d3b4; }
.search-hit .ref { font-weight: 700; }
.search-hit p { margin: 0.25rem 0 0; font-family: var(--serif); }
mark,
.search-hit mark {
  background: #f4d36a;
  color: #1a1612;
  padding: 0 0.14em;
  border-radius: 2px;
  font-weight: 700;
  box-shadow: inset 0 -0.08em 0 rgba(122, 90, 20, 0.35);
}

.login-card { max-width: 420px; margin: 2rem auto; }
.login-links { margin: 0.9rem 0 0; font-size: 0.92rem; }
.field { margin: 0.75rem 0; }
.field label { display: block; font-size: 0.86rem; margin-bottom: 0.25rem; color: var(--text-soft); }
.field input { width: 100%; background: #fff; color: var(--text); border: 1px solid #cbb896; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid #e2d3b4; vertical-align: top; }
.admin-table th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
}
.badge-yes { background: #dce9d4; color: #2f5a2f; }
.badge-no { background: #f0d5d0; color: #7a2a2a; }
.lang-head td { background: #e9ddc4; font-weight: 700; font-family: var(--display); letter-spacing: 0.05em; }

.book-picker {
  display: none;
  background: #1f1a15;
  border-top: 1px solid #3a3228;
  padding: 0.8rem 0 1rem;
}
.book-picker.open { display: block; }
.book-picker-inner { max-width: 1180px; margin: 0 auto; padding: 0 1.1rem; }
.book-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.book-cols h4 {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-family: var(--display);
  letter-spacing: 0.1em;
  font-size: 0.82rem;
}
.book-grid {
  column-count: 3;
  column-gap: 0.6rem;
}
.book-grid a {
  display: block;
  color: #f3ead7;
  font-size: 0.88rem;
  padding: 0.15rem 0.2rem;
  text-decoration: none;
  border-radius: 3px;
  break-inside: avoid;
}
.book-grid a:hover { background: rgba(196,163,90,.15); color: var(--gold-bright); text-decoration: none; }
@media (max-width: 800px) {
  .book-cols { grid-template-columns: 1fr; }
  .book-grid { column-count: 2; }
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto 1.5rem;
  padding: 0 1.1rem 1.5rem;
  color: #9a8b74;
  font-size: 0.82rem;
}
.site-footer a { color: var(--gold); }

.font-controls { display: flex; gap: 0.25rem; }
.font-controls button {
  background: #2c261f;
  color: var(--gold);
  border: 1px solid #5a4d3a;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
}

.admin-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filter-row { display: flex; gap: 0.5rem; margin: 0 0 0.8rem; flex-wrap: wrap; }
.filter-row input { min-width: 220px; background: #fff; color: var(--text); border: 1px solid #cbb896; border-radius: 4px; padding: 0.4rem 0.6rem; }

.reader-toolbar input[type=text] {
  background: #fff;
  color: var(--text);
  border: 1px solid #cbb896;
  border-radius: 4px;
  padding: 0.48rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  min-width: 180px;
  width: 100%;
}
.gospel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.8rem;
}
@media (max-width: 900px) { .gospel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gospel-grid { grid-template-columns: 1fr; } }
.gospel-card, .study-card {
  display: block;
  background: #efe6d2;
  border: 1px solid #d9c9a6;
  border-radius: 6px;
  padding: 0.9rem 1rem;
  color: var(--text);
  text-decoration: none;
}
.gospel-card:hover { background: #e7d7b0; text-decoration: none; color: var(--text); }
.gospel-card h2 { margin: 0 0 0.3rem; font-size: 1.35rem; }
.gospel-card p, .study-card p { margin: 0.35rem 0 0; color: var(--text-soft); }
.study-card { margin: 0 0 0.9rem; }
.study-card strong { color: var(--verse-num); display: block; margin-bottom: 0.35rem; }
.study-card .study-text { margin: 0.35rem 0 0.5rem; padding-bottom: 0.45rem; }
.read-more {
  display: inline-block;
  margin-top: 0.45rem;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
}
.read-more:hover { color: var(--link-hover); text-decoration: underline; }
.study-section {
  margin: 0 0 1.15rem;
  padding: 0.15rem 0;
}
.study-section h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}
.study-section.edited {
  background: #e7f6e4;
  border: 1px solid #b7d8b0;
  border-radius: 4px;
  padding: 0.7rem 0.9rem 0.85rem;
}
.edit-btn {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--link);
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--sans);
}
.edit-btn:hover { background: #efe6d2; }
.edit-area {
  width: 100%;
  min-height: 7rem;
  background: #fff;
  color: var(--text);
  border: 1px solid #cbb896;
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
}
.edit-area.short { min-height: 3.2rem; }
.edit-actions { margin-top: 0.5rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.edit-hint { font-size: 0.82rem; color: var(--text-soft); margin: 0 0 0.4rem; }
.admin-edit-note {
  background: #e7f6e4;
  border: 1px solid #b7d8b0;
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: 4px;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.chapter-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.8rem 0 0; }
.chapter-pills a {
  display: inline-block;
  background: #efe6d2;
  border: 1px solid #d9c9a6;
  color: var(--link);
  padding: 0.35rem 0.7rem;
  border-radius: 99px;
  text-decoration: none;
}
.chapter-pills a:hover { background: #e7d7b0; }
.interpretation, .context { font-size: 1.02rem; line-height: 1.65; margin: 0 0 1rem; }
.interpretation p, .context p { margin: 0 0 0.9rem; }
.study-text { margin: 0 0 1.1rem; padding-bottom: 0.8rem; border-bottom: 1px solid #e2d3b4; }
.keywords { color: var(--muted); font-size: 0.88rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.2rem;
}
@media (max-width: 800px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: #efe6d2;
  border: 1px solid #d9c9a6;
  border-radius: 6px;
  padding: 0.85rem 0.95rem;
}
.feature-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; font-family: var(--sans); }
.feature-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.section-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 1.2rem; }
@media (max-width: 640px) {
  .section-actions .btn { width: 100%; text-align: center; }
  .panel > p .btn, .panel > p .btn.ghost { display: block; text-align: center; }
}
.section-divider { border: 0; border-top: 1px solid #e2d3b4; margin: 1.4rem 0 1.1rem; }
.include-list { margin: 0.4rem 0 1.1rem; padding-left: 1.1rem; color: var(--text); }
.include-list li { margin: 0.35rem 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: 0.75rem; margin: 0.4rem 0 1.3rem; }
.stat-card { background: #fffdf8; border: 1px solid var(--parchment-edge); border-radius: 4px; padding: 0.75rem 0.85rem; min-width: 0; }
.stat-card span { display: block; color: var(--text-soft); font-size: 0.92rem; }
.stat-card strong { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.1; margin-top: 0.2rem; color: var(--ink); }
.data-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fffdf8; }
table.data th, table.data td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--parchment-edge); vertical-align: top; }
table.data th { font-variant: small-caps; letter-spacing: 0.04em; font-weight: 600; color: var(--ink); }
