:root{--navy:#152740;--navy2:#233a56;--paper:#fff;--bg:#f1f3f6;--edge:#e3e8ee;--text:#1f2b39;--muted:#7b8794;--accent:#ed7b31;--side:254px}
*{box-sizing:border-box}html,body{padding:0;margin:0;height:100%;font-family:Inter,"Noto Sans JP","Yu Gothic",Meiryo,system-ui,sans-serif;color:var(--text)}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}.hide{display:none!important}
#app{height:100dvh;min-height:420px;display:flex;flex-direction:column;overflow:hidden}.topbar{height:62px;flex:0 0 62px;background:var(--navy);color:#fff;display:flex;align-items:center;gap:13px;padding:0 19px;box-shadow:0 1px 12px #101c3020;z-index:12}.brand{display:flex;align-items:center;gap:9px;flex:0 0 auto}.brand-icon{height:35px;width:35px;background:linear-gradient(130deg,#ffb165,#e8772b);display:grid;place-items:center;color:#fff;font-weight:800;font-size:22px;border-radius:10px}.brand-text{font-weight:850;font-size:16px;line-height:1;letter-spacing:-.7px}.brand-text span{color:#ffaf78}.brand-text small{display:block;letter-spacing:2px;font-size:7px;margin-top:5px;color:#9dadc0}.file-label{font-size:12px;color:#bfcbd8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;text-align:center;padding:0 8px}.btn,.square,.tool,.mini,.navbtn,.tiny,.linkbtn,.tab{border:0;background:transparent;color:inherit}.btn{border-radius:8px;padding:9px 14px;font-weight:700;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}.btn.primary{background:var(--accent);color:white}.btn.primary:hover{background:#db6922}.btn.mild{background:#f3f5f9;color:#415066}.topbar .btn.mild{background:#2b405a;color:#d6e0ee}.square{border-radius:9px;height:35px;min-width:35px;display:grid;place-items:center;background:#2b405a;color:#dce7f2;font-size:19px}.mobile-menu{display:none}.body-grid{flex:1;min-height:0;display:grid;grid-template-columns:var(--side) 1fr}.sidebar{background:white;border-right:1px solid var(--edge);min-height:0;display:flex;flex-direction:column;z-index:8}.sidebar-tabs{display:flex;padding:12px 12px 0;gap:5px;border-bottom:1px solid var(--edge)}.tab{padding:10px 13px;font-weight:720;font-size:12px;color:#7d8998;border-bottom:2px solid transparent;white-space:nowrap}.tab.active{border-bottom-color:var(--accent);color:var(--navy)}#countBadge{font-size:10px;color:#ad774d;background:#fff2e7;padding:3px 5px;border-radius:100px}.sidebar-heading{display:flex;justify-content:space-between;padding:18px 16px 9px;align-items:center;font-size:11px;color:#919ba6;font-weight:700}.tiny{color:#dc7939;font-size:11px;font-weight:700}.side-list{flex:1;overflow-y:auto;padding:3px 8px 24px}.side-item{display:flex;gap:8px;align-items:flex-start;justify-content:space-between;padding:9px 9px;border-radius:7px;font-size:12px;color:#536175;text-align:left;line-height:1.5;width:100%;border:0;background:white;cursor:pointer}.side-item:hover,.side-item.selected{background:#fff3e9;color:#bd652a}.side-item span:first-child{min-width:0;overflow-wrap:anywhere}.side-item .pagenum{flex:0 0 auto;font-size:10px;color:#97a2ad}.empty-side{text-align:center;color:#a0aab5;font-size:12px;padding:40px 12px;line-height:1.9}.note-item{border-bottom:1px solid #f0f2f5;padding:12px 10px;display:block;text-align:left;width:100%;background:none;border-left:0;border-top:0;border-right:0}.note-item:hover{background:#faf5f0}.note-line{display:flex;align-items:center;gap:7px;font-weight:720;font-size:11px;color:#57657a}.note-content{font-size:11px;color:#6d7788;margin:5px 0 0 13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.note-dot{height:8px;width:8px;border-radius:2px;background:#ffe260;flex-shrink:0}.sidebar-footer{border-top:1px solid var(--edge);padding:17px 14px;font-size:10px;color:#8a96a6;display:flex;align-items:center;gap:8px}.status-dot{height:7px;width:7px;border-radius:50%;background:#65c29f}.main{min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--bg)}.toolbar{min-height:55px;background:white;border-bottom:1px solid var(--edge);display:flex;align-items:center;gap:13px;padding:7px 17px;flex-wrap:wrap;z-index:4}.toolgroup,.viewgroup,.zoomgroup,.swatch-box{display:flex;align-items:center;gap:4px}.tool{font-size:13px;border-radius:7px;padding:9px 9px;display:flex;align-items:center;gap:6px;color:#647286;font-weight:730;white-space:nowrap}.tool:first-letter{font-size:15px}.tool.active{background:#fff0e3;color:#ca6b2e}.tool:hover,.mini:hover{background:#f2f5f8}.divider{background:var(--edge);width:1px;height:24px;flex-shrink:0}.swatch-box{gap:6px}.swatch{width:19px;height:19px;background:var(--sw);border:2px solid #fff;box-shadow:0 0 0 1px #d9dfe7;border-radius:50%;padding:0}.swatch.selected{box-shadow:0 0 0 2px var(--navy)}.toolspacer{flex:1}.mini{min-height:30px;min-width:31px;border-radius:6px;font-weight:800;color:#5c697b;font-size:15px}.mini.on{color:var(--accent);background:#fff1e6}.cover-check{font-size:10px;color:#818b99;display:flex;gap:3px;align-items:center;white-space:nowrap}.cover-check input{accent-color:var(--accent)}#zoomText{font-size:11px;width:43px;text-align:center;color:#7a8594}.fit-btn{font-size:11px}.reader-wrap{flex:1;min-height:0;display:flex;position:relative}.reader{overflow:auto;flex:1;display:flex;justify-content:center;align-items:flex-start;padding:32px 35px 50px;position:relative;touch-action:pan-x pan-y}.pages{display:flex;align-items:flex-start;justify-content:center;gap:12px;min-height:100%;margin:auto 0;max-width:none}.pages:not(:empty){margin:0}.pdf-page{position:relative;background:white;box-shadow:0 8px 25px #263e5920,0 1px 5px #22334418;flex:0 0 auto;overflow:hidden;user-select:none}.pdf-page canvas{display:block}.pdf-page .overlay{position:absolute;inset:0;pointer-events:none;touch-action:none}.overlay.active-tool{pointer-events:auto}.hi-box{position:absolute;opacity:.42;mix-blend-mode:multiply;pointer-events:auto;border-radius:1px}.hi-box:hover{outline:1px dashed #ad7847}.hi-box.working{border:1px dashed #8e7722;z-index:9;pointer-events:none}.note-pin{position:absolute;background:#ffe397;border:1px solid #e3bd5a;box-shadow:1px 2px 6px #312b1733;border-radius:3px;min-width:23px;height:23px;display:grid;place-items:center;font-size:14px;cursor:pointer;pointer-events:auto}.note-pin::after{content:"";position:absolute;right:0;bottom:0;border-width:0 0 7px 7px;border-style:solid;border-color:transparent transparent #efc95f transparent}.image-sticker{position:absolute;pointer-events:auto;box-shadow:0 2px 12px #2225;border:2px solid white;object-fit:contain;background:#fff;max-width:none;touch-action:none}.image-sticker:hover{border-color:#ed7b31}.pagebadge{position:absolute;right:8px;bottom:5px;background:#ffffffcf;color:#9ba4af;border-radius:3px;font-size:9px;padding:1px 5px;pointer-events:none}.minimap{width:17px;background:#e8ebf0;position:relative;flex:0 0 17px;border-left:1px solid #dce2ea;cursor:pointer}.minimap-marks{position:absolute;inset:4px 2px}.map-mark{position:absolute;width:100%;height:4px;border-radius:3px;opacity:.95}.minimap-current{position:absolute;left:0;right:0;height:7px;border:1px solid var(--navy);background:#8092ad66}.pagebar{min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--edge);background:white;padding:6px 16px}.bottom-left,.bottom-right{flex:1;display:flex;align-items:center;gap:12px}.bottom-left{font-size:10px;color:#8b97a5}.bottom-right{justify-content:flex-end}.page-controls{display:flex;align-items:center;gap:12px}.navbtn{background:#f2f5f8;border-radius:8px;font-size:25px;line-height:20px;min-width:34px;min-height:34px;color:#4c5d71}.page-display{white-space:nowrap;display:flex;align-items:center;gap:4px;font-size:12px;color:#8c99a8}.page-display input{width:47px;border:1px solid #dee3ea;border-radius:5px;text-align:center;padding:6px 0;color:#344258;background:white;font-weight:700;appearance:textfield}.page-display input::-webkit-outer-spin-button,.page-display input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.linkbtn{font-size:10px;color:#667488;font-weight:680;white-space:nowrap}.linkbtn:hover{text-decoration:underline}.empty{margin:auto;text-align:center;max-width:540px;padding:38px 15px}.empty h1{font-size:28px;letter-spacing:-.9px;color:#263a52;margin:25px 0 11px}.empty p{color:#8a96a5;font-size:12px;line-height:1.85}.empty .btn.large{font-size:14px;padding:14px 27px;margin-top:20px;border-radius:10px}.empty .privacy{font-size:10px;margin-top:22px}.empty-art{width:155px;height:114px;position:relative;margin:auto}.sheet{position:absolute;width:75px;height:105px;background:white;top:0;border-radius:5px;box-shadow:0 8px 25px #263b5522;border-top:7px solid #f1b77f}.leftsheet{left:0;transform:rotate(-8deg)}.rightsheet{right:0;transform:rotate(8deg);border-top-color:#7b9fc0}.empty-art span{position:absolute;top:27px;left:62px;font-size:30px;color:#ec9349}.note-dialog{border:0;box-shadow:0 18px 70px #15274056;border-radius:15px;padding:26px;min-width:min(92vw,410px);max-width:92vw;color:var(--text)}dialog::backdrop{background:#15274070}.note-dialog h2{font-size:18px;margin:0 0 9px}.muted{font-size:12px;color:#86919e;line-height:1.7}.note-dialog textarea{width:100%;border:1px solid #dee4ea;border-radius:8px;resize:vertical;padding:12px;margin-top:6px;line-height:1.5;outline-color:#eda366}.modal-actions{display:flex;align-items:center;gap:10px;margin-top:17px}.btn.danger{background:#fff0ef;color:#cb6764}.width-row{display:flex;gap:10px;align-items:center;font-size:12px;padding:18px 0}.width-row input{flex:1;accent-color:var(--accent)}.recent-list{min-height:40px;max-height:45vh;overflow:auto}.recent-doc{display:flex;align-items:center;gap:8px;border-bottom:1px solid #e9edf2;padding:9px 0}.recent-doc .docname{background:none;border:0;text-align:left;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#3b4a5b;font-size:13px}.recent-doc .remove{border:0;background:#fff0ef;color:#bb6b67;border-radius:6px;padding:6px}.toast{position:fixed;bottom:75px;left:50%;transform:translateX(-50%);background:#213449;color:#fff;box-shadow:0 5px 20px #131e2e50;z-index:80;padding:11px 19px;border-radius:8px;font-size:12px;max-width:90%;opacity:0;transition:opacity .2s;pointer-events:none}.toast.show{opacity:1}.shade{display:none}
@media(max-width:1100px){:root{--side:220px}.toolbar{gap:6px;padding:7px 9px}.tool{padding:9px 7px}.tool span{display:none}.reader{padding:19px 22px 35px}.cover-check{display:none}}
@media(max-width:740px){.topbar{padding:0 8px;gap:7px;height:54px;flex-basis:54px}.mobile-menu{display:grid}.brand{gap:5px}.brand-icon{height:29px;width:29px;font-size:18px}.brand-text{font-size:12px}.brand-text small{font-size:5px;letter-spacing:1px}.file-label{display:none}.topbar .btn{padding:8px;font-size:11px}.topbar .btn.mild{display:inline-flex;padding:8px 7px}.body-grid{display:block;position:relative;flex:1}.sidebar{position:absolute;top:0;bottom:0;left:0;width:min(85vw,290px);transform:translateX(-105%);transition:transform .15s;box-shadow:8px 0 25px #1a253a11}.sidebar.open{transform:translateX(0);z-index:11}.shade.show{position:absolute;inset:0;background:#1e2d4050;display:block;z-index:10}.main{height:100%}.toolbar{padding:6px 5px;gap:5px;min-height:44px}.toolbar .divider{display:none}.tool{padding:7px 9px}.swatch-box{gap:4px}.swatch{width:16px;height:16px}.viewgroup{margin-left:auto}.zoomgroup{display:none}.reader{padding:15px 8px 25px}.pages{gap:6px}.minimap{width:12px;flex-basis:12px}.pagebar{padding:6px 7px;min-height:51px}.bottom-left{display:none}.bottom-right{gap:6px}.bottom-right .linkbtn{font-size:9px}.page-controls{gap:5px}.page-display input{width:36px}.navbtn{min-width:29px;min-height:31px}.empty h1{font-size:22px}.empty{padding:20px 9px}}

/* Exam-question links and screenshot popup (V2) */
.problem-pin{position:absolute;display:grid;place-items:center;min-width:26px;min-height:26px;padding:1px 6px;border:2px solid #fff;border-radius:6px;background:#ed7b31;color:#fff;font-size:14px;font-weight:900;box-shadow:0 2px 8px #18314960;pointer-events:auto;touch-action:none;cursor:pointer;z-index:3}
.problem-pin:hover,.problem-pin:focus-visible{background:#b9501b;outline:2px solid #ffe1a5}
.problem-dialog{border:0;box-shadow:0 16px 75px #11233a66;border-radius:13px;padding:18px;width:min(94vw,900px);max-height:94dvh;overflow:hidden;background:#f8fafc;color:var(--text)}
.problem-dialog::backdrop{background:#152740b8}
.problem-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.problem-dialog-head h2{font-size:17px;margin:0 0 3px}
.problem-dialog-head p{margin:0 0 10px}
.problem-close{background:#e8edf1;color:#34465d;border-radius:50%;border:0;width:33px;height:33px;font-weight:700;flex-shrink:0}
.problem-title-wrap{font-size:11px;color:#67768a;font-weight:700;display:flex;gap:12px;align-items:center;margin:6px 0 12px}
.problem-title-wrap input{flex:1;min-width:0;border:1px solid #dbe1e9;border-radius:6px;padding:9px 10px;color:#233a56;font-size:13px}
.problem-image-scroll{height:min(69dvh,750px);max-height:calc(94dvh - 182px);overflow:auto;border:1px solid #dbe1e9;background:#e8ebf0;text-align:center;border-radius:8px;padding:12px}
.problem-image-scroll img{width:100%;max-width:none;height:auto;object-fit:contain;vertical-align:top;box-shadow:0 2px 16px #34415b30;background:white}
.problem-dialog-actions{display:flex;align-items:center;gap:7px;margin-top:11px}
.problem-dialog-actions #problemZoomText{font-size:11px;color:#64758a;width:40px;text-align:center}
@media (max-width:740px){.problem-dialog{width:98vw;max-height:98dvh;padding:10px}.problem-image-scroll{max-height:calc(98dvh - 181px);padding:6px}.problem-dialog-actions{gap:4px}.problem-dialog-actions .btn{font-size:10px;padding:8px 6px}.problem-title-wrap{gap:6px}.problem-title-wrap input{padding:7px 8px}}

/* V5: text follows glyphs. This layer is invisible, but selectable like ordinary text. */
.pdf-page .textLayer{position:absolute;inset:0;z-index:2;overflow:hidden;line-height:1;text-align:initial;pointer-events:none;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none}
.pdf-page .textLayer span,.pdf-page .textLayer br{position:absolute;white-space:pre;transform-origin:0% 0%;color:transparent;cursor:text}
.pdf-page .textLayer ::selection{background:rgba(75,130,255,.38)}
.pdf-page.hl-mode .textLayer{pointer-events:auto;user-select:text;-webkit-user-select:text}
.pdf-page.hl-mode .textLayer span{pointer-events:auto;user-select:text;-webkit-user-select:text}
.pdf-page .overlay{z-index:3}
.pdf-page .hi-box{pointer-events:auto}
.pdf-page.hl-mode .hi-box{pointer-events:none}
.annotation-entry{display:flex;align-items:stretch;border-bottom:1px solid #e9edf2}
.annotation-entry .note-item{border-bottom:0;flex:1;min-width:0}
.annotation-remove{border:0;background:transparent;color:#b95948;font-size:10px;padding:8px 7px;cursor:pointer}
.annotation-remove:hover{background:#fff0ef}
#app.sidebar-hidden .body-grid{grid-template-columns:0 minmax(0,1fr)}
#app.sidebar-hidden .sidebar{visibility:hidden;overflow:hidden}
.desktop-sidebar{display:grid}
#savePdfBtn{font-size:11px;padding:8px 10px}
/* On zoom, align the start of wide spreads so their left half remains reachable. */
.reader{justify-content:flex-start}
.pages{margin-left:auto;margin-right:auto}
@media(max-width:740px){.desktop-sidebar{display:none}#savePdfBtn{font-size:10px;padding:7px 5px}.bottom-right{gap:3px}}

/* StudyPDF V5: preserve legibility while toggling outlines. */
.side-list .annotation-entry .side-item{flex:1;min-width:0}
@media(max-width:1100px){.desktop-sidebar{display:none}}
@media(max-width:740px){.toolbar .zoomgroup{display:flex}.toolbar .zoomgroup .mini{min-width:27px;font-size:12px}.toolbar .zoomgroup #zoomText{width:35px}}

#offlineState{color:#4b7968;font-weight:650}

/* V6 rendering and tablet corrections. */
.pdf-page canvas{image-rendering:auto}
.pdf-page .textLayer{position:absolute;inset:0;z-index:2;overflow:clip;line-height:1;text-align:initial;pointer-events:none;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:#173c72;--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size))}
.pdf-page .textLayer :is(span,br){position:absolute;white-space:pre;transform-origin:0% 0%;color:transparent;cursor:text}
.pdf-page .textLayer>:not(.markedContent),.pdf-page .textLayer .markedContent span:not(.markedContent){z-index:1;--font-height:0;font-size:calc(var(--text-scale-factor) * var(--font-height));--scale-x:1;--rotate:0deg;transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}
.pdf-page .textLayer .markedContent{display:contents}
.pdf-page .textLayer span[role="img"]{user-select:none;cursor:default}
@media (min-width:741px) and (max-width:1100px){.desktop-sidebar{display:grid}}
