/* Ancient (Early Semitic / Paleo-Hebrew) script — user-supplied font.
   Replace assets/fonts/SemEarHeb-3.ttf with the real font to enable it. */
@font-face {
  font-family: "Ancient Hebrew";
  src: url("../assets/fonts/ancient-hebrew.ttf") format("truetype");
  font-display: swap;
}
.ancient-heb { font-family: "Ancient Hebrew", var(--serif); }

/* ============================================================================
   Hebrew Explorer — base.css
   Design tokens + chrome (app bar, picker, nav, popups).
   Palette is rooted in the subject: tekhelet (the commanded biblical blue,
   H8504) for structure, a gilt copper for the Strong's research affordance,
   on a clean warm reading ground. Type pairs Frank Ruhl Libre — a Hebrew-
   first serif — with Heebo for UI, both Hebrew-capable for the road ahead.
   Mobile-first; desktop is a centered measure of the same column.
============================================================================ */
:root {
  --tekhelet: #1f3d6e;        /* primary structural blue */
  --tekhelet-bright: #2f5aa0; /* links, active states */
  --gilt: #a9742f;            /* Strong's / tagged-word accent */
  --gilt-soft: #c9a25f;
  --paper: #fcfbf8;           /* reading ground */
  --paper-sunk: #f3f0e9;      /* sheets, sunken surfaces */
  --ink: #1b1b1a;             /* primary text */
  --ink-soft: #5c5852;        /* secondary text */
  --rule: #e6e1d6;            /* hairlines */
  --bar-h: 52px;
  --nav-h: 56px;
  --measure: 38rem;           /* comfortable reading width */
  --serif: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --sans: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 6px 28px rgba(31, 61, 110, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

#app { min-height: 100%; }

/* ---- App bar ------------------------------------------------------------- */
/* ---- Sticky header (app bar + search bar) -------------------------------- */
.topwrap {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.appbar {
  height: var(--bar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 12px;
}
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; color: var(--ink-soft);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--paper-sunk); color: var(--tekhelet); }
.icon-btn svg { display: block; }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 0 12px 9px; }
.toolbar[hidden] { display: none; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px; padding: 7px 13px;
  white-space: nowrap; transition: border-color .15s, background .15s;
}
.tool-btn:hover { border-color: var(--tekhelet-bright); background: var(--paper-sunk); }
.tool-btn .caret { font-size: 10px; }
.toolbar .icon-btn { width: 38px; height: 38px; margin-left: auto; }
.toolbar .ref-btn { max-width: 200px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px; margin-right: auto; }
.brand-mark {
  font-family: var(--serif); font-size: 22px; line-height: 1;
  color: var(--tekhelet); transform: translateY(-1px);
}
.brand-name {
  font-weight: 700; letter-spacing: -0.01em; font-size: 15px; color: var(--ink);
}
@media (max-width: 380px) { .brand-name { display: none; } }

.ref-btn, .trans-btn {
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.ref-btn { color: var(--tekhelet); }
.ref-btn:hover, .trans-btn:hover { border-color: var(--tekhelet-bright); background: var(--paper-sunk); }
.trans-btn { color: var(--ink-soft); min-width: 52px; }

/* ---- Bottom chapter nav -------------------------------------------------- */
.chapnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex; align-items: center;
  background: rgba(252,251,248,0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--rule);
}
.chapnav-btn { flex: 0 0 96px; height: 100%; font-size: 15px; font-weight: 600; color: var(--tekhelet); }
.chapnav-btn:active { background: var(--paper-sunk); }
.chapnav-label { flex: 1; height: 100%; font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ---- Overlay + sheet (picker / translation) ------------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20, 28, 44, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
/* An explicit display rule overrides the [hidden] attribute, so restate it. */
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0));
  box-shadow: var(--shadow);
  animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: .6; } }
@media (min-width: 720px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 16px; max-height: 80vh; }
}
.sheet::before {
  content: ""; display: block; width: 38px; height: 4px; margin: 6px auto 10px;
  background: var(--rule); border-radius: 2px;
}
.sheet-title { font-size: 17px; margin: 6px 2px 14px; letter-spacing: -0.01em; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-back { color: var(--tekhelet); font-weight: 600; font-size: 14px; padding: 6px 0; }

/* Expanding search (swaps in for the toolbar row) */
.gobar { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 12px 9px; }
.gobar[hidden] { display: none; }
.gobar-input {
  flex: 1; min-width: 0; box-sizing: border-box;
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--paper-sunk); border: 1px solid var(--rule);
  border-radius: 11px; padding: 10px 13px; outline: none;
  transition: border-color .15s, background .15s;
}
.gobar-input::placeholder { color: var(--ink-soft); }
.gobar-input:focus { border-color: var(--tekhelet-bright); background: #fff; }
.gobar-close { flex: 0 0 auto; width: 38px; height: 38px; font-size: 22px; color: var(--ink-soft); border-radius: 10px; }
.gobar-close:hover { background: var(--paper-sunk); }
.gobar-drop {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 40;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.gobar-drop[hidden] { display: none; }
.gobar-row {
  text-align: left; padding: 12px 14px; background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.gobar-row:last-child { border-bottom: 0; }
.gobar-row:hover { background: var(--paper-sunk); }
.gr-ref { font-weight: 700; color: var(--tekhelet); font-size: 15px; }

/* Desktop: keep the expanded search phone-sized and right-aligned, not full-width */
@media (min-width: 720px) {
  .gobar { justify-content: flex-end; }
  .gobar-input { flex: 0 1 340px; }
  .gobar-drop { left: auto; right: 12px; width: min(388px, calc(100% - 24px)); }
}

/* Book picker */
.book-group { margin-bottom: 18px; }
.group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gilt); margin: 0 0 8px; font-weight: 700;
}
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.book-cell {
  text-align: left; padding: 10px 12px; border-radius: 10px;
  background: var(--paper-sunk); font-size: 13.5px; font-weight: 600; color: var(--ink);
  line-height: 1.2; transition: background .12s;
}
.book-cell:hover { background: #e9e4d8; }
.book-cell.active { background: var(--tekhelet); color: #fff; }

/* Chapter picker */
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin-top: 6px; }
.chap-cell {
  aspect-ratio: 1; border-radius: 10px; background: var(--paper-sunk);
  font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.chap-cell:hover { background: #e9e4d8; }
.chap-cell.active { background: var(--tekhelet); color: #fff; }

/* Translation list */
.trans-list { display: flex; flex-direction: column; gap: 6px; }
.trans-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--paper-sunk); text-align: left;
}
.trans-row.active { outline: 2px solid var(--tekhelet); background: #fff; }
.trans-main { display: flex; align-items: baseline; gap: 10px; }
.trans-abbr { font-weight: 800; color: var(--tekhelet); min-width: 42px; }
.trans-full { font-size: 14px; color: var(--ink); }
.trans-note { font-size: 11.5px; color: var(--ink-soft); text-align: right; max-width: 45%; }

/* ---- Full-screen lexicon panel ------------------------------------------ */
.lex-panel {
  position: fixed; inset: 0; z-index: 70;
  background: var(--paper);
  display: flex; flex-direction: column;
  animation: fade .14s ease;
}
.lex-bar {
  height: var(--bar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.lex-back { color: var(--tekhelet); font-weight: 700; font-size: 15px; padding: 8px 4px; }
.lex-bar-title { margin: 0 auto; font-weight: 700; font-size: 13px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); }
.lex-close { font-size: 24px; color: var(--ink-soft); line-height: 1; padding: 4px 10px; }
.lex-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lex-body, .lex-recent { max-width: var(--measure); margin: 0 auto; padding: 22px; }
.lex-recent { padding-top: 0; }

.lex-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lex-num { font-family: var(--sans); font-weight: 800; font-size: 22px; color: var(--gilt); }
.lex-lang { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); font-weight: 700; }
.lex-lemma { font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 3rem);
  line-height: 1.25; color: var(--ink); margin: 12px 0 6px; }
.lex-translit { font-size: 17px; color: var(--tekhelet); font-weight: 600; }
.lex-pron { color: var(--ink-soft); font-weight: 400; margin-left: 8px; }
.lex-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gilt); margin: 26px 0 8px; font-weight: 700; }
.lex-def { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; color: var(--ink); margin: 0; }
.lex-loading, .lex-miss { color: var(--ink-soft); padding: 10px 0; }

.lex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lex-chip { font-family: var(--sans); font-weight: 700; font-size: 13px; color: var(--tekhelet);
  background: var(--paper-sunk); padding: 7px 11px; border-radius: 999px; }
.lex-chip:hover { background: #e9e4d8; }

/* ---- Reader status (loading / error) ------------------------------------ */
.reader-status { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22vh 24px; text-align: center; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--rule); border-top-color: var(--tekhelet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { font-weight: 700; color: var(--ink); margin: 0; }
.error-sub { color: var(--ink-soft); margin: 0; font-size: 14px; }

/* Keyboard focus visibility (quality floor) */
:focus-visible { outline: 2px solid var(--tekhelet-bright); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

/* ---- Generic modal (account, tools) ------------------------------------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 28, 44, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: var(--paper); border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0));
  box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 720px) { .modal-scrim { align-items: center; } .modal-card { border-radius: 16px; } }
.modal-close { position: absolute; top: 8px; right: 10px; font-size: 24px; line-height: 1;
  color: var(--ink-soft); padding: 6px 10px; border-radius: 8px; }
.modal-close:hover { background: var(--paper-sunk); }

/* Account panel */
.acct-tabs { display: flex; gap: 6px; margin: 4px 0 18px; }
.acct-tab { flex: 1; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 14px;
  color: var(--ink-soft); background: var(--paper-sunk); }
.acct-tab.active { color: #fff; background: var(--tekhelet); }
.acct-form { display: flex; flex-direction: column; gap: 12px; }
.acct-field { display: flex; flex-direction: column; gap: 5px; }
.acct-field span { font-size: 12px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em; }
.acct-field input {
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--paper-sunk); border: 1px solid var(--rule);
  border-radius: 10px; padding: 11px 13px; outline: none;
}
.acct-field input:focus { border-color: var(--tekhelet-bright); background: #fff; }
.acct-submit { margin-top: 4px; padding: 13px; border-radius: 11px; font-weight: 700; font-size: 15px;
  color: #fff; background: var(--tekhelet); }
.acct-submit:hover { background: #19335c; }
.acct-note { font-size: 13px; color: var(--gilt); margin: 2px 0 0; min-height: 1px; }
.acct-plans { display: flex; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); }
.plan { flex: 1; }
.plan-name { font-weight: 800; color: var(--tekhelet); margin-bottom: 6px; }
.plan-plus .plan-name { color: var(--gilt); }
.plan-soon { font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan li { font-size: 13px; color: var(--ink-soft); padding-left: 16px; position: relative; }
.plan li::before { content: "·"; position: absolute; left: 4px; color: var(--gilt); font-weight: 700; }

/* Tools menu */
.tool-intro { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }
.tool-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--rule); }
.tool-main { display: flex; flex-direction: column; gap: 2px; }
.tool-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.tool-desc { font-size: 12.5px; color: var(--ink-soft); }
.tool-soon { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 8px; }

/* Site navigation menu */
.site-nav { display: flex; flex-direction: column; }
.site-link { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-top: 1px solid var(--rule); font-size: 16px; font-weight: 600;
  color: var(--tekhelet); text-decoration: none; text-align: left; }
.site-link:hover { color: var(--tekhelet-bright); }
.site-link.disabled { color: var(--ink-soft); cursor: default; }
.site-soon { font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 8px; }

/* Tools: active rows clickable, soon rows muted */
.tool-list { display: flex; flex-direction: column; }
button.tool-row { width: 100%; box-sizing: border-box; text-align: left; }
button.tool-row:hover { background: var(--paper-sunk); }
.tool-go { margin-left: auto; font-size: 22px; color: var(--tekhelet); line-height: 1; }
.tool-row.soon { cursor: default; }

/* ---- Interlinear panel --------------------------------------------------- */
.il-panel {
  position: fixed; inset: 0; z-index: 65;
  background: var(--paper); display: flex; flex-direction: column;
  animation: fade .14s ease;
}
.il-bar {
  flex: 0 0 auto; min-height: var(--bar-h);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--rule); background: var(--paper);
}
.il-back { color: var(--tekhelet); font-weight: 700; font-size: 15px; padding: 6px 2px; }
.il-title { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); }
.il-toggle { margin-left: auto; display: inline-flex; background: var(--paper-sunk);
  border-radius: 999px; padding: 3px; }
.il-tog { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 6px 12px; border-radius: 999px; }
.il-tog.active { background: var(--tekhelet); color: #fff; }
.il-langbtn { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 6px 12px; border-radius: 999px; }
.il-langbtn.active { background: var(--tekhelet); color: #fff; }

.il-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.il-body { max-width: var(--measure); margin: 0 auto; padding: 18px 20px 8px; }

.il-verse { padding: 4px 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.il-en { font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; color: var(--ink); margin: 0 0 12px; }
.il-or { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: flex-start; }
.il-unit { display: inline-flex; flex-direction: column; align-items: center; }
.il-word { font-family: var(--serif); font-size: 1.55rem; line-height: 1.5; color: var(--ink); }
.il-num { font-family: var(--sans); font-size: 0.7rem; font-weight: 700; margin-top: 1px; letter-spacing: .01em; }
.il-num.click { color: var(--gilt); cursor: pointer; }
.il-num.click:hover { color: #87571f; text-decoration: underline; }
.il-num.plain { color: var(--ink-soft); }

.il-pager { max-width: var(--measure); margin: 0 auto; display: flex; gap: 10px; padding: 8px 20px 40px; }
.il-prev, .il-next { flex: 1; padding: 13px; border-radius: 11px; font-weight: 700; font-size: 15px;
  color: var(--tekhelet); background: var(--paper-sunk); }
.il-prev:hover, .il-next:hover { background: #e9e4d8; }
.il-loading, .il-miss { color: var(--ink-soft); padding: 16px 0; }

/* Niqqud toggle — toolbar pill (reader) */
.heb-btn { font-family: var(--serif); font-size: 18px; line-height: 1; min-width: 38px;
  padding: 7px 9px; border-radius: 9px; color: var(--tekhelet); background: var(--paper-sunk); font-weight: 500; }
.heb-btn.active { background: var(--tekhelet); color: #fff; }
.heb-btn[hidden] { display: none; }

/* Niqqud toggle — interlinear header */
.il-controls { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.il-controls .il-toggle { margin-left: 0; }
.il-heb { font-family: var(--serif); font-size: 17px; line-height: 1; min-width: 34px;
  padding: 6px 9px; border-radius: 999px; color: var(--tekhelet); background: var(--paper-sunk); }
.il-heb.active { background: var(--tekhelet); color: #fff; }
.il-heb[hidden] { display: none; }

/* Hebrew display sheet (script + niqqud) */
.heb-display .hd-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0; }
.hd-label { font-weight: 700; color: var(--ink); font-size: 15px; }
.seg { display: inline-flex; background: var(--paper-sunk); border-radius: 999px; padding: 3px; }
.seg button { font-size: 14px; font-weight: 700; color: var(--ink-soft); padding: 8px 16px; border-radius: 999px; transition: background .15s, color .15s; }
.seg button.active { background: var(--tekhelet); color: #fff; }
.seg.muted { opacity: .5; }
.seg button:disabled { cursor: default; }
.seg button.ancient-heb { font-size: 17px; }
.hd-note { color: var(--ink-soft); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }

/* Hebrew display sheet must sit above the interlinear / lexicon panels */
.heb-scrim { z-index: 80; }

/* Ancient font must beat .il-word / .oword own font-family (same specificity,
   defined later). Target the word elements directly so it always wins. */
.il-word.ancient-heb, .oword.ancient-heb { font-family: "Ancient Hebrew", var(--serif); }

/* Brown-Driver-Briggs section in the lexicon panel */
.lex-bdb { margin-top: 22px; }
.bdb-entry { font-size: 0.96rem; line-height: 1.72; color: var(--ink); }
.bdb-entry b { font-weight: 700; color: var(--ink); }
.bdb-entry .bh { font-family: var(--serif); font-size: 1.1em; }
.bdb-entry .bpos, .bdb-entry .basp { font-style: italic; color: var(--ink-soft); }
.bdb-entry .bstem { color: var(--tekhelet); }
.bdb-entry .bref { color: var(--ink-soft); font-size: 0.86em; }
.bdb-entry .bsense { margin: 7px 0 7px 16px; }
.bdb-entry .bn { font-weight: 800; color: var(--gilt); margin-right: 3px; }

/* Multi-lexicon panel: sections, chooser button + sheet */
.lex-section { margin-top: 22px; }
.lex-prefs { color: var(--tekhelet); padding: 6px; border-radius: 8px; display: inline-flex; }
.lex-prefs:hover { background: var(--paper-sunk); }
.lex-prefs-scrim { z-index: 85; }
.lxp-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.lxp-row { display: flex; align-items: center; gap: 12px; padding: 8px;
  background: var(--paper-sunk); border-radius: 12px; }
.lxp-on { min-width: 52px; padding: 7px 0; border-radius: 999px; font-weight: 700; font-size: 13px;
  color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule); }
.lxp-on.active { color: #fff; background: var(--tekhelet); border-color: var(--tekhelet); }
.lxp-name { flex: 1; font-weight: 700; color: var(--ink); font-size: 15px; }
.lxp-move { display: inline-flex; gap: 4px; }
.lxp-up, .lxp-down { width: 36px; height: 36px; border-radius: 9px; font-size: 17px; font-weight: 700;
  color: var(--tekhelet); background: var(--paper); border: 1px solid var(--rule); }
.lxp-up:disabled, .lxp-down:disabled { color: var(--rule); cursor: default; }
.lex-bar-title { flex: 1; }

/* ---- Search: toolbar action rows + full-screen panel --------------------- */
.gobar-row.gobar-search { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gobar-search .gr-ref { color: var(--tekhelet-bright); font-weight: 600; }
.gobar-search .gr-go { flex: 0 0 auto; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); }

.srch-panel .srch-controls { flex: 0 0 auto; padding: 12px 16px; border-bottom: 1px solid var(--rule);
  background: var(--paper); }
.srch-input { width: 100%; box-sizing: border-box; height: 42px; padding: 0 14px; font: inherit;
  font-size: 16px; color: var(--ink); background: var(--paper-sunk); border: 1.5px solid var(--rule);
  border-radius: 11px; }
.srch-input::placeholder { color: var(--ink-soft); }
.srch-input:focus { border-color: var(--tekhelet-bright); background: #fff; outline: none; }

.srch-status { max-width: var(--measure); margin: 0 auto; padding: 16px 18px 4px; }
.srch-results { max-width: var(--measure); margin: 0 auto; padding: 4px 10px 8px; }
.srch-more { max-width: var(--measure); margin: 0 auto; padding: 4px 18px 28px; }

.srch-hint, .srch-working, .srch-none { color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.srch-hint b { color: var(--gilt); font-weight: 700; }
.srch-count { color: var(--ink); font-size: 13px; letter-spacing: .02em; }
.srch-count b { color: var(--tekhelet-bright); }

.srch-result { display: block; width: 100%; box-sizing: border-box; text-align: left;
  padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.srch-result:hover { background: var(--paper-sunk); }
.srch-result + .srch-result { border-top: 1px solid var(--rule); }
.srch-ref { display: block; font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .03em; color: var(--tekhelet-bright); margin-bottom: 3px; }
.srch-snip { display: block; font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink); }
.srch-snip mark { background: rgba(169,116,47,.20); color: inherit; border-radius: 3px; padding: 0 1px; }

.srch-gloss { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--paper-sunk); border-radius: 12px; }
.srch-gnum { font-family: var(--sans); font-weight: 800; color: var(--gilt); }
.srch-glang { font-size: 12px; color: var(--ink-soft); }
.srch-glemma { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.srch-gx { font-style: italic; color: var(--ink-soft); }
.srch-gdef { flex-basis: 100%; font-size: 14px; line-height: 1.45; color: var(--ink); }

.srch-morebtn { width: 100%; padding: 11px; font: inherit; font-weight: 600; color: var(--tekhelet-bright);
  background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 11px; cursor: pointer; }
.srch-morebtn:hover { background: #fff; border-color: var(--tekhelet-bright); }

/* ---- Hebrew search results (RTL snippet) --------------------------------- */
.srch-result.heb .srch-snip { direction: rtl; text-align: right;
  font-family: var(--serif); font-size: 19px; line-height: 1.75; }
.srch-q-heb { font-family: var(--serif); font-weight: 700; }

/* ---- Lexicon: "view all occurrences" link ------------------------------- */
.lex-occ:empty { display: none; }
.lex-occ { margin: 12px 0 2px; }
.lex-occ-btn { display: flex; align-items: baseline; gap: 10px; width: 100%;
  border: 1px solid var(--rule); background: var(--paper); border-radius: 12px;
  padding: 11px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background .12s, border-color .12s; }
.lex-occ-btn:hover { background: var(--paper-sunk); border-color: var(--tekhelet); }
.lex-occ-n { font-family: var(--sans); font-weight: 800; font-size: 18px; color: var(--tekhelet); }
.lex-occ-lbl { flex: 1; color: var(--ink-soft); font-size: 14px; }
.lex-occ-go { color: var(--tekhelet); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---- Ancient Hebrew Lexicon (Benner) entries ---------------------------- */
.ahlb-entry { font-size: 0.96rem; line-height: 1.72; color: var(--ink); }
.ahlb-entry b, .ahlb-entry strong { font-weight: 700; }
.ahlb-entry .he { font-family: var(--serif); font-size: 1.12em; }
.ahlb-entry .paleo { font-family: "Ancient Hebrew", var(--serif); font-size: 1.3em;
  color: var(--tekhelet); line-height: 1; }
.ahlb-entry .he { font-family: "Frank Ruhl Libre", var(--serif); font-size: 1.1em; }
.ahlb-entry em, .ahlb-entry i { color: var(--ink-soft); }
.ahlb-entry .ahlb-root { color: var(--tekhelet); font-weight: 700; }
