/* scoped library styles: does not change the existing student practice interface */
.study-top{background:#261769;color:white;padding:17px max(18px,calc((100vw - 1140px)/2));display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap}
.study-top a{color:inherit;text-decoration:none}.study-top nav{display:flex;gap:16px;flex-wrap:wrap;font-size:14px;font-weight:700}
.study-brand{font-weight:900;letter-spacing:.035em}.study-brand small{display:block;font-size:10px;letter-spacing:.12em;font-weight:550;color:#c9c0f3}
.study-wrap{max-width:1140px;margin:auto;padding:28px 18px 65px}.study-overline{color:#6d55c5;letter-spacing:.13em;font-size:11px;font-weight:900}.study-wrap h1{color:#281c64;font-size:clamp(28px,3.5vw,45px);letter-spacing:-.04em;margin:10px 0 14px}.study-intro{max-width:850px;color:#645d79;line-height:1.8}
.study-facts{display:flex;gap:13px;flex-wrap:wrap;margin:22px 0}.study-facts div{background:#fff;border:1px solid #e7e0f4;border-radius:14px;padding:16px 20px;min-width:158px}.study-facts b{display:block;font-size:22px;color:#2f1e7c}.study-facts span{color:#665e7b;font-size:13px}
.study-alert{background:#fff;border:1px solid #e7e0f4;border-radius:15px;padding:20px 24px;line-height:1.75;min-height:70px;color:#332862}
.study-alert a{font-weight:700;color:#4d30aa}.study-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:16px;margin:23px 0}
.study-book{padding:23px;border:1px solid #e6def1;background:#fff;border-radius:16px;display:flex;flex-direction:column;gap:12px;min-height:230px;box-shadow:0 10px 25px #2d14690c}
.study-book .unit{color:#6344a8;font-size:12px;font-weight:850;letter-spacing:.08em}.study-book h2{font-size:18px;line-height:1.42;margin:0;color:#2b205c}
.study-book .book-spacer{flex:1}.study-book .book-actions{display:flex;gap:9px;flex-wrap:wrap}
.study-book button{background:#432797;color:#fff;border:0;border-radius:9px;font-weight:700;padding:11px 16px;cursor:pointer}.study-book button:disabled{opacity:.5;cursor:wait}
.study-book .pending{color:#746c84;font-size:13px}.study-disclaimer{margin-top:22px;color:#6f687e;font-size:12px;line-height:1.8}.study-footer{text-align:center;padding:24px;color:#786f8a;border-top:1px solid #ddd7e9;font-size:13px}
.study-admin{display:inline-block;margin-top:7px}
@media(max-width:460px){.study-wrap{padding:20px 14px 45px}.study-book{min-height:0}.study-top{align-items:flex-start}.study-facts div{flex:1}}

/* PDF-only in-page reader: mobile-first pagination, fit-width, and text reflow. */
.study-book .book-actions button.read-pdf{width:100%;text-align:center;background:#4530a1;color:white;font-weight:750;border-radius:12px}
.study-book .pending{font-style:italic}.reader-shell[hidden],.reader-reflow[hidden],.reader-pagewrap[hidden],#library-main[hidden]{display:none!important}
body.reading{overflow:hidden;background:#eaeaf3}.reader-shell{position:fixed;inset:0;z-index:100;background:#eeedf7;display:flex;flex-direction:column;min-height:0}
.reader-top{background:#251762;color:#fff;display:flex;align-items:center;gap:12px;padding:10px clamp(12px,2vw,30px);min-height:60px}
.reader-title{font-weight:750;font-size:clamp(13px,1.5vw,17px);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reader-back{border:1px solid #8676ca;border-radius:9px;background:#3c2986;padding:9px 13px;color:#fff;font-weight:750;white-space:nowrap}
.reader-label{font-size:10px;letter-spacing:.08em;padding:6px 8px;background:#4d3898;border-radius:8px;white-space:nowrap}
.reader-toolbar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;background:white;padding:9px 10px;border-bottom:1px solid #dedbf0}
.reader-tool{background:#f4f1fc;color:#372486;border:1px solid #dad2ef;padding:9px 13px;border-radius:9px;font-size:13px;font-weight:760;min-height:42px}
.reader-tool:focus-visible,.reader-back:focus-visible,.reader-pagebox input:focus-visible{outline:3px solid #85b6f1;outline-offset:2px}
.reader-tool:disabled{opacity:.4;cursor:default}.reader-tool[aria-pressed="true"]{background:#3e2b8b;color:white}
.reader-pagebox{font-size:13px;font-weight:700;display:flex;align-items:center;gap:6px}.reader-pagebox input{font-size:15px;text-align:center;border:1px solid #cfc7e4;border-radius:7px;max-width:64px;min-height:42px;padding:6px 2px;background:white}
.reader-divide{width:1px;background:#dcd5ed;height:26px}.reader-progress{height:3px;background:#d4cee8}.reader-progress span{display:block;width:0;height:100%;background:#6853d7;transition:width .15s}
.reader-message{padding:8px 14px;text-align:center;font-size:12px;color:#5b4c89;background:#f0ebff}.reader-message.is-error{background:#fff3eb;color:#7e341b}.reader-message[hidden]{display:none}
.reader-stage{overflow:auto;overscroll-behavior:contain;flex:1;min-height:0;padding:18px;display:block;text-align:center;touch-action:pan-x pan-y;outline:none}
.reader-pagewrap{display:inline-block;background:white;box-shadow:0 8px 30px rgba(29,22,69,.15);line-height:0;max-width:none}
.reader-pagewrap canvas{background:#fff;display:block;max-width:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.reader-reflow{margin:0 auto;max-width:720px;background:white;color:#202037;padding:clamp(20px,4vw,44px);text-align:left;box-shadow:0 8px 35px rgba(27,23,55,.12);font:clamp(16px,2.8vw,19px)/1.85 Georgia, 'Times New Roman',serif;overflow-wrap:anywhere}
.reader-reflow p{margin:0 0 .48em;line-height:1.8}.reader-bottom{display:flex;justify-content:space-between;gap:10px;background:#fff;padding:8px 18px;border-top:1px solid #dedbf0;color:#6c6486;font-size:11px}
.study-alert:empty{display:none}
@media(max-width:600px){.reader-top{min-height:48px;padding:7px 9px;gap:8px}.reader-label{display:none}.reader-back{padding:9px 10px;font-size:12px}
 .reader-title{font-size:12px}.reader-toolbar{gap:5px;padding:7px 6px;justify-content:space-around}
 .reader-tool{padding:7px 9px;min-height:39px;font-size:12px}.reader-tool>span{display:none}
 .reader-pagebox{font-size:12px;gap:3px}.reader-pagebox input{min-height:39px;width:50px;font-size:14px}.reader-divide{display:none}
 .reader-stage{padding:9px 6px}.reader-bottom{font-size:10px;padding:7px 10px}.reader-reflow{padding:20px 17px;line-height:1.85;box-shadow:none}}
@media(max-width:390px){.reader-toolbar{gap:4px}.reader-tool{padding:7px 8px}.reader-size{font-size:11px}}
@media print{.reader-shell,.study-grid{display:none!important}body::before{content:'BRIHANTRA LABS: online reader only';display:block;padding:20px}}

/* PDF Publishing Console — consistent desktop/mobile layout and explicit upload progress. */
body.study-publisher-page{margin:0;min-height:100vh;background:#f7f6fd;color:#252045;font:16px/1.65 Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
.study-publisher-page *, .study-publisher-page *::before, .study-publisher-page *::after{box-sizing:border-box}
.study-publisher-page .study-wrap{max-width:1080px}
.study-publisher-page #publisher-form{margin-top:20px;background:#fff;border:1px solid #e5dff3;border-radius:18px;padding:clamp(18px,3vw,30px);box-shadow:0 8px 24px rgba(40,30,100,.04)}
.study-publisher-page #publisher-form>p{margin:0 0 16px;color:#514b66}
.study-publisher-page #study-files{display:block;padding:12px;border:1px dashed #ac9dce;border-radius:12px;background:#fbfaff;font-size:14px;color:#3c316a}
.study-publisher-page .file-help{font-size:13px!important;color:#574c78!important}
.study-publisher-page .study-publish-button{padding:12px 18px;border:0;border-radius:10px;font-weight:750;background:#4931a5;color:white;min-height:46px;max-width:100%;cursor:pointer}
.study-publisher-page .study-publish-button:disabled{background:#c6c0d7;color:#504b5b;cursor:not-allowed}
.study-publisher-page .publisher-inventory{background:#faf9ff;border:1px solid #e5e0f2;padding:19px 20px;border-radius:13px;margin:23px 0}
.study-publisher-page .publisher-inventory strong{font-weight:800;color:#35256d}
.study-publisher-page .publisher-inventory ul{list-style:none;padding:0;margin:13px 0 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr));gap:8px}
.study-publisher-page .publisher-inventory li{background:white;border:1px solid #e7e2ef;padding:10px 12px;border-radius:8px;font-size:13px}
.study-publisher-page .publisher-inventory li.is-uploaded{border-color:#86c4a2;color:#165c3c}
.study-publisher-page .publisher-inventory li.is-published{border-color:#91a4d7;color:#234680}
.study-publisher-page #upload-log,.study-publisher-page #publish-log{font-size:14px;line-height:1.6;min-height:18px;overflow-wrap:anywhere;margin:12px 0}
.study-publisher-page #publish-unit{border:1px solid #cfc4e8;background:#fff;border-radius:10px;font-size:14px}
.study-publisher-page #publisher-form input[type=checkbox]{accent-color:#5634b4;transform:scale(1.2);margin-right:9px}
@media(max-width:600px){.study-publisher-page .study-wrap{padding:20px 14px 45px}.study-publisher-page #publisher-form{padding:19px 14px}.study-publisher-page #upload-books{width:100%}}
