/* Keep the page header, support area and contents in the normal reading flow. */
html body:has(#dcPageContents) :is(.site-header,.top,.id-header,.top-downloads,.dc-language-support,.dc-support-reminder,[data-dc-support-reminder],.dc-language-strip,.site-language-bar){position:static!important;top:auto!important;bottom:auto!important;max-height:none!important}
html body:has(#dcPageContents) #dcPageContents{position:relative!important;top:auto!important}
/* Warm burgundy rails with legible gold writing; preserve every collection link. */
html body:has(#dcPageContents) :is(.dc-early-rail,.dc-top-dua-rail){background:#592239!important;border-color:#d9ba79!important}
html body:has(#dcPageContents) :is(.dc-early-rail,.dc-top-dua-track,.dc-all-dua-grid) :is(a,button){background:#20564c!important;color:#ffe7a0!important;-webkit-text-fill-color:#ffe7a0!important;border:2px solid #c5a362!important;font-size:clamp(18px,1.8vw,22px)!important;font-weight:850!important;line-height:1.6!important;text-shadow:none!important;opacity:1!important}
html body:has(#dcPageContents) :is(.dc-early-rail,.dc-top-dua-track,.dc-all-dua-grid) :is(a,button) :is(span,strong,small){color:inherit!important;-webkit-text-fill-color:inherit!important;font-weight:850!important}
html body:has(#dcPageContents) :is(.dc-early-rail,.dc-top-dua-track,.dc-all-dua-grid) :is([aria-current=true],[aria-pressed=true],.active){background:#f1d58c!important;color:#412034!important;-webkit-text-fill-color:#412034!important}
html body:has(#dcPageContents) .dc-top-dua-rail>button,html body:has(#dcPageContents) .dc-early-rail>button{background:#f1d58c!important;color:#412034!important;-webkit-text-fill-color:#412034!important;font-weight:900!important}
/* Child controls: two equal buttons per row, with clear warm colours. */
html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons,.controls>.row:first-child){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:1fr!important;gap:12px!important;align-items:stretch!important}
html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons,.controls>.row:first-child)>button{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;min-height:68px!important;height:100%!important;margin:0!important;padding:12px 10px!important;box-sizing:border-box!important;grid-column:auto!important;background:#62263f!important;color:#fff0c7!important;-webkit-text-fill-color:#fff0c7!important;border:2px solid #c5a362!important;font-size:21px!important;font-weight:850!important;line-height:1.6!important;border-radius:14px!important;box-shadow:0 4px #3f192c!important;white-space:normal!important}
html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons,.controls>.row:first-child)>button:nth-child(3n+2){background:#7c3c54!important}
html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons,.controls>.row:first-child)>button:nth-child(3n){background:#96536a!important}
html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons)>button[aria-pressed=true]{background:#efd28b!important;color:#3f192c!important;-webkit-text-fill-color:#3f192c!important;outline:2px solid #8f682c!important}
html body#kidsLearningPage main .controls>.row:first-child>label{grid-column:1/-1}
html body#kidsLearningPage main footer{background:#fff5db!important;color:#15100b!important;border:2px solid #c4a265!important;border-radius:20px!important;padding:22px!important;margin-top:28px!important}
html body#kidsLearningPage main footer :is(p,span,a,small,strong){color:#15100b!important;-webkit-text-fill-color:#15100b!important;font-size:20px!important;font-weight:750!important;opacity:1!important;line-height:1.9!important}
html body#kidsLearningPage main #audio-panel,html body#kidsLearningPage.audio-active main #audio-panel{position:static!important;bottom:auto!important;top:auto!important}
@media(max-width:420px){html body#kidsLearningPage main :is(.actions,.surah-nav,.kids-view-buttons,.controls>.row:first-child)>button{font-size:18px!important;padding:10px 8px!important}}
html body#kidsLearningPage main #index{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:1fr;gap:12px!important}
html body#kidsLearningPage main #index button{width:100%;height:100%;box-sizing:border-box;padding:14px 10px;font-weight:800!important}
html body#kidsLearningPage main #index button span{font-size:25px!important;font-weight:800!important}
html body#kidsLearningPage main #index button small{font-size:19px!important;font-weight:800!important}

/* Only genuine action links are placed in this dedicated grid. Other sections keep their original layout. */
html body:has(#dcPageContents) .dc-home-action-buttons{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;align-items:stretch!important;width:100%!important;flex:1 0 100%!important;box-sizing:border-box!important;margin:12px 0!important}
html body:has(#dcPageContents) .dc-home-action-buttons>a{display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;max-width:none!important;min-height:84px!important;height:auto!important;box-sizing:border-box!important;margin:0!important;padding:12px 10px!important;grid-column:auto!important;border:2px solid #c7aa70!important;border-radius:14px!important;background:#fff5dc!important;color:#48253a!important;-webkit-text-fill-color:#48253a!important;font-size:19px!important;font-weight:800!important;line-height:1.6!important;white-space:normal!important;text-align:center!important;overflow-wrap:break-word!important}
html body:has(#dcPageContents) .dc-home-action-buttons>a.dc-challenge-feature{background:#20564c!important;color:#fff4d5!important;-webkit-text-fill-color:#fff4d5!important}
html body:has(#dcPageContents) .dc-home-action-buttons>a :is(strong,span,small){color:inherit!important;-webkit-text-fill-color:inherit!important}
html body:has(#dcPageContents) :is(.filter-bar,.home-groups) button{background:#20564c!important;color:#fff0bd!important;-webkit-text-fill-color:#fff0bd!important;border-color:#c7aa70!important;font-weight:800!important}
html body:has(#dcPageContents) :is(.filter-bar,.home-groups) button.active{background:#efd28b!important;color:#412034!important;-webkit-text-fill-color:#412034!important}
html body:has(#dcPageContents) :is(.filter-bar,.home-groups) button :is(span,strong,small){color:inherit!important;-webkit-text-fill-color:inherit!important}
/* Full-width journeys and competitions; only small utility links share a row. */
html body:has(#dcPageContents) .dc-home-feature-buttons{display:flex!important;flex-direction:column!important;gap:16px!important;align-items:stretch!important;width:100%!important;min-width:0!important;max-width:100%!important;flex:1 0 100%!important;height:auto!important;box-sizing:border-box!important}
html body:has(#dcPageContents) .dc-home-feature-buttons>*{width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;align-self:stretch!important;box-sizing:border-box!important;margin-inline:0!important;grid-column:1/-1!important;overflow-wrap:normal!important;word-break:normal!important}
html body:has(#dcPageContents) .dc-home-feature-buttons>a{display:flex!important;align-items:center!important;justify-content:center!important;min-height:80px!important;padding:18px!important;background:#20564c!important;color:#fff4d5!important;-webkit-text-fill-color:#fff4d5!important;border:2px solid #c7aa70!important;border-radius:16px!important;font:800 clamp(20px,3vw,25px)/1.6 system-ui,Tahoma,sans-serif!important;text-align:center!important;text-decoration:none!important;white-space:normal!important}
html body:has(#dcPageContents) .dc-home-action-buttons{grid-auto-rows:auto!important;min-width:0!important;height:auto!important}
html body:has(#dcPageContents) .dc-home-action-buttons>:not(a){grid-column:1/-1!important;width:100%!important;min-width:0!important;height:auto!important}
html body:has(#dcPageContents) .dc-growth>nav>:is(section,aside,.competition-hub,.dc-plan,.dc-dhikr-promo){width:100%!important;min-width:0!important;flex:1 0 100%!important;height:auto!important;box-sizing:border-box!important}
html body:has(#dcPageContents) .competition-hub{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:20px!important;width:100%!important;min-width:0!important}
html body:has(#dcPageContents) .competition-hub .khatm-board,html body:has(#dcPageContents) .dc-dhikr-promo{width:100%!important;min-width:0!important;height:auto!important;box-sizing:border-box!important;overflow-wrap:normal!important;word-break:normal!important}
html body:has(#dcPageContents) .dc-dhikr-promo{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:14px!important}
html body .dc-supervision{display:block!important;margin:0!important;padding:10px 16px!important;background:#fff3d7!important;color:#49273a!important;-webkit-text-fill-color:#49273a!important;border-bottom:1px solid #c7aa70!important;text-align:center!important;font:750 17px/1.6 system-ui,Tahoma,sans-serif!important;position:static!important;box-sizing:border-box!important;width:100%!important}

/* A native selector and plain links: no custom popup or overlay. */
html body:is(:has(#dcPageContents),.children-page) .dc-language-basic{display:block!important;position:static!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:12px 16px!important;overflow:visible!important}
html body:is(:has(#dcPageContents),.children-page) .dc-language-basic>label{display:block!important;margin:0 0 8px!important;font-size:16px!important;font-weight:750!important;color:#fff0c7!important;-webkit-text-fill-color:#fff0c7!important}
html body:is(:has(#dcPageContents),.children-page) #dcLanguageSelect{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:46px!important;box-sizing:border-box!important;font:650 17px/1.5 system-ui,Tahoma,sans-serif!important;padding:9px 12px!important;border:1px solid #c6a56a!important;border-radius:10px!important;background:#fff8e9!important;color:#35222d!important;-webkit-text-fill-color:#35222d!important;cursor:pointer!important}
html body:is(:has(#dcPageContents),.children-page) #dcLanguageSelect option{background:#fff8e9!important;color:#35222d!important;-webkit-text-fill-color:#35222d!important}
html body:is(:has(#dcPageContents),.children-page) .dc-language-direct-links{display:flex!important;flex-wrap:wrap!important;gap:4px 10px!important;width:100%!important;min-width:0!important;max-width:100%!important;margin-top:9px!important;padding:0!important;box-sizing:border-box!important;overflow:visible!important}
html body:is(:has(#dcPageContents),.children-page) .dc-language-direct-links>a{display:inline-flex!important;flex:0 1 auto!important;align-items:center!important;gap:4px!important;width:auto!important;min-width:0!important;max-width:100%!important;min-height:30px!important;margin:0!important;padding:3px 5px!important;border:0!important;border-radius:4px!important;background:transparent!important;color:#ffe5a6!important;-webkit-text-fill-color:#ffe5a6!important;font:650 13px/1.5 system-ui,Tahoma,sans-serif!important;text-decoration:underline!important;white-space:normal!important;box-shadow:none!important;box-sizing:border-box!important}
html body:is(:has(#dcPageContents),.children-page) .dc-language-direct-links>a[aria-current=page]{color:#fff!important;-webkit-text-fill-color:#fff!important;font-weight:850!important;background:#ffffff12!important}
html body:is(:has(#dcPageContents),.children-page) .dc-language-direct-links>a span{font-size:inherit!important;color:inherit!important;-webkit-text-fill-color:inherit!important}
/* Constrain the document, keeping horizontal scrolling inside its own readers and rails. */
html:has(#dcPageContents){width:100%!important;max-width:100%!important;overflow-x:clip!important}
html body:has(#dcPageContents){width:100%!important;max-width:100%!important;min-width:0!important;margin-inline:0!important;box-sizing:border-box!important;overflow-x:clip!important}
html body:has(#dcPageContents)>:is(main,header,nav,section,aside,footer){max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
html body:has(#dcPageContents) :is(.home-layout,.dc-growth,.dc-home-feature-buttons,.dc-home-action-buttons,.competition-hub,.dc-language-basic){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
html body:has(#dcPageContents) .dc-growth>nav{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
/* Natural block flow prevents flex growth from leaving empty frames. */
html body:has(#dcPageContents) .dc-growth>nav{display:block!important;height:auto!important;min-height:0!important}
html body:has(#dcPageContents) .dc-home-feature-buttons{display:block!important;height:auto!important;min-height:0!important;flex:none!important;position:static!important}
html body:has(#dcPageContents) .dc-home-feature-buttons>*{display:block!important;flex:none!important;height:auto!important;min-height:0!important;margin-block:14px!important;position:static!important;transform:none!important}
html body:has(#dcPageContents) .dc-home-feature-buttons>a{display:block!important;min-height:0!important;padding:17px!important}
html body:has(#dcPageContents) .competition-hub{display:block!important;flex:none!important;height:auto!important;min-height:0!important;margin-block:18px!important;padding-top:0!important;align-items:start!important}
html body:has(#dcPageContents) .competition-hub>.khatm-board{display:block!important;flex:none!important;height:auto!important;min-height:0!important;margin:14px 0!important;padding:18px!important;align-self:start!important;position:static!important}
html body:has(#dcPageContents) .competition-hub .khatm-board>:last-child{margin-bottom:0!important}
html body:has(#dcPageContents) .dc-home-action-buttons{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:auto!important;position:static!important;height:auto!important;min-height:0!important;flex:none!important;clear:both!important;margin:18px 0!important;gap:12px!important;transform:none!important}
html body:has(#dcPageContents) .dc-home-action-buttons>a{position:static!important;float:none!important;transform:none!important;height:auto!important;margin:0!important;align-self:stretch!important}
html body:has(#dcPageContents) .dc-growth>small{display:block!important;position:static!important;clear:both!important;margin-top:16px!important}
html body:has(#dcPageContents) .dc-ihdaa{display:block!important;min-height:0!important;height:auto!important;padding:20px!important;text-align:center!important}
html body:has(#dcPageContents) .dc-ihdaa :is(h2,.dc-ihdaa-details p,.dc-campaign-intro){text-align:center!important;max-width:42rem!important;margin:12px auto!important}
html body:has(#dcPageContents) .dc-ihdaa h2{font-size:clamp(23px,4vw,30px)!important;line-height:1.5!important}
html body:has(#dcPageContents) .dc-ihdaa-details p{font-size:18px!important;line-height:1.75!important}
html body:has(#dcPageContents) .dc-ihdaa>img{display:block!important;width:100%!important;max-height:260px!important;object-fit:cover!important;margin:auto!important}
html body .dc-share-dialog #dcShareMode{display:block;width:100%;min-height:48px;font:700 17px/1.5 system-ui;padding:10px;background:#fff8e9;color:#351d29;border:1px solid #b99b63;border-radius:10px;margin:10px 0 16px}
html body .dc-share-dialog :is(.dc-share-poster,.dc-poster-download)[hidden]{display:none!important}
html body:has(#dcPageContents) .dc-ihdaa figure img{display:block!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:260px!important;object-fit:contain!important;margin:0 auto!important}
html body:has(#dcPageContents) .dc-ihdaa :is(.dc-ihdaa-kicker,.dc-campaign-intro){font-size:17px!important;line-height:1.65!important;text-align:center!important}
