:root {
  --ink: #17201e;
  --muted: #5d6764;
  --line: #d9dfdb;
  --paper: #fbfbf8;
  --soft: #eef3ef;
  --green: #0f5d49;
  --green-2: #16715a;
  --garnet: #8f2d46;
  --gold: #b78a36;
  --blue: #2f5f8f;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(23, 32, 30, .10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Tahoma, Arial, "Noto Sans Arabic", sans-serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
body.is-ltr { font-family: Arial, "Noto Sans", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(143, 45, 70, .42); outline-offset: 3px; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; background: var(--ink); color: white; padding: 8px 12px; transform: translateY(-140%); z-index: 30; }
.skip-link:focus { transform: translateY(0); }
.utility-bar { border-bottom: 1px solid var(--line); background: #f7f8f4; font-size: .83rem; color: var(--muted); }
.utility-inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.utility-inner nav, .footer-links, .social-list { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 251, 248, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.nav-shell { min-height: 82px; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand.inline { min-width: 0; }
.brand-mark { width: 44px; height: 44px; border: 1px solid var(--ink); display: grid; place-items: center; background: var(--ink); color: white; font-weight: 700; }
.brand strong { display: block; font-size: 1.15rem; line-height: 1.15; }
.brand small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.primary-nav { display: flex; align-items: center; justify-content: center; gap: 4px; }
.primary-nav a { padding: 10px 9px; border-radius: 6px; color: #25322f; font-size: .88rem; white-space: nowrap; }
.primary-nav a.active, .primary-nav a:hover { background: var(--soft); color: var(--green); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-link, .text-link { color: var(--muted); font-size: .9rem; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); background: white; }
.lang-switch button { border: 0; background: transparent; padding: 6px 8px; color: var(--muted); }
.lang-switch button.active { background: var(--green); color: white; }
.button, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); min-height: 44px; padding: 10px 18px; border-radius: 6px; background: transparent; color: var(--ink); font-weight: 700; }
.button.primary, button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.secondary { border-color: var(--line); background: white; }
.button.text { border-color: transparent; padding-inline: 0; }
.button.small { min-height: 38px; padding: 7px 13px; font-size: .88rem; }
.menu-toggle { display: none; border: 1px solid var(--line); background: white; padding: 8px; width: 46px; height: 42px; border-radius: 6px; }
.menu-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 2px; }
.menu-toggle b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.page-hero { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f7f8f4, #ffffff); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .65fr); gap: 48px; align-items: center; padding-block: 58px; }
.page-hero h1, .home-hero h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 4.2rem); line-height: 1.15; letter-spacing: 0; max-width: 900px; }
.page-hero p, .home-hero p { color: var(--muted); max-width: 760px; margin-block: 18px 0; font-size: 1.05rem; }
.home-hero { min-height: 530px; display: grid; align-items: end; border-bottom: 1px solid var(--line); background-image: linear-gradient(90deg, rgba(251,251,248,.98) 0%, rgba(251,251,248,.88) 48%, rgba(251,251,248,.34) 100%), url('../images/hero-sadeem.png'); background-size: cover; background-position: center; }
.home-hero .container { padding-block: 74px 64px; }
.home-hero .actions, .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--garnet); font-weight: 700; font-size: .82rem; letter-spacing: 0; text-transform: none; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.hero-aside { border-inline-start: 3px solid var(--green); padding: 22px; background: rgba(255,255,255,.72); box-shadow: var(--shadow); }
.hero-aside h2, .hero-aside h3 { margin-block: 0 10px; font-size: 1rem; }
.hero-aside p { margin: 0; font-size: .92rem; }
.section, .band { padding-block: 70px; }
.band { background: white; border-block: 1px solid var(--line); }
.section-intro { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.1fr); gap: 34px; align-items: start; margin-block-end: 32px; }
.section-intro h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.65rem); line-height: 1.25; }
.section-intro p { margin: 0; color: var(--muted); max-width: 760px; }
.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 22px; min-width: 0; }
.card.subtle { background: var(--soft); }
.card h3 { margin: 0 0 10px; font-size: 1.08rem; line-height: 1.45; }
.card p { color: var(--muted); margin: 0; }
.card-footer { margin-block-start: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.featured-card { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; align-items: stretch; background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.featured-card .body { padding: 28px; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; min-height: 220px; }
.badge, .template-tag { display: inline-flex; align-items: center; min-height: 26px; border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; color: var(--muted); font-size: .76rem; font-weight: 700; background: white; }
.template-tag { border-radius: 4px; color: var(--green); background: #f5faf7; }
.badge.data { color: var(--blue); border-color: rgba(47,95,143,.25); }
.badge.form { color: var(--garnet); border-color: rgba(143,45,70,.25); }
.badge.dynamic { color: var(--green); border-color: rgba(15,93,73,.25); }
.metadata-row, .tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stat-panel { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 24px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.stat-value { font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 1; color: var(--green); font-weight: 800; }
.profile-card { display: grid; grid-template-columns: 86px 1fr; gap: 16px; align-items: center; }
.profile-card img, .profile-photo { width: 86px; height: 86px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); }
.profile-card h3 { margin: 0 0 4px; }
.profile-card p { margin: 0 0 9px; font-size: .9rem; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 42px; align-items: start; }
.article-body { background: white; border: 1px solid var(--line); border-radius: 8px; padding: min(5vw, 46px); }
.article-body h2 { margin-block-start: 36px; font-size: 1.55rem; }
.article-body h2:first-child { margin-block-start: 0; }
.article-body p, .article-body li { color: #3d4845; }
.side-stack { display: grid; gap: 16px; position: sticky; top: 120px; }
.meta-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.meta-grid div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; background: white; padding: 13px 15px; }
.meta-grid dt { color: var(--muted); font-size: .82rem; }
.meta-grid dd { margin: 0; font-weight: 700; }
.filter-panel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 8px; margin-block-end: 24px; }
.filter-panel label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); padding: 10px 12px; min-height: 42px; }
textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-shell { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.form-shell label { display: grid; gap: 6px; color: #31413d; }
.form-success, .result-box { margin-block-start: 18px; padding: 16px; border-radius: 8px; background: #edf7f2; color: var(--green); border: 1px solid rgba(15,93,73,.22); font-weight: 700; }
.result-box.not-found { background: #fbf1f2; color: var(--garnet); border-color: rgba(143,45,70,.22); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { color: var(--muted); background: #f7f8f4; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.bar-chart { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 54px; gap: 12px; align-items: center; }
.bar-track { height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 40%; background: var(--green); }
.timeline { border-inline-start: 2px solid var(--line); padding-inline-start: 20px; display: grid; gap: 18px; }
.timeline-item { position: relative; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -27px; inset-block-start: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--garnet); }
.map-grid { display: grid; gap: 14px; }
.map-row { display: grid; grid-template-columns: 1.1fr 1fr .75fr .8fr .85fr 1fr 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 14px; }
.map-row.header { background: var(--ink); color: white; font-weight: 700; position: sticky; top: 121px; z-index: 5; }
.diagram { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.entity { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 20px; min-height: 180px; }
.entity h3 { margin-block: 0 10px; }
.entity ul { margin: 0; padding-inline-start: 22px; color: var(--muted); }
.workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.workflow .card { position: relative; padding-block-start: 46px; }
.workflow .card::before { counter-increment: step; content: counter(step); position: absolute; inset-block-start: 16px; inset-inline-start: 18px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--garnet); color: white; font-size: .8rem; }
.account-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 18px; }
.account-tabs button { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 9px 12px; }
.account-tabs button.active { background: var(--green); color: white; border-color: var(--green); }
.tab-panel[hidden] { display: none; }
.site-footer { background: #17201e; color: white; padding-block: 54px; }
.site-footer p, .site-footer a, .site-footer small { color: rgba(255,255,255,.74); }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 38px; }
.footer-links { align-content: start; }
.newsletter { display: grid; gap: 8px; margin-block-start: 20px; }
.newsletter div { display: flex; gap: 8px; }
.newsletter button { border: 0; border-radius: 6px; padding-inline: 14px; background: var(--gold); color: var(--ink); font-weight: 700; }
.notes-toggle { position: fixed; inset-inline-end: 20px; inset-block-end: 20px; z-index: 25; border: 1px solid var(--ink); background: var(--ink); color: white; border-radius: 999px; padding: 10px 16px; box-shadow: var(--shadow); }
.prototype-panel { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(430px, 100%); overflow-y: auto; background: white; border-inline-start: 1px solid var(--line); z-index: 40; padding: 24px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 18px; }
.panel-head h2 { margin: 0; }
.panel-close { border: 1px solid var(--line); background: white; width: 40px; height: 40px; border-radius: 6px; font-size: 1.5rem; }
[hidden] { display: none !important; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; text-align: center; color: var(--muted); }
.ltr-note { direction: ltr; text-align: left; }
@media (max-width: 1040px) {
  .nav-shell { grid-template-columns: auto auto 1fr; }
  .menu-toggle { display: block; order: 2; }
  .brand { order: 1; }
  .header-actions { order: 3; justify-self: end; }
  .primary-nav { display: none; grid-column: 1 / -1; order: 4; flex-direction: column; align-items: stretch; padding-block-end: 18px; }
  .site-header[data-open="true"] .primary-nav { display: flex; }
  .primary-nav a { white-space: normal; }
  .utility-inner { display: none; }
  .map-row { grid-template-columns: 1fr; }
  .map-row.header { display: none; }
}
@media (max-width: 840px) {
  .container { width: min(100% - 28px, 1180px); }
  .hero-grid, .content-layout, .section-intro, .footer-grid { grid-template-columns: 1fr; }
  .grid.three, .grid.four, .grid.two, .diagram, .workflow { grid-template-columns: 1fr; }
  .filter-panel, .form-grid { grid-template-columns: 1fr; }
  .featured-card { grid-template-columns: 1fr; }
  .side-stack { position: static; }
  .home-hero { min-height: 470px; background-position: center; }
  .header-actions .text-link, .header-actions .button { display: none; }
  .meta-grid div { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 80px 1fr 46px; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .brand strong { font-size: 1rem; }
  .brand-mark { width: 38px; height: 38px; }
  .home-hero .container, .hero-grid { padding-block: 44px; }
  .page-hero h1, .home-hero h1 { font-size: 2rem; }
  .section, .band { padding-block: 48px; }
  .profile-card { grid-template-columns: 1fr; }
  .newsletter div { flex-direction: column; }
}
  
.relation-ribbon { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; margin-block-end: 24px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8f4; }
.relation-ribbon a { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; border-radius: 999px; background: white; border: 1px solid var(--line); color: var(--green); font-weight: 700; font-size: .84rem; }

.related-block { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 22px; margin-block: 24px; }
.sidebar-related { margin-block: 0; }
.related-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-block-end: 18px; }
.related-head h2 { margin: 4px 0 6px; font-size: 1.35rem; }
.related-head p { margin: 0; color: var(--muted); }
.related-mode { display: inline-flex; align-items: center; border: 1px solid rgba(15,93,73,.24); background: #f5faf7; color: var(--green); border-radius: 999px; padding: 5px 10px; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fbfbf8; }
.related-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; margin-block-end: 10px; }
.related-card h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.45; }
.related-card p { margin: 0; color: var(--muted); }
.related-meta { color: var(--garnet); font-weight: 700; font-size: .78rem; margin-block-start: 12px; }
.related-empty { border: 1px dashed var(--line); border-radius: 8px; padding: 22px; color: var(--muted); background: #f7f8f4; }
.related-empty strong { color: var(--ink); display: block; margin-block-end: 6px; }
@media (max-width: 840px) {
  .related-head, .related-grid { grid-template-columns: 1fr; display: grid; }
  .related-mode { width: fit-content; }
}

.global-related-section { padding-block: 52px; }
.related-system-block { margin-block: 0; }
.related-footnote { margin: 16px 0 0; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); padding-block-start: 12px; }
