/* Shared book opening, paper-turning and accessible narration docking. */
.dg-book-reader .book.dg-physical-book{position:relative;perspective:2000px;overflow:visible;isolation:isolate;box-shadow:0 22px 60px #301a1545,0 0 0 8px #c9a77332}
.dg-book-reader .book.dg-physical-book:before{content:'';position:absolute;left:calc(50% - 8px);top:0;bottom:0;width:16px;pointer-events:none;background:linear-gradient(90deg,transparent,#65432e29 40%,#0002 50%,#fff5 80%,transparent);z-index:3}
.dg-opening-cover{position:absolute;left:50%;top:0;bottom:0;width:50%;transform-origin:left center;z-index:6;display:flex;gap:18px;flex-direction:column;align-items:center;justify-content:center;color:#edc88a;background:linear-gradient(130deg,#173929,#326044 56%,#143527);border:5px solid #c4a16b;box-shadow:4px 5px 22px #19120973;backface-visibility:hidden;pointer-events:none;animation:dg-open-cover 920ms cubic-bezier(.2,.65,.21,1) 150ms forwards}
.dg-opening-cover .dg-om{font:68px Georgia,serif}.dg-opening-cover .dg-cover-text{font:600 27px Georgia,'Noto Serif Devanagari',serif}.dg-opening-cover small{letter-spacing:3px;font-size:10px}
@keyframes dg-open-cover{0%{transform:rotateY(0);opacity:1;visibility:visible}80%{opacity:.9}100%{transform:rotateY(-173deg);opacity:0;visibility:hidden}}
.dg-flip-sheet{position:absolute;top:0;bottom:0;width:50%;z-index:8;transform-style:preserve-3d;pointer-events:none;will-change:transform}
.dg-flip-forward{left:50%;transform-origin:left center;animation:dg-flip-forward 660ms cubic-bezier(.2,.6,.23,1) both}
.dg-flip-backward{left:0;transform-origin:right center;animation:dg-flip-backward 660ms cubic-bezier(.2,.6,.23,1) both}
.dg-flip-front,.dg-flip-reverse{position:absolute;inset:0;backface-visibility:hidden;overflow:hidden;background:#fff9ed}
.dg-flip-front>.page{height:100%;width:100%;min-height:100%;border:none}
.dg-flip-reverse{transform:rotateY(180deg);display:grid;place-items:center;color:#9b7541;font:68px Georgia,serif;background:linear-gradient(110deg,#e7d4b2,#fffaf0 65%,#dfcba8)}
@keyframes dg-flip-forward{to{transform:rotateY(-180deg)}}@keyframes dg-flip-backward{to{transform:rotateY(180deg)}}
.dg-page-sound{border:1px solid #d4bd7b80;background:#204a37;color:#f9eac8;border-radius:26px;padding:9px 14px;cursor:pointer;font-size:12px;white-space:nowrap}
.dg-page-sound[aria-pressed="false"]{opacity:.65}
.dg-book-reader main{padding-bottom:44px}
.dg-book-reader .audio{position:static!important;inset:auto!important;transform:none!important;z-index:auto;width:100%;max-width:1120px;margin:13px auto 18px!important;background:#15382b;border:1px solid #ba9b6577;border-radius:14px;box-shadow:0 8px 22px #0003;padding:14px!important;overflow:visible!important;max-height:none!important;backdrop-filter:none!important}
@media(max-width:760px){.dg-book-reader .book.dg-physical-book:before{display:none}.dg-opening-cover{left:0;width:100%}.dg-book-reader .audio{max-height:none!important;overflow:visible!important;padding:12px!important}.dg-book-reader main{padding-bottom:34px}.dg-page-sound{padding:7px 10px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.dg-opening-cover{display:none}.dg-flip-forward,.dg-flip-backward{animation-duration:1ms}}



/* Shared reading comfort, offline-safe. These controls never overlap printed text. */
.dg-reader-typography{max-width:1040px;margin:4px auto 16px;display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:7px 12px;border:1px solid #aa93624f;border-radius:12px;background:#173929b8;color:#e5cb9a;font:12px Arial,sans-serif}
.dg-reader-typography .dg-type-title{margin-right:auto;color:#e4d2b0;font-weight:600}
.dg-reader-typography button{min-height:36px;min-width:41px;background:#27533d;color:#f6e5c2;border:1px solid #af976a80;border-radius:9px;padding:8px 11px;font:700 13px Arial,sans-serif}
.dg-reader-typography button:hover:not(:disabled){background:#34674b}
.dg-reader-typography button:focus-visible{outline:2px solid #f1d196;outline-offset:3px}
.dg-reader-typography button:disabled{opacity:.43}
.dg-reader-typography .dg-type-amount{font-variant-numeric:tabular-nums;min-width:41px;text-align:center;color:#e7d2af}
.dg-reader-typography .dg-type-reset{font-size:11px;font-weight:400}
.dg-book-reader .audio :is(button,input,select){touch-action:manipulation}
@media(max-width:760px){
 .dg-reader-typography{padding:7px 9px;gap:6px;min-height:46px;margin:6px auto 14px}
 .dg-reader-typography .dg-type-title{font-size:11px;margin-right:auto}
 .dg-reader-typography button{min-width:37px;min-height:38px;padding:6px 8px}
 .dg-book-reader header .dg-page-sound{width:42px;min-width:42px;height:42px;padding:0!important;font-size:0!important;display:grid;place-items:center}
 .dg-book-reader header .dg-page-sound:before{content:'♫';font-size:19px;color:#f8ddac}
 .dg-book-reader header .dg-page-sound[aria-pressed="false"]:before{content:'♪';opacity:.65}
}
@media(max-width:355px){.dg-reader-typography .dg-type-title{font-size:10px}.dg-reader-typography{gap:4px}.dg-reader-typography button{min-width:33px;padding:5px}}

/* Mobile book shell: four real actions; scripture, audio, and page controls
   stay in normal layout. No floating voice settings and no single-page fake. */
.dgMobileDock{display:none}
@media(max-width:760px){
 html{scroll-padding-top:82px;-webkit-text-size-adjust:100%}
 .dg-book-reader{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))}
 .dg-book-reader main{padding-bottom:calc(112px + env(safe-area-inset-bottom,0px))!important}
 .dg-book-reader .dgMobileDock{position:fixed;z-index:90;inset:auto 0 0;
   display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;
   padding:7px max(9px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(9px,env(safe-area-inset-left,0px));
   background:#143b2eed;border-top:1px solid #c5a873;
   box-shadow:0 -8px 28px #0005;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
 .dg-book-reader .dgMobileDock button{min-width:0;min-height:57px;display:flex;
   flex-direction:column;align-items:center;justify-content:center;gap:4px;
   padding:5px 2px;border:0;border-radius:13px;background:transparent;
   color:#e8d4b3;font:600 11px/1.1 system-ui,sans-serif}
 .dg-book-reader .dgMobileDock button[aria-current="page"]{background:#d7ba85;color:#17372b}
 .dgDockGlyph{font:500 23px/1.1 system-ui,sans-serif;height:26px}
 .dgDockText{white-space:nowrap}
 .dg-book-reader :where(button,select,a):focus-visible{outline:3px solid #f1c779;outline-offset:3px}
 .dg-book-reader button,.dg-book-reader select{touch-action:manipulation}
 .dg-book-reader .navigation button,.dg-book-reader .navigator button,.dg-book-reader .nav button{min-height:47px}
 .dg-book-reader .audio button{min-height:46px;border-radius:11px}
 .dg-book-reader .dg-reader-typography button{min-height:44px;min-width:44px}
 .dg-book-reader .dg-page-sound{min-height:44px;white-space:normal}
 .dg-book-reader select,.dg-book-reader input[type="search"]{font-size:16px}
 .dg-book-reader .book{overscroll-behavior:contain;touch-action:pan-y}
 .dg-book-reader .book .page{min-width:0}
 .dg-book-reader .book .page :where(pre,p){overflow-wrap:anywhere}
}
@media(max-width:375px){.dg-book-reader .dgMobileDock button{font-size:10px}}
@media(prefers-reduced-motion:reduce){.dgMobileDock *{transition:none!important}}

/* Reader navigation uses the same non-emoji icons as the main app. */
@media(max-width:760px){
 .dg-book-reader .dgMobileDock .dgDockGlyph{display:flex;align-items:center;justify-content:center;
  width:28px;height:25px;margin:0 auto}
 .dg-book-reader .dgMobileDock .dgDockGlyph svg{display:block;width:22px;height:22px;
  stroke:currentColor;stroke-width:1.8}
 .dg-book-reader .dgMobileDock button{gap:3px}
 .dg-book-reader .dgMobileDock button[aria-current="page"] svg{stroke-width:2.05}
}
