/* ==========================================================================
   محرك العرض: لوحة ثابتة 1280×720 تُكبَّر لتملأ الشاشة.
   على الجوال (< 768px) تتحول الشرائح إلى صفحة تمرير عمودية.
   ========================================================================== */

body.deck-mode {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--panel);
}

.deck {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1280px;
  height: 720px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center center;
  padding: 64px 80px 88px;
  background: var(--ground);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.65;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur-enter) var(--ease-out), visibility 0s linear var(--dur-enter);
}
.slide.is-active {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--dur-enter) var(--ease-out), visibility 0s;
}
.slide.band { background: var(--ground); }

.slide > .notes { display: none; }

/* --- رأس الشريحة --- */
.kicker {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.slide h1 { font-size: 72px; }
.slide h2 { font-size: 48px; }
.slide h3 { font-size: 28px; }
.slide h4 { font-size: 22px; }
.s-head { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; }
.lead { font-size: 28px; line-height: 1.6; color: var(--ink); max-width: 980px; }
.muted { color: var(--ink-muted); }
.small { font-size: 18px; }
.source { font-size: 15px; color: var(--ink-muted); }
.result { color: var(--accent); font-weight: 700; }
.grow { flex: 1; min-height: 0; }
.push-end { margin-top: auto; }

/* --- تذييل الشريحة (يحقنه المحرك) --- */
.slide-foot {
  position: absolute;
  inset-inline: 80px;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1;
}
.slide-foot .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.slide-foot .brand svg { width: 22px; height: 22px; }
.slide-foot .count { direction: ltr; font-variant-numeric: tabular-nums; }

/* --- تخطيطات --- */
.cols { display: grid; gap: 32px; align-items: start; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-wide { grid-template-columns: 1.4fr 1fr; }
.cols-narrow { grid-template-columns: 1fr 1.4fr; }
.center-y { align-items: center; }

.tile {
  background: var(--panel);
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile h3 { font-size: 26px; display: flex; align-items: center; gap: 12px; }
.tile p { font-size: 19px; line-height: 1.6; color: var(--ink-muted); }
.tile .ico { width: 28px; height: 28px; }
.tile--plain { background: var(--ground); }

/* --- قوائم --- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.list li { position: relative; padding-inline-start: 28px; }
.list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .72em;
  width: 12px;
  height: 2px;
  background: var(--ink);
}
.list li b { font-weight: 700; }
.list--lg { font-size: 26px; gap: 18px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 56px 20px 0 20px;
  border-top: 2px solid var(--hairline);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: -21px;
  inset-inline-start: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ground);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps li.is-goal::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps h4 { font-size: 24px; margin-bottom: 6px; }
.steps p { font-size: 18px; line-height: 1.55; color: var(--ink-muted); }

.vsteps { list-style: none; margin: 0; padding: 0; counter-reset: v; display: flex; flex-direction: column; gap: 18px; }
.vsteps li { counter-increment: v; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: baseline; }
.vsteps li::before {
  content: counter(v);
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  transform: translateY(4px);
}
.vsteps b { font-weight: 700; }

/* --- جداول --- */
.table-wrap { width: 100%; }
table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
  line-height: 1.45;
}
.compare th, .compare td {
  text-align: start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.compare thead th {
  background: var(--panel);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.compare tbody th { font-weight: 700; }
/* جدول كثيف: للجداول ذات 6 صفوف أو الخلايا الطويلة */
table.compare--dense { font-size: 18px; line-height: 1.4; }
.compare--dense th, .compare--dense td { padding: 9px 14px; }
.compare--dense thead th { font-size: 16px; }
.compare .yes { color: var(--accent); font-weight: 700; }
.compare .no { color: var(--negative); font-weight: 700; }

/* --- أرقام بطلة --- */
.figures { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 48px; }
.figures > div { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--hairline); padding-top: 20px; }
.figures [data-figure] { font-size: 96px; }
.figures .cap { font-size: 20px; color: var(--ink-muted); line-height: 1.5; }

.hero-figure { font-size: 200px; }

/* --- اقتباس --- */
.quote {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 1020px;
  text-wrap: balance;
}
.quote-by { font-size: 20px; color: var(--ink-muted); }

/* --- كود وبرومبت --- */
.code {
  direction: ltr;
  text-align: left;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  font-size: 20px;
  line-height: 1.6;
  overflow: hidden;
}
.code .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--card-line);
  font: 700 14px/1 var(--font-sans);
  color: var(--ink-muted);
}
.code .bar i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-muted); }
.code pre, .code code { margin: 0; padding: 18px 22px; white-space: pre-wrap; display: block; }
.code .c { color: var(--ink-muted); }
.code .p { color: var(--accent); font-weight: 700; }

.prompt {
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-inline-start: 4px solid var(--ink);
  border-radius: var(--r-sm);
  padding: 18px 24px;
  font-size: 21px;
  line-height: 1.7;
}
.prompt .label { display: block; font-size: 15px; font-weight: 700; color: var(--ink-muted); margin-bottom: 6px; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 .45em;
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--ground);
  font-size: .85em;
  line-height: 1.5;
  text-align: center;
  direction: ltr;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  background: var(--ground);
}
.chip--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- المخططات --- */
.diagram { width: 100%; display: block; }
/* اتجاه ثابت: text-anchor="end" يعني الحافة اليمنى عند x في كل المتصفحات */
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; direction: ltr; }
.diagram text { font-family: var(--font-sans); unicode-bidi: plaintext; } /* كل نص يأخذ اتجاهه من أول حرف: «الامتثال ثم QA» و«20 قسماً» تُقرأ صحيحة */
svg .d-box { fill: var(--ground); stroke: var(--ink); stroke-width: 2; }
svg .d-panel { fill: var(--panel); stroke: var(--card-line); stroke-width: 1.5; }
svg .d-goal { fill: var(--accent); stroke: var(--accent); }
svg .d-line { fill: none; stroke: var(--ink-muted); stroke-width: 2; }
svg .d-line-ink { fill: none; stroke: var(--ink); stroke-width: 2.5; }
svg .d-dash { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-dasharray: 6 6; }
svg .d-t { fill: var(--ink); font-size: 22px; font-weight: 700; }
svg .d-s { fill: var(--ink-muted); font-size: 17px; font-weight: 400; }
svg .d-w { fill: var(--accent-ink); font-size: 22px; font-weight: 700; }
svg .d-ws { fill: var(--accent-ink); font-size: 17px; }
svg .d-arrow { fill: var(--ink-muted); }

/* ==========================================================================
   أنماط الشرائح
   ========================================================================== */

/* الغلاف */
.slide--cover { padding: 0; display: grid; grid-template-columns: 1fr 420px; gap: 0; }
.slide--cover .cover-text { padding: 72px 80px 88px; display: flex; flex-direction: column; gap: 24px; }
.slide--cover .cover-text .mark-lg { width: 64px; height: 64px; }
.slide--cover h1 { font-size: 76px; line-height: 1.1; }
.slide--cover .cover-sub { font-size: 28px; color: var(--ink-muted); line-height: 1.5; max-width: 640px; }
.slide--cover .cover-who { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.slide--cover .cover-who b { font-size: 26px; }
.slide--cover .cover-who span { font-size: 18px; color: var(--ink-muted); }
.slide--cover .cover-photo {
  position: relative;
  background: var(--panel);
  border-inline-start: 1px solid var(--hairline);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.slide--cover .cover-photo img { width: 400px; height: auto; display: block; }
.slide--cover .cover-photo .watermark {
  position: absolute;
  width: 360px;
  top: 60px;
  opacity: .07;
}
.slide--cover .slide-foot { inset-inline-end: 500px; }

/* فاصل قسم */
.slide--section { justify-content: center; gap: 20px; }
.slide--section .part {
  font-size: 160px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.slide--section h2 { font-size: 64px; }
.slide--section .lead { color: var(--ink-muted); }

/* عبارة كبيرة */
.slide--statement { justify-content: center; }
.slide--statement .quote { font-size: 56px; }

/* النهاية */
.slide--end { justify-content: center; gap: 28px; }

/* ==========================================================================
   طبقات المحرك
   ========================================================================== */

.deck-progress {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: var(--hairline);
  z-index: 10;
}
.deck-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width var(--dur-enter) var(--ease-out);
}

.deck-nav {
  position: fixed;
  bottom: 14px;
  inset-inline-start: 16px;
  display: flex;
  gap: 8px;
  z-index: 11;
  opacity: 0;
  transition: opacity var(--dur-ui) var(--ease);
}
body.deck-mode:hover .deck-nav, .deck-nav:focus-within { opacity: 1; }
.deck-nav button, .deck-nav a {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--ground);
  color: var(--ink);
  font: 700 18px/1 var(--font-sans);
  cursor: pointer;
  text-decoration: none;
}
.deck-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.notes-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 3px;
  max-height: 34vh;
  overflow: auto;
  background: var(--ground);
  border-top: 2px solid var(--ink);
  padding: 16px 24px 20px;
  font-size: 18px;
  line-height: 1.8;
  z-index: 12;
  display: none;
}
.notes-panel .np-label { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin-bottom: 4px; }
body.show-notes .notes-panel { display: block; }
.notes-panel p + p, .p-notes p + p { margin-top: 10px; }
.notes-panel ul, .p-notes ul { margin: 6px 0; padding-inline-start: 22px; }

.overview {
  position: fixed;
  inset: 0;
  background: var(--ground);
  z-index: 20;
  overflow: auto;
  padding: 32px;
  display: none;
}
body.show-overview .overview { display: block; }
.overview header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.overview h2 { font-size: 28px; }
.overview .keys { font-size: 15px; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.overview ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.overview button {
  width: 100%;
  min-height: 72px;
  text-align: start;
  padding: 12px 16px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  background: var(--panel);
  font: 700 17px/1.4 var(--font-sans);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
}
.overview button .n { color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 2ch; }
.overview button[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ==========================================================================
   نافذة المقدّم
   ========================================================================== */

body.presenter { background: var(--panel); }
body.presenter .deck-progress, body.presenter .deck-nav { display: none; }
.p-shell { display: none; }
body.presenter .p-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  gap: 16px;
  padding: 16px;
}
.p-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 10px 18px;
}
.p-bar .p-title { font-weight: 700; font-size: 18px; }
.p-timer { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.p-timer output { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; direction: ltr; }
.p-timer output.over { color: var(--negative); }
.p-count { font-size: 20px; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.p-box {
  position: relative;
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.p-box > .p-label {
  position: absolute; top: 8px; inset-inline-start: 12px; z-index: 2;
  font-size: 13px; font-weight: 700; color: var(--ink-muted);
}
.p-current { grid-row: 2 / 4; }
body.presenter .deck { position: absolute; inset: 0; }
.p-next .slide { visibility: visible; opacity: 1; }
.p-notes {
  padding: 36px 20px 20px;
  overflow: auto;
  font-size: 20px;
  line-height: 1.8;
}
.p-notes:empty::after { content: "لا ملاحظات لهذه الشريحة."; color: var(--ink-muted); }

/* ==========================================================================
   الجوال: الشرائح صفحة تمرير
   ========================================================================== */

body.flow { height: auto; overflow: auto; background: var(--ground); }
body.flow .deck { position: static; overflow: visible; }
body.flow .deck-progress, body.flow .deck-nav, body.flow .notes-panel { display: none; }
body.flow .slide {
  position: relative;
  top: auto; left: auto;
  width: auto;
  height: auto;
  transform: none;
  visibility: visible;
  opacity: 1;
  box-shadow: none;
  padding: 40px 16px 64px;
  gap: 24px;
  font-size: 17px;
  line-height: 1.75;
  border-bottom: 1px solid var(--hairline);
  overflow: visible;
}
body.flow .slide-foot { inset-inline: 16px; bottom: 20px; font-size: 13px; }
body.flow .slide h1 { font-size: 38px; }
body.flow .slide h2 { font-size: 30px; }
body.flow .slide h3 { font-size: 22px; }
body.flow .slide h4 { font-size: 19px; }
body.flow .kicker { font-size: 14px; }
body.flow .lead { font-size: 20px; }
body.flow .small { font-size: 15px; }
body.flow .cols-2, body.flow .cols-3, body.flow .cols-4,
body.flow .cols-wide, body.flow .cols-narrow { grid-template-columns: 1fr; gap: 16px; }
body.flow .tile { padding: 18px; }
body.flow .tile h3 { font-size: 20px; }
body.flow .tile p { font-size: 16px; }
body.flow .list--lg { font-size: 18px; }
body.flow .steps { grid-auto-flow: row; gap: 28px; }
body.flow .steps li { padding: 0 52px 0 0; border-top: 0; border-inline-start: 2px solid var(--hairline); padding-inline-start: 40px; padding-inline-end: 0; }
body.flow .steps li::before { top: -4px; inset-inline-start: -19px; width: 36px; height: 36px; font-size: 16px; }
body.flow .steps h4 { font-size: 19px; }
body.flow .steps p { font-size: 16px; }
body.flow .table-wrap { overflow-x: auto; }
body.flow table.compare { font-size: 15px; min-width: 520px; }
body.flow .compare th, body.flow .compare td { padding: 10px 12px; }
body.flow .figures { grid-auto-flow: row; gap: 20px; }
body.flow .figures [data-figure] { font-size: 64px; }
body.flow .figures .cap { font-size: 16px; }
body.flow .hero-figure { font-size: 110px; }
body.flow .quote, body.flow .slide--statement .quote { font-size: 28px; }
body.flow .quote-by { font-size: 16px; }
body.flow .code { font-size: 14px; }
body.flow .code pre, body.flow .code code { padding: 14px; }
body.flow .prompt { font-size: 16px; padding: 14px 16px; }
body.flow .chip { font-size: 14px; }
body.flow .diagram { overflow-x: auto; }
body.flow .diagram svg { min-width: 560px; }
body.flow .diagram.fit svg { min-width: 0; }
body.flow .slide--cover { display: flex; flex-direction: column; padding: 0; }
body.flow .slide--cover .cover-text { padding: 40px 16px 24px; gap: 16px; }
body.flow .slide--cover h1 { font-size: 40px; }
body.flow .slide--cover .cover-sub { font-size: 18px; }
body.flow .slide--cover .cover-photo { border-inline-start: 0; border-top: 1px solid var(--hairline); height: 320px; }
body.flow .slide--cover .cover-photo img { width: 240px; }
body.flow .slide--cover .slide-foot { display: none; }
body.flow .slide--section .part { font-size: 96px; }
body.flow .slide--section h2 { font-size: 34px; }

/* ==========================================================================
   الطباعة: كل شريحة صفحة
   ========================================================================== */

@page { size: 1280px 720px; margin: 0; }
@media print {
  body.deck-mode { height: auto; overflow: visible; background: #fff; }
  .deck { position: static; overflow: visible; }
  .slide {
    position: relative;
    top: auto; left: auto;
    transform: none;
    visibility: visible;
    opacity: 1;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
    transition: none;
  }
  .band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .deck-progress, .deck-nav, .notes-panel, .overview, .p-shell { display: none !important; }
}
