@font-face { font-family: "Amiri"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/amiri-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFC,U+200C-200E; }
@font-face { font-family: "Amiri"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/amiri-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFC,U+200C-200E; }
@font-face { font-family: "Amiri"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/amiri-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F; }
@font-face { font-family: "Amiri"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/amiri-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F; }
@font-face { font-family: "KFGQPC Hafs"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/kfgqpc-hafs-18.woff2") format("woff2"); }
@font-face { font-family: "Aref Ruqaa"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/aref-ruqaa-arabic-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); }
/* تخطيط: عمود قراءة واحد بعرض مريح، شريط علوي ثابت، وألواح سفلية للإعدادات */
:root {
  --paper: #F3F5EE;
  --surface: #FFFFFF;
  --ink: #17251F;
  --muted: #5C6B63;
  --line: #D6DCCF;
  --accent: #0E5E4A;
  --accent-ink: #FFFFFF;
  --gold: #946F1E;
  --mark: #F3E2A6;
  --cover: #0E4B3C;
  --cover-ink: #F3F5EE;
  --cover-gold: #D9B45B;
  --font-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  --font-display: "Aref Ruqaa", "Amiri", serif;
  --read-size: 21px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1714; --surface: #18231F; --ink: #E6EBE3; --muted: #9AA89F; --line: #2B3A33;
    --accent: #5FC2A4; --accent-ink: #0B1512; --gold: #D9B45B; --mark: #5A4A14;
    --cover: #0B3A2F; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1714; --surface: #18231F; --ink: #E6EBE3; --muted: #9AA89F; --line: #2B3A33;
  --accent: #5FC2A4; --accent-ink: #0B1512; --gold: #D9B45B; --mark: #5A4A14;
  --cover: #0B3A2F; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.7; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.loading, .empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }

/* الشريط العلوي */
.bar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 720px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 8px; min-height: 56px; }
.bar h1 { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-family: var(--font-text); font-size: 30px; line-height: 1.3; font-weight: 700; color: var(--accent); flex: 1; }
.ib { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.ib:hover { border-color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; flex: none; }
.brand .r { color: var(--gold); }
.brand .bn { display: flex; flex-direction: column; line-height: 1; }
.brand small { font-family: var(--font-text); font-size: 11px; font-weight: 700; letter-spacing: .28em; text-align: center; margin-top: 2px; }
.tag { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; }

/* الرئيسية */
.sec { margin-top: 28px; display: grid; gap: 12px; }
.sec > h2 { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.gem { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); border-radius: 8px; padding: 16px 18px; text-align: start; display: grid; gap: 8px; width: 100%; }
.gem q { font-family: var(--font-text); font-size: 22px; line-height: 1.9; quotes: "«" "»"; }
.gem small { color: var(--muted); font-size: 13px; }
.resume { display: flex; align-items: center; gap: 12px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 14px 18px; width: 100%; text-align: start; }
.resume b { display: block; font-weight: 600; }
.resume span { font-size: 13px; opacity: .85; }
.resume .go { margin-inline-start: auto; font-size: 20px; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.book { text-decoration: none; color: inherit; display: grid; gap: 8px; }
.cover { aspect-ratio: 3 / 4; background: var(--cover); color: var(--cover-ink); border-radius: 4px 10px 10px 4px; padding: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; border-inline-start: 6px solid var(--cover-gold); position: relative; }
.cover::after { content: ""; position: absolute; inset: 8px; border: 1px solid var(--cover-gold); opacity: .55; border-radius: 2px 6px 6px 2px; pointer-events: none; }
.cover { padding-bottom: 52px; }
.cover .cb { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; direction: rtl; white-space: nowrap; }
.cover .cb img { width: 24px; height: 24px; flex: none; }
.cover .cn { display: flex; flex-direction: column; align-items: center; line-height: 1; color: var(--cover-ink); }
.cover .cn > span:first-child { font-family: var(--font-text); font-weight: 700; font-size: 15px; line-height: 1.2; }
.cover .cn .en { font-family: var(--font-text); font-weight: 700; font-size: 7px; letter-spacing: .25em; margin-top: 1px; direction: ltr; }
.cover .cn i { font-style: normal; color: var(--cover-gold); }
.hero .cover { padding-bottom: 46px; }
.hero .cover .cb { bottom: 12px; gap: 4px; }
.hero .cover .cb img { width: 16px; height: 16px; }
.hero .cover .cn > span:first-child { font-size: 11px; }
.hero .cover .cn .en { font-size: 5px; }
.cover b { font-family: var(--font-display); font-size: 22px; line-height: 1.5; font-weight: 700; }
.cover small { font-size: 12px; color: var(--cover-gold); }
.book .t { font-weight: 600; font-size: 15px; line-height: 1.5; }
.book .a { font-size: 13px; color: var(--muted); }
.soon { margin-top: 14px; border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--line)); border-radius: 12px; text-align: center; color: var(--muted); padding: 14px 16px; background: color-mix(in srgb, var(--gold) 5%, transparent); }
.soon b { display: block; color: var(--ink, inherit); font-size: 16px; margin-bottom: 2px; }
.soon p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
.soon .btn { font-size: 14px; }
.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: grid; gap: 10px; }
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 10px 18px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: .6; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* صفحة الكتاب */
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 18px; margin-top: 24px; align-items: start; }
.hero .cover b { font-size: 17px; }
.hero h2 { font-family: var(--font-display); font-size: 28px; line-height: 1.5; }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.toc { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.toc li + li { border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; text-decoration: none; color: inherit; }
.toc b { font-weight: 600; }
.toc span { grid-column: 1; font-size: 13px; color: var(--muted); }
.toc em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* القارئ */
.reader { max-width: 660px; margin: 0 auto; padding: 24px 20px 40px; font-family: var(--font-text); font-size: var(--read-size); line-height: 2.05; }
.reader header { text-align: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.reader header h2 { font-family: var(--font-display); font-size: 1.7em; color: var(--accent); line-height: 1.6; }
.reader header p { margin: 6px 0 0; font-size: 1.05em; font-weight: 700; line-height: 1.8; }
.reader .blk { margin: 0 0 1.1em; text-align: justify; scroll-margin-top: 76px; }
.reader .ayah { color: var(--accent); font-weight: 700; }
.reader .ref { font-family: var(--font-ui); font-size: .6em; color: var(--muted); white-space: nowrap; }
.reader .q { font-weight: 700; }
.reader .pg { font-family: var(--font-ui); font-size: .52em; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin: 0 4px; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; }
.reader.nopg .pg { display: none; }
.reader mark, .hit mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
.reader .more { border: 0; background: none; color: var(--gold); font-family: var(--font-ui); font-size: .8em; font-weight: 700; padding: 0 10px; min-height: 36px; min-width: 36px; vertical-align: middle; cursor: pointer; }
.reader p.blk { cursor: pointer; }
.reader .blk.saved { border-inline-start: 3px solid var(--gold); padding-inline-start: 12px; }
.nav { max-width: 660px; margin: 0 auto; padding: 0 20px 48px; display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-ui); }

/* البحث والمحفوظات */
.search { display: flex; gap: 8px; margin-top: 20px; }
.search input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; background: var(--surface); }
.count { color: var(--muted); font-size: 13px; margin: 14px 0 6px; }
.hits { display: grid; gap: 10px; }
.hit { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; text-align: start; width: 100%; display: grid; gap: 4px; }
.hit p { margin: 0; font-family: var(--font-text); font-size: 19px; line-height: 1.9; }
.hit small { color: var(--muted); font-size: 12px; }
.hit-row { display: flex; gap: 8px; align-items: stretch; }
.hit-row .hit { flex: 1; }
.mk-n { flex: none; align-self: center; min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.mk-new { color: var(--gold); font-weight: 600; }

/* الألواح */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden], .selbar[hidden], .toast[hidden] { display: none; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.sheet-body { position: relative; background: var(--surface); color: var(--ink); width: 100%; max-width: 560px; max-height: 88%; overflow: auto; border-radius: 14px 14px 0 0; padding: 20px 18px 24px; display: grid; gap: 14px; }
.sheet-body h3 { font-size: 16px; font-weight: 600; }
.sheet-body .list { display: grid; gap: 8px; }
.sheet-body .list .sheet-link { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 48px; text-decoration: none; color: var(--ink); }
.sheet-body .list button { text-align: start; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 12px 14px; min-height: 48px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 10px 4px; min-height: 44px; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.card-img { width: 100%; max-width: 320px; margin: 0 auto; border-radius: 8px; display: block; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.selbar { position: fixed; z-index: 15; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; background: var(--ink); border-radius: 999px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.selbar button { border: 0; background: transparent; color: var(--paper); padding: 10px 18px; min-height: 44px; font-size: 14px; font-weight: 500; }
.selbar button + button { border-inline-start: 1px solid rgba(128, 128, 128, .5); }
.toast { position: fixed; z-index: 30; bottom: 76px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 8px; font-size: 14px; max-width: 90%; text-align: center; }
@media (max-width: 420px) {
  .hero { grid-template-columns: 96px 1fr; gap: 14px; }
  .hero h2 { font-size: 23px; }
  .reader { padding-inline: 16px; }
}

.fihris summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.fihris summary::-webkit-details-marker { display: none; }
.fihris summary h2 { display: inline; }
.fihris summary h2::after { content: ' ▾'; color: var(--muted); font-size: .8em; }
.fihris[open] summary h2::after { content: ' ▴'; }
.fihris summary small { color: var(--muted); font-size: 12px; }
.fihris ol { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.fihris li + li { border-top: 1px solid var(--line); }
.fihris li > a, .fihris li > span { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; text-decoration: none; color: inherit; }
.fihris li b { font-weight: 600; font-size: 15px; }
.fihris li span span { grid-column: 1; font-size: 13px; color: var(--muted); }
.fihris li a > span { grid-column: 1; font-size: 13px; color: var(--muted); }
.fihris li em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.fihris li i { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; justify-self: start; }
.fihris li.sub > a, .fihris li.sub > span { padding-inline-start: 30px; }
.fihris li.sub b { font-weight: 400; font-size: 14px; }
.fihris li.off { opacity: .55; }
.fihris li a b { color: var(--accent); }

.reader .blk.bayt { position: relative; margin: 0 0 14px; padding-inline-end: 22px; line-height: 1.9; }
.reader .blk.bayt .more { position: absolute; inset-inline-end: -6px; bottom: 0; }
.reader .blk.bayt > span { display: block; text-align: start; }
.reader .blk.bayt > span + span { text-align: end; }
@media (min-width: 640px) { .reader .blk.bayt { display: grid; grid-template-columns: 1fr 1fr auto; gap: 24px; } .reader .blk.bayt > span + span { text-align: start; } }

.reader h3.fasl { font-size: 1.05em; color: var(--gold); margin: 1.6em 0 .7em; text-align: center; font-weight: 700; }
/* إحصائياتي */
.mystats { display: flex; align-items: center; gap: 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; color: inherit; }
.mystats span { display: grid; }
.mystats b { font-weight: 600; }
.mystats small { font-size: 12px; color: var(--muted); }
.mystats .go { margin-inline-start: auto; font-size: 13px; color: var(--accent); font-weight: 600; }
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.scard { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 14px; display: grid; gap: 4px; }
.scard b { font-size: 20px; font-weight: 700; }
.scard small { font-size: 12px; color: var(--muted); }
.sbook { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 14px 16px; display: grid; gap: 10px; }
.sbook > a { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.sbook > a b { font-weight: 600; }
.sbook > a span { color: var(--accent); font-weight: 600; white-space: nowrap; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.sbook dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.sbook dt { font-size: 12px; color: var(--muted); }
.sbook dd { margin: 0; font-weight: 600; }
.vcount { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
/* القرآن الكريم */
.qcard { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 18px 20px; border-radius: 10px; text-decoration: none; color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); position: relative; }
.qcard .qc-t { font-family: "KFGQPC Hafs", var(--font-text); font-size: 26px; line-height: 1.5; width: 100%; }
.qcard .qc-s { font-size: 14px; opacity: .9; flex: 1; }
.qcard .go { font-size: 20px; }
.qall { display: inline-block; margin-top: 8px; font-size: 14px; }
.qlink { margin: 10px 0 0; font-size: 14px; }
.qtabs { margin: 18px 0 10px; }
.qtoc a:has(.qn) { grid-template-columns: auto 1fr auto; }
.qtoc .qn { grid-row: 1 / span 2; grid-column: 1; align-self: center; font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font-size: 13px; }
.qtoc a:has(.qn) b, .qtoc a:has(.qn) span { grid-column: 2; }
.qtoc a:has(.qn) em { grid-column: 3; }
.qdl { margin-top: 16px; }
.qsrc { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.8; }
.qhit { font-family: var(--font-text); font-size: 19px; line-height: 1.9; }
.shead { text-align: center; border: 1px solid var(--gold); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.shead h2 { font-family: "KFGQPC Hafs", var(--font-text); font-size: calc(var(--read-size) * 1.3); color: var(--accent); margin: 0; font-weight: 400; }
.shead p { margin: 0; font-size: 13px; color: var(--muted); font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
.basmala { font-family: "KFGQPC Hafs", var(--font-text); text-align: center; font-size: calc(var(--read-size) * 1.35); margin: 6px 0 12px; }
.mushaf { font-family: "KFGQPC Hafs", var(--font-text); font-size: calc(var(--read-size) * 1.32); line-height: 2.35; text-align: justify; text-align-last: center; word-spacing: .04em; }
.mushaf .aya { cursor: pointer; border-radius: 4px; transition: background .2s; -webkit-tap-highlight-color: transparent; }
.mushaf .aya:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.mushaf .aya.on { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.mushaf .aya.saved { border-bottom: 2px solid var(--gold); }
.mushaf .qpg { display: inline-block; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 11px; line-height: 1; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; margin: 0 6px; vertical-align: middle; }
.nopg .mushaf .qpg { display: none; }
.mushaf .qjuz { display: block; text-align: center; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 13px; color: var(--gold); margin: 10px 0; }
.qhint { text-align: center; }
.sheet-aya { font-family: "KFGQPC Hafs", var(--font-text); font-size: 24px; line-height: 2.1; margin: 6px 0 10px; }
.tafsir { background: var(--paper, transparent); border-inline-start: 3px solid var(--gold); padding: 6px 12px; margin-bottom: 12px; max-height: 40vh; overflow: auto; }
.tafsir b { font-size: 13px; color: var(--gold); }
.tafsir p { margin: 4px 0 0; font-family: var(--font-text); font-size: 18px; line-height: 1.9; }
a.ref { text-decoration: none; border-bottom: 1px dotted currentColor; }
.qhit { font-family: "KFGQPC Hafs", var(--font-text); font-size: 21px; line-height: 2; }
/* الوِرد والختمة */
.qlinks { display: flex; gap: 16px; flex-wrap: wrap; }
.wcard { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 14px 18px; border: 1px solid var(--gold); border-inline-start-width: 4px; border-radius: 10px; background: var(--surface); text-decoration: none; color: inherit; }
.wcard b { width: 100%; font-weight: 600; }
.wcard span { font-size: 13px; color: var(--muted); flex: 1; }
.wcard .go { flex: 0; color: var(--gold); font-size: 20px; }
.wird { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 8px; }
.wird .wr { margin: 0; font-size: 18px; }
.wird .mut { margin: 0; font-size: 13px; color: var(--muted); }
.meter.big { height: 10px; border-radius: 5px; }
.kstate { font-size: 14px; padding: 8px 12px; border-radius: 8px; margin: 12px 0; }
.kstate.ok { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.kstate.late { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
h2.sub { font-size: 14px; color: var(--muted); margin: 16px 0 8px; }
.kbars { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-bottom: 18px; }
.kbars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.kbars i { display: block; width: 100%; max-width: 18px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.kbars small { position: absolute; bottom: -18px; font-size: 10px; color: var(--muted); }
.khist { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; }
.khist span { font-size: 13px; color: var(--muted); }
.khist em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 12px; color: var(--accent); }
.mushaf .qwird { display: block; text-align: center; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 13px; color: var(--gold); margin: 10px 0; }
.wrap-seg { flex-wrap: wrap; }
.dua { margin: 28px 0 8px; padding: 18px 20px; border: 1px solid var(--gold); border-radius: 12px; background: var(--surface); font-family: var(--font-text); }
.dua h3 { margin: 0 0 10px; text-align: center; color: var(--gold); font-size: 20px; }
.dua p { margin: 0 0 10px; font-size: calc(var(--read-size) * 1.05); line-height: 2.1; }
.dua .dua-note { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 13px; line-height: 1.8; color: var(--muted); margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
.qret { position: fixed; z-index: 20; inset-inline: 0; margin: 0 auto; bottom: calc(16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/1 "IBM Plex Sans Arabic", system-ui, sans-serif; padding: 12px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.ib.fav { font-size: 20px; color: var(--gold); }
.ib.fav.on { color: var(--gold); }
.book .star { color: var(--gold); }
.sform { display: grid; gap: 10px; margin-top: 8px; }
.sform textarea, .sform input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; }
.sform textarea { resize: vertical; min-height: 110px; }
.sform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* الأوسمة والهدف */
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; }
.goal p { margin: 0; }
.goal .mut { font-size: 13px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); display: grid; gap: 3px; justify-items: center; text-align: center; opacity: .62; }
.badge.on { opacity: 1; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.badge .bi { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--muted); border: 2px dashed var(--line); margin-bottom: 4px; }
.badge.on .bi { color: var(--accent-ink); background: var(--gold); border: 2px solid var(--gold); }
.badge b { font-size: 14px; }
.badge small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.badge em { font-style: normal; font-size: 11px; color: var(--muted); }
.badge.on em { color: var(--gold); }
.badge .bp { width: 80%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.badge .bp i { display: block; height: 100%; background: var(--accent); }
/* الواجهة الإنجليزية: الاتجاه من اليسار، والنصوص العربية (الكتب والمصحف والعناوين) تبقى من اليمين */
html[dir=ltr] body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, var(--font-ui); }
html[dir=ltr] :is(p, li, h1, h2, h3, b, small, dd, dt, q, em, .t, .a, summary) { unicode-bidi: plaintext; }
html[dir=ltr] :is(.reader, .mushaf-wrap, .sheet-aya, .tafsir, .gem, .qhit, .cover, .resume b) { direction: rtl; }
html[dir=ltr] .dua { direction: rtl; }
html[dir=ltr] .dua .dua-note, html[dir=ltr] .reader .hint, html[dir=ltr] .reader .nav { direction: ltr; }
.ib.lang { font-weight: 700; }

.ib.home-ib { flex-direction: column; gap: 0; padding: 2px 8px; color: var(--accent); line-height: 1.1; }
.ib.home-ib small { font-size: 10px; font-weight: 600; }

.quick { display: grid; gap: 8px; margin-bottom: 16px; }
.qk { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.qk em { grid-row: span 2; font-style: normal; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 8px; }
.qk b { font-size: 16px; }
.qk small { color: var(--muted); font-size: 12px; }
.field select { display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }

/* مشغّل التلاوة */
.qplayer { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem calc(.55rem + env(safe-area-inset-bottom)); background: var(--card, #fffaf0); border-top: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
.qplayer[hidden] { display: none; }
.qplayer .qp-t { flex: 1; min-width: 0; text-align: start; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.qplayer .qp-t b, .qplayer .qp-t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qplayer .qp-t span { font-size: .8rem; opacity: .7; }
.qplayer .qp-c { display: flex; align-items: center; gap: .15rem; }
.qplayer .qp-c button { min-width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: none; color: inherit; font: inherit; font-size: .95rem; cursor: pointer; }
.qplayer .qp-c button.act { color: var(--gold); font-weight: 700; }
.qplayer .qp-c .qp-main { min-width: 2.7rem; height: 2.7rem; background: var(--gold); color: #fff; font-size: 1rem; }
body.qp-on { padding-bottom: 4.6rem; }
body.qp-on #toast { bottom: 5.4rem; }
.mushaf .aya.play { background: color-mix(in srgb, var(--gold) 30%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent); }
@media (max-width: 380px) { .qplayer .qp-c button[data-k="sp"] { display: none; } }
