:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: rgba(15, 118, 110, 0.08);
    --warning-soft: rgba(250, 204, 21, 0.32);
    --shadow: 0 18px 48px rgba(2, 6, 23, 0.08);
    --shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.05);
    --container: 1180px;
    --quran-font: 'Uthmanic Hafs', 'Amiri Quran Local', 'Scheherazade New Local', serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
    background: linear-gradient(180deg, #f9fbfd 0%, #eef4f8 35%, var(--bg) 100%);
    color: var(--text);
}

html[dir='ltr'] body {
    font-family: 'Inter', 'Cairo', system-ui, sans-serif;
}

/* Quran fonts */
@font-face {
    font-family: 'Uthmanic Hafs';
    src: url('../fonts/uthmanic-hafs-v22.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Amiri Quran Local';
    src: url('../fonts/AmiriQuran-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Scheherazade New Local';
    src: url('../fonts/ScheherazadeNew-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Scheherazade New Local';
    src: url('../fonts/ScheherazadeNew-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.container {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
}

.hidden,
.tafsir-source-option.hidden,
.tafsir-search-empty.hidden {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-one-line {
    min-width: 0;
}

.brand-logo-only,
.header-one-line .brand,
.header-one-line .brand-logo-only {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.brand-texts {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.brand-texts strong,
.brand-texts span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-texts strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.brand-texts span {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.25;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.donate-button,
.lang-dropdown,
.install-button,
.dismiss-install-button,
.home-search-button,
.primary-button,
.secondary-button,
.surah-toggle-button,
.tafsir-load-button,
.ayah-audio-button,
.audio-main-button,
.audio-control-button {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.donate-button:hover,
.home-search-button:hover,
.primary-button:hover,
.tafsir-load-button:hover,
.audio-main-button:hover,
.install-button:hover {
    transform: translateY(-1px);
}

.donate-button {
    min-height: 42px;
    display: none; /*display: inline-flex;*/
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #0f9d8d);
    color: #ffffff;
    font-weight: 800;
    white-space: nowrap;
}

.lang-dropdown-wrap {
    flex: 0 0 auto;
}

.lang-dropdown {
    min-height: 42px;
    max-width: 180px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[dir='rtl'] .lang-dropdown {
    padding: 0 14px 0 36px;
}

/* Install banner */
.install-banner {
    position: sticky;
    top: 78px;
    z-index: 95;
    padding: 10px 0;
    background: rgba(15, 23, 42, 0.96);
    color: #ffffff;
}

.install-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.install-banner-text {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.install-banner-text strong,
.install-banner-text span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-banner-text span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.install-button,
.dismiss-install-button {
    border: 0;
    cursor: pointer;
    font-weight: 800;
}

.install-button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    white-space: nowrap;
}

.dismiss-install-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.15rem;
}

/* Common labels and buttons */
.section-label,
.surah-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.86rem;
}

.home-search-button,
.primary-button,
.secondary-button,
.surah-toggle-button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #0f9d8d);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.secondary-button {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
}

/* Home search */
.home-search-section {
    padding: 26px 0 12px;
}

.home-search-card,
.surah-reader-card {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: var(--shadow);
}

.home-search-card {
    padding: 20px;
}

.home-search-header p,
.surah-directory-header p,
.surah-reader-name-en,
.surah-back-link,
.search-stat span,
.search-result-card small,
.surah-reader-stat span,
.ayah-text-transliteration,
.continue-reading-content p,
.install-banner-text span {
    color: var(--muted);
}

.home-search-header p {
    margin: 8px 0 0;
}

.home-search-form {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.home-search-input,
.surah-filter-input,
.tafsir-search-input,
.tafsir-selector {
    width: 100%;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.home-search-input {
    min-height: 52px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: 1rem;
}

.home-search-input:focus,
.surah-filter-input:focus,
.tafsir-search-input:focus,
.tafsir-selector:focus,
.lang-dropdown:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.search-output {
    margin-top: 16px;
}

.search-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.search-stat,
.search-result-card,
.search-result-item,
.empty-search-message,
.empty-mushaf-message {
    border: 1px solid var(--line);
    background: #ffffff;
}

.search-stat {
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
}

.search-stat strong {
    display: block;
    margin-top: 4px;
}

.search-results,
.search-results-list,
.search-results-grid {
    min-width: 0;
}

.search-results-list {
    margin-top: 12px;
    display: grid;
    gap: 12px;
}

.search-result-card,
.search-result-item {
    display: block;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
    border-radius: 16px;
    color: inherit;
}

.search-result-card:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.04);
}

.search-result-card * {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.search-result-ref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 800;
}

.search-result-ref span {
    flex: 0 0 auto;
    font-weight: 900;
    color: var(--primary);
}

.search-result-ref strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-card .matched-text,
.search-result-item p {
    line-height: 1.8;
}

.search-result-card .matched-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.search-result-item p {
    margin: 8px 0;
}

.search-highlight,
.tafsir-ayah-highlight {
    display: inline;
    border-radius: 0.38em;
    background: var(--warning-soft);
    color: inherit;
    font-weight: 900;
}

.search-highlight {
    padding: 0 0.18em;
}

.search-load-sentinel {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 800;
}

/* Surah directory */
.surah-directory-section {
    padding: 22px 0 34px;
}

.surah-directory-header {
    margin-bottom: 14px;
}

.surah-directory-header h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.surah-directory-header p {
    margin: 0;
}

.surah-filter-bar {
    margin-bottom: 14px;
}

.surah-filter-input {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: 1rem;
}

.surah-directory-shell {
    position: relative;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.surah-directory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.surah-directory-row {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.05);
}

.surah-directory-row:hover {
    border-color: rgba(15, 118, 110, 0.25);
    transform: translateY(-1px);
}

.surah-row-number {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: #f1f5f9;
    font-weight: 800;
}

.surah-row-content {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.surah-row-name-en {
    margin: 0 0 3px;
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surah-row-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.surah-row-name-ar {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.98rem;
}

.surah-directory-fade {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 88px;
    background: linear-gradient(to bottom, rgba(244, 247, 251, 0), rgba(244, 247, 251, 1));
    pointer-events: none;
}

.surah-directory-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.empty-search-message,
.empty-mushaf-message {
    padding: 18px;
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

/* Surah page */
.surah-reader-hero {
    padding: 22px 0 16px;
}

.surah-reader-card {
    padding: 22px;
}

.surah-reader-top,
.surah-reader-title-row,
.surah-view-tabs,
.ayah-card-top,
.mushaf-page-header,
.surah-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.surah-back-link {
    font-weight: 800;
}

.surah-reader-name-ar {
    margin: 12px 0 6px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.surah-reader-name-en {
    margin: 0;
}

.surah-reader-stat {
    min-width: 130px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.surah-reader-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 1.4rem;
}

.surah-view-tabs {
    margin-top: 18px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.surah-view-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    font-weight: 800;
}

.surah-view-tab.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: rgba(15, 118, 110, 0.25);
}

.surah-ayah-view,
.surah-mushaf-view,
.surah-bottom-navigation {
    padding: 14px 0 28px;
}

.surah-top-navigation {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.surah-top-navigation .secondary-button,
.surah-top-navigation .primary-button,
.surah-bottom-navigation .secondary-button,
.surah-bottom-navigation .primary-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.surah-top-navigation .surah-nav-home {
    justify-self: center;
}

.surah-top-navigation .surah-nav-prev {
    justify-self: start;
}

.surah-top-navigation .surah-nav-next {
    justify-self: end;
}

.surah-nav-placeholder {
    min-height: 1px;
}

/* Ayah view */
.ayahs-list {
    display: grid;
    gap: 14px;
}

.ayah-card {
    padding: 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.05);
}

.ayah-badge {
    display: inline-flex;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.ayah-audio-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    cursor: pointer;
}

.ayah-audio-button.is-playing {
    background: var(--primary);
    color: #ffffff;
}

.ayah-text-ar {
    margin: 16px 0 0;
    font-family: var(--quran-font);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 2.35;
    font-weight: 400;
    letter-spacing: 0;
    word-spacing: 0.08em;
    text-align: right;
    direction: rtl;
}

.ayah-text-transliteration {
    margin: 12px 0 0;
    line-height: 1.8;
}

.ayah-text-translation {
    margin: 12px 0 0;
    line-height: 1.9;
}

html[lang='ar'] .search-result-card .matched-text {
    font-family: var(--quran-font);
    font-size: 1.45rem;
    line-height: 2.15;
    font-weight: 400;
    letter-spacing: 0;
    word-spacing: 0.05em;
    direction: rtl;
    text-align: right;
}

.tafsir-ayah-highlight {
    padding: 0 0.25em;
    font-family: var(--quran-font);
    font-size: 1.18em;
    line-height: 2.15;
    font-weight: 400;
    color: #7c2d12;
}

/* Mushaf */
.mushaf-pages-list {
    display: grid;
    gap: 20px;
}

.mushaf-page-card {
    padding: 14px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.06);
}

.mushaf-page-header {
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 800;
}

.mushaf-svg-wrap {
    position: relative;
    width: 100%;
    min-height: 60vh;
    overflow: auto;
    border-radius: 18px;
    background: #f8fafc;
    padding: 10px;
}

.mushaf-svg-wrap.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent), linear-gradient(#eef2f7 0 0);
    background-size: 42% 100%, 100% 100%;
    background-position: -45% 0, 0 0;
    background-repeat: no-repeat;
    animation: mushafSkeleton 1.15s ease-in-out infinite;
}

.mushaf-svg-wrap.is-loading .mushaf-svg-image {
    opacity: 0;
}

.mushaf-svg-wrap.is-loaded .mushaf-svg-image {
    opacity: 1;
    transition: opacity 220ms ease;
}

.mushaf-svg-image {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 12px;
}

@keyframes mushafSkeleton {
    to {
        background-position: 145% 0, 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mushaf-svg-wrap.is-loading::before {
        animation: none;
    }
}

/* Tafsir */
.tafsir-selector-form,
.tafsir-picker-box {
    margin: 0 0 18px;
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 12px;
}

.tafsir-selector-label {
    font-weight: 800;
    color: var(--text);
}

.tafsir-selector {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 700;
}

.tafsir-picker-header,
.selected-tafsir-summary,
.tafsir-source-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tafsir-picker-header strong,
.selected-tafsir-summary strong,
.tafsir-source-main strong {
    font-weight: 900;
    color: var(--text);
}

.selected-tafsir-summary span,
.tafsir-source-author {
    color: var(--muted);
    font-weight: 700;
}

.tafsir-school-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
    font-size: 0.82rem;
    white-space: nowrap;
}

.tafsir-source-dropdown summary {
    cursor: pointer;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f8fafc;
    font-weight: 800;
}

.tafsir-search-wrap {
    margin-top: 10px;
}

.tafsir-search-input {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 800;
}

.tafsir-source-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-inline-end: 4px;
}

.tafsir-source-option {
    padding: 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.tafsir-source-option:hover,
.tafsir-source-option.active {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.05);
}

.tafsir-source-main {
    display: grid;
    gap: 3px;
}

.tafsir-search-empty {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px dashed rgba(15, 23, 42, 0.16);
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.ayah-tafsir-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.ayah-tafsir-title {
    margin-bottom: 10px;
    color: var(--primary);
    font-weight: 900;
}

.ayah-tafsir-title span {
    color: var(--muted);
}

.ayah-tafsir-text {
    color: #1e293b;
    line-height: 2;
    font-size: 1rem;
}

.ayah-tafsir-missing {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid rgba(234, 88, 12, 0.18);
    font-weight: 700;
}

.tafsir-load-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.tafsir-loading {
    color: var(--muted);
    font-weight: 800;
}

/* Continue reading */
.continue-reading-section {
    margin: 22px 0 0;
}

.continue-reading-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.08);
    color: inherit;
}

.continue-reading-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.1);
}

.continue-reading-content {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.continue-reading-content h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
    color: var(--text);
}

.continue-reading-content p {
    margin: 0;
    font-weight: 700;
}

.continue-reading-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.continue-reading-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.9rem;
}

.continue-reading-action {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

/* Mushaf audio */
.mushaf-surah-audio-card {
    margin-top: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 20px;
    background: rgba(15, 118, 110, 0.06);
    border: 1px solid rgba(15, 118, 110, 0.16);
}

.mushaf-surah-audio-info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.mushaf-surah-audio-label {
    color: var(--primary);
    font-weight: 900;
    font-size: 0.9rem;
}

.mushaf-surah-audio-info strong {
    color: var(--text);
    font-weight: 900;
}

.mushaf-surah-audio-info small {
    color: var(--muted);
    font-weight: 800;
}

.mushaf-surah-audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.audio-main-button,
.audio-control-button {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 900;
}

.audio-main-button {
    width: 54px;
    height: 54px;
    background: var(--primary);
    color: #ffffff;
    font-size: 1.2rem;
}

.audio-control-button {
    width: 42px;
    height: 42px;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid rgba(15, 118, 110, 0.18);
    font-size: 1.4rem;
}

/* Responsive */
@media (max-width: 1280px) {
    .surah-directory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .search-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .surah-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-search-form {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(var(--container), calc(100% - 24px));
    }

    .site-header .header-inner.header-one-line {
        min-height: 64px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding-block: 8px;
    }

    .site-header .header-one-line .brand,
    .site-header .header-one-line .brand-logo-only {
        min-width: 0;
        overflow: hidden;
        gap: 10px;
    }

    .site-header .header-one-line .site-logo {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .site-header .header-one-line .brand-texts span {
        font-size: 0.74rem;
    }

    .site-header .header-one-line .header-right {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        min-width: max-content;
    }

    .site-header .header-one-line .donate-button {
        min-height: 36px;
        padding: 8px 11px;
        font-size: 0.82rem;
    }

    .site-header .header-one-line .lang-dropdown-wrap label,
    .site-header .header-one-line .lang-dropdown-wrap .sr-only {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    .site-header .header-one-line .lang-dropdown-wrap,
    .site-header .header-one-line .lang-dropdown {
        max-width: 118px;
    }

    .site-header .header-one-line .lang-dropdown {
        min-height: 36px;
        font-size: 0.82rem;
    }

    .install-banner {
        top: 64px;
        padding: 8px 0;
    }

    .install-banner-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    .install-banner-text {
        min-width: 0;
    }

    .install-banner-text strong,
    .install-banner-text span {
        white-space: nowrap;
    }

    .install-banner-text strong {
        font-size: 0.92rem;
    }

    .install-banner-text span {
        font-size: 0.78rem;
    }

    .install-banner-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 7px;
    }

    .install-button {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .dismiss-install-button {
        width: 36px;
        height: 36px;
    }

    .surah-reader-title-row,
    .surah-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .surah-directory-grid,
    .search-stats-grid {
        grid-template-columns: 1fr;
    }

    .surah-reader-card,
    .ayah-card {
        padding: 18px;
    }

    .ayah-text-ar {
        font-size: 1.9rem;
        line-height: 2.25;
    }

    .continue-reading-card,
    .mushaf-surah-audio-card {
        align-items: stretch;
        flex-direction: column;
    }

    .continue-reading-action,
    .surah-top-navigation .secondary-button,
    .surah-top-navigation .primary-button,
    .surah-top-navigation .surah-nav-home {
        width: 100%;
    }

    .surah-top-navigation {
        grid-template-columns: 1fr;
    }

    .mushaf-surah-audio-controls {
        justify-content: center;
    }

    .tafsir-picker-header,
    .selected-tafsir-summary,
    .tafsir-source-option {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .container {
        width: calc(100% - 20px);
    }

    .site-header .header-inner.header-one-line {
        min-height: 58px;
        gap: 8px;
    }

    .site-header .header-one-line .site-logo {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .site-header .header-one-line .brand-texts span {
        display: none;
    }

    .site-header .header-one-line .brand-texts strong {
        font-size: 0.92rem;
    }

    .site-header .header-one-line .donate-button {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    .site-header .header-one-line .lang-dropdown-wrap,
    .site-header .header-one-line .lang-dropdown {
        max-width: 104px;
    }

    .site-header .header-one-line .lang-dropdown {
        min-height: 34px;
        font-size: 0.8rem;
    }

    .install-banner {
        top: 58px;
    }

    .install-banner-inner {
        gap: 8px;
    }

    .install-banner-text span {
        display: none;
    }

    .install-button {
        min-height: 34px;
        padding: 0 10px;
        font-size: 0.8rem;
    }

    .dismiss-install-button {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 380px) {
    .container,
    .site-header .container.header-one-line {
        width: calc(100% - 18px);
    }

    .site-header .header-inner.header-one-line {
        gap: 6px;
    }

    .site-header .header-one-line .brand {
        gap: 7px;
    }

    .site-header .header-one-line .site-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .site-header .header-one-line .brand-texts strong {
        max-width: 27vw;
        font-size: 0.84rem;
    }

    .site-header .header-one-line .header-right {
        gap: 5px;
    }

    .site-header .header-one-line .donate-button {
        padding-inline: 8px;
        font-size: 0.76rem;
    }

    .site-header .header-one-line .lang-dropdown-wrap,
    .site-header .header-one-line .lang-dropdown {
        max-width: 88px;
    }

    .site-header .header-one-line .lang-dropdown {
        padding-inline-start: 8px;
        padding-inline-end: 22px;
        font-size: 0.76rem;
    }

    .install-button {
        padding-inline: 9px;
        font-size: 0.76rem;
    }

    .dismiss-install-button {
        width: 32px;
        height: 32px;
    }
}
