/* ==========================================================================
   HadisYar — modern Islamic UI
   Monoline gold ornaments (tazhib / eslimi / girih) on calm ivory & teal.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-FD-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-FD-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri/Amiri-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri/Amiri-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  --font-ui: "Vazirmatn", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --bg: #f6f4ee;
  --bg-2: #efebe1;
  --surface: #fffefa;
  --surface-2: #f9f7f1;
  --ink: #18221f;
  --ink-2: #4a5754;
  --ink-3: #7d8783;
  --line: #e6e0d2;
  --line-2: #d9d1bd;
  --teal: #0f6b66;
  --teal-2: #0a5652;
  --teal-ink: #0c5f5a;
  --teal-soft: #e5efec;
  --gold: #b48c3c;
  --gold-2: #cfab5e;
  --gold-ink: #87661f;
  --gold-soft: #f5edda;
  --gold-line: rgba(180, 140, 60, .42);
  --mark: #f6e2a6;
  --code-bg: #0e1c1a;
  --code-bg-2: #13241f;
  --code-ink: #d6e4df;
  --code-line: #20332f;
  --toranj-fill: var(--surface);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M69.21 69.21L26.79 69.21L26.79 26.79L69.21 26.79ZM78 48L48 78L18 48L48 18ZM21.21 21.21L-21.21 21.21L-21.21 -21.21L21.21 -21.21ZM30 0L0 30L-30 0L0 -30ZM117.21 21.21L74.79 21.21L74.79 -21.21L117.21 -21.21ZM126 0L96 30L66 0L96 -30ZM21.21 117.21L-21.21 117.21L-21.21 74.79L21.21 74.79ZM30 96L0 126L-30 96L0 66ZM117.21 117.21L74.79 117.21L74.79 74.79L117.21 74.79ZM126 96L96 126L66 96L96 66ZM26.79 26.79L21.21 21.21M69.21 26.79L74.79 21.21M26.79 69.21L21.21 74.79M69.21 69.21L74.79 74.79M18 48H0M78 48H96M48 18V0M48 78V96M56 48A8 8 0 1 0 40 48A8 8 0 1 0 56 48M8 0A8 8 0 1 0 -8 0A8 8 0 1 0 8 0M104 0A8 8 0 1 0 88 0A8 8 0 1 0 104 0M8 96A8 8 0 1 0 -8 96A8 8 0 1 0 8 96M104 96A8 8 0 1 0 88 96A8 8 0 1 0 104 96' fill='none' stroke='%230f6b66' stroke-width='.7'/%3E%3C/svg%3E");
  --pattern-opacity: .05;
  --glow: rgba(207, 171, 94, .16);
  --shadow-1: 0 1px 2px rgba(28, 38, 34, .04), 0 2px 10px -2px rgba(28, 38, 34, .05);
  --shadow-2: 0 1px 3px rgba(28, 38, 34, .05), 0 18px 40px -16px rgba(28, 38, 34, .16);
  --shadow-3: 0 24px 70px -20px rgba(10, 30, 26, .35);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --wrap: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1110; --bg-2: #0e1716; --surface: #101a19; --surface-2: #13201e;
    --ink: #ece8dd; --ink-2: #b6bdb7; --ink-3: #7f8b87;
    --line: #1e2c2a; --line-2: #2a3c39;
    --teal: #4fb4a9; --teal-2: #6fc8be; --teal-ink: #7fd0c6; --teal-soft: #132d2a;
    --gold: #d0ad66; --gold-2: #e2c47f; --gold-ink: #dcbd7c; --gold-soft: #262013; --gold-line: rgba(208, 173, 102, .34);
    --mark: #5b4a1b; --code-bg: #070e0d; --code-bg-2: #0c1615; --code-line: #1b2a27;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M69.21 69.21L26.79 69.21L26.79 26.79L69.21 26.79ZM78 48L48 78L18 48L48 18ZM21.21 21.21L-21.21 21.21L-21.21 -21.21L21.21 -21.21ZM30 0L0 30L-30 0L0 -30ZM117.21 21.21L74.79 21.21L74.79 -21.21L117.21 -21.21ZM126 0L96 30L66 0L96 -30ZM21.21 117.21L-21.21 117.21L-21.21 74.79L21.21 74.79ZM30 96L0 126L-30 96L0 66ZM117.21 117.21L74.79 117.21L74.79 74.79L117.21 74.79ZM126 96L96 126L66 96L96 66ZM26.79 26.79L21.21 21.21M69.21 26.79L74.79 21.21M26.79 69.21L21.21 74.79M69.21 69.21L74.79 74.79M18 48H0M78 48H96M48 18V0M48 78V96M56 48A8 8 0 1 0 40 48A8 8 0 1 0 56 48M8 0A8 8 0 1 0 -8 0A8 8 0 1 0 8 0M104 0A8 8 0 1 0 88 0A8 8 0 1 0 104 0M8 96A8 8 0 1 0 -8 96A8 8 0 1 0 8 96M104 96A8 8 0 1 0 88 96A8 8 0 1 0 104 96' fill='none' stroke='%23d4b062' stroke-width='.7'/%3E%3C/svg%3E"); --pattern-opacity: .045; --glow: rgba(208, 173, 102, .09);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, .6); --shadow-3: 0 24px 70px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1110; --bg-2: #0e1716; --surface: #101a19; --surface-2: #13201e;
  --ink: #ece8dd; --ink-2: #b6bdb7; --ink-3: #7f8b87;
  --line: #1e2c2a; --line-2: #2a3c39;
  --teal: #4fb4a9; --teal-2: #6fc8be; --teal-ink: #7fd0c6; --teal-soft: #132d2a;
  --gold: #d0ad66; --gold-2: #e2c47f; --gold-ink: #dcbd7c; --gold-soft: #262013; --gold-line: rgba(208, 173, 102, .34);
  --mark: #5b4a1b; --code-bg: #070e0d; --code-bg-2: #0c1615; --code-line: #1b2a27;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M69.21 69.21L26.79 69.21L26.79 26.79L69.21 26.79ZM78 48L48 78L18 48L48 18ZM21.21 21.21L-21.21 21.21L-21.21 -21.21L21.21 -21.21ZM30 0L0 30L-30 0L0 -30ZM117.21 21.21L74.79 21.21L74.79 -21.21L117.21 -21.21ZM126 0L96 30L66 0L96 -30ZM21.21 117.21L-21.21 117.21L-21.21 74.79L21.21 74.79ZM30 96L0 126L-30 96L0 66ZM117.21 117.21L74.79 117.21L74.79 74.79L117.21 74.79ZM126 96L96 126L66 96L96 66ZM26.79 26.79L21.21 21.21M69.21 26.79L74.79 21.21M26.79 69.21L21.21 74.79M69.21 69.21L74.79 74.79M18 48H0M78 48H96M48 18V0M48 78V96M56 48A8 8 0 1 0 40 48A8 8 0 1 0 56 48M8 0A8 8 0 1 0 -8 0A8 8 0 1 0 8 0M104 0A8 8 0 1 0 88 0A8 8 0 1 0 104 0M8 96A8 8 0 1 0 -8 96A8 8 0 1 0 8 96M104 96A8 8 0 1 0 88 96A8 8 0 1 0 104 96' fill='none' stroke='%23d4b062' stroke-width='.7'/%3E%3C/svg%3E"); --pattern-opacity: .045; --glow: rgba(208, 173, 102, .09);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, .6); --shadow-3: 0 24px 70px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* faint girih lattice fading down from the top + a soft lamp-like glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--pattern);
  opacity: var(--pattern-opacity);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 75vh;
  z-index: -1;
  background: radial-gradient(ellipse 45% 55% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
main { flex: 1; width: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--teal); }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5em; font-weight: 700; color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--gold-2) 40%, transparent); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; }
.skip:focus { top: 12px; color: var(--bg); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.orn { fill: none; stroke: currentColor; stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; color: var(--gold); }

code, kbd, pre { font-family: var(--font-mono); }
code {
  font-size: .84em;
  background: var(--teal-soft);
  color: var(--teal-ink);
  padding: .1em .45em;
  border-radius: 6px;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}
kbd {
  font-size: .7rem;
  line-height: 1.5;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 6px;
  color: var(--ink-3);
  background: var(--surface-2);
}
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 .15em; }

/* ---------- Buttons, chips, fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { border-color: var(--gold-line); color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-2); border-color: var(--teal-2); color: #fff; }
:root[data-theme="dark"] .btn--primary, :root[data-theme="dark"] .btn--primary:hover { color: #06201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--primary, :root:not([data-theme="light"]) .btn--primary:hover { color: #06201d; } }
.btn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; color: #1f1806; }
.btn--gold:hover { filter: brightness(1.05); color: #1f1806; border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--teal-soft); border-color: transparent; color: var(--teal-ink); }
.btn--sm { height: 34px; padding: 0 13px; font-size: .84rem; gap: 6px; }
.btn--sm .icon { width: 17px; height: 17px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--teal-soft); color: var(--teal-ink); }
.icon-btn[aria-pressed="true"], .icon-btn.is-on { color: var(--gold-ink); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.icon-btn--line { border-color: var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .84rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.chip:hover { border-color: var(--gold-line); color: var(--ink); }
.chip small { color: var(--ink-3); font-size: .74rem; }
.chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.is-active small { color: rgba(255, 255, 255, .75); }
:root[data-theme="dark"] .chip.is-active { color: #06201d; }
.chip .icon { width: 15px; height: 15px; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 14%, transparent); }
.field > .icon { color: var(--ink-3); }
.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.field input::placeholder { color: var(--ink-3); }
.field input::-webkit-search-cancel-button, .cmdk__input input::-webkit-search-cancel-button { display: none; }
.field--sm { height: 44px; border-radius: 13px; }

.select, .input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  width: 100%;
}
.select:focus, .input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 14%, transparent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 500;
  background: var(--teal-soft);
  color: var(--teal-ink);
  white-space: nowrap;
}
.badge--gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card__title { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 700; margin: 0 0 4px; }
.card__title .icon { color: var(--gold); }
.card__sub { color: var(--ink-3); font-size: .84rem; margin: 0 0 14px; line-height: 1.8; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-ink);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.eyebrow svg { width: 14px; height: 14px; }

/* ==========================================================================
   Header — «سرلوح»: a centered shamseh medallion on a gold hairline,
   with the menu flanking it on both sides like an illuminated headpiece.
   ========================================================================== */
.sarlowh { position: relative; z-index: 40; padding-top: 12px; }
.sarlowh__bar {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}
.sarlowh__side { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.25; color: var(--ink); }
.brand b { font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
.brand small { color: var(--ink-3); font-size: .72rem; font-weight: 500; }
.brand:hover { color: var(--ink); }

.sarlowh__nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: translateX(-50%) rotate(45deg) scale(0);
  transition: transform .3s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: translateX(-50%) rotate(45deg) scale(.7); }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after { transform: translateX(-50%) rotate(45deg) scale(1); }
.nav-link .count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: .68rem;
  line-height: 18px;
  text-align: center;
}
.nav-link--api { color: var(--teal-ink); }
.nav-link--api .api-tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
  background: var(--teal-soft);
  direction: ltr;
}

.sarlowh__tools { display: flex; align-items: center; gap: 6px; }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.search-trigger:hover { border-color: var(--gold-line); color: var(--ink-2); }

/* the medallion */
.medallion {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translateY(14px);
  z-index: 2;
}
.medallion__ring {
  position: absolute;
  inset: -17px;
  width: calc(100% + 34px);
  height: calc(100% + 34px);
  max-width: none;
  color: var(--gold);
  stroke-width: .55;
  animation: turn 160s linear infinite;
}
.medallion::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--bg);
}
.medallion img {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 6px 18px -6px rgba(10, 60, 55, .45);
  transition: transform .5s var(--ease);
}
.medallion:hover img { transform: scale(1.04); }

.sarlowh__rule {
  max-width: var(--wrap);
  margin: 2px auto 0;
  padding-inline: 20px;
  display: grid;
  grid-template-columns: 1fr auto 120px auto 1fr;
  align-items: center;
  color: var(--gold);
  pointer-events: none;
}
.sarlowh__rule::before, .sarlowh__rule::after { content: ""; height: 1px; }
.sarlowh__rule::before { grid-column: 1; background: linear-gradient(to left, var(--gold-line), transparent); }
.sarlowh__rule::after { grid-column: 5; background: linear-gradient(to right, var(--gold-line), transparent); }
.sarlowh__rule svg { width: 84px; height: 24px; grid-row: 1; }
.sarlowh__rule .fl-1 { grid-column: 2; transform: scaleX(-1); }
.sarlowh__rule .fl-2 { grid-column: 4; }

.menu-toggle { display: none; }

/* mobile sheet menu */
.m-menu {
  position: absolute;
  inset-inline: 12px;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  animation: drop .35s var(--ease);
}
.m-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: .92rem;
}
.m-menu a .icon { color: var(--gold); }
.m-menu a[aria-current="page"] { border-color: var(--gold-line); background: var(--gold-soft); }
.m-menu a.m-menu__api { grid-column: 1 / -1; background: var(--code-bg); color: #e7efe9; border-color: transparent; }
.m-menu a.m-menu__api .icon { color: var(--gold-2); }
.m-menu a.m-menu__api small { margin-inline-start: auto; color: #8fb3aa; font-size: .75rem; }

@media (max-width: 1080px) {
  .brand small { display: none; }
  .nav-link { padding: 8px 9px; font-size: .9rem; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 900px) {
  .sarlowh { padding-top: 8px; }
  .sarlowh__bar { grid-template-columns: auto 1fr auto; height: 60px; gap: 12px; }
  .sarlowh__nav, .sarlowh__rule { display: none; }
  .medallion { grid-column: 1; grid-row: 1; width: 46px; height: 46px; transform: none; }
  .medallion img { width: 44px; height: 44px; }
  .medallion__ring { inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); }
  .sarlowh__side--start { grid-column: 2; grid-row: 1; }
  .sarlowh__side--end { grid-column: 3; grid-row: 1; }
  .menu-toggle { display: inline-grid; }
  .sarlowh { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
}

/* ==========================================================================
   Tazhib frame — the featured hadith
   ========================================================================== */
.tazhib {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(120% 70% at 50% -8%, color-mix(in srgb, var(--gold-soft) 70%, transparent), transparent 62%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 44px clamp(22px, 4.2vw, 60px) 22px;
}
.tazhib::before, .tazhib::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--gold-line);
}
.tazhib::before { inset: 10px; border-radius: 16px; }
.tazhib::after { inset: 14px; border-radius: 13px; opacity: .45; }
.tazhib__corner { position: absolute; width: 66px; height: 66px; z-index: -1; opacity: .9; }
.tazhib__corner--tl { top: 14px; left: 14px; }
.tazhib__corner--tr { top: 14px; right: 14px; transform: scaleX(-1); }
.tazhib__corner--bl { bottom: 14px; left: 14px; transform: scaleY(-1); }
.tazhib__corner--br { bottom: 14px; right: 14px; transform: scale(-1, -1); }
.tazhib__label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 172px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--gold);
}
.tazhib__label svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tazhib__label span { position: relative; font-size: .84rem; font-weight: 700; color: var(--gold-ink); letter-spacing: .01em; }

.tazhib__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.day-nav { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-3); font-size: .84rem; }
.day-nav time { padding-inline: 6px; min-width: 9.5em; text-align: center; }
.day-nav .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
.narrator-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--teal-ink);
  text-decoration: none;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
}
.narrator-chip svg { width: 13px; height: 13px; color: var(--gold); }
.narrator-chip:hover { color: var(--teal); }

.tazhib__body { position: relative; text-align: center; transition: opacity .25s, filter .25s; }
.tazhib.is-loading .tazhib__body { opacity: 0; filter: blur(3px); }
.h-said { font-family: var(--font-ar); color: var(--gold-ink); font-size: 1.12rem; line-height: 1.8; margin: 0 0 2px; }
.h-ar {
  font-family: var(--font-ar);
  font-size: var(--ar-size, 2rem);
  line-height: 2.05;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  word-spacing: .04em;
}
.h-ar::before { content: "«"; color: var(--gold); margin-inline-end: .12em; }
.h-ar::after { content: "»"; color: var(--gold); margin-inline-start: .12em; }
.len-s { --ar-size: clamp(1.75rem, 1.15rem + 1.6vw, 2.5rem); }
.len-m { --ar-size: clamp(1.55rem, 1.05rem + 1.2vw, 2.1rem); }
.len-l { --ar-size: clamp(1.35rem, 1rem + .85vw, 1.75rem); }
.len-xl { --ar-size: clamp(1.2rem, .98rem + .5vw, 1.45rem); }
.h-divider { display: flex; align-items: center; gap: 12px; max-width: 300px; margin: 14px auto 12px; color: var(--gold); }
.h-divider::before, .h-divider::after { content: ""; flex: 1; height: 1px; }
.h-divider::before { background: linear-gradient(to left, var(--gold-line), transparent); }
.h-divider::after { background: linear-gradient(to right, var(--gold-line), transparent); }
.h-divider svg { width: 18px; height: 18px; stroke-width: 1.1; }
.h-fa { font-size: var(--fa-size, 1.1rem); line-height: 2.1; color: var(--ink-2); margin: 0 auto; max-width: 62ch; text-wrap: pretty; }

.tazhib__foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.h-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: .82rem; color: var(--ink-3); min-width: 0; }
.h-meta div { display: flex; gap: 6px; min-width: 0; }
.h-meta dt { color: var(--ink-3); }
.h-meta dd { margin: 0; color: var(--ink-2); }
.h-meta a { color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.h-meta a:hover { color: var(--teal-ink); }
.h-actions { display: flex; align-items: center; gap: 2px; }
.h-actions .sep { width: 1px; height: 22px; background: var(--line); margin-inline: 6px; }

/* ==========================================================================
   Home — everything on one screen
   ========================================================================== */
.home {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 34px 20px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 1fr);
  grid-template-areas: "hadis side";
  gap: 18px 26px;
  align-content: center;
  align-items: stretch;
  flex: 1;
}
body.is-home main { display: flex; flex-direction: column; }
.home__hadis { grid-area: hadis; display: flex; flex-direction: column; }
.home__hadis .tazhib { flex: 1; display: flex; flex-direction: column; }
.home__hadis .tazhib__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 6px; }
.home__side { grid-area: side; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.search-card { padding: 16px 18px; }
.search-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.search-card__head .card__title { margin: 0; }
.search-card .field { height: 48px; }
.quick-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick-topics .chip { height: 28px; font-size: .8rem; padding: 0 10px; }
.stats-line { font-size: .76rem; color: var(--ink-3); }
.stats-line b { color: var(--ink-2); font-weight: 600; }

/* developer card — dark, code-like, with a whisper of girih */
.dev-card {
  position: relative;
  overflow: hidden;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--code-line);
  isolation: isolate;
}
.dev-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M69.21 69.21L26.79 69.21L26.79 26.79L69.21 26.79ZM78 48L48 78L18 48L48 18ZM21.21 21.21L-21.21 21.21L-21.21 -21.21L21.21 -21.21ZM30 0L0 30L-30 0L0 -30ZM117.21 21.21L74.79 21.21L74.79 -21.21L117.21 -21.21ZM126 0L96 30L66 0L96 -30ZM21.21 117.21L-21.21 117.21L-21.21 74.79L21.21 74.79ZM30 96L0 126L-30 96L0 66ZM117.21 117.21L74.79 117.21L74.79 74.79L117.21 74.79ZM126 96L96 126L66 96L96 66ZM26.79 26.79L21.21 21.21M69.21 26.79L74.79 21.21M26.79 69.21L21.21 74.79M69.21 69.21L74.79 74.79M18 48H0M78 48H96M48 18V0M48 78V96M56 48A8 8 0 1 0 40 48A8 8 0 1 0 56 48M8 0A8 8 0 1 0 -8 0A8 8 0 1 0 8 0M104 0A8 8 0 1 0 88 0A8 8 0 1 0 104 0M8 96A8 8 0 1 0 -8 96A8 8 0 1 0 8 96M104 96A8 8 0 1 0 88 96A8 8 0 1 0 104 96' fill='none' stroke='%23d4b062' stroke-width='.7'/%3E%3C/svg%3E");
  opacity: .07;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 65%);
  mask-image: linear-gradient(200deg, #000, transparent 65%);
}
.dev-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dev-card h2 { color: #f2efe6; font-size: 1rem; margin: 14px 0 2px; }
.dev-card p { color: #93ada6; font-size: .82rem; margin: 0 0 12px; line-height: 1.8; }
.dev-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.dev-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: #93ada6; font-size: .8rem; cursor: pointer; transition: background-color .2s, color .2s; }
.dev-tabs button:hover { color: #e7efe9; }
.dev-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.dev-tabs button .icon { color: var(--gold-2); }
.dev-card [role="tabpanel"] { animation: fade .35s var(--ease); }
.dev-card__list { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 6px; font-size: .82rem; color: #b9cdc7; }
.dev-card__list li { display: flex; align-items: center; gap: 8px; }
.dev-card__list .icon { color: #8fd6cc; }
.dev-card .badge { background: rgba(79, 180, 169, .14); color: #8fd6cc; }
.req {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 6px 6px 6px 8px;
  direction: ltr;
}
.req .method { font-family: var(--font-mono); font-size: .7rem; font-weight: 700; color: #0e1c1a; background: #8fd6cc; padding: 2px 7px; border-radius: 6px; }
.req .url { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .78rem; color: #e8dfc6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req .icon-btn { width: 30px; height: 30px; border-radius: 8px; color: #9fb9b2; }
.req .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.req .run { color: #0e1c1a; background: var(--gold-2); }
.req .run:hover { background: #e9cf8f; color: #0e1c1a; }
.dev-card pre.json {
  margin: 10px 0 12px;
  height: 112px;
  overflow: hidden;
  font-size: .74rem;
  line-height: 1.75;
  background: transparent;
  padding: 0 4px;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.dev-card__links { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-card .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #e7efe9; }
.dev-card .btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.dev-card .btn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1f1806; border-color: transparent; }

.widget-card { display: flex; flex-direction: column; gap: 10px; }
.widget-card .snippet {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 6px 6px 6px 12px;
}
.widget-card .snippet code { flex: 1; min-width: 0; background: none; padding: 0; color: var(--ink-2); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; }
.widget-card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.ribbon {
  grid-area: ribbon;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding-top: 4px;
}
.ribbon__label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: .82rem; white-space: nowrap; }
.ribbon__label svg { width: 14px; height: 14px; }
.scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  padding-block: 2px;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  padding-inline: 4px;
}
.scroller::-webkit-scrollbar { display: none; }

@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
}
@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hadis" "side"; padding-top: 34px; }
  .home__hadis, .home__side { min-width: 0; }
  .home { align-content: start; gap: 18px; }
  .ribbon { flex-direction: column; align-items: stretch; gap: 8px; }
}
@media (max-width: 560px) {
  .tazhib { padding: 40px 18px 16px; border-radius: 20px; }
  .tazhib__corner { width: 40px; height: 40px; opacity: .7; }
  .tazhib__foot { flex-direction: column; align-items: stretch; }
  .h-actions { justify-content: space-between; }
  .h-meta dd { max-width: 100%; white-space: normal; }
  .day-nav time { min-width: 0; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.foot { border-top: 1px solid var(--line); margin-top: 8px; }
.foot__in {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 14px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--ink-3);
}
.foot__links { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--teal-ink); }
.foot__credit a { color: var(--ink-2); }

/* ==========================================================================
   Inner pages — shared
   ========================================================================== */
.phead { max-width: var(--wrap); margin: 38px auto 26px; padding-inline: 20px; text-align: center; }
.phead h1 { font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.35rem); font-weight: 800; letter-spacing: -.01em; margin: 6px 0 8px; }
.phead p { color: var(--ink-2); max-width: 64ch; margin: 0 auto; }
.phead--start { text-align: start; }
.phead--start p { margin: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--teal-ink); }
.crumbs .icon { width: 14px; height: 14px; opacity: .6; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0 0 14px; }
.section-title svg { width: 16px; height: 16px; color: var(--gold); }

.ornament-rule { display: flex; align-items: center; gap: 14px; color: var(--gold); margin: 34px auto; max-width: 420px; }
.ornament-rule::before, .ornament-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--gold-line), transparent); }
.ornament-rule svg { width: 16px; height: 16px; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty svg.orn { width: 96px; height: 96px; margin: 0 auto 14px; stroke-width: .6; opacity: .8; }
.empty h2 { font-size: 1.15rem; color: var(--ink); }

/* ==========================================================================
   Browse / search (/ahadis)
   ========================================================================== */
.browse {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 20px 48px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.filters { position: sticky; top: 16px; min-width: 0; }
.results { min-width: 0; }
.filters h2 { font-size: .82rem; color: var(--ink-3); font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.narrator-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.narrator-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .9rem;
  transition: background-color .2s, color .2s;
}
.narrator-list a small { color: var(--ink-3); font-size: .74rem; }
.narrator-list a:hover { background: var(--surface); color: var(--ink); }
.narrator-list a[aria-current="true"] { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.narrator-list a[aria-current="true"] small { color: var(--teal-ink); }
.filters .mobile-chips { display: none; }

.results__bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.results__bar form { display: flex; gap: 10px; }
.results__bar .field { flex: 1; }
.results__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .86rem; color: var(--ink-3); }
.results__meta strong { color: var(--ink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters .chip { height: 28px; font-size: .8rem; background: var(--gold-soft); border-color: transparent; color: var(--gold-ink); }
.active-filters .chip .icon { width: 13px; height: 13px; }
.subject-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.hlist { display: flex; flex-direction: column; gap: 14px; }
.hitem {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px 12px;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.hitem:hover { border-color: var(--gold-line); box-shadow: var(--shadow-2); }
.hitem__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: .8rem; color: var(--ink-3); }
.hitem__top .narrator-chip { font-size: .78rem; padding: 2px 10px 2px 8px; }
.hitem__top .subject { color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.hitem__top .subject:hover { color: var(--teal-ink); }
.hitem__top .num { margin-inline-start: auto; font-size: .74rem; color: var(--ink-3); }
.hitem .h-ar { font-size: 1.42rem; line-height: 2; text-align: start; text-wrap: pretty; }
.hitem .h-fa { font-size: 1rem; line-height: 2; text-align: start; max-width: none; margin-top: 4px; }
.hitem .clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hitem .clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hitem__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.hitem__src { font-size: .78rem; color: var(--ink-3); min-width: 0; line-height: 1.8; }
.hitem__src svg { display: inline; vertical-align: -3px; width: 14px; height: 14px; margin-inline-end: 4px; color: var(--gold); }
.hitem .h-actions .icon-btn { width: 34px; height: 34px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: .9rem;
}
.pager a:hover { border-color: var(--gold-line); color: var(--ink); }
.pager [aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.pager .gap { border: 0; background: none; min-width: 20px; }

@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .filters { position: static; }
  .filters h2, .filters .narrator-list { display: none; }
  .filters .mobile-chips { display: flex; }
  .hitem { padding: 16px 16px 10px; }
  .hitem .h-ar { font-size: 1.28rem; }
}

/* ==========================================================================
   Hadith detail (/hadis/{id})
   ========================================================================== */
.detail { max-width: 980px; margin-inline: auto; padding: 26px 20px 48px; }
.detail .tazhib { margin-top: 30px; }
.detail .tazhib__body { padding-block: 10px 4px; }
.detail__nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.detail__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 22px; margin-top: 34px; align-items: start; }
.related { display: flex; flex-direction: column; gap: 10px; }
.related a {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: .92rem;
  line-height: 1.9;
  transition: border-color .2s;
}
.related a:hover { border-color: var(--gold-line); color: var(--ink); }
.related a small { display: block; color: var(--ink-3); font-size: .76rem; margin-top: 4px; }
.use-card pre.code { font-size: .72rem; }
@media (max-width: 860px) { .detail__grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Code blocks, JSON, tabs, tables
   ========================================================================== */
pre.code, pre.json {
  margin: 0;
  direction: ltr;
  text-align: left;
  font-size: .8rem;
  line-height: 1.75;
  color: var(--code-ink);
  background: var(--code-bg);
  border-radius: 14px;
  padding: 16px 18px;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}
.codebox { position: relative; }
.codebox .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06);
  color: #b9cdc7;
  font-size: .75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.codebox .copy-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.codebox .copy-btn .icon { width: 14px; height: 14px; }
.j-key { color: #8fd6cc; }
.j-str { color: #e9cf91; }
.j-num { color: #f2a679; }
.j-bool { color: #c5a8ff; }
.j-null { color: #7f948f; }
.t-com { color: #6f8a84; font-style: italic; }
.t-kw { color: #c5a8ff; }
.t-str { color: #e9cf91; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .8rem;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th, table.t td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--ink-3); font-weight: 600; font-size: .78rem; background: var(--surface-2); }
table.t tr:last-child td { border-bottom: 0; }
table.t td:first-child code { font-weight: 600; }
.req-flag { font-size: .7rem; color: #b4573c; margin-inline-start: 4px; }

/* ==========================================================================
   Developers (/developers)
   ========================================================================== */
.dev-hero {
  max-width: var(--wrap);
  margin: 36px auto 34px;
  padding-inline: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: center;
}
.dev-hero h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.45; margin: 10px 0 12px; }
.dev-hero h1 em { font-style: normal; color: var(--teal-ink); }
.dev-hero p.lead { color: var(--ink-2); font-size: 1.04rem; margin-bottom: 18px; }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.perks li { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); line-height: 1.7; }
.perks li .icon { color: var(--gold); margin-top: 3px; width: 18px; height: 18px; }
.perks li b { display: block; color: var(--ink); font-weight: 600; }
.dev-hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }

.console {
  background: var(--code-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--code-line);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  color: var(--code-ink);
}
.console__bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--code-line); background: var(--code-bg-2); }
.console__dots { display: flex; gap: 6px; direction: ltr; }
.console__dots i { width: 10px; height: 10px; border-radius: 50%; background: #2b3d39; }
.console__title { font-size: .78rem; color: #87a39c; margin-inline-start: auto; }
.console form { display: flex; gap: 8px; padding: 12px 14px; direction: ltr; border-bottom: 1px solid var(--code-line); }
.console select, .console input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--code-line);
  background: #0a1514;
  color: #e7dfc8;
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: 0 10px;
  min-width: 0;
}
.console input { flex: 1; }
.console select { color: #8fd6cc; font-weight: 700; }
.console pre.json { border-radius: 0; height: 330px; background: transparent; font-size: .76rem; }
.console__status { display: flex; gap: 12px; padding: 8px 14px; font-size: .74rem; color: #87a39c; border-top: 1px solid var(--code-line); direction: ltr; font-family: var(--font-mono); }
.console__status .ok { color: #8fd6cc; }
.console__status .err { color: #f2a679; }

.dev {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.toc { position: sticky; top: 18px; font-size: .86rem; }
.toc h2 { font-size: .78rem; color: var(--ink-3); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.toc a { display: block; padding: 5px 14px; margin-inline-start: -1px; border-inline-start: 1px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.7; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--teal-ink); border-color: var(--teal); }
.toc .sub a { padding-inline-start: 26px; font-size: .8rem; color: var(--ink-3); font-family: var(--font-mono); direction: ltr; text-align: right; }
.doc section { margin-bottom: 44px; scroll-margin-top: 20px; }
.doc h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.doc h2 svg { width: 16px; height: 16px; color: var(--gold); }
.doc p, .doc li { color: var(--ink-2); }
.doc .note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--ink-2);
  font-size: .88rem;
  margin: 12px 0;
}
.doc .note .icon { color: var(--gold-ink); margin-top: 4px; }
.endpoint {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  scroll-margin-top: 20px;
}
.endpoint__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.method-tag { font-family: var(--font-mono); font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-ink); }
.endpoint__path { font-family: var(--font-mono); font-size: .9rem; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.endpoint__title { margin-inline-start: auto; font-size: .85rem; color: var(--ink-3); }
.endpoint__body { padding: 14px 18px 16px; }
.endpoint__body > p { font-size: .92rem; margin-bottom: 12px; }
.endpoint .table-wrap { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.try { display: flex; align-items: center; gap: 8px; direction: ltr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; }
.try code { flex: 1; min-width: 0; background: none; padding: 0; color: var(--ink-2); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.try + pre.json { margin-top: 10px; max-height: 340px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) {
  .dev-hero { grid-template-columns: minmax(0, 1fr); }
  .dev { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .model-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .perks { grid-template-columns: minmax(0, 1fr); } .console pre.json { height: 260px; } }

/* ==========================================================================
   Widget builder (/widget)
   ========================================================================== */
.builder {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 20px 56px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.builder__form { display: flex; flex-direction: column; gap: 18px; }
.opt-group h3 { font-size: .84rem; color: var(--ink-3); font-weight: 600; margin: 0 0 8px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.seg label { position: relative; display: grid; place-items: center; height: 36px; border-radius: 10px; font-size: .86rem; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--teal); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .84rem; cursor: pointer; color: var(--ink-2); background: var(--surface); }
.checks label:has(input:checked) { border-color: var(--teal); color: var(--teal-ink); background: var(--teal-soft); }
.checks input { accent-color: var(--teal); margin: 0; }
.swatches { display: flex; gap: 8px; }
.swatches label { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }
.builder__preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.stage {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 34px 26px;
  background-color: var(--surface-2);
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 18px 18px;
}
.stage.is-dark { background-color: #111816; background-image: radial-gradient(#25302d 1px, transparent 1px); }
.stage iframe { width: 100%; border: 0; display: block; min-height: 180px; background: transparent; }
.stage__bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .8rem; color: var(--ink-3); }
@media (max-width: 960px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder__preview { position: static; } }

/* ==========================================================================
   Article (/seerah, /about)
   ========================================================================== */
.article { max-width: 1100px; margin-inline: auto; padding: 0 20px 56px; display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 44px; align-items: start; }
.prose { font-size: 1.04rem; line-height: 2.2; color: var(--ink-2); max-width: 72ch; }
.prose h2 { font-size: 1.3rem; color: var(--ink); margin: 1.8em 0 .6em; display: flex; align-items: center; gap: 10px; scroll-margin-top: 20px; }
.prose h2::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); flex: none; }
.prose p { margin-bottom: 1.1em; text-align: justify; text-justify: inter-word; }
.prose sup a { text-decoration: none; font-size: .72em; padding: 0 2px; color: var(--teal-ink); }
.prose .footnotes { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--line); font-size: .86rem; line-height: 2; color: var(--ink-3); }
.prose .footnotes ol { padding-inline-start: 1.5em; }
.prose .footnotes li:target { background: var(--gold-soft); border-radius: 8px; }
.article .toc { top: 18px; }
@media (max-width: 900px) { .article { grid-template-columns: minmax(0, 1fr); } .article .toc { display: none; } }

.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person { display: flex; align-items: center; gap: 14px; }
.person__avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; font-size: 1.2rem; flex: none; }
.person h3 { font-size: 1rem; margin: 0; }
.person p { margin: 0; font-size: .84rem; color: var(--ink-3); }
.sources-list { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Command palette, popover menus, toasts
   ========================================================================== */
dialog.cmdk {
  width: min(660px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 80px));
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
dialog.cmdk[open] { display: flex; flex-direction: column; animation: drop .3s var(--ease); }
dialog.cmdk::backdrop { background: rgba(8, 20, 18, .38); backdrop-filter: blur(4px); }
.cmdk__input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 64px; border-bottom: 1px solid var(--line); }
.cmdk__input .icon { color: var(--gold); width: 22px; height: 22px; }
.cmdk__input input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.08rem; color: var(--ink); min-width: 0; }
.cmdk__list { overflow-y: auto; padding: 8px; flex: 1; }
.cmdk__group { font-size: .74rem; color: var(--ink-3); padding: 8px 12px 4px; }
.cmdk__item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.8;
  align-items: flex-start;
}
.cmdk__item .icon { color: var(--ink-3); margin-top: 4px; }
.cmdk__item small { display: block; color: var(--ink-3); font-size: .76rem; }
.cmdk__item[aria-selected="true"], .cmdk__item:hover { background: var(--teal-soft); color: var(--ink); }
.cmdk__item[aria-selected="true"] .icon { color: var(--teal-ink); }
.cmdk__item .txt { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmdk__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--ink-3); }
.cmdk__empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: .9rem; }

.pop {
  position: fixed;
  z-index: 80;
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  animation: drop .2s var(--ease);
}
.pop button, .pop a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: .88rem;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.pop button:hover, .pop a:hover, .pop button:focus-visible { background: var(--teal-soft); color: var(--ink); outline: 0; }
.pop .icon { width: 17px; height: 17px; color: var(--ink-3); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.pop .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-inline: 4px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .88rem;
  box-shadow: var(--shadow-3);
  animation: rise .35s var(--ease);
}
.toast .icon { width: 17px; height: 17px; color: var(--gold-2); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }

/* ==========================================================================
   Motion — gentle and optional
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes draw { from { stroke-dashoffset: 300; opacity: 0; } to { stroke-dashoffset: 0; opacity: .9; } }
.rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
.tazhib__corner use { stroke-dasharray: 300; animation: draw 2.2s .25s var(--ease) both; }
.spin .icon { animation: turn .8s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .sarlowh, .foot, .h-actions, .day-nav, .filters, .pager, .toc { display: none !important; }
  body::before, body::after { display: none; }
  .tazhib, .hitem { box-shadow: none; }
}

/* Never let a wide child (code, chip rows, long Arabic) widen the page on phones. */
.doc, .builder__form, .builder__preview, .prose, .detail__grid > *, .dev-hero > * { min-width: 0; }
pre { max-width: 100%; }
.codebox pre.code { padding-right: 84px; }
@media (max-width: 560px) {
  .console form { flex-wrap: wrap; }
  .console input { flex-basis: 100%; order: 3; }
  .console select { flex: 1; }
  .dev-hero { margin-top: 24px; gap: 28px; }
  .endpoint__title { margin-inline-start: 0; width: 100%; }
}
.detail .h-meta dd { max-width: none; white-space: normal; }
.use-card pre.code { white-space: pre-wrap; word-break: break-all; padding: 44px 16px 14px; }
@media (max-width: 560px) { .codebox pre.code { padding: 46px 16px 14px; } }
.about-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .about-grid--2 { grid-template-columns: minmax(0, 1fr); } }
.chip { max-width: 100%; }
.sources-list .chip, .subject-cloud .chip, .active-filters .chip { white-space: normal; height: auto; min-height: 32px; padding-block: 6px; line-height: 1.6; }
/* Content source (required attribution: hawzah.net / Noor center) */
.source-card { display: flex; align-items: center; gap: 22px; margin-top: 16px; border-color: var(--gold-line); }
.source-card p { margin: 0 0 6px; color: var(--ink-2); }
.source-card__note { font-size: .86rem; color: var(--ink-3) !important; }
.source-card__logo { flex: none; display: grid; place-items: center; width: 210px; height: 84px; border-radius: 14px; background: var(--code-bg); border: 1px solid var(--code-line); }
.source-card__logo img { width: 174px; height: auto; }
.foot__source { flex-basis: 100%; font-size: .76rem; color: var(--ink-3); text-align: center; }
@media (max-width: 640px) { .source-card { flex-direction: column; align-items: stretch; } .source-card__logo { width: 100%; } }
/* Persian translations may contain paragraph breaks (kept as \n by the server). */
.h-fa { white-space: pre-line; }
/* Footnotes split out of the translation (often the primary source). */
.h-notes { list-style: none; counter-reset: fn; margin: 10px auto 0; padding: 8px 0 0; max-width: 62ch; border-top: 1px solid var(--line); font-size: .8rem; line-height: 1.9; color: var(--ink-3); text-align: start; }
.h-notes li { counter-increment: fn; display: flex; gap: 6px; }
.h-notes li::before { content: counter(fn, persian) "."; color: var(--gold-ink); flex: none; }
.hitem .h-notes { margin: 6px 0 0; max-width: none; }
/* «حدیث روز» landing page */
.get-daily { margin-top: 30px; }
.get-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.get-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink-2); font-size: .84rem; line-height: 1.8; transition: border-color .2s, transform .2s var(--ease); }
.get-card:hover { border-color: var(--gold-line); color: var(--ink-2); transform: translateY(-1px); }
.get-card .icon { color: var(--gold); }
.get-card b { color: var(--ink); font-size: .95rem; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--gold-ink); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 8px 0 0; font-size: .86rem; color: var(--ink-2); line-height: 1.95; }
@media (max-width: 900px) { .get-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .get-grid { grid-template-columns: minmax(0, 1fr); } }
/* the card label can be the page heading */
.tazhib__label h1, .tazhib__label h2 { position: relative; margin: 0; font-size: .84rem; font-weight: 700; color: var(--gold-ink); letter-spacing: .01em; line-height: 1.4; }
.detail__title { font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); font-weight: 700; color: var(--ink-2); margin: 4px 0 0; line-height: 1.7; }
.foot__seo { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); font-size: .78rem; }
.foot__seo a { color: var(--ink-3); }
/* keep the home on one screen even on 1366×768 laptops */
@media (min-width: 901px) {
  body.is-home .home { padding-top: 26px; padding-bottom: 8px; }
  body.is-home .foot__in { padding-top: 10px; padding-bottom: 10px; row-gap: 2px; }
}

/* ==========================================================================
   Seerah (/seerah)
   ========================================================================== */
.sh-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: 26px;
  color: #f3eee2;
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(214, 180, 110, .22), transparent 70%),
    linear-gradient(170deg, #0f3c38 0%, #0a2624 60%, #071a19 100%);
  border-block: 1px solid rgba(214, 180, 110, .35);
}
.sh-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M69.21 69.21L26.79 69.21L26.79 26.79L69.21 26.79ZM78 48L48 78L18 48L48 18ZM21.21 21.21L-21.21 21.21L-21.21 -21.21L21.21 -21.21ZM30 0L0 30L-30 0L0 -30ZM117.21 21.21L74.79 21.21L74.79 -21.21L117.21 -21.21ZM126 0L96 30L66 0L96 -30ZM21.21 117.21L-21.21 117.21L-21.21 74.79L21.21 74.79ZM30 96L0 126L-30 96L0 66ZM117.21 117.21L74.79 117.21L74.79 74.79L117.21 74.79ZM126 96L96 126L66 96L96 66ZM26.79 26.79L21.21 21.21M69.21 26.79L74.79 21.21M26.79 69.21L21.21 74.79M69.21 69.21L74.79 74.79M18 48H0M78 48H96M48 18V0M48 78V96M56 48A8 8 0 1 0 40 48A8 8 0 1 0 56 48M8 0A8 8 0 1 0 -8 0A8 8 0 1 0 8 0M104 0A8 8 0 1 0 88 0A8 8 0 1 0 104 0M8 96A8 8 0 1 0 -8 96A8 8 0 1 0 8 96M104 96A8 8 0 1 0 88 96A8 8 0 1 0 104 96' fill='none' stroke='%23d4b062' stroke-width='.7'/%3E%3C/svg%3E"); opacity: .08; }
.sh-hero__in { position: relative; max-width: 880px; margin-inline: auto; padding: 64px 20px 54px; text-align: center; }
.sh-hero__shamseh { position: absolute; z-index: -1; top: 50%; left: 50%; width: 560px; height: 560px; max-width: none; transform: translate(-50%, -50%); color: #d6b46e; opacity: .12; stroke-width: .35; }
.sh-hero .eyebrow { color: #e9cf91; }
.sh-hero h1 { color: #fff; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); font-weight: 800; margin: 10px 0 18px; }
.sh-hero__verse { font-family: var(--font-ar); font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); color: #f1dfb0; line-height: 1.9; margin: 0; }
.sh-hero__tr { color: #c9d6d1; margin: 4px 0 18px; }
.sh-hero__tr span { color: #e9cf91; font-size: .86em; }
.sh-hero__lead { color: #b9cbc5; max-width: 60ch; margin: 0 auto 26px; line-height: 2; }
.sh-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sh-chips a { color: #f3eee2; text-decoration: none; font-size: .86rem; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(214, 180, 110, .45); background: rgba(255, 255, 255, .04); transition: background-color .2s, border-color .2s; }
.sh-chips a:hover { background: rgba(214, 180, 110, .16); border-color: #d6b46e; color: #fff; }

.sh-section { max-width: 1120px; margin-inline: auto; padding: 64px 20px; scroll-margin-top: 10px; }
.sh-section--paper { max-width: none; background: var(--bg-2); border-block: 1px solid var(--line); }
.sh-section--paper > * { max-width: 1080px; margin-inline: auto; }
.sh-head { text-align: center; margin-bottom: 34px; }
.sh-head h2 { font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.15rem); font-weight: 800; margin: 8px 0 6px; }
.sh-head p { color: var(--ink-2); margin: 0 auto; max-width: 60ch; }
.sh-note { text-align: center; font-size: .8rem; color: var(--ink-3); margin: 26px auto 0; max-width: 70ch; }
.sh-more { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--teal-ink); text-decoration: none; transition: gap .2s; }
.sh-more:hover { gap: 9px; }

/* timeline */
.sh-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.sh-timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: linear-gradient(to bottom, transparent, var(--gold-line) 4%, var(--gold-line) 96%, transparent); }
.sh-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0 64px; margin-bottom: 26px; scroll-margin-top: 20px; }
.sh-item:nth-child(odd) .sh-card { grid-column: 1; }
.sh-item:nth-child(even) .sh-card { grid-column: 2; }
.sh-node { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 50px; height: 50px; display: grid; place-items: center; background: var(--bg); border-radius: 50%; z-index: 1; }
.sh-node svg { position: absolute; inset: 2px; width: 46px; height: 46px; stroke-width: .9; color: var(--gold); }
.sh-node b { position: relative; font-size: .86rem; color: var(--gold-ink); }
.sh-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px 18px; box-shadow: var(--shadow-1); transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.sh-card:hover { border-color: var(--gold-line); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.sh-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sh-card h3 { font-size: 1.2rem; margin: 0; }
.sh-titles { display: flex; gap: 5px; flex-wrap: wrap; }
.sh-titles span { font-size: .74rem; color: var(--gold-ink); background: var(--gold-soft); padding: 2px 10px; border-radius: 999px; }
.sh-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sh-meta div { min-width: 0; }
.sh-meta dt { font-size: .7rem; color: var(--ink-3); }
.sh-meta dd { margin: 0; font-size: .8rem; font-weight: 600; color: var(--ink); line-height: 1.7; }
.sh-highlight { color: var(--ink-2); font-size: .92rem; line-height: 2; margin: 0 0 12px; }
.sh-hadis { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(to left, var(--gold-soft), transparent); border-inline-start: 3px solid var(--gold); }
.sh-hadis blockquote { margin: 0; }
.sh-hadis__ar { font-family: var(--font-ar); font-size: 1.22rem; line-height: 1.95; color: var(--ink); margin: 0; }
.sh-hadis__fa { font-size: .9rem; color: var(--ink-2); margin: 2px 0 0; line-height: 1.9; white-space: pre-line; }
.sh-hadis figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: .74rem; color: var(--ink-3); }
.sh-hadis figcaption a { color: var(--teal-ink); text-decoration: none; }

/* concepts, features, types, verses */
.sh-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sh-concept { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px 26px 20px; }
.sh-concept__word { position: absolute; top: -10px; left: 18px; font-family: var(--font-ar); font-size: 5.5rem; line-height: 1.4; color: var(--gold); opacity: .12; pointer-events: none; }
.sh-concept h3 { position: relative; font-size: 1.15rem; }
.sh-concept p { position: relative; color: var(--ink-2); line-height: 2.05; text-align: justify; }
.sh-features { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.sh-feature { grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; }
.sh-feature:nth-child(4) { grid-column: 2 / span 2; }
.sh-feature__n { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; margin-bottom: 10px; }
.sh-feature h3 { font-size: 1.02rem; margin: 0 0 6px; }
.sh-feature p { font-size: .88rem; color: var(--ink-2); line-height: 1.95; flex: 1; }
.sh-feature blockquote { margin: 6px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.sh-feature blockquote p { font-family: var(--font-ar); font-size: 1.12rem; color: var(--ink); margin: 0; line-height: 1.8; }
.sh-feature cite { font-style: normal; font-size: .74rem; color: var(--gold-ink); }
.sh-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sh-type { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.sh-type svg { width: 20px; height: 20px; margin-bottom: 6px; }
.sh-type h3 { font-size: .98rem; margin: 0 0 4px; }
.sh-type p { font-size: .86rem; color: var(--ink-2); margin: 0; line-height: 1.9; }
.sh-verses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sh-verse { margin: 0; text-align: center; background: var(--surface); border: 1px solid var(--gold-line); border-radius: 22px; padding: 26px 20px 20px; position: relative; }
.sh-verse::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-line); border-radius: 16px; opacity: .45; pointer-events: none; }
.sh-verse__ar { font-family: var(--font-ar); font-size: 1.45rem; line-height: 2; color: var(--ink); margin: 0 0 8px; }
.sh-verse__fa { font-size: .88rem; color: var(--ink-2); line-height: 1.9; margin: 0 0 8px; }
.sh-verse figcaption { font-size: .78rem; color: var(--gold-ink); }
#maghaleh .article { padding-inline: 0; padding-bottom: 0; }
#maghaleh .prose .footnotes h2::before { display: none; }

@media (max-width: 900px) {
  .sh-timeline::before { left: auto; right: 24px; transform: none; }
  .sh-item { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sh-item:nth-child(odd) .sh-card, .sh-item:nth-child(even) .sh-card { grid-column: 1; margin-inline-start: 62px; }
  .sh-node { left: auto; right: 0; transform: none; }
  .sh-duo, .sh-verses, .sh-types { grid-template-columns: minmax(0, 1fr); }
  .sh-features { grid-template-columns: minmax(0, 1fr); }
  .sh-feature, .sh-feature:nth-child(4) { grid-column: auto; }
}
@media (max-width: 560px) {
  .sh-section { padding: 46px 16px; }
  .sh-meta { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sh-card { padding: 18px 16px 14px; }
  .sh-hero__shamseh { width: 420px; height: 420px; }
  .sh-concept__word { font-size: 4rem; }
}

/* «هزینهٔ استفاده» note */
.usage-cost { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--ink-2); font-size: .92rem; line-height: 1.9; }
.usage-cost svg { width: 18px; height: 18px; flex: none; margin-top: 5px; }
.usage-cost b { color: var(--gold-ink); }
.usage-cost--center { max-width: 640px; margin: 16px auto 0; justify-content: center; text-align: center; }

/* Seerah — full article as an illuminated manuscript */
.sh-reader { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: start; }
.sh-manuscript {
  position: relative;
  isolation: isolate;
  max-width: none;
  background:
    radial-gradient(120% 40% at 50% 0%, color-mix(in srgb, var(--gold-soft) 75%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-2);
  padding: 58px clamp(22px, 5vw, 64px) 40px;
}
.sh-manuscript::before, .sh-manuscript::after { content: ""; position: absolute; pointer-events: none; border: 1px solid var(--gold-line); }
.sh-manuscript::before { inset: 12px; border-radius: 18px; }
.sh-manuscript::after { inset: 17px; border-radius: 14px; opacity: .45; }
.sh-manuscript .tazhib__corner { width: 76px; height: 76px; }
.sh-manuscript .tazhib__corner--tl { top: 17px; left: 17px; }
.sh-manuscript .tazhib__corner--tr { top: 17px; right: 17px; }
.sh-manuscript .tazhib__corner--bl { bottom: 17px; left: 17px; }
.sh-manuscript .tazhib__corner--br { bottom: 17px; right: 17px; }
.sh-manuscript .tazhib__label { top: 0; }

.sh-manuscript__body { position: relative; }
.sh-manuscript__body p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  font-size: 1.04rem;
  line-height: 2.3;
  color: var(--ink-2);
  margin: 0 0 1.05em;
}
.sh-manuscript__body > p:first-of-type { font-size: 1.12rem; color: var(--ink); }
.sh-manuscript__body h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.28rem;
  color: var(--ink);
  margin: 2em 0 .8em;
  scroll-margin-top: 20px;
}
.sh-manuscript__body h2:first-child { margin-top: .4em; }
.sh-manuscript__body h2::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: none;
  background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cpath d='M7.1 7.1H-7.1V-7.1H7.1ZM10 0 0 10-10 0 0-10Z' fill='none' stroke='black' stroke-width='1.4'/%3E%3Ccircle r='3' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cpath d='M7.1 7.1H-7.1V-7.1H7.1ZM10 0 0 10-10 0 0-10Z' fill='none' stroke='black' stroke-width='1.4'/%3E%3Ccircle r='3' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: none;
}
.sh-manuscript__body h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, var(--gold-line), transparent); }

/* footnote references: small gold medallions */
.sh-manuscript .fn-ref {
  display: inline-grid;
  place-items: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 .2em;
  margin-inline: 1px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-ink) !important;
  font-size: .82em !important;
  line-height: 1;
  text-decoration: none;
  vertical-align: .35em;
  transition: background-color .2s;
}
.sh-manuscript .fn-ref:hover { background: var(--gold); color: #fff !important; }

/* footnotes panel */
.sh-footnotes {
  position: relative;
  margin-top: 2.6em !important;
  padding: 22px 24px !important;
  border: 0 !important;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sh-footnotes h2 { font-size: 1rem; margin: 0 0 12px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.sh-footnotes h2::before { display: none; }
.sh-footnotes ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.sh-footnotes li { display: flex; gap: 8px; break-inside: avoid; font-size: .8rem; line-height: 1.95; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; }
.sh-footnotes li:target { background: var(--gold-soft); }
.sh-fn-n { flex: none; min-width: 1.6em; color: var(--gold-ink); font-weight: 700; }
.sh-footnotes a { text-decoration: none; color: var(--teal-ink); }

/* table of contents card */
.sh-toc {
  position: sticky;
  top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 14px 14px;
  box-shadow: var(--shadow-1);
}
.sh-toc h2 { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink); margin: 0 6px 10px; }
.sh-toc h2 svg { width: 15px; height: 15px; }
.sh-toc ol { border: 0; }
.sh-toc a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 10px; border: 0; font-size: .82rem; line-height: 1.7; margin: 0; }
.sh-toc a span { flex: none; min-width: 1.4em; font-size: .74rem; color: var(--gold-ink); }
.sh-toc a:hover { background: var(--surface-2); }
.sh-toc a.is-active { background: var(--teal-soft); color: var(--teal-ink); }

@media (max-width: 1000px) {
  .sh-reader { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sh-manuscript { padding: 48px 14px 22px; border-radius: 22px; }
  .sh-manuscript::before { inset: 7px; border-radius: 16px; }
  .sh-manuscript::after { inset: 10px; border-radius: 13px; }
  .sh-manuscript .tazhib__corner--tl, .sh-manuscript .tazhib__corner--bl { left: 10px; }
  .sh-manuscript .tazhib__corner--tr, .sh-manuscript .tazhib__corner--br { right: 10px; }
  .sh-manuscript .tazhib__corner--tl, .sh-manuscript .tazhib__corner--tr { top: 10px; }
  .sh-manuscript .tazhib__corner--bl, .sh-manuscript .tazhib__corner--br { bottom: 10px; }
  .sh-manuscript .fn-ref { font-size: .7em !important; }
  #maghaleh.sh-section { padding-inline: 10px; }
  .sh-manuscript .tazhib__corner { width: 48px; height: 48px; opacity: .7; }
  .sh-manuscript__body p { font-size: 1rem; line-height: 2.15; }
  .sh-footnotes { padding: 16px 14px !important; }
  .sh-footnotes ol { columns: 1; }
}
