
/* Release 28: compact language control and a physical book leaf. */
.topbar { flex-wrap:wrap; height:auto; min-height:var(--header-height); row-gap:12px; padding-bottom:24px; }
.topbar .brand { font-size:10px; letter-spacing:.09em; flex:1 1 100px; }
.topbar .language-picker { display:flex!important; order:1; border:1px solid var(--line); border-radius:20px; padding:0 7px; height:40px; background:var(--surface); max-width:120px; }
.language-picker>span { display:none; }
.topbar .language-picker select { width:100%; min-width:0; max-width:105px; border:0; padding:6px 2px; font-size:13px; background:transparent; color:var(--ink); }
.top-controls { order:2; gap:10px; }
.active-phrase { order:2; text-align:center; width:100%; max-width:430px; margin:0 auto 6px; padding:4px 8px 12px; }
.active-phrase[hidden] { display:none; }
.active-arabic { font-family:'Noto Naskh Arabic',serif; font-size:27px; line-height:1.9; margin:0; color:var(--ink); }
.active-transcription { color:var(--muted); font-size:14px; line-height:1.6; margin:4px 0 0; overflow-wrap:anywhere; }
#tasbih:not(.free-practice) #countButton { height:clamp(210px,35svh,320px); }
.app-shell.focus-mode .active-phrase { display:none; }
.book-reader { position:relative; perspective:1400px; isolation:isolate; overflow:hidden; box-shadow:inset 9px 0 18px #2222,0 14px 35px #183c2110; }
.book-reader.book-opening { animation:none; }
.reader-opening-cover { position:absolute; inset:0; z-index:5; border-radius:inherit; background:linear-gradient(105deg,#244f3c,#3f7054 30%,#29543e); color:#f8f2d8; display:flex; flex-direction:column; justify-content:center; gap:22px; padding:34px; border-inline-start:9px solid #193c2e; transform-origin:left center; animation:cover-unfold .8s cubic-bezier(.22,.65,.25,1) forwards; backface-visibility:hidden; pointer-events:none; }
.reader-opening-cover small { font-size:10px; letter-spacing:.2em; }
.reader-opening-cover strong { font:500 31px/1.3 Georgia,serif; }
.reader-opening-cover span { font-size:14px; opacity:.8; }
.page-leaf { position:absolute; z-index:4; margin:0; background:var(--surface); box-shadow:12px 0 20px #182c2725; pointer-events:none; backface-visibility:hidden; }
.page-leaf::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent 35%,#89764922 80%,#fff6); pointer-events:none; }
.leaf-forward { transform-origin:left center; animation:leaf-turn .78s cubic-bezier(.25,.65,.2,1) forwards; }
.leaf-back { transform-origin:right center; animation:leaf-return .78s cubic-bezier(.25,.65,.2,1) forwards; }
@keyframes cover-unfold { 0%,12%{transform:rotateY(0);opacity:1}85%{opacity:1}100%{transform:rotateY(-165deg);opacity:0} }
@keyframes leaf-turn { 0%{transform:rotateY(0);opacity:1}45%{transform:rotateY(-28deg) translateX(-1%);opacity:1}100%{transform:rotateY(-110deg) translateX(-6%);opacity:0} }
@keyframes leaf-return { 0%{transform:rotateY(0);opacity:1}45%{transform:rotateY(28deg) translateX(1%);opacity:1}100%{transform:rotateY(110deg) translateX(6%);opacity:0} }
@media(max-width:380px){.topbar .brand{flex-basis:100%;text-align:center}.topbar .language-picker{margin-inline-end:auto}.top-controls{margin-inline-start:auto}.topbar{padding-bottom:22px}.active-arabic{font-size:24px}}
@media(prefers-reduced-motion:reduce){.reader-opening-cover,.page-leaf{display:none!important}}
html[data-reduce-motion=true] .reader-opening-cover,html[data-reduce-motion=true] .page-leaf{display:none!important}
.topbar .language-picker{width:90px;min-width:90px;position:relative;flex-shrink:0;border-radius:20px}.topbar .language-picker select{opacity:1!important;position:static!important;inset:auto!important;height:100%;cursor:pointer}

/* Short, composited transitions: no layout animation while counting. */
.screen.active{animation:screen-settle .36s cubic-bezier(.2,.75,.25,1)}
#countButton.tap-wave .tasbih-number{animation:number-press .22s cubic-bezier(.2,.7,.2,1)}
.practice-choice[open] .choice-content{animation:menu-unfold .3s cubic-bezier(.2,.75,.25,1)}
.modal[open]{animation:dialog-settle .32s cubic-bezier(.2,.8,.25,1)}
.modal::backdrop{animation:backdrop-settle .24s ease-out}
.faq-section details[open]>p{animation:menu-unfold .28s ease-out}
.nav-item{transition:background-color .24s ease,color .24s ease}
.nav-item img{transition:transform .24s cubic-bezier(.2,.8,.2,1)}
.nav-item.active img{transform:translateY(-2px)}
@keyframes screen-settle{from{opacity:.3;transform:translateY(9px)}to{opacity:1;transform:none}}
@keyframes number-press{0%{transform:scale(1)}38%{transform:scale(.96)}100%{transform:scale(1)}}
@keyframes menu-unfold{from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:none}}
@keyframes dialog-settle{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@keyframes backdrop-settle{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.screen.active,#countButton .tasbih-number,.practice-choice .choice-content,.modal,.modal::backdrop,.faq-section details>p{animation:none!important}.nav-item,.nav-item img{transition:none!important}}
html[data-reduce-motion=true] .screen.active,html[data-reduce-motion=true] #countButton .tasbih-number,html[data-reduce-motion=true] .practice-choice .choice-content,html[data-reduce-motion=true] .modal,html[data-reduce-motion=true] .modal::backdrop,html[data-reduce-motion=true] .faq-section details>p{animation:none!important}

.page-leaf::after{animation:fold-shade .78s ease-in-out both}
@keyframes fold-shade{0%{opacity:.1;transform:translateX(25%)}50%{opacity:.8;transform:translateX(0)}100%{opacity:.15;transform:translateX(-20%)}}
