:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6d675e;
  --faint: #a39d93;
  --line: #e7e2d9;
  --accent: #8a4b14;
  --accent-soft: #f4e9dc;
  --hit: #fff4d6;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 16px rgba(40, 30, 10, .05);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --surface: #1f1e1b; --text: #ece8e1; --muted: #a8a196; --faint: #6f6a62;
    --line: #34322d; --accent: #e0a564; --accent-soft: #3a2c1d; --hit: #3a3220;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--text); text-decoration: none; }
.search { flex: 1 1 420px; display: flex; min-width: 0; }
.search input {
  flex: 1; min-width: 0; padding: 11px 14px; font-size: 15px; border: 1px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--surface); color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); }
.search button {
  padding: 0 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--bg);
  border-radius: 0 10px 10px 0; font-weight: 600;
}
.controls { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toggle { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }

main { max-width: 820px; margin: 0 auto; padding: 24px 16px 80px; }
.intro { text-align: center; padding: 48px 0 16px; }
.intro h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; margin: 0 0 8px; }
.intro p { color: var(--muted); margin: 0 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips button {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px;
  font-size: 13px; color: var(--muted);
}
.chips button:hover { border-color: var(--accent); color: var(--accent); }

.sfilter { display: grid; gap: 14px; margin: 4px 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sfilter .fgroup { display: grid; gap: 7px; }
.sfilter .fgroup + .fgroup { padding-top: 14px; border-top: 1px dashed var(--line); }
.sfilter .flabel { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.sfilter .frow { justify-content: flex-start; flex-wrap: wrap; gap: 8px 8px; }
.sfilter .frow button { padding: 5px 12px; font-size: 13px; }
.sfilter .frow button .n { color: var(--faint); font-weight: 400; }
.sfilter button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.meta { color: var(--faint); font-size: 12px; margin: 4px 2px 12px; min-height: 16px; }
.answer {
  background: var(--accent-soft); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
  font-family: var(--serif); font-size: 17px; line-height: 1.55;
}
.answer .label { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.answer a { color: var(--accent); }
.answer.loading { color: var(--muted); font-style: italic; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ref { font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; font-size: 15px; }
.ref:hover { text-decoration: underline; }
a.ref, a.link { text-decoration: none; }
.xref a.sref { color: var(--accent); font-weight: 600; text-decoration: none; }
.heading { color: var(--muted); font-size: 13px; }
.text { font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.text .v { }
.text .v.ctx { color: var(--muted); }
.text sup { font-family: var(--sans); font-size: 10px; color: var(--faint); margin-right: 2px; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--faint); align-items: center; }
.card-foot .link, .card-foot a.link { white-space: nowrap; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; }
.link:hover { color: var(--accent); }
.why { margin-left: auto; }
.xrefs { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }
.xref { font-size: 14px; line-height: 1.45; }
.xref b { color: var(--accent); font-weight: 600; cursor: pointer; }
.xref .xfrom { font-size: 11px; color: var(--faint); margin-right: 2px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.skeleton { height: 96px; border-radius: 12px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--surface), var(--line), var(--surface)); background-size: 200% 100%;
  animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.reader {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 20;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
}
.reader-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.reader-head h2 { flex: 1; margin: 0; font-family: var(--serif); font-size: 20px; text-align: center; }
.reader-head button { border: 0; background: none; font-size: 20px; padding: 4px 10px; color: var(--muted); }
.reader-body { overflow: auto; padding: 20px 24px 60px; font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.reader-body .v.mark { background: var(--hit); border-radius: 3px; }
.reader-body h3 { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 18px 0 4px; }

.smeta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card.sermon .ref { font-family: var(--serif); font-size: 19px; text-align: left; }
.keyref { color: var(--accent); }
.excerpt { font-size: 16.5px; color: var(--text); }
.reader.sermon-mode #prev, .reader.sermon-mode #next { visibility: hidden; }
.reader.sermon-mode .reader-head h2 { font-size: 18px; }
.reader-body p { margin: 0 0 14px; font-size: 17px; }
.reader-body p.mark { background: var(--hit); border-radius: 4px; box-shadow: 0 0 0 6px var(--hit); }
.reader-body .key { font-style: italic; }
.reader-body .source { font-family: var(--sans); font-size: 12px; color: var(--faint); margin-top: 28px; }
.reader-body .source a { color: var(--muted); }

/* account menu (shared look) */
.account { font-size: 14px; }
.signin { color: var(--accent); font-weight: 600; text-decoration: none; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; z-index: 30; }
.menu-body a, .menu-body button { text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; border: 0; background: none; font-size: 14px; }
.menu-body a:hover, .menu-body button:hover { background: var(--accent-soft); }
.menu-email { padding: 6px 10px 8px; color: var(--faint); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }


@media (max-width: 640px) {
  .top { padding: 10px 16px; gap: 10px; }
  .search { flex-basis: 100%; order: 3; }
  .intro h1 { font-size: 26px; }
  .text { font-size: 17px; }
}

/* ---- word study */
.words { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 14px; }
.wref { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.wrow { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: grid; justify-items: center; gap: 1px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); min-width: 44px; }
.wchip:hover { border-color: var(--accent); background: var(--accent-soft); }
.wchip .we { font-size: 13px; color: var(--text); font-weight: 500; }
.wchip .wo { font-size: 17px; line-height: 1.3; color: var(--accent); }
.wchip.heb .wo, .lemma.heb { font-family: "Noto Serif Hebrew", "SBL Hebrew", serif; }
.wchip.grk .wo, .lemma.grk { font-family: "Noto Serif", "SBL Greek", Georgia, serif; }
.wchip .wt { font-size: 11px; color: var(--faint); font-style: italic; }
.wchip.untr { opacity: .55; min-width: 0; padding: 6px 6px; }
.wchip.untr .we { color: var(--faint); }
.wnote { font-size: 11.5px; color: var(--faint); }
.wordpanel { z-index: 21; }
.word-body { font-family: var(--sans); font-size: 15px; line-height: 1.55; }
.lemma { font-size: 40px; line-height: 1.2; color: var(--accent); }
.lmeta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.lgloss { font-family: var(--serif); font-size: 22px; margin-bottom: 10px; }
.lstats { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.lstats .tr { display: inline-block; background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; margin: 2px 2px 0 0; color: var(--text); font-size: 13px; }
.lstats .tr i { color: var(--faint); font-style: normal; font-size: 11px; }
.ldef { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; font-size: 14px; }
.ldef summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.ldef div { margin-top: 6px; max-height: 360px; overflow: auto; }
.word-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 16px 0 8px; }
.wv { font-family: var(--serif); font-size: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wv b { color: var(--accent); cursor: pointer; font-family: var(--sans); font-size: 13px; margin-right: 4px; }
.wv mark { background: var(--hit); border-radius: 3px; padding: 0 2px; color: inherit; }
.wmore { padding: 12px 0; }

/* word study inside the chapter reader */
.reader-body sup.vn { cursor: pointer; padding: 0 3px; border-radius: 4px; color: var(--accent); }
.reader-body sup.vn:hover, .reader-body sup.vn.open { background: var(--accent-soft); }
.rwords { font-family: var(--sans); margin: 8px 0 12px; padding: 10px 0 4px; }
.rhint { font-family: var(--sans); font-size: 12px; color: var(--faint); margin-bottom: 10px; }

/* ---- topics & dictionary */
.topicbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  margin-bottom: 14px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.trow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; line-height: 1.45; }
.trow + .trow { border-top: 1px solid var(--line); padding-top: 8px; }
.tkind { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.trow b { font-family: var(--serif); font-size: 16px; }
.texc { color: var(--muted); font-size: 13.5px; flex-basis: 100%; }
.tsrc { color: var(--accent) !important; font-size: 13px !important; }
.ttabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ttabs button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.ttabs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.ttabs button i { font-style: normal; color: var(--faint); font-size: 11px; }
.tsource { font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.tbody p { margin: 0 0 8px; font-family: var(--serif); font-size: 16px; line-height: 1.55; }
.tbody p.l1 { font-weight: 600; margin-top: 10px; }
.tbody p.l2 { padding-left: 12px; }
.tbody p.l3 { padding-left: 26px; font-size: 15px; }
.tbody a.sref, .tbody a.tref { color: var(--accent); cursor: pointer; text-decoration: none; font-family: var(--sans); font-size: 13.5px; }
.tbody a.sref:hover, .tbody a.tref:hover { text-decoration: underline; }

.helpbanner { display: block; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.helpbanner b { color: var(--accent); }
.helpbanner:hover { border-color: var(--accent); }
.helpcard { display: flex; align-items: center; gap: 18px; max-width: 640px; margin: 0 auto 26px; padding: 18px 20px;
  text-align: left; text-decoration: none; color: var(--text); background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-left: 5px solid var(--accent);
  border-radius: 14px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.helpcard:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(40, 30, 10, .12); }
.hc-text { display: grid; gap: 4px; flex: 1; }
.hc-title { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.hc-sub { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.hc-btn { flex-shrink: 0; background: var(--accent); color: var(--bg); font-weight: 600; font-size: 15px; padding: 11px 16px;
  border-radius: 10px; white-space: nowrap; }
.navhelp { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 999px; }
.navhelp:hover { background: var(--accent-soft); }
@media (max-width: 640px) {
  .helpcard { flex-direction: column; align-items: stretch; text-align: left; }
  .hc-btn { text-align: center; }
}
.aibadge { display: inline-block; vertical-align: 3px; margin-left: 6px; font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 2px 8px; }

/* preaching heat dots in the reader */
.heat { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; margin: 0 3px 1px 0;
  vertical-align: middle; cursor: pointer; background: var(--accent); }
.heat.h1 { opacity: .25; } .heat.h2 { opacity: .45; } .heat.h3 { opacity: .7; } .heat.h4 { opacity: 1; box-shadow: 0 0 0 2px var(--accent-soft); }
.rhint .heat { cursor: default; margin-left: 6px; }
.rhint a { color: var(--accent); text-decoration: none; font-weight: 600; }
.rheat { font-family: var(--sans); margin: 8px 0 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 6px; }
.rh { font-size: 14px; line-height: 1.4; } .rh a { color: var(--accent); text-decoration: none; font-weight: 600; } .rh span { color: var(--faint); font-size: 12.5px; margin-left: 4px; }
.rhfoot { font-size: 13px; padding-top: 4px; } .rhfoot a { color: var(--muted); text-decoration: none; } .rhfoot a:hover { color: var(--accent); }
.pbadge { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; font-size: 12px; color: var(--accent);
  background: var(--accent-soft); border: 0; border-radius: 999px; padding: 2px 10px 2px 6px; cursor: pointer; white-space: nowrap; }
.pbadge:hover { filter: brightness(.97); text-decoration: underline; }
.pbadge .heat { cursor: inherit; }
