/* ═══════════════════════════════════════════════════════════
   دار النتيجة الموثقة · هوية هيئة الحكومة الرقمية (DGA)
   «بأسلوب رقمي» — خلفية كحلية-بنفسجية داكنة، نعناعي مميز،
   مرجاني للسلبي، بنفسجي #5c2aa3 للتدرجات الدقيقة فقط.
   ═══════════════════════════════════════════════════════════ */
:root {
  --paper: #23174d;           /* الكحلي-البنفسجي الداكن */
  --paper-hi: #2f2152;        /* لوح أفتح من الخلفية (بطاقات) */
  --paper-glow: #2b1f6b;      /* توهج علوي */
  --ink: #f6f4fc;             /* نص أبيض مائل للبنفسجي */
  --ink-md: #cfc8e6;
  --ink-lo: #a89ed6;
  --line: rgba(255,255,255,.14);   /* الخطوط الشعرية #ffffff22 تقريبًا */
  --line-lo: rgba(255,255,255,.07);
  --red: #37d5a7;             /* LEGACY ACCENT SLOT → النعناعي DGA */
  --red-hi: #2bb894;
  --blue: #4ee0b6;            /* روابط — نعناعي أفتح */
  --blue-soft: #9d8fd0;       /* خزامى (سلسلة ثالثة) */
  --copper: #e8b45a;
  --green: #37d5a7;
  --neg: #ff6b7a;             /* مرجاني دافئ — الانحدار والمخاطر */
  --violet: #5c2aa3;          /* للتدرجات الدقيقة فقط */
  --serif: "naskh", "Noto Naskh Arabic", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "naskh", "Noto Naskh Arabic", "Iowan Old Style", Palatino, Georgia, serif;
  --disp: "kufi", "naskh", "Noto Naskh Arabic", Georgia, serif; /* قطع العرض الهندسي — للعناوين فقط */
  --mono: Menlo, Consolas, "SF Mono", "DejaVu Sans Mono", "naskh", ui-monospace, monospace;
  --shadow: 0 1px 2px rgba(8,4,24,.35), 0 10px 34px rgba(8,4,24,.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  --railw: 460px;
  /* تدرج ممتد على كامل الصفحة (بلا background-attachment حتى تصح لقطات fullPage) */
  background: linear-gradient(180deg, var(--paper-glow) 0%, var(--paper) 1400px, #1b1240 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(55,213,167,.28); }
b, strong { font-weight: 700; }
em { font-style: normal; color: var(--ink); font-weight: 700; } /* الأرقام داخل النثر حبريّة — النعناعي محصور بالقابل للنقر */
a { color: var(--blue); }
bdi, .num { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.num { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }

/* ── شعار الهيئة ── */
.brand img, .rail-logo, .foot-brand img { display: block; height: auto; }
.brand { margin-bottom: 20px; }
.brand img { width: 168px; }
.rail-logo { width: 118px; flex: 0 0 auto; }
.foot-brand {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-lo);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.foot-brand img { width: 150px; }
.foot-brand p {
  font-family: var(--mono); font-size: 11px; color: var(--ink-lo);
  line-height: 1.9; margin: 0; max-width: 420px;
}

/* ── شريط تقدّم المراحل (أعلى) ── */
#era-rail {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  background: rgba(35,23,77,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
  visibility: hidden; transform: translateY(-110%);
  transition: transform .4s ease, visibility 0s linear .4s;
}
#era-rail.on { visibility: visible; transform: none; transition: transform .4s ease; }
.rail-year {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--red); border-radius: 4px; color: var(--red);
  padding: 2px 10px; background: transparent;
  font-variant-numeric: tabular-nums; direction: ltr;
}
.rail-track { flex: 1; height: 38px; position: relative; }
.rail-track .seg {
  position: absolute; top: 18px; height: 2px; background: var(--line);
  pointer-events: auto; cursor: pointer;
}
.rail-track .seg.active { background: var(--red); height: 4px; top: 17px; }
.rail-track .seg .seg-label {
  position: absolute; top: -16px; right: 0; font-family: var(--mono);
  font-size: 10px; color: var(--ink-lo); white-space: nowrap; letter-spacing: .02em;
}
.rail-track .seg .seg-year {
  position: absolute; top: 12px; right: 0; font-family: var(--mono);
  font-size: 9px; color: var(--ink-lo); white-space: nowrap; opacity: .8;
}
.rail-track .seg.active .seg-label { color: var(--ink); font-weight: 700; }
.rail-track .seg.active .seg-year { color: var(--ink-md); font-weight: 700; }

/* ── الغلاف: مسرح لاصق ~140vh — التفكيك مدفوع بالتمرير ── */
#cover { position: relative; min-height: 100vh; height: 240vh; }
.cover-stage {
  position: sticky; top: 0; height: 100vh; z-index: 1; overflow: hidden;
  /* أسلوب «رقمي»: شبكة نقطية خافتة + توهج بنفسجي دقيق على الكحلي */
  background:
    radial-gradient(1100px 700px at 32% 46%, rgba(92,42,163,.34), transparent 62%),
    radial-gradient(rgba(255,255,255,.055) 1px, transparent 1.5px),
    linear-gradient(155deg, var(--paper-glow) 0%, var(--paper) 52%, #1a1140 100%);
  background-size: auto, 26px 26px, auto;
}
#cover-canvas, #cover-canvas-x, #cover-canvas-w { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-inner {
  position: relative; z-index: 2; max-width: 660px;
  margin: -100vh 56px 0 auto; padding: 6vh 24px 60px;
}
@media (max-width: 980px) {
  #cover { height: auto; }
  .cover-stage { position: absolute; top: 0; left: 0; right: 0; height: 45vh; }
  .cover-inner { margin: 0 auto; max-width: 640px; padding: 45vh 22px 40px; }
  .cover-title { font-size: clamp(34px, 8.6vw, 52px); }
  .cover-sub { font-size: clamp(16px, 4.6vw, 21px); }
  .brand { padding-top: 14px; }
}

.cover-mode { margin-top: 22px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cover-mode::before {
  content: "الغلاف"; font-family: var(--mono); font-size: 10px;
  letter-spacing: .04em; color: var(--ink-lo); margin-left: 4px;
}
.cover-mode button {
  font-family: var(--sans); font-size: 12px;
  color: var(--ink-md); background: rgba(47,33,82,.55);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.cover-mode button.on { border-color: var(--red); color: var(--red); font-weight: 700; }
.cover-mode button:hover { border-color: var(--red); color: var(--ink); }
.cover-kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em;
  color: var(--ink-lo); margin-bottom: 22px;
}
.cover-title {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(40px, 6.2vw, 84px);
  line-height: 1.34; letter-spacing: 0;
  color: var(--ink);
}
.cover-title .cover-num { color: var(--ink); font-size: .58em; display: inline-block; margin-top: 10px; }
.cover-title .cover-num .era-blue { color: var(--red); } /* السطر النعناعي الوحيد المسموح في الغلاف */
.cover-sub {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(17px, 2vw, 23px); color: var(--ink-md);
  margin: 18px 0 24px; letter-spacing: 0;
}
.cover-lede { max-width: 640px; font-size: 16.5px; color: var(--ink-md); line-height: 1.9; }
.chain {
  font-family: var(--mono); font-size: 13.5px; font-weight: 700; color: var(--ink);
  background: var(--paper-hi); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 8px; white-space: nowrap; direction: ltr; unicode-bidi: isolate;
}
.cover-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 26px; max-width: 560px; }
.chip {
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  color: var(--ink); background: rgba(47,33,82,.5);
  border: 1.5px solid rgba(255,255,255,.35); border-radius: 6px; padding: 8px 18px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { background: var(--red); border-color: var(--red); color: #14243d; }
.cover-anchor { font-size: 12.5px; color: var(--ink-lo); font-family: var(--mono); display: block; max-width: 680px; line-height: 1.8; }
.scroll-hint {
  margin-top: 6vh; font-family: var(--mono); font-size: 11px; color: var(--ink-lo);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; letter-spacing: .1em;
  width: max-content;
}
.scroll-hint span {
  display: block; width: 1px; height: 44px; margin-right: 22px;
  background: linear-gradient(var(--red), transparent);
}

/* ── Section band ── */
.band { padding: 72px 0 64px; border-top: 1px solid var(--line-lo); }
.prose {
  max-width: 692px;
  margin: 0 auto;
  padding: 0 28px;
}
.wide {
  max-width: 800px;
  margin: 36px auto;
  padding: 0 28px;
}
.wide.xl { max-width: 924px; }
.sec-no {
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  color: var(--ink-lo); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.sec-no::before {
  content: ""; flex: 0 0 26px; height: 3px;
  background: var(--red);
}
h2 { font-family: var(--disp); font-size: clamp(26px, 3.1vw, 37px); font-weight: 700; line-height: 1.5; margin-bottom: 22px; max-width: 24em; color: var(--ink); }
h3 { font-family: var(--disp); font-size: 21px; font-weight: 700; line-height: 1.6; margin-bottom: 14px; color: var(--ink); }
.sub-h { margin-top: 26px; }
.prose p { margin-bottom: 18px; }
.muted { color: var(--ink-lo); font-size: 14px; }
.hint-click { font-size: 13px; color: var(--blue); border-bottom: 1px dashed var(--blue); white-space: nowrap; cursor: pointer; }
.era-tag {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  color: var(--ink-lo); margin-bottom: 8px; font-weight: 400;
  padding-right: 14px; position: relative;
}
.era-tag::before {
  content: ""; position: absolute; right: 0; top: .62em;
  width: 6px; height: 6px; background: var(--red);
}
.laws { list-style: none; margin: 8px 0 16px; }
.laws li {
  padding: 11px 0; border-bottom: 1px solid var(--line-lo);
  margin: 0;
}
.laws li:first-child { border-top: 1px solid var(--line-lo); }

/* ── ملاحظة المحلل ── */
.note-box {
  border: 0; background: transparent; box-shadow: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 30px 0 26px;
  padding: 14px 0 16px;
  font-size: 14px; color: var(--ink-md); line-height: 1.9;
}
.note-box::before {
  content: "ملاحظة المحلل";
  display: block;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-lo); margin-bottom: 8px;
}
.note-box p { margin-bottom: 10px; }
.note-box p:last-child { margin-bottom: 0; }
.degrade-note {
  font-family: var(--mono); font-size: 12px; color: var(--neg);
  border: 1px dashed var(--neg); border-radius: 4px; padding: 8px 12px; background: rgba(255,107,122,.07);
}

/* ── Rail cross-reference note ── */
.rail-note {
  font-family: var(--mono); font-size: 11px; color: var(--ink-lo);
  line-height: 1.8;
  margin: 22px 0 18px; padding-right: 16px; position: relative;
}
.rail-note::before { content: "←"; position: absolute; right: 0; color: var(--red); }
@media (max-width: 1180px) { .rail-note { display: none; } }

/* Chart containers */
.chart-frame {
  background: transparent; border: 0; box-shadow: none;
  padding: 8px 0 4px; position: relative;
}
.chart-title { font-family: var(--disp); font-weight: 700; font-size: 18px; margin: 0 0 3px 0; line-height: 1.6; color: var(--ink); }
.chart-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-lo); margin: 0 0 14px 0; letter-spacing: .02em; padding-bottom: 8px; border-bottom: 1px solid var(--line-lo); line-height: 1.7; }
.chart-src { font-family: var(--mono); font-size: 10.5px; color: var(--ink-lo); margin: 10px 0 4px; line-height: 1.7; }
.chart-frame svg text { font-family: var(--mono); }
.chart-frame svg .hang { cursor: pointer; transition: opacity .18s ease; }
.chart-frame svg .hang:hover { opacity: .68; }
.chart-frame svg .hang:focus-visible, .chart-frame svg g[tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; opacity: .85; }
.chart-frame svg { display: block; max-width: 100%; height: auto; }
.fig-xscroll { overflow-x: auto; }

/* metric strip — بطاقات الإحصاء: أرقام ضخمة serif بيضاء، المفتاحية نعناعية، الانحدار مرجاني، بلا ظلال */
.metric-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  margin-top: 14px;
}
@media (max-width: 900px) { .metric-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.metric-strip .m {
  background: var(--paper-hi); padding: 18px 16px 14px; cursor: pointer; transition: background .15s;
}
.metric-strip .m:hover { background: #37265f; }
.metric-strip .m .v {
  font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; direction: ltr; text-align: right; line-height: 1.15;
}
.metric-strip .m .v.key { color: var(--red); }
.metric-strip .m .v.neg { color: var(--neg); }
.metric-strip .m .k { font-size: 13px; color: var(--ink-md); margin-top: 6px; line-height: 1.6; }

/* source button ◆ */
.src {
  border: 0; background: none; color: var(--red); cursor: pointer;
  font-size: 10px; vertical-align: super; padding: 0 2px; font-family: var(--mono);
}
.src:hover { color: var(--red-hi); }
.src:focus-visible, .chip:focus-visible, .cover-mode button:focus-visible, .term:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}

/* ── Scrollytape sticky layout ── */
.chron-grid {
  display: grid; grid-template-columns: minmax(360px, 42%) 1fr;
  max-width: 1440px; margin: 0 auto; gap: 0;
}
.chron-text { padding: 40px 20px 40px 40px; }
.step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding: 44px 24px; max-width: 620px; }
.step h3 { color: var(--ink-lo); transition: color .3s; }
.step.active-step h3 { color: var(--ink); }
.chron-dash { position: relative; }
.dash-inner {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}

/* ── Pull-quote · editorial ── */
.quote-card {
  margin: 46px 0 40px; position: relative;
  background: transparent;
  border: 0;
  border-top: 2px solid var(--red);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 24px 2px 20px;
}
.quote-card::before {
  content: "من السجل";
  display: block;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-lo); margin-bottom: 14px;
}
.quote-card .q-text {
  font-size: 21px; font-style: normal; font-weight: 700;
  font-family: var(--serif); color: var(--ink);
  line-height: 1.7; margin-bottom: 14px;
  text-wrap: balance;
}
.quote-card .q-who {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-md);
  letter-spacing: .02em;
}
.quote-card .q-who b { color: var(--ink); font-weight: 700; }
.quote-card .q-why {
  margin-top: 14px; padding-top: 12px; border-top: 1px dotted var(--line);
  font-size: 13.5px; color: var(--ink-md); line-height: 1.8; display: block;
}
.quote-card .q-lab {
  font-family: var(--mono); font-size: 10px; color: var(--ink-lo);
  margin-left: 6px; letter-spacing: .05em;
}
.quote-card .q-lab.why { color: var(--red); margin-right: 10px; font-weight: 700; }

/* drill card — لوح أفتح من الخلفية بحدّ نعناعي */
#drill-card {
  position: fixed; z-index: 200; min-width: 260px; max-width: 360px;
  background: #2f2152; color: #f6f4fc; padding: 14px 18px; border-radius: 6px;
  box-shadow: 0 14px 44px rgba(8,4,24,.6); font-size: 13.5px; line-height: 1.8;
  border: 1px solid rgba(255,255,255,.12);
  border-top: 3px solid var(--red);
}
#drill-card .d-title { font-family: var(--mono); font-size: 11px; color: #a89ed6; letter-spacing: .03em; }
#drill-card .d-val { font-family: var(--serif); font-size: 34px; font-weight: 700; color: #fff; margin: 2px 0; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; line-height: 1.3; }
#drill-card .d-val .pos { color: #37d5a7; } #drill-card .d-val .neg { color: #ff6b7a; }
#drill-card .d-fact { font-family: var(--serif); font-size: 17.5px; font-weight: 700; color: #fff; line-height: 1.7; margin: 4px 0 2px; }
#drill-card .d-sub { color: #cfc8e6; font-size: 13px; margin-top: 4px; }
#drill-card .d-src { font-family: var(--mono); font-size: 10.5px; color: #a89ed6; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); line-height: 1.7; }
#drill-card .d-close { position: absolute; top: 6px; left: 10px; color: #a89ed6; cursor: pointer; background: none; border: 0; font-size: 14px; }

/* appendix / sources */
#sec-sources { padding: 100px 0 80px; border-top: 1px solid var(--line-lo); }
#source-list { margin-top: 4px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: start; }
@media (max-width: 1420px) { #source-list { grid-template-columns: 1fr; } }
.src-row { display: block; padding: 10px 0 11px; border-bottom: 1px solid var(--line-lo); font-size: 13px; }
.src-row .s-fact { display: block; color: var(--ink); line-height: 1.65; }
.src-row .s-cite { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-md); margin-top: 4px; line-height: 1.7; }
.src-row .s-cite a { color: var(--blue); text-decoration: none; border-bottom: 1px dotted var(--line); overflow-wrap: anywhere; word-break: normal; }
.colophon { margin-top: 40px; font-family: var(--mono); font-size: 11px; color: var(--ink-lo); line-height: 2.1; }

/* source-category badges */
.src-cat {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .03em;
  border: 1px solid var(--line); border-radius: 3px;
  padding: 0 5px; margin-left: 6px; color: var(--ink-md); vertical-align: 1px;
}
.src-cat.press { border-color: var(--copper); color: var(--copper); }
.src-cat.company { border-color: var(--green); color: var(--green); }
.src-cat.gov { border-color: var(--ink-md); color: var(--ink-md); }
.src-cat.acad { border-color: var(--ink); color: var(--ink); border-style: dashed; }

/* data tables */
table.dt {
  border-collapse: collapse; width: 100%;
  font-family: var(--sans); font-size: 13.5px; line-height: 1.7;
}
table.dt th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--ink-md); text-align: right; padding: 7px 0 7px 12px;
  border-bottom: 1.5px solid var(--ink); white-space: nowrap;
}
table.dt td { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--line-lo); vertical-align: top; }
table.dt td.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; text-align: right; }
table.dt tr:hover td { background: var(--paper-hi); }
table.dt tr.hl td { background: rgba(55,213,167,.07); }

/* ── مصطلحات ثلاثية الأعمدة (term-mag) ── */
.term-mag {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0;
}
.term-mag .term {
  padding: 6px 26px 14px;
  cursor: default; outline: none;
}
.term-mag .term + .term { border-right: 1px solid var(--line-lo); }
.term-mag .term:first-child { padding-right: 2px; }
.term-mag .t-abbr {
  font-family: var(--disp); font-weight: 700; font-size: 28px;
  color: var(--ink); line-height: 1.45;
  transition: color .2s ease;
}
.term-mag .term:hover .t-abbr, .term-mag .term:focus-within .t-abbr { color: var(--red); }
.term-mag .t-full {
  font-family: var(--mono); font-size: 10px; color: var(--ink-lo);
  letter-spacing: .04em; margin: 6px 0 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-lo);
}
.term-mag .t-gist { font-size: 14px; color: var(--ink); line-height: 1.75; margin: 0; }
.term-mag .term { position: relative; }
.term-mag .t-more {
  position: absolute; right: 26px; left: 26px; top: 100%; z-index: 6;
  background: var(--paper-hi);
  border-bottom: 1px solid var(--line);
  padding: 10px 0 16px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .4s cubic-bezier(.25,.7,.3,1), opacity .3s ease .05s;
  pointer-events: none;
}
.term-mag .term:first-child .t-more { right: 2px; }
.term-mag .term:hover .t-more, .term-mag .term:focus-within .t-more,
.term-mag .term.open .t-more { max-height: 380px; opacity: 1; pointer-events: auto; box-shadow: 0 26px 34px -22px rgba(8,4,24,.7); }
.term-mag .t-more p { font-size: 13.5px; color: var(--ink-md); line-height: 1.8; margin: 0; }
.term-mag .t-hint {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  color: var(--ink-lo); margin-top: 12px; transition: opacity .25s ease;
}
.term-mag .term:hover .t-hint, .term-mag .term:focus-within .t-hint, .term-mag .term.open .t-hint { opacity: 0; }
@media (max-width: 760px) {
  .term-mag { grid-template-columns: 1fr; }
  .term-mag .term { padding: 18px 2px; border-right: 0 !important; border-top: 1px solid var(--line-lo); }
  .term-mag .term:first-child { border-top: 0; }
  .term-mag .t-more { position: static; max-height: none; opacity: 1; margin-top: 10px; padding: 0; border-bottom: 0; pointer-events: auto; }
  .term-mag .t-hint { display: none; }
}

/* tooltip */
.tip {
  position: fixed; z-index: 150; pointer-events: none;
  background: #2f2152; color: #f6f4fc; font-family: var(--mono); font-size: 11px;
  border: 1px solid rgba(255,255,255,.14);
  padding: 5px 10px; border-radius: 4px; opacity: 0; transition: opacity .12s; white-space: nowrap;
}

@media (max-width: 980px) {
  .chron-grid { grid-template-columns: 1fr; }
  .dash-inner { position: static; height: auto; padding: 20px 12px; }
  .fig-xscroll > svg { max-width: none !important; }
  .step { min-height: 0; }
}

/* ── Narrative column yields to left rail (RTL) ── */
main, footer#sec-sources { margin-left: var(--railw); }
#cover { margin-left: 0; }
#era-rail { left: var(--railw); }

/* ── الشريط الجانبي الثابت (يسار الشاشة في RTL) ── */
#dash-rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--railw);
  border: 0;
  border-left: 1px solid var(--line-lo);
  background: rgba(35,23,77,.55);
  backdrop-filter: blur(6px);
  z-index: 60;
  opacity: 0; visibility: hidden; transform: translateX(-24px);
  transition: opacity .55s ease, transform .55s ease, visibility 0s linear .55s;
}
#dash-rail.on { opacity: 1; visibility: visible; transform: none; transition: opacity .55s ease, transform .55s ease; }
#dash-rail canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
#dash-rail #dash-canvas {
  max-height: none; border: 0; border-radius: 0; box-shadow: none;
  background: transparent;
}

/* ── dek ── */
.dek {
  font-family: var(--serif); font-style: normal; font-weight: 400;
  font-size: 19px; line-height: 1.8; color: var(--ink-md);
  margin: -2px 0 28px; max-width: 620px;
  border: 0; padding: 0;
}
.dek strong, .dek b { color: var(--ink); font-weight: 700; }

@media (max-width: 1180px) {
  body { --railw: 0px; }
  #dash-rail { display: none; }
}
@media (max-width: 700px) {
  table.dt { display: block; overflow-x: auto; }
  .foot-brand img { width: 128px; }
}

/* section hairline */
hr.sep { border: 0; height: 1px; background: var(--line); margin: 0 auto; max-width: 860px; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* شريط النسخة الميسّرة (أعلى الصفحة) */
.a11y-bar { background: var(--red); color: #14243d; text-align: center; padding: 8px 16px; position: relative; z-index: 60; }
.a11y-bar a { color: #14243d; font-weight: 700; font-size: 15.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.a11y-bar a:hover { color: #000; }
.a11y-bar a:focus-visible { outline: 3px solid #14243d; outline-offset: 2px; border-radius: 4px; }
.foot-a11y { margin-top: 18px; font-size: 15px; color: var(--ink-md); }
.foot-a11y a { color: var(--blue); font-weight: 700; }

/* ── مبدّل اللغة AR | EN ── */
.lang-switch { display: inline-flex; gap: 2px; vertical-align: middle; margin-inline-start: 14px; }
.a11y-bar .lang-switch { position: absolute; top: 6px; inset-inline-end: 12px; margin: 0; }
.lang-switch button {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 9px; border-radius: 4px; cursor: pointer;
  border: 1.5px solid transparent; background: transparent; color: inherit;
}
.lang-switch button.on { border-color: currentColor; font-weight: 700; }
.a11y-bar .lang-switch button { color: #14243d; }
.a11y-bar .lang-switch button:not(.on) { opacity: .55; }
.a11y-bar .lang-switch button:hover { opacity: 1; text-decoration: underline; }
.a11y-bar .lang-switch button:focus-visible { outline: 2px solid #14243d; outline-offset: 1px; }
.rail-lang { margin-inline-start: 2px; pointer-events: auto; }
.rail-lang button { color: var(--ink-lo); padding: 2px 7px; font-size: 10px; }
.rail-lang button.on { color: var(--red); border-color: var(--red); }
.rail-lang button:hover { color: var(--ink); }
@media (max-width: 700px) { .a11y-bar { padding-inline-end: 86px; } }

/* ── اتجاه LTR: تصحيح المواضع الفيزيائية ── */
html[dir="ltr"] .note-box::before { content: "Analyst note"; }
html[dir="ltr"] .quote-card::before { content: "From the record"; }
html[dir="ltr"] .cover-mode::before { content: "Cover"; margin-left: 0; margin-right: 4px; }
html[dir="ltr"] .era-tag { padding-right: 0; padding-left: 14px; }
html[dir="ltr"] .era-tag::before { right: auto; left: 0; }
html[dir="ltr"] .rail-note { padding-right: 0; padding-left: 16px; }
html[dir="ltr"] .rail-note::before { content: "→"; right: auto; left: 0; }
html[dir="ltr"] table.dt th { text-align: left; padding: 7px 12px 7px 0; }
html[dir="ltr"] table.dt td { padding: 8px 12px 8px 0; }
html[dir="ltr"] table.dt td.num { text-align: right; }
html[dir="ltr"] .term-mag .term + .term { border-right: 0; border-left: 1px solid var(--line-lo); }
html[dir="ltr"] .term-mag .term:first-child { padding-right: 26px; padding-left: 2px; }
html[dir="ltr"] .term-mag .term { padding: 6px 26px 14px; }
html[dir="ltr"] .term-mag .t-more { right: auto; }
html[dir="ltr"] .term-mag .term .t-more { left: 26px; right: 26px; }
html[dir="ltr"] .term-mag .term:first-child .t-more { left: 2px; }
html[dir="ltr"] .scroll-hint span { margin-right: 0; margin-left: 22px; }
html[dir="ltr"] .scroll-hint { align-items: flex-start; }
html[dir="ltr"] .src-cat { margin-left: 0; margin-right: 6px; }
html[dir="ltr"] .q-lab { margin-left: 0; margin-right: 6px; }
html[dir="ltr"] .q-lab.why { margin-right: 0; margin-left: 10px; }
html[dir="ltr"] .chron-text { padding: 40px 40px 40px 20px; }
/* نصوص SVG داخل الرسوم تُحسب مواضعها افتراض الاتجاه نفسه — نثبّتها RTL دائمًا */
.chart-frame svg { direction: rtl; }
/* اتجاه كل نص SVG يُحسم من محتواه لا من الحاوية:
   نص عربي ⇒ RTL (الرقم أولًا من اليمين)، نص رقمي/لاتيني خالص ⇒ LTR.
   بدون ذلك كان `direction:"ltr"` المفروض على عناصر القيم يقلب ترتيب
   «1,590 دولار» إلى «دولار 1,590». */
.chart-frame svg text { unicode-bidi: plaintext; }
