:root{
  --paper:#fbfaf7;
  --paper-2:#f6f2ea;
  --ink:#211a16;
  --muted:#7f756d;
  --line:#d9d2ca;
  --line-soft:#e8e3dc;
  --rail:#f7f4ef;
  --accent:#1c1714;
  --word-underline:#d9c7b5;
  --amber:#f6df9d;
  --green:#bdeccf;
  --blue:#c9ddf4;
  --rose:#efd0cf;
  --drawer:390px;
  --rail-w:68px;
  --chapter-w:46px;
  --font-size:20px;
  --scripture-line:1.78;
  --radius:3px;
  --ui-font: Georgia, 'Times New Roman', serif;
  --body-font: Georgia, 'Times New Roman', serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink);font-family:var(--body-font)}
body{overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
svg{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-shell{height:100vh;display:grid;grid-template-columns:var(--rail-w) 1fr;background:var(--paper)}
.primary-rail{background:var(--rail);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:stretch;min-height:0;z-index:20}
.brand-mark{height:72px;border:0;border-bottom:1px solid transparent;background:transparent;padding:19px 20px;color:var(--ink)}
.brand-mark svg{width:28px;height:28px;stroke-width:1.3}
.primary-nav{display:flex;flex-direction:column;gap:2px;padding-top:20px}
.rail-item,.theme-quick{border:0;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 3px;font-size:10px;line-height:1.1}
.rail-item svg,.theme-quick svg{width:21px;height:21px}
.rail-item.active{background:#ece8e2;color:var(--ink)}
.theme-quick{margin-top:auto;padding-bottom:18px}
.workspace{min-width:0;min-height:0;position:relative;display:flex;flex-direction:column}
.topbar{height:61px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 18px;background:var(--paper);position:relative;z-index:14}
.topbar-left,.topbar-actions{display:flex;align-items:center;gap:8px}.topbar-actions{justify-self:end}.topbar-left{justify-self:start}
.icon-btn,.close-btn{border:0;background:transparent;width:34px;height:34px;padding:7px;color:var(--ink)}
.icon-btn svg{width:20px;height:20px}.close-btn{font-family:Arial,sans-serif;font-size:22px;line-height:20px}
.compact-select select,.top-select select{border:0;background:transparent;appearance:none;-webkit-appearance:none;outline:0}
.compact-select select{font-size:16px;font-weight:600;padding:8px 18px 8px 0;min-width:110px}
.topbar-center{display:flex;align-items:center;justify-content:center;gap:9px}
.top-select{display:flex;align-items:center;gap:5px}.top-select span{font-size:10px;letter-spacing:.13em;color:var(--muted)}.top-select select{font-size:14px;font-weight:700;max-width:160px}.top-sep{color:#bbb1a8}
.view{display:none;min-height:0;flex:1}.active-view{display:flex}.content-view.active-view{display:block;overflow:auto}
.reader-view{position:relative;min-height:0;overflow:hidden}
.chapter-rail{width:var(--chapter-w);flex:0 0 var(--chapter-w);border-right:1px solid var(--line);overflow-y:auto;background:var(--paper);padding:11px 5px;scrollbar-width:none}.chapter-rail::-webkit-scrollbar{display:none}
.chapter-btn{width:34px;height:34px;border:0;background:transparent;color:var(--muted);font-size:11px;border-radius:2px}.chapter-btn.active{background:var(--ink);color:var(--paper)}
.reading-pane{flex:1;min-width:0;overflow-y:auto;scroll-behavior:smooth;background:var(--paper)}
.reader-page{max-width:760px;margin:0 auto;padding:30px 32px 90px}
.chapter-heading{text-align:left;font-size:29px;letter-spacing:.025em;margin:0 0 20px;font-weight:700}.demo-banner{border:1px solid #d7c8b6;background:#fff4df;padding:10px 12px;font-size:12px;color:#7b4a20;margin:0 0 18px}
.scripture-text{font-size:var(--font-size);line-height:var(--scripture-line);letter-spacing:-.012em}.verse{display:inline;position:relative}.verse.focused{background:rgba(235,213,172,.42)}.verse.whole-amber{background:var(--amber)}.verse.whole-green{background:var(--green)}.verse.whole-blue{background:var(--blue)}.verse.whole-rose{background:var(--rose)}
.verse-number{font-size:.58em;vertical-align:super;margin-right:.2em;color:#7d4e31;cursor:pointer;font-weight:500}.verse-note-indicator{display:inline-flex;align-items:center;justify-content:center;vertical-align:baseline;margin:0 5px 0 1px;color:#a96510;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;width:16px;height:16px;appearance:none;-webkit-appearance:none;transform:translateY(2px)}.verse-note-indicator svg{display:block;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.word{border-bottom:0;cursor:pointer;text-decoration:none;transition:background .08s}.word:hover{background:#f2e9dc}.word.no-strong{border-bottom:0;cursor:pointer}.word.selected-word{background:#efd8a6}.word.hl-amber{background:var(--amber)}.word.hl-green{background:var(--green)}.word.hl-blue{background:var(--blue)}.word.hl-rose{background:var(--rose)}.supplied{font-style:italic}
.study-drawer{width:0;flex:0 0 0;border-left:0 solid var(--line);background:var(--paper);overflow:hidden;transition:width .18s ease,flex-basis .18s ease;display:flex;flex-direction:column}.study-drawer.open{width:var(--drawer);flex-basis:var(--drawer);border-left-width:1px}.study-header{min-height:78px;padding:16px 15px 13px;display:flex;justify-content:space-between;border-bottom:1px solid var(--line)}.lemma-line{font-size:22px}.lemma-line small{font-size:12px;color:var(--muted);margin-left:8px;letter-spacing:.04em}.study-meta{font-size:12px;color:var(--muted);margin-top:5px}.study-tabs{display:flex;border-bottom:1px solid var(--line);padding:0 12px}.study-tab{border:0;background:transparent;padding:11px 9px;font-size:11px;color:var(--muted);border-bottom:2px solid transparent}.study-tab.active{color:var(--ink);border-bottom-color:var(--ink)}.study-scroll{padding:0 16px 50px;overflow:auto;min-height:0}.study-section{padding:18px 0;border-bottom:1px solid var(--line-soft)}.study-section:last-child{border-bottom:0}.eyebrow,.study-section h3{font-size:10px;letter-spacing:.12em;color:#6f6258;text-transform:uppercase;font-weight:600;margin:0 0 12px}.study-section p{font-size:14px;line-height:1.62;margin:0 0 8px}.study-quote{font-style:italic;font-size:16px}.chip-row{display:flex;flex-wrap:wrap;gap:7px}.chip,.ref-chip{border:1px solid var(--line);background:#f3efe9;padding:6px 9px;font-size:11px;border-radius:2px}.ref-chip{cursor:pointer}.metric-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.metric{border:1px solid var(--line);text-align:center;padding:15px 8px}.metric strong{display:block;font-size:20px}.metric span{font-size:11px;color:var(--muted)}.external-link{display:inline-flex;align-items:center;gap:7px;color:var(--ink);font-size:12px;text-decoration:none;border-bottom:1px solid var(--ink);padding-bottom:2px}.data-warning{font-size:12px!important;background:#fff4df;border:1px solid #decbb1;padding:9px 10px}.morph-table{width:100%;border-collapse:collapse;font-size:12px}.morph-table th,.morph-table td{text-align:left;padding:7px 0;border-bottom:1px solid var(--line-soft);vertical-align:top}.morph-table th{color:var(--muted);font-weight:normal;width:40%}
.section-header{min-height:90px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:18px 25px}.section-header h1{font-size:22px;margin:0 0 4px}.section-header p{font-size:12px;color:var(--muted);margin:0}.section-title-row{display:flex;gap:8px;align-items:center}.count-badge{font-size:11px;background:#eee9e3;border-radius:20px;padding:4px 7px;color:var(--muted)}.dark-btn{border:1px solid var(--ink);background:var(--ink);color:var(--paper);padding:9px 14px;font-size:12px;border-radius:2px}
.search-panel{padding:18px 25px}.search-box{height:46px;border:1px solid var(--line);display:flex;align-items:center;padding:0 14px;gap:10px}.search-box svg{width:18px}.search-box input,.notes-toolbar input{border:0;outline:0;background:transparent;width:100%;font-family:var(--body-font)}.search-filters{display:flex;gap:8px;margin:14px 0}.filter{border:1px solid var(--line);background:transparent;padding:6px 10px;font-size:11px}.filter.active{background:var(--ink);color:var(--paper)}.search-result{border-top:1px solid var(--line-soft);padding:15px 3px}.search-result:first-child{border-top:0}.result-ref{font-size:11px;color:var(--muted);margin-bottom:6px}.search-result p{margin:0;font-size:16px;line-height:1.55}.search-empty{padding:38px 0;color:var(--muted);font-size:13px}
.notes-toolbar{display:flex;gap:12px;padding:16px 25px;border-bottom:1px solid var(--line)}.notes-toolbar input{border:1px solid var(--line);padding:10px 12px}.notes-toolbar select{border:1px solid var(--line);background:transparent;padding:8px 11px}.note-row{padding:19px 25px;border-bottom:1px solid var(--line);position:relative}.note-meta{font-size:11px;color:var(--muted);margin-bottom:10px}.note-body{font-size:15px;line-height:1.55;white-space:pre-wrap}.note-tags{font-size:10px;color:var(--muted);margin-top:9px}.row-actions{position:absolute;right:20px;top:20px;display:flex;gap:5px}.row-actions button{border:0;background:transparent;font-size:11px;color:var(--muted)}
.highlight-row{padding:18px 25px;border-bottom:1px solid var(--line);min-height:88px}.highlight-row.amber{background:var(--amber)}.highlight-row.green{background:var(--green)}.highlight-row.blue{background:var(--blue)}.highlight-row.rose{background:var(--rose)}.highlight-meta{font-size:11px;color:#6e635b;margin-bottom:9px}.highlight-text{font-size:17px;line-height:1.5}
.library-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;padding:24px}.library-card{border:1px solid var(--line);display:flex;gap:15px;padding:15px;min-height:140px}.library-card.muted{color:var(--muted)}.book-spine{width:62px;min-width:62px;background:#211a16;color:#faf7f2;display:grid;place-items:center;font-size:12px;letter-spacing:.1em}.library-card h2{font-size:17px;margin:9px 0 6px}.library-card p{font-size:12px;line-height:1.5;color:var(--muted)}.library-card span{font-size:10px;text-transform:uppercase;letter-spacing:.08em}
.settings-view{padding-bottom:60px}.settings-section{padding:24px 25px;border-bottom:1px solid var(--line-soft)}.settings-section h2{font-size:16px;margin:12px 0 3px}.settings-section>p{font-size:11px;color:var(--muted)}.theme-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.theme-card{border:1px solid var(--line);background:transparent;text-align:left;padding:10px}.theme-card.active{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}.theme-preview{height:52px;border:1px solid var(--line);padding:10px;display:flex;flex-direction:column;gap:6px}.theme-preview i{height:4px;background:#cfc8bf;border-radius:4px}.theme-preview i:nth-child(2){width:83%}.theme-preview i:nth-child(3){width:66%}.dark-preview{background:#100d0b}.dark-preview i{background:#46403c}.parchment-preview{background:#f4e8bd}.parchment-preview i{background:#cabd91}.theme-card span{font-size:12px;display:block;margin-top:7px}.size-options{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0}.size-options button,.setting-row button{border:1px solid var(--line);background:transparent;padding:8px}.size-options button.active{background:var(--ink);color:var(--paper)}.font-preview{border:1px solid var(--line-soft);padding:18px;font-size:18px}.setting-row{display:flex;justify-content:space-between;gap:20px;align-items:center;border:1px solid var(--line-soft);padding:12px 15px;margin-top:10px}.setting-row h3{font-size:13px;margin:0 0 3px}.setting-row p{font-size:11px;color:var(--muted);margin:0}
.selection-toolbar,.highlight-palette{position:fixed;z-index:100;background:var(--ink);color:var(--paper);border-radius:3px;box-shadow:0 4px 16px rgba(0,0,0,.18);display:flex}.selection-toolbar button{border:0;background:transparent;color:inherit;padding:8px 10px;font-size:11px}.selection-toolbar button+button{border-left:1px solid #4d4540}.highlight-palette{padding:6px;gap:6px}.highlight-palette button{width:23px;height:23px;border:1px solid rgba(255,255,255,.35);border-radius:1px}.highlight-palette button[data-color=amber]{background:var(--amber)}.highlight-palette button[data-color=green]{background:var(--green)}.highlight-palette button[data-color=blue]{background:var(--blue)}.highlight-palette button[data-color=rose]{background:var(--rose)}
.note-dialog{border:1px solid var(--line);border-radius:2px;background:var(--paper);color:var(--ink);padding:0;width:min(620px,calc(100vw - 30px));box-shadow:0 16px 48px rgba(0,0,0,.2)}.note-dialog::backdrop{background:rgba(28,23,20,.3)}.note-dialog header{display:flex;justify-content:space-between;align-items:flex-start;padding:17px;border-bottom:1px solid var(--line)}.note-dialog h2{font-size:18px;margin:5px 0 0}.note-dialog textarea{width:calc(100% - 34px);margin:17px;border:1px solid var(--line);background:transparent;padding:12px;resize:vertical}.tag-field{display:block;margin:0 17px 17px;font-size:11px;color:var(--muted)}.tag-field input{display:block;width:100%;border:1px solid var(--line);background:transparent;padding:9px;margin-top:6px}.note-dialog footer{display:flex;justify-content:flex-end;gap:9px;padding:12px 17px;border-top:1px solid var(--line)}.note-dialog footer button{padding:8px 13px;border:1px solid var(--line);background:transparent}.note-dialog footer .dark-btn{background:var(--ink);color:var(--paper);border-color:var(--ink)}
html[data-theme=dark],body[data-theme=dark]{--paper:#171411;--paper-2:#201b17;--ink:#f3eee6;--muted:#aaa096;--line:#3b342e;--line-soft:#2c2722;--rail:#12100e;--accent:#f3eee6;--word-underline:#66584c;--amber:#675523;--green:#274f3c;--blue:#29445c;--rose:#5b3435}.dark-btn{transition:none}html[data-theme=parchment],body[data-theme=parchment]{--paper:#f4e8bd;--paper-2:#efe0ac;--rail:#ecdda9;--line:#d0bf8c;--line-soft:#dfcf9e;--word-underline:#b89e6d}
@media(max-width:950px){:root{--drawer:340px}.topbar-center .top-select:first-child,.topbar-center .top-sep:first-of-type{display:none}.reader-page{max-width:680px;padding-left:24px;padding-right:24px}}
@media(max-width:760px){body{overflow:auto}.app-shell{min-height:100vh;height:auto;grid-template-columns:1fr;padding-bottom:58px}.primary-rail{position:fixed;bottom:0;left:0;right:0;height:58px;z-index:60;border-right:0;border-top:1px solid var(--line);flex-direction:row;background:var(--paper)}.brand-mark,.theme-quick{display:none}.primary-nav{padding:0;flex:1;display:grid;grid-template-columns:repeat(5,1fr)}.rail-item{padding:7px 2px;font-size:9px}.rail-item svg{width:18px;height:18px}.workspace{min-height:calc(100vh - 58px)}.topbar{grid-template-columns:1fr auto;height:auto;min-height:58px;padding:7px 9px}.topbar-left{display:none}.topbar-center{justify-self:start;gap:4px;flex-wrap:wrap}.top-select{display:flex!important}.top-select span{font-size:8px}.top-select select{font-size:12px;max-width:105px}.topbar-actions{gap:1px}.icon-btn{width:31px;height:31px;padding:6px}.reader-view{min-height:calc(100vh - 116px)}.chapter-rail{display:none}.reader-page{padding:26px 20px 95px;max-width:100%}.chapter-heading{font-size:24px}.scripture-text{font-size:var(--font-size);line-height:1.7}.study-drawer{position:absolute;inset:auto 0 0 0;width:100%!important;max-height:72%;height:0;z-index:45;border-left:0;border-top:0;box-shadow:0 -8px 30px rgba(0,0,0,.12);transition:height .18s}.study-drawer.open{height:72%;border-top:1px solid var(--line)}.study-scroll{background:var(--paper)}.section-header{padding:16px 14px}.search-panel,.notes-toolbar{padding:14px}.note-row,.highlight-row{padding-left:14px;padding-right:14px}.theme-options{grid-template-columns:1fr}.size-options{grid-template-columns:1fr 1fr}.library-grid{grid-template-columns:1fr;padding:14px}.selection-toolbar{font-size:11px}}
.original-word{font-size:28px;line-height:1.35;margin:8px 0 4px;font-family:"Times New Roman",serif}.study-meta{color:var(--muted);font-size:12px}.data-warning{border-left:2px solid var(--amber);padding:8px 10px;background:var(--amber-soft);font-size:13px;line-height:1.5}

/* V8 reader polish */
.topbar{grid-template-columns:auto 1fr auto;padding:0 12px;gap:10px}
.topbar-left{min-width:150px}.topbar-center{justify-self:start;gap:5px;margin-left:4px}.top-select{gap:3px}.top-select span{font-size:9px}.top-select select{font-size:13px;max-width:130px}.top-sep{margin:0 1px}
.bookmark-top-btn{position:relative}.bookmark-top-btn svg{fill:none}
.bookmark-ribbon{border:0;background:transparent;padding:0;width:19px;height:27px;position:relative;display:inline-block}.bookmark-ribbon span{display:block;width:14px;height:23px;background:#8e2f2a;margin:0 auto;clip-path:polygon(0 0,100% 0,100% 100%,50% 76%,0 100%);box-shadow:0 1px 2px rgba(0,0,0,.18)}.verse-bookmark{vertical-align:top;margin:-3px 4px 0 0;transform:scale(.72);transform-origin:top center}
.bookmark-row{display:grid;grid-template-columns:28px 1fr;gap:10px;padding:14px 17px;border-bottom:1px solid var(--line-soft)}.bookmark-link{border:0;background:transparent;padding:0;font-weight:700}.bookmark-row p{margin:5px 0;font-size:13px;line-height:1.5}.bookmark-row small{color:var(--muted);font-size:10px}.bookmark-list{max-height:55vh;overflow:auto}
.passsage-dialog{}
.passage-dialog{border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:0;width:min(760px,calc(100vw - 28px));max-height:82vh}.passage-dialog::backdrop{background:rgba(28,23,20,.33)}.passage-dialog header{display:flex;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line)}.passage-dialog h2{margin:4px 0 0;font-size:18px}.passage-tabs{display:flex;border-bottom:1px solid var(--line);padding:0 16px}.passage-tabs button{border:0;background:transparent;padding:12px 13px;font-size:11px;color:var(--muted);border-bottom:2px solid transparent}.passage-tabs button.active{color:var(--ink);border-bottom-color:var(--ink)}.book-picker-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:16px;max-height:250px;overflow:auto}.book-picker-grid button,.number-grid button{border:1px solid var(--line);background:transparent;padding:8px 7px;text-align:center;font-size:12px}.book-picker-grid button.active,.number-grid button:hover{background:var(--ink);color:var(--paper)}.passage-step{padding:0 16px 16px}.number-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:5px}.number-grid button{text-align:center;padding:7px 4px}.passage-dialog footer{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid var(--line)}.passage-dialog footer button{border:1px solid var(--line);background:transparent;padding:7px 11px}
.rich-toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:11px 17px 0}.rich-toolbar button{border:1px solid var(--line);background:transparent;padding:6px 8px;font-size:11px}.rich-editor{margin:10px 17px 17px;border:1px solid var(--line);min-height:220px;padding:12px;outline:0;line-height:1.55;overflow:auto}.rich-editor:empty:before{content:attr(data-placeholder);color:var(--muted)}.rich-editor h1,.note-rich-body h1{font-size:24px;margin:.5em 0}.rich-editor h2,.note-rich-body h2{font-size:19px;margin:.5em 0}.rich-editor img,.note-rich-body img{max-width:100%;height:auto;display:block;margin:10px 0}.note-rich-body a,.rich-editor a{color:inherit;text-decoration:underline}.note-rich-body ul{padding-left:22px}
.ref-book-group{padding:8px 0 12px;border-bottom:1px solid var(--line-soft)}.ref-book-group h4{font-size:12px;margin:0 0 8px}.ref-book-group h4 span{font-weight:400;color:var(--muted);margin-left:5px}.rendering-chip{cursor:pointer}.rendering-chip:hover,.ref-chip:hover{background:var(--ink);color:var(--paper)}
.reference-preview-body{padding:18px}.reference-preview-text{font-size:17px;line-height:1.65;margin:0}.reference-preview-text sup{color:#7d4e31;margin-right:5px}.strong-hit{font-weight:800;background:rgba(142,47,42,.09);padding:0 1px}
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:200;background:var(--ink);color:var(--paper);padding:9px 14px;border-radius:2px;font-size:12px;box-shadow:0 5px 20px rgba(0,0,0,.22)}

@media(max-width:950px){.topbar-left{min-width:auto}.topbar{gap:4px}.topbar-center{margin-left:0}.top-select select{max-width:112px}}
@media(max-width:760px){.topbar{grid-template-columns:1fr auto;padding:6px 8px}.topbar-center{gap:2px;min-width:0}.top-select{gap:2px}.top-select span{display:none}.top-select select{font-size:12px;max-width:92px}.top-sep{font-size:11px}.topbar-actions{gap:0}.bookmark-top-btn{display:inline-flex}.book-picker-grid{grid-template-columns:repeat(2,1fr);max-height:230px}.number-grid{grid-template-columns:repeat(6,1fr)}.passage-dialog{max-height:90vh}.rich-toolbar{padding-left:12px;padding-right:12px}.rich-editor{margin-left:12px;margin-right:12px;min-height:190px}.toast{bottom:72px;max-width:calc(100vw - 30px);text-align:center}.verse-bookmark{margin-left:-3px}.reference-preview-dialog{width:calc(100vw - 24px)}}

/* V9 navigation, bookmark, history, paragraph and notes refinements */
.brand-mark .door-logo{width:32px;height:32px;overflow:visible}
.door-logo .door-arch,.door-logo .door-frame,.door-logo .door-panel,.door-logo .door-ray{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
.door-logo .door-arch{stroke-width:1.9}.door-logo .door-frame{stroke-width:1.2}.door-logo .door-panel{stroke-width:1.1}
.door-logo .door-light{fill:#d7b35d;stroke:#8b6a2d;stroke-width:.65}.door-logo .door-ray{stroke:#d7b35d;stroke-width:1.2}.door-logo .door-knob{fill:#d7b35d;stroke:none}

.topbar{grid-template-columns:auto auto 1fr;justify-content:start;column-gap:10px}
.topbar-left{min-width:0}.topbar-center{justify-self:start;margin-left:0;gap:3px;padding-left:4px}
.top-select{gap:3px}.top-select span{font-size:8px;letter-spacing:.15em}.top-select select{font-size:13px;max-width:104px;padding-right:15px}
.top-sep{margin:0 2px;color:#a89e94}.topbar-actions{justify-self:end;margin-left:auto;gap:2px}
.history-nav-btn:disabled{opacity:.28;cursor:default}.history-nav-btn svg{stroke-width:1.55}
.bookmark-top-btn.active svg{fill:#8e2f2a;stroke:#8e2f2a}

.verse.paragraph-start:not(:first-child)::before{content:"";display:block;height:.82em}
.verse.range-selected{background:rgba(181,203,220,.28);box-shadow:inset 0 -1px 0 rgba(80,105,125,.22)}
.verse-number{cursor:pointer}.verse-number:hover{color:#8e2f2a}

.history-list{max-height:58vh;overflow:auto}.history-row{width:100%;display:grid;gap:5px;text-align:left;border:0;border-bottom:1px solid var(--line-soft);background:transparent;padding:13px 17px;color:var(--ink)}
.history-row:hover{background:var(--panel)}.history-row strong{font-family:var(--serif);font-size:15px}.history-row span{font-size:12px;line-height:1.45;color:var(--ink)}.history-row small{font-size:9px;color:var(--muted)}

.notes-toolbar{align-items:center;flex-wrap:wrap}.notes-toolbar button,.bulk-notes-bar button{border:1px solid var(--line);background:var(--paper);padding:9px 11px;color:var(--ink)}
.bulk-notes-bar{display:flex;align-items:center;gap:8px;padding:10px 25px;border-bottom:1px solid var(--line);background:var(--panel);flex-wrap:wrap}.bulk-notes-bar[hidden]{display:none}.bulk-notes-bar input{border:1px solid var(--line);background:var(--paper);padding:9px 10px}.bulk-notes-bar .danger-btn{border-color:#a65b56;color:#8e2f2a}.note-row{padding-left:50px}.note-select{position:absolute;left:22px;top:20px}.note-select input{width:15px;height:15px}

@media(max-width:1100px){.topbar{column-gap:5px}.topbar-center{gap:1px}.top-select select{max-width:88px}.history-nav-btn{width:29px}}
@media(max-width:760px){
  .topbar{grid-template-columns:1fr auto;column-gap:2px}.topbar-center{padding-left:0;gap:1px}.top-select select{max-width:82px;font-size:11px}.topbar-actions{gap:0}.topbar-actions .icon-btn{width:28px;height:30px;padding:5px}.history-nav-btn{display:inline-flex}.bookmark-top-btn{display:inline-flex}
  .verse.paragraph-start:not(:first-child)::before{height:.7em}.bulk-notes-bar{padding:9px 14px}.note-row{padding-left:42px}.note-select{left:13px}.history-dialog{width:calc(100vw - 24px)}
}

/* V10 compact navigation, paragraph, history, theme and font refinements */
.topbar-center{justify-self:center;display:inline-flex!important;align-items:center;gap:0!important;border:1px solid var(--line);background:var(--paper-2);border-radius:999px;padding:3px 7px;white-space:nowrap;max-width:min(430px,42vw)}
.top-select{gap:3px!important;padding:0 4px}.top-select span{font-size:7px!important;letter-spacing:.08em!important;font-weight:700}.top-select select{border:0!important;background:transparent!important;appearance:auto;font-size:12px!important;max-width:105px!important;min-width:0!important;padding:4px 2px!important}.top-sep{font-size:10px;margin:0 1px;color:var(--muted)}
.number-grid button.active{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.verse.paragraph-start:not(:first-child)::before{content:"";display:block;height:1.15em}
.chapter-end-nav{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:38px 0 8px;padding-top:20px;border-top:1px solid var(--line)}
.chapter-end-nav button{border:1px solid var(--line);background:var(--paper-2);padding:12px 14px;text-align:left;min-height:74px}.chapter-end-nav button:last-child{text-align:right}.chapter-end-nav span{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:5px}.chapter-end-nav strong{font-size:12px;line-height:1.45;font-weight:600}
.font-family-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}.font-family-options button{border:1px solid var(--line);background:transparent;padding:10px}.font-family-options button.active{background:var(--ink);color:var(--paper)}
.tag-field{font-size:12px}.tag-help{float:right;font-size:9px;color:var(--muted)}.tag-field input{width:100%;min-height:42px;font-size:14px!important;line-height:1.2;background:var(--paper)!important;position:relative;z-index:2}
.history-pagination{display:flex!important;align-items:center;justify-content:space-between!important}.history-pagination span{font-size:11px;color:var(--muted)}.history-pagination button:disabled{opacity:.35}
body[data-theme=dark] .chip,body[data-theme=dark] .ref-chip,body[data-theme=dark] .rendering-chip{background:var(--paper-2)!important;color:var(--ink)!important;border-color:var(--line)!important}
body[data-theme=dark] .search-result,body[data-theme=dark] .reference-preview-text,body[data-theme=dark] .ref-book-group,body[data-theme=dark] .study-section{color:var(--ink)}
body[data-theme=dark] .word.hl-amber,body[data-theme=dark] .verse.whole-amber{background:#8a7330;color:#fff8e8}body[data-theme=dark] .word.hl-green,body[data-theme=dark] .verse.whole-green{background:#32664c;color:#f7fff9}body[data-theme=dark] .word.hl-blue,body[data-theme=dark] .verse.whole-blue{background:#345b79;color:#f5fbff}body[data-theme=dark] .word.hl-rose,body[data-theme=dark] .verse.whole-rose{background:#704345;color:#fff7f7}
body[data-theme=dark] .strong-hit{background:#6e5530;color:#fff6df}body[data-theme=dark] .reference-preview-dialog,body[data-theme=dark] dialog{background:var(--paper);color:var(--ink)}
body[data-theme=dark] .highlight-row.amber{background:#8a7330;color:#fff8e8}body[data-theme=dark] .highlight-row.green{background:#32664c;color:#f7fff9}body[data-theme=dark] .highlight-row.blue{background:#345b79;color:#f5fbff}body[data-theme=dark] .highlight-row.rose{background:#704345;color:#fff7f7}body[data-theme=dark] .highlight-meta{color:inherit;opacity:.82}
.door-light{fill:#f2d36b;stroke:#c4a646}.door-ray{stroke:#e3bd4e;opacity:.95}.door-panel{fill:var(--paper);stroke:currentColor}.door-arch,.door-frame{stroke-width:1.8}.door-knob{fill:#c7a33d;stroke:none}
@media(max-width:900px){.topbar-center{max-width:48vw}.top-select select{max-width:75px!important}.font-family-options{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.topbar-center{max-width:54vw;padding:2px 5px}.top-select{padding:0 2px}.top-select select{max-width:62px!important;font-size:10px!important}.chapter-end-nav{grid-template-columns:1fr}.chapter-end-nav button:last-child{text-align:left}.verse.paragraph-start:not(:first-child)::before{height:.95em}}

/* V11 light editorial navigation + notes/highlight refinements */
.passage-text-nav{border:0!important;background:transparent!important;border-radius:0!important;padding:0!important;max-width:none!important;gap:8px!important;white-space:nowrap}
.passage-text-part{border:0;background:transparent;color:var(--ink);display:inline-flex;align-items:baseline;gap:5px;padding:3px 1px;cursor:pointer;font:inherit}
.passage-text-part span{font-size:8px;letter-spacing:.16em;color:var(--muted);font-family:var(--sans);font-weight:600}
.passage-text-part strong{font-family:var(--serif);font-size:15px;font-weight:400}
.passage-text-part:hover strong{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}
.passage-text-sep{color:var(--line);font-size:16px;font-weight:300}
.chapter-end-nav{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:40px 0 8px;padding-top:18px;border-top:1px solid var(--line);align-items:start}
.chapter-end-nav .chapter-text-link{border:0!important;background:transparent!important;min-height:0!important;padding:4px 0!important;color:var(--muted);font-family:var(--serif);font-size:13px;line-height:1.4;text-align:left;cursor:pointer}
.chapter-end-nav .chapter-text-link:last-child{text-align:right}.chapter-end-nav .chapter-text-link:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.notes-toolbar>*{height:38px;box-sizing:border-box}.notes-toolbar button,.notes-toolbar select{min-width:112px;padding:0 12px!important;font-size:12px}.notes-toolbar input{height:38px;min-width:230px}
.note-tags{font-size:13px!important;line-height:1.55;color:var(--ink)!important}.multi-ref-count{font-size:10px;color:var(--muted)}
.study-note-item{padding:0 0 16px;margin-bottom:16px;border-bottom:1px solid var(--line-soft)}.study-note-actions{display:flex;gap:12px;margin-top:10px}.study-note-actions button{border:0;background:transparent;padding:0;color:var(--muted);font-size:11px}.study-note-actions button:hover{color:var(--ink);text-decoration:underline}
.tag-field,.reference-field{font-size:13px}.tag-field input{pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important;cursor:text!important;caret-color:var(--ink);padding:10px 12px!important}.tag-help{font-size:10px}
.selection-toolbar[hidden],.highlight-palette[hidden]{display:none!important}.highlight-palette{pointer-events:auto}
@media(max-width:760px){.passage-text-nav{gap:4px!important;overflow:hidden}.passage-text-part span{font-size:7px}.passage-text-part strong{font-size:12px;max-width:82px;overflow:hidden;text-overflow:ellipsis}.passage-text-sep{font-size:12px}.chapter-end-nav{grid-template-columns:1fr 1fr;gap:10px}.chapter-end-nav .chapter-text-link{font-size:12px}.notes-toolbar>*{width:100%;min-width:0!important}.notes-toolbar{display:grid;grid-template-columns:1fr 1fr}.notes-toolbar input{grid-column:1/-1}.notes-toolbar select,.notes-toolbar button{width:100%}}

/* V11.5 UI-only patch */
.rich-editor{pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important;cursor:text!important;caret-color:var(--ink)}
.note-dialog input,.note-dialog textarea,.note-dialog [contenteditable="true"]{pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important}

/* V13 auth + scan note */
.auth-pending{visibility:hidden}.auth-gate{position:fixed;inset:0;z-index:9999;background:var(--paper);display:grid;place-items:center}.auth-gate[hidden]{display:none}.auth-gate-inner{font-size:14px;color:var(--muted)}
.notes-header-actions{display:flex;align-items:center;gap:10px}.text-action{border:0;background:transparent;padding:8px 2px;border-bottom:1px solid var(--line);font-size:12px}.account-body{padding:18px}.scan-note-dialog{width:min(900px,calc(100vw - 24px));max-height:88vh}.scan-note-head{display:flex;justify-content:space-between;padding:17px;border-bottom:1px solid var(--line)}.scan-note-head h2{margin:4px 0 0;font-size:18px}.scan-layout{display:grid;grid-template-columns:minmax(220px,34%) 1fr;min-height:360px}.scan-preview-wrap{padding:18px;border-right:1px solid var(--line);background:var(--paper-2)}.scan-preview-wrap img{display:block;max-width:100%;max-height:62vh;margin:0 auto;object-fit:contain}.scan-preview-wrap p{font-size:12px;line-height:1.4}.scan-review{padding:18px;overflow:auto;max-height:65vh}.scan-section{padding:16px 0;border-top:1px solid var(--line-soft)}.scan-section:first-child{border-top:0}.scan-section-top{display:grid;grid-template-columns:auto 1fr 1.4fr;gap:10px;align-items:end}.scan-section-top label{font-size:10px;color:var(--muted)}.scan-section-top input[type=text]{width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;padding:7px 2px;outline:0}.scan-include{display:flex!important;align-items:center;gap:5px;padding-bottom:7px}.scan-item{display:grid;grid-template-columns:85px 1fr auto;gap:8px;align-items:start;margin-top:9px}.scan-item select,.scan-item textarea{border:1px solid var(--line);background:transparent;padding:7px;font-size:12px}.scan-item textarea{width:100%;min-height:54px;resize:vertical}.scan-strike{font-size:10px;color:var(--muted);display:flex;gap:4px;align-items:center;padding-top:8px}.scan-note-dialog footer{display:flex;justify-content:flex-end;gap:9px;padding:12px 17px;border-top:1px solid var(--line)}
@media(max-width:760px){.notes-header-actions{gap:6px}.scan-layout{grid-template-columns:1fr}.scan-preview-wrap{border-right:0;border-bottom:1px solid var(--line)}.scan-preview-wrap img{max-height:28vh}.scan-section-top{grid-template-columns:auto 1fr}.scan-section-top label:last-child{grid-column:1/-1}.scan-item{grid-template-columns:1fr}.scan-strike{padding-top:0}}


/* V14.1 sync reliability + mobile navigation/selection stability */
.brand-label{display:none}
.mobile-bible-back{display:none}
@media(max-width:760px){
  .primary-rail{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));align-items:stretch;height:62px;padding-bottom:env(safe-area-inset-bottom)}
  .brand-mark{display:flex!important;height:auto!important;border:0!important;padding:7px 2px!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--muted)}
  .brand-mark svg{width:18px;height:18px}
  .brand-label{display:block;font-size:9px;line-height:1.1}
  .primary-nav{display:contents!important}
  .rail-item{justify-content:center;min-width:0}
  .workspace{min-height:calc(100vh - 62px)}
  .app-shell{padding-bottom:62px}
  .mobile-bible-back{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--muted);padding:4px 8px 4px 0;font-size:12px;font-weight:400}
  .section-header{position:relative;gap:8px;align-items:flex-start}
  .section-header>.mobile-bible-back+div{flex:1;min-width:0}
  .selection-toolbar{max-width:calc(100vw - 16px);white-space:nowrap;touch-action:manipulation}
}

/* V15 mobile redesign — screenshot-led reader */
.mobile-reader-topbar,.mobile-bottom-nav,.mobile-action-sheet,.mobile-sheet-backdrop{display:none}
.mobile-reader-topbar svg,.mobile-bottom-nav svg{fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}

@media(max-width:760px){
  :root{--mobile-nav-h:72px;--mobile-top-h:58px}
  body{overflow:auto}
  .app-shell{display:block!important;padding-bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));min-height:100vh}
  .primary-rail{display:none!important}
  .workspace{min-height:100vh!important}
  #readerTopbar{display:none!important}

  .mobile-reader-topbar{display:grid;grid-template-columns:1fr minmax(0,1.7fr) 1fr;align-items:center;gap:2px;position:sticky;top:0;z-index:56;height:var(--mobile-top-h);padding:env(safe-area-inset-top) 10px 0;background:color-mix(in srgb,var(--paper) 96%,transparent);border-bottom:1px solid var(--line-soft);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
  .mobile-reader-topbar[hidden]{display:none!important}
  .mobile-top-side{display:flex;align-items:center;gap:2px;min-width:0}
  .mobile-top-side-left{justify-self:start}
  .mobile-top-side-right{justify-self:end;justify-content:flex-end}
  .mobile-top-icon,.mobile-passage-button{border:0;background:transparent;color:var(--ink);height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0}
  .mobile-top-icon svg{width:25px;height:25px}
  .mobile-top-icon-spacer{visibility:hidden;pointer-events:none}
  .mobile-passage-button{justify-self:center;gap:7px;min-width:0;max-width:100%;font-family:var(--body-font);font-size:20px;font-weight:400;white-space:nowrap}
  .mobile-passage-button span{overflow:hidden;text-overflow:ellipsis}
  .mobile-passage-button svg{width:17px;height:17px;flex:0 0 auto}

  .reader-view{min-height:calc(100vh - var(--mobile-top-h) - var(--mobile-nav-h))!important}
  .reading-pane{min-height:0;overflow:visible!important}
  .reader-page{max-width:100%!important;padding:22px 24px 92px!important}
  .chapter-heading{display:none!important}
  .scripture-text{font-size:var(--font-size);line-height:1.72;letter-spacing:-.008em}
  .verse-number{font-size:.58em;margin-right:7px;color:#a96510}
  .verse-note-indicator{display:inline-flex;vertical-align:baseline;margin:0 6px 0 1px;color:#b36b08;background:transparent;border:0;padding:0;transform:translateY(2px)}
  .verse-note-indicator svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  .verse-bookmark{position:absolute;right:-12px;margin:0!important;transform:translateY(2px)}
  .verse{position:relative}
  .chapter-end-nav{margin-top:32px;padding-top:14px;border-top:1px solid var(--line-soft)}

  .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:90;min-height:var(--mobile-nav-h);padding:4px 7px calc(4px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--paper) 97%,transparent);border-top:1px solid var(--line-soft);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .mobile-bottom-nav button{position:relative;border:0;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;padding:5px 2px;font-family:var(--body-font);font-size:10px;font-weight:400}
  .mobile-bottom-nav button svg{width:23px;height:23px}
  .mobile-bottom-nav button.active{color:#a96510}
  .mobile-bottom-nav button.active::before{content:"";position:absolute;top:-5px;width:42px;height:2px;background:#b57517}
  .mobile-bottom-nav .mobile-bible-home svg{width:29px;height:29px}
  .mobile-bottom-nav .mobile-bible-home span{font-size:11px}

  .content-view{padding-bottom:calc(var(--mobile-nav-h) + 16px)}
  .mobile-bible-back{display:none!important}

  /* Word study is a viewport-fixed bottom sheet, never document-positioned. */
  .study-drawer{position:fixed!important;left:0!important;right:0!important;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom))!important;top:auto!important;width:100%!important;max-width:none!important;height:0!important;max-height:min(64vh,560px)!important;z-index:85!important;border:0!important;border-radius:22px 22px 0 0;background:var(--paper);box-shadow:0 -10px 34px rgba(0,0,0,.14);overflow:hidden;transition:height .2s ease,transform .2s ease;transform:translateY(8px)}
  .study-drawer::before{content:"";display:block;width:42px;height:4px;border-radius:4px;background:var(--line);margin:10px auto 1px}
  .study-drawer.open{height:min(57vh,500px)!important;transform:translateY(0);border-top:1px solid var(--line-soft)!important}
  .study-header{min-height:0;padding:9px 18px 10px;border-bottom:0}
  .lemma-line{font-size:calc(var(--font-size) - 1px)}
  .lemma-line small{font-size:calc(var(--font-size) - 4px)}
  .study-meta{font-size:calc(var(--font-size) - 5px)}
  .study-tabs{padding:0 13px;overflow-x:auto;gap:2px;flex:0 0 auto}
  .study-tab{font-family:var(--body-font);font-size:calc(var(--font-size) - 4px);padding:10px 10px;white-space:nowrap}
  .study-scroll{padding:0 18px 26px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .study-section{padding:14px 0}
  .eyebrow,.study-section h3{font-size:calc(var(--font-size) - 8px)}
  .study-section p{font-size:calc(var(--font-size) - 2px);line-height:1.55}
  .study-quote{font-size:var(--font-size)}
  .chip,.ref-chip{font-size:calc(var(--font-size) - 4px);padding:8px 10px}
  .metric{padding:13px 8px;border-radius:8px}
  .metric strong{font-size:calc(var(--font-size) + 4px)}
  .metric span{font-size:calc(var(--font-size) - 5px)}
  .external-link{font-size:calc(var(--font-size) - 4px)}
  .close-btn{min-width:40px;min-height:40px;font-size:24px}

  /* Long-press selection controls stay inside the current visual viewport. */
  .selection-toolbar{z-index:110!important;border-radius:8px!important;box-shadow:0 8px 24px rgba(0,0,0,.22)!important;max-width:calc(100vw - 16px)!important}
  .selection-toolbar button{font-size:14px!important;padding:10px 13px!important}
  .highlight-palette{z-index:111!important;border-radius:8px!important;padding:8px!important;gap:8px!important}
  .highlight-palette button{width:30px!important;height:30px!important;border-radius:3px!important}

  .mobile-sheet-backdrop{display:block;position:fixed;inset:0;z-index:96;background:rgba(30,24,20,.24);opacity:0;pointer-events:none;transition:opacity .18s ease}
  .mobile-sheet-backdrop.open{opacity:1;pointer-events:auto}
  .mobile-action-sheet{display:block;position:fixed;left:10px;right:10px;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 8px);z-index:97;background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:8px 12px 14px;box-shadow:0 14px 44px rgba(0,0,0,.2);transform:translateY(calc(100% + 120px));transition:transform .2s ease}
  .mobile-action-sheet.open{transform:translateY(0)}
  .mobile-sheet-handle{width:38px;height:4px;border-radius:4px;background:var(--line);margin:3px auto 8px}
  .mobile-action-sheet h2{font-size:18px;font-weight:400;margin:4px 6px 8px}
  .mobile-action-sheet button{display:block;width:100%;text-align:left;border:0;border-top:1px solid var(--line-soft);background:transparent;color:var(--ink);padding:13px 8px;font-family:var(--body-font);font-size:15px}

  .scan-note-dialog{width:100vw!important;max-width:none!important;height:100dvh;max-height:100dvh!important;margin:0;border:0;border-radius:0}
  .scan-layout{display:block!important;min-height:0}
  .scan-preview-wrap{padding:12px 16px!important}
  .scan-preview-wrap img{max-height:22vh!important}
  .scan-review{padding:14px 16px!important;max-height:58vh!important}
  .scan-section{padding:13px 0!important}
  .scan-item{display:block!important;margin-top:7px!important}
  .scan-item select,.scan-item textarea{width:100%!important;font-size:15px!important;margin-bottom:7px}
  .scan-item textarea{min-height:82px!important}
}
@media(max-width:760px){
  .scripture-text,.scripture-text .word{-webkit-user-select:text!important;user-select:text!important}
  .scripture-text .word{-webkit-touch-callout:default}
}


/* V15.4 mobile fixes */
.passage-dialog-heading{display:flex;align-items:flex-start;gap:9px}
.passage-step-back{border:0;background:transparent;color:var(--ink);font-size:22px;line-height:1;padding:1px 4px 0 0}
.passage-tabs[hidden],.book-picker-grid[hidden],.passage-step[hidden]{display:none!important}

@media(max-width:760px){
  .passage-dialog{width:calc(100vw - 18px);max-height:88dvh}
  .passage-dialog header{padding:14px 15px}
  .book-picker-grid{grid-template-columns:repeat(2,1fr);max-height:64dvh;padding:14px}
  .book-picker-grid button{min-height:42px;text-align:center;font-size:14px}
  .passage-step{padding:14px}
  .number-grid{grid-template-columns:repeat(5,1fr);gap:7px}
  .number-grid button{min-height:42px;font-size:14px;text-align:center}

  /* Keep Hebrew/Greek lemma and transliteration from colliding with the tabs below. */
  .study-header{min-height:auto!important;padding:10px 18px 15px!important;align-items:flex-start}
  .lemma-line{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:6px;row-gap:4px;line-height:1.45!important;padding-bottom:2px}
  .lemma-line small{margin-left:0!important;line-height:1.4!important}
  .study-meta{line-height:1.45!important;margin-top:6px!important}
  .study-tabs{flex:0 0 auto}

  /* Full-screen note-taking workspace on mobile. */
  .note-dialog{width:100vw!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border:0!important;border-radius:0!important;padding:0!important}
  .note-dialog form{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
  .note-dialog header{flex:0 0 auto;padding:14px 15px}
  .note-dialog h2{font-size:20px}
  .rich-toolbar{flex:0 0 auto;padding:10px 12px 0;gap:5px;overflow-x:auto;flex-wrap:nowrap}
  .rich-toolbar button{flex:0 0 auto;min-height:36px;padding:7px 10px}
  .rich-editor{flex:1 1 auto;min-height:0!important;margin:10px 12px!important;padding:14px;font-size:17px;line-height:1.6;overflow:auto}
  .tag-field{flex:0 0 auto;margin:0 12px 10px;font-size:11px}
  .tag-field input{padding:10px;font-size:14px}
  .note-dialog footer{flex:0 0 auto;position:sticky;bottom:0;background:var(--paper);padding:10px 12px calc(10px + env(safe-area-inset-bottom));z-index:2}
  .note-dialog footer button{min-height:42px;padding:9px 16px;font-size:14px}
}


/* V15.5 mobile stability + plans */
.library-card-button{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer}
.plans-shell{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:22px;padding:18px 22px 40px}
.plans-calendar-panel{border-right:1px solid var(--line);padding-right:22px}
.plans-month-nav{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;gap:6px;margin-bottom:12px}
.plans-month-nav h2{font-size:20px;text-align:center;margin:0;font-weight:400}
.plans-month-nav button{border:0;background:transparent;color:var(--ink);font-size:20px;height:38px}
.plans-weekdays,.plans-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.plans-weekdays{font-size:10px;color:var(--muted);text-align:center;margin-bottom:6px}
.plans-calendar button,.plans-calendar .empty-day{aspect-ratio:1/1;min-width:0;border:0;background:transparent;color:var(--ink);display:flex;align-items:center;justify-content:center;font:inherit;font-size:13px;border-radius:50%}
.plans-calendar button:hover{background:var(--paper-2)}
.plans-calendar button.today{outline:1px solid #b57517;color:#9b5e0d}
.plans-calendar button.selected{background:var(--ink);color:var(--paper)}
.plans-calendar button.has-reading::after{content:"";position:absolute;width:3px;height:3px;border-radius:50%;background:currentColor;transform:translateY(14px);opacity:.65}
.plans-calendar button{position:relative}
.plans-source-note{font-size:11px;line-height:1.5;color:var(--muted);margin:16px 2px 0}
.devotional-reader{max-width:760px;padding:8px 8px 60px}
.devotional-date{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#9b5e0d;margin-bottom:8px}
.devotional-reader h2{font-size:28px;font-weight:400;margin:0 0 20px}
.devotional-body{font-family:var(--body-font);font-size:18px;line-height:1.72}
.devotional-body p{margin:0 0 1.15em}
.devotional-body .devotional-unavailable{color:var(--muted);font-style:italic}

@media(max-width:760px){
  :root{--mobile-nav-h:68px;--mobile-top-h:56px}
  .mobile-reader-topbar{display:block!important;position:sticky!important;height:calc(var(--mobile-top-h) + env(safe-area-inset-top))!important;padding:0!important;background:var(--paper)!important;border-bottom:1px solid var(--line-soft)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .mobile-passage-cluster{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 7px);transform:translateX(-50%);display:grid;grid-template-columns:38px minmax(0,auto) 38px;align-items:center;gap:0;max-width:calc(100vw - 92px);min-width:0}
  .mobile-passage-button{font-size:19px!important;max-width:min(58vw,250px)!important;padding:0 3px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-passage-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-history-only{position:absolute!important;right:8px;top:calc(env(safe-area-inset-top) + 7px);margin:0!important}
  .mobile-top-icon{width:38px!important;height:42px!important}
  .mobile-top-icon svg{width:23px!important;height:23px!important}

  .mobile-bottom-nav{height:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom))!important;min-height:0!important;padding:3px 7px env(safe-area-inset-bottom)!important;background:var(--paper)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .study-drawer{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) - 1px)!important;transform:none!important;transition:height .16s ease!important}
  .study-drawer.open{height:min(58dvh,520px)!important;transform:none!important}
  .study-header{min-height:88px!important;padding:14px 16px 11px!important;overflow:visible!important}
  .lemma-line{font-size:23px!important;line-height:1.5!important;min-height:34px;padding:2px 0 5px!important;overflow:visible!important}
  .lemma-line small{font-size:14px!important;line-height:1.45!important;vertical-align:baseline!important;margin-left:5px!important}
  .study-meta{font-size:14px!important;line-height:1.45!important;margin-top:2px!important;padding-bottom:3px}
  .study-scroll{padding-bottom:20px!important;overscroll-behavior:contain}
  .study-section p{font-size:max(16px,calc(var(--font-size) - 2px))!important;line-height:1.62!important}
  .study-quote{font-size:max(17px,calc(var(--font-size) - 1px))!important}
  .mobile-action-sheet{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 4px)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .mobile-sheet-backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

  /* Use our own long-press selection instead of Android/iOS browser selection UI. */
  #scriptureText,#scriptureText *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
  #scriptureText{touch-action:pan-y;overscroll-behavior-y:auto}
  #scriptureText .word{touch-action:pan-y}
  #scriptureText .word.mobile-custom-selected{background:var(--amber)!important;border-radius:1px;box-shadow:0 0 0 1px rgba(173,111,22,.08)}
  body.mobile-selecting{overscroll-behavior:none}
  body.mobile-selecting #scriptureText{touch-action:none}

  /* Full-screen note-taking workspace on mobile. */
  .note-workspace-dialog[open]{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
  .note-workspace-dialog form{height:100dvh!important;display:flex!important;flex-direction:column!important;min-height:0!important}
  .note-workspace-dialog .rich-toolbar{flex:0 0 auto;overflow-x:auto;white-space:nowrap;padding:8px 10px!important}
  .note-workspace-dialog .rich-editor{flex:1 1 auto!important;min-height:46dvh!important;max-height:none!important;overflow:auto!important;margin:10px 12px!important;padding:14px!important;font-size:18px!important;line-height:1.62!important}
  .note-workspace-dialog .tag-field{flex:0 0 auto;margin:0 12px 9px!important}
  .note-workspace-dialog footer{flex:0 0 auto!important;position:relative!important;margin-top:auto!important;background:var(--paper)!important;box-shadow:0 -1px 0 var(--line-soft)}

  .plans-shell{display:block;padding:10px 14px calc(var(--mobile-nav-h) + 28px)}
  .plans-calendar-panel{border-right:0;padding-right:0;border-bottom:1px solid var(--line);padding-bottom:18px}
  .plans-calendar button,.plans-calendar .empty-day{font-size:14px}
  .devotional-reader{padding:22px 2px 50px;max-width:none}
  .devotional-reader h2{font-size:25px}
  .devotional-body{font-size:18px;line-height:1.68}
}


/* V16 — unified reader UI: desktop uses the same navigation and study pattern as mobile. */
#scriptureText,#scriptureText *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#scriptureText .word{cursor:pointer}
#scriptureText .word.mobile-custom-selected{background:var(--amber)!important;border-radius:1px;box-shadow:0 0 0 1px rgba(173,111,22,.08)}
body.mobile-selecting{overscroll-behavior:none}
body.mobile-selecting #scriptureText{touch-action:none}
.sync-status-body{padding:18px 20px}.sync-state-text{font-size:18px;margin:0 0 16px}.sync-count-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:0 0 18px}.sync-count-grid>div{border:1px solid var(--line);padding:13px 8px;text-align:center}.sync-count-grid strong{display:block;font-size:23px;font-weight:500}.sync-count-grid span{font-size:11px;color:var(--muted)}

@media(min-width:761px){
  :root{--mobile-nav-h:70px;--mobile-top-h:58px}
  body{overflow:auto}
  .app-shell{display:block!important;padding-bottom:var(--mobile-nav-h)!important;min-height:100vh!important}
  .primary-rail{display:none!important}
  .workspace{min-height:100vh!important}
  #readerTopbar{display:none!important}
  .mobile-reader-topbar{display:block!important;position:sticky!important;top:0!important;z-index:56!important;height:var(--mobile-top-h)!important;padding:0!important;background:var(--paper)!important;border-bottom:1px solid var(--line-soft)!important;max-width:920px;margin:0 auto}
  .mobile-reader-topbar[hidden]{display:none!important}
  .mobile-passage-cluster{position:absolute;left:50%;top:7px;transform:translateX(-50%);display:grid;grid-template-columns:40px minmax(0,auto) 40px;align-items:center;max-width:720px}
  .mobile-passage-button{border:0;background:transparent;color:var(--ink);height:44px;display:inline-flex;align-items:center;justify-content:center;font-family:var(--body-font);font-size:21px;font-weight:400;white-space:nowrap;padding:0 5px}
  .mobile-top-icon{border:0;background:transparent;color:var(--ink);width:40px;height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0}
  .mobile-top-icon svg{width:24px;height:24px}
  .mobile-history-only{position:absolute!important;right:8px;top:7px}
  .reader-view{min-height:calc(100vh - var(--mobile-top-h) - var(--mobile-nav-h))!important}
  .chapter-rail{display:none!important}
  .reading-pane{min-height:0;overflow:visible!important}
  .reader-page{max-width:820px!important;padding:34px 38px 120px!important;margin:0 auto!important}
  .chapter-heading{display:none!important}
  .scripture-text{font-size:var(--font-size);line-height:1.72;letter-spacing:-.008em}
  .verse-number{font-size:.58em;margin-right:7px;color:#a96510}
  .verse-note-indicator{display:inline-flex!important;vertical-align:baseline!important;margin:0 6px 0 1px!important;color:#b36b08!important;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important;transform:translateY(2px)!important;width:auto!important;height:auto!important}
  .verse-note-indicator svg{width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:round!important;stroke-linejoin:round!important}
  .mobile-bottom-nav{display:grid!important;grid-template-columns:repeat(5,1fr);position:fixed;left:50%;right:auto;bottom:0;transform:translateX(-50%);z-index:90;width:min(760px,100vw);min-height:var(--mobile-nav-h);padding:4px 7px;background:var(--paper);border:1px solid var(--line-soft);border-bottom:0;border-radius:16px 16px 0 0;box-shadow:0 -5px 22px rgba(0,0,0,.06)}
  .mobile-bottom-nav button{position:relative;border:0;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;padding:6px 2px;font-family:var(--body-font);font-size:10px;font-weight:400}
  .mobile-bottom-nav button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
  .mobile-bottom-nav button.active{color:#a96510}.mobile-bottom-nav button.active::before{content:"";position:absolute;top:-5px;width:42px;height:2px;background:#b57517}.mobile-bottom-nav .mobile-bible-home svg{width:29px;height:29px}
  .study-drawer{position:fixed!important;left:50%!important;right:auto!important;bottom:calc(var(--mobile-nav-h) - 1px)!important;top:auto!important;transform:translateX(-50%)!important;width:min(860px,100vw)!important;max-width:none!important;height:0!important;max-height:620px!important;z-index:85!important;border:0!important;border-radius:22px 22px 0 0;background:var(--paper)!important;box-shadow:0 -10px 34px rgba(0,0,0,.14)!important;overflow:hidden!important;transition:height .18s ease!important}
  .study-drawer::before{content:"";display:block;width:42px;height:4px;border-radius:4px;background:var(--line);margin:10px auto 1px}
  .study-drawer.open{height:min(58vh,540px)!important;border-top:1px solid var(--line-soft)!important}
  .study-header{min-height:88px!important;padding:14px 18px 11px!important}.lemma-line{font-size:23px!important;line-height:1.5!important}.lemma-line small{font-size:14px!important;line-height:1.45!important}.study-meta{font-size:14px!important;line-height:1.45!important}.study-section p{font-size:max(16px,calc(var(--font-size) - 2px))!important;line-height:1.62!important}
  .content-view{max-width:960px;margin:0 auto;padding-bottom:100px!important}
  .mobile-action-sheet{display:block;left:50%!important;right:auto!important;transform:translate(-50%,120%)!important;width:min(520px,calc(100vw - 24px))!important;bottom:calc(var(--mobile-nav-h) + 8px)!important}.mobile-action-sheet.open{transform:translate(-50%,0)!important}
  .mobile-sheet-backdrop{display:block}
  .note-workspace-dialog[open]{position:fixed!important;inset:3vh 4vw!important;width:92vw!important;height:94vh!important;max-width:1100px!important;max-height:none!important;margin:auto!important;border:1px solid var(--line)!important;border-radius:8px!important}.note-workspace-dialog form{height:100%!important;display:flex!important;flex-direction:column!important}.note-workspace-dialog .rich-editor{flex:1 1 auto!important;min-height:50vh!important;overflow:auto!important;font-size:18px!important;line-height:1.62!important}
  .selection-toolbar button{font-size:14px!important;padding:10px 13px!important}
}

@media(max-width:620px){.sync-count-grid{grid-template-columns:1fr 1fr}}

/* V16.1 desktop unified-UI hotfix ---------------------------------------
   Keep the mobile interaction model on desktop, but give the shared
   controls their complete desktop positioning/styling. */
@media(min-width:761px){
  .mobile-reader-topbar{
    display:block!important;
    position:sticky!important;
    top:0!important;
    width:100%!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
    padding:0!important;
    background:var(--paper)!important;
    border-bottom:1px solid var(--line-soft)!important;
    z-index:80!important;
  }
  .mobile-passage-cluster{
    position:absolute!important;
    left:50%!important;
    top:7px!important;
    transform:translateX(-50%)!important;
    display:grid!important;
    grid-template-columns:42px auto 42px!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    width:auto!important;
    max-width:calc(100vw - 160px)!important;
    white-space:nowrap!important;
  }
  .mobile-passage-button{
    min-width:0!important;
    max-width:520px!important;
    padding:0 10px!important;
    font-size:21px!important;
    line-height:44px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .mobile-passage-button span{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .mobile-history-only{
    position:absolute!important;
    right:18px!important;
    top:7px!important;
    margin:0!important;
  }

  /* These sheets previously inherited only their mobile positioning rules,
     so desktop rendered their buttons inline in the page. */
  .mobile-action-sheet{
    display:block!important;
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    bottom:78px!important;
    z-index:120!important;
    width:min(520px,calc(100vw - 32px))!important;
    max-height:min(70vh,620px)!important;
    overflow:auto!important;
    padding:8px 12px 14px!important;
    background:var(--paper)!important;
    color:var(--ink)!important;
    border:1px solid var(--line)!important;
    border-radius:18px!important;
    box-shadow:0 18px 52px rgba(0,0,0,.20)!important;
    transform:translate(-50%,calc(100% + 120px))!important;
    transition:transform .18s ease!important;
    pointer-events:none!important;
    visibility:hidden!important;
  }
  .mobile-action-sheet.open{
    transform:translate(-50%,0)!important;
    pointer-events:auto!important;
    visibility:visible!important;
  }
  .mobile-action-sheet .mobile-sheet-handle{width:42px;height:4px;border-radius:4px;background:var(--line);margin:2px auto 8px}
  .mobile-action-sheet h2{font-size:18px;font-weight:400;margin:4px 6px 8px}
  .mobile-action-sheet button{
    display:block!important;
    width:100%!important;
    text-align:left!important;
    border:0!important;
    border-top:1px solid var(--line-soft)!important;
    background:transparent!important;
    color:var(--ink)!important;
    padding:13px 8px!important;
    font-family:var(--body-font)!important;
    font-size:15px!important;
    cursor:pointer!important;
  }
  .mobile-sheet-backdrop{
    display:block;
    position:fixed!important;
    inset:0!important;
    z-index:110!important;
    background:rgba(28,23,20,.28)!important;
    opacity:0!important;
    transition:opacity .18s ease!important;
  }
  .mobile-sheet-backdrop[hidden]{display:none!important}
  .mobile-sheet-backdrop.open{opacity:1!important}

  .mobile-bottom-nav{z-index:130!important}
}


/* V16.2 reliability hotfix ------------------------------------------------ */
.verse-bookmark{position:absolute!important;left:-20px!important;right:auto!important;top:.08em!important;display:block!important;width:11px!important;height:17px!important;margin:0!important;vertical-align:baseline!important;transform:none!important;overflow:visible!important;z-index:2}
.verse-bookmark span{width:9px!important;height:15px!important;box-shadow:none!important}
.mobile-tool-highlight-colors{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;padding:8px 4px 4px}
.mobile-tool-highlight-colors[hidden]{display:none!important}
.mobile-tool-highlight-colors button{display:flex!important;align-items:center!important;gap:9px!important;border:1px solid var(--line-soft)!important;border-radius:8px!important;padding:10px!important;text-align:left!important}
.tool-color{display:inline-block;width:22px;height:22px;border:1px solid var(--line);border-radius:3px;flex:0 0 auto}.tool-color.amber{background:var(--amber)}.tool-color.green{background:var(--green)}.tool-color.blue{background:var(--blue)}.tool-color.rose{background:var(--rose)}
.search-result-summary{padding:9px 0 13px;color:var(--muted);font-size:13px;border-bottom:1px solid var(--line-soft);margin-bottom:2px}.search-load-more{display:block;margin:18px auto 4px;border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:10px 18px;font-family:var(--body-font);font-size:14px;border-radius:6px}.search-load-more:hover{background:var(--paper-2)}
.note-draft-status{margin-right:auto;color:var(--muted);font-size:12px;align-self:center}.note-workspace-dialog footer{gap:8px;align-items:center}


/* V16.3 verse actions + full-page theme hotfix ---------------------------- */
html,body,.app-shell,.workspace,.view,.content-view{background:var(--paper)}
html,body{min-height:100%;min-height:100dvh}
.verse-bookmark{position:relative!important;left:auto!important;right:auto!important;top:auto!important;display:inline-flex!important;align-items:flex-start!important;justify-content:center!important;width:14px!important;height:18px!important;margin:0 5px 0 0!important;vertical-align:baseline!important;transform:translateY(3px)!important;overflow:visible!important;z-index:auto!important}
.verse-bookmark span{display:block!important;width:9px!important;height:15px!important;margin:0 auto!important;box-shadow:none!important}
.study-note-item{padding:13px 0;border-bottom:1px solid var(--line-soft)}
.study-note-item:last-of-type{border-bottom:0}
.study-note-item.focused-note{outline:1px solid var(--line);outline-offset:5px;background:var(--paper-2)}
.study-note-actions{display:flex;gap:10px;margin-top:10px}.study-note-actions button{border:0;border-bottom:1px solid var(--line);background:transparent;padding:4px 0;color:var(--muted);font-size:11px}
body[data-theme=dark] .settings-view,body[data-theme=dark] .settings-section,body[data-theme=dark] .font-preview,body[data-theme=dark] .setting-row{background:var(--paper);color:var(--ink)}


/* V16.5 notes + cross-reference hotfix */
.verse-note-indicator.source-note{color:#a33a32!important}
.verse-note-indicator.cross-reference-note{color:#2d6f9f!important}
.note-reference-links{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:9px;font-size:11px;color:var(--muted)}
.note-reference-label{font-weight:600;letter-spacing:.02em}
.note-reference-link{border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;padding:2px 0!important;color:inherit!important;font:inherit!important;cursor:pointer}
.note-reference-link.source-reference{color:#8f3933!important}
.note-reference-link.cross-reference{color:#2d6f9f!important}
.note-reference-link:hover{color:var(--ink)!important;border-bottom-color:currentColor!important}
.note-reference-sep{opacity:.55}
.note-rich-body,.rich-editor{font-family:var(--body-font)}
.note-rich-body *,.rich-editor *{font-family:inherit}
@media(max-width:760px){.note-reference-links{gap:5px;line-height:1.45}.note-reference-label{flex-basis:auto}}

/* V16.6 desktop panel alignment hotfix -----------------------------------
   On desktop, the unified bottom navigation and the study/verse-notes
   drawer share one width so the drawer feels anchored to the navigation. */
@media(min-width:761px){
  :root{--desktop-study-shell-width:min(860px,calc(100vw - 24px))}
  .mobile-bottom-nav{
    width:var(--desktop-study-shell-width)!important;
  }
  .study-drawer{
    width:var(--desktop-study-shell-width)!important;
  }
}


/* V16.7 search book-result filtering */
.search-book-filter-wrap{padding:13px 0 10px;border-bottom:1px solid var(--line-soft);margin-bottom:2px}.search-book-filter-label{font-size:11px;color:var(--muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.08em}.search-book-filters{display:flex;flex-wrap:wrap;gap:6px}.search-book-filter{border:1px solid var(--line);background:transparent;color:var(--ink);padding:6px 9px;font-family:var(--body-font);font-size:12px;line-height:1.1;cursor:pointer}.search-book-filter span{color:var(--muted);font-size:11px;margin-left:3px}.search-book-filter.active{background:var(--ink);color:var(--paper)}.search-book-filter.active span{color:inherit;opacity:.78}
@media(max-width:700px){.search-book-filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}.search-book-filter{flex:0 0 auto;white-space:nowrap}}

/* V16.13: small theme-aware Sparrow artwork and built-in guide. */
.notes-art{flex:0 0 115px;width:115px;height:36px;object-fit:contain}[data-theme="dark"] .notes-art{filter:invert(1)}
.help-body{max-width:760px;padding:20px 26px 100px;line-height:1.65}.help-body details{border-bottom:1px solid var(--line);padding:16px 0}.help-body summary{cursor:pointer;font-size:18px}.help-body p{font-size:15px;color:var(--muted)}
@media(max-width:480px){.notes-header{gap:8px;flex-wrap:wrap}.notes-art{flex-basis:95px;width:95px;height:30px}.help-body{padding:16px 18px 110px}}

/* V16.14: chapter flower divider, matching the quiet line artwork. */
.chapter-ornament{display:flex;align-items:center;justify-content:center;gap:18px;width:min(385px,85%);margin:0 auto 24px;color:var(--ink);pointer-events:none;user-select:none}
.chapter-ornament>span{height:1px;background:var(--line);flex:1}
.chapter-ornament svg{display:block;flex:0 0 29px;width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:600px){.chapter-ornament{gap:14px;margin-bottom:20px;width:min(340px,90%)}.chapter-ornament svg{flex-basis:26px;width:26px;height:26px}}

/* V16.17: import review, subtle loading animation and editable tables. */
.note-import-hint{flex:0 0 auto;margin:8px 14px 0;font-size:11px;color:var(--muted);line-height:1.4}
.rich-editor table,.note-rich-body table{border-collapse:collapse;max-width:100%;display:table;margin:12px 0;table-layout:auto}.rich-editor td,.rich-editor th,.note-rich-body td,.note-rich-body th{border:1px solid var(--line);padding:8px;min-width:45px;vertical-align:top}.rich-editor td p,.note-rich-body td p{margin:0 0 6px}
.note-import-dialog{width:min(840px,94vw);max-height:90dvh;padding:0;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:8px;font-family:var(--ui-font)}.note-import-dialog::backdrop{background:rgba(0,0,0,.35)}.note-import-dialog header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line)}.note-import-dialog h2{margin:3px 0 0;font-size:22px}.note-import-dialog button{font:inherit;border:1px solid var(--line);background:transparent;color:var(--ink);padding:8px 12px;cursor:pointer}.note-import-dialog .dark-btn{background:var(--ink);color:var(--paper)}.note-import-dialog button:disabled{opacity:.4;cursor:default}.note-import-dialog .close-btn{border:0;font-size:22px}.note-import-dialog footer{padding:12px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end}.note-import-scroll{overflow:auto;max-height:calc(90dvh - 140px);padding:16px 20px}.note-import-dialog .muted{font-size:12px;line-height:1.5;color:var(--muted)}.note-import-busy{display:flex;gap:20px;align-items:center;min-height:130px}.note-import-busy[hidden],.note-import-error[hidden],#noteImportReview[hidden]{display:none}.import-sparrow{width:54px;height:40px;flex:0 0 54px;background:var(--ink);mask:url('sparrow-icon.png') center/contain no-repeat;-webkit-mask:url('sparrow-icon.png') center/contain no-repeat}.import-loading-dots{display:inline-flex;margin-left:3px}.import-loading-dots i{font-style:normal;animation:import-dot 1.2s infinite}.import-loading-dots i:nth-child(2){animation-delay:.2s}.import-loading-dots i:nth-child(3){animation-delay:.4s}@keyframes import-dot{0%,70%,100%{opacity:.2}35%{opacity:1}}.note-import-error{color:var(--ink);background:var(--line-soft);border-left:3px solid #a96510;padding:12px;line-height:1.6}.import-preview{border:1px solid var(--line);padding:12px;margin:12px 0 20px}.import-preview summary{cursor:pointer}.import-preview #importTextPreview{max-height:240px;overflow:auto;font-size:15px;line-height:1.6;margin-top:12px}.import-reference-row{border-top:1px solid var(--line);padding:12px 0}.import-reference-input{display:flex;gap:8px;align-items:center}.import-reference-input input[type=text]{flex:1;min-width:0;padding:8px;font:inherit;border:1px solid var(--line);background:var(--paper);color:var(--ink)}.import-reference-context{font-size:13px;line-height:1.5;color:var(--muted);margin:8px 0}.import-reference-status{font-size:11px;color:var(--muted);margin:4px 0}.import-reference-invalid{color:#a96510}
@media(prefers-reduced-motion:reduce){.import-loading-dots i{animation:none;opacity:1}}
@media(max-width:600px){.note-import-dialog{width:96vw;max-height:94dvh}.note-import-scroll{max-height:calc(94dvh - 140px);padding:14px}.note-import-dialog header,.note-import-dialog footer{padding:14px}.import-reference-input{gap:5px}.note-import-dialog button{padding:8px}.note-import-hint{font-size:10px}.rich-editor table{min-width:160px}}

.rich-toolbar #noteImportBtn{position:sticky;right:0;left:auto;margin-left:auto;z-index:1;background:var(--paper);flex:0 0 auto}

.rich-toolbar .note-table-icon{display:inline-flex;align-items:center;justify-content:center;min-width:32px}.rich-toolbar .note-table-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.35}

#richToolbar{flex-wrap:nowrap!important;overflow:visible!important;align-items:center}#richToolbar .note-format-options{display:flex;flex:1;min-width:0;overflow-x:auto;gap:4px;align-items:center}#richToolbar .note-format-options button{flex:0 0 auto;white-space:nowrap}#richToolbar #noteImportBtn{position:static;margin-left:8px;flex:0 0 auto}

/* V16.19: two intentional scroll areas, fixed dialog chrome and a distinct preview heading. */
#noteImportDialog{overflow:hidden}
#noteImportDialog[open]{display:flex;flex-direction:column;height:min(90dvh,900px)}
#noteImportDialog>header,#noteImportDialog>footer{flex:0 0 auto}
#noteImportDialog .note-import-scroll{flex:1 1 auto;min-height:0;max-height:none;overflow:auto}
#noteImportDialog .import-preview{padding:0;overflow:hidden}
#noteImportDialog .import-preview>summary{padding:12px 14px;background:var(--line-soft);border-bottom:1px solid var(--line);font-size:15px}
#noteImportDialog .import-preview #importTextPreview{margin:0;padding:14px;max-height:240px;overflow:auto}
@media(max-width:600px){#noteImportDialog[open]{height:94dvh}}

/* V16.20: fixed verse-note action and explicit multi-word study choices. */
.study-header>div:first-child{min-width:0;flex:1}.study-header-actions{display:flex;align-items:flex-start;gap:8px;flex:0 0 auto}.study-header-actions #studyHeaderAddNote{font:inherit;font-size:12px;padding:7px 9px;white-space:nowrap}.study-header-actions #studyHeaderAddNote[hidden]{display:none}
 .study-words-summary{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:7px 16px;border-bottom:1px solid var(--line);font-size:11px;background:var(--paper);min-width:0}.study-words-summary[hidden]{display:none}.study-word-count{flex-shrink:0;color:var(--muted)}.study-word-toggle{display:flex;gap:0;flex:1;min-width:0;overflow:auto}.study-word-toggle button{flex:1;min-width:0;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:6px 8px;font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--line);cursor:pointer;min-height:30px}.study-word-toggle button+button{border-left:0}.study-word-toggle button[aria-pressed="true"]{background:var(--ink);color:var(--paper)}.study-selected-blb{flex-shrink:0;color:var(--ink);font-size:11px;text-decoration:none}.study-word-toggle button:focus-visible,.study-selected-blb:focus-visible{outline:2px solid var(--ink);outline-offset:2px}@media(max-width:400px){.study-words-summary{padding:7px 12px;gap:6px}.study-word-toggle button{padding:6px 5px}}


/* V16.21: consistent note controls and stable responsive search viewport. */
#richToolbar button{height:36px;min-height:36px;max-height:36px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;line-height:1;flex-shrink:0}
#richToolbar button svg{width:18px;height:18px;flex-shrink:0}
#searchView.active-view{display:flex;width:min(960px,100%);height:calc(100dvh - var(--mobile-nav-h,70px) - env(safe-area-inset-bottom));max-height:calc(100dvh - var(--mobile-nav-h,70px) - env(safe-area-inset-bottom));flex:0 0 auto;align-self:center;flex-direction:column;overflow:hidden;padding-bottom:0!important;box-sizing:border-box}
#searchView .section-header{flex:0 0 auto}
#searchView .search-panel{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
#searchView .search-box,#searchView .search-filters{flex:0 0 auto}
#searchView .search-filters{flex-wrap:wrap}
#searchResults{flex:1;min-height:0;overflow-y:auto;overflow-wrap:anywhere;overscroll-behavior:contain}
.delete-confirm-dialog{width:min(440px,calc(100vw - 24px))}.delete-confirm-dialog h2{font-size:18px;line-height:1.5;padding:22px 24px 10px;margin:0}.delete-confirm-dialog footer{display:flex;gap:10px;justify-content:flex-end;padding:14px 24px 22px}

/* V16.23: passage-history pins and uninterrupted chapter/verse grids. */
.passage-dialog:has(#chapterPickerWrap:not([hidden])) header,.passage-dialog:has(#versePickerWrap:not([hidden])) header{border-bottom:0}
.history-item{display:flex;align-items:center;border-bottom:1px solid var(--line-soft);padding-right:14px}.history-item .history-row{flex:1;min-width:0;border-bottom:0}.history-pin{flex:0 0 32px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:6px;cursor:pointer}.history-pin svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5}.history-pin[aria-pressed="true"]{background:var(--ink);color:var(--paper)}.history-pinned h3,.history-recent h3{font-size:11px;font-weight:600;color:var(--muted);padding:12px 17px 5px;margin:0}.history-pin:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
