/* الموسوعة العالمية للذكاء الاصطناعي — هوية فنار. مظهر فاتح واحد مقصود.
   تُستعمل الخصائص المنطقية (inline-start/end) لتنعكس الصفحة تلقائيًا بين العربية والإنجليزية. */
@font-face{font-family:"Reem Kufi";src:url(fonts/ReemKufi.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:"Readex Pro";src:url(fonts/ReadexPro.woff2) format("woff2");font-weight:160 700;font-display:swap}
@font-face{font-family:"Fraunces";src:url(fonts/Fraunces.woff2) format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"Fraunces";src:url(fonts/Fraunces-Italic.woff2) format("woff2");font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url(fonts/JetBrainsMono.woff2) format("woff2");font-weight:100 800;font-display:swap}
:root {
  --stone: #f2ede1; --stone-light: #f7f3ea; --paper: #fbf9f3; --paper-warm: #faf5e9;
  --ink: #1b2c4a; --ink-soft: #3d4e6d; --ink-mute: #5a6782;
  --teal: #0e6e7c; --teal-deep: #0a5966; --teal-wash: #e7f0f2;
  --amber: #8f5609; --amber-bright: #d78820; --amber-wash: #faf1dd;
  --rule: #c8bea8; --rule-soft: #ddd4bd;
  --sage: #46664b; --sage-soft: #dee6dd; --crimson: #8c3a3a; --slate: #495568;
  --f-display: "Reem Kufi", "Readex Pro", Tahoma, sans-serif;
  --f-body: "Readex Pro", Tahoma, "Segoe UI", sans-serif;
  --f-la: "Fraunces", Georgia, serif;
  --f-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --gut: clamp(16px, 4.2vw, 56px);
  color-scheme: light;
}
html[lang="en"] { --f-display: "Fraunces", Georgia, serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--ink); font-family: var(--f-body); font-weight: 350; font-size: 0.96875rem; line-height: 1.8; }
html[lang="en"] body { line-height: 1.7; font-size: 1rem; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 47px, rgba(200,190,168,.12) 47px, rgba(200,190,168,.12) 48px),
    repeating-linear-gradient(90deg, transparent 0, transparent 47px, rgba(200,190,168,.08) 47px, rgba(200,190,168,.08) 48px);
}
.beam { position: fixed; top: 0; bottom: 0; inset-inline-start: 32px; width: 1px; z-index: 1; pointer-events: none; opacity: .45;
  background: linear-gradient(to bottom, transparent 0%, var(--amber-bright) 18%, var(--amber-bright) 50%, var(--amber-bright) 82%, transparent 100%); }
.beam::before, .beam::after { content: ""; position: absolute; inset-inline-start: -4px; width: 9px; height: 9px; border: 1px solid var(--amber-bright); background: var(--stone); transform: rotate(45deg); }
.beam::before { top: 12%; } .beam::after { bottom: 12%; }
@media (max-width: 760px) { .beam { display: none; } }
.site > * { position: relative; z-index: 2; }
a { color: var(--teal-deep); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mono { font-family: var(--f-mono); direction: ltr; unicode-bidi: isolate; }
.ar-text { font-family: "Reem Kufi", "Readex Pro", Tahoma, sans-serif; direction: rtl; unicode-bidi: isolate; }
.la-text { font-family: var(--f-la); direction: ltr; unicode-bidi: isolate; }
h1, h2, h3, h4, h5 { margin: 0; text-wrap: balance; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 8px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }

/* الترويسة */
.masthead { border-bottom: 2px solid var(--ink); background: var(--paper); padding: 12px var(--gut); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.brand-mark { font-family: "Reem Kufi", "Readex Pro", sans-serif; font-weight: 700; font-size: 20px; }
html[lang="en"] .brand-mark { font-family: var(--f-la); font-weight: 600; font-size: 21px; }
.brand-mark .slash { color: var(--amber-bright); margin: 0 6px; font-weight: 400; }
.brand-mark .other { font-family: var(--f-la); font-style: italic; font-weight: 400; font-size: 17px; color: var(--ink-soft); }
html[lang="en"] .brand-mark .other { font-family: "Reem Kufi", sans-serif; font-style: normal; font-size: 16px; }
.brand-tagline { font-size: 12px; color: var(--ink-mute); }
.mast-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mast-tool { padding: 4px 11px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); text-decoration: none; font-size: 13px; transition: background .15s, color .15s, border-color .15s; }
.mast-tool:hover { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-deep); }
.mast-tool[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mast-tool.lang { background: var(--ink); color: var(--paper); border-color: var(--ink); font-family: var(--f-mono); font-size: 12px; letter-spacing: .5px; }
.mast-tool.lang:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--paper); }
.mast-tool.account[hidden] { display: none; }
.breadcrumb-bar { background: var(--paper-warm); border-bottom: 1px solid var(--rule); padding: 8px var(--gut); font-size: 12.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; align-items: center; }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { color: var(--amber-bright); }
.breadcrumb .current { color: var(--ink); font-weight: 500; }
.ref-number { color: var(--amber); font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; direction: ltr; unicode-bidi: isolate; }

/* رأس الكيان */
.entity-header { background: var(--paper); padding: 40px var(--gut) 34px; border-bottom: 1px solid var(--rule); position: relative; }
.entity-header::before { content: ""; position: absolute; top: 0; inset-inline-start: var(--gut); width: 80px; height: 4px; background: var(--amber-bright); }
.dossier-label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; }
.dossier-id { font-size: 12px; color: var(--ink-mute); }
.dossier-id .mono { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 1px 9px; font-size: 12px; border: 1px solid var(--rule); background: var(--stone-light); color: var(--ink-soft); white-space: nowrap; text-decoration: none; }
.tag.primary { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-deep); }
.tag.accent { background: var(--amber-wash); border-color: var(--amber); color: var(--amber); }
.tag.status { background: var(--sage-soft); border-color: var(--sage); color: var(--sage); }
.tag.code { font-family: var(--f-mono); font-size: 11px; direction: ltr; }
.entity-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 48px; align-items: end; margin-bottom: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.title-main { font-family: var(--f-display); font-size: clamp(40px, 6.5vw, 76px); font-weight: 700; line-height: 1.15; color: var(--ink); }
html[lang="en"] .title-main { font-weight: 600; letter-spacing: -.5px; }
.title-main.long { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.3; }
.title-other { font-family: var(--f-la); font-size: clamp(24px, 3.4vw, 46px); font-weight: 300; font-style: italic; color: var(--ink-soft); line-height: 1.15; text-align: end; }
html[lang="en"] .title-other { font-family: "Reem Kufi", sans-serif; font-style: normal; font-weight: 500; }
.title-sub { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--ink-mute); margin-top: 8px; display: block; font-style: normal; font-weight: 400; direction: ltr; }
.lede { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px 40px; margin-top: 20px; }
.lede-text { font-size: 16.5px; line-height: 1.95; margin: 0; max-width: 74ch; }
.lede-meta { font-size: 12.5px; line-height: 2.1; color: var(--ink-mute); border-inline-start: 1px solid var(--rule); padding-inline-start: 18px; }
.lede-meta .meta-row { display: flex; justify-content: space-between; gap: 8px; }
.lede-meta strong { color: var(--ink); font-weight: 600; }
.identity-strip { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--ink); background: var(--paper); }
.pid-cell { padding: 12px 16px; border-inline-end: 1px solid var(--rule); border-bottom: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pid-label { font-size: 11.5px; color: var(--amber); font-weight: 500; }
.pid-value { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); direction: ltr; text-align: start; overflow-wrap: anywhere; font-weight: 500; }
html[lang="ar"] .pid-value { text-align: right; }
.pid-value.txt { font-family: var(--f-body); direction: inherit; font-size: 14px; }
.pid-value a { color: var(--ink); }
.trust-strip { margin-top: 16px; padding: 10px 16px; background: var(--paper-warm); border: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 12.5px; }
.trust-badge { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); padding-inline-end: 20px; border-inline-end: 1px solid var(--rule); }
.trust-badge:last-child { border-inline-end: 0; padding-inline-end: 0; }
.trust-value { color: var(--ink); font-weight: 600; }
.t1 { color: var(--sage); } .t2 { color: var(--teal-deep); } .t3 { color: var(--amber); } .t4 { color: var(--slate); }
.citation-box { margin-top: 16px; padding: 12px 18px; background: var(--stone-light); border-inline-start: 3px solid var(--amber-bright); font-size: 13.5px; color: var(--ink-soft); line-height: 1.9; }
.citation-box .cite-label { color: var(--amber); font-size: 12px; font-weight: 500; }
.note { margin-top: 16px; padding: 12px 18px; background: var(--amber-wash); border: 1px solid var(--amber); border-inline-start-width: 4px; font-size: 14px; display: grid; gap: 2px; }
.note b { color: var(--amber); }
.note.info { background: var(--teal-wash); border-color: var(--teal); }
.note.info b { color: var(--teal-deep); }

/* التبويبات */
.tab-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--stone); border-top: 1px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 0 var(--gut); display: flex; overflow-x: auto; scrollbar-width: thin; }
.tab-btn { padding: 14px 18px; background: transparent; border: 0; border-inline-end: 1px solid var(--rule); font: 500 13.5px var(--f-body); color: var(--ink-soft); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.tab-btn:first-child { border-inline-start: 1px solid var(--rule); }
.tab-btn .tab-num { font-family: var(--f-mono); font-size: 10px; color: var(--amber); letter-spacing: 1px; font-weight: 600; }
.tab-btn:hover { background: var(--paper); color: var(--ink); }
.tab-btn.active { background: var(--ink); color: var(--paper); }
.tab-btn.active .tab-num { color: var(--amber-bright); }
.content-wrap { max-width: 1380px; margin: 0 auto; padding: 36px var(--gut) 72px; }
.js .tab-panel { display: none; }
.js .tab-panel.active { display: block; }
.tab-panel + .tab-panel { margin-top: 48px; }
.js .tab-panel + .tab-panel { margin-top: 0; }

/* الأقسام */
.section-block { margin-bottom: 44px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.section-head .s-num { font-family: var(--f-mono); font-size: 12px; color: var(--amber); font-weight: 600; letter-spacing: 1.5px; min-width: 38px; direction: ltr; unicode-bidi: isolate; }
.section-head h2 { font-family: var(--f-display); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; }
.section-head .s-other { font-family: var(--f-la); font-style: italic; font-size: 17px; color: var(--ink-mute); margin-inline-start: auto; }
html[lang="en"] .section-head .s-other { font-family: "Reem Kufi", sans-serif; font-style: normal; font-size: 15px; }

/* النص */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.narrative { min-width: 0; max-width: 74ch; font-size: 16px; line-height: 2; }
html[lang="en"] .narrative { line-height: 1.8; font-size: 16.5px; }
.narrative h2 { font-family: var(--f-display); font-size: 21px; font-weight: 600; margin: 30px 0 10px; padding-inline-start: 12px; border-inline-start: 3px solid var(--amber-bright); }
.narrative h2:first-child { margin-top: 0; }
.narrative h3 { font-size: 17px; font-weight: 600; margin: 22px 0 8px; }
.narrative p { margin: 0 0 14px; }
.narrative strong { font-weight: 600; color: var(--ink); }
.narrative ul, .narrative ol { margin: 0 0 14px; padding-inline-start: 22px; }
.narrative li { margin-bottom: 5px; }
.narrative li::marker { color: var(--amber); }
.narrative code { font-family: var(--f-mono); font-size: .85em; background: var(--teal-wash); padding: 0 4px; direction: ltr; unicode-bidi: isolate; }
.narrative hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }
.aside-panel { background: var(--paper); border: 1px solid var(--ink); position: sticky; top: 64px; }
.aside-title { background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.aside-title .dot { width: 7px; height: 7px; background: var(--amber-bright); transform: rotate(45deg); }
.aside-body { padding: 6px 18px 12px; }
.fact-list { margin: 0; }
.fact-item { display: grid; grid-template-columns: 7.4em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--rule); font-size: 13.5px; }
.fact-item:last-child { border-bottom: 0; }
.fact-item dt { color: var(--amber); font-size: 12.5px; }
.fact-item dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
sup.cite { font-size: .7em; line-height: 0; font-family: var(--f-mono); }
sup.cite a { text-decoration: none; color: var(--teal); padding-inline: 1px; }
sup.cite a::before { content: "["; } sup.cite a::after { content: "]"; }

/* الجداول */
.table-wrap { overflow-x: auto; border: 1px solid var(--ink); background: var(--paper); margin-bottom: 16px; }
.data-table, .narrative table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .narrative th { background: var(--ink); color: var(--paper); font-weight: 500; text-align: start; padding: 9px 14px; white-space: nowrap; }
.data-table td, .narrative td { padding: 9px 14px; border-top: 1px solid var(--rule-soft); vertical-align: top; }
.data-table tr:nth-child(even) td, .narrative tr:nth-child(even) td { background: var(--stone-light); }
.data-table .key { color: var(--amber); font-weight: 500; white-space: nowrap; }
.data-table .muted, .muted { color: var(--ink-mute); }
.empty { color: var(--ink-mute); font-size: 14px; padding: 14px 16px; background: var(--paper); border: 1px dashed var(--rule); }

/* الخط الزمني */
.timeline { position: relative; padding: 8px 0; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 124px; width: 2px; background: var(--ink); }
.tl-event { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 30px; margin-bottom: 22px; position: relative; }
.tl-event::before { content: ""; position: absolute; inset-inline-start: 119px; top: 9px; width: 10px; height: 10px; background: var(--amber-bright); border: 2px solid var(--paper); transform: rotate(45deg); }
.tl-date .date-main { display: block; font-family: var(--f-la); font-style: italic; font-size: 21px; font-weight: 500; color: var(--amber); line-height: 1.1; }
.tl-date .date-sub { display: block; font-size: 12.5px; color: var(--ink-mute); }
.tl-content { background: var(--paper); border: 1px solid var(--rule); padding: 12px 16px; min-width: 0; }
.tl-content h3 { font-size: 15px; font-weight: 500; line-height: 1.7; }
.tl-content .via { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; display: block; }
@media (max-width: 560px) {
  .timeline::before { inset-inline-start: 6px; }
  .tl-event { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-inline-start: 26px; }
  .tl-event::before { inset-inline-start: 1px; }
}

/* المصادر */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; background: var(--paper-warm); border: 1px solid var(--rule); font-size: 12.5px; margin-bottom: 18px; }
.source-entry { display: grid; grid-template-columns: 64px minmax(0, 1fr); background: var(--paper); border: 1px solid var(--rule); margin-bottom: 10px; scroll-margin-top: 70px; }
.source-entry:target { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-wash); }
.src-tier { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-inline-end: 1px solid var(--rule); background: var(--stone-light); padding: 10px 4px; }
.src-tier .n { font-family: var(--f-mono); font-size: 18px; font-weight: 600; }
.src-tier .lv { font-size: 11.5px; font-weight: 600; }
.src-body { padding: 11px 16px; min-width: 0; }
.src-title { font-weight: 500; overflow-wrap: anywhere; }
.src-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--ink-mute); margin-top: 3px; }

/* الإسناد */
.prov-chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border: 1px solid var(--ink); background: var(--paper); margin-bottom: 22px; }
.prov-step { padding: 14px 16px; border-inline-end: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; }
.prov-step .p-num { font-family: var(--f-mono); font-size: 11px; color: var(--amber); font-weight: 600; letter-spacing: 1px; }
.prov-step .p-role { font-weight: 600; }
.prov-step .p-action { font-size: 13px; color: var(--ink-soft); }
.prov-step .p-state { font-size: 12.5px; font-weight: 600; }
.prov-step.done .p-state { color: var(--sage); }
.prov-step.wait { background: var(--amber-wash); }
.prov-step.wait .p-state { color: var(--amber); }
.disclosure { background: var(--paper-warm); border: 1px solid var(--rule); border-inline-start: 3px solid var(--teal); padding: 14px 18px; margin-bottom: 16px; }
.disclosure h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.disclosure p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* البحث والمرشّحات */
.search { margin-top: 24px; max-width: 780px; }
.search label { display: block; font-weight: 500; margin-bottom: 6px; }
.search input, .filters select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; }
.search input { width: 100%; font-size: 16px; padding: 12px 14px; }
.search input:focus, .filters select:focus { outline: 2px solid var(--teal); outline-offset: 0; }
.hint { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }
.results { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.results a { display: grid; gap: 2px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.results a:hover { border-color: var(--teal); }
.results .r-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.results .r-sum { font-size: 13.5px; color: var(--ink-mute); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 12px 14px; background: var(--paper-warm); border: 1px solid var(--rule); margin-bottom: 18px; }
.filters label { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-soft); }
.filters select { padding: 6px 8px; font-size: 14px; min-width: 150px; max-width: 100%; }
.filters .count { margin-inline-start: auto; font-size: 13px; color: var(--ink-mute); }

/* البطاقات والقوائم */
.layers-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.layer-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; height: 100%; padding: 14px 18px; background: var(--paper); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.layer-card:hover { border-color: var(--teal); background: var(--teal-wash); color: var(--ink); }
.layer-card .l-name { font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1.6; }
.layer-card .l-num { grid-row: span 2; font-family: var(--f-mono); font-size: 26px; color: var(--amber); line-height: 1; direction: ltr; }
.layer-card .l-note { font-size: 12.5px; color: var(--ink-mute); }
.layer-card .l-note.has { color: var(--teal-deep); font-weight: 600; }
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entry-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); background: var(--paper); border: 1px solid var(--rule); }
.entry-card[hidden] { display: none; }
.entry-card .ec-stat { background: var(--stone-light); border-inline-end: 1px solid var(--rule); padding: 12px 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--ink-soft); }
.entry-card .ec-body { padding: 12px 16px; min-width: 0; }
.entry-card .ec-title { font-family: var(--f-display); font-weight: 600; font-size: 17px; text-decoration: none; color: var(--ink); }
.entry-card .ec-title:hover { color: var(--teal-deep); }
.entry-card .ec-other { font-family: var(--f-la); font-style: italic; color: var(--ink-mute); margin-inline-start: 10px; }
html[lang="en"] .entry-card .ec-other { font-family: "Reem Kufi", sans-serif; font-style: normal; }
.entry-card p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.entry-card .why { color: var(--teal-deep); font-size: 13.5px; }
@media (max-width: 560px) { .entry-card { grid-template-columns: minmax(0, 1fr); } .entry-card .ec-stat { flex-direction: row; justify-content: flex-start; border-inline-end: 0; border-bottom: 1px solid var(--rule); padding: 8px 12px; } }
.paths-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.path-card { display: grid; gap: 6px; height: 100%; padding: 14px 16px; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--ink); text-decoration: none; color: var(--ink); }
.path-card:hover { border-color: var(--teal); border-top-color: var(--amber-bright); }
.path-card b { font-family: var(--f-display); font-size: 17px; font-weight: 600; }
.path-card span { font-size: 13px; color: var(--ink-soft); }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.letters a, .letters span { min-width: 34px; text-align: center; padding: 4px 6px; border: 1px solid var(--rule); background: var(--paper); text-decoration: none; font-weight: 600; }
.letters span { color: var(--ink-mute); background: transparent; font-weight: 300; }
.letter-group { margin-bottom: 26px; }
.letter-group h2 { font-family: var(--f-display); font-size: 26px; color: var(--amber); border-bottom: 1px solid var(--ink); margin-bottom: 10px; }
.glossary { margin: 0; display: grid; gap: 0; }
.glossary div { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.glossary dt { font-weight: 600; }
.glossary dt .la-text, .glossary dt .ar-text { display: block; font-weight: 400; color: var(--ink-mute); font-size: 14px; }
.glossary dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .glossary div { grid-template-columns: minmax(0, 1fr); } }
.sitemap-tree { columns: 2 320px; column-gap: 40px; }
.sitemap-tree section { break-inside: avoid; margin-bottom: 18px; }
.sitemap-tree h3 { font-family: var(--f-display); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.sitemap-tree ul { margin: 0; padding-inline-start: 18px; font-size: 14px; }
.doc { max-width: 78ch; }
.scope { font-size: 16.5px; line-height: 2; max-width: 78ch; margin: 0; }

/* التذييل */
footer.foot { border-top: 2px solid var(--ink); background: var(--paper); }
footer.foot .in { padding: 22px var(--gut); display: grid; gap: 14px; }
footer.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
footer.foot nav a { color: var(--ink-soft); text-decoration: none; }
footer.foot nav a:hover { color: var(--teal-deep); text-decoration: underline; }
footer.foot .meta { display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; font-size: 12.5px; color: var(--ink-mute); }

@media (max-width: 1080px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .aside-panel { position: static; }
  .entity-title { grid-template-columns: minmax(0, 1fr); }
  .title-other { text-align: start; }
  .lede { grid-template-columns: minmax(0, 1fr); }
  .lede-meta { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--rule); padding-top: 10px; }
}
@media print {
  body::before, .beam, .tab-nav, .mast-tools, footer.foot nav { display: none; }
  .js .tab-panel { display: block; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* إضافات */
.sub-head { font-family: var(--f-display); font-size: 18px; font-weight: 600; margin: 22px 0 10px; color: var(--ink); }
.entry-card .ec-stat .tag { white-space: normal; text-align: center; max-width: 100%; }

/* عمود الحقائق وفهرس المدخل */
.aside-col { display: flex; flex-direction: column; gap: 18px; align-self: stretch; }
.aside-col .aside-panel { position: static; }
.aside-col .toc { position: sticky; top: 64px; }
.toc-list { margin: 0; padding: 10px 18px 12px; padding-inline-start: 36px; font-size: 13.5px; line-height: 1.7; }
.toc-list li { padding: 3px 0; }
.toc-list li::marker { color: var(--amber); font-family: var(--f-mono); font-size: 12px; }
.toc-list a { color: var(--ink-soft); text-decoration: none; }
.toc-list a:hover { color: var(--teal-deep); text-decoration: underline; }
.narrative h2[id] { scroll-margin-top: 70px; }
@media (max-width: 1080px) { .aside-col .toc { position: static; } }

/* الأشكال: رسوم بيانية وخرائط */
.fig { position: relative; margin: 26px 0 30px; border: 1px solid var(--ink); background: var(--paper); }
.fig-head { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.fig-num { font-family: var(--f-mono); font-size: 11.5px; color: var(--paper); background: var(--amber); padding: 1px 8px; white-space: nowrap; }
.fig-title { font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1.5; }
.fig-body { padding: 16px 16px 8px; }
.fig-body svg { display: block; width: 100%; height: auto; }
.fig-cap { padding: 8px 16px 12px; font-size: 12.5px; color: var(--ink-mute); line-height: 1.7; border-top: 1px dotted var(--rule); }
.chart text, .map text { font-family: var(--f-body); fill: var(--ink); }
.chart .lbl { font-size: 14px; font-weight: 500; }
html[lang="ar"] .chart .val { font-family: var(--f-body); font-size: 14px; }
.chart .val { font-family: var(--f-mono); font-size: 13.5px; font-weight: 600; fill: var(--ink); }
.chart .note { font-size: 11.5px; fill: var(--ink-mute); }
.chart .axis { stroke: var(--ink); stroke-width: 1.2; }
.chart .year { font-family: var(--f-mono); font-size: 13px; fill: var(--ink-soft); }
.chart .stem { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .today { stroke: var(--crimson); stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .today-t { font-size: 11.5px; fill: var(--crimson); font-weight: 600; }
.chart .ms-date { font-family: var(--f-mono); font-size: 11px; fill: var(--amber); }
html[lang="ar"] .chart .ms-date { font-family: var(--f-body); }
.chart .ms-lbl { font-size: 12.5px; font-weight: 500; }
.chart .lvl { stroke: var(--paper); stroke-width: 2; }
.chart .lvl-t { font-size: 15px; font-weight: 600; fill: #fff; }
.chart .lvl-r { font-size: 13.5px; font-weight: 600; }
.chart .bar, .chart .lvl, .chart .dot, .map .on, .sw { fill: var(--teal); }
.t-primary { fill: var(--teal); background: var(--teal); }
.t-amber { fill: var(--amber-bright); background: var(--amber-bright); }
.t-crimson { fill: var(--crimson); background: var(--crimson); }
.t-sage { fill: var(--sage); background: var(--sage); }
.t-slate { fill: var(--slate); background: var(--slate); }
.t-ink { fill: var(--ink); background: var(--ink); }
.chart .lvl-t.dark { fill: var(--ink); }
.map .sea { fill: var(--teal-wash); }
.map .land { fill: #e4dccb; stroke: var(--paper); stroke-width: .6; }
.map .land:hover { fill: #d3c8b0; }
.map .land.t-primary { fill: var(--teal); } .map .land.t-amber { fill: var(--amber-bright); } .map .land.t-crimson { fill: var(--crimson); }
.map .land.t-sage { fill: var(--sage); } .map .land.t-slate { fill: var(--slate); } .map .land.t-ink { fill: var(--ink); }
.map .land.on:hover { opacity: .85; }
.map .map-l { font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0 16px 8px; font-size: 13px; }
.map-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.map-legend .sw { display: inline-block; width: 14px; height: 14px; }
.map-list { margin: 0; padding: 0 16px 10px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border-top: 1px solid var(--rule); border-inline-start: 1px solid var(--rule); }
.stat-cell { background: var(--paper); border-bottom: 1px solid var(--rule); border-inline-end: 1px solid var(--rule); padding: 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat-v sup { font-size: .55em; vertical-align: super; line-height: 0; }
.stat-v { font-family: var(--f-mono); font-size: 26px; font-weight: 600; color: var(--teal-deep); line-height: 1.2; direction: ltr; unicode-bidi: isolate; text-align: start; }
.stat-l { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.narrative blockquote { margin: 0 0 16px; padding: 12px 18px; border-inline-start: 3px solid var(--teal); background: var(--teal-wash); font-size: 15px; }
.narrative blockquote p:last-child { margin-bottom: 0; }
@media print { .fig { break-inside: avoid; } .aside-col .toc { display: none; } }
@media (max-width: 640px) {
  .fig-body { overflow-x: auto; padding-inline: 10px; }
  .fig-body svg.chart { min-width: 580px; }
  .fig-head { flex-wrap: wrap; gap: 6px 10px; }
}

/* ═════════════ عناصر نص المدخل — المرجع: 04_الهوية/دليل_عناصر_المدخل.md ═════════════ */
/* النغمات الدلالية الثابتة: teal أساسي · amber انتباه · crimson محظور/خطر/خلاف · sage إيجابي/مُصحَّح · slate محايد · ink بنية */
.narrative > :is(aside, section, figure, nav, details, div.cols, div.hatnote) { margin-block: 22px 26px; }
.fig-titles { display: flex; flex-direction: column; gap: 2px; }
.fig-sub { font-size: 13px; color: var(--ink-mute); }
.fig-num.inline { margin-inline-end: 6px; }
.fig-note { margin: 4px 0 0; font-size: 12.5px; }
.fig-src { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-mute); }
.fig-cap .fig-src:first-child { margin-top: 0; }

/* التنبيهات: شريط جانبي سميك + رأس صغير. لون واحد لكل معنى */
.callout { --c: var(--slate); --w: #eef0f3; border-inline-start: 4px solid var(--c); background: var(--w); padding: 12px 18px 4px; }
.callout.c-amber { --c: var(--amber-bright); --w: var(--amber-wash); }
.callout.c-crimson { --c: var(--crimson); --w: #f6e8e6; }
.callout.c-sage { --c: var(--sage); --w: var(--sage-soft); }
.callout.c-primary { --c: var(--teal); --w: var(--teal-wash); }
.callout-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: 13.5px; }
.callout-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; transform: translateY(3px); flex: none; }
.callout-kind { font-weight: 600; color: var(--ink); }
.callout-title { color: var(--ink-soft); }
.callout-body { font-size: 15px; }
.callout.k-disputed { background-image: repeating-linear-gradient(135deg, transparent 0 9px, rgba(140,58,58,.05) 9px 10px); }

/* ملاحظة التمييز في رأس النص */
.hatnote { font-size: 14px; color: var(--ink-soft); font-style: italic; padding-inline-start: 22px; position: relative; }
.hatnote::before { content: "↳"; position: absolute; inset-inline-start: 0; font-style: normal; color: var(--amber); }
html[lang="ar"] .hatnote { font-style: normal; }

/* باختصار */
.keypoints { border: 1px solid var(--ink); background: var(--paper); }
.kp-head { background: var(--ink); color: var(--paper); padding: 7px 16px; font-size: 13.5px; font-weight: 500; }
.kp-body { padding: 12px 18px 2px; }
.kp-body ul { list-style: none; padding: 0; }
.kp-body li { position: relative; padding-inline-start: 22px; }
.kp-body li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .85em; width: 8px; height: 8px; background: var(--amber-bright); transform: rotate(45deg); }

/* تعريف */
.definition { border-block: 2px solid var(--teal); padding: 12px 4px 2px; }
.def-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.def-kind, .ex-kind, .legal-kind, .doc-kind, .dl-kind, .algo-kind { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--paper); background: var(--teal); padding: 1px 8px; }
html[lang="ar"] :is(.def-kind, .ex-kind, .legal-kind, .doc-kind, .dl-kind, .algo-kind) { font-family: var(--f-body); letter-spacing: 0; font-size: 12px; }
.def-term { font-family: var(--f-display); font-style: normal; font-size: 18px; font-weight: 600; }

/* مثال */
.example { border: 1px dashed var(--rule); background: var(--paper-warm); padding: 12px 18px 2px; }
.ex-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.ex-kind { background: var(--amber); }
.ex-title { font-weight: 600; }

/* الاقتباس والتصريح */
.quote { margin-inline: 0; }
.quote blockquote, .narrative > blockquote { margin: 0; padding: 4px 20px; border-inline-start: 3px solid var(--teal); background: none; font-size: 16.5px; color: var(--ink); }
.quote figcaption { padding-inline-start: 23px; font-size: 13.5px; color: var(--ink-mute); margin-top: 4px; }
.statement { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; margin-inline: 0; }
.st-mark { grid-row: span 2; font-family: var(--f-la); font-size: 56px; line-height: 1; color: var(--amber); }
.statement blockquote { margin: 0; font-family: var(--f-display); font-size: 19px; line-height: 1.75; }
html[lang="en"] .statement blockquote { font-style: italic; font-weight: 400; }
.statement figcaption { font-size: 13.5px; color: var(--ink-mute); border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 6px; }
.statement figcaption b { color: var(--ink); font-weight: 600; }

/* النص الرسمي: ورقة رسمية بإطار مزدوج */
.legal { margin-inline: 0; border: 3px double var(--ink); background: #fff; }
.legal-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; border-bottom: 1px solid var(--rule); }
.legal-kind { background: var(--ink); }
.legal-ref { font-weight: 600; font-size: 14px; }
.legal-body { margin: 0; padding: 12px 18px 4px; font-size: 15px; font-family: var(--f-la); }
html[lang="ar"] .legal-body { font-family: var(--f-body); }

/* مقتطف وثيقة: ورقة بهامش */
.docx { margin-inline: 0; background: #fff; border: 1px solid var(--rule); box-shadow: 4px 4px 0 var(--rule-soft); }
.doc-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; border-bottom: 1px dotted var(--rule); }
.doc-kind { background: var(--slate); }
.doc-ref { font-size: 13.5px; color: var(--ink-soft); }
.doc-body { padding: 12px 18px 4px; border-inline-start: 2px solid #e8b4ae; margin-inline-start: 30px; font-size: 15px; }

/* مواقف الأطراف */
.positions, .procon, .glossbox, .further, .faq, .sumlist, .chrono, .steps { border-top: 2px solid var(--ink); padding-top: 10px; }
.pos-head, .pc-head, .gb-head, .fr-head, .faq-head, .sl-head, .chrono-head, .steps-head { font-family: var(--f-display); font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pos-card { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--slate); padding: 10px 14px 2px; }
.pos-who { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pos-say { font-size: 14.5px; }

/* الحجج */
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-col { padding: 10px 16px 2px; background: var(--paper); border: 1px solid var(--rule); }
.pc-col.pro { border-top: 3px solid var(--sage); }
.pc-col.con { border-top: 3px solid var(--crimson); }
.pc-kind { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pc-col.pro .pc-kind { color: var(--sage); } .pc-col.con .pc-kind { color: var(--crimson); }
@media (max-width: 640px) { .pc-grid { grid-template-columns: 1fr; } }

/* المحادثة الموثقة */
.dialogue { margin-inline: 0; border: 1px solid var(--ink); background: var(--paper); }
.dl-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; border-bottom: 1px solid var(--rule); }
.dl-kind { background: var(--slate); }
.dl-title { font-size: 13.5px; color: var(--ink-soft); }
.dl-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.dl-turn { max-width: 88%; padding: 8px 14px 0; border: 1px solid var(--rule); font-size: 14.5px; }
.dl-turn.r-user { align-self: flex-start; background: #fff; }
.dl-turn.r-ai { align-self: flex-end; background: var(--teal-wash); border-color: #b9d3d8; }
.dl-turn.r-system { align-self: stretch; max-width: none; background: var(--stone-light); border-style: dashed; font-family: var(--f-mono); font-size: 13px; }
.dl-role { font-size: 11.5px; font-weight: 600; color: var(--ink-mute); margin-bottom: 2px; }
.dl-note { text-align: center; font-size: 12.5px; color: var(--ink-mute); }
.dl-note p { margin: 0; }
.dl-cap { padding: 6px 16px 10px; font-size: 12px; color: var(--ink-mute); border-top: 1px dotted var(--rule); }

/* الخطوات */
.steps-list { list-style: none; counter-reset: st; padding: 0 !important; }
.steps-list > li { counter-increment: st; position: relative; padding-inline-start: 46px; padding-bottom: 14px; margin: 0; }
.steps-list > li::before { content: counter(st); position: absolute; inset-inline-start: 0; top: 2px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 13px; }
.steps-list > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 14.5px; top: 34px; bottom: 0; width: 1px; background: var(--rule); }

/* الجدول المرقّم */
.tbl { margin-inline: 0; }
.tbl > .fig-head { border: 1px solid var(--ink); border-bottom: 0; background: var(--paper); }
.tbl .table-wrap { margin-bottom: 0; }
.tbl > .fig-cap { border: 1px solid var(--ink); border-top: 0; background: var(--paper); }
.dtable td.num, .dtable th.num { text-align: end; font-family: var(--f-mono); font-variant-numeric: tabular-nums; direction: ltr; }
.dtable td.yes { color: var(--sage); font-weight: 700; text-align: center; }
.dtable td.no { color: var(--crimson); font-weight: 700; text-align: center; }
.dtable td.part { color: var(--amber); text-align: center; }

/* أسئلة شائعة وتفاصيل */
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary, .more summary { cursor: pointer; padding: 10px 0; font-weight: 500; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.faq-item summary::-webkit-details-marker, .more summary::-webkit-details-marker { display: none; }
.faq-item summary::before, .more summary::before { content: "+"; font-family: var(--f-mono); color: var(--amber); width: 14px; flex: none; }
.faq-item[open] summary::before, .more[open] summary::before { content: "−"; }
.faq-a { padding-inline-start: 24px; padding-bottom: 4px; }
.more { border: 1px solid var(--rule); padding: 0 16px; background: var(--paper); }
.more-body { padding-bottom: 6px; }

/* المصطلحات وقائمة المفاتيح */
.glossbox dl, .sumlist dl { margin: 0; }
.gl-row, .sl-row { display: grid; grid-template-columns: minmax(8em, 30%) minmax(0, 1fr); gap: 14px; padding: 8px 0; border-bottom: 1px dotted var(--rule); font-size: 14.5px; }
.gl-row dt, .sl-row dt { font-weight: 600; }
.sl-row dt { color: var(--amber); font-weight: 500; font-size: 13.5px; }
.sl-row dd, .gl-row dd { margin: 0; }
.gl-tr { display: block; font-family: var(--f-la); font-weight: 400; font-size: 13px; color: var(--ink-mute); direction: ltr; text-align: start; }

/* انظر أيضًا، والاستزادة */
.seealso { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 14px; background: var(--stone-light); border: 1px solid var(--rule-soft); font-size: 14px; }
.seealso p, .seealso ul { margin: 0; display: contents; }
.seealso li { display: inline; list-style: none; }
.seealso li::after { content: " ·"; color: var(--rule); }
.seealso li:last-child::after { content: ""; }
.sa-head { font-weight: 600; color: var(--amber); }
.further ul { padding-inline-start: 18px; }
.further li { font-size: 14.5px; }

/* تسلسل زمني قصير */
.chrono ol { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--teal); }
.chrono li { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 12px; padding: 5px 0 5px 0; padding-inline-start: 16px; position: relative; font-size: 14.5px; margin: 0; }
.chrono li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 13px; width: 10px; height: 10px; background: var(--paper); border: 2px solid var(--teal); transform: rotate(45deg); }
.chrono time { font-family: var(--f-mono); font-size: 12.5px; color: var(--amber); padding-top: 2px; }
html[lang="ar"] .chrono time { font-family: var(--f-body); }

/* خوارزمية وشيفرة */
.algo, .code { margin-inline: 0; border: 1px solid var(--ink); background: #fff; }
.algo-head, .code-head { display: flex; gap: 10px; align-items: baseline; padding: 6px 14px; border-bottom: 1px solid var(--rule); background: var(--paper); font-size: 13px; }
.algo-kind { background: var(--ink); }
.algo-lines { margin: 0; padding: 10px 14px 10px 0; padding-inline-start: 46px; font-size: 13.5px; direction: ltr; text-align: left; }
html[lang="ar"] .algo-lines { direction: rtl; text-align: right; }
.algo-lines li { padding: 1px 0; }
.algo-lines li::marker { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); }
.algo-lines code { font-family: var(--f-mono); white-space: pre-wrap; background: none; padding: 0; direction: inherit; }
.code-lang { font-family: var(--f-mono); font-size: 11px; color: var(--paper); background: var(--slate); padding: 1px 8px; }
.code pre { margin: 0; padding: 12px 16px; overflow-x: auto; font-family: var(--f-mono); font-size: 13px; line-height: 1.6; text-align: left; }
.code pre code { background: none; padding: 0; }
.code .k, .code .kn, .code .kd { color: #8c3a3a; font-weight: 600; } .code .s, .code .s1, .code .s2 { color: #46664b; }
.code .c, .code .c1, .code .cm { color: #5a6782; font-style: italic; } .code .mi, .code .mf { color: #8f5609; } .code .nf, .code .nc { color: #0a5966; }

/* معادلات */
.eq { margin-inline: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 0; overflow-x: auto; }
.eq-body { direction: ltr; text-align: center; font-size: 1.15em; }
.eq-num { font-family: var(--f-mono); font-size: 13px; color: var(--ink-mute); }
.eq-cap { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-mute); text-align: center; }
.math { direction: ltr; unicode-bidi: isolate; }
math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", serif; }
.math-raw { font-family: var(--f-mono); direction: ltr; unicode-bidi: isolate; }

/* داخل السطر */
.asof { display: inline-block; font-size: .78em; padding: 0 6px; border: 1px solid var(--amber-bright); color: var(--amber); line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.term-tr { font-family: var(--f-la); font-size: .85em; color: var(--ink-mute); margin-inline-start: 4px; direction: ltr; unicode-bidi: isolate; }
.term-tr::before { content: "("; } .term-tr::after { content: ")"; }
.xref { font-weight: 500; white-space: nowrap; }
.xref.missing { color: var(--crimson); }
.narrative abbr[title] { text-decoration: underline dotted var(--ink-mute); cursor: help; }
.narrative .footnote { margin-top: 30px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13.5px; }
.narrative .footnote ol { padding-inline-start: 22px; }
.narrative sup a.footnote-ref { font-family: var(--f-mono); font-size: .78em; text-decoration: none; color: var(--amber); }
.narrative sup a.footnote-ref::before { content: "("; } .narrative sup a.footnote-ref::after { content: ")"; }

/* أعمدة */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }

/* الوسائط */
.media { margin-inline: 0; border: 1px solid var(--ink); background: var(--paper); }
.media-body { padding: 10px; }
.media-body img { display: block; width: 100%; height: auto; background: var(--stone-light); }
.media.w-half { max-width: 50%; } .media.w-narrow { max-width: 340px; }
@media (max-width: 640px) { .media.w-half, .media.w-narrow { max-width: none; } }
.credit { display: block; font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; }
.credit .cr-lic { font-family: var(--f-mono); font-size: 11px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.g-item { margin: 0; }
.g-item img { aspect-ratio: 4 / 3; object-fit: cover; }
.g-item figcaption { font-size: 12px; color: var(--ink-soft); padding-top: 4px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-item { margin: 0; position: relative; }
.cmp-lab { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--ink); color: var(--paper); font-size: 12px; padding: 2px 8px; }
.shot { border: 1px solid var(--ink-soft); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--ink); color: var(--paper); font-size: 11.5px; }
.shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.shot-bar span { margin-inline-start: 8px; } .shot-date { margin-inline-start: auto !important; opacity: .75; }
.vcard { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); background: #fff; position: relative; }
.v-poster { width: 100%; height: 100%; min-height: 124px; object-fit: cover; }
.v-poster.blank { background: repeating-linear-gradient(135deg, var(--ink) 0 12px, var(--ink-soft) 12px 24px); }
.v-play { position: absolute; inset-inline-start: 86px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: grid; place-items: center; background: var(--amber-bright); color: #fff; font-size: 18px; }
.v-info { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; }
.v-title { font-weight: 600; } .v-meta { font-size: 12.5px; color: var(--ink-mute); } .v-note { font-size: 12px; color: var(--teal-deep); margin-top: auto; }
@media (max-width: 640px) { .vcard { grid-template-columns: 1fr; } .v-play { inset-inline-start: 50%; top: 62px; transform: translate(-50%, -50%); } html[dir="rtl"] .v-play { transform: translate(50%, -50%); } }
.media audio { width: 100%; }
.transcript { margin-top: 8px; font-size: 13.5px; } .transcript summary { cursor: pointer; color: var(--teal-deep); }
.m-document { border: 0; background: none; }
.doccard { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--ink); background: #fff; text-decoration: none; color: var(--ink); }
.dc-fmt { font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: #fff; background: var(--crimson); padding: 14px 8px; flex: none; }
.dc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .dc-title { font-weight: 600; } .dc-meta { font-size: 12.5px; color: var(--ink-mute); }
.dc-go { margin-inline-start: auto; color: var(--teal); font-size: 18px; }

/* الرسوم الإضافية */
.chart .grid { stroke: var(--rule-soft); stroke-width: 1; }
.chart .tick { font-family: var(--f-mono); font-size: 12px; fill: var(--ink-mute); }
html[lang="ar"] .chart .tick.lbl-x { font-family: var(--f-body); font-size: 12.5px; }
.chart .ln { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .s-primary { stroke: var(--teal); fill: var(--teal); } .chart .s-amber { stroke: var(--amber-bright); fill: var(--amber); }
.chart .s-crimson { stroke: var(--crimson); fill: var(--crimson); } .chart .s-sage { stroke: var(--sage); fill: var(--sage); }
.chart .s-slate { stroke: var(--slate); fill: var(--slate); } .chart .s-ink { stroke: var(--ink); fill: var(--ink); }
.chart .ln.s-primary, .chart .ln.s-amber, .chart .ln.s-crimson, .chart .ln.s-sage, .chart .ln.s-slate, .chart .ln.s-ink { fill: none; }
.chart .end-lbl { font-size: 13px; font-weight: 600; stroke: none; }
.chart .pt { stroke: var(--paper); stroke-width: 1.5; }
.chart .val.sm { font-size: 12px; }
.chart .seg { font-family: var(--f-mono); font-size: 12px; font-weight: 600; fill: #fff; }
.chart .seg.dark { fill: var(--ink); }
.chart .rng { stroke-width: 6; stroke-linecap: butt; opacity: .35; }
.chart .rng.t-primary { stroke: var(--teal); } .chart .rng.t-amber { stroke: var(--amber-bright); } .chart .rng.t-crimson { stroke: var(--crimson); } .chart .rng.t-sage { stroke: var(--sage); }
.chart .rng-cap { stroke: var(--ink-soft); stroke-width: 1.4; }
.chart .pt-l { font-size: 12px; }
.chart .ax-t { font-size: 12px; fill: var(--ink-mute); font-style: italic; }
html[lang="ar"] .chart .ax-t { font-style: normal; }
.chart .annot-line { stroke: var(--ink-mute); stroke-dasharray: 3 3; }
.chart .annot { font-size: 11.5px; fill: var(--ink-soft); }
.chart.net .net-edge { stroke: var(--rule); stroke-width: 1.4; }
.chart.net .net-center { fill: var(--ink); }
.chart.net .net-ct { fill: var(--paper); font-size: 14px; font-weight: 600; }
.chart.net .net-node { fill: var(--paper); stroke: var(--teal); stroke-width: 1.5; }
.chart.net .net-node.ghost { stroke-dasharray: 4 3; stroke: var(--ink-mute); }
.chart.net .net-lb { font-size: 13px; }
.chart.net a:hover .net-node { fill: var(--teal-wash); }
.chart.net .net-rel { font-size: 11px; fill: var(--amber); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.heat { width: 100%; border-collapse: collapse; font-size: 13px; }
.heat th { background: var(--ink); color: var(--paper); font-weight: 500; padding: 7px 10px; text-align: center; white-space: nowrap; }
.heat tbody th { background: var(--paper); color: var(--ink); text-align: start; font-weight: 500; border-top: 1px solid var(--rule-soft); }
.heat td { text-align: center; padding: 7px 10px; font-family: var(--f-mono); border: 2px solid var(--paper); }
.h-0 { background: #e7f0f2; } .h-1 { background: #bcd8dd; } .h-2 { background: #7fb3bc; } .h-3 { background: #2f8593; color: #fff; } .h-4 { background: #0a5966; color: #fff; } .h-na { color: var(--ink-mute); }
.heat-scale { display: flex; align-items: center; gap: 2px; padding: 0 16px 8px; font-size: 12px; color: var(--ink-mute); }
.heat-scale i { width: 26px; height: 10px; } .heat-scale span { margin-inline-start: 8px; }
.map .land.q-0, .sw.q-0 { fill: #d4e5e8; background: #d4e5e8; } .map .land.q-1, .sw.q-1 { fill: #a3c9cf; background: #a3c9cf; }
.map .land.q-2, .sw.q-2 { fill: #5e9ea8; background: #5e9ea8; } .map .land.q-3, .sw.q-3 { fill: #237a87; background: #237a87; }
.map .land.q-4, .sw.q-4 { fill: #0a4f5a; background: #0a4f5a; }
.map .land.nodata { fill: #ece6d8; } .sw.nodata { background: repeating-linear-gradient(135deg, #ece6d8 0 3px, #d6cdb8 3px 5px); }
.map .bub { fill-opacity: .72; stroke: #fff; stroke-width: 1; }
.map .bub.t-primary { fill: var(--teal); } .map .bub.t-amber { fill: var(--amber-bright); } .map .bub.t-crimson { fill: var(--crimson); }

/* المخططات التوضيحية (HTML) */
.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; row-gap: 12px; }
.flow.fl-column { flex-direction: column; align-items: stretch; }
.fl-node { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: #fff; border: 1px solid var(--ink); border-top: 4px solid var(--teal); min-width: 110px; }
.fl-node.t-amber { border-top-color: var(--amber-bright); } .fl-node.t-crimson { border-top-color: var(--crimson); } .fl-node.t-sage { border-top-color: var(--sage); } .fl-node.t-slate { border-top-color: var(--slate); }
.fl-n { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); }
.fl-label { font-weight: 600; font-size: 14px; line-height: 1.5; }
.fl-note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.fl-arrow { flex: 0 0 26px; display: grid; place-items: center; }
.fl-arrow::before { content: "→"; color: var(--amber); font-size: 18px; }
html[dir="rtl"] .fl-arrow::before { content: "←"; }
.fl-column .fl-arrow { flex-basis: 22px; } .fl-column .fl-arrow::before, html[dir="rtl"] .fl-column .fl-arrow::before { content: "↓"; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-inline-start: 26px; position: relative; }
.tree li { position: relative; padding-top: 8px; margin: 0; }
.tree ul > li::before { content: ""; position: absolute; inset-inline-start: -16px; top: 0; bottom: 0; border-inline-start: 1px solid var(--rule); }
.tree ul > li:last-child::before { bottom: auto; height: 26px; }
.tree ul > li::after { content: ""; position: absolute; inset-inline-start: -16px; top: 26px; width: 14px; border-top: 1px solid var(--rule); }
.tr-node { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 12px; background: #fff; border: 1px solid var(--ink); border-inline-start: 4px solid var(--teal); }
.tr-node.t-amber { border-inline-start-color: var(--amber-bright); } .tr-node.t-slate { border-inline-start-color: var(--slate); } .tr-node.t-crimson { border-inline-start-color: var(--crimson); } .tr-node.t-sage { border-inline-start-color: var(--sage); }
.tr-label { font-weight: 600; font-size: 14px; } .tr-date { font-family: var(--f-mono); font-size: 11.5px; color: var(--amber); } .tr-note { font-size: 12.5px; color: var(--ink-mute); }
.layers { display: flex; flex-direction: column; gap: 4px; }
.ly-row { display: grid; grid-template-columns: 9em minmax(0, 1fr); background: #fff; border: 1px solid var(--ink); }
.ly-label { background: var(--teal); color: #fff; padding: 8px 12px; font-size: 13.5px; font-weight: 600; }
.ly-row.t-amber .ly-label { background: var(--amber); } .ly-row.t-slate .ly-label { background: var(--slate); } .ly-row.t-sage .ly-label { background: var(--sage); } .ly-row.t-ink .ly-label { background: var(--ink); } .ly-row.t-crimson .ly-label { background: var(--crimson); }
.ly-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
.ly-items span { font-size: 12.5px; border: 1px solid var(--rule); padding: 1px 8px; background: var(--paper); }
.quad { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto 22px; gap: 4px; }
.qd-y { display: flex; flex-direction: column; justify-content: space-between; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11.5px; color: var(--ink-mute); text-align: center; }
html[dir="rtl"] .qd-y { transform: none; }
.qd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.qd-cell { background: #fff; border: 1px solid var(--ink); padding: 12px; min-height: 92px; display: flex; flex-direction: column; gap: 4px; }
.qd-cell b { font-weight: 600; font-size: 14px; } .qd-cell span { font-size: 12.5px; color: var(--ink-soft); }
.qd-cell:nth-child(2) { border-top: 3px solid var(--teal); }
.qd-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-mute); }
/* معرض العناصر */
.srcbox { margin: -14px 0 30px; font-size: 12.5px; }
.srcbox summary { cursor: pointer; color: var(--teal-deep); padding: 4px 0; }
.srcbox pre { margin: 4px 0 0; padding: 10px 14px; background: var(--ink); color: #e8e3d6; overflow-x: auto; font-family: var(--f-mono); font-size: 12px; line-height: 1.6; text-align: left; white-space: pre-wrap; }
.el-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-mute); margin: -4px 0 10px; }
.el-meta b { color: var(--amber); font-weight: 500; }
/* شارات الحالة: قائمة مغلقة بألوان ثابتة */
.stag { display: inline-block; font-size: .78em; font-weight: 500; line-height: 1.55; padding: 0 8px; border: 1px solid var(--g); color: var(--g); background: color-mix(in srgb, var(--g) 9%, #fff); white-space: nowrap; vertical-align: 1px; }
.stag.g-primary { --g: var(--teal-deep); } .stag.g-sage { --g: var(--sage); } .stag.g-amber { --g: var(--amber); }
.stag.g-crimson { --g: var(--crimson); } .stag.g-slate { --g: var(--slate); } .stag.g-ink { --g: var(--ink); }
.cn { font-size: .72em; color: var(--crimson); font-style: italic; white-space: nowrap; }
html[lang="ar"] .cn { font-style: normal; }
.chart .ln.dashed { stroke-dasharray: 6 5; }
.narrative a[target="_blank"]::after, .narrative a.ext::after { content: "↗"; font-size: .75em; margin-inline-start: 2px; color: var(--ink-mute); }
.narrative .vcard::after, .narrative .doccard::after { content: none; }
/* التقدير */
.estimate { border: 1px dashed var(--slate); background: var(--paper); }
.es-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; border-bottom: 1px dashed var(--rule); }
.es-kind { font-size: 12px; color: var(--paper); background: var(--slate); padding: 1px 8px; }
.es-title { font-weight: 600; font-size: 14px; }
.es-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1px; background: var(--rule-soft); }
.es-grid > div { background: var(--paper); padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.es-grid > div > span:first-child { font-size: 11.5px; color: var(--ink-mute); }
.es-val { font-family: var(--f-mono); font-size: 22px !important; font-weight: 600; color: var(--slate); justify-content: center; }
.meter { display: flex; gap: 3px; } .meter i { width: 18px; height: 6px; background: var(--rule-soft); } .meter i.on { background: var(--slate); }
.es-method { padding: 8px 16px 10px; font-size: 13px; color: var(--ink-soft); border-top: 1px dashed var(--rule); }
@media (max-width: 640px) { .es-grid { grid-template-columns: 1fr; } }
.bibtex { margin-top: 8px; font-size: 12.5px; } .bibtex summary { cursor: pointer; color: var(--teal-deep); font-family: var(--f-mono); }
.bibtex pre { margin: 6px 0 0; padding: 8px 12px; background: var(--paper); border: 1px solid var(--rule); font-family: var(--f-mono); font-size: 12px; overflow-x: auto; text-align: left; }
.citation-box .report { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--crimson); }
/* إصلاح: النغمات تغلب اللون الافتراضي داخل الرسوم */
.chart .t-primary { fill: var(--teal); } .chart .t-amber { fill: var(--amber-bright); } .chart .t-crimson { fill: var(--crimson); }
.chart .t-sage { fill: var(--sage); } .chart .t-slate { fill: var(--slate); } .chart .t-ink { fill: var(--ink); }
.chart .lvl-t.dark { fill: var(--ink); }
.narrative .heat td.h-0 { background: #e7f0f2; color: var(--ink); } .narrative .heat td.h-1 { background: #bcd8dd; color: var(--ink); }
.narrative .heat td.h-2 { background: #7fb3bc; color: var(--ink); } .narrative .heat td.h-3 { background: #2f8593; color: #fff; }
.narrative .heat td.h-4 { background: #0a5966; color: #fff; } .narrative .heat td.h-na { background: var(--paper); color: var(--ink-mute); }
.narrative .statement blockquote, .narrative .legal blockquote, .narrative .dialogue blockquote { border: 0; background: none; padding: 0; }
.narrative .legal blockquote.legal-body { padding: 12px 18px 4px; }
.flow { flex-wrap: nowrap; }
.fl-node { flex: 1 1 0; min-width: 0; }
@media (max-width: 640px) { .flow.fl-row { flex-direction: column; } .flow.fl-row .fl-arrow::before { content: "↓"; } .flow.fl-row .fl-arrow { flex-basis: 22px; } }

/* ═════════════ الميزات المستعادة بعد التدقيق ═════════════ */
.trust-value.ok { color: var(--sage); } .trust-value.warn { color: var(--amber); } .trust-value.bad { color: var(--crimson); }
.trust-why { width: 100%; margin-top: 6px; font-size: 13px; }
.trust-why summary { cursor: pointer; color: var(--teal-deep); font-size: 12.5px; }
.trust-why dl { margin: 8px 0 0; display: grid; gap: 6px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--rule); }
.tw-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 10px; }
.tw-row dt { font-weight: 600; color: var(--ink); } .tw-row dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .tw-row { grid-template-columns: 1fr; gap: 0; } }
.note.bad { border-color: var(--crimson); background: #f6e8e6; } .note.bad b { color: var(--crimson); }
.note.version { border-color: var(--teal); background: var(--teal-wash); flex-wrap: wrap; }
.note.version .vdiff { width: 100%; margin-top: 8px; } .vdiff summary { cursor: pointer; color: var(--teal-deep); font-size: 13px; }
.diff { margin-top: 8px; background: #fff; border: 1px solid var(--rule); padding: 8px 0; font-size: 13px; max-height: 420px; overflow: auto; }
.diff > div { padding: 1px 12px; white-space: pre-wrap; } .df-add { background: #e3efe2; } .df-add::before { content: "+ "; color: var(--sage); }
.df-del { background: #f6e3e1; text-decoration: line-through; text-decoration-color: rgba(140,58,58,.4); } .df-del::before { content: "− "; color: var(--crimson); }
.df-hunk { color: var(--ink-mute); text-align: center; } .df-ctx { color: var(--ink-mute); }
.cite-ver { margin-top: 6px; font-size: 13px; }
.tab-intro { font-size: 14px; color: var(--ink-soft); max-width: 74ch; }
.claim { border: 1px solid var(--rule); border-inline-start: 4px solid var(--sage); background: var(--paper); padding: 10px 16px; margin-bottom: 12px; }
.claim.c-crimson { border-inline-start-color: var(--crimson); } .claim.c-amber { border-inline-start-color: var(--amber-bright); } .claim.c-ink { border-inline-start-color: var(--ink); }
.cl-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font-size: 12.5px; }
.cl-n { font-family: var(--f-mono); color: var(--ink-mute); }
.cl-lv { font-family: var(--f-mono); } .cl-date { color: var(--ink-mute); margin-inline-start: auto; }
.cl-text { margin: 8px 0; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 500; }
.cl-by, .cl-note { font-size: 13px; color: var(--ink-soft); margin: 2px 0; }
.cl-ev { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; }
.cl-against { color: var(--crimson); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tl-event.ev-alleged .tl-content h3, .tl-event.ev-planned .tl-content h3 { font-weight: 400; font-style: italic; }
html[lang="ar"] .tl-event.ev-alleged .tl-content h3, html[lang="ar"] .tl-event.ev-planned .tl-content h3 { font-style: normal; color: var(--ink-soft); }
.tl-event.future .date-main { color: var(--ink-mute); }
.def-scope { font-size: 14px; padding: 6px 4px 10px; border-top: 1px dotted var(--rule); margin-top: 6px; }
.vchain { margin: 0; padding-inline-start: 22px; } .vchain li.here { font-weight: 600; }
.src-arch { font-size: 12px; } .small { font-size: 12.5px; }
#tab-relations .fig-network { max-width: 780px; margin-inline: auto; }
/* الشجرة الجانبية والعائلات والفهارس */
.content-wrap.with-tree { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.tree-col { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
@media (max-width: 1080px) { .content-wrap.with-tree { grid-template-columns: minmax(0, 1fr); } .tree-col { position: static; max-height: none; order: 2; } }
.sidetree { font-size: 13.5px; border: 1px solid var(--ink); background: var(--paper); }
.tr-fam-h { background: var(--ink); color: var(--paper); padding: 6px 12px; font-size: 12.5px; font-weight: 500; }
.tr-bab { border-bottom: 1px solid var(--rule-soft); }
.tr-bab summary { cursor: pointer; padding: 6px 12px; display: flex; gap: 6px; align-items: baseline; list-style: none; }
.tr-bab summary::-webkit-details-marker { display: none; }
.tr-bab summary::before { content: "+"; font-family: var(--f-mono); color: var(--amber); width: 12px; flex: none; }
.tr-bab[open] summary::before { content: "−"; }
.tr-bab summary a { color: var(--ink); text-decoration: none; flex: 1; } .tr-bab summary a:hover { color: var(--teal-deep); }
.tr-bab ul { list-style: none; margin: 0; padding: 0 0 6px; padding-inline-start: 30px; }
.tr-bab li { padding: 2px 0; } .tr-bab li a { color: var(--ink-soft); text-decoration: none; } .tr-bab li a:hover { text-decoration: underline; }
.tr-bab li.here a { color: var(--teal-deep); font-weight: 600; }
.sidetree .mono { font-size: 11px; color: var(--ink-mute); }
.sidetree .cnt { font-family: var(--f-mono); font-size: 11px; background: var(--teal-wash); color: var(--teal-deep); padding: 0 6px; }
.tree-full .sidetree { columns: 2 340px; column-gap: 0; border: 0; background: none; }
.tree-full .tr-fam { break-inside: avoid; border: 1px solid var(--ink); background: var(--paper); margin-bottom: 14px; }
.fam-h { font-family: var(--f-display); font-size: 16px; font-weight: 600; margin: 18px 0 8px; color: var(--amber); }
.tools-row { margin-top: 16px; font-size: 14px; }
.coverage { font-size: 13px; color: var(--ink-mute); margin: 6px 0 14px; }
.filters input[type=date] { font: inherit; padding: 4px 6px; border: 1px solid var(--rule); background: #fff; }
.fw-linked { font-size: 13px; }
.cmp-form { margin-bottom: 14px; } table.cmp th[scope=row] { background: var(--paper); color: var(--ink); font-weight: 600; white-space: normal; }
.gen-badge { display: inline-block; font-size: 11px; color: #fff; background: var(--slate); padding: 0 6px; margin-inline-end: 4px; }
/* البحث */
.results .r-note { display: block; font-size: 12.5px; color: var(--amber); }
.results .r-meta { display: block; font-size: 12px; color: var(--ink-mute); font-family: var(--f-mono); }
.results a.kb { outline: 2px solid var(--teal); outline-offset: -2px; background: var(--teal-wash); }
.results .r-dis { list-style: none; font-size: 13px; color: var(--crimson); padding: 6px 0; }
.sfacets { margin: 10px 0; }
#s0 p { margin: 6px 0; font-size: 14px; }
table.cmp { table-layout: fixed; } table.cmp thead th { white-space: normal; } table.cmp thead a { color: #fff; }
table.cmp thead th:first-child { width: 22%; }

/* الصورة الرئيسية للمدخل (الحزمة 1) */
.lead-fig { margin: 0; border: 1px solid var(--ink); background: var(--paper); }
.lead-frame { display: grid; place-items: center; background: var(--stone-light); border-bottom: 1px solid var(--rule); }
.lead-frame img { display: block; width: 100%; height: auto; }
.lead-fig.role-logo .lead-frame, .lead-fig.role-flag .lead-frame { padding: 22px 28px; background: #fff; }
.lead-fig.role-logo .lead-frame img { width: auto; max-width: 100%; max-height: 110px; }
.lead-fig.role-flag .lead-frame img { max-height: 150px; width: auto; max-width: 100%; border: 1px solid var(--rule-soft); }
.lead-fig figcaption { padding: 8px 12px 10px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.lead-fig .credit { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-mute); }
.lead-fig .credit a { color: var(--ink-mute); }
.credit .cr-restr { font-style: italic; }
.lead-fig.placeholder { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-color: var(--rule);
  background: linear-gradient(135deg, var(--teal-wash), var(--paper) 70%); }
.type-ico-wrap { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--teal); color: var(--teal-deep); background: var(--paper); flex: none; }
.type-ico { width: 30px; height: 30px; }
.ph-label { font-family: var(--f-display); font-size: 17px; color: var(--teal-deep); }
.ico { width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
/* الجوال: الصورة والمعلومات بعد الفقرة الأولى، والفهرس مطويًّا (2.1) */
.mobile-box, .toc-m { display: none; }
@media (max-width: 1080px) {
  .mobile-box { display: grid; gap: 14px; margin: 18px 0 22px; }
  .aside-col .lead-fig, .aside-col > aside.aside-panel:not(.toc) { display: none; }
  .aside-col .toc { display: none; }
  .toc-m { display: block; margin: 0 0 18px; border: 1px solid var(--rule); background: var(--paper); }
  .toc-m summary { cursor: pointer; padding: 8px 14px; font-weight: 500; }
  .toc-m ol { margin: 0; padding: 4px 18px 12px; padding-inline-start: 36px; font-size: 14px; }
}

/* أدوات القراءة (الحزمة 2) */
html { --fs: 1; }
.content-wrap, .entity-header { zoom: var(--fs); }
.mast-search { display: flex; align-items: stretch; border: 1px solid var(--rule); background: #fff; min-width: 0; flex: 1 1 220px; max-width: 340px; }
.mast-search input { flex: 1; min-width: 0; border: 0; padding: 5px 10px; font: inherit; font-size: 13.5px; background: transparent; color: var(--ink); }
.mast-search button { border: 0; border-inline-start: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); padding: 0 10px; cursor: pointer; }
.mast-search:focus-within { border-color: var(--teal); }
@media (max-width: 760px) { .mast-search { max-width: none; flex-basis: 100%; } }
.entry-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 2px; }
.et { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft);
  font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.et:hover { border-color: var(--teal); color: var(--teal-deep); background: var(--teal-wash); }
.et.ok { border-color: var(--sage); color: var(--sage); }
.et-sep { flex: 0 0 8px; }
.fs-group { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-mute); }
.fs-group .et { padding: 3px 8px; min-width: 30px; justify-content: center; }
.cite-tools { display: grid; gap: 6px; margin: 10px 0 6px; }
.cite-fmt { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 13px; }
.cf-name { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-mute); padding-top: 2px; }
.cf-text { overflow-wrap: anywhere; }
.btn-copy { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rule); background: var(--paper); font: inherit; font-size: 12px; padding: 1px 8px; cursor: pointer; color: var(--ink-soft); }
.btn-copy.ok { border-color: var(--sage); color: var(--sage); }
.ris { font-size: 12.5px; }
@media (max-width: 560px) { .cite-fmt { grid-template-columns: minmax(0, 1fr) auto; } .cf-name { grid-column: 1 / -1; } }
.cite-pop { position: absolute; z-index: 60; background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 8px 24px rgba(27, 44, 74, .18);
  padding: 10px 14px 12px; font-size: 13px; line-height: 1.6; }
.cite-pop .cp-n { font-family: var(--f-mono); font-size: 12px; color: var(--amber); margin-bottom: 2px; }
.cite-pop .src-title { font-weight: 500; }
.cite-pop .src-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-mute); font-size: 12px; margin-top: 4px; }
.cite-pop .cp-go { display: inline-block; margin-top: 6px; font-size: 12px; }
.note.correction-note { border-inline-start-color: var(--crimson); }
@media print { .entry-tools, .mast-search, .cite-tools .btn-copy, .ris { display: none !important; } .content-wrap, .entity-header { zoom: 1; } }
.cite-more { margin-top: 8px; font-size: 13px; }
.cite-more > summary { cursor: pointer; color: var(--teal-deep); }

/* إمكانية الوصول (الحزمة 7) */
html { scroll-padding-top: 76px; }

/* فهارس الأنواع: جدول يُفرز (الحزمة 3) */
.view-toggle { display: inline-flex; margin: 0 0 12px; border: 1px solid var(--rule); }
.view-toggle button { border: 0; background: var(--paper); padding: 4px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
table.sortable th { padding: 0; }
table.sortable button.sort { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; cursor: pointer; font-weight: 500; }
table.sortable button.sort::after { content: " ↕"; color: var(--rule); font-size: 11px; }
table.sortable th[aria-sort="ascending"] button.sort::after { content: " ↑"; color: var(--amber); }
table.sortable th[aria-sort="descending"] button.sort::after { content: " ↓"; color: var(--amber); }
table.sortable button.sort:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
[hidden] { display: none !important; }
.kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 6px 18px; margin: 0; }
.kv dt { color: var(--ink-mute); font-size: 13.5px; } .kv dd { margin: 0; }

/* المسرد (الحزمة 9) */
.g-abbr { font-family: var(--f-mono); font-size: 12px; color: var(--amber); border: 1px solid var(--rule); padding: 0 5px; margin-inline-start: 6px; text-decoration: none; }
.g-terms > div { scroll-margin-top: 80px; }
.g-terms > div:target { background: var(--amber-wash); }
.g-eq, .g-see, .g-src { font-size: 12.5px; color: var(--ink-mute); margin: 4px 0 0; }
.g-entry { font-size: 13px; margin-inline-start: 6px; }
.note.coi-note { border-inline-start-color: var(--amber-bright); background: var(--amber-wash); }
