/* Khan Academy Design System Recreation */

:root {
  --ka-blue: #1865f2;
  --ka-blue-hover: #0b4ec2;
  --ka-blue-light: #f0f5fe;
  --ka-green: #14bf96;
  --ka-green-dark: #0a5554;
  --ka-green-light: #e8f9f5;
  --ka-navy: #0b2149;
  --ka-charcoal: #21242c;
  --ka-text-muted: #62656d;
  --ka-bg-light: #f7f8fa;
  --ka-border: #e4e7eb;
  --ka-border-hover: #c3c7ce;
  --ka-card-bg: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Lato', Georgia, serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--ka-charcoal);
  background-color: var(--ka-bg-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ka-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Fluid Container spanning edge-to-edge with balanced side margins */
.container {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  margin: 0 auto;
}

/* 1. Global Header */
.ka-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--ka-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  color: var(--ka-charcoal);
  border-radius: 4px;
}

.mobile-menu-btn:hover {
  background: var(--ka-bg-light);
}

.courses-dropdown-wrapper {
  position: relative;
}

.courses-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ka-navy);
  border-radius: 4px;
  transition: background 0.15s;
}

.courses-btn:hover {
  background: var(--ka-bg-light);
}

.courses-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 290px;
  background: #ffffff;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  z-index: 110;
}

.courses-popover.open {
  display: block;
}

.popover-column h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--ka-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.popover-column ul {
  list-style: none;
}

.popover-column li {
  margin-bottom: 0.4rem;
}

.popover-column a {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ka-charcoal);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

.popover-column a:hover {
  background: var(--ka-bg-light);
  text-decoration: none;
}

.search-bar {
  display: flex;
  align-items: center;
  position: relative;
  width: 260px;
}

.search-bar input {
  width: 100%;
  padding: 0.42rem 0.75rem 0.42rem 2.2rem;
  font-size: 0.88rem;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  outline: none;
  background: #fdfdfd;
}

.search-bar input:focus {
  border-color: var(--ka-blue);
  background: #ffffff;
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--ka-text-muted);
}

.header-center {
  display: flex;
  justify-content: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  flex: 1;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ka-navy);
}

.nav-link:hover {
  color: var(--ka-blue);
  text-decoration: none;
}

.donate-link {
  color: var(--ka-blue);
}

.btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--ka-blue);
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-signup:hover {
  background: var(--ka-blue-hover);
  text-decoration: none;
}

/* 2. Breadcrumb Navigation */
.breadcrumb-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--ka-border);
  padding: 0.65rem 0;
  font-size: 0.85rem;
}

.breadcrumb-container {
  display: flex;
  align-items: center;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.home-crumb {
  display: inline-flex;
  align-items: center;
  color: var(--ka-blue);
}

.dot-separator {
  color: var(--ka-text-muted);
  font-size: 0.75rem;
}

.breadcrumb-list a {
  color: var(--ka-blue);
  font-weight: 500;
}

.breadcrumb-list .current a {
  color: var(--ka-blue);
  font-weight: 500;
}

/* 3. Main Layout Structure (Left pinned to left, content expands to right) */
.main-layout {
  display: flex;
  gap: 2.5rem;
  padding-top: 1.75rem;
  padding-bottom: 4rem;
  align-items: flex-start;
  width: 100%;
}

/* Left Sticky Course Sidebar */
.course-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 0.25rem;
}

.sidebar-course-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
}

.sidebar-course-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #14bf96;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.sidebar-course-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ka-navy);
  line-height: 1.25;
}

.sidebar-units-count {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ka-text-muted);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.close-drawer-btn {
  display: none;
}

/* Unit Nav List */
.unit-nav-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.unit-nav-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--ka-border);
  border-left: 4px solid transparent;
  background: transparent;
  transition: background 0.15s;
  text-decoration: none;
}

.unit-nav-item:hover,
.unit-nav-item.is-hovered {
  background-color: #ebf3ff;
  text-decoration: none;
}

.unit-nav-item:hover .unit-nav-tag,
.unit-nav-item:hover .unit-nav-name,
.unit-nav-item.is-hovered .unit-nav-tag,
.unit-nav-item.is-hovered .unit-nav-name {
  color: var(--ka-blue);
}

/* Authentic Active Unit indicator (Vertical Straight Blue Bar) */
.unit-nav-item.active {
  background-color: var(--ka-blue-light);
  border-left: 4px solid var(--ka-blue);
  border-bottom: 1px solid #dce7fa;
}

.unit-nav-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ka-text-muted);
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}

.unit-nav-item.active .unit-nav-tag {
  color: var(--ka-blue);
}

.unit-nav-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ka-charcoal);
  line-height: 1.35;
}

.unit-nav-item.active .unit-nav-name {
  color: var(--ka-blue);
  font-weight: 700;
}

/* Course Challenge Card */
.sidebar-challenge-card {
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  background: #ffffff;
  padding: 0.9rem;
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ka-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.challenge-desc {
  font-size: 0.82rem;
  color: var(--ka-charcoal);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.challenge-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ka-blue);
  display: inline-block;
}

/* 4. Right Unit Content Area (Expands fully to right edge) */
.unit-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Unit Header Section */
.unit-header-section {
  margin-bottom: 1.5rem;
}

.unit-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ka-navy);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.skills-summary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.skills-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ka-charcoal);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.info-icon {
  font-size: 0.82rem;
  color: var(--ka-text-muted);
  cursor: help;
}

/* Mastery Legend Bar */
.mastery-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.82rem;
  color: var(--ka-charcoal);
}

.legend-chip-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.legend-chip-item:hover .legend-chip {
  background: #eef2f7;
}

.legend-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 270px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 0.95rem;
  white-space: normal;
  word-wrap: break-word;
  z-index: 150;
  pointer-events: none;
  text-align: left;
}

.legend-chip-item:hover .legend-popover,
.legend-chip-item.is-hovered .legend-popover {
  display: block;
}

.legend-popover .popover-arrow {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-right: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  border-top: none;
  border-left: none;
}

.popover-desc {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
  margin-top: 0.25rem;
  font-weight: 400;
  word-break: normal;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  font-size: 0.7rem;
  line-height: 1;
}

.badge-mastered {
  background: #5c35c6;
  color: #ffffff;
  font-size: 0.62rem;
}

.badge-proficient {
  background: #7852e6;
}

.badge-familiar {
  background: #f59e0b;
}

.badge-attempted {
  background: #f87171;
}

.badge-notstarted {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
}

.badge-quiz {
  color: var(--ka-blue);
  font-size: 0.75rem;
}

.badge-test {
  color: #f59e0b;
  font-size: 0.8rem;
}

/* Skills Progress Block Chain with Rich Tooltip (Matches Screenshot 2) */
.skills-progress-blocks {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  position: relative;
}

.progress-block-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-block {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.progress-block.status-familiar {
  background: #f59e0b;
}

.progress-block.status-notstarted {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
}

.progress-block.block-quiz {
  color: var(--ka-blue);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
}

.progress-block.block-test {
  color: #f59e0b;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
}

/* Hover style on block: dark thick border (Screenshot 2) */
.progress-block-item:hover .progress-block,
.progress-block-item.is-hovered .progress-block {
  border: 2px solid #586574 !important;
  border-radius: 4px;
}

/* Tooltip Popover (Screenshot 2) */
.block-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -10px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0.65rem 0.95rem;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

.progress-block-item:hover .block-popover,
.progress-block-item.is-hovered .block-popover {
  display: block;
}

.popover-arrow {
  position: absolute;
  top: -5px;
  left: 17px;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-left: 1px solid #d1d5db;
  border-top: 1px solid #d1d5db;
  transform: rotate(45deg);
}

.popover-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.popover-status {
  font-size: 0.8rem;
  color: #64748b;
}

/* About This Unit Card */
.about-unit-card {
  background: #ffffff;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  padding: 1.35rem 1.6rem;
  margin-bottom: 2rem;
}

.about-unit-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ka-navy);
  margin-bottom: 0.6rem;
}

.about-unit-text {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.55;
}

/* 5. Lesson Sections */
.lesson-section {
  margin-bottom: 2.75rem;
}

/* Two Column Card (Title inside, 2 columns with NO vertical border / transparent divider) */
.two-column-card {
  background: #ffffff;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  padding: 1.75rem 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Subjudul inside the card */
.card-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ka-navy);
  margin-bottom: 1.5rem;
}

/* Split columns with generous gap and NO border between Learn and Practice */
.card-split-columns {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 3.5rem;
  align-items: start;
}

/* Column Headings */
.col-heading {
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1.15rem;
}

/* Learn Column (Transparent / No border) */
.col-learn {
  border-right: none;
  padding: 0;
}

.learn-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.learn-item-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.learn-item-btn:hover {
  background: #f8fafc;
}

.learn-item-btn:hover .item-label {
  color: var(--ka-blue);
  text-decoration: underline;
}

.icon-wrap {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
  background: #ffffff;
}

.item-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ka-charcoal);
  line-height: 1.35;
}

/* Practice Column (Clean rows) */
.col-practice {
  padding: 0;
  background: transparent;
}

.practice-items-list {
  display: flex;
  flex-direction: column;
}

.practice-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-top: 1px solid var(--ka-border);
  gap: 1.25rem;
  background: #ffffff;
}

/* Authentic Active / Up Next indicator with Blue Top Border (Screenshot 1) */
.practice-card-row.is-up-next {
  border-top: 3px solid var(--ka-blue);
  background: #fafcff;
}

.practice-info {
  flex: 1;
  min-width: 0;
}

.up-next-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ka-blue);
  margin-bottom: 0.25rem;
}

.practice-skill-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ka-navy);
  margin-bottom: 0.2rem;
}

.practice-skill-hint {
  font-size: 0.8rem;
  color: var(--ka-text-muted);
  margin-bottom: 0.75rem;
}

.practice-status-cell {
  flex-shrink: 0;
  text-align: right;
}

.status-text {
  font-size: 0.82rem;
  color: var(--ka-text-muted);
  white-space: nowrap;
}

/* Buttons (Authentic clean square styling, max 4px radius, identical dimensions) */
.btn-action-primary,
.btn-action-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 1.25rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 4px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

.btn-action-primary {
  color: #ffffff;
  background: var(--ka-blue);
  border: 1px solid var(--ka-blue);
  transition: background 0.15s, border-color 0.15s;
}

.btn-action-primary:hover {
  background: var(--ka-blue-hover);
  border-color: var(--ka-blue-hover);
}

.btn-action-outline {
  color: var(--ka-blue);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  transition: all 0.15s;
}

.btn-action-outline:hover {
  border-color: var(--ka-blue);
  background: #f8fafc;
}

.btn-action-outline:hover {
  border-color: var(--ka-blue);
  background: #f8fafc;
}

/* 6. Quiz Cards with Mascot (Matches User's Photo 2) */
.quiz-assessment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  margin-top: 1.25rem;
  padding: 1.5rem 1.75rem;
  gap: 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.quiz-assessment-card:hover {
  border-color: var(--ka-blue);
}

.quiz-content-left {
  flex: 1;
}

.quiz-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ka-navy);
  margin-bottom: 0.4rem;
}

.quiz-subtext {
  font-size: 0.9rem;
  color: var(--ka-text-muted);
  margin-bottom: 0.85rem;
  max-width: 480px;
}

.quiz-mascot-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 7. Unit Test Card */
.unit-test-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--ka-border);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  gap: 1.5rem;
  margin-bottom: 3rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.unit-test-card:hover {
  border-color: var(--ka-blue);
}

.unit-test-left {
  flex: 1;
}

.unit-test-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ka-navy);
  margin-bottom: 0.4rem;
}

.unit-test-desc {
  font-size: 0.9rem;
  color: var(--ka-text-muted);
  margin-bottom: 0.85rem;
  max-width: 500px;
}

.unit-test-mascot {
  flex-shrink: 0;
}

.star-badge-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffbeb;
  border-radius: 50%;
}

/* 8. Modals (Practice & Video) */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 33, 73, 0.65);
  backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 4px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ka-border);
}

.modal-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ka-blue);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ka-navy);
}

.modal-close-btn {
  color: var(--ka-text-muted);
  padding: 0.25rem;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: var(--ka-bg-light);
  color: var(--ka-charcoal);
}

.modal-body {
  padding: 1.5rem;
}

.problem-prompt {
  font-size: 1.02rem;
  color: var(--ka-navy);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.ka-math-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
}

.ka-math-table th,
.ka-math-table td {
  border: 1px solid var(--ka-border);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.95rem;
}

.ka-math-table th {
  background: #f8fafc;
  font-weight: 700;
}

.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--ka-border);
  border-radius: 4px;
  background: #ffffff;
  font-size: 0.95rem;
  color: var(--ka-charcoal);
  transition: all 0.15s;
}

.option-btn:hover {
  border-color: var(--ka-border-hover);
  background: #fbfcfd;
}

.option-btn.selected {
  border-color: var(--ka-blue);
  background: #f0f5fe;
}

.opt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: #ffffff;
}

.option-btn.selected .opt-badge {
  background: var(--ka-blue);
  color: #ffffff;
  border-color: var(--ka-blue);
}

.input-box-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.input-box-wrapper input {
  padding: 0.55rem 0.85rem;
  font-size: 1rem;
  border: 1.5px solid var(--ka-border);
  border-radius: 4px;
  width: 120px;
}

.input-box-wrapper input:focus {
  border-color: var(--ka-blue);
  outline: none;
}

.feedback-banner {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-size: 0.92rem;
  margin-top: 1rem;
  line-height: 1.45;
}

.feedback-banner.correct {
  display: block;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.feedback-banner.incorrect {
  display: block;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.exercise-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ka-border);
}

.btn-check-answer {
  background: var(--ka-green-dark);
  color: #ffffff;
  padding: 0.65rem 1.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.btn-check-answer:hover {
  opacity: 0.9;
}

/* Video Player Mockup */
.video-mockup-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b192c;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-overlay {
  text-align: center;
  padding: 1.5rem;
  max-width: 520px;
}

.play-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ka-blue);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.video-disclaimer {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.video-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ka-navy);
  margin-bottom: 0.4rem;
}

.video-details p {
  font-size: 0.92rem;
  color: var(--ka-text-muted);
}

/* 9. Global Footer */
.ka-footer {
  background: #ffffff;
  border-top: 1px solid var(--ka-border);
  padding: 3rem 0;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-brand {
  max-width: 380px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--ka-text-muted);
  margin: 0.8rem 0 0.5rem;
}

.footer-brand small {
  font-size: 0.76rem;
  color: #94a3b8;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-links h5 {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ka-charcoal);
  margin-bottom: 0.75rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--ka-text-muted);
}

.footer-links a:hover {
  color: var(--ka-blue);
}

/* 10. Responsive Breakpoints */
@media (max-width: 992px) {
  .math-index-page .mobile-menu-btn,
  .course-overview-page .mobile-menu-btn { display: inline-flex; }
  .math-index-page .courses-btn,
  .course-overview-page .courses-btn { display: none; }

  .main-layout {
    flex-direction: column;
  }

  .course-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    z-index: 250;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    padding: 1.25rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease-in-out;
  }

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

  .close-drawer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 240;
  }

  .drawer-backdrop.open {
    display: block;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .card-split-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .search-bar,
  .header-right .donate-link,
  .header-right .login-link {
    display: none;
  }

  .container,
  .ka-header {
    padding: 0 1rem;
  }

  .unit-main-title {
    font-size: 1.4rem;
    line-height: 1.25;
    overflow-wrap: break-word;
  }

  .skills-progress-blocks {
    flex-wrap: wrap;
  }

  .two-column-card {
    padding: 1.25rem 1rem;
  }

  .quiz-assessment-card,
  .unit-test-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-mascot-right,
  .unit-test-mascot {
    align-self: center;
  }
}

/* Layer 1: Math course catalog */
.math-index-page {
  min-height: 100vh;
  background: #f7f8fa;
}

.math-index-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 69px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b2149;
  box-shadow: 0 1px 3px rgba(5, 20, 48, 0.12);
}

.math-index-header a {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 600;
}

.math-index-header a:hover { text-decoration: none; }

.math-catalog {
  width: min(954px, calc(100% - 32px));
  margin: 38px auto 64px;
  display: grid;
  gap: 13px;
}

.math-catalog-card {
  min-height: 104px;
  padding: 21px 26px 25px;
  border: 1px solid #d6d8dc;
  border-radius: 7px;
  background: #fff;
}

.math-catalog-card:first-child,
.math-catalog-card:last-child { min-height: 150px; }

.prototype-notice {
  width: min(954px, calc(100% - 32px));
  margin: 16px auto -20px;
  color: #5c4a16;
  font-size: 0.85rem;
}
.prototype-notice:empty { display: none; }

.math-catalog-card h2 {
  margin: 0 0 9px;
  color: #39465b;
  font-size: 1rem;
  font-weight: 600;
}

.math-course-title { color: inherit; }
.math-course-title:hover { color: var(--ka-blue); }

.math-topic-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 4px;
}

.math-topic-columns a {
  color: #53647f;
  font-size: 0.76rem;
  line-height: 1.65;
}

.statistics-catalog-card {
  border-color: #b8c9d8;
  box-shadow: 0 1px 3px rgba(21, 42, 68, 0.05);
}

/* Layer 2: Course collection and mastery overview */
.course-overview-page { background: #fff; }

.learning-streakbar {
  min-height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border-bottom: 1px solid #d8dce2;
  background: #fff;
  color: #20242b;
  font-size: 0.88rem;
}

.streak-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #565a62;
  font-size: 0.75rem;
}

.streak-metrics > span:first-child { color: #858990; font-size: 1rem; }
.streak-metrics b { color: #1f2329; }
.streak-metrics small { display: block; font-size: 0.6rem; }
.level-marker { padding-left: 10px; border-left: 1px solid #d5d8de; }
.level-track { width: 140px; height: 6px; border-radius: 8px; background: #e5e6e9; }
.level-track i { display: block; width: 8px; height: 8px; margin-top: -1px; border-radius: 50%; background: #9d55ff; }
.streak-metrics > a { padding: 5px 14px; border-radius: 4px; background: #1865f2; color: #fff; font-size: 0.7rem; font-weight: 600; }

.course-overview-layout { display: flex; min-height: calc(100vh - 48px); }

.statistics-sidebar {
  flex: 0 0 304px;
  padding: 18px 18px 24px 16px;
  border-right: 1px solid #e2e4e8;
  background: #fff;
}

.statistics-sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  margin-bottom: 4px;
  padding: 7px 12px;
  background: #eef4fc;
  color: #18304e;
}

.statistics-sidebar-title:hover { text-decoration: none; }
.statistics-sidebar-title b { display: block; font-size: 0.83rem; }
.statistics-sidebar-title small { display: block; margin-top: 3px; color: #606a78; font-size: 0.61rem; }
.stats-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #27b8c7; color: #fff; font-size: 1.15rem; }

.statistics-sidebar nav { display: grid; }
.statistics-sidebar nav a {
  display: block;
  padding: 11px 12px;
  border-bottom: 1px solid #e1e3e7;
  color: #17375f;
  font-size: 0.78rem;
  line-height: 1.35;
}
.statistics-sidebar nav a.active { border-left: 3px solid #1865f2; background: #f4f7fc; }
.statistics-sidebar nav small { display: block; margin-bottom: 3px; color: #657184; font-size: 0.58rem; }

.course-challenge-box {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  color: #243247;
  font-size: 0.68rem;
}
.course-challenge-box b { font-size: 0.58rem; }
.course-challenge-box span { color: #59677b; }
.course-challenge-box strong { color: #1865f2; font-weight: 500; }
.course-challenge-box:hover { text-decoration: none; border-color: #aebbd0; }

.course-overview-main { flex: 1; min-width: 0; padding: 16px clamp(22px, 4vw, 64px) 38px; }
.course-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.75rem; }
.course-overview-main > h1 { margin: 0; color: #2a2d33; font-size: 1.75rem; line-height: 1.2; }
.course-skills-count { margin: 5px 0 17px; color: #676b73; font-size: 0.8rem; }

.course-mastery-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin: 0 0 17px; color: #4a4d54; font-size: 0.68rem; }
.course-mastery-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mastery-swatch { width: 18px; height: 18px; display: inline-grid; place-items: center; border: 1px solid #aeb2b9; border-radius: 3px; font-style: normal; font-size: 0.68rem; }
.mastery-swatch.mastered { border-color: #6843a4; background: #6843a4; color: #fff; }
.mastery-swatch.proficient { border-color: #8d83c9; background: #8d83c9; }
.mastery-swatch.familiar { border-color: #db8617; background: #db8617; }
.mastery-swatch.attempted { border-color: #e06b31; }
.mastery-swatch.not-started { background: #fff; }

.course-progress-matrix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
.progress-unit { min-width: 0; padding: 8px 10px; border-bottom: 1px solid #d8dce2; }
.progress-unit.active-unit { background: #eaf1fa; }
.progress-unit > a { display: block; margin-bottom: 6px; color: #333841; font-size: 0.67rem; }
.progress-unit > a span { margin-left: 8px; color: #69727f; font-size: 0.6rem; }
.skill-track { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-cell { width: 19px; height: 20px; display: inline-grid; flex: 0 0 auto; place-items: center; border: 1px solid #999fa8; border-radius: 3px; background: #fff; color: #60656e; font-size: 0.64rem; line-height: 1; }
.skill-cell:hover { border-color: #1865f2; text-decoration: none; }
.skill-cell.next-skill { outline: 2px solid #1865f2; outline-offset: 1px; }
.skill-cell.quiz-cell { background: #e8e8eb; border-color: #e8e8eb; }
.skill-cell.test-cell { background: #e8e8eb; border-color: #e8e8eb; }
.challenge-inline { margin: 0 0 0 0; align-self: stretch; }

.course-update-notice { max-width: 510px; margin: 24px auto 76px; text-align: center; color: #50545c; }
.course-update-notice b { display: block; margin-bottom: 13px; font-size: 1rem; }
.course-update-notice p { font-size: 0.78rem; line-height: 1.55; }

.up-next-unit { margin: 0 -32px; border-top: 4px solid #1865f2; background: #fff; box-shadow: 0 -1px 6px rgba(20, 42, 72, 0.08); }
.up-next-heading { display: flex; justify-content: space-between; gap: 20px; padding: 11px 14px; border-bottom: 1px solid #dfe2e6; color: #60646c; font-size: 0.68rem; }
.up-next-heading p { margin: 0; }
.up-next-heading > span { white-space: nowrap; }
.unit-material-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 15px 14px 22px; }
.unit-material-columns h2 { margin: 0 0 8px; color: #555a62; font-size: 0.72rem; }
.unit-material-columns a { display: block; padding: 4px 0; color: #737982; font-size: 0.68rem; }
.unit-material-columns .unit-quiz-link { margin-top: 5px; color: #1865f2; }

@media (max-width: 900px) {
  .course-overview-layout { display: block; }
  .statistics-sidebar { padding: 12px; border-right: 0; border-bottom: 1px solid #e2e4e8; }
  .statistics-sidebar nav { display: flex; gap: 5px; overflow-x: auto; }
  .statistics-sidebar nav a { flex: 0 0 190px; border: 1px solid #e1e3e7; border-radius: 4px; }
  .statistics-sidebar nav a.active { border-left: 1px solid #1865f2; }
  .statistics-sidebar .course-challenge-box { display: none; }
  .course-overview-main { padding: 18px 20px 30px; }
  .up-next-unit { margin: 0 -8px; }
}

@media (max-width: 620px) {
  .math-catalog { margin-top: 18px; }
  .math-catalog-card { min-height: auto !important; padding: 17px 18px; }
  .math-topic-columns { grid-template-columns: 1fr; gap: 5px; }
  .math-topic-columns a { font-size: 0.82rem; }
  .learning-streakbar { flex-direction: column; justify-content: center; gap: 6px; padding: 9px 12px; font-size: 0.74rem; text-align: center; }
  .streak-metrics { justify-content: center; flex-wrap: wrap; gap: 7px 10px; font-size: 0.68rem; }
  .streak-metrics > span:first-child { font-size: 0.82rem; }
  .level-track { width: 72px; }
  .streak-metrics > a { padding: 4px 9px; }
  .course-overview-main { padding: 16px 13px 24px; }
  .course-overview-main > h1 { font-size: 1.45rem; }
  .course-progress-matrix { grid-template-columns: 1fr; }
  .progress-unit { padding: 8px 6px; }
  .skill-track { gap: 3px; }
  .skill-cell { width: 17px; height: 18px; }
  .course-update-notice { margin: 22px auto 48px; }
  .unit-material-columns { grid-template-columns: 1fr; gap: 18px; }
  .up-next-heading { padding: 10px; font-size: 0.64rem; }
}

@media (max-width: 390px) {
  .streak-metrics .level-track { display: none; }
  .streak-metrics .level-marker { padding-left: 7px; }
}

/* Dedicated lesson view: course navigation stays beside the player. */
.lesson-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  color: #202124;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(330px, 21.5vw) minmax(0, 1fr);
  height: 100%;
}

.lesson-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 8px 0 8px 12px;
  overflow: hidden;
  border: 1px solid #d7dbe0;
  border-radius: 12px;
  background: #fff;
}

.lesson-course-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e2e5;
  color: #202124;
  font-size: 1.05rem;
  font-weight: 700;
}
.lesson-course-heading:hover { text-decoration: none; background: #fbfcfe; }
.lesson-course-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #312e81; color: #fff; }
.lesson-course-icon svg { width: 25px; height: 25px; }

.lesson-sidebar-unit { padding: 12px 14px 10px; border-bottom: 1px solid #eceef1; }
.lesson-unit-breadcrumb { display: flex; align-items: center; gap: 7px; margin: 0 24px 4px; color: #1758c8; font-size: 0.61rem; font-weight: 600; white-space: nowrap; }
.lesson-unit-breadcrumb a { overflow: hidden; color: #1758c8; text-overflow: ellipsis; }
.lesson-unit-title-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 6px; }
.lesson-unit-title-row strong { color: #15171a; font-size: 0.83rem; line-height: 1.35; text-align: center; }
.lesson-unit-title-row button { width: 24px; height: 30px; color: #4b5563; font-size: 1.5rem; }
.lesson-unit-title-row button:disabled { color: #d2d6dc; cursor: default; }

.lesson-sidebar-scroll { flex: 1 1 auto; min-height: 70px; overflow: auto; scrollbar-width: thin; }
.lesson-contents { padding: 0 14px; }
.lesson-content-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 72px; padding: 10px 8px; border-bottom: 1px solid #e1e4e8; color: #22262c; font-size: 0.88rem; line-height: 1.35; }
.lesson-content-row:hover { background: #f5f8fc; text-decoration: none; }
.lesson-content-row.is-current { position: relative; background: #eef4fc; color: #174ea6; }
.lesson-content-row.is-current::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #1865f2; content: ''; }
.lesson-content-icon { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #aeb5be; border-radius: 2px; color: #38424d; font-size: 0.75rem; }
.lesson-content-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lesson-content-label small { display: block; margin-top: 2px; color: #737980; font-size: 0.72rem; }

.lesson-sidebar-bottom { flex: 0 0 auto; padding: 10px 14px 14px; background: #fff; }
.lesson-breadcrumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 6px; max-height: 108px; overflow: auto; padding: 10px; border-radius: 5px; background: #f4f6f8; color: #4c5a6b; font-size: 0.71rem; line-height: 1.5; text-align: center; }
.lesson-breadcrumbs a { color: #536b88; text-decoration: underline; }
.lesson-footer { padding-top: 12px; color: #6e7480; font-size: 0.62rem; line-height: 1.7; text-align: center; }
.lesson-footer a { margin: 0 3px; color: #52647b; text-decoration: underline; }

.lesson-main { min-width: 0; overflow-y: auto; padding: 8px 28px 76px; text-align: center; }
.lesson-main-heading { max-width: 1000px; margin: 0 auto; }
.lesson-eyebrow { margin: 0 0 2px; color: #667085; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; }
.lesson-main-heading h1 { margin: 0; color: #181a1f; font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 600; line-height: 1.3; }
.lesson-actions { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 12px; }
.lesson-teams-link { color: #a1a5ab; font-size: 0.84rem; font-weight: 600; }
.lesson-share-link { display: inline-flex; align-items: center; gap: 8px; color: #165df4; font-size: 0.84rem; }
.lesson-share-link svg { width: 20px; height: 20px; }
.lesson-share-feedback { min-height: 16px; margin: 3px 0 0; color: #526274; font-size: 0.7rem; }

.lesson-player-section { display: grid; place-items: center; margin: 10px auto 16px; }
.lesson-player-frame { position: relative; display: grid; width: min(100%, 1380px); height: min(62vh, 550px); min-height: 280px; place-items: center; overflow: hidden; background: #050505; }
.lesson-player-frame iframe { display: block; width: auto; height: 100%; max-width: 100%; aspect-ratio: 16 / 9; border: 0; background: #050505; }
.lesson-player-frame iframe[hidden] { display: none; }
.lesson-video-placeholder { position: relative; display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; background: #f8f9fb; }
.lesson-video-placeholder[hidden] { display: none; }
.lesson-video-placeholder::before,
.lesson-video-placeholder::after { position: absolute; top: 0; bottom: 0; width: 14.5%; background: #050505; content: ''; }
.lesson-video-placeholder::before { left: 0; }
.lesson-video-placeholder::after { right: 0; }
.lesson-video-title-art { position: relative; display: flex; width: 68%; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 28px; }
.lesson-video-title-art strong { z-index: 1; max-width: 650px; color: #22252d; font-size: clamp(1.7rem, 5vw, 3.7rem); font-weight: 700; line-height: 1.12; }
.lesson-video-scribble { position: absolute; top: 25%; color: #7d8aa8; font-family: Georgia, serif; font-size: clamp(1rem, 3vw, 2.6rem); font-style: italic; filter: blur(1px); transform: rotate(-4deg); }
.lesson-video-brand { position: absolute; bottom: 5%; left: 4%; display: flex; align-items: center; gap: 9px; color: #172554; font-size: clamp(1rem, 2.5vw, 2rem); font-weight: 700; }
.lesson-video-brand > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #14bf96; color: #fff; font-size: 1.2rem; }
.lesson-play-original { position: absolute; z-index: 2; top: 50%; left: 50%; display: grid; width: 82px; height: 82px; place-items: center; border-radius: 50%; background: #1865f2; color: #fff; font-size: 2rem; transform: translate(-50%, -50%); }
.lesson-play-original:hover { background: #0b4ec2; text-decoration: none; }
.lesson-video-status { position: absolute; right: 16px; bottom: 12px; z-index: 3; margin: 0; padding: 6px 10px; border-radius: 20px; background: rgba(30, 34, 40, 0.68); color: #fff; font-size: 0.7rem; }

.lesson-tabs { display: flex; justify-content: center; gap: 24px; border-bottom: 1px solid #e1e4e8; }
.lesson-tabs button { padding: 10px 4px 8px; border-bottom: 2px solid transparent; color: #6c737d; font-size: 0.84rem; }
.lesson-tabs button.active { border-color: #1865f2; color: #1865f2; }
.lesson-info-panel { max-width: 920px; margin: 16px auto; color: #454b54; font-size: 0.9rem; line-height: 1.6; text-align: left; }
.lesson-info-panel h2 { margin: 0 0 6px; color: #252a31; font-size: 1rem; }
.lesson-info-panel p { margin: 0; }
.lesson-original-link-wrap { max-width: 920px; margin: 0 auto; text-align: left; }
.lesson-original-link-wrap a { color: #175fe8; font-size: 0.83rem; }
.lesson-up-next { position: fixed; right: 16px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 5px; background: #1865f2; color: #fff; box-shadow: 0 2px 7px rgba(11, 33, 73, 0.2); font-size: 0.78rem; font-weight: 600; }
.lesson-up-next:hover { background: #0b4ec2; text-decoration: none; }
.lesson-up-next strong { font-weight: 700; }
.lesson-up-next-arrow { font-size: 1rem; }

@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: minmax(280px, 36vw) minmax(0, 1fr); }
  .lesson-sidebar { margin-left: 6px; }
  .lesson-main { padding-right: 16px; padding-left: 16px; }
  .lesson-player-frame { height: min(54vh, 440px); }
  .lesson-video-placeholder::before,
  .lesson-video-placeholder::after { width: 9%; }
}

@media (max-width: 680px) {
  .lesson-page { height: auto; min-height: 100vh; overflow: auto; }
  .lesson-layout { display: flex; height: auto; min-height: 100vh; flex-direction: column; }
  .lesson-sidebar { max-height: 38vh; min-height: 240px; margin: 6px; }
  .lesson-sidebar-bottom { display: none; }
  .lesson-main { overflow: visible; padding: 8px 12px 92px; }
  .lesson-main-heading h1 { font-size: 1.35rem; }
  .lesson-actions { gap: 16px; }
  .lesson-player-frame { height: min(60vw, 320px); min-height: 200px; }
  .lesson-video-placeholder::before,
  .lesson-video-placeholder::after { width: 6%; }
  .lesson-video-title-art { width: 88%; padding: 14px; }
  .lesson-video-title-art strong { font-size: clamp(1.3rem, 6vw, 2rem); }
  .lesson-video-brand { font-size: 0.9rem; }
  .lesson-video-brand > span { width: 24px; height: 24px; }
  .lesson-play-original { width: 60px; height: 60px; font-size: 1.5rem; }
  .lesson-up-next { right: 8px; bottom: 8px; left: 8px; justify-content: center; }
}

/* In-lesson practice runner. Exercises stay inside the lesson shell. */
.practice-mode[hidden],
.practice-ready[hidden],
.practice-question[hidden],
.practice-footer[hidden],
.practice-feedback[hidden],
.lesson-video-only[hidden],
.lesson-original-link-wrap[hidden],
.lesson-up-next[hidden],
.practice-text-button[hidden],
.practice-inline-hint[hidden],
.practice-primary[hidden] { display: none !important; }

.practice-active .lesson-main { padding-right: 0; padding-bottom: 88px; padding-left: 0; }
.practice-active .lesson-main-heading { padding: 0 28px; }
.practice-mode { margin-top: 14px; text-align: left; }
.practice-ready { position: relative; min-height: 590px; overflow: hidden; background: #2258b9; color: #fff; text-align: center; }
.practice-ready-copy { position: relative; z-index: 2; padding: 86px 24px 0; }
.practice-ready-copy h2 { margin: 0 0 12px; font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1.1; }
.practice-ready-copy p { margin: 0 0 30px; font-size: 1.2rem; }
.practice-ready-copy strong { font-size: 1.1rem; }
.practice-characters { position: absolute; inset: auto 0 0; height: 300px; }
.practice-blob { position: absolute; bottom: -80px; display: grid; place-items: start center; color: #102c68; font-size: 5rem; line-height: 1; box-shadow: inset 0 0 55px rgba(255,255,255,.28); transform: rotate(-8deg); }
.practice-blob::before,
.practice-blob::after { position: absolute; top: 60px; width: 20px; height: 34px; border-radius: 50%; background: #fff; content: ''; }
.practice-blob::before { left: 38%; transform: rotate(25deg); }
.practice-blob::after { right: 38%; transform: rotate(-25deg); }
.practice-blob-one { left: 7%; width: 310px; height: 330px; border-radius: 36% 44% 28% 50%; background: linear-gradient(135deg,#74a4ed,#9a7fc9); }
.practice-blob-two { left: 43%; width: 300px; height: 260px; border-radius: 50% 46% 22% 40%; background: #9be0d8; transform: rotate(4deg); }
.practice-blob-three { right: 6%; width: 250px; height: 260px; border-radius: 47% 40% 30% 45%; background: #9cbdf2; transform: rotate(8deg); }
.practice-primary { min-width: 126px; padding: 12px 20px; border-radius: 4px; background: #1865f2; color: #fff; font-weight: 700; }
.practice-primary:hover:not(:disabled) { background: #0b4ec2; }
.practice-primary:disabled { background: #b9bdc4; color: #fff; cursor: default; }
.practice-ready-button { position: absolute; right: 18px; bottom: 16px; z-index: 3; background: #fff; color: #185abc; }
.practice-ready-button:hover:not(:disabled) { background: #edf4ff; }

.practice-question { padding: 18px 24px 60px; }
.practice-question-card { width: min(100%, 650px); margin: 0 auto; color: #17191d; font-size: 0.95rem; line-height: 1.38; }
.practice-question-card > p:first-child { margin: 0 0 22px; }
.practice-question-card h2 { margin: 0 0 20px; font-size: 1rem; line-height: 1.4; }
.practice-instruction { margin: 0; padding-bottom: 16px; border-bottom: 1px solid #d9dde3; font-weight: 600; }
.practice-answers { display: flex; flex-direction: column; }
.practice-answer { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; min-height: 80px; padding: 14px 16px; border-bottom: 1px solid #d9dde3; color: #353a42; text-align: left; }
.practice-answer:hover:not(:disabled) { background: #f7f9fc; }
.practice-answer.selected { color: #1559cf; }
.practice-answer-letter { display: grid; width: 32px; height: 32px; place-items: center; border: 2px solid #6b7179; border-radius: 50%; font-weight: 600; }
.practice-answer.selected .practice-answer-letter { border-color: #1865f2; background: #1865f2; color: #fff; }
.practice-answer.incorrect { background: #fff8f7; color: #a33b2e; }
.practice-answer.correct { margin-top: 7px; margin-bottom: 7px; border: 2px solid #12a13a; border-radius: 8px; background: #fff; color: #14733c; }
.practice-answer.correct .practice-answer-letter { width: auto; min-width: 42px; padding: 0 7px; border-color: #11852f; background: #11852f; color: #fff; }
.practice-answer.locked { background: #f5f6f7; color: #a0a5ad; cursor: default; opacity: .78; }
.practice-hints { margin-top: 4px; }
.practice-hint { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; }
.practice-hint strong { padding-top: 18px; color: #1765ed; font-size: .88rem; white-space: nowrap; }
.practice-hint p { margin: 0; padding: 18px 8px 18px 18px; border-left: 3px solid #dfe2e6; line-height: 1.55; }
.practice-hint:last-child p { border-left-color: #aeb7c4; }
.practice-inline-hint { display: inline-flex; margin: 4px 0 14px 64px; padding: 8px 0; color: #1765ed; font-size: .86rem; font-weight: 700; text-align: left; }
.practice-inline-hint:hover:not(:disabled) { text-decoration: underline; }
.practice-inline-hint:disabled { color: #8b929c; cursor: default; }
.practice-related { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid #d9dde3; color: #56606d; font-size: .75rem; }
.practice-related a { color: #16191e; font-size: .82rem; font-weight: 600; }

.practice-footer { position: fixed; right: 0; bottom: 0; left: max(330px, 21.5vw); z-index: 20; display: flex; min-height: 66px; align-items: center; justify-content: center; gap: 22px; padding: 8px 16px; border-top: 1px solid #d9dde3; background: #fff; }
.practice-footer-progress { display: flex; align-items: center; gap: 12px; }
.practice-reset-icon { color: #1261ed; font-size: 1.6rem; }
.practice-progress-dots { display: flex; gap: 7px; }
.practice-progress-dots i { width: 8px; height: 8px; border: 2px solid #9ba1a9; border-radius: 50%; }
.practice-progress-dots i.active { border-color: #9ba1a9; background: #9ba1a9; }
.practice-footer-actions { position: absolute; right: 16px; display: flex; align-items: center; gap: 18px; }
.practice-text-button { color: #1765ed; font-weight: 700; }
.practice-text-button:disabled { color: #9aa1ab; }
.practice-feedback { position: fixed; right: 10px; bottom: 76px; z-index: 24; width: 200px; padding: 18px 16px 14px; border: 1px solid #d5d9df; border-radius: 5px; background: #fff; box-shadow: 0 2px 10px rgba(20,33,54,.14); text-align: left; }
.practice-feedback strong { display: block; font-size: 1.08rem; }
.practice-feedback p { margin: 8px 0 14px; color: #505761; font-size: .83rem; }
.practice-feedback .practice-primary { width: 100%; min-width: 0; padding: 10px; }
.practice-feedback-close { position: absolute; top: 7px; right: 9px; color: #6d737b; font-size: 1.35rem; }

@media (max-width: 900px) {
  .practice-footer { left: max(280px, 36vw); justify-content: flex-start; }
  .practice-footer-progress strong { display: none; }
  .practice-blob-one { left: -6%; }
  .practice-blob-two { left: 35%; }
  .practice-blob-three { right: -8%; }
}

@media (max-width: 680px) {
  .practice-active .lesson-main { padding: 8px 0 84px; }
  .practice-active .lesson-main-heading { padding: 0 12px; }
  .practice-ready { min-height: 430px; }
  .practice-ready-copy { padding-top: 48px; }
  .practice-ready-copy h2 { font-size: 2rem; }
  .practice-characters { height: 220px; }
  .practice-blob-one { left: -26%; width: 220px; height: 230px; }
  .practice-blob-two { left: 30%; width: 210px; height: 200px; }
  .practice-blob-three { right: -25%; width: 190px; height: 200px; }
  .practice-question { padding: 18px 16px 50px; }
  .practice-footer { left: 0; min-height: 68px; justify-content: flex-start; }
  .practice-footer-progress { display: none; }
  .practice-footer-actions { right: 10px; left: 10px; justify-content: flex-end; }
  .practice-feedback { right: 8px; bottom: 78px; left: 8px; width: auto; }
}


/* ==========================================================================
   12. Source Material Cards & Metadata Display (Statistika dan Sains Data)
   ========================================================================== */

.source-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.source-card:hover {
  border-color: #bcc3cb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.source-card.is-selected {
  border-left: 4px solid #1865f2;
  background: #f9fbfd;
}

.source-card.khan-source-card {
  border-left: 4px solid #1865f2;
  background: #f7faff;
}

.source-card-title {
  margin: 4px 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #21242c;
  line-height: 1.35;
}

.source-card-note {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: #5f6368;
  line-height: 1.45;
}

.source-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #5f6368;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.source-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.source-badge-local {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

.source-badge-drive {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.source-relative-path {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #5f6368;
  word-break: break-all;
}

.source-relative-path code {
  font-family: Consolas, Monaco, "Lucida Console", monospace;
  font-size: 0.78rem;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e8eaed;
  color: #3c4043;
}

.source-open-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1865f2;
  text-decoration: none;
  white-space: nowrap;
}

.source-open-link:hover {
  text-decoration: underline;
}

.source-section {
  margin-top: 24px;
}

.source-section h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #21242c;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e3e6ea;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.learn-item-btn.source-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 4px;
  text-decoration: none;
  color: #21242c;
  transition: background 0.15s ease;
}

.learn-item-btn.source-row-link:hover {
  background: #f0f4fd;
  color: #1865f2;
}

.learn-item-btn.source-row-link .icon-wrap {
  font-size: 1.15rem;
  color: #1865f2;
  flex-shrink: 0;
}

.learn-item-btn.source-row-link .item-label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.learn-item-btn.source-row-link .item-label small {
  font-weight: 400;
  font-size: 0.78rem;
  color: #5f6368;
  margin-top: 2px;
}

.practice-card-row.khan-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
  background: #ffffff;
  text-decoration: none;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}

.practice-card-row.khan-card-row:hover {
  border-color: #1865f2;
  box-shadow: 0 2px 8px rgba(24, 101, 242, 0.08);
  background: #fbfdff;
}

.practice-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
  background: #ffffff;
  text-decoration: none;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}

.practice-card-row:hover {
  border-color: #1865f2;
  box-shadow: 0 2px 8px rgba(24, 101, 242, 0.08);
  background: #fbfdff;
}

.practice-card-row .practice-info {
  flex: 1;
}

.practice-card-row .practice-skill-title {
  margin: 2px 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #21242c;
}

.practice-card-row .practice-skill-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #5f6368;
  line-height: 1.35;
}

.source-empty {
  padding: 14px 16px;
  color: #5f6368;
  font-style: italic;
  font-size: 0.88rem;
  background: #f9fafb;
  border-radius: 4px;
}

.lesson-content-row.is-current {
  background: #e8f0fe !important;
  color: #1865f2 !important;
  font-weight: 600 !important;
  border-left: 3px solid #1865f2;
}

.btn-action-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #1865f2;
  color: #1865f2;
  background: #ffffff;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-action-outline:hover {
  background: #1865f2;
  color: #ffffff;
}

.btn-action-primary.start-btn-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 16px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 4px;
  background: #1865f2;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

.btn-action-primary.start-btn-size:hover {
  background: #0b4ec2;
}

/* Sidebar hover blue block on other units */
.unit-nav-item:hover:not(.active) {
  background: #e8f0fe !important;
  color: #1865f2 !important;
}

.ssd-topic-link {
  display: block;
  padding: 8px 12px;
  margin-bottom: 6px;
  color: #21242c;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ssd-topic-link:hover {
  background: #f0f4fd;
  color: #1865f2;
}

@media (max-width: 600px) {
  .source-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .practice-card-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .practice-card-row .btn-action-outline {
    width: 100%;
  }
}


.source-badge-drive-active {
  background: #e8f0fe;
  color: #1865f2;
  border: 1px solid #c2e7ff;
  text-decoration: none;
  transition: all 0.15s ease;
}

.source-badge-drive-active:hover {
  background: #1865f2;
  color: #ffffff;
}

.source-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.source-drive-link {
  font-size: 0.8rem;
  height: 32px;
  min-width: 90px;
  padding: 0 10px;
}
