/* =====================================================================
   أحسن القصص — الواجهة العامة (الاتجاه أ: المخطوطة)
   ===================================================================== */
@import url('../fonts/fonts.css');

:root {
  --ground: #F7F1E6;
  --paper: #FFFDF8;
  --band: #EFE6D5;
  --line: #E4D8C2;
  --line-strong: #CDBB9A;
  --ink: #2A2118;
  --ink-2: #4A3D2C;
  --muted: #6B5B45;
  --accent: #1E5B57;
  --accent-ink: #123B38;
  --accent-soft: #E6EFEC;
  --gold: #C9A65E;
  --gold-soft: #F3E6C8;
  --gold-ink: #7A5418;
  --font-display: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-body: 'Noto Naskh Arabic', 'Amiri', serif;
  --font-quran: 'KA Al-Naskh Pro', 'Amiri Quran', 'Amiri', serif;
  --radius: 14px;
  --wrap: 1240px;
}

/* خط الآيات يختاره المدير من «الرأس والتذييل والخط» */
:root[data-qfont="amiri"] { --font-quran: 'Amiri Quran', 'Amiri', serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font-body); font-size: 18px; line-height: 1.9;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -60px; right: 16px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

/* ---- الرأس ---------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand span { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 17px; font-weight: 500; }
.nav a { padding: 8px 14px; border-radius: 8px; color: var(--ink); }
.nav a:hover { background: var(--band); text-decoration: none; }
.nav a[aria-current="page"] { background: #EDE3D1; }

/* ---- الآية ---------------------------------------------------------- */
.ayah { font-family: var(--font-quran); line-height: 2.2; }
.ayah-ref { font-size: 15px; color: var(--muted); }

/* ---- صفحة «قريباً» --------------------------------------------------- */
.soon { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 64px 24px; }
.soon .ayah { font-size: clamp(24px, 4vw, 34px); max-width: 920px; margin: 0; }
.soon h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 56px); margin: 24px 0 0; }
.soon p { color: var(--muted); margin: 0; }

/* ---- صفحات الخطأ ----------------------------------------------------- */
.error-page { text-align: center; padding: 96px 24px; }
.error-page .code { font-family: var(--font-display); font-size: 72px; color: var(--line-strong); line-height: 1; }
.error-page h1 { font-family: var(--font-display); font-size: 36px; margin: 8px 0; }
.error-page p { color: var(--muted); }

/* ---- التذييل -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; font-size: 14px; color: var(--muted); }

.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { color: var(--muted); }

/* =====================================================================
   الحزمة ٣ — الواجهة العامة
   ===================================================================== */
.site-header .wrap { gap: 12px 24px; }
.header-search { flex: 1 1 190px; max-width: 300px; min-width: 0; position: relative; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 4px 4px 4px 4px; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox svg { flex: none; margin-right: 10px; }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 8px 2px; color: var(--ink); outline: none; }
.searchbox button { font: inherit; font-weight: 600; font-size: 16px; background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 9px 20px; cursor: pointer; }
.searchbox button:hover { background: var(--accent-ink); }
.searchbox.big { border-radius: 14px; padding: 6px; }
.searchbox.big input { font-size: 18px; padding: 12px 4px; }
.searchbox.big button { font-size: 17px; padding: 12px 26px; border-radius: 10px; }
.suggest { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 20; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(42,33,24,.14); padding: 6px; margin: 0; list-style: none; text-align: right; }
.suggest li { padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.suggest li small { color: var(--muted); }

.hero { max-width: var(--wrap); margin: 0 auto; padding: 64px 24px 48px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.hero .ayah { margin: 0; font-size: clamp(24px, 3.4vw, 34px); max-width: 920px; }
.hero form { width: 100%; max-width: 720px; margin-top: 12px; position: relative; }
.hero label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.hero .hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

.section { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h1, .section-head h2 { margin: 0; font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.3; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.tabs { display: flex; gap: 4px; background: #EDE3D1; padding: 4px; border-radius: 12px; }
.tabs a, .tabs button { font: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 9px; padding: 9px 18px; cursor: pointer; background: transparent; color: #5A4A35; }
.tabs a:hover { text-decoration: none; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(42,33,24,.15); }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); min-height: 96px; transition: border-color .15s, transform .15s; }
a.card:hover { text-decoration: none; border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .name { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.3; }
.card .num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .tag { font-size: 14px; color: var(--muted); line-height: 1.6; }
.card .kicker { font-size: 13px; font-weight: 600; color: var(--accent); }
.badge-azm { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); border-radius: 999px; padding: 2px 10px; line-height: 1.6; }
.more { display: flex; justify-content: center; margin-top: 20px; }
.btn-outline { font-size: 16px; font-weight: 600; padding: 10px 22px; border: 1.5px solid var(--accent); border-radius: 10px; }
.btn-outline:hover { text-decoration: none; background: var(--accent-soft); }

.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.feature { display: flex; flex-direction: column; gap: 10px; border-radius: 16px; padding: 32px; }
.feature:hover { text-decoration: none; }
.feature .t { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.3; }
.feature .d { font-size: 16px; line-height: 1.8; }
.feature .go { font-size: 16px; font-weight: 600; margin-top: 8px; }
.feature.dark { background: var(--accent); color: #fff; }
.feature.dark .d { color: #DCEBE8; }
.feature.light { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.feature.light .go { color: var(--accent); }

.letter-group { margin-bottom: 28px; }
.letter-group h2, .era-group h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 12px; color: var(--accent-ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* ---- صفحة القصة ------------------------------------------------------ */
.progress { position: sticky; top: 0; height: 4px; background: var(--line); z-index: 30; }
.progress span { display: block; height: 4px; width: 0; background: var(--accent); }
.story-layout { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.story-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.story-main { flex: 999 1 640px; min-width: 0; max-width: 820px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--muted); font-family: var(--font-body); }
.toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; font-size: 16px; line-height: 1.6; padding: 7px 12px; border-radius: 8px; color: var(--ink-2); }
.toc a:hover { background: var(--band); text-decoration: none; }
.toc a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; line-height: 1.8; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.story-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.story-head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(40px, 6vw, 56px); font-weight: 700; line-height: 1.3; }
.story-head h1 small { font-size: .54em; color: var(--muted); font-weight: 400; }
.story-head .tagline { margin: 0; font-size: 17px; color: var(--muted); }
.tools { display: flex; gap: 6px; }
.tools button { font: inherit; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tools button:hover { background: var(--band); }
.story-body { font-size: var(--reading-size, 19px); line-height: 2.05; }
.story-body p { margin: 0 0 16px; }
.story-body h2 { font-family: var(--font-display); font-size: 1.68em; font-weight: 700; margin: 40px 0 8px; line-height: 1.4; scroll-margin-top: 16px; }
.story-body ol, .story-body ul { margin: 0 0 16px; padding-inline-start: 28px; }
.story-body .table-wrap { overflow-x: auto; }
.story-body table { border-collapse: collapse; width: 100%; margin-bottom: 16px; }
.story-body td { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; }
.nabdha { background: var(--band); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0 8px; }
.nabdha h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--muted); font-family: var(--font-body); }
.nabdha p { margin: 0; }
.ayah { font-family: var(--font-quran); }
.ayah-inline .ayah { font-size: 1.12em; line-height: 2.2; color: #24302E; }
.ayah-ref { font-size: .72em; color: var(--muted); white-space: nowrap; }
.ayah-block { margin: 0 0 20px; background: var(--paper); border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); padding: 20px 28px; text-align: center; }
.ayah-block blockquote { margin: 0; font-size: 1.42em; line-height: 2.2; }
.ayah-block figcaption { margin-top: 10px; font-size: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.aya-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; padding: 0 .2em; border: 1.5px solid var(--gold);
  border-radius: 50%; font-family: var(--font-body); font-size: .55em; line-height: 1; color: var(--gold-ink); vertical-align: middle; margin: 0 .15em; }
q.hadith, blockquote.hadith { font-style: normal; color: var(--accent-ink); }
q.hadith::before { content: '«'; } q.hadith::after { content: '»'; }
blockquote.hadith { margin: 0 0 16px; padding: 12px 20px; border-right: 3px solid var(--accent); background: var(--paper); border-radius: 8px; }
a.xref { color: var(--accent); border-bottom: 1.5px dotted var(--accent); }
a.xref:hover { text-decoration: none; border-bottom-style: solid; }
.preview-card { position: absolute; z-index: 40; max-width: 360px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(42,33,24,.16); padding: 16px 18px; font-size: 15px; line-height: 1.8; }
.preview-card .t { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.preview-card .s { color: var(--muted); font-size: 14px; }
.preview-card p { margin: 6px 0 8px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { font-size: 15px; padding: 6px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.chips a:hover { text-decoration: none; border-color: var(--line-strong); }
.after { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.after h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.after h2 + .chips { margin-bottom: 28px; }
.pager-nav { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pager-nav a { display: flex; flex-direction: column; gap: 2px; border-radius: 14px; padding: 14px 22px; background: var(--paper); border: 1px solid var(--line); }
.pager-nav a:hover { text-decoration: none; border-color: var(--line-strong); }
.pager-nav a.next { background: var(--accent); color: #fff; border-color: var(--accent); margin-inline-start: auto; }
.pager-nav span { font-size: 13px; opacity: .8; }
.pager-nav strong { font-family: var(--font-display); font-size: 22px; }
.draft-note { background: var(--gold-soft); color: var(--gold-ink); padding: 8px 16px; border-radius: 10px; margin-bottom: 12px; font-size: 15px; }

/* ---- أوضاع القراءة: الموجز / من الوحي / الموسّعة ------------------------ */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 20px 0 4px; padding: 6px;
  background: var(--band); border-radius: var(--radius); }
.modes a { display: flex; flex-direction: column; gap: 0; padding: 10px 14px; border-radius: 10px; color: var(--ink); line-height: 1.5; }
.modes a:hover { text-decoration: none; background: rgba(255,253,248,.6); }
.modes a strong { font-size: 17px; }
.modes a span { font-size: 13px; color: var(--muted); }
.modes a[aria-current="true"] { background: var(--paper); box-shadow: 0 1px 3px rgba(42,33,24,.12); }
.modes a[aria-current="true"] strong { color: var(--accent-ink); }
@media (max-width: 560px) {
  .modes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; }
  .modes a { padding: 8px 6px; text-align: center; }
  .modes a strong { font-size: 15px; }
  .modes a span { display: none; }
}
[data-mode="brief"] .not-brief,
[data-mode="narrative"] .not-brief,
[data-mode]:not([data-mode="brief"]) .only-brief,
[data-mode]:not([data-mode="narrative"]) .only-narrative,
[data-mode]:not([data-mode="full"]) .story-body .ext,
[data-mode]:not([data-mode="full"]) .story-body aside.isr { display: none; }
.mujaz { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0 8px; }
.mujaz h2 { margin-top: 0; }
.qissa { margin: 24px 0 8px; }
.qissa > p { text-indent: 1.2em; }
.mode-more { margin: 8px 0 0 !important; font-size: 16px; font-weight: 600; }
/* مربع ملاحظة في الموجز (div.note)، على هيئة صندوق «يُروى» */
.mujaz .note { background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px 4px; margin: 18px 0 0;
  font-size: .95em; line-height: 1.95; }
.mujaz .note p { margin: 0 0 10px; }

/* التفاصيل الموسّعة */
.story-body .ext { border-inline-start: 3px solid var(--line-strong); padding-inline-start: 18px; margin: 0 0 16px; }
.story-body .ext::before { content: 'تفصيل من المفسرين'; display: block; font-size: 13px; font-weight: 600; color: var(--muted); }

/* صندوق «يُروى» */
.story-body aside.isr { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px 6px; margin: 0 0 20px;
  font-size: .9em; line-height: 1.95; }
.isr-tag { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.story-body aside.isr p { margin: 0 0 10px; }
.story-body aside.isr p.verdict { color: var(--ink-2); }
.isr-badge { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.6; padding: 1px 10px; border-radius: 999px; margin-inline-end: 4px;
  vertical-align: 1px; }
.isr-badge.v-agree  { background: var(--accent-soft); color: var(--accent-ink); }
.isr-badge.v-silent { background: var(--gold-soft); color: var(--gold-ink); }
.isr-badge.v-contra { background: #F6E1DC; color: #8A2E1F; }
.isr-badge.v-weak   { background: #ECE6DC; color: #4F4232; }

/* دروس، شائع لكنه لا يصح، المصادر */
.shai .myth, .shai blockquote { background: var(--paper); border: 1px solid var(--line); border-inline-start: 4px solid #B5523E; border-radius: 10px;
  padding: 12px 18px 2px; margin: 0 0 14px; }
.shai .myth p, .shai blockquote p { margin: 0 0 10px; }
.masadir { font-size: .85em; line-height: 1.9; }
.masadir ul { padding-inline-start: 22px; }
.masadir a { overflow-wrap: anywhere; }

/* ---- البحث ---------------------------------------------------------- */
.results h2 { font-family: var(--font-display); font-size: 28px; margin: 32px 0 12px; }
.result { padding: 16px 0; border-top: 1px solid var(--line); }
.result:first-of-type { border-top: 0; }
.result .t { font-size: 19px; font-weight: 600; }
.result .w { font-size: 14px; color: var(--muted); }
.result p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.9; }
mark { background: #F6E3A9; color: inherit; border-radius: 3px; padding: 0 2px; }
.verse-result .ayah { font-size: 22px; line-height: 2.1; }

/* ---- صفحة الآيات ------------------------------------------------------ */
.mushaf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; font-family: var(--font-quran); font-size: 26px; line-height: 2.3; text-align: justify; }
.mushaf .v { padding: 2px 4px; border-radius: 6px; }
.mushaf .v.hit { background: #F4EBCF; }
.mushaf-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 16px; }
.prose { font-size: 18px; line-height: 2; }
.prose .table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td { border: 1px solid var(--line); padding: 10px 14px; vertical-align: top; background: var(--paper); }

/* ---- الخط الزمني (الحزمة ٤) ----------------------------------------- */
.tl-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: inherit; font-size: 15px; font-weight: 600; border-radius: 999px; padding: 9px 18px; cursor: pointer; background: var(--paper); color: var(--ink); border: 1.5px solid var(--line-strong); min-height: 44px; }
.pill[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tl-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 24px 8px 18px; }
.tl { display: flex; width: max-content; margin: 0; padding: 0 16px; list-style: none; }
.tl-era { padding: 0 14px; border-left: 1px dashed var(--line); display: flex; flex-direction: column; gap: 14px; }
.tl-era:last-child { border-left: 0; }
.tl-era h2 { margin: 0; align-self: flex-start; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; background: #F3ECDF; border-radius: 8px; padding: 4px 12px; }
.tl-nodes { position: relative; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tl-nodes::before { content: ''; position: absolute; top: 24px; right: 0; left: 0; height: 2px; background: #D9C9AA; }
.tl-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; padding: 12px 6px; border-radius: 12px; color: var(--ink); }
.tl-node:hover { background: var(--band); text-decoration: none; }
.tl-node .dot { width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--paper); border: 2.5px solid #8C7A5E; }
.tl-node.azm .dot { width: 22px; height: 22px; margin-top: 0; background: var(--gold); border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--gold); }
.tl-node .nm { font-size: 17px; font-weight: 500; white-space: nowrap; }
.tl-node.azm .nm { font-size: 19px; font-weight: 700; }
.tl-node .rel { font-size: 12px; color: var(--muted); white-space: nowrap; line-height: 1.4; }
.tl-node[aria-current="true"] { background: var(--accent-soft); }
.tl-node[aria-current="true"] .dot { background: var(--accent); border-color: var(--accent); box-shadow: none; }
.tl-node[aria-current="true"] .nm { color: var(--accent-ink); font-weight: 700; }
.tl-scroll.only-azm .tl-node:not(.azm) { opacity: .35; }
.tl-scroll.no-rel .rel { display: none; }
.tl-detail { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.tl-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; }
.tl-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.tl-title h2 { margin: 0; font-family: var(--font-display); font-size: 40px; color: var(--ink); }
.tl-era-name { color: var(--muted); font-size: 15px; }
.tl-tag { margin: 4px 0 0; color: var(--muted); }
.tl-main p[data-f="excerpt"] { font-size: 18px; line-height: 2; color: #3A2F22; }
.btn-solid { display: inline-block; font-size: 16px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 10px; padding: 12px 22px; }
.btn-solid:hover { background: var(--accent-ink); color: #fff; text-decoration: none; }
.tl-steps { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.tl-steps button { font: inherit; text-align: right; cursor: pointer; color: var(--ink); padding: 16px 20px; }
.tl-steps button:hover:not(:disabled) { border-color: var(--line-strong); }
.tl-steps button:disabled { opacity: .5; cursor: default; }
.tl-steps span { display: block; font-size: 13px; color: var(--muted); }
.tl-steps strong { font-family: var(--font-display); font-size: 22px; }

/* ---- روابط السيرة --------------------------------------------------- */
.link-group h2 { font-family: var(--font-display); font-size: 28px; margin: 28px 0 8px; }
.links { list-style: none; margin: 0; padding: 0; }
.links li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
.links li > a { font-size: 20px; font-weight: 700; }
.links .by { color: var(--muted); }
.links p { margin: 4px 0 0; color: var(--ink-2); }
.links .host { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; text-align: right; }

.sirah-card { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; background: var(--accent); color: #fff; border-radius: var(--radius); padding: 20px 24px; }
.sirah-card p { margin: 0; color: #DCEBE8; }
.sirah-card strong { display: block; font-family: var(--font-display); font-size: 24px; color: #fff; }
.sirah-card a { background: #fff; color: var(--accent-ink); font-weight: 600; border-radius: 10px; padding: 10px 18px; }
.nav a { padding: 8px 12px; }

@media (max-width: 900px) {
  .story-side { position: static; max-height: none; order: 2; }
  .story-main { order: 1; }
}
@media print {
  .site-header, .site-footer, .story-side, .tools, .progress, .pager-nav, .after, .modes { display: none !important; }
  body { background: #fff; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .section-head h1, .section-head h2 { font-size: 32px; }
  .ayah-block { padding: 16px; }
  .mushaf { padding: 16px; font-size: 22px; }
  .wrap { padding: 0 16px; }
  .brand span { font-size: 26px; }
}
