/* MaharatDZ store: light by default, dark on demand. Flat, calm, readable. */
:root {
  --bg: #f6f4ee;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f2efe7;
  --line: #e3ddcf;
  --line2: #ece8de;
  --ink: #1b1f1a;
  --ink2: #50574d;
  --ink3: #80867b;
  --brand: #17683d;
  --brand2: #0f5230;
  --brand-ink: #ffffff;
  --brand-soft: #e6f1e9;
  --gold: #a26c12;
  --gold-soft: #fbf1dc;
  --save: #b45309;
  --save-bg: #fff1e0;
  --wa: #1fa855;
  --red: #c93c3c;
  --hl: #ffe08a;
  --kid-bg: #fff6e9;
  --appbar-bg: rgba(246, 244, 238, .92);
  --scrim: rgba(20, 24, 20, .45);
  --shadow: 0 1px 2px rgba(27, 31, 26, .06), 0 4px 14px rgba(27, 31, 26, .06);
  --shadow-lg: 0 12px 40px rgba(27, 31, 26, .16);
  --r: 18px;
  --r-sm: 12px;
  --tab-h: 64px;
  --bar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1412;
  --bg2: #161c19;
  --card: #171d1a;
  --card2: #1f2622;
  --line: #2c3530;
  --line2: #232b27;
  --ink: #ecefe9;
  --ink2: #b3b9b0;
  --ink3: #868d83;
  --brand: #3fbf7f;
  --brand2: #5fd396;
  --brand-ink: #062313;
  --brand-soft: #17301f;
  --gold: #e2b85a;
  --gold-soft: #2a2414;
  --save: #f5b26b;
  --save-bg: #3a2410;
  --red: #ff8a8a;
  --hl: rgba(226, 184, 90, .3);
  --kid-bg: #151a22;
  --appbar-bg: rgba(15, 20, 18, .9);
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { inset-inline-start: 8px; }
[hidden] { display: none !important; }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 16px 8px;
  min-height: var(--bar-h);
  background: var(--appbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line2);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; background: #fff; padding: 3px; object-fit: contain; border: 1px solid var(--line); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-txt small { font-size: 11px; color: var(--ink3); }
.appbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--card2); }
.icon-btn:active { background: var(--line2); }
.back svg { transform: none; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
.kids-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 700; white-space: nowrap; flex: none;
}
.kids-toggle[aria-pressed="true"] { background: #ff8a3d; color: #fff; border-color: transparent; }
@media (max-width: 380px) { .kids-toggle .lbl { display: none; } .brand-txt small { display: none; } }
@media (max-width: 460px) { body:has(#backBtn:not([hidden])) .kids-toggle .lbl, body:has(#backBtn:not([hidden])) .brand-txt small { display: none; } }

.searchbar {
  position: sticky; top: calc(var(--bar-h) + var(--safe-t)); z-index: 29;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 10px;
  background: var(--appbar-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2);
}
.searchbar svg { color: var(--ink3); flex: none; }
.searchbar input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); outline: none;
}
.searchbar input:focus { border-color: var(--brand); }
.txt-btn { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 8px; }

/* Layout */
main { outline: none; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.view { max-width: 1120px; margin: 0 auto; padding: 0 16px; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-title { font-size: 28px; font-weight: 800; margin: 20px 0 4px; letter-spacing: -.01em; line-height: 1.3; }
.page-sub { color: var(--ink2); margin: 0 0 16px; font-size: 15px; }
.sec { margin: 32px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec h2 { font-size: 20px; margin: 0; font-weight: 800; }
.sec a { color: var(--brand); font-size: 14px; font-weight: 700; white-space: nowrap; }
.sec h2 .n { font-size: 14px; font-weight: 600; color: var(--ink3); margin-inline-start: 2px; }
.muted { color: var(--ink2); }
.gold { color: var(--gold); }

/* Hero */
.hero {
  position: relative; margin-top: 16px; padding: 24px 20px 20px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.hero .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }
.hero h1 { font-size: clamp(26px, 6.4vw, 40px); line-height: 1.25; margin: 12px 0 8px; font-weight: 800; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand); background: linear-gradient(transparent 62%, var(--hl) 62%); padding: 0 2px; }
.hero p { margin: 0 0 18px; color: var(--ink2); max-width: 52ch; font-size: 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.perks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 14px; color: var(--ink2); }
.perks span::before { content: "✓ "; color: var(--brand); font-weight: 800; }
@media (min-width: 900px) {
  .hero-main { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; padding: 36px 32px; }
}
.flow { list-style: none; margin: 0; padding: 14px; display: grid; gap: 10px; counter-reset: f; background: var(--card2); border-radius: var(--r); }
.flow li { counter-increment: f; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; }
.flow li::before { content: counter(f); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand); color: var(--brand-ink); }
.flow li small { display: block; font-weight: 400; color: var(--ink3); font-size: 13px; }
@media (max-width: 899px) { .flow { margin-top: 18px; } }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.trust span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--card2); color: var(--ink2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; transition: transform .12s ease, background .15s; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn-gold, .btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-gold:hover, .btn-primary:hover { background: var(--brand2); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--card2); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa svg { width: 20px; height: 20px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 16px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: transparent; }
.chip .n { font-size: 12px; opacity: .7; font-weight: 500; }

/* Year picker */
.year-pick { display: grid; gap: 12px; }
@media (min-width: 760px) { .year-pick { grid-template-columns: 1fr 1fr; } }
.phase { padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.phase h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.phase h3 small { font-weight: 500; color: var(--ink3); font-size: 13px; }
.yrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.yr {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 6px 4px;
  border-radius: 14px; background: var(--card2); border: 1px solid transparent; text-align: center; transition: transform .1s ease;
}
.yr:hover { border-color: var(--brand); }
.yr:active { transform: scale(.95); }
.yr b { font-size: 22px; line-height: 1.1; font-weight: 800; color: var(--brand); }
.yr small { font-size: 11px; color: var(--ink3); line-height: 1.3; }

/* Horizontal rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%); gap: 12px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 700px) { .rail { grid-auto-columns: 200px; } }

/* Product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); text-align: start; padding: 0; color: inherit;
  transition: transform .12s ease, border-color .2s; content-visibility: auto; contain-intrinsic-size: 300px;
}
.card:active { transform: scale(.98); }
.card:hover { border-color: var(--line); }
.cover { position: relative; aspect-ratio: 4 / 5; background: var(--card2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.contain img { object-fit: contain; padding: 18%; }
.tag {
  position: absolute; top: 8px; inset-inline-start: 8px; padding: 3px 8px; border-radius: 8px;
  font-size: 11px; font-weight: 700; background: var(--ink); color: var(--bg);
}
.tag.free { background: var(--brand); color: var(--brand-ink); }
.tag.save { inset-inline-start: auto; inset-inline-end: 8px; background: var(--save-bg); color: var(--save); }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; flex: 1; }
.card-body b { font-size: 15px; line-height: 1.35; }
.card-body small { color: var(--ink3); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; color: var(--ink); font-size: 15px; white-space: nowrap; }
.card-body .price small, .price small { display: inline; font-size: 11px; color: var(--ink3); font-weight: 500; }
.price-old { color: var(--ink3); text-decoration: line-through; font-weight: 500; font-size: 13px; white-space: nowrap; }
/* Coloring bundles: group total on a second line under the per-story price. */
.cp-pack { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink3); white-space: nowrap; }
.cp-pack small { font-size: 10px; }
.add {
  height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--brand); display: inline-flex; align-items: center; gap: 4px;
  background: var(--card); color: var(--brand); flex: none; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.add.in { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.add svg { width: 18px; height: 18px; }

/* Free content list */
.free-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.free-item {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--r); background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); text-align: start; width: 100%;
}
.free-item:hover { border-color: var(--line); }
.free-item:active { transform: scale(.985); }
.free-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: var(--card2); }
.free-txt { min-width: 0; }
.free-txt b { display: block; font-size: 15px; line-height: 1.35; }
.free-txt small { display: block; color: var(--ink3); font-size: 13px; line-height: 1.45; }
.age { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.open-pill { height: 36px; padding: 0 14px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; white-space: nowrap; }

/* Featured free card variant removed with the board item. */

/* Try-first-lesson list */
.try-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .try-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.try-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line2); text-align: start; width: 100%;
}
.try-row:hover { border-color: var(--brand); }
.try-row .ti { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: var(--card2); display: grid; place-items: center; font-size: 22px; }
.try-row .ti img { width: 100%; height: 100%; object-fit: cover; }
.try-row b { display: block; font-size: 15px; line-height: 1.35; }
.try-row small { display: block; color: var(--ink3); font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-row .go { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }

/* Full-pack call to action */
.pack-cta {
  position: relative; margin-top: 16px; padding: 20px; border-radius: 22px; background: var(--card);
  border: 2px solid var(--brand); box-shadow: var(--shadow);
}
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); }
.pack-cta h3 { margin: 10px 0 2px; font-size: 22px; line-height: 1.3; font-weight: 800; }
.pack-cta .pc-sub { color: var(--ink2); margin: 0; font-size: 14px; }
.pc-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 14px 0 4px; }
.pc-price b { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.pc-price b small { font-size: 15px; font-weight: 600; color: var(--ink2); }
.save { display: inline-block; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--save-bg); color: var(--save); }
.pc-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.pc-list li { position: relative; padding-inline-start: 26px; font-size: 15px; color: var(--ink2); }
.pc-list li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.pc-actions .wide { grid-column: 1 / -1; }
.pc-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink3); }
.pc-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Upsell strip (sheet) */
.upsell { margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--brand-soft); display: grid; gap: 10px; }
.upsell p { margin: 0; font-size: 14px; color: var(--ink); }
.upsell b { color: var(--brand); }

/* Quran band */
.quran-band {
  margin-top: 16px; padding: 22px 20px; border-radius: 24px; background: #123d2b; color: #f3efe2;
  display: grid; gap: 14px;
}
@media (min-width: 760px) { .quran-band { grid-template-columns: 1fr auto; align-items: center; padding: 26px 28px; } }
.quran-band .qb-eyebrow { font-size: 13px; font-weight: 700; color: #e2c27a; }
.quran-band h2 { margin: 4px 0 6px; font-size: clamp(22px, 5vw, 28px); line-height: 1.3; }
.quran-band p { margin: 0; color: #d9d4c4; font-size: 15px; max-width: 52ch; }
.qb-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qb-stats span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.qb-stats b { color: #e2c27a; }
.quran-band .btn-ghost { background: transparent; color: #f3efe2; border-color: rgba(255, 255, 255, .3); }
.quran-band .btn-gold { background: #e2c27a; color: #1d1a10; }
.qb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.axis-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .axis-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.axis-n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--brand-soft); color: var(--brand); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: var(--brand-ink); background: var(--brand); font-size: 15px;
}
.steps b { display: block; }
.steps span { color: var(--ink2); font-size: 14px; }
.panel { padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.panel h3 { margin: 0 0 12px; font-size: 17px; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.how .panel { margin: 0; }
.how .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand); color: var(--brand-ink); margin-bottom: 8px; }
.how b { display: block; margin-bottom: 4px; }
.how p { margin: 0; color: var(--ink2); font-size: 14px; }

/* FAQ */
details.faq { border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line2); }
details.faq + details.faq { margin-top: 8px; }
details.faq summary { list-style: none; padding: 14px 16px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--brand); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 0; padding: 0 16px 14px; color: var(--ink2); }

/* Empty */
.empty { text-align: center; padding: 48px 16px; color: var(--ink2); }
.empty .big { font-size: 52px; margin-bottom: 8px; }

/* Cart */
.cart-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line2); }
.cart-row + .cart-row { margin-top: 8px; }
.cart-row .thumb { width: 64px; height: 80px; border-radius: 10px; overflow: hidden; background: var(--card2); }
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row b { display: block; font-size: 15px; line-height: 1.35; }
.cart-row small { color: var(--ink3); font-size: 12px; }
.rm { border: 0; background: var(--card2); color: var(--red); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.summary { margin-top: 16px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.summary .row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--ink2); }
.summary .total { font-size: 20px; font-weight: 800; color: var(--ink); }
.summary .total span:last-child { color: var(--brand); }
.cart-offer { margin: 14px 0; padding: 18px; border: 1px solid var(--brand); border-radius: var(--r); background: var(--brand-soft); }
.cart-offer h2, .cart-promo h2 { margin: 0 0 8px; font-size: 20px; }
.cart-offer p { margin: 6px 0; }
.cart-offer small { display: block; color: var(--ink2); line-height: 1.8; }
.cart-tiers { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.cart-tiers > span { flex: 1 1 95px; display: grid; gap: 3px; padding: 10px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.cart-tiers b { font-size: 23px; color: var(--brand); }
.cart-tiers .active { border: 2px solid var(--brand); background: var(--gold-soft); }
.cart-next, .summary .cart-saving { font-weight: 700; color: var(--brand); }
.cart-promo { margin-top: 16px; }
.cart-promo label { display: block; margin-bottom: 7px; font-size: 14px; }
.promo-entry { display: flex; flex-wrap: wrap; gap: 8px; }
.promo-entry input { flex: 1 1 160px; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--card2); color: var(--ink); }
.promo-entry :disabled { cursor: not-allowed; }
.promo-entry button:disabled { opacity: .6; }
.note { font-size: 13px; color: var(--ink3); margin: 10px 0 0; }

/* Bottom tab bar */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--appbar-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line2);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink3); font-size: 11px; font-weight: 600; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.badge {
  position: absolute; top: 7px; inset-inline-end: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center; background: var(--red); color: #fff;
}
.badge.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
@media (min-width: 900px) {
  .tabbar { inset-inline: 50%; width: 520px; transform: translateX(50%); bottom: 16px; height: var(--tab-h); padding: 0; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--bg2); }
}

/* Floating buttons: WhatsApp + smart guide */
.fab-stack { position: fixed; z-index: 45; inset-inline-end: 14px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (min-width: 900px) { .fab-stack { bottom: 24px; inset-inline-end: 24px; } }
.fab { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow-lg); border: 0; transition: transform .12s ease; }
.fab:active { transform: scale(.93); }
.fab-wa { background: #25d366; color: #fff; }
.fab-wa svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.fab-ask { background: var(--card); border: 1px solid var(--line); padding: 6px; }
.robot svg, .fab-ask svg { width: 100%; height: 100%; fill: initial; stroke: none; }
.nudge {
  position: relative; max-width: 230px; padding: 10px 34px 10px 12px; border-radius: 14px 14px 4px 14px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-lg);
  animation: up .3s ease; cursor: pointer;
}
.nudge button { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .7; font-size: 16px; line-height: 1; }
body.kids .fab-wa { display: none; }

/* Bottom sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; inset-inline: 0; bottom: 0; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg2); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line);
  padding: 8px 16px calc(24px + var(--safe-b)); animation: up .32s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(100%); } }
@media (min-width: 760px) {
  .sheet { inset-inline: 50%; width: 640px; transform: translateX(50%); bottom: 24px; border-radius: 24px; border: 1px solid var(--line); max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg); }
  @keyframes up { from { transform: translate(50%, 40px); opacity: 0; } }
}
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 8px; }
.sheet-close { position: absolute; top: 10px; inset-inline-end: 10px; background: var(--card2); }
.sh-head { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; margin-top: 8px; padding-inline-end: 40px; }
.sh-cover { border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--card2); border: 1px solid var(--line2); }
.sh-cover img { width: 100%; height: 100%; object-fit: cover; }
.sh-cover.contain img { object-fit: contain; padding: 18%; }
.sh-head h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.sh-head .sub { color: var(--ink2); font-size: 14px; margin: 2px 0 8px; }
.sh-price { font-size: 24px; font-weight: 800; color: var(--ink); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.sh-price small { font-size: 13px; color: var(--ink3); font-weight: 500; }
.sh-desc { color: var(--ink2); margin: 14px 0 0; }
.sh-h { font-size: 15px; margin: 18px 0 8px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.inside { display: flex; flex-wrap: wrap; gap: 6px; }
.inside span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--card2); }
.bullets { margin: 0; padding: 0 18px 0 0; color: var(--ink2); font-size: 14px; }
.bullets li + li { margin-top: 4px; }
.parent-note { padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); font-size: 14px; color: var(--ink2); }
.sh-actions { position: sticky; bottom: calc(-24px - var(--safe-b)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px -16px 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(180deg, transparent, var(--bg2) 30%); }
.sh-actions .wide { grid-column: 1 / -1; }
.btn.has-label { flex-direction: column; gap: 2px; line-height: 1.3; padding: 10px 20px; }
.try-label { display: block; font-size: 12px; font-weight: 500; opacity: .85; }

/* Smart guide (advisor) */
.ask { padding-top: 4px; }
.ask-head { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding-inline-end: 40px; }
.robot { width: 64px; height: 64px; }
.ask-head b { display: block; font-size: 18px; }
.ask-head small { color: var(--ink3); font-size: 13px; }
.ask-bubble { margin: 14px 0 12px; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--card2); font-size: 16px; font-weight: 600; line-height: 1.5; }
.ask-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ask-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 10px 8px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: center; font-weight: 700; font-size: 15px; line-height: 1.3;
}
.ask-opt:hover { border-color: var(--brand); }
.ask-opt:active { transform: scale(.97); }
.ask-opt .e { font-size: 26px; line-height: 1; }
.ask-opt small { font-weight: 500; font-size: 12px; color: var(--ink3); }
.ask-opt.wide { grid-column: 1 / -1; }
.ask-res { display: grid; gap: 8px; }
.ask-res .pack-cta { margin-top: 0; }
.ask-back { margin-top: 12px; display: flex; justify-content: space-between; gap: 8px; }

/* Viewer */
.viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); animation: fadein .2s ease; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--safe-t)) 8px 6px; background: var(--bg2); border-bottom: 1px solid var(--line2); }
.viewer-bar b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-cta { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--brand-soft); border-bottom: 1px solid var(--line2); font-size: 14px; }
.viewer-cta span { flex: 1; min-width: 0; line-height: 1.4; }
.viewer-cta b { color: var(--brand); }
body.kids .viewer-cta { display: none !important; }
.viewer-stage { position: relative; flex: 1; background: #fff; }
.viewer-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink2); background: var(--bg); z-index: 1; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.guide-card {
  position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 16px;
  background: var(--scrim);
}
.guide-inner { width: min(440px, 100%); padding: 20px; border-radius: 22px; background: var(--bg2); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: up .3s ease; }
.guide-inner .gi-ico { font-size: 44px; line-height: 1; }
.guide-inner h3 { margin: 10px 0 2px; font-size: 20px; }
.guide-inner .gi-sub { color: var(--ink2); margin: 0 0 14px; font-size: 14px; }
.guide-inner .steps { margin-bottom: 16px; }
.guide-inner .row2 { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* Parent gate */
.gate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.gate-box { width: min(360px, 100%); text-align: center; padding: 24px 20px; border-radius: 24px; background: var(--bg2); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.gate-ico { font-size: 40px; }
.gate h2 { margin: 6px 0 4px; }
.gate p { color: var(--ink2); margin: 0 0 16px; font-size: 18px; }
.gate-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gate-keys button { height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 20px; font-weight: 700; }
.gate-keys button:active { background: var(--card2); }
.gate-keys [data-parent-confirm] { grid-column: 1 / -1; height: auto; min-height: 54px; padding: 12px; font-size: 17px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Toast */
.toast {
  position: fixed; z-index: 80; inset-inline: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  margin: 0 auto; max-width: 420px; padding: 12px 16px; border-radius: 14px; text-align: center; font-weight: 600;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); animation: up .25s ease;
}

/* ---------- Kids mode ---------- */
body.kids { background: var(--kid-bg); }
body.kids .shop-tab, body.kids .cart-tab, body.kids .price, body.kids .add, body.kids #searchBtn, body.kids #viewerExt { display: none !important; }
body.kids .tabbar { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) { body.kids .tabbar { width: 360px; } }
.kids-hero { margin-top: 16px; padding: 22px 20px; border-radius: 26px; text-align: center; background: #ff8a3d; color: #fff; }
.kids-hero h1 { margin: 0; font-size: clamp(26px, 7vw, 36px); line-height: 1.3; }
.kids-hero p { margin: 4px 0 0; font-size: 17px; }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
@media (min-width: 700px) { .kid-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.kid-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 16px 10px; border-radius: 26px; border: 0; color: #fff; text-align: center; width: 100%;
  font-size: 18px; font-weight: 700; line-height: 1.3; box-shadow: 0 6px 0 rgba(0, 0, 0, .18);
  transition: transform .1s ease;
}
.kid-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.kid-tile .k-ico { font-size: 54px; line-height: 1; }
.kid-say {
  position: absolute; top: 8px; inset-inline-end: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(255, 255, 255, .28); color: #fff; font-size: 18px;
}
.c0 { background: #f26b4f; }
.c1 { background: #2f8fe0; }
.c2 { background: #1fa577; }
.c3 { background: #f5b82e; color: #3a2400; }
.c4 { background: #7a5cf0; }
.c5 { background: #e0559b; }
.c3 .kid-say { color: #3a2400; }
.kids-note { margin: 18px 0 0; text-align: center; color: var(--ink2); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.noscript { padding: 24px; text-align: center; }
.card-link { display: block; position: relative; }
.kid-wrap { position: relative; display: grid; }
.guide-inner h4 { font-size: 15px; }

/* ---------- Free area: one card for shop and free (data/taxonomy.json) ---------- */
.cover.wide { aspect-ratio: 4 / 3; }
.cover.glyph { display: grid; place-items: center; background: linear-gradient(150deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) + 25) 60% 84%)); }
.cover.glyph span { padding: .25em .6em; border-radius: 16px; background: hsl(0 0% 100% / .75); color: hsl(var(--h) 50% 22%); font-size: clamp(20px, 6vw, 28px); font-weight: 800; line-height: 1.4; text-align: center; max-width: 88%; }
.fcard .card-body small { min-height: 2.8em; }
.fcard .card-foot .age { margin: 0; }
.fcard .open-pill { height: 32px; padding: 0 12px; }
.fcard .kid-say { position: absolute; top: 8px; inset-inline-end: 8px; }
.rail > .fcard { min-width: 0; }
@media (max-width: 699px) { .rail:has(> .fcard) { grid-auto-columns: minmax(150px, 46%); } }
/* fillRows(): the last card of an incomplete row widens and lies on its side instead of leaving empty slots. */
.grid > .card.span { flex-direction: row; align-items: stretch; }
.grid > .card.span .card-link { flex: 0 0 min(46%, 260px); }
.grid > .card.span .cover { height: 100%; aspect-ratio: auto; min-height: 150px; }
.grid > .card.span .card-body { justify-content: center; gap: 4px; padding: 14px 16px; }
.grid > .card.span .card-body small { min-height: 0; -webkit-line-clamp: 3; }
/* Group doors */
.gtiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 8px; }
@media (min-width: 700px) { .gtiles { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.gtile { position: relative; display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; background: hsl(var(--h) 50% 90%); box-shadow: var(--shadow); }
.gtile img { width: 100%; height: 100%; object-fit: cover; }
.gtile span { position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; background: linear-gradient(transparent, rgba(10, 30, 20, .78)); color: #fff; }
.gtile b { display: block; font-size: 16px; line-height: 1.3; }
.gtile small { font-size: 12px; opacity: .9; }
.gtile:active { transform: scale(.98); }
.ghead { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; margin-bottom: 8px; }
.ghead img { width: 112px; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 16px; }
.ghead .page-title { margin: 0; }
.ghead .page-sub { margin: 4px 0 0; }
.age-chips { margin-top: 4px; }
.shop-link { margin-top: 20px; border-color: var(--brand); }
body.kids .fcard .card-body b { font-size: 17px; }
body.kids .fcard .card-foot .age { display: none; }
.gtiles > .gtile.span { aspect-ratio: auto; height: 150px; }
@media (min-width: 700px) { .gtiles > .gtile.span { height: auto; aspect-ratio: auto; } }

/* ---------- Selling pass (2026-11-12): compact hero, order bar, pack year chip, parent card ---------- */
html { overflow-x: clip; }
.try-row > span { min-width: 0; }
.hero-compact { padding: 18px 18px 16px; }
.hero-compact h1 { margin: 10px 0 6px; }
.hero-compact p { margin: 0 0 12px; font-size: 15px; }
.hero-compact .hero-cta { gap: 8px; }
.flow-row { margin-top: 12px; }
@media (min-width: 760px) { .flow-row { grid-template-columns: repeat(3, 1fr); } }
.yr-chip {
  position: absolute; bottom: 8px; inset-inline-end: 8px; min-width: 52px; padding: 4px 10px; border-radius: 14px; text-align: center;
  background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-lg); line-height: 1.15;
}
.yr-chip b { display: block; font-size: 24px; font-weight: 800; }
.yr-chip small { display: block; font-size: 11px; font-weight: 700; }
.buybar {
  position: fixed; z-index: 41; inset-inline: 0; bottom: calc(var(--tab-h) + var(--safe-b));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 8px 16px;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(27, 31, 26, .1); animation: up .25s ease;
}
.buybar > span { min-width: 0; }
.buybar b { display: block; font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar small { display: block; color: var(--ink2); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .btn { flex: none; min-height: 42px; }
body.has-buybar main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px + 58px); }
body.has-buybar .fab-stack, body.has-buybar .toast { bottom: calc(var(--tab-h) + var(--safe-b) + 14px + 58px); }
@media (min-width: 900px) {
  .buybar { inset-inline: 50%; width: 520px; transform: translateX(50%); bottom: calc(16px + var(--tab-h) + 8px); border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  body.has-buybar .fab-stack, body.has-buybar .toast { bottom: 24px; }
}
.parent-card .pack-cta { margin-top: 12px; }
.ask-parent { margin-top: 18px; min-height: 60px; font-size: 17px; border-radius: 20px; }

.cover.glyph span.emo { background: none; font-size: 64px; padding: 0; line-height: 1; }
.gico { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 64px; padding-bottom: 28px; }
.ghead .gico { position: static; width: 112px; aspect-ratio: 4 / 3; border-radius: 16px; font-size: 48px; padding: 0; background: hsl(var(--h, 200) 50% 90%); }

/* ---------- Boss pass (2026-11-12): shelf tile shapes, Quran page ---------- */
.cover.glyph { position: relative; }
.cover.glyph span.emo { position: relative; z-index: 1; display: grid; place-items: center; width: 96px; height: 96px; font-size: 54px; max-width: none; }
.step-n { position: absolute; z-index: 2; top: 8px; inset-inline-start: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 16px; background: hsl(var(--h) 55% 30%); color: #fff; }
/* repeat: round medal */
.glyph.sh-repeat span.emo { border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px hsl(var(--h) 60% 80%), 0 8px 18px hsl(var(--h) 50% 30% / .18); }
/* test: tilted exam sheet */
.glyph.sh-test { background: repeating-linear-gradient(135deg, hsl(var(--h) 55% 93%) 0 14px, hsl(var(--h) 55% 89%) 14px 28px); }
.glyph.sh-test span.emo { border-radius: 14px; background: #fff; transform: rotate(-5deg); border: 2px solid hsl(var(--h) 45% 70%); }
/* play: stack of cards */
.glyph.sh-play span.emo { border-radius: 16px; background: #fff; box-shadow: 8px 8px 0 hsl(var(--h) 60% 78%), 16px 16px 0 hsl(var(--h) 60% 86%); }
/* memory: tiles board */
.glyph.sh-memory { background: conic-gradient(hsl(var(--h) 55% 90%) 25%, hsl(var(--h) 55% 95%) 0 50%, hsl(var(--h) 55% 90%) 0 75%, hsl(var(--h) 55% 95%) 0) 0 0 / 56px 56px; }
.glyph.sh-memory span.emo { border-radius: 22px; background: hsl(var(--h) 70% 97%); border: 3px solid hsl(var(--h) 50% 60%); }
/* puzzles: dotted paper, hexagon */
.glyph.sh-puzzles { background: radial-gradient(hsl(var(--h) 45% 78%) 2px, transparent 3px) 0 0 / 18px 18px, hsl(var(--h) 55% 94%); }
.glyph.sh-puzzles span.emo { background: #fff; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
/* quests: sunrise */
.glyph.sh-quests { background: radial-gradient(circle at 50% 120%, hsl(calc(var(--h) + 40) 80% 78%) 0 38%, hsl(var(--h) 60% 86%) 39% 58%, hsl(var(--h) 55% 93%) 59%); }
.glyph.sh-quests span.emo { background: none; filter: drop-shadow(0 6px 6px hsl(var(--h) 50% 30% / .25)); font-size: 64px; }
/* guides / academy: document corner */
.glyph.sh-guides span.emo, .glyph.sh-academy span.emo { border-radius: 10px 26px 10px 10px; background: #fff; border: 2px solid hsl(var(--h) 35% 75%); }
:root[data-theme="dark"] .cover.glyph { filter: saturate(.85) brightness(.82); }

/* Quran page */
.q-hero { position: relative; overflow: hidden; background: #0f3b29; border: 1px solid #c9a24b55; }
.q-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle at 0 0, #e2c27a22 0 90px, transparent 91px), radial-gradient(circle at 100% 100%, #e2c27a1c 0 130px, transparent 131px),
    repeating-conic-gradient(from 22.5deg at 50% 50%, #e2c27a0d 0 45deg, transparent 0 90deg) 0 0 / 44px 44px; }
.q-hero > * { position: relative; }
.q-hero h1 { margin: 4px 0 6px; font-size: clamp(28px, 7vw, 40px); line-height: 1.3; color: #f6e7bd; }
.q-hero .qb-actions .btn { flex: 1 1 150px; }
.qpath { list-style: none; margin: 0 -16px; padding: 2px 16px 12px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: none; }
.qpath::-webkit-scrollbar { display: none; }
.qpath button { position: relative; width: 100%; height: 100%; display: grid; justify-items: center; gap: 2px; padding: 18px 8px 12px; border-radius: 20px; border: 1px solid var(--line2); background: var(--card); box-shadow: var(--shadow); text-align: center; }
.qpath button:active { transform: scale(.97); }
.qpath i { position: absolute; top: 8px; inset-inline-start: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 14px; background: #0f3b29; color: #e2c27a; }
.qpath .e { font-size: 34px; line-height: 1.2; }
.qpath b { font-size: 15px; line-height: 1.35; }
.qpath small { font-size: 12px; color: var(--ink3); line-height: 1.35; }
.qsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.qsteps li { position: relative; padding-bottom: 10px; }
.qsteps li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 29px; top: 44px; bottom: -6px; width: 3px; border-radius: 2px; background: var(--line); }
.qsteps a { position: relative; display: grid; grid-template-columns: 36px 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.qsteps a:hover { border-color: var(--brand); }
.qsteps i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; background: #0f3b29; color: #e2c27a; position: relative; z-index: 1; }
.qsteps .e { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: hsl(var(--h) 60% 92%); box-shadow: 0 0 0 3px hsl(var(--h) 55% 82%); }
.qsteps b { display: block; font-size: 16px; line-height: 1.35; }
.qsteps small { display: block; color: var(--ink3); font-size: 12.5px; line-height: 1.45; }
.qsteps .go { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
@media (min-width: 760px) { .qsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } .qsteps li:not(:last-child)::before { display: none; } }

/* Tajweed rule index: compact, one look, clearly a list of exercises (not 16 cards). */
.sh-h small { font-weight: 600; color: var(--ink3); font-size: 13px; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .rules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rule { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); }
.rule:hover { border-color: var(--brand); }
.rule i { grid-row: 1 / 3; min-width: 54px; height: 44px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 15px; white-space: nowrap; background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 50% 24%); }
.rule b { font-size: 14px; line-height: 1.3; align-self: end; }
.rule small { font-size: 11.5px; color: var(--ink3); align-self: start; }
:root[data-theme="dark"] .rule i { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 60% 82%); }

/* House style of the maharat dz picture cards: cream ground, deep green frame, thin gold line. */
.cover.glyph::after, .gtile::after { content: ""; position: absolute; inset: 5px; border-radius: 12px; pointer-events: none; border: 2px solid #1c5a39; box-shadow: inset 0 0 0 1.5px #d8b65a; z-index: 3; }
.cover.glyph { background-color: #fbf2dc; }
.gico { background: #fbf2dc; }
:root[data-theme="dark"] .cover.glyph::after, :root[data-theme="dark"] .gtile::after { border-color: #2f8f5d; }

/* Home: interactive-world band (2026-11-13) */
.band-note { margin: -4px 0 10px; color: var(--ink3); font-size: 13.5px; line-height: 1.6; }

/* Quran page: a section that is one thing (tajweed lessons, tuhfa) is one wide panel, not a lone card */
.qfeature { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: linear-gradient(135deg, hsl(var(--h) 45% 94%), var(--card)); border: 1.5px solid hsl(var(--h) 35% 78%); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.qfeature .e { flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center; font-size: 30px; border-radius: 16px; background: hsl(var(--h) 50% 88%); box-shadow: inset 0 0 0 2px #d8b65a; }
.qfeature .tx { flex: 1; min-width: 0; }
.qfeature b { display: block; font-size: 17px; line-height: 1.35; }
.qfeature small { display: block; color: var(--ink3); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.qfeature .go { flex: 0 0 auto; font-weight: 700; color: #fff; background: var(--brand); padding: 9px 14px; border-radius: 12px; font-size: 14px; }
.qfeature:active { transform: scale(.99); }
:root[data-theme="dark"] .qfeature { background: linear-gradient(135deg, hsl(var(--h) 25% 18%), var(--card)); border-color: hsl(var(--h) 25% 30%); }

/* Letter level picker: 28 letter tiles instead of a long list (2026-11-13) */
.lgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .lgrid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.lgrid a { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 18px; text-decoration: none; color: #15402a; background: linear-gradient(160deg, hsl(var(--h) 60% 95%), hsl(var(--h) 45% 86%)); border: 2px solid hsl(var(--h) 35% 72%); box-shadow: 0 4px 0 hsl(var(--h) 30% 70%); transition: transform .12s ease, box-shadow .12s ease; }
.lgrid a:active { transform: translateY(3px); box-shadow: 0 1px 0 hsl(var(--h) 30% 70%); }
.lgrid a:focus-visible { outline: 3px solid #d6ad52; outline-offset: 2px; }
.lgrid b { font-size: clamp(30px, 9vw, 40px); line-height: 1; font-weight: 800; }
.lgrid small { position: absolute; top: 5px; inset-inline-start: 7px; font-size: 11px; font-weight: 700; color: hsl(var(--h) 30% 38%); }
:root[data-theme="dark"] .lgrid a { color: #eaf5e6; background: linear-gradient(160deg, hsl(var(--h) 25% 22%), hsl(var(--h) 25% 16%)); border-color: hsl(var(--h) 25% 32%); box-shadow: 0 4px 0 hsl(var(--h) 25% 10%); }
:root[data-theme="dark"] .lgrid small { color: hsl(var(--h) 30% 70%); }
