:root {
  --navy: #302319;
  --navy-soft: #5a402c;
  --blue-link: #765234;
  --cyan: #9a7450;
  --ink: #171411;
  --muted: #655b51;
  --page: #fff;
  --card: #fff;
  --line: #e6ded4;
  --soft: #f7f2eb;
  --accent: #795536;
  --accent-on: #fff;
  --paper: #fffdf9;
  --brand-rgb: 137, 101, 69;
  --bead-top: #f5e5ce;
  --bead-mid: #ae7a4d;
  --bead-low: #59391f;
  --bead-count-top: #fff0dc;
  --bead-count-mid: #93623b;
  --bead-count-low: #432a19;
  --tassel-main: #9a6b3c;
  --tassel-light: #f0dfc6;
  --tassel-shadow: #674526;
  --masthead-overlay: rgba(48, 35, 25, .9);
  --shadow: 0 3px 12px rgba(17, 24, 39, .12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --navy: #050505;
  --navy-soft: #121212;
  --blue-link: #dfbd69;
  --cyan: #d8b65e;
  --ink: #f5f3ed;
  --muted: #b7b0a4;
  --page: #0a0a0a;
  --card: #151515;
  --line: #36332c;
  --soft: #101010;
  --accent: #d8b65e;
  --accent-on: #17130a;
  --paper: #151515;
  --brand-rgb: 216, 182, 94;
  --bead-top: #fff1c3;
  --bead-mid: #c29b43;
  --bead-low: #6a4d17;
  --bead-count-top: #fff5d6;
  --bead-count-mid: #e0b84f;
  --bead-count-low: #8f6718;
  --tassel-main: #bd963f;
  --tassel-light: #fff1c3;
  --tassel-shadow: #795911;
  --masthead-overlay: rgba(0, 0, 0, .9);
  --shadow: 0 4px 16px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); font-family: Changa, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 1.75; transition: background-color .15s ease, color .15s ease; }
body.welcome-active { overflow: hidden; }
body.modal-open { overflow: hidden; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--blue-link); }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 50; top: -60px; right: 14px; background: var(--navy); color: white; padding: 8px 14px; border-radius: 4px; }
.skip-link:focus { top: 10px; }

/* Welcome screen: a calm, short entrance, with reduced-motion support. */
.welcome-screen { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); color: #fff; background: radial-gradient(ellipse at 50% 38%, rgba(var(--brand-rgb), .42), transparent 52%), linear-gradient(145deg, var(--navy), var(--navy-soft) 68%, #050505); }
.welcome-card { width: min(100%, 540px); padding: clamp(25px, 6vw, 48px); border: 1px solid rgba(var(--brand-rgb), .34); border-radius: 18px; background: rgba(255,255,255,.055); box-shadow: 0 24px 80px rgba(0,0,0,.32); text-align: center; animation: welcome-card-in .65s ease-out both; }
.welcome-mark { position: relative; width: clamp(148px, 38vw, 224px); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto 14px; }
.welcome-mark::before { position: absolute; inset: 4%; border: 1px solid rgba(var(--brand-rgb), .48); border-radius: 50%; content: ""; box-shadow: 0 0 38px rgba(var(--brand-rgb), .18), inset 0 0 30px rgba(var(--brand-rgb), .12); animation: welcome-orbit 16s linear infinite; }
.welcome-mark::after { position: absolute; inset: 13%; border: 1px dashed rgba(var(--brand-rgb), .64); border-radius: 50%; content: ""; animation: welcome-orbit 25s linear infinite reverse; }
.welcome-logo { position: relative; z-index: 1; width: 75%; max-height: 68px; object-fit: contain; animation: welcome-logo-in .9s cubic-bezier(.2,.75,.25,1) both; }
.welcome-kicker { margin: 0 0 2px; color: var(--cyan); font-size: 12px; }
.welcome-card h1 { margin: 0; color: #fff; font-size: clamp(31px, 7vw, 42px); font-weight: 600; line-height: 1.4; }
.welcome-card h2 { margin: 18px 0 6px; color: var(--accent); font-size: 16px; font-weight: 500; }
.welcome-card > p:not(.welcome-kicker) { max-width: 420px; margin: 0 auto; color: rgba(255,255,255,.88); font-size: 14px; line-height: 2; }
.welcome-continue { min-width: 170px; min-height: 49px; margin: 23px auto 14px; padding: 9px 25px; border: 1px solid rgba(255,255,255,.27); border-radius: 999px; color: var(--accent-on); background: linear-gradient(110deg, var(--cyan), var(--accent)); font-size: 15px; font-weight: 700; box-shadow: 0 8px 24px rgba(var(--brand-rgb), .24); transition: transform .18s ease, box-shadow .18s ease; }
.welcome-continue:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(var(--brand-rgb), .3); }
.welcome-card small { display: block; color: rgba(255,255,255,.64); font-size: 10px; }
.welcome-screen.is-leaving { animation: welcome-dismiss .38s ease-in both; }
@keyframes welcome-card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes welcome-logo-in { from { opacity: 0; transform: scale(.83); } to { opacity: 1; transform: scale(1); } }
@keyframes welcome-orbit { to { transform: rotate(360deg); } }
@keyframes welcome-dismiss { to { opacity: 0; visibility: hidden; } }

.site-header { color: #fff; background: var(--navy); }
.topline { width: min(100% - 44px, 1140px); min-height: 56px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 17px; border-bottom: 1px solid rgba(255,255,255,.14); }
.site-brand { flex: 0 0 156px; display: inline-flex; align-items: center; }
.site-brand img { display: block; width: 148px; max-height: 41px; object-fit: contain; }
.main-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.65vw, 23px); white-space: nowrap; }
.main-nav a { color: rgba(255,255,255,.9); font-size: 11px; line-height: 1.4; text-decoration: none; transition: color .14s ease; }
.main-nav a:hover { color: var(--cyan); }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.theme-button, .top-share-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(255,255,255,.24); color: #fff; background: transparent; border-radius: 5px; }
.theme-button { width: 40px; font-size: 17px; color: var(--accent); }
.top-share-button { padding: 6px 11px; font-size: 11px; line-height: 1.3; border-color: rgba(var(--brand-rgb), .65); color: #fff; transition: background .15s ease, border-color .15s ease; }
.top-share-button span:first-child { color: var(--cyan); font-size: 15px; }
.top-share-button:hover { background: rgba(var(--brand-rgb), .2); border-color: var(--cyan); }
.masthead { position: relative; min-height: 132px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px 20px 19px; text-align: center; background: var(--navy) url('./reference/header-bg.png') center 39% / cover no-repeat; }
.masthead:before { position: absolute; inset: 0; background: var(--masthead-overlay); content: ""; }
.masthead h1, .masthead p { position: relative; z-index: 1; margin: 0; }
.masthead h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.masthead p { color: rgba(255,255,255,.9); font-size: 13px; line-height: 1.5; }
.masthead-ornament { position: absolute; top: 6px; color: rgba(255,255,255,.07); font-family: serif; font-size: 125px; line-height: 1; }
.masthead-ornament-right { right: 4%; transform: rotate(-24deg); }
.masthead-ornament-left { left: 5%; transform: rotate(17deg); }

main { width: min(100% - 36px, 920px); margin: 0 auto; }
.intro { padding: 17px 0 12px; text-align: center; }
.iqraa-art { display: block; width: min(585px, 88%); height: auto; margin: 0 auto 2px; }
.intro h2 { margin: 0 0 17px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.intro h2 a { color: var(--blue-link); text-decoration: none; }
.intro h2 a:hover { text-decoration: underline; }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 0 auto 11px; }
.quick-links a { min-height: 44px; display: grid; place-items: center; padding: 7px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); font-size: 11px; font-weight: 600; text-decoration: none; transition: color .14s ease, transform .14s ease; }
.quick-links a:hover { color: var(--blue-link); transform: translateY(-1px); }
.intro-copy { max-width: 800px; margin: 0 auto 12px; }
.intro-copy h3 { margin: 5px 0; font-size: 13px; font-weight: 500; }
.intro-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.search-box { width: min(420px, 100%); min-height: 44px; display: flex; align-items: center; gap: 7px; margin: 11px auto 5px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); }
.search-box span { font-size: 22px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; padding: 7px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box:focus-within { border-color: var(--blue-link); }

.index-section { padding: 9px 0 24px; }
.section-title { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 7px 0 0; }
.section-title h2 { margin: 0; font-size: 19px; font-weight: 600; }
.section-mark { color: var(--accent); font-size: 16px; }
.index-caption { margin: 1px 0 13px; color: var(--muted); font-size: 11px; text-align: center; }
.index-caption span { color: var(--blue-link); }
.surah-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 5px; }
.surah-card { min-height: 48px; display: flex; flex-direction: column; justify-content: center; padding: 7px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer; transition: border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.surah-card:hover, .surah-card:focus { border-color: var(--cyan); color: var(--blue-link); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(17,24,39,.15); }
.surah-card small { color: var(--muted); font-size: 10px; font-weight: 400; }
.no-results { padding: 20px; color: var(--muted); text-align: center; font-size: 12px; }
.loading { grid-column: 1 / -1; color: var(--muted); text-align: center; }

.reader-section { margin: 28px 0 26px; padding: 22px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.reader-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.reader-heading h2 { margin: 0; color: var(--ink); font-family: "Amiri Quran", serif; font-size: 29px; font-weight: 400; }
.reader-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.reader-kicker { color: var(--blue-link) !important; }
.reader-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.reader-close, .summary-open { min-height: 44px; flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--card); font-size: 11px; }
.reader-close:hover, .summary-open:hover { border-color: var(--blue-link); color: var(--blue-link); }
.summary-open { border-color: rgba(var(--brand-rgb),.6); color: var(--blue-link); background: rgba(var(--brand-rgb),.08); font-weight: 600; }
.shared-note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; padding: 10px 12px; border-right: 3px solid var(--cyan); background: rgba(var(--brand-rgb),.12); font-size: 12px; }
.shared-note strong { color: var(--blue-link); }
.ayah-flow { margin: 17px 0; padding: clamp(15px, 3vw, 29px); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); direction: rtl; text-align: justify; text-justify: inter-word; font-family: "Amiri Quran", "Traditional Arabic", serif; font-size: clamp(24px, 3.45vw, 35px); line-height: 2.25; overflow-wrap: break-word; word-break: normal; }
.ayah-inline { display: inline; border-radius: 3px; }
.ayah-inline.is-highlighted { background: rgba(var(--brand-rgb),.19); }
.ayah-text { font-family: inherit; }
.ayah-mark { white-space: nowrap; color: var(--blue-link); font-size: .68em; }
.summary-panel, .tafsir-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); overflow: hidden; }
.summary-panel > summary, .tafsir-panel > summary { min-height: 50px; padding: 12px 17px; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.summary-panel[open] > summary, .tafsir-panel[open] > summary { border-bottom: 1px solid var(--line); }
.summary-body, .tafsir-body { padding: 13px 17px 17px; }
.summary-intro, .tafsir-intro { margin: 0 0 9px; color: var(--muted); font-size: 12px; }
.panel-status { min-height: 22px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.summary-content { margin-top: 12px; }
.summary-card { padding: 16px; border-right: 3px solid var(--cyan); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); }
.summary-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.summary-facts span { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--blue-link); background: var(--soft); font-size: 11px; }
.summary-card h4 { margin: 3px 0 5px; font-size: 14px; }
.summary-copy { margin: 0; color: var(--ink); font-size: 14px; line-height: 2; white-space: pre-wrap; }
.summary-more { min-height: 38px; margin-top: 8px; padding: 4px 8px; border: 0; color: var(--blue-link); background: transparent; font-size: 12px; text-decoration: underline; }
.summary-disclaimer { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.tafsir-content { margin-top: 14px; }
.tafsir-ayah { padding: 11px 0; border-bottom: 1px solid var(--line); }
.tafsir-ayah:last-child { border-bottom: 0; }
.tafsir-ayah h4 { margin: 0 0 4px; color: var(--blue-link); font-size: 13px; }
.tafsir-ayah p { margin: 0; color: var(--ink); font-size: 14px; line-height: 2; }
.source-note { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.source-note a { color: var(--blue-link); }
.service-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 30px; padding: 12px 0 23px; border-top: 1px solid var(--line); }
.service-strip a { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-height: 59px; color: var(--muted); font-size: 11px; text-decoration: none; text-align: center; }
.service-strip a span { color: var(--blue-link); font-size: 19px; }
.service-strip a:hover { color: var(--blue-link); }

footer { padding: 17px 15px 27px; border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); text-align: center; }
.footer-rule { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 8px; color: var(--accent); }
.footer-rule:before, .footer-rule:after { width: 38px; height: 1px; content: ""; background: var(--line); }
footer p { margin: 0; font-size: 12px; }
footer strong { color: var(--ink); }
footer small { display: block; margin-top: 5px; font-size: 10px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 15px; overflow-y: auto; background: rgba(2, 5, 24, .58); }
.share-dialog { width: min(100%, 510px); max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px); overflow-y: auto; padding: 23px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); box-shadow: 0 18px 60px rgba(0,0,0,.27); }
.share-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.dialog-kicker { color: var(--blue-link); font-size: 11px; }
.share-dialog-head h2 { margin: 2px 0 5px; font-size: 20px; }
.share-dialog-head p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 24px; line-height: 1; }
.field-label { display: block; margin: 8px 0 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.select-field { display: block; width: 100%; min-height: 46px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 4px; outline: none; color: var(--ink); background: var(--card); font-size: 14px; }
.select-field:focus { border-color: var(--blue-link); box-shadow: 0 0 0 2px rgba(var(--brand-rgb),.18); }
.select-field:disabled { cursor: wait; opacity: .72; }
.range-fields { display: grid; grid-template-columns: 1fr 20px 1fr auto; gap: 9px; align-items: end; margin-top: 14px; }
.field-group { min-width: 0; }
.range-separator { padding-bottom: 8px; color: var(--muted); text-align: center; }
.create-link, .copy-row button { min-height: 46px; padding: 8px 17px; border: 0; border-radius: 4px; color: var(--accent-on); background: var(--accent); font-size: 13px; font-weight: 600; transition: filter .15s ease; }
.create-link:hover, .copy-row button:hover { filter: brightness(.92); }
.form-error { margin: 10px 0 0; color: #b13d3d; font-size: 12px; }
.share-result { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.share-result > strong { display: block; margin-bottom: 8px; color: var(--blue-link); font-size: 13px; }
.copy-row { display: flex; gap: 7px; }
.copy-row input { width: 100%; min-width: 0; min-height: 44px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--soft); font-family: ui-monospace, monospace; font-size: 11px; }
.copy-row button { flex: 0 0 auto; }
.native-share { min-height: 42px; margin-top: 9px; padding: 5px 2px; border: 0; border-bottom: 1px solid var(--blue-link); color: var(--blue-link); background: none; font-size: 12px; }
.copy-feedback { min-height: 20px; margin: 6px 0 0; color: var(--blue-link); font-size: 11px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 800px) {
  .topline { width: min(100% - 28px, 720px); min-height: 56px; gap: 10px; }
  .site-brand { flex-basis: 125px; }
  .site-brand img { width: 122px; }
  .main-nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 14px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { font-size: 11px; }
  main { width: min(100% - 28px, 720px); }
  .masthead { min-height: 116px; }
  .surah-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .topline { width: calc(100% - 22px); min-height: 56px; gap: 8px; }
  .site-brand { flex-basis: auto; }
  .site-brand img { width: 104px; }
  .main-nav { display: none; }
  .header-actions { margin-right: auto; gap: 6px; }
  .top-share-button { padding: 6px 9px; font-size: 11px; }
  .masthead { min-height: 106px; background-position: center 38%; }
  .masthead h1 { font-size: 26px; }
  .masthead p { font-size: 12px; }
  main { width: calc(100% - 22px); }
  .intro { padding-top: 13px; }
  .iqraa-art { width: min(430px, 96%); }
  .intro h2 { margin-bottom: 12px; font-size: 16px; }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .quick-links a { min-height: 44px; }
  .intro-copy p { font-size: 12px; }
  .surah-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
  .surah-card { min-height: 48px; padding: 7px 5px; font-size: 12px; }
  .section-title h2 { font-size: 18px; }
  .reader-section { margin-top: 18px; padding: 14px 11px; }
  .reader-heading { align-items: flex-start; gap: 9px; }
  .reader-heading h2 { font-size: 25px; }
  .reader-actions { flex-direction: column; }
  .reader-close, .summary-open { max-width: 100%; padding: 6px 8px; font-size: 11px; }
  .ayah-flow { margin: 13px 0; padding: 14px 10px; font-size: clamp(24px, 6.3vw, 31px); line-height: 2.2; }
  .summary-body, .tafsir-body { padding: 12px 11px 15px; }
  .summary-card { padding: 12px; }
  .service-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-dialog { padding: 18px 14px; }
  .range-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
  .range-separator { display: none; }
  .create-link { grid-column: 1 / -1; width: 100%; }
  .copy-row { flex-direction: column; }
  .copy-row button { width: 100%; }
}
@media (max-width: 370px) {
  .topline { width: calc(100% - 16px); }
  .site-brand img { width: 88px; }
  .top-share-button { padding: 5px 7px; }
  .header-actions { gap: 5px; }
  main { width: calc(100% - 18px); }
  .reader-section { padding: 12px 8px; }
  .reader-close, .summary-open { font-size: 10px; }
  .ayah-flow { padding: 12px 8px; font-size: 24px; }
  .welcome-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


/* Daily adhkar and on-device tasbeeh counter. */
.adhkar-section { margin: 17px 0 27px; padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.adhkar-heading { display: flex; align-items: center; justify-content: center; gap: 11px; margin: 0 0 14px; text-align: right; }
.adhkar-mark { color: var(--accent); font-size: 23px; }
.adhkar-heading h2 { margin: 0; font-size: 19px; font-weight: 600; }
.adhkar-heading p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.adhkar-heading .adhkar-kicker { color: var(--blue-link); font-size: 10px; }
.adhkar-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr); align-items: start; gap: 11px; }
.adhkar-list { display: flex; flex-direction: column; gap: 8px; }
.dhikr-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); transition: border-color .15s ease, box-shadow .15s ease; }
.dhikr-card.is-selected { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(var(--brand-rgb),.12); }
.dhikr-card-content { min-width: 0; }
.dhikr-card h3 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.dhikr-text { margin: 2px 0; color: var(--ink); font-family: "Amiri Quran", "Traditional Arabic", serif; font-size: 19px; line-height: 1.85; overflow-wrap: anywhere; }
.dhikr-goal { margin: 2px 0; color: var(--muted); font-size: 10px; }
.dhikr-source { display: inline-block; color: var(--blue-link); font-size: 10px; text-decoration: underline; text-underline-offset: 2px; }
.choose-dhikr { min-width: 102px; min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--blue-link); background: var(--soft); font-size: 10px; font-weight: 600; }
.choose-dhikr.is-selected { border-color: var(--cyan); color: var(--accent-on); background: var(--accent); }
.adhkar-section .panel-status { margin-top: 7px; font-size: 10px; }
.adhkar-loading { margin: 8px 0; color: var(--muted); text-align: center; font-size: 12px; }
.tasbeeh-counter { position: sticky; top: 12px; padding: 16px; border: 1px solid rgba(var(--brand-rgb),.48); border-radius: 5px; background: var(--card); box-shadow: var(--shadow); text-align: center; }
.counter-eyebrow { margin: 0; color: var(--blue-link); font-size: 10px; }
.tasbeeh-counter h3 { margin: 2px 0; font-size: 16px; font-weight: 600; }
.counter-phrase { min-height: 34px; margin: 2px 0 0; color: var(--ink); font-family: "Amiri Quran", "Traditional Arabic", serif; font-size: 18px; line-height: 1.8; }
.counter-target { margin: 5px 0 10px; color: var(--muted); font-size: 10px; }
.counter-display { display: flex; justify-content: center; align-items: center; gap: 8px; }
.counter-count { min-width: 76px; color: var(--ink); font-family: "Amiri Quran", serif; font-size: 41px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.counter-primary, .counter-secondary, .counter-reset { min-height: 42px; padding: 7px 12px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.counter-primary { border: 1px solid var(--accent); color: var(--accent-on); background: var(--accent); }
.counter-primary:hover { filter: brightness(.92); }
.counter-secondary { border: 1px solid var(--line); color: var(--muted); background: var(--soft); }
.counter-primary:disabled, .counter-secondary:disabled, .counter-reset:disabled { cursor: not-allowed; opacity: .55; }
.counter-track { height: 7px; margin: 11px 0 6px; overflow: hidden; border-radius: 999px; background: var(--line); }
.counter-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--accent)); transition: width .2s ease; }
.counter-status { min-height: 22px; margin: 4px 0; color: var(--muted); font-size: 10px; }
.counter-reset { min-height: 36px; margin: 2px auto 5px; border: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 10px; }
.tasbeeh-counter small { display: block; color: var(--muted); font-size: 9px; line-height: 1.6; }

@media (max-width: 800px) {
  .adhkar-layout { grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr); }
  .tasbeeh-counter { position: static; }
}
@media (max-width: 560px) {
  .adhkar-section { margin-top: 12px; padding: 13px 10px; }
  .adhkar-heading { justify-content: flex-start; gap: 8px; }
  .adhkar-heading h2 { font-size: 17px; }
  .adhkar-heading p { font-size: 10px; }
  .adhkar-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dhikr-card { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 10px 8px; }
  .choose-dhikr { min-width: 89px; padding: 6px; font-size: 9px; }
  .tasbeeh-counter { padding: 13px 10px; }
  .counter-display { gap: 5px; }
  .counter-count { min-width: 60px; font-size: 36px; }
  .counter-primary, .counter-secondary { padding: 6px 9px; }
}
@media (max-width: 370px) {
  .adhkar-section { padding: 11px 8px; }
  .dhikr-card { grid-template-columns: minmax(0, 1fr); }
  .choose-dhikr { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .counter-track span { transition: none; }
}


/* Distinct devotional and Quran sections. */
.page-section { margin: 21px 0 28px; padding-top: 11px; border-top: 1px solid var(--line); }
.division-heading { display: flex; justify-content: center; align-items: center; gap: 13px; margin: 0 0 14px; text-align: center; }
.division-heading h2 { margin: 0; font-size: 21px; font-weight: 600; }
.division-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.division-heading .division-kicker { color: var(--blue-link); font-size: 10px; }
.subsection { margin: 18px 0 23px; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.subsection-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.subsection-heading h3 { margin: 0; font-size: 16px; font-weight: 600; }
.subsection-heading p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.subsection-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border: 1px solid rgba(var(--brand-rgb),.42); border-radius: 50%; color: var(--blue-link); background: rgba(var(--brand-rgb),.08); }
.adhkar-list, .dua-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
.dhikr-card, .dua-card { min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); }
.dhikr-card h3, .dua-card h3 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.dhikr-text, .dua-text { margin: 3px 0; color: var(--ink); font-family: "Amiri Quran", "Traditional Arabic", serif; font-size: 18px; line-height: 1.9; overflow-wrap: anywhere; }
.dhikr-goal, .dua-context { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.dhikr-source, .dua-source, .counter-reference { display: inline-block; width: fit-content; margin-top: auto; padding-top: 5px; color: var(--blue-link); font-size: 10px; text-decoration: underline; text-underline-offset: 2px; }
.dua-references { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; }
.dua-references .dua-source { margin-top: 0; }
.adhkar-section, .dua-section, .tasbeeh-section { margin-top: 12px; }
.tasbeeh-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: 14px; margin-top: 12px; }
.tasbeeh-board, .tasbeeh-controls { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); box-shadow: var(--shadow); }
.bead-ring { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; border: 1px solid rgba(var(--brand-rgb),.45); border-radius: 50%; background: radial-gradient(circle, var(--soft) 1%, var(--card) 72%); touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; }
.bead-ring:active { cursor: grabbing; }
.bead-ring::before { position: absolute; inset: 10%; border: 1px dashed rgba(var(--brand-rgb),.36); border-radius: 50%; content: ""; pointer-events: none; }
.bead-ring::after { position: absolute; top: 3%; left: 50%; width: 17px; height: 28px; border: 1px solid rgba(var(--brand-rgb),.58); border-radius: 7px 7px 10px 10px; background: linear-gradient(135deg, var(--tassel-main), var(--tassel-light) 55%, var(--tassel-shadow)); content: ""; transform: translateX(-50%); z-index: 3; pointer-events: none; }
.bead-wheel { position: absolute; inset: 0; z-index: 2; border-radius: 50%; transform: rotate(0deg); transform-origin: center; touch-action: none; will-change: transform; }
.bead-center { position: absolute; inset: 29%; z-index: 4; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); text-align: center; }
.bead-center .counter-eyebrow { margin: 0; color: var(--blue-link); font-size: 9px; }
.bead-center h4 { max-width: 100%; margin: 0; color: var(--ink); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.counter-count { display: block; min-width: 0; color: var(--ink); font-family: "Amiri Quran", serif; font-size: clamp(28px, 5vw, 40px); font-variant-numeric: tabular-nums; line-height: 1.25; }
.bead-cycle-status { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.3; }
.tasbeeh-bead { position: absolute; z-index: 1; width: 34px; min-width: 34px; height: 34px; min-height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.tasbeeh-bead::before { width: 17px; height: 17px; border: 1px solid rgba(var(--brand-rgb),.72); border-radius: 50%; background: radial-gradient(circle at 33% 29%, var(--bead-top), var(--bead-mid) 53%, var(--bead-low) 100%); box-shadow: 0 2px 4px rgba(0,0,0,.25); content: ""; transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
.tasbeeh-bead.is-counted::before { background: radial-gradient(circle at 33% 29%, var(--bead-count-top), var(--bead-count-mid) 59%, var(--bead-count-low)); }
.tasbeeh-bead.is-next { z-index: 4; }
.tasbeeh-bead.is-next::before { transform: scale(1.24); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.21), 0 2px 7px rgba(0,0,0,.3); }
.tasbeeh-bead:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bead-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.tasbeeh-controls { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.counter-phrase { margin: 0 0 8px; color: var(--ink); font-family: "Amiri Quran", "Traditional Arabic", serif; font-size: 22px; line-height: 2; }
.counter-target { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.counter-track { width: 100%; height: 8px; margin: 4px 0 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.tasbeeh-controls .counter-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--accent)); transition: width .2s ease; }
.counter-status { min-height: 24px; margin: 5px 0; color: var(--muted); font-size: 10px; }
.counter-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 7px 0; }
.counter-secondary, .counter-reset { min-height: 42px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--soft); font-size: 11px; font-weight: 600; }
.counter-secondary:disabled, .counter-reset:disabled { cursor: not-allowed; opacity: .55; }
.counter-reference { margin-top: 4px; }
.tasbeeh-controls small { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.7; }

@media (max-width: 800px) {
  .adhkar-list, .dua-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tasbeeh-layout { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 9px; }
  .tasbeeh-board, .tasbeeh-controls { padding: 10px; }
}
@media (max-width: 560px) {
  .page-section { margin-top: 15px; padding-top: 9px; }
  .division-heading { gap: 8px; }
  .division-heading h2 { font-size: 18px; }
  .subsection { margin: 12px 0; padding: 11px 9px; }
  .subsection-heading h3 { font-size: 14px; }
  .adhkar-list, .dua-list { grid-template-columns: minmax(0, 1fr); }
  .tasbeeh-layout { grid-template-columns: minmax(0, 1fr); }
  .tasbeeh-board { padding: 12px 8px; }
  .bead-ring { width: min(100%, 340px); }
  .tasbeeh-controls { padding: 13px; }
}
@media (max-width: 370px) {
  .division-heading h2 { font-size: 16px; }
  .bead-ring { width: min(100%, 306px); }
  .counter-phrase { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .tasbeeh-bead::before, .counter-track span { transition: none; }
}


/* Keep the five top-level shortcuts balanced at each breakpoint. */
.quick-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 800px) { .quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
