/* A single app-level dark theme. Page-specific styles load earlier; this
 * stylesheet intentionally loads last, across Home, reader, prayer/Qibla,
 * dialogs and the install/privacy/push overlays created in JavaScript. */
html[data-app-theme="dark"]{
 --app-dark-bg:#10231e;--app-dark-card:#1c352c;--app-dark-card-2:#243e33;
 --app-dark-border:#456451;--app-dark-ink:#e8f5ec;--app-dark-muted:#b3cdbb;
 --app-dark-gold:#e8c889;--app-dark-green:#97e5bd;
 --surface:#1c352c;--surface-alt:#253f33;--subtle:#b4cdbd;
}
/* Header/reader and all light card backgrounds must be readable together. */
html[data-app-theme="dark"] body.mojeze-app{background:var(--app-dark-bg);color:var(--app-dark-ink)}
html[data-app-theme="dark"] .mojeze-app :is(
 .app-community-card,.prayer-city-panel,.prayer-side-card,.prayer-calendar,
 .prayer-time-card,.prayer-day-arrow,.prayer-date-launch,
 .prayer-quick-days button:not(.active),.prayer-search-results,
 .qibla-compass-panel,.qibla-howto,.reader-content,
 .reader-side-panel,.reader-options-dialog,.reader-side-card,
 .mushaf-chapter-header,.mushaf-verse,.mushaf-translation,
 .mushaf-verse-toolbar,.reader-page-navigation,
 .search-result-card,
 .reader-settings-panel,.reader-studio .studio-card,.reader-studio .studio-preview,
 .app-option-card,.surah-live-results
 ){
 background:var(--app-dark-card)!important;
 border-color:var(--app-dark-border)!important;
 color:var(--app-dark-ink)!important;
 box-shadow:0 7px 22px #08191228;
}
html[data-app-theme="dark"] .mojeze-app :is(
 .app-donation-banner,.app-contact-banner,.push-optin,.prayer-countdown,
 .prayer-info-card,.prayer-time-card.is-next,.qibla-instruction
 ){
 background:linear-gradient(115deg,#233e32,#1b352d 69%,#29463a)!important;
 border-color:#54745a!important;
}
html[data-app-theme="dark"] .mojeze-app :is(
 .app-donation-banner strong,.app-contact-banner strong,
 .push-optin-info strong,.prayer-countdown strong,.prayer-city-top h2,
 .prayer-side-card h3,.prayer-side-card strong,.prayer-time-card strong,
 .qibla-howto h2,.qibla-reading strong,.qibla-compass-panel strong,
 .reader-title-block h1,.reader-side-panel h2,.mushaf-translation p,
 .mushaf-chapter-name strong,.mushaf-arabic,.mushaf-verse-toolbar,
 .surah-quick-reader-content,.surah-quick-head h2
 ){color:var(--app-dark-ink)!important}
html[data-app-theme="dark"] .mojeze-app :is(
 .app-donation-banner p,.app-contact-banner p,
 .push-optin-info p,.push-optin-info small,.prayer-region,
 .prayer-side-card p,.prayer-city-facts dt,.prayer-date-launch small,
 .prayer-time-card small,.prayer-countdown small,
 .prayer-info-card p,.prayer-location-note,.qibla-message,
 .qibla-howto p,.qibla-instruction,.reader-title-block p,
 .reader-side-help,.mushaf-translation-source,.reader-options-dialog p
 ){color:var(--app-dark-muted)!important}
/* A dedicated high-contrast quick reader: no invisible verse text and no
   white-on-white translation paragraphs when preview is a <dialog>. */
html[data-app-theme="dark"] .surah-quick-reader{
 background:#1a3028!important;color:#eaf6e8!important;border-color:#567360!important;
}
html[data-app-theme="dark"] .surah-quick-body{
 background:#152a24!important;color:var(--app-dark-ink)!important;
}
html[data-app-theme="dark"] .surah-quick-foot{
 background:#20392e!important;border-top:1px solid #476b54!important;color:#bdd5bd!important;
}
html[data-app-theme="dark"] .surah-quick-foot span{color:#c7dcc9!important}
html[data-app-theme="dark"] .surah-quick-body :is(
 .reader-content,.mushaf-chapter-header,.mushaf-verse,.mushaf-translations,
 .mushaf-translation,.mushaf-verse-toolbar
 ){background-color:#1d382d!important;border-color:#476853!important;color:#e7f1df!important}
html[data-app-theme="dark"] .surah-quick-body :is(
 .mushaf-arabic,.mushaf-word,.mushaf-translation p,.mushaf-chapter-name strong,
 .mushaf-translation-source,.mushaf-verse-reference,.mushaf-basmala
 ){color:#eaf3e0!important;opacity:1!important;text-shadow:none!important}
html[data-app-theme="dark"] .surah-quick-body .mushaf-verse.is-quick-found{
 background:linear-gradient(105deg,#2c503b,#254133)!important;
 box-shadow:inset 3px 0 #b9e7a6,0 7px 24px #071c144d!important;
}
html[data-app-theme="dark"] .surah-quick-body .mushaf-verse-end{color:#efce88!important}
/* Reader and audio: dark background beyond the reading pane as well. */
html[data-app-theme="dark"] .mojeze-app :is(.reader-heading,.reader-grid,.reader-page-navigation,.reader-side-panel,.reader-options-inner){color:var(--app-dark-ink)}
html[data-app-theme="dark"] .mojeze-app .reader-content{background:#1d3329!important}
html[data-app-theme="dark"] .mojeze-app .mushaf-verse.is-current{background:#2c503d!important}
html[data-app-theme="dark"] .mojeze-app .reader-player{
 background:linear-gradient(125deg,#173d32,#105043)!important;
 color:#f2f8ee!important;border-color:#5f9178!important;
}
html[data-app-theme="dark"] .mojeze-app :is(.reader-side-panel input,.reader-side-panel select,.reader-options-dialog select,.reader-options-dialog input){background:#264438!important;border-color:#5b7763!important;color:#eaf3e7!important}
html[data-app-theme="dark"] .mojeze-app .mushaf-translation{background:#254035!important;color:#e4f2df!important}
/* Home cards and notification call-to-action. */
html[data-app-theme="dark"] .mojeze-app .push-optin-icon{
 background:#315741!important;color:#c0f2d3!important}
html[data-app-theme="dark"] .mojeze-app .push-optin-actions .push-text-btn{
 background:#315943!important;border-color:#61866a!important;color:#e5f4e9!important}
html[data-app-theme="dark"] .mojeze-app .app-donation-banner>a,
html[data-app-theme="dark"] .mojeze-app .app-contact-banner>a{color:#fff!important}
html[data-app-theme="dark"] .mojeze-app .app-donation-banner .contact-banner-icon,
html[data-app-theme="dark"] .mojeze-app .app-contact-banner>.contact-banner-icon{
 background:#3a573c!important;color:#ecd4a2!important;box-shadow:none!important;
}
/* Opt-in, privacy and install dialogs are app-level body children, not reader
   cards; style them directly rather than depending on .reader-night. */
html[data-app-theme="dark"] .mojeze-app .push-preferences,
html[data-app-theme="dark"] .mojeze-app .privacy-preferences,
html[data-app-theme="dark"] .mojeze-app .app-install-dialog{
 background:#1b342b!important;color:#e8f5e8!important;
 border:1px solid #53715a!important;box-shadow:0 24px 80px #030d0b85!important;
}
html[data-app-theme="dark"] .mojeze-app :is(
 .push-preferences-header h2,.privacy-pref-heading h2,.app-install-body h2,
 .push-preferences label,.privacy-category strong,.privacy-consent h2
 ){color:#e8f5e8!important}
html[data-app-theme="dark"] .mojeze-app :is(
 .push-preferences p,.privacy-preferences p,.app-install-body>p,
 .privacy-category small,.app-install-later,.app-install-step p
 ){color:#bbd2bf!important}
html[data-app-theme="dark"] .mojeze-app :is(
 .push-preferences select,.privacy-category,.app-install-step,
 .app-install-benefits,.app-install-platform,.app-install-instructions,
 .privacy-consent,.push-preferences .push-pref-close,
 .privacy-close,.app-install-dismiss,.app-install-visual
 ){
 background:#294337!important;color:#e3f3e8!important;
 border-color:#526e5b!important;
}
html[data-app-theme="dark"] .mojeze-app .push-preferences .push-pref-close>span::before,
html[data-app-theme="dark"] .mojeze-app .push-preferences .push-pref-close>span::after{background:#ddf1df!important}
html[data-app-theme="dark"] .mojeze-app .privacy-required{color:#8ce6b4!important}
html[data-app-theme="dark"] .mojeze-app .privacy-category>.bx{color:#93e3ba!important}
html[data-app-theme="dark"] .mojeze-app .app-install-step-number{
 background:#356049!important;color:#e0f3e2!important}
html[data-app-theme="dark"] .mojeze-app .privacy-consent{
 background:linear-gradient(120deg,#203b30,#172e27)!important;
 border-color:#55735f!important;color:#eaf6eb!important;
}
html[data-app-theme="dark"] .mojeze-app .privacy-consent p{color:#bdd3c0!important}
html[data-app-theme="dark"] .mojeze-app .privacy-essential{
 background:#2d5140!important;color:#e5f6e6!important;border-color:#567862!important;
}
html[data-app-theme="dark"] .mojeze-app .privacy-settings{color:#a0e3ba!important}
html[data-app-theme="dark"] .mojeze-app .app-install-visual-device{background:#365849!important}
/* Qibla compass: keep actual compass contrast while darkening surrounding
   cards and status/instructions. Do not change sensor/heading calculations. */
html[data-app-theme="dark"] .mojeze-app :is(.qibla-compass-panel,.qibla-howto){
 background:#1c342d!important;border:1px solid #4d6b59!important;
}
html[data-app-theme="dark"] .mojeze-app :is(
 .qibla-reading,.qibla-howto>p,.qibla-message,.qibla-reading span,
 .qibla-coordinates,.qibla-instruction
 ){color:#c6dfcc!important}
html[data-app-theme="dark"] .mojeze-app :is(.qibla-frame,.qibla-ring){
 border-color:#6a876f!important;background-color:#203b31!important;
}
html[data-app-theme="dark"] .mojeze-app :is(.qibla-north,.qibla-south,.qibla-east,.qibla-west){color:#e3eedb!important}
html[data-app-theme="dark"] .mojeze-app .qibla-center{background:#335444!important;color:#f1deaf!important}
/* Prayer times uses --surface/--surface-alt plus hardcoded informational
   boxes; override both to avoid leftover white/yellow areas. */
html[data-app-theme="dark"] .mojeze-app.prayer-times-page{
 --prayer-ink:#e7f3e7;--prayer-sub:#b6cdbd;--prayer-line:#4e6b5a;
 --prayer-bg:#1e382d;--prayer-edge:#4b6b58;
}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page :is(
 .prayer-city-panel,.prayer-time-card,.prayer-calendar,.prayer-side-card,
 .prayer-date-launch,.prayer-day-arrow,.prayer-quick-days button:not(.active),
 .prayer-city-input,.prayer-search-results,.prayer-method-card select
 ){background:#1d372d!important;color:#e5f1e8!important;border-color:#4e6f5a!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page :is(
 .prayer-countdown,.prayer-info-card,.prayer-time-card.is-next
 ){background:linear-gradient(115deg,#234a3d,#1b3932)!important;border-color:#507960!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page :is(
 .prayer-info-card strong,.prayer-countdown strong,.prayer-time-card strong,
 .prayer-date-launch strong,.prayer-city-top h2,.prayer-calendar-top strong,
 .prayer-times-section-head h3,.prayer-side-card h3,.prayer-side-card dd,
 .prayer-calendar-days button,.prayer-city-result,.prayer-city-input input
 ){color:#e4f4e9!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page :is(
 .prayer-info-card p,.prayer-countdown small,.prayer-time-card small,
 .prayer-date-launch small,.prayer-city-result small,.prayer-region,
 .prayer-search-helper,.prayer-city-facts dt,.prayer-location-note
 ){color:#b6d1bf!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page .prayer-countdown-icon{
 background:#2e5b49!important;color:#adedd0!important;border-color:#5c8067!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page .prayer-city-result:hover,
html[data-app-theme="dark"] .mojeze-app.prayer-times-page .prayer-calendar-days button:hover{background:#315744!important}
html[data-app-theme="dark"] .mojeze-app.prayer-times-page .prayer-quick-days button.active{background:#16735b!important;color:#fff!important}
/* Standalone reading studio (source and selection cards, live preview). */
html[data-app-theme="dark"] .mojeze-app .reader-studio :is(
 .studio-card,.studio-preview-mushaf,.studio-preview-card,.studio-source-item,
 .studio-setting-row,.studio-option-label,.studio-card-header,
 .studio-panel,.studio-summary-card
 ){background-color:#1f392f!important;border-color:#4f705a!important;color:#e5f4e8!important}
html[data-app-theme="dark"] .mojeze-app .reader-studio :is(
 .studio-card h2,.studio-card h3,.studio-preview-header,.studio-preview-mushaf,
 .studio-option-label strong
 ){color:#e6f3e7!important}
html[data-app-theme="dark"] .mojeze-app .reader-studio :is(input,select,textarea){
 background:#274538!important;color:#eff8eb!important;border-color:#59735b!important}
/* Dark-themed focus/hover: preserve keyboard affordances. */
html[data-app-theme="dark"] .mojeze-app :is(button,a,input,select,textarea):focus-visible{
 outline:2px solid #95d8b0!important;outline-offset:3px!important;
}
/* Native modal open/exit transitions with discrete display/overlay support.
   Focus trap, Escape and document modality remain owned by the browser. */
dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog){
 opacity:0;transform:translateY(13px) scale(.976);
 transition:opacity .26s cubic-bezier(.2,.76,.25,1),
  transform .26s cubic-bezier(.2,.76,.25,1),
  display .26s allow-discrete,overlay .26s allow-discrete;
}
dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)[open]{
 opacity:1;transform:none;
}
@starting-style{
 dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)[open]{opacity:0;transform:translateY(13px) scale(.976)}
}
dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)::backdrop{
 background-color:rgba(4,21,18,0);backdrop-filter:blur(0);
 transition:background-color .26s ease,backdrop-filter .26s ease,
  display .26s allow-discrete,overlay .26s allow-discrete;
}
dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)[open]::backdrop{
 background-color:rgba(3,20,16,.7);backdrop-filter:blur(6px);
}
@starting-style{
 dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)[open]::backdrop{background-color:rgba(4,21,18,0);backdrop-filter:blur(0)}
}
@media(prefers-reduced-motion:reduce){
 dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog),
 dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)::backdrop{
  transition:none!important;animation:none!important;transform:none!important;
 }
 dialog:is(.surah-quick-reader,.push-preferences,.privacy-preferences,.app-install-dialog,.reader-options-dialog,.surah-description-dialog)[open]{opacity:1!important}
}
/* Keep the top-level modal canvas consistent even when a generic :is(card)
   rule has a higher specificity than the base modal selector. */
html[data-app-theme="dark"] body.mojeze-app .app-install-dialog,
html[data-app-theme="dark"] body.mojeze-app .push-preferences,
html[data-app-theme="dark"] body.mojeze-app .privacy-preferences{background:#1b342b!important;color:#e8f5e8!important}
html[data-app-theme="dark"] body.mojeze-app .surah-quick-reader{background:#1a3028!important;color:#eaf6e8!important}
html[data-app-theme="dark"] body.mojeze-app .app-donation-banner,
html[data-app-theme="dark"] body.mojeze-app .app-contact-banner,
html[data-app-theme="dark"] body.mojeze-app .push-optin{background:linear-gradient(115deg,#233e32,#1b352d 69%,#29463a)!important;border-color:#54745a!important;color:#e4f4e8!important}

/* The on-demand "About this surah" dialog is mounted at body level, too. */
html[data-app-theme="dark"] body.mojeze-app .surah-description-dialog{
 background:#1b342b!important;color:#e7f5e7!important;
 border-color:#53715d!important;box-shadow:0 25px 90px #04120d91!important;
}
html[data-app-theme="dark"] .mojeze-app .surah-description-content h2{color:#d5f2dc!important}
html[data-app-theme="dark"] .mojeze-app .surah-description-content p{color:#c6dcc9!important}
html[data-app-theme="dark"] .mojeze-app .surah-description-foot{
 background:#223c31!important;border-color:#4e6d58!important;
}
html[data-app-theme="dark"] .mojeze-app .surah-description-kicker{color:#a2e6be!important}
/* The original compass used a WHITE radial-gradient image and white inset
   rings; setting only background-color left the actual dial light. */
html[data-app-theme="dark"] body.mojeze-app .qibla-ring{
 background-image:
  radial-gradient(circle,#294f3e 0 19%,transparent 20%),
  repeating-conic-gradient(from 0deg,rgba(169,210,174,.09) 0 1deg,transparent 1deg 15deg),
  radial-gradient(circle,#2c523f,#193328 78%)!important;
 box-shadow:inset 0 0 0 16px #264435,inset 0 0 0 18px #577c5c,0 17px 42px #071b144f!important;
 border-color:#6d9778!important;
}
html[data-app-theme="dark"] body.mojeze-app .qibla-center{
 box-shadow:0 0 0 9px #385b46!important;
 background:#255f47!important;color:#f6dfa4!important;
}
