/* ===== Tokens ===== */
:root {
	--bg: #f7f5ef;
	--surface: #ffffff;
	--surface-2: #f2efe5;
	--ink: #1c2a23;
	--ink-soft: #3a4a42;
	--muted: #6d7771;
	--line: #e5e0d2;
	--green: #0f4d36;
	--green-2: #17694a;
	--green-soft: #e3efe8;
	--gold: #a9853a;
	--gold-soft: #efe3c4;
	--hl: #f6ecc9;
	--hl-strong: #ecd99a;
	--shadow: 0 1px 2px rgba(20, 40, 30, .05), 0 8px 24px rgba(20, 40, 30, .06);
	--radius: 14px;
	--hero-from: #0c3d2b;
	--hero-to: #145c41;
	--page: #fffdf6;
	--ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
	--display: "Amiri", "Traditional Arabic", serif;
	--quran: "Amiri Quran", "Amiri", serif;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0d1512; --surface: #141f1b; --surface-2: #1a2722; --ink: #e9e6dc; --ink-soft: #c9c6bb;
		--muted: #93a099; --line: #24342d; --green: #4fb487; --green-2: #3d9c72; --green-soft: #1c3329;
		--gold: #d6b46c; --gold-soft: #3a3322; --hl: #2c3a2a; --hl-strong: #3d4f35;
		--shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
		--hero-from: #08251b; --hero-to: #0f3f2d; --page: #17221d; color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #0d1512; --surface: #141f1b; --surface-2: #1a2722; --ink: #e9e6dc; --ink-soft: #c9c6bb;
	--muted: #93a099; --line: #24342d; --green: #4fb487; --green-2: #3d9c72; --green-soft: #1c3329;
	--gold: #d6b46c; --gold-soft: #3a3322; --hl: #2c3a2a; --hl-strong: #3d4f35;
	--shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
	--hero-from: #08251b; --hero-to: #0f3f2d; --page: #17221d; color-scheme: dark;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--ink);
	font-family: var(--ui); font-size: 15px; line-height: 1.7;
	transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

@font-face { font-family: "qcf_bsml"; src: url("/fonts/bsml.woff2") format("woff2"); font-display: block; }

/* ===== Header ===== */
.topbar {
	position: sticky; top: 0; z-index: 40;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 42px; height: 42px; color: var(--gold); }
.brand b { display: block; font-family: var(--display); font-size: 25px; line-height: 1; color: var(--green); font-weight: 700; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-inline-start: 18px; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--green); }
.nav a.on { color: var(--green); font-weight: 600; }
.nav a.on::after { content: ""; position: absolute; inset-inline: 14px; bottom: -14px; height: 2px; background: var(--green); border-radius: 2px; }
.tools { margin-inline-start: auto; display: flex; gap: 4px; }
.icon-btn {
	width: 40px; height: 40px; display: grid; place-items: center;
	border: 0; background: transparent; border-radius: 10px; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--green); }
.menu-btn { display: none; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }

/* ===== Hero ===== */
.hero {
	position: relative; overflow: hidden; color: #fff;
	background:
		radial-gradient(1000px 300px at 85% 0%, rgba(214, 180, 108, .18), transparent 60%),
		linear-gradient(135deg, var(--hero-from), var(--hero-to));
}
.hero::before {
	content: ""; position: absolute; inset: 0; opacity: .10;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
	-webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
	mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.hero .wrap { position: relative; padding-block: 44px 40px; display: grid; justify-items: center; text-align: center; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(38px, 6vw, 60px); line-height: 1.25; font-weight: 700; letter-spacing: 0; }
.hero p.lead { margin: 4px 0 22px; font-size: 17px; color: rgba(255,255,255,.82); }
.search {
	width: min(620px, 100%); display: flex; align-items: center; gap: 6px;
	background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 16px; height: 44px; color: #1c2a23; font-size: 15.5px; }
.search input::placeholder { color: #8a948e; }
.search button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--hero-from); color: #fff; display: grid; place-items: center; }
.search button:hover { background: #0a2f21; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chips a {
	display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px;
	border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.9); font-size: 14px;
}
.chips a:hover { background: rgba(255,255,255,.1); }
.chips svg.i { width: 17px; height: 17px; }

/* ===== Layout ===== */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 280px; gap: 20px; padding-block: 24px 120px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== Surah list ===== */
.surahs { position: sticky; top: 84px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; overflow: hidden; }
.surahs header { padding: 16px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.surahs h2 { margin: 0; font-size: 17px; font-family: var(--display); font-size: 21px; }
.surahs .close-drawer { display: none; }
.filter { margin: 0 14px 10px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.filter input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; }
.filter svg.i { width: 18px; color: var(--muted); }
.slist { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; scrollbar-width: thin; }
.slist a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.slist a:hover { background: var(--surface-2); }
.slist a.on { background: var(--green); color: #fff; }
:root[data-theme="dark"] .slist a.on { color: #08251b; }
.snum {
	width: 32px; height: 32px; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
	background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23a9853a' stroke-width='1.4'%3E%3Crect x='8' y='8' width='24' height='24' rx='2'/%3E%3Crect x='8' y='8' width='24' height='24' rx='2' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
}
.slist a.on .snum { filter: brightness(2.2); }
.sname { flex: 1; font-weight: 600; }
.smeta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.slist a.on .smeta { color: inherit; opacity: .8; }

/* ===== Reader ===== */
.reader { padding: 0; overflow: hidden; }
.banner {
	position: relative; padding: 22px 20px 18px; text-align: center;
	background: linear-gradient(var(--surface-2), var(--surface));
	border-bottom: 1px solid var(--line);
}
.banner .frame {
	display: inline-flex; align-items: center; gap: 18px; padding: 6px 28px;
	border: 1px solid var(--gold); border-radius: 999px; position: relative;
}
.banner .frame::before, .banner .frame::after { content: "۞"; color: var(--gold); font-size: 22px; line-height: 1; }
.banner h1 { margin: 0; font-family: var(--display); font-size: 32px; color: var(--green); font-weight: 700; }
.banner .meta { margin-top: 8px; font-size: 13.5px; color: var(--muted); display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.banner .meta span::before { content: "•"; margin-inline-end: 14px; color: var(--gold); }
.banner .meta span:first-child::before { content: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on, .seg a.on { background: var(--surface); color: var(--green); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg svg.i { width: 17px; height: 17px; }
.tb-spacer { flex: 1; }
.select {
	height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 10px;
	max-width: 200px; color: var(--ink);
}
.btn {
	height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
	border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 500;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #08251b; }
.btn.primary:hover { background: var(--green-2); color: #fff; }
.size-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.size-ctl button { width: 36px; height: 36px; border: 0; background: var(--surface); font-weight: 700; color: var(--ink-soft); }
.size-ctl button:hover { background: var(--surface-2); color: var(--green); }
.size-ctl button + button { border-inline-start: 1px solid var(--line); }

/* Mushaf page */
.stage { padding: 22px 18px 8px; }
.mushaf {
	--qsize: 30px;
	max-width: 640px; margin: 0 auto; padding: 28px 22px 18px; background: var(--page);
	border: 1px solid var(--gold-soft); border-radius: 6px; position: relative;
	box-shadow: inset 0 0 0 6px var(--page), inset 0 0 0 7px var(--gold-soft);
}
.mushaf .qp { display: block; font-size: var(--qsize); }
.mushaf .line { display: flex; justify-content: center; gap: 0; line-height: 2; direction: rtl; white-space: nowrap; }
.mushaf .line.justify { justify-content: space-between; }
.sura-head {
	margin: 0 auto 10px; max-width: 420px; text-align: center; font-family: "qcf_bsml"; font-size: 1.15em;
	line-height: 1.8; color: var(--green); border-block: 1px solid var(--gold); position: relative;
	background: linear-gradient(90deg, transparent, var(--gold-soft) 15%, var(--gold-soft) 85%, transparent);
}
.page-no { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.g { color: var(--ink); cursor: pointer; border-radius: 4px; padding-inline: .07em; transition: background .15s; }
.g.end { color: var(--gold); }
.g.hover { background: var(--hl); }
.g.sel { background: var(--hl-strong); }
.g.playing { background: var(--green-soft); color: var(--green); }

/* Ayah list view */
.ayah-card { border-bottom: 1px solid var(--line); padding: 16px 6px 14px; scroll-margin-top: 90px; }
.ayah-card:last-child { border-bottom: 0; }
.ayah-card.sel { background: linear-gradient(90deg, transparent, var(--hl) 30%, var(--hl) 70%, transparent); }
.ayah-card .qt { font-size: var(--qsize, 30px); line-height: 2.1; text-align: right; direction: rtl; }
.ayah-card .qt .g { cursor: text; }
.ayah-card .acts { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.ayah-card .acts .ref { font-size: 13px; color: var(--muted); margin-inline-end: auto; font-weight: 500; }
.ayah-card .icon-btn { width: 34px; height: 34px; }
.ayah-card .icon-btn svg.i { width: 18px; height: 18px; }
.icon-btn.on { color: var(--gold); }
.icon-btn.on svg.i { fill: currentColor; }

/* Tafsir */
.tafsir { margin: 14px 16px 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 0 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 12px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tabs .select { margin-inline-start: auto; height: 32px; font-size: 13.5px; }
.tafsir-body { padding: 16px 18px 18px; }
.tafsir-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tafsir-head h3 { margin: 0; font-size: 15.5px; color: var(--green); }
.tafsir-head .nav-ayah { margin-inline-start: auto; display: flex; gap: 4px; }
.tafsir-head .icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); }
.tafsir-text { font-size: 16.5px; line-height: 2; color: var(--ink-soft); max-height: 340px; overflow-y: auto; padding-inline-end: 6px; scrollbar-width: thin; }
.tafsir-text p { margin: 0 0 .6em; }

/* ===== Info aside ===== */
.side { display: grid; gap: 16px; position: sticky; top: 84px; }
.votd {
	position: relative; overflow: hidden; color: #fff; padding: 22px 20px 18px; text-align: center; border: 0;
	background: linear-gradient(160deg, var(--hero-to), var(--hero-from));
}
.votd::before { content: ""; position: absolute; inset: 0; opacity: .08; background: inherit; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 80 80'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z' fill='none' stroke='%23fff'/%3E%3C/svg%3E"); }
.votd small { position: relative; display: block; font-size: 12.5px; letter-spacing: 0; color: var(--gold-soft); color: #e7d3a0; margin-bottom: 6px; }
.votd q { position: relative; display: block; font-family: var(--quran); font-size: 25px; line-height: 2; quotes: "﴿" "﴾"; }
.votd q::before, .votd q::after { color: #e7d3a0; }
.votd cite { position: relative; display: block; font-style: normal; font-size: 13px; opacity: .8; margin-top: 4px; }
.info { padding: 16px 18px; }
.info h3 { margin: 0 0 10px; font-size: 15px; }
.info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; font-size: 14px; }
.info dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.info dt svg.i { width: 17px; height: 17px; color: var(--gold); }
.info dd { margin: 0; font-weight: 600; text-align: end; }
.continue { padding: 16px 18px; display: flex; gap: 12px; align-items: center; }
.continue .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.continue b { display: block; font-size: 14.5px; }
.continue span { font-size: 13px; color: var(--muted); }

/* ===== Audio bar ===== */
.player {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
	transform: translateY(110%); transition: transform .3s ease;
	padding: 0 12px 12px;
}
.player.show { transform: none; }
.player .inner {
	max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
.player .play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
:root[data-theme="dark"] .player .play { color: #08251b; }
.player .play svg.i { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.player .play .pause { display: none; }
.player.playing .play .pause { display: block; }
.player.playing .play .tri { display: none; }
.player .now { flex: 1; min-width: 0; }
.player .now b { display: block; font-size: 14.5px; }
.player .now span { font-size: 12.5px; color: var(--muted); }
.player .bar { height: 4px; background: var(--surface-2); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.player .bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s linear; }
.player .select { max-width: 150px; }

/* ===== Toast / footer / drawer ===== */
.toast {
	position: fixed; bottom: 96px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
	background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; transition: .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.foot b { display: block; font-family: var(--display); color: var(--green); font-size: 21px; margin-bottom: 4px; font-weight: 700; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 70; opacity: 0; pointer-events: none; transition: .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
	.layout { grid-template-columns: 270px minmax(0, 1fr); }
	.side { grid-column: 1 / -1; position: static; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
	.wrap { padding: 0 16px; }
	.nav { display: none; }
	.menu-btn { display: grid; }
	.topbar .wrap { gap: 8px; height: 60px; }
	.brand svg { width: 36px; height: 36px; }
	.brand b { font-size: 22px; }
	.brand small { display: none; }
	.tools .hide-sm { display: none; }
	.hero .wrap { padding-block: 28px 26px; }
	.hero p.lead { font-size: 15px; margin-bottom: 16px; }
	.layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 16px; }
	.surahs {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); max-height: none; z-index: 80;
		border-radius: 0; transform: translateX(100%); transition: transform .3s ease;
	}
	.surahs.open { transform: none; }
	.surahs .close-drawer { display: grid; }
	.side { grid-template-columns: 1fr; }
	.stage { padding: 14px 8px 4px; }
	.mushaf { padding: 18px 8px 12px; }
	.toolbar { padding: 10px 12px; gap: 8px; }
	.toolbar .select { max-width: 150px; }
	.tafsir { margin: 12px 10px 14px; }
	.player .select { display: none; }
}
@media (max-width: 420px) {
	.chips a { padding: 5px 11px; font-size: 13px; }
	.banner h1 { font-size: 27px; }
	.toolbar .tb-spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ======================================================================
   إضافات الموقع الكامل
   ====================================================================== */
[hidden] { display: none !important; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--green); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 10px; }
.muted { color: var(--muted); }
.narrow { max-width: 900px; }
.block { padding-block: 28px 8px; }
.block-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.block-head h1, .block-head h2 { margin: 0; font-family: var(--display); font-size: 28px; color: var(--green); font-weight: 700; margin-inline-end: auto; }
.block-head .more { color: var(--green); font-weight: 600; }
.block-head .filter { margin: 0; min-width: 220px; }
main { min-height: 60vh; padding-bottom: 110px; }

/* QCF fonts: النص مخفي حتى يُحمَّل خط صفحته */
.qp { visibility: hidden; }
.qp.ready { visibility: visible; }
.sura-head, .bism { font-family: "qcf_bsml"; }
.bism { text-align: center; font-size: 1.05em; line-height: 2; color: var(--ink); }
.mushaf .line { justify-content: space-between; }
.mushaf .line.c { justify-content: center; }
.mushaf { margin-bottom: 8px; }
.page-no { display: block; margin: 4px 0 18px; }
a.page-no:hover { color: var(--green); }

/* Drawer */
.drawer-host .surahs { display: none; }
.drawer-nav { display: none; }

/* Home */
.home-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; padding-top: 24px; }
.home-top .votd { display: grid; align-content: center; min-height: 190px; }
.home-top .votd q { font-size: 24px; }
.quick { display: grid; gap: 12px; }
.quick .continue { padding: 14px 16px; }
.quick .continue:hover, .scard:hover, .jcard:hover, .tcard:hover { border-color: var(--gold); transform: translateY(-1px); }
.sgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sgrid.compact { margin: 14px 0; }
.scard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: transform .15s, border-color .15s; height: 100%; }
.scard .snum { width: 40px; height: 40px; font-size: 13.5px; }
.sbody { flex: 1; min-width: 0; }
.sbody b { display: block; font-size: 16.5px; }
.sbody small { color: var(--muted); font-size: 12.5px; }
.scard .smeta { text-align: end; line-height: 1.5; }
.jgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.jcard { display: block; padding: 12px 14px; transition: transform .15s, border-color .15s; }
.jcard b { display: block; color: var(--green); }
.jcard small { color: var(--muted); font-size: 12.5px; }
.tgrid { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tcard { display: flex; gap: 12px; align-items: center; padding: 12px 14px; transition: transform .15s, border-color .15s; height: 100%; }
.tcard .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.tcard b { display: block; }
.tcard small { color: var(--muted); font-size: 12.5px; }
.group-h { font-size: 17px; margin: 18px 0 10px; }
.group-h small { color: var(--muted); font-weight: 400; }
.lead-p { margin-top: -6px; }

/* Reader extras */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 16px 18px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); padding: 18px 0 12px; }
.crumbs a:hover { color: var(--green); }
.reader.single { margin-bottom: 20px; }
.ayah-card.big { border: 0; padding: 10px 4px; background: none; }
.ayah-card.big .qt { font-size: calc(var(--qsize, 30px) * 1.15); text-align: center; }
.ayah-card .qt { line-height: 2.2; }
.plain { font-family: var(--quran); font-size: 21px; line-height: 2.1; color: var(--ink-soft); margin: 8px 0; }
.ayah-card.big .plain { text-align: center; font-size: 19px; color: var(--muted); }
.ayah-card .ref:hover { color: var(--green); }
.ayah-card.playing { background: linear-gradient(90deg, transparent, var(--green-soft) 30%, var(--green-soft) 70%, transparent); }
.tabs a { display: inline-block; padding: 12px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tafsir-text.full { max-height: none; }
.tafsir-text[dir="auto"] { text-align: start; }
.tafsir-head h2 { margin: 0; font-size: 16px; color: var(--green); }

/* Mushaf page reader */
.mushaf-reader { max-width: 760px; padding-top: 18px; }
.mr-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; margin-bottom: 10px; }
.mr-title { text-align: center; }
.mr-title b { display: block; font-family: var(--display); font-size: 22px; color: var(--green); line-height: 1.3; }
.mr-title span { font-size: 13px; color: var(--muted); }
.mr-bar .icon-btn[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.mr-jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin-bottom: 14px; }
.mr-jump label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.mr-jump input { width: 74px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 8px; text-align: center; }
.mr-jump .select { max-width: 160px; }
.mushaf.page-view { max-width: none; touch-action: pan-y; }
.ayah-pop { position: fixed; z-index: 55; padding: 10px; width: max-content; max-width: calc(100vw - 24px); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.ayah-pop .pop-title { display: block; font-size: 14px; margin-bottom: 8px; color: var(--green); }
.pop-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pop-acts .btn { height: 34px; padding: 0 10px; font-size: 13.5px; }

/* Search */
.search.big { width: 100%; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hint { font-size: 13.5px; margin: 10px 4px 0; }
.result-count { font-weight: 600; margin: 18px 0 10px; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.result { padding: 14px 16px; }
.result .ref { font-weight: 600; color: var(--green); font-size: 14px; }
.result .plain { margin: 6px 0 4px; font-size: 22px; }
.match { margin: 0; font-size: 13.5px; color: var(--muted); }
mark { background: var(--hl-strong); color: inherit; border-radius: 3px; padding: 0 2px; }
.empty { text-align: center; padding-top: 60px; }
.empty h1 { font-family: var(--display); font-size: 64px; color: var(--green); margin: 0; }

/* Bookmarks sheet */
.sheet { position: fixed; z-index: 90; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 70vh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; border: 1px solid var(--line); box-shadow: 0 -10px 40px rgba(0,0,0,.2); padding: 6px 16px 18px; }
.sheet header { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); padding-top: 8px; }
.sheet h2 { margin: 0; font-size: 18px; }
.marks-list a { display: flex; justify-content: space-between; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.marks-list a:hover { color: var(--green); }
.marks-list .muted { padding: 16px 6px; }

/* Footer */
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 8px; }
.foot-links a:hover { color: var(--green); }
.foot small { display: block; font-size: 12px; }

@media (max-width: 1180px) {
	.home-top { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	.drawer-host .surahs { display: flex; }
	.drawer-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
	.drawer-nav a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; }
	.block-head .filter { min-width: 0; flex: 1 1 100%; }
	.block-head h1, .block-head h2 { font-size: 24px; }
	.sgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
	.scard { padding: 10px; gap: 8px; }
	.scard .smeta { display: none; }
	.jgrid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
	.mr-jump .select { max-width: none; flex: 1 1 40%; }
	.mushaf.page-view { padding-inline: 4px; }
}
@media (max-width: 420px) {
	.sgrid { grid-template-columns: 1fr; }
	.jgrid { grid-template-columns: 1fr 1fr; }
}

/* الشعار (قناع يأخذ لون السياق) */
.logo-mask { display: block; aspect-ratio: 2421 / 796; background: currentColor; -webkit-mask: url("/images/logo-sm.webp") center / contain no-repeat; mask: url("/images/logo-sm.webp") center / contain no-repeat; }
.brand { color: var(--green); }
.brand .logo-mask { height: 34px; }
.brand small { margin-top: 2px; }
.hero h1 { color: #fff; }
.logo-mask.big { width: min(430px, 78vw); margin: 0 auto 6px; -webkit-mask-image: url("/images/logo.webp"); mask-image: url("/images/logo.webp"); filter: drop-shadow(0 2px 10px rgba(0,0,0,.25)); }
@media (max-width: 860px) { .brand .logo-mask { height: 28px; } }
.ayah-list .bism { font-size: calc(var(--qsize) * 1.05); }
