/* Tafsir navigation and search redesign. Original IDs remain for the legacy scripts. */
body.fl-modern { background: #f4f4ef; color: #213b3a; font-family: Manrope, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.55; margin: 0; }
.fl-modern *, .fl-modern *::before, .fl-modern *::after { box-sizing: border-box; }
.fl-modern .article { width: min(1120px, 100%); padding: 0 24px 56px; }
.fl-modern .article > .title, .fl-modern .fl-original-controls { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.fl-modern .fl-shell { margin: 0 -24px 28px; padding: 28px max(24px, calc((100vw - 1120px)/2 + 24px)) 26px; background: linear-gradient(120deg, #103d3a, #174f49 65%, #22645a); color: #fff; box-shadow: 0 12px 32px #183d3419; }
.fl-modern .fl-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.fl-modern .fl-brand-copy { min-width: 0; }
.fl-modern .fl-mark { width: 55px; height: 55px; flex: none; display: grid; place-items: center; border: 1px solid #b9d4c486; border-radius: 15px; font-size: 37px; color: #e5c481; }
.fl-modern .fl-eyebrow { display: block; color: #d8bd84; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.fl-modern .fl-brand h1 { margin: 4px 0 2px; color: white; font-family: Manrope, 'Segoe UI', sans-serif; font-size: clamp(27px, 3.8vw, 38px); font-weight: 750; letter-spacing: -.045em; line-height: 1.18; }
.fl-modern .fl-brand p { margin: 0; color: #d0e0da; font-size: 14px; }
.fl-modern .fl-arabic-link { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 34px; margin-top: 12px; border: 1px solid #b9d4c486; border-radius: 8px; padding: 5px 10px; background: #ffffff12; color: #f4e2bb !important; font-size: 12px; font-weight: 700; text-decoration: none; }
.fl-modern .fl-arabic-link:hover { background: #ffffff24; text-decoration: underline; }
.fl-modern .fl-arabic-name { font-family: 'Noto Naskh Arabic', 'Droid Arabic Naskh', serif; font-size: 15px; line-height: 1; }
.fl-modern #fl-arabic-ref { border-left: 1px solid #b9d4c486; padding-left: 8px; color: #d6e4db; font-weight: 500; }
.fl-modern .fl-nav { position: relative; max-width: 1064px; border: 1px solid #cbe1d657; border-radius: 16px; background: #ffffff12; padding: 17px; }
.fl-modern .fl-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.fl-modern .fl-nav-label { color: #dfc78e; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.fl-modern .fl-nav-row { display: flex; gap: 9px; align-items: stretch; }
.fl-modern .fl-nav-row button { font: inherit; cursor: pointer; }
.fl-modern .fl-select { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 62px; border: 1px solid #cbd9d1; border-radius: 10px; background: #fff; padding: 8px 38px 8px 16px; text-align: left; color: #193d38; }
.fl-modern .fl-surah-trigger { flex: 1.7; min-width: 0; }
.fl-modern .fl-ayah-trigger { flex: 1; min-width: 0; }
.fl-modern .fl-field-label { margin-bottom: 3px; color: #6a7d79; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.fl-modern .fl-select strong { overflow: hidden; width: 100%; font-size: 16px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.fl-modern .fl-chevron { position: absolute; right: 14px; color: #52736b; font-size: 24px; line-height: 1; }
.fl-modern .fl-step { width: 54px; flex: none; border: 1px solid #8cb4a5; border-radius: 10px; background: #ffffff1c; color: white; font-size: 23px !important; }
.fl-modern .fl-search-trigger { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 186px; border: 0; border-radius: 10px; padding: 0 18px; background: #e8c782; color: #153d37; font-size: 14px !important; font-weight: 750 !important; }
.fl-modern .fl-glass { position: relative; display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 50%; }
.fl-modern .fl-glass::after { content: ''; position: absolute; width: 7px; height: 2px; right: -6px; bottom: -3px; transform: rotate(45deg); background: currentColor; }
.fl-modern .fl-nav-help { margin: 10px 1px 0; color: #cbded8; font-size: 12px; }
.fl-modern button:disabled { cursor: not-allowed; opacity: .48; }
.fl-modern :is(button, input, a):focus-visible { outline: 3px solid #d29c40; outline-offset: 3px; }
.fl-modern :is(.fl-select, .fl-step, .fl-search-trigger):not(:disabled):hover { filter: brightness(.96); transform: translateY(-1px); }
.fl-modern .whitebox { margin: 0 0 18px; border: 1px solid #e0e6df; border-radius: 14px; padding: 20px; background: #fff; box-shadow: 0 3px 14px #153b3110; }
.fl-modern #full-verse { padding: 25px 32px; }
.fl-modern #verse-title { color: #23544b; font-family: Manrope, 'Segoe UI', sans-serif; font-size: 20px; font-weight: 750; }
.fl-modern #arabic-verse { line-height: 2.4; font-size: 1.62em; }
.fl-modern :is(#arabic-verse, .arword, .arabic-font, .nice-arabic) { font-family: 'Noto Naskh Arabic', 'Droid Arabic Naskh', serif; }
.fl-modern #eng-translation { line-height: 1.75; color: #44514e; }
.fl-modern #fl-source-issue { margin: 16px 0 0; border-top: 1px solid #e6e8e2; padding-top: 13px; color: #825e27; font-size: 13px; }
.fl-modern #main-title, .fl-modern .loading { color: #204b43; }
.fl-modern .option, .fl-modern .option-none { border-radius: 9px; min-height: 88px; padding: 17px 10px; }
.fl-modern .option { background: #eaf3ec; color: #174f43; }
.fl-modern .option-none { background: #eff1ed; }
.fl-modern a { color: #176759; }
.fl-modern .fl-footer { display: flex; justify-content: flex-end; border-top: 1px solid #dce5db; margin: 38px 0 0; padding: 15px 2px 0; color: #73847b; font-size: 12px; }
.fl-modern .fl-footer p { margin: 0; }
.fl-modern .fl-footer strong { color: #4a675b; font-weight: 650; }
.fl-modern .fl-staff-access { position: relative; z-index: 2; }
.fl-modern .fl-staff-access summary { list-style: none; color: #d1e1d9; font-size: 11px; cursor: pointer; opacity: .78; }
.fl-modern .fl-staff-access summary::-webkit-details-marker { display: none; }
.fl-modern .fl-staff-access summary:hover, .fl-modern .fl-staff-access[open] summary { opacity: 1; text-decoration: underline; }
.fl-modern .fl-staff-form { position: absolute; right: 0; top: 28px; width: 250px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border: 1px solid #dce6dd; border-radius: 10px; padding: 14px; background: white; color: #33564c; box-shadow: 0 15px 35px #173e3250; }
.fl-modern .fl-staff-form label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; }
.fl-modern #code-input { width: 100%; min-width: 0; height: 36px; border: 1px solid #cbd9cf; border-radius: 6px; padding: 0 9px; font: inherit; }
.fl-modern #code-button { border: 0; border-radius: 6px; padding: 0 11px; background: #e6f0e9; color: #315949; font: 700 12px Manrope, sans-serif; cursor: pointer; }
.fl-modern #code-response { grid-column: 1 / -1; font-size: 12px; }

.fl-modern .fl-picker { width: min(570px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 24px)); border: 1px solid #dae3dc; border-radius: 16px; padding: 0; background: #fff; color: #213b3a; box-shadow: 0 28px 80px #0b292c55; }
.fl-modern .fl-picker::backdrop { background: #102e35a8; backdrop-filter: blur(3px); }
.fl-modern .fl-picker-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 22px 24px 17px; border-bottom: 1px solid #e3eae4; }
.fl-modern .fl-picker-head h2 { margin: 4px 0 0; font: 750 25px Manrope, 'Segoe UI', sans-serif; letter-spacing: -.04em; color: #1b433d; }
.fl-modern .fl-picker-close { width: 38px; height: 38px; border: 0; border-radius: 9px; background: #f0f3ef; color: #35554d; font-size: 26px; cursor: pointer; }
.fl-modern .fl-picker-body { padding: 18px 24px 24px; }
.fl-modern #fl-filter-label { display: block; margin-bottom: 8px; color: #426159; font-size: 13px; font-weight: 700; }
.fl-modern #fl-picker-filter { width: 100%; height: 48px; border: 1px solid #b9ccc2; border-radius: 9px; padding: 0 14px; font-family: inherit; font-size: 15px; }
.fl-modern #fl-picker-count { margin: 12px 0 9px; color: #6d7f77; font-size: 12px; }
.fl-modern #fl-picker-options { max-height: min(440px, 48vh); overflow-y: auto; }
.fl-modern .fl-option { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 65px; border: 0; border-bottom: 1px solid #edf0ec; background: #fff; padding: 8px 9px; color: #1d4038; text-align: left; cursor: pointer; }
.fl-modern .fl-option:hover, .fl-modern .fl-option[aria-current], .fl-modern .fl-ayah-option:hover, .fl-modern .fl-ayah-option[aria-current] { background: #edf6ef; }
.fl-modern .fl-number { width: 35px; height: 35px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #e7f0e8; color: #1e5b4d; font-size: 13px; font-weight: 700; }
.fl-modern .fl-option-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fl-modern .fl-option-main strong { font-size: 15px; }
.fl-modern .fl-option-main small, .fl-modern .fl-option-meta { color: #718079; font-size: 12px; }
.fl-modern .fl-option-meta { margin-left: auto; white-space: nowrap; }
.fl-modern #fl-picker-options.fl-ayah-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-content: start; }
.fl-modern .fl-ayah-option { min-height: 46px; border: 1px solid #d7e5d9; border-radius: 8px; background: #fff; color: #205143; font-size: 14px; cursor: pointer; }

.fl-modern #pdfModal { z-index: 30; background: #102e35b5; backdrop-filter: blur(3px); }
.fl-modern #pdfModal .modal-content { display: flex; flex-direction: column; width: min(1050px, calc(100vw - 24px)); height: min(930px, calc(100dvh - 24px)); margin: 12px auto; border: 1px solid #d7e2d9; border-radius: 16px; overflow: hidden; background: #e8ede8; box-shadow: 0 28px 80px #0b292c55; }
.fl-modern #pdfModal .modal-header { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; min-height: 64px; border-bottom: 1px solid #e3eae4; padding: 13px 20px; background: #fff; color: #1b433d; }
.fl-modern #pdfTitle { font: 750 21px Manrope, 'Segoe UI', sans-serif; letter-spacing: -.035em; }
.fl-modern #pdfModal .close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #f0f3ef; color: #35554d; line-height: 1; cursor: pointer; }
.fl-modern .fl-pdf-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 58px; border-bottom: 1px solid #dbe5dd; padding: 9px 20px; background: #fff; color: #3a5c50; }
.fl-modern .fl-pdf-context { font-size: 12px; font-weight: 700; }
.fl-modern #fl-pdf-verse { color: #788980; font-weight: 500; }
.fl-modern .fl-pdf-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fl-modern .fl-pdf-controls button, .fl-modern #fl-pdf-full { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #ccded1; border-radius: 7px; padding: 0 10px; background: #f1f7f1; color: #285c4c; font: 700 12px Manrope, sans-serif; text-decoration: none; cursor: pointer; }
.fl-modern .fl-pdf-controls button:hover, .fl-modern #fl-pdf-full:hover { background: #e5f1e8; }
.fl-modern #fl-pdf-position { min-width: 160px; text-align: center; color: #4c665a; font-size: 12px; font-weight: 700; }
.fl-modern #pdfText { flex: 1; min-height: 0; width: min(100%, 860px); height: auto !important; max-height: none !important; margin: 0 auto; padding: 16px !important; overflow: auto; background: #e8ede8; scrollbar-color: #a5b8a9 #e8ede8 !important; }
.fl-modern #pages { width: 100%; margin: 0; background: #fff; box-shadow: 0 4px 24px #26433320; }
.fl-modern #pages .pdf_page { display: block; width: 100%; height: auto; padding-bottom: 8px; }
.fl-modern #pdfModal .modal-content > div[style*="height: 12px"] { display: none; }
.fl-modern [id^="pdf-"].option { cursor: pointer; }

.fl-modern #searchModal { z-index: 30; background: #102e35a8; backdrop-filter: blur(3px); }
.fl-modern #searchModal .modal-content { display: flex; flex-direction: column; width: min(780px, calc(100vw - 24px)); height: min(850px, calc(100dvh - 24px)); margin: 12px auto; border: 1px solid #dae3dc; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 28px 80px #0b292c55; }
.fl-modern #searchModal .modal-header { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; min-height: 70px; background: #fff; border-bottom: 1px solid #e3eae4; padding: 16px 22px; color: #1b433d; }
.fl-modern #searchTitle { font: 750 25px Manrope, 'Segoe UI', sans-serif; letter-spacing: -.04em; }
.fl-modern #searchModal .close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #f0f3ef; color: #35554d; line-height: 1; cursor: pointer; }
.fl-modern .fl-search-intro { margin: 16px 22px 12px; color: #5d7069; font-size: 14px; }
.fl-modern #inp { display: block; width: calc(100% - 44px) !important; min-height: 52px; margin: 0 22px; border: 1px solid #b9ccc2; border-radius: 9px; padding: 0 15px !important; font: 16px inherit !important; }
.fl-modern #inp.fl-search-invalid { border-color: #bb8840; box-shadow: 0 0 0 2px #e8d2a83d; }
.fl-modern .fl-search-error { margin: 7px 22px 0; color: #8b6126; font-size: 12px; }
.fl-modern .fl-search-error[hidden] { display: none; }
.fl-modern .fl-search-examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 11px 22px 2px; }
.fl-modern .fl-search-examples span { color: #82918a; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.fl-modern .fl-search-examples button { min-height: 32px; border: 1px solid #d8e3d8; border-radius: 7px; background: #f4f8f3; padding: 0 10px; color: #315b4f; font-family: inherit; font-size: 12px; cursor: pointer; }
.fl-modern .fl-search-examples button:hover { background: #e9f2e9; }
.fl-modern #prev { height: auto !important; min-height: 0; padding: 8px 22px !important; background: transparent !important; color: #56746a !important; font-size: 13px !important; text-align: left !important; }
.fl-modern #prev:empty::before { content: 'Search interpretation will appear here'; color: #86968f; }
.fl-modern #findb { width: calc(100% - 44px) !important; min-height: 48px; margin: 0 22px 14px; border: 0; border-radius: 9px; background: #1d6253; color: #fff; font-family: inherit !important; font-size: 15px !important; font-weight: 700 !important; cursor: pointer; }
.fl-modern #findb:disabled { background: #d8e1da; color: #71827a; opacity: 1; }
.fl-modern #results { flex: 1; height: auto !important; max-height: none !important; width: 100% !important; margin: 0 !important; border-top: 1px solid #e3eae4; overflow-y: auto; padding: 12px 18px 22px; background: #f7f8f5; }
.fl-modern #results:not(:has(.search-item))::before { content: 'Results will appear here after you search.'; display: block; padding: 38px 10px; text-align: center; color: #7f8d84; font-size: 14px; }
.fl-modern .search-item { width: 100%; margin: 0 0 10px; border: 1px solid #e1e8e1; border-radius: 10px; padding: 17px 20px; background: #fff; line-height: 1.65; }
.fl-modern .search-item button { min-height: 38px; border: 1px solid #2a6b59; border-radius: 7px; background: #eaf3ec; color: #1d5b4d; padding: 0 14px; cursor: pointer; }
.fl-modern .fl-result-content { color: #344b43; }
.fl-modern .fl-result-content .arabic-font { font-size: 20px; line-height: 2; }
.fl-modern .fl-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; border-top: 1px solid #e9eee8; padding-top: 14px; }
.fl-modern .fl-result-actions button { min-height: 42px; font: 700 13px Manrope, sans-serif; }
.fl-modern .fl-result-actions .fl-read-result { border-color: #1e6252; background: #1e6252; color: #fff; }
.fl-modern .fl-result-actions .fl-read-result:hover { background: #154c40; }
.fl-modern .fl-result-actions .fl-context-trigger { border-color: #d3e1d6; background: #f5f8f4; color: #375e51; }
.fl-modern .fl-result-actions .fl-context-trigger:hover { background: #eaf2e9; }
.fl-modern .fl-result-context { margin-top: 16px; border: 1px solid #dce7dc; border-radius: 9px; overflow: hidden; background: #f9faf7; }
.fl-modern .fl-result-context[hidden] { display: none; }
.fl-modern .fl-context-heading { margin: 0; padding: 10px 14px; background: #e9f0e9; color: #355e50; font-size: 12px; font-weight: 800; }
.fl-modern .fl-context-ayah { padding: 14px; border-top: 1px solid #e5ebe3; }
.fl-modern .fl-context-match { background: #f0f5ed; }
.fl-modern .fl-context-number { color: #1d6252; font-size: 12px; font-weight: 800; }
.fl-modern .fl-context-arabic { margin: 6px 0; font-family: 'Noto Naskh Arabic', 'Droid Arabic Naskh', serif; font-size: 21px; line-height: 2; }
.fl-modern .fl-context-translation { margin: 4px 0 10px; color: #53625b; font-size: 13px; line-height: 1.6; }
.fl-modern .fl-context-read { min-height: 36px !important; border-color: #d3e1d6 !important; background: white !important; font: 700 12px Manrope, sans-serif; }
@media (max-width: 760px) {
  .fl-modern .article { padding: 0 14px 36px; }
  .fl-modern .fl-shell { margin: 0 -14px 18px; padding: 22px 14px; }
  .fl-modern .fl-nav-row { flex-wrap: wrap; }
  .fl-modern .fl-surah-trigger { flex: 1 1 60%; }
  .fl-modern .fl-ayah-trigger { flex: 1 1 30%; }
  .fl-modern .fl-step { flex: 0 0 47px; min-height: 49px; }
  .fl-modern .fl-search-trigger { flex: 1; min-height: 49px; }
  .fl-modern #full-verse { padding: 20px; }
  .fl-modern #fl-picker-options.fl-ayah-grid { grid-template-columns: repeat(5, 1fr); }
  .fl-modern .whitebox table { display: block; overflow-x: auto; }
  .fl-modern #pdfModal .modal-content { width: calc(100vw - 8px); height: calc(100dvh - 8px); margin: 4px auto; border-radius: 11px; }
  .fl-modern #pdfModal .modal-header { min-height: 54px; padding: 8px 14px; }
  .fl-modern #pdfTitle { font-size: 18px; }
  .fl-modern .fl-pdf-toolbar { padding: 8px 14px; }
  .fl-modern .fl-pdf-controls { width: 100%; justify-content: space-between; }
  .fl-modern #fl-pdf-position { min-width: auto; }
  .fl-modern #pdfText { padding: 8px !important; }
}
@media (max-width: 430px) {
  .fl-modern .fl-brand { gap: 12px; }
  .fl-modern .fl-mark { width: 45px; height: 45px; font-size: 30px; }
  .fl-modern .fl-nav-row { gap: 7px; }
  .fl-modern .fl-surah-trigger, .fl-modern .fl-ayah-trigger { flex: 1 1 100%; }
  .fl-modern .fl-search-trigger { min-width: 0; }
  .fl-modern .fl-picker-body { padding: 15px; }
  .fl-modern #fl-picker-options.fl-ayah-grid { grid-template-columns: repeat(4, 1fr); }
  .fl-modern .fl-option-meta { display: none; }
  .fl-modern .fl-pdf-controls button span { display: none; }
  .fl-modern .fl-pdf-controls button { min-width: 35px; padding: 0 8px; }
  .fl-modern #fl-pdf-full { padding: 0 7px; }
}
