/* =========================================================
   Buruj Quran — inner pages: reader, community, explore, library
   ========================================================= */

.toast { position: fixed; left: 50%; bottom: 110px; z-index: 120; transform: translate(-50%, 20px); padding: 11px 20px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .3s var(--ease); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: calc(var(--nav-h) + 64px) 0 56px; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse 60% 80% at 80% 0, color-mix(in srgb, var(--em) 16%, transparent), transparent 70%), radial-gradient(ellipse 50% 80% at 10% 0, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%), var(--bg-alt); border-bottom: 1px solid var(--line-soft); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pattern) 0 0/80px; opacity: var(--pattern-o); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.page-hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); margin: 16px 0 16px; }
.page-hero .lead { font-size: 1.1rem; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: end; }
.hero-stats-row { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats-row.four { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 26px 48px; }

/* ---------- Reader ---------- */
.reader { padding-top: var(--nav-h); --fs: 2.2rem; }
.reader-bar { position: sticky; top: var(--nav-h); z-index: 40; background: var(--glass); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line-soft); }
.reader-bar-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; flex-wrap: wrap; }
.surah-pick { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.surah-pick .rub { width: 34px; height: 34px; font-size: .74rem; }
.surah-pick:hover { border-color: var(--gold); }
.reader-bar .sp { margin-inline-start: auto; }
.tabs.sm button { height: 32px; padding: 0 14px; font-size: .82rem; }
.reader-bar .chip { height: 32px; font-size: .8rem; }
.reader-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 350px; gap: 28px; align-items: start; padding: 28px 0 150px; }
.rail { position: sticky; top: calc(var(--nav-h) + 84px); max-height: calc(100vh - var(--nav-h) - 190px); overflow: auto; padding: 10px; scrollbar-width: thin; }
.rail-title { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: .9rem; color: var(--muted); }
.rail a .num { width: 24px; flex: none; font-size: .74rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.rail a b { font-weight: inherit; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail a .ar { margin-inline-start: auto; flex: none; white-space: nowrap; font-size: .98rem; line-height: 1.5; opacity: .7; }
.rail a:hover { background: var(--line-soft); color: var(--text); }
.rail a.is-on { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); font-weight: 600; }
.rail a.is-on .num { color: var(--gold); }

.surah-head { text-align: center; padding: 10px 0 30px; }
.cartouche { position: relative; display: inline-grid; place-items: center; padding: 22px clamp(36px, 8vw, 90px); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%), var(--surface); }
.cartouche::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--line); border-radius: 13px; opacity: .7; }
.cartouche::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--pattern) center/48px; opacity: calc(var(--pattern-o) * .8); -webkit-mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000); mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000); }
.cartouche .ar { position: relative; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.6; color: var(--gold); }
.surah-head h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; line-height: 1.1; }
.surah-head .sub { color: var(--muted); margin-top: 6px; }
.surah-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.bism { font-size: clamp(1.7rem, 3.6vw, 2.5rem); text-align: center; color: var(--text); margin: 6px 0 26px; }

.ayah { position: relative; padding: 22px 24px; margin-bottom: 12px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--surface); transition: border-color .3s, box-shadow .3s, background .3s; scroll-margin-top: calc(var(--nav-h) + 90px); cursor: pointer; }
.ayah:hover { border-color: var(--line); }
.ayah.is-sel { border-color: var(--gold); }
.ayah.is-playing { border-color: var(--gold); background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 70%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 12%, transparent); }
.ayah-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ayah-top .ref { font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--gold); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 12%, transparent); margin-inline-end: auto; }
.ayah-top .icon-btn { width: 34px; height: 34px; border-color: transparent; }
.ayah .ar-line { font-family: var(--quran); direction: rtl; font-size: var(--fs); line-height: 2.25; text-align: right; }
.ayah .ar-line .w { border-radius: 8px; padding: 0 3px; transition: color .2s, background .2s; }
.ayah .ar-line .w.is-on { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.end { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; margin-inline: .25em; border-radius: 50%; border: 1px solid var(--gold); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); font-size: .42em; font-family: var(--quran); color: var(--gold); line-height: 1; vertical-align: middle; }
.wbw-on .ayah .ar-line.has-gloss { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 6px; line-height: 2.3; }
.wbw-on .ayah .ar-line.has-gloss .w { display: inline-grid; justify-items: center; text-align: center; padding: 4px 10px 8px; }
.wbw-on .ayah .ar-line.has-gloss .w:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); }
.w { cursor: pointer; }
.w small { display: none; font-family: var(--sans); direction: ltr; line-height: 1.3; font-size: .74rem; color: var(--muted); max-width: 11em; }
.wbw-on .has-gloss .w .g-en { display: block; }
.gl-ur.wbw-on .has-gloss .w .g-en { display: none; }
.gl-ur.wbw-on .has-gloss .w .g-ur { display: block; font-family: var(--urdu); direction: rtl; font-size: .82rem; line-height: 2.1; }
.mk { color: var(--gold); opacity: .85; }
.wbw-on .has-gloss .mk { align-self: flex-start; padding-top: .35em; }
.wbw-on .has-gloss .end { align-self: flex-start; margin-top: .9em; }
.ayah .tl { font-style: italic; color: var(--faint); font-size: .92rem; margin-top: 10px; }
.ayah .en { margin-top: 12px; font-size: 1.04rem; }
.ayah .ur { margin-top: 10px; font-size: 1.12rem; color: var(--muted); text-align: right; }
.ayah .src { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-top: 4px; font-family: var(--sans); direction: ltr; }
.ayah .ur .src { text-align: right; }
.hide-tl .tl, .hide-en .en, .hide-ur .ur { display: none; }

.mushaf { padding: clamp(26px, 5vw, 60px); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); position: relative; }
.mushaf::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--line); border-radius: 20px; opacity: .6; pointer-events: none; }
.mushaf p { font-family: var(--quran); direction: rtl; font-size: calc(var(--fs) * 1.08); line-height: 2.5; text-align: justify; text-align-last: center; }
.mushaf .w { border-radius: 8px; transition: .2s; cursor: pointer; }
.mushaf .v:hover { color: var(--gold); }
.mushaf .v.is-playing { color: var(--gold); }
.surah-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.notice { padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: .88rem; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.notice .i { color: var(--gold); margin-top: 3px; }
.skel { height: 120px; border-radius: var(--r); margin-bottom: 12px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0/300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

.study { position: sticky; top: calc(var(--nav-h) + 84px); max-height: calc(100vh - var(--nav-h) - 190px); overflow: auto; scrollbar-width: thin; }
.study-head { padding: 18px 20px 0; }
.study-head .ar { font-size: 1.5rem; line-height: 1.9; color: var(--gold); }
.study-tabs { display: flex; gap: 4px; padding: 12px 14px 0; border-bottom: 1px solid var(--line-soft); }
.study-tabs button { padding: 9px 11px; font-size: .84rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.study-tabs button.is-on { color: var(--gold); border-color: var(--gold); }
.study-body { padding: 18px 20px 22px; font-size: .93rem; }
.study-body h4 { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 16px 0 8px; }
.study-body textarea { width: 100%; min-height: 130px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface-2); resize: vertical; outline: 0; }
.study-body textarea:focus { border-color: var(--gold); }
.mini-ref { display: block; padding: 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; border: 1px solid transparent; }
.mini-ref:hover { border-color: var(--line); }
.mini-ref b { font-size: .84rem; display: flex; align-items: center; gap: 8px; }
.mini-ref p { font-size: .86rem; color: var(--muted); margin-top: 4px; }

.playerbar { position: fixed; left: 50%; bottom: 18px; z-index: 55; transform: translateX(-50%); width: min(1040px, calc(100% - 32px)); display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.5fr) auto; align-items: center; gap: 20px; padding: 12px 18px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pb-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-info b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-info small { color: var(--muted); font-size: .78rem; }
.pb-ctrl { display: flex; align-items: center; gap: 6px; }
.pb-play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #f4dfa6, #d9b66c 50%, #b98c3c); color: #1a1305; transition: transform .2s; }
.pb-play:hover { transform: scale(1.07); }
.pb-prog { display: flex; align-items: center; gap: 12px; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.pb-track { flex: 1; height: 6px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.pb-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); border-radius: inherit; }
.pb-extra { display: flex; align-items: center; gap: 6px; }
.pb-extra .chip { height: 34px; font-size: .78rem; padding: 0 12px; }

.sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(400px, 100%); padding: 26px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .45s var(--ease); overflow: auto; }
.sheet.open { transform: none; }
.sheet h3 { font-family: var(--serif); font-size: 1.8rem; font-weight: 500; }
.sheet h4 { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 24px 0 10px; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; }
.sheet input[type=range] { width: 100%; accent-color: var(--gold); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-soft); margin-bottom: 8px; font-size: .92rem; cursor: pointer; }
.opt small { color: var(--faint); display: block; font-size: .78rem; }
.opt input { accent-color: var(--gold); width: 18px; height: 18px; }
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.swatch { padding: 14px; border-radius: 12px; border: 1px solid var(--line-soft); text-align: left; font-size: .86rem; font-weight: 600; }
.swatch.is-on { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 25%, transparent); }
.swatch i { display: block; height: 30px; border-radius: 8px; margin-bottom: 8px; }

/* ---------- Community ---------- */
.comm-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 320px; gap: 28px; align-items: start; padding: 32px 0 100px; }
.side-nav { position: sticky; top: calc(var(--nav-h) + 22px); display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 500; color: var(--muted); font-size: .95rem; }
.side-nav a:hover { background: var(--line-soft); color: var(--text); }
.side-nav a.is-on { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); font-weight: 600; }
.side-nav a em { margin-inline-start: auto; font-style: normal; font-size: .72rem; color: var(--faint); }
.side-nav hr { border: 0; border-top: 1px solid var(--line-soft); margin: 10px 0; width: 100%; }
.side-nav .rail-title { padding: 6px 14px; }
.pane { display: none; }
.pane.is-on { display: block; animation: swap .45s var(--ease); }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pane-head h2 { font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.composer { padding: 18px; margin-bottom: 18px; }
.composer-row { display: flex; gap: 12px; }
.composer textarea { flex: 1; min-height: 64px; border: 0; outline: 0; background: none; resize: none; font-size: 1rem; padding-top: 8px; }
.composer-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-soft); margin-top: 8px; }
.composer select { height: 36px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--surface-2); padding: 0 12px; font-size: .84rem; outline: 0; max-width: 220px; }
.feed .post { margin-bottom: 16px; }
.post .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: .84rem; color: var(--em); }
.comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: grid; gap: 12px; }
.comment { display: flex; gap: 10px; font-size: .9rem; }
.comment div { padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); }
.comment b { font-size: .84rem; display: block; }
.comment-form { display: flex; gap: 10px; align-items: center; }
.comment-form input { flex: 1; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--surface-2); outline: 0; font-size: .9rem; }
.comment-form input:focus { border-color: var(--gold); }

.board { display: grid; grid-template-columns: 48px minmax(0, 1.3fr) 90px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); transition: background .2s; }
.board:last-child { border-bottom: 0; }
.board:hover { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.board .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); }
.board h3 { font-size: 1rem; font-weight: 700; }
.board p { font-size: .84rem; color: var(--muted); }
.board .cnt { text-align: center; font-size: .78rem; color: var(--faint); }
.board .cnt b { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.board .last { font-size: .82rem; color: var(--muted); min-width: 0; }
.board .last b { display: block; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.thread:last-child { border: 0; }
.thread b { display: block; font-size: .96rem; }
.thread small { color: var(--faint); font-size: .8rem; }
.thread .n { margin-inline-start: auto; display: flex; gap: 14px; font-size: .8rem; color: var(--faint); white-space: nowrap; }
.thread .n span { display: inline-flex; align-items: center; gap: 5px; }
.circles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.circle { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.circle h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.15; }
.circle p { font-size: .88rem; color: var(--muted); }
.circle-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--faint); }
.circle-meta span { display: inline-flex; gap: 6px; align-items: center; }
.circle-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.qa { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 16px; padding: 20px; margin-bottom: 12px; }
.vote { display: grid; justify-items: center; gap: 2px; align-content: start; }
.vote button { width: 40px; height: 34px; border-radius: 10px; border: 1px solid var(--line-soft); display: grid; place-items: center; color: var(--muted); }
.vote button:hover, .vote button.is-on { color: var(--gold); border-color: var(--gold); }
.vote b { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.qa h3 { font-size: 1.06rem; font-weight: 700; line-height: 1.35; }
.qa p { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.qa-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: .8rem; color: var(--faint); }
.rail-card { padding: 20px; margin-bottom: 16px; }
.rail-card h3 { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rail-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: .9rem; }
.rail-list li small { color: var(--faint); display: block; font-size: .78rem; }
.rail-list li .n { margin-inline-start: auto; font-size: .78rem; color: var(--faint); }
.rank { width: 22px; font-family: var(--serif); font-size: 1.2rem; color: var(--gold); text-align: center; }
.principles li { display: flex; gap: 10px; font-size: .88rem; color: var(--muted); padding: 6px 0; }
.principles .i { color: var(--em); margin-top: 3px; }
.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; background: rgba(3, 6, 12, .7); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box { width: min(460px, 100%); padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.modal-box h3 { font-family: var(--serif); font-size: 2rem; font-weight: 500; margin: 10px 0 6px; }
.modal-box input { width: 100%; height: 48px; margin-top: 10px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface-2); outline: 0; }
.modal-box input:focus { border-color: var(--gold); }

/* ---------- Explore ---------- */
.ask-box { margin-top: 26px; max-width: 640px; }
.ask-box .search-box { background: var(--surface); border-color: var(--line); }
.browse-tabs { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.topics-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.topic.sm { min-height: 0; padding: 16px 18px; flex-direction: row; align-items: center; gap: 14px; }
.topic.sm h3 { font-size: 1.15rem; }
.topic.sm p { margin: 0; font-size: .78rem; }
.topic.sm .tico { width: 40px; height: 40px; flex: none; font-family: var(--serif); font-weight: 600; }
.topic.sm.is-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.qa-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.q-list { padding: 8px; }
.q-item { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px; border-radius: 12px; transition: .2s; }
.q-item:hover { background: var(--line-soft); }
.q-item.is-on { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.q-item .qn { font-family: var(--serif); font-size: 1.3rem; color: var(--gold); width: 26px; flex: none; line-height: 1.2; }
.q-item b { font-weight: 600; font-size: .96rem; display: block; line-height: 1.35; }
.q-item small { color: var(--faint); font-size: .78rem; }
.answer { padding: 28px; position: sticky; top: calc(var(--nav-h) + 20px); }
.answer h3 { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.15; }
.answer .ans-ayah { margin-top: 18px; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.answer .ans-ayah .ar { font-size: 1.7rem; }
.answer .ans-ayah p { color: var(--muted); margin-top: 8px; font-style: italic; }
.answer .ans-ayah a { display: inline-block; margin-top: 10px; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.theme { padding: 24px; min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: #f7efd9; background: linear-gradient(150deg, var(--c1), var(--c2)); border: 0; position: relative; overflow: hidden; }
.theme::before { content: ""; position: absolute; inset: 0; background: var(--pattern) center/60px; opacity: .2; mix-blend-mode: overlay; }
.theme .kufi { position: absolute; top: 14px; right: 18px; font-size: 2.6rem; opacity: .5; line-height: 1.3; transition: .5s var(--ease); }
.theme:hover .kufi { opacity: .9; transform: scale(1.08); }
.theme h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; position: relative; }
.theme p { font-size: .84rem; opacity: .85; position: relative; }

/* ---------- Library ---------- */
.lib-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.lib-filters { position: sticky; top: calc(var(--nav-h) + 22px); display: grid; gap: 22px; }
.lib-filters h4 { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.lib-filters button { display: flex; width: 100%; justify-content: space-between; padding: 8px 12px; border-radius: 10px; font-size: .9rem; color: var(--muted); text-align: left; }
.lib-filters button:hover { background: var(--line-soft); color: var(--text); }
.lib-filters button.is-on { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); font-weight: 600; }
.lib-filters button span { font-size: .76rem; color: var(--faint); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px 22px; }
.book-card { display: grid; gap: 14px; }
.book-card .book { width: 100%; }
.book-card h3 { font-weight: 700; font-size: .98rem; line-height: 1.3; }
.book-card p { font-size: .82rem; color: var(--muted); }
.book-card .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.book-card .tag { font-size: .62rem; padding: 3px 8px; }
.collections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.reading-now { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 26px; padding: 26px; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .reader-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .reader-grid > .rail { display: none; }
  .comm-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .comm-layout > .side-nav { position: static; grid-column: 1 / -1; display: flex; overflow: auto; }
  .side-nav hr, .side-nav .rail-title, .side-nav .extra { display: none; }
  .side-nav a { white-space: nowrap; }
  .themes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .reader-grid, .comm-layout, .qa-layout, .lib-layout, .page-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .study, .answer, .lib-filters { position: static; max-height: none; }
  .lib-filters { grid-template-columns: 1fr 1fr; }
  .playerbar { grid-template-columns: minmax(0, 1fr) auto; }
  .pb-prog, .pb-extra { display: none; }
  .circles, .collections { grid-template-columns: 1fr; }
  .board { grid-template-columns: 48px minmax(0, 1fr); }
  .board .cnt, .board .last { display: none; }
  .reading-now { grid-template-columns: 1fr; }
}

/* ---------- Learn ---------- */
.learn-today { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 16px; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.quiz { padding: clamp(24px, 4vw, 40px); text-align: center; min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.quiz .tag { margin-inline: auto; }
.quiz .q-ar { font-family: var(--quran); direction: rtl; font-size: clamp(3rem, 7vw, 4.8rem); line-height: 2.3; padding-bottom: .12em; color: var(--gold); }
.quiz-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 20px; }
.quiz-dots i { width: 28px; height: 5px; border-radius: 3px; background: var(--surface-3); transition: background .3s; }
.quiz-dots i.now { background: var(--gold); }
.quiz-dots i.ok { background: var(--em); }
.quiz-dots i.no { background: var(--rose); }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 18px; }
.quiz-opt { padding: 15px 12px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--surface-2); font-weight: 600; transition: .2s var(--ease); }
.quiz-opt:hover { border-color: var(--gold); transform: translateY(-2px); }
.quiz-opt.right { border-color: var(--em); color: var(--em); background: color-mix(in srgb, var(--em) 14%, var(--surface-2)); }
.quiz-opt.wrong { border-color: var(--rose); color: var(--rose); }
.quiz-note { margin-top: 16px; font-size: .9rem; min-height: 1.5em; }
.steps { list-style: none; display: grid; gap: 8px; counter-reset: s; }
.steps li { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--surface); }
.steps .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); }
.steps b { font-size: 1rem; }
.steps p { font-size: .88rem; color: var(--muted); }
.hifz-card, .recall { padding: clamp(20px, 3vw, 30px); }
.juz-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.juz-cell { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); position: relative; overflow: hidden; }
.juz-cell::before { content: ""; position: absolute; inset: auto 0 0 0; height: var(--p, 0%); background: linear-gradient(0deg, var(--em-lo), var(--em)); opacity: .8; transition: height 1.4s var(--ease) .3s; }
.juz-cell span { position: relative; }
.juz-cell.full { color: #eafff8; border-color: var(--em); }
.recall-line { font-family: var(--quran); direction: rtl; font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 2.6; text-align: center; margin: 14px 0; }
.rw { display: inline-block; padding: 0 8px; border-radius: 10px; color: transparent; background: linear-gradient(var(--line), var(--line)) bottom / 100% 2px no-repeat; cursor: pointer; user-select: none; transition: color .4s, background-color .2s; line-height: 2; }
.rw:not(.shown):hover { background-color: color-mix(in srgb, var(--gold) 14%, transparent); }
.rw.shown { color: var(--text); background-image: none; cursor: default; }
.plan { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 4vw, 44px); align-items: center; }
.lbl-sm { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--faint); }
.plan-days { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.plan-days b { font-family: var(--serif); font-size: clamp(4rem, 9vw, 6.4rem); font-weight: 500; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.plan-days span { font-size: 1.1rem; color: var(--muted); }
.plan input[type=range] { width: 100%; accent-color: var(--gold); }
@media (max-width: 1100px) { .learn-today { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .learn-today, .lesson-layout, .plan { grid-template-columns: minmax(0, 1fr); }
  .learn-today .dash-continue { grid-column: auto; }
  .juz-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Reader: word details ---------- */
.wpop { position: absolute; z-index: 70; width: min(290px, calc(100vw - 24px)); padding: 18px 18px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 4px; text-align: center; animation: swap .25s var(--ease); }
.wpop[hidden] { display: none; }
.wpop .icon-btn { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-color: transparent; }
.wpop > .ar { font-size: 2.3rem; line-height: 1.9; color: var(--gold); }
.wpop b { font-size: 1.05rem; }
.wpop .urdu { font-size: 1rem; color: var(--muted); }
.wpop small { color: var(--faint); font-size: .8rem; }
.root-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); font-size: .8rem; font-weight: 600; transition: .2s; }
.root-link:hover { background: var(--gold); color: var(--gold-ink); }
.root-link .kufi { font-size: 1rem; }
.word-row { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.word-row:last-child { border: 0; }
.word-row > .ar { font-size: 1.5rem; line-height: 1.8; text-align: center; color: var(--text); }
.word-row b { display: block; font-size: .92rem; }
.word-row .urdu { display: block; font-size: .92rem; color: var(--muted); line-height: 2; }
.word-row small { display: block; color: var(--faint); font-size: .76rem; font-style: italic; }
.word-row .root-link { margin-top: 6px; padding: 4px 10px; font-size: .72rem; }
.ayah .tl u, .ayah .tl b { text-decoration-color: var(--line); font-weight: inherit; }

/* ---------- Explore: word index ---------- */
.wrap.narrow { width: min(880px, 100% - 48px); }
.group-title { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; margin: 44px 0 16px; }
.group-title:first-child { margin-top: 0; }
.topic.sm p .kufi { color: var(--gold); }
.occ { padding: 20px 24px; margin-bottom: 12px; }
.occ .ref { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.occ .ar { font-size: 1.75rem; margin: 8px 0 6px; text-align: right; }
.occ .en { color: var(--muted); font-size: .96rem; }
.occ mark { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); border-radius: 8px; padding: 0 5px; }
.roots-all .chip { height: 40px; }
.back { font-size: .86rem; }
@media (max-width: 640px) { .wrap.narrow { width: min(880px, 100% - 32px); } .occ .ar { font-size: 1.5rem; } }

/* ---------- Learn: pickers, hifz list ---------- */
.pick { display: inline-flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pick select, .pick input { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 600 .95rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); outline: 0; max-width: 240px; }
.pick input { width: 92px; }
.pick select:focus, .pick input:focus { border-color: var(--gold); }
.pick-row { display: flex; gap: 14px; flex-wrap: wrap; }
.lesson-layout.top { align-items: start; }
.hifz-list { max-height: 430px; overflow: auto; scrollbar-width: thin; margin-inline: -8px; padding-inline: 8px; }
.hifz-row { display: grid; grid-template-columns: 28px minmax(0, 9rem) minmax(60px, 1fr) 5.4rem auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.hifz-row:last-child { border: 0; }
.hifz-row .num { color: var(--faint); font-size: .76rem; }
.hifz-row b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hifz-row input { width: 100%; accent-color: var(--em); }
.hifz-row .val { font-size: .78rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hifz-row .chip { height: 28px; padding: 0 10px; font-size: .74rem; }
.quiz-note .urdu { font-size: .95rem; }
.recall .mk { font-size: .8em; }
@media (max-width: 640px) {
  .hifz-row { grid-template-columns: 24px minmax(0, 1fr) 5rem auto; }
  .hifz-row input { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Tools: prayer times, compass, calendar, tasbih ---------- */
.times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.time { padding: 22px 12px; text-align: center; }
.time span { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--faint); }
.time b { display: block; font-family: var(--serif); font-size: clamp(1.4rem, 2.3vw, 2.1rem); font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time.next { border-color: var(--gold); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface)); }
.time.next span { color: var(--gold); }
.time.done b { color: var(--faint); }
.prefs { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 22px; margin-top: 16px; }
.compass-wrap { display: grid; place-items: center; }
.compass { width: min(360px, 80vw); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: radial-gradient(circle, var(--surface-2), var(--surface)); position: relative; display: grid; place-items: center; box-shadow: var(--shadow); }
.dial { position: absolute; inset: 14px; border-radius: 50%; border: 1px dashed var(--line); transition: transform .25s linear; }
.dial > span { position: absolute; font-size: .8rem; font-weight: 700; color: var(--faint); }
.dial .n { top: 8px; left: 50%; transform: translateX(-50%); color: var(--rose); }
.dial .s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.dial .e { right: 10px; top: 50%; transform: translateY(-50%); }
.dial .w { left: 10px; top: 50%; transform: translateY(-50%); }
.dial .needle-q { inset: 0; }
.needle-q i { position: absolute; left: 50%; top: 40px; width: 4px; height: calc(50% - 40px); margin-left: -2px; border-radius: 4px; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); }
.needle-q i::before { content: ""; position: absolute; left: 50%; top: -11px; transform: translateX(-50%); border: 9px solid transparent; border-top: 0; border-bottom: 13px solid var(--gold-hi); }
.compass .kaaba { position: relative; z-index: 1; width: 28px; height: 28px; background: #0b0f18; border: 1px solid var(--gold); border-radius: 4px; box-shadow: inset 0 6px 0 -3px var(--gold); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 22px; }
.cal .wd { text-align: center; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--faint); padding-bottom: 6px; }
.cal .day { border-radius: 14px; border: 1px solid var(--line-soft); padding: 12px 6px; text-align: center; background: var(--surface-2); }
.cal .day b { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.1; }
.cal .day span { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.cal .day.fri b { color: var(--em); }
.cal .day.today { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface-2)); }
.cal .day.today b { color: var(--gold); }
.tasbih.big button { width: 230px; height: 230px; font-size: 5.2rem; }
.tasbih button.hit { color: var(--em); border-color: var(--em); }
.soon-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.soon { padding: 24px; display: grid; gap: 8px; align-content: start; }
.soon .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); }
.soon h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.soon p { color: var(--muted); font-size: .92rem; }
.src-list { display: grid; gap: 12px; }
.src { padding: 22px 24px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
.src h3 { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding-top: 4px; }
.src b { font-size: 1.05rem; }
.src p { color: var(--muted); font-size: .93rem; margin-top: 4px; }
.src a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.src pre { margin: 12px 0 0; padding: 14px; border-radius: 12px; background: var(--surface-2); font: .74rem/1.5 ui-monospace, Consolas, monospace; color: var(--muted); white-space: pre-wrap; }
@media (max-width: 860px) {
  .times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .soon-list { grid-template-columns: 1fr; }
  .src { grid-template-columns: 1fr; gap: 6px; }
  .cal { padding: 12px; gap: 4px; }
  .cal .day { padding: 8px 2px; border-radius: 10px; }
  .cal .day b { font-size: 1.2rem; }
  .cal .day span { font-size: .6rem; }
}
@media (max-width: 640px) {
  .times { gap: 8px; }
  .time { padding: 18px 4px; }
  .time b { font-size: 1.25rem; }
}

/* ---------- Reader on a phone: keep the fixed chrome small so the ayah has the screen ---------- */
@media (max-width: 860px) {
  .page-reader .nav { position: absolute; }
  .page-reader .reader-bar { top: 0; }
  .page-reader .reader-bar .chip { display: none; }
  .page-reader .reader-bar-inner { flex-wrap: nowrap; min-height: 54px; }
  .page-reader .surah-pick { min-width: 0; }
  .page-reader .surah-pick #pick-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-reader .ayah { scroll-margin-top: 70px; padding: 18px 16px; }
  .playerbar { bottom: 10px; padding: 8px 12px; gap: 10px; border-radius: 18px; }
  .playerbar .pb-info small { display: none; }
  .playerbar .av { width: 36px; height: 36px; }
  .pb-play { width: 42px; height: 42px; }
  .reader-grid { padding-bottom: 110px; }
}
@media (max-width: 860px) {
  .page-reader .surah-pick { flex: 1; padding-right: 10px; }
  .page-reader .surah-pick > .i { display: none; }
  .page-reader .reader-bar .sp { display: none; }
  .page-reader .tabs.sm button { padding: 0 11px; }
}
