/* SafestCore — V3.60: premium visual design layer.
   Original HTML copy, labels, navigation, functionality and earlier CSS/JS preserved.
   Walnut, deep emerald, charcoal, warm ivory and restrained metallic gold.
*/
:root{
  --sc360-emerald:#103e33;
  --sc360-emerald-dark:#09251f;
  --sc360-forest:#17483b;
  --sc360-charcoal:#1a2521;
  --sc360-gold:#d9b977;
  --sc360-gold-rich:#bf9450;
  --sc360-ivory:#fbf5e8;
  --sc360-parchment:#f3e7d2;
  --sc360-ink:#183b31;
  --sc360-wood:url('sc360-walnut.webp');
  --sc360-radius:13px;
  --sc360-shadow:0 18px 42px rgba(0,0,0,.19);
}
html[data-palette="sapphire"]{--sc360-emerald:#203850;--sc360-forest:#294c66;--sc360-gold:#ced8e2;--sc360-gold-rich:#a9bacb;--sc360-ink:#1b3445}
html[data-palette="plum"]{--sc360-emerald:#422b41;--sc360-forest:#513852;--sc360-gold:#e6c79f;--sc360-gold-rich:#b88b64;--sc360-ink:#422b40}
html[data-palette="manuscript"]{--sc360-emerald:#51402b;--sc360-forest:#645039;--sc360-gold:#d7b17c;--sc360-gold-rich:#a97b44;--sc360-ink:#463523}
html[data-palette="emerald"]{--sc360-emerald:#0b493a;--sc360-forest:#0d5b49;--sc360-gold:#ecd091;--sc360-gold-rich:#bb904d;--sc360-ink:#103e32}
html{scroll-padding-top:155px}
body{
  background:linear-gradient(120deg,rgba(9,24,20,.82),rgba(24,16,10,.74) 49%,rgba(8,36,28,.82)),var(--sc360-wood) center top/cover fixed;
  color:#f9efdd;
}
body :is(a,button,summary){-webkit-tap-highlight-color:transparent}
body :is(a,button,summary,input,select):focus-visible{outline:3px solid #e6c780!important;outline-offset:3px!important}
body :is(h1,h2,h3,p,li,a,summary){overflow-wrap:break-word}
body.dark{background:linear-gradient(120deg,rgba(5,19,16,.91),rgba(20,14,10,.88),rgba(5,25,18,.91)),var(--sc360-wood) center top/cover fixed}
body.large-text{line-height:1.85}

/* Brand, navigation and read controls: premium square imagery, slogan below brand. */
body > header{
  position:sticky;top:0;z-index:100;
  background:linear-gradient(115deg,rgba(8,29,25,.985),rgba(20,27,23,.978) 52%,rgba(10,48,37,.982))!important;
  border-bottom:1px solid rgba(225,191,117,.68)!important;
  box-shadow:0 6px 30px rgba(0,0,0,.36),inset 0 2px 0 rgba(234,201,130,.16)!important;
  color:#f8f1e2!important;
}
body > header .header-inner{max-width:1400px;gap:clamp(11px,1.8vw,24px);padding-block:12px}
body > header .brand{gap:12px;min-width:0}
body > header .brand-image{
  width:58px;height:58px;aspect-ratio:1;object-fit:contain;border-radius:11px;
  padding:3px;border:1px solid #d9b977;
  background:linear-gradient(145deg,#d1b77a,#15392f 48%,#3d301e);
  box-shadow:inset 0 0 0 1px #f9e5bd60,0 6px 16px #0006;
}
body > header .brand > span, footer .brand > span{display:flex;flex-direction:column;gap:2px;align-items:stretch;min-width:0}
body > header .brand strong,footer .brand strong{font-family:Georgia,'Times New Roman',serif!important;color:#fffaee!important;font-weight:700;line-height:1.1!important;white-space:nowrap;text-align:center}
body > header .brand strong span,footer .brand strong span{color:var(--sc360-gold)!important}
body > header .brand small,footer .brand small{color:#e3d1ad!important;font-family:SCBody,Roboto,Arial,sans-serif!important;text-align:center;white-space:nowrap;margin:0!important;letter-spacing:.055em!important}
body > header nav{column-gap:clamp(10px,1.4vw,24px);row-gap:7px}
body > header nav > a,body > header .gateway-menu > summary{
  color:#f1e7d6!important;padding:8px 6px;border-radius:6px;text-decoration:none!important;
  transition:background .17s ease,color .17s ease;
}
body > header nav > a:is(:hover,:focus-visible),body > header .gateway-menu > summary:is(:hover,:focus-visible){background:rgba(229,196,132,.16)!important;color:#ffe2a6!important;text-decoration:none!important;border-color:transparent!important}
body > header .preferences{gap:7px;align-items:center}
body > header .preferences :is(summary,button,.sc-search-trigger){
  display:inline-flex;align-items:center;justify-content:center;
  min-height:43px;padding:.55rem .72rem;
  background:#1d2925!important;color:#f5e8d2!important;border:1px solid #ad925e!important;
  border-radius:9px!important;box-shadow:inset 0 1px 0 #ffffff11;
  text-decoration:none!important;
}
body > header .preferences :is(summary,button,.sc-search-trigger):is(:hover,:focus-visible){background:#edcf91!important;color:#0b2e25!important;border-color:#d1a755!important}
body > header .preferences .popover,body > header .gateway-popover{
  background:#142c26!important;color:#fbf3e4!important;
  border:1px solid #bf9e64!important;border-radius:12px!important;
  box-shadow:0 20px 48px #0009!important;
  overscroll-behavior:contain;
}
body > header .preferences .popover :is(label,legend,.design-help),body > header .gateway-popover h3{color:#f6e8c9!important}
body > header .preferences .popover a,body > header .gateway-popover a{color:#f8edda!important;border-radius:7px;padding:.5rem .55rem}
body > header .preferences .popover a:is(:hover,:focus-visible),body > header .gateway-popover a:is(:hover,:focus-visible){background:#edd49d!important;color:#123b2e!important}
body > header .preferences .popover select,body > header .preferences .popover input{
  background:#f9f2e7!important;color:#173c31!important;border-color:#a98a53!important;
  border-radius:7px!important;
}
body > header .preferences .popover button:not(.palette-choice){background:#173f34!important;color:#faefdd!important;border-color:#bfa06a!important}
body > header .preferences .popover button:not(.palette-choice):hover{background:#efd59f!important;color:#102e27!important}
body > header .preferences .palette-choice{background:#25372f!important;color:#fff4df!important;border-color:#8e764e!important}
body > header .preferences .palette-choice[aria-pressed="true"]{border-color:#f2cf8a!important;box-shadow:0 0 0 1px #f2cf8a}
body > header .preferences .palette-choice:is(:hover,:focus-visible){background:#e6ca8e!important;color:#123328!important}
body > header .chosen-font-preview{background:#f4e7cf!important;color:#15392f!important;border-color:#ba985f!important}
body > header .mobile-menu{color:#f7ead6!important;background:#1c342b!important;border:1px solid #b89b68!important;border-radius:8px!important}
body > header .mobile-menu:is(:hover,:focus-visible){color:#142f28!important;background:#f1d79c!important}

/* Hero: distinctive dark walnut, deep emerald, glowing metal inlay, square logo. */
main > .hero{
  background:linear-gradient(112deg,rgba(8,24,20,.90),rgba(22,18,13,.77) 48%,rgba(6,47,36,.88)),var(--sc360-wood) center center/cover!important;
  border-bottom:2px solid var(--sc360-gold-rich)!important;
  color:#fff3df!important;
}
.hero .hero-lines{opacity:.1!important;pointer-events:none}
.hero-layout{gap:clamp(2rem,5vw,5.5rem)!important;padding-block:clamp(4rem,6.3vw,6.6rem)!important;grid-template-columns:minmax(0,1.17fr) minmax(290px,.83fr)!important}
.hero-copy{min-width:0}.hero .brand-descriptor{color:#e9c785!important;font-weight:700;letter-spacing:.085em;text-transform:uppercase}
.hero .eyebrow{color:#f1d399!important}
.hero h1{font-weight:400!important;color:#fff0d5!important;font-family:SCTitle,Georgia,serif!important;line-height:1.24!important;letter-spacing:-.016em!important;text-shadow:0 4px 22px rgba(0,0,0,.24)}
.hero h1 em{color:#f1cc86!important}
html[lang="ar"] .hero h1{font-family:var(--arabic-font),SCAmiri,serif!important;line-height:1.5!important;letter-spacing:0!important}
.hero .hero-intro{color:#f4e9d5!important;line-height:1.95!important;max-width:63ch}
.hero .hero-foot{color:#e5d3b1!important}
.hero .button{border-radius:9px!important;padding:12px 22px;min-height:48px!important;box-shadow:0 8px 18px rgba(0,0,0,.12)}
.hero .button.gold{background:linear-gradient(115deg,#f3deaf,#bc9551 65%,#e9cb8c)!important;color:#17382f!important;border:1px solid #e9d29f!important}
.hero .button.gold:is(:hover,:focus-visible){background:#f9e7bf!important;color:#102f26!important;transform:translateY(-1px)}
.hero .button.outline{background:#172e27a8!important;color:#fff1d7!important;border:1px solid #d7b574!important}
.hero .button.outline:is(:hover,:focus-visible){background:#edcf92!important;color:#133b30!important}
.hero .hero-panel{
  border-radius:18px!important;
  border:1px solid #d1b171!important;
  padding:clamp(1.35rem,3vw,2.4rem)!important;
  background:linear-gradient(150deg,#092b25f6,#1c2921ed 52%,#242017f2)!important;
  box-shadow:inset 0 0 0 5px rgba(243,213,154,.045),0 22px 60px rgba(0,0,0,.42)!important;
  min-width:0;position:relative;isolation:isolate;
}
.hero .hero-panel::before{content:"";position:absolute;inset:10px;border:1px solid #d5b67144;border-radius:12px;pointer-events:none}
.hero .hero-logo{
  width:min(205px,67%);aspect-ratio:1;object-fit:contain;height:auto;
  border-radius:11px!important;border:2px solid #dfc28b!important;padding:5px!important;
  background:#ddc69b;box-shadow:0 14px 34px #0008,inset 0 0 0 1px #fff7e6!important;
}
.hero .panel-kicker{color:#e6c484!important}
.hero .panel-title{color:#fff0d3!important;font-family:SCTitle,Georgia,serif!important;font-weight:500}
html[lang="ar"] .hero .panel-title{font-family:var(--arabic-font),SCAmiri,serif!important}
.hero .hero-panel>a{color:#f7ecda!important;border-top:1px solid #e4bc7750!important;padding:15px 4px!important}
.hero .hero-panel>a:is(:hover,:focus-visible){color:#ffe2a4!important;background:#eecb8c14!important}
.hero .panel-bottom{color:#e5c88f!important;border-top-color:#e4bc7750!important}

/* Main information panels: ivory manuscripts framed by walnut and gold. */
main > section.section.wrap:not(.hero),main > .section.wrap,main > div.section.wrap{
  width:min(1300px,calc(100% - clamp(18px,4.8vw,76px)))!important;
  margin-block:clamp(1.8rem,4vw,3.5rem)!important;
  padding:clamp(1.35rem,3.9vw,3.5rem)!important;
  background:linear-gradient(133deg,#fbf6ea 0%,#f0e5d2 58%,#f9f1e3 100%)!important;
  border:1px solid #c6a56c!important;border-radius:15px!important;
  box-shadow:inset 0 0 0 5px #ffffff70,0 24px 48px #0005!important;
  color:var(--sc360-ink)!important;
  min-width:0;
}
main > section.section.wrap :is(h2,h3),main > div.section.wrap :is(h2,h3){color:var(--sc360-ink)!important}
main > section.section.wrap .section-heading,main > div.section.wrap .section-heading{margin-bottom:clamp(1.1rem,2vw,2rem)}
.section-heading .eyebrow{color:#956a2b!important;letter-spacing:.1em}
.section-heading > p, main > section.section.wrap p,main > div.section.wrap p{color:#42574d}
main .section-heading h2{margin-top:0!important;color:var(--sc360-ink)!important}
main > section.section.wrap .section-heading>div{min-width:0}

/* Pathways: four/five responsive premium enamel cards with warm gold details. */
.doors{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:clamp(.6rem,1.2vw,.9rem)!important;background:none!important;border:0!important;border-radius:0!important;overflow:visible!important}
.door{
  position:relative;min-width:0;overflow:hidden;
  display:flex!important;flex-direction:column!important;gap:.25rem;
  padding:clamp(1.1rem,1.55vw,1.55rem)!important;
  background:linear-gradient(150deg,#113d33,#202b24 64%,#30261d)!important;
  border:1px solid #bba065!important;border-radius:11px!important;
  box-shadow:inset 0 0 0 1px #e4c27b18,0 9px 24px #0003!important;
  color:#faf0df!important;
}
.door:nth-child(2n){background:linear-gradient(160deg,#2c2b24,#244239 88%)!important}
.door-number{color:#f1c983!important;font-size:.8rem!important;margin-bottom:.55rem!important}
.door h3{color:#f6d99f!important;line-height:1.5!important;margin:0 0 .6rem!important}
.door p{color:#f8edda!important;line-height:1.85!important;margin:0 0 1.25rem!important}
.door-action{color:#f1d39c!important;border-top:1px solid #ecc98944;padding-top:.7rem;margin-top:auto!important;text-decoration:none!important}
.door:is(:hover,:focus-visible){background:linear-gradient(135deg,#23483d,#354135)!important;border-color:#f3d99b!important;box-shadow:0 13px 27px #0004!important;transform:translateY(-2px)}
.door:is(:hover,:focus-visible) :is(h3,p,.door-action,.door-number){color:#fff4df!important}

/* Featured source modules: contrasting deep jade and ivory, full reading contrast. */
main > .sources.wrap{width:min(1300px,calc(100% - clamp(18px,4.8vw,76px)))!important;margin-block:clamp(1.5rem,4vw,3.2rem)!important;gap:clamp(1rem,2vw,1.5rem)!important}
.sources>div{border:1px solid #c5a66e!important;border-radius:14px!important;padding:clamp(1.3rem,3vw,2.5rem)!important;box-shadow:var(--sc360-shadow)!important}
.sources .source-quran{background:linear-gradient(135deg,#123e33,#15271f),var(--sc360-wood)!important;color:#fff3dd!important}
.sources .source-quran :is(h2,h3){color:#ffe2a5!important}
.sources .source-quran p{color:#f5ebd9!important}
.sources .source-hadith{background:linear-gradient(130deg,#faf2e4,#eadeca)!important;color:#163d31!important}
.sources .source-hadith :is(h2,h3){color:#133e32!important}
.sources .source-hadith :is(p,.source-label){color:#3f5549!important}
.sources .button{border-radius:8px!important}

/* Interactive directory: preserve all data, filters, links and favourites. */
.availability{border-inline-start:3px solid #bd9452!important;background:#e8d9bc!important;color:#365047!important;border-radius:8px;padding:clamp(.8rem,1.4vw,1.15rem)!important}
.directory-controls :is(input,select),body .article-search{background:#fff9ef!important;color:#193f32!important;border:1px solid #bfa16c!important;border-radius:9px!important;min-height:48px}
.directory-controls :is(input,select)::placeholder,body .article-search::placeholder{color:#52665b!important;opacity:1}
.search-row .button,.search-row button{border-radius:9px!important}
.filters button,.filter-chip{background:#f7eddd!important;color:#143e32!important;border:1px solid #aa8b53!important;border-radius:999px!important}
.filters button[aria-pressed="true"],.filter-chip[aria-pressed="true"]{background:#174738!important;color:#ffefd2!important;border-color:#bf9b5b!important}
.filters button:is(:hover,:focus-visible),.filter-chip:is(:hover,:focus-visible){background:#e6c887!important;color:#12362b!important}
.branch-grid{gap:clamp(.9rem,1.6vw,1.35rem)!important}
.branch{
  border:1px solid #c5a874!important;border-radius:12px!important;
  background:linear-gradient(132deg,#fff9ee,#eee2cc)!important;
  box-shadow:0 7px 23px #00000016!important;
  min-width:0;
}
.branch:hover,.branch:focus-within{border-color:#a5792f!important;box-shadow:0 15px 30px #00000025!important}
.branch :is(h3,.branch-number){color:#143d31!important}
.branch .branch-number{color:#8d682d!important}
.branch :is(p,.branch-category,.domain){color:#45594f!important}
.branch-link{border-radius:10px!important}
.branch-link:is(:hover,:focus-visible){background:#ead9ba!important}
.branch-link :is(h3,p,.domain){overflow-wrap:anywhere}
.branch .favourite{background:#f1e1c4!important;border-color:#b59158!important;color:#184b3b!important}
.branch .favourite[aria-pressed="true"],.branch .favourite:hover{background:#164c3c!important;color:#ffe6b2!important}

/* Thematic principles and primary reading cards. */
main > .principles{
  background:linear-gradient(123deg,#082b24ed,#22201bef 53%,#103f31ed),var(--sc360-wood) center/cover!important;
  border-block:1px solid #c09a58!important;color:#f8eddb!important;
  padding-block:clamp(3.2rem,6vw,5.7rem)!important;
}
.principles :is(h2,h3){color:#f6d8a0!important}
.principles :is(p,li){color:#f9ecda!important}
.principles .eyebrow,.principle-list article>span{color:#dcb776!important}
.principle-list article{border-color:#e2b86e55!important}
main .faq details{border-bottom-color:#bb9d68!important}
main .faq summary{color:#123e32!important;font-weight:650;padding:1rem 0!important}
main .faq summary:is(:hover,:focus-visible){color:#7b5421!important}
main .faq details[open]{background:#f5ead5;border-radius:9px;padding-inline:1rem;border:1px solid #d2b687}
main .faq details p{color:#355047!important}

/* Premium added paths and editorial details: no beige-on-beige or white-on-white. */
main > .premium-added{
  padding-block:clamp(3rem,5vw,5rem)!important;
  background:linear-gradient(130deg,#0e3028ed,#251e18f0 64%,#12352cef),var(--sc360-wood) center/cover!important;
  border-block:1px solid #c0a269!important;
  color:#fff3dd!important;
}
main > .premium-added :is(h2,h3){color:#f7d99f!important}
main > .premium-added :is(p,.section-lead){color:#f3e9d7!important}
.premium-grid{gap:clamp(.85rem,1.6vw,1.35rem)!important}
.premium-card{
  background:linear-gradient(155deg,#fdf6e9,#ecdfca)!important;
  color:#1c4435!important;border:1px solid #c7a46b!important;
  box-shadow:0 15px 30px #0004!important;border-radius:12px!important;
}
.premium-card h3{color:#154639!important}
.premium-card p{color:#3b5447!important}
.premium-card:is(:hover,:focus-visible){background:#f7e8ca!important;border-color:#e0bf7e!important}
.guidance-path{
  background:linear-gradient(137deg,#f8f0e1,#eee1cb)!important;
  color:#163a30!important;border:1px solid #c2a167!important;
  box-shadow:0 13px 30px #0002!important;
  border-radius:13px!important;
}
.guidance-path h2{color:#143f32!important}
.guidance-path :is(p,li){color:#365146!important}
.guidance-step{background:#fcf7ee!important;border:1px solid #d1b581!important;border-radius:9px!important;color:#163e32!important}
.guidance-step strong{color:#123c2f!important}
.guidance-step span{color:#3e5349!important}
.related-reading{border-top:1px solid #bfa16c!important}
.related-reading h2{color:#183f33!important}
.related-card,.reading-card{
  background:linear-gradient(140deg,#fdf7ea,#efe3cf)!important;
  border:1px solid #c5a775!important;border-radius:12px!important;
  box-shadow:0 10px 24px #0002!important;color:#163e33!important;
}
.related-card strong,.reading-card h2{color:#143c31!important}
.related-card span,.reading-card p,.reading-card .card-kicker{color:#4b5c51!important}
.related-card:is(:hover,:focus-visible),.reading-card:is(:hover,:focus-visible){background:#ead6b2!important;border-color:#b58d4b!important;box-shadow:0 15px 30px #0003!important}

/* All editorial pages: dark hero above comfortable ivory reading surface. */
.editorial-hero{
  background:linear-gradient(115deg,#0b2923e9,#212018e9 55%,#123c30e9),var(--sc360-wood) center/cover!important;
  color:#fef3e0!important;border-bottom:1px solid #cfac70!important;
}
.editorial-hero::after{opacity:.28!important;border-color:#d9ba7844!important}
.editorial-hero .wrap{min-width:0}
.editorial-hero h1{color:#fff1d8!important;font-family:SCTitle,Georgia,serif!important;font-weight:400!important;text-shadow:0 3px 20px #0004}
html[lang="ar"] .editorial-hero h1{font-family:var(--arabic-font),SCAmiri,serif!important}
.editorial-hero :is(p,.editorial-intro){color:#f5ead8!important}
.editorial-hero .eyebrow{color:#e7c17d!important}
.editorial-hero .editorial-meta{color:#e8d7b9!important}
.editorial-hero button,.editorial-hero a.button{border-color:#d1b275!important;background:#172d26!important;color:#fff1d9!important;border-radius:8px!important}
.editorial-hero button:hover,.editorial-hero a.button:hover{background:#e8ca90!important;color:#12372d!important}
.editorial-grid{
  width:min(1300px,calc(100% - clamp(18px,4.8vw,76px)))!important;
  grid-template-columns:minmax(218px,255px) minmax(0,1fr)!important;
  align-items:start!important;
  gap:clamp(1.15rem,3vw,2.4rem)!important;
  padding-block:clamp(1.5rem,3vw,2.6rem)!important;
}
.editorial-toc{
  position:sticky;top:151px;min-width:0;max-height:calc(100vh - 172px);overflow:auto;
  background:linear-gradient(145deg,#112e27f8,#1c2921f8)!important;
  color:#fdf3e3!important;border:1px solid #c2a067!important;
  border-radius:12px!important;box-shadow:0 14px 32px #0005!important;
}
.editorial-toc strong{color:#f5d99e!important}
.editorial-toc a{color:#f4e9d6!important;display:block!important;line-height:1.65}
.editorial-toc a:is(:hover,:focus-visible),.editorial-toc a[aria-current="true"]{color:#123b30!important;background:#ead09b!important;border-radius:7px!important}
.editorial-toc .sc-toc-toggle{border:1px solid #c6a36a!important;background:#1c4135!important;color:#fff1d6!important}
.editorial-body{
  max-width:none!important;width:100%;min-width:0;
  padding:clamp(1.35rem,3.3vw,3.25rem)!important;
  color:#19382e!important;
  background:linear-gradient(140deg,#fcf7ed 0%,#f4e9d7 78%,#fbf3e6 100%)!important;
  border:1px solid #c6a771!important;border-radius:14px!important;
  box-shadow:inset 0 0 0 5px #ffffff6b,0 17px 42px #0005!important;
}
.editorial-body :is(p,li,blockquote,dd,dt){color:#284338!important}
.editorial-body :is(h2,h3,h4){color:#174637!important}
.editorial-body h2{border-bottom:1px solid #cbaa6f;padding-bottom:.42rem}
.editorial-body :is(a:not(.button),.references a){color:#12604c!important;text-decoration:underline;text-underline-offset:4px}
.editorial-body :is(a:not(.button),.references a):is(:hover,:focus-visible){color:#704d1b!important;background:#eddab6!important;border-radius:3px}
.editorial-body .verse{
  padding:clamp(1.15rem,2.5vw,2rem)!important;
  color:#193e31!important;
  background:#faf6ed!important;border:1px solid #c5a46d!important;border-radius:10px!important;
  box-shadow:inset 0 0 0 4px #f0e1c8;
}
.editorial-body .verse :is(p,figcaption){color:#163e32!important}
.editorial-body .evidence,.editorial-body .data-chart{
  background:#f2e6d1!important;border:1px solid #bfa16b!important;
  border-inline-start:4px solid #9d7639!important;color:#1a3e32!important;
  border-radius:10px!important;padding:clamp(1rem,2vw,1.5rem)!important;
}
.editorial-body .evidence :is(summary,p),.editorial-body .data-chart :is(p,th,td){color:#1a3b31!important}
.editorial-body .evidence summary:is(:hover,:focus-visible){background:#e7cc98!important;color:#16382c!important;border-radius:7px}
.editorial-body :is(.references,.editorial-note){background:#efe2ca!important;border:1px solid #c9ad79!important;color:#394f42!important;border-radius:9px}
.editorial-body .references{padding:clamp(1.05rem,2vw,1.8rem)!important}
.editorial-body .references :is(h2,h3){color:#174838!important}
.editorial-body .journey-nav a{background:#154b3d!important;color:#fff0d6!important;border:1px solid #bb9962!important;border-radius:9px!important}
.editorial-body .journey-nav a strong{color:#fff0d6!important}
.editorial-body .journey-nav a span{color:#ebd3aa!important}
.editorial-body .journey-nav a:is(:hover,:focus-visible){background:#edcf95!important;color:#173e32!important}
.editorial-body .journey-nav a:is(:hover,:focus-visible) :is(strong,span){color:#173e32!important}

/* About pages and alternate page structures. */
.about-intro :is(h1,h2),.about-content :is(h2,h3){color:#174338!important}
.about-intro :is(p,li),.about-content :is(p,li){color:#354e41!important}
.about-content .evidence,.about-content .data-chart{background:#f1e3cb!important;color:#163d32!important;border:1px solid #bb9b60!important}
.about-content .verse p{color:#163d32!important}
.reading-cards{align-items:stretch!important}
.reading-card{padding:clamp(1.2rem,2vw,1.65rem)!important}

/* Footer, brand consistency and navigation; no control obscures footer. */
body > footer{
  background:linear-gradient(110deg,#071f1aec,#241d17f7 53%,#0a3227f0),var(--sc360-wood) center/cover!important;
  border-top:2px solid #c2a169!important;
  color:#fff2dd!important;box-shadow:inset 0 5px 15px #0003;
  padding-block:clamp(2rem,3vw,3.4rem) clamp(1.5rem,2vw,2rem)!important;
}
body > footer .brand-image{border-radius:10px;border:1px solid #d1b376;padding:3px;background:#dec69c}
body > footer :is(p,.footer-bottom){color:#e0d4bc!important}
body > footer a{color:#fff0d4!important}
body > footer a:is(:hover,:focus-visible){color:#ffdc97!important;text-decoration:underline!important}
body > footer .footer-bottom{border-top-color:#ddb87566!important}
body > footer .wrap{min-width:0}

/* Search and HD logo use existing working interactions; visual refinement only. */
.sc-search-dialog{background:#f9f1e2!important;color:#163d31!important;border:1px solid #c8a46a!important;border-radius:15px!important;box-shadow:0 28px 90px #000a!important}
.sc-search-head h2{color:#164334!important}
.sc-search-input{background:#fffbf4!important;color:#183d31!important;border:1px solid #ab8f5e!important}
.sc-search-result{background:#fff8eb!important;color:#1b4034!important;border:1px solid #ceb27f!important}
.sc-search-result span{color:#4a5b4f!important}
.sc-search-result:is(:hover,:focus-visible){background:#e9d6b0!important;color:#103729!important}
.sc-icon-button{background:#194738!important;color:#fff1d7!important;border-color:#bf9f62!important}
.sc-icon-button:hover{background:#edd29c!important;color:#173d31!important}
.sc-logo-dialog{background:radial-gradient(ellipse at 50% 40%,#fbf3e4,#e9d7b7 75%,#c9a977)!important}
.sc-logo-dialog .sc-logo-canvas img{border-radius:8px;filter:drop-shadow(0 28px 35px #33281b50)}

/* Ensure controls and headings remain legible with original site themes. */
body.dark main > :is(.section.wrap,div.section.wrap),body.dark main .editorial-body,
body.dark main :is(.related-card,.reading-card,.guidance-path,.premium-card,.branch,.source-hadith){
  background:linear-gradient(145deg,#1a332a,#22332d 60%,#2b2a25)!important;
  color:#f7eddc!important;border-color:#ac905e!important;
}
body.dark main > :is(.section.wrap,div.section.wrap) :is(h2,h3,p,li),
body.dark main .editorial-body :is(h2,h3,p,li),
body.dark main :is(.related-card,.reading-card,.guidance-path,.premium-card,.branch,.source-hadith) :is(h2,h3,p,li,strong,span){color:#f4ead7!important}
body.dark main .editorial-body .evidence,body.dark main .editorial-body .data-chart,
body.dark main .editorial-body .references,body.dark main .editorial-body .verse{
  background:#f2e4cc!important;color:#123a2f!important;border-color:#b99b69!important;
}
body.dark main .editorial-body :is(.evidence,.data-chart,.references,.verse) :is(h2,h3,p,li,summary,figcaption,th,td){color:#183f32!important}
body.dark main .editorial-body .journey-nav a :is(strong,span){color:#fff0d6!important}
body.dark main .editorial-body .journey-nav a:is(:hover,:focus-visible) :is(strong,span){color:#173e32!important}
body.dark main > .section.wrap .doors :is(h3,p),body.dark main .door :is(h3,p){color:#fff2dc!important}
body.dark .editorial-toc a{color:#f9edd7!important}
body.dark .editorial-toc a:is(:hover,:focus-visible){color:#133a2d!important}

/* Responsive, stable grids and touch targets. */
@media(min-width:1520px){main > .hero .hero-layout{max-width:1370px}}
@media(max-width:1240px){
  .doors{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body > header .header-inner{flex-wrap:wrap;row-gap:5px}
  body > header nav{justify-content:center;width:100%;order:3;flex-basis:100%}
}
@media(max-width:980px){
  .hero-layout{grid-template-columns:minmax(0,1fr)!important}
  .hero .hero-panel{max-width:530px;margin-inline:auto}
  .editorial-grid{grid-template-columns:minmax(0,1fr)!important}
  .editorial-toc{position:static;max-height:none}
  .premium-grid,.reading-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  html{scroll-padding-top:155px}
  body{background-attachment:scroll!important}
  body > header .header-inner{gap:8px;min-height:72px}
  body > header .brand-image{width:48px;height:48px}
  body > header .brand strong{font-size:1.36rem!important}
  body > header .brand small{font-size:.68rem!important}
  body > header .preferences{gap:6px}
  body > header nav{background:#142d26!important;border:1px solid #9f8253!important;border-radius:9px;padding:9px!important;max-height:55vh;overflow:auto}
  body > header nav > a{color:#faeeda!important}
  body > header .gateway-popover{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px}
  body > header .gateway-popover :is(section,a){min-width:0}
  .hero-layout{padding-block:clamp(2.4rem,6vw,4rem)!important}
  .doors{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .premium-grid,.reading-cards,.guidance-steps{grid-template-columns:minmax(0,1fr)!important}
  .editorial-toc.is-collapsed > a{display:none!important}
  .sc-toc-toggle{display:block}
  body > footer .footer-top{align-items:flex-start;gap:1.3rem}
}
@media(max-width:500px){
  .hero-layout{gap:1.8rem!important}
  .hero .hero-panel{width:100%}
  .doors{grid-template-columns:minmax(0,1fr)!important}
  .door{padding:1.1rem!important}
  main > :is(section.section.wrap,div.section.wrap){padding:1.2rem!important;width:calc(100% - 20px)!important}
  main > .sources.wrap{width:calc(100% - 20px)!important}
  .editorial-grid{width:calc(100% - 20px)!important}
  .editorial-body{padding:1.2rem!important}
  body > header .preferences .popover{max-width:calc(100vw - 22px)!important}
  body > header .gateway-popover{grid-template-columns:1fr;max-height:65vh}
  body > header .brand strong{font-size:1.23rem!important}
  body > header .brand small{font-size:.64rem!important}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*,*::before,*::after{animation:none!important;transition:none!important}}
@media print{
  body{background:#fff!important;color:#111!important}
  main > .hero,main > .principles,main > .premium-added,.editorial-hero{background:#fff!important;color:#111!important}
  main > :is(.section.wrap,div.section.wrap),.editorial-body,.branch,.reading-card,.premium-card{background:#fff!important;color:#111!important;box-shadow:none!important}
  :is(main,body) :is(h1,h2,h3,p,li){color:#111!important}
}
/* Final cross-surface contrast guards: dark jewel cards and light parchment pages. */
main > section.section.wrap .doors .door :is(h3,p),
main > div.section.wrap .doors .door :is(h3,p),
body.dark main > section.section.wrap .doors .door :is(h3,p){color:#fff2dc!important;-webkit-text-fill-color:#fff2dc!important}
main > section.section.wrap .doors .door h3,
main > div.section.wrap .doors .door h3{color:#ffdfa3!important;-webkit-text-fill-color:#ffdfa3!important}
main > section.section.wrap .doors .door .door-action{color:#eac988!important;-webkit-text-fill-color:#eac988!important}
main > .premium-added .premium-card :is(h2,h3){color:#154639!important;-webkit-text-fill-color:#154639!important}
main > .premium-added .premium-card :is(p,li){color:#3b5447!important;-webkit-text-fill-color:#3b5447!important}
main > .premium-added .premium-card:is(:hover,:focus-visible) :is(h2,h3,p,li){color:#163e32!important;-webkit-text-fill-color:#163e32!important}
main > .premium-added .premium-grid .premium-card{background:linear-gradient(155deg,#fdf6e9,#ecdfca)!important}
body.dark main > .premium-added .premium-card{background:#20382e!important}
body.dark main > .premium-added .premium-card :is(h2,h3,p,li){color:#f9ecd9!important;-webkit-text-fill-color:#f9ecd9!important}
/* Prevent the older giant ring ornament from appearing as a yellow disc on a phone. */
main > .editorial-hero::after{display:none!important;content:none!important}
/* Neutralize overly bright inline text defaults in manuscript sources while preserving content. */
body:not(.dark) main > section.section.wrap .sources .source-hadith :is(p,h2,h3){color:#193f32!important}
/* Palette continuity: retained controls now tint the new wood-and-metal system. */
html[data-palette="sapphire"] .hero .hero-panel{background:linear-gradient(145deg,#152e43,#202934 58%,#29251f)!important;border-color:#d1d7df!important}
html[data-palette="sapphire"] main > .hero{background:linear-gradient(110deg,#0b2032ec,#1d1e24d9,#173f4de8),var(--sc360-wood) center/cover!important}
html[data-palette="sapphire"] .door{background:linear-gradient(145deg,#223f54,#242e35)!important;border-color:#a8becc!important}
html[data-palette="sapphire"] .door:nth-child(2n){background:linear-gradient(145deg,#273442,#364656)!important}
html[data-palette="sapphire"] .hero .button.gold{background:linear-gradient(110deg,#e9eef4,#b5c3d0)!important;border-color:#e3eaf3!important}
html[data-palette="plum"] .hero .hero-panel{background:linear-gradient(145deg,#37263b,#29262a 58%,#281e1d)!important;border-color:#d1ab8a!important}
html[data-palette="plum"] main > .hero{background:linear-gradient(110deg,#302232eb,#211a1cda,#46303cec),var(--sc360-wood) center/cover!important}
html[data-palette="plum"] .door{background:linear-gradient(145deg,#423044,#2b272c)!important;border-color:#c5a077!important}
html[data-palette="plum"] .door:nth-child(2n){background:linear-gradient(145deg,#3b303c,#513b43)!important}
html[data-palette="manuscript"] .hero .hero-panel{background:linear-gradient(145deg,#392e20,#292920 58%,#282016)!important;border-color:#c8a374!important}
html[data-palette="manuscript"] main > .hero{background:linear-gradient(110deg,#302718eb,#251b16d9,#453522e8),var(--sc360-wood) center/cover!important}
html[data-palette="manuscript"] .door{background:linear-gradient(145deg,#4d3a2b,#302b24)!important;border-color:#c5a173!important}
html[data-palette="manuscript"] .door:nth-child(2n){background:linear-gradient(145deg,#44372b,#514432)!important}
html[data-palette="emerald"] .hero .hero-panel{background:linear-gradient(145deg,#0a4638,#162e27 58%,#242018)!important}
html[data-palette="emerald"] .door{background:linear-gradient(145deg,#12513e,#18332a)!important}
html[data-palette="emerald"] .door:nth-child(2n){background:linear-gradient(145deg,#0d4b3c,#334039)!important}
/* The 404 page is a full-root document, not a subdirectory route. */
