@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');

:root {
  /* Brand — primary */
  --brand-navy: #213d78;
  --brand-blue-deep: #176199;
  --brand-blue-deep-muted: #1761992e;
  --brand-blue: #1782ba;
  --brand-green: #0f944d;
  --brand-green-bright: #17ab57;

  /* Brand — secondary */
  --brand-teal: #0abab5;
  --brand-teal-dark: #0f7075;
  --brand-off-white: #ffffff;
  --brand-gray: #e5e5e5;

  /* Semantic — primary is navy (#213D78) */
  --color-primary: var(--brand-navy);
  --color-primary-dark: var(--brand-blue-deep);
  --color-primary-light: var(--brand-off-white);
  --color-primary-muted: var(--brand-blue-deep);
  --color-accent: var(--brand-teal);
  --color-accent-dark: var(--brand-teal-dark);
  --color-success: var(--brand-green-bright);
  --color-success-dark: var(--brand-green);

  /* Legacy aliases (used across components) */
  --ksa-green: var(--color-primary);
  --ksa-green-dark: var(--color-primary-dark);
  --ksa-green-light: var(--color-primary-light);
  --ksa-green-muted: var(--color-primary-muted);

  --border: var(--brand-gray);
  --border-strong: var(--brand-gray);
  --text: #000000;
  --text-muted: #000000;
  --text-subtle: #000000;
  --color-bg: var(--brand-off-white);
  --color-surface: #ffffff;
  --color-danger: var(--brand-navy);
  --color-warning: var(--brand-blue);
  --shadow-xs: 0 1px 2px rgb(33 61 120 / 0.04);
  --shadow-sm: 0 1px 3px rgb(33 61 120 / 0.05), 0 1px 2px rgb(33 61 120 / 0.03);
  --shadow-md: 0 4px 16px rgb(33 61 120 / 0.06);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --motion-fast: 150ms;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --demo-bar-h: 0px;
  --journey-timeline-h: 3.75rem;
}

* {
  font-family: 'Cairo', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-surface);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.app-layout {
  background: var(--color-bg);
}

body:has(.app-shell) {
  height: 100vh;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--brand-gray);
  border-radius: 999px;
}

/* Demo flow bar — hidden for presentation */
.demo-bar {
  display: none;
}

.demo-bar__step {
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-bar__next {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-md);
  background: var(--ksa-green);
  padding: 0.375rem 0.875rem;
  color: #fff;
  flex-shrink: 0;
  font-weight: 600;
  transition: background var(--motion-fast) var(--ease-out);
}
.demo-bar__next:hover {
  background: var(--ksa-green-dark);
}
.demo-bar__next:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: 2px;
}

/* App shell */
body.has-journey-timeline .app-shell {
  height: calc(100vh - var(--demo-bar-h) - var(--journey-timeline-h));
}

.app-shell {
  height: calc(100vh - var(--demo-bar-h));
  min-height: 0;
  overflow: hidden;
}

/* Sidebar — mobile drawer */
.sidebar-backdrop {
  position: fixed;
  inset: var(--demo-bar-h) 0 0 0;
  z-index: 40;
  background: rgb(0 0 0 / 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.sidebar-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-sidebar {
  z-index: 45;
  background: var(--color-surface);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-sidebar > .sidebar-brand,
.app-sidebar > .border-b {
  flex-shrink: 0;
}

.app-sidebar > nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-sidebar > .mt-auto,
.app-sidebar > .border-t,
.app-sidebar > .sidebar-footer {
  flex-shrink: 0;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .app-sidebar {
    position: static;
    transform: none !important;
    box-shadow: none;
    max-width: none;
  }
}

@media (max-width: 1023px) {
  .app-sidebar {
    position: fixed;
    top: var(--demo-bar-h);
    bottom: 0;
    inset-inline-start: 0;
    width: 16rem;
    max-width: 85vw;
    border-inline-end: none;
    border-inline-start: 1px solid var(--border);
    box-shadow: -4px 0 24px rgb(0 0 0 / 0.12);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
  }
  .app-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .app-shell > .app-main {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Page header with mobile menu */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.page-header p {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  background: #fff;
}
.sidebar-toggle:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}

@media (min-width: 1024px) {
  .sidebar-toggle {
    display: none;
  }
}

/* Progress bar RTL */
.progress-rtl {
  direction: ltr;
}
.progress-rtl .progress-fill {
  transform-origin: 100% 50%;
}

.showcase-progress-bar {
  direction: rtl;
  overflow: hidden;
}

/* Comprehension vs pattern comparison chart */
.compare-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.compare-chart__axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 9.5rem;
  padding-bottom: 2.25rem;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: end;
}

.compare-chart__plot {
  position: relative;
  height: 9.5rem;
  border-bottom: 1px solid var(--border);
}

.compare-chart__grid {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.compare-chart__grid span {
  display: block;
  border-top: 1px dashed #E5E5E5;
}

.compare-chart__bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5rem;
  height: 100%;
  padding-bottom: 0;
}

.compare-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 4.5rem;
  height: 100%;
  gap: 0.5rem;
}

.compare-bar__track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  flex: 1;
}

.compare-bar__fill {
  width: 100%;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: height 0.4s ease;
}

.compare-bar__fill--understanding {
  background: linear-gradient(180deg, var(--brand-teal) 0%, var(--ksa-green) 100%);
}

.compare-bar__fill--patterns {
  background: #F5F5F5;
  border: 2px solid #1782BA;
  border-bottom: none;
}

.compare-bar__value {
  position: absolute;
  top: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.compare-bar__value--understanding {
  color: var(--ksa-green);
}

.compare-bar__value--patterns {
  color: #1782BA;
}

.compare-bar__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.compare-chart__gap {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  pointer-events: none;
}

.compare-chart__gap-line {
  width: 5.5rem;
  height: 1.75rem;
  border: 1px dashed #1782BA;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
}

.compare-chart__gap-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1782BA;
  background: #fff;
  padding: 0 0.35rem;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.compare-legend__item {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.compare-legend__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.compare-legend__swatch--understanding {
  background: var(--ksa-green);
}

.compare-legend__swatch--patterns {
  background: #F5F5F5;
  border: 2px solid #1782BA;
}

.compare-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.compare-insight {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.compare-insight__label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.compare-insight__value {
  margin-top: 0.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.compare-insight__value--warning {
  color: #1782BA;
}

/* Admin analytics dashboard charts */
.analytics-donut {
  position: relative;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.analytics-donut__hole {
  position: absolute;
  inset: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
}
.analytics-donut__total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.analytics-donut__label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.analytics-legend__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}
.analytics-legend__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  flex-shrink: 0;
}
.analytics-hbar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.analytics-hbar__title {
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.35;
}
.analytics-hbar__value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.analytics-hbar__value--critical {
  color: #0F7075;
}
.analytics-hbar__track {
  height: 0.625rem;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}
.analytics-hbar__fill {
  height: 100%;
  border-radius: 999px;
  background: #213D78;
  transition: width 0.5s ease;
}
.analytics-hbar__fill--critical {
  background: #0F7075;
}
.analytics-sw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
}
.analytics-sw-item--strength {
  border: 1px solid rgb(15 148 77 / 0.25);
  background: rgb(15 148 77 / 0.06);
}
.analytics-sw-item--weakness {
  border: 1px solid rgb(15 112 117 / 0.25);
  background: rgb(15 112 117 / 0.06);
}
.analytics-sw-item__title {
  line-height: 1.35;
  color: var(--text);
}
.analytics-sw-item__score {
  font-weight: 700;
  flex-shrink: 0;
}
.analytics-sw-item--strength .analytics-sw-item__score {
  color: #0F944D;
}
.analytics-sw-item--weakness .analytics-sw-item__score {
  color: #0F7075;
}
.analytics-intel-stack {
  display: flex;
  height: 1.25rem;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.analytics-intel-stack__seg {
  min-width: 2px;
  transition: width 0.5s ease;
}
.analytics-intel-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
}
.analytics-intel-card__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}
.analytics-intel-card__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.analytics-intel-card__pct {
  margin-inline-start: auto;
  font-weight: 700;
  font-size: 1.125rem;
}
.ai-modal__dialog--wide {
  max-width: 36rem;
}
.ai-insight-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
}
.ai-insight-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ai-insight-card__priority {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}
.ai-insight-card__priority--urgent {
  background: rgb(15 112 117 / 0.12);
  color: #0F7075;
}
.ai-insight-card__priority--important {
  background: rgb(23 130 186 / 0.12);
  color: #1782BA;
}
.ai-insight-card__priority--opportunity {
  background: rgb(15 148 77 / 0.12);
  color: #0F944D;
}
.ai-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}
.ai-metric-row__values {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.progress-rtl .showcase-progress-bar {
  direction: ltr;
}
.showcase-progress-bar > .h-full,
.showcase-progress-bar > .progress-fill,
.showcase-progress-bar > .ui-progress__fill,
.showcase-progress-bar > div > .h-full,
.showcase-progress-bar > div > .progress-fill {
  transform: scaleX(0);
  transform-origin: 100% 50%;
  animation: showcaseProgressGrow 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--showcase-delay, 0.35s);
}

@keyframes lock-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.exam-lock-badge {
  animation: lock-pulse 2s ease-in-out infinite;
}

.tab-active {
  color: var(--ksa-green);
  border-bottom: 2px solid var(--ksa-green);
}

.tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar {
  display: none;
}
.tabs-scroll__inner {
  display: flex;
  gap: 1.5rem;
  min-width: max-content;
}

/* AI panel */
.ai-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ai-panel.hidden-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-backdrop {
  position: fixed;
  inset: var(--demo-bar-h) 0 0 0;
  z-index: 48;
  background: rgb(0 0 0 / 0.2);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.ai-backdrop.hidden-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-panel--overlay {
  position: fixed;
  inset: var(--demo-bar-h) 0 0 0;
  z-index: 49;
  width: 100%;
  max-width: 24rem;
  height: calc(100vh - var(--demo-bar-h));
  max-height: calc(100vh - var(--demo-bar-h));
  margin-inline-start: auto;
  box-shadow: -4px 0 24px rgb(0 0 0 / 0.1);
}

.ai-panel__header {
  flex-shrink: 0;
}

.ai-panel__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ai-panel__footer {
  flex-shrink: 0;
}

.ai-config-toast {
  position: fixed;
  top: calc(var(--demo-bar-h) + 1rem);
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  border-radius: 0.75rem;
  border: 1px solid rgb(23 171 87 / 0.35);
  background: var(--ksa-green-muted);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ksa-green);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
}

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ai-modal.hidden {
  display: none;
}
.ai-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
}
.ai-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  max-height: calc(100vh - 2rem);
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.15);
  overflow: hidden;
}
.ai-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.ai-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.ai-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  background: #F5F5F5;
}

/* ── Data tables (admin / tutor lists) ── */
.data-table-section {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.data-table-toolbar__title {
  font-weight: 700;
  color: var(--text);
}
.data-table-toolbar__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.data-table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.data-table-filters__search {
  min-width: 12rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  background: #fff;
}
.data-table-filters__search:focus {
  outline: none;
  border-color: var(--ksa-green);
}
.data-table-filters__select {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  background: #fff;
}
.data-table-filters__select:focus {
  outline: none;
  border-color: var(--ksa-green);
}
.data-table-scroll {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead tr {
  border-bottom: 1px solid var(--border);
  background: #F5F5F5;
}
.data-table th {
  padding: 0.75rem 1rem;
  text-align: start;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: #F5F5F5;
}
.data-table__name {
  font-weight: 600;
  color: var(--text);
}
.data-table__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.data-table__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.data-table__action {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ksa-green);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.data-table__action:hover {
  text-decoration: underline;
}
.data-table__empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.filter-pill {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.filter-pill:hover {
  border-color: var(--ksa-green);
  color: var(--text);
}
.filter-pill.is-active {
  border-color: var(--ksa-green);
  background: var(--ksa-green-muted);
  color: var(--ksa-green);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge--active {
  border-color: rgb(33 61 120 / 0.35);
  background: rgb(33 61 120 / 0.08);
  color: #213D78;
}
.status-badge--inactive {
  border-color: var(--border);
  background: #F5F5F5;
  color: var(--text-muted);
}
.status-badge--risk {
  border-color: rgb(15 112 117 / 0.35);
  background: rgb(15 171 181 / 0.1);
  color: #0F7075;
}
.status-badge--pending {
  border-color: rgb(23 130 186 / 0.35);
  background: rgb(23 130 186 / 0.08);
  color: #1782BA;
}
.status-badge--on-track {
  border-color: rgb(33 61 120 / 0.35);
  background: rgb(33 61 120 / 0.08);
  color: #213D78;
}
.progress-bar-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.progress-bar-inline__track {
  width: 5rem;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}
.progress-bar-inline__fill {
  height: 100%;
  border-radius: 999px;
  background: #213D78;
}
.progress-bar-inline__fill.is-risk {
  background: #0F7075;
}

.ai-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
  overflow-x: auto;
}
.ai-stepper__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-width: 4.5rem;
  text-align: center;
}
.ai-stepper__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ai-stepper__label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.ai-stepper__item.is-active .ai-stepper__num {
  border-color: var(--ksa-green);
  background: var(--ksa-green);
  color: #fff;
}
.ai-stepper__item.is-active .ai-stepper__label {
  color: var(--ksa-green);
  font-weight: 600;
}
.ai-stepper__item.is-done .ai-stepper__num {
  border-color: var(--ksa-green);
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}
.ai-stepper__line {
  flex: 1;
  min-width: 1.5rem;
  height: 2px;
  margin-bottom: 1.25rem;
  background: var(--border);
}
.ai-stepper__line.is-done {
  background: var(--ksa-green);
}

.ai-review-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.ai-review-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.ai-review-row__label {
  min-width: 6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ai-review-row__value {
  flex: 1;
  color: var(--text);
}

.ai-boundary-banner {
  border-radius: 0.75rem;
  border: 1px solid #E5E5E5;
  background: #F5F5F5;
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #000000;
}

.ai-step-monitor {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.75rem;
}

@media (max-width: 1279px) {
  .ai-panel--mobile:not(.hidden-panel):not(.hidden) {
    position: fixed;
    inset-inline-end: 0;
    top: var(--demo-bar-h);
    bottom: 0;
    width: 100%;
    max-width: 24rem;
    height: calc(100vh - var(--demo-bar-h));
    max-height: calc(100vh - var(--demo-bar-h));
    z-index: 49;
  }
}

@media (min-width: 1280px) {
  .ai-panel--dock {
    position: static;
    box-shadow: none;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    height: 100%;
    max-height: 100%;
  }
}

/* Icons */
.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.inline-icon {
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
}

[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  flex-shrink: 0;
}

[dir="rtl"] .icon-send {
  transform: scaleX(-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.nav-link:hover {
  background: var(--ksa-green-muted);
  color: var(--text);
}

.nav-link[aria-current='page'],
.app-sidebar nav a[aria-current='page'],
.app-sidebar nav a.font-medium.text-\[\#213D78\],
.app-sidebar nav a.bg-\[\#F5F5F5\],
.app-sidebar nav a[class*='bg-[#F5F5F5]'] {
  background: rgb(33 61 120 / 0.1);
  color: var(--text);
  font-weight: 600;
}

.nav-link[aria-current='page']:hover,
.app-sidebar nav a[aria-current='page']:hover,
.app-sidebar nav a.font-medium.text-\[\#213D78\]:hover,
.app-sidebar nav a.bg-\[\#F5F5F5\]:hover,
.app-sidebar nav a[class*='bg-[#F5F5F5]']:hover {
  background: rgb(33 61 120 / 0.16);
  color: var(--text);
}

.nav-link[aria-current='page'] [data-lucide],
.app-sidebar nav a[aria-current='page'] [data-lucide],
.app-sidebar nav a.font-medium.text-\[\#213D78\] [data-lucide],
.app-sidebar nav a.bg-\[\#F5F5F5\] [data-lucide] {
  color: var(--ksa-green);
}

.app-sidebar nav a[aria-current='page']:hover [data-lucide],
.app-sidebar nav a.font-medium.text-\[\#213D78\]:hover [data-lucide],
.app-sidebar nav a.bg-\[\#F5F5F5\]:hover [data-lucide] {
  color: var(--brand-blue-deep);
}

.app-sidebar nav a.rounded-xl {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.app-sidebar nav a.rounded-xl:hover {
  background: rgb(33 61 120 / 0.08);
  color: var(--text);
}

.app-sidebar nav a.block.rounded-xl {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.app-sidebar nav a.block.rounded-xl:hover {
  background: var(--ksa-green-muted);
  color: var(--text);
}

.app-sidebar nav a.block.rounded-xl.font-medium,
.app-sidebar nav a.block.rounded-xl.bg-\[\#F5F5F5\] {
  background: rgb(33 61 120 / 0.1);
  color: var(--text);
  font-weight: 600;
}

.app-sidebar nav a.block.rounded-xl.font-medium:hover,
.app-sidebar nav a.block.rounded-xl.bg-\[\#F5F5F5\]:hover {
  background: rgb(33 61 120 / 0.16);
}

/* App layout */
.app-main {
  background: var(--color-bg);
}

.app-main__content {
  max-width: 72rem;
  margin-inline: auto;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .app-main__content {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .app-main__content {
    padding: 2rem;
  }
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 1rem;
}

.sidebar-brand__logo {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  object-fit: contain;
}

.sidebar-brand__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}
.sidebar-nav-item:hover {
  background: rgb(33 61 120 / 0.08);
  color: var(--text);
}
.sidebar-nav-item.is-active {
  background: rgb(33 61 120 / 0.1);
  color: var(--text);
  font-weight: 600;
}
.sidebar-nav-item.is-active:hover {
  background: rgb(33 61 120 / 0.16);
  color: var(--text);
}
.sidebar-nav-item.is-active [data-lucide] {
  color: var(--ksa-green);
}
.sidebar-nav-item.is-active:hover [data-lucide] {
  color: var(--brand-blue-deep);
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.sidebar-footer__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.sidebar-profile {
  order: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.sidebar-profile__avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(145deg, var(--ksa-green-light) 0%, #F5F5F5 100%);
  color: var(--ksa-green);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 0 0 2px var(--color-surface),
    0 1px 3px rgb(23 171 87 / 0.12);
}

.sidebar-profile__info {
  min-width: 0;
  flex: 1;
}

.sidebar-profile__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.sidebar-profile__role {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.sidebar-logout {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-top: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.sidebar-logout [data-lucide] {
  flex-shrink: 0;
  opacity: 0.85;
  transition: color var(--motion-fast) var(--ease-out);
}

.sidebar-logout:hover {
  background: rgb(33 61 120 / 0.06);
  color: var(--color-danger);
}

.sidebar-logout:hover [data-lucide] {
  color: var(--color-danger);
}

.sidebar-logout:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: -2px;
}

.sidebar-logout:active {
  background: rgb(33 61 120 / 0.1);
}

.course-cards-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .course-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .course-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.course-card-link {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--color-surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}
.course-card-link:hover {
  border-color: rgb(23 171 87 / 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.course-card-link:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: 2px;
}
.course-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand-teal-dark) 0%, var(--brand-green) 50%, var(--brand-green-bright) 100%);
}
.course-card__thumb--muted {
  background: linear-gradient(135deg, #176199 0%, #1782BA 100%);
}
.course-card__thumb--scheduled {
  background: linear-gradient(135deg, var(--brand-blue-deep) 0%, var(--brand-blue) 40%, var(--brand-teal) 100%);
}
.course-card__status {
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgb(255 255 255 / 0.92);
  color: var(--ksa-green);
}
.course-card__status.is-warning {
  color: #1782BA;
}
.course-card__status.is-muted {
  color: var(--text-muted);
}
.course-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.125rem;
}
.course-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}
.course-card__desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.course-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.course-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.course-card__footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.course-card__progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.course-card__progress-track {
  height: 0.375rem;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}
.course-card__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ksa-green);
}
.course-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ksa-green);
}

.course-detail-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .course-detail-grid {
    grid-template-columns: 1fr 20rem;
  }
}

.course-sticky-card {
  position: sticky;
  top: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 24px rgb(0 0 0 / 0.06);
  overflow: hidden;
}

.course-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-blue-deep) 45%, var(--brand-green) 100%);
}
.course-preview__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-preview__play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: var(--ksa-green);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.15);
}

.course-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.course-meta-row__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.course-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.course-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.course-pill:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}
.course-pill.is-active {
  border-color: var(--ksa-green);
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  font-weight: 600;
}

.course-accordion {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.course-accordion__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.course-accordion__expand {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ksa-green);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.course-accordion__expand:hover {
  text-decoration: underline;
}

.accordion-section {
  border-bottom: 1px solid var(--border);
}
.accordion-section:last-child {
  border-bottom: none;
}
.accordion-section__trigger {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  text-align: start;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.accordion-section__trigger:hover {
  background: var(--ksa-green-muted);
}
.accordion-section__trigger[aria-expanded="true"] {
  background: var(--ksa-green-muted);
}
.accordion-section__title {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.accordion-section__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.accordion-section__trigger [data-lucide='chevron-down'] {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-section__trigger[aria-expanded='true'] [data-lucide='chevron-down'] {
  transform: rotate(180deg);
}
.accordion-section__body {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: #fff;
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s ease;
}
.accordion-section__body.is-open {
  max-height: 32rem;
  border-top-color: var(--border);
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 0.75rem 2.5rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.lesson-row:last-child {
  border-bottom: none;
}
.lesson-row:hover {
  background: var(--ksa-green-muted);
}
.lesson-row.is-current {
  background: var(--ksa-green-muted);
}
.lesson-row.is-locked {
  opacity: 0.55;
  pointer-events: none;
}
.lesson-row--phase {
  background: #F5F5F5;
  cursor: default;
  pointer-events: none;
}
.lesson-row--phase:hover {
  background: #F5F5F5;
}
.lesson-row__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.lesson-row__icon.is-done {
  color: var(--ksa-green);
}
.lesson-row__title {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.lesson-row__duration {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-ring {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.progress-ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}
.progress-ring__fill {
  fill: none;
  stroke: var(--ksa-green);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-ring__fill.is-muted {
  stroke: #000000;
}

.course-includes {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.course-includes__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.course-includes__item [data-lucide] {
  color: var(--ksa-green);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--ksa-green);
}
.breadcrumb__sep {
  color: #000000;
}

.locked-course-panel {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 3rem 2rem;
  text-align: center;
}

@media (max-width: 1023px) {
  .course-sticky-card {
    position: static;
  }
}

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* ── UI system: simple, clean surfaces ── */

.ui-surface {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.ui-surface--pad {
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .ui-surface--pad {
    padding: 1.5rem;
  }
}

.ui-stat {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1.25rem;
}

.ui-stat__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.ui-stat__value {
  margin-top: 0.375rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ui-stat__value.is-brand {
  color: var(--ksa-green);
}

.ui-stat__value.is-danger {
  color: var(--color-danger);
}

.ui-stat__value.is-warning {
  color: var(--color-warning);
}

.ui-stat__hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ui-section-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ui-eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--ksa-green);
  background: var(--ksa-green-light);
  padding: 0.125rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ksa-green);
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  transition:
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.ui-btn:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: 2px;
}

.ui-btn--primary {
  background: var(--ksa-green);
  color: #fff;
}

.ui-btn--primary:hover {
  background: var(--ksa-green-dark);
}

.ui-btn--secondary {
  border: 1px solid var(--ksa-green);
  background: var(--color-surface);
  color: var(--ksa-green);
}

.ui-btn--secondary:hover {
  background: var(--ksa-green-light);
}

.ui-btn--ghost {
  border: 1px solid var(--border);
  background: var(--color-surface);
  color: var(--text);
}

.ui-btn--ghost:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--color-surface);
  padding: 0.125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.ui-badge--success {
  border-color: rgb(23 171 87 / 0.35);
  color: var(--ksa-green);
}

.ui-badge--warning {
  border-color: #E5E5E5;
  color: var(--color-warning);
}

.ui-badge--danger {
  border-color: #E5E5E5;
  color: var(--color-danger);
}

.ui-badge--brand {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}

.ui-field {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--color-surface);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.ui-field::placeholder {
  color: var(--text-subtle);
}

.ui-field:hover {
  border-color: var(--border-strong);
}

.ui-field:focus {
  border-color: var(--ksa-green);
  outline: none;
  box-shadow: 0 0 0 3px rgb(23 171 87 / 0.12);
}

.ui-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.ui-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.ui-list-row:first-child {
  padding-top: 0;
}

.ui-list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ui-progress {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-bg);
}

.ui-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ksa-green);
}

.ui-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Auto-polish legacy Tailwind cards in app views */
.app-main .rounded-2xl.border,
.app-main section.rounded-2xl {
  border-color: var(--border) !important;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.app-main .divide-y.divide-\[\#E5E5E5\] > * {
  border-color: var(--border) !important;
}

/* Login page */
body.has-journey-timeline .login-page {
  min-height: calc(100vh - var(--demo-bar-h) - var(--journey-timeline-h));
}

.login-page {
  min-height: calc(100vh - var(--demo-bar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgb(33 61 120 / 0.1), transparent),
    linear-gradient(180deg, rgb(33 61 120 / 0.04) 0%, var(--color-bg) 45%);
}

.login-demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--ksa-green);
  border-radius: var(--radius-lg);
  background: var(--ksa-green-light);
}

.login-demo-banner__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ksa-green);
  color: #fff;
}

.login-demo-banner__text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.login-demo-banner__text p {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.login-demo-cta {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1rem 1rem;
  border: 2px solid var(--ksa-green);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 8px 28px rgb(33 61 120 / 0.12);
}

.login-demo-cta__header {
  position: relative;
  margin-bottom: 1rem;
  text-align: center;
}

.login-demo-cta__pulse {
  position: absolute;
  top: -0.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ksa-green);
  animation: loginCtaPulse 1.8s ease-in-out infinite;
}

@keyframes loginCtaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(33 61 120 / 0.45); }
  50% { box-shadow: 0 0 0 10px rgb(33 61 120 / 0); }
}

.login-demo-cta__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.login-demo-cta__subtitle {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-panel--demo {
  position: relative;
  opacity: 0.72;
}

.login-panel__demo-tag {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--border);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.login-panel__form {
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 26rem;
}

.login-brand {
  margin-bottom: 2rem;
  text-align: center;
}

.login-brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.login-brand__logo {
  display: block;
  width: min(100%, 16rem);
  height: auto;
  object-fit: contain;
}

.login-brand__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.login-brand__subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-panel {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.login-panel__title {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.login-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.login-role {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--color-surface);
  padding: 1rem 0.75rem;
  text-align: center;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.login-role:hover {
  border-color: var(--ksa-green);
  box-shadow: var(--shadow-sm);
}

.login-role:focus-visible {
  outline: 2px solid var(--ksa-green);
  outline-offset: 2px;
}

.login-role__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.login-role__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.login-roles--primary {
  gap: 0.875rem;
}

.login-role--cta {
  border-width: 2px;
  border-color: var(--ksa-green);
  padding: 1.1rem 0.65rem;
  background: var(--ksa-green-light);
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out),
    background var(--motion-fast) var(--ease-out);
}

.login-role--cta:hover {
  border-color: var(--ksa-green-dark);
  background: #fff;
  box-shadow: 0 6px 20px rgb(33 61 120 / 0.16);
  transform: translateY(-2px);
}

.login-role--cta .login-role__icon {
  width: 3rem;
  height: 3rem;
}

.login-role__hint {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ksa-green);
}

/* Showcase animations */
@keyframes showcaseFadeUp {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes showcaseSlideInEnd {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes showcaseProgressGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes showcasePulseCta {
  0%, 100% { box-shadow: 0 0 0 0 rgb(23 171 87 / 0.35); }
  50% { box-shadow: 0 0 0 6px rgb(23 171 87 / 0); }
}

@keyframes showcaseFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.showcase-fade-up {
  animation: showcaseFadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: var(--showcase-delay, 0s);
}

.showcase-fade-in {
  animation: showcaseFadeIn 0.5s ease both;
  animation-delay: var(--showcase-delay, 0s);
}

.showcase-scale-in {
  animation: showcaseScaleIn 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  animation-delay: var(--showcase-delay, 0s);
}

.showcase-slide-in {
  animation: showcaseSlideInEnd 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: var(--showcase-delay, 0s);
}

.showcase-page-enter {
  animation: showcaseFadeIn 0.4s ease both;
}

.showcase-on-scroll {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.showcase-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.showcase-stagger > * {
  animation: showcaseFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.showcase-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.showcase-stagger > *:nth-child(2) { animation-delay: 0.12s; }
.showcase-stagger > *:nth-child(3) { animation-delay: 0.19s; }
.showcase-stagger > *:nth-child(4) { animation-delay: 0.26s; }
.showcase-stagger > *:nth-child(5) { animation-delay: 0.33s; }
.showcase-stagger > *:nth-child(6) { animation-delay: 0.4s; }

.showcase-pulse-cta {
  animation: showcasePulseCta 2.5s ease-in-out infinite;
}

.showcase-float {
  animation: showcaseFloat 3s ease-in-out infinite;
}

.showcase-hover-lift {
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s ease,
    border-color 0.2s ease;
}
.showcase-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tab-panel-enter {
  animation: showcaseFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

[data-tab-panel]:not(.hidden) .lesson-row {
  animation: showcaseFadeUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}
[data-tab-panel]:not(.hidden) .lesson-row:nth-child(1) { animation-delay: 0.04s; }
[data-tab-panel]:not(.hidden) .lesson-row:nth-child(2) { animation-delay: 0.08s; }
[data-tab-panel]:not(.hidden) .lesson-row:nth-child(3) { animation-delay: 0.12s; }
[data-tab-panel]:not(.hidden) .lesson-row:nth-child(4) { animation-delay: 0.16s; }
[data-tab-panel]:not(.hidden) .lesson-row:nth-child(5) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .ai-panel,
  .ai-backdrop,
  .exam-lock-badge,
  .app-sidebar,
  .sidebar-backdrop,
  .showcase-fade-up,
  .showcase-fade-in,
  .showcase-scale-in,
  .showcase-slide-in,
  .showcase-page-enter,
  .showcase-pulse-cta,
  .showcase-float,
  .showcase-stagger > *,
  .tab-panel-enter,
  [data-tab-panel]:not(.hidden) .lesson-row {
    animation: none !important;
    transition: none;
    opacity: 1 !important;
    transform: none !important;
  }
  .showcase-on-scroll {
    opacity: 1;
    transform: none;
  }
  .accordion-section__body {
    transition: none;
  }
  .showcase-progress-bar > .h-full,
  .showcase-progress-bar > .progress-fill,
  .showcase-progress-bar > .ui-progress__fill,
  .showcase-progress-bar > div > .h-full,
  .showcase-progress-bar > div > .progress-fill {
    transform: scaleX(1);
    animation: none;
  }
}

/* Student schedule calendar */
.schedule-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }
}

.schedule-calendar__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.schedule-calendar__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.schedule-calendar__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  color: var(--text-muted);
  background: #fff;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.schedule-calendar__nav-btn:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
  background: var(--ksa-green-light);
}

.schedule-calendar__month {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.schedule-calendar__weekdays,
.schedule-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.375rem;
}

.schedule-calendar__weekdays {
  margin-bottom: 0.5rem;
}

.schedule-calendar__weekday {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.schedule-day {
  position: relative;
  display: flex;
  min-height: 3.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.375rem 0.25rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.schedule-day:hover:not(.schedule-day--empty) {
  border-color: var(--border);
  background: #F5F5F5;
}

.schedule-day.is-today {
  border-color: var(--ksa-green);
  background: var(--ksa-green-light);
}

.schedule-day.is-selected {
  border-color: var(--ksa-green);
  background: #fff;
  box-shadow: 0 0 0 2px rgb(23 171 87 / 0.15);
}

.schedule-day.is-today.is-selected {
  background: var(--ksa-green-light);
}

.schedule-day--empty {
  pointer-events: none;
}

.schedule-day__num {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
}

.schedule-day__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.125rem;
  margin-top: auto;
}

.schedule-day__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--ksa-green);
}

.schedule-day__dot--live { background: #1782BA; }
.schedule-day__dot--exam { background: #213d78; }
.schedule-day__dot--workshop { background: #176199; }
.schedule-day__dot--self { background: var(--ksa-green); }

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.schedule-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.schedule-legend__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ksa-green);
}

.schedule-legend__dot--live { background: #1782BA; }
.schedule-legend__dot--exam { background: #213d78; }
.schedule-legend__dot--workshop { background: #176199; }

.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.schedule-filter {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #fff;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.schedule-filter:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}

.schedule-filter.is-active {
  border-color: var(--ksa-green);
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  font-weight: 600;
}

.schedule-events__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.schedule-events__subtitle {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.schedule-events__list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.schedule-events__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.schedule-event {
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 0.875rem;
  background: #fff;
}

.schedule-event--live { border-inline-start: 3px solid #1782BA; }
.schedule-event--exam { border-inline-start: 3px solid #213d78; }
.schedule-event--workshop { border-inline-start: 3px solid #176199; }
.schedule-event--self { border-inline-start: 3px solid var(--ksa-green); }

.schedule-event__time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.schedule-event__title {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.schedule-event__detail {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.schedule-event__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.schedule-event__tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.schedule-event__link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ksa-green);
}

.schedule-event__link:hover {
  text-decoration: underline;
}

@media (max-width: 639px) {
  .schedule-day {
    min-height: 3rem;
    padding: 0.25rem 0.125rem 0.375rem;
  }

  .schedule-day__num {
    font-size: 0.75rem;
  }
}

/* ── Journey timeline (bottom bar + info modal) ───────────────────── */
.journey-timeline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  border-top: 1px solid var(--border-strong);
  background: #fff;
  box-shadow: 0 -4px 24px rgb(26 35 50 / 0.08);
}

.journey-timeline__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--journey-timeline-h);
  max-width: 100%;
  padding: 0.4rem 1rem;
}

.journey-timeline__info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.journey-timeline__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ksa-green);
  background: var(--ksa-green-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.journey-timeline__title {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-timeline__count {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
}

.journey-timeline__progress {
  display: none;
  width: 5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.journey-timeline__progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ksa-green);
  transition: width var(--motion-fast) var(--ease-out);
}

.journey-timeline__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.journey-timeline__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.journey-timeline__btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: #fff;
}

.journey-timeline__btn--ghost:hover {
  border-color: var(--ksa-green);
  color: var(--ksa-green);
}

.journey-timeline__btn--info {
  border: 1px solid var(--ksa-green);
  color: var(--ksa-green);
  background: var(--ksa-green-light);
}

.journey-timeline__btn--info:hover {
  background: var(--ksa-green);
  color: #fff;
}

.journey-timeline__btn--primary {
  background: var(--ksa-green);
  color: #fff;
  min-width: 4.5rem;
}

.journey-timeline__btn--primary:hover {
  background: var(--ksa-green-dark);
}

.journey-timeline__btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.journey-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(0 0 0 / 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out),
    visibility var(--motion-fast) var(--ease-out);
}

.journey-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.journey-modal {
  position: fixed;
  bottom: calc(var(--journey-timeline-h) + 0.75rem);
  left: 50%;
  z-index: 90;
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - var(--demo-bar-h) - var(--journey-timeline-h) - 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 20px 56px rgb(26 35 50 / 0.18);
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out),
    visibility var(--motion-fast) var(--ease-out);
}

.journey-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

body.has-journey-timeline:not(:has(.app-shell)) main {
  padding-bottom: calc(var(--journey-timeline-h) + 1rem);
}

body.journey-modal-open {
  overflow: hidden;
}

.journey-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.journey-modal__head-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ksa-green);
}

.journey-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.journey-modal__close:hover {
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.journey-modal__role {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.journey-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.journey-modal__text {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.journey-modal__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-modal__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.journey-modal__list li i {
  color: var(--ksa-green);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .journey-timeline__progress {
    display: block;
  }
}

@media (max-width: 640px) {
  .journey-timeline__inner {
    flex-wrap: wrap;
    padding: 0.35rem 0.65rem;
    gap: 0.35rem;
  }

  .journey-timeline__info {
    flex: 1 1 100%;
    order: 1;
  }

  .journey-timeline__actions {
    flex: 1 1 100%;
    order: 2;
    justify-content: space-between;
  }

  .journey-timeline__btn-label {
    display: none;
  }

  .journey-timeline__btn {
    min-width: 2.25rem;
    padding: 0.35rem 0.5rem;
  }

  .journey-timeline__btn--primary {
    min-width: 2.25rem;
  }

  body.has-journey-timeline {
    --journey-timeline-h: 5.5rem;
  }

  .journey-modal {
    bottom: calc(var(--journey-timeline-h) + 0.5rem);
    width: calc(100vw - 1.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-timeline__progress > span,
  .journey-modal,
  .journey-modal-backdrop,
  .login-demo-cta__pulse {
    animation: none;
    transition: none;
  }
}

/* ── Community module (Skool-inspired) ── */

.community-app-main {
  background: #fff;
}

.community-page.app-main__content {
  max-width: none;
  padding: 0;
}

.community-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #E5E5E5;
  position: sticky;
  top: 0;
  z-index: 20;
}

.community-topbar__start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.community-aside-toggle {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ksa-green);
  background: var(--ksa-green-light);
  white-space: nowrap;
}
.community-aside-toggle:hover {
  background: #F5F5F5;
}

.community-aside-backdrop {
  position: fixed;
  inset: var(--demo-bar-h) 0 0 0;
  z-index: 30;
  background: rgb(0 0 0 / 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.community-aside-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.community-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.community-topbar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: #000000;
  transition: background 0.15s ease;
}
.community-topbar__icon:hover {
  background: #F5F5F5;
}

.community-topbar__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  font-size: 0.65rem;
  font-weight: 700;
}

.community-topbar__tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
  background: #F5F5F5;
  transition: background 0.15s ease, color 0.15s ease;
}
.community-topbar__tool:hover {
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.community-tutor-bar {
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #E5E5E5;
}

.community-tutor-bar__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 72rem;
  margin-inline: auto;
}

.community-tutor-bar__icon {
  color: var(--ksa-green);
  flex-shrink: 0;
}

.community-tutor-bar__input {
  flex: 1;
  min-width: 12rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: #F5F5F5;
}
.community-tutor-bar__input:focus {
  outline: none;
  border-color: var(--ksa-green);
  background: #fff;
}

.community-tutor-bar__select {
  padding: 0.55rem 0.85rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: #fff;
}

.community-tutor-bar__submit {
  padding: 0.55rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ksa-green);
  transition: background 0.15s ease;
}
.community-tutor-bar__submit:hover {
  background: var(--ksa-green-dark);
}

.community-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: 1.25rem;
  align-items: start;
  direction: ltr;
}

.community-aside,
.community-main {
  direction: rtl;
}

.community-page {
  overflow-x: hidden;
}

.community-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 0;
}

@media (max-width: 900px) {
  .community-shell {
    grid-template-columns: 1fr;
    padding: 0.85rem;
    gap: 0;
    direction: rtl;
  }

  .community-aside-toggle {
    display: inline-flex;
  }

  .community-aside {
    position: fixed;
    top: var(--demo-bar-h);
    bottom: 0;
    left: 0;
    width: min(85vw, 280px);
    z-index: 35;
    padding: 0.85rem;
    gap: 0.75rem;
    background: #fff;
    border-inline-end: 1px solid #E5E5E5;
    box-shadow: 4px 0 24px rgb(0 0 0 / 0.12);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
  }

  .community-aside.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .community-main {
    width: 100%;
    min-width: 0;
  }
}

.community-profile-card {
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}

.community-profile-card__logo {
  display: block;
  width: 100%;
  max-width: 10rem;
  height: auto;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.community-profile-card__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.4;
}

.community-profile-card__members {
  font-size: 0.8rem;
  color: #000000;
  margin-top: 0.25rem;
}

.community-profile-card__desc {
  font-size: 0.8rem;
  color: #000000;
  line-height: 1.6;
  margin-top: 0.75rem;
  text-align: start;
}

.community-profile-card__active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #F5F5F5;
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
}

.community-profile-card__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #17AB57;
}

.community-channels {
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  overflow: hidden;
}

.community-channels__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000000;
  border-bottom: 1px solid #F5F5F5;
}

.community-channels__list {
  padding: 0.35rem;
}

.community-channel {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
  text-align: start;
  transition: background 0.15s ease;
}
.community-channel:hover {
  background: #F5F5F5;
}
.community-channel.is-active {
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.community-channel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  flex-shrink: 0;
}
.community-channel.is-active .community-channel__icon {
  background: var(--ksa-green);
  color: #fff;
}

.community-main {
  min-width: 0;
}

.community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem 0.75rem 0 0;
  border-bottom: none;
}

.community-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.community-header__logo {
  display: block;
  width: auto;
  max-width: 5.5rem;
  height: 2.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.community-header__info {
  min-width: 0;
}

.community-header__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-header__badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.1rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.community-header__chat {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ksa-green);
  color: #fff;
  flex-shrink: 0;
}

.community-body {
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0 0 0.75rem 0.75rem;
}

.community-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0 1rem;
  border-bottom: 1px solid #E5E5E5;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.community-nav::-webkit-scrollbar {
  display: none;
}

.community-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.community-nav__btn:hover {
  color: var(--ksa-green);
}
.community-nav__btn.is-active {
  color: var(--ksa-green);
  border-bottom-color: var(--ksa-green);
}

.community-panels {
  padding: 1rem 1.25rem 1.5rem;
}

.community-panel.hidden {
  display: none;
}

.community-compose {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
}

.community-compose__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.community-compose__field {
  flex: 1;
  min-width: 0;
}

.community-compose__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  resize: none;
  background: #F5F5F5;
  line-height: 1.5;
}
.community-compose__input:focus {
  outline: none;
  border-color: var(--ksa-green);
  background: #fff;
}

.community-compose__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.community-compose__submit {
  padding: 0.45rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--ksa-green);
}
.community-compose__submit:hover {
  background: var(--ksa-green-dark);
}

.community-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.community-post {
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  padding: 1.15rem 1.25rem;
}

.community-post--pinned {
  border-color: var(--ksa-green);
}

.community-post__head {
  margin-bottom: 0.65rem;
}

.community-post__author {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.community-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.community-avatar--sm {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.6rem;
}

.community-post__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.community-post__name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--brand-navy);
}

.community-role {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.community-role--trainer {
  background: #F5F5F5;
  color: #213D78;
}
.community-role--student {
  background: #F5F5F5;
  color: #000000;
}
.community-role--admin {
  background: #F5F5F5;
  color: #000000;
}

.community-post__time {
  font-size: 0.75rem;
  color: #000000;
  margin-top: 0.1rem;
}

.community-post__pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ksa-green);
  margin-bottom: 0.5rem;
}

.community-post__body p {
  color: #000000;
  line-height: 1.75;
  font-size: 0.9rem;
}

.community-post__more {
  display: inline;
  margin-inline-start: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ksa-green);
  cursor: pointer;
}
.community-post__more:hover {
  text-decoration: underline;
}

.community-post__media {
  margin-top: 0.85rem;
  border-radius: 0.625rem;
  overflow: hidden;
  border: 1px solid #E5E5E5;
  position: relative;
}
.community-post__media img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.community-post__media--video {
  aspect-ratio: 16 / 9;
  background: #213D78;
}
.community-post__media--video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.community-post__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #F5F5F5;
}

.community-post__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.community-vote {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #E5E5E5;
  border-radius: 999px;
  background: #F5F5F5;
}

.community-vote__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  color: #000000;
  transition: color 0.15s ease, background 0.15s ease;
}
.community-vote__btn:hover {
  color: var(--ksa-green);
  background: var(--ksa-green-light);
}

.community-vote__score {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000000;
}

.community-post__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #000000;
  transition: background 0.15s ease, color 0.15s ease;
}
.community-post__stat:hover {
  background: #F5F5F5;
  color: var(--ksa-green);
}

.community-post__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: #000000;
}
.community-post__menu:hover {
  background: #F5F5F5;
  color: #000000;
}

.community-thread {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #F5F5F5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.community-thread.is-collapsed {
  display: none;
}

.community-thread__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ksa-green);
  margin-top: 0.5rem;
}
.community-thread__toggle:hover {
  text-decoration: underline;
}

.community-thread__replies {
  margin-top: 0.5rem;
  margin-inline-start: 1.25rem;
  padding-inline-start: 0.75rem;
  border-inline-start: 2px solid #E5E5E5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.community-comment__head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.2rem;
}
.community-comment__author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-navy);
}
.community-comment__meta {
  font-size: 0.7rem;
  color: #000000;
  margin-inline-start: 0.35rem;
}
.community-comment__body {
  font-size: 0.85rem;
  color: #000000;
  line-height: 1.6;
}

.community-section {
  margin-bottom: 1.5rem;
}
.community-section:last-child {
  margin-bottom: 0;
}
.community-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
}
.community-section__desc {
  font-size: 0.85rem;
  color: #000000;
  margin-bottom: 1rem;
}

.community-live-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .community-live-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.community-live {
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  background: #fff;
}
.community-live__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.community-live__platform {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
}
.community-live__status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}
.community-live__status--live {
  background: #F5F5F5;
  color: #213d78;
  animation: community-pulse 2s ease-in-out infinite;
}
@keyframes community-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.community-live__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
}
.community-live__desc {
  font-size: 0.85rem;
  color: #000000;
  margin-bottom: 0.75rem;
}
.community-live__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #000000;
  margin-bottom: 0.85rem;
}
.community-live__meta li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.community-live__join {
  width: 100%;
  justify-content: center;
}

.community-events {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.community-event {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  background: #fff;
}
.community-event--live {
  border-inline-start: 3px solid var(--ksa-green);
}
.community-event--exam {
  border-inline-start: 3px solid #1782BA;
}
.community-event__time {
  flex-shrink: 0;
  text-align: center;
  min-width: 4rem;
}
.community-event__hour {
  display: block;
  font-weight: 700;
  color: var(--brand-navy);
}
.community-event__end {
  font-size: 0.75rem;
  color: #000000;
}
.community-event__type {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ksa-green);
}
.community-event__title {
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0.15rem 0;
}
.community-event__detail {
  font-size: 0.875rem;
  color: #000000;
}
.community-event__course {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ksa-green);
  margin-top: 0.35rem;
}

.community-files {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.community-file {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  background: #fff;
}
.community-file__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}
.community-file__info {
  flex: 1;
  min-width: 0;
}
.community-file__name {
  font-weight: 700;
  color: var(--brand-navy);
  font-size: 0.9rem;
}
.community-file__desc {
  font-size: 0.8rem;
  color: #000000;
  margin-top: 0.15rem;
}
.community-file__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #000000;
  margin-top: 0.35rem;
}
.community-file__download {
  flex-shrink: 0;
}

.community-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #000000;
}

.community-admin-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #F5F5F5;
  color: #000000;
}
.community-admin-badge.is-on {
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

/* Community library */
.community-library {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.community-library-upload {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem;
  border: 1px dashed #E5E5E5;
  border-radius: 0.75rem;
  background: #F5F5F5;
}

.community-library-upload__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.community-library-upload__icon {
  color: var(--ksa-green);
}

.community-library-upload__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.community-library-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.community-library-upload__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.community-library-upload__hint {
  font-size: 0.75rem;
  color: #000000;
}

.community-library-upload__btn {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ksa-green);
  background: var(--ksa-green-light);
  transition: background 0.15s ease;
}
.community-library-upload__label:hover .community-library-upload__btn {
  background: #F5F5F5;
}

.community-library-upload__filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ksa-green);
}

.community-library-upload__desc {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  resize: vertical;
  background: #fff;
  line-height: 1.5;
}
.community-library-upload__desc:focus {
  outline: none;
  border-color: var(--ksa-green);
}

.community-library-upload__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  align-self: flex-end;
  padding: 0.55rem 1.15rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ksa-green);
  transition: background 0.15s ease;
}
.community-library-upload__submit:hover {
  background: var(--ksa-green-dark);
}

.community-library-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.community-library-item:hover {
  border-color: var(--ksa-green);
  box-shadow: 0 1px 4px rgb(23 171 87 / 0.08);
}

.community-library-item__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: var(--ksa-green-light);
  color: var(--ksa-green);
}

.community-library-item__info {
  flex: 1;
  min-width: 0;
}

.community-library-item__name {
  font-weight: 700;
  color: var(--brand-navy);
  font-size: 0.9rem;
  word-break: break-word;
}

.community-library-item__desc {
  font-size: 0.8rem;
  color: #000000;
  margin-top: 0.2rem;
  line-height: 1.5;
}

.community-library-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #000000;
  margin-top: 0.4rem;
}

.community-library-item__download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ksa-green);
  background: var(--ksa-green-light);
  transition: background 0.15s ease, color 0.15s ease;
}
.community-library-item__download:hover {
  background: var(--ksa-green);
  color: #fff;
}

@media (max-width: 640px) {
  .community-library-item {
    flex-wrap: wrap;
  }
  .community-library-item__download {
    width: 100%;
    justify-content: center;
  }
}

/* Community — phone / small screens */
@media (max-width: 640px) {
  .community-topbar {
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .community-aside-toggle span {
    display: none;
  }

  .community-aside-toggle {
    padding: 0.45rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    justify-content: center;
  }

  .community-topbar__tool {
    padding: 0.45rem 0.6rem;
    font-size: 0.7rem;
  }

  .community-tutor-bar {
    padding: 0.65rem 0.85rem;
  }

  .community-tutor-bar__form {
    flex-direction: column;
    align-items: stretch;
  }

  .community-tutor-bar__input,
  .community-tutor-bar__select,
  .community-tutor-bar__submit {
    width: 100%;
    min-width: 0;
  }

  .community-shell {
    padding: 0.5rem;
    gap: 0.65rem;
  }

  .community-profile-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    padding: 1rem;
    text-align: start;
  }

  .community-profile-card__logo {
    margin-bottom: 0;
    max-width: 7rem;
    flex-shrink: 0;
  }

  .community-profile-card__name {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
  }

  .community-profile-card__members {
    width: 100%;
    margin-top: -0.35rem;
    padding-inline-start: 3.6rem;
  }

  .community-profile-card__desc {
    width: 100%;
    margin-top: 0;
    font-size: 0.75rem;
  }

  .community-profile-card__active {
    width: 100%;
    justify-content: center;
    margin-top: 0.35rem;
  }

  .community-channels__list {
    display: flex;
    overflow-x: auto;
    gap: 0.35rem;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .community-channels__list::-webkit-scrollbar {
    display: none;
  }

  .community-channel {
    flex: 0 0 auto;
    max-width: min(85vw, 18rem);
    scroll-snap-align: start;
    padding: 0.55rem 0.75rem;
  }

  .community-channel__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .community-header {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .community-header__name {
    font-size: 0.875rem;
    white-space: normal;
    line-height: 1.35;
  }

  .community-header__logo {
    max-width: 4.5rem;
    height: 1.85rem;
  }

  .community-body {
    border-radius: 0.625rem;
  }

  .community-header {
    border-radius: 0.625rem 0.625rem 0 0;
  }

  .community-nav {
    padding: 0 0.35rem;
  }

  .community-nav__btn {
    padding: 0.75rem 0.7rem;
    font-size: 0.78rem;
    min-height: 2.75rem;
  }

  .community-panels {
    padding: 0.65rem;
  }

  .community-compose {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .community-compose__input {
    font-size: 1rem; /* prevents iOS zoom on focus */
  }

  .community-compose__submit {
    min-height: 2.75rem;
    padding: 0.55rem 1.25rem;
  }

  .community-post {
    padding: 0.85rem 1rem;
  }

  .community-post__foot {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .community-post__actions {
    flex: 1;
    min-width: 0;
  }

  .community-vote__btn,
  .community-post__stat {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .community-post__media img {
    max-height: 240px;
  }

  .community-event {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem;
  }

  .community-event__time {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    min-width: 0;
    text-align: start;
  }

  .community-file {
    flex-wrap: wrap;
    padding: 0.85rem;
  }

  .community-file__download {
    width: 100%;
    justify-content: center;
  }

  .community-live-grid {
    grid-template-columns: 1fr;
  }

  .community-live {
    padding: 0.85rem;
  }

  .community-section__title {
    font-size: 0.925rem;
  }

  .community-section__desc {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .community-library-upload {
    padding: 1rem;
  }

  .community-library-upload__desc {
    font-size: 1rem;
  }

  .community-library-upload__submit {
    width: 100%;
    align-self: stretch;
    min-height: 2.75rem;
  }

  .community-library-item {
    padding: 0.85rem;
  }

  .community-empty {
    padding: 1.5rem 0.75rem;
    font-size: 0.825rem;
  }

  .community-thread__replies {
    margin-inline-start: 0.75rem;
    padding-inline-start: 0.5rem;
  }

  .community-channel {
    min-height: 2.75rem;
  }
}

@media (max-width: 380px) {
  .community-header__chat {
    display: none;
  }

  .community-nav__btn {
    padding: 0.7rem 0.55rem;
    font-size: 0.72rem;
    gap: 0.3rem;
  }

  .community-topbar__actions {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .demo-bar {
    padding: 0.4rem 0.65rem;
    gap: 0.35rem;
    font-size: 0.7rem;
  }

  .demo-bar__next {
    padding: 0.35rem 0.65rem;
    font-size: 0.7rem;
  }
}

/* ─── Email simulator ─── */

.sidebar-nav-badge {
  margin-inline-start: auto;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #213D78;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
}

.email-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid #E5E5E5;
}
.email-status--pending { background: #F5F5F5; color: #000; }
.email-status--review { background: #E8F4FC; color: #176199; border-color: #1782BA; }
.email-status--approved { background: #E8F7EF; color: #0F944D; border-color: #17AB57; }
.email-status--returned { background: #FDF0F0; color: #B42318; border-color: #F04438; }

.data-table__action--primary {
  color: #213D78;
  font-weight: 600;
}

.email-inbox-layout,
.email-review-layout {
  display: grid;
  gap: 1rem;
  min-height: 28rem;
}
@media (min-width: 1024px) {
  .email-inbox-layout,
  .email-review-layout {
    grid-template-columns: 17rem minmax(0, 1fr);
  }
}

.email-inbox-sidebar,
.email-review-sidebar {
  border: 1px solid #E5E5E5;
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
}

.email-inbox-sidebar__title {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-bottom: 1px solid #E5E5E5;
}

.email-inbox-list {
  display: flex;
  flex-direction: column;
}

.email-inbox-item {
  width: 100%;
  text-align: start;
  padding: 0.85rem 1rem;
  border: none;
  border-bottom: 1px solid #E5E5E5;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.email-inbox-item:hover { background: #F5F5F5; }
.email-inbox-item.is-active { background: #EEF3FA; border-inline-start: 3px solid #213D78; }
.email-inbox-item.is-unread .email-inbox-item__subject { font-weight: 700; }

.email-inbox-item__from {
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
}
.email-inbox-item__subject {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-inbox-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  font-size: 0.68rem;
  color: #000;
}

.email-inbox-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.email-read {
  border: 1px solid #E5E5E5;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #fff;
}

.email-read__header { margin-bottom: 1rem; }
.email-read__subject {
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
}
.email-read__meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #000;
  display: grid;
  gap: 0.25rem;
}
.email-read__label { font-weight: 600; }
.email-read__body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: #000;
  white-space: pre-wrap;
}
.email-read__body--reply {
  background: #F5F5F5;
  border-radius: 0.75rem;
  padding: 1rem;
}

.email-reply {
  border: 1px solid #E5E5E5;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #fff;
}
.email-reply__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #000;
}
.email-reply__textarea {
  min-height: 10rem;
  line-height: 1.6;
}
.email-reply__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.email-evaluation {
  border: 1px solid #1782BA;
  border-radius: 1rem;
  padding: 1.25rem;
  background: linear-gradient(to left, #F5F5F5, #fff);
}
.email-evaluation--human {
  border-color: #213D78;
}
.email-evaluation__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #000;
}

.email-score-ring {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 999px;
  border: 4px solid #1782BA;
  margin-bottom: 1rem;
}
.email-score-ring__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #213D78;
}
.email-score-ring__label {
  font-size: 0.65rem;
  color: #000;
}

.email-criteria-grid {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.email-criteria {
  display: grid;
  grid-template-columns: 6rem 1fr 2.5rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.email-criteria__bar {
  height: 0.45rem;
  background: #E5E5E5;
  border-radius: 999px;
  overflow: hidden;
}
.email-criteria__bar span {
  display: block;
  height: 100%;
  background: #213D78;
  border-radius: 999px;
}

.email-feedback-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .email-feedback-grid { grid-template-columns: 1fr 1fr; }
}
.email-feedback {
  border-radius: 0.75rem;
  padding: 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
}
.email-feedback ul {
  margin-top: 0.35rem;
  padding-inline-start: 1.1rem;
}
.email-feedback--ok { background: #E8F7EF; border: 1px solid #17AB57; }
.email-feedback--warn { background: #FDF8E8; border: 1px solid #E5C100; }
.email-feedback--return { background: #FDF0F0; border: 1px solid #F04438; margin-bottom: 0.75rem; }

.email-stat {
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  padding: 0.85rem;
  background: #fff;
}
.email-stat__label {
  display: block;
  font-size: 0.7rem;
  color: #000;
}
.email-stat__value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #213D78;
}

.email-review-item {
  width: 100%;
  text-align: start;
  padding: 0.85rem 1rem;
  border: none;
  border-bottom: 1px solid #E5E5E5;
  background: #fff;
  cursor: pointer;
}
.email-review-item:hover { background: #F5F5F5; }
.email-review-item.is-active { background: #EEF3FA; }
.email-review-item__name { font-weight: 700; font-size: 0.85rem; }
.email-review-item__subject { font-size: 0.75rem; margin-top: 0.15rem; }
.email-review-item__score { font-size: 0.7rem; margin-top: 0.35rem; color: #176199; font-weight: 600; }
.email-review-empty {
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
  color: #000;
}

.email-ideal {
  border: 1px dashed #E5E5E5;
  border-radius: 0.75rem;
  padding: 0.85rem;
  background: #FAFAFA;
}

@media (max-width: 1023px) {
  .email-inbox-layout,
  .email-review-layout {
    grid-template-columns: 1fr;
  }
}
