/* Hadith section (hadith-hub.php, hadith-cat.php, hadith.php) */
.hd-page { --hd-pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23a07a4a' stroke-opacity='.16' stroke-width='1'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='5'/%3E%3C/g%3E%3C/svg%3E"); }

/* ── hub hero + search ── */
.hd-hero { position: relative; z-index: 5; margin: 6px 0 26px; padding: 34px 26px 28px; border-radius: 28px; text-align: center; border: 1px solid var(--t-border);
    background: radial-gradient(circle at 50% -30%, color-mix(in srgb, var(--t-accent) 22%, transparent), transparent 65%), var(--hd-pat), var(--t-card); }
.hd-hero-star { display: block; width: 50px; height: 50px; margin: 0 auto 6px; color: var(--t-accent); }
.hd-hero-ar { margin: 0; font: 400 20px/1.4 'Amiri', serif; color: var(--t-accent); }
.hd-hero-h1 { margin: 2px 0 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--t-text); }
.hd-hero-sub { margin: 10px auto 22px; max-width: 620px; font-size: 15.5px; line-height: 1.6; color: var(--t-text-secondary); }
.hd-search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 720px; margin: 0 auto; padding: 6px 6px 6px 18px; border-radius: 18px; border: 1px solid var(--t-border); background: var(--t-bg); text-align: start; box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .3); }
.hd-search:focus-within { border-color: var(--t-accent); }
.hd-search > svg { width: 18px; height: 18px; flex: none; color: var(--t-text-secondary); }
.hd-search input { flex: 1; min-width: 0; padding: 12px 4px; border: 0; background: none; color: var(--t-text); font: inherit; font-size: 16px; outline: none; }
.hd-search button[type=submit] { flex: none; padding: 11px 18px; border: 0; border-radius: 13px; background: var(--t-accent); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.hd-suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; border-radius: 16px; border: 1px solid var(--t-border); background: var(--t-card); box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .4); max-height: 60vh; overflow: auto; }
.hd-suggest a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--t-text); text-decoration: none; font-size: 14px; line-height: 1.4; }
.hd-suggest a span { flex: 1; min-width: 0; }
.hd-suggest a:hover, .hd-suggest a.is-on { background: var(--t-bg); }
.hd-sg-all button { width: 100%; padding: 10px 12px; border: 0; border-radius: 11px; background: none; color: var(--t-accent); font: inherit; font-weight: 700; font-size: 13.5px; text-align: start; cursor: pointer; }
.hd-sg-none { padding: 12px; font-size: 14px; color: var(--t-text-secondary); }
.hd-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.hd-dot.is-hasan { background: #0ea5e9; }

/* ── grade badge ── */
.hd-grade { display: inline-flex; align-items: center; flex: none; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: rgba(22, 163, 74, .12); color: #15803d; }
.hd-grade.is-hasan { background: rgba(14, 165, 233, .13); color: #0369a1; }
.hd-grade.is-other { background: var(--t-bg); color: var(--t-text-secondary); }
[data-theme="midnight"] .hd-grade.is-sahih, [data-theme="slate"] .hd-grade.is-sahih { color: #4ade80; }
[data-theme="midnight"] .hd-grade.is-hasan, [data-theme="slate"] .hd-grade.is-hasan { color: #7dd3fc; }

/* ── hadith of the day ── */
.hd-today { margin: 0 0 34px; }
.hd-today-k { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t-accent); }
.hd-today-card { display: grid; gap: 14px; padding: 24px 26px; border-radius: 24px; border: 1px solid var(--t-border); background: var(--t-card); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.hd-today-card:hover { border-color: var(--t-accent); transform: translateY(-2px); }
.hd-today-ar { font: 400 clamp(1.25rem, 2.6vw, 1.6rem)/1.9 'Amiri', serif; color: var(--t-text); text-align: right; }
.hd-today-t { font-size: 16.5px; line-height: 1.7; color: var(--t-text); }
.hd-today-m { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--t-text-secondary); }
.hd-today-m b { margin-inline-start: auto; color: var(--t-accent); }

/* ── topics ── */
.hd-topics h2, .hd-results h2, .hd-rel h2 { margin: 0 0 14px; font-family: "Space Grotesk", sans-serif; font-size: 1.45rem; }
.hd-results { margin: 0 0 34px; }
.hd-results h2 small { font-size: .9rem; color: var(--t-text-secondary); font-weight: 600; }
.hd-empty { color: var(--t-text-secondary); }
.hd-roots { columns: 3 300px; column-gap: 14px; }
.hd-root { break-inside: avoid; margin: 0 0 14px; padding: 6px; border-radius: 20px; background: var(--t-card); }
.hd-root-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 15px; color: var(--t-text); text-decoration: none; }
.hd-root-h:hover { background: var(--t-bg); }
.hd-root-h strong { font-size: 16px; }
.hd-root-h span { flex: none; font-size: 12px; font-weight: 600; color: var(--t-accent); }
.hd-root ul { list-style: none; margin: 0; padding: 0 0 6px; }
.hd-root li a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px; border-radius: 11px; color: var(--t-text-secondary); font-size: 14px; text-decoration: none; }
.hd-root li a:hover { background: var(--t-bg); color: var(--t-text); }
.hd-root li a span { flex: none; font-size: 12px; opacity: .8; }
.hd-root .hd-more a { color: var(--t-accent); font-weight: 600; }

/* ── lists (category, related, results) ── */
.hd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hd-list li + li { border-top: 1px solid var(--t-border); }
.hd-list a { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "t" "m"; align-items: start; gap: 8px 18px; padding: 16px 4px; color: var(--t-text); text-decoration: none; }
.hd-li-t { grid-area: t; min-width: 0; font-weight: 600; font-size: 15.5px; line-height: 1.5; transition: color .15s; }
.hd-list a:hover .hd-li-t { color: var(--t-accent); }
.hd-li-n { grid-area: n; padding-top: 3px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t-text-secondary); opacity: .75; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hd-li-m { grid-area: m; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--t-text-secondary); }
.hd-li-m .hd-grade, [data-theme] .hd-li-m .hd-grade { padding: 2px 9px; background: color-mix(in srgb, var(--t-accent) 13%, transparent); color: var(--t-accent); font-size: 11.5px; }
.hd-li-m .hd-grade.is-other { background: color-mix(in srgb, var(--t-text) 7%, transparent); color: var(--t-text-secondary); }
.hd-li-s span { font-family: 'Amiri', serif; font-size: 14px; }
.hd-li-s span { unicode-bidi: isolate; }
@media (max-width: 600px) { .hd-list a { grid-template-columns: 1fr; grid-template-areas: "t" "m"; gap: 4px; padding: 14px 2px; } .hd-li-n { padding: 0; } .hd-li-m { margin-top: 4px; } }
.hd-li-x { flex-basis: 100%; order: 3; font-size: 13.5px; line-height: 1.55; color: var(--t-text-secondary); }
.hd-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.hd-subs a { padding: 8px 14px; border-radius: 999px; background: var(--t-card); color: var(--t-text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.hd-subs a:hover { background: var(--t-text); color: var(--t-bg); }
.hd-subs a span { margin-inline-start: 4px; font-weight: 500; opacity: .65; }

/* ── one hadith ── */
.hd-head { margin: 6px 0 20px; }
.hd-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t-accent); }
.hd-h1 { margin: 8px 0 0; max-width: 900px; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.5rem, 3.2vw, 2.2rem); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--t-text); }
.hd-art { max-width: 900px; }
.hd-card { padding: 26px 28px; border-radius: 26px; border: 1px solid var(--t-border); background: var(--hd-pat), var(--t-card); }
.hd-ar { margin: 0 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--t-border); font: 400 clamp(1.4rem, 3vw, 1.85rem)/2 'Amiri', serif; color: var(--t-text); text-align: right; }
.hd-ar-intro { color: var(--t-text-secondary); font-size: .82em; }
.hd-text p { margin: 0; }
.hd-intro { margin-bottom: 8px !important; font-size: 14.5px; color: var(--t-text-secondary); }
.hd-words { font-size: clamp(1.05rem, 2vw, 1.2rem); line-height: 1.75; color: var(--t-text); }
.hd-text[lang="ar"] .hd-words { font: 400 clamp(1.4rem, 3vw, 1.85rem)/2 'Amiri', serif; }
.hd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; font-size: 13.5px; color: var(--t-text-secondary); }
.hd-src b { color: var(--t-text); font-weight: 600; }
.hd-acts { display: flex; gap: 6px; margin-inline-start: auto; }
.hd-act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--t-border); border-radius: 12px; background: var(--t-bg); color: var(--t-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.hd-act svg { width: 15px; height: 15px; }
.hd-act:hover { border-color: var(--t-accent); color: var(--t-accent); }
.hd-sec { margin-top: 30px; }
.hd-sec h2 { margin: 0 0 10px; font-family: "Space Grotesk", sans-serif; font-size: 1.3rem; }
.hd-sec p { margin: 0 0 12px; font-size: 16px; line-height: 1.75; color: var(--t-text); }
.hd-hints { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.hd-hints li { position: relative; padding: 14px 16px 14px 44px; border-radius: 16px; background: var(--t-card); font-size: 15px; line-height: 1.65; }
.hd-hints li::before { content: ''; position: absolute; left: 18px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--t-accent); }
.hd-words-ar { display: grid; gap: 8px; margin: 0; }
.hd-words-ar div { padding: 10px 14px; border-radius: 12px; background: var(--t-card); }
.hd-words-ar dt { font-weight: 700; }
.hd-words-ar dd { margin: 2px 0 0; color: var(--t-text-secondary); }
.hd-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.hd-cats a { padding: 6px 12px; border-radius: 999px; background: var(--t-card); color: var(--t-text-secondary); font-size: 13px; font-weight: 600; text-decoration: none; }
.hd-cats a:hover { color: var(--t-accent); }
.hd-langs { margin: 18px 0 0; font-size: 13.5px; color: var(--t-text-secondary); }
.hd-langs a, .hd-back a, .hd-credit a { color: var(--t-accent); }
.hd-credit { margin: 18px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--t-text-secondary); }
.hd-rel { margin-top: 40px; max-width: 900px; }
.hd-back { margin: 28px 0 0; }
.hd-faq { margin-top: 36px; }
.hd-toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; padding: 11px 18px; border-radius: 14px; background: var(--t-text); color: var(--t-bg); font-weight: 600; font-size: 14px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.hd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
    .hd-hero { padding: 24px 14px 16px; border-radius: 22px; }
    .hd-search { padding-inline-start: 12px; }
    .hd-search button[type=submit] { padding: 10px 12px; }
    .hd-card { padding: 20px 18px; border-radius: 20px; }
    .hd-acts { margin-inline-start: 0; }
    .hd-today-card { padding: 18px; }
}
.hd-saw { font-family: 'Amiri', serif; font-size: .62em; font-weight: 400; vertical-align: .15em; }

/* ── sources (collections) ── */
.hd-sources { margin: 0 0 34px; }
.hd-sources h2 { margin: 0 0 14px; font-family: "Space Grotesk", sans-serif; font-size: 1.45rem; }
.hd-sources .hd-srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.hd-sources .hd-srcs a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: space-between; gap: 6px 10px; padding: 14px 16px; border-radius: 16px; background: var(--t-card); color: var(--t-text); text-decoration: none; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.hd-sources .hd-srcs a:hover { border-color: var(--t-accent); transform: translateY(-1px); }
.hd-sources .hd-srcs strong { grid-column: 1 / -1; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-sources .hd-srcs span { align-self: end; font-size: 12.5px; font-weight: 600; color: var(--t-text-secondary); }
.hd-sources .hd-srcs i { align-self: end; font-style: normal; font-family: 'Amiri', serif; font-size: 18px; line-height: 1.2; color: var(--t-accent); }
@media (max-width: 560px) { .hd-sources .hd-srcs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .hd-sources .hd-srcs a { padding: 12px 13px; } .hd-sources .hd-srcs strong { font-size: 14.5px; } }
nav.hd-srcs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
nav.hd-srcs a { padding: 8px 14px; border-radius: 999px; background: var(--t-card); color: var(--t-text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
nav.hd-srcs a:hover, nav.hd-srcs a[aria-current] { background: var(--t-text); color: var(--t-bg); }
nav.hd-srcs a span { margin-inline-start: 4px; font-weight: 500; opacity: .65; }
.hd-h1-ar { font-family: 'Amiri', serif; font-weight: 400; color: var(--t-accent); margin-inline-start: 10px; }
.hd-src-topics { margin: 0 0 22px; font-size: 14px; line-height: 1.8; color: var(--t-text-secondary); }
.hd-src-topics a { color: var(--t-text); }
.hd-src a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--t-accent) 55%, transparent); text-underline-offset: 3px; }
.hd-src a:hover { color: var(--t-accent); }

/* ── share dialog ── */
.hd-sh { width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px; background: var(--t-bg); color: var(--t-text); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; }
.hd-sh::backdrop { background: rgba(10, 12, 16, .55); backdrop-filter: blur(3px); }
.hd-sh[open] { animation: hd-sh-in .2s ease-out; }
@keyframes hd-sh-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.hd-sh-in { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.hd-sh-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--t-border); }
.hd-sh-top h2 { margin: 0; font-size: 18px; }
.hd-sh-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--t-card); color: var(--t-text); cursor: pointer; }
.hd-sh-x svg { width: 18px; height: 18px; }
.hd-sh-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; padding: 20px; overflow: auto; }
.hd-sh-prev { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 16px; border-radius: 18px; background: var(--t-card); }
.hd-sh-prev canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: min(62vh, 640px); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.hd-sh-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hd-sh-row { display: flex; flex-direction: column; gap: 7px; }
.hd-sh-lbl { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--t-text-secondary); }
.hd-sh-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: var(--t-card); }
.hd-sh-seg button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--t-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.hd-sh-seg button[aria-pressed="true"] { background: var(--t-bg); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.hd-sh-ratio { display: inline-block; border: 2px solid currentColor; border-radius: 3px; opacity: .7; }
.hd-sh-ratio.r45 { width: 12px; height: 15px; } .hd-sh-ratio.r11 { width: 14px; height: 14px; } .hd-sh-ratio.r916 { width: 10px; height: 17px; }
.hd-sh-sw i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid; }
.hd-sh-main { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-sh-btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--t-border); border-radius: 14px; background: var(--t-bg); color: var(--t-text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.hd-sh-btn:hover { border-color: var(--t-accent); }
.hd-sh-btn.is-pri { border-color: var(--t-accent); background: var(--t-accent); color: var(--t-bg); }
.hd-sh-btn.is-pri:hover { filter: brightness(1.08); }
.hd-sh-btn svg { width: 18px; height: 18px; }
.hd-sh-nets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.hd-sh-net { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border-radius: 12px; color: var(--t-text); text-decoration: none; }
.hd-sh-net span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; transition: transform .15s; }
.hd-sh-net:hover span { transform: translateY(-2px); }
.hd-sh-net svg { width: 23px; height: 23px; }
.hd-sh-net b { font-size: 11px; font-weight: 600; color: var(--t-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hd-sh-net.is-wa span { background: #25d366; } .hd-sh-net.is-vb span { background: #7360f2; } .hd-sh-net.is-fb span { background: #1877f2; }
.hd-sh-net.is-tw span { background: #111; } .hd-sh-net.is-tg span { background: #229ed9; } .hd-sh-net.is-em span { background: var(--t-text-secondary); }
.hd-sh-link { display: flex; align-items: center; gap: 8px; padding: 5px; padding-inline-start: 12px; border: 1px solid var(--t-border); border-radius: 13px; background: var(--t-card); }
.hd-sh-link > svg { flex: none; width: 17px; height: 17px; color: var(--t-text-secondary); }
.hd-sh-link input { flex: 1; min-width: 0; border: 0; background: none; color: var(--t-text); font: inherit; font-size: 13px; outline: none; direction: ltr; }
.hd-sh-link button { flex: none; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--t-text); color: var(--t-bg); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.hd-sh-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--t-text-secondary); }
.hd-sh-more { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--t-accent); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hd-sh .hd-toast { position: absolute; }
@media (max-width: 760px) {
    .hd-sh { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
    .hd-sh-in { max-height: 100dvh; }
    .hd-sh-body { grid-template-columns: 1fr; gap: 16px; padding: 14px 16px 20px; }
    .hd-sh-prev { padding: 10px; }
    .hd-sh-prev canvas { max-height: 38vh; }
    .hd-sh-net span { width: 40px; height: 40px; }
}

/* ── one collection: sticky menu of collections + topics of the collection above the list (hadith-src.php) ── */
.hd-sl { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; align-items: start; }
.hd-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 14px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--t-text) 15%, transparent) transparent; }
.hd-side-box > summary { list-style: none; display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; padding-inline-start: 12px; cursor: default; pointer-events: none; }
.hd-side-box > summary::-webkit-details-marker { display: none; }
.hd-side-box > summary span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t-accent); }
.hd-side-box > summary b { display: none; }
.hd-side-box > nav { display: grid; border-inline-start: 1px solid var(--t-border); }
.hd-side-box > nav a { position: relative; display: flex; align-items: baseline; gap: 10px; margin-inline-start: -1px; padding: 5px 0; padding-inline-start: 12px; border-inline-start: 2px solid transparent; color: var(--t-text-secondary); font-size: 13.5px; font-weight: 500; line-height: 1.4; text-decoration: none; transition: color .15s, border-color .15s; }
.hd-side-box > nav a span { flex: 1; min-width: 0; }
.hd-side-box > nav a i { flex: none; font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--t-text-secondary); opacity: .7; }
.hd-side-box > nav a:hover { color: var(--t-text); border-inline-start-color: color-mix(in srgb, var(--t-text) 25%, transparent); }
.hd-side-box > nav a[aria-current] { color: var(--t-text); font-weight: 700; border-inline-start-color: var(--t-accent); }
.hd-side-box > nav a[aria-current] i { color: var(--t-accent); opacity: 1; }
.hd-sl-main { min-width: 0; }
.hd-tchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.hd-tchips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--t-card); color: var(--t-text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.hd-tchips a i { font-style: normal; font-size: 11.5px; font-weight: 500; opacity: .6; }
.hd-tchips a:hover { background: color-mix(in srgb, var(--t-card) 85%, var(--t-text) 15%); }
.hd-tchips a[aria-current] { background: var(--t-text); color: var(--t-bg); }
.hd-tchips a[aria-current] i { opacity: .75; }
.hd-tchips a.is-more { background: none; color: var(--t-accent); padding-inline: 6px; }
@media (max-width: 900px) {
    .hd-sl { grid-template-columns: 1fr; gap: 12px; }
    .hd-side { position: static; max-height: none; overflow: visible; }
    .hd-side-box { border-radius: 14px; background: var(--t-card); }
    .hd-side-box > summary { pointer-events: auto; cursor: pointer; position: relative; padding: 9px 40px 9px 14px; padding-inline: 14px 40px; }
    .hd-side-box > summary::after { content: ''; position: absolute; inset-inline-end: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--t-text-secondary); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
    .hd-side-box[open] > summary::after { transform: rotate(225deg); margin-top: -2px; }
    .hd-side-box > summary span { font-size: 10.5px; }
    .hd-side-box > summary b { display: block; font-size: 14px; font-weight: 700; color: var(--t-text); }
    .hd-side-box > nav { margin: 0 14px 10px; max-height: 50vh; overflow-y: auto; }
    .hd-tchips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
    .hd-tchips::-webkit-scrollbar { display: none; }
}

/* ── topic tree in the side menu (hadith-cat.php) ── */
.hd-tree { display: block !important; border: 0 !important; }
@media (min-width: 901px) { .hd-side-box:has(.hd-tree) > summary { padding-inline-start: 0; } }
.hd-tree ul { list-style: none; margin: 0; padding: 0; }
.hd-tree-root { border-bottom: 1px solid var(--t-border); }
.hd-tree-root:last-child { border-bottom: 0; }
.hd-tree-root > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 9px 0; padding-inline-end: 22px; position: relative; cursor: pointer; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--t-text); }
.hd-tree-root > summary::-webkit-details-marker { display: none; }
.hd-tree-root > summary span { flex: 1; min-width: 0; }
.hd-tree-root > summary i { flex: none; font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--t-text-secondary); opacity: .7; }
.hd-tree-root > summary::after { content: ''; position: absolute; inset-inline-end: 4px; top: 15px; width: 6px; height: 6px; border: solid var(--t-text-secondary); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .2s; }
.hd-tree-root[open] > summary::after { transform: rotate(225deg); top: 18px; }
.hd-tree-root > summary:hover { color: var(--t-accent); }
.hd-tree-root > summary.is-cur, .hd-tree-root[open] > summary { color: var(--t-text); }
.hd-tree-root > ul { padding-bottom: 8px; border-inline-start: 1px solid var(--t-border); margin-inline-start: 2px; }
.hd-tree a { padding-inline-end: 22px !important; }
.hd-tree a.is-path { color: var(--t-text) !important; font-weight: 700; border-inline-start-color: var(--t-accent) !important; }

/* ── classic pager ── */
.hd-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--t-border); }
.hd-pager a, .hd-pager span { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; color: var(--t-text-secondary); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; background: none; transition: background .15s, color .15s; }
.hd-pager a:hover { background: color-mix(in srgb, var(--t-text) 7%, transparent); color: var(--t-text); }
.hd-pager span[aria-current] { background: var(--t-text); color: var(--t-bg); }
.hd-pager .hd-pg-a { font-size: 18px; font-weight: 500; line-height: 1; color: var(--t-text); }
.hd-pager .hd-pg-a.is-off { opacity: .25; }
.hd-pager .hd-pg-gap { min-width: 20px; padding: 0; color: var(--t-text-secondary); }
@media (max-width: 480px) { .hd-pager a, .hd-pager span { min-width: 32px; height: 32px; padding: 0 6px; font-size: 13px; } }

/* sticky side menu: body/html clip instead of hide horizontally (overflow hidden makes them scroll containers, which breaks position: sticky) */
html:has(.hd-sl), body:has(.hd-sl) { overflow-x: clip; }
