/* /khalwati-public-assets/ui3.css */
:root{--green:#07583d;--green-2:#0b6b49;--deep:#043c2a;--gold:#c99a37;--gold-2:#e6bd60;--cream:#fbf6e9;--paper:#fffdf8;--ink:#153d32;--muted:#6e746e;--line:#e6d6ae;--shadow:0 14px 42px rgba(60,45,20,.08);--r:26px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--cream);color:var(--ink);font-family:'Tajawal',system-ui,sans-serif;line-height:1.65;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}button,input{font:inherit}img{max-width:100%;display:block}svg{width:1.45em;height:1.45em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.container{width:min(1180px,calc(100% - 40px));margin:auto}.muted{color:var(--muted)}
/* entry */.entry-page{min-height:100svh;background:#e8dcc2;position:relative;overflow:hidden}.entry-bg{position:absolute;inset:0;background-image:linear-gradient(180deg,rgba(255,247,229,.13) 0%,rgba(10,64,44,.03) 56%,rgba(251,246,233,.96) 86%),url('/khalwati-public-assets/masjid-nabawi-hero.webp');background-size:cover;background-position:center 40%;filter:saturate(.86) contrast(.96)}.entry-content{position:relative;z-index:2;min-height:100svh;display:flex;align-items:flex-end;padding:44px 0}.entry-card{width:min(900px,94vw);margin:0 auto;background:rgba(255,253,248,.94);backdrop-filter:blur(8px);border:1px solid rgba(201,154,55,.42);border-radius:36px;padding:34px;box-shadow:0 24px 70px rgba(31,46,38,.18)}.entry-brand{text-align:center;margin-bottom:22px}.entry-brand img{width:78px;margin:0 auto 12px}.entry-brand h1{font-size:clamp(2rem,5vw,3.5rem);line-height:1.12;margin:0;font-weight:800;letter-spacing:-.04em}.entry-brand p{margin:8px 0 0;color:#9b7425;font-size:1.1rem;font-weight:600}.entry-welcome{text-align:center;border-top:1px solid var(--line);padding-top:20px;margin-top:10px}.entry-welcome h2{margin:0 0 4px;font-size:1.45rem}.entry-welcome p{margin:0;color:var(--muted)}.entry-choice-title{text-align:center;margin:22px 0 12px;font-size:1.4rem}.entry-choices{display:grid;grid-template-columns:1fr 1fr;gap:14px}.entry-choice{border:1px solid var(--line);border-radius:22px;padding:20px 18px;text-align:center;background:var(--paper);transition:.2s;box-shadow:0 6px 18px rgba(80,57,14,.04)}.entry-choice svg{width:38px;height:38px;margin-bottom:6px}.entry-choice strong{display:block;font-size:1.18rem}.entry-choice small{display:block;color:var(--muted);margin-top:4px}.entry-choice.mobile{background:linear-gradient(145deg,var(--green-2),var(--deep));color:#fff;border-color:var(--gold)}.entry-choice.mobile small{color:#e5eee9}.entry-choice:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.entry-note{text-align:center;font-size:.82rem;color:#7b7d78;margin-top:16px}
/* header */.site-header{position:sticky;top:0;z-index:40;background:rgba(251,246,233,.92);backdrop-filter:blur(12px);border-bottom:1px solid rgba(201,154,55,.26)}.header-inner{height:78px;display:flex;align-items:center;justify-content:space-between;gap:18px}.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.05rem}.brand img{width:44px;height:44px;object-fit:contain}.header-actions{display:flex;align-items:center;gap:8px}.icon-btn,.pill-btn{border:1px solid var(--line);background:rgba(255,253,248,.82);color:var(--deep);min-width:44px;height:44px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.pill-btn{padding:0 14px;gap:7px;font-weight:700}.nav-links{display:flex;align-items:center;gap:5px}.nav-links a{padding:9px 12px;border-radius:12px;font-weight:600}.nav-links a:hover{background:#f1ead8}.mobile-menu{display:none}
/* home */.home-hero{padding:46px 0 24px}.home-hero-grid{display:grid;grid-template-columns:1.12fr .88fr;gap:28px;align-items:center}.welcome-box h1{font-size:clamp(2.2rem,5vw,4.2rem);margin:0 0 12px;line-height:1.08;letter-spacing:-.045em}.welcome-box h1 span{color:var(--green)}.welcome-box p{font-size:1.15rem;color:var(--muted);max-width:700px;margin:0 0 22px}.quick-search{position:relative;max-width:650px}.quick-search input,.library-search input{width:100%;height:56px;border:1px solid var(--line);border-radius:18px;background:var(--paper);padding:0 52px 0 18px;outline:none;font-size:1rem;box-shadow:0 6px 24px rgba(75,50,10,.03)}.quick-search svg,.library-search svg{position:absolute;right:17px;top:50%;transform:translateY(-50%);color:#7a806f}.feature-panel{background:linear-gradient(145deg,#0a6949,#043c2a);color:#fff;padding:28px;border-radius:32px;box-shadow:var(--shadow);position:relative;overflow:hidden}.feature-panel:before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 20% 0%,rgba(230,189,96,.16),transparent 38%)}.feature-panel>*{position:relative}.feature-panel small{color:#f2d58f;font-weight:700}.feature-panel h2{font-size:2rem;margin:8px 0}.feature-panel p{color:#dce8e1;margin:0}.section{padding:28px 0}.section-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:18px}.section-head h2{font-size:2rem;margin:0}.section-head p{margin:0;color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.dash-card{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:22px;min-height:145px;display:flex;flex-direction:column;justify-content:space-between;transition:.2s;box-shadow:0 5px 20px rgba(60,45,20,.035)}.dash-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.dash-icon{width:48px;height:48px;border-radius:15px;background:#edf4ef;color:var(--green);display:grid;place-items:center}.dash-card:nth-child(2n) .dash-icon{background:#fbf1da;color:#a77c21}.dash-card h3{margin:14px 0 2px;font-size:1.15rem}.dash-card p{margin:0;color:var(--muted);font-size:.88rem}.dash-card.accent{background:linear-gradient(145deg,var(--green-2),var(--deep));color:#fff;border-color:var(--gold)}.dash-card.accent p{color:#dce8e1}.dash-card.accent .dash-icon{background:rgba(255,255,255,.12);color:#f1d48d}
/* library */.library-shell{padding:28px 0 54px}.library-tools{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:18px 0}.library-search{position:relative;flex:1 1 360px}.filters{display:flex;gap:8px;flex-wrap:wrap}.filter{border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:999px;padding:10px 16px;cursor:pointer;font-weight:600;min-height:44px;display:inline-flex;align-items:center;justify-content:center}.filter.active{background:var(--green);color:#fff;border-color:var(--green)}.books-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:18px}.book-card{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:14px;box-shadow:0 6px 20px rgba(56,41,10,.04);transition:.2s;min-width:0}.book-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.book-cover-wrap{aspect-ratio:3/4;border-radius:15px;overflow:hidden;background:#eee9db;display:grid;place-items:center}.book-cover-wrap img{width:100%;height:100%;object-fit:cover}.book-card h3{font-size:1rem;line-height:1.5;margin:12px 0 4px;white-space:normal}.book-card .cat{font-size:.78rem;color:#9a7529}.book-card .open{margin-top:10px;color:var(--green);font-weight:700;font-size:.9rem}.empty{display:none;text-align:center;padding:50px 20px;border:1px dashed var(--line);border-radius:20px;color:var(--muted)}
/* book detail */.crumbs{padding:20px 0 0;color:var(--muted);font-size:.9rem}.book-detail{padding:18px 0 52px}.book-detail-card{background:var(--paper);border:1px solid var(--line);border-radius:30px;padding:30px;box-shadow:var(--shadow)}.detail-grid{display:grid;grid-template-columns:220px 1fr;gap:34px;align-items:center}.detail-cover{width:190px;margin:auto;border-radius:16px;overflow:hidden;box-shadow:0 12px 30px rgba(31,42,35,.14)}.detail-meta .tag{display:inline-flex;padding:7px 12px;border-radius:999px;background:#f8efd9;color:#8a6720;font-weight:700;font-size:.86rem}.detail-meta h1{font-size:clamp(2rem,5vw,3.4rem);line-height:1.15;margin:13px 0 12px;letter-spacing:-.035em}.detail-meta p{font-size:1.05rem;max-width:700px;color:var(--muted);margin:0}.detail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.btn{height:50px;border-radius:15px;padding:0 19px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:700;border:1px solid var(--line);background:var(--paper)}.btn.primary{background:var(--green);color:#fff;border-color:var(--green)}.btn.gold{background:linear-gradient(135deg,#f1d174,#dca62d);color:#234236;border-color:#d7a336}.facts{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:28px;padding-top:22px;border-top:1px solid var(--line)}.fact{background:#fcf8ed;border-radius:15px;padding:14px}.fact b,.fact span{display:block}.fact b{font-size:.78rem;color:#9a7529}.fact span{margin-top:3px;font-weight:600}
/* section pages */.page-hero{padding:44px 0 18px}.page-hero h1{font-size:clamp(2.1rem,5vw,3.5rem);margin:0}.page-hero p{color:var(--muted);margin:6px 0 0;max-width:720px}.simple-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding-bottom:55px}.simple-card{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:24px}.simple-card h3{margin:0 0 7px}.simple-card p{margin:0;color:var(--muted)}
/* footer */.site-footer{border-top:1px solid rgba(201,154,55,.24);padding:26px 0;margin-top:18px;color:#787d75;font-size:.88rem}.footer-inner{display:flex;justify-content:space-between;gap:18px;align-items:center}.footer-links{display:flex;gap:14px;flex-wrap:wrap}
/* drawer */.drawer{position:fixed;inset:0;z-index:70;display:none}.drawer.open{display:block}.drawer-backdrop{position:absolute;inset:0;background:rgba(2,28,19,.32)}.drawer-panel{position:absolute;top:0;right:0;height:100%;width:min(340px,88vw);background:var(--paper);padding:26px;box-shadow:-10px 0 35px rgba(0,0,0,.12)}.drawer-panel nav{display:grid;gap:7px;margin-top:28px}.drawer-panel nav a{padding:12px 14px;border-radius:12px;font-weight:700}.drawer-panel nav a:hover{background:#f6eedc}
@media(max-width:900px){.container{width:min(100% - 28px,760px)}.nav-links{display:none}.mobile-menu{display:inline-flex}.home-hero-grid{grid-template-columns:1fr}.dashboard-grid{grid-template-columns:repeat(2,1fr)}.books-grid{grid-template-columns:repeat(3,1fr)}.simple-grid{grid-template-columns:1fr 1fr}.entry-card{padding:26px}.detail-grid{grid-template-columns:170px 1fr}.detail-cover{width:160px}.facts{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){body{font-size:15px}.container{width:calc(100% - 24px)}.header-inner{height:68px}.brand img{width:38px;height:38px}.brand strong{font-size:.96rem}.pill-btn span{display:none}.home-hero{padding:28px 0 12px}.welcome-box h1{font-size:2.25rem}.welcome-box p{font-size:1rem}.feature-panel{padding:22px;border-radius:24px}.feature-panel h2{font-size:1.6rem}.dashboard-grid{grid-template-columns:1fr 1fr;gap:10px}.dash-card{padding:16px;min-height:128px}.dash-icon{width:42px;height:42px}.section{padding:20px 0}.section-head h2{font-size:1.6rem}.library-tools{margin-top:12px}.filters{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px;width:100%;scrollbar-width:none}.filters::-webkit-scrollbar{display:none}.filter{white-space:nowrap;padding:8px 13px}.books-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.book-card{padding:9px;border-radius:17px}.book-card h3{font-size:.91rem;margin-top:9px}.book-card .cat{font-size:.72rem}.book-detail-card{padding:20px 16px;border-radius:23px}.detail-grid{grid-template-columns:1fr;text-align:center;gap:20px}.detail-cover{width:132px}.detail-meta h1{font-size:2rem}.detail-meta p{font-size:.96rem}.detail-actions{display:grid;grid-template-columns:1fr 1fr}.detail-actions .primary{grid-column:1/-1}.facts{grid-template-columns:1fr 1fr}.entry-page{background:#dfd1b8}.entry-bg{background-image:linear-gradient(180deg,rgba(255,248,232,.08) 0%,rgba(2,46,31,.02) 45%,rgba(251,246,233,.98) 75%),url('/khalwati-public-assets/masjid-nabawi-hero-mobile.webp');background-position:center top}.entry-content{padding:18px 0;align-items:flex-end}.entry-card{width:calc(100% - 24px);padding:21px 15px;border-radius:28px}.entry-brand img{width:58px}.entry-brand h1{font-size:1.95rem}.entry-brand p{font-size:.95rem}.entry-welcome{padding-top:15px}.entry-welcome h2{font-size:1.18rem}.entry-welcome p{font-size:.88rem}.entry-choice-title{font-size:1.18rem;margin:16px 0 9px}.entry-choices{gap:9px}.entry-choice{padding:15px 8px;border-radius:18px}.entry-choice svg{width:31px;height:31px}.entry-choice strong{font-size:1rem}.entry-choice small{font-size:.77rem}.simple-grid{grid-template-columns:1fr}.footer-inner{display:block;text-align:center}.footer-links{justify-content:center;margin-top:10px}}
/* UI 3.2 requested refinements — preserve 3.0 palette and geometry */
.home-hero-grid.single-feature{grid-template-columns:minmax(0,780px);justify-content:center}.home-hero-grid.single-feature .feature-panel{width:100%}.library-tools.kh-filters-only{justify-content:center}.books-grid .book-card{text-align:center}.book-card .open{display:flex;justify-content:center;align-items:center}.book-return-row{display:flex;justify-content:flex-start;padding:18px 0 0}.back-site-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border:1px solid var(--line);background:var(--paper);color:var(--green);border-radius:14px;font-weight:700}.about-page{padding-bottom:58px}.about-kicker{display:inline-flex;color:#997126;font-weight:700;margin-bottom:6px}.about-story{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.7fr);gap:18px;align-items:stretch;margin:6px 0 18px}.about-copy,.about-source-card,.tasawwuf-summary{background:var(--paper);border:1px solid var(--line);border-radius:24px;padding:26px;box-shadow:0 6px 20px rgba(56,41,10,.035)}.about-copy h2,.tasawwuf-head h2{margin:0 0 10px;font-size:1.7rem}.about-copy p{margin:0 0 12px;color:var(--muted);font-size:1.02rem}.about-source-card{display:flex;flex-direction:column;justify-content:center;text-align:center;background:linear-gradient(145deg,var(--green-2),var(--deep));color:white;border-color:var(--gold)}.about-source-card span{color:#f1d48d;font-weight:700}.about-source-card strong{font-size:1.35rem;margin:8px 0}.about-source-card small{color:#dce8e1}.tasawwuf-summary{margin-top:18px}.tasawwuf-head span{color:#9a7529;font-weight:700}.tasawwuf-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.tasawwuf-grid p{margin:0;background:#fcf8ed;border-radius:17px;padding:18px;color:var(--muted)}.about-note{margin-top:16px;color:#7f837d;font-size:.9rem}.about-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
@media(max-width:700px){.home-hero-grid.single-feature{display:block}.about-story,.tasawwuf-grid{grid-template-columns:1fr}.about-copy,.about-source-card,.tasawwuf-summary{padding:20px;border-radius:21px}.book-return-row{justify-content:center}.back-site-btn{width:100%}}
/* UI 3.2 performance and accessibility refinements */
.book-card,.simple-card,.about-copy,.tasawwuf-summary{content-visibility:auto;contain-intrinsic-size:1px 420px}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.entry-choice,.dash-card,.book-card{transition:none}.entry-choice:hover,.dash-card:hover,.book-card:hover{transform:none}}

/* KHALWATI HOME SEO LINKS */
.entry-seo-intro{
  max-width:680px;
  margin:8px auto 0;
  line-height:1.9;
}

.entry-seo-links{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px 14px;
  margin-top:18px;
  font-size:.92rem;
}

.entry-seo-links a{
  color:inherit;
  text-decoration:none;
  opacity:.84;
}

.entry-seo-links a:hover,
.entry-seo-links a:focus-visible{
  text-decoration:underline;
  opacity:1;
}

/* Arabic reading alignment across desktop and mobile */
html[dir="rtl"] body{direction:rtl;text-align:right}
html[dir="rtl"] :is(h1,h2,h3,h4,h5,h6,p){text-align:right;letter-spacing:normal}
html[dir="rtl"] :is(.section-head,.page-hero,.detail-meta,.dash-card,.app-feature,.community-card,.about-copy,.tasawwuf-summary){direction:rtl;text-align:right;min-width:0}
html[dir="rtl"] .section-head{width:100%;justify-content:space-between}
html[dir="rtl"] .section-head>div:first-child{margin-inline-end:auto;text-align:right}
html[dir="rtl"] :is(.book-card h3,.book-card .cat){text-align:right}
html[dir="rtl"] :is(.brand,.nav-links,.detail-actions,.footer-links){direction:rtl}
html[dir="rtl"] :is(.btn,.pill-btn,.filter){text-align:center}
html[dir="rtl"] :is(.dashboard-grid,.simple-grid,.books-grid)>*{min-width:0}
@media(max-width:700px){html[dir="rtl"] .section-head{align-items:flex-start;flex-wrap:wrap}html[dir="rtl"] .detail-meta{text-align:right}}


/* HOME COMPACT HERO 2026 */
.home-hero-compact{
  padding:18px 0 10px;
}
.compact-library-hero{
  background:linear-gradient(145deg,#fffdf8,#f8f1df);
  border:1px solid var(--line);
  border-radius:24px;
  padding:22px 24px;
  box-shadow:0 8px 24px rgba(60,45,20,.05);
}
.compact-library-copy{
  max-width:760px;
}
.compact-kicker{
  display:inline-flex;
  color:#9a7529;
  font-weight:700;
  margin-bottom:8px;
}
.compact-library-copy h1{
  margin:0 0 8px;
  font-size:clamp(1.8rem,4vw,2.8rem);
  line-height:1.12;
  color:var(--deep);
}
.compact-library-copy p{
  margin:0;
  color:var(--muted);
  font-size:1rem;
  max-width:680px;
}
.compact-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}
@media(max-width:600px){
  .home-hero-compact{
    padding:10px 0 6px;
  }
  .compact-library-hero{
    padding:16px 15px;
    border-radius:18px;
  }
  .compact-library-copy h1{
    font-size:1.55rem;
  }
  .compact-library-copy p{
    font-size:.95rem;
  }
  .compact-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .compact-actions .btn{
    width:100%;
    min-width:0;
  }
}

/* =========================================================
   KHALWATI HOME — ULTRA COMPACT HERO
   2026-09-27
   ========================================================= */

/* إخفاء البلوك القديم الكبير: أنوار اللآلئ السنية */
.home-hero-grid.single-feature{
    display:none !important;
}

/* الهيدر الجديد */
.home-hero-compact{
    padding:10px 0 6px !important;
}

.home-hero-compact .compact-library-hero{
    min-height:0 !important;
    padding:13px 18px !important;
    border-radius:18px !important;
    box-shadow:0 4px 14px rgba(60,45,20,.035) !important;
}

/* Desktop: كل المحتوى في شريط صغير */
.home-hero-compact .compact-library-copy{
    width:100% !important;
    max-width:none !important;

    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-rows:auto auto auto !important;

    column-gap:22px !important;
    row-gap:1px !important;
    align-items:center !important;
}

.home-hero-compact .compact-kicker{
    grid-column:1 !important;
    grid-row:1 !important;
    margin:0 0 1px !important;
    font-size:.72rem !important;
    line-height:1.2 !important;
}

.home-hero-compact .compact-library-copy h1{
    grid-column:1 !important;
    grid-row:2 !important;

    margin:0 !important;
    font-size:clamp(1.35rem,2.3vw,1.85rem) !important;
    line-height:1.15 !important;
}

.home-hero-compact .compact-library-copy p{
    grid-column:1 !important;
    grid-row:3 !important;

    margin:3px 0 0 !important;
    font-size:.82rem !important;
    line-height:1.45 !important;
}

.home-hero-compact .compact-actions{
    grid-column:2 !important;
    grid-row:1 / 4 !important;

    margin:0 !important;
    display:flex !important;
    gap:7px !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
}

.home-hero-compact .compact-actions .btn{
    height:44px !important;
    min-height:44px !important;
    padding:0 14px !important;
    border-radius:12px !important;
    font-size:.88rem !important;
    white-space:nowrap !important;
}

/* Tablet */
@media (max-width:900px){

    .home-hero-compact .compact-library-hero{
        padding:12px 14px !important;
    }

    .home-hero-compact .compact-library-copy{
        column-gap:12px !important;
    }

    .home-hero-compact .compact-library-copy h1{
        font-size:1.4rem !important;
    }

    .home-hero-compact .compact-library-copy p{
        font-size:.78rem !important;
    }
}

/* Mobile */
@media (max-width:600px){

    .home-hero-compact{
        padding:6px 0 4px !important;
    }

    .home-hero-compact .compact-library-hero{
        padding:11px 12px !important;
        border-radius:16px !important;
    }

    .home-hero-compact .compact-library-copy{
        display:block !important;
    }

    .home-hero-compact .compact-kicker{
        display:none !important;
    }

    .home-hero-compact .compact-library-copy h1{
        margin:0 !important;
        text-align:center !important;
        font-size:1.28rem !important;
        line-height:1.2 !important;
    }

    /* نخفي الشرح على الهاتف لتوفير المساحة */
    .home-hero-compact .compact-library-copy p{
        display:none !important;
    }

    .home-hero-compact .compact-actions{
        margin-top:9px !important;
        display:grid !important;
        grid-template-columns:1fr 1fr !important;
        gap:7px !important;
        width:100% !important;
    }

    .home-hero-compact .compact-actions .btn{
        width:100% !important;
        height:44px !important;
        min-height:44px !important;
        padding:0 8px !important;
        font-size:.82rem !important;
        border-radius:11px !important;
    }
}


/* =========================================================
   REMOVE OLD LARGE HOME HERO
   Keep only .home-hero-compact
   ========================================================= */

.home-hero:not(.home-hero-compact){
    display:none !important;
    height:0 !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
}

.home-hero-grid{
    display:none !important;
}

/* =========================================================
   KHALWATI HEADER CLEAN R2 — 2026-09-27
   Compact sticky header for desktop, tablet and phones.
   ========================================================= */
.site-header{
  position:sticky!important;
  top:0!important;
  z-index:60!important;
  padding:max(8px,env(safe-area-inset-top)) 0 0!important;
  background:linear-gradient(180deg,rgba(251,246,233,.98),rgba(251,246,233,.90))!important;
  border-bottom:0!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}
.site-header .header-inner,
.home-refined .site-header .header-inner{
  width:min(1180px,calc(100% - 28px))!important;
  height:64px!important;
  min-height:64px!important;
  margin:0 auto 8px!important;
  padding:0 12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  border:1px solid rgba(201,154,55,.28)!important;
  border-radius:18px!important;
  background:rgba(255,253,248,.95)!important;
  box-shadow:0 8px 24px rgba(56,41,10,.065)!important;
}
.site-header .brand{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-width:0!important;
  flex:0 1 auto!important;
}
.site-header .brand img,
.home-refined .site-header .brand img{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
  object-fit:contain!important;
}
.site-header .brand strong{
  color:var(--deep)!important;
  font-size:1rem!important;
  line-height:1.25!important;
  font-weight:800!important;
  white-space:nowrap!important;
}
.site-header .nav-links{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px!important;
  min-width:0;
}
.site-header .nav-links a{
  min-height:40px!important;
  display:inline-flex!important;
  align-items:center!important;
  padding:0 11px!important;
  border-radius:12px!important;
  color:#315247!important;
  font-size:.94rem!important;
  font-weight:700!important;
  transition:background-color .16s ease,color .16s ease!important;
}
.site-header .nav-links a:hover,
.site-header .nav-links a:focus-visible{
  background:#f2ecdc!important;
  color:var(--deep)!important;
}
.site-header .nav-links a[aria-current="page"]{
  background:#e8f1e9!important;
  color:var(--green)!important;
}
.site-header .header-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:7px!important;
  flex:0 0 auto!important;
}
.site-header .pill-btn,
.site-header .icon-btn,
.site-header select{
  height:40px!important;
  min-height:40px!important;
  border:1px solid #ded1b2!important;
  border-radius:12px!important;
  background:#fffdf8!important;
  color:var(--deep)!important;
  box-shadow:none!important;
}
.site-header .pill-btn{
  min-width:40px!important;
  padding:0 12px!important;
  gap:6px!important;
  font-size:.9rem!important;
  font-weight:700!important;
}
.site-header .icon-btn{
  width:40px!important;
  min-width:40px!important;
  padding:0!important;
}
.site-header select{
  max-width:138px!important;
  padding:0 10px!important;
  margin:0!important;
  font:700 .9rem/1 'Tajawal',system-ui,sans-serif!important;
}
.site-header .pill-btn:hover,
.site-header .icon-btn:hover,
.site-header select:hover{
  border-color:#c8ae72!important;
  background:#fffaf0!important;
}
@media(max-width:900px){
  .site-header{padding-top:max(6px,env(safe-area-inset-top))!important}
  .site-header .header-inner,
  .home-refined .site-header .header-inner{
    width:calc(100% - 20px)!important;
    height:60px!important;
    min-height:60px!important;
    margin-bottom:6px!important;
    padding:0 10px!important;
    border-radius:16px!important;
    gap:8px!important;
  }
  .site-header .nav-links{display:none!important}
  .site-header .mobile-menu{display:inline-flex!important}
  .site-header .brand img,
  .home-refined .site-header .brand img{
    width:36px!important;
    height:36px!important;
    flex-basis:36px!important;
  }
  .site-header .brand strong{font-size:.94rem!important}
}
@media(max-width:520px){
  .site-header .header-inner,
  .home-refined .site-header .header-inner{
    height:58px!important;
    min-height:58px!important;
    border-radius:15px!important;
  }
  .site-header .brand{gap:7px!important}
  .site-header .brand img,
  .home-refined .site-header .brand img{
    width:34px!important;
    height:34px!important;
    flex-basis:34px!important;
  }
  .site-header .brand strong{
    font-size:.88rem!important;
    max-width:175px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .site-header .pill-btn,
  .site-header .icon-btn,
  .site-header select{
    height:40px!important;
    min-height:40px!important;
  }
  .site-header .pill-btn{width:40px!important;padding:0!important}
  .site-header .pill-btn span{display:none!important}
  .site-header select{max-width:106px!important;font-size:.82rem!important}
}
@media(max-width:360px){
  .site-header .brand strong{max-width:145px!important;font-size:.83rem!important}
}
@media(prefers-reduced-motion:reduce){
  .site-header .nav-links a{transition:none!important}
}


/* Khalwati V61 — compact responsive library category cards */
.library-tools{align-items:stretch}.library-tools .filters{width:100%;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px!important;overflow:visible!important;padding:0!important}.library-tools .filter{min-width:0!important;min-height:54px!important;height:auto!important;padding:7px 12px!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;white-space:normal!important;text-align:right!important;line-height:1.25!important}.library-tools .kh-filter-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;font-weight:800}.library-tools .kh-filter-count{flex:0 0 auto;min-width:28px;height:28px;padding:0 7px;display:grid;place-items:center;border-radius:999px;background:#f3ecdc;color:#81601b;font-size:.7rem;font-weight:900}.library-tools .filter.active .kh-filter-count{background:rgba(255,255,255,.18);color:#fff}
@media(max-width:1100px){.library-tools .filters{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:850px){.library-tools .filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){.library-tools .filters{grid-template-columns:repeat(2,minmax(0,1fr))}.library-tools .filter{min-height:52px!important;padding:7px 10px!important}.library-tools .kh-filter-label{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:.86rem}.library-tools .kh-filter-count{min-width:26px;height:26px;font-size:.68rem}}
@media(max-width:360px){.library-tools .filters{grid-template-columns:1fr}.library-tools .filter{min-height:48px!important}}

/* Khalwati V68 — distinguish same-title editions without changing book data */
.kh-card-edition{margin-top:6px;color:#7a642d;font-size:.78rem;font-weight:800;line-height:1.5}
.kh-card-edition[hidden]{display:none!important}

/* Khalwati Website 04 — design-system, accessibility and performance polish */
:root{
  --kh-space-1:4px;--kh-space-2:8px;--kh-space-3:12px;--kh-space-4:16px;--kh-space-5:24px;--kh-space-6:32px;
  --kh-radius-sm:12px;--kh-radius-md:18px;--kh-radius-lg:26px;
  --kh-touch:48px;--kh-focus:0 0 0 3px rgba(201,154,55,.32);
  --kh-surface:var(--paper);--kh-primary:var(--green);--kh-primary-dark:var(--deep);--kh-accent:var(--gold);
}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--gold);outline-offset:3px;box-shadow:var(--kh-focus)}
:where(.icon-btn,.pill-btn,.filter,.btn,.back-site-btn){min-height:var(--kh-touch)}
:where(.icon-btn){min-width:var(--kh-touch)}
:where(.book-card,.dash-card,.simple-card){contain:layout style paint}
@media(max-width:700px){
  .container{width:min(100% - 24px,1180px)}
  :where(.btn,.pill-btn,.filter,.back-site-btn){min-height:48px}
  .books-grid{gap:12px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* /khalwati-public-assets/app-site.css */
[hidden]{display:none!important}
/* Khalwatiya app and community sections, 2026 */
.app-strip{padding:28px 0 10px}.app-strip-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:22px;padding:25px 30px;background:linear-gradient(125deg,#064731,#0a6446);color:#fff;border:1px solid #b99a55;border-radius:26px;box-shadow:var(--shadow)}.app-strip-copy{display:flex;align-items:center;gap:20px}.app-strip-icon{width:86px;height:86px;object-fit:contain;flex:none}.app-strip h2{margin:0 0 5px;font-size:1.65rem;line-height:1.3}.app-strip p{margin:0;color:#e1eee6}.app-strip-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.app-strip .btn,.app-cta .btn{min-height:48px;height:auto;text-align:center}.store-soon{display:inline-flex;align-items:center;justify-content:center;padding:10px 17px;min-height:48px;border:1px solid rgba(255,255,255,.5);border-radius:15px;color:#e5eee9;font-weight:700}.app-strip .btn.gold{border-color:#e7bd60}.app-strip .btn.outline{background:transparent;color:white;border-color:rgba(255,255,255,.58)}
.app-page{padding-bottom:65px}.app-hero{display:grid;grid-template-columns:1fr 215px;gap:26px;align-items:center;padding:42px 0 25px}.app-hero h1{font-size:clamp(2.2rem,4.6vw,3.7rem);line-height:1.15;margin:10px 0 12px}.app-hero p{font-size:1.12rem;color:var(--muted);max-width:710px;margin:0}.app-eyebrow{color:#9d7421;font-weight:800}.app-hero-logo{width:100%;max-width:215px;filter:drop-shadow(0 15px 25px rgba(3,60,42,.2))}.app-downloads{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:23px}.app-downloads .store-soon{color:var(--green);border-color:var(--line);background:var(--paper)}.app-photo{width:100%;height:auto;border-radius:25px;box-shadow:0 18px 50px rgba(23,55,43,.13);border:1px solid var(--line)}.app-feature-title{font-size:1.95rem;margin:34px 0 13px}.app-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.app-feature{background:var(--paper);border:1px solid var(--line);border-radius:19px;padding:20px;min-height:142px}.app-feature h3{font-size:1.11rem;margin:0 0 7px}.app-feature p{color:var(--muted);margin:0;font-size:.98rem}.app-more{display:flex;align-items:center;justify-content:space-between;gap:20px;background:#e8f1e9;border-radius:20px;padding:23px 28px;margin-top:24px}.app-more h2{margin:0 0 5px;font-size:1.4rem}.app-more p{margin:0;color:var(--muted)}
.community-page{padding-bottom:55px}.community-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.community-card{display:flex;flex-direction:column;gap:7px;min-height:160px;background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:24px;transition:transform .18s,box-shadow .18s}.community-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.community-card strong{font-size:1.25rem}.community-card span{color:var(--muted)}.community-card em{font-style:normal;font-weight:800;color:var(--green);margin-top:auto}.about-map{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#e8f1e9;border:1px solid #d8e4d9;border-radius:22px;padding:23px 28px;margin-top:18px}.about-map h2{margin:0 0 4px;font-size:1.35rem}.about-map p{margin:0;color:var(--muted)}
.entry-app-cta{display:flex;align-items:center;justify-content:center;gap:9px;margin:18px auto 0;flex-wrap:wrap}.entry-app-cta a{font-weight:800;color:var(--green);text-decoration:underline;text-underline-offset:4px}.entry-app-cta img{width:30px;height:30px}.entry-app-cta span{color:var(--muted);font-size:.9rem}
a:focus-visible{outline:3px solid #dca62d;outline-offset:3px}
@media(max-width:900px){.app-strip-inner{grid-template-columns:1fr}.app-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.app-hero{grid-template-columns:1fr 96px;gap:12px;padding-top:30px}.app-hero-logo{width:96px}.app-hero h1{font-size:2.25rem}.app-hero p{font-size:1rem}.community-grid{grid-template-columns:1fr}.app-more,.about-map{align-items:flex-start;flex-direction:column}.app-strip-inner{padding:20px}.app-strip-icon{width:65px;height:65px}.app-strip h2{font-size:1.35rem}}
@media(max-width:440px){.app-strip-copy{align-items:flex-start;gap:11px}.app-strip-icon{width:50px;height:50px}.app-strip-actions,.app-downloads{display:grid;grid-template-columns:1fr;width:100%}.app-strip-actions>* ,.app-downloads>*{width:100%}.app-hero{grid-template-columns:1fr}.app-hero-logo{grid-row:1}.app-feature-grid{grid-template-columns:1fr}.app-feature{min-height:0}.app-photo{border-radius:16px}}
@media(prefers-reduced-motion:reduce){.community-card{transition:none}}
.app-showcase{padding:18px 0 28px}.app-showcase-inner{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);gap:28px;align-items:center}.app-showcase-art{display:block;width:100%;height:auto;aspect-ratio:1794/876;object-fit:cover;border-radius:23px;border:1px solid var(--line);box-shadow:0 15px 40px rgba(7,64,43,.12)}.app-showcase-copy h2{font-size:clamp(1.6rem,3vw,2.35rem);line-height:1.25;margin:7px 0 12px}.app-showcase-copy p{color:var(--muted);line-height:1.85;margin:0 0 16px}.app-showcase-points{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px;padding:0;list-style:none}.app-showcase-points li{border:1px solid #d9e8dc;background:#eff6f0;border-radius:99px;padding:6px 13px;color:var(--green);font-weight:700;font-size:.91rem}.app-showcase-actions{display:flex;gap:9px;flex-wrap:wrap}.app-showcase-actions .btn{height:auto;min-height:47px;text-align:center}
.community-home{padding:0 0 25px}.community-home-head{margin:0 0 13px;font-size:1.55rem}.community-card .channel-icon{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:#e9f3ec;color:#075b3e;margin-bottom:6px}.channel-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.community-card.youtube .channel-icon{background:#fff0ef;color:#c5221f}.community-card.facebook .channel-icon{background:#eef3ff;color:#2462a6}.community-card:hover .channel-icon{transform:scale(1.05)}
@media(max-width:850px){.app-showcase-inner{grid-template-columns:1fr}.app-showcase-art{max-width:760px}}
@media(max-width:440px){.app-showcase-actions{display:grid}.app-showcase-art{border-radius:16px}}

/* Simplified homepage app section */
.home-refined .site-header{background:#fbf6e9;border-bottom:1px solid #e6dcc8}
.home-refined .header-inner{min-height:86px;gap:22px}
.home-refined .brand img{width:46px;height:46px;object-fit:contain}
.home-refined .nav-links a{padding:10px 12px;border-radius:12px}
.home-refined .nav-links a[aria-current="page"]{background:#e6eee5;color:#075b3e}
.app-simple{padding:12px 0 30px}
.app-simple-card{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);align-items:center;gap:30px;padding:30px;border-radius:26px;background:linear-gradient(120deg,#063c2c,#0b5e43);border:1px solid #b69c61;color:#fff;box-shadow:0 12px 30px #123c2710}
.app-simple-logo{object-fit:contain;width:64px;height:64px;margin-bottom:12px}
.app-simple-copy h2{color:#fff;font-size:clamp(1.5rem,2.5vw,2rem);line-height:1.45;margin:0 0 8px}
.app-simple-copy p{color:#dbe9df;line-height:1.7;margin:0 0 22px;font-size:1.05rem}
.app-simple-actions{display:flex;align-items:center;flex-wrap:wrap;gap:22px}
.app-simple-actions .btn{height:auto;min-height:48px;padding:12px 24px}
.app-simple-more{color:#fff;font-weight:700;text-underline-offset:5px}
.app-simple-more:hover{text-decoration:underline}
.app-simple-copy small{display:block;color:#c6d9cc;margin-top:14px;font-size:.83rem}
.app-simple-image{display:block;min-width:0}
.app-simple-image img{display:block;width:100%;height:auto;border-radius:17px;border:1px solid #ffffff30}
@media(max-width:760px){.app-simple-card{grid-template-columns:1fr;padding:22px;gap:24px}.app-simple-copy{text-align:center}.app-simple-logo{margin:0 auto 10px}.app-simple-actions{justify-content:center}.home-refined .header-inner{min-height:74px;gap:12px}.home-refined .brand img{width:38px;height:38px}}

/* Featured book and compact community links */
.book-spotlight{padding:28px 0 20px}
.book-spotlight-card{display:flex;align-items:center;justify-content:space-between;gap:30px;padding:32px 44px;background:linear-gradient(120deg,#f1ead6,#fffdf6 70%);border:1px solid #dfd3b5;border-radius:26px;overflow:hidden}
.book-spotlight-copy{min-width:0}.book-spotlight-label{color:#907024;font-weight:700;font-size:.88rem}
.book-spotlight-copy h1{color:#154733;font-size:clamp(1.9rem,3.5vw,3rem);line-height:1.4;margin:8px 0}
.book-spotlight-copy p{color:#667162;margin:0 0 22px;line-height:1.7}
.book-spotlight-actions{display:flex;align-items:center;flex-wrap:wrap;gap:24px}
.book-spotlight-actions .btn{height:auto;min-height:48px;gap:10px;padding:12px 23px}
.book-spotlight-actions svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.book-details-link{font-weight:700;color:#28543d}.book-details-link:hover{text-decoration:underline;text-underline-offset:5px}
.book-spotlight-cover{flex:none;display:block;width:145px;transform:rotate(-4deg);margin:0 22px}
.book-spotlight-cover img{display:block;width:100%;height:auto;max-height:200px;object-fit:contain;border-radius:5px;filter:drop-shadow(8px 12px 9px #23382130)}
.home-refined .community-home-head{font-size:1.2rem;margin-bottom:12px}
.home-refined .community-home .community-card{display:flex;flex-direction:row;align-items:center;min-height:88px;gap:14px;padding:18px;border-radius:18px}
.home-refined .community-home .community-card strong{font-size:1.05rem}
.home-refined .community-home .channel-icon{width:44px;height:44px;margin:0;flex:none;border-radius:13px}
.home-refined .community-home .channel-arrow{margin-inline-start:auto;color:#78917f;font-size:1.2rem}
@media(max-width:700px){.book-spotlight-card{padding:24px;gap:20px}.book-spotlight-cover{width:100px;margin:0}.book-spotlight-copy h1{font-size:1.85rem}.book-spotlight-copy p{font-size:.95rem}.book-spotlight-actions{gap:14px}.home-refined .community-home .community-grid{grid-template-columns:1fr}}
@media(max-width:440px){.book-spotlight-card{flex-direction:column-reverse;text-align:center}.book-spotlight-cover{width:105px}.book-spotlight-actions{justify-content:center}.book-spotlight-copy h1{font-size:1.8rem}}

/* Balanced section navigation */
.home-refined .dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.home-refined .dash-card{display:flex;flex-direction:row;align-items:center;gap:16px;padding:22px;min-height:112px;border-radius:20px;text-align:right;transition:transform .18s,box-shadow .18s}
.home-refined .dash-card .dash-icon{width:52px;height:52px;flex:none;margin:0;border-radius:16px;display:grid;place-items:center}
.home-refined .dash-card h3{margin:0 0 6px;font-size:1.08rem;line-height:1.5}
.home-refined .dash-card p{margin:0;font-size:.88rem;line-height:1.65}
.home-refined .dash-card:hover{transform:translateY(-3px);box-shadow:0 9px 22px #143d2510}
.home-refined .dashboard-grid .dash-card:nth-child(3) .dash-icon{background:#f1ecfa;color:#74568c}
.home-refined .dashboard-grid .dash-card:nth-child(5) .dash-icon{background:#e8f1fa;color:#326589}
@media(max-width:850px){.home-refined .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.home-refined .dash-card{padding:16px;flex-direction:column;align-items:flex-start;gap:12px;min-height:160px}.home-refined .dash-card h3{font-size:1rem}.home-refined .dash-card .dash-icon{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.home-refined .dash-card{transition:none}.home-refined .dash-card:hover{transform:none}}

/* Preserve right alignment at every responsive breakpoint */
html[dir="rtl"] :is(.app-simple-copy,.book-spotlight-copy,.community-home-head,.app-showcase-copy){text-align:right;direction:rtl}
html[dir="rtl"] :is(.app-simple-actions,.book-spotlight-actions){justify-content:flex-start}
html[dir="rtl"] .app-simple-logo{margin-inline-start:0;margin-inline-end:auto}
html[dir="rtl"] .book-spotlight-card{align-items:center}
@media(max-width:440px){html[dir="rtl"] .book-spotlight-copy{width:100%}html[dir="rtl"] .book-spotlight-cover{align-self:flex-start}}

/* Section card content starts beside the icon in RTL */
.home-refined .dashboard-grid{direction:rtl}
.home-refined .dashboard-grid .dash-card{direction:rtl;justify-content:flex-start;text-align:right}
.home-refined .dashboard-grid .dash-card>div:last-child{flex:1;min-width:0;text-align:right}
.home-refined .dashboard-grid .dash-card :is(h3,p){text-align:right;margin-inline:0}
.home-refined .dashboard-grid .dash-card .dash-icon{order:0}
@media(max-width:520px){.home-refined .dashboard-grid .dash-card{align-items:flex-start}.home-refined .dashboard-grid .dash-card>div:last-child{flex:none;width:100%}}

/* Landing card is centered; the rest of the Arabic site stays right-aligned. */
html[dir="rtl"] .entry-page .entry-card{text-align:center}
html[dir="rtl"] .entry-page .entry-card :is(.entry-brand,.entry-welcome,.entry-seo-intro,.entry-choice-title,.entry-note,.entry-app-cta,.entry-seo-links){text-align:center}
html[dir="rtl"] .entry-page .entry-card :is(h1,h2,p){text-align:center}
html[dir="rtl"] .entry-page .entry-card .entry-choice{text-align:center}
html[dir="rtl"] .entry-page .entry-card .entry-choice :is(strong,small){text-align:center}

/* Compact featured content on narrow screens; Arabic text remains right aligned. */
@media(max-width:700px){
  .book-spotlight-card{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;column-gap:14px;row-gap:8px;padding:18px;text-align:right}
  .book-spotlight-copy{display:contents}
  .book-spotlight-cover,html[dir="rtl"] .book-spotlight-cover{grid-column:1;grid-row:1 / span 2;width:72px;margin:0;align-self:center}
  .book-spotlight-label{grid-column:2;grid-row:1;align-self:end}
  .book-spotlight-copy h1{grid-column:2;grid-row:2;align-self:start;font-size:clamp(1.28rem,5.3vw,1.75rem);line-height:1.3;margin:0}
  .book-spotlight-copy p{grid-column:1 / -1;grid-row:3;margin:6px 0 0;font-size:.92rem}
  .book-spotlight-actions{grid-column:1 / -1;grid-row:4;margin-top:4px}
  .book-spotlight-actions .btn{min-height:44px;padding:9px 16px}
  .app-simple-card{display:grid;grid-template-columns:52px minmax(0,1fr);column-gap:12px;row-gap:10px;padding:18px}
  .app-simple-copy{display:contents}
  .app-simple-logo,html[dir="rtl"] .app-simple-logo{grid-column:1;grid-row:1;width:52px;height:52px;margin:0}
  .app-simple-copy h2{grid-column:2;grid-row:1;align-self:center;margin:0;font-size:clamp(1.18rem,5vw,1.65rem);line-height:1.32;text-align:right}
  .app-simple-copy p{grid-column:1 / -1;grid-row:2;margin:0;font-size:.94rem;text-align:right}
  .app-simple-actions{grid-column:1 / -1;grid-row:3;gap:12px;justify-content:flex-start}
  .app-simple-actions .btn{min-height:44px;padding:9px 16px}
  .app-simple-image{grid-column:1 / -1;grid-row:4}
  .app-simple-image img{max-height:165px;object-fit:cover;object-position:center top}
}
@media(max-width:380px){.book-spotlight-card,.app-simple-card{padding:15px}.app-simple-actions{gap:10px}.app-simple-more{font-size:.9rem}}
/* Keep the application icon square on the app detail page. */
@media(max-width:440px){.app-hero-logo{width:96px;height:96px;object-fit:contain;grid-row:1}.app-hero{align-items:start}}

/* /khalwati-public-assets/site-shell-r5.css */
/* =========================================================
   KHALWATI SITE SHELL R5 — 2026-09-27
   Unified identity, no-flash library, Safari-safe controls.
   One public header/footer across the whole website.
   ========================================================= */
:root{--kh-shell-bg:#fbf6e9;--kh-shell-card:#fffdf8;--kh-shell-deep:#073f34;--kh-shell-green:#0a684e;--kh-shell-line:rgba(190,151,67,.28)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-height:100vh;display:flex;flex-direction:column}
body>main{flex:1 0 auto;min-width:0}
.site-header{position:sticky!important;top:0!important;z-index:70!important;padding:max(7px,env(safe-area-inset-top)) 0 0!important;background:linear-gradient(180deg,rgba(251,246,233,.985),rgba(251,246,233,.925))!important;border:0!important;-webkit-backdrop-filter:blur(16px)!important;backdrop-filter:blur(16px)!important}
.site-header .header-inner,.home-refined .site-header .header-inner{width:min(1240px,calc(100% - 28px))!important;height:64px!important;min-height:64px!important;margin:0 auto 7px!important;padding:0 13px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;border:1px solid var(--kh-shell-line)!important;border-radius:18px!important;background:rgba(255,253,248,.965)!important;box-shadow:0 8px 24px rgba(56,41,10,.055)!important}
.site-header .kh-brand,.site-header .brand{display:inline-flex!important;align-items:center!important;gap:9px!important;min-width:0!important;flex:0 1 auto!important;color:var(--kh-shell-deep)!important;text-decoration:none!important}
.site-header .kh-brand-mark{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center}
.site-header .kh-brand img,.site-header .brand img,.home-refined .site-header .brand img{width:40px!important;height:40px!important;display:block!important;object-fit:contain!important;flex:0 0 40px!important}
.site-header .kh-brand-copy{display:flex;align-items:center;min-width:0}
.site-header .kh-brand-copy strong,.site-header .brand strong{margin:0!important;color:var(--kh-shell-deep)!important;font-size:.96rem!important;line-height:1.35!important;font-weight:800!important;white-space:nowrap!important}
.site-header .kh-brand-copy small{display:none!important}
.site-header .nav-links,.home-refined .site-header .nav-links{display:flex!important;flex:1 1 auto!important;align-items:center!important;justify-content:center!important;gap:1px!important;min-width:0!important}
.site-header .nav-links a,.home-refined .site-header .nav-links a{min-height:40px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0 9px!important;border-radius:11px!important;color:#315247!important;font-size:.84rem!important;font-weight:750!important;line-height:1.25!important;white-space:nowrap!important;text-decoration:none!important;transition:background-color .16s ease,color .16s ease!important}
.site-header .nav-links a:hover,.site-header .nav-links a:focus-visible{background:#f2ecdc!important;color:var(--kh-shell-deep)!important}
.site-header .nav-links a[aria-current="page"]{background:#e8f1e9!important;color:var(--kh-shell-green)!important}
.site-header .header-actions,.home-refined .site-header .header-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:7px!important;flex:0 0 auto!important}
.site-header .icon-btn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;border:1px solid #ded1b2!important;border-radius:12px!important;background:#fffdf8!important;color:var(--kh-shell-deep)!important;box-shadow:none!important}
.site-header .mobile-menu{display:none!important}
.site-header .mobile-menu svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}

/* Shared footer */
.site-footer{flex:0 0 auto!important;margin-top:28px!important;padding:18px 0 max(18px,env(safe-area-inset-bottom))!important;border-top:1px solid rgba(201,154,55,.22)!important;background:rgba(255,253,248,.72)!important;color:#66766f!important}
.site-footer .footer-inner{width:min(1240px,calc(100% - 28px))!important;min-height:48px!important;margin:0 auto!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;align-items:center!important;gap:20px!important}
.footer-brand{display:inline-flex;align-items:center;gap:9px;min-width:0;color:var(--kh-shell-deep)!important;font-weight:800;text-decoration:none!important}
.footer-brand img{width:34px;height:34px;object-fit:contain;flex:0 0 34px}
.footer-brand span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.site-footer .footer-links{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;flex-wrap:wrap!important;margin:0!important}
.site-footer .footer-links a{padding:7px 9px;border-radius:9px;color:#48675d!important;font-weight:700;text-decoration:none!important}
.site-footer .footer-links a:hover,.site-footer .footer-links a:focus-visible{background:#f2ecdc;color:var(--kh-shell-deep)!important}
.footer-copy{white-space:nowrap;color:#877c68;font-size:.82rem}

/* Privacy page keeps its readable content width while shell stays full-width. */
.privacy-content{width:min(900px,calc(100% - 32px))!important;margin:0 auto!important}

@media(max-width:1100px){
  .site-header .nav-links,.home-refined .site-header .nav-links{display:none!important}
  .site-header .mobile-menu,.home-refined .site-header .mobile-menu{display:inline-flex!important}
}
@media(max-width:700px){
  .site-header{padding-top:max(5px,env(safe-area-inset-top))!important}
  .site-header .header-inner,.home-refined .site-header .header-inner{width:calc(100% - 18px)!important;height:58px!important;min-height:58px!important;margin-bottom:6px!important;padding:0 10px!important;border-radius:15px!important;gap:8px!important}
  .site-header .kh-brand-mark{width:34px;height:34px;flex-basis:34px}
  .site-header .kh-brand img,.site-header .brand img,.home-refined .site-header .brand img{width:34px!important;height:34px!important;flex-basis:34px!important}
  .site-header .kh-brand-copy strong,.site-header .brand strong{max-width:min(66vw,270px)!important;font-size:.88rem!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .site-header .icon-btn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
  .site-footer{margin-top:22px!important;padding-top:16px!important}
  .site-footer .footer-inner{width:calc(100% - 24px)!important;grid-template-columns:1fr!important;justify-items:center!important;gap:8px!important;text-align:center!important}
  .footer-brand{max-width:100%;justify-content:center}
  .site-footer .footer-links{gap:1px!important}
  .site-footer .footer-links a{padding:7px 6px;font-size:.82rem}
}
@media(max-width:390px){
  .site-header .kh-brand-copy strong,.site-header .brand strong{max-width:220px!important;font-size:.83rem!important}
  .footer-brand span{font-size:.87rem}
}
@media(prefers-reduced-motion:reduce){.site-header .nav-links a{transition:none!important}}

/* Library preference card is present in HTML before async sync, so there is no layout flash. */
.kh-lib-pref{width:100%;min-height:74px;box-sizing:border-box;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;margin:14px 0 18px;padding:12px 15px;border:1px solid rgba(194,153,67,.34);border-radius:18px;background:linear-gradient(180deg,#fffdf9 0%,#fcf8ee 100%);box-shadow:0 7px 20px rgba(44,65,53,.045);color:#173f34;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(7,88,61,.08)}
.kh-lib-pref-input{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important}
.kh-lib-pref-icon{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:13px;background:#f5ecd5;color:#9a7019;flex:0 0 44px}.kh-lib-pref-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.kh-lib-pref-copy{min-width:0;display:block;text-align:right;direction:rtl}.kh-lib-pref-copy strong{display:block;margin:0 0 2px;color:#123d31;font-size:.98rem;line-height:1.45;font-weight:800}.kh-lib-pref-copy small{display:block;color:#817965;font-size:.79rem;line-height:1.55}
.kh-lib-switch{position:relative;width:48px;height:28px;display:inline-block;flex:0 0 48px;border-radius:999px;background:#d8d2c4;box-shadow:inset 0 0 0 1px rgba(39,63,52,.08);transition:background-color .16s ease}.kh-lib-switch::after{content:"";position:absolute;top:4px;left:4px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 2px 7px rgba(31,52,42,.22);transition:transform .16s ease}.kh-lib-pref-input:checked~.kh-lib-switch{background:#0b6a4c}.kh-lib-pref-input:checked~.kh-lib-switch::after{transform:translateX(20px)}.kh-lib-pref-input:focus-visible~.kh-lib-switch{outline:3px solid rgba(18,112,78,.20);outline-offset:3px}
@media(max-width:600px){.kh-lib-pref{min-height:68px;grid-template-columns:40px minmax(0,1fr) 46px;gap:10px;margin:10px 0 14px;padding:11px 12px;border-radius:16px}.kh-lib-pref-icon{width:40px;height:40px;flex-basis:40px;border-radius:12px}.kh-lib-pref-copy strong{font-size:.92rem}.kh-lib-pref-copy small{font-size:.74rem}.kh-lib-switch{width:46px;height:27px;flex-basis:46px}.kh-lib-switch::after{width:19px;height:19px}.kh-lib-pref-input:checked~.kh-lib-switch::after{transform:translateX(19px)}}
@media(prefers-reduced-motion:reduce){.kh-lib-switch,.kh-lib-switch::after{transition:none}}

/* Static styles used by library-auto-sync: no style injection after first paint. */
.kh-cover-placeholder{width:100%;height:100%;min-height:220px;display:grid;place-items:center;text-align:center;padding:16px;background:#f5edd9;color:#074a3e;font-weight:800;border-radius:inherit}
.books-grid[data-khalwati-live="1"] .book-card{cursor:pointer}
.library-tools.kh-filters-only{justify-content:center}

/* R6 Audio navigation */
.site-header .kh-audio-link>span,.drawer .kh-audio-link>span{display:inline-block;margin-inline-end:4px;font-size:.92em;line-height:1;color:#a87717}


/* R6c: dynamic library first-paint guard. */
.books-grid:not([data-khalwati-live]){position:relative;min-height:240px}
.books-grid:not([data-khalwati-live])>.book-card{opacity:0;visibility:hidden;pointer-events:none}
.books-grid:not([data-khalwati-live])::before{content:"جاري تحديث المكتبة…";position:absolute;inset:18px 0 auto;min-height:118px;display:grid;place-items:center;border:1px solid #ead8aa;border-radius:18px;background:linear-gradient(100deg,#fffdf8 30%,#f7efd9 50%,#fffdf8 70%);background-size:220% 100%;color:#0a5b48;font-weight:800;animation:khLibraryLoading 1.25s linear infinite;z-index:2}
.books-grid[data-khalwati-live]::before{display:none}
.book-cover-wrap{position:relative;overflow:hidden;background:#f4efe4}
.book-cover-wrap.kh-cover-loading::after{content:"";position:absolute;inset:0;background:linear-gradient(105deg,#f2ead8 25%,#fffaf0 45%,#f2ead8 65%);background-size:220% 100%;animation:khLibraryLoading 1.15s linear infinite}
.book-cover-wrap img.kh-cover-img-loading{opacity:0}
.book-cover-wrap img{transition:opacity .16s ease}
@keyframes khLibraryLoading{to{background-position:-220% 0}}
@media (prefers-reduced-motion:reduce){.books-grid:not([data-khalwati-live])::before,.book-cover-wrap.kh-cover-loading::after{animation:none}}
@media(max-width:640px){.books-grid:not([data-khalwati-live]){min-height:190px}.books-grid:not([data-khalwati-live])::before{min-height:96px;font-size:.92rem}}

/* R7 book metadata cards */
.book-card .kh-card-subtitle{margin:2px 0 4px;color:#786f60;font-size:.84rem;line-height:1.55;text-align:center;min-height:0}
.book-card .kh-card-author{margin:1px 0 5px;color:#31584d;font-size:.8rem;line-height:1.5;font-weight:700;text-align:center}
.book-card .kh-card-subtitle[hidden],.book-card .kh-card-author[hidden]{display:none!important}
@media(max-width:600px){.book-card .kh-card-subtitle{font-size:.76rem}.book-card .kh-card-author{font-size:.74rem}}

/* Khalwati Responsive V38.1 — desktop/tablet/mobile/touch */
html{max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%}
body{max-width:100%;overflow-x:hidden;overscroll-behavior-x:none}
*,*::before,*::after{box-sizing:border-box}
img,video,iframe,canvas,svg{max-width:100%}
:where(a,button,input,select,textarea,[role="button"]){touch-action:manipulation}
:where(button,.button,.icon-btn,.filter,.book-card,a){-webkit-tap-highlight-color:rgba(7,81,63,.10)}
:where(button,.button,.icon-btn,.filter){min-height:44px}
:where(input,select,textarea){max-width:100%}

/* Avoid rendering large off-screen collections until they approach the viewport. */
.books-grid>.book-card,.library-grid>.book-card,.section-grid>*{content-visibility:auto;contain-intrinsic-size:320px}

/* Mobile drawer: stable fixed layer, touch safe, no page scroll behind it. */
.drawer{position:fixed!important;inset:0!important;z-index:1000!important;pointer-events:none!important;visibility:hidden!important}
.drawer.open{pointer-events:auto!important;visibility:visible!important}
.drawer .drawer-backdrop{position:absolute!important;inset:0!important;background:rgba(11,33,27,.42)!important;opacity:0!important;transition:opacity .18s ease!important}
.drawer.open .drawer-backdrop{opacity:1!important}
.drawer .drawer-panel{position:absolute!important;top:0!important;bottom:0!important;inset-inline-end:0!important;width:min(88vw,360px)!important;max-width:100%!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;transform:translateX(105%)!important;transition:transform .2s ease!important;padding-bottom:max(20px,env(safe-area-inset-bottom))!important}
[dir="rtl"] .drawer .drawer-panel{transform:translateX(-105%)!important}
.drawer.open .drawer-panel{transform:translateX(0)!important}
body.kh-drawer-open{overflow:hidden!important;touch-action:none!important}
.drawer .drawer-panel nav a{min-height:48px!important;display:flex!important;align-items:center!important}

/* Keep long content and forms within viewport. */
.container,.library-shell,.page-hero,main,section,article{min-width:0;max-width:100%}
pre,code{max-width:100%;overflow-wrap:anywhere}

@media(max-width:900px){
  .container{width:min(100% - 24px,1240px)!important}
  .site-header .header-inner{width:calc(100% - 20px)!important}
  .books-grid{gap:14px!important}
}
@media(max-width:600px){
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}
  .container{width:calc(100% - 20px)!important}
  .page-hero{padding-inline:4px!important}
  .books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .book-card{min-width:0!important;padding:10px!important}
  .book-card h3{overflow-wrap:anywhere!important}
  .library-tools,.filters{max-width:100%!important;overflow-x:auto!important;overscroll-behavior-inline:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin}
  .filters{flex-wrap:nowrap!important;justify-content:flex-start!important;padding-bottom:4px!important}
  .filter{flex:0 0 auto!important;white-space:nowrap!important}
}
@media(max-width:360px){
  .books-grid{grid-template-columns:1fr!important}
  .site-header .kh-brand-copy strong,.site-header .brand strong{max-width:180px!important}
}
@media(hover:none) and (pointer:coarse){
  :where(a,button,.button,.icon-btn,.filter){min-height:44px}
}
@media(prefers-reduced-motion:reduce){
  .drawer .drawer-backdrop,.drawer .drawer-panel{transition:none!important}
}

/* V38.1 — centered book-card copy + large category/sheikh collections */
.book-card{text-align:center!important;align-items:center!important}
.book-card h3,.book-card .cat,.book-card .open,.book-card .kh-card-subtitle,.book-card .kh-card-author{width:100%;text-align:center!important;margin-inline:auto!important}
.book-card h3{display:flex;align-items:center;justify-content:center;min-height:2.9em;line-height:1.45}
.book-card .cat{display:flex;align-items:center;justify-content:center;min-height:1.6em}
.book-card .open{display:flex;align-items:center;justify-content:center;margin-top:auto!important;min-height:44px}
.kh-category-status{margin:10px auto 18px;padding:10px 16px;width:max-content;max-width:100%;border:1px solid #ead8aa;border-radius:999px;background:#fffaf0;color:#07513f;font-weight:800;text-align:center}
.kh-category-status[hidden]{display:none!important}
.books-grid .book-card[hidden]{display:none!important}
@media(max-width:600px){.book-card h3{min-height:3.1em}.kh-category-status{width:100%;border-radius:14px}}

/* Khalwati Responsive V50 — category-only library books + optional Home visibility */


/* Khalwati Library V50 — scalable sheikh/category browsing */
.kh-library-search{display:block;width:min(680px,100%);margin:0 auto 14px}.kh-library-search input{width:100%;min-height:48px;border:1px solid #d9c58f;border-radius:16px;background:#fffefb;padding:10px 16px;font:inherit;font-size:16px;color:inherit;outline:none}.kh-library-search input:focus{border-color:#a77a22;box-shadow:0 0 0 3px rgba(167,122,34,.12)}.library-tools.kh-filters-only{overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:6px}.library-tools .filters{display:flex;flex-wrap:nowrap;min-width:max-content}.library-tools .filter{white-space:nowrap;min-height:44px}.books-grid{align-items:stretch}.book-card{height:100%}.book-card .book-cover-wrap{margin-inline:auto}@media(max-width:600px){.kh-library-search{margin-bottom:10px}.library-tools.kh-filters-only{margin-inline:-4px;padding-inline:4px}}


/* Khalwati Library V50 — no horizontal category bars, responsive category cards */
.library-page-ui3{overflow-x:hidden}
.library-shell,.library-shell .container{min-width:0;max-width:100%}
.library-tools.kh-filters-only{width:100%!important;max-width:100%!important;overflow:visible!important;overscroll-behavior:auto!important;padding:0!important;margin:0 auto 18px!important}
.library-tools.kh-filters-only .filters{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important;gap:10px!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow:visible!important;padding:0!important;justify-content:stretch!important}
.library-tools.kh-filters-only .filter{min-width:0!important;width:100%!important;min-height:64px!important;white-space:normal!important;border-radius:16px!important;padding:10px 12px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;text-align:center!important;line-height:1.35!important}
.library-tools.kh-filters-only .filter .kh-filter-label{display:block;width:100%;font-weight:800;overflow-wrap:anywhere}
.library-tools.kh-filters-only .filter .kh-filter-count{display:block;font-size:.78rem;font-weight:600;opacity:.72}
.library-tools.kh-filters-only .filter.active{box-shadow:0 0 0 2px rgba(167,122,34,.10) inset}
.kh-library-search{width:min(760px,100%)!important;margin:0 auto 16px!important}
.kh-library-search input{min-height:52px!important;border-radius:18px!important;padding-inline:18px!important}
.kh-category-status{display:grid!important;grid-template-columns:1fr auto!important;grid-template-areas:'name back' 'count back';align-items:center!important;gap:2px 12px!important;width:min(760px,100%)!important;max-width:100%!important;margin:0 auto 20px!important;border-radius:18px!important;padding:12px 14px!important;text-align:right!important}
.kh-category-status-name{grid-area:name;font-size:1rem}
.kh-category-status-count{grid-area:count;color:#786f60;font-size:.82rem;font-weight:700}
.kh-category-status-back{grid-area:back;min-height:42px;border:1px solid #d9c58f;border-radius:12px;background:#fffefb;color:#07513f;padding:7px 12px;font:inherit;font-weight:800;cursor:pointer}
.kh-category-status[hidden]{display:none!important}
@media(max-width:760px){.library-tools.kh-filters-only .filters{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}.library-tools.kh-filters-only .filter{min-height:58px!important;padding:9px 8px!important;font-size:.92rem!important}.kh-library-search{margin-bottom:12px!important}}
@media(max-width:360px){.library-tools.kh-filters-only .filters{grid-template-columns:1fr!important}.kh-category-status{grid-template-columns:1fr!important;grid-template-areas:'name' 'count' 'back';text-align:center!important}.kh-category-status-back{width:100%;margin-top:6px}}

/* Khalwati Library V52 — focused Sheikh/category view + obvious back controls */
.library-shell.kh-category-focused .library-tools.kh-filters-only{display:none!important}
.library-shell.kh-category-focused .kh-lib-pref{display:none!important}
.kh-category-status{scroll-margin-top:88px}
.kh-category-status{grid-template-columns:auto minmax(0,1fr)!important;grid-template-areas:'back copy'!important}.kh-category-status-copy{grid-area:copy;min-width:0;display:flex;flex-direction:column;gap:2px;align-items:flex-start}.kh-category-status-copy .kh-category-status-name,.kh-category-status-copy .kh-category-status-count{grid-area:auto!important}
.kh-category-status-back.kh-category-back-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:132px;background:#07513f;color:#fff;border-color:#07513f;box-shadow:0 6px 16px rgba(7,81,63,.14)}
.kh-category-status-back.kh-category-back-primary:hover{filter:brightness(1.04)}
.kh-category-bottom-back{display:flex;justify-content:center;margin:22px auto 4px;width:100%}
.kh-category-bottom-back[hidden]{display:none!important}
.kh-category-bottom-back-btn{min-height:46px;border:1px solid #d7bd7b;border-radius:14px;background:#fffaf0;color:#07513f;padding:9px 18px;font:inherit;font-weight:900;cursor:pointer}
.library-shell.kh-category-focused .books-grid{margin-top:4px}
@media(max-width:600px){
  .kh-category-status{grid-template-columns:1fr!important;grid-template-areas:none!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important;text-align:center!important}
  .kh-category-status-copy{align-items:center!important}
  .kh-category-status-back.kh-category-back-primary,.kh-category-bottom-back-btn{width:100%!important}
}


/* Khalwati V62 — compact responsive category cards: wider, lower, readable on every viewport */
.library-tools.kh-filters-only .filters{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))!important;
  gap:9px!important;
  width:100%!important;min-width:0!important;overflow:visible!important;
}
.library-tools.kh-filters-only .filter{
  min-height:52px!important;height:auto!important;
  padding:8px 11px!important;border-radius:14px!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;gap:9px!important;text-align:start!important;
  white-space:normal!important;
}
.library-tools.kh-filters-only .filter .kh-filter-label{
  min-width:0!important;font-size:.94rem!important;font-weight:800!important;
  line-height:1.35!important;text-align:start!important;overflow-wrap:anywhere!important;
}
.library-tools.kh-filters-only .filter .kh-filter-count{
  min-width:30px!important;height:30px!important;padding:0 8px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  border-radius:999px!important;background:#f3ead8!important;color:#7c6429!important;
  font-size:.78rem!important;font-weight:900!important;opacity:1!important;white-space:nowrap!important;
}
.library-tools.kh-filters-only .filter.active .kh-filter-count{background:rgba(255,255,255,.16)!important;color:#fff!important}
.kh-category-status{min-height:54px!important;padding:8px 10px!important;border-radius:14px!important;margin-bottom:14px!important}
.kh-category-status-copy{flex-direction:row!important;align-items:center!important;gap:8px!important;min-width:0!important}
.kh-category-status-name{font-size:.98rem!important;line-height:1.35!important;overflow-wrap:anywhere!important}
.kh-category-status-count{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:30px!important;height:30px!important;padding:0 8px!important;border-radius:999px!important;background:#f3ead8!important;color:#7c6429!important;font-size:.78rem!important;white-space:nowrap!important}
.kh-category-status-back.kh-category-back-primary{min-width:118px!important;min-height:40px!important;padding:6px 10px!important}
@media(max-width:900px){.library-tools.kh-filters-only .filters{grid-template-columns:repeat(3,minmax(0,1fr))!important}.library-tools.kh-filters-only .filter{min-height:50px!important}}
@media(max-width:640px){.library-tools.kh-filters-only .filters{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}.library-tools.kh-filters-only .filter{min-height:50px!important;padding:7px 9px!important}.library-tools.kh-filters-only .filter .kh-filter-label{font-size:.88rem!important}.kh-category-status{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:7px!important}.kh-category-status-copy{justify-content:center!important}.kh-category-status-back.kh-category-back-primary{width:100%!important}}
@media(max-width:340px){.library-tools.kh-filters-only .filters{grid-template-columns:1fr!important}}


/* Khalwati V64 — cross-device public layout sweep */
html,body{max-width:100%;overflow-x:hidden}
:where(main,section,article,.container,.page-hero,.library-shell,.audio-shell,.content-shell){min-width:0;max-width:100%}
:where(img,video,canvas,iframe){max-width:100%;height:auto}
:where(input:not([type="checkbox"]):not([type="radio"]),select,textarea,button,.btn,.filter){box-sizing:border-box;max-width:100%}
.site-header .header-inner,.footer-inner{min-width:0}
.nav-links{min-width:0;flex-wrap:wrap}
@media(max-width:1024px){.container{width:min(100% - 24px,1180px)!important}.page-hero{padding-block:22px!important}}
@media(max-width:700px){.container{width:calc(100% - 18px)!important}.page-hero{padding-block:16px!important}.page-hero h1{font-size:clamp(1.55rem,7vw,2.1rem)!important}.site-footer .footer-inner{gap:14px}.footer-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 14px}.books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.book-card{min-width:0!important}}
@media(max-width:380px){.container{width:calc(100% - 12px)!important}.books-grid{grid-template-columns:1fr!important}.page-hero{padding-inline:2px!important}}
@media(hover:none) and (pointer:coarse){:where(a,button,.btn,.filter,.icon-btn){min-height:44px}}

/* KHALWATI V11.46 — COMPACT SEARCH ONLY; BOOK COVER/GRID SIZE RESTORED TO ORIGINAL */
/* User requested a smaller library search, but book/card/cover/grid dimensions now fall back to the original production CSS. */
@media (min-width: 901px) {
  .kh-library-search { width:min(420px,100%)!important; max-width:420px!important; margin:0 auto 9px!important; }
  .kh-library-search input { width:100%!important; min-height:36px!important; height:36px!important; padding:5px 12px!important; border-radius:12px!important; font-size:.89rem!important; }
}
.books-grid .book-card .kh-card-edition, .library-grid .book-card .kh-card-edition, .book-grid .book-card .kh-card-edition { display:none!important; }
/* /KHALWATI V11.46 */
/* =========================================================
   KHALWATI V11.48 — PUBLIC FOOTER STABILITY / PROFESSIONAL SHELL
   Existing served asset patch; no new public static dependency.
   ========================================================= */
.site-footer{
  flex:0 0 auto!important;
  width:100%!important;
  margin-top:32px!important;
  padding:0!important;
  border-top:1px solid rgba(190,151,67,.24)!important;
  background:rgba(255,253,248,.94)!important;
  color:#64736c!important;
  overflow:hidden!important;
}
.site-footer .footer-inner{
  width:min(1180px,calc(100% - 32px))!important;
  max-width:1180px!important;
  min-height:70px!important;
  margin:0 auto!important;
  padding:13px 0!important;
  display:grid!important;
  grid-template-columns:minmax(210px,1fr) minmax(0,2.15fr) auto!important;
  grid-template-areas:"brand links copy"!important;
  align-items:center!important;
  justify-content:stretch!important;
  gap:16px!important;
  text-align:initial!important;
  box-sizing:border-box!important;
  min-width:0!important;
}
.site-footer .footer-brand{
  grid-area:brand!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-self:start!important;
  gap:9px!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  color:#073f34!important;
  font-weight:800!important;
  text-decoration:none!important;
}
.site-footer .footer-brand img{
  width:32px!important;
  height:32px!important;
  flex:0 0 32px!important;
  object-fit:contain!important;
}
.site-footer .footer-brand span{
  display:block!important;
  min-width:0!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.45!important;
  font-size:.9rem!important;
}
.site-footer .footer-links{
  grid-area:links!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:wrap!important;
  gap:4px 6px!important;
}
.site-footer .footer-links a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:34px!important;
  padding:6px 9px!important;
  border-radius:9px!important;
  white-space:nowrap!important;
  color:#48675d!important;
  font-size:.82rem!important;
  line-height:1.25!important;
  font-weight:750!important;
  text-decoration:none!important;
  box-sizing:border-box!important;
}
.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible{
  background:#f2ecdc!important;
  color:#073f34!important;
}
.site-footer .footer-copy{
  grid-area:copy!important;
  justify-self:end!important;
  white-space:nowrap!important;
  color:#877c68!important;
  font-size:.78rem!important;
  line-height:1.4!important;
}
@media(max-width:980px){
  .site-footer .footer-inner{
    width:calc(100% - 28px)!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:"brand copy" "links links"!important;
    gap:6px 14px!important;
    padding:12px 0 14px!important;
  }
  .site-footer .footer-links{padding-top:4px!important}
}
@media(max-width:640px){
  .site-footer{margin-top:22px!important}
  .site-footer .footer-inner{
    width:calc(100% - 20px)!important;
    grid-template-columns:1fr!important;
    grid-template-areas:"brand" "links" "copy"!important;
    justify-items:center!important;
    gap:8px!important;
    padding:13px 0 max(14px,env(safe-area-inset-bottom))!important;
    text-align:center!important;
  }
  .site-footer .footer-brand{justify-self:center!important;justify-content:center!important}
  .site-footer .footer-brand img{width:30px!important;height:30px!important;flex-basis:30px!important}
  .site-footer .footer-brand span{font-size:.86rem!important;text-align:center!important}
  .site-footer .footer-links{
    width:min(100%,430px)!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:4px 7px!important;
    padding:2px 0!important;
  }
  .site-footer .footer-links a{
    width:100%!important;
    min-width:0!important;
    min-height:36px!important;
    padding:6px 7px!important;
    white-space:normal!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
  }
  .site-footer .footer-copy{justify-self:center!important;font-size:.74rem!important}
}
@media(max-width:350px){
  .site-footer .footer-inner{width:calc(100% - 14px)!important}
  .site-footer .footer-links{grid-template-columns:1fr!important;width:min(100%,280px)!important}
}

/* /khalwati-public-assets/fonts/khalwati-fonts-02.css */
/* Khalwati 02 — local font shared with Flutter V123. No external font request. */
@font-face{font-family:'Tajawal';font-style:normal;font-weight:400;font-display:swap;src:url('/khalwati-public-assets/fonts/Tajawal-Regular.woff2') format('woff2')}

/* /khalwati-public-assets/site-v10-recovery.css */
/* Khalwati V10 — cross-site responsive containment and rendering safeguards */
:root{--kh-v10-safe-inline:12px}
html{
  width:100%;
  max-width:100%;
  overflow-x:clip;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:clip;
  overflow-wrap:anywhere;
}
*,*::before,*::after{box-sizing:border-box}
main,header,footer,section,article,aside,nav,form,
.container,.header-inner,.footer-inner,.section-head,.library-shell,.library-tools,
.home-hero-grid,.dashboard-grid,.books-grid,.simple-grid,.detail-grid,.facts,
.audio-grid,.audio-card,.audio-card-main,.audio-card-summary,.audio-inline-player,
.live-r7-shell,.live-r7-hero,.live-r7-stage,.live-r7-info,
.about-story,.about-copy,.about-source-card,.tasawwuf-grid,.tasawwuf-summary{
  min-width:0;
  max-width:100%;
}
img,svg,video,canvas,iframe{
  max-width:100%;
}
img,video{height:auto}
iframe{border:0}
input,select,textarea,button{max-width:100%;font:inherit}
pre,code{max-width:100%}
pre{overflow:auto}
table{max-width:100%}
.table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.filters,.audio-category-filters{
  max-width:100%;
}
.book-card,.simple-card,.dash-card,.fact,.community-card,.app-feature{
  min-width:0;
}
@supports not (overflow:clip){
  html,body{overflow-x:hidden}
}
@media(max-width:720px){
  body{min-width:0}
  .container,.live-r7-shell{
    max-width:100%;
  }
  .site-header,.site-footer,main{
    width:100%;
    max-width:100%;
  }
  .header-inner,.footer-inner{
    min-width:0;
  }
  .nav-links,.footer-links{
    max-width:100%;
  }
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* /khalwati-public-assets/site-v11-36-polish.css */
/* Khalwati V11.36 — conservative final polish
   Deliberately does NOT redesign existing pages or PDF reader. */
html{min-width:0}
@supports (overflow:clip){html{overflow-x:clip}}
body{min-width:0}
img,video{max-inline-size:100%}
button,input,select,textarea,a{-webkit-tap-highlight-color:transparent}
:focus-visible{outline:2px solid #0b6758;outline-offset:3px}
@media (prefers-reduced-motion:reduce){
  html:focus-within{scroll-behavior:auto!important}
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* /khalwati-public-assets/header-compact-r2.css */
/* Khalwati R2: compact one-line RTL desktop header, 2026-10-10.
 * Lower priority links remain in the mobile drawer and/or footer.
 * No changes to content, authentication, or admin.
 */
@media (min-width:1101px) {
  .site-header .header-inner,
  .home-refined .site-header .header-inner {
    min-height:56px!important;
    height:56px!important;
    margin-bottom:5px!important;
    padding-inline:11px!important;
    gap:7px!important;
  }
  .site-header .kh-brand,
  .site-header .brand { gap:7px!important; }
  .site-header .kh-brand-copy strong,
  .site-header .brand strong {font-size:.9rem!important;}
  .site-header .kh-brand-mark {width:35px!important;height:35px!important;flex-basis:35px!important;}
  .site-header .kh-brand img,
  .site-header .brand img,
  .home-refined .site-header .brand img {width:35px!important;height:35px!important;flex-basis:35px!important;}
  .site-header .nav-links,
  .home-refined .site-header .nav-links {
    flex-wrap:nowrap!important;
    justify-content:center!important;
    gap:0!important;
    white-space:nowrap!important;
  }
  /* Secondary pages remain accessible via mobile drawer, footer and page links. */
  .site-header nav.nav-links>a[href="/sections/about.html"],
  .site-header nav.nav-links>a[href="/sections/apps.html"],
  .site-header nav.nav-links>a[href="/sections/contact.html"] {display:none!important;}
  .site-header .nav-links a,
  .home-refined .site-header .nav-links a {
    min-height:36px!important;
    padding-inline:6px!important;
    font-size:.81rem!important;
    border-radius:9px!important;
  }
}
/* At tablet/phone widths the existing navigation drawer remains unchanged. */
@media (max-width:700px) {
  .site-header .header-inner,
  .home-refined .site-header .header-inner {min-height:56px!important;height:56px!important;}
}

/* /khalwati-public-assets/v16/design-r16.css */
/* Khalwati R16 | additive polish only; keep original palette, layout and Arabic typefaces. */
:root { --kh-r16-tap:44px; }
.site-header .nav-links a,
.site-header [aria-label="قائمة الهاتف"] a,
.footer-links a { min-height:var(--kh-r16-tap); align-items:center; }
.site-header .nav-links a { display:inline-flex; font-size:max(13.5px,.86rem); line-height:1.45; }
:where(.home-refined,.library-page-ui3,.audio-page) .book-card h3,
.book-card h3 { font-size:clamp(15px,1.8vw,17px); line-height:1.6; overflow-wrap:break-word; }
.book-card .cat, .book-card .open { font-size:max(13px,.85rem); line-height:1.45; }
.books-grid .book-card .book-cover-wrap img,
.book-card .book-cover-wrap img { object-fit:contain; max-width:100%; }
.home-refined .community-home .community-card { min-height:var(--kh-r16-tap); }
.home-refined .community-home .community-card strong {font-size:clamp(14px,1.8vw,16px);line-height:1.5;}
.audio-page .audio-hero p {font-size:clamp(15px,1.8vw,17px);line-height:1.75;}
.audio-page button, .audio-page .audio-toolbar a, .audio-page .audio-toolbar button { min-height:var(--kh-r16-tap); }
:where(.home-refined,.library-page-ui3,.audio-page) :is(a,button,input,select):focus-visible,
.site-header a:focus-visible, .book-card:focus-visible,
.app button:focus-visible, .reader-drawer button:focus-visible {
  outline:3px solid #ad8530; outline-offset:3px;
}
.kh-r16-sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
@media (max-width:680px) {
  .home-refined .community-home .community-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .home-refined .community-home .community-card { padding:13px 10px; }
  .home-refined .community-home .community-card strong {font-size:15px;}
  .home-refined .books-grid .book-card h3,
  .library-page-ui3 .books-grid .book-card h3 {font-size:15px;line-height:1.55;}
  .book-card .cat,.book-card .open {font-size:13.5px;}
  .audio-page button {font-size:14px;}
  .app .topbar button,.app .topbar a {min-height:var(--kh-r16-tap);}
  .app .toolbar { overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap; scrollbar-width:thin; padding-bottom:max(6px,env(safe-area-inset-bottom)); }
  .app .toolbar > * {flex-shrink:0;}
  .app .toolbar .tool-button,.app .toolbar .zoom-value,
  .app .toolbar .page-control input {min-height:var(--kh-r16-tap);}
  .app .toolbar #previousButton span,.app .toolbar #nextButton span {font-size:14px;}
  .reader-drawer .panel-action,.reader-drawer .panel-tab {min-height:var(--kh-r16-tap);font-size:14px;}
}
@media (prefers-reduced-motion:reduce) {
  .book-card,.community-card {transition-duration:.01ms!important;animation-duration:.01ms!important;}
}

/* /khalwati-public-assets/v17/design-r17.css */
/* Khalwati R17 | additive layout polish. Same palette, same Tajawal typeface, same components. */
:root{--kh17-green:#07583d;--kh17-deep:#073f34;--kh17-gold:#c99a37;--kh17-line:#e6d6ae;--kh17-paper:#fffdf8;--kh17-cream:#fbf6e9;--kh17-muted:#6e746e;--kh17-tap:44px}

/* 1) Library category filters: 440px-tall 2-column grid on phones -> one swipeable row. */
@media (max-width:680px){
  html body :is(.library-tools.kh-filters-only,.library-tools) .filters{
    display:flex!important;flex-wrap:nowrap!important;grid-template-columns:none!important;
    overflow-x:auto!important;overflow-y:hidden!important;max-width:100%;contain:inline-size;gap:8px!important;padding:2px 2px 10px!important;margin-inline:-4px;
    scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;
    mask-image:linear-gradient(to left,#000 88%,transparent);-webkit-mask-image:linear-gradient(to left,#000 88%,transparent);
  }
  html body :is(.library-tools.kh-filters-only,.library-tools) .filters::-webkit-scrollbar{display:none}
  html body :is(.library-tools.kh-filters-only,.library-tools) .filters>.filter{
    flex:0 0 auto!important;width:auto!important;min-height:var(--kh17-tap);scroll-snap-align:start;
    display:inline-flex!important;flex-direction:row!important;align-items:center;gap:8px;padding:0 14px!important;border-radius:999px!important;white-space:nowrap;
  }
  html body :is(.library-tools.kh-filters-only,.library-tools) .filters .kh-filter-label{font-size:14px}
  html body :is(.library-tools.kh-filters-only,.library-tools) .filters .kh-filter-count{font-size:12.5px}
}

/* 2) Book page: comfortable tap targets on breadcrumb links. */
.crumbs a{display:inline-block;padding:10px 2px;margin:-10px 0}
.crumbs{line-height:2}

/* 3) Book page: related books (server-rendered by library-book.php R17). */
.kh17-related{margin-top:28px;padding-top:22px;border-top:1px solid var(--kh17-line)}
.kh17-related-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;margin:0 0 14px}
.kh17-related-head h2{margin:0;font-size:clamp(18px,2.2vw,22px);color:var(--kh17-deep);line-height:1.5}
.kh17-related-head a{color:var(--kh17-green);font-weight:800;text-decoration:none;white-space:nowrap;min-height:var(--kh17-tap);display:inline-flex;align-items:center}
.kh17-related-head a:hover{text-decoration:underline}
.kh17-related-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.kh17-related-grid a{display:flex;flex-direction:column;height:100%;text-decoration:none;color:var(--kh17-deep);background:var(--kh17-paper);border:1px solid var(--kh17-line);border-radius:18px;padding:10px;transition:transform .15s ease,box-shadow .15s ease}
.kh17-related-grid a:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(7,63,52,.10)}
.kh17-related-grid a:focus-visible{outline:3px solid #ad8530;outline-offset:3px}
.kh17-related-cover{display:block;aspect-ratio:3/4;border-radius:12px;background:#f4ecd9;overflow:hidden}
.kh17-related-cover img{display:block;width:100%;height:100%;object-fit:contain}
.kh17-related-title{display:block;margin-top:10px;font-weight:800;font-size:15px;line-height:1.6;overflow-wrap:anywhere}
.kh17-related-meta{display:block;margin-top:2px;font-size:13px;color:var(--kh17-muted)}
@media (max-width:600px){
  .kh17-related-grid{display:flex;overflow-x:auto;scroll-snap-type:x proximity;gap:12px;padding-bottom:8px;scrollbar-width:thin}
  .kh17-related-grid li{flex:0 0 42%;scroll-snap-align:start}
}
@media (prefers-reduced-motion:reduce){.kh17-related-grid a{transition:none}}

/* 4) Desktop book page: keep the card from floating in empty space on wide screens. */
@media (min-width:1100px){
  .book-detail .detail-grid{align-items:start}
  .book-detail .detail-cover{position:sticky;top:96px}
}

/* 5) Small-text floor on phones (kickers, notes, footer). */
@media (max-width:680px){
  .app-simple-kicker,.app-simple-note,.kh-sawati-eyebrow,.footer-copy{font-size:13px!important}
}

