/* Fanous Books — site styles. Brand: deep teal #1C4A57, amber #FF9326, cream #fffaf3 */
:root {
  --teal: #1C4A57;
  --teal-2: #2E6B7A;
  --amber: #FF9326;
  --amber-ink: #A34E00;
  --cream: #fffaf3;
  --sand: #f6ecdc;
  --line: #eadcc6;
  --ink: #1d2a30;
  --muted: #5b6a70;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,74,87,.06), 0 8px 24px rgba(28,74,87,.08);
  /* 2026-11-14 audit fix 1: every stack ends with a real Arabic font ("Fanous Naskh" = self-hosted Noto Naskh Arabic subset, below),
     so Arabic words (the brand «فانوس», language links, lang="ar") never show as boxes on a device without Arabic fonts. */
  --serif: "Fraunces", Georgia, "Times New Roman", "Noto Naskh Arabic", "Fanous Naskh", serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Naskh Arabic", "Fanous Naskh", sans-serif;
  --arabic: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", "Fanous Naskh", serif;
  color-scheme: light;
}
@font-face { font-family: "Fanous Naskh"; src: url(/assets/fonts/noto-naskh-arabic-sub1.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Fanous Nastaliq"; src: url(/assets/fonts/noto-nastaliq-urdu-sub1.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.65 var(--sans); }
/* 2026-11-14 audit fix 4: page = flex column at least one screen tall, so on short pages (/account/, 404) the footer sits at the bottom */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > * { flex-shrink: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--amber-ink); }
h1, h2, h3 { font-family: var(--serif); color: var(--teal); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin-top: 1.4em; }
h3 { font-size: 1.15rem; }
h1 [lang="ar"], h2 [lang="ar"] { font-family: var(--arabic); font-weight: 600; color: var(--amber-ink); font-size: .8em; margin-inline-start: .3em; white-space: nowrap; }
p { margin: 0 0 1em; }
[lang="ar"] { font-family: var(--arabic); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.small { font-size: .9rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: #34454c; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--amber-ink); margin-bottom: .6em; }
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip: auto; inset-inline-start: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
section { padding: 28px 0; }

/* header */
.top { background: var(--teal); color: #fff; position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { filter: drop-shadow(0 0 8px rgba(255,190,90,.55)); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: var(--serif); font-size: 1.35rem; }
.brand small { font-size: .75rem; opacity: .8; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { background: rgba(255,255,255,.14); color: #fff; }
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 14px; }
.crumbs a { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; background: var(--teal); color: #fff; border: 2px solid var(--teal); line-height: 1.2; }
.btn:hover { background: var(--teal-2); border-color: var(--teal-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--teal); }
.btn.ghost:hover { background: var(--teal); color: #fff; }
.btn.apple { background: #111; border-color: #111; color: #fff; }
.btn.apple::before { content: ""; width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #ffb14a, #ff6a00); flex: none; }
.btn.apple:hover { background: #333; border-color: #333; }
.btn.soon { background: var(--sand); border-color: var(--line); color: var(--muted); cursor: default; }
.btn.soon::before { background: #cfc3b0; }
.btn.big { padding: 14px 24px; font-size: 1.05rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 12px; }

/* hero */
.hero { background: radial-gradient(900px 400px at 85% 30%, rgba(255,147,38,.18), transparent 70%), var(--sand); border-bottom: 1px solid var(--line); padding: 56px 0; }
.hero-in { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero-art { position: relative; aspect-ratio: 10 / 9; max-width: 520px; width: 100%; justify-self: center; }
.hero-art img { position: absolute; width: 58%; border-radius: 12px; box-shadow: var(--shadow), 0 20px 40px rgba(0,0,0,.12); }
.hero-art img:nth-child(1) { left: 0; top: 9%; transform: rotate(-5deg); }
.hero-art img:nth-child(2) { right: 0; top: 0; transform: rotate(4deg); }
.hero-art img:nth-child(3) { left: 21%; top: 34%; z-index: 2; }

/* features */
.band { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; margin-top: 36px; margin-bottom: 20px; }
.band h2 { margin-top: 0; }
.feats { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feats li { border-top: 3px solid var(--amber); padding-top: 14px; }
.feats h3 { margin-bottom: .35em; }
.feats p { color: var(--muted); font-size: .96rem; margin: 0; }

/* grids + cards */
.grid { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.card a { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); height: 100%; }
.cov { position: relative; display: block; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 8px; transition: transform .15s ease; }
.card a:hover .cov { transform: translateY(-3px); }
.cov img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.badge { position: absolute; top: 10px; right: 10px; z-index: 1; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.badge.free { background: var(--amber); color: #2a1600; }
.badge.soon { background: rgba(255,255,255,.92); color: var(--teal); }
.card .num { font-size: .78rem; font-weight: 700; color: var(--amber-ink); text-transform: uppercase; letter-spacing: .08em; }
.card .t { font-family: var(--serif); font-weight: 700; color: var(--teal); font-size: 1.08rem; line-height: 1.25; }
.card .ar { text-align: left; font-size: 1.05rem; color: #3a4a50; }
.card .hook { font-size: .9rem; color: var(--muted); line-height: 1.45; }

.series-teaser .st-head, .series-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.series-teaser .st-head > div { max-width: 760px; }
.series-head > div { max-width: 820px; }

/* book page */
.book-head { display: grid; grid-template-columns: minmax(260px, 460px) 1fr; gap: 44px; align-items: start; padding-top: 20px; }
.book-cover img { border-radius: 14px; box-shadow: var(--shadow), 0 24px 50px rgba(0,0,0,.14); width: 100%; }
.title-ar { text-align: left; font-size: 1.9rem; color: var(--amber-ink); margin: -.2em 0 .3em; line-height: 1.7; }
.byline { color: var(--muted); font-size: .95rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); font-size: .95rem; }
.facts dt { font-weight: 700; color: var(--teal); }
.facts dd { margin: 0; }
.prose > * { max-width: 780px; }
.prose > .faq { max-width: 860px; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .5em; }
.lesson, .ask { background: #fff; border-inline-start: 4px solid var(--amber); padding: 12px 16px; border-radius: 8px; }
.samples { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.samples figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.samples figcaption { padding: 14px 16px; }
.ar-text { display: block; font-size: 1.3rem; line-height: 2.1; color: var(--ink); }
.samples small { color: var(--muted); }
.words { width: 100%; max-width: 640px; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.words th, .words td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: start; }
.words th { background: var(--sand); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); }
.words td[lang="ar"] { font-size: 1.35rem; text-align: right; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px; font-weight: 600; }

/* author */
.author-teaser, .author-page { display: flex; gap: 32px; align-items: flex-start; }
.author-teaser img, .author-page img { flex: none; filter: drop-shadow(0 0 18px rgba(255,170,60,.5)); }
.booklist li { margin-bottom: .3em; }
.booklist [lang="ar"] { color: var(--muted); margin-inline-start: .4em; }

/* faq */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--teal); padding: 14px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

/* footer */
.foot { margin-top: 56px; background: var(--teal); color: #d8e6ea; padding: 36px 0 18px; font-size: .92rem; }
.foot a { color: #fff; }
.foot-in { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-in > div { max-width: 480px; }
.foot-brand { display: flex; align-items: center; gap: 8px; color: #fff; }
.foot nav { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 28px; align-content: start; }
.fine { margin-top: 24px; opacity: .7; font-size: .8rem; }

@media (max-width: 900px) {
  .hero-in, .book-head { grid-template-columns: 1fr; }
  .hero-art { max-width: 440px; }
  .feats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 36px 0; }
  .feats { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .band { padding: 24px 18px; }
  .nav a { padding: 6px 9px; font-size: .88rem; }
  .author-teaser, .author-page { flex-direction: column; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
}

/* Arabic landing page (/ar/) */
.ar-card { display: flex; flex-direction: column; }
.ar-card a { height: auto; }
.ar-card p { margin: 10px 0 0; }
.ar-card .btn { font-size: .85rem; padding: 8px 14px; }

/* graded readers: first-scene sample (Arabic + English) */
.scene-sample { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 24px; align-items: start; margin-top: 12px; }
.scene-sample img { width: 100%; height: auto; border-radius: 14px; }
.scene-text { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.scene-text h3 { margin: 0 0 8px; font-size: 1.05rem; }
.scene-text p { margin: 0 0 10px; line-height: 1.7; }
.scene-text .ar-text p { font-size: 1.15rem; line-height: 2; }
@media (max-width: 820px) { .scene-sample, .scene-text { grid-template-columns: 1fr; } }

/* 'Level 2 and 3 coming soon' note */
.note-soon { margin: 18px 0 4px; padding: 12px 16px; border-radius: 12px; background: var(--sand); border: 1px dashed var(--line); color: var(--ink); font-size: .95rem; }
.note-soon[dir=rtl] { text-align: right; }

/* read-aloud demo video */
.demo-video { margin: 26px auto 4px; max-width: 360px; text-align: center; }
.demo-video video { width: 100%; height: auto; border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.14); background: #f7f1e6; }
.demo-video figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); line-height: 1.5; }

/* ---------- shop (buy on this site) ---------- */
.shop-buy { margin: 14px 0 18px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 440px; }
.shop-buy.mini { max-width: none; padding: 12px 14px; margin: 8px 0 0; }
.shop-buy.bundle { max-width: 520px; margin: 18px 0 8px; }
.shop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 800; color: var(--teal); font-size: 1.05rem; }
.shop-price { white-space: nowrap; }
.shop-price small { font-size: .7em; font-weight: 600; color: var(--muted); }
.shop-sar { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; text-align: end; }
.shop-sub, .shop-lead { font-size: .9rem; color: var(--muted); margin: 6px 0 12px; line-height: 1.45; }
.shop-email { display: block; font-size: .85rem; font-weight: 700; color: var(--teal); margin: 0 0 12px; }
.shop-email input, .shop-signin input, .acct-form input, .acct-form select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; border: 1.5px solid var(--line); border-radius: 10px; background: var(--cream); }
.shop-email input:focus, .shop-signin input:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.shop-wallets { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.shop-wallets:empty { display: none; }
apple-pay-button.shop-applepay { --apple-pay-button-width: 100%; --apple-pay-button-height: 45px; --apple-pay-button-border-radius: 999px; display: block; }
.shop-googlepay { width: 100%; }
.shop-msg { font-size: .9rem; margin: 10px 0 0; color: var(--teal); }
.shop-msg.err { color: #a12a1e; }
.shop-owned { font-weight: 700; color: var(--teal); margin: 0 0 10px; }
.shop-read { margin-top: 4px; }
.account h1 { margin-bottom: 8px; }
.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.acct-head h2 { margin: 0; }
.shop-signin { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; max-width: 520px; }
.shop-signin input { flex: 1 1 240px; margin: 0; }
.acct-form { max-width: 520px; display: grid; gap: 12px; }
.acct-form label { font-size: .85rem; font-weight: 700; color: var(--teal); }
.acct-form label.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.acct-form label.chk input { width: auto; margin: 0; }
html[lang="ar"] .shop-head, html[lang="ar"] .shop-email, html[lang="ar"] .shop-sub, html[lang="ar"] .shop-signin { direction: rtl; }
.alt-store { display: inline-block; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; margin-top: 2px; }
.alt-store:hover { color: var(--teal); }
.ar-card .alt-store { font-size: .8rem; }
.shop-pay { width: 100%; justify-content: center; font-size: 1.05rem; padding: 13px 20px; }
.shop-methods { margin: 8px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.shop-test { margin: 8px 0 0; font-size: .78rem; color: #8a4f1d; text-align: center; }
.nav .lang-switch { border: 1.5px solid rgba(255,255,255,.45); margin-inline-start: 6px; font-family: var(--arabic), var(--sans); }
html[lang="ar"] .nav { direction: rtl; }
html[lang="ar"] .nav a { font-family: var(--arabic); font-size: 1.05rem; }

/* ---------- Arabic (RTL) pages ---------- */
html[dir="rtl"] body { font-family: var(--arabic), var(--sans); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: var(--arabic); }
html[dir="rtl"] .card .ar, html[dir="rtl"] .title-ar, html[dir="rtl"] [lang="en"] { font-family: var(--sans); }
html[dir="rtl"] .card .ar { text-align: right; font-size: .95rem; }
html[dir="rtl"] h1 [lang="en"], html[dir="rtl"] h2 [lang="en"] { font-family: var(--serif); font-weight: 600; color: var(--amber-ink); font-size: .7em; margin-inline-start: .3em; white-space: nowrap; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
html[dir="rtl"] .card .num { letter-spacing: 0; }
html[dir="rtl"] .words td[lang="en"], html[dir="rtl"] .words th { text-align: right; }
html[dir="rtl"] .words td[lang="ar"] { text-align: right; }
html[dir="rtl"] .prevnext { direction: rtl; }
html[dir="rtl"] .scene-text [lang="en"] { text-align: left; }
html[dir="rtl"] .facts dt { font-family: var(--arabic); }
html[dir="rtl"] .nav .lang-switch { font-family: var(--sans); }
html[dir="rtl"] .hero-copy .lead, html[dir="rtl"] .lead { line-height: 1.9; }
html[dir="rtl"] .crumbs { direction: rtl; }
.shop-price.sar { font-size: 1.25rem; }
.sar-sym { font-family: var(--arabic); font-size: .8em; font-weight: 700; color: var(--teal); }
.shop-price.sar .shop-sar { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }
.shop-buy.bundle { border: 2px solid var(--amber); background: linear-gradient(180deg, #fff8ec, #fff); }
.shop-buy.bundle.compact { max-width: 440px; margin-top: 0; }
.series-teaser .shop-buy.bundle.compact { max-width: 560px; margin: 0 0 18px; }
.shop-save { display: inline-block; background: var(--amber); color: #1d1205; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-inline-start: 6px; vertical-align: middle; letter-spacing: .03em; }
html[dir="rtl"] .shop-save { letter-spacing: 0; }

/* ---- blog */
.posts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; max-width: none; }
.post-card a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; transition: transform .15s, box-shadow .15s; }
.post-card a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card img { width: 100%; height: auto; border-radius: 10px; aspect-ratio: 1200 / 630; object-fit: cover; margin-bottom: 6px; }
.post-meta { font-size: .85rem; color: var(--muted); }
.post-card .post-title { font-family: var(--serif); font-weight: 700; color: var(--teal); font-size: 1.2rem; line-height: 1.3; }
.post-card .post-desc { font-size: .95rem; color: #3a4a50; line-height: 1.5; }
.post .post-cover { width: 100%; max-width: 780px; height: auto; border-radius: 16px; margin: 18px 0 8px; }
.post .post-body > * { max-width: 780px; }
.post .post-body h2 { margin-top: 1.6em; }
.post .post-body img { max-width: 100%; height: auto; border-radius: 12px; }
.post .post-body blockquote { border-inline-start: 4px solid var(--amber); margin: 1.2em 0; padding: .2em 1em; color: #3a4a50; background: var(--sand); border-radius: 0 10px 10px 0; }
[dir="rtl"] .post .post-body blockquote { border-radius: 10px 0 0 10px; }
.post-cta { display: flex; gap: 20px; align-items: center; background: var(--sand); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; margin: 36px 0 8px; max-width: 780px; }
.post-cta img { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: var(--shadow); }
.post-cta h2 { margin: 0 0 .3em; font-size: 1.3rem; }
.post-cta p { margin: 0 0 .8em; color: #3a4a50; }
.more-posts { padding-bottom: 40px; }
@media (max-width: 600px) { .post-cta { flex-direction: column; align-items: flex-start; } }

/* ---- how children learn (home) */
.howto { margin-top: 28px; }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: none; }
.steps li { border-top: 3px solid var(--teal); padding-top: 14px; }
.steps h3 { margin: 0 0 .35em; }
.steps p { color: var(--muted); font-size: .96rem; margin: 0; }
.howto .center { text-align: center; margin-top: 22px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
/* --- home-screen app (build_app.py) --- */
.app-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.app-hero img { border-radius: 22px; box-shadow: var(--shadow); }
.app-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1em; }
.app-steps li { counter-increment: s; position: relative; padding: 10px 0 10px 46px; border-bottom: 1px solid var(--line); }
.app-steps li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
html[dir="rtl"] .app-steps li { padding: 10px 46px 10px 0; }
html[dir="rtl"] .app-steps li::before { left: auto; right: 0; }
.app-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; box-shadow: var(--shadow); }
.app-card h2 { margin-top: 0; }
.app-done { background: #e8f3ef; border-radius: var(--radius); padding: 12px 16px; }
.app-icon-inline { display: inline-block; vertical-align: -4px; width: 20px; height: 20px; }
.app-banner { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 0 18px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.app-banner img { border-radius: 10px; flex: none; }
.app-banner p { margin: 0; flex: 1; font-size: .92rem; line-height: 1.4; }
.app-banner .btn { padding: 8px 14px; }
.app-banner button { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.is-app .app-banner { display: none; }

/* reading profile card (account page) */
.profile-card { background: var(--cream, #fbf6ec); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 18px 6px; margin: 18px 0 26px; }
.profile-card fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.profile-card legend { font-weight: 700; color: var(--teal); margin-bottom: 8px; }
.profile-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-card .chips label { cursor: pointer; }
.profile-card .chips input { position: absolute; opacity: 0; pointer-events: none; }
.profile-card .chips span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: .95rem; }
.profile-card .chips input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.profile-card .chips input:focus-visible + span { outline: 2px solid var(--teal-2); outline-offset: 2px; }

/* Salla button + "choose your book" (2026-11-05) */
.shop-salla { margin-top: 10px; text-align: center; }
.shop-salla .shop-or { margin: 4px 0 8px; font-size: .85rem; color: var(--muted); }
.shop-salla-btn { display: block; width: 100%; box-sizing: border-box; text-align: center; }
.pick-book { margin: 18px 0; padding: 16px; border: 2px solid var(--accent, #b8862b); border-radius: 14px; }
.pick-book h4 { margin: 14px 0 8px; }
.pick-btn { all: unset; cursor: pointer; display: flex; flex-direction: column; width: 100%; }
.pick-btn:focus-visible { outline: 3px solid var(--accent, #b8862b); border-radius: 10px; }
.pick-btn[disabled] { opacity: .5; cursor: wait; }
/* 2026-11-09 Salla Mini Checkout Widget; the «ادفع عبر سلة» link is the fallback (hidden while the widget works) */
.shop-salla-btn[hidden], .shop-salla-widget[hidden] { display: none; }
.shop-salla-widget { display: flex; justify-content: center; min-height: 44px; }
.shop-salla-widget salla-mini-checkout-widget { display: block; width: 100%; }
.shop-salla-label { margin: 2px 0 8px; font-weight: 700; font-size: .95rem; }
/* 2026-11-09 sign-in: a wrong code must be impossible to miss; the browser-blocked-cookie notice */
.shop-msg.shop-code-err { display: block; background: #fdecea; border: 2px solid #c0392b; color: #8a1c12; border-radius: 10px; padding: 10px 12px; font-weight: 700; margin-top: 8px; }
.shop-code.shake { animation: shopshake .45s ease-in-out; }
@keyframes shopshake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .shop-code.shake { animation: none; } }
.shop-cookie-block { background: #fdecea; border: 2px solid #c0392b; border-radius: 12px; padding: 16px; }
.shop-cookie-block h2 { color: #8a1c12; margin-top: 0; }
.shop-cookie-block .btn { margin: 6px 6px 0 0; }

/* ---- round 3 (2026-11-10): answer-first lines, review dates, story pages, topic hubs, the two-step box */
.answer { font-size: 1.08rem; background: #fff; border-inline-start: 4px solid var(--teal); padding: 12px 16px; border-radius: 8px; max-width: 780px; }
.reviewed { font-size: .85rem; color: var(--muted); margin-top: -.4em; }
.hub-links { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; max-width: none; }
.hub-links a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .95rem; }
.hub-links a:hover { border-color: var(--amber); }
.hub-body .grid { max-width: none; margin: 14px 0 26px; }
.faq-open h3 { margin-top: 1.2em; }
.opening .ar-text p { margin: 0 0 .5em; }
.story-text { max-width: 860px; }
.story-unit { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0 0 22px; }
.story-unit > img { width: 100%; height: auto; }
.story-unit > p, .story-unit > small, .story-unit .scene-text { padding: 14px 18px; margin: 0; }
.story-unit > small { display: block; color: var(--muted); padding-top: 0; }
.story-unit.scene > img { max-width: 420px; margin: 16px auto 0; border-radius: 12px; }
.story-unit .scene-text { display: block; }
.story-unit .scene-text > div { margin-bottom: 10px; }
.story audio { width: 100%; max-width: 520px; display: block; }
.sell { background: var(--sand); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 36px; padding: 30px 0; }
.sell-in { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.sell-step { position: relative; padding-inline-start: 52px; }
.sell-n { position: absolute; inset-inline-start: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--amber); color: #3b1d00; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.sell h2 { margin: 2px 0 .35em; font-size: 1.35rem; }
.sell ul { margin: 0 0 .8em; padding-inline-start: 1.1em; }
.sell li { margin-bottom: .3em; }
.sell-alt { display: inline-block; margin-inline-start: 12px; font-size: .95rem; }
@media (max-width: 760px) { .sell-in { grid-template-columns: 1fr; } .sell-alt { display: block; margin: 10px 0 0; } }
.foot-topics { font-size: .9rem; line-height: 2; padding-top: 14px; padding-bottom: 6px; }
.foot-topics a { margin-inline-end: 14px; white-space: nowrap; }
.topics h2 { margin-top: .6em; }
.foot nav.foot-topics { display: block; }
.news-card { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; background: #fff; border: 2px solid var(--amber); border-radius: 14px; padding: 14px 16px; margin: 14px 0 18px; cursor: pointer; max-width: 620px; }
.news-card input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--teal); }
.news-card > span:nth-child(2) { flex: 1 1 220px; display: flex; flex-direction: column; }
.news-card small { color: var(--muted); }
.news-card .shop-msg { flex: 1 1 100%; margin: 0; }

/* ---- landing pages in other languages (2026-11-10) */
html[lang="ur"] main { font-family: var(--arabic); font-size: 1.12rem; line-height: 2; }
html[lang="ur"] main h1, html[lang="ur"] main h2, html[lang="ur"] main h3 { font-family: var(--arabic); line-height: 1.6; letter-spacing: 0; }
html[lang="ur"] main .eyebrow { letter-spacing: 0; }
.langpage [lang="ar"] { font-size: 1.08em; }
.foot-langs a { margin-inline-end: 14px; }
html[lang="ur"] main .js-price { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.langpage span[lang="ar"] { white-space: nowrap; }

/* 2026-11-14 audit fix 1: Urdu text — the current Naskh first, then the self-hosted Nastaliq before any system fallback */
[lang="ur"] { font-family: "Noto Naskh Arabic", "Fanous Nastaliq", "Fanous Naskh", serif; }
/* 2026-11-14 audit fix 4: the language links in the footer row keep normal left-to-right spacing (the RTL «اردو» link had its gap on the wrong side) */
.foot-langs a bdi { unicode-bidi: isolate; }
/* 2026-11-14 audit fix 5: "Have a code?" box on the signed-out library page */
.shop-codein { margin-top: 26px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }
.shop-codein h3 { margin: 0 0 6px; font-size: 1.1rem; }
.shop-codein p { margin: 0 0 10px; }
.shop-codein form { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-codein input { flex: 1 1 200px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; text-transform: uppercase; }
/* 2026-11-14 audit fix 6 (Step 0): visitors outside the Arab region see one currency; Salla (riyal) folds into a small link */
.shop-other-cur { display: block; margin: 10px auto 0; background: none; border: 0; padding: 4px; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: .88rem; cursor: pointer; }
/* 2026-11-14 v3: single-book choice under a series bundle box */
.shop-one { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed rgba(0,0,0,.15); font-size: .95rem; text-align: center; }
.shop-one a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
/* 2026-11-16: Printables page (/printables/, /ar/printables/) and the home-page block */
.pr-group { margin-top: 34px; }
.pr-group > p { color: var(--muted); max-width: 760px; }
.pr-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.pr-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--sand); }
.pr-card h3 { margin: 4px 0 0; font-family: var(--serif); font-size: 1.04rem; line-height: 1.3; color: var(--teal); }
.pr-card p { margin: 0; flex: 1; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.pr-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.pr-price { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.pr-buy .btn { padding: 9px 16px; font-size: .92rem; }
.pr-home { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.pr-home h2 { margin: 0 0 6px; }
.pr-home p { margin: 0; color: var(--muted); max-width: 640px; }
html[dir="rtl"] .pr-card h3 { font-family: var(--arabic); font-size: 1.1rem; }
