html.bible-toolbar-ready { --bible-search-tools-width: 188px; --bible-reader-logo-width: 200px; --bible-reader-logo-height: 60px; --bible-reader-logo-row: calc(var(--bible-reader-logo-height) + 12px); }
/* Bible web interface only. Keep the existing book list and chapter-grid styles. */
html.bible-toolbar-ready #sw-top-bar { min-height: 0; height: auto; padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); }
html.bible-toolbar-ready body.sw-chrome-reader #sw-top-bar .sw-top-bar-inner {
  display: grid; grid-template-columns: minmax(0, var(--bible-reader-logo-width)) minmax(0, 1fr); grid-template-rows: var(--bible-reader-logo-row) 48px;
  gap: 6px 8px; min-height: 0; width: 100%; box-sizing: border-box;
}
.bible-toolbar-left { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); grid-template-rows: var(--bible-reader-logo-row) 48px; grid-column: 1; grid-row: 1 / -1; align-items: center; justify-self: start; row-gap: 6px; width: var(--bible-reader-logo-width); }
html.bible-toolbar-ready #sw-top-bar .bible-toolbar-logo { display: block; grid-column: 1 / -1; grid-row: 1; width: var(--bible-reader-logo-width); height: auto; max-height: var(--bible-reader-logo-height); object-fit: contain; }
html.bible-toolbar-ready #sw-top-bar .sw-chrome-home { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-width: 40px; padding: 0; }
html.bible-toolbar-ready body.sw-chrome-reader #sw-top-bar .sw-chrome-home { grid-column: 2; grid-row: 2; align-self: center; }
html.bible-toolbar-ready body.sw-chrome-reader #sw-top-bar #bible-general-toggle { grid-column: 1; grid-row: 2; justify-self: start; align-self: center; width: 40px; height: 40px; min-width: 40px; }
html.bible-toolbar-ready #sw-top-bar #sw-chrome-tools { grid-column: 2; grid-row: 1; display: flex; gap: 4px; align-items: center; justify-self: end; }
html.bible-toolbar-ready #sw-top-bar #search-container { position: static; grid-column: 2; grid-row: 1; display: none; min-width: 0; width: min(540px, calc(100% - 200px)); justify-self: end; margin-inline-end: calc(var(--bible-search-tools-width) + 8px); box-sizing: border-box; padding: 0; border: 0; background: transparent; transition: none; }
html.bible-toolbar-ready #sw-top-bar #search-container.open { display: flex; top: auto; }
html.bible-toolbar-ready #sw-top-bar #search-input { min-width: 0; width: 100%; flex: 1 1 0; }
html.bible-toolbar-ready #search-results { top: calc(var(--sw-chrome-h) + 2px); }
html.bible-toolbar-ready #sw-top-bar #search-input:focus-visible {
  outline: 2px solid #000745 !important; outline-offset: 2px;
  border-color: #000745; box-shadow: 0 0 0 4px #F7F7F7;
}
html.bible-toolbar-ready #sw-top-bar .sw-chrome-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; padding: 0; }
html.bible-toolbar-ready body.sw-chrome-reader #sw-top-bar #sw-chrome-nav {
  position: static; inset: auto; transform: none; grid-column: 2; grid-row: 2;
  width: min(650px, 100%); max-width: 100%; justify-self: end;
  display: flex; justify-content: flex-end; gap: 4px;
}
html.bible-toolbar-ready #sw-top-bar #sw-chrome-chapter { min-width: 0; flex: 1 1 auto; }
html.bible-toolbar-ready #sw-top-bar #sw-chrome-chapter { font-size: 1.235em; }
/* Right-align mixed book labels while preserving the markup's LTR/RTL runs. */
html.bible-toolbar-ready .bible-menu .bible-nav-heading,
html.bible-toolbar-ready .bible-menu .bible-nav-heading-label,
html.bible-toolbar-ready .bible-menu .bible-nav-transliteration,
html.bible-toolbar-ready .bible-menu .bible-book-label { text-align: right; }
html.bible-toolbar-ready .bible-menu .bible-book-label { justify-content: flex-end; direction: ltr; }
html.bible-toolbar-ready .bible-menu .bible-book-english { direction: ltr; unicode-bidi: isolate; text-align: right; }
html.bible-toolbar-ready .bible-menu .bible-book-hebrew { direction: rtl; unicode-bidi: isolate; text-align: right; }
html.bible-toolbar-ready .bible-menu .bible-nav-heading-label { direction: ltr; unicode-bidi: isolate; }
html.bible-toolbar-ready .bible-menu .bible-nav-heading-hebrew,
.scripture-home .scripture-section-hebrew,
.scripture-home .scripture-strip-hebrew { font-size: calc(1em + 10pt); }
html.bible-toolbar-ready .bible-menu .bible-nav-heading-english,
.scripture-home .scripture-section-name { font-size: calc(0.8em + 8pt); }
html.bible-toolbar-ready .bible-menu .bible-nav-transliteration { font-size: calc(0.65em + 5pt); }
html.bible-toolbar-ready .bible-menu .bible-nav-secondary .bible-nav-transliteration { font-size: calc(0.8357em + 5pt); }
.scripture-home .scripture-section-translit,
.scripture-home .scripture-strip-translit { font-size: calc(1rem + 5pt); }
.scripture-home .scripture-strip-english { font-size: calc(0.8em + 8pt); }
/* Keep enlarged heading lines readable while tightening the gap before the transliteration. */
.scripture-home .scripture-section-heading { line-height: 1.3; }
.scripture-home .scripture-section-translit { line-height: 1.2; margin-top: 0; }
html.bible-toolbar-ready .bible-menu .bible-nav-heading { text-align: right; }
html.bible-toolbar-ready .bible-menu .bible-nav-heading { color: #800000; }
html.bible-toolbar-ready .bible-menu .bible-nav-transliteration { direction: ltr; unicode-bidi: isolate; }
html.bible-toolbar-ready #sw-chrome-nav .nqd-nav-btn { color: #000745 !important; background: #fff !important; border: 1px solid #000745; flex: 0 0 44px; height: 44px; width: 44px; }
html.bible-toolbar-ready #sw-chrome-nav .nqd-nav-btn svg, html.bible-toolbar-ready #sw-chrome-nav .nqd-nav-btn svg * { stroke: #000745 !important; }
html.bible-toolbar-ready #sw-chrome-nav .nqd-nav-btn:disabled { opacity: .5; }
html.bible-toolbar-ready #nav-overlay.open { top: var(--sw-chrome-h); background: transparent; backdrop-filter: none; }
html.bible-toolbar-ready #nav-sidebar {
  top: calc(var(--sw-chrome-h) + 6px); left: auto; right: auto; bottom: auto !important;
  width: min(430px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
  max-height: calc(100dvh - var(--sw-chrome-h) - 18px); height: var(--bible-menu-height, 70dvh) !important;
  border: 1px solid var(--here-chrome) !important; border-radius: 8px;
  box-shadow: 0 8px 24px #0004 !important; visibility: hidden; pointer-events: none;
  transform: none !important; transition: none; z-index: var(--z-panel);
}
html.bible-toolbar-ready #nav-sidebar.open { visibility: visible; pointer-events: auto; transform: none !important; }
.bible-menu-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: 8px 16px; flex: 0 0 auto; direction: ltr; }
.bible-menu-header h2 { grid-column: 2; font: inherit; font-size: 1.2em; font-weight: 700; margin: 0; text-align: center; }
.bible-menu-header button { grid-column: 3; justify-self: end; min-width: 44px; min-height: 44px; font: inherit; font-size: 1.5em; border: 0; background: transparent; color: inherit; cursor: pointer; }
/* Wrapping preserves every pointed name when the available panel is narrower. */
html.bible-toolbar-ready #nav-sidebar .bible-book-label { flex-wrap: wrap; white-space: normal; }
html.bible-toolbar-ready #nav-sidebar .bible-book-hebrew { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.bible-ui-pop, html.bible-toolbar-ready #sw-size-pop { position: fixed; z-index: calc(var(--z-chrome) + 4); box-sizing: border-box; overflow: auto; background: var(--surface-0); color: var(--on-surface); border: 1px solid var(--here-chrome); border-radius: 8px; padding: 14px; box-shadow: 0 8px 24px #0004; font-family: 'David Libre', Georgia, serif; direction: ltr; }
.bible-ui-pop[hidden], html.bible-toolbar-ready #sw-size-pop[hidden] { display: none !important; }
.bible-ui-pop h2 { margin: 0 0 8px; font: inherit; font-size: 1.2em; font-weight: 700; }
.bible-ui-pop > button, .bible-ui-pop > a { display: block; box-sizing: border-box; width: 100%; padding: 10px 8px; min-height: 44px; font: inherit; text-align: left; background: transparent; color: inherit; border: 0; text-decoration: none; cursor: pointer; }
.bible-ui-pop > button:disabled { opacity: .6; cursor: default; }
.bible-ui-pop button[aria-pressed="true"] { background: var(--surface-2); font-weight: bold; }
html.bible-toolbar-ready :is(#sw-top-bar, .bible-ui-pop, #nav-sidebar, #sw-app-panel, #sw-size-pop) :is(button, a, [tabindex="0"], select):focus-visible { outline: 2px solid var(--here-chrome); outline-offset: 2px; }
/* Home section headings only: leave book names, verses and transliterations sized as before. */
.scripture-home .scripture-section-heading { font-size: clamp(1.6rem, 3vw, 1.85rem); color: #800000; overflow-wrap: break-word; }
.scripture-home .scripture-home-header > .scripture-section-heading { font-size: clamp(1.85rem, 4vw, 2.1rem); color: #800000; }
@media (max-width: 520px) {
  html.bible-toolbar-ready #sw-top-bar { padding-left: 8px; padding-right: 8px; }
  .bible-toolbar-left { width: min(var(--bible-reader-logo-width), calc(100vw - 212px)); grid-template-columns: 40px 40px minmax(0, 1fr); }
  html.bible-toolbar-ready #sw-top-bar .bible-toolbar-logo { width: 100%; max-width: var(--bible-reader-logo-width); height: auto; max-height: none; }
  html.bible-toolbar-ready #sw-top-bar #sw-chrome-tools, .bible-toolbar-left { gap: 0; }
  html.bible-toolbar-ready #sw-top-bar .sw-top-bar-inner { column-gap: 4px; }
  html.bible-toolbar-ready #sw-top-bar { --bible-search-tools-width: 176px; }

}

/* Typed search text stays navy against a light input in every appearance. */
html.bible-toolbar-ready #sw-top-bar #search-input { color: #000745 !important; -webkit-text-fill-color: #000745; caret-color: #000745; background: #fff !important; }
#search-submit { flex: 0 0 auto; min-height: 44px; padding: 6px 10px; border: 1px solid var(--chrome-line); border-radius: 4px; background: transparent; color: var(--on-chrome); font: inherit; cursor: pointer; }

/* Reserve a separate area for header controls while keeping search in its row. */
@media (max-width: 800px) {
  html.bible-toolbar-ready #sw-top-bar #search-container.open { grid-column: 1 / -1; width: min(540px, calc(100% - var(--bible-search-tools-width) - 8px)); gap: 4px; }
  html.bible-toolbar-ready .sw-top-bar-inner:has(#search-container.open) .bible-toolbar-logo { visibility: hidden; }
  html.bible-toolbar-ready #sw-top-bar #search-close { min-width: 24px !important; padding-inline: 4px; flex: 0 0 auto; }
}
/* Only the smallest screens need narrower icon targets to keep every control visible. */
@media (max-width: 360px) {
  html.bible-toolbar-ready #sw-top-bar:has(#search-container.open) { --bible-search-tools-width: 128px; }
  html.bible-toolbar-ready #sw-top-bar:has(#search-container.open) #sw-chrome-tools .sw-chrome-btn { width: 32px; min-width: 32px !important; }
}
/* Reuse the chapter-title color only for dark section headings. */
body.dark-mode { --bible-chapter-title-color: #D4B78A; }
html.bible-toolbar-ready body.dark-mode .bible-menu .bible-nav-heading,
body.dark-mode .scripture-home :is(.scripture-section-heading,
  .scripture-strip-hebrew, .scripture-strip-translit, .scripture-strip-english) {
  color: var(--bible-chapter-title-color);
}
