.hero { width:100%; max-width:none; overflow:hidden; }
.hero > div[style*="position:relative"] { width:100%; max-width:none; margin:0; }
.hero > div[style*="position:relative"] > img { display:block; width:100%; max-width:none; height:clamp(520px,62vw,760px); object-fit:cover; object-position:center top; }
@media (max-width:768px) { .hero > div[style*="position:relative"] > img { height:620px; } }

/* Amanah brand visibility + MFA copy control */
.amanah-brand{display:inline-flex!important;align-items:center;gap:10px;font-size:1.28rem!important;font-weight:800;white-space:nowrap;text-decoration:none}.amanah-brand-logo{width:52px;height:52px;object-fit:contain;display:block}.mfa-key-row{display:inline-flex;align-items:center;gap:5px;max-width:100%;direction:ltr}.mfa-copy-key{overflow-wrap:anywhere}.mfa-copy-btn{width:24px;height:24px;min-width:24px;padding:0;border:1px solid currentColor;border-radius:5px;background:transparent;cursor:pointer;font-size:13px;line-height:1}html[dir="rtl"] body{text-align:right}html[dir="rtl"] .nav,html[dir="rtl"] .nav-actions,html[dir="rtl"] nav ul{direction:rtl}@media(max-width:700px){.amanah-brand-logo{width:44px;height:44px}.amanah-brand{font-size:1.08rem!important}}

.admin-shell{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:calc(100vh - 90px);align-items:stretch}
.admin-sidebar{background:#073f38;color:#fff;padding:24px 14px;position:sticky;top:0;align-self:start;min-height:100vh}
.admin-sidebar-title{font-size:1.35rem;font-weight:800;padding:8px 12px 18px}
.admin-sidebar nav{display:flex;flex-direction:column;gap:6px}
.admin-sidebar nav a{display:block;color:#fff;text-decoration:none;padding:11px 13px;border-radius:10px;font-weight:650}
.admin-sidebar nav a:hover,.admin-sidebar nav a:focus{background:rgba(255,255,255,.14);color:#fff}
.admin-content{min-width:0;width:100%}.amanah-brand-logo{background:transparent!important;box-shadow:none!important}
@media(max-width:900px){.admin-shell{display:block}.admin-sidebar{position:relative;min-height:auto;padding:10px 12px}.admin-sidebar-title{display:none}.admin-sidebar nav{flex-direction:row;overflow-x:auto;white-space:nowrap}.admin-sidebar nav a{flex:0 0 auto}}

/* Stable Amanah admin sidebar — restored original light/gold/green visual language */
.admin-shell{display:grid!important;grid-template-columns:245px minmax(0,1fr)!important;min-height:calc(100vh - 86px);width:100%;overflow:visible}
.admin-sidebar{display:block!important;visibility:visible!important;opacity:1!important;transform:none!important;position:relative!important;left:auto!important;right:auto!important;top:auto!important;width:245px!important;min-width:245px!important;height:auto!important;min-height:100%;overflow:visible!important;background:#f6f1e6!important;color:#163f37!important;border-right:1px solid #d8c9a6!important;padding:22px 14px!important;z-index:2}
.admin-sidebar-title{display:block!important;color:#0d4f43!important;font-size:1.25rem;font-weight:800;padding:8px 12px 16px;border-bottom:1px solid #dfd2b6;margin-bottom:10px}
.admin-sidebar nav{display:flex!important;flex-direction:column!important;gap:5px!important;overflow:visible!important}
.admin-sidebar nav a{display:block!important;visibility:visible!important;color:#234f46!important;background:transparent!important;text-decoration:none!important;padding:10px 12px!important;border-radius:9px!important;font-weight:650!important;white-space:normal!important}
.admin-sidebar nav a:hover,.admin-sidebar nav a:focus{background:#e8ddc4!important;color:#083f35!important}
.admin-content{min-width:0!important;width:100%!important;overflow-x:hidden}
.amanah-brand-logo{background:transparent!important;box-shadow:none!important}

/* Mobile/tablet: sidebar stays visible as a normal horizontal admin navigation.
   No off-canvas transform, swipe state, or persisted hidden state. */
@media(max-width:900px){
 .admin-shell{display:block!important;min-height:0!important}
 .admin-sidebar{display:block!important;visibility:visible!important;opacity:1!important;transform:none!important;position:relative!important;width:100%!important;min-width:0!important;min-height:0!important;padding:10px 12px!important;border-right:0!important;border-bottom:1px solid #d8c9a6!important}
 .admin-sidebar-title{display:none!important}
 .admin-sidebar nav{display:flex!important;flex-direction:row!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
 .admin-sidebar nav a{flex:0 0 auto!important;white-space:nowrap!important}
 .admin-content{width:100%!important}
}

.admin-list-tools{display:flex;justify-content:space-between;gap:14px;align-items:center;flex-wrap:wrap;margin:14px 0}
.admin-search-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.admin-search-form input[type=search]{min-width:260px;max-width:100%;padding:10px 12px}
.admin-search-form select{padding:10px 12px}
.admin-page-summary{font-size:.92rem;opacity:.78}
.admin-pagination{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:16px 0}
.admin-pagination a{display:inline-block;padding:8px 11px;border:1px solid #d8c9a6;border-radius:8px;text-decoration:none;background:#fff;color:#164a40}
.admin-pagination a.current{background:#e8ddc4;font-weight:800}
html[dir="rtl"] .admin-shell{grid-template-columns:minmax(0,1fr) 245px}
html[dir="rtl"] .admin-sidebar{grid-column:2;border-right:0!important;border-left:1px solid #d8c9a6!important}
html[dir="rtl"] .admin-content{grid-column:1;grid-row:1}
@media(max-width:900px){html[dir="rtl"] .admin-shell{display:block!important}.admin-search-form input[type=search]{min-width:180px}}

/* Amanah success-story marquee */
.amanah-marriage-marquee{overflow:hidden;white-space:nowrap;width:100%}
.amanah-marriage-track{display:inline-flex;gap:3rem;min-width:100%;animation:amanahMarriageScroll 35s linear infinite}
.amanah-marriage-track span{display:inline-block;padding:.5rem 0}
@keyframes amanahMarriageScroll{from{transform:translateX(100%)}to{transform:translateX(-100%)}}
@media(prefers-reduced-motion:reduce){.amanah-marriage-track{animation:none;white-space:normal;flex-wrap:wrap}}

/* Guided Amanah journey */
.journey-progress{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0}.journey-step{padding:9px 12px;border:1px solid #d7dde5;border-radius:999px;background:#fff}.journey-step b{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:50%;background:#eef2f6;margin-right:5px}.journey-step.done,.journey-step.current{font-weight:700}.journey-step.current{border-width:2px}.journey-next{max-width:900px;margin:0 auto}.founder-offer .card{text-align:center}[dir="rtl"] .journey-step b{margin-right:0;margin-left:5px}@media(max-width:700px){.journey-progress{display:block}.journey-step{display:block;margin:7px 0}}

/* Consistent form success/error feedback */
.amanah-global-feedback{margin-top:16px}
.amanah-alert{border:1px solid;border-radius:12px;padding:14px 16px;margin:14px 0;font-size:1rem;line-height:1.5}
.amanah-alert-success{background:#edf8f0;border-color:#7eb78c;color:#174b25}
.amanah-alert-error{background:#fff0f0;border-color:#d98a8a;color:#7a1d1d}
.amanah-alert-warning{background:#fff8e6;border-color:#d8b55b;color:#684d00}
.amanah-alert-info{background:#eef6ff;border-color:#8bb5df;color:#173f68}
.amanah-alert:focus{outline:3px solid currentColor;outline-offset:2px}
.js-form-feedback[hidden]{display:none}

/* UX/navigation refinements */
.page-header h1,.hero h1{font-size:clamp(2rem,4vw,3.6rem);line-height:1.08}h2{font-size:clamp(1.45rem,2.5vw,2.25rem)}.btn{font-size:.98rem;line-height:1.2;padding:.72rem 1.05rem}.site-header .btn{font-size:.94rem;padding:.62rem .9rem}
.login-register-option{margin:24px auto;max-width:760px}.auth-exit{margin-top:22px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}.photo-identity-attestation,.photo-admin-review{display:block;padding:14px;border:1px solid #d7dde5;border-radius:10px;margin:18px 0;line-height:1.5}
.profiles-filter-scroll{max-height:calc(100vh - 130px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:6px}@media(max-width:900px){.profiles-filter-scroll{max-height:none;overflow:visible;padding-right:0}}

.photo-compare-note{font-size:.92rem;line-height:1.5;margin-top:.4rem}

.photo-file-status{margin-top:.55rem;padding:.55rem .7rem;border-radius:8px;background:#f4f7f6;font-size:.9rem;font-weight:600}.photo-file-status:empty{display:none}


/* 2026-09-28 conservative UI repair: no JavaScript/i18n changes. */

/* Keep the admin shell structurally stable in both languages.
   Arabic text remains RTL, but RTL must not move the entire dashboard to the far-right column. */
html[dir="rtl"] body.amanah-admin-page .admin-shell{
  direction:ltr!important;
  grid-template-columns:245px minmax(0,1fr)!important;
}
html[dir="rtl"] body.amanah-admin-page .admin-sidebar{
  grid-column:1!important;
  grid-row:1!important;
  border-left:0!important;
  border-right:1px solid #d8c9a6!important;
}
html[dir="rtl"] body.amanah-admin-page .admin-content{
  grid-column:2!important;
  grid-row:1!important;
  direction:rtl!important;
  text-align:right!important;
}
html[dir="rtl"] body.amanah-admin-page .admin-sidebar,
html[dir="rtl"] body.amanah-admin-page .admin-sidebar nav{
  direction:rtl!important;
  text-align:right!important;
}
@media(max-width:900px){
  html[dir="rtl"] body.amanah-admin-page .admin-shell{display:block!important}
}

/* More restrained typography site-wide. This changes size only, not layout/content. */
body h1{font-size:clamp(1.85rem,3.2vw,2.65rem)!important;line-height:1.16!important}
body h2{font-size:clamp(1.45rem,2.35vw,2rem)!important;line-height:1.22!important}
body h3{font-size:clamp(1.15rem,1.75vw,1.45rem)!important;line-height:1.28!important}
body .page-header h1{font-size:clamp(1.9rem,3vw,2.55rem)!important}
body .card h2{font-size:clamp(1.35rem,2vw,1.8rem)!important}
body .card h3{font-size:clamp(1.1rem,1.6vw,1.4rem)!important}
body .badge{font-size:.82rem!important}
body.amanah-admin-page .admin-sidebar-title{font-size:1.12rem!important}

/* Both English and Arabic remain selectable. */


/* Questionnaire Wali UI stability */
#wali-questionnaire-section .wali-help-text{
  margin:0 0 18px;
  line-height:1.55;
}
#wali-questionnaire-section .wali-authorization-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:16px 0;
}
#wali-questionnaire-section .wali-authorization-row input[type="checkbox"]{
  width:auto!important;
  min-width:16px;
  margin:4px 0 0!important;
  flex:0 0 auto;
}
#wali-questionnaire-section .wali-authorization-row label{
  margin:0!important;
  display:block!important;
}
#wali-questionnaire-section .wali-password-field{
  display:block;
  margin-top:14px;
}
#wali-questionnaire-section .wali-password-field > label{
  display:block;
  margin-bottom:6px;
}
#wali-questionnaire-section .wali-password-field > input{
  display:block;
  width:100%;
}
#wali-questionnaire-section .wali-password-field > small{
  display:block;
  margin-top:6px;
  line-height:1.4;
}

/* English-only UI: language switching note is intentionally hidden. */
.lang-note{display:none!important;}

/* Accessibility enhancements: intentionally minimal visual change */
.amanah-skip-link{position:fixed;left:12px;top:-80px;z-index:100000;padding:10px 14px;background:#fff;color:#111;border:2px solid #111;border-radius:6px}
.amanah-skip-link:focus{top:12px}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid currentColor;outline-offset:3px}
button,.btn,a,input,select,textarea{scroll-margin-top:12px}
img{max-width:100%;height:auto}
::placeholder{opacity:1}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Milestone 2: keyboard-accessible mobile navigation and usable controls */
.amanah-mobile-menu{display:none}
@media(max-width:900px){
  .amanah-desktop-nav{display:none}
  .amanah-mobile-menu{display:block;position:relative;flex:0 0 auto}
  .amanah-mobile-menu summary{cursor:pointer;padding:10px 14px;border:1px solid #cbd5d1;border-radius:9px;background:#fff;font-weight:700;list-style:none}
  .amanah-mobile-menu summary::-webkit-details-marker{display:none}
  .amanah-mobile-menu[open] nav{position:absolute;z-index:100;top:100%;left:0;min-width:min(300px,90vw);max-width:90vw;display:flex;flex-direction:column;gap:0;padding:10px;background:#fff;border:1px solid #d7e2dd;border-radius:12px;box-shadow:0 12px 30px #0002}
  .amanah-mobile-menu nav a{display:block;padding:10px 12px;color:#153e35}
  .amanah-mobile-menu nav .lang-switch{display:flex;gap:10px;padding:10px 12px}
  .nav-actions{min-width:0;flex-wrap:wrap}
  .nav-actions>.lang-switch{display:flex!important;gap:6px}
  .nav-actions>.lang-switch .lang-button{min-width:38px;min-height:38px;white-space:nowrap}
}
@media(max-width:620px){
  .nav{flex-direction:row;flex-wrap:wrap;align-items:center}
  .amanah-brand{white-space:normal!important;max-width:calc(100% - 110px)}
  .nav-actions{width:100%;display:flex;flex-wrap:wrap}
  .nav-actions>.btn{width:auto;max-width:100%;white-space:normal;text-align:center;flex:1 1 150px}
  .nav-actions>.logged-user{overflow-wrap:anywhere}
}

/* Fixed-width public/member site buttons — November 2026.
   All standard .btn buttons share one width, regardless of caption length.
   Long English or Arabic captions wrap inside the fixed width rather than
   resizing the button. Exclude admin pages marked .amanah-admin-page. */
body:not(.amanah-admin-page) .btn {
  width: 210px !important;
  min-width: 0 !important;
  max-width: calc(100vw - 32px) !important;
  min-height: 44px;
  height: auto;
  box-sizing: border-box;
  padding: 10px 14px;
  display: inline-flex;
  flex: 0 0 210px !important;
  align-items: center;
  justify-content: center;
  align-self: start;
  justify-self: start;
  text-align: center;
  white-space: normal !important;
  overflow-wrap: break-word;
}
html[lang="ar"] body:not(.amanah-admin-page) .btn,
html[dir="rtl"] body:not(.amanah-admin-page) .btn {
  justify-self: end;
}
/* On narrow screens the fixed width is preserved; only viewport overflow
   can reduce it. No caption-dependent width or flex growth is allowed. */
@media (max-width: 620px) {
  body:not(.amanah-admin-page) .btn {
    width: 210px !important;
    flex: 0 0 210px !important;
    max-width: calc(100vw - 32px) !important;
  }
}


/* 2026-11-06: tighter vertical rhythm on member-facing content pages.
   Shared page-header + section padding previously added up to large blank bands.
   Keep homepage hero, onboarding forms, and administration layout unchanged. */
body:not(.amanah-admin-page) main#main-content > section.page-header {
  padding-top: clamp(26px, 3.5vw, 42px) !important;
  padding-bottom: clamp(24px, 3vw, 36px) !important;
  min-height: 0 !important;
}
body:not(.amanah-admin-page) main#main-content > section:not(.page-header):not(.hero) {
  padding-top: clamp(20px, 2.6vw, 32px) !important;
  padding-bottom: clamp(20px, 2.6vw, 32px) !important;
  min-height: 0 !important;
}
body:not(.amanah-admin-page) main#main-content > section.page-header + section:not(.hero) {
  padding-top: clamp(18px, 2.5vw, 28px) !important;
}
body:not(.amanah-admin-page) main#main-content > section.page-header h1 {
  margin-bottom: 10px !important;
}
body:not(.amanah-admin-page) main#main-content > section.page-header .lead {
  margin-bottom: 0 !important;
}
/* Reduce whitespace between adjacent ordinary sections without modifying
   form controls, profile images, card contents, or page actions. */
@media (max-width: 640px) {
  body:not(.amanah-admin-page) main#main-content > section.page-header {
    padding-block: 24px !important;
  }
  body:not(.amanah-admin-page) main#main-content > section:not(.page-header):not(.hero) {
    padding-block: 18px !important;
  }
}


/* Site-wide sticky footer for short member/public pages. */
html {min-height:100%}
body:not(.amanah-admin-page) {min-height:100vh;display:flex;flex-direction:column}
body:not(.amanah-admin-page) > main {flex:1 0 auto}
body:not(.amanah-admin-page) > footer {margin-top:auto;flex-shrink:0}
/* The mobile compact menu owns a language switch when desktop actions are hidden. */
.amanah-compact-links > .lang-switch {display:flex;gap:6px;align-items:center;padding:6px 10px;border-bottom:1px solid #e5e8e5}
.amanah-compact-links > .lang-switch .lang-button {flex:0 0 auto;width:auto;min-width:50px;min-height:35px;border:1px solid #cfded8;border-radius:7px;background:#fff;color:#07564e;cursor:pointer}
.amanah-compact-links > .lang-switch .lang-button.active {background:#0d5d53;color:#fff}


/* Amanah public/member pastel section palette — November 2026.
   Additive presentation only. Explicitly exclude all .amanah-admin-page
   and layouts containing .admin-shell (including administrative tools).
   Preserve button/input colors, translations, layout, and interaction. */
@supports selector(body:has(.admin-shell)) {
  body:not(.amanah-admin-page):not(:has(.admin-shell)) {
    --amanah-card-mint: #f0f9f5;
    --amanah-card-ivory: #fffaf0;
    --amanah-card-sky: #eff7fd;
    --amanah-card-lilac: #f7f3fc;
    --amanah-card-peach: #fff4ee;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card) {
    background-color: var(--amanah-card-mint);
    border-color: #d5e8df;
    color: #102c28;
    transition: background-color .2s ease, border-color .2s ease;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card):nth-child(5n + 2) {
    background-color: var(--amanah-card-ivory);
    border-color: #ede3cf;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card):nth-child(5n + 3) {
    background-color: var(--amanah-card-sky);
    border-color: #d9e8f2;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card):nth-child(5n + 4) {
    background-color: var(--amanah-card-lilac);
    border-color: #e8def1;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card):nth-child(5n) {
    background-color: var(--amanah-card-peach);
    border-color: #f0dfd5;
  }
  /* Alternating prominent top-level blocks even when each holds only one card. */
  body:not(.amanah-admin-page):not(:has(.admin-shell)) main > section:not(.hero):not(.page-header):nth-of-type(even) :is(.card,.step,.form-card,.pricing-card,.login-card):first-child {
    background-color: var(--amanah-card-ivory);
    border-color: #ede3cf;
  }
  body:not(.amanah-admin-page):not(:has(.admin-shell)) main > section:not(.hero):not(.page-header):nth-of-type(3n) :is(.card,.step,.form-card,.pricing-card,.login-card):first-child {
    background-color: var(--amanah-card-sky);
    border-color: #d9e8f2;
  }
  /* Inputs remain white for legibility, regardless of card background. */
  body:not(.amanah-admin-page):not(:has(.admin-shell)) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card) :is(input,textarea,select) {
    background-color: #fff;
  }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.amanah-admin-page) :is(.card,.step,.profile-card,.form-card,.pricing-card,.login-card) {transition:none;}
}
