/* =========================================================
   islam.click — Reading Experience v2
   Mobile-first design tokens and components
   ========================================================= */

:root {
  --paper: #FAF7F0;
  --paper-deep: #F2EEE5;
  --surface: #FFFDF8;
  --surface-2: #F7F4EC;
  --ink: #16211B;
  --ink-soft: #2C3A32;
  --muted: #5E6B63;
  --muted-2: #7C8880;
  --line: #E3E8E2;
  --line-strong: #D2DAD4;
  --brand: #087D48;
  --brand-strong: #065F37;
  --brand-soft: #EAF7F0;
  --brand-soft-2: #DDF1E5;
  --gold: #C9A54A;
  --gold-strong: #A9852F;
  --gold-soft: #F2E4B8;
  --danger: #B4453A;
  --danger-soft: #FBEFED;
  --shadow-sm: 0 1px 2px rgba(22, 33, 27, .05);
  --shadow-md: 0 8px 28px -12px rgba(22, 33, 27, .18);
  --shadow-lg: 0 24px 60px -20px rgba(22, 33, 27, .28);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --container: 1440px;
  --content: 720px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-reading: 'Literata', 'PT Serif', Georgia, serif;
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', 'Times New Roman', serif;
  --fs-body: 17px;
  --lh-body: 1.7;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  --paper: #0B1712;
  --paper-deep: #08120E;
  --surface: #10231B;
  --surface-2: #143026;
  --ink: #E9EFEB;
  --ink-soft: #D6E0DA;
  --muted: #A7B5AD;
  --muted-2: #8E9E95;
  --line: #234034;
  --line-strong: #335346;
  --brand: #3FBF7F;
  --brand-strong: #62D69B;
  --brand-soft: #163A2B;
  --brand-soft-2: #1B4633;
  --gold: #E3B743;
  --gold-strong: #F0CB6A;
  --gold-soft: #3A3020;
  --danger: #E58A80;
  --danger-soft: #3B1F1B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-md: 0 12px 34px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -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.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-soft); color: var(--ink); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200; transform: translateY(-150%);
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
@media (min-width: 768px) { .container { width: min(var(--container), 100% - 48px); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 80; height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-ui); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.brand-tag { display: none; font-size: 9px; letter-spacing: .12em; color: var(--muted); margin-top: 3px; }
@media (min-width: 480px) { .brand-tag { display: block; } }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 0; background: transparent; border-radius: 10px; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.catalog-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px;
  margin-left: 4px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.catalog-btn:hover { background: var(--surface-2); color: var(--ink); }
.catalog-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.catalog-btn-label { display: none; }
@media (min-width: 560px) { .catalog-btn { padding: 0 12px; } .catalog-btn-label { display: inline; } }
.desktop-nav { display: none; }
@media (min-width: 1024px) {
  :root { --header-h: 68px; }
  .brand img { width: 38px; height: 38px; }
  .brand-name { font-size: 19px; }
  .desktop-nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
  .desktop-nav a {
    color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 8px 10px; border-radius: 8px; white-space: nowrap;
  }
  .desktop-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .desktop-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
  .menu-btn { display: none; }
}
@media (max-width: 1023px) { .desktop-nav { display: none; } }

/* section chips */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); text-decoration: none;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-current="page"], .chip.is-active { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); }
.chip-row-wrap { border-bottom: 1px solid var(--line); background: var(--paper); }
@media (min-width: 1024px) { .chip-row-wrap { display: none; } }

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-reading); color: var(--ink); margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.12; font-weight: 600; }
h2 { font-size: clamp(24px, 3.6vw, 34px); line-height: 1.18; font-weight: 600; }
h3 { font-size: clamp(20px, 2.6vw, 25px); line-height: 1.25; font-weight: 600; }
p { margin: 0 0 1.1em; }
.eyebrow { font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.lead { font-size: 18px; line-height: 1.6; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- home ---------- */
.home { padding-bottom: 40px; }
.search-form { display: flex; gap: 8px; max-width: 680px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  height: 50px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.search-box svg { width: 19px; height: 19px; stroke: var(--muted); fill: none; stroke-width: 1.8; flex: 0 0 auto; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search-box input::placeholder { color: var(--muted-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn.gold { background: var(--gold); color: #241D12; }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 13px; }
.btn.icon-only { width: 44px; padding: 0; }

.section { padding: 18px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { font-size: 22px; }
.section-link { font-size: 13px; font-weight: 500; color: var(--brand); text-decoration: none; white-space: nowrap; }
.continue-card {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 72%);
  border: 1px solid var(--brand-soft-2); text-decoration: none; color: var(--ink);
}
.continue-art { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.continue-art svg { width: 22px; height: 22px; fill: currentColor; }
.continue-main { min-width: 0; flex: 1; }
.continue-kicker { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.continue-title { font-family: var(--font-reading); font-weight: 600; font-size: 16px; line-height: 1.3; margin: 3px 0 6px; }
.progress { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.section-card {
  display: flex; flex-direction: column; gap: 8px; min-height: 112px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.section-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.section-card .sc-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.section-card .sc-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.section-card strong { font-size: 14px; font-weight: 600; }
.section-card span { font-size: 12px; color: var(--muted); line-height: 1.35; }

.post-list { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); }
.post-row {
  display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); align-items: flex-start;
}
.post-thumb { width: 78px; height: 78px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.post-body { min-width: 0; flex: 1; }
.post-kicker { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.post-title { font-family: var(--font-reading); font-size: 16px; font-weight: 600; line-height: 1.32; margin: 0 0 5px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.badge-audio { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 500; }
.badge-audio svg { width: 13px; height: 13px; fill: currentColor; }

.h-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.quiz-card {
  flex: 0 0 238px; padding: 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.quiz-card .qk { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-strong); }
.quiz-card h3 { font-size: 17px; margin: 6px 0 5px; }
.quiz-card p { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.quiz-card .progress { margin-top: 8px; }
.journal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.journal-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); text-decoration: none; }
.journal-card img { width: 100%; height: 100%; object-fit: cover; }
.journal-card span { position: absolute; inset: auto 0 0 0; padding: 24px 12px 10px; color: #fff; font-weight: 600; font-size: 14px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.cta {
  margin: 22px 0 8px; padding: 20px; border-radius: var(--radius-lg);
  background: var(--ink); color: var(--paper); display: flex; flex-direction: column; gap: 10px;
}
.cta h2 { color: var(--paper); font-size: 23px; }
.cta p { color: color-mix(in srgb, var(--paper) 72%, transparent); margin: 0; font-size: 14px; }
.cta .btn { align-self: flex-start; background: var(--gold); color: #241D12; }

/* ---------- footer ---------- */
.site-footer { margin-top: 34px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-main { display: grid; gap: 22px; padding: 28px 0; }
@media (min-width: 768px) { .footer-main { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand p { font-size: 13px; color: var(--muted); max-width: 280px; }
.footer-col h3 { font-family: var(--font-ui); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.footer-col a { display: block; font-size: 13px; color: var(--ink-soft); text-decoration: none; padding: 4px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------- article ---------- */
.article-page { padding-bottom: 0; }
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; background: transparent; }
.reading-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.article-wrap { padding: 16px 0 0; }
.article-shell { display: grid; gap: 22px; }
@media (min-width: 1280px) {
  .article-shell { grid-template-columns: 252px minmax(0, 720px) 280px; justify-content: center; gap: 36px; align-items: start; }
}
.article-rail { display: none; }
@media (min-width: 1280px) {
  .article-rail { display: block; position: sticky; top: calc(var(--header-h) + 22px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding-bottom: 20px; scrollbar-width: thin; }
}
.article-main { min-width: 0; }
@media (max-width: 1279px) {
  .article-main { width: 100%; max-width: 760px; margin-inline: auto; }
  body.wide-reading .article-main { max-width: 860px; }
}
.article-utility { display: none; }
@media (min-width: 1280px) { .article-utility { display: block; position: sticky; top: calc(var(--header-h) + 22px); } }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { opacity: .5; }
.article-header { margin-bottom: 18px; }
.article-series { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.article-title { margin: 0 0 12px; }
.article-arabic-title { font-family: var(--font-arabic); font-size: 22px; line-height: 1.9; color: var(--muted); direction: rtl; text-align: right; margin: -6px 0 14px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-decoration: none; }

/* audio card */
.audio-card { margin: 18px 0 6px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.audio-top { display: flex; align-items: center; gap: 12px; }
.audio-play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.audio-play svg { width: 20px; height: 20px; fill: currentColor; }
.audio-info { min-width: 0; flex: 1; }
.audio-label { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-strong); }
.audio-title { font-size: 13px; font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-time { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.audio-bar { position: relative; height: 4px; margin: 12px 0 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.audio-bar > span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; }
.audio-actions { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.audio-actions .left, .audio-actions .right { display: flex; align-items: center; gap: 2px; }
.audio-actions button { border: 0; background: transparent; color: var(--muted); height: 30px; min-width: 34px; border-radius: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.audio-actions button:hover { background: var(--surface-2); color: var(--ink); }
.audio-actions button.active { color: var(--brand); font-weight: 600; }

.reader-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); border-radius: 999px; font-size: 12px; font-weight: 500; }
.tool-btn:hover { background: var(--surface-2); }
.tool-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.details-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.details-controls[hidden], .reader-resume[hidden] { display: none; }
.reader-resume { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-strong); }
@media (min-width: 1280px) { .reader-toolbar .mobile-only { display: none; } }

.article-body { font-family: var(--font-reading); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-soft); overflow-wrap: anywhere; }
.article-body > * { max-width: 100%; }
.article-body p { margin: 0 0 1.15em; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { scroll-margin-top: calc(var(--header-h) + 20px); margin: 1.6em 0 .6em; }
.article-body h2 { font-size: clamp(24px, 3vw, 30px); }
.article-body h3 { font-size: clamp(20px, 2.4vw, 24px); }
.article-body h4 { font-size: 19px; }
.article-body strong { color: var(--ink); }
.article-body a { color: var(--brand); text-decoration-thickness: 1px; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article-body li { margin: .35em 0; }
.article-body blockquote { margin: 1.4em 0; padding: 0 0 0 18px; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
.article-body img { border-radius: var(--radius); margin: 1.2em auto; }
.article-body figure { margin: 1.4em 0; }
.article-body figcaption { font-family: var(--font-ui); font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.article-body table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 13px; margin: 1.4em 0; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-body th { background: var(--surface-2); font-weight: 600; }
.article-body hr { border: 0; height: 1px; background: var(--line); margin: 2em auto; width: 40%; }
.article-body [dir="rtl"], .article-body .has-text-align-right, .article-body .arabic {
  font-family: var(--font-arabic); font-size: 25px; line-height: 2; direction: rtl; text-align: right; color: var(--ink);
  margin: 1.1em 0; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
}
.article-body .hadith-marker {
  display: flex; align-items: center; gap: 10px; margin: 1.8em 0 .8em;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
.article-body .hadith-marker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.article-body details { margin: 1em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.article-body details > summary { cursor: pointer; padding: 13px 15px; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.article-body details > summary::-webkit-details-marker { display: none; }
.article-body details > summary::after { content: "+"; font-size: 18px; color: var(--brand); }
.article-body details[open] > summary::after { content: "−"; }
.article-body details > :not(summary) { padding: 0 15px; }
.article-body details > :last-child { padding-bottom: 14px; }
.article-body .wp-block-audio { display: none; }

.article-end { margin: 34px 0 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.article-end h3 { font-size: 20px; margin-bottom: 10px; }
.end-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.series-nav a { display: block; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.series-nav .k { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.series-nav .t { font-family: var(--font-reading); font-size: 14px; font-weight: 600; margin-top: 4px; line-height: 1.3; }

/* TOC */
.toc { font-size: 13px; }
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.toc-head strong { font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc-filter { margin: 0 0 10px; }
.toc-filter input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px;
}
.toc-filter input::placeholder { color: var(--muted-2); }
.toc-filter input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.toc-list.is-filtering li:not([hidden]) { display: block; }
.toc-list li[hidden] { display: none !important; }
.toc-no-results { padding: 8px 0 0 12px; font-size: 12px; color: var(--muted); }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc-list li { margin: 0; }
.toc-link {
  display: block; padding: 6px 0 6px 12px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; line-height: 1.35; font-size: 12.5px;
}
.toc-link:hover { color: var(--ink); }
.toc-link.is-active { color: var(--brand-strong); border-left-color: var(--gold); background: linear-gradient(90deg, var(--brand-soft), transparent); font-weight: 600; }
.toc-link .num { display: inline-block; min-width: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; font-size: 11px; }
.toc-sublist { list-style: none; margin: 0; padding: 0; }
.toc-sublist .toc-link { padding-left: 26px; font-size: 12px; }

/* utility rail */
.rail-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.rail-card h3 { font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li + li { border-top: 1px solid var(--line); }
.rail-list a { display: block; padding: 9px 0; text-decoration: none; color: var(--ink-soft); font-size: 12.5px; line-height: 1.35; }
.rail-list a:hover { color: var(--brand); }
.rail-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.rail-stat strong { color: var(--ink); font-weight: 600; }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(4, 14, 10, .5); z-index: 140; opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 150; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .28s var(--ease); padding: 8px 16px calc(20px + var(--safe-bottom));
}
.sheet.is-open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 6px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 20px; }
.sheet-close { width: 40px; height: 40px; border: 0; background: var(--surface-2); border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.sheet-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- app launcher ---------- */
.launcher {
  position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 18px;
  visibility: hidden; pointer-events: none;
}
.launcher.is-open { visibility: visible; pointer-events: auto; }
.launcher-backdrop {
  position: absolute; inset: 0; background: rgba(4, 14, 10, .58);
  backdrop-filter: blur(7px); opacity: 0; transition: opacity .22s var(--ease);
}
.launcher.is-open .launcher-backdrop { opacity: 1; }
.launcher-panel {
  position: relative; width: min(780px, 100%); max-height: min(86dvh, 820px); overflow: auto;
  padding: 18px; background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.985);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  scrollbar-width: thin;
}
.launcher.is-open .launcher-panel { opacity: 1; transform: none; }
.launcher-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.launcher-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.launcher-app-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: 0 0 auto; }
.launcher-app-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.launcher-heading h2 { font-size: 22px; line-height: 1.2; }
.launcher-subtitle { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.launcher-close { width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; }
.launcher-close:hover { background: var(--line); }
.launcher-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.launcher-layers { padding: 16px 0 2px; }
.launcher-layer[hidden] { display: none; }
.launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
@media (min-width: 560px) { .launcher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
.launcher-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 124px; padding: 15px 10px 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-align: center; text-decoration: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.launcher-tile:hover, .launcher-tile:focus-visible { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.launcher-tile.is-current { border-color: var(--brand); background: var(--brand-soft); }
.launcher-tile-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.launcher-tile:hover .launcher-tile-icon { background: var(--brand); color: #fff; }
.launcher-tile-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.launcher-tile-label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.launcher-tile-meta { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.launcher-tile-chevron { position: absolute; top: 9px; right: 9px; color: var(--muted-2); opacity: .75; }
.launcher-tile-chevron svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.launcher-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.launcher-crumb { border: 0; background: transparent; padding: 0; color: var(--brand); font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.launcher-crumb:hover { text-decoration: underline; }
.launcher-crumb-sep { color: var(--muted-2); font-size: 11px; }
.launcher-crumb-current { color: var(--muted); font-size: 11.5px; font-weight: 500; line-height: 1.3; }
.launcher-child-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.launcher-back {
  display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  color: var(--ink-soft); font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.launcher-back:hover { background: var(--surface-2); color: var(--ink); }
.launcher-back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.launcher-child-heading { display: flex; align-items: center; gap: 9px; min-width: 0; padding-top: 2px; }
.launcher-child-heading-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); flex: 0 0 auto; }
.launcher-child-heading-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.launcher-child-heading h3 { font-size: 18px; line-height: 1.2; }
.launcher-child-heading p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.launcher-child-list { display: grid; gap: 6px; }
.launcher-child {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.launcher-child:hover, .launcher-child:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.launcher-child-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-strong); flex: 0 0 auto; }
.launcher-child-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.launcher-child-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.launcher-child-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.launcher-child-meta { font-size: 11px; color: var(--muted); line-height: 1.3; }
.launcher-child-chevron { color: var(--muted-2); flex: 0 0 auto; }
.launcher-child-chevron svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.launcher-open-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 600; text-decoration: none; }
.launcher-open-all svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.launcher-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.launcher-foot-links { display: flex; flex-wrap: wrap; gap: 4px; }
.launcher-foot-links .btn { min-height: 36px; }
.launcher-foot-links svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
@media (max-width: 559px) {
  .launcher { padding: 0; }
  .launcher-panel { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; padding: 14px 14px calc(18px + var(--safe-bottom)); }
  .launcher-heading h2 { font-size: 20px; }
}

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; font-size: 16px; color: var(--ink); }
.stepper button:hover { background: var(--surface); }
.stepper span { min-width: 40px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }

/* mobile article bar + audio dock */
.mobile-reader-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.mobile-reader-bar .back { width: 40px; height: 40px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink); border-radius: 10px; }
.mobile-reader-bar .back svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.mobile-reader-bar .title { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1280px) { .mobile-reader-bar { display: none; } }

.audio-dock {
  position: fixed; z-index: 130; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom));
  display: none; align-items: center; gap: 10px; padding: 8px 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-md);
}
.audio-dock.is-visible { display: flex; }
.audio-dock .dock-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.audio-dock .dock-play svg { width: 17px; height: 17px; fill: currentColor; }
.audio-dock .dock-main { flex: 1; min-width: 0; }
.audio-dock .dock-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-dock .dock-sub { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.audio-dock .dock-progress { height: 3px; background: var(--line); border-radius: 999px; margin-top: 5px; overflow: hidden; }
.audio-dock .dock-progress > span { display: block; height: 100%; width: 0; background: var(--gold); }
.audio-dock .dock-btn { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.audio-dock .dock-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
@media (min-width: 1280px) { .audio-dock { left: auto; right: 24px; bottom: 24px; width: 340px; } }

/* quiz */
.quiz { margin: 24px 0; }
.quiz-card-large { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.quiz-topline { height: 3px; background: var(--line); }
.quiz-topline > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s var(--ease); }
.quiz-pad { padding: 18px 16px; }
@media (min-width: 640px) { .quiz-pad { padding: 26px 28px; } }
.quiz-kicker { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-strong); margin-bottom: 8px; }
.quiz-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.quiz-title { font-size: clamp(22px, 4vw, 30px); line-height: 1.2; margin: 0 0 8px; }
.quiz-desc { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.quiz-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.quiz-meta span { display: inline-flex; align-items: center; gap: 5px; }
.quiz-meta svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.quiz-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.quiz-progress-row .count { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.quiz-progress-row .progress { flex: 1; }
.quiz-question-text { font-family: var(--font-reading); font-size: 19px; line-height: 1.45; font-weight: 600; margin: 0 0 16px; color: var(--ink); }
.quiz-answers { display: flex; flex-direction: column; gap: 8px; }
.quiz-answer {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; min-height: 50px;
  padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); text-align: left; color: var(--ink-soft); font-size: 14px; line-height: 1.45;
}
.quiz-answer:hover { border-color: var(--brand); background: var(--brand-soft); }
.quiz-answer .letter { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--muted); }
.quiz-answer.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.quiz-answer.is-selected .letter { background: var(--brand); border-color: var(--brand); color: #fff; }
.quiz-answer.is-correct { border-color: var(--brand); background: var(--brand-soft); }
.quiz-answer.is-correct .letter { background: var(--brand); border-color: var(--brand); color: #fff; }
.quiz-answer.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-answer.is-wrong .letter { background: var(--danger); border-color: var(--danger); color: #fff; }
.quiz-answer[disabled] { cursor: default; }
.quiz-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.quiz-feedback.good { background: var(--brand-soft); color: var(--brand-strong); }
.quiz-feedback.bad { background: var(--danger-soft); color: var(--danger); }
.quiz-explanation { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.quiz-explanation .tc { margin-top: 8px; }
.timecode-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-strong); border-radius: 999px; font-size: 12px; font-weight: 600; }
.timecode-btn svg { width: 13px; height: 13px; fill: currentColor; }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.quiz-nav .btn { min-width: 110px; }
.quiz-nav .btn[disabled] { opacity: .45; pointer-events: none; }
.quiz-results { text-align: center; padding: 8px 0; }
.score-ring { width: 116px; height: 116px; border-radius: 50%; margin: 4px auto 14px; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--score, 0) * 1%), var(--line) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.score-ring strong { position: relative; font-family: var(--font-reading); font-size: 30px; line-height: 1; }
.score-ring span { position: relative; font-size: 10px; color: var(--muted); margin-top: 2px; }
.quiz-results h3 { font-size: 24px; margin: 0 0 6px; }
.quiz-results p { color: var(--muted); font-size: 14px; }
.quiz-review { margin-top: 18px; text-align: left; border-top: 1px solid var(--line); padding-top: 14px; }
.quiz-review h4 { font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.review-row { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
.review-row:last-child { border-bottom: 0; }
.review-row .ok { color: var(--brand); font-weight: 600; }
.review-row .no { color: var(--danger); font-weight: 600; }

/* quiz library */
.quiz-library { padding: 24px 0 40px; }
.quiz-library h1 { margin: 6px 0 8px; }
.lib-grid { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 640px) { .lib-grid { grid-template-columns: 1fr 1fr; gap: 14px; } }
@media (min-width: 1100px) { .lib-grid { grid-template-columns: repeat(3, 1fr); } }
.lib-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.lib-card:hover { border-color: var(--line-strong); }
.lib-card .topic { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-strong); }
.lib-card h3 { font-size: 18px; line-height: 1.3; margin: 0; }
.lib-card p { font-size: 12px; color: var(--muted); margin: 0; }
.lib-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--muted); }
.lib-card .foot .progress { flex: 1; }

/* dua */
.dua-page { padding: 22px 0 40px; }
.dua-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 768px) { .dua-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dua-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.dua-card h2, .dua-card p, .dua-card a { overflow-wrap: anywhere; word-break: break-word; }
.dua-arabic { font-family: var(--font-arabic); font-size: 25px; line-height: 2; direction: rtl; text-align: right; color: var(--ink); margin: 0 0 12px; }
.dua-card h2 { font-size: 18px; margin: 0 0 8px; }
.dua-card p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.dua-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* search overlay */
.search-overlay { position: fixed; inset: 0; z-index: 160; background: var(--paper); display: none; overflow: auto; }
.search-overlay.is-open { display: block; }
.search-overlay-inner { width: min(760px, 100% - 32px); margin: 0 auto; padding: 20px 0 40px; }
.search-overlay-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-overlay-head .search-box { height: 52px; }
.search-results { margin-top: 18px; }
.search-group { margin-bottom: 20px; }
.search-group h3 { font-family: var(--font-ui); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.search-result { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.search-result .k { font-size: 10px; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.search-result .t { font-family: var(--font-reading); font-size: 15px; line-height: 1.35; }
.search-result .m { font-size: 11px; color: var(--muted); }
.empty-state { padding: 34px 0; text-align: center; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 200; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* dark/light toggle icons */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* print */
@media print {
  .site-header, .chip-row-wrap, .article-rail, .article-utility, .reader-toolbar, .audio-card, .audio-dock, .reading-progress, .article-end, .site-footer, .sheet, .launcher, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .article-shell { display: block; }
  .article-body { font-size: 12pt; line-height: 1.55; color: #000; }
  .article-body a { color: #000; text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- generated thumbnails ---------- */
.post-thumb { display: grid; place-items: center; color: #fff; font-family: var(--font-arabic); font-size: 28px; overflow: hidden; position: relative; }
.post-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 55%); }
.post-thumb span { position: relative; z-index: 1; }
.thumb-0 { background: linear-gradient(145deg, #0B5E3A, #087D48); }
.thumb-1 { background: linear-gradient(145deg, #8C6B23, #C9A54A); }
.thumb-2 { background: linear-gradient(145deg, #143226, #2F6A4D); }
.thumb-3 { background: linear-gradient(145deg, #5E3A2A, #A9852F); }

/* ---------- reading width ---------- */
@media (min-width: 1280px) {
  .article-shell { --article-width: 720px; grid-template-columns: 252px minmax(0, var(--article-width)) 280px; }
  body.wide-reading .article-shell { --article-width: 860px; }
}
body.reader-mode .site-header,
body.reader-mode .chip-row-wrap,
body.reader-mode .article-rail,
body.reader-mode .article-utility,
body.reader-mode .mobile-reader-bar { display: none !important; }
body.reader-mode .article-shell { display: block; }
body.reader-mode .article-main { max-width: 760px; margin: 0 auto; }

/* ---------- playlist ---------- */
.playlist-item { display: flex; align-items: center; gap: 9px; }
.playlist-item .pt { color: var(--muted-2); font-variant-numeric: tabular-nums; font-size: 11px; min-width: 20px; }
.playlist-item .pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-item.is-active { color: var(--brand-strong); font-weight: 600; }
#playlistSheetBody .toc-link { white-space: normal; }

/* ---------- score ring fix ---------- */
.score-ring > div { position: relative; text-align: center; }
.score-ring strong { display: block; }
.score-ring span { display: block; margin-top: 2px; }

/* ---------- small mobile fixes ---------- */
@media (max-width: 479px) {
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; }
  .header-inner { gap: 6px; }
  .brand-name { font-size: 15px; }
  .brand img { width: 30px; height: 30px; }
  .article-title { font-size: 28px; }
  .article-body [dir="rtl"], .article-body .has-text-align-right, .article-body .arabic { font-size: 22px; padding: 10px 12px; }
  .quiz-pad { padding: 16px 14px; }
  .quiz-nav { gap: 8px; }
  .quiz-nav .btn { flex: 1; min-width: 0; }
  .audio-dock { left: 8px; right: 8px; }
  .journal-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- focus & details ---------- */
.toc-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.article-body details > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.quiz-answer:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- print quiz ---------- */
@media print {
  .quiz-nav, .quiz-feedback, .score-ring { display: none !important; }
  .quiz-card-large { border: 1px solid #ccc; }
}

/* keep closed dialogs out of the accessibility tree and full-page screenshots */
.sheet { visibility: hidden; pointer-events: none; }
.sheet.is-open { visibility: visible; pointer-events: auto; }
.search-overlay { visibility: hidden; }
.search-overlay.is-open { visibility: visible; }

/* ---------- desktop polish ---------- */
@media (min-width: 1024px) {
  .home .container { width: min(1120px, 100% - 64px); }
}
.continue-main { display: block; }
.continue-kicker, .continue-title, .continue-main .progress { display: block; }
.continue-main .progress { margin-top: 8px; }
.continue-card { max-width: 980px; }
.post-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home .post-list { max-width: 1040px; }
.article-title { font-size: clamp(28px, 3vw, 38px); line-height: 1.14; text-wrap: balance; }

/* collapsible TOC for long articles */
.toc-collapsed li:nth-child(n+13) { display: none; }
.toc-more { display: block; margin: 8px 0 0 12px; padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 600; text-align: left; }
.toc-more:hover { text-decoration: underline; }
.toc-empty-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toc-empty-card p { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0 0 10px; }

/* mobile bottom navigation */
.mobile-bottom-nav { display: none; }
@media (max-width: 1023px) {
  body:not(.article-page):not(.quiz-page):not(.dua-page) { padding-bottom: 72px; }
  body:not(.article-page):not(.quiz-page):not(.dua-page) .mobile-bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 110;
    left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + var(--safe-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .mobile-bottom-nav a, .mobile-bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; border: 0; background: transparent; color: var(--muted);
    text-decoration: none; font-size: 10px; font-weight: 500; padding: 4px 0;
  }
  .mobile-bottom-nav a:hover, .mobile-bottom-nav button:hover { color: var(--brand); }
  .mobile-bottom-nav svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
}
.mobile-bottom-nav a.is-active, .mobile-bottom-nav button.is-active { color: var(--brand); }

@media (max-width: 1023px) {
  .playlist-card { display: none; }
}
