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

/* ===== LankaConnect Authentic Design Tokens ===== */
:root {
  /* Backgrounds (sampled from screenshots) */
  --bg-page: #FAF6F3;
  --bg-card: #FFFFFF;
  --bg-soft: #F5EFE7;

  /* Text colors */
  --text-1: #1D1D1D;
  --text-2: #4A4A48;
  --text-3: #7E7E7E;
  --text-4: #A6A5A3;

  /* Borders */
  --border: #E8E0D0;
  --border-soft: #F0E9DC;

  /* Brand from logo */
  --brand-blue: #1B3A4B;
  --brand-blue-2: #2E5C70;
  --brand-orange: #E97B3B;

  /* CTA gradient (sampled exactly from "Add to favorites" button) */
  --cta-grad: linear-gradient(180deg, #D08F4F 0%, #C9763A 50%, #B86D2F 100%);
  --cta-grad-h: linear-gradient(180deg, #DCA068 0%, #D58547 50%, #C77C3D 100%);
  --cta-grad-active: linear-gradient(180deg, #B86D2F 0%, #A85820 100%);

  /* LC category icon colors (sampled from WhatsApp Communities screen) */
  --c-green: #4A6741;
  --c-green-bg: #E5EDE0;
  --c-orange: #C97B3B;
  --c-orange-bg: #F6E5D2;
  --c-blue: #2E5C70;
  --c-blue-bg: #DCE7EC;
  --c-purple: #6E4F8E;
  --c-purple-bg: #E7DEEE;
  --c-yellow: #B8860B;
  --c-yellow-bg: #F5EAC2;
  --c-pink: #B85268;
  --c-pink-bg: #F2D8DD;

  /* Badge style (from VEHICLES/JOBS labels) */
  --badge-bg: #F0E6D5;
  --badge-text: #896E50;

  /* Link green (from "View all communities") */
  --link-green: #2F7A4F;

  /* Fonts */
  --font: 'Inter', 'Noto Sans Sinhala', system-ui, -apple-system, sans-serif;
  --font-heb: 'Arial Hebrew', 'Arial', sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(27, 58, 75, 0.04);
  --shadow-2: 0 2px 6px rgba(27, 58, 75, 0.06);
  --shadow-3: 0 4px 12px rgba(27, 58, 75, 0.08);

  --tap: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-1);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; }

/* ===== Container - mobile-first (LC app width), expands on tablet/desktop ===== */
.lc-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-page);
  min-height: 100vh;
  padding: 16px max(16px, env(safe-area-inset-right)) 100px max(16px, env(safe-area-inset-left));
}

/* ===== Bilingual text ===== */
.bi { display: block; }
.si { font-family: 'Noto Sans Sinhala', var(--font); color: var(--text-1); display: block; line-height: 1.5; }
.en { font-family: var(--font); color: var(--text-3); font-size: 0.85em; display: block; margin-top: 1px; line-height: 1.4; font-style: italic; }
.bi-i { display: inline; }
.si-i { font-family: 'Noto Sans Sinhala', var(--font); }
.en-i { color: var(--text-3); font-size: 0.85em; font-style: italic; }

/* ===== Course Hero (top of home page) ===== */
.course-hero {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-2) 100%);
  color: white;
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.course-hero::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(233, 123, 59, 0.3), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.course-hero-title {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}
.course-hero-title .si { color: white; font-size: 1em; }
.course-hero-title .en { color: rgba(255,255,255,0.85); font-size: 0.65em; font-weight: 500; font-style: normal; margin-top: 2px; }
.course-hero-desc {
  font-size: 0.86em;
  opacity: 0.92;
  position: relative;
  margin-bottom: 18px;
}
.course-hero-desc .si-i { color: rgba(255,255,255,0.95); }
.course-hero-desc .en-i { color: rgba(255,255,255,0.7); display: block; margin-top: 1px; }
.course-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  position: relative;
}
.course-stat {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border-radius: var(--r-md);
  padding: 10px 6px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.course-stat-num {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--brand-orange);
  line-height: 1;
}
.course-stat-label {
  font-size: 0.7em;
  opacity: 0.92;
  line-height: 1.2;
}
.course-stat-label .si-i, .course-stat-label .en-i { display: block; }
.course-stat-label .en-i { font-size: 0.85em; opacity: 0.8; margin-top: 1px; }

/* ===== Video Frame (welcome video, dialog video, lesson video) ===== */
.video-frame {
  background: white;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  margin-bottom: 16px;
}
.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2A4A5C 0%, #1B3A4B 100%);
  overflow: hidden;
}
.video-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  z-index: 1;
}
/* Placeholder button - default visible layer until user clicks play */
.video-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%),
    linear-gradient(135deg, #2A4A5C 0%, #1B3A4B 100%);
  color: white;
  text-align: center;
  padding: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s;
}
.video-placeholder:hover { opacity: 0.92; }
.video-placeholder:active { opacity: 0.85; }
.video-placeholder.error {
  background: linear-gradient(135deg, #5C2A2A 0%, #3D1F1F 100%);
  cursor: default;
}
.video-frame.video-welcome .video-placeholder {
  background:
    radial-gradient(ellipse at center, rgba(208,143,79,0.18) 0%, transparent 70%),
    linear-gradient(135deg, #2A4A5C 0%, #1B3A4B 100%);
}
.video-ph-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.video-ph-icon svg { margin-left: 4px; }
.video-ph-label { display: flex; flex-direction: column; gap: 1px; }
.video-ph-si {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: 0.95em;
  font-weight: 600;
  color: white;
}
.video-ph-en {
  font-size: 0.78em;
  font-style: italic;
  color: rgba(255,255,255,0.75);
}
.video-ph-file {
  font-family: monospace;
  font-size: 0.7em;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.25);
  padding: 3px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
.video-caption {
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  text-align: center;
}
.video-caption-si {
  font-family: 'Noto Sans Sinhala', sans-serif;
  color: var(--text-1);
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.3;
}
.video-caption-en {
  color: var(--text-2);
  font-size: 0.78em;
  font-style: italic;
  margin-top: 2px;
}

/* Smaller/inline variant for dialog videos inside lesson cards */
.dialog .video-frame {
  margin-bottom: 14px;
}
.dialog .video-player { aspect-ratio: 16 / 9; }
.dialog .video-ph-icon { width: 56px; height: 56px; }
.dialog .video-ph-icon svg { width: 32px; height: 32px; }

/* ===== Search Bar (matches LC marketplace search) ===== */
.search-wrap {
  margin-bottom: 16px;
}
.search-bar {
  background: white;
  border-radius: var(--r-pill);
  padding: 0 16px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
}
.search-icon { color: var(--text-3); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95em;
  color: var(--text-1);
}
.search-bar input::placeholder { color: var(--text-3); font-size: 0.95em; }

/* Bilingual hint below search bar - framed badge */
.search-hint {
  margin-top: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}
.search-hint-si {
  font-family: 'Noto Sans Sinhala', sans-serif;
  color: var(--text-2);
  font-size: 0.78em;
  line-height: 1.3;
}
.search-hint-en {
  color: var(--text-3);
  font-size: 0.7em;
  font-style: italic;
  line-height: 1.2;
}

/* ===== Search Results ===== */
.search-results {
  background: white;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  margin-bottom: 16px;
  overflow: hidden;
}
.search-result {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-result:last-child { border-bottom: none; }
.search-result:active { background: var(--bg-soft); }
.search-result-num {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--c-blue-bg);
  color: var(--c-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9em;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-track {
  font-size: 0.7em;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.search-result-title {
  font-size: 0.88em;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-3);
}

/* ===== Section Block (like LC home sections) ===== */
.section-block { margin-bottom: 24px; }
.section-block-head { margin-bottom: 12px; }
.section-block-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}
.section-block-desc {
  font-size: 0.82em;
  color: var(--text-3);
}

/* ===== Track Grid (matches WhatsApp Communities cards exactly) ===== */
.track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
  position: relative;
  box-shadow: var(--shadow-1);
}
.track-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-2);
}
.track-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05em;
}
.track-icon-blue { background: var(--c-blue-bg); }
.track-icon-orange { background: var(--c-orange-bg); }
.track-icon-green { background: var(--c-green-bg); }
.track-icon-purple { background: var(--c-purple-bg); }
.track-icon-yellow { background: var(--c-yellow-bg); }
.track-icon-pink { background: var(--c-pink-bg); }
.track-card-body { flex: 1; }
.track-card-title {
  font-weight: 600;
  font-size: 0.92em;
  margin-bottom: 4px;
}
.track-card-title .si { font-size: 1em; font-weight: 600; }
.track-card-title .en { font-size: 0.78em; font-style: normal; color: var(--text-3); }
.track-card-meta {
  font-size: 0.75em;
  color: var(--text-3);
}
.track-card-arrow {
  position: absolute;
  top: 14px;
  left: 12px;
  color: var(--link-green);
  display: flex;
  align-items: center;
}

/* ===== Lesson Card (like LC marketplace listing) ===== */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  box-shadow: var(--shadow-1);
}
.lesson-card:active {
  transform: scale(0.98);
  background: var(--bg-soft);
}
.lesson-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.lesson-thumb-num {
  font-size: 1.4em;
  font-weight: 700;
  color: white;
}
.lesson-thumb-blue { background: linear-gradient(135deg, #2E5C70, #1B3A4B); }
.lesson-thumb-orange { background: linear-gradient(135deg, #D08F4F, #B86D2F); }
.lesson-thumb-green { background: linear-gradient(135deg, #5A8B5A, #3F6B3F); }
.lesson-thumb-purple { background: linear-gradient(135deg, #8E6BAB, #6E4F8E); }
.lesson-thumb-yellow { background: linear-gradient(135deg, #D4A431, #B8860B); }
.lesson-thumb-pink { background: linear-gradient(135deg, #C97283, #B85268); }
.lesson-card-body { flex: 1; min-width: 0; }
.lesson-card-track {
  font-size: 0.7em;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.lesson-card-title {
  font-size: 0.92em;
  line-height: 1.35;
  font-weight: 500;
}
.lesson-card-title .si { font-size: 1em; font-weight: 500; }
.lesson-card-title .en { font-size: 0.78em; color: var(--text-3); margin-top: 1px; font-style: normal; }
.lesson-arrow {
  color: var(--text-3);
  flex-shrink: 0;
}

/* ===== Emergency Card ===== */
.emergency-card {
  background: var(--c-pink-bg);
  border: 1px solid #ECBDC4;
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  gap: 12px;
}
.emergency-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--c-pink);
  color: white;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.emergency-body { flex: 1; }
.emergency-title {
  font-weight: 700;
  font-size: 0.95em;
  color: var(--c-pink);
  margin-bottom: 8px;
}
.emergency-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.emergency-item {
  font-size: 0.85em;
  color: var(--text-1);
}
.emergency-item strong {
  color: var(--c-pink);
  font-weight: 700;
  font-family: var(--font);
}

/* ===== Day Page (single lesson) ===== */
.day-page, .track-page { display: none; }
.day-page.active, .track-page.active, .home-page.active { display: block; animation: fadeIn 0.25s ease-out; }
.home-page { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Track page hero */
.track-hero {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
}
.track-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  flex-shrink: 0;
}
.track-hero-title {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 2px;
}
.track-hero-title .si { font-size: 1em; }
.track-hero-title .en { font-size: 0.78em; color: var(--text-3); font-style: normal; }
.track-hero-meta {
  font-size: 0.82em;
  color: var(--text-3);
}

/* Day hero */
.day-hero {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
}
.day-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  font-size: 0.72em;
  font-weight: 600;
}
.day-pill .en-i { font-style: normal; color: inherit; opacity: 0.85; }
.day-pill-icon { font-size: 1.1em; }
.day-pill-blue { background: var(--c-blue-bg); color: var(--c-blue); }
.day-pill-orange { background: var(--c-orange-bg); color: var(--c-orange); }
.day-pill-green { background: var(--c-green-bg); color: var(--c-green); }
.day-pill-purple { background: var(--c-purple-bg); color: var(--c-purple); }
.day-pill-yellow { background: var(--c-yellow-bg); color: var(--c-yellow); }
.day-pill-pink { background: var(--c-pink-bg); color: var(--c-pink); }
.day-num-tag {
  font-size: 0.78em;
  color: var(--text-3);
  font-weight: 600;
}
.day-num-tag .en-i { color: var(--text-3); }
.day-title {
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.35;
}
.day-title .si { font-size: 1em; font-weight: 700; }
.day-title .en { font-size: 0.78em; font-weight: 500; color: var(--text-3); margin-top: 3px; font-style: normal; }

/* ===== Generic Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  flex-shrink: 0;
}
.icon-blue { background: var(--c-blue-bg); color: var(--c-blue); }
.icon-orange { background: var(--c-orange-bg); color: var(--c-orange); }
.icon-green { background: var(--c-green-bg); color: var(--c-green); }
.icon-purple { background: var(--c-purple-bg); color: var(--c-purple); }
.icon-yellow { background: var(--c-yellow-bg); color: var(--c-yellow); }
.icon-pink { background: var(--c-pink-bg); color: var(--c-pink); }
.card-head-title {
  font-size: 0.95em;
  font-weight: 700;
  flex: 1;
}
.card-head-title .en-i { color: var(--text-3); font-style: normal; font-size: 0.82em; font-weight: 500; }

/* ===== Objectives ===== */
.objectives {
  list-style: none;
  padding: 0;
}
.objectives li {
  padding: 8px 0 8px 22px;
  position: relative;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 0.88em;
}
.objectives li:last-child { border-bottom: none; padding-bottom: 0; }
.objectives li:first-child { padding-top: 0; }
.objectives li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 8px;
  color: var(--c-green);
  font-weight: 700;
}
.objectives li:first-child::before { top: 0; }
.objectives .si { font-size: 1em; }
.objectives .en { font-size: 0.85em; }

/* ===== Words / Vocabulary ===== */
.word-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.word-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.word-row:first-child { padding-top: 0; }
.word-row:last-child { border-bottom: none; padding-bottom: 0; }
.word-row .img-wrap.img-sm {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}
.word-body { flex: 1; min-width: 0; }
.word-top {
  margin-bottom: 4px;
}
.word-heb-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1px;
}
.word-heb {
  direction: rtl;
  font-family: var(--font-heb);
  font-size: 1.2em;
  font-weight: 700;
  color: var(--brand-blue);
  line-height: 1.2;
}
.word-lat {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 0.78em;
  color: var(--text-3);
  letter-spacing: 0.2px;
}
.word-mean {
  font-size: 0.88em;
  margin-top: 4px;
}
.word-mean .si { font-size: 1em; }
.word-mean .en { font-size: 0.85em; }
.word-usage {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-soft);
  font-size: 0.8em;
}
.word-usage .si { color: var(--text-2); }

/* ===== Phrases ===== */
.phrase-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.phrase-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.phrase-row:first-child { padding-top: 0; }
.phrase-row:last-child { border-bottom: none; padding-bottom: 0; }
.phrase-heb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.phrase-heb {
  direction: rtl;
  font-family: var(--font-heb);
  font-size: 1.1em;
  font-weight: 700;
  color: var(--brand-blue);
  flex: 1;
  text-align: right;
  line-height: 1.4;
}
.phrase-lat {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 0.78em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.phrase-mean { font-size: 0.86em; }

/* ===== Audio Button (small, inline) ===== */
.audio-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: none;
  background: var(--cta-grad);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(184, 109, 47, 0.4);
  transition: all 0.15s;
}
.audio-btn:active { background: var(--cta-grad-active); transform: scale(0.92); }
.audio-btn:hover { background: var(--cta-grad-h); }
.audio-btn.playing {
  background: linear-gradient(135deg, #B85268, #8E3A4D);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(184, 82, 104, 0.5); }
  50% { box-shadow: 0 1px 3px rgba(184, 82, 104, 0.5), 0 0 0 6px rgba(184, 82, 104, 0.15); }
}

/* ===== Image placeholders ===== */
.img-wrap {
  position: relative;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.img-sm { aspect-ratio: 1; }
.img-wide { aspect-ratio: 16/9; }
.img-lg { aspect-ratio: 4/3; }
.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-ph {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(135deg, var(--c-blue-bg), var(--bg-soft));
  padding: 6px;
}
.img-emo { font-size: 1.5em; }
.img-heb {
  direction: rtl;
  font-family: var(--font-heb);
  font-weight: 700;
  font-size: 0.85em;
  color: var(--brand-blue);
  text-align: center;
}

/* ===== Dialog (chat bubble style) ===== */
.dialog { display: block; }
.dialog-img { margin-bottom: 12px; }
.dialog-context {
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  border-right: 3px solid var(--c-green);
}
.ctx-icon { font-size: 1em; flex-shrink: 0; }
.ctx-text { flex: 1; font-size: 0.85em; }
.ctx-text .si { font-style: italic; color: var(--text-2); }
.ctx-text .en { font-style: italic; color: var(--text-3); }
.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
.msg-r { align-self: flex-end; align-items: flex-end; }
.msg-l { align-self: flex-start; align-items: flex-start; }
.msg-spk {
  font-size: 0.7em;
  font-weight: 600;
  margin-bottom: 3px;
  padding: 0 4px;
  color: var(--text-3);
}
.msg-spk .si { font-size: 1em; display: inline; }
.msg-spk .en { display: inline; font-size: 0.85em; margin-right: 3px; font-style: normal; }
.msg-r .msg-spk { color: var(--c-blue); }
.msg-l .msg-spk { color: var(--c-pink); }
.msg-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  min-width: 180px;
  background: white;
  border: 1px solid var(--border-soft);
}
.msg-r .msg-bubble {
  background: #E1F2DB;
  border-color: #C9E2BF;
  border-bottom-left-radius: 4px;
}
.msg-l .msg-bubble {
  border-bottom-right-radius: 4px;
}
.msg-heb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.msg-heb {
  direction: rtl;
  font-family: var(--font-heb);
  font-size: 1.05em;
  font-weight: 700;
  color: var(--brand-blue);
  flex: 1;
  text-align: right;
  line-height: 1.4;
}
.msg-lat {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 0.74em;
  color: var(--text-3);
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.msg-mean { font-size: 0.84em; }
.msg-mean .si { font-size: 1em; line-height: 1.4; }
.msg-mean .en { font-size: 0.85em; }

/* ===== CTA Button (matching "Add to favorites" exactly) ===== */
.cta-btn {
  background: var(--cta-grad);
  color: white;
  border: none;
  padding: 13px 18px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(184, 109, 47, 0.25);
  transition: all 0.15s;
  min-height: var(--tap);
}
.cta-btn:hover { background: var(--cta-grad-h); }
.cta-btn:active { background: var(--cta-grad-active); transform: scale(0.98); }
.cta-secondary {
  background: var(--bg-soft);
  color: var(--text-1);
  box-shadow: none;
  border: 1px solid var(--border);
  font-weight: 600;
}
.cta-secondary:hover { background: var(--bg-card); }
.cta-secondary svg { color: var(--c-orange); }
.play-all-btn { margin-bottom: 0; }
.play-all-btn.playing {
  background: linear-gradient(135deg, #B85268, #8E3A4D);
  color: white;
}
.play-all-btn.playing svg { color: white; }

/* ===== Info Cards ===== */
.info-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
}
.info-grammar { background: var(--c-blue-bg); }
.info-pron { background: var(--c-pink-bg); }
.info-culture { background: var(--c-yellow-bg); }
.info-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  flex-shrink: 0;
}
.info-body { flex: 1; min-width: 0; }
.info-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.9em;
}
.info-list {
  list-style: none;
  padding: 0;
}
.info-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.85em;
}
.info-list li:last-child { border-bottom: none; padding-bottom: 0; }
.info-list li:first-child { padding-top: 0; }
.info-list .si { font-size: 1em; }
.info-list .en { font-size: 0.85em; }

/* ===== Exercises ===== */
.ex-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ex-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ex-row:first-child { padding-top: 0; }
.ex-row:last-child { border-bottom: none; padding-bottom: 0; }
.ex-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cta-grad);
  color: white;
  font-weight: 700;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(184, 109, 47, 0.3);
}
.ex-body { flex: 1; min-width: 0; }
.ex-type { font-weight: 700; margin-bottom: 3px; font-size: 0.92em; }
.ex-instr {
  font-size: 0.82em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.ex-items {
  list-style: none;
  padding: 0;
}
.ex-items li {
  padding: 5px 16px 5px 0;
  font-size: 0.85em;
  position: relative;
}
.ex-items li::before {
  content: '▸';
  position: absolute;
  right: 0;
  top: 5px;
  color: var(--brand-orange);
  font-weight: 700;
}
.ex-items .si { font-size: 1em; }
.ex-items .en { font-size: 0.85em; }

/* ===== Quiz ===== */
.quiz {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qcard {
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
}
.qnum {
  font-size: 0.7em;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.qtext {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.92em;
  line-height: 1.4;
}
.qtext .si { font-size: 1em; }
.qtext .en { font-size: 0.85em; font-weight: 500; color: var(--text-3); }
.qopts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qopt {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1.5px solid var(--border-soft);
  transition: all 0.15s;
  min-height: 42px;
}
.qopt:hover { border-color: var(--c-orange); }
.qopt input { display: none; }
.qopt-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.qopt input:checked + .qopt-radio {
  border-color: var(--c-orange);
  background: var(--c-orange);
}
.qopt input:checked + .qopt-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: white;
  border-radius: 50%;
}
.qopt-text { flex: 1; font-size: 0.88em; }
.qopt-text .en-i { color: var(--text-3); margin-right: 3px; }
.qopt.correct {
  background: #E5F0DC;
  border-color: var(--c-green);
}
.qopt.correct .qopt-radio { border-color: var(--c-green); background: var(--c-green); }
.qopt.incorrect {
  background: #F5DDE0;
  border-color: var(--c-pink);
}
.qopt.incorrect .qopt-radio { border-color: var(--c-pink); background: var(--c-pink); }

.qfb {
  margin-top: 8px;
  font-size: 0.82em;
  font-weight: 600;
  display: none;
}
.qfb.show { display: block; }
.qfb.correct { color: var(--c-green); }
.qfb.incorrect { color: var(--c-pink); }

.quiz-check { margin-top: 4px; }

.qresult {
  display: none;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  text-align: center;
  font-size: 0.92em;
}
.qresult.show { display: block; }
.qresult.pass { background: #E5F0DC; color: var(--c-green); border: 1px solid var(--c-green); }
.qresult.fail { background: #F5DDE0; color: var(--c-pink); border: 1px solid var(--c-pink); }

/* ===== Tomorrow ===== */
.tomorrow {
  background: linear-gradient(135deg, var(--c-green-bg), var(--bg-soft));
  border: 1px dashed var(--c-green);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.tomorrow-icon {
  font-size: 1.4em;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}
.tomorrow-body { flex: 1; }
.tomorrow-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--c-green);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.tomorrow-text { font-size: 0.86em; }
.tomorrow-text .si { font-size: 1em; }
.tomorrow-text .en { font-size: 0.85em; }

/* ===== Day Navigation (prev/home/next) ===== */
.day-nav {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 14px;
}
.day-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: white;
  color: var(--text-1);
  text-decoration: none;
  padding: 10px 8px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.8em;
  border: 1px solid var(--border-soft);
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
  min-height: var(--tap);
}
.day-nav-btn:hover { background: var(--bg-soft); border-color: var(--c-orange); }
.day-nav-btn:active { transform: scale(0.97); }
.day-nav-home { background: var(--cta-grad); color: white; border-color: transparent; }
.day-nav-home:hover { background: var(--cta-grad-h); color: white; border-color: transparent; }
.day-nav-home svg { color: white; }

/* Small phones: single-column tracks, stack matching exercises */
@media (max-width: 479px) {
  .track-grid { grid-template-columns: 1fr; }
  .ex-match { grid-template-columns: 1fr; gap: 12px; }
  .ex-fillblank-row { flex-direction: column; }
  .ex-check-btn { width: 100%; }
  .word-row { flex-wrap: wrap; gap: 10px; }
  .word-heb-area { flex-wrap: wrap; }
}

/* Phablet / small tablet */
@media (min-width: 480px) {
  .lc-container {
    max-width: min(100%, 520px);
    padding-inline: 20px;
  }
}

/* Larger screens */
@media (min-width: 600px) {
  .lc-container {
    max-width: min(100% - 32px, 560px);
    box-shadow: 0 0 24px rgba(0,0,0,0.06);
    padding: 20px 20px 100px;
    border-radius: var(--r-lg);
  }
  body { background: #EDE5D5; }
  .track-grid { gap: 12px; }
}
@media (min-width: 900px) {
  body { padding: 0; }
}

section { scroll-margin-top: 16px; }

/* ===== Interactive Exercise Engine v2 (drag&drop, inputs, multiple choice) ===== */

/* Remove old hover and arrow on items that became interactive */
.ex-items.engine-active {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ex-items.engine-active li {
  cursor: default;
  padding: 0;
  margin: 0;
}
.ex-items.engine-active li::before { content: '' !important; }

/* Container for built exercise UI */
.ex-interactive {
  margin: 8px 0;
}
.ex-interactive .ex-prompt {
  font-size: 0.95em;
  color: #555;
  margin-bottom: 8px;
  display: block;
}

/* ===== Fill-in-the-blank / Translate / Complete Dialog ===== */
.ex-fillblank {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(208, 143, 79, 0.05);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(208, 143, 79, 0.15);
}
.ex-fillblank-prompt {
  font-size: 1em;
  color: #1B3A4B;
  line-height: 1.4;
  direction: rtl;
  text-align: right;
}
.ex-fillblank-prompt .blank-mark {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px solid #C97B3B;
  margin: 0 4px;
  color: #C97B3B;
  font-weight: 600;
}
.ex-fillblank-prompt-si {
  font-size: 0.85em;
  color: #666;
  margin-top: 4px;
  direction: ltr;
  text-align: left;
  display: block;
}
.ex-fillblank-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.ex-input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
  direction: rtl;
  text-align: right;
}
.ex-input:focus {
  outline: none;
  border-color: #C97B3B;
}
.ex-input.correct {
  border-color: #2F7A4F;
  background: rgba(47, 122, 79, 0.05);
}
.ex-input.incorrect {
  border-color: #C95450;
  background: rgba(201, 84, 80, 0.05);
}
.ex-check-btn {
  padding: 8px 16px;
  background: #1B3A4B;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s, transform 0.1s;
}
.ex-check-btn:hover { background: #2A4A5C; }
.ex-check-btn:active { transform: scale(0.95); }
.ex-check-btn.ok { background: #2F7A4F; }
.ex-check-btn.no { background: #C95450; }
.ex-feedback {
  font-size: 0.85em;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
}
.ex-feedback.show { display: block; }
.ex-feedback.pass {
  background: rgba(47, 122, 79, 0.12);
  color: #1F5A37;
}
.ex-feedback.fail {
  background: rgba(201, 84, 80, 0.12);
  color: #8B3B38;
}
.ex-feedback .correct-answer {
  font-weight: 700;
  color: #2F7A4F;
  margin-left: 4px;
}

/* ===== Listen & Choose / Multiple Choice ===== */
.ex-choice {
  padding: 12px;
  background: rgba(27, 58, 75, 0.04);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(27, 58, 75, 0.1);
}
.ex-choice-prompt {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 8px;
}
.ex-choice-prompt-he {
  display: inline-block;
  background: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  color: #1B3A4B;
  margin: 0 4px;
  direction: rtl;
}
.ex-choices-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ex-choice-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 14px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  direction: rtl;
  color: #1B3A4B;
  transition: all 0.2s;
}
.ex-choice-btn:hover {
  border-color: #C97B3B;
  background: rgba(208, 143, 79, 0.05);
}
.ex-choice-btn:active { transform: scale(0.97); }
.ex-choice-btn.correct {
  border-color: #2F7A4F;
  background: rgba(47, 122, 79, 0.15);
  color: #1F5A37;
}
.ex-choice-btn.incorrect {
  border-color: #C95450;
  background: rgba(201, 84, 80, 0.15);
  color: #8B3B38;
}
.ex-choice-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ===== Matching (drag and drop / tap to pair) ===== */
.ex-match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 12px;
  background: rgba(110, 79, 142, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(110, 79, 142, 0.12);
  margin-bottom: 8px;
}
.ex-match-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ex-match-col-title {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 2px;
  font-weight: 600;
  text-align: center;
}
.ex-match-item {
  padding: 8px 10px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  text-align: center;
  user-select: none;
  transition: all 0.2s;
  position: relative;
}
.ex-match-item:hover {
  border-color: #6E4F8E;
  background: rgba(110, 79, 142, 0.04);
}
.ex-match-item.selected {
  border-color: #6E4F8E;
  background: rgba(110, 79, 142, 0.12);
  box-shadow: 0 0 0 3px rgba(110, 79, 142, 0.15);
}
.ex-match-item.matched {
  border-color: #2F7A4F;
  background: rgba(47, 122, 79, 0.1);
  color: #1F5A37;
  cursor: default;
  pointer-events: none;
}
.ex-match-item.matched::after {
  content: attr(data-match-num);
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2F7A4F;
  color: white;
  font-size: 0.75em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex-match-status {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 8px;
  font-size: 0.85em;
  color: #666;
}
.ex-match-status.complete {
  color: #1F5A37;
  font-weight: 600;
}
.ex-match-reset {
  margin-top: 8px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8em;
  cursor: pointer;
  color: #666;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}
.ex-match-reset:hover { background: rgba(0,0,0,0.04); }

/* ===== Open scenario / pronunciation / discussion ===== */
.ex-open {
  padding: 10px 12px;
  background: rgba(255, 248, 232, 0.7);
  border-left: 3px solid #C97B3B;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.9em;
}
.ex-open-icon {
  display: inline-block;
  margin-right: 6px;
}

/* Score badge on exercise */
.ex-score {
  display: none;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(47,122,79,0.1), rgba(47,122,79,0.02));
  border-radius: 8px;
  font-weight: 600;
  color: #1F5A37;
}
.ex-score.show { display: block; }


/* ===== Latin-first display (Hebrew same size, secondary color) ===== */
/* Latin is primary: brand-blue, bold.
   Hebrew is same size but lighter weight and muted grey color. */

.word-heb {
  direction: rtl !important;
  font-family: var(--font-heb) !important;
  font-size: 1.35em !important;
  font-weight: 400 !important;
  color: #999 !important;
  opacity: 1;
  letter-spacing: 0 !important;
  order: 2;
}
.word-lat {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 1.35em !important;
  font-weight: 700 !important;
  color: var(--brand-blue, #1B3A4B) !important;
  letter-spacing: 0.3px !important;
  margin-bottom: 2px;
  order: 1;
}
.word-heb-area {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 2px !important;
}
/* Dialog/message lines */
.msg-heb {
  direction: rtl !important;
  font-family: var(--font-heb) !important;
  font-size: 1.05em !important;
  font-weight: 400 !important;
  color: #999 !important;
  opacity: 1;
  order: 2;
}
.msg-lat {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 1.05em !important;
  font-weight: 700 !important;
  color: var(--brand-blue, #1B3A4B) !important;
  letter-spacing: 0.3px !important;
  order: 1;
  margin-bottom: 2px !important;
}
.msg-heb-row {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1px !important;
}
/* Phrase blocks */
.phrase-heb {
  direction: rtl !important;
  font-family: var(--font-heb) !important;
  font-size: 1.15em !important;
  font-weight: 400 !important;
  color: #999 !important;
  opacity: 1;
  order: 2;
}
.phrase-lat {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 1.15em !important;
  font-weight: 700 !important;
  color: var(--brand-blue, #1B3A4B) !important;
  letter-spacing: 0.3px !important;
  order: 1;
  margin-bottom: 2px !important;
}
.phrase-heb-row {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1px !important;
}
/* Image placeholder Hebrew label - keep matching */
.img-heb {
  font-size: 0.9em !important;
  opacity: 0.85;
  color: #999;
}

/* Hebrew chunks inserted into exercise/quiz text — equal-size, secondary color */
.heb-with-lat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 4px;
  vertical-align: middle;
  line-height: 1.15;
}
.heb-with-lat .lat {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1em;
  font-weight: 700;
  color: #1B3A4B;
  letter-spacing: 0.3px;
}
.heb-with-lat .heb {
  direction: rtl;
  font-family: var(--font-heb);
  font-size: 1em;
  font-weight: 400;
  color: #999;
  opacity: 1;
  margin-top: 0;
}


/* ===== Sticky Lesson Header (top of every day page) ===== */
.lesson-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 243, 0.97);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: -10px -10px 12px -10px;  /* extend to container edges */
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  min-height: 44px;
}
.lesson-sticky-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--brand-blue, #1B3A4B);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  min-height: 36px;
}
.lesson-sticky-back:hover {
  background: var(--bg-soft, #F4F0EB);
  border-color: var(--c-orange, #C97B3B);
}
.lesson-sticky-back:active { transform: scale(0.96); }
.lesson-sticky-back svg {
  flex-shrink: 0;
  color: var(--c-orange, #C97B3B);
}
.lesson-sticky-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
}
.lesson-sticky-info-top {
  font-size: 0.72em;
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-sticky-info-title {
  font-size: 0.88em;
  color: var(--brand-blue, #1B3A4B);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Small screens: shorten back button to just icon + "Home" */
@media (max-width: 380px) {
  .lesson-sticky-back-label-full { display: none; }
}
@media (min-width: 381px) {
  .lesson-sticky-back-label-short { display: none; }
}
/* Larger screens: a bit more padding */
@media (min-width: 600px) {
  .lesson-sticky-header { padding: 10px 14px; }
  .lesson-sticky-info-title { font-size: 1em; }
  .lesson-sticky-info-top { font-size: 0.78em; }
}

/* Make sure day-pages have positioning context */
.day-page.active { position: relative; }

/* Adjust day-hero top spacing now that we have a sticky header above */
.day-page .day-hero { margin-top: 4px; }


/* ===== LankaConnect Top App Bar (removed from HTML; keep hidden if re-added) ===== */
.lc-topbar {
  display: none !important;
}
.lc-topbar--legacy {
  position: sticky;
  top: 0;
  z-index: 200;
  background: white;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  width: 100%;
}
.lc-topbar-logo {
  flex: 1;
  max-width: 230px;
  min-width: 0;
  display: flex;
  align-items: center;
}
.lc-topbar-logo img {
  width: 100%;
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.lc-topbar-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cta-grad, linear-gradient(135deg, #D08F4F 0%, #C9763A 50%, #B86D2F 100%));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 9px 14px 9px 12px;
  font-family: inherit;
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 38px;
  box-shadow: 0 2px 6px rgba(208, 143, 79, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.lc-topbar-back:hover {
  opacity: 0.95;
  box-shadow: 0 3px 10px rgba(208, 143, 79, 0.4);
}
.lc-topbar-back:active { transform: scale(0.96); }
.lc-topbar-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/* Small screens: shorter button label */
@media (max-width: 380px) {
  .lc-topbar-back-label-full { display: none; }
  .lc-topbar-back { padding: 9px 12px 9px 10px; }
}
@media (min-width: 381px) {
  .lc-topbar-back-label-short { display: none; }
}
@media (min-width: 600px) {
  .lc-topbar { padding: 14px 18px; min-height: 64px; }
  .lc-topbar-logo { max-width: 280px; }
  .lc-topbar-logo img { max-height: 48px; }
  .lc-topbar-back { font-size: 0.9em; padding: 11px 18px 11px 14px; }
}
/* Ensure the topbar sits ABOVE lesson sticky headers (they have z-index 100) */

/* ===== Desktop Responsive Enhancements =====
   Mobile layout is preserved. These rules expand the course gracefully on tablets/desktops. */
@media (min-width: 768px) {
  body {
    background: linear-gradient(180deg, #EDE5D5 0%, #FAF6F3 100%);
  }

  .lc-topbar {
    padding-inline: clamp(18px, 4vw, 48px);
  }

  .lc-topbar-logo {
    max-width: 300px;
  }

  .lc-container {
    max-width: min(100% - 48px, 760px);
    padding: 24px 24px 110px;
    border-radius: 0 0 24px 24px;
  }

  .course-hero {
    padding: 28px 30px;
  }

  .course-hero-title {
    font-size: 1.75em;
  }

  .track-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-page.active #mainContent.course-main {
    display: block;
  }

  .lesson-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .lesson-card {
    min-height: 92px;
  }

  .word-row .img-wrap.img-sm {
    width: 72px;
    height: 72px;
  }

  .video-frame,
  .card,
  .course-hero,
  .track-hero,
  .day-hero {
    box-shadow: var(--shadow-2);
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 16px;
  }

  .lc-topbar {
    max-width: none;
    padding: 16px max(48px, calc((100vw - 1180px) / 2));
  }

  .lc-container {
    max-width: min(100% - 64px, 1180px);
    padding: 32px;
    margin: 24px auto 48px;
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(27, 58, 75, 0.10);
  }

  .home-page.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .home-page.active > .course-hero,
  .home-page.active > .video-frame,
  .home-page.active > .search-wrap,
  .home-page.active > .search-results {
    width: 100%;
  }

  .home-page.active #mainContent.course-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
  }

  .home-page.active #mainContent.course-main > .section-block {
    width: 100%;
    margin-bottom: 0;
  }

  .home-page.active #mainContent.course-main > .section-block:first-of-type {
    order: 1;
  }

  .home-page.active #mainContent.course-main > .section-block:last-of-type {
    order: 2;
  }

  .course-stats {
    max-width: 720px;
  }

  .track-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .track-card {
    min-height: 128px;
    padding: 18px 16px;
  }

  .track-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25em;
  }

  .lesson-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .track-page.active,
  .day-page.active {
    max-width: 980px;
    margin: 0 auto;
  }

  .day-page.active .card,
  .day-page.active .day-hero,
  .day-page.active .tomorrow,
  .day-page.active .day-nav,
  .day-page.active .lesson-sticky-header {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
  }

  .day-hero {
    padding: 22px 24px;
  }

  .day-title {
    font-size: 1.35em;
  }

  .card {
    padding: 20px;
  }

  .word-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }

  .word-row:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }

  .phrase-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }

  .chat {
    max-width: 820px;
    margin-inline: auto;
  }

  .msg {
    max-width: 70%;
  }

  .ex-match {
    max-width: 760px;
    margin-inline: auto;
  }
}

@media (min-width: 1280px) {
  .lc-container {
    max-width: 1240px;
  }

  .home-page.active #mainContent.course-main {
    gap: 32px;
  }

  .lesson-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .track-page.active .lesson-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .track-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Wide desktop: optional side-by-side hero + welcome video */
@media (min-width: 1100px) {
  .home-page.active > .course-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
  }
  .home-page.active > .course-hero .course-stats {
    grid-column: 1 / -1;
  }
}

@media (hover: hover) and (pointer: fine) {
  .track-card:hover,
  .lesson-card:hover,
  .day-nav-btn:hover,
  .qopt:hover,
  .ex-match-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
  }
}
