/* My Books reader — scoped to its own dialog. */
.my-books-library-entry{display:flex;width:100%;align-items:center;gap:16px;text-align:left;background:var(--surface,#fff);color:inherit;border:1px solid var(--line,#c8d7d0);border-radius:18px;padding:18px 20px;margin:20px 0 12px;cursor:pointer}
.my-books-library-entry:hover,.my-books-library-entry:focus-visible{outline:2px solid #789f91;outline-offset:2px}
.my-books-library-entry>span:nth-child(2){display:flex;flex-direction:column;gap:5px;flex:1}
.my-books-library-entry strong{font-size:1rem}.my-books-library-entry small{font-size:.84rem;color:var(--muted,#667a78)}
.my-books-book-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#e4ece6;font-size:25px}
.my-books-dialog{width:min(1080px,calc(100% - 16px));max-height:94vh;padding:0;overflow-y:auto;border-radius:19px;border:1px solid #bfccc7;background:var(--surface,#fff);color:var(--text,#24332e);box-shadow:0 18px 55px #0005}
.my-books-dialog::backdrop{background:rgba(14,34,29,.62)}
.my-books-shell{padding:clamp(15px,3vw,28px);line-height:1.6}
.my-books-shell *{box-sizing:border-box}
.my-books-bar,.my-books-reader-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.my-books-bar h2{margin:0;font-size:1.55rem}.my-books-bar small{color:var(--muted,#638074);font-size:.75rem;text-transform:uppercase;letter-spacing:.08em}
.my-books-shell button{cursor:pointer}.my-books-shell button:focus-visible{outline:2px solid #3c7b62;outline-offset:2px}
#my-books-close{font-size:26px;padding:3px 12px;border-radius:10px;border:1px solid #aebfb5;background:transparent;color:inherit}
.my-books-shelf-heading{display:flex;flex-wrap:wrap;align-items:end;gap:12px;justify-content:space-between;padding-top:24px}
.my-books-shelf-heading h3{margin:0}.my-books-shelf-heading p{margin:5px 0;color:var(--muted,#64786f);max-width:670px;font-size:.9rem}
.my-books-upload{display:inline-flex;position:relative;align-items:center;justify-content:center;border-radius:11px;background:#286450;color:#fff;padding:11px 16px;cursor:pointer;font-size:.88rem;font-weight:700}
.my-books-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.my-books-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:13px;margin-top:22px}
.my-books-tile{display:flex;gap:16px;align-items:center;border:1px solid #d2dfd7;border-radius:14px;padding:16px;background:var(--surface,#fff)}
.my-books-cover{display:grid;place-items:center;background:#e4efea;width:75px;min-width:75px;height:100px;border-radius:6px 12px 12px 6px;font-size:35px}
.my-books-tile h4{font-size:1rem;margin:0 0 5px}.my-books-tile p{font-size:.8rem;color:var(--muted,#637773);margin:0 0 10px}
 .my-books-tile button,.my-books-reader-bar button,.my-books-para-notes button{padding:6px 10px;border:1px solid #9cb7a9;border-radius:8px;background:transparent;color:inherit;font-size:.78rem}
.my-books-tile button:first-of-type{background:#286450;color:#fff;border-color:#286450}
.my-books-tile button.my-books-delete{border-color:#d0a6a3}
#my-books-reader[hidden],#my-books-shelf[hidden]{display:none}
.my-books-reader-bar{position:sticky;top:-1px;z-index:5;background:var(--surface,#fff);padding:16px 0;border-bottom:1px solid #cbdad1;margin:12px 0 15px}
.my-books-reader-bar strong{max-width:270px}.my-books-reader-bar label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:.8rem;flex:1;min-width:180px;max-width:440px}
.my-books-reader-bar select{width:100%;padding:9px;border:1px solid #a4bcb1;border-radius:9px;background:var(--surface,#fff);color:inherit;font-size:.9rem}
#my-books-pages{max-width:770px;margin:auto;font-size:1rem;line-height:1.85;user-select:text}
.my-books-paragraph{margin:0 0 20px;padding:12px 16px 8px;border:1px solid transparent;border-radius:13px;overflow-wrap:anywhere}
.my-books-paragraph:hover{border-color:#d4e2d8;background:var(--surface-secondary,#fbfdfb)}
.my-books-paragraph-text{white-space:normal;user-select:text}.my-books-paragraph-text h3{font-size:1.3rem;line-height:1.45;margin:10px 0}
.my-books-paragraph .my-books-image{display:block;max-width:100%;height:auto;border-radius:10px;margin:12px auto}
.my-books-paragraph .my-books-text-block mark[data-color=yellow]{background:#ffeb8a;color:#2b2810;box-shadow:0 0 0 1px #ffeb8a}
.my-books-has-highlight{border-left:3px solid #efc657}
#my-books-status{border-top:1px solid #d4dfd9;margin:20px 0 0;padding-top:10px;font-size:.82rem;color:#376e55}
#my-books-status[data-error=true]{color:#aa3b30}
@media(max-width:620px){
 .my-books-dialog{width:calc(100% - 6px);max-height:98vh;border-radius:12px}
 .my-books-shell{padding:13px}
 .my-books-reader-bar{align-items:stretch}
 .my-books-reader-bar strong{order:-1;width:100%;max-width:none}
 .my-books-reader-bar label{max-width:none;min-width:100%}
 .my-books-paragraph{padding:10px 7px}
 #my-books-pages{font-size:1rem}
}
.my-books-cover img{width:100%;height:100%;object-fit:cover;border-radius:inherit}

.my-books-note-editor{width:min(620px,calc(100% - 16px));max-height:90vh;overflow:auto;border:1px solid #b5c9be;border-radius:17px;padding:24px;background:var(--surface,#fff);color:var(--text,#253931);box-shadow:0 22px 60px #0005}
.my-books-note-editor::backdrop{background:#152f2ab8}
.my-books-note-editor form{display:grid;gap:17px}
.my-books-note-editor header,.my-books-note-editor footer{display:flex;justify-content:space-between;align-items:center;gap:12px}
.my-books-note-editor h3{margin:0;font-size:1.2rem}
.my-books-note-editor label{display:grid;gap:7px;font-size:.89rem;font-weight:650}
.my-books-note-editor input,.my-books-note-editor textarea{width:100%;border:1px solid #9eafa7;border-radius:10px;padding:12px;background:var(--surface,#fff);color:inherit;font:inherit}
.my-books-note-editor textarea{line-height:1.6;min-height:180px;resize:vertical}
.my-books-note-editor button{padding:9px 16px;border:1px solid #a0b6aa;border-radius:10px;background:transparent;color:inherit;cursor:pointer}
.my-books-note-editor button[type=submit]{background:#286450;color:#fff;border-color:#286450}
.my-books-note-editor button[disabled]{opacity:.5}

.my-books-figure{margin:22px auto;padding:10px 0;text-align:center;max-width:100%}
.my-books-figure img{display:block;width:auto;height:auto;max-width:100%;max-height:620px;margin:auto;border-radius:9px}
.my-books-figure figcaption{font-size:.85rem;line-height:1.55;color:var(--muted,#667873);margin:9px auto}

/* One shared Library across all phases. Before SKE retains the Bible-reading
   tracker; the book-management tools are enabled in During and After. */
.ske-library-before-notice{display:none;padding:14px 16px;margin:10px 0 16px;border:1px solid var(--line,#cedad2);border-radius:12px;background:var(--surface-secondary,#f5f8f6);font-size:.9rem}
.ske-library-before-notice p{margin:6px 0 0;color:var(--muted,#60736b)}
body[data-ske-viewed-phase="before"] .ske-library-before-notice{display:block}
body[data-ske-viewed-phase="before"] #open-ske-my-books,
body[data-ske-viewed-phase="before"] #open-jw-backup-manager{display:none}

/* Uploaded books are visible on the Library page, not hidden in a popup. */
.my-books-library-section{padding:4px 0 26px;margin:0 0 24px;border-bottom:1px solid var(--line,#d5e0d9)}
.my-books-library-section .my-books-shelf-heading{padding-top:0}
.my-books-library-section .my-books-list{margin-top:16px}
.my-books-library-section .my-books-tile,.my-books-phase-section .my-books-tile{min-width:0}
#my-books-reader-view[hidden]{display:none!important}
#my-books-reader-view{position:relative;width:100%;padding:clamp(12px,2.6vw,28px) 0 70px;min-height:70vh}
#my-books-reader-view .my-books-reader-bar{margin:0 0 24px;padding:12px 0 18px;z-index:4}
#my-books-reader-view #my-books-pages{max-width:810px;margin:0 auto;font-size:1.06rem;line-height:1.9}
#my-books-reader-view #my-books-status{max-width:810px;margin:30px auto 0}
.my-books-phase-section{padding:8px 0 22px}
.my-books-phase-heading{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:14px}
.my-books-phase-heading h3{margin:2px 0 4px;font-size:1.2rem}
.my-books-phase-heading p{margin:0;color:var(--muted,#64786f);font-size:.89rem}
.my-books-phase-section .my-books-list{margin-top:16px}
.my-books-phase-section .my-books-tile{background:var(--surface,#fff)}
.my-books-phase-section [data-ske-my-books-status]{color:var(--muted,#64786f);font-size:.86rem}
[data-my-books-status][data-error=true]{color:#a93532!important}
body[data-ske-viewed-phase="before"] #my-books-inline{display:none}
@media(max-width:640px){
 #my-books-reader-view{padding:10px 0 35px}
 #my-books-reader-view .my-books-reader-bar{position:sticky;top:0}
 #my-books-reader-view #my-books-pages{font-size:1rem}
 .my-books-phase-heading .my-books-upload{width:100%}
}

/* The reader replaces the SKE Library contents, not a separate popup.
   Respect hidden even when site styles set layout on the phase root. */
#ske-experience-root[hidden]{display:none!important}
#experience-view #my-books-reader-view:not([hidden]){display:block}

/* Text selection brings up one contextual menu, rather than paragraph-level buttons. */
.my-books-selection-hint{margin:0 auto 18px;max-width:810px;font-size:.86rem;color:var(--muted,#657a70)}
.my-books-paragraph-text{cursor:text}
.my-books-paragraph{padding-bottom:6px}
.my-books-selection-tools[hidden]{display:none!important}
.my-books-selection-tools{
 position:fixed;z-index:1000;display:flex;flex-direction:column;gap:7px;
 box-sizing:border-box;width:max-content;max-width:min(540px,calc(100vw - 20px));min-width:180px;
 padding:10px 12px;border:1px solid #99b6a7;border-radius:13px;
 background:var(--surface,#fff);color:var(--text,#23372e);
 box-shadow:0 8px 28px rgba(20,43,30,.20)
}
.my-books-selected-label{display:block;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted,#617970);font-size:.76rem;font-style:italic}
.my-books-selection-buttons{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;max-width:100%;min-width:0}
.my-books-selection-buttons button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:38px;border:1px solid #9bb8a7;border-radius:9px;padding:8px 11px;background:transparent;color:inherit;cursor:pointer;white-space:nowrap;font-size:.84rem;line-height:1.25}
.my-books-selection-buttons [data-my-selected-highlight]{background:#fbe592;border-color:#e7ce6b;color:#38331c;font-weight:700}
.my-books-selection-buttons [data-my-selected-note]{background:#e8f2ec;color:#205641;font-weight:700}
.my-books-selection-buttons [data-my-selection-close],
.my-books-selection-buttons [data-my-highlight-close]{padding:6px 10px;margin-left:auto;font-size:1.15rem;line-height:1;min-width:38px}
.my-books-selection-buttons button:focus-visible{outline:2px solid #286450;outline-offset:2px}
.my-books-note-quote{border-left:3px solid #a9bfaf;padding:4px 10px;margin:8px 0;color:var(--muted,#60756a);font-size:.84rem;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:620px){
 .my-books-selection-tools{width:min(100%,calc(100vw - 20px));max-width:calc(100vw - 20px)}
 .my-books-selection-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .my-books-selection-buttons button{white-space:normal;min-width:0;padding:8px 9px;text-align:center}
 .my-books-selection-buttons [data-my-highlight-close],
 .my-books-selection-buttons [data-my-selection-close]{margin-left:0}
}


/* Compact page-margin note anchors. No inline notes or highlight chips. */
.my-books-paragraph{position:relative;padding-right:34px}
.my-books-note-pins{position:absolute;top:0;right:-8px;bottom:0;width:30px;pointer-events:none}
.my-books-note-pin{
 pointer-events:auto;position:absolute;right:0;display:grid;place-items:center;
 width:29px;height:29px;padding:0;border:1px solid #a2bcad;border-radius:10px;
 color:#285d4d;background:var(--surface,#fff);cursor:pointer;
 box-shadow:0 2px 8px rgba(23,51,39,.09)
}
.my-books-note-pin:hover,.my-books-note-pin:focus-visible{
 background:#e4f0e9;border-color:#51876b;outline:2px solid #8bb69a;outline-offset:2px;
}
.my-books-note-pin-icon{font-size:17px;line-height:1}
.my-books-note-pin-tip{
 display:none;position:absolute;right:calc(100% + 9px);top:50%;
 transform:translateY(-50%);max-width:230px;min-width:80px;white-space:normal;
 padding:7px 10px;border-radius:8px;background:#204a3b;color:white;
 font-size:.78rem;line-height:1.35;box-shadow:0 5px 15px #0002;pointer-events:none;
}
.my-books-note-pin:hover .my-books-note-pin-tip,.my-books-note-pin:focus-visible .my-books-note-pin-tip{display:block}
.my-books-text-block mark[data-my-highlight-id]{cursor:pointer;border-radius:2px}
.my-books-text-block mark[data-my-highlight-id]:hover{box-shadow:0 0 0 2px #c49e23}
.my-books-text-block mark[data-my-highlight-id]:focus-visible{outline:2px solid #286450;outline-offset:2px}
.my-books-selection-buttons [data-my-highlight-edit]{background:#e8f2ec;color:#205641;font-weight:700}
.my-books-selection-buttons [data-my-highlight-remove]{background:#fff1ed;color:#8b302b;border-color:#d9aaa1}
.my-books-edit-instructions[hidden]{display:none!important}
.my-books-edit-instructions{
 max-width:810px;margin:0 auto 12px;padding:12px 14px;border-left:3px solid #c5a43a;
 background:var(--surface-secondary,#f7f8f2);border-radius:8px;
 font-size:.88rem;
}
.my-books-edit-instructions button{margin-left:8px;padding:4px 10px;border:1px solid #a3b8aa;border-radius:8px;background:transparent;color:inherit;cursor:pointer}
.my-books-note-viewer{
 width:min(540px,calc(100% - 16px));max-height:90vh;overflow-y:auto;padding:24px;
 border:1px solid #acc7b6;border-radius:17px;background:var(--surface,#fff);
 color:var(--text,#24372f);box-shadow:0 16px 48px #0005;line-height:1.6;
}
.my-books-note-viewer::backdrop{background:rgba(14,38,30,.62)}
.my-books-view-head{display:flex;align-items:start;justify-content:space-between;gap:12px}
.my-books-view-head small{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#658073)}
.my-books-view-head h3{margin:5px 0 12px;font-size:1.18rem;line-height:1.35;overflow-wrap:anywhere}
.my-books-note-viewer button{border:1px solid #afc2b5;padding:9px 13px;border-radius:9px;background:transparent;color:inherit;cursor:pointer}
.my-books-note-viewer [data-my-note-close]:first-of-type{font-size:1.3rem;line-height:1;padding:5px 11px}
.my-books-note-viewer #my-books-note-view-quote{
 margin:8px 0 14px;padding:8px 12px;border-left:3px solid #88a99a;
 color:var(--muted,#60776a);background:var(--surface-secondary,#f5f8f6);
 white-space:pre-wrap;overflow-wrap:anywhere;font-size:.88rem
}
.my-books-note-viewer #my-books-note-view-quote[hidden]{display:none}
#my-books-note-view-body{white-space:pre-wrap;overflow-wrap:anywhere;padding:5px 0 18px}
.my-books-note-viewer footer{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;border-top:1px solid #d6e2da;padding-top:15px}
.my-books-note-viewer [data-my-note-edit]{background:#27634f;color:#fff;border-color:#27634f;margin-right:auto}
.my-books-note-viewer [data-my-note-delete]{color:#9d3930;border-color:#d7b2ac}
@media(max-width:640px){
 .my-books-paragraph{padding-right:30px}
 .my-books-note-pins{right:-2px}
 .my-books-note-viewer{padding:17px}
 .my-books-note-viewer footer{justify-content:stretch}
 .my-books-note-viewer footer button{flex:1}
}


/* A real marker-pen effect: each additional highlight layer deepens the
   shared section instead of concealing overlap behind a flat background. */
.my-books-paragraph .my-books-text-block mark[data-color=yellow][data-my-overlap="1"]{
 background:#ffed9d;color:#302b11;box-shadow:0 0 0 1px #ffed9d;
}
.my-books-paragraph .my-books-text-block mark[data-color=yellow][data-my-overlap="2"]{
 background:#f4cf59;color:#302609;box-shadow:0 0 0 1px #f4cf59;
}
.my-books-paragraph .my-books-text-block mark[data-color=yellow][data-my-overlap="3"]{
 background:#e8b831;color:#291f08;box-shadow:0 0 0 1px #e8b831;
}
.my-books-paragraph .my-books-text-block mark[data-color=yellow][data-my-overlap="4"]{
 background:#d59d18;color:#241906;box-shadow:0 0 0 1px #d59d18;
}
.my-books-overlap-choices[hidden],.my-books-selection-buttons[hidden]{display:none!important}
.my-books-overlap-choices{display:grid;gap:5px;max-height:230px;overflow:auto;min-width:220px}
.my-books-overlap-choice{
 display:block;width:100%;white-space:normal;text-align:left;overflow-wrap:anywhere;
 padding:8px 10px;background:var(--surface-secondary,#f4f8f4);
 color:inherit;border:1px solid #adbfaf;border-radius:9px;cursor:pointer;font-size:.8rem;
}
.my-books-overlap-choice:hover,.my-books-overlap-choice:focus-visible{border-color:#3e8567;outline:1px solid #3e8567}

/* Independent, nonmodal note windows — not <dialog> and no backdrop/blur.
   Each window can be moved, resized, stacked and kept open while reading. */
.my-books-note-window{
 position:fixed;display:flex;flex-direction:column;isolation:isolate;min-width:250px;
 min-height:190px;max-width:100vw;max-height:100vh;
 border:1px solid #a5c4b3;border-radius:15px;background:var(--surface,#fff);
 color:var(--text,#253931);box-shadow:0 12px 34px rgba(15,44,34,.24);
 overflow:hidden;resize:both;
}
.my-books-window-header{
 display:flex;gap:10px;align-items:center;flex:0 0 auto;min-height:43px;
 padding:8px 11px;background:#e2eee6;color:#244d3d;
 cursor:grab;touch-action:none;user-select:none;border-bottom:1px solid #b9cebf;
}
.my-books-window-header:active{cursor:grabbing}
.my-books-window-header strong{
 flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;
}
.my-books-window-header button{
 flex:0 0 auto;min-width:32px;min-height:30px;padding:2px 7px;
 border:1px solid #95b5a5;border-radius:8px;background:#f9fcfa;
 color:#284f3f;font-size:1.25rem;cursor:pointer;
}
.my-books-window-grip{font-size:1.05rem;line-height:1;color:#497c64}
.my-books-window-content{flex:1;min-height:0;overflow:auto;padding:13px 15px 27px;line-height:1.55}
.my-books-window-quote{
 margin:0 0 12px;padding:7px 10px;border-left:3px solid #8caa98;
 color:var(--muted,#617668);font-size:.84rem;white-space:pre-wrap;overflow-wrap:anywhere;
 background:var(--surface-secondary,#f3f7f3);border-radius:3px;
}
.my-books-window-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.92rem;min-height:40px}
.my-books-window-content footer{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:16px}
.my-books-window-content button{
 padding:7px 12px;border:1px solid #9eb9a9;border-radius:8px;
 background:transparent;color:inherit;cursor:pointer;font:inherit;font-size:.84rem;
}
.my-books-window-content button[type=submit],.my-books-window-content [data-my-note-window-edit]{
 background:#286450;color:#fff;border-color:#286450;
}
.my-books-window-content [data-my-note-window-delete]{color:#983e38;border-color:#d2afa8}
.my-books-window-content form{display:grid;gap:11px}
.my-books-window-content form label{display:grid;gap:5px;font-size:.83rem;font-weight:600}
.my-books-window-content input,.my-books-window-content textarea{
 width:100%;min-width:0;padding:9px 10px;border:1px solid #afc2b5;
 border-radius:8px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:.91rem;
}
.my-books-window-content textarea{resize:vertical;min-height:90px}
.my-books-window-resize{
 position:absolute;right:0;bottom:0;width:22px;height:22px;
 cursor:nwse-resize;touch-action:none;z-index:2;
 background:linear-gradient(135deg,transparent 53%,#94b2a2 54%,#94b2a2 60%,transparent 61%,transparent 70%,#94b2a2 71%,#94b2a2 78%,transparent 79%);
 border-bottom-right-radius:13px;
}
.my-books-note-window:focus-within{box-shadow:0 15px 42px rgba(14,43,34,.3)}
@media(max-width:640px){
 .my-books-note-window{min-width:230px;min-height:190px}
 .my-books-window-content{padding:11px 12px 26px}
}


/* Publication scripture reader: mirrors the SKE Notes and Studies pop-up,
   but is anchored beside the clicked reference and never obscures the book
   with a modal backdrop. */
.my-books-scripture-link{cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.my-books-scripture-link:hover,.my-books-scripture-link:focus-visible{background:#e7f0ea;border-radius:3px;outline-offset:3px}
.my-books-scripture-popup{
 position:fixed;z-index:12000;box-sizing:border-box;
 width:min(525px,calc(100vw - 16px));max-height:min(75vh,650px);
 border:1px solid #9dbbaf;border-left:4px solid #5c89a7;border-radius:15px;
 background:var(--surface,#fff);color:var(--text,#263a36);
 box-shadow:0 12px 40px rgba(13,40,34,.26);
 display:flex;flex-direction:column;overflow:hidden;
}
.my-books-scripture-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0;padding:12px 15px;border-bottom:1px solid #d4e2dc}
.my-books-scripture-header>div{display:grid;gap:3px;min-width:0}
.my-books-scripture-header small{font-size:.73rem;letter-spacing:.06em;text-transform:uppercase;color:#577884}
.my-books-scripture-header strong{font-size:1.05rem;overflow-wrap:anywhere}
.my-books-scripture-header button{font-size:1.35rem;border:1px solid #bfd0c7;background:transparent;color:inherit;border-radius:9px;min-width:36px;min-height:35px;cursor:pointer}
.my-books-scripture-content{padding:14px;overflow:auto;overscroll-behavior:contain;min-height:0}
.my-books-scripture-passage small{font-size:.8rem;color:var(--muted,#667973)}
.my-books-scripture-passage p{margin:8px 0 16px;font-size:1rem;line-height:1.72;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}
.my-books-scripture-loading,.my-books-scripture-error{font-size:.9rem;padding:7px 0}
.my-books-scripture-error{color:#b1372e}
.my-books-scripture-actions,.my-books-scripture-research-actions{display:flex;flex-wrap:wrap;gap:9px;margin:12px 0}
.my-books-scripture-content button,.my-books-scripture-content a{
 display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
 padding:9px 12px;min-height:39px;border:1px solid #a7bcae;border-radius:9px;
 background:transparent;color:inherit;font-size:.85rem;line-height:1.35;
 font-weight:600;text-decoration:none;cursor:pointer;
}
.my-books-scripture-actions a{background:#386b53;color:#fff;border-color:#386b53}
.my-books-scripture-content button[aria-pressed=true]{background:#e2efe6;border-color:#8aab93}
.my-books-scripture-research{border:1px solid #d5e2d9;background:var(--surface-secondary,#f7faf8);border-radius:11px;padding:12px;margin-top:12px;max-height:340px;overflow:auto}
.my-books-scripture-research article{border-top:1px solid #d8e1da;padding:10px 0}
.my-books-scripture-research article:first-child{border:0}
.my-books-scripture-research article p,.my-books-scripture-research>p{margin:7px 0;line-height:1.65;font-size:.87rem;white-space:pre-wrap}
.my-books-scripture-research article button{display:grid;justify-content:stretch;text-align:left;gap:4px;width:100%;white-space:normal;font-weight:600}
.my-books-scripture-research article button span{font-size:.76rem;color:var(--muted,#61786b);font-weight:400}
.my-books-scripture-research h4,.my-books-scripture-research h5{margin:10px 0 6px;font-size:.92rem}
.my-books-scripture-content :focus-visible{outline:2px solid #397b61;outline-offset:2px}
@media(max-width:620px){
 .my-books-scripture-popup{width:calc(100vw - 16px);max-height:min(78dvh,650px)}
 .my-books-scripture-content{padding:12px}
 .my-books-scripture-actions,.my-books-scripture-research-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .my-books-scripture-content button,.my-books-scripture-content a{white-space:normal;text-align:center}
}


/* Insert Study Notes and Research Guide material directly into movable notes. */
.my-books-research-destination{
 display:grid;gap:6px;margin:10px 0;padding:11px 12px;border:1px solid #cbdcd2;
 border-radius:11px;background:var(--surface-secondary,#f6faf7);
}
.my-books-research-destination label{display:flex;flex-wrap:wrap;align-items:center;gap:9px;font-size:.84rem;font-weight:700}
.my-books-research-destination select{
 flex:1;min-width:155px;max-width:100%;box-sizing:border-box;padding:8px 10px;
 border:1px solid #9fb9aa;border-radius:9px;background:var(--surface,#fff);
 color:inherit;font:inherit;font-weight:500;
}
.my-books-research-destination span{font-size:.78rem;color:var(--muted,#5f796e);line-height:1.45}
.my-books-research-selection{
 position:sticky;top:0;z-index:1;display:flex;flex-wrap:wrap;gap:8px;
 align-items:center;justify-content:space-between;margin:0 0 12px;
 padding:9px;border:1px solid #d7e5d9;border-radius:9px;background:var(--surface,#fff);
}
.my-books-research-selection span{flex:1 1 165px;font-size:.78rem;color:var(--muted,#5f796e);line-height:1.45}
.my-books-scripture-content .my-books-research-selection [data-my-research-selected]{
 background:#e0eee6;border-color:#84aa94;color:#22543e;font-weight:700;
}
.my-books-scripture-content [data-my-research-full-note],
.my-books-scripture-content [data-my-research-reference]{
 margin:8px 0 0;background:#e9f3ec;border-color:#9abbaa;color:#22543e;font-size:.8rem;
}
.my-books-insert-feedback{
 margin:8px 0 2px;padding:8px 11px;border-left:3px solid #5a9c73;
 border-radius:6px;background:#e9f3ea;color:#254f3b;font-size:.82rem;line-height:1.45
}
.my-books-scripture-research p,.my-books-scripture-research article{
 user-select:text;-webkit-user-select:text;
}
@media(max-width:620px){
 .my-books-research-destination label{display:grid}
 .my-books-research-destination select{width:100%}
 .my-books-research-selection [data-my-research-selected]{width:100%}
}

/* Study notes keep their original line breaks while article citations,
   source URLs and scripture references are usable links in read mode. */
.my-books-window-body .my-books-note-live-link,
.my-books-window-quote .my-books-note-live-link{
 color:#246e87;
 text-decoration:underline;
 text-underline-offset:3px;
 text-decoration-thickness:1px;
 overflow-wrap:anywhere;
 cursor:pointer;
}
.my-books-window-body .my-books-note-live-link:hover,
.my-books-window-quote .my-books-note-live-link:hover{
 color:#164c60;
 background:rgba(58,127,151,.10);
 border-radius:3px;
}
.my-books-window-body .my-books-note-live-link:focus-visible,
.my-books-window-quote .my-books-note-live-link:focus-visible{
 outline:2px solid #377c91;
 outline-offset:3px;
}

/* Reference articles from jwpub://p/ links appear as their own nonmodal
   reading pane, with a clear citation and optional paragraph focus. */
.my-books-publication-popup{width:min(590px,calc(100vw - 16px));max-height:min(78dvh,750px)}
.my-books-publication-article{display:grid;gap:10px;font-size:.94rem;line-height:1.7}
.my-books-publication-article p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.my-books-publication-article h4{margin:10px 0 1px;font-size:1.02rem;line-height:1.35}
.my-books-publication-range{margin:0 0 14px;padding:8px 11px;border-radius:8px;border-left:3px solid #689684;background:var(--surface-secondary,#f3f8f4);font-size:.83rem}
.my-books-publication-article .my-books-publication-focus{background:rgba(251,217,103,.23);border-left:3px solid #e0b84f;padding:7px 10px;border-radius:3px}
.my-books-publication-actions{display:flex;flex-wrap:wrap;gap:9px;margin:18px 0 3px;padding-top:13px;border-top:1px solid #d6e3da}
.my-books-publication-actions a{white-space:normal;text-align:center;flex:1 1 175px}
.my-books-publication-overflow{font-size:.82rem;color:var(--muted,#64786b);margin:14px 0}
@media(max-width:620px){.my-books-publication-popup{width:calc(100vw - 16px);max-height:min(80dvh,750px)}}


/* Inline citations use prose typography, independently of popup action buttons. */
.my-books-publication-article a,
.my-books-publication-article a:hover,
.my-books-publication-article a:focus-visible{
 display:inline;align-items:normal;justify-content:normal;padding:0;min-height:0;
 border:0;border-radius:0;background:transparent;box-shadow:none;
 color:#286f9c;font:inherit;line-height:inherit;text-decoration:underline;
 text-underline-offset:2px;white-space:normal;vertical-align:baseline;
}
.my-books-scripture-header{cursor:move;touch-action:none;user-select:none}
.my-books-scripture-header button{cursor:pointer}

/* Picture note anchors use image-relative coordinates across screen sizes. */
.my-books-picture{position:relative;display:inline-block;max-width:100%;line-height:0;vertical-align:middle}
.my-books-picture>img.my-books-image{display:block;margin:0;max-width:100%}
.my-books-picture-pins{position:absolute;inset:0;pointer-events:none}
.my-books-picture-add{position:absolute;top:8px;right:8px;z-index:2;font:600 13px/1.3 system-ui,sans-serif;padding:7px 10px;border:1px solid #9cbcaf;border-radius:8px;background:#fff;color:#234e50;cursor:pointer}
.my-books-picture.placing>img{cursor:crosshair;outline:3px solid #568dae;outline-offset:-3px}
.my-books-picture-pin{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;user-select:none;width:36px;height:36px;padding:0;border:2px solid #fff;border-radius:50%;background:#265c58;color:white;font:700 21px/1 system-ui,sans-serif;box-shadow:0 2px 7px #0005;cursor:grab;z-index:3}
.my-books-picture-pin:active{cursor:grabbing}
.my-books-picture-pin:focus-visible{outline:3px solid #d5a646;outline-offset:2px}

/* Keep every picture marker on the image plane, independent of prose button styles. */
#my-books-pages .my-books-picture{position:relative;isolation:isolate;line-height:0}
#my-books-pages .my-books-picture-pins{position:absolute;display:block;inset:0;width:100%;height:100%;margin:0;padding:0;pointer-events:none;z-index:3}
#my-books-pages button.my-books-picture-pin{position:absolute;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:40px;height:40px;min-width:40px;min-height:40px;margin:0;padding:0;border:0;border-radius:50%;background:transparent;box-shadow:none;transform:translate(-50%,-50%);color:#164e50;pointer-events:auto;touch-action:none}
#my-books-pages .my-books-picture-pin svg{display:block;width:36px;height:36px;overflow:visible;fill:#ffffff90;stroke:currentColor;stroke-width:2;filter:drop-shadow(0 0 1px #ffffff70)}
#my-books-pages .my-books-picture-add{z-index:4}

/* A note attached to highlighted words carries the highlight's color. */
.my-books-note-pin[data-highlight-color],
.my-books-note-pin[data-highlight-color]:hover,
.my-books-note-pin[data-highlight-color]:focus-visible{
 background:var(--my-note-highlight-color,#ffeb8a);
 color:#2b2810;border-color:#9c873c;
}

/* Individual verses remain ordinary black scripture text while clickable. */
.my-books-scripture-passage p{color:#111}
.my-books-scripture-passage [data-my-individual-verse],
.my-books-scripture-passage [data-my-individual-verse]:hover{
 color:inherit;text-decoration:none;background:transparent;border:0;padding:0;font:inherit;
}
.my-books-scripture-passage [data-my-individual-verse]:focus-visible{outline:1px solid currentColor;outline-offset:2px}

/* Keep reader navigation comfortably spaced within the available reading area. */
#my-books-reader-view{min-width:0;container-type:inline-size}
#my-books-reader-view .my-books-reader-bar{
 display:grid;grid-template-columns:auto auto minmax(140px,1fr) auto;
 gap:16px 20px;align-items:center;top:0;padding:20px 16px;
 margin:0 0 28px;box-sizing:border-box;
}
#my-books-reader-view .my-books-reader-bar button{
 min-height:44px;padding:10px 16px;font-size:.9rem;line-height:1.35;white-space:nowrap;
}
#my-books-reader-view .my-books-reader-bar strong{
 grid-column:3;grid-row:1;order:0;min-width:0;max-width:none;width:auto;
 line-height:1.45;overflow-wrap:anywhere;
}
#my-books-reader-view .my-books-reader-bar label{
 grid-column:1 / -1;grid-row:2;min-width:0;max-width:none;width:100%;
 gap:8px;line-height:1.4;margin:0;
}
#my-books-reader-view .my-books-reader-bar select{
 box-sizing:border-box;min-width:0;max-width:100%;min-height:46px;padding:11px 14px;font-size:1rem;
}
#my-books-history-back{grid-column:1;grid-row:1}
#my-books-back{grid-column:2;grid-row:1}
#my-books-export{grid-column:4;grid-row:1}
@container (max-width:600px){
 #my-books-reader-view .my-books-reader-bar{grid-template-columns:auto auto 1fr;gap:14px 10px;padding:16px 10px}
 #my-books-reader-view .my-books-reader-bar strong{grid-column:1 / -1;grid-row:2}
 #my-books-reader-view .my-books-reader-bar label{grid-row:3}
 #my-books-export{grid-column:3;justify-self:end}
 #my-books-reader-view .my-books-reader-bar button{padding:10px 12px}
}

/* Keep the reader controls reachable on phones as well as tablets. */
#my-books-reader-view .my-books-reader-bar{
 position:sticky;top:0;z-index:40;background:var(--surface,#fff);
 box-shadow:0 3px 10px rgba(20,55,50,.08);
}
@media(max-width:640px){
 #my-books-reader-view .my-books-reader-bar{gap:8px 10px;padding:10px;max-height:42dvh;overflow:auto}
 #my-books-reader-view .my-books-reader-bar strong{font-size:.88rem;line-height:1.25}
 #my-books-reader-view .my-books-reader-bar label{gap:3px;font-size:.75rem}
 #my-books-reader-view .my-books-reader-bar select{min-height:42px;padding:8px 10px;font-size:.9rem}
}

/* The Android status buffer is a fixed overlay; sticky controls must clear it. */
body.native-android #my-books-reader-view .my-books-reader-bar{
 top:var(--ske-status-buffer,34px);
 max-height:calc(50dvh - var(--ske-status-buffer,34px));
 scroll-padding-top:10px;
}

/* One compact action group above the book title and chapter selector. */
#my-books-reader-view .my-books-reader-bar{grid-template-columns:minmax(0,1fr);gap:10px}
#my-books-reader-view .my-books-reader-actions{display:grid;grid-template-columns:auto auto auto minmax(0,1fr);grid-column:1;grid-row:1;gap:0;border:1px solid #9cb7a9;border-radius:12px;overflow:hidden}
#my-books-reader-view .my-books-reader-actions>button,
#my-books-reader-view .my-books-reader-actions>a{grid-column:auto;grid-row:auto;justify-self:stretch;display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;margin:0;padding:8px 12px;border:0;border-right:1px solid #9cb7a9;border-radius:0;background:transparent;color:inherit;font:inherit;font-size:.82rem;text-align:center;text-decoration:none;white-space:normal;line-height:1.2;box-sizing:border-box}
#my-books-reader-view .my-books-reader-actions>:last-child{border-right:0}
#my-books-reader-view .my-books-reader-actions>:focus-visible{outline:2px solid currentColor;outline-offset:-3px}
#my-books-reader-view .my-books-reader-bar strong{grid-column:1;grid-row:2}
#my-books-reader-view .my-books-reader-bar label{grid-column:1;grid-row:3}
@media(max-width:420px){
 #my-books-reader-view .my-books-reader-actions{grid-template-columns:.7fr .8fr 1fr 1.4fr}
 #my-books-reader-view .my-books-reader-actions>button,
 #my-books-reader-view .my-books-reader-actions>a{padding:7px 5px;font-size:.73rem}
}

.my-books-lesson-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:28px 0;padding:20px 0 calc(20px + env(safe-area-inset-bottom));border-top:1px solid #bacbc3}
.my-books-lesson-navigation button{min-height:48px;min-width:0;padding:12px;border:1px solid #9cb7a9;border-radius:12px;background:var(--surface,#fff);color:inherit;font:inherit;font-weight:600;line-height:1.35;white-space:normal;cursor:pointer}
.my-books-lesson-navigation button:disabled{opacity:.4;cursor:default}
.my-books-lesson-navigation button:focus-visible{outline:2px solid currentColor;outline-offset:3px}

/* Keep reference charts readable on narrow screens. */
.my-books-publication-popup .my-books-scripture-header{padding:12px 14px;gap:12px;align-items:flex-start}
.my-books-publication-popup .my-books-scripture-header>div{min-width:0}
.my-books-publication-popup .my-books-scripture-header small{font-size:.65rem;letter-spacing:.09em}
.my-books-publication-popup .my-books-scripture-header strong{font-size:1rem;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.my-books-publication-popup .my-books-scripture-header button{flex:0 0 36px;width:36px;min-height:36px;padding:4px;border-radius:50%}
.my-books-publication-popup .my-books-scripture-content{padding:14px;min-width:0}
.my-books-publication-article{min-width:0}
.my-books-publication-article>div:has(table){border:1px solid #ceddd8;border-radius:12px;background:#fff;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#8bafa2 #edf4f0}
.my-books-publication-article>div:has(table)::before{content:"Swipe sideways to explore the chart →";display:block;position:sticky;left:0;width:fit-content;max-width:100%;box-sizing:border-box;padding:9px 12px;color:#547168;font-size:.72rem;background:#f1f7f3}
.my-books-publication-article table{width:100%;min-width:100%!important;max-width:100%!important;table-layout:auto!important;border-collapse:collapse;font-size:.84rem;line-height:1.5}
.my-books-publication-article table :is(td,th){min-width:90px;max-width:320px;padding:12px 14px!important;border:1px solid #dce5e0!important;vertical-align:top;word-break:normal!important;overflow-wrap:normal!important;white-space:normal}
.my-books-publication-article table :is(p,a,strong,span){word-break:normal!important;overflow-wrap:normal!important}
.my-books-publication-article table th{background:#eaf3ee;color:#244c42;font-size:.72rem;letter-spacing:.035em;white-space:nowrap}
.my-books-publication-article table tr:nth-child(even){background:#f8fbf8}
.my-books-publication-article table:has(tr>:nth-child(4)){min-width:900px!important}
.my-books-publication-article table:has(tr>:nth-child(4)) td:nth-child(3){min-width:240px}
.my-books-publication-article table a{white-space:normal}
.my-books-publication-article table :is(p,span,figcaption){white-space:normal!important}
.my-books-publication-article table:not(:has(tr>:nth-child(4))) :is(td,th){min-width:0;max-width:none;overflow-wrap:anywhere!important}
.my-books-publication-article table img{display:block;max-width:100%;height:auto}
.my-books-publication-article>div:has(table):not(:has(tr>:nth-child(4)))::before{display:none}
.my-books-publication-article>div{min-width:0}
.my-books-publication-article>p{white-space:normal;overflow-wrap:break-word}
