/* Waligo Yasin — Quran Android-inspired reader layer
   Adapted from https://android.quran.com/ patterns; no Android source or page assets copied. */
:root { --quran-toolbar: #263238; --quran-toolbar-2: #37474f; --quran-paper: #f7f3ea; --quran-ink: #27231e; --quran-muted: #b9c2c4; --quran-accent: #8bc7a7; --quran-border: rgba(255,255,255,.14); }
html, body { background: #102027; }
.yasin-reader { background: var(--quran-paper); color: var(--quran-ink); min-height: 100svh; overflow-x: hidden; }
.yasin-reader-header { position: sticky; top: 0; z-index: 20; min-height: 58px; padding: .45rem .55rem; background: var(--quran-toolbar); border-bottom: 1px solid rgba(0,0,0,.28); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.24); }
.yasin-icon-button, .yasin-round-button { width: 2.45rem; height: 2.45rem; border-radius: .35rem; color: #fff; }
.yasin-icon-button:hover, .yasin-round-button:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.yasin-surah-title { max-width: none; padding: .28rem .55rem; background: transparent; border: 0; box-shadow: none; text-align: center; }
.yasin-surah-title b { color: #fff; font-size: .95rem; font-weight: 600; }
.yasin-surah-title span { margin-top: .08rem; color: #c4ced0; font-size: .68rem; }
.yasin-reader-page { padding: .7rem .55rem 0; background: var(--quran-paper); }
.yasin-page-meta { color: #847b6d; padding: 0 .35rem .5rem; font-family: DM Sans, sans-serif; font-size: .7rem; }
.yasin-ayah-list { border-top: 1px solid #d8d0c2; border-bottom: 1px solid #d8d0c2; }
.yasin-ayah-row { gap: .55rem; padding: .82rem .2rem; border-bottom-color: #e3dccf; align-items: flex-start; }
.yasin-ayah-text { color: var(--quran-ink); font-family: Amiri, serif; font-size: var(--yasin-font-size); line-height: 1.82; overflow: visible; }
.yasin-ayah-number { margin-top: .25rem; color: #6f624f; border-color: #b9a98f; background: transparent; border-radius: .25rem; }
.yasin-ayah-number:hover, .yasin-ayah-number.is-bookmarked { color: #fff; background: #597e68; border-color: #597e68; }
.yasin-reader-footer { background: var(--quran-toolbar); border-top: 1px solid var(--quran-border); padding: .5rem .55rem calc(.5rem + env(safe-area-inset-bottom)); color: #fff; box-shadow: 0 -3px 12px rgba(0,0,0,.2); }
.yasin-reader-footer button { color: #fff; }
.yasin-mic-button { color: #183027; background: var(--quran-accent); border: 2px solid rgba(255,255,255,.65); box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.yasin-page-hint { color: var(--quran-muted); }
.yasin-reader-mushaf { background: #102027; color: var(--quran-ink); }
.yasin-mushaf-page { background: var(--quran-paper); min-height: 100svh; padding: 1.15rem .7rem 1.45rem; box-shadow: inset 0 0 0 1px rgba(91,72,40,.13), 0 0 22px rgba(0,0,0,.18); }
.yasin-mushaf-lines { color: var(--quran-ink); }
.yasin-mushaf-line { line-height: 1.17; }
.yasin-mushaf-marker { color: #6d614f; border-color: #b9a98f; background: rgba(255,255,255,.2); }
.yasin-mushaf-marker.is-bookmarked { color: #fff; background: #597e68; border-color: #597e68; }
.yasin-edge-button { color: #fff; background: var(--quran-toolbar-2); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.yasin-edge-button:hover:not(:disabled) { background: #455a64; }
@media (min-width: 640px) { .yasin-reader-header { padding-inline: 1.1rem; } .yasin-reader-page, .yasin-reader-footer { padding-inline: 1.25rem; } .yasin-mushaf-page { max-width: 760px; margin: 0 auto; padding-inline: 2rem; box-shadow: 0 0 0 1px rgba(91,72,40,.13), 0 12px 34px rgba(0,0,0,.25); } }
@media (min-width: 900px) { .yasin-reader-page { max-width: 920px; width: 100%; margin-inline: auto; } }
@media (prefers-reduced-motion: reduce) { .yasin-page-turn { animation: none; } }
/* FeaturePage chrome becomes the Android-style toolbar while Yasin is open. */
body:has(.yasin-reader-mushaf) header.sticky {
  background: var(--quran-toolbar) !important;
  border-bottom-color: rgba(255,255,255,.12) !important;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
body:has(.yasin-reader-mushaf) header.sticky button { color: #fff !important; }
body:has(.yasin-reader-mushaf) header.sticky button[class*="bg-white"] { background: var(--quran-toolbar-2) !important; border-color: var(--quran-border) !important; }
body:has(.yasin-reader-mushaf) header.sticky button[class*="bg-teal-700"] { background: #597e68 !important; }
/* Mobile readability correction: keep full diacritics inside a comfortable text column. */
.yasin-reader-mushaf .yasin-mushaf-lines {
  --yasin-font-size: 19px !important;
  padding-inline: .65rem;
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-weight: 400;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
}
.yasin-reader-mushaf .yasin-mushaf-line {
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: var(--yasin-font-size) !important;
  line-height: 1.42;
  overflow: visible;
}
.yasin-reader-mushaf .yasin-mushaf-page {
  padding: 1rem 1.15rem 1.35rem;
}
.yasin-reader-mushaf .yasin-mushaf-marker {
  line-height: 1;
}
@media (min-width: 640px) {
  .yasin-reader-mushaf .yasin-mushaf-lines { --yasin-font-size: 23px !important; padding-inline: 0; }
  .yasin-reader-mushaf .yasin-mushaf-page { padding-inline: 2rem; }
}
/* The web reader now mirrors a 15-line mushaf page. */
.yasin-reader-mushaf .yasin-mushaf-lines {
  grid-template-rows: repeat(15, minmax(0, 1fr));
  align-content: stretch;
  text-align: justify;
}
.yasin-reader-mushaf .yasin-mushaf-line {
  width: 100%;
  min-height: 0;
  direction: rtl;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .18em;
  text-align: justify;
  text-align-last: justify;
  white-space: nowrap;
}
.yasin-reader-mushaf .yasin-mushaf-word {
  display: inline;
  margin-inline: 0;
  flex: 0 0 auto;
}

/* Mushaf dark-mode refresh: mobile-first, RTL-safe and visually aligned with the sample UI. */
:root { --mushaf-black: #000; --mushaf-panel: #101113; --mushaf-line: rgba(255,255,255,.11); --mushaf-muted: #9a9ca2; --mushaf-silver: #97999e; --mushaf-green: #43ef9b; }
html:has(.yasin-reader-mushaf), body:has(.yasin-reader-mushaf) { background: var(--mushaf-black) !important; }
body:has(.yasin-reader-mushaf) header.sticky { display: none !important; }
.yasin-reader-mushaf { min-height: 100svh; background: var(--mushaf-black) !important; color: #fff; overflow: hidden; padding-bottom: 5.75rem; font-family: 'DM Sans', system-ui, sans-serif; }
.yasin-reader-mushaf .yasin-mushaf-page { display: block; min-height: 100svh; padding: 0 .85rem 2.25rem; background: #000 !important; box-shadow: none; }
.yasin-reader-mushaf .yasin-mushaf-lines { display: block; width: min(100%, 980px); margin: 0 auto; padding: 0 .2rem 2.5rem; color: #fff; direction: rtl; text-align: justify; font-family: 'Amiri Quran', Amiri, 'Scheherazade New', serif; font-weight: 400; font-feature-settings: 'kern','liga','calt'; text-rendering: optimizeLegibility; }
.yasin-reader-mushaf .yasin-mushaf-line { display: block; width: 100%; min-height: 0; margin: 0; padding: .25rem 0; direction: rtl; color: #fff; text-align: justify; text-align-last: justify; white-space: normal; overflow: visible; font-family: inherit; font-size: clamp(1.35rem, 4.45vw, 2rem) !important; line-height: 1.9; }
.yasin-reader-mushaf .yasin-mushaf-word { display: inline; flex: none; margin: 0; white-space: normal; }
.yasin-reader-mushaf .yasin-mushaf-marker { display: inline-grid; width: 1.5em; height: 1.5em; margin: 0 .18em; color: #fff; background: transparent; border: 1px solid var(--mushaf-silver); border-radius: 999px; vertical-align: .08em; font-family: 'Amiri Quran', Amiri, serif; font-size: .58em; line-height: 1; }
.yasin-reader-mushaf .yasin-mushaf-marker:hover, .yasin-reader-mushaf .yasin-mushaf-marker.is-bookmarked { color: #001d11; background: var(--mushaf-green); border-color: var(--mushaf-green); }
.mushaf-topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; min-height: 4.25rem; padding: .65rem .7rem; background: rgba(8,9,10,.96); border-bottom: 1px solid var(--mushaf-line); backdrop-filter: blur(16px); }
.mushaf-topbar-side { display: flex; align-items: center; gap: .18rem; }
.mushaf-topbar-right { justify-content: flex-end; }
.mushaf-ui-button, .mushaf-toolbar-icon { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; padding: 0; color: #e8e8eb; background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.mushaf-ui-button:hover, .mushaf-toolbar-icon:hover, .mushaf-toolbar-icon.is-active { background: #222428; }
.mushaf-ui-button svg, .mushaf-toolbar-icon svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mushaf-surah-badge { min-width: 9.5rem; padding: .45rem .8rem; color: #aeb0b6; background: #18191c; border: 1px solid #383a40; border-radius: .65rem; text-align: center; font-size: .62rem; line-height: 1.25; white-space: nowrap; }
.mushaf-badge-title { display: block; color: #fff; font-size: .83rem; font-weight: 700; }
.mushaf-badge-bookmark { color: var(--mushaf-green); font-size: 1rem; }
.mushaf-intro { max-width: 980px; margin: 0 auto; padding: 1.3rem .4rem .2rem; color: #fff; text-align: center; font-family: 'Amiri Quran', Amiri, 'Scheherazade New', serif; }
.mushaf-carryover { color: #c5c7cb; font-size: clamp(1rem, 3.4vw, 1.3rem); line-height: 2; text-align: justify; }
.mushaf-verse-badge { display: inline-block; margin-inline-start: .2em; color: #fff; font-size: .85em; }
.mushaf-surah-frame { position: relative; display: grid; place-items: center; max-width: 21rem; min-height: 3.6rem; margin: 1.6rem auto 1rem; color: #e3e4e7; border: 1px solid #73757b; outline: 1px solid #34363a; outline-offset: -5px; background: linear-gradient(90deg, transparent, #222327 18%, #222327 82%, transparent); box-shadow: 0 0 0 1px #111214, inset 0 0 18px #000; font-size: 1.45rem; }
.mushaf-surah-frame::before, .mushaf-surah-frame::after { content: '✦'; position: absolute; color: #b8bac0; font-size: .8rem; }
.mushaf-surah-frame::before { inset-inline-start: .8rem; } .mushaf-surah-frame::after { inset-inline-end: .8rem; }
.mushaf-basmala { padding-bottom: 1rem; color: #fff; font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.8; }
.mushaf-bottom-toolbar { position: fixed; inset-inline: .85rem; bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; justify-content: space-between; min-height: 3.55rem; padding: .35rem .45rem .35rem .8rem; color: #d4d5da; background: rgba(25,27,30,.96); border: 1px solid #3b3e43; border-radius: 999px; box-shadow: 0 12px 32px #000b, 0 0 0 1px #000; backdrop-filter: blur(18px); }
.mushaf-toolbar-actions { display: flex; align-items: center; gap: .12rem; }
.mushaf-text-button { padding: .5rem .25rem; color: #d7d8dc; background: transparent; border: 0; font-size: .72rem; cursor: pointer; }
.mushaf-mic-button { display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; color: #032516; background: linear-gradient(145deg, #8affc1, #1bdc82 65%, #0a9a58); border: 2px solid #baffd9; border-radius: 999px; box-shadow: 0 0 0 4px #43ef9b1a, 0 0 22px #43ef9b99, 0 5px 18px #0009; cursor: pointer; }
.mushaf-mic-button svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.yasin-reader-mushaf.mushaf-listening .mushaf-mic-button { animation: mushaf-pulse 1.15s ease-in-out infinite; }
@keyframes mushaf-pulse { 50% { box-shadow: 0 0 0 9px #43ef9b1f, 0 0 34px #43ef9bcc, 0 5px 18px #0009; transform: scale(1.04); } }
@media (min-width: 640px) { .mushaf-topbar { padding-inline: 1.35rem; } .yasin-reader-mushaf .yasin-mushaf-page { padding-inline: 2rem; } .mushaf-bottom-toolbar { inset-inline: auto; left: 50%; width: min(29rem, calc(100vw - 2rem)); transform: translateX(-50%); } .mushaf-intro { padding-top: 1.7rem; } }
@media (prefers-reduced-motion: reduce) { .yasin-reader-mushaf.mushaf-listening .mushaf-mic-button { animation: none; } }

/* Final correction for mobile browsers: never render the verse chunks as columns. */
body:has(.yasin-reader-mushaf) #root > header,
body:has(.yasin-reader-mushaf) header,
body:has(.yasin-reader-mushaf) nav { display: none !important; }
.yasin-reader-mushaf .yasin-mushaf-page { display: block !important; padding-top: 0 !important; }
.yasin-reader-mushaf .yasin-mushaf-lines { display: block !important; grid-template-rows: none !important; text-align: right !important; }
.yasin-reader-mushaf .yasin-mushaf-line { display: inline !important; width: auto !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; direction: rtl !important; text-align: right !important; text-align-last: auto !important; white-space: normal !important; line-height: 2.15 !important; }
.yasin-reader-mushaf .yasin-mushaf-line::after { content: ' '; }
.yasin-reader-mushaf .yasin-mushaf-word { display: inline !important; width: auto !important; white-space: normal !important; margin: 0 .07em !important; }
.yasin-reader-mushaf .yasin-mushaf-marker { display: inline-grid !important; }
@media (max-width: 639px) { .yasin-reader-mushaf .yasin-mushaf-lines { padding-inline: .1rem !important; } .yasin-reader-mushaf .yasin-mushaf-line { font-size: clamp(1.42rem, 5.4vw, 1.95rem) !important; } }
