/* v80.8.45 — isolated book/reader glossary controls. No changes to graphic art heights. */
.rw845-dialog {box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(840px,calc(100vw - 1.3rem));max-width:100%;height:min(86dvh,900px);max-height:calc(100dvh - 1rem);padding:0;color:var(--text,#e7e8e8);background:var(--surface,#1d232e);border:1px solid var(--border,#414854);border-radius:15px;box-shadow:0 22px 75px rgba(0,0,0,.65);overflow:hidden}
.rw845-dialog::backdrop {background:rgba(3,5,10,.76);backdrop-filter:blur(3px)}
.rw845-dialog[open] {display:flex;flex-direction:column}
.rw845-dialog-head {display:flex;gap:1rem;align-items:flex-start;justify-content:space-between;padding:1.2rem 1.35rem;border-bottom:1px solid var(--border,#414854);background:var(--raised,#252b36)}
.rw845-dialog-head small {font-size:.67rem;letter-spacing:.13em;font-weight:800;color:var(--accent,#cba9e5)}
.rw845-dialog-head h2 {font-size:1.45rem;line-height:1.2;margin:.3rem 0}.rw845-dialog-head p {font-size:.85rem;margin:0;color:var(--muted,#a9afbd)}
.rw845-dialog .rw845-dialog-close {border:1px solid var(--border,#424955);background:var(--bg,#171b22);color:inherit;border-radius:50%;width:36px;height:36px;flex:0 0 36px;font-size:1.5rem;line-height:1;cursor:pointer}
.rw845-dialog .rw845-dialog-close:hover,.rw845-dialog .rw845-dialog-close:focus-visible {border-color:var(--accent,#cba9e5);color:var(--accent,#cba9e5)}
.rw845-dialog .rw845-content {flex:1 1 auto;min-height:0;overflow:auto;padding:1.2rem 1.35rem;overscroll-behavior:contain}
.rw845-book-glossary {min-width:0}.rw845-book-glossary>h2 {margin:0 0 1rem}.rw845-book-glossary [data-rw845-content] {min-width:0}
.rw845-reader-results {min-width:0;display:grid;gap:.85rem;overflow-wrap:anywhere}
.rw845-filters {display:flex;flex-wrap:wrap;align-items:end;gap:.65rem;padding:.85rem;margin:0 0 .3rem;border:1px solid var(--border,#414854);border-radius:.7rem;background:rgba(140,140,160,.035)}
.rw845-filters label {display:grid;gap:.4rem;flex:1 1 190px;min-width:0;font-size:.82rem;font-weight:600}
.rw845-filters :is(input,select),.rw845-filters button,.rw845-pager a,.rw845-reader-results button {box-sizing:border-box;min-height:40px;border:1px solid var(--border,#454a56);border-radius:.48rem;background:var(--bg,#161a22);color:var(--text,#e7e8e8);font:inherit;padding:.5rem .72rem}
.rw845-filters :is(input,select) {width:100%;min-width:0}.rw845-filters button,.rw845-pager a,.rw845-reader-results button {cursor:pointer;background:var(--raised,#293040)}
.rw845-filters button:hover,.rw845-pager a:hover,.rw845-reader-results button:hover {border-color:var(--accent,#cba9e5);color:var(--accent,#cba9e5)}
.rw845-entry {min-width:0;padding:1rem 1.1rem;border-radius:.7rem;border:1px solid var(--border,#414854);background:rgba(140,140,160,.04)}
.rw845-entry-heading {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:.4rem 1rem;margin-bottom:.55rem}
.rw845-entry-heading h3 {margin:0;font-size:1.15rem;color:var(--text,#eee)}.rw845-entry-heading span {color:var(--muted,#aab);font-size:.76rem}
.rw845-entry :is(p,ul,ol,blockquote) {margin:.45rem 0 .8rem}.rw845-entry-description {overflow-wrap:anywhere;min-width:0;line-height:1.6}
.rw845-entry-description :is(img,video,iframe),.rw845-entry-image {max-width:100%;height:auto}.rw845-entry-image {display:block;max-height:260px;object-fit:contain;object-position:left;margin:.5rem 0 1rem;border-radius:.3rem}
.rw845-spoiler {margin-top:.5rem;padding:.55rem .7rem;border-radius:.4rem;border:1px solid var(--border,#414854)}.rw845-spoiler>summary {color:var(--accent,#cba9e5);font-weight:650;cursor:pointer}
.rw845-muted {font-size:.87rem;color:var(--muted,#aaa)}.rw845-empty {color:var(--muted,#a9afbd);margin:1rem 0;padding:.6rem 0}
.rw845-pager {display:flex;flex-wrap:wrap;align-items:center;gap:.65rem;margin-top:.3rem}.rw845-pager a {text-decoration:none;font-size:.86rem}
.rw845-loading {opacity:.7}.rw845-dialog :focus-visible,.rw845-book-glossary :focus-visible {outline:2px solid var(--accent,#cba9e5);outline-offset:2px}
/* Non-invasive: use the same icon surface as bookmark, editor, and TOC. */
.rw9-navigation .rw845-open {display:inline-flex;align-items:center;justify-content:center}
.rw802-shell .rw845-dialog {--bg:var(--rw802-bg,#14171d);--text:var(--rw802-fg,#e7e8e8);--accent:var(--rw802-accent,#cba9e5)}
@media(max-width:600px){.rw845-dialog {height:calc(100dvh - .5rem);width:calc(100vw - .5rem);border-radius:9px}.rw845-dialog-head {padding:.8rem 1rem}.rw845-dialog .rw845-content {padding:.75rem}.rw845-entry {padding:.85rem}.rw845-filters {padding:.65rem}}
@media(prefers-reduced-motion:reduce){.rw845-dialog::backdrop {backdrop-filter:none}}
/* Six toolbar actions (including Glossary) fit small portrait handsets without
   changing the two-line title/header established in v80.8.41. */
@media(max-width:420px){
 #rw802-reader .rw802-toolbar {gap:.2rem;padding-inline:.35rem}
 #rw802-reader .rw802-toolbar-actions {gap:.12rem}
 #rw802-reader .rw8076-icon-btn {width:31px;min-width:31px;height:31px;min-height:31px}
 #rw802-reader .rw802-back {font-size:.72rem}
}
