/* UECF.NET /hebrew-greek-latin-telugu-english/ -- Hebrew - Greek - Latin -
   Telugu - English (NKJV) Parallel Bible.

   Base tokens, header/toolbar/home/search chrome are adapted directly from
   UECF.NET's existing /hebrew-english-parallel-bible/ reader (see that
   app's css/style.css) -- only the verse-grid and its responsive behavior
   are re-designed here for 5 simultaneous language columns instead of 2.
   Hebrew and Greek here are ROMANIZED (Latin-script transliterations, not
   native Hebrew/Greek Unicode), so -- unlike the 2-language reference app
   -- nothing in this app needs RTL/bidi handling; every column is LTR. */

/* Noto Sans Telugu is loaded via the Google Fonts <link> in index.html
   (see var(--font-te) below) -- no local @font-face needed. */

:root {
  --ink: #101B31;
  --ink-soft: #2C3E60;
  --gold: #C79A3D;
  --gold-soft: #E4C685;
  --maroon: #8B3A42;
  --cream: #FAF6EC;
  --paper: #FBF8F1;
  --line: #E2D8C0;
  --text: #1B2437;
  --muted: #5C6B80;
  --chip: #efe6d3;
  --overlay: rgba(16, 27, 49, 0.46);
  --verse-num: #C79A3D;
  --flash: rgba(199, 154, 61, 0.22);
  --header-h: 76px;
  --toolbar-h: 56px;
  --read-max: 96rem;
  --bible-size: 1.02rem;
  --bible-leading: 1.68;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 27, 49, 0.08);
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-he: Georgia, "Times New Roman", serif;
  --font-gr: Georgia, "Times New Roman", serif;
  --font-la: Georgia, "Times New Roman", serif;
  --font-te: "Noto Sans Telugu", "Noto Sans", Tahoma, sans-serif;
  --font-en: "Source Serif 4", Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --max: 1280px;
  --app-bg: #FAF6EC;
  --card-bg: #FBF8F1;
  --meta: #5C6B80;
  --tab-active: #C79A3D;
  --col-he: #8B3A42;
  --col-gr: #2C6E8E;
  --col-la: #6B4F8E;
  --col-te: #1E7A4C;
  --col-en: #101B31;
}

html[data-theme="dark"] {
  --cream: #121826;
  --app-bg: #121826;
  --paper: #171F2E;
  --card-bg: #1c2538;
  --ink: #FFFFFF;
  --ink-soft: #F4EFE4;
  --text: #FFFFFF;
  --muted: #A9B4C7;
  --meta: #8a9bb8;
  --line: #2C384C;
  --chip: #1c2538;
  --verse-num: #E4C685;
  --tab-active: #e8c07d;
  --overlay: rgba(6, 10, 18, 0.62);
  --flash: rgba(228, 198, 133, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --col-he: #e08d95; --col-gr: #7ec3e6; --col-la: #c3a8ec; --col-te: #6fd3a0; --col-en: #FFFFFF;
  color-scheme: dark;
}

html[data-width="narrow"] { --read-max: 68rem; }
html[data-width="wide"] { --read-max: 112rem; }
html[data-spacing="compact"] { --bible-leading: 1.5; }
html[data-spacing="relaxed"] { --bible-leading: 2.0; }
html[data-density="compact"] .verse { padding: 0.35rem 0.35rem; }
html[data-density="comfortable"] .verse { padding: 0.7rem 0.4rem; }

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-padding-top: calc(var(--header-h) + var(--toolbar-h) + 12px);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--app-bg, var(--cream));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
img { max-width: 100%; height: auto; }
a { color: var(--maroon); text-decoration: none; }
html[data-theme="dark"] a { color: var(--gold-soft); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold);
  color: #101b31; padding: 10px 16px; z-index: 400; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---- header ---- */
.site-header {
  background: #101b31; color: #faf6ec; position: sticky; top: 0; z-index: 100;
  border-bottom: 3px solid var(--gold); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding-top: env(safe-area-inset-top, 0);
}
.header-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: #faf6ec; min-width: 0; }
.brand:hover { text-decoration: none; color: var(--gold-soft); }
.brand-logo-img { width: 50px; height: 50px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text .full { font-family: var(--font-display); font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text .sub { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-soft); font-weight: 600; }
.nav-toggle {
  margin-left: auto; min-width: 44px; min-height: 44px; border: 1px solid rgba(228, 198, 133, 0.5);
  background: transparent; color: #faf6ec; border-radius: 8px; cursor: pointer; padding: 8px 12px; font-weight: 600;
}
.primary-nav > ul:not(.uecf-nav) { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.primary-nav > ul:not(.uecf-nav) a { color: #faf6ec; display: block; padding: 10px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; }
.primary-nav > ul:not(.uecf-nav) a[aria-current="page"], .primary-nav > ul:not(.uecf-nav) a:hover {
  background: rgba(228, 198, 133, 0.12); text-decoration: none; color: var(--gold-soft);
}
.uecf-nav .uecf-nav-panel { --ink: #101B31; --ink-soft: #2C3E60; --cream: #FAF6EC; --line: #E2D8C0; --maroon: #8B3A42; background: #FAF6EC; color: #101B31; }
.uecf-nav .uecf-nav-group a { color: #101B31; }
@media (max-width: 992px) {
  .primary-nav:not(:has(.uecf-nav)) {
    position: absolute; top: 100%; left: 0; right: 0; background: #101b31; max-height: 0;
    overflow: hidden; transition: max-height 0.3s ease; border-bottom: 1px solid rgba(228, 198, 133, 0.25);
  }
  .primary-nav:not(:has(.uecf-nav)).open { max-height: min(80vh, 720px); overflow-y: auto; }
  .primary-nav > ul:not(.uecf-nav) { flex-direction: column; padding: 8px 18px 16px; }
  .primary-nav > ul:not(.uecf-nav) a { width: 100%; }
  .brand-text .full { max-width: 52vw; font-size: 0.86rem; }
  .uecf-nav .uecf-nav-panel { --ink: #E7ECF6; --ink-soft: #B9C3D6; --cream: #101B31; --line: rgba(228, 198, 133, 0.2); background: rgba(255, 255, 255, 0.05); color: #E7ECF6; }
  .uecf-nav .uecf-nav-group a { color: #E7ECF6; }
}
@media (min-width: 993px) {
  .nav-toggle { display: none; }
  .header-inner { justify-content: space-between; }
  .primary-nav { margin-left: auto; }
}

/* ---- toolbar ---- */
.bible-toolbar { position: sticky; top: var(--header-h); z-index: 80; background: var(--paper); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); transition: transform 0.2s ease; touch-action: manipulation; }
html[data-theme="dark"] .bible-toolbar { background: rgba(23, 31, 46, 0.94); }
.toolbar-inner { max-width: var(--max); margin: 0 auto; display: flex; gap: 8px; align-items: center; padding: 8px 16px; flex-wrap: wrap; }
.toolbar-home { font-family: var(--font-ui); font-weight: 700; color: var(--ink); white-space: nowrap; }
.toolbar-home:hover { text-decoration: none; color: var(--gold); }
body[data-view="read"] .toolbar-home { display: none; }
.toolbar-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; flex: none; margin-left: auto; }
.toolbar-uecf.tool-btn { display: none; align-items: center; justify-content: center; min-width: 40px; padding: 0; color: var(--gold-soft); }
.toolbar-uecf svg { display: block; }
.tool-btn, .pager, .chip, .btn, .tab-btn, .search-filter-btn {
  min-height: 44px; border: 1px solid var(--line); background: var(--paper); color: inherit; border-radius: 10px; padding: 0 12px; cursor: pointer;
}
.tool-btn:hover, .pager:hover, .chip:hover, .tab-btn:hover, .search-filter-btn:hover { border-color: var(--gold); }
.tool-btn:disabled, .pager:disabled { opacity: 0.4; cursor: not-allowed; }
.tool-btn[aria-pressed="true"], .chip.is-active, .tab-btn.is-active, .search-filter-btn.is-active { background: #101B31; color: #FAF6EC; border-color: #101B31; }
html[data-theme="dark"] .tool-btn[aria-pressed="true"], html[data-theme="dark"] .chip.is-active, html[data-theme="dark"] .tab-btn.is-active, html[data-theme="dark"] .search-filter-btn.is-active { background: var(--tab-active, var(--gold)); color: #101B31; border-color: var(--tab-active, var(--gold)); }
.chapter-nav { display: flex; gap: 4px; }
.selects { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.selects select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: inherit; padding: 0 10px; max-width: min(100%, 240px); }
.chapter-select-fallback { display: none !important; }
.chapter-picker-btn { flex: 0 0 52px; width: 52px; min-width: 52px; max-width: 52px; min-height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card-bg, var(--paper)); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; }
.chapter-picker-btn:hover { border-color: var(--gold); }
html[data-theme="dark"] .chapter-picker-btn { background: #1c2538; color: #FFFFFF; }
body[data-view="home"] .selects, body[data-view="home"] .chapter-nav, body[data-view="search"] .selects, body[data-view="search"] .chapter-nav { display: none; }
body[data-view="read"] .toolbar-search { flex: 1 1 160px; min-width: 140px; max-width: 260px; }
body[data-view="home"] .toolbar-search, body[data-view="search"] .toolbar-search { display: none; }
body:not([data-view="read"]) #shareChapter, body:not([data-view="read"]) #printChapter { display: none; }
.search-form { display: flex; gap: 8px; min-width: 0; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
.search-form input, .app-search input, .selects select {
  flex: 1; min-height: 48px; min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  line-height: 1.65; background: var(--card-bg, var(--paper)); color: var(--text); caret-color: var(--gold); -webkit-text-fill-color: var(--text);
}
#bookSelect { flex: 1 1 0; width: auto; max-width: 100%; }
.search-form input::placeholder, .app-search input::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; }
html[data-theme="dark"] .search-form input, html[data-theme="dark"] .app-search input, html[data-theme="dark"] .selects select { background: #1c2538; color: #FFFFFF; -webkit-text-fill-color: #FFFFFF; }
.search-form button, .btn { min-height: 48px; background: #101b31; color: #fff; border: 0; border-radius: 12px; padding: 0 18px; font-weight: 700; cursor: pointer; }
html[data-theme="dark"] .search-form button, html[data-theme="dark"] .btn { background: var(--gold); color: #101b31; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 24px 16px 80px; }
.library-wrap { max-width: 760px; }
.hero { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.hero h1, .page-title, .chapter-head h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin: 0 0 6px; color: var(--ink); line-height: 1.35; }
.lede { margin: 0 0 18px; color: var(--muted); max-width: 42rem; }
.kicker { display: block; color: var(--gold); font-weight: 700; letter-spacing: 0.08em; font-size: 0.78rem; text-transform: uppercase; margin-bottom: 6px; }
.continue-chip { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; margin-bottom: 18px; color: inherit; }
.continue-chip[hidden] { display: none !important; }
.continue-chip:hover { text-decoration: none; border-color: var(--gold); }
.continue-chip-label { color: var(--gold); font-weight: 700; font-size: 0.82rem; }
.continue-chip-title { font-family: var(--font-display); font-weight: 600; }
.app-search { position: relative; margin-bottom: 14px; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); min-width: 36px; min-height: 36px; cursor: pointer; font-size: 1.4rem; }
.testament-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.tab-btn { flex: 0 0 auto; font-weight: 600; }
.list-status { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.book-list { display: flex; flex-direction: column; gap: 6px; }
.book-row-item { display: flex; align-items: stretch; background: var(--card-bg, var(--paper)); border: 1px solid var(--line); border-radius: 14px; min-height: 64px; }
.book-row-item[hidden] { display: none !important; }
.book-row { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 12px 8px 12px 14px; color: inherit; }
.book-row:hover { text-decoration: none; }
.book-row-item:hover { border-color: var(--gold); }
.book-row-badge { flex: none; width: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); letter-spacing: 0.02em; }
.book-row-content { display: flex; flex-direction: column; min-width: 0; }
.book-row-he { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); overflow-wrap: anywhere; }
.book-row-meta { color: var(--meta, var(--muted)); font-size: 0.84rem; }
.book-row-star { flex: none; width: 48px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 0 14px 14px 0; }
.book-row-star[aria-pressed="true"] { color: var(--gold); }
.book-row-star:hover { color: var(--gold); }

.reader { max-width: var(--read-max); margin: 0 auto; }
.breadcrumb { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.breadcrumb a { color: inherit; }
.chapter-head .en { margin: 4px 0 0; color: var(--muted); }
.section-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.chapter-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 0 0 22px; }
.chip { min-width: 0; padding: 0; }

/* ============================================================
   5-column verse grid
   ============================================================ */
:root { --num-col: 2.6rem; --lang-col-min: 12rem; }

.verse-head {
  display: grid;
  grid-template-columns: var(--num-col) repeat(5, minmax(var(--lang-col-min), 1fr));
  gap: 10px 16px;
  padding: 8px 0.4rem 0.6rem;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky;
  top: calc(var(--header-h) + var(--toolbar-h));
  background: var(--app-bg);
  z-index: 40;
}
body[data-view="read"]:not(:has(.site-header:visible)) .verse-head,
.chrome-hidden .verse-head { top: 0; }
.verse-head span:first-child { text-align: right; }
.verse-head .col-he { color: var(--col-he); }
.verse-head .col-gr { color: var(--col-gr); }
.verse-head .col-la { color: var(--col-la); }
.verse-head .col-te { color: var(--col-te); }
.verse-head .col-en { color: var(--col-en); }
html[data-theme="dark"] .verse-head .col-en { color: var(--gold-soft); }

.verses { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.verse {
  display: grid;
  grid-template-columns: var(--num-col) repeat(5, minmax(var(--lang-col-min), 1fr));
  gap: 10px 16px;
  align-items: start;
  border-radius: 12px;
  cursor: pointer;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.verse:hover, .verse.is-selected { background: rgba(199, 154, 61, 0.12); }
.verse.is-flash { background: var(--flash); }
.verse.is-highlight { background: rgba(199, 154, 61, 0.16); box-shadow: inset 0 0 0 1px rgba(199, 154, 61, 0.38); }
.verse-num { font-weight: 700; color: var(--verse-num); text-align: right; padding-top: 0.4em; font-variant-numeric: tabular-nums; }
.verse-text { margin: 0; font-size: var(--bible-size); line-height: var(--bible-leading); overflow-wrap: anywhere; color: var(--text); }
.verse-he { font-family: var(--font-he); border-left: 3px solid var(--col-he); padding-left: 0.5em; }
.verse-gr { font-family: var(--font-gr); border-left: 3px solid var(--col-gr); padding-left: 0.5em; }
.verse-la { font-family: var(--font-la); border-left: 3px solid var(--col-la); padding-left: 0.5em; }
.verse-te { font-family: var(--font-te); border-left: 3px solid var(--col-te); padding-left: 0.5em; }
.verse-en { font-family: var(--font-en); border-left: 3px solid var(--col-en); padding-left: 0.5em; }
html[data-theme="dark"] .verse-en { border-left-color: var(--gold-soft); }
.lang-tag { display: none; font-family: var(--font-ui); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.verse-missing { color: var(--muted); font-style: italic; font-family: var(--font-ui); font-size: 0.88em; }
html[data-theme="dark"] .verse-text { color: #FFFFFF; }

.reader-nav, .book-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.pager { flex: 1; min-width: 140px; text-align: center; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.search-scope { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); }
.search-scope[hidden] { display: none !important; }
.search-hit { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; color: inherit; }
.search-hit:hover { text-decoration: none; border-color: var(--gold); }
.search-ref { display: block; font-weight: 700; font-family: var(--font-display); margin-bottom: 6px; }
.search-langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 8px 14px; }
.search-lang-row { font-size: 0.92rem; line-height: 1.55; }
.search-lang-row .lang-tag { display: block; }
.search-stats { color: var(--muted); }
mark { background: rgba(199, 154, 61, 0.35); color: inherit; padding: 0 0.12em; border-radius: 3px; }
.empty-state, .status { background: var(--paper); border: 1px dashed var(--line); border-radius: 14px; padding: 24px; text-align: center; font-family: var(--font-display); }
.empty-state[hidden] { display: none !important; }
.settings-sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-width: 44rem; }
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 120; display: grid; place-items: end center; padding: 16px; }
.overlay[hidden] { display: none !important; }
.settings-sheet { width: min(520px, 100%); margin-bottom: 12px; }
.settings-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.settings-row span:first-child { font-weight: 600; }
.settings-row > div { display: flex; gap: 6px; flex-wrap: wrap; }
#closeSettings { width: 100%; margin-top: 12px; }
.chapter-picker-sheet { width: min(520px, 100%); max-height: min(80vh, 640px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 20px; margin-bottom: 12px; overscroll-behavior: contain; }
.chapter-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chapter-picker-head h2 { margin: 0; font-size: 1.05rem; font-family: var(--font-display); }
.chapter-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.chapter-picker-grid .chip { min-height: 48px; touch-action: manipulation; }
.verse-sheet { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; display: flex; gap: 8px; background: #101b31; color: #fff; padding: 10px; border-radius: 14px; box-shadow: var(--shadow); flex-wrap: wrap; max-width: calc(100vw - 20px); justify-content: center; }
.verse-sheet[hidden] { display: none !important; }
.verse-sheet button { min-height: 44px; background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 0 12px; cursor: pointer; }
.site-footer { background: #101b31; color: #faf6ec; padding: 40px 16px calc(24px + env(safe-area-inset-bottom, 0px)); margin-top: 12px; }
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.site-footer h2 { color: var(--gold-soft); font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px; }
.site-footer p, .site-footer li { color: #c7cedd; margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #d9dfec; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-bottom { border-top: 1px solid rgba(228, 198, 133, 0.2); padding-top: 16px; color: #a7b3c6; font-size: 0.9rem; }
.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: #101b31; color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 200; }
.toast[hidden] { display: none !important; }

/* ---- Tablet: keep the grid, but let it scroll horizontally rather than
   shrinking every column's text to unreadable size. Verse number + first
   language stay put via sticky positioning so context is never lost. ---- */
@media (max-width: 1180px) and (min-width: 769px) {
  :root { --lang-col-min: 15rem; }
  .verse-head, .verse { min-width: calc(var(--num-col) + 5 * (var(--lang-col-min) + 16px)); }
  .verse-num { position: sticky; left: 0; background: var(--app-bg); z-index: 2; }
  .verse-head span:first-child { position: sticky; left: 0; background: var(--app-bg); z-index: 41; }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .brand-text .sub { display: none; }
}

/* ---- Mobile: stacked verse presentation. Each verse becomes a labeled
   card with all 5 languages stacked vertically -- no shrinking, no
   horizontal scroll, full readability preserved (per spec: "prioritize
   readability over cramming all columns onto one small screen"). ---- */
@media (max-width: 768px) {
  html { scroll-padding-top: calc(var(--toolbar-h) + 12px); }
  .desktop-only, .site-header, .site-footer { display: none !important; }
  .bible-toolbar { top: 0; }
  body.chrome-hidden .bible-toolbar { transform: translateY(-100%); }
  .hero { padding: 20px 16px; }
  .desktop-tool { display: none; }
  .toolbar-uecf.tool-btn { display: inline-flex; }
  .search-form { flex-direction: column; }
  body[data-view="read"] .toolbar-search, #firstChapter, #lastChapter { display: none; }
  body[data-view="read"] .toolbar-home { display: none; }
  .selects { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 8px; overflow: hidden; }
  .selects select, #bookSelect { flex: 1 1 0; width: auto; min-width: 0; max-width: none; }
  .chapter-picker-btn { flex: 0 0 44px; width: 44px; min-width: 44px; max-width: 44px; min-height: 44px; }
  .toolbar-inner { padding: 6px 10px; flex-wrap: nowrap; gap: 6px; }
  .tool-btn { min-width: 40px; min-height: 40px; padding: 0 8px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .chapter-nav { margin-left: auto; }
  .wrap { padding: 16px 14px 72px; }
  .breadcrumb { display: none; }
  .reader { display: flex; flex-direction: column; }
  .chapter-head { order: 1; }
  .verses, .status { order: 2; }
  .section-label { order: 3; margin-top: 28px; }
  .chapter-chips { order: 4; }
  .reader-nav { order: 5; }
  .book-nav { order: 6; }

  .verse-head { display: none; }
  .verses { overflow-x: visible; }
  .verse {
    display: block;
    scroll-margin-top: calc(var(--toolbar-h) + 8px);
    padding: 0.85rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--card-bg, var(--paper));
    min-width: 0;
  }
  .verse-num { display: inline-block; padding: 0 0 6px; text-align: left; }
  .verse-text { display: block; margin: 0 0 8px; padding: 0.35rem 0 0.35rem 0.6em; }
  .verse-text:last-child { margin-bottom: 0; }
  .lang-tag { display: block; }
  .search-langs { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .brand-text .full { max-width: 46vw; }
  .toolbar-home { font-size: 0.95rem; }
}

@media print {
  .site-header, .bible-toolbar, .search-form, .verse-sheet, .settings-panel, .chapter-picker,
  .tool-btn, .pager, .chip, .btn, .site-footer, .toast, .continue-chip,
  nav, .chapter-chips, .selects, .reader-nav, .book-nav, .skip-link,
  .testament-tabs, .app-search, .search-filters, .search-scope, .verse-head { display: none !important; }
  body { background: #fff; color: #000; }
  .verses { overflow: visible; }
  .verse { display: block; break-inside: avoid; page-break-inside: avoid; border-bottom: 1px solid #ddd; padding: 8px 0; }
  .verse-text { display: block; font-size: 10.5pt; line-height: 1.5; color: #000; margin: 0 0 4px; }
  .chapter-head h1 { font-size: 18pt; }
  a { color: #000; text-decoration: none; }
  .lang-tag { display: block; color: #444; }
}
