

@font-face {
  font-family: 'AmiriQuran';
  src: url('fonts/amiriquran.ttf') format('truetype');
  font-display: swap;
}

:root, [data-theme="dark"] {
  --bg: #1C1812;
  --ink: #E8DFC8;
  --ink-soft: rgba(232, 223, 200, 0.74);
  --ink-faint: rgba(232, 223, 200, 0.52);
  --gold: #C9A84C;
  --on-accent: #1C1812;
  
  --serif: Georgia, 'Times New Roman', serif;
  --title-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sage: #8FBF8F;
  --grey: #B0A89A;
  --mark-m: var(--gold);
  --mark-r: var(--sage);
  --mark-s: var(--grey);
  --panel: #252018;
  --outline: rgba(232, 223, 200, 0.16);
  --divider: rgba(232, 223, 200, 0.14);
  --band-a: color-mix(in srgb, var(--gold) 22%, transparent);
  --band-b: color-mix(in srgb, var(--gold) 8%, transparent);
  --panel-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.30);
  --strip-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
  --sq: 12px;
}

[data-theme="light"] {
  --bg: #F5F0E8;
  --ink: #2C2416;
  --ink-soft: rgba(44, 36, 22, 0.76);
  --ink-faint: rgba(44, 36, 22, 0.54);
  --gold: #C9A84C;
  --on-accent: #1C1812;
  --sage: #7AAB7A;
  --grey: #B0A89A;
  --panel: #FBF8F1;
  --outline: rgba(44, 36, 22, 0.18);
  --divider: rgba(44, 36, 22, 0.14);
  --band-a: color-mix(in srgb, var(--gold) 30%, transparent);
  --band-b: color-mix(in srgb, var(--gold) 10%, transparent);
  --panel-shadow: 0 24px 60px rgba(44, 36, 22, 0.14), 0 3px 12px rgba(44, 36, 22, 0.08);
  --strip-shadow: 0 8px 26px rgba(44, 36, 22, 0.10);
}

[data-theme="dark"][data-palette="teal"] {
  --bg: #101A19;
  --panel: #182523;
  --ink: #DBE9E6;
  --ink-soft: rgba(219, 233, 230, 0.74);
  --ink-faint: rgba(219, 233, 230, 0.52);
  --outline: rgba(219, 233, 230, 0.16);
  --divider: rgba(219, 233, 230, 0.14);
  --gold: #33BEB1;
  --on-accent: #06201D;
}
[data-theme="light"][data-palette="teal"] {
  --bg: #E8F3F0;
  --panel: #F4FBF9;
  --ink: #143230;
  --ink-soft: rgba(20, 50, 48, 0.76);
  --ink-faint: rgba(20, 50, 48, 0.54);
  --outline: rgba(20, 50, 48, 0.18);
  --divider: rgba(20, 50, 48, 0.14);
  --gold: #0E8C82;
  --on-accent: #F1FBF8;
}

[data-theme="dark"][data-palette="lapis"] {
  --bg: #13151F;
  --panel: #1C1F2B;
  --ink: #DEE2EE;
  --ink-soft: rgba(222, 226, 238, 0.74);
  --ink-faint: rgba(222, 226, 238, 0.52);
  --outline: rgba(222, 226, 238, 0.16);
  --divider: rgba(222, 226, 238, 0.14);
  --gold: #6D8BEA;
  --on-accent: #0A0F1E;
}
[data-theme="light"][data-palette="lapis"] {
  --bg: #ECEFF8;
  --panel: #F7F9FE;
  --ink: #1A2338;
  --ink-soft: rgba(26, 35, 56, 0.76);
  --ink-faint: rgba(26, 35, 56, 0.54);
  --outline: rgba(26, 35, 56, 0.18);
  --divider: rgba(26, 35, 56, 0.14);
  --gold: #2C49B8;
  --on-accent: #F2F5FD;
}

[data-theme="dark"][data-palette="garnet"] {
  --bg: #1E1416;
  --panel: #2A1B1E;
  --ink: #ECDCDA;
  --ink-soft: rgba(236, 220, 218, 0.74);
  --ink-faint: rgba(236, 220, 218, 0.52);
  --outline: rgba(236, 220, 218, 0.16);
  --divider: rgba(236, 220, 218, 0.14);
  --gold: #D2808B;
  --on-accent: #24070C;
}
[data-theme="light"][data-palette="garnet"] {
  --bg: #F6ECEC;
  --panel: #FCF6F5;
  --ink: #34201F;
  --ink-soft: rgba(52, 32, 31, 0.76);
  --ink-faint: rgba(52, 32, 31, 0.54);
  --outline: rgba(52, 32, 31, 0.18);
  --divider: rgba(52, 32, 31, 0.14);
  --gold: #B23A4E;
  --on-accent: #FBEFEF;
}

[data-theme="dark"][data-palette="eink"] {
  --bg: #161616;
  --panel: #201F1F;
  --ink: #E9E9E7;
  --ink-soft: rgba(233, 233, 231, 0.74);
  --ink-faint: rgba(233, 233, 231, 0.52);
  --outline: rgba(233, 233, 231, 0.16);
  --divider: rgba(233, 233, 231, 0.14);
  --gold: #BFBFBC;
  --on-accent: #141414;
}
[data-theme="light"][data-palette="eink"] {
  --bg: #F1F1EE;
  --panel: #FBFBF9;
  --ink: #121212;
  --ink-soft: rgba(18, 18, 18, 0.78);
  --ink-faint: rgba(18, 18, 18, 0.56);
  --outline: rgba(18, 18, 18, 0.2);
  --divider: rgba(18, 18, 18, 0.15);
  --gold: #2E2E2E;
  --on-accent: #F4F4F1;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  transition: background 0.4s ease, color 0.4s ease;
}

.arabic {
  font-family: 'AmiriQuran', serif;
  direction: rtl;
}

.theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--strip-shadow);
  transition: color 0.2s, border-color 0.2s, background 0.4s ease;
}

.theme-toggle:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.palette-toggle {
  position: fixed;
  top: 22px;
  right: 74px;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--strip-shadow);
  transition: color 0.35s ease, border-color 0.2s, background 0.4s ease;
}

.palette-toggle:hover { border-color: var(--gold); }

.info-toggle {
  position: fixed;
  top: 22px;
  right: 276px;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--strip-shadow);
  transition: background 0.35s ease, border-color 0.2s, filter 0.2s;
}
.info-toggle:hover { filter: brightness(1.08); border-color: var(--gold); }

[data-theme="dark"] .info-toggle {
  background: var(--panel);
  border-color: var(--outline);
  color: var(--gold);
}
[data-theme="dark"] .info-toggle:hover { filter: none; border-color: var(--gold); }
@media (max-width: 880px) {
  
  .info-toggle { right: 128px; }
}

.zoom-control {
  position: fixed;
  top: 22px;
  right: 128px;
  z-index: 60;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--ink-soft);
  box-shadow: var(--strip-shadow);
  transition: border-color 0.2s, background 0.4s ease;
}
.zoom-control:hover { border-color: var(--gold); }
.zoom-control .zoom-ic { flex: none; color: var(--ink-soft); }

.theme-toggle,
.palette-toggle,
.info-toggle,
.zoom-control,
.focus-toggle,
.kompakt-topbar,
.lang-toggle {
  zoom: var(--inv-zoom, 1);
}

.zoom-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 82px;
  height: 3px;
  border-radius: 2px;
  background: var(--outline);
  outline: none;
  cursor: pointer;
}
.zoom-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
}
.zoom-control input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
}

@media (max-width: 880px) {
  .zoom-control { display: none; }
}

.lang-toggle {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 60;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--strip-shadow);
  overflow: hidden;
}

.lang-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 0 14px;
  height: 40px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle button.arabic {
  font-size: 15px;
  letter-spacing: 0;
}

.lang-toggle button:hover { color: var(--gold); }

.lang-toggle button.active {
  background: var(--gold);
  color: var(--on-accent);
}

body > section,
.site-footer {
  transition: opacity 0.24s ease;
}

body.lang-fading > section,
body.lang-fading .site-footer {
  opacity: 0;
}

body.lang-ar .lang-hide-ar { display: none; }

body.lang-ar .site-title {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  font-size: 30px;
}

body.lang-ar .site-sub {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
  font-size: 15px;
}

body.lang-ar .hadith-src {
  letter-spacing: 0.04em;
  font-size: 12px;
}

body.lang-ar .hero-points {
  direction: rtl;
  text-align: right;
}

body.lang-ar .pt-title {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  font-size: 12px;
}

body.lang-ar .pt-body {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
  font-size: 15.5px;
  line-height: 1.85;
}

body.lang-ar .journey h2 {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  font-size: 15px;
}

body.lang-ar .control-row,
body.lang-ar .legend-row {
  direction: rtl;
}

body.lang-ar .control-strip .pill-toggle button,
body.lang-ar .control-strip .btn-small,
body.lang-ar .control-strip .swatch-btn,
body.lang-ar .control-strip .range-group,
body.lang-ar .control-strip .range-group input,
body.lang-ar .control-strip .plan-group input,
body.lang-ar .control-strip .legend-row {
  letter-spacing: 0;
}

body.lang-ar .grid-note {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
  font-size: 14.5px;
  direction: rtl;
}

body.lang-ar .page-indicator {
  letter-spacing: 0.04em;
}

body.lang-ar .overlay-hint {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  font-size: 12px;
}

.hero {
  padding: 120px 24px 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  margin-bottom: 22px;
  line-height: 0;
  perspective: 620px;
}
.hero-logo svg {
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
  filter: drop-shadow(0 0 calc(var(--logo-glow, 0) * 14px) color-mix(in srgb, var(--gold) 55%, transparent));
}
.hero-logo .lg-frame-cream { stroke: var(--ink); opacity: 0.28; }
.hero-logo .lg-frame-gold { stroke: var(--gold); opacity: 0.32; }
.hero-logo .lg-cream { fill: var(--ink); stroke: var(--ink); }
.hero-logo .lg-gold { fill: var(--gold); stroke: var(--gold); }
.hero-logo .lg-dot-cream { fill: var(--ink); }
.hero-logo .lg-dot-gold { fill: var(--gold); }
.hero-logo .lg-center { fill: var(--bg); }

@keyframes heroKitePulse {
  0%, 8% { fill-opacity: 0.9; stroke-width: 2.4; }
  20%, 100% { fill-opacity: 0; stroke-width: 1.1; }
}
.hero-logo .k {
  animation: heroKitePulse 6.4s linear infinite;
}
.hero-logo .k0 { animation-delay: 0s; }
.hero-logo .k1 { animation-delay: 0.8s; }
.hero-logo .k2 { animation-delay: 1.6s; }
.hero-logo .k3 { animation-delay: 2.4s; }
.hero-logo .k4 { animation-delay: 3.2s; }
.hero-logo .k5 { animation-delay: 4s; }
.hero-logo .k6 { animation-delay: 4.8s; }
.hero-logo .k7 { animation-delay: 5.6s; }
@media (prefers-reduced-motion: reduce) {
  .hero-logo .k { animation: none; fill-opacity: 0.18; }
}

.hero .site-title {
  font-family: var(--title-serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-transform: none;
  font-variant: normal;
  margin: 0 0 18px;
}

.hero .site-sub {
  font-size: 14.5px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 72px;
}

.hero .hadith-main {
  font-size: 30px;
  line-height: 2.25;
  max-width: 900px;
  margin: 0;
}

.hero .saw {
  font-size: 0.55em;
  color: var(--ink-soft);
}

.hero .climax {
  display: inline-block;
  margin-top: 0.35em;
  color: var(--gold);
  font-size: 1.2em;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 14px;
}

.hero .hadith-en {
  font-style: italic;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 42px 0 0;
}

.hero .hadith-src {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
  margin: 14px 0 0;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(420px, 70vw);
  margin: 58px auto 0;
  opacity: 0.45;
}

.ornament .line {
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.ornament svg { display: block; flex: none; }
.ornament .motif-stroke { stroke: var(--gold); }

.hero-points {
  margin: 64px auto 0;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
}

.hero-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.hero-point .pt-diamond {
  color: var(--gold);
  font-size: 9px;
  line-height: 1;
  text-align: center;
}

.hero-point .pt-text {
  margin: 0;
}

.hero-point .pt-titlerow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.hero-point .pt-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  font-weight: 700;
  color: var(--gold);
}

details.hero-point {
  display: block;
}

details.hero-point > summary.pt-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  list-style: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 10px;
  margin: 0 auto;
  transition: background 0.15s;
}

details.hero-point > summary.pt-summary::-webkit-details-marker { display: none; }
details.hero-point > summary.pt-summary::marker { display: none; }

details.hero-point > summary.pt-summary:hover { background: color-mix(in srgb, var(--gold) 7%, transparent); }

.pt-chevron {
  font-size: 10px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink-soft);
  opacity: 0.5;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

details.hero-point > summary.pt-summary:hover .pt-chevron {
  opacity: 0.75;
  transform: translateY(0);
}

details.hero-point[open] > summary.pt-summary .pt-chevron {
  opacity: 0.7;
  transform: translateY(0) rotate(180deg);
}

details.hero-point > p.pt-text {
  margin-top: 10px;
  text-align: center;
}

body.lang-ar details.hero-point > summary.pt-summary {
  direction: rtl;
}

body.lang-ar .pt-titlerow {
  direction: rtl;
}

body.lang-ar details.hero-point > p.pt-text {
  text-align: center;
}

.hero-point .pt-body {
  display: block;
  font-style: normal;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  text-wrap: pretty;
}

.hero-point .pt-body + .pt-body {
  margin-top: 10px;
}

.hero-points:not(.brief-points) .pt-body {
  text-align: justify;
  text-align-last: center;
}

.brief-brief .pt-body {
  text-align: justify;
  text-align-last: center;
}

.hero-point .pt-callout .pt-body {
  color: var(--ink);
  font-weight: 400;
}

.brief-brief .pt-body {
  font-style: normal;
}
.brief-brief .pt-body em {
  font-style: italic;
  letter-spacing: 0.01em;
}
.cite-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: baseline;
  margin-left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: var(--gold);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(2px);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cite-link svg {
  display: block;
}
.cite-link:hover,
.cite-link:focus-visible {
  background: var(--ink);
  color: var(--panel);
  transform: translateY(1px);
}

.reader {
  padding: 70px 24px 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.taawwudh {
  font-size: 24px;
  
  color: var(--ink);
  opacity: 0.74;
  text-align: center;
  margin: 0 0 30px;
}

.reader-panel {
  position: relative;
  width: fit-content;
  max-width: 94vw;
  margin: 0 auto;
  height: 560px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.4s ease;
}

.reader-header {
  font-size: 24px;
  text-align: center;
  padding: 30px 20px 8px;
  
  color: var(--ink);
  opacity: 0.74;
}
.reader-header .rh-surah {
  color: var(--gold);
}

.reader-cols {
  
  --col-ar: 280px;
  --col-en: 280px;
  --col-tl: 264px;
  flex: 1;
  display: flex;
  justify-content: center;
  column-gap: 0;
  min-height: 0;
  padding: 18px 0 16px;
}

.reader-pane {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
}

.ar-pane { width: var(--col-ar); }
.en-pane { width: var(--col-en); }
.tl-pane { width: var(--col-tl); }

.reader-pane::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--divider);
}
.reader-pane.pane-lead::before,
.reader-pane.pane-collapsed::before { display: none; }

.reader-col {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 22px;
}

.reader-col.ar {
  font-size: 24px;
  line-height: 2.15;
  text-align: right;
}

.reader-col.en {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  text-align: left;
}

.reader-col.tl {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-soft);
  text-align: left;
}

.reader-col.tl .en-verse { margin: 0 0 10px; }
.reader-col.tl .en-verse .verse-num { color: var(--gold); font-size: 0.85em; }
.reader-col.tl u { text-underline-offset: 2px; }
.reader-col.tl b { color: var(--ink); font-weight: 600; }

.en-pane,
.tl-pane {
  min-height: 0;
  margin-bottom: 10px; 
  
  overflow: hidden;
  transition: width 0.42s cubic-bezier(0.33, 0, 0.18, 1),
              opacity 0.3s ease,
              margin 0.42s cubic-bezier(0.33, 0, 0.18, 1);
}

.en-pane.pane-collapsed,
.tl-pane.pane-collapsed {
  width: 0;
  opacity: 0;
  margin-left: 0;
  margin-right: 0;
  pointer-events: none;
}

.en-pane .reader-col.en { box-sizing: border-box; width: var(--col-en); }
.tl-pane .reader-col.tl { box-sizing: border-box; width: var(--col-tl); }

.en-pane .reader-col.en,
.tl-pane .reader-col.tl {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;       
  -ms-overflow-style: none;
  overscroll-behavior: auto;   
}

.en-pane .reader-col.en::-webkit-scrollbar,
.tl-pane .reader-col.tl::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.en-more,
.tl-more {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--panel) 0%, transparent),
    var(--panel) 78%
  );
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.en-more.show,
.tl-more.show {
  opacity: 1;
  pointer-events: auto;
}

.en-more-chev,
.tl-more-chev {
  font-size: 22px;
  line-height: 1;
  padding-bottom: 4px;
  animation: enMoreNudge 1.7s ease-in-out infinite;
}

@keyframes enMoreNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .en-more-chev,
  .tl-more-chev { animation: none; }
}

.reader-col.en .bismillah-en {
  font-style: italic;
  color: var(--ink-soft);
}

.col-divider {
  flex: none;
  width: 1px;
  background: var(--divider);
  margin: 10px 0;
}

.verse-num {
  color: var(--gold);
  font-size: 0.78em;
}

.bismillah-line {
  text-align: center;
  font-size: 0.8125em;
  
  color: var(--ink);
  opacity: 0.74;
  margin-bottom: 8px;
}

.cont-arrow {
  position: absolute;
  left: 20px;
  bottom: 18px;
  color: var(--gold);
  font-size: 17px;
  opacity: 0.65;
  pointer-events: none;
}

.reader-col.en .en-verse {
  margin: 0 0 10px;
}

.reader-col.en .en-verse .verse-num {
  font-size: 0.85em;
}

.reader-footer {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 34px;
  padding: 10px 0 22px;
}

.nav-arrow {
  appearance: none;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--ink-soft);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--serif);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-arrow:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.turn-flash {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  pointer-events: none;
  opacity: 0;
}

.turn-flash.right { right: 0; background: linear-gradient(to left, color-mix(in srgb, var(--gold) 16%, transparent), transparent); }
.turn-flash.left { left: 0; background: linear-gradient(to right, color-mix(in srgb, var(--gold) 16%, transparent), transparent); }

.turn-flash.show { animation: flash 0.55s ease-out; }

@keyframes flash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.page-indicator-row {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.page-status {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--outline);
  display: inline-block;
  transition: background 0.2s;
}

.page-status.m { background: var(--mark-m); box-shadow: none; }
.page-status.r { background: var(--mark-r); box-shadow: none; }
.page-status.s { background: var(--mark-s); box-shadow: none; }

.page-indicator {
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
}

.reader-empty {
  display: block;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-faint);
  padding-top: 14px;
}

.journey {
  padding: 60px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.journey h2 {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-soft);
  margin: 0 0 36px;
}

.control-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--strip-shadow);
  padding: 16px 22px;
  margin-bottom: 40px;
  transition: background 0.4s ease;
}

.control-strip .pill-toggle button,
.control-strip .btn-small,
.control-strip .swatch-btn,
.control-strip .plan-chip,
.control-strip .range-group,
.control-strip .range-group input,
.control-strip .plan-group input,
.control-strip .legend-row {
  text-transform: capitalize;
  letter-spacing: 0.06em;
  font-size: 13px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
}

.pill-toggle {
  display: flex;
  border: 1px solid var(--outline);
  border-radius: 999px;
  overflow: hidden;
}

.pill-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  padding: 7px 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pill-toggle button.active {
  background: var(--gold);
  color: var(--on-accent);
}

[data-theme="light"] .pill-toggle button.active {
  color: #FFFFFF;
}

.range-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.range-group input {
  width: 64px;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  padding: 6px 8px;
  text-align: center;
}

.range-group input:focus { outline: 1px solid var(--gold); }

.range-group input::placeholder {
  color: var(--ink-faint);
  opacity: 0.42;
}

.btn-small {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 7px;
  font-family: var(--serif);
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-small:hover { background: var(--gold); color: var(--on-accent); }

.btn-small.ghost {
  border-color: var(--outline);
  color: var(--ink-soft);
}

.btn-small.ghost:hover {
  background: transparent;
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn-small.active,
.btn-small.ghost.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-accent);
}

.plans-row {
  border-top: 1px solid var(--divider);
  padding-top: 14px;
}

.calc-row {
  border-top: 1px solid var(--divider);
  padding-top: 14px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.calc-summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 13px;
  text-transform: capitalize;
  letter-spacing: 0.06em;
  user-select: none;
}

.calc-summary::-webkit-details-marker { display: none; }

.calc-summary::after {
  content: "\25BE";
  margin-left: 8px;
  font-size: 10px;
  opacity: 0.7;
  display: inline-block;
  transition: transform 0.2s;
}

.calc-row[open] .calc-summary::after { transform: rotate(180deg); }

.calc-body {
  margin-top: 16px;
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
}

.calc-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--serif);
  font-size: 13px;
  text-transform: capitalize;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.calc-field input {
  width: 62px;
  flex: none;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  padding: 6px 8px;
  text-align: center;
}

.calc-field input:focus { outline: 1px solid var(--gold); }

.calc-result {
  text-align: center;
  margin: 18px 0 2px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}

.calc-result .calc-num {
  color: var(--gold);
  font-weight: 600;
}

body.lang-ar .calc-row { direction: rtl; }
.calc-row[open] .calc-body {
  animation: calcExpand 0.34s cubic-bezier(0.33, 0, 0.18, 1);
}
@keyframes calcExpand {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .calc-row[open] .calc-body { animation: none; }
}
body.lang-ar .calc-field,
body.lang-ar .calc-summary { letter-spacing: 0; }

@media (max-width: 520px) {
  .calc-fields { grid-template-columns: 1fr; }
}

.plan-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-group input {
  width: 130px;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  padding: 6px 10px;
}

.plan-group input:focus { outline: 1px solid var(--gold); }

.plan-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 5px 7px 5px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  background: transparent;
  font-family: var(--serif);
  transition: border-color 0.2s, color 0.2s;
}

.plan-chip:hover { border-color: var(--gold); color: var(--ink); }

.plan-chip.active { border-color: var(--gold); color: var(--gold); }

.plan-chip .x {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-faint);
}

.plan-chip .x:hover { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--ink); }

.swatches {
  display: flex;
  align-items: center;
  gap: 14px;
}

.swatch-btn {
  appearance: none;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.swatch-btn .chip {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.swatch-btn.active {
  border-color: var(--gold);
  color: var(--ink);
}

.legend-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
  font-size: 13px;
  color: var(--ink-faint);
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}

.legend-row span { display: flex; align-items: center; gap: 7px; }

.legend-row .chip {
  width: 10px;
  height: 10px;
  border-radius: 2.5px;
  display: inline-block;
}

.chip.c-m { background: var(--mark-m); }
.chip.c-r { background: var(--mark-r); }
.chip.c-s { background: var(--mark-s); }

.legend-count {
  margin-left: 7px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legend-count.c-m-ink { color: var(--mark-m); }
.legend-count.c-r-ink { color: var(--mark-r); }
.legend-count.c-s-ink { color: var(--mark-s); }

#pageGrid {
  display: grid;
  grid-template-columns: repeat(58, var(--sq));
  gap: 2px;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

#pageGrid .sq {
  width: var(--sq);
  height: var(--sq);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--outline);
  background: transparent;
  transition: transform 0.12s ease;
  cursor: pointer;
}

#pageGrid .sq:hover {
  transform: scale(1.8);
  position: relative;
  z-index: 5;
  box-shadow: inset 0 0 0 1px var(--gold);
}

#pageGrid .sq.m { background: var(--mark-m); box-shadow: none; }
#pageGrid .sq.r { background: var(--mark-r); box-shadow: none; }
#pageGrid .sq.s { background: var(--mark-s); box-shadow: none; }

#pageGrid .sq.current-page {
  position: relative;
  z-index: 3;
}
#pageGrid .sq.current-page::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px 2px color-mix(in srgb, var(--gold) 55%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: currentPulse 1.6s ease-in-out infinite;
}
@keyframes currentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  #pageGrid .sq.current-page::before { animation: none; opacity: 1; }
}

#pageGrid.overlay-juz .sq[data-juz-num] {
  position: relative;
}

#pageGrid.overlay-juz .sq[data-juz-num]::after {
  content: attr(data-juz-num);
  position: absolute;
  inset: 0;
  font-size: 7px;
  line-height: var(--sq);
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  color: rgba(28, 24, 18, 0.8);
  animation: juzNumFade 0.45s ease forwards;
  pointer-events: none;
}

[data-theme="dark"] #pageGrid.overlay-juz .sq[data-juz-num]::after {
  color: #FFFFFF;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

#pageGrid.overlay-surah .sq[data-surah-num] {
  position: relative;
}

#pageGrid.overlay-surah .sq[data-surah-num]::after {
  content: attr(data-surah-num);
  position: absolute;
  inset: 0;
  font-size: 7px;
  line-height: var(--sq);
  text-align: center;
  white-space: nowrap;
  font-family: var(--serif);
  font-weight: 700;
  color: rgba(28, 24, 18, 0.8);
  animation: juzNumFade 0.45s ease forwards;
  pointer-events: none;
}

[data-theme="dark"] #pageGrid.overlay-surah .sq[data-surah-num]::after {
  color: #FFFFFF;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

@keyframes juzNumFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#pageGrid.overlay .sq { background: var(--band-b); box-shadow: none; }
#pageGrid.overlay-juz .sq[data-jband="1"] { background: var(--band-a); }
#pageGrid.overlay-surah .sq[data-sband="1"] { background: var(--band-a); }
#pageGrid.overlay .sq.m { background: var(--mark-m); }
#pageGrid.overlay .sq.r { background: var(--mark-r); }
#pageGrid.overlay .sq.s { background: var(--mark-s); }

.overlay-hint {
  display: none;
  margin: -24px 0 16px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--gold);
}

.grid-tooltip {
  position: fixed;
  zoom: var(--inv-zoom, 1);
  transform: translate(-50%, -130%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--outline);
  border-radius: 9px;
  box-shadow: var(--strip-shadow);
  padding: 11px 18px;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 50;
  display: none;
  text-align: center;
}

.grid-tooltip .tt-ar {
  font-family: 'AmiriQuran', serif;
  direction: rtl;
  font-size: 21px;
  display: block;
}

.grid-tooltip .tt-en {
  display: block;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.grid-tooltip .tt-verses {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.grid-note {
  margin-top: 30px;
  font-size: 14px;
  color: var(--ink-faint);
  font-style: normal;
  max-width: 760px;
  text-align: center;
  line-height: 2.1;
  text-wrap: pretty;
}

.grid-note .dot {
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
  vertical-align: 2px;
  margin: 0 9px;
  opacity: 0.8;
}

.grid-symbols {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 30px;
  max-width: 820px;
}
.gs-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.gs-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.gs-sq {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--outline);
  background: var(--band-b, transparent);
}
.gs-sq.gs-corner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 7px solid var(--gold);
  border-left: 7px solid transparent;
}
.gs-sq.gs-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
  animation: currentPulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .gs-sq.gs-dot::before { animation: none; }
}
.gs-sq.gs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: var(--band-a, transparent);
}
.gs-text {
  font-size: 14px;
  color: var(--ink-faint);
  font-style: normal;
  text-wrap: pretty;
}
body.lang-ar .grid-symbols { direction: rtl; }
body.lang-ar .gs-text {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
  font-size: 14px;
}

.closing {
  padding: 24px 24px 50px;
  text-align: center;
}

.closing .closing-ar {
  font-size: 52px;
  line-height: 2;
  margin: 0;
  color: var(--gold);
}

.closing .closing-en {
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 26px 0 0;
}

.closing .closing-src {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-faint);
  margin: 14px auto 0;
  max-width: 520px;
  text-wrap: pretty;
}

body.lang-ar .closing .closing-src {
  font-size: 14px;
  line-height: 2;
}

:root { --qr-ink: #6E561B; --qr-bg: #FBF8F1; }
[data-palette="teal"]   { --qr-ink: #0C5049; }
[data-palette="lapis"]  { --qr-ink: #22357F; }
[data-palette="garnet"] { --qr-ink: #7E2A39; }
[data-palette="eink"]   { --qr-ink: #262626; }

.aani-support {
  margin: 46px auto 0;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-point > p.pt-text.aani-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.aani-line {
  display: block;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
.aani-name { color: var(--gold); font-weight: 600; }
.aani-qr {
  display: block;
  width: 188px;
  height: 188px;
  padding: 14px;
  box-sizing: border-box;
  background: var(--qr-bg);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 14px;
  box-shadow: var(--panel-shadow);
  
  color: var(--qr-ink);
  transition: color 0.4s ease;
}
.aani-qr-svg { display: block; width: 100%; height: 100%; }

.aani-qr-svg path { fill: var(--qr-ink); }
body.lang-ar .aani-line { font-family: 'AmiriQuran', serif; font-size: 17px; }
.karak-line { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 16px; font-weight: 600; color: var(--gold); }
.karak-ico { width: 24px; height: 24px; flex: none; }
.support-cards { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 34px; }
.support-card { display: flex; flex-direction: column; align-items: center; gap: 13px; max-width: 210px; }
.qr-caption { display: block; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); text-align: center; text-wrap: pretty; }
.qr-link { display: inline-flex; color: var(--gold); }
.qr-link svg { width: 20px; height: 20px; }
.ziina-qr-img { display: block; width: 100%; height: 100%; background: var(--qr-ink); transition: background 0.4s ease; -webkit-mask: url("uploads/ziina-qr.png") center/contain no-repeat; mask: url("uploads/ziina-qr.png") center/contain no-repeat; }

.references {
  max-width: 560px;
  margin: 54px auto 0;
  text-align: center;
}

.references-title {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
  position: relative;
  padding: 0 22px;
}

.references-title::before,
.references-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--divider);
}

.references-title::before { left: 0; }
.references-title::after { right: 0; }

.references .ref-list {
  list-style: decimal;
  text-align: left;
  margin: 22px 0 0;
  padding: 0 0 0 26px;
  counter-reset: none;
}

.references .ref-list li {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-faint);
  margin: 0 0 11px;
  padding-left: 6px;
  text-wrap: pretty;
}

.references .ref-list-alpha {
  list-style: lower-alpha;
}

.references .ref-list li::marker {
  color: var(--gold);
  font-size: 11px;
}

.references .ref-list i {
  font-style: italic;
  color: var(--ink-soft);
}

.references a {
  color: var(--gold);
}

body.lang-ar .references {
  direction: rtl;
}

body.lang-ar .references .ref-list {
  text-align: right;
  padding: 0 26px 0 0;
}

.site-footer {
  height: 180px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.10));
}

[data-theme="light"] .site-footer {
  background: linear-gradient(to bottom, transparent, rgba(44, 36, 22, 0.05));
}

.reader-controls {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.rc-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
}

.rc-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant: small-caps;
  text-transform: uppercase;
  padding: 6px 15px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.rc-toggle:hover { border-color: var(--gold); color: var(--ink); }

.rc-toggle.is-on {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--ink);
}

.rc-toggle::before {
  content: "\2713";
  display: inline-block;
  overflow: hidden;
  max-width: 0;
  margin-right: 0;
  opacity: 0;
  color: var(--gold);
  vertical-align: baseline;
  white-space: nowrap;
  transition: max-width 0.34s cubic-bezier(0.33, 0, 0.18, 1),
              margin-right 0.34s cubic-bezier(0.33, 0, 0.18, 1),
              opacity 0.28s ease;
}

.rc-toggle.is-on::before {
  max-width: 1.2em;
  margin-right: 0.34em;
  opacity: 1;
}

.rc-modes {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.rc-mode {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rc-toggle.rc-locked {
  cursor: default;
  pointer-events: none;
  border-color: var(--outline);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-faint);
}
.rc-toggle.rc-locked::before { color: var(--ink-faint); }

.rc-swap {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  flex: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.rc-swap:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.rc-swap:active { transform: scale(0.92); }
.rc-swap svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  .en-pane,
  .tl-pane,
  .rc-toggle::before {
    transition: none;
  }
}

#translationRow.rc-hidden { display: none; }

body.lang-ar .reader-controls { direction: rtl; }
body.lang-ar .rc-label,
body.lang-ar .rc-toggle {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  text-transform: none;
}

.translation-row label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
}

.reader-hints {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.reader-hints-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
  position: relative;
  padding: 0 22px;
}

.reader-hints-title::before,
.reader-hints-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--divider);
}

.reader-hints-title::before { left: 0; }
.reader-hints-title::after { right: 0; }

.hint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.hint {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 14px;
}

.source-credit {
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.source-credit .src-ico { flex: none; color: var(--ink-faint); }
.shift-ico { display: block; }
.source-credit a,
.source-credit a:link,
.source-credit a:visited {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.source-credit a:hover { color: var(--ink); }

.hint-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hint-key .kbd {
  flex: none;
  width: 19px;
  height: 19px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1;
}

.hint-key .cue {
  color: var(--gold);
  font-size: 19px;
  line-height: 1;
}

.hint-text {
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  text-align: left;
  font-style: normal;
  text-wrap: pretty;
}

body.lang-ar .hint-list { direction: rtl; }

body.lang-ar .hint-text {
  font-family: 'AmiriQuran', serif;
  text-align: right;
  letter-spacing: 0;
  font-style: normal;
  line-height: 1.9;
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: '\25BE';
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-faint);
  font-size: 10px;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--gold);
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  padding: 7px 28px 7px 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.select-wrap select:hover { border-color: var(--gold); color: var(--ink); }

.select-wrap select:focus { outline: 1px solid var(--gold); }

.select-wrap select option { background: var(--panel); color: var(--ink); }

.cselect-wrap select { display: none; }

.cselect-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  padding: 7px 28px 7px 13px;
  min-width: 168px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cselect-btn:hover,
.select-wrap.open .cselect-btn {
  border-color: var(--gold);
  color: var(--ink);
}

.select-wrap.open::after { transform: translateY(-50%) rotate(180deg); }

.cselect-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 9px;
  box-shadow: var(--panel-shadow);
  z-index: 55;
  display: none;
}

.select-wrap.open .cselect-list { display: block; }

.cselect-opt {
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.cselect-opt:hover { background: var(--gold); color: var(--on-accent); }
.cselect-opt.active { color: var(--gold); }
.cselect-opt.active:hover { color: var(--on-accent); }

body.lang-ar .cselect-btn { text-align: right; padding: 7px 13px 7px 28px; }

.reader-jump {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.surah-jump .cselect-btn { min-width: 196px; }

#surahRow .cselect-list { max-height: 344px; overflow-y: auto; }
#surahRow .cselect-list::-webkit-scrollbar { width: 8px; }
#surahRow .cselect-list::-webkit-scrollbar-thumb {
  background: var(--outline); border-radius: 8px;
}
#surahRow .cselect-list::-webkit-scrollbar-thumb:hover { background: var(--gold); }

#translationRow .cselect-btn { min-width: 268px; }
#translationRow .cselect-list { max-height: 344px; overflow-y: auto; }
#translationRow .cselect-list::-webkit-scrollbar { width: 8px; }
#translationRow .cselect-list::-webkit-scrollbar-thumb {
  background: var(--outline); border-radius: 8px;
}
#translationRow .cselect-list::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.bookmark-btn:hover { border-color: var(--gold); color: var(--ink); }
.bookmark-btn .bm-ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4px;
  stroke-linejoin: round;
  transition: fill 0.2s, stroke 0.2s;
}
.bookmark-btn.is-on { border-color: var(--gold); color: var(--gold); }
.bookmark-btn.is-on .bm-ico { fill: var(--gold); stroke: var(--gold); }

.bm-group { position: relative; display: inline-flex; align-items: stretch; }
.bm-group .bookmark-btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.bm-list-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--outline);
  border-left: none;
  border-radius: 0 7px 7px 0;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.bm-list-btn:hover { border-color: var(--gold); color: var(--gold); }
.bm-list-btn.empty { opacity: 0.55; }
.bm-caret { display: block; transition: transform 0.2s ease; }
.bm-group.open .bm-list-btn { border-color: var(--gold); color: var(--gold); }
.bm-group.open .bm-caret { transform: rotate(180deg); }

.bm-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 9px;
  box-shadow: var(--panel-shadow);
  z-index: 56;
  display: none;
}
.bm-group.open .bm-menu { display: block; }
.bm-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.bm-opt-main {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink);
}
.bm-opt-sub {
  font-family: var(--serif);
  font-size: 11.5px;
  color: var(--ink-faint);
  font-style: italic;
}
.bm-opt:hover { background: var(--gold); }
.bm-opt:hover .bm-opt-main,
.bm-opt:hover .bm-opt-sub { color: var(--on-accent); }
.bm-opt.current .bm-opt-main { color: var(--gold); }
.bm-opt.current:hover .bm-opt-main { color: var(--on-accent); }
.bm-empty {
  padding: 9px 12px;
  font-family: var(--serif);
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
}
body.lang-ar .bm-menu { left: auto; right: 0; text-align: right; }
body.lang-ar .bm-list-btn { border-left: 1px solid var(--outline); border-right: none; border-radius: 7px 0 0 7px; }
body.lang-ar .bm-group .bookmark-btn { border-radius: 0 7px 7px 0; }
body.lang-ar .bm-opt-main, body.lang-ar .bm-opt-sub, body.lang-ar .bm-empty {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
}
.bookmark-btn.limit { animation: bmShake 0.4s ease; border-color: var(--mark-r, var(--gold)); }
@keyframes bmShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) { .bookmark-btn.limit { animation: none; } }
body.lang-ar .bm-label { font-family: 'AmiriQuran', serif; line-height: 1.5; }
body.lang-ar .bookmark-btn { padding-top: 5px; padding-bottom: 5px; font-size: 15px; }
body.lang-ar .bookmark-btn .bm-ico { flex: none; }
.bm-cue { fill: var(--gold); display: block; }

.reader-ribbon {
  position: absolute;
  top: -2px;
  right: 26px;
  width: 20px;
  height: 28px;
  z-index: 6;
  opacity: 0;
  transform: translateY(-7px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.reader-ribbon svg { display: block; }
.reader-ribbon svg path { fill: var(--gold); }
.reader-panel.bookmarked .reader-ribbon {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .reader-ribbon { transition: opacity 0.25s ease; transform: none; }
  .reader-panel.bookmarked .reader-ribbon { transform: none; }
}
body.lang-ar .reader-ribbon { right: auto; left: 26px; }

#pageGrid .sq.bookmarked { position: relative; z-index: 2; }
#pageGrid .sq-bm {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 5px solid var(--gold);
  border-left: 5px solid transparent;
  pointer-events: none;
  z-index: 4;
}

body.lang-ar .translation-row label {
  font-family: 'AmiriQuran', serif;
  letter-spacing: 0;
  font-size: 12px;
}

.reader-col.en u { text-underline-offset: 2px; }

.swatch-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.chip-edit {
  appearance: none;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  letter-spacing: 0.04em;
}

.chip-edit:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.palette-pop {
  position: fixed;
  zoom: var(--inv-zoom, 1);
  display: none;
  transform: translateX(-50%);
  grid-template-columns: repeat(4, 30px);
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 13px;
  box-shadow: var(--panel-shadow);
  padding: 15px;
  z-index: 55;
}

.pal-cell {
  appearance: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.pal-cell:hover:not(:disabled) {
  transform: scale(1.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), 0 3px 10px rgba(0,0,0,0.3);
}

.pal-cell.current { outline: 2.5px solid var(--ink); outline-offset: 2px; }

.pal-cell.taken { opacity: 0.2; cursor: not-allowed; }

@media (max-width: 640px) {
  .hero .hadith-main { font-size: 24px; }
  .closing .closing-ar { font-size: 36px; }
  :root { --sq: 8px; }
}

.hero .hero-logo { cursor: pointer; }
.hero .hero-logo:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 10px;
  border-radius: 8px;
}

.logo-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 4, 2, 0.78);
  
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  overflow: auto;
}

[data-theme="light"] .logo-modal {
  background: color-mix(in srgb, var(--gold) 14%, rgba(245, 240, 232, 0.74));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.logo-modal.open { display: flex; animation: ldFade 0.32s ease both; }
@keyframes ldFade { from { opacity: 0; } to { opacity: 1; } }
.logo-modal.closing { display: flex; animation: ldFadeOut 0.3s ease both; }
@keyframes ldFadeOut { from { opacity: 1; } to { opacity: 0; } }

.logo-decode {
  position: relative;
  width: 760px;
  height: 486px;
  margin: auto;
  flex: none;
  cursor: default;
  transform: scale(var(--decode-scale, 1));
  transform-origin: center center;
}
.logo-modal.open .logo-decode { animation: ldRise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes ldRise {
  from { opacity: 0; transform: scale(var(--decode-scale, 1)) translateY(22px); }
  to   { opacity: 1; transform: scale(var(--decode-scale, 1)) translateY(0); }
}

.ld-eyebrow {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
}

.ld-logo {
  position: absolute;
  left: 50%;
  top: 88px;
  margin: 0;
  transform: translateX(-50%);
  perspective: none;
}
.ld-logo svg { width: 140px; height: 140px; }

.ld-lines {
  position: absolute;
  inset: 0;
  width: 760px;
  height: 690px;
  pointer-events: none;
  overflow: visible;
}
.ld-lines .ld-line {
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.55;
  fill: none;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: ldDraw 0.6s ease forwards;
}
.logo-modal.open .ld-lines .ld-line { animation: ldDraw 0.6s ease 0.32s forwards; }
.ld-lines .ld-node { fill: var(--gold); }
@keyframes ldDraw { to { stroke-dashoffset: 0; } }

.ld-label {
  position: absolute;
  width: 232px;
  opacity: 0;
  animation: ldLabel 0.5s ease 0.5s forwards;
}
.ld-label.ld-frame { left: 12px; top: 56px; text-align: right; }
.ld-label.ld-kite  { left: 516px; top: 56px; text-align: left; }
.ld-label.ld-dots  { left: 230px; top: 252px; width: 300px; text-align: center; }
@keyframes ldLabel { to { opacity: 1; } }

.ld-label .ld-num {
  display: block;
  font-family: 'AmiriQuran', serif;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 7px;
}
.ld-label .ld-title {
  display: block;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink);
  margin-bottom: 6px;
}
.ld-label .ld-desc {
  display: block;
  font-size: 13.5px;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.ld-caption {
  position: absolute;
  left: 70px;
  right: 70px;
  top: 398px;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  font-style: italic;
  color: var(--ink-soft);
  text-wrap: pretty;
  opacity: 0;
  animation: ldLabel 0.5s ease 0.66s forwards;
}
.ld-caption em { color: var(--gold); font-style: italic; }

.ld-dismiss {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--ink-faint);
  opacity: 0;
  animation: ldLabel 0.6s ease 0.9s forwards;
}

body.lang-ar .ld-label .ld-desc,
body.lang-ar .ld-caption,
body.lang-ar .ld-eyebrow,
body.lang-ar .ld-dismiss {
  font-family: 'AmiriQuran', serif;
  font-style: normal;
  letter-spacing: 0;
}
body.lang-ar .ld-label.ld-frame { text-align: left; }
body.lang-ar .ld-label.ld-kite { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .logo-modal.open,
  .logo-modal.open .logo-decode,
  .ld-lines .ld-line,
  .logo-modal.open .ld-lines .ld-line,
  .ld-label, .ld-caption, .ld-dismiss { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

@media (max-width: 800px) { .logo-decode { --decode-scale: 0.72; } }
@media (max-width: 560px) { .logo-decode { --decode-scale: 0.5; } }
@media (max-width: 400px) { .logo-decode { --decode-scale: 0.42; } }

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  
  zoom: var(--inv-zoom, 1);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 10, 7, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
[data-theme="light"] .info-modal {
  background: color-mix(in srgb, var(--gold) 12%, rgba(245, 240, 232, 0.78));
}
.info-modal.open { display: flex; animation: ldFade 0.3s ease both; }
.info-modal.closing { display: flex; animation: ldFadeOut 0.28s ease both; }

.info-panel {
  position: relative;
  width: 560px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
  padding: 40px 42px 30px;
  text-align: left;
}
.info-modal.open .info-panel { animation: ldRise 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

.info-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.info-close:hover { color: var(--gold); border-color: var(--gold); }

.info-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.info-title {
  margin: 0 0 14px;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.info-lead {
  margin: 0 0 22px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
}
.info-block { margin-bottom: 20px; }
.info-h {
  margin: 0 0 8px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.info-p {
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}
.info-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.info-list li { margin-bottom: 6px; }
.info-list li::marker { color: var(--gold); }

.info-warn {
  border-left: 2px solid var(--gold);
  padding: 4px 0 4px 16px;
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  border-radius: 0 8px 8px 0;
}

.info-dismiss {
  display: block;
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-align: center;
}

@media (max-width: 560px) {
  .info-panel { padding: 34px 24px 26px; }
  .info-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .info-modal.open,
  .info-modal.open .info-panel { animation: none; opacity: 1; }
}

.screen-gate { display: none; }

@media (max-width: 820px) {
  
  body > *:not(.screen-gate) { display: none !important; }

  .screen-gate {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    padding: 40px 28px;
    background: var(--bg);
    color: var(--ink);
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
  }

  .gate-logo { line-height: 0; margin-bottom: 26px; }
  .gate-logo svg { display: block; }
  .gate-logo .lg-frame-cream { stroke: var(--ink); opacity: 0.26; }
  .gate-logo .lg-frame-gold  { stroke: var(--gold); opacity: 0.34; }
  .gate-logo .lg-cream { fill: var(--ink);  stroke: var(--ink);  fill-opacity: 0.18; }
  .gate-logo .lg-gold  { fill: var(--gold); stroke: var(--gold); fill-opacity: 0.5; }
  .gate-logo .lg-dot-cream { fill: var(--ink); }
  .gate-logo .lg-dot-gold  { fill: var(--gold); }
  .gate-logo .lg-center { fill: var(--bg); }

  .gate-eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--gold);
  }
  .gate-title {
    margin: 0 0 18px;
    font-family: 'AmiriQuran', serif;
    font-weight: 400;
    font-size: 27px;
    line-height: 1.25;
    color: var(--ink);
  }
  .gate-body {
    margin: 0 0 14px;
    max-width: 30rem;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--ink-soft);
    text-wrap: pretty;
  }
  .gate-strong { color: var(--ink); }
  .gate-ar {
    font-family: 'AmiriQuran', serif;
    font-size: 16.5px;
    line-height: 1.9;
    color: var(--ink-soft);
  }
  .gate-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 16rem;
    margin: 22px 0 18px;
    color: var(--gold);
    font-size: 11px;
    position: relative;
  }
  .gate-rule::before, .gate-rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--outline);
  }
  .gate-rule span { padding: 0 12px; opacity: 0.8; }
  .gate-foot {
    margin: 0;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    font-variant: small-caps;
  }
}

.grid-gate { display: none; }

@media (max-width: 1000px) {
  .journey .control-strip,
  .journey .overlay-hint,
  #pageGrid,
  .journey .grid-symbols,
  .journey .grid-note { display: none !important; }

  .grid-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 34rem;
    margin: 14px auto 0;
    padding: 36px 24px 10px;
  }
  .gg-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--gold);
    font-size: 12px;
    margin-bottom: 20px;
  }
  .gg-ornament span {
    display: block;
    width: 46px;
    height: 1px;
    background: var(--outline);
  }
  .gg-title {
    margin: 0 0 14px;
    font-family: 'AmiriQuran', serif;
    font-weight: 400;
    font-size: 23px;
    line-height: 1.3;
    color: var(--ink);
  }
  .gg-body {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-soft);
    text-wrap: pretty;
  }
  body.lang-ar .gg-body { font-family: 'AmiriQuran', serif; font-size: 16px; line-height: 1.9; }
}

.hero .site-sub,
.gs-text,
.gg-sub,
.section-sub {
  color: var(--ink);
}

.rc-label,
.rc-toggle {
  color: var(--ink);
}

.control-strip .pill-toggle button,
.control-strip .btn-small,
.control-strip .swatch-btn,
.control-strip .plan-chip,
.control-strip .range-group,
.control-strip .range-group input,
.control-strip .plan-group input,
.control-strip .legend-row,
.grid-note {
  color: var(--ink);
}

.reader-hints-title,
.hint-text,
.hint-key .kbd,
.hint-key .cue,
.source-credit,
.source-credit .src-ico {
  color: var(--ink);
}

.focus-toggle {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px 0 13px;
  border-radius: 21px;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--strip-shadow);
  transition: color 0.2s, border-color 0.2s, background 0.4s ease;
}
.focus-toggle svg { flex: none; }
.focus-toggle:hover { color: var(--gold); border-color: var(--gold); }
.focus-toggle[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-accent);
}
@media (max-width: 880px) {
  .focus-toggle { padding: 0; width: 42px; justify-content: center; }
  .focus-toggle .focus-label { display: none; }
}

.hero { transition: padding 0.45s ease; }
.hero .site-title { transition: font-size 0.45s ease; }
.hero-logo svg { transition: width 0.45s ease, height 0.45s ease; }
.reader { transition: padding 0.45s ease; }

body.focus-mode .journey,
body.focus-mode .closing,
body.focus-mode .site-footer,
body.focus-mode .kompakt-topbar,
body.focus-mode .hero-points,
body.focus-mode .hero .ornament,
body.focus-mode .hero .hadith-main,
body.focus-mode .hero .hadith-en,
body.focus-mode .hero .hadith-src,
body.focus-mode .hero .site-sub,
body.focus-mode .reader .taawwudh,
body.focus-mode .reader .ornament,
body.focus-mode .reader-hints,
body.focus-mode .source-credit {
  display: none !important;
}

body.focus-mode .hero { padding: 76px 24px 6px; }
body.focus-mode .hero-logo { margin-bottom: 10px; }
body.focus-mode .hero-logo svg { width: 46px !important; height: 46px !important; }
body.focus-mode .hero .site-title { font-size: 18px; margin: 0; }
body.focus-mode .hero-logo .k { animation: none !important; fill-opacity: 0.16; }

body.focus-mode .hero-logo { pointer-events: none; cursor: default; }
body.focus-mode .reader { padding-top: 16px; }
body.focus-mode .mudita-note { display: none !important; }

.mudita-note {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 560px;
  margin: 38px auto 0;
  padding: 16px 22px;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 8px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.25s ease, background 0.4s ease;
}
.mudita-note:hover { border-color: var(--gold); color: var(--ink); }
.mn-device { flex: none; display: flex; color: var(--gold); }
.mn-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mn-title {
  font-size: 12.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--gold);
}
.mn-sub { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
.mn-arrow {
  margin-left: auto;
  flex: none;
  color: var(--gold);
  font-size: 18px;
  transition: transform 0.25s ease;
}
.mudita-note:hover .mn-arrow { transform: translateX(4px); }
@media (max-width: 560px) {
  .mudita-note { margin-left: 18px; margin-right: 18px; }
}

.reader-marks {
  position: absolute;
  right: 14px;
  bottom: 16px;
  display: flex;
  gap: 6px;
  z-index: 4;
}
.rm-box {
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
}
.rm-box:hover { opacity: 0.85; transform: translateY(-1px); }
.rm-m { background: var(--mark-m); }
.rm-r { background: var(--mark-r); }
.rm-s { background: var(--mark-s); }
.rm-box.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--ink-soft);
}
body.lang-ar .reader-marks { right: auto; left: 14px; }

.bm-opt { position: relative; padding-right: 34px; }
.bm-del {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 17px;
  line-height: 1;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.bm-opt:hover .bm-del { opacity: 1; color: var(--on-accent); }
.bm-del:hover { background: color-mix(in srgb, var(--on-accent) 22%, transparent); }
@media (hover: none) {
  .bm-del { opacity: 0.6; }
  .bm-opt:hover .bm-del { color: var(--ink-faint); }
}
body.lang-ar .bm-opt { padding-right: 12px; padding-left: 34px; }
body.lang-ar .bm-del { right: auto; left: 6px; }

.kompakt-topbar {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, left 0.5s cubic-bezier(0.4, 0, 0.15, 1), transform 0.5s cubic-bezier(0.4, 0, 0.15, 1);
}
.kompakt-topbar.docked {
  left: calc(100% - 330px);
  transform: translateX(-100%);
  
  gap: 0;
  padding: 7px;
  border-color: var(--gold);
  color: var(--on-accent);
}
.kompakt-topbar:hover { color: var(--gold); border-color: var(--gold); }
.kt-device { flex: none; display: flex; color: inherit; }
.kt-body { transition: fill 0.4s, stroke 0.4s; }
.kompakt-topbar.docked .kt-device { color: var(--on-accent); }
.kompakt-topbar.docked .kt-body { fill: var(--gold); stroke: var(--gold); }
.kompakt-topbar.docked:hover { border-color: var(--gold); }
.kompakt-topbar.docked:hover .kt-body { fill: var(--gold); }
.kt-label {
  max-width: 220px;
  overflow: hidden;
  transition: max-width 0.45s cubic-bezier(0.4,0,0.15,1), opacity 0.3s;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant: small-caps;
  white-space: nowrap;
}
.kompakt-topbar.docked .kt-label { max-width: 0; opacity: 0; }
@media (max-width: 880px) {
  .kompakt-topbar { display: none; }
}

.credits {
  max-width: 660px;
  margin: 44px auto 0;
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  text-align: center;
}
.credits-title {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.credits-line {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 6px 0;
  text-wrap: pretty;
}
.credits-copy {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-faint);
  margin-top: 18px;
}
.credits a, .credits a:link, .credits a:visited {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.credits a:hover { color: var(--ink); }
