*{box-sizing:border-box}
:root{
  --qg-navy:#102b49;
  --qg-blue:#1b5d91;
  --qg-gold:#f2bd3d;
  --graphite:#171b20;
  --graphite-soft:#20262d;
  --line:#39424c;
  --text:#f5f7fa;
  --muted:#b4bec8;
}
html,body{margin:0;padding:0;width:100%;height:100%;font-family:Inter,Arial,Helvetica,sans-serif;color:var(--text);background:transparent}
button,a,input{font:inherit}
.viewer{position:relative;width:100%;height:100dvh;min-height:560px;background:var(--graphite);border:1px solid #303943;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 14px 40px #0002}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:var(--qg-navy);border-bottom:1px solid #244563;flex:0 0 auto;z-index:10}
.toolbar-group{display:flex;align-items:center;gap:7px}
.toolbar button,.download,.page-controls button{min-height:36px;min-width:36px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:7px 11px;border:1px solid #526779;border-radius:7px;background:#193c5c;color:#fff;text-decoration:none;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.toolbar button:hover,.page-controls button:hover{background:#285579;border-color:#83a5c2}
.toolbar button:focus-visible,.download:focus-visible,.nav:focus-visible,.page-controls button:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid var(--qg-gold);outline-offset:2px}
.toolbar svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#zoomLabel{font-size:12px;font-variant-numeric:tabular-nums;min-width:42px;text-align:center;color:#fff}
.download{background:var(--qg-gold);border-color:var(--qg-gold);color:#172638;font-weight:700}
.download:hover{background:#ffcf5b;border-color:#ffcf5b}
.reader-area{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:0;padding:28px 48px;background:radial-gradient(ellipse at center,#343b43 0%,#242a31 58%,#1a1f25 100%);overflow:hidden}
.book-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;transform-origin:center center;transition:transform .14s ease;will-change:transform;min-width:0;min-height:0}
.book{width:100%;height:100%;margin:auto;max-width:100%;max-height:100%}
.book .page{background:#fff;overflow:hidden}
.book canvas{display:block;width:100%;height:100%;object-fit:contain}
.loading{padding:40px 20px;text-align:center;color:#e1e7ed}
.nav{position:absolute;z-index:5;top:50%;transform:translateY(-50%);width:40px;height:56px;border:1px solid #66727d;border-radius:9px;background:#111820dd;color:#fff;font-size:34px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 14px #0003}
.nav:hover{background:var(--qg-blue);border-color:#7fa9cc}
.prev{left:9px}.next{right:9px}
.progress-wrap{height:4px;flex:0 0 4px;background:#333b44;z-index:10}
.progress-track{width:100%;height:100%;background:#343b44}
.progress-bar{height:100%;width:0;background:var(--qg-gold);transition:width .2s ease}
.reader-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;background:#20262d;border-top:1px solid #343d47;color:var(--muted);font-size:12px;flex:0 0 auto;z-index:10}
.reading-status{display:flex;align-items:center;gap:8px;min-width:0}.reading-status #status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.status-dot{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--qg-gold)}
.page-controls{display:flex;align-items:center;gap:7px;white-space:nowrap}
.page-controls button{min-height:30px;min-width:30px;padding:4px 8px;background:#2a333c;border-color:#46515c}
.page-controls label{color:#cbd3db}
.page-controls input{width:54px;height:30px;padding:4px 7px;border:1px solid #56616d;border-radius:6px;background:#111820;color:#fff}
#pageTotal{font-variant-numeric:tabular-nums}
.help{padding:0 16px 12px;background:#20262d;color:#c6cfd7;font-size:12px;flex:0 0 auto}
.help summary{cursor:pointer;color:#f0c75e;display:inline-block;padding:2px 0 5px}
.help p{margin:4px 0 0;line-height:1.6;max-width:900px}
kbd{font-family:inherit;background:#111820;border:1px solid #46515c;border-radius:4px;padding:1px 5px;color:#fff}
.error{padding:14px 16px;background:#3c2021;color:#ffd9d6;border-top:1px solid #874444;font-size:13px;line-height:1.5;z-index:20}
.viewer:fullscreen{min-height:100vh;border-radius:0;border:0}
.viewer:fullscreen .reader-area{min-height:0;flex:1}
.viewer:fullscreen .book-stage{max-height:none}
@media(max-width:600px){
 .viewer{height:100dvh;min-height:0;border:0;border-radius:0;box-shadow:none}
 .toolbar,.reader-footer,.progress-wrap{position:absolute;left:0;right:0;transition:transform .25s ease,opacity .2s ease,visibility .25s ease}
 .toolbar{top:0;padding:max(9px,env(safe-area-inset-top)) 10px 9px;background:#102b49f2}
 .reader-footer{bottom:0;padding:9px 10px max(9px,env(safe-area-inset-bottom));background:#20262df2;align-items:flex-start;flex-direction:column;gap:9px}
 .progress-wrap{bottom:0;height:4px}
 .viewer:not(.mobile-ui-visible) .toolbar{transform:translateY(-110%);opacity:0;visibility:hidden;pointer-events:none}
 .viewer:not(.mobile-ui-visible) .reader-footer{transform:translateY(110%);opacity:0;visibility:hidden;pointer-events:none}
 .viewer:not(.mobile-ui-visible) .progress-wrap{opacity:0;visibility:hidden}
 .toolbar{gap:7px}.toolbar-group{gap:4px}
 .toolbar button,.download{padding:6px 8px;min-width:32px;min-height:33px}
 .toolbar button span,.download span{font-size:12px}
 #zoomLabel{min-width:34px;font-size:11px}
 .reader-area{width:100%;height:100%;min-height:0;padding:0 18px}
 .book-stage{width:100%;height:100%}
 .nav{width:30px;height:45px;font-size:28px;background:#11182099}.prev{left:3px}.next{right:3px}
 .help{display:none}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}

.page-pending{background:linear-gradient(135deg,#eef2f5,#ffffff);position:relative}
.page-pending::after{content:"Carregando página…";position:absolute;inset:0;display:grid;place-items:center;color:#71808d;font-size:12px;background:#fff9}
.page-canvas{position:relative;z-index:1}
.pdf-notice{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(8,15,23,.72);backdrop-filter:blur(3px)}
.pdf-notice[hidden]{display:none}
.pdf-notice-card{position:relative;width:min(100%,520px);padding:30px 30px 26px;border:1px solid #d8e0e7;border-radius:14px;background:#fff;color:#182431;box-shadow:0 18px 60px #0006;text-align:center}
.pdf-notice-close{position:absolute;top:9px;right:11px;width:34px;height:34px;border:0;border-radius:50%;background:transparent;color:#5c6a76;font-size:27px;line-height:1;cursor:pointer}
.pdf-notice-close:hover{background:#edf1f4;color:#182431}
.pdf-notice-icon{width:46px;height:46px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;background:#fff2c9;color:#8a6200;font-size:28px;font-weight:700}
.pdf-notice h2{margin:0 0 11px;color:#102b49;font-size:22px}
.pdf-notice p{margin:0 auto 22px;max-width:430px;color:#4c5c68;font-size:14px;line-height:1.6}
.pdf-notice-actions{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:10px}
.pdf-notice-download,.pdf-notice-continue{min-height:40px;padding:9px 15px;border-radius:7px;font-size:13px;font-weight:700;cursor:pointer;text-decoration:none}
.pdf-notice-download{background:#f2bd3d;border:1px solid #f2bd3d;color:#172638}
.pdf-notice-download:hover{background:#ffcf5b;border-color:#ffcf5b}
.pdf-notice-continue{background:#eef2f5;border:1px solid #ccd6de;color:#263746}
.pdf-notice-continue:hover{background:#e2e9ee}
.pdf-notice-download:focus-visible,.pdf-notice-continue:focus-visible,.pdf-notice-close:focus-visible{outline:2px solid #1b5d91;outline-offset:2px}
@media(max-width:600px){
 .pdf-notice{padding:14px}
 .pdf-notice-card{padding:27px 19px 21px}
 .pdf-notice-actions{align-items:stretch;flex-direction:column}
 .pdf-notice-download,.pdf-notice-continue{width:100%}
}
