/* =========================================================
   AI Project Lifecycle Presentation
   من الفكرة إلى الإنتاج
   Keynote-quality design system · Arabic RTL
   ========================================================= */

:root {
  --primary: #0B84B5;
  --primary-dark: #086a91;
  --primary-soft: rgba(11, 132, 181, 0.1);
  --secondary: #C88618;
  --secondary-soft: rgba(200, 134, 24, 0.12);
  --accent: #00B894;
  --accent-soft: rgba(0, 184, 148, 0.12);
  --bg: #F8FAFC;
  --bg-deep: #EEF2F7;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;
  --border: #E2E8F0;
  --danger: #E11D48;
  --danger-soft: rgba(225, 29, 72, 0.1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --sidebar-w: 200px;
  --toolbar-h: 56px;
  --transition: 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Room-projection scaling.
   Slide type, spacing and radii are all authored in rem, so lifting the root
   size scales the whole slide proportionally and keeps the intended hierarchy.
   The chrome is zoomed back to its 16px baseline so the sidebar and toolbar
   stay compact and leave the stage as wide as possible. */
@media (min-width: 1500px) {
  html { font-size: 18px; }
  html:has(body.fullscreen-mode) { font-size: 18px; }
  .sidebar,
  .toolbar,
  .presenter-overlay,
  .export-overlay { zoom: 0.8; }
}

@media (min-width: 1800px) {
  html { font-size: 20px; }
  html:has(body.fullscreen-mode) { font-size: 20px; }
  .sidebar,
  .toolbar,
  .presenter-overlay,
  .export-overlay { zoom: 0.7; }
}

@media (min-width: 2400px) {
  html { font-size: 22px; }
  html:has(body.fullscreen-mode) { font-size: 22px; }
  .sidebar,
  .toolbar,
  .presenter-overlay,
  .export-overlay { zoom: 0.55; }
}

body {
  font-family: var(--font);
  background: linear-gradient(145deg, #E8EEF5 0%, #F8FAFC 40%, #EEF4F8 100%);
  color: var(--text);
  direction: rtl;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul { list-style: none; }

/* =========================================================
   App Shell
   ========================================================= */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--toolbar-h);
  height: 100vh;
  width: 100vw;
}

.sidebar {
  grid-row: 1 / 3;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.sidebar-header {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.15rem;
}

.sidebar-header p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.thumbnails {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.thumb {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  text-align: right;
  transition: all 0.2s ease;
  width: 100%;
}

.thumb:hover {
  background: var(--primary-soft);
}

.thumb.active {
  background: var(--primary-soft);
  border-color: rgba(11, 132, 181, 0.35);
  box-shadow: var(--shadow-sm);
}

.thumb-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.thumb.active .thumb-num {
  background: var(--primary);
  color: #fff;
}

.thumb-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   Stage
   ========================================================= */

.stage-wrap {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.25rem 0.1rem;
  position: relative;
  min-height: 0;
  overflow: hidden;
  container-type: size;
  container-name: stage-area;
}

.stage {
  /* أكبر مساحة ممكنة مع الحفاظ على 16:9 */
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
  max-width: 100%;
  max-height: 100%;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  container-type: size;
  container-name: slide-stage;
  /* Typography scale relative to slide stage (multiplied by --fit for autofit) */
  --fit: 1;
  --s-xs: calc(clamp(0.68rem, 1.45cqw, 0.82rem) * var(--fit));
  --s-sm: calc(clamp(0.78rem, 1.75cqw, 0.95rem) * var(--fit));
  --s-md: calc(clamp(0.88rem, 2.05cqw, 1.08rem) * var(--fit));
  --s-lg: calc(clamp(1rem, 2.5cqw, 1.28rem) * var(--fit));
  --s-xl: calc(clamp(1.15rem, 3.2cqw, 1.55rem) * var(--fit));
  --s-2xl: calc(clamp(1.45rem, 4.2cqw, 2.1rem) * var(--fit));
  --s-mega: calc(clamp(2.6rem, 7.5cqw, 5.5rem) * var(--fit));
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  padding:
    calc(clamp(0.95rem, 2.6cqh, 1.75rem) * var(--fit, 1))
    calc(clamp(1.25rem, 3.6cqw, 2.5rem) * var(--fit, 1))
    calc(clamp(0.65rem, 1.8cqh, 1.1rem) * var(--fit, 1));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-28px) scale(0.985);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  gap: calc(0.15rem * var(--fit, 1));
}

.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  z-index: 2;
}

.slide.exit-left {
  transform: translateX(40px) scale(0.98);
  opacity: 0;
}

.slide.exit-right {
  transform: translateX(-40px) scale(0.98);
  opacity: 0;
}

.slide.zoom-in.active {
  animation: zoomIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
  from { stroke-dashoffset: 400; }
  to { stroke-dashoffset: 0; }
}

.slide.active .anim {
  animation: fadeUp 0.55s ease both;
}

/* Detail sits just above the footer — skip the downward travel so it never
   briefly overlaps the CPMAI footer during entrance. */
.slide.active .slide-detail.anim {
  animation-name: fadeOnly;
}

/* Body blocks are packed tightly; vertical travel makes banners/cards collide. */
.slide.active .slide-body .anim {
  animation-name: fadeOnly;
}

/* While measuring fit, freeze motion so translateY does not inflate bounds. */
.slide.autofitting .anim {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@keyframes fadeOnly {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide.active .anim-d1 { animation-delay: 0.08s; }
.slide.active .anim-d2 { animation-delay: 0.16s; }
.slide.active .anim-d3 { animation-delay: 0.24s; }
.slide.active .anim-d4 { animation-delay: 0.32s; }
.slide.active .anim-d5 { animation-delay: 0.4s; }
.slide.active .anim-d6 { animation-delay: 0.48s; }

/* =========================================================
   Slide chrome
   ========================================================= */

.slide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: calc(clamp(0.68rem, 1.45cqw, 0.82rem) * var(--fit, 1));
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: calc(0.25rem * var(--fit, 1));
  flex-shrink: 0;
}

/* English concept label per slide */
.slide-en-term {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: calc(clamp(0.62rem, 1.3cqw, 0.76rem) * var(--fit, 1));
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: calc(0.2rem * var(--fit, 1));
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  direction: ltr;
  unicode-bidi: embed;
  flex-shrink: 0;
}

.slide-en-term::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
}

/* Inline English under Arabic labels in diagrams */
.en-sub {
  display: block;
  font-size: calc(clamp(0.5rem, 1cqw, 0.62rem) * var(--fit, 1));
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  direction: ltr;
  margin-top: 0.08rem;
}

.slide-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.slide-title {
  font-size: calc(clamp(1.2rem, 4.6cqw, 2.2rem) * var(--fit, 1));
  font-weight: 800;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: calc(0.15rem * var(--fit, 1));
  max-width: 100%;
  flex-shrink: 0;
}

.slide-subtitle {
  font-size: calc(clamp(0.75rem, 2cqw, 0.98rem) * var(--fit, 1));
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
  max-width: 100%;
  margin-bottom: calc(0.4rem * var(--fit, 1));
  flex-shrink: 0;
}

.cpmai-footer {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: calc(clamp(0.55rem, 1.1cqw, 0.65rem) * var(--fit, 1));
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-top: 0.4rem;
  margin-top: 0.55rem;
  z-index: 5;
  flex-shrink: 0;
}

.cpmai-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cpmai-badge {
  background: var(--secondary-soft);
  color: var(--secondary);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
}

.slide-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(0.45rem * var(--fit, 1));
  padding-bottom: 0.15rem;
  overflow: hidden; /* no scroll — autofit shrinks content instead */
  justify-content: flex-start;
}

.slide-body::-webkit-scrollbar {
  display: none;
  width: 0;
}

/* Auto-fit helper */
.autofit {
  container-type: size;
}

/* =========================================================
   Shared UI components
   ========================================================= */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(0.75rem * var(--fit, 1));
  flex: 1;
  min-height: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(0.7rem * var(--fit, 1));
  flex: 1;
  min-height: 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(0.55rem * var(--fit, 1));
  flex: 1;
  min-height: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(0.75rem * var(--fit, 1)) calc(0.85rem * var(--fit, 1));
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(11, 132, 181, 0.25);
}

.card-icon {
  width: calc(36px * var(--fit, 1));
  height: calc(36px * var(--fit, 1));
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: calc(0.4rem * var(--fit, 1));
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.card-icon.secondary { background: var(--secondary-soft); color: var(--secondary); }
.card-icon.accent { background: var(--accent-soft); color: var(--accent); }
.card-icon.danger { background: var(--danger-soft); color: var(--danger); }

.card h3 {
  font-size: calc(clamp(0.75rem, 1.75cqw, 0.95rem) * var(--fit, 1));
  font-weight: 700;
  margin-bottom: calc(0.15rem * var(--fit, 1));
  line-height: 1.25;
}

.card p {
  font-size: calc(clamp(0.6rem, 1.3cqw, 0.74rem) * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.icon-lg {
  width: 28px;
  height: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat {
  text-align: center;
  padding: 1.2rem 0.8rem;
}

.stat-value {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.stat-value.secondary { color: var(--secondary); }
.stat-value.accent { color: var(--accent); }
.stat-value.danger { color: var(--danger); }

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Cover slide */
.slide-cover {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(11, 132, 181, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(200, 134, 24, 0.12), transparent 50%),
    linear-gradient(160deg, #F8FAFC 0%, #EEF6FA 50%, #F8FAFC 100%);
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 3.5rem;
}

.cover-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.cover-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(11, 132, 181, 0.2);
  overflow: hidden;
  padding: 6px;
  flex-shrink: 0;
}

.cover-logo img,
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  padding: 6px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* Nexim AI wordmark shown next to the logo */
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.brand-wordmark em {
  font-style: normal;
  color: var(--primary);
}

.brand-logo-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  padding: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.sidebar-brand .brand-wordmark {
  font-size: 0.95rem;
}

.cover-brand .brand-wordmark {
  font-size: 1.3rem;
  color: var(--text);
}

.cover-brand .brand-wordmark em {
  color: var(--primary);
}

.cover-brand-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.thanks-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.thanks-brand .brand-logo {
  width: 60px;
  height: 60px;
  padding: 8px;
}

.thanks-brand .brand-wordmark {
  font-size: 1.35rem;
}

.cover-presenter-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.speaker-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid rgba(255, 255, 255, 0.45);
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.speaker-credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.speaker-cred {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.slide-detail {
  margin-top: calc(0.2rem * var(--fit, 1));
  margin-bottom: 0;
  padding:
    calc(clamp(0.35rem, 0.9cqh, 0.55rem) * var(--fit, 1))
    calc(clamp(0.6rem, 1.8cqw, 0.85rem) * var(--fit, 1));
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  border-right: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  font-size: calc(clamp(0.6rem, 1.35cqw, 0.72rem) * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.35;
  flex-shrink: 0;
  overflow: hidden;
  max-height: calc(4.2em * var(--fit, 1) + 1.2rem);
}

.slide-detail strong {
  color: var(--primary-dark);
  font-weight: 800;
}

.slide-detail .detail-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  margin-left: 0.5rem;
  letter-spacing: 0.02em;
}

.slide-body.has-detail {
  padding-bottom: 0.5rem;
}

.cover-presenter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cover-brand span {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
}

.cover-title {
  font-size: clamp(1.75rem, 6.5cqw, 3.2rem);
  font-weight: 900;
  line-height: 1.28;
  max-width: 18ch;
  margin-bottom: 0.85rem;
  background: linear-gradient(120deg, var(--text) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cover-en-term {
  font-size: clamp(0.85rem, 2.5cqw, 1.15rem);
  color: var(--secondary);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  direction: ltr;
}

.cover-subtitle {
  font-size: clamp(0.88rem, 2.4cqw, 1.2rem);
  color: var(--text-muted);
  font-weight: 500;
  max-width: 38ch;
  line-height: 1.55;
  margin-bottom: 1.8rem;
}

.cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.cover-presenter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow-md);
}

.cover-presenter strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.cover-presenter span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cover-decor {
  position: absolute;
  left: 8%;
  top: 18%;
  width: 38%;
  height: 64%;
  pointer-events: none;
  opacity: 0.95;
}

/* Timeline */
.timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  position: relative;
  padding-top: 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 2.1rem;
  right: 4%;
  left: 4%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--secondary));
  border-radius: 999px;
  z-index: 0;
}

.timeline-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0.4rem;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.timeline-item:nth-child(even) .timeline-dot {
  border-color: var(--secondary);
  color: var(--secondary);
}

.timeline-item h4 {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.timeline-item p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Circular process */
.circle-process {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
}

.circle-ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 3px dashed rgba(11, 132, 181, 0.25);
}

.circle-center {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), #0891b2);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 16px 40px rgba(11, 132, 181, 0.35);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.35;
}

.circle-node {
  position: absolute;
  width: 110px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.55rem 0.4rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.circle-node i,
.circle-node .icon {
  display: block;
  margin: 0 auto 0.25rem;
  color: var(--primary);
}

/* Flow / pipeline */
.pipeline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

.pipe-step {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: calc(0.65rem * var(--fit, 1)) calc(0.5rem * var(--fit, 1));
  text-align: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.pipe-step:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pipe-step .icon {
  color: var(--primary);
  margin-bottom: 0.45rem;
}

.pipe-step h4 {
  font-size: var(--s-sm);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pipe-step p {
  font-size: var(--s-xs);
  color: var(--text-muted);
  line-height: 1.35;
}

.pipe-arrow {
  color: var(--text-soft);
  flex-shrink: 0;
}

/* Compare panels */
.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
  flex: 1;
}

.compare-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.compare-panel h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
  color: var(--primary);
}

.compare-panel.alt h3 { color: var(--secondary); }

.compare-panel li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  line-height: 1.45;
}

.compare-vs {
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Checklist */
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1.2rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s;
}

.check-item:hover { border-color: var(--accent); }

.check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Quiz */
.quiz {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 720px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  text-align: right;
  width: 100%;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.quiz-option:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quiz-option.correct {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.quiz-letter {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  flex-shrink: 0;
}

.quiz-feedback {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #066;
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
}

.quiz-feedback.show { display: block; }

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  overflow: auto;
}

.acc-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.15rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-align: right;
}

.acc-btn .icon { color: var(--primary); transition: transform 0.25s; }

.acc-item.open .acc-btn .icon { transform: rotate(180deg); }

.acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.15rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.acc-item.open .acc-panel {
  max-height: 200px;
  padding-bottom: 1rem;
}

/* Architecture diagram */
.arch {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.7rem;
  flex: 1;
}

.arch-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.arch-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.arch-box .icon {
  display: block;
  margin: 0 auto 0.4rem;
  color: var(--primary);
}

.arch-label {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* Speaker about */
.speaker-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  flex: 1;
  align-items: stretch;
}

.speaker-card {
  background: linear-gradient(165deg, var(--primary) 0%, #086a91 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 20px 40px rgba(11, 132, 181, 0.3);
}

.speaker-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  font-size: 2.2rem;
  font-weight: 800;
}

.speaker-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.speaker-card p {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.5;
}

.speaker-points {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

/* Mistakes / practices lists */
.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.55rem;
}

.feature-row .icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-row h4 {
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.feature-row p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Thank you / Nexim CTA */
.slide-thanks {
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(43, 88, 204, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(142, 45, 226, 0.08), transparent 55%),
    var(--bg);
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
  padding-block: calc(0.7rem * var(--fit, 1));
}

.nexim-close {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(0.45rem * var(--fit, 1));
}

.nexim-close-head {
  flex: 0 0 auto;
}

.slide-thanks .thanks-brand {
  margin-bottom: calc(0.25rem * var(--fit, 1));
}

.slide-thanks .thanks-brand .brand-logo {
  width: calc(44px * var(--fit, 1));
  height: calc(44px * var(--fit, 1));
  padding: 4px;
}

.slide-thanks .thanks-brand .brand-wordmark {
  font-size: calc(1.15rem * var(--fit, 1));
}

.slide-thanks .thanks-title {
  font-size: calc(clamp(1.25rem, 3.2cqw, 1.85rem) * var(--fit, 1));
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: calc(0.15rem * var(--fit, 1));
  line-height: 1.2;
}

.slide-thanks .thanks-sub {
  font-size: calc(clamp(0.72rem, 1.6cqw, 0.92rem) * var(--fit, 1));
  color: var(--text-muted);
  margin-bottom: 0;
}

.nexim-cta-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(0.7rem * var(--fit, 1));
  align-items: stretch;
}

.nexim-cta-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(0.28rem * var(--fit, 1));
  padding: calc(0.65rem * var(--fit, 1)) calc(0.75rem * var(--fit, 1)) calc(0.55rem * var(--fit, 1));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.9);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-height: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.nexim-cta-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(43, 88, 204, 0.35);
}

.nexim-cta-accent {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #2b58cc, #8e2de2);
}

.nexim-cta-card h3 {
  font-size: calc(clamp(1rem, 2.4cqw, 1.35rem) * var(--fit, 1));
  font-weight: 800;
  color: #1e3a8a;
  margin: 0.15rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nexim-cta-card h3::before {
  content: "";
  width: 3px;
  height: 1.1em;
  border-radius: 2px;
  background: linear-gradient(180deg, #2b58cc, #8e2de2);
}

.nexim-cta-card h3::after {
  content: none;
}

.nexim-cta-card > p {
  font-size: calc(clamp(0.62rem, 1.25cqw, 0.78rem) * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 28ch;
  margin: 0;
}

.nexim-qr-frame {
  width: min(42%, 7.2rem);
  aspect-ratio: 1;
  padding: 0.35rem;
  margin: 0.15rem 0;
  background: #fff;
  border-radius: 12px;
  border: 2px solid transparent;
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(135deg, #2b58cc, #8e2de2);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  flex: 0 0 auto;
}

.nexim-qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.nexim-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b58cc, #8e2de2);
  color: #fff;
  font-size: calc(clamp(0.65rem, 1.35cqw, 0.8rem) * var(--fit, 1));
  font-weight: 700;
}

.nexim-cta-pill .icon {
  width: 0.95em;
  height: 0.95em;
  stroke: #fff;
}

.nexim-cta-url {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: calc(clamp(0.55rem, 1.1cqw, 0.68rem) * var(--fit, 1));
  color: var(--text-soft);
  font-weight: 600;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.nexim-cta-url .icon {
  width: 0.9em;
  height: 0.9em;
}

.nexim-cta-services {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  width: 100%;
  margin-top: auto;
  padding: calc(0.4rem * var(--fit, 1)) 0.2rem 0;
  border-top: 1px solid var(--border);
}

.nexim-cta-services li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: calc(clamp(0.48rem, 0.95cqw, 0.6rem) * var(--fit, 1));
  color: #1e3a8a;
  font-weight: 700;
  line-height: 1.2;
}

.nexim-cta-services .icon {
  width: 1.15em;
  height: 1.15em;
  color: #2b58cc;
}

.nexim-close-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: calc(0.2rem * var(--fit, 1));
}

.nexim-speaker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: start;
}

.nexim-speaker img {
  width: calc(2.4rem * var(--fit, 1));
  height: calc(2.4rem * var(--fit, 1));
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid #2b58cc;
}

.nexim-speaker strong {
  display: block;
  font-size: calc(0.78rem * var(--fit, 1));
  color: var(--text);
}

.nexim-speaker span {
  display: block;
  font-size: calc(0.62rem * var(--fit, 1));
  color: var(--text-muted);
}

.nexim-close-note {
  font-size: calc(0.68rem * var(--fit, 1));
  color: var(--text-soft);
  margin: 0;
}

@media (max-width: 900px) {
  .nexim-cta-grid { grid-template-columns: 1fr; }
  .nexim-close-foot { flex-direction: column; }
}

/* Lifecycle horizontal cards */
.life-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  flex: 1;
}

.life-steps.seven-col {
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
}

.life-steps.seven-col .life-step {
  padding: 0.75rem 0.5rem;
}

.life-steps.seven-col .life-step h4 {
  font-size: var(--s-xs);
}

.life-steps.seven-col .life-step .en-sub {
  display: block;
  font-size: clamp(0.52rem, 0.95cqw, 0.62rem);
  margin: 0.15rem 0 0.25rem;
  opacity: 0.85;
}

.life-step {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 0.85rem;
  position: relative;
  overflow: hidden;
}

.life-step::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
}

.life-step:nth-child(2)::before { background: var(--secondary); }
.life-step:nth-child(3)::before { background: var(--accent); }
.life-step:nth-child(4)::before { background: #6366f1; }
.life-step:nth-child(5)::before { background: var(--primary); }
.life-step:nth-child(6)::before { background: var(--secondary); }
.life-step:nth-child(7)::before { background: var(--accent); }
.life-step:nth-child(8)::before { background: #6366f1; }

.life-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.life-step h4 {
  font-size: var(--s-md);
  margin-bottom: 0.35rem;
}

.life-step p {
  font-size: var(--s-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Bars / metrics */
.metric-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  justify-content: center;
  flex: 1;
}

.metric-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  gap: 0.75rem;
  align-items: center;
}

.metric-row span {
  font-size: 0.82rem;
  font-weight: 600;
}

.bar-track {
  height: 12px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #22d3ee);
  width: 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide.active .bar-fill { width: var(--w); }

.bar-fill.secondary { background: linear-gradient(90deg, var(--secondary), #fbbf24); }
.bar-fill.accent { background: linear-gradient(90deg, var(--accent), #34d399); }
.bar-fill.danger { background: linear-gradient(90deg, var(--danger), #fb7185); }

/* =========================================================
   Toolbar
   ========================================================= */

.toolbar {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 30;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 40px;
  padding: 0 0.85rem;
  border-radius: 11px;
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.tool-btn.primary {
  background: var(--primary);
  color: #fff;
}

.tool-btn.primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.tool-btn.icon-only {
  width: 40px;
  padding: 0;
  justify-content: center;
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.progress-wrap {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.progress-bar {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.slide-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  min-width: 72px;
  text-align: center;
}

.slide-counter span { color: var(--primary); }

/* =========================================================
   Presenter Mode
   ========================================================= */

.presenter-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  z-index: 100;
  display: none;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 1rem;
  padding: 1rem;
  color: #fff;
  direction: rtl;
}

.presenter-overlay.open {
  display: grid;
}

.presenter-current,
.presenter-next {
  background: #1e293b;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.presenter-label {
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
}

.presenter-preview {
  flex: 1;
  background: var(--bg);
  margin: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  color: var(--text);
}

.presenter-preview .slide {
  position: absolute;
  inset: 0;
  transform: scale(0.55);
  transform-origin: top right;
  width: 181.8%;
  height: 181.8%;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  padding: 2rem;
}

.presenter-notes {
  grid-column: 1 / -1;
  background: #1e293b;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  max-height: 180px;
  overflow: auto;
}

.presenter-notes h3 {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.presenter-notes p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.presenter-controls {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 5;
}

.presenter-controls .tool-btn {
  background: #334155;
  color: #fff;
}

/* =========================================================
   PDF Export overlay
   ========================================================= */

.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  place-items: center;
}

.export-overlay.show {
  display: grid;
}

.export-card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 2.2rem;
  width: min(400px, 92vw);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.export-card h3 {
  font-size: 1.2rem;
  margin: 1rem 0 0.4rem;
}

.export-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.export-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.export-progress {
  height: 8px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
}

.export-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s ease;
}

/* Offscreen render for PDF — keep in viewport so html2canvas paints correctly */
.pdf-render-root {
  position: fixed;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  pointer-events: none;
  z-index: 150; /* below export overlay (200), above app */
  opacity: 0;
  overflow: hidden;
}

body.pdf-exporting .pdf-render-root {
  opacity: 1;
}

.pdf-page {
  width: 1920px;
  height: 1080px;
  background: #F8FAFC;
  overflow: hidden;
  position: relative;
  font-family: var(--font);
  direction: rtl;
  color: #0F172A;
}

.pdf-page .slide,
.pdf-page .slide.active,
.pdf-page .slide * {
  animation: none !important;
  transition: none !important;
}

.pdf-page .slide {
  position: absolute !important;
  inset: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: none;
  padding: 2.8rem 3.4rem 2.4rem;
  background: #F8FAFC;
}

.pdf-page .anim,
.pdf-page .anim-d1,
.pdf-page .anim-d2,
.pdf-page .anim-d3,
.pdf-page .anim-d4,
.pdf-page .anim-d5,
.pdf-page .anim-d6 {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.pdf-page .bar-fill {
  transition: none !important;
}

.pdf-page .acc-item .acc-panel,
.pdf-page .acc-item.open .acc-panel {
  max-height: none !important;
  padding-bottom: 1rem !important;
  overflow: visible !important;
}

/* =========================================================
   Mobile sidebar toggle
   ========================================================= */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  place-items: center;
  color: var(--primary);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(100%);
}

body.fullscreen-mode .sidebar,
body.fullscreen-mode .toolbar {
  display: none;
}

body.fullscreen-mode .app {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

body.fullscreen-mode .stage-wrap {
  grid-column: 1;
  padding: 0;
}

body.fullscreen-mode .stage {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  :root { --sidebar-w: 180px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .life-steps { grid-template-columns: repeat(2, 1fr); }
  .speaker-layout { grid-template-columns: 1fr; }
  .cover-decor { display: none; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 82vw);
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle { display: grid; }

  .stage-wrap {
    grid-column: 1;
    padding: 3.5rem 0.75rem 0.5rem;
  }

  .toolbar {
    grid-column: 1;
    padding: 0 0.6rem;
    gap: 0.35rem;
  }

  .tool-btn span.label { display: none; }
  .progress-wrap { max-width: 120px; }

  .slide { padding: clamp(1.2rem, 3cqh, 1.6rem) clamp(1rem, 3.5cqw, 1.4rem) clamp(1rem, 2.5cqh, 1.6rem); }
  .grid-2, .grid-3, .compare { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .pipeline { flex-wrap: wrap; }
  .pipe-arrow { display: none; }
  .timeline { flex-wrap: wrap; gap: 0.8rem; }
  .timeline::before { display: none; }
  .metric-row { grid-template-columns: 100px 1fr 40px; }
  .presenter-overlay { grid-template-columns: 1fr; }
  .cpmai-footer { font-size: 0.6rem; }
}

/* =========================================================
   Print / PDF friendly
   ========================================================= */

@media print {
  body {
    background: #fff !important;
    overflow: visible !important;
    height: auto !important;
  }

  .sidebar,
  .toolbar,
  .sidebar-toggle,
  .export-overlay,
  .presenter-overlay {
    display: none !important;
  }

  .app {
    display: block;
    height: auto;
  }

  .stage-wrap {
    padding: 0;
  }

  .stage {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto;
    box-shadow: none;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .slides {
    position: static;
  }

  .slide {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    page-break-after: always;
    break-after: page;
    width: 297mm;
    height: 210mm;
    padding: 18mm;
    border: 1px solid #e2e8f0;
    margin: 0 auto 8mm;
  }

  .slide:last-child {
    page-break-after: auto;
  }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-1 { flex: 1; min-height: 0; }
.center { display: grid; place-items: center; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.mini-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--text-muted);
}

.mini-tag.tag-key {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(11, 132, 181, 0.28);
}

.speaker-cred.cred-key {
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.two-col-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  flex: 1;
}

.diagram-svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}

.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* =========================================================
   Executive Keynote Extensions (content elevation)
   ========================================================= */

.mega-stat-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.mega-stat {
  background: linear-gradient(155deg, #0B84B5 0%, #086a91 55%, #0e7490 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 20px 40px rgba(11, 132, 181, 0.28);
  position: relative;
  overflow: hidden;
}

.mega-stat::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  left: -40px;
  bottom: -50px;
}

.mega-stat .num {
  font-size: var(--s-mega);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.mega-stat .num-suffix {
  font-size: 0.55em;
  font-weight: 800;
}

.mega-stat p {
  font-size: var(--s-md);
  line-height: 1.55;
  opacity: 0.95;
  max-width: 28ch;
}

.mega-stat .source {
  margin-top: 1rem;
  font-size: var(--s-xs);
  opacity: 0.75;
  font-weight: 600;
}

.insight-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-content: center;
}

.insight-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.insight-chip .chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--danger-soft);
  color: var(--danger);
}

.insight-chip h4 {
  font-size: var(--s-md);
  margin-bottom: 0.15rem;
}

.insight-chip p {
  font-size: var(--s-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
  flex: 1;
  align-content: center;
}

.why-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.75rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.why-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.why-card .why-num {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-soft);
}

.why-card .card-icon {
  margin: 0.4rem auto 0.7rem;
}

.why-card h3 {
  font-size: var(--s-md);
  margin-bottom: 0.35rem;
}

.why-card p {
  font-size: var(--s-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.apple-statement {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 920px;
}

.apple-statement .line-main {
  font-size: clamp(1.85rem, 4.2cqw, 3rem);
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.apple-statement .line-main em {
  font-style: normal;
  color: var(--primary);
}

.apple-statement .line-sub {
  font-size: clamp(1.05rem, 2.2cqw, 1.45rem);
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.4rem;
  max-width: 36ch;
}

.cpmai-intro {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-md);
  max-width: 520px;
}

.cpmai-intro strong {
  display: block;
  font-size: var(--s-md);
  margin-bottom: 0.15rem;
}

.cpmai-intro span {
  font-size: var(--s-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.journey-track {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  flex: 1;
  padding-top: 0.5rem;
}

.journey-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.journey-node .jn-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--primary);
  display: grid;
  place-items: center;
  color: var(--primary);
  margin-bottom: 0.55rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.journey-node:nth-child(odd) .jn-icon { border-color: var(--primary); color: var(--primary); }
.journey-node:nth-child(even) .jn-icon { border-color: var(--secondary); color: var(--secondary); }
.journey-node:last-child .jn-icon {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.journey-node h4 {
  font-size: var(--s-sm);
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.journey-node p {
  font-size: var(--s-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

.journey-arrow {
  align-self: flex-start;
  margin-top: 1rem;
  color: var(--text-soft);
  flex-shrink: 0;
}

.journey-caption {
  margin-top: 1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  flex: 1;
  align-content: center;
}

.roadmap-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.roadmap-step::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
}

.roadmap-step:nth-child(2)::before { background: #0891b2; }
.roadmap-step:nth-child(3)::before { background: var(--secondary); }
.roadmap-step:nth-child(4)::before { background: var(--accent); }
.roadmap-step:nth-child(5)::before { background: #6366f1; }

.roadmap-step .rs-label {
  font-size: var(--s-xs);
  font-weight: 800;
  color: var(--text-soft);
  margin-bottom: 0.45rem;
}

.roadmap-step h3 {
  font-size: var(--s-lg);
  margin-bottom: 0.35rem;
}

.roadmap-step p {
  font-size: var(--s-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.principles-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.principle {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-weight: 800;
  font-size: var(--s-md);
}

.principle:nth-child(2) { background: var(--secondary-soft); color: #9a6810; }
.principle:nth-child(3) { background: var(--accent-soft); color: #067a64; }
.principle:nth-child(4) { background: rgba(99, 102, 241, 0.12); color: #4338ca; }

.quote-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 1rem;
}

.quote-mark {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 0.6;
  opacity: 0.35;
  margin-bottom: 0.8rem;
}

.quote-text {
  font-size: clamp(1.4rem, 3.2cqw, 2.15rem);
  font-weight: 800;
  line-height: 1.45;
  color: var(--text);
  max-width: 22ch;
  margin-bottom: 1.2rem;
}

.quote-text .break {
  display: block;
  margin-top: 0.35rem;
  color: var(--primary);
}

.quote-attr {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.iter-cycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  flex: 1;
  align-content: center;
}

.iter-node {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.iter-node .card-icon {
  margin: 0 auto 0.55rem;
}

.iter-node h4 {
  font-size: var(--s-md);
  margin-bottom: 0.25rem;
}

.iter-node p {
  font-size: var(--s-sm);
  color: var(--text-muted);
}

.iter-center {
  grid-column: 2;
  background: linear-gradient(145deg, var(--primary), #0891b2);
  color: #fff;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(11, 132, 181, 0.3);
}

.iter-center h4,
.iter-center p { color: #fff; }
.iter-center p { opacity: 0.9; }

.roi-dash {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.roi-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.roi-kpi .kpi-val {
  font-size: clamp(1.35rem, 3.5cqw, 1.85rem);
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.roi-kpi .kpi-val.gold { color: var(--secondary); }
.roi-kpi .kpi-val.green { color: var(--accent); }
.roi-kpi .kpi-val.rose { color: var(--danger); }

.roi-kpi .kpi-label {
  font-size: var(--s-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.roi-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: center;
}

.case-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
  flex: 1;
}

.case-board.six-col {
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}

.case-board.six-col .case-card {
  padding: 0.75rem 0.7rem;
}

.case-board.six-col .case-card h3 {
  font-size: var(--s-sm);
}

.case-board.six-col .case-card .cc-row,
.case-board.six-col .case-card .cc-out {
  font-size: clamp(0.6rem, 1.15cqw, 0.72rem);
}

.case-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease;
}

.case-card:hover { transform: translateY(-4px); }

.case-card .cc-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.case-card h3 {
  font-size: var(--s-sm);
  font-weight: 800;
}

.case-card .cc-row {
  font-size: var(--s-xs);
  color: var(--text-muted);
  line-height: 1.35;
}

.case-card .cc-row strong {
  color: var(--text);
  font-weight: 700;
}

.case-card .cc-out {
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-size: var(--s-xs);
  font-weight: 800;
  color: var(--accent);
}

.story-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  border-right: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0;
  font-size: calc(0.78rem * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.4;
  flex: 0 0 auto;
  min-height: 0;
}

.story-banner strong {
  color: var(--primary-dark);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.mini-stats.four-col {
  grid-template-columns: repeat(4, 1fr);
}

.mini-stats.four-col .ms-val {
  font-size: var(--s-lg);
}

/* CPMAI six-phase track */
.life-steps.six-col {
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.life-steps.six-col .life-step {
  padding: 0.8rem 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

/* Cards that should breathe rather than sit pinned to the top */
.grid-4.center-cards .card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: calc(0.15rem * var(--fit, 1));
}

.life-steps.six-col .life-step h4 {
  font-size: var(--s-sm);
}

.life-steps.six-col .life-step p {
  font-size: clamp(0.6rem, 1.15cqw, 0.7rem);
}

/* Value vs feasibility prioritisation matrix */
.matrix-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: calc(0.4rem * var(--fit, 1));
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
}

.matrix-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(0.45rem * var(--fit, 1)) calc(0.65rem * var(--fit, 1));
  display: flex;
  flex-direction: column;
  gap: calc(0.12rem * var(--fit, 1));
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.matrix-cell::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--border);
}

.matrix-cell.win::before { background: var(--accent); }
.matrix-cell.later::before { background: var(--secondary); }
.matrix-cell.quick::before { background: var(--primary); }
.matrix-cell.drop::before { background: var(--danger); }

.matrix-cell .mx-tag {
  font-size: var(--s-xs);
  font-weight: 800;
  color: var(--text-soft);
  letter-spacing: 0.03em;
  flex: 0 0 auto;
}

.matrix-cell h4 {
  font-size: var(--s-sm);
  font-weight: 800;
  flex: 0 0 auto;
  line-height: 1.25;
}

.matrix-cell p {
  font-size: calc(clamp(0.55rem, 1.05cqw, 0.68rem) * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.mini-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: calc(0.45rem * var(--fit, 1)) calc(0.5rem * var(--fit, 1));
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.mini-stat .ms-val {
  font-size: calc(1.05rem * var(--fit, 1));
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.mini-stat .ms-label {
  font-size: calc(0.62rem * var(--fit, 1));
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  font-weight: 600;
}

.speaker-layout-v2 {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  flex: 1;
}

.speaker-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

@media (max-width: 1100px) {
  .why-grid,
  .roadmap,
  .case-board,
  .principles-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .journey-track { flex-wrap: wrap; }
  .journey-arrow { display: none; }
  .mega-stat-row,
  .roi-panel,
  .speaker-layout-v2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .why-grid,
  .roadmap,
  .case-board,
  .roi-dash,
  .iter-cycle,
  .principles-banner,
  .mini-stats,
  .speaker-meta-grid {
    grid-template-columns: 1fr;
  }
  .iter-center { grid-column: auto; }
}

/* =========================================================
   Language toggle (عربي / English)
   ========================================================= */

.lang-btn .lang-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.lang-btn .lang-opt {
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.lang-btn .lang-opt.active {
  color: var(--primary);
}

.lang-btn .lang-sep {
  color: var(--border);
}

.lang-btn:hover .lang-opt.active {
  color: var(--primary-dark);
}

/* English mode: LTR reading order inside the stage */
body.lang-en .stage {
  direction: ltr;
}

/* Flow arrows point right-to-left in Arabic; flip them for LTR */
body.lang-en .pipe-arrow,
body.lang-en .journey-arrow {
  transform: rotate(180deg);
}

/* Inline Arabic-to-English helpers become redundant once translated */
body.lang-en .en-sub {
  display: none;
}

body.lang-en .slide-en-term,
body.lang-en .cover-en-term {
  direction: ltr;
}

body.lang-en .story-banner {
  border-right: none;
  border-left: 3px solid var(--primary);
  border-radius: 12px 0 0 12px;
  background: linear-gradient(270deg, var(--primary-soft), transparent);
}


/* ── Density guards ───────────────────────────────────────────────
   Three slides carry the most content per square inch, so at projection
   scale their grids try to grow past the slide body. These rules keep each
   grid inside the stage instead of letting a row size to its content. */
/* The speaker column was pinned at 260px while its text scaled with the root,
   which squeezed the name onto three lines. Sizing it in rem keeps the column
   and its contents in the same proportion at every scale. */
.speaker-layout-v2 {
  grid-template-columns: 15rem 1fr;
  min-height: 0;
}

.speaker-card {
  min-height: 0;
  justify-content: center;
  padding: 1.1rem 1rem;
}

/* The certifications card carries eight chips, so it needs the taller row. */
.speaker-meta-grid {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.22fr);
  min-height: 0;
}

.speaker-meta-grid > .card {
  min-height: 0;
  padding: 0.8rem 0.95rem;
}

.slide-body.grid-2 > .grid-3 { min-height: 0; }
.slide-body.grid-2 > .grid-3 > .card { min-height: 0; padding: 0.85rem 1rem; }

.check-grid { min-height: 0; }
.check-item { padding: 0.55rem 0.8rem; }

/* Sizing the tick box in em keeps it wrapped around its digit; at 22px fixed
   the number outgrew the box as soon as the type scaled up. */
.check-box {
  width: 1.35em;
  height: 1.35em;
  line-height: 1;
}

/* The stat panel and the chip column share one row, so both need to be free to
   shrink rather than pushing their content past the row. */
/* Slides whose content is shorter than the stage used to hang from the title
   with all the slack pooled at the bottom. Keep top-aligned so autofit can
   measure overflow reliably — spare space sits below the last block. */
.slide-body { justify-content: flex-start; }
.slide-body[class*="grid-"] { align-content: start; }

/* Both comparison panels hold three short lines, so stretching them to the full
   body height left a third of each card empty below the last bullet. */
.compare { align-items: center; }

/* Padding is authored in rem too, so at projection scale the stock values turn
   into ~30px of air per card and crowd out the text they surround. Type should
   scale with the room; the padding around it does not have to. */
@media (min-width: 1800px) {
  .card { padding: 0.7rem 0.8rem; }
  .matrix-cell { padding: 0.5rem 0.7rem; }
  .feature-row { padding: 0.55rem 0.75rem; }
  .insight-chip { padding: 0.5rem 0.7rem; }
  .life-steps .life-step { padding: 0.55rem 0.45rem; }
  .story-banner { padding: 0.45rem 0.75rem; }
  .roi-kpi { padding: 0.7rem 0.65rem; }
  .pipe-step { padding: 0.55rem 0.45rem; }
}

/* line-height:1 on a 50px numeral leaves the glyphs taller than their own box. */
.mega-stat .num { line-height: 1.12; }
.mega-stat { padding: 1.2rem 1.2rem; min-height: 0; }
.insight-stack { min-height: 0; gap: 0.4rem; }
.insight-chip { padding: 0.5rem 0.75rem; }
.insight-chip .chip-icon { width: 1.6em; height: 1.6em; }

/* Equal-height step cards hold unequal amounts of text, so centring each one
   individually left the phase labels sitting on six different baselines. */
.life-steps .life-step,
.life-steps.six-col .life-step,
.life-steps.seven-col .life-step { justify-content: flex-start; }

/* Let the row size to its tallest card and sit at the start of leftover space. */
.life-steps { align-content: start; }

/* Dense multi-block bodies: grids share space without stretching into overlap. */
.slide-body > .grid-3:not(:only-child),
.slide-body > .grid-4:not(:only-child) {
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.slide-body > .pipeline {
  flex: 0 0 auto;
}

.slide-body > .story-banner,
.slide-body > .mini-stats,
.slide-body > .roi-dash,
.slide-body > .arch {
  flex: 0 0 auto;
}

.grid-4.center-cards .card {
  justify-content: flex-start;
  gap: calc(0.15rem * var(--fit, 1));
  padding: calc(0.55rem * var(--fit, 1)) calc(0.65rem * var(--fit, 1));
}

.grid-4.center-cards .card-icon {
  width: calc(32px * var(--fit, 1));
  height: calc(32px * var(--fit, 1));
  margin-bottom: calc(0.25rem * var(--fit, 1));
}

.grid-4.center-cards .card p {
  font-size: calc(clamp(0.55rem, 1.15cqw, 0.68rem) * var(--fit, 1));
  line-height: 1.3;
}

.roi-dash {
  gap: calc(0.4rem * var(--fit, 1));
  margin-bottom: calc(0.25rem * var(--fit, 1));
  margin-top: calc(0.2rem * var(--fit, 1)) !important;
}

.arch {
  margin-top: calc(0.15rem * var(--fit, 1)) !important;
}

.dense-roi > .grid-3 {
  flex: 0 1 auto;
}

.dense-roi .card {
  padding: calc(0.5rem * var(--fit, 1)) calc(0.65rem * var(--fit, 1));
}

.dense-roi .card-icon {
  width: calc(30px * var(--fit, 1));
  height: calc(30px * var(--fit, 1));
  margin-bottom: calc(0.25rem * var(--fit, 1));
}

.dense-roi .roi-kpi .kpi-val {
  font-size: calc(clamp(0.95rem, 2.4cqw, 1.35rem) * var(--fit, 1));
}

.dense-roi .arch-box {
  padding: calc(0.4rem * var(--fit, 1)) calc(0.3rem * var(--fit, 1));
  font-size: var(--s-xs);
}


/* Three drift items in a two-column grid left a hole in the second row.
   Stacking them mirrors the three monitoring cards opposite. */
.two-col-list { grid-template-columns: 1fr; }
