/* Hadith Library | مكتبة الحديث — dizayn tizimi.
   Iliq oq o'qish foni, siyoh rangli arabcha matn, chuqur yashil/to'q ko'k urg'u, yorug'/qorong'i mavzu.
   Ranglar faqat tokenlar orqali; mantiqiy xossalar (inline-start/end) RTL/LTR uchun. */
@font-face { font-family: "Noto Naskh Arabic"; src: url("./fonts/NotoNaskhArabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Naskh Arabic"; src: url("./fonts/NotoNaskhArabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* ﷺ ﷽ ﷲ — interfeys matnida ham ilovaning o'z shrifti (tizim shriftidagi bitmap/bo'sh kvadrat o'rniga) */
@font-face { font-family: "HL Ligatures"; src: url("./fonts/NotoNaskhArabic-400.woff2") format("woff2"); unicode-range: U+FDF2, U+FDFA, U+FDFD; font-display: swap; }

:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f1eee7; --surface-3: #e9e5dc;
  --ink: #1c1d1b; --ink-2: #4c504c; --ink-3: #74786f; --line: #e2ddd2; --line-2: #d3cdbf;
  --accent: #1e5d4e; --accent-hover: #174a3e; --accent-ink: #ffffff; --accent-soft: #e3eee8;
  --navy: #22344d; --gold: #9a6b16;
  --warn: #8a5800; --warn-soft: #fbf0d9; --bad: #a3302b; --bad-soft: #fbe8e5; --good: #2b6a3d; --good-soft: #e5f1e6;
  --mark: #f8e19a; --focus: #2b7a66;
  --shadow-1: 0 1px 2px rgba(28, 29, 27, .06), 0 1px 3px rgba(28, 29, 27, .05);
  --shadow-2: 0 6px 24px rgba(28, 29, 27, .10);
  --radius: 14px; --radius-s: 10px; --radius-l: 20px;
  --ui: "HL Ligatures", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Naskh Arabic", sans-serif;
  --ar: "Noto Naskh Arabic", "Amiri", "Scheherazade New", "Geeza Pro", "Traditional Arabic", serif;
  --read-size: 26px; --read-lh: 2.05; --tr-size: 16px; --col: 760px; --bk: var(--accent);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161917; --surface: #1d211f; --surface-2: #232825; --surface-3: #2b312d;
  --ink: #e6ebe7; --ink-2: #b7bfb9; --ink-3: #8f9993; --line: #2c322f; --line-2: #3b433e;
  --accent: #8fd6bb; --accent-hover: #a9e3cd; --accent-ink: #0d1a15; --accent-soft: #1f3a30;
  --navy: #9fb7d8; --gold: #e3b863;
  --warn: #f0c46a; --warn-soft: #33290f; --bad: #ff9d92; --bad-soft: #3b201d; --good: #8fd4a0; --good-soft: #1d3324;
  --mark: #5c4c12; --focus: #86d2b6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161917; --surface: #1d211f; --surface-2: #232825; --surface-3: #2b312d;
    --ink: #e6ebe7; --ink-2: #b7bfb9; --ink-3: #8f9993; --line: #2c322f; --line-2: #3b433e;
    --accent: #8fd6bb; --accent-hover: #a9e3cd; --accent-ink: #0d1a15; --accent-soft: #1f3a30;
    --navy: #9fb7d8; --gold: #e3b863;
    --warn: #f0c46a; --warn-soft: #33290f; --bad: #ff9d92; --bad-soft: #3b201d; --good: #8fd4a0; --good-soft: #1d3324;
    --mark: #5c4c12; --focus: #86d2b6;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ui); overflow-x: hidden;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.yashirin { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:focus, main:focus-visible { outline: none; }
.otish { position: absolute; inset-inline-start: -9999px; } .otish:focus { inset-inline-start: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.iso { unicode-bidi: isolate; }
.ltr-id { unicode-bidi: isolate; direction: ltr; display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; }
.ar-i { font-family: var(--ar); unicode-bidi: isolate; font-size: 1.12em; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] svg.flip { transform: scaleX(-1); }

/* ---------- qobiq: yuqori panel va mobil pastki tablar ---------- */
.appbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top); }
.appbar-in { max-width: 1280px; margin: 0 auto; height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand-text small { font-family: var(--ar); font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.topnav { display: flex; gap: 2px; margin-inline-start: 8px; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.appbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.lang { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; padding: 0 8px; }
.netbar { text-align: center; font-size: 13px; background: var(--warn-soft); color: var(--warn); padding: 4px 12px; }
.updatebar { display: block; margin: 0 auto 8px; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .topnav { display: none; }
  .appbar-in { height: 56px; padding: 0 14px; gap: 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 500; border-radius: 10px; text-align: center; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a svg.i { width: 22px; height: 22px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) { .brand-text small { display: none; } }

main { max-width: 1280px; margin: 0 auto; padding: 28px 20px 48px; outline: none; min-height: 60vh; }
@media (max-width: 860px) { main { padding: 18px 14px 32px; } h1 { font-size: 24px; } }
.foot { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- tugmalar, maydonlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { color: var(--bad); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
.btn.block { width: 100%; }
.btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input[type="search"], input[type="text"], select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; min-height: 44px; padding: 8px 14px; }
input[type="search"], input[type="text"], textarea { width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.searchbox { position: relative; }
.searchbox svg.i { position: absolute; top: 50%; inset-inline-start: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbox input { padding-inline-start: 46px; min-height: 52px; border-radius: 14px; font-size: 16px; }
.searchbox.xl input { min-height: 60px; font-size: 17px; box-shadow: var(--shadow-1); }
label.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- kartalar, belgi, jadval ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.section { margin: 36px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); max-width: 100%; white-space: normal; overflow-wrap: break-word; line-height: 1.35; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill svg.i { width: 14px; height: 14px; }
.note { border-radius: 12px; padding: 12px 14px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table th { color: var(--ink-3); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
[lang="ar"] .table th, .table th:lang(ar) { text-transform: none; letter-spacing: 0; }
.table-wrap { overflow-x: auto; }
/* Dalil jadvali: tor ekranda har savol alohida blok (4 ustun 390px'ga sig'maydi) */
@media (max-width: 720px) {
  .ev-table thead { display: none; }
  .ev-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .ev-table td { display: block; border: 0; padding: 3px 0; overflow-wrap: break-word; }
  .ev-table td.q { font-weight: 600; color: var(--ink); padding-bottom: 6px; }
  .ev-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
}
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14.5px; }
dl.meta dt { color: var(--ink-3); } dl.meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.meta { grid-template-columns: 1fr; gap: 2px; } dl.meta dd { margin-bottom: 8px; } }
details.disclose > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--accent); }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary svg.i { transition: transform .15s; }
details.disclose[open] > summary svg.i.chev { transform: rotate(90deg); }
[dir="rtl"] details.disclose[open] > summary svg.i.chev { transform: scaleX(-1) rotate(90deg); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty svg.i { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: stretch; }
.hero-main { padding: 36px; border-radius: var(--radius-l); background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 55%),
  linear-gradient(180deg, var(--surface) 0%, var(--surface) 100%); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.hero-ar { font-family: var(--ar); font-size: 22px; color: var(--accent); margin-bottom: 6px; }
.hero h1 { font-size: 40px; margin-bottom: 12px; letter-spacing: -.02em; }
.hero .lead { font-size: 17px; color: var(--ink-2); max-width: 46ch; margin-bottom: 22px; }
.hero .searchbox { margin-bottom: 16px; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.continue { display: block; text-decoration: none; color: inherit; border-radius: var(--radius-l); padding: 22px; background: var(--navy); color: #f3f5f8; box-shadow: var(--shadow-2); }
:root[data-theme="dark"] .continue { background: #24344a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .continue { background: #24344a; } }
.continue .eyebrow { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.continue .ttl { font-family: var(--ar); font-size: 24px; margin: 6px 0 2px; }
.continue .ex { font-family: var(--ar); font-size: 19px; line-height: 1.9; opacity: .92; margin: 8px 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.stat-card { border-radius: var(--radius-l); padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div b { display: block; font-size: 24px; letter-spacing: -.02em; } .stats div span { font-size: 13px; color: var(--ink-3); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.step { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.step b { display: block; margin-bottom: 4px; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } .hero-main { padding: 24px 20px; } .hero h1 { font-size: 32px; } }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }

/* ---------- kitob kartalari (katalog) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.book { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; min-height: 190px; }
.book:hover { border-color: var(--line-2); transform: translateY(-1px); }
.book .spine { position: absolute; inset-block: 14px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--bk); }
[dir="rtl"] .book .spine { border-radius: 4px 0 0 4px; }
.book .ttl-ar { font-family: var(--ar); font-size: 24px; line-height: 1.6; direction: rtl; text-align: right; color: var(--ink); }
.book .ttl-en { font-weight: 650; font-size: 15.5px; }
.book .auth { font-size: 13.5px; color: var(--ink-2); }
.book .auth .ar-i { font-size: 1.05em; }
.book .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; align-items: center; }
.book .cta { margin-inline-start: auto; font-weight: 650; font-size: 14px; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- kitob sahifasi (landing) ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.crumbs svg.i { width: 14px; height: 14px; }
.book-hero { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; padding: 28px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.cover { aspect-ratio: 3 / 4; border-radius: 12px; background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, var(--navy)) 100%);
  color: var(--accent-ink); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 14px; text-align: center; box-shadow: var(--shadow-2); }
.cover .c-ar { font-family: var(--ar); font-size: 22px; line-height: 1.6; }
.cover .c-orn { width: 46px; height: 2px; background: currentColor; opacity: .5; margin: 10px 0; }
.cover .c-en { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.book-hero h1.ttl-ar { display: inline-block; font-family: var(--ar); font-weight: 700; font-size: 38px; line-height: 1.55; margin: 0; }
.book-hero .ttl-en { font-size: 20px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.book-hero .auth { color: var(--ink-2); margin-bottom: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 20px; font-size: 14px; color: var(--ink-2); }
.facts b { color: var(--ink); }
@media (max-width: 760px) { .book-hero { grid-template-columns: 1fr; padding: 20px; gap: 16px; } .cover { width: 120px; } .book-hero h1.ttl-ar { font-size: 30px; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 28px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; font-weight: 600; font-size: 15px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 16px; }
.chapter-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.chapter-link:hover { background: var(--surface); border-color: var(--line); }
.chapter-link .ci { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-size: 13px; font-weight: 700; flex: none; }
.chapter-link .ct { font-family: var(--ar); font-size: 19px; line-height: 1.6; flex: 1; min-width: 0; direction: rtl; text-align: right; }
.chapter-link .cn { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.comm-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.comm-card + .comm-card { margin-top: 10px; }
.comm-card .ttl-ar { font-family: var(--ar); font-size: 21px; line-height: 1.6; }
.comm-card .sub { font-size: 13.5px; color: var(--ink-2); }
.comm-card .acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 640px) { .comm-card { grid-template-columns: auto 1fr; } .comm-card .acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
.installbar { position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); }
.installbar .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
@media (max-width: 860px) { .installbar { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---------- mundarija (o'quvchi) ---------- */
.reader-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc-side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toc-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 4px 6px 10px; }
.toc-side input { min-height: 40px; margin-bottom: 8px; font-size: 14px; }
.toc-ch { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: start; padding: 8px 10px; border-radius: 10px; border: 0; background: none; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.toc-ch:hover { background: var(--surface-2); color: var(--ink); }
.toc-ch[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.toc-ch .n { font-size: 12px; color: var(--ink-3); min-width: 22px; }
.toc-ch .t { font-family: var(--ar); font-size: 17px; line-height: 1.6; flex: 1; direction: rtl; text-align: right; }
.toc-ch .c { font-size: 11.5px; color: var(--ink-3); }
.drawer-btn { display: none; }
@media (max-width: 960px) {
  .reader-layout { grid-template-columns: 1fr; }
  .toc-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 360px); max-height: none; z-index: 60; border-radius: 0; transform: translateX(-105%); transition: transform .2s; padding-top: calc(16px + env(safe-area-inset-top)); }
  [dir="rtl"] .toc-side { transform: translateX(105%); }
  .toc-side.open { transform: none !important; box-shadow: var(--shadow-2); }
  .drawer-btn { display: inline-flex; }
}
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 55; }
.ch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.ch-head .ch-ttl { font-family: var(--ar); font-size: 30px; line-height: 1.6; margin: 0; }
.ch-head .ch-sub { font-size: 14px; color: var(--ink-3); }
.entries { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.entry { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.entries li:first-child .entry { border-top: 0; }
.entry:hover { background: var(--surface-2); }
.entry .num { justify-self: start; min-width: 52px; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.entry .num.none { background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: 12px; }
.entry .ex { font-family: var(--ar); font-size: 19px; line-height: 1.85; direction: rtl; text-align: right; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .entry { grid-template-columns: 1fr; gap: 6px; padding: 14px; } .entry .ex { font-size: 18px; } }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; }
.jump { display: flex; gap: 8px; align-items: center; }
.jump input { width: 120px; min-height: 40px; }

/* ---------- hadis o'quvchi ---------- */
.read-wrap { display: grid; grid-template-columns: minmax(0, var(--col)) 360px; gap: 32px; justify-content: center; align-items: start; }
.read-wrap.focus { grid-template-columns: minmax(0, var(--col)); }
.read-wrap.focus .inspector { display: none; }
@media (max-width: 1180px) { .read-wrap { grid-template-columns: minmax(0, var(--col)); } }
.read-col { min-width: 0; }
.read-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .read-top { flex-wrap: nowrap; }
  .read-top .btn { padding: 0 10px; }
  .read-top .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.hadith-head { margin: 4px 0 18px; }
.hadith-head .kitab { font-family: var(--ar); font-size: 18px; color: var(--ink-2); direction: rtl; text-align: right; }
.hadith-head .hn { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hadith-head .hn h1 { margin: 0; font-size: 26px; }
.nav-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nav-pn > a, .nav-pn > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); min-height: 64px; justify-content: center; }
.nav-pn > a:hover { border-color: var(--accent); }
.nav-pn .dir { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.nav-pn .where { font-weight: 650; font-size: 15px; }
.nav-pn .next { text-align: end; align-items: flex-end; }
.nav-pn > span[aria-disabled="true"] { opacity: .5; }
.nav-pn.top > a, .nav-pn.top > span { min-height: 48px; padding: 8px 14px; }
.text-card { margin: 16px 0; padding: 34px 40px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.text-card .src { font-family: var(--ar); font-size: var(--read-size); line-height: var(--read-lh); direction: rtl; text-align: right; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.text-card .src.nomarks { font-feature-settings: normal; }
@media (max-width: 640px) { .text-card { padding: 22px 18px; border-radius: var(--radius); margin-inline: -4px; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.narr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: 14px; color: var(--ink-2); }
.person { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.person .ar-i { font-size: 17px; }
.nm-inline { font: inherit; color: inherit; background: none; border: 0; padding: 0 2px; margin: 0; cursor: pointer; border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 2px; }
.nm-inline:hover, .nm-inline[aria-expanded="true"] { background: var(--accent-soft); }
.person[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.panel-below { margin: 16px 0; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--accent); }
.panel-below h3 { margin: 0 0 4px; }
.res-list { list-style: none; margin: 12px 0 0; padding: 0; }
.res-list li { border-top: 1px solid var(--line); padding: 12px 0; }
.res-list .rh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.res-list .rx { font-family: var(--ar); font-size: 18px; line-height: 1.9; direction: rtl; text-align: right; margin: 6px 0 0; }
.res-list .rx.full { white-space: pre-line; }
.chain { margin: 0 0 16px; }
.chain-body { padding: 4px 2px 8px; }
.evidence { margin-top: 18px; }
.ev-sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ev-sum li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.ev-sum li svg.i { width: 18px; height: 18px; margin-top: 2px; }
.ev-sum li.ok svg.i { color: var(--good); } .ev-sum li.warn svg.i { color: var(--warn); } .ev-sum li.bad svg.i { color: var(--bad); } .ev-sum li.none svg.i { color: var(--ink-3); }
.ev-sum b { color: var(--ink); font-weight: 600; }
.inspector { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.insp-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.insp-card + .insp-card { margin-top: 14px; }
.insp-card h2 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cgroup { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.cgroup .cg-ttl { font-family: var(--ar); font-size: 19px; line-height: 1.6; }
.cgroup .cg-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.passages { display: flex; flex-wrap: wrap; gap: 6px; }
.passage { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.passage[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.c-preview { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.c-preview .src { font-family: var(--ar); font-size: 19px; line-height: 2; direction: rtl; text-align: right; white-space: pre-line; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.settings-pop { position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + 8px); width: 300px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.set-row:first-child { border-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 13.5px; border: 0; background: var(--surface); color: var(--ink-2); padding: 6px 10px; cursor: pointer; min-width: 38px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.rel { position: relative; }
.note-box textarea { min-height: 90px; margin: 8px 0; }
.mu-label { display: inline-flex; gap: 6px; align-items: center; }

/* sharh sahifasi */
.seg-block { border-inline-start: 3px solid var(--line-2); padding-inline-start: 16px; margin: 14px 0; }
.seg-block .who { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.seg-block.r-commentator { border-color: var(--accent); } .seg-block.r-hadith_text { border-color: var(--navy); } .seg-block.r-quoted_scholar { border-color: var(--gold); } .seg-block.r-attribution_unresolved { border-color: var(--bad); }
.seg-block .src { font-family: var(--ar); font-size: 22px; line-height: 2.05; direction: rtl; text-align: right; white-space: pre-line; overflow-wrap: anywhere; margin: 0; }

/* qidiruv */
.search-head { max-width: 860px; }
.searchbox.grow { flex: 1 1 320px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.filters select { min-height: 40px; font-size: 14px; }
.hits { display: grid; gap: 12px; margin-top: 16px; }
.hit { display: block; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.hit:hover { border-color: var(--accent); }
.hit .hh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.hit .hx { font-family: var(--ar); font-size: 20px; line-height: 1.95; direction: rtl; text-align: right; margin: 0; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
#q { font-family: var(--ar); font-size: 20px; }

/* mening kutubxonam */
.lib-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.lib-row + .lib-row { margin-top: 10px; }
.lib-row .ttl-ar { font-family: var(--ar); font-size: 21px; line-height: 1.6; }
.lib-row .sub { font-size: 13.5px; color: var(--ink-3); }
.lib-row .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 640px) { .lib-row { grid-template-columns: 1fr; } .lib-row .acts { justify-content: flex-start; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.platform { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.platform svg.i { width: 26px; height: 26px; color: var(--accent); }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 13px; direction: ltr; text-align: left; }

/* bildirishnomalar */
.toast { position: fixed; z-index: 70; inset-inline: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-size: 14.5px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast .t-title { font-weight: 700; margin-bottom: 4px; display: block; }
.toast .bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--bg) 25%, transparent); margin-top: 10px; overflow: hidden; }
.toast .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.toast a { color: inherit; }
.toast .btn { margin-top: 10px; background: var(--bg); color: var(--ink); border-color: var(--bg); }
@media (max-width: 860px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.nusxa-maydon { width: 100%; min-height: 160px; }

/* statik sahifalar (en/ar) */
.site main { max-width: 1080px; }
.site .appbar-in { height: 60px; }
.site .topnav { display: flex; flex-wrap: wrap; }
@media (max-width: 860px) { .site .topnav { display: flex; overflow-x: auto; margin-inline-start: 0; } .site .appbar-in { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 14px; } .site body, body.site { padding-bottom: 0; } }
.site .prose { max-width: 70ch; }
.site table.table { margin: 8px 0; }

/* ================================================================ V7: to'plam → Kitob → Bob → hadis */
.block { display: block; }
body.no-scroll { overflow: hidden; }
.grp-h { font-size: 15px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 30px 0 12px; }
[lang="ar"] .grp-h, :root[data-lang="ar"] .grp-h { text-transform: none; letter-spacing: 0; font-size: 17px; }
.bgsec:first-child .grp-h { margin-top: 8px; }
.ok-note { background: var(--good-soft); color: var(--good); }
.note svg.i { width: 16px; height: 16px; vertical-align: -3px; }

/* to'plamning ichki Kitoblari: ixcham ko'p ustunli ro'yxat */
.kgrid { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 14px; }
.kcell { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "no kt" "no kn" "no km"; gap: 0 10px; align-items: center; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: inherit; border: 1px solid transparent; }
.kcell:hover { background: var(--surface); border-color: var(--line); }
.kcell .no { grid-area: no; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kcell .kt { grid-area: kt; font-family: var(--ar); font-size: 19px; line-height: 1.55; direction: rtl; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
.kcell .kn { grid-area: kn; font-size: 13px; font-weight: 600; color: var(--bk); text-align: end; }
.kcell .km { grid-area: km; font-size: 12.5px; color: var(--ink-3); text-align: end; }
.kcell:hover .no { background: color-mix(in srgb, var(--bk) 18%, var(--surface-2)); color: var(--bk); }

/* mundarija va o'qish: chap daraxt + o'ng ustun */
.cv-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 28px; align-items: start; }
.cv-side { position: sticky; top: 72px; }
.cv-side .tree { max-height: calc(100vh - 92px); overflow: auto; overscroll-behavior: contain; }
.tree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; }
.tree-head { position: sticky; top: -12px; z-index: 1; background: var(--surface); padding: 2px 4px 8px; margin: -2px 0 4px; }
.tree-head h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 2px 2px 8px; }
:root[data-lang="ar"] .tree-head h2 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.tree-head input { min-height: 40px; font-size: 14px; }
.tk-list, .tb-list { list-style: none; margin: 0; padding: 0; }
.tk { display: grid; grid-template-columns: 26px 1fr auto 16px; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink-2); min-height: 40px; }
.tk:hover { background: var(--surface-2); color: var(--ink); }
.tk .no, .tb .no { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: center; }
.tk .tt { font-family: var(--ar); font-size: 17px; line-height: 1.55; direction: rtl; text-align: right; overflow-wrap: anywhere; }
.tk .cnt, .tb .cnt { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tk svg.chev { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s; }
.tk[aria-expanded="true"] svg.chev { transform: rotate(90deg); }
[dir="rtl"] .tk[aria-expanded="true"] svg.chev { transform: scaleX(-1) rotate(90deg); }
.tk-item.cur > .tk { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.tk-item.cur > .tk .no { color: var(--accent); }
.tb-list { margin: 2px 0 8px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); margin-inline-start: 20px; }
.tb-list > li.tiny { padding: 4px 8px; }
.tb { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: baseline; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink-2); position: relative; }
.tb:hover { background: var(--surface-2); color: var(--ink); }
.tb .tt { font-family: var(--ar); font-size: 15.5px; line-height: 1.65; direction: rtl; text-align: right; overflow-wrap: anywhere; }
.tb[aria-current="location"] { background: var(--accent-soft); color: var(--ink); }
.tb[aria-current="location"]::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: -16px; width: 3px; border-radius: 2px; background: var(--accent); }

.cv-col { min-width: 0; }
.locwrap { position: sticky; top: 60px; z-index: 20; height: 0; }
.locspace { height: 60px; }
.locbar { position: absolute; inset-inline: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; min-height: 46px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); }
.locbar .loc-text { flex: 1 1 120px; min-width: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.locbar .loc-bab { font-family: var(--ar); font-size: 16px; }
.locbar .sep { color: var(--ink-3); }
.locbar .loc-tools { display: flex; gap: 6px; align-items: center; flex: none; }
.menu-btn { display: none; }
.cv-main { min-width: 0; }
.kit-head { padding: 6px 2px 14px; border-bottom: 2px solid color-mix(in srgb, var(--bk) 55%, var(--line)); margin-bottom: 8px; }
.kit-head .eyebrow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.bk-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--bk); flex: none; }
.kit-head .kit-name { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--bk); text-align: end; }
.loc-kit { font-weight: 600; }
.kit-head h1 { font-family: var(--ar); font-weight: 700; font-size: 34px; line-height: 1.6; margin: 4px 0 2px; }

/* bob guruhi (mundarija): to'liq sarlavha, ixcham kirish, neytral hadis qatorlari */
.bgroup { padding: 18px 0 10px; border-top: 1px solid var(--line); scroll-margin-top: 130px; }
.bgroup:first-of-type { border-top: 0; }
.bmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.bmeta span:first-child { color: var(--bk); font-weight: 600; }
.warn-t, .bmeta .warn-t { color: var(--warn); }
.btitle { font-family: var(--ar); font-weight: 700; font-size: 22px; line-height: 1.7; margin: 0 0 6px; direction: rtl; text-align: right; overflow-wrap: anywhere; }
.btitle a { color: var(--ink); text-decoration: none; }
.btitle a:hover { color: var(--accent); text-decoration: underline; }
.bintro { margin: 0 0 6px; }
.bintro > summary { min-height: 36px; font-size: 14px; }
.src.sm, .bintro .src.sm { font-family: var(--ar); font-size: 18px; line-height: 1.95; direction: rtl; text-align: right; white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); margin: 0 0 6px; }
.hrows { list-style: none; margin: 4px 0 0; padding: 0; }
.hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; gap: 12px; align-items: start; padding: 10px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.hrow:hover { background: var(--surface); }
.hrow .num { min-width: 46px; height: 26px; padding: 0 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 13px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; margin-top: 4px; }
.hrow .num.none { font-weight: 600; font-size: 11.5px; color: var(--ink-3); }
.hrow .hb { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hrow .who { font-family: var(--ar); font-size: 15px; color: var(--accent); direction: rtl; text-align: right; }
.hrow .ex { font-family: var(--ar); font-size: 18.5px; line-height: 1.85; direction: rtl; text-align: right; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hrow .tag { color: var(--ink-3); }
.hrow svg.go { width: 16px; height: 16px; color: var(--ink-3); margin-top: 8px; }

/* mundarija ko'rinish rejimlari */
.cv-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin: 6px 0 4px; }
.cv-main[data-mode="compact"] .hrow .ex, .cv-main[data-mode="compact"] .hrow .tag { display: none; }
.cv-main[data-mode="compact"] .hrow { padding: 6px 10px; }
.cv-main[data-mode="full"] .hrow .tag { display: none; }
.hrow .ex.full.src { display: block; -webkit-line-clamp: unset; overflow: visible; font-family: var(--ar); font-size: 18.5px; line-height: 1.95; direction: rtl; text-align: right; white-space: pre-line; margin: 0; }
.hrow .ex.full .nm { pointer-events: none; }

/* batafsil o'qish */
.reading .rbab { padding: 26px 0 8px; border-top: 3px solid color-mix(in srgb, var(--bk) 45%, var(--line)); scroll-margin-top: 130px; }
.reading .rbab:first-of-type { border-top: 0; }
.reading .btitle { font-size: 25px; }
.reading .bintro .src { font-family: var(--ar); font-size: calc(var(--read-size) * .82); line-height: var(--read-lh); direction: rtl; text-align: right; white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); margin: 0 0 8px; }
.reading .rbab > p.src { font-family: var(--ar); font-size: calc(var(--read-size) * .82); line-height: var(--read-lh); direction: rtl; text-align: right; white-space: pre-line; color: var(--ink-2); }
.hadith { margin: 14px 0; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 130px; }
.h-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.h-num { font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; padding: 2px 10px; border-radius: 8px; background: var(--surface-2); }
.h-num:hover { color: var(--accent); }
.h-tools { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.hadith .src, .tslot .src { font-family: var(--ar); font-size: var(--read-size); line-height: var(--read-lh); direction: rtl; text-align: right; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.src .cut { font-family: var(--ui); font-size: 12.5px; color: var(--ink-3); unicode-bidi: isolate; }
/* roviy rollari: oddiy sanad roviysi — nuqtali chiziq; Nabiy ﷺga eng yaqin roviy — yaxlit chiziq + qalinroq; tanlangan — fon. Rang yolg'iz belgi emas. */
.nm { font: inherit; color: inherit; background: none; border: 0; padding: 0 1px; margin: 0; cursor: pointer; border-bottom: 2px dotted color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 2px; line-height: inherit; }
.nm:hover, .nm:focus-visible { background: var(--accent-soft); }
.nm.term { border-bottom-style: solid; border-bottom-width: 3px; font-weight: 700; }
.nm.off { border-bottom-color: var(--line-2); }
.nm.sel { background: color-mix(in srgb, var(--mark) 75%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mark) 75%, transparent); }
sup.ord { font-family: var(--ui); font-size: max(10px, calc(var(--read-size) * .42)); line-height: 0; vertical-align: super; color: var(--accent); font-weight: 700; padding: 0 1px; unicode-bidi: isolate; }
.tr { margin: 10px 0 0; padding: 4px 14px 6px; border-inline-start: 3px solid color-mix(in srgb, var(--bk) 50%, var(--line)); background: var(--surface-2); border-radius: 0 10px 10px 0; }
[dir="rtl"] .tr { border-radius: 10px 0 0 10px; }
.tr > summary { min-height: 36px; font-size: 14px; }
.tr-body p { font-size: var(--tr-size); line-height: 1.7; margin: 0 0 8px; color: var(--ink); }
.tr-title { font-weight: 650; }
.tr-note { color: var(--warn); margin: 2px 0 4px; }
.tr-miss { margin: 8px 0 0; }
.pslot:empty, .cslot:empty { display: none; }
.cslot { margin-top: 10px; }
.bab-line .kitab { font-size: 20px; }

/* qisqa roviy paneli */
.npanel { margin: 12px 0 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-1); }
.hadith .npanel { background: var(--bg); }
.np-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.np-name { font-family: var(--ar); font-size: 24px; line-height: 1.6; }
.np-pos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.np-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.np-counts div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.np-counts b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.np-counts span { font-size: 12.5px; color: var(--ink-3); }
.np-bio details { margin-top: 6px; }
dl.ar-meta { grid-template-columns: max-content 1fr; font-family: var(--ar); font-size: 16px; line-height: 1.8; }
dl.ar-meta dt { color: var(--ink-3); }
.opinions .op { padding: 8px 0; border-top: 1px solid var(--line); }
.opinions .op b { font-family: var(--ar); font-size: 16px; }
.opinions blockquote { margin: 6px 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--line-2); font-family: var(--ar); font-size: 16px; line-height: 1.85; }
.opinions blockquote p { margin: 0; }
.opinions cite { display: block; font-style: normal; font-size: 13.5px; color: var(--ink-3); }

/* sanad yo'llari (alohida sahifa) */
.routes .route-box { margin: 6px 0 10px; }
.routes ol.route { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; direction: rtl; }
.routes ol.route li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-family: var(--ar); font-size: 16px; }
.routes ol.route li .pos { font-family: var(--ui); font-size: 11.5px; font-weight: 700; color: var(--accent); }

/* roviy indeksi */
.nidx { max-width: 880px; }
.ni-head h1 { font-family: var(--ar); font-size: 32px; line-height: 1.6; margin: 10px 0 0; }
.nlist { list-style: none; margin: 8px 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.nrow > a { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.nlist > li:first-child.nrow > a { border-top: 0; }
.nrow > a:hover { background: var(--surface-2); }
.nrow .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.nrow .nm-as { font-family: var(--ar); font-size: 18px; line-height: 1.7; direction: rtl; text-align: right; }
.nrow .rp { color: var(--ink-2); white-space: nowrap; }
.nrow .go { color: var(--accent); display: inline-flex; align-items: center; gap: 2px; }
.ng-k { padding: 12px 14px 4px; font-family: var(--ar); font-size: 19px; font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; direction: rtl; }
.ng-k .ng-kn { font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--ink-2); direction: ltr; }
.ng-b { display: flex; flex-direction: column; gap: 0; padding: 4px 14px 8px; background: var(--surface-2); color: var(--ink-2); }
.ng-b .ng-l { color: var(--bk); font-weight: 600; }
.ng-b .ng-t { font-family: var(--ar); font-size: 16px; line-height: 1.7; direction: rtl; text-align: right; }
.routes ol.route li .tiny { font-family: var(--ui); }
.seg a { display: inline-flex; align-items: center; font-size: 13.5px; padding: 6px 12px; min-height: 36px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.seg a[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ilmiy bog'lanish stoli */
.desk { max-width: 1100px; }
.dk-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; margin-inline-end: 8px; }
.dk-root { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; padding: 6px 0 10px; }
.dk-tree { list-style: none; margin: 0; padding: 0 0 0 0; border-inline-start: 2px solid color-mix(in srgb, var(--bk) 50%, var(--line)); margin-inline-start: 4px; }
.dk-tree > li { padding: 8px 0 8px 16px; padding-inline-start: 16px; padding-left: unset; }
.dk-work { font-size: 17px; }
.dk-eds { list-style: none; margin: 4px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--ink-2); }
.dk-eds li { padding: 3px 0; }
.dk-pin { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.dk-status { list-style: none; margin: 8px 0; padding: 0; }
.dk-status li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dk-status li[data-state="dk.stLinked"] b { color: var(--good); }
.dk-pick { margin-inline-start: 10px; }
.dk-compare { margin-top: 18px; }
.dk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.dk-col { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.dk-col .src.sm { max-height: 520px; overflow: auto; }

/* o'qish sozlamalari: ekran ichida qoladi (telefonda pastdan) */
.sheet-scrim { position: fixed; inset: 0; z-index: 59; background: transparent; }
.sheet { position: fixed; z-index: 60; top: 72px; inset-inline-end: 16px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 96px); overflow: auto;
  padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 17px; }
.set-check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; cursor: pointer; min-height: 44px; }
.set-check input { margin-top: 1px; }
.sheet .set-row { flex-wrap: wrap; }
.fs { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; justify-content: flex-end; }
.fs input[type="range"] { flex: 1; min-width: 90px; accent-color: var(--accent); height: 32px; }
.fs .icon-btn { width: 44px; height: 44px; font-weight: 700; font-size: 14px; }
.fs-out { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 640px) {
  .sheet { top: auto; bottom: 0; inset-inline: 0; width: auto; max-height: 82vh; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sheet-scrim { background: rgba(0, 0, 0, .35); }
}

/* mobil daraxt menyusi */
.drawer { position: fixed; z-index: 62; inset-block: 0; inset-inline-start: 0; width: min(92vw, 420px); background: var(--surface); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 10px 10px; }
.drawer[hidden], .drawer-scrim[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.drawer .tree { flex: 1; overflow: auto; border: 0; padding: 0 4px; }
.drawer .tree-head { top: 0; margin-top: 0; }
.drawer-scrim { position: fixed; inset: 0; z-index: 61; background: rgba(0, 0, 0, .4); }
@media (max-width: 960px) {
  .cv-layout { grid-template-columns: 1fr; }
  .cv-side { display: none; }
  .menu-btn { display: inline-flex; }
  .locwrap { top: 56px; }
}
@media (max-width: 640px) {
  .kit-head h1 { font-size: 27px; }
  .btitle { font-size: 20px; }
  .reading .btitle { font-size: 21px; }
  .hadith { padding: 14px 14px; margin-inline: -4px; }
  .h-tools .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .locbar .loc-tools .btn .lbl, .locbar .menu-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nrow > a { grid-template-columns: 54px minmax(0, 1fr); }
  .nrow .rp, .nrow .go { grid-column: 2; white-space: normal; }
  .kgrid { grid-template-columns: 1fr; }
  .np-counts b { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .appbar, .tabbar, .foot, .nav-pn, .actions, .inspector, .toolbar { display: none !important; } .text-card { border: 0; box-shadow: none; } }
/* Kitob ostidagi ﷽ (asl holida) va nashrning old qismi */
.kit-head .bism { font-family: var(--ar); font-size: 26px; line-height: 1.6; margin: 0 0 6px; color: var(--ink-2); direction: rtl; text-align: right; }
.front-matter > summary { color: var(--ink-3); }
.front-matter .fm-title { font-family: var(--ar); font-size: 18px; font-weight: 700; margin: 12px 0 4px; direction: rtl; text-align: right; color: var(--ink-2); }
.drawer .tree-head h2 { display: none; }

/* =====================================================================================================
   V8 dizayn qatlami: kitob rangi (--bk) butun sahifada, Kitob sarlavhasi — rangli lenta va islomiy
   geometrik naqsh, «shisha» panel va daraxt, roviy darajalari palitrasi, Rasululloh ﷺ so'zlari belgisi,
   o'qish chizig'i (scroll-driven animation), sahifa kirish animatsiyasi. Hammasi tokenlar orqali.
   ===================================================================================================== */
@font-face { font-family: "Amiri"; src: url("./fonts/Amiri-Arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Amiri"; src: url("./fonts/Amiri-Arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Manrope"; src: url("./fonts/Manrope-Latin-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("./fonts/Manrope-LatinExt-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ui: "HL Ligatures", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Naskh Arabic", sans-serif;
  --display-ar: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  --glass: color-mix(in srgb, var(--surface) 76%, transparent);
  --bk-ink: #ffffff;
  --hero-a: color-mix(in srgb, var(--bk) 88%, #ffffff); --hero-mid: var(--bk); --hero-b: color-mix(in srgb, var(--bk) 62%, #050806);
  --nab-bg: rgba(214, 158, 46, .17); --nab-ink: #5a3b00; --nab-line: rgba(176, 125, 18, .55);
  --lv1: #0f766e; --lv2: #2563eb; --lv3: #7c3aed; --lv4: #c026d3; --lv5: #db2777; --lv6: #ea580c; --lv7: #a16207; --lv8: #15803d; --lv9: #475569;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.1'%3E%3Crect x='21' y='21' width='30' height='30'/%3E%3Crect x='21' y='21' width='30' height='30' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='7'/%3E%3Cpath d='M0 36h9M63 36h9M36 0v9M36 63v9M0 0l9 9M72 0l-9 9M0 72l9-9M72 72l-9-9'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --bk-ink: #0b120e; --hero-a: color-mix(in srgb, var(--bk) 58%, #0a0f0c); --hero-mid: color-mix(in srgb, var(--bk) 40%, #0a0f0c); --hero-b: color-mix(in srgb, var(--bk) 16%, #050806);
  --nab-bg: rgba(227, 184, 99, .16); --nab-ink: #ffe0a3; --nab-line: rgba(227, 184, 99, .5);
  --lv1: #5eead4; --lv2: #93c5fd; --lv3: #c4b5fd; --lv4: #f0abfc; --lv5: #f9a8d4; --lv6: #fdba74; --lv7: #fcd34d; --lv8: #86efac; --lv9: #cbd5e1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bk-ink: #0b120e; --hero-a: color-mix(in srgb, var(--bk) 58%, #0a0f0c); --hero-mid: color-mix(in srgb, var(--bk) 40%, #0a0f0c); --hero-b: color-mix(in srgb, var(--bk) 16%, #050806);
    --nab-bg: rgba(227, 184, 99, .16); --nab-ink: #ffe0a3; --nab-line: rgba(227, 184, 99, .5);
    --lv1: #5eead4; --lv2: #93c5fd; --lv3: #c4b5fd; --lv4: #f0abfc; --lv5: #f9a8d4; --lv6: #fdba74; --lv7: #fcd34d; --lv8: #86efac; --lv9: #cbd5e1;
  }
}
.lv1 { --lv: var(--lv1); } .lv2 { --lv: var(--lv2); } .lv3 { --lv: var(--lv3); } .lv4 { --lv: var(--lv4); } .lv5 { --lv: var(--lv5); }
.lv6 { --lv: var(--lv6); } .lv7 { --lv: var(--lv7); } .lv8 { --lv: var(--lv8); } .lv9 { --lv: var(--lv9); } .lv0 { --lv: var(--ink-3); }

h1, h2, h3, .btn, .appbar { font-feature-settings: "ss01", "cv11"; }
h1 { font-weight: 800; letter-spacing: -.025em; }
h2 { font-weight: 750; }

/* yuqori panel: shisha, kitob rangidagi chiziq; kitob sahifalarida o'qish jarayoni chizig'i */
.appbar { background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
html[data-book] .appbar { border-bottom-color: color-mix(in srgb, var(--bk) 35%, var(--line)); }
html[data-book] .appbar::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--bk), color-mix(in srgb, var(--bk) 40%, var(--gold))); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
html[dir="rtl"][data-book] .appbar::after { transform-origin: 100% 50%; }
@supports (animation-timeline: scroll()) {
  html[data-book] .appbar::after { animation: hl-progress linear both; animation-timeline: scroll(root block); }
}
@keyframes hl-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* sahifa almashinuvi: yangi sahifa yengil ko'tarilib paydo bo'ladi */
@media (prefers-reduced-motion: no-preference) {
  #asosiy.enter { animation: hl-enter .26s ease-out; }
  @keyframes hl-enter { from { opacity: 0; } to { opacity: 1; } }
}

/* Kitob sarlavhasi: kitob rangidagi lenta + naqsh */
.kit-head { position: relative; isolation: isolate; overflow: hidden; padding: 24px 26px 20px; margin: 0 0 16px; border: 0; border-radius: 24px; color: #fff;
  background: radial-gradient(130% 150% at 100% 0%, var(--hero-a) 0%, var(--hero-mid) 42%, var(--hero-b) 100%);
  box-shadow: 0 22px 46px -26px color-mix(in srgb, var(--bk) 85%, transparent); }
.kit-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 72px 72px; opacity: .14; }
.kit-head::after { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; inset-inline-start: -120px; bottom: -200px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent); }
.kit-head h1 { font-family: var(--display-ar); font-weight: 700; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.45; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .18); }
.kit-head .eyebrow, .kit-head .small, .kit-head .muted { color: rgba(255, 255, 255, .86); }
.kit-head .bk-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.kit-head .kit-name { color: #fff; opacity: .95; font-size: 16px; letter-spacing: .01em; }
.kit-head .bism { color: #fff; font-family: var(--display-ar); font-size: 30px; opacity: .95; }
.kit-head .btn { border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .08); }
.kit-head .btn:hover { background: rgba(255, 255, 255, .18); }
.kit-head .btn.primary { background: #fff; color: color-mix(in srgb, var(--bk) 75%, #000); border-color: #fff; }
:root[data-theme="dark"] .kit-head .btn.primary { color: #0b120e; }

/* chap daraxt: shisha panel, Kitob yoyiladi/yig'iladi, faol Kitob va bob kitob rangida */
.cv-side .tree { background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, var(--bk) 18%, var(--line));
  border-radius: 20px; padding: 10px 8px; box-shadow: 0 16px 40px -30px color-mix(in srgb, var(--bk) 70%, transparent); }
.tk-item { position: relative; }
.tk { grid-template-columns: 26px 1fr auto; padding-inline-end: 40px; transition: background .15s; }
.tk .no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; }
.tk .tn { display: block; font-family: var(--ui); font-size: 11.5px; font-weight: 650; color: var(--bk); text-align: end; line-height: 1.3; }
.tk-tog { position: absolute; inset-inline-end: 6px; top: 7px; width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; }
.tk-tog:hover { background: var(--surface-2); color: var(--ink); }
.tk-tog:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tk-tog svg { width: 15px; height: 15px; transition: transform .2s; }
.tk-tog[aria-expanded="true"] svg { transform: rotate(90deg); }
.tk-item.cur > .tk { background: linear-gradient(135deg, color-mix(in srgb, var(--bk) 20%, var(--surface)), color-mix(in srgb, var(--bk) 7%, var(--surface))); color: var(--ink); }
.tk-item.cur > .tk .no { background: var(--bk); color: var(--bk-ink); }
.tb-list { border-inline-start: 2px solid color-mix(in srgb, var(--bk) 22%, var(--line)); margin-inline-start: 20px; }
.tb[aria-current="location"] { background: color-mix(in srgb, var(--bk) 15%, transparent); color: var(--ink); }
.tb[aria-current="location"]::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: -17px; width: 4px; border-radius: 4px; background: var(--bk);
  box-shadow: 0 0 12px color-mix(in srgb, var(--bk) 60%, transparent); }

/* joy satri — shisha */
.locbar { background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: color-mix(in srgb, var(--bk) 22%, var(--line)); }

/* bob guruhi va hadis kartalari */
.btitle, .reading .btitle { font-family: var(--display-ar); font-weight: 700; }
.bmeta span:first-child { color: var(--bk); }
.reading .rbab { border-top: 0; position: relative; }
.reading .rbab::before { content: ""; display: block; height: 2px; margin-bottom: 18px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bk) 60%, transparent), transparent); }
.hadith { position: relative; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--bk) 14%, var(--line));
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02), 0 14px 34px -28px color-mix(in srgb, var(--bk) 75%, transparent); transition: box-shadow .2s, border-color .2s; }
.hadith:hover { border-color: color-mix(in srgb, var(--bk) 30%, var(--line)); }
.hadith::before { content: ""; position: absolute; inset-block: 20px; inset-inline-start: -1px; width: 4px; border-radius: 4px; background: linear-gradient(var(--bk), color-mix(in srgb, var(--bk) 40%, var(--gold))); }
.h-num { background: var(--bk); color: var(--bk-ink); box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--bk) 80%, transparent); }
.h-num:hover { color: var(--bk-ink); filter: brightness(1.08); }
.text-card { border-radius: 20px; border-color: color-mix(in srgb, var(--bk) 16%, var(--line)); }
.hadith-head h1 { font-weight: 800; }
.hadith-head .kitab { font-family: var(--display-ar); }

/* roviylar: daraja ranglari (matndagi kichik raqamlar, chiziq ostidagi rang, panel va ro'yxat) */
.nm[class*=" lv"] { text-decoration-color: color-mix(in srgb, var(--lv) 70%, transparent); }
.nm.term { text-decoration-thickness: 2px; }
sup.ord[class*=" lv"] { color: var(--lv); font-weight: 800; }
.pill.lvp { color: var(--lv, var(--accent)); background: color-mix(in srgb, var(--lv, var(--accent)) 14%, var(--surface)); border-color: color-mix(in srgb, var(--lv, var(--accent)) 35%, transparent); }

/* Rasululloh ﷺ so'zlari: yengil oltin fon (matn o'zgarmaydi) */
.nabawi { background: var(--nab-bg); color: var(--nab-ink); border-radius: .35em; padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  box-shadow: inset 0 -.12em 0 var(--nab-line); }

/* faqat ismlar: ism ← ism ← … ← النبي ﷺ */
.src.compact .chainline { display: block; margin: 0 0 .35em; padding: .25em .6em; border-radius: 14px; font-size: .78em; line-height: 2.1;
  background: color-mix(in srgb, var(--bk) 9%, transparent); border: 1px dashed color-mix(in srgb, var(--bk) 30%, transparent); }
.chainline .arr { color: var(--bk); opacity: .8; font-weight: 700; }
.chainline .nabi { color: var(--nab-ink); font-weight: 700; }
.chainline .more-routes { font-family: var(--ui); color: var(--ink-3); }
.chain-tog[aria-pressed="true"] { background: color-mix(in srgb, var(--bk) 16%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--bk) 40%, transparent); }

/* hadis ostidagi qisqa roviy paneli: son va darajalar */
.npanel { border: 1px solid color-mix(in srgb, var(--bk) 35%, var(--line)); border-radius: 20px; background:
  linear-gradient(160deg, color-mix(in srgb, var(--bk) 7%, var(--surface)), var(--surface) 60%); box-shadow: 0 18px 40px -30px color-mix(in srgb, var(--bk) 80%, transparent); }
.np-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; font-size: 14px; color: var(--ink-2); }
.np-big b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--bk); font-variant-numeric: tabular-nums; }
.lvbars { display: grid; gap: 6px; margin: 8px 0 10px; }
.lvbar { display: grid; grid-template-columns: minmax(84px, auto) 1fr 44px; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: start; width: 100%; }
button.lvbar { cursor: pointer; }
button.lvbar:hover { background: var(--surface-2); }
button.lvbar[aria-pressed="true"] { border-color: color-mix(in srgb, var(--lv) 55%, transparent); background: color-mix(in srgb, var(--lv) 10%, var(--surface)); }
.lvbar .lbl { font-weight: 650; color: var(--lv); }
.lvbar .track { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.lvbar .fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 10px; background: linear-gradient(90deg, var(--lv), color-mix(in srgb, var(--lv) 55%, #fff)); }
.lvbar .n { font-variant-numeric: tabular-nums; text-align: end; }

/* roviy sahifasi */
.ni-head { position: relative; isolation: isolate; overflow: hidden; padding: 22px 24px; border-radius: 24px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(130% 150% at 100% 0%, var(--hero-a) 0%, var(--hero-mid) 45%, var(--hero-b) 100%); }
.ni-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 72px 72px; opacity: .13; }
.ni-head h1 { font-family: var(--display-ar); color: #fff; font-size: clamp(28px, 4vw, 42px); }
.ni-head .small, .ni-head .tiny, .ni-head .eyebrow, .ni-head .faint, .ni-head .muted { color: rgba(255, 255, 255, .86); }
.ni-head .bk-dot { background: #fff; }
.ni-head .ltr-id { color: #fff; }
.lv-card { margin: 12px 0 16px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.lv-card .h3 { font-size: 16px; margin: 0 0 2px; }
.nrow > a { border-inline-start: 4px solid var(--lv, var(--line)); }
.nrow .where { grid-column: 2 / -1; color: var(--ink-3); }
.nrow .where [lang="ar"] { font-family: var(--ar); font-size: 14px; }
.lvdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lv); margin-inline-end: 6px; vertical-align: middle; }
.ni-bio { margin-top: 18px; }

/* kitoblar ro'yxati va kartalar: kitob rangidagi yengil fon va naqsh */
.book { overflow: hidden; isolation: isolate; border-color: color-mix(in srgb, var(--bk) 16%, var(--line)); transition: transform .18s, box-shadow .18s, border-color .18s; }
.book::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--bk), color-mix(in srgb, var(--bk) 35%, var(--gold))); }
.book::after { content: ""; position: absolute; z-index: -1; inset-block-start: -40px; inset-inline-end: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bk) 16%, transparent), transparent); }
.book:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -28px color-mix(in srgb, var(--bk) 80%, transparent); border-color: color-mix(in srgb, var(--bk) 40%, var(--line)); }
.cover { background: radial-gradient(130% 140% at 100% 0%, var(--hero-a), var(--hero-mid) 45%, var(--hero-b)); position: relative; isolation: isolate; overflow: hidden; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 56px 56px; opacity: .16; }
.kcell:hover { border-color: color-mix(in srgb, var(--bk) 40%, var(--line)); box-shadow: 0 12px 26px -22px color-mix(in srgb, var(--bk) 80%, transparent); }
.comm-card, .insp-card { border-color: color-mix(in srgb, var(--bk) 22%, var(--line)); }
.hero-main { position: relative; isolation: isolate; overflow: hidden; }
.hero-main::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 80px 80px; opacity: .05; filter: invert(1); }
:root[data-theme="dark"] .hero-main::before { filter: none; opacity: .06; }

/* alohida hadis sahifasi: chapda daraxt + markazda hadis + o'ngda sharhlar */
.unit-layout .read-wrap { max-width: none; margin: 0; }
/* chap daraxt bor: sharhlar paneli keng ekranda o'ngda, qolganida hadis ostida (matn tor bo'lib qolmasin) */
@media (max-width: 1699px) { .unit-layout .read-wrap { grid-template-columns: minmax(0, 1fr); } .unit-layout .inspector { position: static; max-height: none; overflow: visible; } }
@media (max-width: 960px) { .unit-layout .menu-btn { display: inline-flex; } }
@media (min-width: 961px) { .read-top .menu-btn { display: none; } }

/* matnda zikr qilinmagan (oldingi sanaddan davom etadigan) roviylar — matn tepasida kichik satr */
.src .implied { display: block; margin: 0 0 .4em; font-family: var(--ui); font-size: .5em; line-height: 1.8; color: var(--ink-3); }
.src .implied bdi { font-family: var(--ar); font-size: 1.35em; color: var(--ink-2); margin-inline-start: .15em; }
.src .implied sup.ord { margin-inline-end: .1em; }
.note.warn { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
