/* MyBiblio styles: mobile first, system fonts, no external requests. */
:root {
  --fs: 1rem;
  --paper: #fbf7ef; --card: #fffdf8; --ink: #1d2a2f; --muted: #5a6a70; --line: #e3d9c4;
  --teal: #17625e; --teal-ink: #ffffff; --amber: #a8641a; --danger: #a12a2a; --focus: #0b57d0;
  --hl-yellow: #fbe98a; --hl-green: #bfe8bf; --hl-blue: #bfdcf7; --hl-pink: #f6c6dc; --sel: #dcebe9;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14191b; --card: #1b2326; --ink: #e8e4d9; --muted: #a2b0b4; --line: #2f3b3f;
    --teal: #5fc2bb; --teal-ink: #0d1517; --amber: #e0a050; --danger: #ff8d8d; --focus: #8ab4ff;
    --hl-yellow: #6b5e12; --hl-green: #2f5a2f; --hl-blue: #264b6c; --hl-pink: #6c2f4a; --sel: #26403f;
  }
}
html[data-fs="-2"] { --fs: .85rem } html[data-fs="-1"] { --fs: .93rem } html[data-fs="0"] { --fs: 1rem }
html[data-fs="1"] { --fs: 1.12rem } html[data-fs="2"] { --fs: 1.25rem } html[data-fs="3"] { --fs: 1.4rem } html[data-fs="4"] { --fs: 1.6rem }
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--fs)/1.55 var(--sans); }
a { color: var(--teal); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
h1 { font: 700 1.7em/1.2 var(--serif); margin: .4em 0; } h2 { font: 700 1.25em/1.25 var(--serif); margin: 1em 0 .4em; } h3 { font-size: 1.05em; margin: .8em 0 .3em; }
.hint, small, .lic-line { color: var(--muted); } .lead { font-size: 1.15em; max-width: 40em; }
.err, .flash.err { color: var(--danger); }

/* header */
.top { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font: 700 1.3rem var(--serif); text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .45rem; }
.mark { width: 1.2rem; height: 1.2rem; border-radius: 4px; background: var(--teal); box-shadow: inset 0 0 0 3px var(--teal), inset 0 0 0 5px var(--card); position: relative; }
.nav { display: flex; gap: .2rem .9rem; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; } .nav a:hover { border-color: var(--amber); }
.quick { display: flex; flex: 1 1 14rem; min-width: 12rem; max-width: 22rem; }
.quick input { flex: 1; min-width: 0; border-radius: 6px 0 0 6px; } .quick button { border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: var(--card); color: var(--ink); padding: 0 .6rem; cursor: pointer; }
.ic { width: 1.1em; height: 1.1em; vertical-align: -.15em; }
.tools { display: flex; gap: .5rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
.fs button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .2rem .5rem; cursor: pointer; } .fs button:first-child { border-radius: 6px 0 0 6px; } .fs button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }

/* controls */
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid #b9ae98; border-radius: 6px; padding: .4rem .55rem; max-width: 100%; }
@media (prefers-color-scheme: dark) { input, select, textarea { border-color: #4b5b60; } }
textarea { width: 100%; } label { display: block; margin: .6rem 0; font-weight: 600; } label input:not([type=checkbox]), label select, label textarea { display: block; margin-top: .2rem; font-weight: 400; }
label.check { font-weight: 400; } label.check input { display: inline; }
.btn { display: inline-block; font: 600 .95em var(--sans); text-decoration: none; background: var(--teal); color: var(--teal-ink); border: 1px solid var(--teal); border-radius: 6px; padding: .45rem .9rem; cursor: pointer; }
.btn.small { padding: .25rem .6rem; font-size: .85em; } .btn.ghost { background: transparent; color: var(--teal); } .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: wait; }
.linkish { background: none; border: 0; color: var(--teal); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline; } .row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; font-size: .78em; font-weight: 600; border: 1px solid var(--line); border-radius: 99px; padding: 0 .55em; background: var(--card); }
.chip.warn, .flash.warn { background: #fff0cf; color: #5a3b00; border-color: #e5c777; } @media (prefers-color-scheme: dark) { .chip.warn, .flash.warn { background: #3d3112; color: #f3d996; } }

/* pages */
main.page { max-width: 62rem; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1.1rem 1rem; } .card.narrow, .narrow { max-width: 30rem; margin: 1rem auto; }
.grid2, .grid3 { display: grid; gap: 1rem; margin: 1rem 0; } @media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.hero { padding: 1.5rem 0 .5rem; } .bigsearch { display: flex; gap: .5rem; max-width: 36rem; } .bigsearch input { flex: 1; font-size: 1.1em; padding: .6rem .8rem; }
.price { font: 700 1.6em var(--serif); margin: .2em 0; }
.flash { padding: .6rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); } .flash.ok { border-color: var(--teal); }
.sample-note { background: #fff0cf; color: #5a3b00; border: 1px dashed #d1a640; padding: .45rem .8rem; border-radius: 8px; font-size: .9em; } @media (prefers-color-scheme: dark) { .sample-note { background: #3d3112; color: #f3d996; } }
.foot { max-width: 62rem; margin: 2rem auto; padding: 1rem; color: var(--muted); font-size: .9em; border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: end; } .filters label { margin: .3rem 0; }
.tablewrap { overflow-x: auto; } .tbl { border-collapse: collapse; width: 100%; font-size: .95em; } .tbl th, .tbl td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; } .tbl thead th { background: var(--card); }
.facts dt { font-weight: 700; margin-top: .6rem; } .facts dd { margin: 0; }
.split { display: grid; gap: 1.5rem; } @media (min-width: 800px) { .split { grid-template-columns: 2fr 1fr; } }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .3rem 1rem .8rem; margin: .8rem 0; }
.nbody { margin: .3rem 0; } .tabs a { display: inline-block; padding: .4rem .8rem; text-decoration: none; border-bottom: 3px solid transparent; } nav.tabs { border-bottom: 1px solid var(--line); margin-bottom: 1rem; } nav.tabs a.on { border-color: var(--teal); font-weight: 700; }
.pager { display: flex; gap: 1rem; }

/* workspace */
body.is-workspace main.wide { padding: 0; }
.ws-bar { display: flex; gap: .5rem; flex-wrap: wrap; padding: .4rem 1rem; border-bottom: 1px solid var(--line); background: var(--card); }
.ws-bar button { font: inherit; font-size: .85em; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; padding: .2rem .6rem; cursor: pointer; } .ws-bar button[aria-pressed=true] { border-color: var(--teal); }
.panels { display: grid; grid-template-columns: 1fr; }
.panel { min-width: 0; border-bottom: 4px solid var(--line); }
@media (min-width: 900px) {
  .panels[data-count="2"] { grid-template-columns: 1fr 1fr; } .panel + .panel { border-left: 1px solid var(--line); }
  .panel { height: calc(100vh - 7.2rem); display: flex; flex-direction: column; border-bottom: 0; } .panel-body { overflow-y: auto; flex: 1; }
}
.panel > .tabs, .panel .tabs { display: flex; flex-wrap: wrap; gap: .2rem; padding: .3rem .5rem 0; background: var(--card); border-bottom: 1px solid var(--line); align-items: end; }
.tabwrap { display: inline-flex; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--paper); } .tabwrap.on { background: var(--paper); border-color: var(--teal); box-shadow: inset 0 3px 0 var(--teal); }
.tab, .tabx { font: inherit; font-size: .88em; background: none; border: 0; color: var(--ink); padding: .35rem .6rem; cursor: pointer; } .tabx { padding-left: 0; color: var(--muted); } .tabwrap.on .tab { font-weight: 700; }
.addtab { font-size: .85em; margin-bottom: .2rem; }
.panel-body { padding: .8rem 1rem 1.2rem; position: relative; } .panel-body[aria-busy=true] { opacity: .6; }
.chap { font: 700 1.35em var(--serif); margin: .2em 0 .5em; }
.goto { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .6rem; } .goto input { width: 10.5rem; }
.chap-nav { display: flex; justify-content: space-between; font-size: .9em; }
.scripture { font: calc(var(--fs) * 1.18)/1.85 var(--serif); max-width: 40rem; }
.verse { cursor: pointer; border-radius: 3px; padding: 0 1px; } .verse:hover { background: var(--sel); } .verse.sel { background: var(--sel); box-shadow: 0 0 0 2px var(--teal); }
.vn { font: 700 .62em var(--sans); color: var(--amber); margin-right: .2em; vertical-align: super; line-height: 0; }
.hl-yellow { background: var(--hl-yellow); } .hl-green { background: var(--hl-green); } .hl-blue { background: var(--hl-blue); } .hl-pink { background: var(--hl-pink); }
.verse.sel.hl-yellow, .verse.sel.hl-green, .verse.sel.hl-blue, .verse.sel.hl-pink { box-shadow: 0 0 0 2px var(--teal); }
.note-mark { font-size: .8em; border: 1px solid var(--amber); color: var(--amber); background: var(--card); border-radius: 50%; width: 1.5em; height: 1.5em; padding: 0; cursor: pointer; line-height: 1; }
.vbar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; background: var(--card); border: 1px solid var(--teal); border-radius: 8px; padding: .4rem .6rem; margin-top: 1rem; box-shadow: 0 -4px 12px rgba(0,0,0,.12); }
.swatches { display: inline-flex; gap: .25rem; } .sw { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; padding: 0; }
.sw-yellow { background: var(--hl-yellow); } .sw-green { background: var(--hl-green); } .sw-blue { background: var(--hl-blue); } .sw-pink { background: var(--hl-pink); }
.vstatus { font-size: .85em; color: var(--muted); }
.summary { background: var(--card); border-left: 4px solid var(--amber); padding: .2rem 1rem; margin: .8rem 0; }
.xrefs ul, .results, .sources-list { padding-left: 1.2rem; } .results { list-style: none; padding: 0; } .results li { margin: .6rem 0; } .results p { margin: .15rem 0; }
mark { background: #ffd54a; color: #1d2a2f; border-radius: 2px; padding: 0 1px; }
.entry { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: .1rem 1rem .6rem; margin: .8rem 0; } .entry h3 { margin-bottom: 0; } .entry .src { margin: .1rem 0; color: var(--muted); font-size: .88em; }
.entry .lic { font-size: .8em; color: var(--muted); border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .3rem; }
.cform { display: flex; gap: .8rem; flex-wrap: wrap; } .cform label { margin: .2rem 0; font-size: .9em; }
.searchbox .opts { display: flex; flex-wrap: wrap; gap: .2rem 1rem; } .searchbox .opts label { font-size: .88em; margin: .3rem 0; } .searchbox .row input { flex: 1; min-width: 8rem; }
.aifind { border-top: 1px solid var(--line); margin-top: 1.2rem; }
.empty { color: var(--muted); font-style: italic; }
.ai-counter { font-weight: 700; } .ai-msg { border-top: 1px solid var(--line); padding: .5rem 0; } .ai-q { font-weight: 700; margin: 0; } .ai-a { margin: .3rem 0; }
.study-note { font-size: .82em; color: var(--muted); } .upgrade { border: 2px solid var(--amber); border-radius: 8px; padding: .3rem 1rem; background: var(--card); }
.cite { font-size: .8em; vertical-align: super; text-decoration: none; font-weight: 700; }
.sources { font-size: .9em; } .report summary, .sources summary { cursor: pointer; font-size: .88em; }
.popover { position: fixed; z-index: 40; max-width: min(22rem, calc(100vw - 16px)); background: var(--card); color: var(--ink); border: 1px solid var(--teal); border-radius: 8px; padding: .6rem .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-family: var(--serif); }
.popover[hidden] { display: none; } .pv { margin: .3rem 0; }
dialog { border: 1px solid var(--teal); border-radius: 10px; background: var(--card); color: var(--ink); max-width: 30rem; width: calc(100vw - 2rem); } dialog::backdrop { background: rgba(0,0,0,.45); }
blockquote { margin: .4rem 0; padding-left: .8rem; border-left: 3px solid var(--teal); font-family: var(--serif); } blockquote footer { font: .8em var(--sans); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .btn, .verse { transition: background .15s; } }

.pbr { display: block; height: .6em; } .scripture > .pbr:first-child { display: none; }
.ind { display: inline-block; width: 1.6em; } .ind2 { width: 3.2em; }
.etext { white-space: pre-line; }
