/* ==========================================================================
   Kurd Store VIP — Academy Cinema & Curriculum UI (v4.0 Pro Clean)
   Pure CSS Design Tokens (--v3-*) · Light & OLED Dark · RTL/LTR
   ========================================================================== */

:root {
  --ac-bg: var(--v3-bg, #f5f7fa);
  --ac-surface: var(--v3-surface, #ffffff);
  --ac-surface-2: var(--v3-surface-2, #f1f5f9);
  --ac-surface-3: var(--v3-surface-3, #e8eef5);
  --ac-border: var(--v3-border, rgba(15, 23, 42, 0.08));
  --ac-border-strong: var(--v3-border-strong, rgba(15, 23, 42, 0.16));
  --ac-text: var(--v3-text, #0b1220);
  --ac-text-2: var(--v3-text-2, #475569);
  --ac-text-3: var(--v3-text-3, #64748b);
  --ac-primary: var(--v3-primary, #0071e3);
  --ac-primary-hover: var(--v3-primary-hover, #005bbf);
  --ac-primary-soft: var(--v3-primary-soft, rgba(0, 113, 227, 0.09));
  --ac-primary-border: var(--v3-primary-border, rgba(0, 113, 227, 0.22));
  --ac-success: var(--v3-success, #059669);
  --ac-success-soft: var(--v3-success-soft, rgba(5, 150, 105, 0.10));
  --ac-success-border: var(--v3-success-border, rgba(5, 150, 105, 0.24));
  --ac-gold: var(--v3-gold, #b45309);
  --ac-gold-accent: var(--v3-gold-accent, #d97706);
  --ac-gold-soft: var(--v3-gold-soft, rgba(217, 119, 6, 0.10));
  --ac-gold-border: var(--v3-gold-border, rgba(217, 119, 6, 0.24));
  --ac-danger: var(--v3-danger, #dc2626);
  --ac-danger-soft: var(--v3-danger-soft, rgba(220, 38, 38, 0.10));
  --ac-shadow-sm: var(--v3-shadow-sm, 0 2px 10px -2px rgba(15, 23, 42, 0.06));
  --ac-shadow-md: var(--v3-shadow-md, 0 12px 32px -12px rgba(15, 23, 42, 0.14));
  --ac-shadow-lg: var(--v3-shadow-lg, 0 24px 60px -16px rgba(15, 23, 42, 0.22));
  --ac-cinema-bg: #070b14;
  --ac-cinema-bar: #0d1424;
  --ac-cinema-border: rgba(255, 255, 255, 0.09);
  --ac-cinema-pill: rgba(255, 255, 255, 0.07);
  --ac-cinema-pill-hover: rgba(255, 255, 255, 0.13);
  --ac-ease: var(--v3-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

html[data-theme="dark-mode"],
html[data-theme="dark"],
html.dark-mode,
body.dark-mode {
  --ac-cinema-bg: #03060c;
  --ac-cinema-bar: #0a101e;
  --ac-cinema-border: rgba(255, 255, 255, 0.08);
}

/* ---------- Page Container & Hero Banner ---------- */

body.ksv-academy-page {
  background: var(--ac-bg);
  color: var(--ac-text);
}

#ksv-page-stage main.academy-main-container {
  max-width: 1400px;
  margin-inline: auto;
  padding: 20px clamp(14px, 3vw, 28px) 64px;
}

.academy-hero-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  margin-bottom: 18px;
  border-radius: 20px;
  background:
    radial-gradient(600px 180px at 90% 0%, var(--ac-primary-soft), transparent 70%),
    linear-gradient(135deg, var(--ac-surface) 0%, var(--ac-surface-2) 100%);
  border: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
}

.academy-hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vip-cinema-badge,
.vip-chip-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.vip-cinema-badge {
  background: var(--ac-gold-soft);
  color: var(--ac-gold);
  border: 1px solid var(--ac-gold-border);
}

.vip-chip-stat {
  background: var(--ac-surface);
  color: var(--ac-text-2);
  border: 1px solid var(--ac-border);
}

.academy-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.academy-chip-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.academy-chip-label-mobile {
  display: none;
}

.academy-hero-title {
  margin: 2px 0 0;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ac-text);
}

.academy-hero-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ac-text-2);
  max-width: 780px;
}

/* ---------- Theater Mode Backdrop & Centered Cinema Stage ---------- */

html.ksv-theater-active,
body.ksv-theater-active {
  overflow: hidden;
}

body.ksv-theater-active #ksv-floating-dock,
body.ksv-theater-active #ksv-floating-support-btn,
body.ksv-theater-active .ksv-social-toast {
  display: none !important;
}

.ksv-theater-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(3, 6, 14, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ac-ease);
}

body.ksv-theater-active .ksv-theater-backdrop,
.ksv-theater-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ksv-theater-dismiss-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.ksv-theater-active #academy-player-wrapper {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1140px, calc(100vw - 32px));
  max-height: calc(100dvh - 68px);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.85);
}

body.ksv-theater-active #academy-player-wrapper.is-portrait-wrapper {
  width: min(470px, calc(100vw - 24px));
}

body.ksv-theater-active #academy-player-wrapper .academy-video-frame {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 124px);
}

/* ---------- Primary Grid Layout ---------- */

.academy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 365px;
  gap: 20px;
  align-items: start;
}

.academy-player-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Cinema Player Shell & Topbar ---------- */

.academy-player-wrapper {
  position: relative;
  border-radius: 20px;
  background: var(--ac-cinema-bg);
  border: 1px solid var(--ac-cinema-border);
  box-shadow: var(--ac-shadow-md);
  overflow: hidden;
  color: #f8fafc;
}

.cinema-ambient-glow {
  position: absolute;
  inset: -40px 10% auto;
  height: 140px;
  background: radial-gradient(ellipse at center, rgba(59, 158, 255, 0.16) 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.ksv-fs-mini-restore {
  display: none;
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 40;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 16, 30, 0.84);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.ksv-fs-mini-restore svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ksv-cinema-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 9px 12px;
  background: var(--ac-cinema-bar);
  border-bottom: 1px solid var(--ac-cinema-border);
}

.ksv-cinema-topbar.is-locked-topbar {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.16), var(--ac-cinema-bar) 60%);
}

.ksv-servers-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ksv-servers-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  padding-inline-end: 4px;
}

.ksv-servers-label.is-locked-label {
  color: #fbbf24;
}

.srv-label-locked {
  display: inline-flex;
  align-items: center;
}

.srv-label-locked svg {
  width: 13px;
  height: 13px;
  display: block;
}

.pulse-live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
  animation: ksvAcPulse 2.2s ease-in-out infinite;
}

.pulse-live-indicator.is-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24);
}

@keyframes ksvAcPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.72; }
}

.server-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--ac-cinema-pill);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s var(--ac-ease), border-color 0.18s var(--ac-ease), transform 0.15s var(--ac-ease);
}

.server-btn:hover {
  background: var(--ac-cinema-pill-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

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

.server-btn.active {
  background: linear-gradient(135deg, #2563eb, #0071e3);
  border-color: rgba(96, 178, 255, 0.65);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.36);
}

.server-btn.srv-youtube.active {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.server-btn.vip-gdrive.active {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.server-btn.srv-pro-stream.active {
  background: linear-gradient(135deg, #0284c7, #0071e3);
}

.srv-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.srv-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.srv-name-mobile {
  display: none;
}

.srv-tag {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.ksv-player-tools-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ksv-view-mode-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.ksv-view-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-family: var(--v3-font-num, inherit);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s var(--ac-ease), color 0.18s var(--ac-ease);
}

.ksv-view-seg-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}

.ksv-view-seg-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.ksv-player-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: var(--ac-cinema-pill);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ac-ease), border-color 0.18s var(--ac-ease);
}

.ksv-player-ctrl-btn:hover {
  background: var(--ac-cinema-pill-hover);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.ksv-player-ctrl-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.ksv-player-ctrl-btn.theater-toggle-btn.active {
  background: rgba(59, 158, 255, 0.22);
  border-color: rgba(96, 178, 255, 0.55);
  color: #ffffff;
}

.ksv-player-ctrl-btn.is-fullscreen-cta {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Rotate & Hide-Bar controls belong exclusively inside Fullscreen mode */
#btn-fs-rotate,
#btn-fs-hide-bar {
  display: none;
}

/* ---------- Video Stage & Frame ---------- */

.academy-video-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #03060c;
  overflow: hidden;
  transition: aspect-ratio 0.24s var(--ac-ease), max-width 0.24s var(--ac-ease);
}

.academy-video-frame.is-portrait-mode {
  aspect-ratio: 9 / 16;
  max-width: 420px;
  margin-inline: auto;
  border-inline: 1px solid rgba(255, 255, 255, 0.08);
}

.academy-video-frame.is-locked-frame {
  aspect-ratio: auto;
  min-height: 410px;
  display: flex;
  align-items: stretch;
  overflow: visible;
  background:
    radial-gradient(620px 320px at 50% 0%, rgba(245, 158, 11, 0.12), transparent 68%),
    radial-gradient(500px 280px at 50% 100%, rgba(37, 99, 235, 0.14), transparent 70%),
    #070c18;
}

.academy-video-frame > iframe,
.academy-video-frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Custom HTML5 / HLS Pro Player ---------- */

.ksv-pro-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #03060c;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.ksv-pro-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000000;
}

.ksv-pro-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 17, 32, 0.72);
  backdrop-filter: blur(12px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ac-ease), background-color 0.2s ease;
  z-index: 6;
}

.ksv-pro-center-play svg {
  width: 26px;
  height: 26px;
  display: block;
}

.ksv-pro-player:not(.is-playing) .ksv-pro-center-play {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.ksv-pro-center-play:hover {
  background: #0071e3;
  border-color: rgba(96, 178, 255, 0.8);
}

.ksv-pro-seek-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 17, 32, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--v3-font-num, inherit);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 7;
}

.ksv-pro-seek-badge.is-back {
  left: 16%;
}

.ksv-pro-seek-badge.is-fwd {
  right: 16%;
}

.ksv-pro-seek-badge.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.ksv-pro-controls {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 36px 14px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(3, 6, 14, 0.88) 55%, rgba(3, 6, 14, 0.96) 100%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.ksv-pro-player:hover .ksv-pro-controls,
.ksv-pro-player:not(.is-playing) .ksv-pro-controls,
.ksv-pro-player.is-seeking .ksv-pro-controls,
.ksv-pro-player:focus-within .ksv-pro-controls {
  opacity: 1;
}

.ksv-pro-player.is-playing.is-idle:not(.is-seeking) .ksv-pro-controls {
  opacity: 0;
}

.ksv-pro-progress-wrap {
  position: relative;
  padding: 7px 0;
  cursor: pointer;
  touch-action: none;
}

.ksv-pro-progress-bg {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: height 0.14s ease;
}

.ksv-pro-progress-wrap:hover .ksv-pro-progress-bg,
.ksv-pro-player.is-seeking .ksv-pro-progress-bg {
  height: 7px;
}

.ksv-pro-progress-buf {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  pointer-events: none;
}

.ksv-pro-progress-cur {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #3b9eff, #0071e3);
  border-radius: 999px;
  pointer-events: none;
}

.ksv-pro-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ksv-pro-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ksv-pro-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.ksv-pro-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
}

.ksv-pro-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.ksv-pro-time {
  font-family: var(--v3-font-num, inherit);
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
  padding-inline: 4px;
}

.ksv-pro-player.has-stream-error .ksv-pro-controls,
.ksv-pro-player.has-stream-error .ksv-pro-center-play,
.ksv-pro-player.has-stream-error .ksv-pro-seek-badge {
  display: none !important;
}

.ksv-pro-error-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(4, 7, 15, 0.94);
  color: #f8fafc;
}

.ksv-pro-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #f87171;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ksv-pro-error-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.ksv-pro-error-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.ksv-pro-error-desc {
  margin: 0;
  font-size: 0.84rem;
  color: #94a3b8;
  max-width: 420px;
  line-height: 1.5;
}

.ksv-pro-error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.ksv-pro-error-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ksv-pro-error-btn.is-primary {
  background: linear-gradient(135deg, #2563eb, #0071e3);
  border-color: rgba(96, 178, 255, 0.7);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

.ksv-pro-error-btn:hover {
  background: #0071e3;
  border-color: rgba(96, 178, 255, 0.65);
}

/* ---------- VIP Locked Paywall & Empty Course Screen ---------- */

.academy-locked-screen,
.academy-empty-state {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
}

.academy-locked-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.36);
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.16);
}

.academy-locked-badge svg {
  width: 26px;
  height: 26px;
  display: block;
}

.academy-locked-title {
  margin: 4px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  color: #ffffff;
}

.academy-locked-desc {
  margin: 0;
  max-width: 520px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.academy-locked-product-card {
  width: 100%;
  max-width: 480px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: start;
}

.locked-pkg-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 158, 255, 0.16);
  border: 1px solid rgba(96, 178, 255, 0.32);
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.locked-pkg-icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.locked-pkg-info {
  flex: 1 1 auto;
  min-width: 0;
}

.locked-pkg-title {
  font-size: 0.93rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}

.locked-pkg-price {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--v3-font-num, inherit);
  color: #fbbf24;
}

.locked-pkg-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #2563eb, #0071e3);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.36);
  transition: transform 0.16s var(--ac-ease), filter 0.16s ease;
}

.locked-pkg-buy-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.locked-pkg-buy-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.academy-locked-catalog-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(59, 158, 255, 0.16);
  border: 1px solid rgba(96, 178, 255, 0.35);
  color: #93c5fd;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.academy-locked-catalog-cta:hover {
  background: #0071e3;
  color: #ffffff;
}

.academy-unlock-phone-box {
  width: 100%;
  max-width: 480px;
  margin-top: 6px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.unlock-phone-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 10px;
  line-height: 1.45;
}

.unlock-phone-row {
  display: flex;
  justify-content: center;
}

.unlock-phone-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.18s var(--ac-ease), border-color 0.18s var(--ac-ease);
}

.unlock-phone-btn:hover:not(:disabled) {
  background: rgba(59, 158, 255, 0.25);
  border-color: rgba(96, 178, 255, 0.55);
}

.unlock-phone-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.unlock-btn-label {
  display: inline-block;
  line-height: 1.25;
}

.unlock-btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.unlock-btn-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.unlock-btn-ico.is-spinning svg {
  animation: ksvSpin 0.9s linear infinite;
}

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

.unlock-phone-alert {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1.45;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.unlock-phone-alert:empty {
  display: none;
}

.unlock-phone-alert.is-success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

.unlock-phone-alert.is-error {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.academy-locked-auth-hint {
  margin: 10px 0 0;
  font-size: 0.77rem;
  color: #94a3b8;
  line-height: 1.45;
}

.academy-empty-state {
  min-height: 360px;
  border-radius: 20px;
  background: var(--ac-surface);
  border: 1px dashed var(--ac-border-strong);
}

.academy-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--ac-primary-soft);
  color: var(--ac-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.academy-empty-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.academy-empty-title {
  margin: 4px 0 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ac-text);
}

.academy-empty-sub {
  margin: 0;
  max-width: 440px;
  font-size: 0.88rem;
  color: var(--ac-text-2);
  line-height: 1.55;
}

.academy-empty-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--ac-primary);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.academy-empty-cta svg {
  width: 15px;
  height: 15px;
  display: block;
}

.academy-empty-cta:hover {
  background: var(--ac-primary-hover);
}

/* ---------- Lesson Details Card & Action Bar ---------- */

.ksv-lesson-details-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
}

.ksv-lesson-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ksv-lesson-title-col {
  flex: 1 1 320px;
  min-width: 0;
}

.ksv-lesson-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ksv-lesson-official-badge,
.ksv-lesson-course-pill,
.ksv-lesson-dur-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.ksv-lesson-official-badge {
  background: var(--ac-primary-soft);
  color: var(--ac-primary);
  border: 1px solid var(--ac-primary-border);
}

.ksv-lesson-course-pill {
  background: var(--ac-gold-soft);
  color: var(--ac-gold);
  border: 1px solid var(--ac-gold-border);
  max-width: 100%;
}

.ksv-lesson-course-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ksv-lesson-dur-badge {
  background: var(--ac-surface-2);
  color: var(--ac-text-2);
  border: 1px solid var(--ac-border);
  font-family: var(--v3-font-num, inherit);
}

.ksv-lesson-official-badge svg,
.ksv-lesson-course-pill svg,
.ksv-lesson-dur-badge svg {
  width: 13px;
  height: 13px;
  display: block;
}

.ksv-lesson-heading {
  margin: 0;
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.38;
  color: var(--ac-text);
}

.ksv-lesson-desc {
  margin: 8px 0 0;
  font-size: 0.89rem;
  line-height: 1.65;
  color: var(--ac-text-2);
}

.ksv-lesson-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 12px;
  background: var(--ac-success-soft);
  border: 1px solid var(--ac-success-border);
  color: var(--ac-success);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.ksv-lesson-wa-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.ksv-lesson-wa-btn:hover {
  background: var(--ac-success);
  color: #ffffff;
}

.ksv-lesson-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--ac-border);
}

.ksv-nav-btns-group,
.ksv-tools-btns-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ksv-lesson-nav-btn,
.ksv-lesson-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--ac-border-strong);
  background: var(--ac-surface-2);
  color: var(--ac-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ksv-lesson-nav-btn:hover,
.ksv-lesson-tool-btn:hover {
  background: var(--ac-primary-soft);
  border-color: var(--ac-primary-border);
  color: var(--ac-primary);
}

.ksv-lesson-nav-btn.prev {
  background: var(--ac-surface-2);
  color: var(--ac-text);
}

.ksv-lesson-nav-btn.next {
  background: var(--ac-primary);
  border-color: var(--ac-primary);
  color: #ffffff;
}

.ksv-lesson-nav-btn.next:hover {
  background: var(--ac-primary-hover);
  color: #ffffff;
}

.ksv-lesson-nav-btn svg,
.ksv-tool-svg svg {
  width: 15px;
  height: 15px;
  display: block;
}

.ksv-tool-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ksv-lesson-tool-btn.active {
  background: var(--ac-success-soft);
  border-color: var(--ac-success-border);
  color: var(--ac-success);
}

/* ---------- Mobile & Tablet Course Progress Strip (Hidden on Desktop >= 900px) ---------- */

.ksv-mobile-lessons-strip {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
}

.ksv-mobile-lessons-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ksv-mobile-strip-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ac-text);
}

.ksv-mobile-strip-title svg {
  width: 15px;
  height: 15px;
  color: var(--ac-primary);
  display: block;
}

.strip-counter-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  color: var(--ac-text-2);
  font-family: var(--v3-font-num, inherit);
  font-size: 0.74rem;
  font-weight: 800;
}

.ksv-course-progress-track,
.ksv-sidebar-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--ac-surface-3);
  overflow: hidden;
}

.ksv-course-progress-fill,
.ksv-sidebar-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ac-primary), #10b981);
  transition: width 0.28s var(--ac-ease);
}

.ksv-mobile-lessons-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.ksv-mobile-lesson-chip {
  flex: 0 0 auto;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  color: var(--ac-text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  scroll-snap-align: start;
}

.ksv-mobile-lesson-chip.active {
  background: var(--ac-primary);
  border-color: var(--ac-primary);
  color: #ffffff;
}

.ksv-mobile-lesson-chip.completed:not(.active) {
  background: var(--ac-success-soft);
  border-color: var(--ac-success-border);
  color: var(--ac-success);
}

.chip-idx {
  font-family: var(--v3-font-num, inherit);
  font-size: 0.75rem;
  font-weight: 800;
  opacity: 0.8;
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.chip-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Sidebar Curriculum Tree ---------- */

.lesson-tree-card {
  position: sticky;
  top: calc(var(--v3-header-h, 64px) + 16px);
  max-height: calc(100vh - var(--v3-header-h, 64px) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
}

.ksv-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.academy-tree-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ac-text);
}

.academy-tree-title svg {
  width: 17px;
  height: 17px;
  color: var(--ac-primary);
  display: block;
}

.ksv-sidebar-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
}

.ksv-sidebar-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ac-text-2);
}

.ksv-academy-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.ksv-academy-search-icon {
  position: absolute;
  inset-inline-start: 12px;
  display: inline-flex;
  color: var(--ac-text-3);
  pointer-events: none;
}

.ksv-academy-search-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.ksv-academy-search-input {
  width: 100%;
  min-height: 40px;
  padding-block: 8px;
  padding-inline: 36px 34px;
  border-radius: 12px;
  border: 1px solid var(--ac-border-strong);
  background: var(--ac-surface-2);
  color: var(--ac-text);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.ksv-academy-search-input:focus {
  background: var(--ac-surface);
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px var(--ac-primary-soft);
}

.ksv-academy-search-clear {
  position: absolute;
  inset-inline-end: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: var(--ac-surface-3);
  color: var(--ac-text-2);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ksv-academy-search-clear[hidden] {
  display: none;
}

.ksv-search-empty-msg,
.academy-tree-empty-text {
  margin: 4px 0;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--ac-surface-2);
  color: var(--ac-text-3);
  font-size: 0.83rem;
  font-weight: 600;
  text-align: center;
}

.ksv-search-empty-msg[hidden] {
  display: none;
}

/* Distinct Category / Section Cards with Color-Coded Themes */
.ksv-tree-category-block {
  --cat-accent: #0071e3;
  --cat-accent-soft: rgba(0, 113, 227, 0.11);
  --cat-accent-border: rgba(0, 113, 227, 0.24);
  --cat-head-bg: linear-gradient(135deg, rgba(0, 113, 227, 0.11) 0%, rgba(0, 113, 227, 0.03) 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border-strong);
}

.ksv-tree-category-block[data-cat-theme="violet"] {
  --cat-accent: #7c3aed;
  --cat-accent-soft: rgba(124, 58, 237, 0.12);
  --cat-accent-border: rgba(124, 58, 237, 0.26);
  --cat-head-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.13) 0%, rgba(124, 58, 237, 0.03) 100%);
}

.ksv-tree-category-block[data-cat-theme="emerald"] {
  --cat-accent: #059669;
  --cat-accent-soft: rgba(5, 150, 105, 0.12);
  --cat-accent-border: rgba(5, 150, 105, 0.26);
  --cat-head-bg: linear-gradient(135deg, rgba(5, 150, 105, 0.13) 0%, rgba(5, 150, 105, 0.03) 100%);
}

.ksv-tree-category-block[data-cat-theme="amber"] {
  --cat-accent: #d97706;
  --cat-accent-soft: rgba(217, 119, 6, 0.12);
  --cat-accent-border: rgba(217, 119, 6, 0.28);
  --cat-head-bg: linear-gradient(135deg, rgba(217, 119, 6, 0.14) 0%, rgba(217, 119, 6, 0.03) 100%);
}

html[data-theme="dark-mode"] .ksv-tree-category-block,
html[data-theme="dark"] .ksv-tree-category-block,
html.dark-mode .ksv-tree-category-block,
body.dark-mode .ksv-tree-category-block {
  --cat-accent: #60a5fa;
  --cat-accent-soft: rgba(96, 165, 250, 0.16);
  --cat-accent-border: rgba(96, 165, 250, 0.32);
  --cat-head-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.20) 0%, rgba(15, 23, 38, 0.65) 100%);
  background: rgba(22, 33, 52, 0.65);
}

html[data-theme="dark-mode"] .ksv-tree-category-block[data-cat-theme="violet"],
html[data-theme="dark"] .ksv-tree-category-block[data-cat-theme="violet"],
html.dark-mode .ksv-tree-category-block[data-cat-theme="violet"],
body.dark-mode .ksv-tree-category-block[data-cat-theme="violet"] {
  --cat-accent: #a78bfa;
  --cat-accent-soft: rgba(167, 139, 250, 0.17);
  --cat-accent-border: rgba(167, 139, 250, 0.34);
  --cat-head-bg: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(15, 23, 38, 0.65) 100%);
}

html[data-theme="dark-mode"] .ksv-tree-category-block[data-cat-theme="emerald"],
html[data-theme="dark"] .ksv-tree-category-block[data-cat-theme="emerald"],
html.dark-mode .ksv-tree-category-block[data-cat-theme="emerald"],
body.dark-mode .ksv-tree-category-block[data-cat-theme="emerald"] {
  --cat-accent: #34d399;
  --cat-accent-soft: rgba(52, 211, 153, 0.17);
  --cat-accent-border: rgba(52, 211, 153, 0.34);
  --cat-head-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(15, 23, 38, 0.65) 100%);
}

html[data-theme="dark-mode"] .ksv-tree-category-block[data-cat-theme="amber"],
html[data-theme="dark"] .ksv-tree-category-block[data-cat-theme="amber"],
html.dark-mode .ksv-tree-category-block[data-cat-theme="amber"],
body.dark-mode .ksv-tree-category-block[data-cat-theme="amber"] {
  --cat-accent: #fbbf24;
  --cat-accent-soft: rgba(251, 191, 36, 0.17);
  --cat-accent-border: rgba(251, 191, 36, 0.34);
  --cat-head-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(15, 23, 38, 0.65) 100%);
}

.academy-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cat-head-bg);
  border: 1px solid var(--cat-accent-border);
  border-inline-start: 4px solid var(--cat-accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ac-surface);
  border: 1px solid var(--cat-accent-border);
  color: var(--cat-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cat-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.cat-title-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.cat-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cat-accent);
  line-height: 1.1;
}

.cat-name {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ac-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-count-pill {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ac-surface);
  border: 1px solid var(--cat-accent-border);
  color: var(--cat-accent);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.ksv-tree-category-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-icon svg,
.camp-folder-icon svg,
.lesson-status-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.topic-icon,
.camp-folder-icon,
.lesson-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topic-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ksv-tree-topic-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline-start: 4px;
}

.academy-topic-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-inline-start: 3px solid var(--cat-accent);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ac-text-2);
}

.academy-topic-header .topic-icon {
  color: var(--cat-accent);
}

.ksv-tree-campaign-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 12px;
  border: 1px solid var(--ac-border);
  background: var(--ac-surface);
  padding: 5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ksv-tree-campaign-block.is-open-camp {
  border-color: var(--ac-primary-border);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.07);
}

.ksv-camp-series-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ac-text);
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.ksv-camp-series-link:hover {
  background: var(--ac-surface-2);
}

.ksv-camp-series-link.active {
  background: var(--ac-primary-soft);
  color: var(--ac-primary);
}

.camp-title-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-right-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.camp-count-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  color: var(--ac-text-3);
  font-family: var(--v3-font-num, inherit);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ksv-camp-series-link.active .camp-count-badge {
  background: var(--ac-surface);
  border-color: var(--ac-primary-border);
  color: var(--ac-primary);
}

.camp-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ac-text-3);
  transform: rotate(-90deg);
  transition: transform 0.2s var(--ac-ease), color 0.2s ease;
}

[dir="rtl"] .camp-chevron {
  transform: rotate(90deg);
}

.camp-chevron svg {
  width: 13px;
  height: 13px;
  display: block;
}

.ksv-tree-campaign-block.is-open-camp:not(.is-user-collapsed) .camp-chevron {
  transform: rotate(0deg);
  color: var(--ac-primary);
}

.ksv-camp-lessons-nested {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  margin-top: 2px;
  border-radius: 9px;
  background: var(--ac-surface-2);
}

.ksv-camp-lessons-nested[hidden],
.ksv-camp-lessons-nested.is-search-collapsed[hidden] {
  display: none;
}

.lesson-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--ac-text-2);
  font-size: 0.81rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.lesson-item-row:hover {
  background: var(--ac-surface);
  border-color: var(--ac-border);
  color: var(--ac-text);
}

.lesson-item-row.is-locked-row:not(.active) .lesson-status-icon {
  color: var(--ac-gold-accent);
}

.lesson-item-row.active {
  background: var(--ac-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.lesson-item-row.completed:not(.active) {
  color: var(--ac-text);
}

.lesson-item-row.completed:not(.active) .lesson-status-icon {
  color: var(--ac-success);
}

.lesson-row-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.lesson-idx {
  font-family: var(--v3-font-num, inherit);
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.7;
  min-width: 16px;
}

.lesson-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-duration-tag {
  font-family: var(--v3-font-num, inherit);
  font-size: 0.71rem;
  font-weight: 700;
  opacity: 0.78;
  flex-shrink: 0;
}

/* ---------- Fullscreen Mode Portal & Anti-Overlap Chrome Hiding ---------- */

html.ksv-academy-fs-active,
html.ksv-academy-fs-active body {
  overflow: hidden !important;
}

html.ksv-academy-fs-active #ksv-header,
html.ksv-academy-fs-active .mobile-bottom-nav,
html.ksv-academy-fs-active .store-footer,
html.ksv-academy-fs-active #ksv-floating-dock,
html.ksv-academy-fs-active #ksv-floating-support-btn,
html.ksv-academy-fs-active #ksv-live-chat-drawer,
html.ksv-academy-fs-active .ksv-lc-backdrop,
html.ksv-academy-fs-active .ksv-social-toast,
html.ksv-academy-fs-active .ksv-promo-overlay,
html.ksv-academy-fs-active .ksv-theater-backdrop,
html.ksv-academy-fs-active .academy-hero-banner,
html.ksv-academy-fs-active .ksv-lesson-details-card,
html.ksv-academy-fs-active .ksv-mobile-lessons-strip,
html.ksv-academy-fs-active #academy-sidebar-tree {
  display: none !important;
}

#academy-player-wrapper:fullscreen,
#academy-player-wrapper.is-fs-fallback,
html.ksv-academy-fs-active #academy-player-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  z-index: 2147483000 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #000000 !important;
}

html.ksv-academy-fs-active #academy-player-wrapper .academy-video-frame,
#academy-player-wrapper:fullscreen .academy-video-frame {
  flex: 1 1 auto;
  min-height: 0;
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  height: 100% !important;
}

html.ksv-academy-fs-active #btn-fs-hide-bar,
html.ksv-academy-fs-active #btn-fs-rotate {
  display: inline-flex;
}

html.ksv-academy-fs-active #academy-player-wrapper.is-fs-bar-hidden .ksv-cinema-topbar {
  display: none !important;
}

html.ksv-academy-fs-active #academy-player-wrapper.is-fs-bar-hidden .ksv-fs-mini-restore {
  display: inline-flex;
}

#academy-player-wrapper.is-fs-rotated {
  width: 100dvh !important;
  height: 100vw !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
}

/* Desktop mice do not rotate physical monitors in fullscreen */
@media (min-width: 1025px) and (hover: hover) {
  html.ksv-academy-fs-active #btn-fs-rotate {
    display: none !important;
  }
}

/* ---------- Responsive Breakpoints ---------- */

@media (max-width: 1099.98px) {
  .academy-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
  }
}

@media (max-width: 899.98px) {
  #ksv-page-stage main.academy-main-container {
    padding: 14px 12px 92px;
  }

  .academy-hero-banner {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .academy-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .ksv-mobile-lessons-strip {
    display: flex;
  }

  .lesson-tree-card {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 639.98px) {
  .academy-chip-label-full,
  .srv-name-desktop,
  .ksv-player-ctrl-btn .tool-text {
    display: none;
  }

  .academy-chip-label-mobile,
  .srv-name-mobile {
    display: inline;
  }

  .ksv-cinema-topbar {
    padding: 9px 10px;
    gap: 8px;
  }

  .ksv-servers-label .srv-label-text {
    display: none;
  }

  .academy-player-wrapper {
    border-radius: 16px;
  }

  .academy-video-frame.is-locked-frame {
    min-height: 360px;
  }

  .academy-locked-screen {
    padding: 24px 16px;
  }

  .academy-locked-product-card {
    flex-wrap: wrap;
    padding: 12px;
  }

  .locked-pkg-buy-btn {
    width: 100%;
  }

  .ksv-lesson-details-card {
    padding: 15px;
    border-radius: 16px;
  }

  .ksv-lesson-wa-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 370px) {
  .server-btn {
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .ksv-view-seg-btn {
    padding: 4px 7px;
  }
}
