:root {
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --primary-soft: #e8f5f2;
    --accent: #d5a94e;
    --accent-soft: #fbf3df;
    --bg: #f7faf9;
    --surface: #ffffff;
    --surface-2: #f0f6f4;
    --text: #172321;
    --muted: #687975;
    --border: #dce8e5;
    --shadow-sm: 0 8px 24px rgba(18, 63, 58, .07);
    --shadow: 0 20px 50px rgba(18, 63, 58, .11);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 28px;
    --container: 1180px;
    --reader-size: 1.04rem;
}

[data-theme="dark"] {
    --primary: #54c6b8;
    --primary-dark: #75d5c9;
    --primary-soft: #153b37;
    --accent: #e0bc6c;
    --accent-soft: #3a3120;
    --bg: #0d1715;
    --surface: #14211f;
    --surface-2: #192a27;
    --text: #eef7f5;
    --muted: #a6bab5;
    --border: #29413d;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
    --shadow: 0 20px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.container { width: min(calc(100% - 36px), var(--container)); margin-inline: auto; }
.container.narrow { max-width: 860px; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 200; padding: 10px 16px; background: var(--text); color: var(--surface); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); border-radius: 14px; box-shadow: 0 10px 24px rgba(15, 118, 110, .22); }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font-size: .74rem; margin-top: 4px; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 7px; padding: 10px 13px; border-radius: 11px; color: var(--muted); font-weight: 650; font-size: .9rem; transition: .2s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); background: var(--primary-soft); }
.main-nav .icon { width: 18px; height: 18px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.menu-toggle { display: none; margin-left: auto; }
.theme-toggle { margin-left: 4px; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
[data-theme="dark"] .theme-icon-light { display: none; }

.hero { position: relative; overflow: hidden; padding: 76px 0 64px; background: radial-gradient(circle at 85% 25%, var(--primary-soft), transparent 35%), linear-gradient(180deg, var(--surface), var(--bg)); }
.hero::before { content: ""; position: absolute; width: 500px; height: 500px; left: -340px; top: -260px; border: 70px solid color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 50%; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 74px; align-items: center; }
.eyebrow { display: inline-flex; color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1, .page-hero h1, .surah-hero h1, .topic-hero h1 { margin: 13px 0 17px; line-height: 1.1; letter-spacing: -.045em; }
.hero h1 { font-size: clamp(2.65rem, 5vw, 4.65rem); max-width: 720px; }
.hero h1 span { color: var(--primary); }
.hero-copy > p { max-width: 680px; color: var(--muted); font-size: 1.08rem; margin: 0 0 28px; }
.hero-search { display: flex; align-items: center; gap: 10px; max-width: 690px; padding: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow); }
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow); }
.hero-search .search-icon { color: var(--muted); display: grid; place-items: center; padding-left: 10px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; padding: 10px 4px; }
.hero-search input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.hero-search button { border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 750; color: white; background: var(--primary); cursor: pointer; }
.hero-search button:hover { background: var(--primary-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 17px; font-weight: 750; font-size: .9rem; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--primary); color: white; box-shadow: 0 10px 22px rgba(15, 118, 110, .18); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 15%, var(--border)); }
.button.ghost { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.light { color: var(--primary-dark); background: white; }
.button.small { min-height: 38px; padding: 7px 12px; font-size: .8rem; }
.button.full { width: 100%; }
.hero-visual { position: relative; min-height: 430px; display: grid; place-items: center; }
.quran-card { position: relative; z-index: 2; width: min(100%, 390px); min-height: 390px; padding: 50px 38px; text-align: center; color: white; background: linear-gradient(150deg, #0f766e 0%, #085c57 62%, #0d4c49 100%); border: 1px solid rgba(255,255,255,.18); border-radius: 30px; box-shadow: 0 30px 75px rgba(9, 76, 71, .3); overflow: hidden; transform: rotate(1.5deg); }
.quran-card::before, .quran-card::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.quran-card::before { width: 310px; height: 310px; top: -170px; right: -120px; }
.quran-card::after { width: 260px; height: 260px; bottom: -170px; left: -110px; }
.quran-card-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 28px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 22px; }
.quran-card-icon .icon { width: 38px; height: 38px; }
.arabic-title { font-family: "Times New Roman", serif; font-size: 2rem; letter-spacing: .02em; }
.ornamental-line { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--accent); }
.ornamental-line span { flex: 1; height: 1px; background: rgba(255,255,255,.3); }
.quran-card p { margin: 0; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.8; }
.quran-card small { display: block; margin-top: 17px; color: rgba(255,255,255,.72); }
.ornament { position: absolute; border-radius: 50%; }
.ornament-one { width: 120px; height: 120px; top: 10px; right: 7px; background: var(--accent-soft); }
.ornament-two { width: 90px; height: 90px; bottom: 7px; left: 5px; border: 18px solid var(--primary-soft); }

.stats-strip { position: relative; z-index: 3; margin-top: -8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 25px 20px; text-align: center; position: relative; }
.stat:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 25%; width: 1px; height: 50%; background: var(--border); }
.stat strong { font-size: 1.7rem; color: var(--primary); letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .84rem; }

.section { padding: 78px 0; }
.section-soft { background: var(--surface-2); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading h2, .results-header h2, .content-card h2, .about-card h2 { margin: 6px 0 5px; font-size: clamp(1.65rem, 3vw, 2.3rem); line-height: 1.2; letter-spacing: -.03em; }
.section-heading p, .results-header p { color: var(--muted); margin: 0; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 750; font-size: .9rem; white-space: nowrap; }
.text-link .icon { width: 17px; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.category-card { display: flex; align-items: center; gap: 13px; min-height: 106px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: .22s ease; }
.category-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); }
.category-icon { width: 47px; height: 47px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 15px; }
.category-icon .icon { width: 24px; height: 24px; }
.category-content { min-width: 0; display: flex; flex-direction: column; }
.category-content strong { line-height: 1.3; }
.category-content small { color: var(--muted); margin-top: 5px; }
.category-arrow { margin-left: auto; color: var(--muted); }
.category-arrow .icon { width: 17px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.topic-card { min-height: 224px; display: flex; flex-direction: column; padding: 23px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: .22s ease; }
.topic-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow); }
.topic-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.topic-category { color: var(--primary); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.ref-count, .result-pill { padding: 5px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: .72rem; font-weight: 700; }
.topic-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.45; letter-spacing: -.01em; }
.topic-card p { color: var(--muted); font-size: .83rem; margin: 10px 0 20px; }
.card-link { margin-top: auto; display: flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 750; font-size: .82rem; }
.card-link .icon { width: 16px; }
.surah-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.surah-mini { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: .2s ease; }
.surah-mini:hover { border-color: var(--primary); transform: translateY(-2px); }
.number-badge { width: 39px; height: 39px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 12px; font-size: .82rem; font-weight: 800; }
.surah-mini > span:nth-child(2) { display: flex; flex-direction: column; }
.surah-mini strong { font-size: .88rem; }
.surah-mini small { color: var(--muted); font-size: .72rem; }
.surah-mini > .icon { margin-left: auto; width: 16px; color: var(--muted); }
.callout-section { padding-top: 30px; }
.callout { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 34px; color: white; background: linear-gradient(135deg, var(--primary-dark), #0a4946); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.callout-icon { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 20px; background: rgba(255,255,255,.12); }
.callout-icon .icon { width: 30px; height: 30px; }
.callout .eyebrow { color: #b7eee7; }
.callout h2 { margin: 4px 0; line-height: 1.2; }
.callout p { margin: 0; color: rgba(255,255,255,.72); }

.page-hero, .surah-hero, .topic-hero { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border-bottom: 1px solid var(--border); }
.page-hero.compact { padding: 48px 0 42px; }
.page-hero h1 { font-size: clamp(2.1rem, 4vw, 3.35rem); max-width: 850px; }
.page-hero p { max-width: 780px; color: var(--muted); font-size: 1rem; margin: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: .78rem; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs strong { color: var(--text); font-weight: 700; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-top: 27px; }
.filter-input { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 14px; height: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.filter-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.filter-input span { display: grid; color: var(--muted); }
.filter-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.filter-bar select, .reader-sidebar select { height: 48px; min-width: 210px; padding: 0 36px 0 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; outline: 0; }
.page-section { padding-top: 52px; }
.results-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.results-header h2 { font-size: 1.7rem; }
.results-header.small { align-items: center; }
.results-header.small h2 { font-size: 1.25rem; }
.surah-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.surah-card { display: flex; align-items: center; gap: 14px; min-height: 94px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; transition: .2s ease; }
.surah-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.surah-number { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; position: relative; color: var(--primary); background: var(--primary-soft); border-radius: 15px; }
.surah-number::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); transform: rotate(45deg); border-radius: 5px; }
.surah-number b { position: relative; z-index: 2; font-size: .78rem; }
.surah-info { display: flex; min-width: 0; flex-direction: column; }
.surah-info strong { font-size: .92rem; line-height: 1.3; }
.surah-info small { color: var(--muted); margin-top: 5px; }
.surah-open { margin-left: auto; color: var(--muted); }
.surah-open .icon { width: 16px; }
.empty-state { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state > .icon { width: 48px; height: 48px; color: var(--primary); margin-bottom: 12px; }
.empty-state h1, .empty-state h2 { margin: 0 0 7px; }
.empty-state p { max-width: 480px; color: var(--muted); margin: 0 0 20px; }
.intro-state { background: transparent; }

.surah-hero { padding: 40px 0 43px; }
.surah-title-row { display: flex; align-items: center; gap: 20px; }
.large-number { width: 78px; height: 78px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 24px; font-size: 1.35rem; font-weight: 850; }
.surah-title-row h1 { margin: 2px 0 5px; font-size: clamp(2.2rem, 4vw, 3.4rem); }
.surah-title-row p { margin: 0; color: var(--muted); }
.basmallah { margin-top: 35px; text-align: center; color: var(--primary); font-family: "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.5; }
.reader-section { padding-top: 46px; }
.reader-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; align-items: start; }
.reader-sidebar, .related-sidebar { min-width: 0; }
.sticky-box { position: sticky; top: 96px; }
.sidebar-box { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.sidebar-box > strong { display: block; margin-bottom: 12px; }
.reader-sidebar select { width: 100%; min-width: 0; }
.font-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0; margin-top: 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.font-controls span { color: var(--muted); font-size: .78rem; }
.font-controls div { display: flex; gap: 5px; }
.font-controls button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.font-controls .icon { width: 15px; }
.sidebar-note { display: flex; gap: 9px; margin-top: 16px; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.sidebar-note .icon { width: 17px; color: var(--primary); }
.sidebar-note p { margin: 0; }
.reader-content { min-width: 0; }
.verse-list { display: flex; flex-direction: column; gap: 14px; }
.verse-card { scroll-margin-top: 100px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.verse-card:target { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 11%, transparent), var(--shadow-sm); }
.verse-meta { display: flex; align-items: center; gap: 10px; min-height: 34px; color: var(--primary); font-size: .78rem; font-weight: 800; }
.verse-meta a:hover { text-decoration: underline; }
.ayah-badge { width: 33px; height: 33px; display: grid; place-items: center; color: white; background: var(--primary); border-radius: 10px; }
.copy-button { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: .75rem; }
.copy-button:hover { color: var(--primary); }
.copy-button .icon { width: 17px; }
.verse-card p { margin: 17px 0 0; font-family: Georgia, "Times New Roman", serif; color: var(--text); font-size: var(--reader-size); line-height: 1.95; }
.compact-verse { padding: 18px 20px; }
.compact-verse p { margin-top: 10px; font-size: .96rem; line-height: 1.8; }
.surah-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.surah-navigation a { display: flex; align-items: center; gap: 10px; padding: 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.surah-navigation a:hover { border-color: var(--primary); }
.surah-navigation a.next { justify-content: flex-end; text-align: right; }
.surah-navigation span { display: flex; flex-direction: column; }
.surah-navigation small { color: var(--muted); }

.category-section { padding: 24px 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.category-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 3px; }
.category-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 9px 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; font-weight: 700; }
.category-chip:hover, .category-chip.active { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.category-chip span { display: grid; }
.category-chip .icon { width: 16px; height: 16px; }
.topics-section { padding-top: 44px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 32px; }
.page-link, .page-number { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: .8rem; font-weight: 700; }
.page-number { width: 40px; padding-inline: 0; }
.page-number.active, .page-link:hover, .page-number:hover { color: white; background: var(--primary); border-color: var(--primary); }
.page-link .icon { width: 15px; }

.topic-hero { padding: 40px 0 46px; }
.topic-heading-layout { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.topic-heading-icon { width: 78px; height: 78px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 24px; }
.topic-heading-icon .icon { width: 36px; height: 36px; }
.topic-hero h1 { max-width: 930px; font-size: clamp(2rem, 4vw, 3.35rem); }
.topic-path { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: .77rem; }
.topic-path span.current { color: var(--primary); font-weight: 750; }
.topic-path .icon { width: 13px; }
.topic-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.topic-summary > span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; }
.topic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 30px; align-items: start; }
.related-sidebar h3 { margin: 3px 0 15px; }
.related-list { display: flex; flex-direction: column; margin-bottom: 16px; }
.related-list a { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.related-list a:hover { color: var(--primary); }
.related-list a > span { min-width: 0; display: flex; flex-direction: column; font-size: .82rem; font-weight: 700; line-height: 1.4; }
.related-list small { color: var(--muted); margin-top: 4px; font-weight: 500; }
.related-list .icon { margin-left: auto; width: 15px; }

.hero-search.standalone { margin-top: 25px; max-width: 760px; }
.search-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; margin-bottom: 28px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); border-radius: 14px; }
.search-summary h2 { margin: 0; font-size: 1.2rem; }
.search-summary div { display: flex; gap: 8px; }
.search-summary span { padding: 6px 10px; color: var(--primary); background: var(--surface); border-radius: 999px; font-size: .76rem; font-weight: 800; }
.search-columns { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: start; }
.topic-list-compact { display: flex; flex-direction: column; gap: 9px; }
.topic-list-compact a { display: flex; align-items: center; gap: 10px; padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.topic-list-compact a:hover { border-color: var(--primary); }
.topic-list-compact a > span { min-width: 0; display: flex; flex-direction: column; }
.topic-list-compact small { color: var(--primary); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.topic-list-compact strong { margin: 3px 0; font-size: .84rem; line-height: 1.4; }
.topic-list-compact em { color: var(--muted); font-size: .7rem; font-style: normal; }
.topic-list-compact .icon { margin-left: auto; width: 15px; color: var(--muted); }
.mini-empty { padding: 30px; color: var(--muted); text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.about-card, .content-card { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.about-card > span { width: 52px; height: 52px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 16px; }
.about-card > span .icon { width: 27px; height: 27px; }
.about-card h2 { font-size: 1.3rem; }
.about-card p, .content-card p { color: var(--muted); margin-bottom: 0; }
.content-card { margin-top: 18px; }
.content-card h2 { font-size: 1.35rem; }
.notice-box { display: flex; gap: 12px; padding: 16px; margin-top: 20px; color: var(--muted); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 13px; }
.notice-box .icon { color: var(--accent); }
.notice-box p { margin: 0; font-size: .84rem; }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.tech-list span { padding: 7px 11px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: .76rem; font-weight: 750; }

.site-footer { padding-top: 55px; background: #092f2c; color: white; }
.footer-grid { display: grid; grid-template-columns: 1.5fr .6fr .7fr; gap: 50px; align-items: start; padding-bottom: 40px; }
.footer-brand .brand-copy small, .footer-note { color: rgba(255,255,255,.62); }
.footer-note { max-width: 480px; font-size: .84rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links strong { margin-bottom: 5px; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .83rem; }
.footer-links a:hover { color: white; }
.footer-arabic { align-self: center; text-align: right; color: var(--accent); font-family: "Times New Roman", serif; font-size: 2.1rem; }
.footer-bottom { display: flex; justify-content: space-between; padding-block: 18px; color: rgba(255,255,255,.5); border-top: 1px solid rgba(255,255,255,.1); font-size: .74rem; }
.toast { position: fixed; z-index: 500; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 10px 16px; color: white; background: #102b28; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .2s ease; font-size: .82rem; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; gap: 45px; }
    .hero-copy { text-align: center; }
    .hero-copy > p, .hero-search { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { min-height: 380px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .surah-grid { grid-template-columns: repeat(2, 1fr); }
    .surah-mini-grid { grid-template-columns: repeat(2, 1fr); }
    .reader-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
    .topic-layout { grid-template-columns: minmax(0, 1fr); }
    .related-sidebar .sticky-box { position: static; }
    .related-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .related-list a { padding: 12px; border: 1px solid var(--border); border-radius: 11px; }
    .search-columns { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
    .header-inner { min-height: 68px; }
    .brand-mark { width: 40px; height: 40px; }
    .menu-toggle { display: grid; }
    .theme-toggle { margin-left: 0; }
    .main-nav { position: fixed; left: 18px; right: 18px; top: 76px; display: none; flex-direction: column; align-items: stretch; gap: 5px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px; }
    .hero { padding-top: 52px; }
    .hero h1 { font-size: clamp(2.35rem, 11vw, 3.6rem); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2)::after { display: none; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .section { padding: 58px 0; }
    .section-heading { align-items: flex-start; }
    .topic-grid { grid-template-columns: 1fr; }
    .home-topic-grid .topic-card:nth-child(n+5) { display: none; }
    .surah-mini-grid, .surah-grid { grid-template-columns: 1fr; }
    .callout { grid-template-columns: auto 1fr; }
    .callout .button { grid-column: 1 / -1; }
    .filter-bar { flex-wrap: wrap; }
    .filter-input { flex-basis: 100%; }
    .filter-bar select { flex: 1; min-width: 170px; }
    .reader-layout { grid-template-columns: 1fr; }
    .reader-sidebar .sticky-box { position: static; }
    .reader-sidebar .sidebar-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
    .reader-sidebar .sidebar-box > strong { grid-column: 1 / -1; margin-bottom: 0; }
    .reader-sidebar select { width: 100%; }
    .font-controls { margin: 0; padding: 0; border: 0; }
    .font-controls > span { display: none; }
    .sidebar-note { grid-column: 1 / -1; margin-top: 0; }
    .topic-heading-layout { grid-template-columns: 1fr; }
    .topic-heading-icon { width: 62px; height: 62px; border-radius: 18px; }
    .topic-heading-icon .icon { width: 29px; height: 29px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
    .footer-arabic { text-align: left; }
}

@media (max-width: 560px) {
    .container { width: min(calc(100% - 24px), var(--container)); }
    .brand-copy small { display: none; }
    .header-inner { gap: 8px; }
    .hero { padding: 42px 0 46px; }
    .hero-search { border-radius: 14px; }
    .hero-search button { padding-inline: 16px; }
    .hero-visual { min-height: 340px; }
    .quran-card { min-height: 330px; padding: 35px 25px; border-radius: 24px; }
    .quran-card-icon { width: 60px; height: 60px; margin-bottom: 20px; }
    .arabic-title { font-size: 1.7rem; }
    .category-grid { grid-template-columns: 1fr; }
    .section-heading { display: block; }
    .section-heading .text-link { margin-top: 12px; }
    .callout { grid-template-columns: 1fr; text-align: center; }
    .callout-icon { margin-inline: auto; }
    .page-hero.compact, .surah-hero, .topic-hero { padding: 34px 0; }
    .filter-bar select, .filter-bar .button { width: 100%; flex: 1 1 100%; }
    .results-header { align-items: flex-start; }
    .result-pill { white-space: nowrap; }
    .surah-title-row { align-items: flex-start; }
    .large-number { width: 61px; height: 61px; border-radius: 18px; }
    .basmallah { margin-top: 25px; }
    .verse-card { padding: 18px; border-radius: 15px; }
    .verse-meta { flex-wrap: wrap; }
    .copy-button span { display: none; }
    .verse-card p { line-height: 1.85; }
    .surah-navigation { grid-template-columns: 1fr; }
    .surah-navigation > span { display: none; }
    .related-list { grid-template-columns: 1fr; }
    .topic-summary { align-items: flex-start; flex-direction: column; }
    .search-summary { align-items: flex-start; flex-direction: column; }
    .about-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-grid > div:first-child { grid-column: auto; }
    .footer-bottom { gap: 10px; flex-direction: column; }
}

@media print {
    .site-header, .site-footer, .related-sidebar, .reader-sidebar, .topic-summary .button, .copy-button, .pagination { display: none !important; }
    body { background: white; color: black; }
    .section, .reader-section { padding: 20px 0; }
    .topic-hero, .surah-hero { background: white; border-bottom: 1px solid #ddd; }
    .topic-layout, .reader-layout { display: block; }
    .verse-card { break-inside: avoid; box-shadow: none; border-color: #ddd; }
    .container { width: 100%; max-width: none; }
}
