@font-face { font-family: "me_quran"; src: local("me_quran"), url("../fonts/me_quran.ttf"); }
@font-face { font-family: "KFGQPC Uthmanic Script HAFS"; src: local("KFGQPC Uthmanic Script HAFS"), url("../fonts/UthmanicHafs.ttf"); }
@font-face { font-family: "kitab"; src: local("kitab"), url("../fonts/Kitab-Regular.ttf"); }

@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
html {
  scroll-behavior: smooth;
}
body {
  padding-top: 0px;
  padding-bottom: 0px;
  background:#251e20 url(images/main-bg.jpg) repeat center top;
  color:#333;
  font-family: 'Roboto', sans-serif, Tahoma, Arial;
}

a { text-decoration: none; color:#666; }
a:hover { color:#115292; }

.header-wrapper { background:url(images/header-bg.png); }
.header-wrapper .container { background:none; padding-top:0px; }
.ads { margin: 0; padding: 15px 0; text-align: center; }

footer { padding:10px; color:#fff; background-color:#4a3f33; }
footer a, footer a:hover { color:#f6c489; }
.powered { text-align:center; margin:10px 0 0 0; color:#fff; }

.custom-breadcrumb { margin-top: 15px; }
.custom-breadcrumb .breadcrumb { background-color:#f9c875; padding: 15px; border-radius: 5px; }
.custom-breadcrumb .breadcrumb > li + li:before {  color: #666; }
.custom-breadcrumb .breadcrumb > .active {  color: #666; }
.custom-breadcrumb .breadcrumb li a span, .breadcrumb li a { color: #fff; }

.card-custom { margin-bottom: 10px; border:none; border-radius:0; border-bottom:1px solid #1774b1; }
.card-custom .card-header { color:#fff; padding: 10px; background:#4a3f33; border-bottom:5px solid #f9c875; border-radius:0px;  }
.card-custom .card-header:first-child { border-radius: 0; }

.block { border: 1px solid #ddd; background-color:#ffffff; margin-bottom:10px; }

.navbar-collapse { padding-left: 0px; }

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: #666666; } /*ff8a00, 64ad15, 1eaade*/

div.spacer { padding:5px; margin: 0; background-color: #ffffff; border-bottom:1px dotted #666; margin-bottom:10px; }
div:hover.spacer { background-color: #eee; border-bottom:1px dotted #333; }

audio { width:100%; }
#sound { text-align:center; }

.ayat, .ayat4tafseer, .ayat2  {
  font-family:  'KFGQPC Uthmanic Script HAFS';
  font-size: 1.9em;
  line-height: 1.8em;
  font-weight: 500;
}

/* الآية الكريمة داخل نص التفسير - تظهر بخط المصحف مع تمييز بصري */
.ayat4tafseer_text .aya,
.aya {
  font-family: 'KFGQPC Uthmanic Script HAFS', "Traditional Arabic", "Amiri Quran", serif !important;
  font-size: 1.15em !important;
  font-weight: 600 !important;
  color: #0d4d36 !important;
  display: inline-block !important;
  margin: 0 4px !important;
  padding: 2px 8px !important;
  line-height: 1.6 !important;
  direction: rtl !important;
  unicode-bidi: isolate !important;
}
.surah-text {
  margin-top: 30px;
  text-align: center;
}
.aya-number {
  font-family: "Traditional Arabic", "Times New Roman";
  font-size: 25px;
  white-space: nowrap;
  color: #0e6efd;
}
#translateindex { font-family: 'KFGQPC Uthmanic Script HAFS'; }
#translateindex h1 { padding: 10px 0; margin: 0; color: #333; text-align:center; direction: ltr; }
#translateindex .englishtext { padding: 10px 0; margin: 0; color: #CC0000; text-align:center; direction: ltr; }
#translateindex .translate { margin: 10px 0; text-align:left; direction: ltr; }
#translateindex .translate_rtl { margin: 10px 5px 10px 0; }
#translateindex .ayat, #translateindex .ayat2, #translateindex .translate_rtl { direction: rtl; text-align:right; }
#translateindex .ayat { padding: 10px; margin-bottom: 10px; background-color:#fff; border: 1px solid #cccccc; }
#translateindex .ayat2 { padding: 10px; margin-bottom: 10px; background-color:#f2f2f2; border: 1px solid #cccccc; }

/* Start View All Sorah */
span.ayat { color:#333; padding: 0; }
span:hover.ayat { color:#425406; }
span:active.ayat { color:#425406; }
img.ayatnumber {  margin:0 5px 0 5px; }
/* End View All Sorah */

/* Start tafseer.php */
.tafseer { padding: 5px; margin: 0; color:#333; text-align:justify; }
.tafseer img { padding: 0; margin: 0; border:none; }
.ayat4tafseer {
  position: relative;
  margin-bottom: 25px;
  background-color:#fff;
  border-bottom: 1px solid #ddd;
  padding-bottom: 15px;
}
.ayat4tafseer .number { color:#3499cc; }
.ayat4tafseer .author { font-size: .7em; }
.ayat4tafseer img { position:relative; top:1px; }
.ayat4tafseer_text {
  margin-bottom: 25px;
  background-color: #fff;
  font-size: 1.3em;
  line-height: 1.6em;
  color: #000;
}
.ayat4tafseersearch { padding: 10px; margin: 0 5px 25px 5px; background-color:#f2f2f2; border: 1px solid #cccccc; text-align:center; }
.ayat4tafseer_info { font-size: .7em; margin-bottom: 0; line-height: 1em; }
.share-content a { color: #4a3f33; }
.share-content a:hover { color: #f9c875; }

.share { text-align:center; margin-top: 10px;  margin-bottom: 20px; border: 1px solid #ddd; padding: 15px; }
.share h5 { margin-bottom: 15px; }
.share a { margin: 0 15px; font-size: 35px; color: #3499cc; }

.ayat, .ayat2 {
  position: relative;
}

.listen_aya {
  position: absolute;
  left: 0;
  top: 10px;
}

.section-content {
  background: #fff;
  padding: 15px;
  background: rgba(250,250,250,.9);
}

.section-title {
  text-align: center;
  margin: 0 0 20px 0;
  padding: 0;
}

.section-title h1 {
  padding-bottom: 15px;
  font-size: 25px;
  font-weight: 700;
  margin: 0 0 10px 0;
  border-bottom: 4px solid #f9c875;
  display: inline-block;
}

.section-1, .section-2, .section-3 {
  padding: 15px 0;
  margin: 0;
  background: #f2f2f2;
  margin-bottom: 0;
}

.section-1 {
  background:#251e20 url(images/section-bg.jpg) repeat center top;
}

.section-2 {
  background:#251e20;
  border-top: 4px solid #56493d;
  border-bottom: 4px solid #56493d;
}

.section-2 .section-content {
  background:#fff;
}

.section-3 {
  background:#251e20 url(images/section-bg.jpg) repeat center top;
}

.quran-file {
  margin-bottom: 15px;
}

.books {
  margin-top: 30px;
}
.books h1, .books h2 {
  font-size: 22px;
  font-weight: 600;
}
.books .btn {
  color: #fff;
}
.books-type-3 .card-img-top {
  max-height: 250px;
}
.book-image {
  position: relative;
}
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: .5s ease;
  background-color: #008CBA;
}
.book-image:hover .overlay {
  opacity: 1;
}
.overlay-text {
  color: #fff;
  font-size: 20px;
  padding: 15px;
}
.overlay-text a, .overlay-text .text-muted {
  color: #fff !important;
}

.books-languages {
  background-color: #fff;
  margin-bottom: 15px;
  padding: 15px;
}

.language-flag {
  border: 0px solid #f9c875;
  margin-top: 20px;
}

.language-flag img {
  width: 50px;
  height: 30px;
}

.language-loop {
  text-align: center;
  margin-bottom: 30px;
  color: #fff;
  background:#251e20 url(images/section-bg.jpg) repeat center top;
}

.language-loop a {
  color: #fff;
}

.language-loop h1 {
  margin-top: 15px;
  padding-top: 0;
  font-weight: 700;
  font-size: 20px;
}

.language-loop h1 a {
  color: #f9c875;
}

.language-count {
  padding-top: 5px;
  padding-bottom: 15px;
}

.language-count span {
  margin: 0 10px;
}

.language-count .fas, .language-count .far {
  color: #f9c875;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #f9c875;
    border-color: #f9c875;
}

.page-link {
    color: #251e20;
}

.page-link:hover {
    color: #f9c875;
}

.flags {
  width: 30px;
  height: 18px;
}

#languages h5 a {
  font-size: 16px;
}
#quran h5 a {
  font-size: 16px;
}
.custom-navbar-brand {
  text-decoration: none !important;
  font-size: 22px;
  font-weight: 600;
}
.custom-nav {
  background-color: rgba(255, 255, 255, .9) !important;
}
@media (max-width: 767px) {
	.ads_hidden{ display:none; }
  .logo { width: 100%; float:none; text-align: center; }
  .ads { width: 100%; float:none; text-align: center; }
}

@media only screen and (min-width: 320px) and (max-width: 479px) {
	.ads_hidden{ display:none; }
}

@media only screen and (min-width: 240px) and (max-width: 320px) {
	.ads_hidden{ display:none; }
}

@media only screen and (max-width: 240px) {
	.ads_hidden{ display:none; }
}
@media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
  .logo { width: 100%; float:none; text-align: center; }
  .ads { width: 100%; float:none; text-align: center; }
}
@media all and (device-width: 1024px) and (device-height: 768px) and (orientation:landscape) {
  .logo { width: 100%; float:none; text-align: center; }
  .ads { width: 100%; float:none; text-align: center; }
}

/* =========================================================
   Ibn Thani Royal Quran Interface
   ========================================================= */
:root {
  --royal-green-dark: #031f17;
  --royal-green: #073b2a;
  --royal-green-soft: #0d4d36;
  --royal-gold: #d4af37;
  --royal-gold-light: #f4d783;
  --royal-border: rgba(212, 175, 55, .48);
  --royal-text: #fff7d7;
  --royal-muted: #d8c990;
}

html { background: var(--royal-green-dark); }
body {
  background:
    radial-gradient(circle at top center, rgba(18, 96, 63, .72) 0, rgba(3, 31, 23, .98) 56%),
    linear-gradient(135deg, #02150f 0%, #073b2a 50%, #02150f 100%) !important;
  color: var(--royal-text);
  min-height: 100vh;
}

a { color: var(--royal-muted); transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
a:hover, a:focus { color: var(--royal-gold-light) !important; }

.royal-top {
  background:
    radial-gradient(circle at top center, rgba(23, 103, 70, .55), rgba(3, 31, 23, .96) 70%),
    linear-gradient(180deg, #062d21 0%, #031f17 100%);
  border-top: 1px solid rgba(212, 175, 55, .65);
  border-bottom: 1px solid var(--royal-border);
  padding: 22px 0 18px;
}
.royal-top-grid {
  display: grid;
  grid-template-columns: minmax(230px, 320px) 1fr minmax(90px, 140px);
  align-items: center;
  gap: 18px;
}
.royal-brand {
  text-align: center;
  color: var(--royal-gold-light) !important;
  display: block;
  text-decoration: none !important;
  line-height: 1.35;
}
.royal-brand-title {
  display: block;
  font-size: 42px;
  font-weight: 800;
  color: var(--royal-gold-light);
  text-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.royal-brand-subtitle {
  display: block;
  font-size: 16px;
  color: var(--royal-text);
  opacity: .9;
  margin-top: 5px;
}
.royal-search,
.royal-inline-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(212, 175, 55, .34);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 48px;
  color: var(--royal-gold-light);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.royal-search:focus-within,
.royal-inline-search:focus-within {
  border-color: var(--royal-gold-light);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .15);
}
.royal-search input,
.royal-inline-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--royal-text);
  font-size: 16px;
  min-width: 0;
}
.royal-search-submit {
  background: transparent;
  border: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-gold-light);
  cursor: pointer;
  border-radius: 6px;
  transition: background .18s ease;
  flex-shrink: 0;
}
.royal-search-submit:hover,
.royal-search-submit:focus {
  background: rgba(212, 175, 55, .15);
  outline: none;
}
.royal-search-submit i { font-size: 16px; }
.royal-search input::placeholder,
.royal-inline-search input::placeholder { color: rgba(255, 247, 215, .64); }
.royal-tools { text-align: left; }
.royal-tool-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(212, 175, 55, .35);
  color: var(--royal-gold-light) !important;
}

.custom-nav.royal-nav {
  background: linear-gradient(180deg, rgba(11, 78, 53, .98), rgba(5, 47, 34, .98)) !important;
  border-bottom: 1px solid var(--royal-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.royal-nav .navbar-nav { gap: 16px; }
.royal-nav .nav-link {
  color: var(--royal-text) !important;
  font-size: 18px;
  font-weight: 700;
  padding: 18px 16px !important;
  border-bottom: 3px solid transparent;
}
.royal-nav .nav-link i { color: var(--royal-gold-light); margin-inline-start: 6px; }
.royal-nav .nav-link:hover,
.royal-nav .nav-link:focus {
  color: var(--royal-gold-light) !important;
  border-bottom-color: var(--royal-gold);
}
.royal-language-menu {
  background: rgba(3, 31, 23, .98);
  border: 1px solid var(--royal-border);
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
  padding: 8px;
  min-width: 230px;
}
/* Ensure dropdown menus stay hidden until Bootstrap toggles them */
.dropdown-menu.royal-language-menu:not(.show) {
  display: none !important;
}
.royal-language-menu .dropdown-item {
  color: var(--royal-text);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
}
.royal-language-menu .dropdown-item:hover,
.royal-language-menu .dropdown-item.active {
  background: rgba(212, 175, 55, .14);
  color: var(--royal-gold-light) !important;
}
.royal-language-menu .dropdown-divider { border-color: rgba(212, 175, 55, .28); }

.header-wrapper {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, 0)),
    radial-gradient(circle at top center, rgba(15, 83, 57, .5), rgba(3, 31, 23, 0) 60%) !important;
}
.container-section,
.home-sections { background: transparent !important; }
.section-1, .section-2, .section-3 {
  background:
    radial-gradient(circle at center top, rgba(21, 109, 74, .42), rgba(3, 31, 23, .96) 62%),
    linear-gradient(135deg, #02150f 0%, #073b2a 50%, #02150f 100%) !important;
  border: 0;
  padding: 34px 0;
}
.section-2 { border-top: 1px solid var(--royal-border); border-bottom: 1px solid var(--royal-border); }
.section-content {
  background: rgba(5, 45, 32, .72) !important;
  border: 1px solid var(--royal-border);
  border-radius: 16px;
  padding: 28px;
  color: var(--royal-text);
  box-shadow: 0 18px 45px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(2px);
}
.section-title h1 {
  color: var(--royal-gold-light);
  border-bottom-color: var(--royal-gold);
  font-size: 32px;
  font-weight: 800;
  text-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.royal-home-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 28px;
  align-items: start;
}
.royal-home-main { min-width: 0; }
.royal-home-side { display: grid; gap: 18px; }
.royal-side-card,
.royal-random-ayah {
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(212, 175, 55, .32);
  border-radius: 12px;
  padding: 18px;
  color: var(--royal-text);
}
.royal-side-card h2,
.royal-random-title {
  color: var(--royal-gold-light);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
  text-align: center;
}
.royal-side-card p { margin-bottom: 0; color: var(--royal-text); line-height: 1.8; }
.royal-stats p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, .18);
  padding: 7px 0;
}
.royal-stats p:last-child { border-bottom: 0; }
.royal-stats strong { color: var(--royal-gold-light); }

#quran .row > [class*="col-"],
#tafseer .row > [class*="col-"],
#languages .row > [class*="col-"] { margin-bottom: 14px; }
div.spacer {
  background: linear-gradient(180deg, rgba(18, 91, 63, .88), rgba(8, 62, 43, .92)) !important;
  border: 1px solid rgba(212, 175, 55, .45) !important;
  border-radius: 10px;
  margin-bottom: 0;
  padding: 0;
  min-height: 68px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.14);
  overflow: hidden;
}
div:hover.spacer {
  background: linear-gradient(180deg, rgba(28, 116, 79, .96), rgba(10, 73, 50, .98)) !important;
  border-color: var(--royal-gold-light) !important;
  box-shadow: 0 0 0 1px rgba(212,175,55,.18), 0 0 22px rgba(212,175,55,.22);
  transform: translateY(-1px);
}
div.spacer h5 { margin: 0; height: 100%; }
div.spacer h5 a {
  color: var(--royal-text) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 15px 16px;
  font-size: 18px !important;
  font-weight: 800;
  line-height: 1.4;
}
div.spacer h5 a:hover { color: var(--royal-gold-light) !important; }
.surah-card-icon { color: var(--royal-gold-light); font-size: 22px; opacity: .95; }
.surah-card-name { flex: 1; }
.surah-card-number { color: var(--royal-gold-light); font-size: 16px; }

.royal-random-ayah { margin-top: 10px; text-align: center; }
.royal-random-text {
  font-family: 'KFGQPC Uthmanic Script HAFS', 'Traditional Arabic', serif;
  color: #fff;
  font-size: 27px;
  line-height: 1.9;
  margin: 10px 0;
}
.royal-random-ref { color: var(--royal-gold-light); }

.card-custom,
.block,
.books-languages,
.ayat4tafseer,
.ayat4tafseer_text,
#translateindex .ayat,
#translateindex .ayat2 {
  border-color: rgba(212, 175, 55, .32) !important;
  background: rgba(255,255,255,.92) !important;
  border-radius: 10px;
}
.card-custom .card-header {
  background: linear-gradient(180deg, #0d4d36, #073b2a) !important;
  border-bottom-color: var(--royal-gold) !important;
}
.custom-breadcrumb .breadcrumb,
.page-item.active .page-link {
  background-color: var(--royal-gold) !important;
  border-color: var(--royal-gold) !important;
}
.page-link { color: var(--royal-green); }
.page-link:hover { color: var(--royal-gold) !important; }

footer {
  background: linear-gradient(180deg, #073b2a, #031f17) !important;
  border-top: 1px solid var(--royal-border);
  color: var(--royal-text);
  padding: 18px 10px;
}
footer a, footer a:hover { color: var(--royal-gold-light) !important; }
.powered p { margin: 3px 0; color: var(--royal-text); }

.quran-card.royal-filter-hidden { display: none !important; }
.quran-card.royal-filter-hidden-wrap { display: none !important; }

@media (max-width: 991px) {
  .royal-top-grid { grid-template-columns: 1fr; text-align: center; }
  .royal-search { max-width: 520px; margin: 0 auto; width: 100%; }
  .royal-tools { display: none; }
  .royal-home-layout { grid-template-columns: 1fr; }
  .royal-nav .navbar-nav { gap: 0; }
  .royal-nav .nav-link { padding: 12px 10px !important; }
}
@media (max-width: 575px) {
  .royal-brand-title { font-size: 30px; }
  .section-content { padding: 18px; }
  .section-title h1 { font-size: 26px; }
  div.spacer h5 a { font-size: 16px !important; padding: 13px 12px; }
  .royal-random-text { font-size: 22px; }
}

/* Quran logo: lightweight transparent PNG, no layout rebuild */
.royal-brand-logo {
  display: block;
  width: min(190px, 68vw);
  height: auto;
  max-height: 58px;
  object-fit: contain;
  margin: 0 auto 2px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.38));
}
.royal-brand-subtitle {
  margin-top: 0;
}
@media (max-width: 767.98px) {
  .royal-brand-logo {
    width: min(165px, 66vw);
    max-height: 48px;
  }
}

/* Royal UI refinement: reduce mobile gaps, compact surah cards, improve breadcrumb contrast */
.header-wrapper {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.header-wrapper .container {
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.section-1,
.section-2,
.section-3 {
  padding-top: 18px !important;
  padding-bottom: 24px !important;
}
.custom-breadcrumb {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
}
.custom-breadcrumb .breadcrumb {
  background: linear-gradient(180deg, #d9bd55, #caa53a) !important;
  color: #073b2a !important;
  border: 1px solid rgba(255, 232, 145, .35);
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.custom-breadcrumb .breadcrumb,
.custom-breadcrumb .breadcrumb li,
.custom-breadcrumb .breadcrumb li a,
.custom-breadcrumb .breadcrumb li a span,
.custom-breadcrumb .breadcrumb > .active,
.custom-breadcrumb .breadcrumb > li + li:before {
  color: #073b2a !important;
  font-weight: 800;
  text-shadow: none !important;
}

div.spacer { min-height: 60px; }
div.spacer h5 a {
  min-height: 60px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 19px !important;
  letter-spacing: 0.3px;
}
.surah-card-icon { font-size: 21px; }
.surah-card-name { 
  font-size: 18px; 
  font-weight: 800;
  color: #fff7d7;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.surah-card-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--royal-gold-light);
}

@media (max-width: 767.98px) {
  .section-1,
  .section-2,
  .section-3 {
    padding-top: 10px !important;
    padding-bottom: 14px !important;
  }
  .section-content {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }
  .custom-breadcrumb { margin-bottom: 10px !important; }
  .custom-breadcrumb .breadcrumb {
    padding: 10px 12px !important;
    font-size: 16px;
    line-height: 1.6;
  }
  #quran .row > [class*="col-"],
  #tafseer .row > [class*="col-"],
  #languages .row > [class*="col-"] {
    margin-bottom: 8px;
  }
  #quran .row,
  #tafseer .row,
  #languages .row {
    --bs-gutter-x: 0.7rem;
    --bs-gutter-y: 0;
  }
  div.spacer { min-height: 54px; border-radius: 9px; }
  div.spacer h5 a {
    min-height: 54px;
    padding: 9px 12px !important;
    font-size: 17px !important;
    line-height: 1.35;
    gap: 8px;
    font-weight: 800;
  }
  .surah-card-icon { font-size: 19px; }
  .surah-card-number { font-size: 15px; font-weight: 700; }
  .surah-card-name { 
    font-size: 17px; 
    font-weight: 800;
    color: #fff7d7;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

@media (max-width: 420px) {
  div.spacer { min-height: 50px; }
  div.spacer h5 a {
    min-height: 50px;
    padding: 7px 10px !important;
    font-size: 16px !important;
    gap: 7px;
  }
  .surah-card-icon { font-size: 17px; }
  .surah-card-number { font-size: 14px; }
  .surah-card-name { font-size: 16px; font-weight: 800; }
}

/* =========================================================
   Royal Edition v2 — Additions
   Top language switcher, random recitation button,
   stat icons, ornament titles, scope dropdown
   ========================================================= */

/* Top-bar language switcher (replaces home icon) */
.royal-lang-switcher { display: inline-block; }
.royal-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.04);
  color: var(--royal-gold-light) !important;
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.royal-lang-btn:hover,
.royal-lang-btn:focus {
  background: rgba(212,175,55,.1);
  border-color: var(--royal-gold-light);
  box-shadow: 0 0 0 2px rgba(212,175,55,.18);
  outline: none;
}
.royal-lang-btn i { color: var(--royal-gold-light); }
.royal-lang-current { color: var(--royal-text); }
.royal-lang-btn::after { margin-inline-start: 4px; color: var(--royal-gold-light); }

/* Random recitation button under random ayah */
.royal-random-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 22px;
  border-radius: 10px;
  background: rgba(212,175,55,.08);
  border: 1px solid var(--royal-gold);
  color: var(--royal-gold-light) !important;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none !important;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.royal-random-btn:hover,
.royal-random-btn:focus {
  background: rgba(212,175,55,.18);
  color: var(--royal-gold-light) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212,175,55,.18);
}
.royal-random-btn i { font-size: 14px; }

/* "More" button inside about card */
.royal-more-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 28px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(212,175,55,.55);
  color: var(--royal-gold-light) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background .18s ease;
}
.royal-more-btn:hover,
.royal-more-btn:focus {
  background: rgba(212,175,55,.12);
  color: var(--royal-gold-light) !important;
}

/* Stats with icons (right-side card) */
.royal-stats p {
  font-size: 15px;
}
.royal-stats strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--royal-text);
  font-weight: 700;
}
.royal-stats strong i {
  color: var(--royal-gold-light);
  font-size: 13px;
  opacity: .85;
}

/* Ornament beside section titles */
.royal-title-ornament {
  display: inline-block;
  color: var(--royal-gold);
  opacity: .8;
  margin: 0 14px;
  font-size: .65em;
  vertical-align: middle;
}
.section-title h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-bottom: 0 !important;
}
.royal-side-card h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 19px !important;
}
.royal-side-card h2 i { color: var(--royal-gold-light); font-size: 16px; }

/* Quick search scope dropdown look */
.royal-search-scope {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(212,175,55,.32);
  border-radius: 10px;
  color: var(--royal-text);
  font-size: 15px;
  cursor: pointer;
}
.royal-search-scope i {
  color: var(--royal-gold-light);
  font-size: 12px;
}

/* Random recitation title — more spacing for the icons */
.royal-random-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 22px;
}
.royal-random-title i {
  color: var(--royal-gold-light);
  font-size: 18px;
}
.royal-random-ref {
  margin-top: 4px;
  font-size: 14px;
  opacity: .9;
}

/* Footer container alignment */
.royal-footer .container { padding: 0 15px; }
.royal-footer .powered p { line-height: 1.7; }

/* Tighter mobile spacing for new elements */
@media (max-width: 767.98px) {
  .royal-lang-btn { padding: 6px 12px; font-size: 14px; min-height: 38px; }
  .royal-random-btn { padding: 8px 18px; font-size: 15px; }
  .royal-title-ornament { margin: 0 8px; }
  .royal-random-title { font-size: 18px; gap: 8px; }
  .royal-side-card h2 { font-size: 17px !important; }
}

/* Accessibility: keyboard focus rings */
.royal-tool-btn:focus-visible,
.royal-lang-btn:focus-visible,
.royal-random-btn:focus-visible,
.royal-more-btn:focus-visible,
.royal-nav .nav-link:focus-visible {
  outline: 2px solid var(--royal-gold-light);
  outline-offset: 2px;
}

/* Active nav-link underline (matches screenshot) */
.royal-nav .nav-link.active {
  color: var(--royal-gold-light) !important;
  border-bottom-color: var(--royal-gold) !important;
}

/* =========================================================
   Royal Edition v3 — Logo Fix + Breadcrumb + Share Icons
   ========================================================= */

/* ===== 1. تكبير الشعار في الجوال (كان مضغوطًا) ===== */
.royal-brand-logo {
  width: min(220px, 75vw) !important;
  max-height: 72px !important;
  height: auto !important;
}
@media (max-width: 767.98px) {
  .royal-brand-logo {
    width: min(200px, 72vw) !important;
    max-height: 64px !important;
  }
  .royal-top {
    padding: 14px 0 12px;
  }
  .royal-brand-subtitle {
    font-size: 14px;
    margin-top: 4px;
  }
}
@media (max-width: 420px) {
  .royal-brand-logo {
    width: min(180px, 70vw) !important;
    max-height: 58px !important;
  }
}

/* ===== 2. Breadcrumb بألوان متناسقة (قراءته سهلة) ===== */
.custom-breadcrumb .breadcrumb {
  background: rgba(212, 175, 55, 0.12) !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  color: var(--royal-gold-light) !important;
  border-radius: 10px;
  padding: 12px 16px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 4px 12px rgba(0, 0, 0, 0.18);
}
.custom-breadcrumb .breadcrumb,
.custom-breadcrumb .breadcrumb li,
.custom-breadcrumb .breadcrumb li a,
.custom-breadcrumb .breadcrumb li a span,
.custom-breadcrumb .breadcrumb > .active,
.custom-breadcrumb .breadcrumb > li + li:before {
  color: var(--royal-gold-light) !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45) !important;
}
.custom-breadcrumb .breadcrumb li a {
  color: var(--royal-text) !important;
  transition: color .18s ease;
}
.custom-breadcrumb .breadcrumb li a:hover {
  color: var(--royal-gold-light) !important;
}
.custom-breadcrumb .breadcrumb > .active {
  color: var(--royal-gold-light) !important;
}
.custom-breadcrumb .breadcrumb > li + li:before {
  content: "/";
  color: rgba(212, 175, 55, 0.6) !important;
  padding: 0 8px;
}

/* ===== 3. Share Icons - تصميم ذهبي/أخضر ملكي ===== */
.royal-share {
  margin-top: 24px;
  padding: 20px;
  background: rgba(7, 59, 42, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 14px;
  text-align: center;
}
.royal-share h5 {
  color: var(--royal-gold-light);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.royal-share h5::before,
.royal-share h5::after {
  content: "❖";
  color: var(--royal-gold);
  font-size: 0.7em;
  opacity: 0.7;
}

.royal-share-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.royal-share-icons a,
.royal-share-icons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.06)) !important;
  border: 1px solid rgba(212, 175, 55, 0.55) !important;
  color: var(--royal-gold-light) !important;
  font-size: 17px;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  padding: 0;
}

.royal-share-icons a:hover,
.royal-share-icons a:focus,
.royal-share-icons button:hover,
.royal-share-icons button:focus {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15)) !important;
  border-color: var(--royal-gold-light) !important;
  color: #fff7d7 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.25), 0 0 0 3px rgba(212, 175, 55, 0.12);
  outline: none;
}

.royal-share-icons a i,
.royal-share-icons button i {
  font-size: 16px;
  line-height: 1;
}

/* ===== 4. أيقونة X (Twitter الجديدة) — SVG مخصص ===== */
.royal-share-icons .fa-x-twitter,
.fa-x-twitter {
  font-family: inherit !important;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f4d783'><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  vertical-align: middle;
}
.royal-share-icons .fa-x-twitter::before,
.fa-x-twitter::before {
  content: "" !important;
  display: none;
}
.royal-share-icons a:hover .fa-x-twitter,
.royal-share-icons a:focus .fa-x-twitter {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff7d7'><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/></svg>");
}

/* Mobile responsive for share */
@media (max-width: 575px) {
  .royal-share { padding: 16px 12px; }
  .royal-share-icons { gap: 8px; }
  .royal-share-icons a,
  .royal-share-icons button {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  .royal-share-icons a i,
  .royal-share-icons button i {
    font-size: 14px;
  }
  .royal-share-icons .fa-x-twitter,
  .fa-x-twitter {
    width: 14px;
    height: 14px;
  }
}

/* Copy link button feedback */
.royal-share-copy.copied {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(76, 175, 80, 0.15)) !important;
  border-color: #66bb6a !important;
  color: #c8e6c9 !important;
}

/* =========================================================
   Royal Edition v3 — Prayer Times Block
   ========================================================= */
.royal-prayer-card {
  position: relative;
}

/* New: header row — title on right (RTL), city select on left */
.royal-prayer-card {
  overflow: hidden;  /* Critical: prevent any child from escaping */
}
.royal-prayer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;  /* Critical for flex shrinking */
}
.royal-prayer-header h2 {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 16px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
  order: 1;
  white-space: nowrap;
}
.royal-prayer-header .royal-prayer-city-wrap {
  order: 2;
  flex-shrink: 0;
}
.royal-prayer-header h2 i.fa-kaaba {
  color: var(--royal-gold-light);
  font-size: 18px;
}

/* City selector: custom dropdown — iOS-friendly, keeps royal theme */
.royal-prayer-card .royal-prayer-city-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.06));
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  max-width: 160px;
  min-width: 120px;
  flex-shrink: 1;  /* allow shrinking when title is long */
  overflow: hidden;
  box-sizing: border-box;
}
.royal-prayer-city-wrap:hover,
.royal-prayer-city-wrap:focus-within {
  border-color: var(--royal-gold-light);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.1));
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.royal-prayer-city-wrap > i {
  color: var(--royal-gold-light);
  font-size: 12px;
  flex-shrink: 0;
}
.royal-prayer-card .royal-prayer-city {
  flex: 1 1 auto;
  width: 100%;
  /* Force-override iOS native styling */
  background: transparent !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23f4d783'><path d='M3 4.5l3 3 3-3z'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
  background-size: 9px !important;
  border: 0 !important;
  outline: 0 !important;
  color: var(--royal-gold-light) !important;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 12px 1px 0;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  direction: rtl;
  /* iOS Safari needs these to fully suppress default look */
  border-radius: 0;
  box-shadow: none;
  -webkit-border-radius: 0;
  line-height: 1.5;
  box-sizing: border-box;
}
.royal-prayer-city:focus {
  color: #fff7d7 !important;
  background-color: transparent !important;
}
.royal-prayer-city option {
  background: #031f17 !important;
  color: var(--royal-text) !important;
  font-weight: 600;
  text-align: right;
  direction: rtl;
  padding: 8px;
}

/* Old class kept for any existing markup */
.royal-prayer-meta { margin-bottom: 14px; }
.royal-prayer-city-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.royal-prayer-city-row i {
  color: var(--royal-gold-light);
  font-size: 14px;
}

.royal-prayer-date {
  font-size: 13px;
  color: var(--royal-muted);
  text-align: center;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.18);
  margin-bottom: 12px;
  line-height: 1.6;
}
.royal-prayer-date span {
  display: inline-block;
  margin: 0 4px;
}
.royal-prayer-date .royal-hijri {
  color: var(--royal-gold-light);
  font-weight: 700;
}

.royal-prayer-next {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.06));
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  text-align: center;
}
.royal-prayer-next-label {
  display: block;
  color: var(--royal-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.royal-prayer-next-name {
  color: var(--royal-gold-light);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 2px;
}
.royal-prayer-next-countdown {
  color: var(--royal-text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.royal-prayer-next-countdown.royal-prayer-now {
  color: #66bb6a;
  font-size: 16px;
}
.royal-prayer-loading {
  text-align: center;
  color: var(--royal-muted);
  font-size: 14px;
  padding: 6px 0;
}
.royal-prayer-error {
  text-align: center;
  color: #ff7373;
  font-size: 13px;
  padding: 6px 0;
}

.royal-prayer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.royal-prayer-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
  font-size: 15px;
  transition: background .18s ease;
}
.royal-prayer-list li:last-child { border-bottom: 0; }
.royal-prayer-list li.royal-prayer-active {
  background: rgba(212, 175, 55, 0.12);
  border-radius: 8px;
  border-bottom-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.32);
}
.royal-prayer-list li.royal-prayer-active .royal-prayer-name {
  color: var(--royal-gold-light);
  font-weight: 800;
}
.royal-prayer-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--royal-text);
  font-weight: 600;
}
.royal-prayer-name i {
  color: var(--royal-gold-light);
  font-size: 13px;
  width: 16px;
  text-align: center;
}
.royal-prayer-time {
  color: var(--royal-gold-light);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.royal-prayer-method {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(212, 175, 55, 0.2);
  text-align: center;
  color: var(--royal-muted);
  font-size: 12px;
  line-height: 1.5;
}
.royal-prayer-method i { color: var(--royal-gold-light); margin-inline-end: 4px; }

@media (max-width: 575px) {
  .royal-prayer-next-name { font-size: 18px; }
  .royal-prayer-list li { padding: 8px 10px; font-size: 14px; }
  .royal-prayer-time { font-size: 14px; }
}

/* Footer link to ibn-thani.com blog */
.royal-footer-link {
  color: var(--royal-gold-light) !important;
  text-decoration: none !important;
  font-weight: 700;
  border-bottom: 1px solid rgba(212, 175, 55, 0.32);
  padding-bottom: 1px;
  transition: color .18s ease, border-color .18s ease;
}
.royal-footer-link:hover,
.royal-footer-link:focus {
  color: #fff7d7 !important;
  border-bottom-color: var(--royal-gold-light);
  outline: none;
}

/* =========================================================
   Royal Edition — Unified Search Page
   ========================================================= */
.royal-search-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 0;
}

.royal-search-form {
  background: rgba(7, 59, 42, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}

.royal-search-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 10px;
  padding: 4px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.royal-search-input-wrap:focus-within {
  border-color: var(--royal-gold-light);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.royal-search-input-wrap > i {
  color: var(--royal-gold-light);
  font-size: 16px;
  padding: 0 10px;
  align-self: center;
}
.royal-search-input-wrap input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--royal-text);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 8px;
  font-family: inherit;
  min-width: 0;
}
.royal-search-input-wrap input[type="search"]::placeholder {
  color: rgba(255, 247, 215, .64);
}

.royal-search-go {
  background: linear-gradient(135deg, #d4af37, #f4d783);
  color: #073b2a !important;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s ease, transform .18s ease;
  flex-shrink: 0;
}
.royal-search-go:hover,
.royal-search-go:focus {
  background: linear-gradient(135deg, #f4d783, #ffe9a8);
  transform: translateY(-1px);
  outline: none;
}
.royal-search-go i { font-size: 13px; }

.royal-search-scope-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.royal-search-scope-select label {
  color: var(--royal-muted);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.royal-search-scope-select label i {
  color: var(--royal-gold-light);
  font-size: 12px;
}
.royal-search-scope-select select {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--royal-text);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.royal-search-scope-select select option {
  background: #031f17;
  color: var(--royal-text);
}

.royal-search-hint,
.royal-search-empty {
  text-align: center;
  color: var(--royal-muted);
  font-size: 16px;
  padding: 30px 20px;
  background: rgba(7, 59, 42, 0.3);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  margin: 20px 0;
}
.royal-search-hint i,
.royal-search-empty i {
  color: var(--royal-gold-light);
  font-size: 24px;
  display: block;
  margin-bottom: 10px;
}

.royal-search-summary {
  margin: 14px 0 18px;
}
.royal-search-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.royal-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--royal-gold-light);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.royal-stat-pill i { font-size: 12px; }

.royal-search-section {
  margin-bottom: 22px;
}
.royal-search-section-title {
  color: var(--royal-gold-light);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}
.royal-search-section-title i {
  color: var(--royal-gold);
  font-size: 16px;
}

/* Surah match grid (small cards) */
.royal-search-surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.royal-search-surah-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.7), rgba(7, 59, 42, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  color: var(--royal-text) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.royal-search-surah-card:hover,
.royal-search-surah-card:focus {
  transform: translateY(-2px);
  border-color: var(--royal-gold-light);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.2);
  color: #fff7d7 !important;
  outline: none;
}
.royal-search-surah-card > i {
  color: var(--royal-gold-light);
  font-size: 18px;
}
.royal-search-surah-card .royal-search-surah-name {
  flex: 1;
  font-size: 16px;
}
.royal-search-surah-card .royal-search-surah-num {
  color: var(--royal-gold-light);
  font-weight: 800;
  font-size: 14px;
}

/* Ayah results */
.royal-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.royal-search-result {
  display: block;
  padding: 14px 16px;
  background: rgba(7, 59, 42, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--royal-text) !important;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.royal-search-result:hover,
.royal-search-result:focus {
  border-color: var(--royal-gold-light);
  background: rgba(7, 59, 42, 0.75);
  transform: translateY(-1px);
  outline: none;
}
.royal-search-result-ref {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.royal-search-surah-tag,
.royal-search-ayah-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.royal-search-surah-tag {
  background: rgba(212, 175, 55, 0.15);
  color: var(--royal-gold-light);
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.royal-search-surah-tag i { font-size: 11px; }
.royal-search-ayah-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--royal-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.royal-search-result-text {
  font-size: 19px;
  line-height: 2;
  color: #fff7d7;
  font-family: "Amiri Quran", "Amiri", "Scheherazade", "Traditional Arabic", serif;
  text-align: right;
}
.royal-search-result-text mark {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 700;
}

@media (max-width: 575px) {
  .royal-search-form { padding: 14px; }
  .royal-search-input-wrap input[type="search"] { font-size: 16px; padding: 10px 8px; }
  .royal-search-go { padding: 9px 14px; font-size: 14px; }
  .royal-search-go span { display: none; } /* show only icon on phone */
  .royal-search-result-text { font-size: 17px; line-height: 1.9; }
  .royal-search-surah-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Royal Edition — Inline Search Bar (above surah grid)
   ========================================================= */
/* Unified inline search bar — matches top header search */
.royal-inline-search-bar {
  margin: 0 auto 18px;
  max-width: 720px;
  width: 100%;
}
.royal-inline-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 48px;
  color: var(--royal-gold-light);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.royal-inline-search-wrap:focus-within {
  border-color: var(--royal-gold-light);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.royal-inline-search-wrap > i {
  color: var(--royal-gold-light);
  font-size: 16px;
  flex-shrink: 0;
}
.royal-inline-search-wrap input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--royal-text);
  font-size: 16px;
  padding: 0;
  font-family: inherit;
  min-width: 0;
}
.royal-inline-search-wrap input[type="search"]::placeholder {
  color: rgba(255, 247, 215, .64);
}

.royal-inline-search-btn {
  background: transparent;
  border: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-gold-light);
  cursor: pointer;
  border-radius: 6px;
  transition: background .18s ease;
  flex-shrink: 0;
}
.royal-inline-search-btn:hover,
.royal-inline-search-btn:focus {
  background: rgba(212, 175, 55, 0.15);
  outline: none;
}
.royal-inline-search-btn i {
  font-size: 16px;
  color: var(--royal-gold-light);
}

@media (max-width: 575px) {
  .royal-inline-search-bar { margin-bottom: 14px; }
  .royal-inline-search-wrap { min-height: 44px; padding: 0 10px; }
  .royal-inline-search-wrap input[type="search"] { font-size: 15px; }
}

/* =========================================================
   Royal Edition v6 — Mobile Layout Fixes
   Fix order: Logo → Navbar → Title → Search → Cards
   ========================================================= */

/* On mobile, hide the top search bar (cluttered) - keep only the inline search */
@media (max-width: 767.98px) {
  .royal-top .royal-search {
    display: none !important;
  }
  
  .royal-top-grid {
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    padding: 10px 12px !important;
  }
  
  .royal-brand {
    order: 1;
  }
  
  .royal-tools {
    order: 2;
  }
  
  /* Compact language button on mobile */
  .royal-lang-btn {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  .royal-lang-btn .royal-lang-current {
    display: none; /* show only icon on small screens */
  }
}

/* Even more compact on small phones */
@media (max-width: 380px) {
  .royal-brand-logo {
    width: 160px !important;
    max-height: 50px !important;
  }
  .royal-brand-subtitle {
    font-size: 12px !important;
  }
  .royal-top-grid {
    padding: 8px 10px !important;
  }
}

/* Ensure Bootstrap dropdown menus stay collapsed when JS not loaded */
.dropdown-menu:not(.show) {
  display: none !important;
}

/* But navbar collapsed items should still work via Bootstrap toggle */
.navbar-collapse.collapse:not(.show) {
  display: none;
}
.navbar-collapse.collapsing,
.navbar-collapse.show {
  display: block !important;
}

/* Desktop: ensure navbar items always visible */
@media (min-width: 992px) {
  .navbar-collapse.collapse {
    display: flex !important;
  }
}

/* Hide native bullet/number lists from converted markdown that shouldn't show */
.royal-language-menu,
.royal-language-menu * {
  list-style: none !important;
}

/* =========================================================
   Royal Edition v6 — Mushaf Editions Section
   إصدارات المصاحف من مجمع الملك فهد
   ========================================================= */
.royal-mushaf-section {
  padding: 28px 0;
  background: linear-gradient(180deg, rgba(7, 59, 42, 0.0), rgba(7, 59, 42, 0.4));
}

.royal-mushaf-wrap {
  padding: 24px;
  background: rgba(7, 59, 42, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.royal-mushaf-subtitle {
  text-align: center;
  color: var(--royal-muted);
  font-size: 14px;
  margin: 6px 0 22px;
  font-weight: 500;
}

.royal-mushaf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.royal-mushaf-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.75), rgba(7, 59, 42, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.royal-mushaf-card:hover,
.royal-mushaf-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--royal-gold-light);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(212, 175, 55, 0.25);
}

/* Cover area: gold gradient + decorative book icon */
.royal-mushaf-cover {
  position: relative;
  height: 92px;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.06)),
    radial-gradient(ellipse at center, rgba(212, 175, 55, 0.12) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.royal-mushaf-cover > i {
  font-size: 44px;
  color: var(--royal-gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  opacity: 0.92;
}
.royal-mushaf-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  background: linear-gradient(135deg, #d4af37, #f4d783);
  color: #073b2a;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Body */
.royal-mushaf-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
}
.royal-mushaf-name {
  color: var(--royal-gold-light);
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.royal-mushaf-size {
  color: var(--royal-muted);
  font-size: 12px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.royal-mushaf-size i {
  color: var(--royal-gold-light);
  font-size: 11px;
}

/* Open button */
.royal-mushaf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #d4af37, #f4d783);
  color: #073b2a !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  border-radius: 10px;
  margin-top: auto;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.royal-mushaf-btn:hover,
.royal-mushaf-btn:focus {
  background: linear-gradient(135deg, #f4d783, #ffe9a8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
  outline: none;
}
.royal-mushaf-btn i { font-size: 12px; }

/* Footer note */
.royal-mushaf-footer {
  margin-top: 22px;
  padding: 14px 18px;
  text-align: center;
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed rgba(212, 175, 55, 0.32);
  border-radius: 10px;
  color: var(--royal-muted);
  font-size: 13px;
  font-weight: 500;
}
.royal-mushaf-footer i {
  color: var(--royal-gold-light);
  margin-inline-end: 6px;
}

/* Mobile responsive */
@media (max-width: 575px) {
  .royal-mushaf-wrap { padding: 16px; }
  .royal-mushaf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .royal-mushaf-cover { height: 76px; }
  .royal-mushaf-cover > i { font-size: 34px; }
  .royal-mushaf-badge { font-size: 9px; padding: 2px 7px; }
  .royal-mushaf-body { padding: 11px 11px 13px; }
  .royal-mushaf-name { font-size: 13.5px; }
  .royal-mushaf-size { font-size: 11px; margin-bottom: 10px; }
  .royal-mushaf-btn { font-size: 12px; padding: 8px 10px; }
}

@media (max-width: 380px) {
  .royal-mushaf-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablet */
@media (min-width: 576px) and (max-width: 991.98px) {
  .royal-mushaf-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* =========================================================
   Royal Edition — Mushaf Viewer (internal iframe)
   ========================================================= */
.royal-mushaf-viewer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0 24px;
}
.royal-mushaf-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(7, 59, 42, 0.7), rgba(7, 59, 42, 0.5));
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 14px 14px 0 0;
  flex-wrap: nowrap;
}
.royal-mushaf-viewer-title-wrap {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.royal-mushaf-viewer-header h2 {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 18px !important;
  color: var(--royal-gold-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.royal-mushaf-viewer-header h2 i {
  color: var(--royal-gold);
  font-size: 18px;
}
.royal-mushaf-viewer-size {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.royal-mushaf-viewer-size i {
  color: var(--royal-gold-light);
  font-size: 10px;
}
.royal-mushaf-back,
.royal-mushaf-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--royal-gold-light) !important;
  text-decoration: none !important;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.royal-mushaf-back:hover,
.royal-mushaf-back:focus,
.royal-mushaf-external:hover,
.royal-mushaf-external:focus {
  background: rgba(212, 175, 55, 0.28);
  border-color: var(--royal-gold-light);
  transform: translateY(-1px);
  outline: none;
}
.royal-mushaf-external {
  width: 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
}

/* Frame holding the iframe */
.royal-mushaf-viewer-frame {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 600px;
  background: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
.royal-mushaf-viewer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.royal-mushaf-iframe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.95), rgba(7, 59, 42, 0.85));
  color: var(--royal-gold-light);
  font-size: 16px;
  font-weight: 700;
  gap: 10px;
  z-index: 2;
}
.royal-mushaf-iframe-loading i {
  color: var(--royal-gold-light);
  font-size: 20px;
}

/* Prev / Next navigation */
.royal-mushaf-viewer-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
}
.royal-mushaf-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.7), rgba(7, 59, 42, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--royal-text) !important;
  text-decoration: none !important;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  max-width: 48%;
  overflow: hidden;
}
.royal-mushaf-nav-btn:hover,
.royal-mushaf-nav-btn:focus {
  transform: translateY(-2px);
  border-color: var(--royal-gold-light);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  color: #fff7d7 !important;
  outline: none;
}
.royal-mushaf-nav-btn i {
  color: var(--royal-gold-light);
  font-size: 11px;
  flex-shrink: 0;
}
.royal-mushaf-nav-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.royal-mushaf-viewer-note {
  margin-top: 18px;
  padding: 10px 14px;
  text-align: center;
  color: var(--royal-muted);
  font-size: 12px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: 8px;
}
.royal-mushaf-viewer-note i {
  color: var(--royal-gold-light);
  margin-inline-end: 4px;
}

@media (max-width: 575px) {
  .royal-mushaf-viewer-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .royal-mushaf-viewer-header h2 {
    font-size: 14px !important;
  }
  .royal-mushaf-viewer-size {
    font-size: 11px;
  }
  .royal-mushaf-back {
    padding: 8px 10px;
    font-size: 12px;
  }
  .royal-mushaf-back span { display: none; }
  .royal-mushaf-external {
    width: 36px;
    height: 36px;
  }
  .royal-mushaf-viewer-frame {
    height: 75vh;
    min-height: 500px;
  }
  .royal-mushaf-nav-btn {
    font-size: 11px;
    padding: 10px 12px;
  }
}

/* =========================================================
   Royal Edition — Quran Books Section (home page)
   ========================================================= */
.royal-qbooks-section {
  padding: 28px 0 8px;
}
.royal-qbooks-wrap {
  padding: 24px;
  background: linear-gradient(180deg, rgba(7, 59, 42, 0.55), rgba(7, 59, 42, 0.35));
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.royal-qbooks-subtitle {
  text-align: center;
  color: var(--royal-muted);
  font-size: 14px;
  margin: 6px 0 22px;
}

.royal-qbooks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.royal-qbook-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.7), rgba(7, 59, 42, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 22px 16px 18px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.royal-qbook-card:hover {
  transform: translateY(-4px);
  border-color: var(--royal-gold-light);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

.royal-qbook-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.royal-qbook-icon i {
  font-size: 26px;
  color: var(--royal-gold-light);
}

.royal-qbook-body { width: 100%; flex: 1; }
.royal-qbook-body h3 {
  color: var(--royal-gold-light);
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px;
}
.royal-qbook-body p {
  color: var(--royal-text);
  font-size: 13px;
  opacity: 0.85;
  margin: 0 0 10px;
}

.royal-qbook-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 11px;
}
.royal-qbook-fmt {
  background: linear-gradient(135deg, #d4af37, #f4d783);
  color: #073b2a;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.royal-qbook-size {
  color: var(--royal-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.royal-qbook-size i {
  color: var(--royal-gold-light);
  font-size: 9px;
}

.royal-qbook-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #d4af37, #f4d783);
  color: #073b2a !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  border-radius: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
  width: 100%;
}
.royal-qbook-btn:hover,
.royal-qbook-btn:focus {
  background: linear-gradient(135deg, #f4d783, #ffe9a8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
  outline: none;
}
.royal-qbook-btn i { font-size: 12px; }

@media (max-width: 767px) {
  .royal-qbooks-grid { grid-template-columns: 1fr; }
  .royal-qbooks-wrap { padding: 16px; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .royal-qbooks-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Royal Edition — Tafseer Books Library (home section)
   ========================================================= */
}

/* Mushaf cover is now a clickable link */
.royal-mushaf-cover-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
}
.royal-mushaf-cover-link:hover .royal-mushaf-cover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15)),
              radial-gradient(ellipse at center, rgba(212, 175, 55, 0.2) 0%, transparent 60%);
}


/* Royal internal KFGQPC viewer hardening for mobile/tablet */
.royal-kfgqpc-frame,
.royal-qbook-viewer .royal-mushaf-viewer-frame {
  height: min(82vh, 900px);
  min-height: 640px;
  -webkit-overflow-scrolling: touch;
}
.royal-kfgqpc-frame iframe,
.royal-qbook-viewer iframe {
  background: #fff;
}
@media (max-width: 991px) {
  .royal-kfgqpc-frame,
  .royal-qbook-viewer .royal-mushaf-viewer-frame,
  .royal-mushaf-viewer-frame {
    height: 78vh;
    min-height: 620px;
  }
}
@media (max-width: 575px) {
  .royal-kfgqpc-frame,
  .royal-qbook-viewer .royal-mushaf-viewer-frame,
  .royal-mushaf-viewer-frame {
    height: 76vh;
    min-height: 520px;
  }
  .royal-mushaf-viewer-nav {
    display: grid;
    grid-template-columns: 1fr;
  }
  .royal-mushaf-nav-btn {
    max-width: 100%;
    justify-content: center;
  }
}


/* Ibn Thani Quran refinements */
.share-box{margin-top:18px!important}
.mushaf-card .btn{
display:inline-flex!important;
align-items:center!important;
justify-content:center!important;
padding:10px 18px!important;
font-size:18px!important;
border-radius:10px!important;
min-width:120px!important;
}
.mushaf-card img{
width:100%!important;
height:220px!important;
object-fit:cover!important;
border-radius:12px 12px 0 0!important;
}
.surah-meta{
font-size:15px!important;
margin-top:6px!important;
opacity:.92!important;
}




/* FINAL COMPACT SURAH CARDS — no redesign */
.quran-card h5 a,
div.spacer h5 a {
  min-height: 54px !important;
  padding: 8px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.surah-card-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: block !important;
}

.surah-card-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.surah-card-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: block !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: right !important;
  color: inherit !important;
}

.surah-card-number {
  flex: 0 0 auto !important;
  min-width: 18px !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1 !important;
  color: #d4af37 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.surah-card-meta {
  display: block !important;
  margin-top: 2px !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: rgba(255,247,215,.72) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: right !important;
}

.surah-card-icon,
.surah-card-ornament {
  flex: 0 0 auto !important;
  width: 13px !important;
  height: 13px !important;
  font-size: 9px !important;
  color: #d4af37 !important;
  opacity: .62 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.quran-card h5 a {
  grid-template-columns: none !important;
  grid-template-areas: none !important;
}

/* Mushaf buttons only */
.royal-mushaf-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
.royal-mushaf-actions .royal-mushaf-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
}

/* =================================================================
   v6.1 — ضبط شامل لبطاقات السور لجميع المتصفحات والأجهزة
   ================================================================= */

/* قاعدة موحدة: كل بطاقة سورة تستخدم flex منظم */
.quran-card h5 a,
div.spacer h5 a {
  min-height: 48px !important;
  max-height: 56px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  border-radius: 10px !important;
}

/* اسم السورة: حجم متوازن */
.surah-card-name {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

/* الرقم: واضح بدون مبالغة */
.surah-card-number {
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

/* عدد الآيات + مكية/مدنية: واضح ومميز */
.surah-card-meta {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: rgba(255, 247, 215, 0.82) !important;
  margin-top: 3px !important;
}

/* الأيقونة: بحجم مناسب */
.surah-card-icon,
.surah-card-ornament {
  width: 14px !important;
  height: 14px !important;
  font-size: 11px !important;
  opacity: 0.7 !important;
}

/* ==========================
   التفاصيل حسب حجم الشاشة
   ========================== */

/* جوال صغير: حتى 360px */
@media (max-width: 360px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 44px !important;
    padding: 6px 9px !important;
  }
  .surah-card-name { font-size: 13px !important; }
  .surah-card-number { font-size: 10.5px !important; }
  .surah-card-meta { font-size: 9px !important; }
  .surah-card-icon,
  .surah-card-ornament { width: 12px !important; height: 12px !important; font-size: 10px !important; }
}

/* جوال متوسط: 361-575px */
@media (min-width: 361px) and (max-width: 575px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 46px !important;
    padding: 7px 10px !important;
  }
  .surah-card-name { font-size: 13.5px !important; }
  .surah-card-meta { font-size: 9.5px !important; }
}

/* جوال كبير + تابلت رأسي: 576-767px */
@media (min-width: 576px) and (max-width: 767px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 50px !important;
    padding: 9px 12px !important;
  }
  .surah-card-name { font-size: 15px !important; }
  .surah-card-number { font-size: 12px !important; }
  .surah-card-meta { font-size: 10.5px !important; }
}

/* تابلت + iPad: 768-1199px — هنا كانت البطاقات كبيرة جداً */
@media (min-width: 768px) and (max-width: 1199px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 52px !important;
    max-height: 58px !important;
    padding: 9px 13px !important;
  }
  .surah-card-name { font-size: 15px !important; }
  .surah-card-number { font-size: 12px !important; }
  .surah-card-meta { font-size: 10.5px !important; }
  .surah-card-icon,
  .surah-card-ornament { width: 15px !important; height: 15px !important; font-size: 12px !important; }
}

/* ديسكتوب: 1200px فأكثر */
@media (min-width: 1200px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 54px !important;
    max-height: 60px !important;
    padding: 10px 14px !important;
  }
  .surah-card-name { font-size: 16px !important; }
  .surah-card-number { font-size: 12.5px !important; }
  .surah-card-meta { font-size: 11px !important; }
}

/* تحسين تباين النص على جميع الأجهزة */
.quran-card h5 a,
div.spacer h5 a {
  color: #fff7d7 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

.quran-card h5 a:hover,
.quran-card h5 a:focus,
div.spacer h5 a:hover,
div.spacer h5 a:focus {
  color: #f4d783 !important;
}

/* منع overflow أفقي على أي جهاز */
.surah-card-row,
.surah-card-main {
  max-width: 100% !important;
  overflow: hidden !important;
}

/* =================================================================
   v6.2 — تحسينات شاملة بناءً على ملاحظات المستخدم
   1. تكبير خطوط بطاقات السور بعد التمرير
   2. تحسين زر السور
   3. حذف زر التحميل من المصاحف + إضافة صور
   4. تكبير خطوط أوقات الصلاة
   5. تحسين بوكس المشاركة
   ================================================================= */

/* ========== 1+2. بطاقات السور — تكبير وتحسين ========== */
.quran-card h5 a,
div.spacer h5 a {
  min-height: 56px !important;
  max-height: 68px !important;
  padding: 11px 14px !important;
  font-size: 16px !important;
  border-radius: 12px !important;
  background: rgba(7, 59, 42, 0.5) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  transition: all .2s ease !important;
}
.quran-card h5 a:hover,
div.spacer h5 a:hover {
  background: rgba(13, 77, 54, 0.85) !important;
  border-color: rgba(212, 175, 55, 0.9) !important;
  transform: translateY(-2px) !important;
}
.surah-card-name {
  font-size: 16.5px !important;
  font-weight: 800 !important;
  color: #fff7d7 !important;
}
.surah-card-number {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #f4d783 !important;
}
.surah-card-meta {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #d8c990 !important;
  margin-top: 3px !important;
}
.surah-card-icon,
.surah-card-ornament {
  width: 16px !important;
  height: 16px !important;
  font-size: 13px !important;
  opacity: 0.85 !important;
  color: #d4af37 !important;
}

/* جوال صغير: 360px وأقل */
@media (max-width: 360px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 52px !important;
    padding: 9px 11px !important;
  }
  .surah-card-name { font-size: 15px !important; }
  .surah-card-number { font-size: 12px !important; }
  .surah-card-meta { font-size: 10.5px !important; }
}

/* جوال متوسط: 361-575px */
@media (min-width: 361px) and (max-width: 575px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 54px !important;
    padding: 10px 12px !important;
  }
  .surah-card-name { font-size: 15.5px !important; }
}

/* تابلت + iPad: 768-1199px */
@media (min-width: 768px) and (max-width: 1199px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 58px !important;
    padding: 12px 14px !important;
  }
  .surah-card-name { font-size: 17px !important; }
  .surah-card-number { font-size: 13.5px !important; }
  .surah-card-meta { font-size: 12px !important; }
}

/* ديسكتوب: 1200px فأكثر */
@media (min-width: 1200px) {
  .quran-card h5 a,
  div.spacer h5 a {
    min-height: 60px !important;
    padding: 13px 16px !important;
  }
  .surah-card-name { font-size: 18px !important; }
  .surah-card-number { font-size: 14px !important; }
  .surah-card-meta { font-size: 12.5px !important; }
}

/* ========== 3. المصاحف — صور حقيقية + زر فتح بعرض كامل ========== */
.royal-mushaf-cover-image {
  position: relative;
  overflow: hidden;
  height: 180px !important;
  background: linear-gradient(135deg, rgba(7,59,42,0.4), rgba(7,59,42,0.7)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
}
.royal-mushaf-cover-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}
.royal-mushaf-cover-link:hover .royal-mushaf-cover-image img {
  transform: scale(1.05);
}
/* الأيقونة الاحتياطية تختفي عند وجود صورة */
.royal-mushaf-cover-image .royal-mushaf-cover-icon {
  display: none;
}
/* في حال فشل تحميل الصورة، تظهر الأيقونة */
.royal-mushaf-cover-fallback .royal-mushaf-cover-icon {
  display: block !important;
  font-size: 60px;
  color: var(--royal-gold-light);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* زر فتح بعرض كامل (بدل زرين) */
.royal-mushaf-actions-single {
  display: block !important;
  width: 100% !important;
  margin-top: 12px !important;
}
.royal-mushaf-btn-full {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #d4af37, #f4d783) !important;
  color: #073b2a !important;
  text-decoration: none !important;
  transition: all .2s ease !important;
}
.royal-mushaf-btn-full:hover,
.royal-mushaf-btn-full:focus {
  background: linear-gradient(135deg, #f4d783, #ffe9a8) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4) !important;
}
.royal-mushaf-btn-full i { font-size: 14px !important; }

/* الشارة "حفص" تنتقل للزاوية اليمنى */
.royal-mushaf-cover-image .royal-mushaf-badge {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 2 !important;
}

/* جوال: تصغير ارتفاع الصورة */
@media (max-width: 575px) {
  .royal-mushaf-cover-image { height: 140px !important; padding: 10px !important; }
  .royal-mushaf-btn-full { padding: 11px 14px !important; font-size: 14px !important; }
}
@media (min-width: 576px) and (max-width: 991px) {
  .royal-mushaf-cover-image { height: 160px !important; }
}

/* ========== 4. تكبير خطوط أوقات الصلاة ========== */
.royal-prayer-card h2 {
  font-size: 19px !important;
  font-weight: 800 !important;
}
.royal-prayer-date {
  font-size: 14px !important;
  font-weight: 600 !important;
}
.royal-prayer-next-label {
  font-size: 13.5px !important;
  font-weight: 600 !important;
}
.royal-prayer-next-name {
  font-size: 20px !important;
  font-weight: 800 !important;
}
.royal-prayer-countdown {
  font-size: 16px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
}
.royal-prayer-list li {
  padding: 12px 10px !important;
  font-size: 16px !important;
}
.royal-prayer-name {
  font-size: 16px !important;
  font-weight: 700 !important;
}
.royal-prayer-time {
  font-size: 16px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
}
.royal-prayer-list li i,
.royal-prayer-name i {
  font-size: 15px !important;
  width: 18px !important;
}
.royal-prayer-method {
  font-size: 13px !important;
  padding: 10px !important;
}
.royal-prayer-city {
  font-size: 14px !important;
  font-weight: 700 !important;
}

/* جوال: تكبير معتدل */
@media (max-width: 575px) {
  .royal-prayer-list li { padding: 11px 8px !important; font-size: 15px !important; }
  .royal-prayer-name { font-size: 15px !important; }
  .royal-prayer-time { font-size: 15px !important; }
  .royal-prayer-next-name { font-size: 18px !important; }
  .royal-prayer-countdown { font-size: 15px !important; }
}

/* ========== 5. بوكس المشاركة — مدمج، أيقونات بصف واحد ========== */
.royal-share {
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.85), rgba(7, 59, 42, 0.65)) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 14px !important;
  padding: 14px 12px !important;
  margin: 24px 0 14px 0 !important;
  text-align: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.royal-share h5 {
  color: #f4d783 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  margin: 0 0 10px 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.royal-share h5::before,
.royal-share h5::after {
  content: '❖';
  color: #d4af37;
  font-size: 11px;
  opacity: 0.8;
}
.royal-share-icons {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}
.royal-share-icons a,
.royal-share-icons button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.18)) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.75) !important;
  color: #ffe9a8 !important;
  font-size: 17px !important;
  cursor: pointer !important;
  transition: all .2s ease !important;
  text-decoration: none !important;
  padding: 0 !important;
}
.royal-share-icons a:hover,
.royal-share-icons button:hover,
.royal-share-icons a:focus,
.royal-share-icons button:focus {
  background: linear-gradient(135deg, #d4af37, #f4d783) !important;
  color: #073b2a !important;
  border-color: #f4d783 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 12px rgba(212, 175, 55, 0.45) !important;
  outline: none !important;
}
.royal-share-icons a i,
.royal-share-icons button i {
  font-size: 17px !important;
  line-height: 1 !important;
  color: inherit !important;
}

/* جوال: أيقونات أصغر بدون فجوات كبيرة - تبقى بصف واحد */
@media (max-width: 575px) {
  .royal-share { padding: 12px 8px !important; margin: 20px 0 12px 0 !important; }
  .royal-share h5 { font-size: 14px !important; margin-bottom: 9px !important; }
  .royal-share-icons { gap: 6px !important; flex-wrap: nowrap !important; }
  .royal-share-icons a,
  .royal-share-icons button {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    flex-shrink: 0 !important;
  }
  .royal-share-icons a i,
  .royal-share-icons button i { font-size: 15px !important; }
}

/* جوال صغير جداً: تقليل أكثر */
@media (max-width: 360px) {
  .royal-share-icons { gap: 4px !important; }
  .royal-share-icons a,
  .royal-share-icons button {
    width: 34px !important;
    height: 34px !important;
  }
}

/* =================================================================
   v6.3 — إصلاح نهائي قوي بناءً على ملاحظات المستخدم
   • صور المصاحف بدون خلفية (PNG شفافة) مع تخطيط بطاقة سليم
   • تكبير اسم السورة والوصف
   • تحسين حواف الزر الذهبية
   ================================================================= */

/* ===== بطاقة المصحف: تخطيط flex column صارم ===== */
.royal-mushaf-card {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  height: auto !important;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.55), rgba(7, 59, 42, 0.35)) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.royal-mushaf-card .royal-mushaf-cover-link {
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
}

/* الكوفر — ارتفاع ثابت، الصورة لا تطلع منه أبداً */
.royal-mushaf-card .royal-mushaf-cover-image {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 170px !important;
  padding: 14px !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.08), transparent 70%) !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
}

.royal-mushaf-card .royal-mushaf-cover-image img {
  display: block !important;
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)) !important;
  background: transparent !important;
}

/* الشارة "حفص" في الزاوية اليمنى العليا */
.royal-mushaf-card .royal-mushaf-cover-image .royal-mushaf-badge {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  z-index: 3 !important;
  padding: 4px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #d4af37, #f4d783) !important;
  color: #073b2a !important;
  border-radius: 20px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* الـ body — اسم المصحف + المقاس + الزر */
.royal-mushaf-card .royal-mushaf-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  padding: 14px 14px 16px 14px !important;
  text-align: center !important;
  background: transparent !important;
}

/* اسم المصحف — واضح وكبير */
.royal-mushaf-card .royal-mushaf-name {
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  font-size: 18.5px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  color: #fff7d7 !important;
  text-align: center !important;
  display: block !important;
  visibility: visible !important;
}

/* المقاس */
.royal-mushaf-card .royal-mushaf-size {
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #d8c990 !important;
  text-align: center !important;
  display: block !important;
}

.royal-mushaf-card .royal-mushaf-size i {
  margin-left: 5px !important;
  color: #d4af37 !important;
  font-size: 12px !important;
}

/* الأزرار */
.royal-mushaf-card .royal-mushaf-actions {
  display: block !important;
  width: 100% !important;
  margin-top: auto !important;
  padding: 0 !important;
}

.royal-mushaf-card .royal-mushaf-actions-single {
  display: block !important;
  width: 100% !important;
}

/* زر فتح المصحف — بعرض كامل، حواف ذهبية محسّنة */
.royal-mushaf-card .royal-mushaf-btn,
.royal-mushaf-card .royal-mushaf-btn-full {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 13px 14px !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #d4af37 0%, #f4d783 50%, #d4af37 100%) !important;
  color: #073b2a !important;
  border: 2px solid #c39c2e !important;
  border-radius: 12px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 3px 8px rgba(212, 175, 55, 0.3) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.royal-mushaf-card .royal-mushaf-btn:hover,
.royal-mushaf-card .royal-mushaf-btn-full:hover,
.royal-mushaf-card .royal-mushaf-btn:focus,
.royal-mushaf-card .royal-mushaf-btn-full:focus {
  background: linear-gradient(135deg, #f4d783 0%, #ffe9a8 50%, #f4d783 100%) !important;
  border-color: #d4af37 !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 14px rgba(212, 175, 55, 0.5) !important;
  outline: none !important;
}

.royal-mushaf-card .royal-mushaf-btn i,
.royal-mushaf-card .royal-mushaf-btn-full i {
  font-size: 14px !important;
  color: inherit !important;
}

/* جوال صغير: صورة أصغر + اسم وزر أوضح */
@media (max-width: 575px) {
  .royal-mushaf-card .royal-mushaf-cover-image {
    height: 115px !important;
    padding: 10px !important;
  }
  .royal-mushaf-card .royal-mushaf-name { font-size: 17.5px !important; font-weight: 800 !important; }
  .royal-mushaf-card .royal-mushaf-size { font-size: 13px !important; font-weight: 700 !important; }
  .royal-mushaf-card .royal-mushaf-btn-full,
  .royal-mushaf-card .royal-mushaf-btn { font-size: 15.5px !important; font-weight: 800 !important; padding: 12px 12px !important; }
}

/* تابلت/iPad */
@media (min-width: 768px) and (max-width: 1199px) {
  .royal-mushaf-card .royal-mushaf-cover-image { height: 180px !important; }
  .royal-mushaf-card .royal-mushaf-name { font-size: 17.5px !important; }
}

/* ديسكتوب */
@media (min-width: 1200px) {
  .royal-mushaf-card .royal-mushaf-cover-image { height: 200px !important; }
  .royal-mushaf-card .royal-mushaf-name { font-size: 18px !important; }
  .royal-mushaf-card .royal-mushaf-size { font-size: 14px !important; }
  .royal-mushaf-card .royal-mushaf-btn-full { font-size: 16px !important; padding: 14px 16px !important; }
}

/* إخفاء أيقونة fallback عند وجود صورة سليمة */
.royal-mushaf-card .royal-mushaf-cover-image .royal-mushaf-cover-icon {
  display: none !important;
}
.royal-mushaf-card .royal-mushaf-cover-fallback .royal-mushaf-cover-icon {
  display: block !important;
  font-size: 60px !important;
  color: #d4af37 !important;
}

/* ===== بطاقات السور: تكبير قوي + حواف ذهبية محسّنة ===== */
.quran-card h5 a,
div.spacer h5 a {
  min-height: 64px !important;
  max-height: 76px !important;
  padding: 12px 16px !important;
  background: linear-gradient(135deg, rgba(7, 59, 42, 0.6), rgba(7, 59, 42, 0.4)) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.55) !important;
  border-radius: 14px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 215, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.18) !important;
  transition: all 0.2s ease !important;
}
.quran-card h5 a:hover,
.quran-card h5 a:focus,
div.spacer h5 a:hover,
div.spacer h5 a:focus {
  background: linear-gradient(135deg, rgba(13, 77, 54, 0.85), rgba(13, 77, 54, 0.6)) !important;
  border-color: #d4af37 !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 215, 0.15),
    0 6px 14px rgba(212, 175, 55, 0.3) !important;
}

/* اسم السورة — كبير وواضح */
.surah-card-name {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #fff7d7 !important;
  line-height: 1.25 !important;
}

/* الرقم — واضح وذهبي */
.surah-card-number {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #f4d783 !important;
}

/* عدد الآيات + مكية/مدنية — واضح ومقروء */
.surah-card-meta {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #e8d99f !important;
  margin-top: 4px !important;
  line-height: 1.3 !important;
}

/* الأيقونة */
.surah-card-icon,
.surah-card-ornament {
  width: 16px !important;
  height: 16px !important;
  font-size: 13px !important;
  opacity: 0.85 !important;
  color: #d4af37 !important;
}

/* جوال صغير */
@media (max-width: 360px) {
  .quran-card h5 a,
  div.spacer h5 a { min-height: 58px !important; padding: 10px 12px !important; }
  .surah-card-name { font-size: 18px !important; font-weight: 800 !important; }
  .surah-card-number { font-size: 14px !important; font-weight: 800 !important; }
  .surah-card-meta { font-size: 13px !important; font-weight: 700 !important; }
}

/* جوال متوسط */
@media (min-width: 361px) and (max-width: 575px) {
  .quran-card h5 a,
  div.spacer h5 a { min-height: 60px !important; padding: 11px 14px !important; }
  .surah-card-name { font-size: 19px !important; font-weight: 800 !important; }
  .surah-card-number { font-size: 14.5px !important; font-weight: 800 !important; }
  .surah-card-meta { font-size: 13.5px !important; font-weight: 700 !important; }
}

/* تابلت/iPad */
@media (min-width: 768px) and (max-width: 1199px) {
  .quran-card h5 a,
  div.spacer h5 a { min-height: 66px !important; padding: 13px 16px !important; }
  .surah-card-name { font-size: 20px !important; }
  .surah-card-number { font-size: 15px !important; }
  .surah-card-meta { font-size: 13.5px !important; }
}

/* ديسكتوب */
@media (min-width: 1200px) {
  .quran-card h5 a,
  div.spacer h5 a { min-height: 70px !important; padding: 14px 18px !important; }
  .surah-card-name { font-size: 21px !important; }
  .surah-card-number { font-size: 15px !important; }
  .surah-card-meta { font-size: 14px !important; }
}

/* ==================================================================
   ✨ Quran Pro - واجهة فاخرة عصرية
   تصميم متطور بزخارف إسلامية ولمسات بصرية ذهبية
   ================================================================== */

/* ----- متغيرات هوية فاخرة ----- */
:root {
  --pro-emerald: #064e3b;
  --pro-emerald-light: #0f6e54;
  --pro-emerald-dark: #042f23;
  --pro-gold: #d4af37;
  --pro-gold-light: #f4d783;
  --pro-gold-bright: #ffe9a8;
  --pro-cream: #fdf6e3;
  --pro-ivory: #faf7f0;
  --pro-shadow: rgba(0, 0, 0, 0.25);
  --pro-gold-glow: rgba(212, 175, 55, 0.35);
}

/* ==================================================================
   1. بطاقة سبب النزول - تصميم فاخر مع تدرّجات وزخارف
   ================================================================== */
.asbab-nuzool-card {
  position: relative;
  margin: 24px 0;
  padding: 28px 24px;
  background:
    linear-gradient(135deg, rgba(6, 78, 59, 0.06) 0%, rgba(212, 175, 55, 0.04) 100%),
    linear-gradient(180deg, #fdfaf0 0%, #faf5e6 100%);
  border: 2px solid transparent;
  border-radius: 18px;
  box-shadow:
    0 8px 28px rgba(6, 78, 59, 0.10),
    0 2px 8px rgba(212, 175, 55, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  background-clip: padding-box;
}

/* حد ذهبي متدرج فاخر */
.asbab-nuzool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(135deg, var(--pro-gold), var(--pro-emerald-light), var(--pro-gold-light), var(--pro-gold));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

/* زخرفة إسلامية في الزاوية العلوية اليمنى */
.asbab-nuzool-card::after {
  content: '۞';
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 32px;
  color: rgba(212, 175, 55, 0.18);
  pointer-events: none;
  font-family: 'KFGQPC Uthmanic Script HAFS', serif;
}

.asbab-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
  z-index: 1;
}

.asbab-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--pro-emerald) !important;
  text-align: center !important;
  letter-spacing: 0.5px;
  font-family: 'Amiri', 'Scheherazade', serif;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, var(--pro-emerald) 0%, var(--pro-emerald-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 0 !important;
}

.asbab-ornament {
  color: var(--pro-gold);
  font-size: 13px;
  opacity: 0.85;
  text-shadow: 0 1px 2px var(--pro-gold-glow);
}

.asbab-body {
  position: relative;
  font-size: 17px;
  line-height: 2.0;
  color: #2a3b35;
  text-align: justify;
  font-weight: 500;
  z-index: 1;
  text-indent: 18px;
}

/* أول حرف بأسلوب الطبع الفاخر */
.asbab-body::first-letter {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--pro-emerald);
  margin-left: 2px;
}

.asbab-source {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed rgba(6, 78, 59, 0.18);
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: var(--pro-emerald-light);
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* جوال */
@media (max-width: 575px) {
  .asbab-nuzool-card { padding: 20px 16px; margin: 20px 0; border-radius: 14px; }
  .asbab-title { font-size: 19px !important; }
  .asbab-body { font-size: 16px; line-height: 1.9; text-indent: 14px; }
  .asbab-source { font-size: 12px; }
  .asbab-nuzool-card::after { font-size: 26px; top: 6px; left: 10px; }
}

/* وضع داكن */
@media (prefers-color-scheme: dark) {
  .asbab-nuzool-card {
    background:
      linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(6, 78, 59, 0.10) 100%),
      linear-gradient(180deg, #0d2419 0%, #082014 100%);
  }
  .asbab-body { color: #e8e0c9; }
  .asbab-title {
    background: linear-gradient(135deg, var(--pro-gold-light), var(--pro-gold-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .asbab-source { color: var(--pro-gold-light); border-top-color: rgba(212, 175, 55, 0.2); }
}

/* ==================================================================
   2. تحسينات الواجهة العامة الفاخرة
   ================================================================== */

/* عناوين السور - تدرّج ذهبي فاخر */
.section-title h1 {
  background: linear-gradient(135deg, var(--pro-gold-light) 0%, var(--pro-gold) 50%, var(--pro-gold-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

/* تحسين البطاقات بظلال أعمق وتفاعل أكثر */
.royal-mushaf-card,
.quran-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.royal-mushaf-card:hover,
.quran-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 8px var(--pro-gold-glow) !important;
}

/* زر الانتقال للسبب - في صفحة التفسير */
.btn-asbab-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin: 0 6px;
  background: linear-gradient(135deg, var(--pro-gold), var(--pro-gold-light));
  color: var(--pro-emerald-dark) !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  border-radius: 24px;
  border: 1px solid var(--pro-gold);
  box-shadow: 0 3px 10px var(--pro-gold-glow);
  transition: all 0.2s ease;
}

.btn-asbab-jump:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(212, 175, 55, 0.5);
  color: var(--pro-emerald-dark) !important;
}

/* ==================================================================
   3. تحسين بوكس الآية أعلى التفسير
   ================================================================== */
.ayat4tafseer {
  background: linear-gradient(135deg, #ffffff 0%, #fdfaf0 100%) !important;
  border: 2px solid transparent !important;
  border-radius: 16px !important;
  padding: 20px 18px !important;
  position: relative;
  box-shadow: 0 6px 20px rgba(6, 78, 59, 0.10), 0 2px 6px rgba(212, 175, 55, 0.08) !important;
}

.ayat4tafseer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--pro-gold) 0%, var(--pro-emerald-light) 50%, var(--pro-gold) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==================================================================
   4. تحسين بوكس نص التفسير
   ================================================================== */
.ayat4tafseer_text {
  background: linear-gradient(180deg, #ffffff 0%, #fafaf5 100%) !important;
  border: 1px solid rgba(6, 78, 59, 0.12) !important;
  border-radius: 14px !important;
  padding: 22px 20px !important;
  margin: 20px 0 !important;
  font-size: 18px !important;
  line-height: 2.0 !important;
  color: #2a3b35 !important;
  text-align: justify;
  box-shadow: 0 4px 16px rgba(6, 78, 59, 0.06);
  position: relative;
}

.ayat4tafseer_text::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, var(--pro-gold-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

@media (max-width: 575px) {
  .ayat4tafseer_text { font-size: 16.5px !important; padding: 18px 14px !important; line-height: 1.95 !important; }
}

/* ==================================================================
   5. تحسين الفوتر العلوي - sticky نية فاخرة
   ================================================================== */
.royal-nav {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.92), rgba(6, 78, 59, 0.85)) !important;
  border-bottom: 1px solid var(--pro-gold-glow) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ==================================================================
   6. تأثيرات الحركة (Animations)
   ================================================================== */
@keyframes goldShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.asbab-title {
  background-size: 200% 100%;
  animation: goldShimmer 6s linear infinite;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.asbab-nuzool-card {
  animation: fadeInUp 0.5s ease-out;
}

/* ==================================================================
   7. تحسين Scrollbar
   ================================================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 78, 59, 0.08);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pro-gold) 0%, var(--pro-emerald-light) 100%);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--pro-gold-light) 0%, var(--pro-emerald) 100%);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ==================================================================
   8. تأثير زجاجي (Glassmorphism) للبطاقات المختارة
   ================================================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.10);
}

/* ==================================================================
   9. مكتبة الميزات الجديدة (للصفحات الجديدة)
   ================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.feature-card {
  background: linear-gradient(135deg, var(--pro-emerald) 0%, var(--pro-emerald-dark) 100%);
  border: 1px solid var(--pro-gold);
  border-radius: 16px;
  padding: 22px 18px;
  color: var(--pro-cream);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--pro-gold-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  border-color: var(--pro-gold-light);
}
.feature-card:hover::before {
  opacity: 0.5;
}

.feature-icon {
  font-size: 38px;
  color: var(--pro-gold);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.feature-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--pro-gold-light);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.feature-desc {
  font-size: 13.5px;
  color: var(--pro-cream);
  opacity: 0.85;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ==================================================================
   10. شارة Pro الذهبية الفاخرة
   ================================================================== */
.pro-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--pro-emerald-dark);
  background: linear-gradient(135deg, var(--pro-gold-light), var(--pro-gold));
  border-radius: 10px;
  border: 1px solid var(--pro-gold);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px var(--pro-gold-glow);
  vertical-align: middle;
  margin-right: 6px;
}


/* ==================================================================
   11. وضع الخشوع - يخفي كل شيء عدا النص الأساسي
   ================================================================== */
body.khushu-mode .royal-nav,
body.khushu-mode .royal-top,
body.khushu-mode footer,
body.khushu-mode .royal-share,
body.khushu-mode .post-share,
body.khushu-mode .navbar,
body.khushu-mode .section-title,
body.khushu-mode .tafseer-controls,
body.khushu-mode aside,
body.khushu-mode .sidebar {
  display: none !important;
}

body.khushu-mode {
  background: linear-gradient(180deg, #fdfaf0 0%, #faf5e6 100%) !important;
}

body.khushu-mode .container,
body.khushu-mode .container-fluid {
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 30px 20px !important;
}

body.khushu-mode .ayat4tafseer {
  font-size: 1.2em;
  line-height: 2.2;
  padding: 30px !important;
  box-shadow: 0 4px 20px rgba(6, 78, 59, 0.08) !important;
}

body.khushu-mode .ayat4tafseer_text {
  font-size: 19px !important;
  line-height: 2.1 !important;
  padding: 28px !important;
}

/* زر العودة من وضع الخشوع */
.khushu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pro-gold), var(--pro-gold-light));
  color: var(--pro-emerald-dark);
  border: 2px solid var(--pro-emerald);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

body.khushu-mode .khushu-toggle {
  display: flex !important;
}

.khushu-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* ==================================================================
   12. أحجام الخط القابلة للتحكم
   ================================================================== */
body.font-size-small .ayat4tafseer_text { font-size: 15px !important; line-height: 1.85 !important; }
body.font-size-small .asbab-body { font-size: 15px !important; line-height: 1.85 !important; }

body.font-size-normal .ayat4tafseer_text { font-size: 18px !important; line-height: 2.0 !important; }
body.font-size-normal .asbab-body { font-size: 17px !important; line-height: 2.0 !important; }

body.font-size-large .ayat4tafseer_text { font-size: 20px !important; line-height: 2.1 !important; }
body.font-size-large .asbab-body { font-size: 19px !important; line-height: 2.1 !important; }

body.font-size-xlarge .ayat4tafseer_text { font-size: 23px !important; line-height: 2.2 !important; }
body.font-size-xlarge .asbab-body { font-size: 22px !important; line-height: 2.2 !important; }

/* ==================================================================
   13. شريط أدوات سفلي عائم (Floating Toolbar)
   ================================================================== */
.floating-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(6, 78, 59, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pro-gold-glow);
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.floating-toolbar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--pro-gold-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.floating-toolbar-btn:hover {
  background: linear-gradient(135deg, var(--pro-gold), var(--pro-gold-light));
  color: var(--pro-emerald-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--pro-gold-glow);
}

.floating-toolbar-btn.active {
  background: linear-gradient(135deg, var(--pro-gold), var(--pro-gold-light));
  color: var(--pro-emerald-dark);
}

@media (max-width: 575px) {
  .floating-toolbar { bottom: 16px; padding: 6px 10px; gap: 6px; }
  .floating-toolbar-btn { width: 38px; height: 38px; font-size: 14px; }
}


.royal-surah-grid .quran-card > h5 > a{
  min-height:54px !important;
  max-height:62px !important;
  padding:10px 13px !important;
}
.royal-surah-grid .quran-card .surah-card-name{
  font-size:16px !important;
  line-height:1.25 !important;
}
.royal-surah-grid .quran-card .surah-card-number{
  font-size:12.5px !important;
}
.royal-surah-grid .quran-card .surah-card-meta{
  font-size:11px !important;
  margin-top:2px !important;
}
.royal-surah-grid .quran-card .surah-card-icon,
.royal-surah-grid .quran-card .surah-card-ornament{
  width:15px !important;
  height:15px !important;
  font-size:12px !important;
}

@media (max-width:575.98px){
  .royal-section-title h1{ gap:8px !important; }
  .royal-surah-grid .quran-card > h5 > a{
    min-height:50px !important;
    max-height:58px !important;
    padding:8px 10px !important;
  }
  .royal-surah-grid .quran-card .surah-card-name{ font-size:14.5px !important; }
  .royal-surah-grid .quran-card .surah-card-number{ font-size:11.5px !important; }
  .royal-surah-grid .quran-card .surah-card-meta{ font-size:10px !important; }
}

@media (min-width:768px) and (max-width:1199.98px){
  .royal-surah-grid .quran-card > h5 > a{
    min-height:54px !important;
    max-height:62px !important;
    padding:10px 12px !important;
  }
  .royal-surah-grid .quran-card .surah-card-name{ font-size:16px !important; }
  .royal-surah-grid .quran-card .surah-card-number{ font-size:12.5px !important; }
  .royal-surah-grid .quran-card .surah-card-meta{ font-size:11px !important; }
}

/* =========================================================
   Ibn Thani targeted patch — scoped only
   - official light backgrounds for surah/tafseer content areas
   - gold change button
   - tafseer ayah navigation visibility
   - surah card visual width without inner/double frame
   - prayer header spacing/city visibility
   - section title ornaments
   ========================================================= */

/* Section title ornaments: desktop + mobile */
.royal-section-title h1{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:12px !important;
}
.royal-section-title h1 .royal-title-ornament{
  display:inline-flex !important;
  color:#d4af37 !important;
  opacity:1 !important;
  visibility:visible !important;
  text-shadow:0 0 8px rgba(212,175,55,.42) !important;
}

/* Change button only: royal gold, not yellow */
.changesoraform button#submit,
.changesoraform .btn.btn-primary#submit{
  background:linear-gradient(180deg,#d4af37 0%,#b88a1a 100%) !important;
  border:1px solid #8f6b12 !important;
  color:#061f17 !important;
  font-weight:800 !important;
  box-shadow:0 3px 10px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.28) !important;
}
.changesoraform button#submit:hover,
.changesoraform .btn.btn-primary#submit:hover{
  background:linear-gradient(180deg,#e0bf4c 0%,#b88a1a 100%) !important;
  color:#061f17 !important;
}

/* Tafseer previous/current/next ayah navigation only */
.tafseer-ayah-nav{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  margin:10px 0 14px !important;
  direction:rtl !important;
}
.tafseer-ayah-nav-btn,
.tafseer-ayah-nav-current{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  min-height:42px !important;
  padding:8px 16px !important;
  border:1px solid rgba(212,175,55,.75) !important;
  border-radius:10px !important;
  color:#d4af37 !important;
  background:rgba(6,78,59,.72) !important;
  opacity:1 !important;
  font-weight:800 !important;
  text-shadow:none !important;
  text-decoration:none !important;
}
.tafseer-ayah-nav-current{
  color:#061f17 !important;
  background:linear-gradient(180deg,#d4af37,#b88a1a) !important;
  border-color:#8f6b12 !important;
}
.tafseer-ayah-disabled{
  opacity:.55 !important;
  cursor:not-allowed !important;
}
@media (max-width:575.98px){
  .tafseer-ayah-nav{
    gap:6px !important;
    margin:8px 0 12px !important;
  }
  .tafseer-ayah-nav-btn,
  .tafseer-ayah-nav-current{
    min-height:36px !important;
    padding:7px 9px !important;
    font-size:12.5px !important;
    border-radius:8px !important;
  }
}

/* Surah cards: shrink visual button by targeting the outer card only; link fills it to avoid double frame */
.royal-surah-grid .quran-card.spacer,
.royal-surah-grid div.spacer.quran-card{
  width:88% !important;
  max-width:190px !important;
  margin-inline:auto !important;
  border:1.6px solid rgba(212,175,55,.72) !important;
  border-radius:12px !important;
  background:linear-gradient(180deg,rgba(18,91,63,.90),rgba(8,62,43,.94)) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 5px 12px rgba(0,0,0,.18) !important;
  overflow:hidden !important;
}
.royal-surah-grid .quran-card.spacer > h5,
.royal-surah-grid div.spacer.quran-card > h5{
  margin:0 !important;
  height:100% !important;
}
.royal-surah-grid .quran-card.spacer > h5 > a,
.royal-surah-grid div.spacer.quran-card > h5 > a{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  min-height:54px !important;
  padding:9px 13px !important;
}
.royal-surah-grid .quran-card.spacer > h5 > a:hover,
.royal-surah-grid div.spacer.quran-card > h5 > a:hover,
.royal-surah-grid .quran-card.spacer > h5 > a:focus,
.royal-surah-grid div.spacer.quran-card > h5 > a:focus{
  background:rgba(212,175,55,.08) !important;
  box-shadow:inset 0 0 0 1px rgba(212,175,55,.55) !important;
}
@media (max-width:575.98px){
  .royal-surah-grid .quran-card.spacer,
  .royal-surah-grid div.spacer.quran-card{
    width:94% !important;
    max-width:none !important;
  }
  .royal-surah-grid .quran-card.spacer > h5 > a,
  .royal-surah-grid div.spacer.quran-card > h5 > a{
    min-height:50px !important;
    padding:8px 10px !important;
  }
}

/* Prayer header: city/title spacing only */
.royal-prayer-header{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  flex-wrap:nowrap !important;
  overflow:visible !important;
}
.royal-prayer-header h2{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}
.royal-prayer-card .royal-prayer-city-wrap{
  flex:0 1 auto !important;
  min-width:96px !important;
  max-width:150px !important;
  overflow:visible !important;
}
.royal-prayer-card .royal-prayer-city{
  min-width:0 !important;
  max-width:100% !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}


/* =========================================================
   Targeted form contrast fix: reciter/surah/from/to fields only
   Scope: reader selector + surah range form. Does not touch Quran text.
   ========================================================= */
.reader-list label,
.changesoraform .form-group label:not([for="submit"]){
  color:#b88a1a !important;
  opacity:1 !important;
  font-weight:800 !important;
  text-shadow:none !important;
  background:transparent !important;
  line-height:1.45 !important;
}
.reader-list label strong,
.changesoraform .form-group label strong{
  color:#b88a1a !important;
  opacity:1 !important;
  font-weight:800 !important;
  text-shadow:none !important;
}
.reader-list select.form-control,
.changesoraform select.form-control{
  color:#111827 !important;
  opacity:1 !important;
  font-weight:700 !important;
  text-shadow:none !important;
  background-color:#ffffff !important;
  border:1px solid rgba(17,24,39,.22) !important;
}
.reader-list select.form-control option,
.changesoraform select.form-control option{
  color:#111827 !important;
  background:#ffffff !important;
}

/* Ibn Thani targeted fix: Prayer city below title only */
.royal-prayer-card .royal-prayer-header{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  text-align:center !important;
  overflow:visible !important;
}
.royal-prayer-card .royal-prayer-header h2,
.royal-prayer-card .royal-prayer-title{
  width:100% !important;
  justify-content:center !important;
  text-align:center !important;
  white-space:nowrap !important;
  margin:0 !important;
}
.royal-prayer-card .royal-prayer-city-wrap{
  order:2 !important;
  margin-inline:auto !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
}
.royal-prayer-card .royal-prayer-city{
  width:auto !important;
  max-width:100% !important;
  min-width:0 !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  text-align:center !important;
}
