
:root {
  --font-main: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-en: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Color Palette: Royal Navy + Crisp White + Medical Blue + Cyan */
  --bg: #f5f8fc;
  --bg-subtle: #edf3fa;
  --surface: #ffffff;
  --surface-hover: #f8fbff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-card: #ffffff;
  /* Backward-compatible semantic aliases used by newer UI components. */
  --card: var(--surface);
  --soft: var(--bg-subtle);
  --shadow: var(--shadow-md);
  
  --navy-dark: #050f1f;
  --navy: #07162e;
  --navy-light: #0d264d;
  --navy-muted: #1a3a6b;
  
  --blue-primary: #0284c7;
  --blue-hover: #0369a1;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  
  --text: #0b192e;
  --text-muted: #576b85;
  --text-light: #8fa0b5;
  
  --border: #dbe5f0;
  --border-focus: #0284c7;
  --border-light: rgba(219, 229, 240, 0.6);
  
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  
  --shadow-sm: 0 4px 12px rgba(7, 22, 46, 0.04);
  --shadow-md: 0 10px 30px rgba(7, 22, 46, 0.08);
  --shadow-lg: 0 20px 50px rgba(7, 22, 46, 0.12);
  --shadow-glow: 0 12px 36px rgba(2, 132, 199, 0.28);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
  --bg: #040c17;
  --bg-subtle: #071424;
  --surface: #0b1a2d;
  --surface-hover: #10243d;
  --surface-glass: rgba(11, 26, 45, 0.88);
  --surface-card: #0b1a2d;
  
  --navy-dark: #02070e;
  --navy: #061324;
  --navy-light: #0d223f;
  
  --text: #f0f6fc;
  --text-muted: #94a9c2;
  --text-light: #627b99;
  
  --border: #1a3350;
  --border-focus: #38bdf8;
  --border-light: rgba(26, 51, 80, 0.6);
  
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 35px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 12px 40px rgba(56, 189, 248, 0.2);
}

/* Base Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Animations */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes floatRev {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(10px) rotate(-1deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* Container */
.container {
  width: min(1200px, calc(100% - 36px));
  margin-inline: auto;
}

/* Topbar / Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 80px;
  padding: 12px clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  white-space: nowrap;
}

.brand img {
  width: 54px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text span:first-child {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
}

.brand-text span:last-child {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-primary);
  margin-top: -3px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar nav a {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14.5px;
  position: relative;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--blue-primary);
  background: var(--bg-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 14px 32px rgba(2, 132, 199, 0.45);
  transform: translateY(-2px);
}

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

.btn.ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  transform: translateY(-1px);
}

.btn.dark {
  background: var(--navy);
  color: #ffffff;
}

.btn.dark:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
}

.btn.success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.btn.danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.btn.small {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.btn.large {
  padding: 15px 30px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  transform: rotate(15deg);
}

.user-pill {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* =====================================================================
   HERO SECTION — Premium Medical Landing
   ===================================================================== */
.hero {
  --hero-img-x: 0px;
  --hero-img-y: 0px;
  position: relative;
  isolation: isolate;
  width: min(1320px, calc(100% - 32px));
  min-height: 690px;
  margin: 28px auto 52px;
  border-radius: 38px;
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(440px, 0.96fr);
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(53, 205, 255, 0.18), transparent 28%),
    radial-gradient(circle at 14% 86%, rgba(18, 129, 216, 0.18), transparent 34%),
    linear-gradient(122deg, #061020 0%, #071b35 47%, #0a315f 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 34px 100px rgba(4, 16, 34, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.9) 45%, transparent 86%);
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.9) 45%, transparent 86%);
  opacity: .72;
  animation: heroGridDrift 22s linear infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 46%;
  height: 140%;
  top: -20%;
  left: 33%;
  z-index: -3;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent);
  transform: rotate(12deg);
  pointer-events: none;
}

.hero-noise {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .28;
  background-image:
    radial-gradient(rgba(255,255,255,.28) .7px, transparent .7px),
    radial-gradient(rgba(103,232,249,.18) .7px, transparent .7px);
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
  mask-image: linear-gradient(100deg, rgba(0,0,0,.1), #000 55%, rgba(0,0,0,.4));
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.1), #000 55%, rgba(0,0,0,.4));
}

.hero-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.hero-light-one {
  width: 420px;
  height: 420px;
  right: -190px;
  top: -170px;
  background: radial-gradient(circle, rgba(71, 215, 255, .24), rgba(71, 215, 255, 0) 68%);
  animation: heroLightFloat 8s ease-in-out infinite;
}

.hero-light-two {
  width: 520px;
  height: 520px;
  left: -210px;
  bottom: -270px;
  background: radial-gradient(circle, rgba(0, 121, 213, .28), rgba(0, 121, 213, 0) 70%);
  animation: heroLightFloat 10s ease-in-out -3s infinite reverse;
}

.hero-copy {
  position: relative;
  z-index: 8;
  align-self: center;
  padding: clamp(44px, 5.2vw, 78px) clamp(34px, 5.2vw, 78px) clamp(44px, 5vw, 70px) 28px;
  animation: heroCopyIn .8s cubic-bezier(.2,.75,.25,1) both;
}

.eyebrow {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #c9f5ff;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1px;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, .12), 0 0 20px rgba(34, 211, 238, .65);
  animation: statusPulse 2s ease-in-out infinite;
  flex: 0 0 auto;
}

.eyebrow-separator {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.2);
}

.hero h1 {
  max-width: 620px;
  margin: 22px 0 18px;
  font-size: clamp(38px, 3.7vw, 56px);
  line-height: 1.34;
  letter-spacing: -0.35px;
  word-spacing: 1px;
  font-weight: 900;
  text-wrap: balance;
}

.hero h1 .highlight {
  display: inline;
  color: transparent;
  background: linear-gradient(115deg, #ffffff 0%, #76e8ff 38%, #2ab8ff 76%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroTextShine 7s linear infinite;
}

.hero p {
  max-width: 665px;
  margin: 0 0 30px;
  color: #c9d8ea;
  font-size: clamp(15.5px, 1.55vw, 18.5px);
  line-height: 1.95;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  min-height: 54px;
}

.hero-primary-cta {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 36px rgba(2,132,199,.34);
}

.hero-primary-cta::before {
  content: '';
  position: absolute;
  top: -80%;
  left: -45%;
  width: 34%;
  height: 260%;
  transform: rotate(24deg);
  background: linear-gradient(to right, transparent, rgba(255,255,255,.45), transparent);
  animation: ctaSweep 4.8s ease-in-out 1.4s infinite;
}

.cta-arrow {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-inline-start: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  transition: transform .28s ease, background-color .28s ease;
}

.hero-primary-cta:hover .cta-arrow {
  transform: translateX(-4px);
  background: rgba(255,255,255,.24);
}

.hero-actions .btn.ghost {
  color: #fff;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.17);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-actions .btn.ghost:hover {
  color: #fff;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.32);
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-width: 710px;
  margin-top: 34px;
  padding-top: 23px;
  border-top: 1px solid rgba(255,255,255,.11);
}

.hero-proof-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 14px;
  color: #ecf7ff;
  transition: transform .25s ease, background-color .25s ease;
}

.hero-proof-item:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.05);
}

.hero-proof-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.hero-proof-item strong {
  font-size: 12.8px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-proof-item small {
  color: #91a9c2;
  font-size: 10.5px;
  line-height: 1.45;
  white-space: nowrap;
}

.proof-icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #75edff;
  background: rgba(34,211,238,.09);
  border: 1px solid rgba(103,232,249,.16);
  font-size: 13px;
  font-family: var(--font-en);
  font-weight: 900;
}

/* Hero visual */
.hero-visual {
  position: relative;
  z-index: 5;
  min-height: 690px;
  display: grid;
  place-items: end center;
  padding: 24px 16px 0;
  overflow: visible;
  perspective: 1100px;
}

.hero-visual::before {
  content: '';
  position: absolute;
  width: min(520px, 86%);
  aspect-ratio: 1;
  left: 50%;
  top: 49%;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 180, 238, .26) 0 27%, rgba(15, 116, 187, .08) 44%, transparent 70%);
  filter: blur(2px);
  box-shadow: 0 0 110px rgba(16, 151, 220, .16);
  animation: visualBreath 6.5s ease-in-out infinite;
}

.hero-visual-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid rgba(137, 225, 255, .13);
  pointer-events: none;
}

.orbit-one {
  width: min(535px, 88%);
  aspect-ratio: 1;
  animation: orbitSpin 28s linear infinite;
}

.orbit-one::before,
.orbit-two::before {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  top: -5px;
  left: 50%;
  background: #67e8f9;
  box-shadow: 0 0 24px #22d3ee;
}

.orbit-two {
  width: min(410px, 70%);
  aspect-ratio: 1;
  border-style: dashed;
  border-color: rgba(125, 211, 252, .11);
  animation: orbitSpin 34s linear infinite reverse;
}

.hero-ecg {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 29%;
  z-index: 1;
  opacity: .26;
  filter: drop-shadow(0 0 5px rgba(83,220,255,.42));
  pointer-events: none;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.hero-ecg svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-ecg path {
  fill: none;
  stroke: #65dff8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: ecgDraw 5.8s ease-in-out 1.1s infinite;
}

.hero-image-stage {
  position: relative;
  z-index: 4;
  width: min(610px, 99%);
  height: 100%;
  min-height: 665px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: translate3d(var(--hero-img-x), var(--hero-img-y), 0);
  transition: transform .18s ease-out;
}

.hero-image-halo {
  position: absolute;
  z-index: -1;
  width: 72%;
  aspect-ratio: 1;
  left: 50%;
  bottom: 19%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103,232,249,.19), rgba(14,165,233,.075) 45%, transparent 69%);
  filter: blur(9px);
  animation: haloPulse 5.6s ease-in-out infinite;
}

.hero-image-platform {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 8px;
  translate: -50% 0;
  width: 78%;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(38,185,238,.28) 0%, rgba(11,93,158,.13) 40%, transparent 74%);
  filter: blur(9px);
}

.hero-doctor-img {
  position: relative;
  z-index: 3;
  width: auto;
  height: min(660px, 100%);
  max-width: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 26px 24px rgba(0,0,0,.25)) drop-shadow(0 0 30px rgba(51,184,241,.06));
  transform-origin: 50% 100%;
  animation:
    heroImageIn .95s cubic-bezier(.16,.8,.25,1) .15s both,
    heroImageFloat 6.2s ease-in-out 1.15s infinite;
  will-change: transform;
}

.hero-floating-card,
.hero-success-badge {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #0d1d31;
  background: rgba(255,255,255,.93);
  border: 1px solid rgba(255,255,255,.74);
  box-shadow: 0 18px 48px rgba(1, 13, 28, .27), inset 0 1px 0 rgba(255,255,255,.85);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  transition: transform .18s ease-out, box-shadow .28s ease;
}

.hero-floating-card:hover,
.hero-success-badge:hover {
  box-shadow: 0 24px 58px rgba(1, 13, 28, .35), inset 0 1px 0 rgba(255,255,255,.9);
}

.hero-floating-card {
  min-width: 218px;
  padding: 11px 14px 11px 12px;
  border-radius: 18px;
}

.hero-floating-card > span:last-child,
.hero-success-badge > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.hero-floating-card strong,
.hero-success-badge strong {
  font-family: var(--font-main);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 900;
  white-space: nowrap;
}

.hero-floating-card small,
.hero-success-badge small {
  color: #667c94;
  font-size: 10.5px;
  line-height: 1.5;
  font-weight: 700;
  white-space: nowrap;
}

.floating-card-icon {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-en);
  font-weight: 900;
}

.medical-cross {
  color: #047cae;
  background: linear-gradient(145deg, #e6fbff, #bdefff);
  border: 1px solid #b4ebf7;
  font-size: 22px;
}

.check-ring {
  color: #07876d;
  background: linear-gradient(145deg, #e9fff8, #c8f5e7);
  border: 1px solid #b8ebdc;
  font-size: 18px;
}

.hero-card-skills {
  top: 20%;
  right: 1.5%;
  animation: cardInRight .75s cubic-bezier(.16,.8,.25,1) .65s both, cardFloatA 5.4s ease-in-out 1.4s infinite;
}

.hero-card-quiz {
  left: 0%;
  bottom: 19%;
  animation: cardInLeft .75s cubic-bezier(.16,.8,.25,1) .82s both, cardFloatB 6s ease-in-out 1.55s infinite;
}

.hero-success-badge {
  right: 6%;
  bottom: 8.5%;
  min-width: 183px;
  padding: 10px 13px;
  border-radius: 16px;
  animation: badgeIn .7s cubic-bezier(.16,.8,.25,1) 1s both, cardFloatA 6.6s ease-in-out 1.7s infinite reverse;
}

.success-pulse {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 6px rgba(16,185,129,.11);
}

.success-pulse::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(16,185,129,.42);
  animation: badgePulse 2.1s ease-out infinite;
}

html[data-theme="dark"] .hero-floating-card,
html[data-theme="dark"] .hero-success-badge {
  color: #eef8ff;
  background: rgba(7, 24, 44, .90);
  border-color: rgba(126, 214, 255, .16);
  box-shadow: 0 18px 48px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.05);
}

html[data-theme="dark"] .hero-floating-card small,
html[data-theme="dark"] .hero-success-badge small {
  color: #8faac4;
}

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

@keyframes heroImageIn {
  from { opacity: 0; transform: translateY(42px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroImageFloat {
  0%, 100% { transform: translateY(0) rotate(.001deg); }
  50% { transform: translateY(-8px) rotate(.18deg); }
}

@keyframes cardInRight {
  from { opacity: 0; transform: translate3d(28px, 12px, 0) scale(.94); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes cardInLeft {
  from { opacity: 0; transform: translate3d(-28px, 14px, 0) scale(.94); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes badgeIn {
  from { opacity: 0; transform: translateY(16px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFloatA {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -9px; }
}

@keyframes cardFloatB {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: -10px; }
}

@keyframes heroLightFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .75; }
  50% { transform: translate3d(20px, 14px, 0) scale(1.08); opacity: 1; }
}

@keyframes visualBreath {
  0%, 100% { transform: scale(.98); opacity: .82; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes haloPulse {
  0%, 100% { transform: scale(.96); opacity: .72; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes orbitSpin {
  to { rotate: 360deg; }
}

@keyframes ecgDraw {
  0%, 13% { stroke-dashoffset: 620; opacity: 0; }
  25% { opacity: .8; }
  72% { stroke-dashoffset: 0; opacity: .9; }
  92%, 100% { stroke-dashoffset: -620; opacity: 0; }
}

@keyframes badgePulse {
  0% { transform: scale(.7); opacity: .85; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes statusPulse {
  0%, 100% { opacity: .8; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes heroGridDrift {
  to { background-position: 48px 48px, 48px 48px; }
}

@keyframes heroTextShine {
  to { background-position: -220% center; }
}

@keyframes ctaSweep {
  0%, 62% { left: -45%; opacity: 0; }
  68% { opacity: 1; }
  84% { left: 120%; opacity: .8; }
  100% { left: 120%; opacity: 0; }
}

/* =====================================================================
   STATS BAR (الأرقام والإحصائيات)
   ===================================================================== */
.stats-ribbon {
  margin: -10px auto 50px;
  position: relative;
  z-index: 10;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-md);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.stat-item:last-child {
  border-left: 0;
  padding-left: 0;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--blue-primary);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-content strong {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  font-family: var(--font-en), var(--font-main);
}

.stat-content span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* =====================================================================
   SECTIONS & SECTION HEADERS
   ===================================================================== */
.section {
  padding: 68px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 48px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--blue-primary);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 14px;
}

.section-header p {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--text-muted);
  line-height: 1.7;
}

/* Cards & Grids */
.grid {
  display: grid;
  gap: 22px;
}

.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

/* =====================================================================
   ACADEMIC PATHWAYS (المسارات الأكاديمية)
   ===================================================================== */
.pathway-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--blue-primary);
}

.pathway-card.p-school { border-top-color: #0284c7; }
.pathway-card.p-inst { border-top-color: #06b6d4; }
.pathway-card.p-college { border-top-color: #8b5cf6; }

.pathway-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.pathway-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  font-size: 26px;
}

.duration-tag {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.pathway-card h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.pathway-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.pathway-subjects {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.pathway-subjects li {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pathway-subjects li span {
  color: var(--blue-primary);
  font-size: 14px;
}

/* =====================================================================
   LEARNING JOURNEY (رحلة الطالب - 5 خطوات)
   ===================================================================== */
.journey-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  position: relative;
  margin-top: 30px;
}

.journey-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

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

.step-num {
  position: absolute;
  top: -14px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.step-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--blue-primary);
  display: grid;
  place-items: center;
  font-size: 26px;
  margin: 6px auto 14px;
}

.journey-step h4 {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.journey-step p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =====================================================================
   FEATURES & TRUST CARDS
   ===================================================================== */
.feature-card {
  display: flex;
  flex-direction: column;
}

.feature-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(6, 182, 212, 0.12));
  color: var(--blue-primary);
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.feature-card p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* =====================================================================
   FAQ ACCORDION
   ===================================================================== */
.faq-wrap {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.active {
  border-color: var(--blue-primary);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  padding: 20px 24px;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.faq-question span.arrow {
  transition: transform 0.3s ease;
  font-size: 18px;
  color: var(--blue-primary);
}

.faq-item.active .faq-question span.arrow {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* =====================================================================
   CTA BANNER
   ===================================================================== */
.cta-banner {
  background: 
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.3), transparent 40%),
    linear-gradient(135deg, #07162e 0%, #0d2850 60%, #0284c7 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
  margin: 40px auto 20px;
  box-shadow: 0 25px 70px rgba(7, 22, 46, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-banner h2 {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 900;
  margin-bottom: 14px;
}

.cta-banner p {
  font-size: 17px;
  color: #dbeafe;
  max-width: 640px;
  margin: 0 auto 30px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =====================================================================
   AUTH PAGES (Login & Register & Student ID Modal)
   ===================================================================== */
.auth-wrap {
  width: min(1060px, calc(100% - 32px));
  margin: 40px auto 60px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  min-height: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-art {
  background: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.25), transparent 40%),
    linear-gradient(145deg, #051020, #0a274d);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.auth-art h2 {
  font-size: 32px;
  font-weight: 900;
  margin: 20px 0 10px;
  line-height: 1.25;
}

.auth-art p {
  color: #93c5fd;
  font-size: 15.5px;
}

.auth-art img {
  max-width: 240px;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  margin-top: 30px;
}

.auth-card {
  padding: clamp(30px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card h1 {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14.5px;
  outline: none;
  transition: var(--transition);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

/* Student ID Celebration Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.student-id-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.4s ease;
}

.celebration-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 34px;
  margin: 0 auto 18px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.id-display-box {
  background: var(--bg-subtle);
  border: 2px dashed var(--blue-primary);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.id-display-box strong {
  font-size: 26px;
  font-family: var(--font-en), monospace;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--blue-primary);
}

/* Toast Messages */
.toast {
  width: min(900px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { background: var(--green-bg); color: #065f46; border: 1px solid var(--green-border); }
.toast.danger { background: var(--red-bg); color: #991b1b; border: 1px solid var(--red-border); }
.toast.warning { background: var(--amber-bg); color: #92400e; border: 1px solid #fde68a; }

/* =====================================================================
   STUDENT PLATFORM DASHBOARD & LECTURES
   ===================================================================== */
.page-shell {
  width: min(1260px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 34px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.metric span.muted {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.metric strong {
  display: block;
  font-size: 32px;
  font-weight: 900;
  color: var(--blue-primary);
  margin-top: 6px;
  font-family: var(--font-en), var(--font-main);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.subject-cover {
  height: 180px;
  background: linear-gradient(135deg, #07162e 0%, #0c2d58 100%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.subject-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subject-cover .placeholder {
  font-size: 48px;
  color: #38bdf8;
}

.subject-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subject-body h3 {
  font-size: 18.5px;
  font-weight: 800;
  margin: 10px 0 14px;
  color: var(--text);
}

.progress {
  height: 9px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #06b6d4);
  border-radius: inherit;
  transition: width 0.4s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
}

.badge.green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge.blue { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge.red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* Lecture view & Video */
.video-box {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.video-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Quiz & Exam System */
.quiz-shell {
  width: min(840px, calc(100% - 32px));
  margin: 36px auto;
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.timer {
  font-size: 20px;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
  font-family: var(--font-en), monospace;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: var(--shadow-md);
}

.question-card h2 {
  font-size: 22px;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--text);
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15.5px;
  font-weight: 700;
}

.option:hover {
  background: var(--bg-subtle);
  border-color: var(--blue-primary);
}

.option input {
  accent-color: var(--blue-primary);
  transform: scale(1.2);
}

/* Certificate */
.certificate {
  width: min(1000px, calc(100% - 30px));
  margin: 36px auto;
  padding: 60px 40px;
  border: 12px double var(--navy);
  border-radius: var(--radius-xl);
  background: #ffffff;
  color: #07162e;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.certificate h1 {
  font-size: 42px;
  font-weight: 900;
  margin: 18px 0 6px;
  color: var(--navy);
}

.certificate .student-name {
  font-size: 36px;
  font-weight: 900;
  color: #0284c7;
  margin: 14px 0;
}

/* =====================================================================
   FOOTER & WHATSAPP FLOATER
   ===================================================================== */
.footer {
  margin-top: 80px;
  background: var(--navy);
  color: #cbd5e1;
  padding: 50px clamp(20px, 5vw, 70px) 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand img {
  width: 140px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.7;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: #94a3b8;
  font-size: 14px;
}

.footer-col a:hover {
  color: #38bdf8;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13.5px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

.wa-float {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 999;
  background: #25d366;
  color: #ffffff;
  padding: 13px 20px;
  border-radius: var(--radius-full);
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.4);
  transition: var(--transition);
}

.wa-float:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 20px 45px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}

/* =====================================================================
   RESPONSIVE DESIGN (Mobile & Tablet)
   ===================================================================== */
@media (max-width: 1024px) {
  .hero {
    width: min(940px, calc(100% - 28px));
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-copy {
    padding: 52px 48px 26px;
  }
  .hero h1 {
    max-width: 760px;
  }
  .hero-proof {
    max-width: 760px;
  }
  .hero-visual {
    min-height: 570px;
    padding-top: 0;
  }
  .hero-image-stage {
    min-height: 560px;
    width: min(620px, 96%);
  }
  .hero-doctor-img {
    height: min(555px, 100%);
  }
  .hero-card-skills {
    right: 10%;
    top: 16%;
  }
  .hero-card-quiz {
    left: 9%;
    bottom: 20%;
  }
  .hero-success-badge {
    right: 14%;
    bottom: 7%;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-item {
    border-left: 0;
  }
  .journey-timeline {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(2, 1fr); }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 16px;
    min-height: 70px;
  }
  .topbar nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }
  .topbar nav a {
    padding: 8px 10px;
    font-size: 13px;
  }
  body {
    padding-bottom: 65px;
  }
  .hero {
    width: min(calc(100% - 18px), 720px);
    margin: 12px auto 30px;
    border-radius: 26px;
  }
  .hero-copy {
    padding: 34px 22px 18px;
  }
  .eyebrow {
    gap: 7px;
    padding: 8px 11px;
    font-size: 10.7px;
  }
  .eyebrow-separator {
    height: 13px;
  }
  .hero h1 {
    margin-top: 18px;
    font-size: clamp(30px, 7.5vw, 39px);
    line-height: 1.38;
    letter-spacing: -.2px;
  }
  .hero p {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.85;
  }
  .hero-actions {
    align-items: stretch;
  }
  .hero-actions .btn {
    flex: 1 1 190px;
    justify-content: center;
  }
  .hero-proof {
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 24px;
    padding-top: 17px;
  }
  .hero-proof-item {
    padding: 7px 4px;
  }
  .hero-proof-item small {
    white-space: normal;
  }
  .hero-visual {
    min-height: 450px;
    padding-inline: 4px;
  }
  .hero-image-stage {
    min-height: 445px;
    width: min(475px, 100%);
  }
  .hero-doctor-img {
    height: min(445px, 100%);
  }
  .hero-card-skills {
    top: 17%;
    right: 2%;
    min-width: 178px;
    padding: 9px 10px;
    transform: scale(.9);
    transform-origin: right center;
  }
  .hero-card-quiz {
    display: none;
  }
  .hero-success-badge {
    right: 4%;
    bottom: 5%;
    min-width: 166px;
    padding: 8px 10px;
  }
  .hero-ecg {
    top: 30%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px;
  }
  .journey-timeline {
    grid-template-columns: 1fr;
  }
  .grid.two, .grid.three, .grid.four, .subject-grid, .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .wa-float {
    bottom: 74px;
    left: 16px;
    padding: 10px 16px;
    font-size: 13.5px;
  }
}


@media (max-width: 480px) {
  .hero {
    width: calc(100% - 12px);
    border-radius: 22px;
  }
  .hero-copy {
    padding: 30px 17px 12px;
  }
  .eyebrow span:last-child,
  .eyebrow-separator {
    display: none;
  }
  .hero h1 {
    font-size: clamp(28px, 8.5vw, 34px);
    line-height: 1.4;
  }
  .hero-actions .btn {
    flex-basis: 100%;
  }
  .hero-visual {
    min-height: 390px;
  }
  .hero-image-stage {
    min-height: 390px;
  }
  .hero-doctor-img {
    height: min(390px, 100%);
  }
  .hero-card-skills {
    top: 11%;
    right: -10px;
    scale: .82;
  }
  .hero-success-badge {
    right: 2px;
    bottom: 3%;
    scale: .86;
    transform-origin: right bottom;
  }
  .hero-visual-orbit.orbit-one {
    width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero *,
  .hero *::before,
  .hero *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero-image-stage {
    transform: none !important;
  }
}

/* =====================================================================
   CHAPTERS, ACCORDION & LECTURE ITEMS
   ===================================================================== */
.subject-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 36px);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.subject-hero-card h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 900;
  color: var(--text);
  margin: 10px 0 6px;
}

.chapter-card,
.accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.chapter-card:hover {
  border-color: var(--blue-primary);
}

.chapter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.chapter-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lecture-list {
  display: grid;
  gap: 12px;
}

.lecture-item {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.lecture-item:hover {
  background: var(--surface);
  border-color: var(--blue-primary);
  transform: translateX(-4px);
  box-shadow: var(--shadow-sm);
}

.lecture-left-col {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lecture-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--blue-primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.lecture-item-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text);
}

.lecture-item-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.lecture-right-col {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* =====================================================================
   DATA TABLES (Results, Students, Payments)
   ===================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  text-align: right;
  font-size: 14.5px;
}

.table thead {
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 16px 18px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: var(--bg-subtle);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-en), var(--font-main);
  direction: ltr;
  unicode-bidi: isolate;
}


/* =====================================================================
   V3.0 — PWA INSTALL EXPERIENCE
   ===================================================================== */
html.pwa-modal-open,
html.pwa-modal-open body {
  overflow: hidden;
}

.pwa-install-modal[hidden] { display: none !important; }
.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 10, 20, .64);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.pwa-install-card {
  position: relative;
  width: min(520px, 100%);
  background:
    radial-gradient(circle at 100% 0%, rgba(56,189,248,.16), transparent 31%),
    var(--surface);
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 30px;
  padding: 28px 30px 24px;
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
  animation: pwaPop .36s cubic-bezier(.2,.8,.2,1) both;
  overflow: hidden;
}
.pwa-install-card::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  left: -65px;
  bottom: -92px;
  background: rgba(2,132,199,.09);
  pointer-events: none;
}
@keyframes pwaPop {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.pwa-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.pwa-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 42px;
  margin-bottom: 18px;
}
.pwa-brand-row img {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  box-shadow: var(--shadow-md);
}
.pwa-brand-row div { display: grid; gap: 1px; }
.pwa-brand-row span {
  font-family: var(--font-en), var(--font-main);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--blue-primary);
}
.pwa-brand-row small { color: var(--text-muted); font-weight: 700; }
.pwa-install-card h2 {
  font-size: clamp(25px, 4vw, 32px);
  line-height: 1.35;
  margin-bottom: 10px;
  font-weight: 900;
}
.pwa-install-card > p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.9;
}
.pwa-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 20px;
}
.pwa-benefits span {
  padding: 8px 11px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
}
.pwa-ios-help {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #e0f2fe;
  color: #075985;
  font-size: 13px;
  line-height: 1.8;
  border: 1px solid #bae6fd;
}
.pwa-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.pwa-install-btn { min-height: 51px; }
.pwa-privacy-note {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: var(--text-light);
  font-size: 10.5px;
}

/* =====================================================================
   V3.0 — PROTECTED LESSON / YOUTUBE PLAYER SHELL
   ===================================================================== */
body.protected-lesson {
  -webkit-user-select: none;
  user-select: none;
}
.lesson-shell { max-width: 1380px; }
.lesson-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
.lesson-back {
  display: inline-flex;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.lesson-back:hover { color: var(--blue-primary); }
.lesson-heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.lesson-heading-row h1 {
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.35;
  font-weight: 900;
}
.lesson-kicker {
  display: inline-block;
  color: var(--blue-primary);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .2px;
  margin-bottom: 3px;
}
.lesson-progress-chip {
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
}
.lesson-progress-chip strong { color: var(--blue-primary); font-size: 18px; }
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 22px;
}
.lesson-main { min-width: 0; }
.lesson-player-card,
.lesson-parts-panel,
.lesson-extra-card,
.lesson-locked-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}
.lesson-player-card { padding: 14px; }
.lesson-player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 4px 14px;
}
.lesson-player-head span:first-child {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
}
.lesson-player-head h2 {
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 900;
  margin-top: 2px;
}
.lesson-protected-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  font-size: 11px;
  font-weight: 900;
}
.protected-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #02070e;
  border-radius: 19px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}
.protected-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 1;
}
.lesson-video-topmask {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 78px;
  padding: 14px 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  color: #fff;
  background: linear-gradient(180deg, rgba(1,8,17,.91), rgba(1,8,17,.48) 62%, transparent);
  pointer-events: none;
}
.lesson-video-topmask > span {
  font-family: var(--font-en), var(--font-main);
  font-size: 10px;
  color: rgba(255,255,255,.58);
  padding-top: 4px;
}
.lesson-video-brandmark {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 68%;
}
.lesson-video-brandmark img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.2);
}
.lesson-video-brandmark div { min-width: 0; display: grid; }
.lesson-video-brandmark strong {
  font-family: var(--font-en), var(--font-main);
  font-size: 11px;
  letter-spacing: .5px;
}
.lesson-video-brandmark small {
  font-size: 11px;
  color: rgba(255,255,255,.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-video-watermark[hidden] { display: none !important; }
.student-video-watermark {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  min-width: 145px;
  max-width: 230px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  color: rgba(255,255,255,.48);
  background: rgba(2,10,20,.22);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
  opacity: 0;
  transition: transform 1.15s cubic-bezier(.2,.75,.2,1), opacity .2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.student-video-watermark.is-visible { opacity: 1; }
.student-video-watermark strong,
.student-video-watermark span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.student-video-watermark strong { font-size: 11px; font-weight: 900; }
.student-video-watermark span {
  direction: ltr;
  text-align: left;
  font-family: var(--font-en), monospace;
  font-size: 10px;
  letter-spacing: .6px;
  margin-top: 1px;
}
.capture-shield-layer {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 5px;
  padding: 30px;
  color: #fff;
  background: #020b16;
  opacity: 0;
  visibility: hidden;
  transition: .12s ease;
  pointer-events: none;
}
.capture-shield-layer div { font-size: 34px; }
.capture-shield-layer strong { font-size: 19px; }
.capture-shield-layer small { color: #9db2ca; }
.protected-player.capture-shield .capture-shield-layer {
  opacity: 1;
  visibility: visible;
}
.protected-player.capture-shield iframe,
.protected-player.capture-shield .student-video-watermark { visibility: hidden; }
.lesson-player-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 5px 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.lesson-player-note p { margin: 0; }
.lesson-primary-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 4px 4px;
  border-top: 1px solid var(--border-light);
}
.lesson-primary-actions form { flex: 1 1 240px; }
.lesson-primary-actions .btn { min-height: 48px; }
.lesson-complete-btn { width: 100%; }
.lesson-quiz-btn { flex: 1 1 220px; }
.btn.disabled {
  opacity: .5;
  pointer-events: none;
  filter: grayscale(.15);
}
.lesson-no-quiz {
  flex: 1 1 220px;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.lesson-nav-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  padding: 0 4px 4px;
}
.lesson-nav-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-subtle);
}
.lesson-nav-btn:hover { border-color: var(--blue-primary); background: var(--surface-hover); }
.lesson-nav-btn.next { justify-content: flex-end; text-align: left; }
.lesson-nav-btn div { min-width: 0; display: grid; }
.lesson-nav-btn small { font-size: 9.5px; color: var(--text-muted); }
.lesson-nav-btn b { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-nav-btn > span { color: var(--blue-primary); font-weight: 900; }
.lesson-nav-btn.locked { opacity: .55; cursor: not-allowed; }
.lesson-parts-panel {
  position: sticky;
  top: 100px;
  padding: 18px;
}
.lesson-parts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.lesson-parts-head span { color: var(--text-muted); font-size: 10.5px; font-weight: 800; }
.lesson-parts-head h3 { font-size: 19px; font-weight: 900; }
.lesson-parts-head strong { color: var(--blue-primary); font-size: 20px; }
.lesson-progress { height: 7px; margin-bottom: 15px; }
.lesson-parts-list { display: grid; gap: 7px; }
.lesson-part-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  transition: var(--transition);
}
.lesson-part-row:hover { border-color: var(--border); transform: translateX(-2px); }
.lesson-part-row.active {
  background: rgba(2,132,199,.08);
  border-color: rgba(2,132,199,.32);
  box-shadow: inset -3px 0 0 var(--blue-primary);
}
.lesson-part-row.done .lesson-part-index {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-border);
}
.lesson-part-row.locked { opacity: .48; cursor: not-allowed; }
.lesson-part-index {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--blue-primary);
  font-size: 12px;
  font-weight: 900;
}
.lesson-part-row div { min-width: 0; display: grid; }
.lesson-part-row b {
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lesson-part-row small { color: var(--text-muted); font-size: 9.5px; margin-top: 1px; }
.lesson-part-state { color: var(--blue-primary); font-size: 11px; }
.lesson-subject-link {
  display: block;
  text-align: center;
  margin-top: 13px;
  padding: 10px;
  color: var(--blue-primary);
  font-size: 11.5px;
  font-weight: 900;
  border-top: 1px solid var(--border-light);
}
.lesson-extra-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 15px;
  padding: 18px;
}
.lesson-extra-icon {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 20px;
}
.lesson-extra-content h3 { font-size: 17px; margin-bottom: 4px; }
.lesson-extra-content p { color: var(--text-muted); font-size: 12.5px; margin-bottom: 10px; }
.lesson-locked-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 220px;
  padding: 32px;
}
.lesson-lock-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.lesson-locked-card h2 { font-size: 22px; }
.lesson-locked-card p { color: var(--text-muted); margin-top: 5px; }
.lesson-empty { text-align: center; padding: 50px 20px; }
.lesson-empty-icon { font-size: 46px; margin-bottom: 8px; }

@media (max-width: 1050px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-parts-panel { position: static; }
  .lesson-sidebar { order: -1; }
  .lesson-parts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .pwa-install-card { border-radius: 24px; padding: 24px 20px 20px; }
  .pwa-actions { grid-template-columns: 1fr; }
  .pwa-actions .btn { width: 100%; }
  .lesson-topbar { align-items: flex-start; flex-direction: column; }
  .lesson-progress-chip { width: 100%; }
  .lesson-player-card { padding: 8px; border-radius: 18px; }
  .lesson-player-head { padding: 4px 4px 10px; }
  .lesson-protected-badge { display: none; }
  .protected-player { border-radius: 14px; }
  .lesson-video-topmask { height: 60px; padding: 9px 10px; }
  .lesson-video-brandmark img { width: 32px; height: 32px; border-radius: 9px; }
  .lesson-video-brandmark strong { font-size: 9.5px; }
  .lesson-video-brandmark small { font-size: 9px; }
  .student-video-watermark { min-width: 118px; max-width: 165px; padding: 6px 8px; }
  .student-video-watermark strong { font-size: 9px; }
  .student-video-watermark span { font-size: 8.5px; }
  .lesson-primary-actions { display: grid; grid-template-columns: 1fr; }
  .lesson-nav-actions { grid-template-columns: 1fr; }
  .lesson-parts-list { grid-template-columns: 1fr; }
  .lesson-sidebar { order: 0; }
}

@media print {
  body.protected-lesson * { visibility: hidden !important; }
  body.protected-lesson::before {
    content: 'المحتوى التعليمي محمي وغير متاح للطباعة.';
    visibility: visible !important;
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font: 700 22px Cairo, sans-serif;
  }
}

/* =====================================================================
   V3.0 — STUDENT DASHBOARD
   ===================================================================== */
.student-dashboard { max-width: 1320px; }
.student-dashboard-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 10%, rgba(56,189,248,.15), transparent 24%),
    linear-gradient(135deg, #07162e 0%, #0b2850 62%, #0b3967 100%);
  color: #fff;
  box-shadow: 0 22px 58px rgba(3, 22, 45, .18);
  margin-bottom: 20px;
}
.student-dashboard-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000);
  pointer-events: none;
}
.student-dashboard-welcome { position: relative; z-index: 1; max-width: 760px; }
.student-dashboard-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56,189,248,.13);
  border: 1px solid rgba(125,211,252,.24);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 10px;
}
.student-dashboard-welcome h1 {
  color: #fff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.32;
  font-weight: 900;
  margin-bottom: 7px;
}
.student-dashboard-welcome > p { color: #bfd1e7; font-size: 14.5px; }
.student-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.student-meta-pills span,
.student-meta-pills button {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #d8e8f8;
  padding: 8px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.student-meta-pills button { cursor: pointer; }
.student-meta-pills button:hover { background: rgba(255,255,255,.12); }
.student-overall-progress {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 16px;
  border-radius: 21px;
  background: rgba(4,17,33,.45);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
.student-progress-ring {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#38bdf8 var(--progress), rgba(255,255,255,.12) 0);
  padding: 7px;
}
.student-progress-ring > div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #091b33;
  display: grid;
  place-content: center;
  text-align: center;
}
.student-progress-ring strong { font: 900 22px var(--font-en), var(--font-main); }
.student-progress-ring small { color: #9fb8d2; font-size: 9px; }
.student-overall-progress > div:last-child { display: grid; }
.student-overall-progress > div:last-child b { font-size: 16px; }
.student-overall-progress > div:last-child span { color: #9fb8d2; font-size: 10px; }

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, .7fr);
  gap: 16px;
  margin-bottom: 16px;
}
.continue-learning-card {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.continue-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  box-shadow: 0 10px 28px rgba(2,132,199,.25);
  font-size: 18px;
}
.continue-copy { min-width: 0; }
.continue-copy > span { color: var(--blue-primary); font-size: 10.5px; font-weight: 900; }
.continue-copy h2 {
  font-size: clamp(17px, 2vw, 22px);
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-copy p { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-quick-links {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}
.dashboard-quick-links a {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 13px;
}
.dashboard-quick-links a:hover { background: var(--bg-subtle); }
.dashboard-quick-links a > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bg-subtle);
}
.dashboard-quick-links div { display: grid; }
.dashboard-quick-links b { font-size: 12.5px; }
.dashboard-quick-links small { font-size: 9.5px; color: var(--text-muted); }
.dashboard-quick-links i { font-style: normal; color: var(--blue-primary); }
.dashboard-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.dashboard-mini-stats > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 17px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.dashboard-mini-stats span { color: var(--text-muted); font-size: 11px; font-weight: 800; }
.dashboard-mini-stats strong { color: var(--blue-primary); font-size: 17px; font-weight: 900; }
.student-lessons-section { margin-top: 6px; }
.student-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.student-section-head span { color: var(--blue-primary); font-size: 10px; font-weight: 900; }
.student-section-head h2 { font-size: 24px; font-weight: 900; }
.student-section-head > a { color: var(--blue-primary); font-size: 11.5px; font-weight: 900; }
.student-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.student-subject-card {
  overflow: hidden;
  border-radius: 21px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.student-subject-card:hover { transform: translateY(-3px); border-color: rgba(2,132,199,.45); box-shadow: var(--shadow-md); }
.student-subject-cover {
  position: relative;
  height: 152px;
  background: linear-gradient(135deg, #07162e, #0a3667);
  overflow: hidden;
}
.student-subject-cover img { width: 100%; height: 100%; object-fit: cover; }
.student-subject-cover::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(2,8,18,.55));
}
.student-subject-cover > span {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 10px;
  min-width: 44px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(3,14,28,.7);
  border: 1px solid rgba(255,255,255,.18);
  font: 800 10px var(--font-en), var(--font-main);
}
.student-subject-placeholder { height: 100%; display: grid; place-items: center; font-size: 44px; }
.student-subject-body { padding: 15px; }
.student-subject-body small { color: var(--green); font-size: 9.5px; font-weight: 900; }
.student-subject-body h3 { font-size: 16px; margin: 2px 0 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-subject-body .progress { height: 6px; margin-bottom: 7px; }
.student-subject-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.student-subject-meta span { color: var(--text-muted); font-size: 9.5px; }
.student-subject-meta b { color: var(--blue-primary); font-size: 10.5px; }
.student-empty-state { text-align: center; padding: 50px 20px; }
.student-empty-state > div { font-size: 44px; }
.student-empty-state p { color: var(--text-muted); margin: 6px auto 18px; }

@media (max-width: 1050px) {
  .dashboard-focus-grid { grid-template-columns: 1fr; }
  .student-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .student-dashboard-hero { align-items: flex-start; flex-direction: column; }
  .student-overall-progress { width: 100%; justify-content: space-between; }
  .continue-learning-card { grid-template-columns: 48px 1fr; }
  .continue-learning-card > .btn { grid-column: 1 / -1; width: 100%; }
  .dashboard-mini-stats { grid-template-columns: 1fr; }
  .student-subject-grid { grid-template-columns: 1fr; }
  .student-section-head { align-items: center; }
}

/* ===== Student support + certificates V2 ===== */
.nav-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#ff5a66;color:#fff;font-size:10px;font-weight:900;margin-inline-start:5px}
.support-page-head{align-items:center}.support-head-badge{min-width:105px;padding:13px 16px;border:1px solid var(--border);border-radius:16px;background:var(--surface);text-align:center}.support-head-badge strong{display:block;font-size:24px;color:var(--blue-primary)}.support-head-badge span{font-size:11px;color:var(--text-muted)}.support-workspace{display:grid;grid-template-columns:minmax(300px,.75fr) minmax(0,1.25fr);gap:16px;align-items:stretch}.support-inbox,.support-chat{padding:0;overflow:hidden;min-height:590px}.support-inbox-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px;border-bottom:1px solid var(--border)}.support-inbox-head h3{margin:0}.support-inbox-head small{display:block;color:var(--text-muted);margin-top:3px}.support-new-box{padding:14px 16px;border-bottom:1px solid var(--border);background:var(--bg-subtle)}.support-ticket-list{max-height:520px;overflow:auto}.support-ticket{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;padding:13px 14px;border-bottom:1px solid var(--border);text-decoration:none;color:var(--text);transition:.18s ease}.support-ticket:hover,.support-ticket.active{background:var(--bg-subtle)}.support-ticket.active{box-shadow:inset -3px 0 var(--blue-primary)}.support-ticket-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:rgba(8,127,195,.09)}.support-ticket-copy{min-width:0}.support-ticket-copy>div{display:flex;align-items:center;gap:6px}.support-ticket-copy b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.support-ticket-copy p{margin:4px 0;color:var(--text-muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.support-ticket-copy small{font-size:9px;color:var(--text-muted)}.support-unread{min-width:19px;height:19px;padding:0 5px;display:inline-grid;place-items:center;border-radius:999px;background:var(--blue-primary);color:#fff;font-size:9px;font-weight:900}.support-chat{display:flex;flex-direction:column}.support-chat-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border)}.support-chat-head span:first-child{color:var(--text-muted);font-size:10px}.support-chat-head h2{margin:3px 0 0;font-size:18px}.support-messages{height:440px;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:10px;background:linear-gradient(180deg,var(--bg-subtle),transparent)}.support-bubble-wrap{display:flex}.support-bubble-wrap.mine{justify-content:flex-start}.support-bubble-wrap.theirs{justify-content:flex-end}.support-bubble{max-width:78%;padding:11px 13px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-sm)}.support-bubble-wrap.mine .support-bubble{background:linear-gradient(135deg,rgba(8,127,195,.14),rgba(0,188,212,.06));border-color:rgba(8,127,195,.2)}.support-bubble-name{font-size:10px;font-weight:900;color:var(--blue-primary)}.support-bubble p{margin:5px 0;line-height:1.85;font-size:13px}.support-bubble small{color:var(--text-muted);font-size:9px}.support-composer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:13px;border-top:1px solid var(--border);margin-top:auto}.support-composer textarea{resize:none;min-height:50px}.support-closed-note{margin:14px;padding:13px;border-radius:12px;background:var(--bg-subtle);color:var(--text-muted);text-align:center;font-size:12px}.support-chat-empty{min-height:500px;display:grid;place-items:center;align-content:center;text-align:center;padding:28px}.support-chat-empty>div{font-size:44px}.support-chat-empty h2{margin:10px 0 6px}.support-chat-empty p{margin:0;color:var(--text-muted);max-width:430px;line-height:1.8}
.student-certificates-section,.student-results-section{margin-top:28px}.student-certificate-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.student-certificate-card{display:flex;gap:13px;align-items:flex-start;padding:16px;border:1px solid var(--border);background:var(--surface);border-radius:17px;text-decoration:none;color:var(--text);box-shadow:var(--shadow-sm);transition:.18s ease}.student-certificate-card:hover{transform:translateY(-2px);border-color:rgba(8,127,195,.28);box-shadow:var(--shadow)}.student-cert-icon{width:48px;height:48px;display:grid;place-items:center;flex:0 0 auto;border-radius:14px;background:rgba(247,181,0,.12);font-size:23px}.student-certificate-card small{color:var(--text-muted);font-size:10px}.student-certificate-card h3{margin:3px 0 5px;font-size:15px}.student-certificate-card p{margin:0 0 8px;color:var(--text-muted);font-size:11px;line-height:1.6}.student-certificate-card span{color:var(--blue-primary);font-size:11px;font-weight:900}.certificate-toolbar{display:flex;justify-content:center;gap:8px;margin:18px auto}.manual-certificate h2{max-width:760px;margin:14px auto;font-size:20px;line-height:1.7}.certificate-revoked{margin:20px auto 0;max-width:560px;padding:12px;border:2px solid #d94a54;color:#d94a54;font-weight:900;border-radius:10px}.manual-certificate.revoked{filter:grayscale(.35);opacity:.75}
@media(max-width:900px){.support-workspace{grid-template-columns:1fr}.support-inbox,.support-chat{min-height:auto}.support-ticket-list{max-height:360px}.support-messages{height:430px}.support-composer{grid-template-columns:1fr}.student-certificate-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.student-certificate-grid{grid-template-columns:1fr}.support-ticket{grid-template-columns:34px minmax(0,1fr)}.support-ticket>.badge{grid-column:2;justify-self:start}.support-bubble{max-width:90%}}
@media print{
  .print-hide,.topbar,.admin-topbar,.footer,.wa-float,.pwa-install-modal{display:none!important}
  body{background:#fff!important}
  .certificate{box-shadow:none!important;margin:0 auto!important;max-width:100%!important;min-height:0!important}
}


/* ===== MEDxBasha V4 UX patch ===== */
.optional-label{font-size:11px;color:var(--text-muted);font-weight:600}.auth-help-row{display:flex;justify-content:flex-start;margin-top:-4px;margin-bottom:10px}.auth-help-row a{font-size:13px;font-weight:800;color:var(--blue-primary)}
.brand-hero-title{font-size:clamp(48px,7vw,88px)!important;letter-spacing:-2px}.landing-tagline{font-size:clamp(26px,3vw,42px);font-weight:900;color:#7eeaff;margin:8px 0}.lecturer-name{font-family:'Plus Jakarta Sans',sans-serif;font-size:clamp(18px,2vw,28px);font-weight:800;color:#fff;margin:2px 0 22px}.hero-text-link{display:inline-flex;align-items:center;padding:12px 4px;color:#d8efff;font-weight:900;text-decoration:none;border-bottom:1px solid transparent}.hero-text-link:hover{border-bottom-color:currentColor}
.register-art img{object-fit:contain;object-position:center bottom;background:transparent}.single-auth{grid-template-columns:minmax(0,620px);justify-content:center}.single-auth .auth-card{width:100%}
.student-menu-btn{display:none;width:44px;height:44px;border:1px solid var(--border);border-radius:14px;background:var(--card);align-items:center;justify-content:center;gap:4px;flex-direction:column}.student-menu-btn span{width:20px;height:2px;background:var(--text);border-radius:2px}.student-drawer,.student-drawer-backdrop{display:none}
.checkout-dock{position:sticky;bottom:14px;z-index:20;margin-top:24px;padding:20px;border:1px solid var(--border);border-radius:24px;background:color-mix(in srgb,var(--card) 93%,transparent);backdrop-filter:blur(18px);box-shadow:0 18px 50px rgba(4,25,54,.16);display:grid;grid-template-columns:1.4fr .5fr auto;gap:20px;align-items:center}.plan-switch{display:flex;gap:8px;flex-wrap:wrap}.plan-switch label{border:1px solid var(--border);padding:9px 13px;border-radius:999px;font-weight:800}.checkout-total strong{font-size:25px;display:block}.checkout-code-note{font-size:12px;color:var(--text-muted);margin-top:10px}.checkout-actions{display:flex;gap:8px;flex-wrap:wrap}.subject-card.selectable{cursor:pointer}.subject-select-line{display:flex;align-items:center;gap:10px}.subject-select-line input{width:20px;height:20px}.plan-prices{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:12px}.plan-prices span{background:var(--soft);border-radius:12px;padding:8px;font-size:11px;display:grid}.plan-prices b{font-size:12px}.already-enrolled{opacity:.72}.store-empty{padding:44px;text-align:center}
.dashboard-schedule{margin-top:24px}.schedule-list{display:grid;gap:10px}.schedule-row{display:flex;align-items:center;gap:16px;padding:14px;border:1px solid var(--border);border-radius:16px;background:var(--soft)}.schedule-time{min-width:100px;font-family:'Plus Jakarta Sans';font-weight:900;color:var(--blue-primary)}.schedule-row>div:last-child{display:grid;gap:2px}.schedule-row span,.schedule-row small{color:var(--text-muted);font-size:12px}
.support-visibility{display:grid;gap:8px;margin:10px 0}.support-visibility label{padding:10px;border:1px solid var(--border);border-radius:12px}.support-public{margin-top:22px}.public-question-list{display:grid;gap:8px}.public-question-list a{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:14px;border:1px solid var(--border);border-radius:14px;color:var(--text);text-decoration:none}.public-question-list small{grid-column:1;color:var(--text-muted)}.public-question-list span{color:var(--green);font-weight:800}
.book-filter{max-width:560px}.book-package details summary{list-style:none;cursor:pointer}.book-order-form{display:grid;gap:12px;margin-top:14px}.choice-row{display:block;padding:10px;border:1px solid var(--border);border-radius:12px;margin:7px 0}
.protected-player iframe{pointer-events:none}.video-tap-layer{position:absolute;inset:62px 0 68px;z-index:7;border:0;background:transparent;cursor:pointer}.custom-video-controls{position:absolute;z-index:9;left:12px;right:12px;bottom:10px;min-height:52px;border-radius:16px;background:rgba(4,17,37,.86);backdrop-filter:blur(12px);display:grid;grid-template-columns:auto auto auto minmax(80px,1fr) auto auto;gap:8px;align-items:center;padding:9px 10px;color:#fff}.custom-video-controls button{border:0;background:rgba(255,255,255,.11);color:#fff;border-radius:10px;min-width:42px;height:36px;font-weight:900}.custom-video-controls input[type=range]{width:100%;accent-color:#19b8ec}.custom-video-controls span{font:700 11px 'Plus Jakarta Sans';white-space:nowrap}.student-video-watermark{opacity:.28!important;pointer-events:none}.student-video-watermark.is-visible{opacity:.28!important}
@media(max-width:768px){body:not(.admin-ui){padding-top:0}.student-mobile-header{padding-top:calc(env(safe-area-inset-top,0px) + 10px)!important;min-height:calc(70px + env(safe-area-inset-top,0px));position:sticky;top:0;z-index:100}.student-mobile-header .desktop-student-nav,.student-mobile-header .desktop-logout,.student-mobile-header .user-pill{display:none!important}.student-mobile-header .brand-text{display:grid!important}.student-mobile-header .brand img{width:42px!important;height:42px!important}.student-menu-btn{display:flex}.student-drawer-backdrop{display:block;position:fixed;inset:0;z-index:190;background:rgba(2,12,28,.52);backdrop-filter:blur(3px)}.student-drawer-backdrop[hidden]{display:none}.student-drawer{display:flex;position:fixed;z-index:200;top:0;bottom:0;right:0;width:min(86vw,360px);padding:calc(env(safe-area-inset-top,0px) + 18px) 18px calc(env(safe-area-inset-bottom,0px) + 18px);background:var(--card);box-shadow:-20px 0 50px rgba(0,0,0,.22);transform:translateX(105%);transition:transform .26s ease;flex-direction:column}.student-drawer.open{transform:translateX(0)}.student-drawer-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:18px;border-bottom:1px solid var(--border)}.student-drawer-head>div{display:grid}.student-drawer-head small{color:var(--text-muted)}.student-drawer-head button{border:0;background:var(--soft);width:40px;height:40px;border-radius:12px;font-size:25px}.student-drawer nav{display:grid;gap:8px;padding:16px 0}.student-drawer nav a{display:flex;align-items:center;gap:11px;padding:13px;border-radius:14px;color:var(--text);text-decoration:none;font-weight:800}.student-drawer nav a:hover{background:var(--soft)}.student-drawer nav b{margin-inline-start:auto;background:var(--red);color:#fff;border-radius:99px;padding:2px 7px}.student-drawer-foot{margin-top:auto;display:grid;gap:10px}.drawer-logout{padding:13px;border-radius:14px;background:#fff0f0;color:#c62828;text-align:center;font-weight:900;text-decoration:none}.student-menu-open{overflow:hidden}.checkout-dock{position:static;grid-template-columns:1fr}.plan-prices{grid-template-columns:1fr}.custom-video-controls{grid-template-columns:auto auto auto 1fr auto;bottom:8px}.custom-video-controls [data-video-time]{display:none}.video-tap-layer{inset:60px 0 66px}.wa-float{display:none!important}}
@media(max-width:480px){.student-mobile-header .brand-text span:last-child{display:none}.student-mobile-header{padding-inline:14px}.custom-video-controls{left:6px;right:6px;gap:4px;padding:7px}.custom-video-controls button{min-width:36px;font-size:11px}.schedule-row{align-items:flex-start;flex-direction:column}.schedule-time{min-width:0}}

/* =====================================================================
   V4.1 — ORGANIZED LECTURES / MOBILE CONTENT FIX / VIDEO COVER
   ===================================================================== */
body:not(.admin-ui) { overflow-x: hidden; }
.subject-page-shell { max-width: 1120px; }
.subject-back-row { margin-bottom: 16px; }
.subject-back-row a { color: var(--text-muted); font-size: 13px; font-weight: 800; }
.subject-hero-main { flex: 1 1 560px; min-width: 0; }
.subject-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.subject-hero-card p { color: var(--text-muted); font-size: 14px; line-height: 1.85; margin: 0 0 15px; }
.subject-progress-wrap { max-width: 430px; }
.subject-progress-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 11px; }
.subject-progress-label span { color: var(--text-muted); font-weight: 800; }
.subject-progress-label strong { color: var(--blue-primary); font-weight: 900; }
.subject-hero-actions { display: grid; gap: 9px; width: min(100%, 250px); }
.subject-hero-actions .btn { width: 100%; justify-content: center; }
.subject-content-stack { width: min(920px, 100%); margin-inline: auto; }
.lecture-chapter-block { width: 100%; min-width: 0; }
.lecture-chapter-block .chapter-header p { color: var(--text-muted); font-size: 11.5px; margin: 4px 0 0; line-height: 1.7; }
.lecture-group-list { display: grid; gap: 16px; }
.lecture-group-card {
  width: 100%; min-width: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg-subtle); box-shadow: var(--shadow-sm);
}
.lecture-group-card.completed { border-color: var(--green-border); }
.lecture-group-head { display: grid; grid-template-columns: 128px minmax(0,1fr); gap: 16px; padding: 16px; align-items: stretch; }
.lecture-group-cover { min-height: 92px; border-radius: 15px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.lecture-group-cover img { width: 100%; height: 100%; min-height: 92px; object-fit: cover; display: block; }
.lecture-group-cover span { font-size: 31px; }
.lecture-group-main { min-width: 0; }
.lecture-group-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.lecture-group-title-row > div { min-width: 0; }
.lecture-group-title-row small { color: var(--blue-primary); font-size: 9.5px; font-weight: 900; }
.lecture-group-title-row h3 { font-size: 18px; line-height: 1.55; margin: 2px 0 0; overflow-wrap: anywhere; }
.lecture-group-description { color: var(--text-muted); font-size: 11.5px; line-height: 1.75; margin: 7px 0 10px; }
.lecture-group-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.lecture-group-progress .progress { margin: 0; height: 6px; }
.lecture-group-progress b { color: var(--blue-primary); font-size: 10px; }
.lecture-parts-preview { border-top: 1px solid var(--border); background: var(--surface); padding: 10px; display: grid; gap: 7px; }
.lecture-part-preview { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid transparent; border-radius: 13px; color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.lecture-part-preview:hover { border-color: rgba(2,132,199,.35); background: var(--surface-hover); }
.lecture-part-preview.done { background: var(--green-bg); border-color: var(--green-border); }
.lecture-part-preview.locked { opacity: .55; cursor: not-allowed; }
.lecture-part-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--blue-primary); font-size: 11px; font-weight: 900; }
.lecture-part-preview.done .lecture-part-number { color: var(--green); border-color: var(--green-border); }
.lecture-part-preview > div { min-width: 0; display: grid; }
.lecture-part-preview strong { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.lecture-part-preview small { color: var(--text-muted); font-size: 9.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lecture-part-arrow { color: var(--blue-primary); font-weight: 900; font-size: 11px; }
.lecture-group-actions { padding: 11px 16px 15px; display: flex; justify-content: flex-end; background: var(--surface); }
.lecture-group-actions .btn { min-width: 160px; justify-content: center; }
.lecture-no-parts,.subject-empty-inline { padding: 18px; text-align: center; color: var(--text-muted); font-size: 11px; }
.subject-empty { text-align: center; padding: 46px 20px; }
.subject-empty > div { font-size: 42px; margin-bottom: 8px; }

.lesson-heading-description { max-width: 780px; margin: 7px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.8; }
.lesson-player-head > div { min-width: 0; }
.lesson-video-description { max-width: 760px; color: var(--text-muted); font-size: 11px; line-height: 1.8; margin: 5px 0 0; white-space: normal; overflow-wrap: anywhere; }
.lesson-video-cover {
  position: absolute; inset: 0; z-index: 8; border: 0; padding: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  cursor: pointer; transition: opacity .22s ease, visibility .22s ease;
}
.lesson-video-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(1,8,17,.14),rgba(1,8,17,.62)); }
.lesson-video-cover.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.lesson-cover-play { position: absolute; z-index: 2; inset: 50% auto auto 50%; transform: translate(-50%,-50%); width: 72px; height: 72px; display: grid; place-items: center; border-radius: 999px; padding-inline-start: 5px; background: rgba(4,143,209,.94); color: #fff; box-shadow: 0 14px 35px rgba(0,0,0,.32); font-size: 29px; }
.lesson-cover-caption { position: absolute; z-index: 2; inset-inline: 18px; bottom: 78px; display: grid; color: #fff; text-align: right; text-shadow: 0 2px 8px rgba(0,0,0,.65); }
.lesson-cover-caption strong { font-size: 15px; }
.lesson-cover-caption small { color: rgba(255,255,255,.8); font-size: 10px; margin-top: 2px; }

@media (max-width: 700px) {
  .page-shell { width: calc(100% - 22px); margin-top: 18px; }
  .subject-hero-card { padding: 17px; border-radius: 20px; gap: 16px; }
  .subject-hero-card h1 { font-size: 25px; }
  .subject-hero-actions { width: 100%; grid-template-columns: 1fr; }
  .subject-progress-label { align-items: flex-start; flex-direction: column; gap: 3px; }
  .chapter-card { padding: 13px; border-radius: 18px; }
  .chapter-header { align-items: flex-start; margin-bottom: 12px; padding-bottom: 11px; }
  .chapter-header h3 { font-size: 17px; }
  .lecture-group-head { grid-template-columns: 1fr; padding: 11px; gap: 10px; }
  .lecture-group-cover { min-height: 150px; max-height: 190px; }
  .lecture-group-cover img { min-height: 150px; max-height: 190px; }
  .lecture-group-title-row { gap: 7px; }
  .lecture-group-title-row h3 { font-size: 15px; }
  .lecture-group-title-row .badge { flex: 0 0 auto; font-size: 9px; }
  .lecture-parts-preview { padding: 8px; }
  .lecture-part-preview { grid-template-columns: 31px minmax(0,1fr) auto; gap: 8px; padding: 8px; }
  .lecture-part-number { width: 31px; height: 31px; }
  .lecture-part-preview strong { font-size: 11px; }
  .lecture-group-actions { padding: 9px 11px 12px; }
  .lecture-group-actions .btn { width: 100%; min-width: 0; }
  .lesson-heading-row h1 { overflow-wrap: anywhere; }
  .lesson-video-description { font-size: 10px; }
  .lesson-cover-play { width: 58px; height: 58px; font-size: 23px; }
  .lesson-cover-caption { bottom: 68px; inset-inline: 11px; }
  .lesson-cover-caption strong { font-size: 12px; }
}

/* V4.2.1 — points & package-access helpers */
.student-point-list{display:flex;flex-direction:column;margin-top:10px}.student-point-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 0;border-bottom:1px solid var(--border)}.student-point-row:last-child{border-bottom:0}.student-point-main{display:grid;gap:3px;min-width:0}.student-point-main strong{font-size:13px}.student-point-main small{color:var(--text-muted);font-size:10px}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:18px;display:grid;gap:5px;box-shadow:var(--shadow-sm)}.stat-card small,.stat-card span{color:var(--text-muted)}.stat-card strong{font-size:28px;color:var(--blue-primary)}
@media(max-width:900px){.dashboard-mini-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.dashboard-mini-stats{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr!important}}


/* =====================================================================
   V4.2.4 — UI/UX POLISH
   Responsive navigation, readable mobile data, accessibility and store UX.
   ===================================================================== */

/* Consistent keyboard focus across public + student UI. */
body:not(.admin-ui) :is(a,button,input,select,textarea,summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue-primary) 62%, white);
  outline-offset: 3px;
}
.topbar nav a[aria-current="page"],
.student-drawer nav a[aria-current="page"] {
  color: var(--blue-primary);
  background: var(--bg-subtle);
  font-weight: 900;
}
.student-drawer nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--blue-primary); }

/* Compact footer inside the signed-in student application. */
.student-app-footer { border-top:1px solid var(--border); background:var(--surface); margin-top:42px; }
.student-app-footer .container { min-height:68px; display:flex; align-items:center; justify-content:space-between; gap:18px; color:var(--text-muted); font-size:12px; }
.student-app-footer nav { display:flex; gap:14px; flex-wrap:wrap; }
.student-app-footer a { color:var(--text-muted); font-weight:800; }
.student-app-footer a:hover { color:var(--blue-primary); }

/* The public mobile header keeps only brand + theme action; auth actions already live in bottom nav. */
@media (max-width:768px) {
  .public-topbar .public-auth-action { display:none; }
  .public-topbar .nav-actions { margin-inline-start:auto; }
  .public-topbar .brand { min-width:0; }
  .public-topbar .brand-text { min-width:0; }
}
@media (max-width:430px) {
  .public-topbar .brand-text span:last-child { display:none; }
  .public-topbar .brand img { width:46px; height:40px; }
}

/* Student navigation moves to the drawer on tablet too, avoiding the 769–1050px squeeze. */
@media (max-width:1080px) {
  .student-mobile-header { padding-top:calc(env(safe-area-inset-top,0px) + 10px)!important; min-height:calc(70px + env(safe-area-inset-top,0px)); position:sticky; top:0; z-index:100; }
  .student-mobile-header .desktop-student-nav,.student-mobile-header .desktop-logout,.student-mobile-header .user-pill { display:none!important; }
  .student-mobile-header .brand-text { display:grid!important; }
  .student-mobile-header .brand img { width:42px!important; height:42px!important; }
  .student-menu-btn { display:flex; flex:0 0 44px; }
  .student-drawer-backdrop { display:block; position:fixed; inset:0; z-index:190; background:rgba(2,12,28,.52); backdrop-filter:blur(3px); }
  .student-drawer-backdrop[hidden] { display:none; }
  .student-drawer { display:flex; position:fixed; z-index:200; top:0; bottom:0; right:0; width:min(86vw,360px); padding:calc(env(safe-area-inset-top,0px) + 18px) 18px calc(env(safe-area-inset-bottom,0px) + 18px); background:var(--card); box-shadow:-20px 0 50px rgba(0,0,0,.22); transform:translateX(105%); transition:transform .26s ease; flex-direction:column; }
  .student-drawer.open { transform:translateX(0); }
  .student-drawer-head { display:flex; justify-content:space-between; align-items:center; padding-bottom:18px; border-bottom:1px solid var(--border); }
  .student-drawer-head>div { display:grid; }
  .student-drawer-head small { color:var(--text-muted); font-size:12px; }
  .student-drawer-head button { border:0; background:var(--soft); min-width:44px; min-height:44px; border-radius:12px; font-size:25px; }
  .student-drawer nav { display:grid; gap:8px; padding:16px 0; }
  .student-drawer nav a { display:flex; align-items:center; gap:11px; min-height:48px; padding:13px; border-radius:14px; color:var(--text); text-decoration:none; font-weight:800; }
  .student-drawer nav a:hover { background:var(--soft); }
  .student-drawer nav b { margin-inline-start:auto; background:var(--red); color:#fff; border-radius:99px; padding:2px 7px; }
  .student-drawer-foot { margin-top:auto; display:grid; gap:10px; }
  .student-drawer-foot .icon-btn,.drawer-logout { min-height:48px; }
  .drawer-logout { padding:13px; border-radius:14px; background:#fff0f0; color:#c62828; text-align:center; font-weight:900; text-decoration:none; }
  .student-menu-open { overflow:hidden; }
}

/* Store: clearer selection, plan chips and unavailable gateway state. */
.subject-card.selectable { position:relative; border:2px solid transparent; }
.subject-card.selectable::after { content:'✓'; position:absolute; top:12px; inset-inline-start:12px; width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:var(--blue-primary); color:#fff; font-weight:900; opacity:0; transform:scale(.72); transition:.18s ease; box-shadow:var(--shadow-sm); }
.subject-card.selectable.is-selected { border-color:var(--blue-primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--blue-primary) 12%,transparent), var(--shadow-md); }
.subject-card.selectable.is-selected::after { opacity:1; transform:scale(1); }
.subject-card.selectable:has(input:checked) { border-color:var(--blue-primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--blue-primary) 12%,transparent), var(--shadow-md); }
.subject-card.selectable:has(input:checked)::after { opacity:1; transform:scale(1); }
.already-enrolled { opacity:1; }
.already-enrolled .subject-body { background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--green-bg) 42%,transparent)); }
.plan-switch label { cursor:pointer; min-height:44px; display:inline-flex; align-items:center; gap:7px; }
.plan-switch label.is-selected,.plan-switch label:has(input:checked) { color:var(--blue-primary); border-color:var(--blue-primary); background:color-mix(in srgb,var(--blue-primary) 9%,var(--surface)); box-shadow:0 0 0 2px color-mix(in srgb,var(--blue-primary) 10%,transparent); }
.checkout-dock-heading { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.checkout-dock-heading h3 { margin:0; }
.selected-count { display:inline-flex; padding:4px 9px; border-radius:999px; background:var(--bg-subtle); color:var(--blue-primary); font-size:12px; font-weight:900; }
.gateway-disabled { opacity:.58; cursor:not-allowed!important; filter:saturate(.55); box-shadow:none!important; transform:none!important; }

/* Larger touch targets where mobile fingers need them most. */
.custom-video-controls button { min-width:44px; height:44px; }
@media (max-width:480px) {
  .custom-video-controls button { min-width:44px!important; height:44px; font-size:11px; }
  .custom-video-controls { min-height:58px; }
  .student-app-footer .container { min-height:82px; flex-direction:column; justify-content:center; text-align:center; gap:7px; padding-block:12px; }
}

/* Mixed Arabic/English lesson breadcrumbs stay readable and correctly isolated. */
.lesson-breadcrumb { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:9px; color:var(--text-muted); font-size:12px; font-weight:800; }
.lesson-breadcrumb a { color:var(--blue-primary); }
.lesson-breadcrumb b { color:var(--text-muted); unicode-bidi:isolate; }
.lesson-heading-row h1,.lesson-player-head h2 { unicode-bidi:plaintext; }

/* On tablet, keep the video before the parts panel; sidebar follows content. */
@media (min-width:701px) and (max-width:1050px) {
  .lesson-layout { display:flex!important; flex-direction:column; }
  .lesson-main { order:1; }
  .lesson-sidebar { order:2; width:100%; }
  .lesson-parts-panel { position:static!important; }
  .lesson-parts-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
}
@media (max-width:760px) { .lesson-parts-list { grid-template-columns:1fr; } }

/* Quiz progress + urgency + clearer result breakdown. */
.quiz-progress-copy { min-width:0; flex:1; }
.quiz-progress-track { width:min(420px,100%); height:7px; overflow:hidden; border-radius:999px; background:var(--bg-subtle); margin-top:8px; border:1px solid var(--border); }
.quiz-progress-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--blue-primary),var(--cyan)); transition:width .25s ease; }
.timer.urgent { animation:timerPulse 1s ease-in-out infinite; border-color:#f59e0b; color:#b45309; background:#fffbeb; }
.timer.critical { border-color:var(--red); color:#fff; background:var(--red); }
@keyframes timerPulse { 50% { transform:scale(1.04); box-shadow:0 0 0 5px rgba(245,158,11,.12); } }
.quiz-result-breakdown { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin:14px auto 4px; }
.quiz-result-breakdown span { padding:7px 11px; border:1px solid var(--border); border-radius:999px; background:var(--bg-subtle); color:var(--text-muted); font-size:12px; font-weight:800; }
.quiz-result-breakdown .correct { color:#047857; border-color:var(--green-border); background:var(--green-bg); }
.quiz-result-breakdown .incorrect { color:#b91c1c; border-color:var(--red-border); background:var(--red-bg); }

/* Student result/wallet tables become stacked cards instead of horizontal panning. */
@media (max-width:700px) {
  .table.student-responsive-table { min-width:0; border-collapse:separate; border-spacing:0; }
  .student-responsive-table thead { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip:rect(0 0 0 0)!important; white-space:nowrap!important; }
  .student-responsive-table tbody { display:grid; gap:11px; padding:11px; }
  .student-responsive-table tbody tr { display:block; border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--surface); box-shadow:var(--shadow-sm); }
  .student-responsive-table tbody td { display:grid; grid-template-columns:minmax(100px,.7fr) minmax(0,1fr); gap:12px; align-items:center; min-height:46px; padding:10px 12px; border-bottom:1px solid var(--border); font-size:13px; }
  .student-responsive-table tbody td:last-child { border-bottom:0; }
  .student-responsive-table tbody td::before { content:attr(data-label); color:var(--text-muted); font-size:11.5px; font-weight:900; }
  .student-responsive-table tbody td[colspan] { display:block; text-align:center; }
  .student-responsive-table tbody td[colspan]::before { display:none; }
  .student-responsive-table .btn { min-height:44px; }
  .table-wrap:has(.student-responsive-table) { overflow:visible; border:0; box-shadow:none; background:transparent; }
}

/* Readability pass for tiny student metadata. */
.student-point-main small,.dashboard-quick-links small,.lecture-group-title-row small,.lecture-part-preview small,.lesson-cover-caption small { font-size:max(11.5px, .72rem); }
.schedule-row span,.schedule-row small { font-size:12px; }

/* Light theme contrast improvements for small secondary copy. */
:root:not([data-theme="dark"]) { --text-light:#667b94; --text-muted:#4f647d; }

/* V4.2.4 final readability/touch pass after responsive browser testing. */
@media (max-width:1080px) {
  .student-drawer { visibility:hidden; pointer-events:none; }
  .student-drawer.open { visibility:visible; pointer-events:auto; }
}
@media (max-width:768px) {
  .public-topbar nav a { min-height:44px; display:flex; align-items:center; justify-content:center; }
  .student-mobile-header .brand { min-height:44px; }
  .student-meta-pills button { min-height:44px; }
  .student-section-head > a { min-height:44px; display:inline-flex; align-items:center; }
  .student-app-footer a { min-height:44px; display:inline-flex; align-items:center; padding-inline:4px; }
  body:not(.admin-ui) .btn.small { min-height:44px; }
}
.student-progress-ring small,
.student-overall-progress > div:last-child span,
.continue-copy > span,
.student-section-head span,
.student-subject-cover > span,
.student-subject-body small,
.student-subject-meta span,
.student-subject-meta b,
.support-ticket small,
.support-unread,
.support-chat-head span,
.support-bubble-name,
.support-bubble small,
.lesson-video-description,
.lesson-video-brandmark strong,
.lesson-video-brandmark small,
.lesson-video-topmask > span,
.lesson-nav-btn small,
.lesson-parts-head span,
.lesson-part-row small {
  font-size:max(11.5px,.72rem);
}
@media (max-width:768px) {
  .public-topbar .brand { min-height:44px; }
  .auth-help-row a { min-height:44px; display:inline-flex; align-items:center; }
  .student-app-footer a { min-width:44px; justify-content:center; padding-inline:8px; }
  .lesson-breadcrumb a { min-height:44px; display:inline-flex; align-items:center; }
}
.support-chat-head > div > span { font-size:max(11.5px,.72rem); }
/* V4.2.4 final specificity fixes from mobile audit. */
.support-chat-head > div > span:first-child { font-size:11.5px!important; }
.lecture-group-title-row .badge { font-size:11.5px!important; }
.lecture-group-progress b { font-size:11.5px; }
@media (max-width:768px) {
  .subject-back-row a { min-height:44px; display:inline-flex; align-items:center; }
}
@media (max-width:768px) {
  .lesson-back { min-height:44px; display:inline-flex; align-items:center; }
}


/* =====================================================================
   V4.2.5 — STUDENT LAYOUT SPACING HOTFIX
   Keeps short student pages anchored to the bottom of the viewport and
   restores deliberate vertical rhythm between points/wallet cards.
   ===================================================================== */
body.student-ui {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* The main student content owns the remaining viewport height. This keeps
   the footer at the visual bottom on short pages without making it fixed. */
body.student-ui > main {
  flex: 1 0 auto;
}

body.student-ui > .student-app-footer {
  flex: 0 0 auto;
  margin-top: 0;
}

/* Points and wallet intentionally remain stacked, with real breathing room
   instead of touching card borders. */
.student-spaced-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.points-panels,
.wallet-panels {
  margin-top: 4px;
  margin-bottom: 24px;
}

.points-panels > .card,
.wallet-panels > .card {
  margin: 0;
}

@media (max-width: 700px) {
  .student-spaced-stack { gap: 16px; }
  .points-panels,
  .wallet-panels { margin-bottom: 18px; }
}

/* Student navigation uses the drawer on mobile, so the legacy public bottom-nav
   safe area must not leave an artificial 65px gap under the student footer. */
@media (max-width: 768px) {
  body.student-ui { padding-bottom: 0; }
}

/* =====================================================================
   V4.3.0 — QUIZ NAVIGATION, SEQUENTIAL GATES, LIVE SUPPORT & iOS SAFE AREA
   ===================================================================== */

/* iPhone / installed PWA: never let the public app header sit under the status bar. */
@media (max-width:768px) {
  .public-topbar {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    min-height: calc(70px + env(safe-area-inset-top, 0px));
    top: 0;
  }
  .public-topbar nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    min-height: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  body:not(.student-ui):not(.admin-ui) {
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
  }
}
@media (display-mode: standalone) and (max-width:768px) {
  .public-topbar,.student-mobile-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
  }
}

/* Sequential lecture lock state. */
.lecture-group-card.locked { opacity:.78; }
.lecture-group-card.locked .lecture-group-cover { filter:saturate(.5); }
.lecture-group-card.locked .lecture-part-preview.locked { cursor:not-allowed; }

/* Live support badges. */
[data-support-unread-count][hidden] { display:none !important; }
.dashboard-support-link { position:relative; }
.dashboard-support-count {
  margin-inline-start:auto;
  min-width:24px;height:24px;padding:0 7px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--red);color:#fff;font-style:normal;font-size:11px;font-weight:900;
}
.support-live-toast { z-index:3000; }

/* Quiz start / rules screen. */
.quiz-intro-shell { max-width:900px; }
.quiz-start-card h1 { margin:12px 0 18px;font-size:clamp(26px,4vw,38px); }
.quiz-start-stats { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0; }
.quiz-start-stats span { display:grid;gap:3px;padding:14px;border:1px solid var(--border);border-radius:16px;background:var(--bg-subtle);color:var(--text-muted);font-size:12px;text-align:center; }
.quiz-start-stats b { color:var(--text);font-size:20px; }
.quiz-security-warning { display:flex;gap:14px;align-items:flex-start;padding:16px 18px;margin:20px 0;border:1px solid #f59e0b;border-radius:18px;background:#fffbeb;color:#92400e; }
[data-theme="dark"] .quiz-security-warning { background:rgba(245,158,11,.11);color:#fcd34d; }
.quiz-security-warning>div:first-child { font-size:28px;line-height:1; }
.quiz-security-warning strong { display:block;margin-bottom:5px;font-size:16px; }
.quiz-security-warning p { margin:0;line-height:1.85;font-size:13px; }
.quiz-start-rules { margin:18px 0 24px;padding-inline-start:22px;color:var(--text-muted);line-height:2; }
.quiz-start-form { display:flex;gap:10px;flex-wrap:wrap; }

/* Active quiz navigation. */
.quiz-answered-copy { display:block;margin-top:4px;color:var(--text-muted);font-weight:700; }
.quiz-security-strip { margin:-8px 0 16px;padding:10px 14px;border:1px solid var(--border);border-radius:14px;background:var(--bg-subtle);color:var(--text-muted);font-size:12px;font-weight:800;text-align:center; }
.question-card .option:has(input:checked) { border-color:var(--blue-primary);background:color-mix(in srgb,var(--blue-primary) 8%,var(--surface));box-shadow:0 0 0 2px color-mix(in srgb,var(--blue-primary) 8%,transparent); }
.quiz-question-palette { display:flex;gap:8px;flex-wrap:wrap;margin:24px 0 8px;padding-top:18px;border-top:1px solid var(--border); }
.quiz-question-palette button { width:40px;height:40px;border-radius:11px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font:800 13px var(--font-main);cursor:pointer; }
.quiz-question-palette button.answered { border-color:var(--green-border);background:var(--green-bg);color:var(--green); }
.quiz-question-palette button.current { border-color:var(--blue-primary);background:var(--blue-primary);color:#fff;box-shadow:0 7px 16px rgba(2,132,199,.22); }
.quiz-nav-toolbar { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px; }
.quiz-nav-toolbar .quiz-submit-btn { grid-column:1/-1; }
.quiz-nav-toolbar button:disabled { opacity:.45;cursor:not-allowed;transform:none!important; }
.quiz-focus-note { position:sticky;top:10px;z-index:60;margin-bottom:12px;padding:11px 14px;border-radius:14px;background:var(--green-bg);border:1px solid var(--green-border);color:var(--green);font-size:12px;font-weight:900;text-align:center; }
.quiz-focus-note.flash { animation:quizFocusBlink .42s ease-in-out 2; }
@keyframes quizFocusBlink { 50% { opacity:.28;transform:scale(.985); } }

/* Completed attempt answer review. */
.quiz-result-shell { width:min(920px,calc(100% - 28px)); }
.quiz-result-summary { margin-bottom:24px; }
.quiz-auto-submit-notice { margin:16px auto;max-width:680px;border-color:#f59e0b;background:#fffbeb;color:#92400e; }
[data-theme="dark"] .quiz-auto-submit-notice { background:rgba(245,158,11,.11);color:#fcd34d; }
.quiz-review-section { display:grid;gap:14px; }
.quiz-review-heading { margin:8px 2px 2px; }
.quiz-review-heading h2 { margin:8px 0 3px;font-size:24px; }
.quiz-review-heading p { color:var(--text-muted);margin:0; }
.quiz-review-card { padding:24px;box-shadow:var(--shadow-sm); }
.quiz-review-qhead { display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;color:var(--text-muted);font-size:12px;font-weight:900; }
.quiz-review-qhead b { padding:5px 9px;border-radius:999px; }
.quiz-review-qhead b.correct { background:var(--green-bg);color:var(--green); }
.quiz-review-qhead b.wrong { background:var(--red-bg);color:var(--red); }
.quiz-review-qhead b.blank { background:var(--bg-subtle);color:var(--text-muted); }
.quiz-review-card h2 { font-size:18px;margin-bottom:16px; }
.quiz-review-option { cursor:default!important;position:relative; }
.quiz-review-option:hover { border-color:var(--border);background:transparent; }
.quiz-review-option.review-correct { background:#ecfdf5!important;border-color:#10b981!important;color:#065f46!important; }
.quiz-review-option.review-wrong { background:#fef2f2!important;border-color:#ef4444!important;color:#991b1b!important; }
[data-theme="dark"] .quiz-review-option.review-correct { background:rgba(16,185,129,.14)!important;color:#6ee7b7!important; }
[data-theme="dark"] .quiz-review-option.review-wrong { background:rgba(239,68,68,.14)!important;color:#fca5a5!important; }
.quiz-review-option strong { margin-inline-start:auto;font-size:12px; }
.quiz-option-letter { flex:0 0 30px;height:30px;display:grid;place-items:center;border-radius:9px;background:color-mix(in srgb,currentColor 8%,transparent);font-family:var(--font-en);font-weight:900; }

@media (max-width:620px) {
  .quiz-shell { width:min(100% - 18px,840px);margin:18px auto; }
  .quiz-top { align-items:flex-start; }
  .quiz-top h2 { font-size:18px; }
  .timer { font-size:15px;padding:9px 11px; }
  .question-card { padding:20px 16px; }
  .question-card h2 { font-size:18px; }
  .quiz-start-stats { grid-template-columns:1fr; }
  .quiz-start-form { display:grid; }
  .quiz-start-form .btn { width:100%; }
  .quiz-nav-toolbar { grid-template-columns:1fr 1fr; }
  .quiz-nav-toolbar .btn { padding-inline:10px;font-size:12px;white-space:normal; }
  .quiz-question-palette { gap:6px; }
  .quiz-question-palette button { width:38px;height:38px; }
  .quiz-result-actions { display:grid!important;grid-template-columns:1fr;width:100%; }
  .quiz-result-actions .btn { width:100%; }
  .quiz-review-card { padding:18px 14px; }
  .quiz-review-qhead { align-items:flex-start; }
}
.quiz-away-warning { position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);z-index:5000;width:min(420px,calc(100% - 34px));padding:20px;border:2px solid #f59e0b;border-radius:18px;background:var(--surface);box-shadow:0 24px 80px rgba(0,0,0,.28);text-align:center; }
.quiz-away-warning strong,.quiz-away-warning span { display:block; }
.quiz-away-warning strong { color:var(--red);font-size:19px;margin-bottom:5px; }
.quiz-away-warning span { color:var(--text-muted);font-size:13px; }
.quiz-away-warning.blink { animation:quizAwayBlink 1s ease-in-out 2; }
@keyframes quizAwayBlink { 50% { opacity:.25;transform:translate(-50%,-50%) scale(.98); } }

/* Mobile & iOS Safari Full-Window Fallback & Touch Fixes */
.protected-player.is-fullscreen-fallback {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 9999999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
}

.protected-player.is-fullscreen-fallback iframe {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  inset: 0 !important;
}

body.has-fullscreen-player {
  overflow: hidden !important;
  touch-action: none;
}

.custom-video-controls {
  z-index: 40 !important;
  pointer-events: auto !important;
}

.custom-video-controls button {
  touch-action: manipulation;
  cursor: pointer;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}

.custom-video-controls [data-video-fullscreen] {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  position: relative;
  z-index: 50 !important;
  transition: transform 0.15s ease, background 0.15s ease;
}

.custom-video-controls [data-video-fullscreen]:active {
  transform: scale(0.92);
  background: rgba(25, 184, 236, 0.35) !important;
}

.custom-video-controls [data-video-fullscreen].is-active {
  background: rgba(25, 184, 236, 0.45) !important;
  color: #fff;
}

@media (max-width: 768px) {
  .video-tap-layer {
    inset: 60px 0 74px !important;
  }
}

/* =====================================================================
   V4.6.0: COMPACT STUDENT ALL-IN-ONE HERO & TOP SCHEDULE PRIORITY
   ===================================================================== */
.student-allinone-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(16px, 2.8vw, 24px);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  background-image: radial-gradient(circle at 100% 0%, rgba(25, 184, 236, 0.08) 0%, transparent 45%);
}

.allinone-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.allinone-title { display: grid; gap: 2px; }
.allinone-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--blue-primary);
  text-transform: uppercase;
}
.allinone-title h1 {
  font-size: clamp(20px, 3.2vw, 27px);
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
}

.allinone-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.allinone-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.allinone-tag.wallet-tag {
  background: rgba(25, 184, 236, 0.1);
  border-color: rgba(25, 184, 236, 0.3);
  color: var(--blue-primary);
  text-decoration: none;
}
.allinone-tag.wallet-tag:hover {
  background: rgba(25, 184, 236, 0.18);
}

/* Compact Resume Strip */
.student-resume-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(25, 184, 236, 0.08);
  border: 1px solid rgba(25, 184, 236, 0.22);
  border-radius: 16px;
  margin-bottom: 14px;
}
.resume-strip-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.resume-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(25, 184, 236, 0.35);
}
.resume-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.resume-text small {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-primary);
}
.resume-text strong {
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resume-text span {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resume-strip-btn {
  flex-shrink: 0;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 10px;
}

/* Compact All-in-One Stats Grid */
.allinone-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.allinone-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.allinone-stat-item .stat-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.allinone-stat-item .stat-content {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.allinone-stat-item strong {
  font-size: 14.5px;
  font-weight: 900;
  color: var(--blue-primary);
  line-height: 1.2;
}
.allinone-stat-item small {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Micro Chips for Quick Access */
.student-micro-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  -webkit-overflow-scrolling: touch;
}
.student-micro-chips::-webkit-scrollbar { display: none; }
.micro-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s ease;
}
.micro-chip:hover {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}
.micro-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}

/* Top Priority Schedule Widget */
.dashboard-top-schedule {
  margin-bottom: 22px;
  padding: clamp(16px, 2.5vw, 22px);
  border-radius: 22px;
}
.schedule-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.schedule-head-row h2 {
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 900;
  margin: 0;
}
.schedule-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.schedule-compact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.schedule-card-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(25, 184, 236, 0.1);
  border: 1px solid rgba(25, 184, 236, 0.22);
}
.schedule-card-time .day-badge {
  font-size: 11px;
  font-weight: 900;
  color: var(--blue-primary);
}
.schedule-card-time strong {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  direction: ltr;
}
.schedule-card-details {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.schedule-card-details h4 {
  font-size: 13.5px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-card-details .schedule-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}
.schedule-card-details .schedule-loc {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-primary);
}

/* Book Reservation & Payment Styles */
.book-reservation-page { max-width: 1200px; }
.book-filter-card {
  padding: 16px 20px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.book-year-select {
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  width: 100%;
}
.book-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.book-package-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 22px;
  padding: 22px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-package-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.book-pkg-badge { margin-bottom: 12px; }
.book-pkg-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.35;
}
.book-pkg-desc {
  font-size: 13.5px;
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: 16px;
}
.book-pkg-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.book-pkg-price-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.book-pkg-price {
  font-size: 22px;
  font-weight: 900;
  color: var(--blue-primary);
}
.book-open-btn {
  width: 100%;
  text-align: center;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}
.book-order-details[open] summary {
  margin-bottom: 16px;
}
.book-order-form {
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.form-section-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--blue-primary);
  margin: 14px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.fulfillment-options, .payment-method-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.choice-box, .payment-method-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s ease;
}
.choice-box:hover, .payment-method-card:hover {
  border-color: var(--blue-primary);
}
.choice-box input:checked ~ .choice-content,
.payment-method-card input:checked ~ .payment-card-body {
  color: var(--text-main);
}
.choice-box:has(input:checked), .payment-method-card:has(input:checked) {
  border-color: var(--blue-primary);
  background: rgba(25, 184, 236, 0.08);
}
.payment-method-card.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.payment-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.order-summary-box {
  background: rgba(25, 184, 236, 0.08);
  border: 1px solid rgba(25, 184, 236, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 16px 0;
}
.order-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.order-summary-row.total-row {
  font-size: 16px;
  font-weight: 900;
  color: var(--blue-primary);
  border-top: 1px dashed rgba(25, 184, 236, 0.35);
  padding-top: 8px;
  margin-top: 8px;
  margin-bottom: 4px;
}
.order-method-hint {
  font-size: 11.5px;
  margin-top: 4px;
}
.book-submit-btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 900;
  border-radius: 14px;
}

/* Mobile responsive optimizations */
@media (max-width: 640px) {
  .allinone-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .allinone-stat-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .allinone-stat-item .stat-icon { font-size: 18px; }
  .allinone-stat-item strong { font-size: 13.5px; }
  .allinone-stat-item small { font-size: 10px; }
  
  .student-resume-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .resume-strip-btn { width: 100%; text-align: center; }
  .schedule-compact-grid { grid-template-columns: 1fr; }
}


/* V4.7.0 — subscription promo code */
.checkout-promo{margin-top:14px;max-width:460px}.checkout-promo>label{display:block;font-weight:900;font-size:13px;margin-bottom:7px}.checkout-promo-row{display:flex;gap:8px;align-items:center}.checkout-promo-row input{min-width:0;flex:1;height:43px;border:1px solid var(--border);border-radius:13px;background:var(--input-bg,var(--card));color:var(--text);padding:0 13px;font:inherit;text-transform:uppercase}.checkout-promo-row input:focus{outline:2px solid color-mix(in srgb,var(--primary,#19b8ec) 30%,transparent);border-color:var(--primary,#19b8ec)}.checkout-promo-feedback{display:block;margin-top:6px;color:var(--text-muted);font-size:11px;line-height:1.5}.checkout-promo-feedback.success{color:#18a66b}.checkout-promo-feedback.error{color:#dc3545}.checkout-promo-feedback.warning{color:#d28b00}.checkout-discount-note{display:block;color:#18a66b;font-weight:800;margin:5px 0}.badge.gray{background:var(--soft);color:var(--text-muted);border:1px solid var(--border)}
@media(max-width:768px){.checkout-promo{max-width:none}.checkout-promo-row{align-items:stretch}.checkout-promo-row .btn{white-space:nowrap}}

/* =====================================================================
   V4.8.0: VIDEO CONTROLS AUTO-HIDE & SPEED SELECTOR
/* =====================================================================
   V4.8.0: VIDEO CONTROLS AUTO-HIDE & SPEED SELECTOR
   ===================================================================== */
.protected-player .custom-video-controls {
  position: absolute !important;
  z-index: 25 !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  border-radius: 14px !important;
  background: rgba(4, 17, 37, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(25, 184, 236, 0.25) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  color: #fff !important;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.protected-player.controls-hidden .custom-video-controls {
  opacity: 0 !important;
  transform: translateY(12px) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Control buttons inside custom-video-controls */
.protected-player .custom-video-controls button {
  border: 0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  border-radius: 9px !important;
  min-width: 38px !important;
  height: 34px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  touch-action: manipulation !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

.protected-player .custom-video-controls button:hover {
  background: rgba(25, 184, 236, 0.25) !important;
  color: #fff !important;
}

.protected-player .custom-video-controls button.video-play {
  background: rgba(25, 184, 236, 0.25) !important;
  color: #19b8ec !important;
  min-width: 44px !important;
  font-size: 16px !important;
}

.protected-player .custom-video-controls button.video-play:hover {
  background: #19b8ec !important;
  color: #fff !important;
}

.protected-player .custom-video-controls button.video-skip-btn {
  min-width: 36px !important;
  width: 36px !important;
  height: 34px !important;
  padding: 0 !important;
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.protected-player .custom-video-controls button.video-skip-btn svg {
  display: block;
  pointer-events: none;
  transition: transform 0.15s ease;
}

.protected-player .custom-video-controls button.video-skip-btn:hover {
  background: rgba(25, 184, 236, 0.25) !important;
  color: #38bdf8 !important;
}

.protected-player .custom-video-controls button.video-skip-btn:hover svg {
  transform: scale(1.08);
}

.protected-player .custom-video-controls button.video-skip-btn:active svg {
  transform: scale(0.92);
}

.protected-player .custom-video-controls input[type="range"] {
  flex: 1 1 auto !important;
  min-width: 70px !important;
  height: 6px !important;
  accent-color: #19b8ec !important;
  cursor: pointer !important;
  margin: 0 6px !important;
}

.protected-player .custom-video-controls span[data-video-time] {
  flex-shrink: 0 !important;
  font: 700 11.5px 'Plus Jakarta Sans', monospace, sans-serif !important;
  white-space: nowrap !important;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 0 4px !important;
}

/* Speed Selector Menu */
.protected-player .video-speed-menu-wrap {
  position: relative !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.protected-player .video-speed-btn {
  border: 1px solid rgba(25, 184, 236, 0.35) !important;
  background: rgba(25, 184, 236, 0.12) !important;
  color: #38bdf8 !important;
  border-radius: 9px !important;
  min-width: 38px !important;
  height: 32px !important;
  padding: 0 6px !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.protected-player .video-speed-btn:hover,
.protected-player .video-speed-btn.is-active {
  background: #19b8ec !important;
  border-color: #19b8ec !important;
  color: #fff !important;
}

.protected-player .video-speed-dropdown {
  position: absolute !important;
  bottom: calc(100% + 10px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(4, 17, 37, 0.96) !important;
  border: 1px solid rgba(25, 184, 236, 0.45) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-radius: 12px !important;
  padding: 6px !important;
  width: 95px !important;
  z-index: 100 !important;
  display: none !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.protected-player .video-speed-dropdown.is-open {
  display: flex !important;
  animation: speedPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes speedPop {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.protected-player .video-speed-title {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  text-align: center !important;
  padding: 2px 0 4px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 2px !important;
}

.protected-player .video-speed-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.protected-player .video-speed-options button {
  border: 0 !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer !important;
  text-align: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 26px !important;
  transition: all 0.12s ease !important;
}

.protected-player .video-speed-options button:hover {
  background: rgba(25, 184, 236, 0.25) !important;
  color: #fff !important;
}

.protected-player .video-speed-options button.active {
  background: #19b8ec !important;
  color: #fff !important;
  font-weight: 900 !important;
}

/* =====================================================================
   V4.8.0: COMPREHENSIVE EXAMS & WRITTEN / LIST QUESTIONS
   ===================================================================== */
.comprehensive-exam-priority-banner {
  background: linear-gradient(135deg, rgba(8, 28, 60, 0.98), rgba(12, 44, 88, 0.96));
  border: 1px solid rgba(25, 184, 236, 0.45);
  border-radius: 24px;
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24), 0 0 25px rgba(25, 184, 236, 0.15);
  position: relative;
  overflow: hidden;
}

.comp-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.comp-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.comp-banner-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #19b8ec, #0284c7);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(25, 184, 236, 0.35);
  flex-shrink: 0;
}

.comp-banner-meta h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.comp-banner-meta p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
}

.comp-banner-meta p strong {
  color: #38bdf8;
}

.comp-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.comp-countdown-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
}

.comp-countdown-chip.urgent {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  animation: pulseComp 1.5s infinite;
}

@keyframes pulseComp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Written / List Question Box */
.written-question-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin-top: 18px;
}

.written-question-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}

.written-question-instruction {
  font-size: 14.5px;
  font-weight: 600;
  font-style: italic;
  color: var(--primary, #19b8ec);
  margin-bottom: 18px;
}

.written-answer-box {
  position: relative;
  width: 100%;
}

.written-textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--input-bg, var(--card));
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.written-textarea:focus {
  border-color: var(--primary, #19b8ec);
  box-shadow: 0 0 0 3px rgba(25, 184, 236, 0.2);
}

.written-list-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.written-list-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.written-item-num {
  font-weight: 900;
  font-size: 16px;
  color: var(--primary, #19b8ec);
  min-width: 24px;
}

.written-item-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--input-bg, var(--card));
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s;
}

.written-item-input:focus {
  border-color: var(--primary, #19b8ec);
}

.written-autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 10px;
  transition: opacity 0.2s ease;
}

.written-autosave-status.saved {
  color: #10b981;
}

.written-autosave-status.saving {
  color: #f59e0b;
}

/* Reference image style dotted writing lines */
.written-dotted-guide {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

