/* ==========================================================================
   Masār al-Anbiyāʾ — base from Aʿlām (visual language shared with Mutūn)
   ========================================================================== */

:root {
  /* palette of the 2026 redesign: parchment, ink, olive (accent) and ochre (gold) */
  --bg: #f3eee3;
  --bg-2: #eae3d3;
  --surface: #fbf8f1;
  --ink: #1b1814;
  --ink-2: #4f483d;
  --ink-3: #6b6356;
  --line: #d9d0bd;
  --line-2: #cfc5af;
  --accent: #47562a;
  --accent-ink: #fbf8f1;
  --accent-soft: #e4e6d6;
  --gold: #8e6219;
  --gold-soft: #f1e6cf;
  --warn: #9a5b2b;
  --warn-soft: #f6e6d8;
  --land: #f6f1e6;
  --water: #dce2df;
  --river: #b9c8c4;
  --night: #1b1814; --night-ink: #ede6d7; --night-2: #c4baa6; --night-gold: #d3a65c; --night-line: #36322b;
  --shadow: 0 1px 2px rgba(30, 25, 15, .04), 0 6px 24px -12px rgba(30, 25, 15, .14);
  --shadow-lg: 0 2px 6px rgba(30, 25, 15, .05), 0 26px 50px -30px rgba(30, 25, 15, .45);

  --f-ar: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --f-quran: "Amiri Quran", "Amiri", serif;
  --f-display: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 4px;
  --radius-sm: 4px;
  --wrap: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f; --bg-2: #1b1915; --surface: #1f1c17; --ink: #ede6d7; --ink-2: #c4baa6; --ink-3: #8f8676;
    --line: #2f2b25; --line-2: #3d382f; --accent: #a9bc7c; --accent-ink: #15130f; --accent-soft: #262b1c;
    --gold: #d3a65c; --gold-soft: #2a2418; --warn: #d79a68; --warn-soft: #2c2018; --land: #22201b; --water: #141816; --river: #26302c;
    --night: #0e0d0a; --night-ink: #ede6d7; --night-2: #b7ad99; --night-gold: #d3a65c; --night-line: #2c2822;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --bg-2: #1b1915; --surface: #1f1c17; --ink: #ede6d7; --ink-2: #c4baa6; --ink-3: #8f8676;
    --line: #2f2b25; --line-2: #3d382f; --accent: #a9bc7c; --accent-ink: #15130f; --accent-soft: #262b1c;
    --gold: #d3a65c; --gold-soft: #2a2418; --warn: #d79a68; --warn-soft: #2c2018; --land: #22201b; --water: #141816; --river: #26302c;
    --night: #0e0d0a; --night-ink: #ede6d7; --night-2: #b7ad99; --night-gold: #d3a65c; --night-line: #2c2822;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; }
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#app:focus { outline: none; }
.muted { color: var(--ink-3); }
.ar { font-family: var(--f-ar); direction: rtl; unicode-bidi: isolate; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-300%); background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 3000; }
.skip:focus { transform: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } .hide-sm { display: none !important; } }
.link { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink-3); }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) { .topbar__inner { padding: 0 8px 0 16px; } }
.brand { display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand__mark { font-family: var(--f-ar); font-size: 26px; line-height: 1; color: var(--accent); }
.brand__name { font-family: var(--f-display); font-size: 19px; letter-spacing: -.01em; }
@media (max-width: 600px) { .brand__name { display: none; } }
.topnav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.topnav a { padding: 7px 11px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a.is-active { color: var(--ink); background: var(--bg-2); }
@media (max-width: 600px) { .topnav a { padding: 7px 8px; font-size: 13.5px; } }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- Buttons, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 500; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, transform .12s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: var(--shadow); }
.btn svg { width: 16px; height: 16px; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.pill--exact { background: var(--accent-soft); color: var(--accent); }
.pill--approximate { background: transparent; border: 1px dashed var(--ink-3); color: var(--ink-2); }
.pill--disputed { background: var(--warn-soft); color: var(--warn); }
.pill--reported { background: var(--gold-soft); color: var(--gold); }
.pill--high { background: var(--accent-soft); color: var(--accent); }
.pill--medium { background: var(--gold-soft); color: var(--gold); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line-2); background: var(--surface); white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Notice ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--gold-soft); color: var(--ink-2); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; line-height: 1.55; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--gold); }
.notice b { color: var(--ink); font-weight: 600; }

/* ---------- Home ---------- */
.hero { padding: 64px 0 28px; text-align: center; }
.hero__ornament { width: 52px; height: 52px; margin: 0 auto 18px; color: var(--gold); opacity: .85; }
.hero__ar { font-family: var(--f-ar); font-size: clamp(48px, 9vw, 84px); line-height: 1.25; margin: 0; font-weight: 400; }
.hero__en { font-family: var(--f-display); font-weight: 300; font-style: italic; font-size: clamp(19px, 2.6vw, 24px); color: var(--ink-2); margin: 4px 0 0; }
.hero__lede { max-width: 600px; margin: 18px auto 0; color: var(--ink-2); font-size: 15.5px; }
.stats { display: flex; justify-content: center; gap: 30px; margin-top: 26px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat__n { font-family: var(--f-display); font-size: 26px; line-height: 1.1; }
.stat__l { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-top: 4px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 0; }
@media (max-width: 760px) { .modes { grid-template-columns: 1fr; } }
.mode { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.mode:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.mode svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 6px; }
.mode h3 { font-family: var(--f-display); font-weight: 400; font-size: 21px; margin: 0; }
.mode p { margin: 0; color: var(--ink-2); font-size: 14px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 48px 0 16px; }
.section-head h2 { font-family: var(--f-display); font-size: 24px; font-weight: 400; margin: 0; letter-spacing: -.01em; white-space: nowrap; }
.section-head .rule { flex: 1; height: 1px; background: var(--line); align-self: center; }
.section-head .meta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }
.principle { padding: 16px 18px; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; color: var(--ink-2); }
.principle b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* ---------- Scholar cards / list ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 28px 0 8px; }
.search { position: relative; flex: 0 1 320px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 14px 0 38px; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--accent); }
@media (max-width: 700px) { .search { flex: 1 1 100%; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.card__ar { font-family: var(--f-ar); font-size: 24px; line-height: 1.6; text-align: right; direction: rtl; margin: 10px 0 0; }
.card__en { font-family: var(--f-display); font-style: italic; font-size: 16px; }
.card__meta { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.century-head { font-family: var(--f-display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 32px 0 12px; }

/* ---------- Scholar page ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--ink-3); font-size: 12.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.back:hover { color: var(--ink); }
.back svg { width: 15px; height: 15px; }
.p-hero { text-align: center; padding: 26px 0 8px; }
.p-hero__ar { font-family: var(--f-ar); font-weight: 400; font-size: clamp(40px, 8vw, 70px); line-height: 1.35; margin: 8px 0 0; }
.p-hero__en { font-family: var(--f-display); font-style: italic; font-weight: 300; font-size: clamp(20px, 3vw, 28px); margin: 0; }
.p-hero__names { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.p-hero__names .ar { font-size: 18px; }
.p-hero__epithet { max-width: 640px; margin: 18px auto 0; font-family: var(--f-ar); font-size: 21px; line-height: 1.8; color: var(--ink-2); direction: rtl; }
.p-hero__epithet small { display: block; direction: ltr; font-family: var(--f-ui); font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.p-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin-top: 28px; align-items: start; }
@media (max-width: 900px) { .p-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.block { padding: 20px 22px; }
.block + .block { border-top: 1px solid var(--line); }
.block h3 { margin: 0 0 12px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.side { display: grid; gap: 16px; position: sticky; top: 76px; }
@media (max-width: 900px) { .side { position: static; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; }
.date-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.date-big b { font-family: var(--f-display); font-size: 28px; font-weight: 400; line-height: 1.1; }
.date-big span { color: var(--ink-3); font-size: 13px; }
.reports { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.report { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.report__y { font-family: var(--f-display); font-size: 17px; font-variant-numeric: lining-nums; }
.report__by { color: var(--ink-2); }
.report__note { display: block; color: var(--ink-3); font-size: 12.5px; }
.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.claim { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.claim:last-child { border-bottom: 0; }
.claim__main { min-width: 0; }
.claim__main small { display: block; color: var(--ink-3); font-size: 12.5px; }
.ev-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-right: 6px; }
.person-link { color: var(--ink); font-weight: 500; }
.person-link:hover { color: var(--accent); }
.mini-map { height: 260px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); margin-top: 4px; }

/* citation chip + popover */
.cite { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cite:hover, .cite[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.cite svg { width: 12px; height: 12px; }
.cite-pop { position: fixed; z-index: 2000; width: min(420px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px 18px; font-size: 13.5px; }
.cite-pop h4 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 17px; }
.cite-pop .loc { color: var(--ink-2); margin: 2px 0 10px; }
.cite-pop blockquote { margin: 0 0 10px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); font-family: var(--f-ar); font-size: 19px; line-height: 1.8; direction: rtl; text-align: right; }
.cite-pop .status { font-size: 12px; color: var(--ink-3); }
.cite-pop .links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; }
.cite-pop .x { position: absolute; top: 8px; right: 8px; }

/* ---------- Atlas ---------- */
.atlas { position: relative; height: calc(100vh - 60px); height: calc(100dvh - 60px); }
.atlas #map { position: absolute; inset: 0; background: var(--bg-2); }
.era { position: absolute; z-index: 500; left: 16px; right: 16px; top: 14px; max-width: 560px; margin: 0 auto; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px 16px 8px; }
.era__row { display: flex; align-items: baseline; gap: 10px; }
.era__lbl { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.era__v { font-family: var(--f-display); font-size: 21px; }
.era__ce { font-size: 12.5px; color: var(--ink-3); }
.era__n { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.era input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.era__ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); }
.era__all { font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.sheet { position: absolute; z-index: 500; left: 16px; bottom: 16px; width: 380px; max-height: calc(100% - 140px); overflow-y: auto; background: color-mix(in srgb, var(--surface) 97%, transparent); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 18px 20px; }
@media (max-width: 640px) { .sheet { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 46%; } .era { left: 8px; right: 8px; top: 8px; } }
.sheet h2 { font-family: var(--f-display); font-weight: 400; font-size: 23px; margin: 0; line-height: 1.2; }
.sheet .ar { font-size: 22px; color: var(--gold); }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.sheet p { margin: 6px 0; color: var(--ink-2); font-size: 13.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin: 10px 0 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 6px; vertical-align: -1px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; }
.row:hover { background: var(--bg-2); }
.row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row__t b { font-weight: 600; font-size: 14px; }
.row__t span { font-size: 12.5px; color: var(--ink-3); }
.dot { width: 9px; height: 9px; border-radius: 99px; background: var(--accent); flex: none; }
.dot--off { background: transparent; border: 1.5px solid var(--ink-3); }
.stops { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: s; }
.stop { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.stop:last-child { border-bottom: 0; }
.stop__n { width: 24px; height: 24px; border-radius: 99px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.stop__n--u { background: transparent; border: 1.5px solid var(--ink-3); color: var(--ink-3); }
.fine { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
/* leaflet theming */
.leaflet-container { font: inherit; background: var(--bg-2); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--ink-3); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line) !important; }
.city-pin { display: grid; place-items: center; }
.city-pin span { display: grid; place-items: center; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.city-pin.is-dim span { background: var(--surface); color: var(--ink-3); border-color: var(--line-2); box-shadow: none; }
.city-pin.is-approx span { border-style: dashed; }
.city-label { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 0; border-radius: 99px; box-shadow: var(--shadow); color: var(--ink); font-size: 11.5px; font-weight: 600; padding: 1px 8px; }
.city-label::before { display: none; }
.stop-pin span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700; border: 2px solid var(--gold); }
.stop-pin.is-u span { background: var(--surface); color: var(--ink); border: 2px dashed var(--ink-3); }

/* ---------- Timeline ---------- */
.tl { margin-top: 20px; overflow-x: auto; }
.tl svg { min-width: 760px; width: 100%; height: auto; }
.tl text { fill: var(--ink-2); font-size: 12px; font-family: var(--f-ui); }
.tl .axis line { stroke: var(--line); }
.tl .axis text { fill: var(--ink-3); font-size: 11px; }
.tl .bar { fill: var(--accent); opacity: .85; }
.tl .bar--approx { fill: none; stroke: var(--accent); stroke-dasharray: 3 3; }
.tl .bar--disp { fill: var(--warn); opacity: .55; }
.tl a:hover text { fill: var(--accent); }
.tl a:hover .bar { opacity: 1; }

/* ---------- Network ---------- */
.net { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.net svg { display: block; width: 100%; height: auto; }
.net .edge { fill: none; stroke: var(--ink-3); stroke-opacity: .28; stroke-width: 1.2; }
.net .edge--medium { stroke-dasharray: 4 4; }
.net .edge.is-on { stroke: var(--accent); stroke-opacity: .95; stroke-width: 2; }
.net .edge.is-in { stroke: var(--gold); stroke-opacity: .95; stroke-width: 2; }
.net .edge.is-off { stroke-opacity: .07; }
.net .node circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.net .node text { fill: var(--ink); font-size: 12px; font-family: var(--f-ui); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.net .node.is-off { opacity: .3; }
.net .node.is-sel circle { fill: var(--accent); }
.net .axis text { fill: var(--ink-3); font-size: 11px; }
.net .axis line { stroke: var(--line); }

/* ---------- Tables / sources ---------- */
.src { padding: 18px 20px; }
.src + .src { border-top: 1px solid var(--line); }
.src h4 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 18px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.src h4 .ar { font-size: 20px; color: var(--ink-2); }
.src p { margin: 4px 0; font-size: 13.5px; color: var(--ink-2); }
.src .review { background: var(--warn-soft); color: var(--ink-2); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 8px; }
.prose { max-width: 720px; color: var(--ink-2); }
.prose h2 { font-family: var(--f-display); font-weight: 400; color: var(--ink); font-size: 24px; margin: 36px 0 8px; }
.prose li { margin: 4px 0; }
.prose--ar { font-family: var(--f-ar); font-size: 18px; line-height: 1.95; }
.prose--ar h2, .prose--ar h3 { font-family: var(--f-ar); }
.prose--ar .legend, .prose--ar .howto { font-family: var(--f-ui); font-size: 14px; }
.prose h3 { font-size: 16px; color: var(--ink); margin: 22px 0 6px; }
.prose .toc { font-size: 14px; line-height: 2; margin: 18px 0 0; }
.defs { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 6px 16px; margin: 10px 0 16px; }
.defs dt { font-weight: 600; color: var(--ink); }
.defs dd { margin: 0; }
@media (max-width: 560px) { .defs { grid-template-columns: 1fr; } .defs dd { margin-bottom: 8px; } }

.foot { margin: 72px 0 36px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* ---------- small screens ---------- */
.topnav { min-width: 0; }
.net { overflow-x: auto; }
@media (max-width: 600px) {
  .section-head { flex-wrap: wrap; row-gap: 2px; }
  .section-head h2 { white-space: normal; font-size: 21px; }
  .section-head .rule { display: none; }
  .section-head .meta { flex-basis: 100%; }
  .stats { gap: 18px; }
  .p-hero__epithet { font-size: 18px; }
  .report { grid-template-columns: 44px 1fr auto; }
}

/* named lists & catalogue */
.named { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 8px; }
.named__ar { font-family: var(--f-ar); direction: rtl; text-align: right; font-size: 18px; line-height: 1.95; margin: 0; }
.named__ar .person-link { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 4px; }
.named__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
details.cat { margin-top: 12px; }
details.cat summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
code { font-size: 12.5px; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }

/* language switcher (as in Mutūn) */
.langsw { display: inline-flex; gap: 2px; margin: 0 4px; padding: 2px; border-radius: 999px; background: var(--bg-2); flex: none; }
.langsw button { height: 28px; min-width: 32px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.langsw button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.langsw button[lang="ar"] { font-family: var(--f-ar); font-size: 15px; }
@media (max-width: 600px) { .langsw button { min-width: 26px; padding: 0 5px; } }

/* right-to-left */
[dir="rtl"] body { font-family: var(--f-ui), var(--f-ar); }
[dir="rtl"] .kv dd { text-align: left; }
[dir="rtl"] .back svg { transform: scaleX(-1); }
[dir="rtl"] .principle { border-left: 0; border-right: 2px solid var(--accent); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
[dir="rtl"] .search svg { left: auto; right: 14px; }
[dir="rtl"] .search input { padding: 0 38px 0 14px; }
[dir="rtl"] .cite-pop .x { right: auto; left: 8px; }
[dir="rtl"] .row, [dir="rtl"] .card__top, [dir="rtl"] .claim { text-align: right; }
[dir="rtl"] .card__en, [dir="rtl"] .p-hero__en { font-family: var(--f-ar); font-style: normal; }
[dir="rtl"] .tl svg, [dir="rtl"] .net svg, [dir="rtl"] .leaflet-container { direction: ltr; }
[dir="rtl"] .sheet { left: auto; right: 16px; }
@media (max-width: 640px) { [dir="rtl"] .sheet { right: 8px; left: 8px; } }
/* in Arabic the Latin name is already shown in Arabic: hide the duplicate */
html[lang="ar"] .claim__main > .ar.muted, html[lang="ar"] .stop .ar.muted, html[lang="ar"] .sheet__head .ar,
html[lang="ar"] .p-hero__ar + .p-hero__en, html[lang="ar"] .card__ar + .card__en { display: none; }

/* display settings */
.prefs-btn { position: relative; }
.prefs-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 99px; background: var(--gold); }
.prefs { position: fixed; z-index: 2100; width: min(340px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; display: grid; gap: 10px; }
.prefs__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prefs__lbl { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.prefs__note { margin: -2px 0 2px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--bg-2); }
.seg button { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
html[data-cal="ce"] .era__ce { display: none; }
.card__top .chips { gap: 4px; flex-wrap: nowrap; }
.claim > span { flex-wrap: wrap; justify-content: flex-end; }
.claim__main { overflow-wrap: anywhere; }
.card__top .chips { flex-wrap: wrap; justify-content: flex-end; }
.card__top { align-items: flex-start; }
.report { grid-template-columns: minmax(64px, max-content) 1fr auto; }
.report__y { white-space: nowrap; }

/* network: vertical generations with name pills */
.net { overflow: visible; background: transparent; border: 0; }
.net svg { width: 100%; height: auto; min-width: 0; }
.net .band rect { fill: var(--surface); stroke: var(--line); }
.net .band text { fill: var(--ink-3); font-size: 11px; font-family: var(--f-ui); letter-spacing: .02em; }
.net .edges .edge { fill: none; stroke: var(--ink-3); stroke-opacity: .22; stroke-width: 1.1; transition: stroke-opacity .2s; }
.net .node { cursor: pointer; }
.net .node rect { fill: var(--bg); stroke: var(--line-2); stroke-width: 1; transition: fill .15s, stroke .15s; }
.net .node text { fill: var(--ink); font-size: 12.5px; font-family: var(--f-ui); paint-order: normal; stroke: none; pointer-events: none; }
.net .node text.ar-t { font-family: var(--f-ar); font-size: 15px; }
.net .node:hover rect, .net .node:focus-visible rect { stroke: var(--accent); }
.net .node:focus { outline: none; }
.net .node.is-sel rect { fill: var(--accent); stroke: var(--accent); }
.net .node.is-sel text { fill: var(--accent-ink); font-weight: 600; }
.net .node.is-t rect { stroke: var(--gold); stroke-width: 2; fill: var(--gold-soft); }
.net .node.is-s rect { stroke: var(--accent); stroke-width: 2; fill: var(--accent-soft); }
.net .node.is-off { opacity: .28; }
.net-card { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.net-card__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.net-card__head .person-link { font-family: var(--f-display); font-size: 20px; }
.net-card__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.net-card__cols h3 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
@media (max-width: 640px) { .net-card__cols { grid-template-columns: 1fr; } }
.net-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) {
  .net-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .net-card { margin-top: 0; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
  .net-card__cols { grid-template-columns: 1fr; }
}
.net .edges .edge.is-on { stroke: var(--accent); stroke-opacity: .9; stroke-width: 2; }
.net .edges .edge.is-in { stroke: var(--gold); stroke-opacity: .9; stroke-width: 2; }
.net .edges .edge.is-off { stroke-opacity: .05; }
.net .edges .edge--medium { stroke-dasharray: 4 4; }

/* ==========================================================================
   Masār al-Anbiyāʾ additions
   ========================================================================== */
.scope { text-align: center; margin: 14px auto 0; max-width: 640px; }
.center { justify-content: center; }
.pcard .card__en .muted { font-size: 13px; }
.pill--pilot, .pill--c-certain { background: var(--accent-soft); color: var(--accent); }
.pill--core, .pill--g, .pill--t-quran_explicit, .pill--t-sahih_hadith, .pill--t-hasan_hadith, .pill--t-classical_tafsir_supported { background: var(--bg-2); color: var(--ink-2); }
.pill--context, .pill--warn, .pill--c-probable, .pill--c-disputed, .pill--t-historical_report { background: var(--warn-soft); color: var(--warn); }
.pill--c-strong { background: var(--gold-soft); color: var(--gold); }
.pill--c-unknown { background: var(--bg-2); color: var(--ink-3); }

/* profile */
.secnav { justify-content: center; margin: 18px 0 8px; position: sticky; top: 60px; z-index: 20; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.secnav .chip { display: inline-flex; align-items: center; }
.lead { max-width: 760px; margin: 18px auto 22px; text-align: center; }
.lead p { font-family: var(--f-display); font-size: 19px; line-height: 1.6; color: var(--ink); margin: 0 0 8px; }
.sec { max-width: 820px; margin: 44px auto 0; scroll-margin-top: 120px; }
.sec__h { font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.story__h { font-family: var(--f-display); font-weight: 500; font-size: 19px; margin: 26px 0 6px; }
.story__p { font-size: 16px; line-height: 1.75; margin: 0 0 12px; }
.cites { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: 1px; }
.cite--q { color: var(--accent); }
.cite--h { color: var(--gold); }
.cite--t { color: var(--warn); }
.claimpop p { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.claimpop .chips { margin-bottom: 8px; }
.cite-pop { max-height: min(70vh, 560px); overflow-y: auto; }
.ev { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.ev__src { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ev__src svg { width: 14px; height: 14px; color: var(--ink-3); }
.ev blockquote, .lesson blockquote, .ctx-item blockquote { margin: 6px 0; font-family: var(--f-ar); font-size: 19px; line-height: 1.9; direction: rtl; text-align: right; color: var(--ink); }
.ev .fine { margin: 2px 0 0; }

/* Qur'an */
.passage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 10px 0; }
.passage > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 12px; padding: 14px 18px; }
.passage > summary::-webkit-details-marker { display: none; }
.passage__ref { font-weight: 600; font-size: 13px; color: var(--accent); min-width: 64px; }
.passage__t { flex: 1; font-family: var(--f-display); font-size: 17px; }
.passage__s { font-family: var(--f-ar); font-size: 18px; color: var(--ink-3); }
.verses { padding: 0 18px 10px; }
.verse { padding: 14px 0; border-top: 1px solid var(--line); scroll-margin-top: 120px; }
.verse:target { background: var(--gold-soft); }
.verse__ar { font-family: "Amiri Quran", var(--f-ar); font-size: 25px; line-height: 2.2; direction: rtl; text-align: right; margin: 0; }
.verse__n { font-family: var(--f-ar); color: var(--gold); font-size: 20px; }
.verse__tr { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.verse__ref { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-right: 6px; }
.tafsir-tabs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tafsir-tabs button { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); background: transparent; }
.tafsir-tabs button.is-on, .tafsir-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.tafsir { margin-top: 10px; background: var(--bg-2); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 420px; overflow-y: auto; }
.tafsir__src { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-2); }
.tafsir__t { font-family: var(--f-ar); font-size: 18px; line-height: 1.95; direction: rtl; text-align: right; color: var(--ink); }
.qv { color: var(--accent); }
.ed-note { color: var(--ink-3); font-size: .85em; }

/* Sunnah */
.hcard { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 18px; margin: 10px 0; }
.hcard__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.hcard__top .ar { font-size: 17px; color: var(--ink-2); }
.hcard__claims { margin: 8px 0; padding-left: 18px; font-size: 15px; }
.hcard details summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.hcard__ar { font-family: var(--f-ar); font-size: 18px; line-height: 1.95; direction: rtl; text-align: right; }

/* map links */
.mini-map { height: 360px; border-radius: var(--radius); border: 1px solid var(--line); margin: 10px 0; }
.plinks { display: grid; gap: 10px; }
.plink { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; display: grid; gap: 8px; }
.plink .ar { font-size: 17px; color: var(--ink-2); }
.plink__two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plink__two small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 3px; }
@media (max-width: 600px) { .plink__two { grid-template-columns: 1fr; } }
.legend .lg-ring { background: transparent; border: 1.5px dashed var(--ink-2); }
.legend .lg-region { background: color-mix(in srgb, var(--accent) 15%, transparent); border: 1.5px dashed var(--accent); width: 14px; height: 14px; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 6px 0 10px; }
.ctx-mini { font-size: 12.5px; color: var(--ink-2); background: var(--warn-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; }
.sheet .btn { margin-top: 10px; }

/* lessons, context, evidence */
.lesson { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 14px 0; }
.lesson > p { margin: 0; font-size: 15.5px; }
.ctx { background: var(--warn-soft); border-radius: var(--radius); padding: 16px 20px; border: 1px dashed color-mix(in srgb, var(--warn) 40%, transparent); }
.ctx .sec__h { border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.ctx-item { padding: 10px 0; border-top: 1px dashed color-mix(in srgb, var(--warn) 30%, transparent); }
.ctx-item p { margin: 6px 0; font-size: 14.5px; }
.etable { display: grid; }
.erow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.erow__m { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .erow { grid-template-columns: 1fr; } .erow__m { justify-content: flex-start; } }
.flags { font-size: 14px; color: var(--ink-2); }

/* lineage */
.ln-wrap { padding: 10px; overflow-x: auto; }
.ln { width: 100%; min-width: 420px; height: auto; display: block; }
.ln .ln-en { font: 500 13px var(--f-ui); fill: var(--ink); }
.ln .ln-ar { font: 17px var(--f-ar); fill: var(--ink-3); }
.ln a:hover .ln-en { fill: var(--accent); }
/* Arabic interface: the name column is already Arabic, so show it once and keep the diagram's left-to-right geometry */
html[lang="ar"] .ln .ln-ar { display: none; }
html[lang="ar"] .ln .ln-en { font: 18px var(--f-ar); }
@media (max-width: 900px) { .lineage { grid-template-columns: 1fr; } }
html[dir="rtl"] .lesson { border-left: 0; border-right: 3px solid var(--accent); padding: 4px 14px 4px 0; }
html[dir="rtl"] [lang="en"] { unicode-bidi: plaintext; }

/* provenance, support and review */
.cite--attr { border-style: dashed; }
.pill--s-direct, .pill--r-scholarly_reviewed { background: var(--accent-soft); color: var(--accent); }
.pill--s-strong_inference, .pill--r-reviewed { background: var(--gold-soft); color: var(--gold); }
.pill--s-interpretive, .pill--s-contextual_only, .pill--r-research_draft { background: var(--warn-soft); color: var(--warn); }
.speaker { margin: 2px 0 4px; }
.speaker--companion { color: var(--warn); font-weight: 600; }
.kv--h { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; color: var(--ink-2); margin: 6px 0 0; }
.kv--h dt { color: var(--ink-3); } .kv--h dd { margin: 0; }
.notice--ok { background: var(--accent-soft); }
.howto { font-size: 12.5px; color: var(--ink-2); background: var(--bg-2); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px 0; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.howto ul { margin: 6px 0 2px; padding-left: 18px; } .howto li { margin: 3px 0; }

.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; }
.src p, .src h4, .prose a { overflow-wrap: anywhere; }
/* English content inside the Arabic interface reads left to right (punctuation stays at the end) */
html[dir="rtl"] [lang="en"] { direction: ltr; unicode-bidi: isolate; }

/* ==========================================================================
   2026 redesign: research bar, header, home, prophet cards, profile layout
   ========================================================================== */
.rbar { background: var(--night); color: var(--night-2); font-size: 12.5px; text-align: center; padding: 8px 16px; }
.brand { align-items: center; gap: 12px; }
.brand__sq { width: 36px; height: 36px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 22px/1 var(--f-ar); flex: none; }
.brand__t { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font: 500 21px/1.1 var(--f-display); letter-spacing: 0; }
.brand__sub { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 600px) { .brand__name { display: inline; font-size: 18px; } .brand__sub { display: none; } }
.kicker { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.kicker--accent { color: var(--accent); }
.kicker--accent::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.h2x { margin: 8px 0 0; font: 500 clamp(30px, 3.4vw, 44px)/1.1 var(--f-display); }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 4px; border: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn:hover { border-color: var(--ink-3); }
.arrow-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; color: var(--accent); }
.arrow-link svg { width: 16px; height: 16px; }

/* home */
.h-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 56px; align-items: center; padding: 72px 0 80px; }
.h-hero__ar { margin: 14px 0 0; font: 400 clamp(64px, 8vw, 116px)/1.15 var(--f-ar); text-align: start; }
.h-hero__tag { margin: 6px 0 0; font: 400 clamp(24px, 2.6vw, 34px)/1.22 var(--f-display); }
.h-hero__lede { margin: 20px 0 0; color: var(--ink-2); max-width: 500px; }
.h-hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.h-stats { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 13.5px; color: var(--ink-2); }
.h-stats b { color: var(--ink); font-weight: 600; }
.h-arch { margin: 0; position: relative; }
.h-arch svg { width: 100%; height: auto; }
.h-arch figcaption { position: absolute; inset-inline-start: 0; bottom: 24px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; padding: 14px 16px; max-width: 300px; box-shadow: var(--shadow-lg); }
.h-arch .verse-ar { font: 21px/1.9 var(--f-quran); text-align: right; direction: rtl; }
.h-arch .verse-tr { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.h-arch .verse-ref, .h-ayah .verse-ref { color: var(--accent); font-weight: 500; }
.band { padding: 88px 0; background: var(--surface); border-block: 1px solid var(--line); }
.band__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 36px; }
.band__head p { margin: 10px 0 0; color: var(--ink-2); max-width: 560px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.filters button { min-height: 40px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); }
.filters button.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pc { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 18px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; min-height: 150px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.pc:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pc__top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--ink-3); letter-spacing: .08em; }
.pc__badge { background: var(--accent); color: var(--accent-ink); padding: 1px 7px; border-radius: 3px; letter-spacing: .04em; }
.pc__ar { font: 38px/1.5 var(--f-ar); text-align: right; margin-top: 6px; transition: color .2s; direction: rtl; }
.pc:hover .pc__ar { color: var(--accent); }
.pc__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: auto; }
.pc__en { font: 20px var(--f-display); }
.pc__people { font-size: 12px; color: var(--ink-3); }
.ctxrow { margin-top: 48px; padding-top: 28px; border-top: 1px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ctxrow > div:first-child { flex: 1 1 260px; }
.ctxrow h3 { margin: 0; font: 500 24px var(--f-display); }
.ctxrow p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; max-width: 360px; }
.ctxgrid { flex: 3 1 520px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ctxgrid a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 4px; min-height: 44px; }
.ctxgrid a:hover { border-color: var(--gold); }
.ctxgrid .en { font: 17px var(--f-display); }
.ctxgrid .ar { font-size: 21px; color: var(--ink-2); }
.h-ayah { padding: 96px 0; text-align: center; max-width: 860px; margin: 0 auto; }
.h-ayah svg { margin: 0 auto; width: 44px; height: 44px; }
.h-ayah .verse-ar { margin: 22px 0 0; font: clamp(34px, 4.4vw, 56px)/1.9 var(--f-quran); direction: rtl; }
.h-ayah .verse-tr { margin: 10px 0 0; font: italic clamp(20px, 2vw, 25px) var(--f-display); color: var(--ink-2); }
.h-ayah .verse-ref { margin: 10px 0 0; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.h-atlas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: center; padding-bottom: 96px; }
.h-atlas__map { position: relative; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; height: 440px; }
.h-atlas__map .mini { position: absolute; inset: 0; }
.h-atlas__count { position: absolute; inset-inline-end: 12px; top: 12px; z-index: 500; background: color-mix(in srgb, var(--surface) 95%, transparent); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; font-size: 12px; }
.h-atlas p { margin: 14px 0 0; color: var(--ink-2); }
.dark-band { background: var(--night); color: var(--night-ink); padding: 88px 0; }
.dark-band .kicker { color: var(--night-gold); }
.pillars { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--night-line); border: 1px solid var(--night-line); }
.pillars > div { background: var(--night); padding: 26px 24px; }
.pillars .ar { font: 30px var(--f-ar); color: var(--night-gold); }
.pillars h3 { margin: 6px 0 0; font: 500 22px var(--f-display); }
.pillars p { margin: 8px 0 0; font-size: 14px; color: var(--night-2); }
.dark-band .arrow-link { color: var(--night-gold); margin-top: 22px; }

/* footer */
.sfoot { border-top: 1px solid var(--line); margin-top: 0; }
.sfoot__in { padding: 36px 0 44px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 24px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.sfoot__sites { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.sfoot__k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sfoot__site { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.sfoot__site i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sfoot__site.is-here { font-weight: 500; }
.sfoot__links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sfoot__links a, .sfoot__src a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.sfoot__src { width: 100%; font-size: 12px; color: var(--ink-3); }

/* profile */
.pf-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.pf-head__orn { position: absolute; inset-inline-end: -60px; top: -40px; width: 460px; height: 460px; opacity: .55; pointer-events: none; }
.pf-head__in { position: relative; padding: 28px 0 48px; }
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.pf-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 24px; }
.pf-title__names { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.pf-title h1 { margin: 0; font: 400 clamp(76px, 9vw, 128px)/1.45 var(--f-ar); }
.pf-title .salam { font: 22px var(--f-ar); color: var(--gold); }
.pf-title__en { font: clamp(30px, 3.2vw, 42px)/1.1 var(--f-display); margin-top: -6px; }
.pf-title__ep { margin: 10px 0 0; font: italic 21px var(--f-display); color: var(--ink-2); }
.pf-title__ep .ar { font-style: normal; font-size: 19px; color: var(--ink-3); margin: 0 10px; display: inline-block; }
.pf-badges { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; align-items: center; }
.pf-badges > span, .pf-badges > a { padding: 5px 10px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--ink-2); }
.pf-badges .b-acc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pf-badges .b-draft { border-style: dashed; border-color: var(--gold); color: var(--gold); }
.pf-badges .b-ok { border-color: var(--accent); color: var(--accent); }
.pf-brief { margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 22px 24px; max-width: 860px; }
.pf-brief__k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.pf-brief p { margin: 0; font: 20px/1.55 var(--f-display); }
.pf-body { display: flex; flex-wrap: wrap; gap: 56px; padding: 56px 0 24px; align-items: flex-start; }
.pf-main { flex: 999 1 560px; min-width: 0; }
.pf-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 88px; }
@media (max-width: 900px) { .pf-side { position: static; } }
.pf-main .notice { margin-top: 0; }
.pf-main .sec__h, .pf-main > section > h2 { font: 500 34px var(--f-display); }
.story__h { font: 500 24px var(--f-display); display: flex; align-items: center; gap: 12px; }
.story__h .rn { font: 600 12px var(--f-ui); color: var(--gold); letter-spacing: .1em; }
.story__p { font-size: 17px; line-height: 1.75; }
.side-card { border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px; background: var(--surface); }
.side-card__k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.side-toc { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.side-toc a { color: var(--ink-2); border-inline-start: 2px solid var(--line); padding: 4px 0; padding-inline-start: 12px; }
.side-toc a.is-on { color: var(--ink); font-weight: 500; border-inline-start-color: var(--accent); }
.side-place + .side-place { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-place__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.side-place__h b { font: 500 20px var(--f-display); }
.side-place p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.side-place__geo { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.geo-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.geo-dot--region { border: 1px dashed var(--ink); }
.geo-dot--trad { width: 11px; height: 11px; border: 2px dashed var(--ink); }
.geo-dot--point { width: 11px; height: 11px; background: var(--ink); }
.side-people { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.side-people > div { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.side-unknown { background: var(--night); color: var(--night-2); border-radius: 4px; padding: 18px 20px; font-size: 13px; }
.side-unknown .side-card__k { color: var(--night-gold); }
.side-unknown p { margin: 0 0 8px; }
.pf-nav { margin: 56px 0 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pf-nav a { flex: 1 1 220px; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-nav a:hover { border-color: var(--ink-3); }
.pf-nav .n { font-size: 12px; color: var(--ink-3); }
.pf-nav .en { font: 19px var(--f-display); }
.pf-nav .ar { font-size: 24px; }
/* evidence opened inside the story */
.evcard { margin: 16px 0 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: var(--shadow-lg); overflow: hidden; }
.evcard__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; }
.evcard__top .lvl { display: flex; align-items: center; gap: 8px; }
.evcard__top .dot { width: 8px; height: 8px; border-radius: 50%; }
.evcard__top .muted { color: var(--ink-3); }
.evcard__body { padding: 16px 20px 18px; }
.evcard__body .claimpop > p:first-child { display: none; }
.evcard__body .chips { display: none; }
.evcard__claim { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.evcard .verse-full { font: 28px/2 var(--f-quran); text-align: right; direction: rtl; margin: 4px 0 0; }
.evcard .verse-tr { font-size: 14.5px; color: var(--ink-2); margin: 8px 0 0; }
.evcard__close { font-size: 12.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.cite[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sec, .pf-side [id] { scroll-margin-top: 90px; }
@media (max-width: 600px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pc { min-height: 118px; padding: 14px 14px 12px; }
  .pc__ar { font-size: 31px; }
  .pc__en { font-size: 17px; }
  .h-hero { padding: 44px 0 56px; gap: 36px; }
  .band, .dark-band { padding: 60px 0; }
  .h-ayah { padding: 64px 16px; }
  .h-atlas__map { height: 340px; }
  .pf-body { gap: 32px; padding-top: 36px; }
}
@media (max-width: 520px) { .topnav a[data-nav] { display: none; } }
html[lang="ar"] .h-arch text.tr { display: none; }
/* Arabic interface: the name and epithet are already shown in Arabic once */
html[lang="ar"] .pf-title__en, html[lang="ar"] .pf-title__ep .ar { display: none; }
