/* Compact, tactile controls. Closed locale picker contains only a globe icon. */
.mojeze-app .app-account-actions{gap:8px}
.mojeze-app .app-top-icon-btn,.mojeze-app .app-login-icon-only{
 width:43px;min-width:43px;height:43px;min-height:43px;display:grid;place-items:center;
 padding:0!important;margin:0;border:1px solid #d6e5da;border-radius:13px;
 background:linear-gradient(145deg,#fffefa,#f2f8f2);color:#21785a;
 box-shadow:0 3px 12px rgba(26,86,55,.055);
 font-size:21px;line-height:1;cursor:pointer;
 transition:background .22s ease,border-color .22s ease,transform .22s ease,box-shadow .22s ease;
}
.mojeze-app .app-top-icon-btn:hover,.mojeze-app .app-login-icon-only:hover{
 background:#e9f5ec;border-color:#90c4a2;transform:translateY(-1px);box-shadow:0 6px 16px #164c2f16;
}
.mojeze-app .app-top-icon-btn:focus-visible,.mojeze-app .app-login-icon-only:focus-visible{outline:3px solid #57bb87;outline-offset:3px}
.mojeze-app .app-top-icon-btn i,.mojeze-app .app-login-icon-only i{font-size:23px;line-height:1}
.mojeze-app .app-locale-container{position:relative;flex:0 0 43px;direction:ltr}
.mojeze-app .app-locale-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%);overflow:hidden;min-height:0!important}
.mojeze-app .app-locale-menu{position:absolute;top:calc(100% + 10px);inset-inline-end:0;z-index:210;
 min-width:192px;padding:7px;display:grid;gap:3px;border:1px solid #d2e5d9;border-radius:17px;
 background:#fffefa;box-shadow:0 17px 42px rgba(16,77,45,.19);
 animation:appLocaleMenuIn .18s cubic-bezier(.2,.7,.2,1);}
.mojeze-app .app-locale-menu[hidden]{display:none!important}
.mojeze-app .app-locale-menu button{appearance:none;min-width:0;display:flex;align-items:center;gap:11px;
 min-height:44px;padding:8px 10px;border:0;border-radius:11px;
 background:transparent;color:#375c49;font:750 13px/1.4 Vazir,Tahoma,sans-serif;
 text-align:start;cursor:pointer}
.mojeze-app .app-locale-menu button:hover,.mojeze-app .app-locale-menu button:focus-visible{background:#ebf6ee;outline:none}
.mojeze-app .app-locale-menu button[aria-selected="true"]{background:#e4f4e9;color:#166c48}
.mojeze-app .app-locale-menu .locale-flag{font-family:system-ui,sans-serif;font-size:23px;line-height:1.35;min-width:32px;text-align:center}
.mojeze-app .app-locale-menu button>span:nth-child(2){flex:1;white-space:nowrap}
.mojeze-app .app-locale-menu button>.bx-check{font-size:20px;opacity:0}
.mojeze-app .app-locale-menu button[aria-selected="true"]>.bx-check{opacity:1}
.mojeze-app .app-theme-toggle i{transition:transform .3s ease}
.mojeze-app .app-theme-toggle:active i{transform:rotate(35deg) scale(.83)}
@keyframes appLocaleMenuIn{from{opacity:0;transform:translateY(-6px) scale(.975)}to{opacity:1;transform:none}}
@media(max-width:650px){.mojeze-app .app-account-actions{gap:5px}.mojeze-app .app-top-icon-btn,.mojeze-app .app-login-icon-only{width:37px;min-width:37px;height:37px;min-height:37px;border-radius:11px}.mojeze-app .app-locale-container{flex-basis:37px}.mojeze-app .app-locale-menu{inset-inline-end:-7px;min-width:177px}.mojeze-app .app-top-icon-btn i,.mojeze-app .app-login-icon-only i{font-size:21px}}
/* App-wide dark palette, used by the same CSS variables as the original light design. */
html[data-app-theme="dark"]{color-scheme:dark;--deep:#071c1b;--pine:#c7e9d6;--emerald:#61c8a0;--mint:#203f36;--gold:#d5ad6b;--gold-dark:#d9b978;--cream:#1d2a27;--paper:#1b302b;--canvas:#10211e;--ink:#e4f1e8;--muted:#9eb6a8;--line:#355347;--shadow:0 18px 50px rgba(0,0,0,.24)}
html[data-app-theme="dark"] body{background:var(--canvas);color:var(--ink)}
html[data-app-theme="dark"] .mojeze-app .app-topbar,html[data-app-theme="dark"] .mojeze-app .mobile-bottom-nav{background:#162a26ed!important;border-color:#315043!important}
html[data-app-theme="dark"] .mojeze-app .app-top-icon-btn,html[data-app-theme="dark"] .mojeze-app .app-login-icon-only{background:#233d34;color:#a6e5c5;border-color:#3c5d4b}
html[data-app-theme="dark"] .mojeze-app .app-locale-menu{background:#21372f;border-color:#456452}
html[data-app-theme="dark"] .mojeze-app .app-locale-menu button{color:#e2f4e7}
html[data-app-theme="dark"] .mojeze-app .app-locale-menu button:hover,html[data-app-theme="dark"] .mojeze-app .app-locale-menu button[aria-selected="true"]{background:#345747;color:#c8f5d8}
html[data-app-theme="dark"] .mojeze-app :is(.surah-card,.surah-live-hit,.surah-live-results,.surah-quick-reader,.search-page-form,.reader-side-panel,.studio-card,.app-notice,.app-empty-reading,.app-results-summary,.search-result-card,.app-community-card,.quick-feature,.privacy-preferences){background:#1a332b!important;border-color:#365a49!important;color:#dff1e6!important}
html[data-app-theme="dark"] .mojeze-app :is(.surah-card strong,.surah-live-hit-title strong,.section-kicker,.app-section-heading h2,.reader-side-title,.reader-title-block h1,.app-community-card strong){color:#d3eddb!important}
html[data-app-theme="dark"] .mojeze-app :is(.surah-card small,.surah-live-excerpt,.app-section-heading p,.surah-live-source,.reader-side-help){color:#a5beaf!important}
html[data-app-theme="dark"] .mojeze-app :is(.surah-order-menu,.surah-search-inline,.surah-order-toggle,.search-page-input,.surah-quick-body,.surah-quick-foot){background:#203a30!important;border-color:#41634f!important;color:#dcf2e6!important}
html[data-app-theme="dark"] .mojeze-app :is(input,select,textarea){color:#e7f6eb!important}
html[data-app-theme="dark"] .mojeze-app input::placeholder{color:#a1bda9!important}
html[data-app-theme="dark"] .mojeze-app .surah-search-inline input#surah-filter{color:#e6f6e9!important}
html[data-app-theme="dark"] .mojeze-app .surah-order-menu .surah-order-choice{color:#d5e7d9}
html[data-app-theme="dark"] .mojeze-app .surah-order-choice:hover,html[data-app-theme="dark"] .mojeze-app .surah-order-choice[aria-selected="true"]{background:#315543}
html[data-app-theme="dark"] .mojeze-app :is(.reader-player,.mushaf-chapter-header,.mushaf-verse,.mushaf-translation,.reader-heading,.studio-preview-card){background-color:#1a302a;color:#e6f4e6;border-color:#45604c}
html[data-app-theme="dark"] .mojeze-app .surah-quick-head{background:linear-gradient(115deg,#09211c,#1b4d37)}
html[data-app-theme="dark"] .mojeze-app .surah-quick-head h2{color:#fff}
html[data-app-theme="dark"] .mojeze-app .privacy-consent{background:#21392f;color:#dbf0df}
html[data-app-theme="dark"] .mojeze-app .privacy-category{background:#274536;color:#e2f3e5;border-color:#496a56}
html[data-app-theme="dark"] .mojeze-app .privacy-category :is(strong,small){color:#dbebdf}
html[data-app-theme="dark"] .mojeze-app .privacy-preferences p{color:#b6cdbd}
/* Switching uses a same-document view transition, not a blocking reload. */
@media(prefers-reduced-motion:no-preference){::view-transition-old(root){animation:.28s ease-out both appThemeFadeOut}::view-transition-new(root){animation:.34s ease-in both appThemeFadeIn}}
@keyframes appThemeFadeOut{to{opacity:.72;filter:brightness(.75)}}@keyframes appThemeFadeIn{from{opacity:.76;filter:brightness(1.25)}to{opacity:1;filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.mojeze-app .app-top-icon-btn,.mojeze-app .app-login-icon-only{transition:none}.mojeze-app .app-locale-menu{animation:none}}
/* Extend the dark palette to the rest of the shell while keeping Quran text
   legible, and avoid light cards inside an otherwise dark application. */
html[data-app-theme="dark"] .mojeze-app .app-donation-banner,
html[data-app-theme="dark"] .mojeze-app .app-contact-banner{background:linear-gradient(125deg,#253c32,#1b302a 70%,#263d30)!important;border-color:#45604d!important;color:#e6f1df!important}
html[data-app-theme="dark"] .mojeze-app .app-contact-banner :is(strong,p),
html[data-app-theme="dark"] .mojeze-app .app-donation-banner :is(strong,p){color:#d7e4d8!important}
html[data-app-theme="dark"] .mojeze-app .app-community-links{background:linear-gradient(120deg,#1b302b,#243c32)!important}
html[data-app-theme="dark"] .mojeze-app .app-community-card{box-shadow:0 8px 22px #09181042;color:#dcefe0!important}
html[data-app-theme="dark"] .mojeze-app .app-brand strong{color:#d0f0dc}
html[data-app-theme="dark"] .mojeze-app .desktop-nav>a{color:#aac9b5}
html[data-app-theme="dark"] .mojeze-app .desktop-nav>a:hover,
html[data-app-theme="dark"] .mojeze-app .desktop-nav>a.active{background:#304c3c;color:#d4f3e0}
html[data-app-theme="dark"] .mojeze-app .app-footer{color:#abc6b4;border-color:#385a49}
html[data-app-theme="dark"] .mojeze-app .surah-search-languages{background:#243f33;border-color:#41664c}
html[data-app-theme="dark"] .mojeze-app .surah-search-languages button{color:#bbddc5}
html[data-app-theme="dark"] .mojeze-app .surah-search-languages button[aria-pressed="true"]{background:#365c48;color:#e3fbe7}
html[data-app-theme="dark"] .mojeze-app .surah-no-results{background:#1d372b;border-color:#4b6352;color:#d4e7d8}
html[data-app-theme="dark"] .mojeze-app .reader-studio{--studio-accent:#76d1aa;--studio-gold:#dfbd7c;--studio-line:#426052;--studio-paper:#22392f;--studio-soft:#1e342b;--studio-ink:#e6f5e9;--studio-muted:#b4ccbc}
html[data-app-theme="dark"] .mojeze-app .reader-studio .studio-preview-mushaf:not(.is-dark){background:#293e33;color:#e5f1d8;border-color:#58715b}
html[data-app-theme="dark"] .mojeze-app .reader-studio .studio-preview-note{background:#233c30;color:#dfebdf;border-color:#42624c}
html[data-app-theme="dark"] .mojeze-app .app-control{background:#223c30!important;color:#edf8ee!important;border-color:#41654c!important}
html[data-app-theme="dark"] .mojeze-app .privacy-pref-heading h2,
html[data-app-theme="dark"] .mojeze-app .privacy-category strong{color:#dcefe5!important}

/* Single-line header at every handheld and tablet width, irrespective of
   old two-row media rules or English LTR direction. */
@media(max-width:970px){
 .mojeze-app .app-topbar{
  display:flex!important;flex-flow:row nowrap!important;align-items:center!important;
  justify-content:space-between!important;grid-template-columns:none!important;
  grid-template-rows:none!important;row-gap:0!important;
  min-height:64px!important;height:64px!important;
  gap:6px!important;padding:7px 12px!important;
 }
 .mojeze-app .app-topbar>.app-brand{
  flex:1 1 auto!important;min-width:0!important;max-width:none!important;
  height:auto!important;grid-row:auto!important;justify-self:auto!important;
  display:flex!important;align-items:center!important;gap:7px!important;
 }
 .mojeze-app .app-topbar .app-brand-logo{
  width:36px!important;height:36px!important;flex:0 0 36px!important;
  border-radius:11px!important;font-size:21px!important;
 }
 .mojeze-app .app-brand>span:last-child{flex:1 1 auto!important;min-width:0!important;max-width:100%!important}
 .mojeze-app .app-brand strong{font-size:16px!important;line-height:1.4!important;white-space:nowrap!important}
 .mojeze-app .app-brand small{font-size:8px!important;white-space:nowrap!important}
 .mojeze-app .app-topbar>.app-account-actions{
  grid-row:auto!important;grid-column:auto!important;display:flex!important;
  flex:0 0 auto!important;width:auto!important;max-width:calc(100% - 115px)!important;
  min-width:0!important;align-items:center!important;justify-content:flex-end!important;
  flex-wrap:nowrap!important;gap:5px!important;margin:0!important;
 }
 .mojeze-app .app-account-actions>*{flex-shrink:0!important}
 .mojeze-app .app-account-actions :is(.app-top-icon-btn,.app-login-icon-only,.app-install-shortcut){
  box-sizing:border-box!important;display:grid!important;place-items:center!important;
  width:38px!important;min-width:38px!important;max-width:38px!important;
  height:38px!important;min-height:38px!important;max-height:38px!important;
  padding:0!important;margin:0!important;border-radius:11px!important;
 }
 .mojeze-app .app-account-actions .app-locale-container{flex:0 0 38px!important;width:38px!important;min-width:38px!important}
 .mojeze-app .app-account-actions .app-install-shortcut span{display:none!important}
 .mojeze-app .app-account-actions .app-welcome{max-width:58px!important;min-width:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
}
@media(max-width:380px){
 .mojeze-app .app-topbar{min-height:58px!important;height:58px!important;gap:4px!important;padding-inline:8px!important}
 .mojeze-app .app-topbar .app-brand-logo{width:32px!important;height:32px!important;flex-basis:32px!important;font-size:19px!important}
 .mojeze-app .app-topbar>.app-brand{gap:5px!important}
 .mojeze-app .app-brand strong{font-size:14px!important}
 .mojeze-app .app-brand small{display:none!important}
 .mojeze-app .app-topbar>.app-account-actions{gap:3px!important;max-width:calc(100% - 92px)!important}
 .mojeze-app .app-account-actions :is(.app-top-icon-btn,.app-login-icon-only,.app-install-shortcut){width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;min-height:34px!important;max-height:34px!important}
 .mojeze-app .app-account-actions .app-locale-container{flex-basis:34px!important;min-width:34px!important;width:34px!important}
 .mojeze-app .app-top-icon-btn i,.mojeze-app .app-login-icon-only i{font-size:20px!important}
}
/* Viewport-positioned menu is portalled to body by app-header-controls.js;
   it cannot be clipped by overflow:hidden/clip or backdrop-filter in header. */
.mojeze-app #app-locale-menu.app-locale-menu{
 position:fixed!important;z-index:99990!important;
 right:auto!important;
 min-width:0!important;max-width:calc(100vw - 24px)!important;
 box-sizing:border-box!important;padding:8px!important;
 animation:none!important;direction:ltr!important;
}
.mojeze-app #app-locale-menu.app-locale-menu button{
 display:grid!important;grid-template-columns:32px minmax(0,1fr) 18px!important;
 gap:11px!important;width:100%!important;min-width:0!important;
 align-items:center!important;text-align:right!important;direction:ltr!important;
 white-space:nowrap!important;
}
.mojeze-app #app-locale-menu.app-locale-menu button>.locale-flag{
 display:flex;align-items:center;justify-content:center;
 width:32px!important;min-width:32px!important;text-align:center!important;
}
.mojeze-app #app-locale-menu.app-locale-menu button>span:nth-child(2){
 display:block!important;min-width:0!important;text-align:right!important;
 justify-self:stretch!important;white-space:nowrap!important;
}
.mojeze-app #app-locale-menu.app-locale-menu button>.bx-check{justify-self:center!important}

/* Never show the install shortcut in a launched PWA. The old mobile header
   uses display:grid!important, which outranked .app-install-shortcut[hidden].
   Keep all selectors strong so neither mobile nor dark theme can reveal it. */
html .mojeze-app .app-account-actions #app-install-shortcut[hidden],
html[data-pwa-installed="true"] .mojeze-app .app-account-actions #app-install-shortcut,
html .mojeze-app .app-account-actions #app-install-shortcut[aria-hidden="true"]{
 display:none!important;visibility:hidden!important;pointer-events:none!important;
}
@media (display-mode:standalone),(display-mode:fullscreen),(display-mode:minimal-ui){
 html .mojeze-app .app-account-actions #app-install-shortcut{
  display:none!important;visibility:hidden!important;pointer-events:none!important;
 }
}
